XDisplay.h
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef __XDisplay_h__
#define __XDisplay_h__
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
class XDisplay {
private:
//alles zum Display und screen
Display* display;
int screen_num;
int argc;
char** argv;
unsigned int display_width;
unsigned int display_height;
char* display_name;
XFontStruct* font_info;
XEvent report;
Colormap default_cm;
public:
//Konstruktoren und Destruktoren
/* Displayname=NULL -> Wert der DISPLAY env-var nutzen */
XDisplay(int argc, char** argv, char* name=NULL);
~XDisplay();
//Inline Funktionen
unsigned int getWidth(void) { return display_width; }
unsigned int getHeight(void) { return display_height; }
XFontStruct* getFont(void) { return font_info; }
Display* getDisplay(void) { return display; }
int getScreen(void) { return screen_num; }
Colormap getDefaultCm(void) { return default_cm; }
int getArgc(void) { return argc; }
char** getArgv(void) { return argv; }
// weitere Funktionen
unsigned long getColor(unsigned short, unsigned short, unsigned short);
void loadFont(char* name="9x15");
Window getRootWindow(void);
unsigned long getBlackPixel(void);
unsigned long getWhitePixel(void);
};
#endif /*__XDisplay_h__*/