YggdrasilWM  0.1.1
A tiny window manager coded in C++
baseX11Wrapper.hpp
Go to the documentation of this file.
1 
28 #ifndef BASE_X11_WRAPPER_HPP
29 #define BASE_X11_WRAPPER_HPP
30 extern "C" {
31 #include <X11/Xlib.h>
32 #include <X11/Xatom.h>
33 };
34 #include <memory>
35 #include <string>
36 
38 public:
39  virtual ~BaseX11Wrapper() = default;
40  virtual Display * openDisplay() = 0;
41  virtual Display * openDisplay(const char * display_name) = 0;
42  virtual void closeDisplay(Display * display) = 0;
43  virtual int defaultScreen(Display * display) = 0;
44  virtual Window rootWindow(Display * display, int screen) = 0;
45  virtual Atom internAtom(Display * display, const char * atomName, bool onlyIfExists) = 0;
46  virtual int displayWidth(Display * display, int screen) = 0;
47  virtual int displayHeight(Display * display, int screen) = 0;
48  virtual int grabServer(Display * display) = 0;
49  virtual int ungrabServer(Display * display) = 0;
50  virtual int flush(Display * display) = 0;
51  virtual XErrorHandler setErrorHandler(XErrorHandler handler) = 0;
52  virtual int selectInput(Display * display, Window window, long eventMask) = 0;
53  virtual int sync(Display * display, bool discard) = 0;
54  virtual int queryTree(Display * display, Window window, Window * rootReturn, Window * parentReturn, Window ** childrenReturn, unsigned int * nChildrenReturn) = 0;
55  virtual int freeX(void * data) = 0;
56  virtual int nextEvent(Display * display, XEvent * event_return) = 0;
57  virtual int sendEvent(Display * display, Window window, bool propagate, long eventMask, XEvent * event_send) = 0;
58  virtual int changeProperty(Display * display, Window window, Atom property, Atom type, int format, int mode, const unsigned char * data, int nelements) = 0;
59  virtual int getProperty(Display * display, Window window, Atom property, long long_offset, long long_length, bool delete_, Atom req_type, Atom * actual_type_return, int * actual_format_return, unsigned long * nitems_return, unsigned long * bytes_after_return, unsigned char ** prop_return) = 0;
60  virtual int setInputFocus(Display * display, Window focus, int revertTo, Time time) = 0;
61  virtual int getErrorText(Display * display, int code, char * buffer_return, int length) = 0;
62  virtual int mapWindow(Display * display, Window window) = 0;
63  virtual int unmapWindow(Display * display, Window window) = 0;
64  virtual int configureWindow(Display * display, Window window, unsigned valueMask, XWindowChanges * changes) = 0;
65  virtual int setInputFocus(Display * display, Window focus, int revertTo) = 0;
66  virtual int raiseWindow(Display * display, Window window) = 0;
67  virtual int lowerWindow(Display * display, Window window) = 0;
68  virtual int setWindowBorder(Display * display, Window window, unsigned long border) = 0;
69  virtual int getWindowProperty(Display * display, Window window, Atom property, long long_offset, long long_length, bool delete_, Atom req_type, Atom * actual_type_return, int * actual_format_return, unsigned long * nitems_return, unsigned long * bytes_after_return, unsigned char ** prop_return) = 0;
70  virtual int destroyWindow(Display * display, Window window) = 0;
71  virtual int getWindowAttributes(Display * display, Window window, XWindowAttributes * window_attributes_return) = 0;
72  virtual int addToSaveSet(Display * display, Window window) = 0;
73  virtual int removeFromSaveSet(Display * display, Window window) = 0;
74  virtual int reparentWindow(Display * display, Window window, Window parent, int x, int y) = 0;
75  virtual int grabButton(Display * display, unsigned int button, unsigned int modifiers, Window grab_window, bool owner_events, unsigned int event_mask, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor) = 0;
76  virtual int ungrabButton(Display * display, unsigned int button, unsigned int modifiers, Window grab_window) = 0;
77  virtual int grabKey(Display * display, int keycode, unsigned int modifiers, Window grab_window, bool owner_events, int pointer_mode, int keyboard_mode) = 0;
78  virtual int ungrabKey(Display * display, int keycode, unsigned int modifiers, Window grab_window) = 0;
79  virtual int moveWindow(Display * display, Window window, int x, int y) = 0;
80  virtual int resizeWindow(Display * display, Window window, unsigned int width, unsigned int height) = 0;
81  virtual int keysymToKeycode(Display * display, int keysym) = 0;
82  virtual KeySym stringToKeysym(const char * string) = 0;
83  virtual Window createWindow(Display * display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int _class, Visual * visual, unsigned long valuemask, XSetWindowAttributes * attributes) = 0;
84  virtual int clearWindow(Display * display, Window window) = 0;
85  virtual int drawString(Display * display, Window window, GC gc, int x, int y, const char * string, int length) = 0;
86  virtual Window createSimpleWindow(Display * display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, unsigned long border, unsigned long background) = 0;
87 
88 };
89 
90 #endif
Definition: baseX11Wrapper.hpp:37
virtual int ungrabKey(Display *display, int keycode, unsigned int modifiers, Window grab_window)=0
virtual int moveWindow(Display *display, Window window, int x, int y)=0
virtual int selectInput(Display *display, Window window, long eventMask)=0
virtual int reparentWindow(Display *display, Window window, Window parent, int x, int y)=0
virtual int ungrabServer(Display *display)=0
virtual Display * openDisplay()=0
virtual int clearWindow(Display *display, Window window)=0
virtual int sync(Display *display, bool discard)=0
virtual Atom internAtom(Display *display, const char *atomName, bool onlyIfExists)=0
virtual int nextEvent(Display *display, XEvent *event_return)=0
virtual int sendEvent(Display *display, Window window, bool propagate, long eventMask, XEvent *event_send)=0
virtual int drawString(Display *display, Window window, GC gc, int x, int y, const char *string, int length)=0
virtual int mapWindow(Display *display, Window window)=0
virtual int getWindowAttributes(Display *display, Window window, XWindowAttributes *window_attributes_return)=0
virtual Display * openDisplay(const char *display_name)=0
virtual int grabServer(Display *display)=0
virtual int lowerWindow(Display *display, Window window)=0
virtual Window createSimpleWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, unsigned long border, unsigned long background)=0
virtual int setInputFocus(Display *display, Window focus, int revertTo, Time time)=0
virtual XErrorHandler setErrorHandler(XErrorHandler handler)=0
virtual int grabButton(Display *display, unsigned int button, unsigned int modifiers, Window grab_window, bool owner_events, unsigned int event_mask, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor)=0
virtual int setInputFocus(Display *display, Window focus, int revertTo)=0
virtual int displayWidth(Display *display, int screen)=0
virtual int keysymToKeycode(Display *display, int keysym)=0
virtual int destroyWindow(Display *display, Window window)=0
virtual int defaultScreen(Display *display)=0
virtual int resizeWindow(Display *display, Window window, unsigned int width, unsigned int height)=0
virtual int removeFromSaveSet(Display *display, Window window)=0
virtual KeySym stringToKeysym(const char *string)=0
virtual int displayHeight(Display *display, int screen)=0
virtual int addToSaveSet(Display *display, Window window)=0
virtual int flush(Display *display)=0
virtual int freeX(void *data)=0
virtual int raiseWindow(Display *display, Window window)=0
virtual int setWindowBorder(Display *display, Window window, unsigned long border)=0
virtual int changeProperty(Display *display, Window window, Atom property, Atom type, int format, int mode, const unsigned char *data, int nelements)=0
virtual int ungrabButton(Display *display, unsigned int button, unsigned int modifiers, Window grab_window)=0
virtual void closeDisplay(Display *display)=0
virtual int getErrorText(Display *display, int code, char *buffer_return, int length)=0
virtual int getProperty(Display *display, Window window, Atom property, long long_offset, long long_length, bool delete_, Atom req_type, Atom *actual_type_return, int *actual_format_return, unsigned long *nitems_return, unsigned long *bytes_after_return, unsigned char **prop_return)=0
virtual Window rootWindow(Display *display, int screen)=0
virtual Window createWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int _class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes)=0
virtual ~BaseX11Wrapper()=default
virtual int getWindowProperty(Display *display, Window window, Atom property, long long_offset, long long_length, bool delete_, Atom req_type, Atom *actual_type_return, int *actual_format_return, unsigned long *nitems_return, unsigned long *bytes_after_return, unsigned char **prop_return)=0
virtual int unmapWindow(Display *display, Window window)=0
virtual int queryTree(Display *display, Window window, Window *rootReturn, Window *parentReturn, Window **childrenReturn, unsigned int *nChildrenReturn)=0
virtual int configureWindow(Display *display, Window window, unsigned valueMask, XWindowChanges *changes)=0
virtual int grabKey(Display *display, int keycode, unsigned int modifiers, Window grab_window, bool owner_events, int pointer_mode, int keyboard_mode)=0