#ifndef XUTIL
#define XUTIL
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/IntrinsicP.h>
#include <X11/xpm.h>
#include <stdio.h>

struct	XpmIcon {
	Pixmap		pixmap, mask;
	XpmAttributes	xpmattributes;
};

class xutil {
	public:
		Display			*display;
		GC			clearoutgc;
		Window			mainwin;
		Pixmap			nomail, def;

			xutil(int argc, char **argv);
			~xutil();
		void	AddTimeOut(XtTimerCallbackProc proc, int interval,
					XtPointer pointer);
		void	AddEventHandler(XtEventHandler proc, EventMask mask);
		void	CreatePixmap(Pixmap *pixmap, int height, int width);
		void	Border();
		Pixel	GetColor(char *colorname);
		void	LoadPixmapOntoPixmap(Pixmap *pixmap, char *filename, 
				int width, int height);
		void	DrawNumbers(int numbers, Pixmap pixmap);
		void	MainLoop();
	private:
		XtAppContext		application;
		Widget			mainwidget;
		Window			root;
		int			screennum;
		GC			topbordergc, bottombordergc;
		GC			lettergc;
		XColor			color;
		XFontStruct		*font;
};

#endif
