// -------------------------------------------------------- // // Primitive X11R6 Windows class (Revision 2.0) // // -------------------------------------------------------- #ifndef __WINDOW_H #define __WINDOW_H #include "defs.h" class window { Display *display; int screen; Window win; UINT width, height; GC gc; XGCValues gc_val; XEvent report; Pixmap icon_pixmap; void open (int, int); void close (); Button event_handler (Pstate, UINT, UINT, UINT&, UINT&); public: window (int w=DEF_WIDTH, int h=DEF_HEIGHT) { width=w; height=h; open (w,h); } ~window () { close (); } Button readMouse (UINT& x, UINT& y) { return event_handler(off,0,0,x,y); } Button readMouse (UINT x1, UINT y1, UINT& x2, UINT& y2) { return event_handler(on,x1,y1,x2,y2); } void drawLine (UINT x1, UINT y1, UINT x2, UINT y2) { XDrawLine(display,win,gc,x1,y1,x2,y2); XFlush(display); } }; // -------------------------------------------------------- #endif