1 /* 2 * The Rubik's cube. 3 * 4 * Sed - december 2003. 5 * 6 * This program is in the public domain. 7 *-------------------- 8 * The screen stuff, ie X. 9 */ 10 11 #ifndef _SCREEN_H_ 12 #define _SCREEN_H_ 13 14 #include <X11/Xlib.h> 15 #include <X11/Xutil.h> 16 17 typedef struct { 18 char *buffer; //[SCREEN_X*SCREEN_Y]; 19 Display *d; 20 Window w; 21 Window h; 22 XFontStruct *font; 23 GC gc; 24 Colormap cm; 25 XImage *im; 26 int pause; 27 int control; 28 int depth; 29 } SCREEN; 30 31 #include "cube.h" 32 33 int init_screen(SCREEN *); 34 int screen_event(SCREEN *, CUBE *); 35 void close_screen(SCREEN *); 36 void clear_screen(SCREEN *); 37 void put_screen(CUBE *, SCREEN *); 38 void show_text(SCREEN *, int); 39 void place_mouse(SCREEN *); 40 void grab_pointer(SCREEN *, int); 41 void set_cube_size(); 42 void realize_colors(SCREEN *); 43 void display_clickwidget(SCREEN *); 44 45 struct timeval get_time(void); 46 47 #endif /* _SCREEN_H_ */ 48