#ifndef _WM_H_
#define _WM_H_

#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

#include <X11/X.h>
#include <X11/Xos.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>

#define LOGFILE "/home/zhouer/working/wm/log"

typedef struct wmScreen {
	int width, height;
	Window rootwindow;
	Colormap colormap;
	Cursor cursor;
	GC gc;
	XGCValues xgcvlues;
	unsigned long black, white;
} wmScreen;

typedef struct wmClient {
	int width, height;
	int border;
	Window window;
	Window parent;
	struct wmClient *next;
	wmScreen *screen;
} wmClient;

/* client.c */
extern int countClient();
extern wmClient *clients;
extern wmClient * findClient(Window);
extern wmClient * addClient(Window);

/* cursor.c */
extern void initcursor();

/* display.c */
extern Display *display;
extern void initdisplay();
extern void closedisplay();

/* event.c */
extern void initevent();

/* font.c */
extern XFontStruct *font;
extern void initfont();

/* screen.c */
extern int screencount;
extern wmScreen *screens;
extern void initscreen(int);
extern void initscreens();

/* util.c */
extern void wmlog(char *);

/* wm.c */
extern int loop;

#endif

