original 1.0.1 release
[xwelltris.git] / src / x11 / xwellengine.h
blobb18f6e9b7d40b20d9d0b8fcc07a3ead396eef916
1 #ifndef XWELLENGINE_H
2 #define XWELLENGINE_H
4 #include "globals.h"
5 #include "welltris.h"
7 #include "xheaders.h"
9 #include "wellengine.h"
10 #include "xwelldrawing.h"
11 #include "xwellimagefont.h"
13 extern Display *disp;
14 extern Colormap defcmp;
16 class XWellEngine:public WellEngine
18 protected:
19 int scr; //DefaultScreen of X display
20 int xcon; //X Connection file descriptor
21 Window mainw;
22 GC maingc;
23 XWMHints *pxwmh;
24 XSizeHints *pxsh;
25 XClassHint *pch;
26 XTextProperty wname;
27 XTextProperty iname;
28 Colormap colormap;
29 Atom wmDeleteWindow;
30 XEvent xev; // X Event we got from x-server
31 Pixmap image_pixmaps[MAX_IMAGES]; //X pixmaps of images
33 unsigned long whitepixel,blackpixel;
35 unsigned long game_colors[MAX_GAME_COLORS];
37 struct timeval nexttime,now;
40 virtual void init_mainwindow(int,char**);
41 virtual int wait_for_timers();
42 virtual void init_colors();
43 void correct_to_real_time(struct timeval& tv);
45 public:
46 XWellEngine(int argc,char** argv);
47 ~XWellEngine();
48 virtual void show_main();
49 virtual void event_loop();
51 virtual WellDrawingEngine* new_well_drawing_engine();
52 virtual WellTopNine* new_well_top_nine();
53 virtual WellIntro* new_well_intro();
54 virtual WellKey* new_well_key(char*);
55 virtual WellSwitch* new_well_switch(char*);
56 virtual WellInput* new_well_input(char*);
57 virtual WellImageFont* new_well_image_font(Images id,
58 unsigned int ifl,
59 unsigned int ifh,
60 int idx, int idy);
61 virtual WellBase* new_well_base();
63 Window get_main_window() {return mainw;};
64 GC get_main_gc() {return maingc;};
65 Pixmap get_pixmap_of_image(Images id) { return image_pixmaps[id];};
66 unsigned long* get_colors() { return game_colors; };
67 virtual bool load_image(Images id, char* name);
68 virtual void set_main_background_image(Images id);
69 virtual void screen_copy(Geo*);
70 virtual void screen_clear(Geo*);
71 virtual void udelay(int msec);
74 #endif