]> icculus.org git repositories - mikachu/openbox.git/blob - otk_c/display.h
color and gccache etc are like, half done
[mikachu/openbox.git] / otk_c / display.h
1 // -*- mode: C; indent-tabs-mode: nil; -*-
2 #ifndef   __display_h
3 #define   __display_h
4
5 #include <X11/Xlib.h>
6 #include <Python.h>
7
8 struct OtkScreenInfo;
9 struct OtkGCCache;
10 struct OtkDisplay;
11
12 struct OtkDisplay *OBDisplay; // the global display XXX: move this to app.h and ob.h?
13
14 typedef struct OtkDisplay {
15   PyObject_HEAD
16   
17   //! The X display
18   Display *display;
19   
20   //! Does the display have the Shape extention?
21   Bool shape;
22   //! Base for events for the Shape extention
23   int  shape_event_basep;
24
25   //! Does the display have the Xinerama extention?
26   Bool xinerama;
27   //! Base for events for the Xinerama extention
28   int  xinerama_event_basep;
29
30   //! A list of all possible combinations of keyboard lock masks
31   unsigned int mask_list[8];
32
33   //! The number of requested grabs on the display
34   int grab_count;
35
36   //! A list of information for all screens on the display
37   PyObject *screenInfoList; // PyListObject
38
39   //! A cache for re-using GCs, used by the drawing objects
40   /*!
41     @see BPen
42     @see BFont
43     @see BImage
44     @see BImageControl
45     @see BTexture
46   */
47   struct OtkGCCache *gccache;
48 } OtkDisplay;
49
50 //! Creates a struct, opens the X display
51 /*!
52   @see OBDisplay::display
53   @param name The name of the X display to open. If it is null, the DISPLAY
54   environment variable is used instead.
55 */
56 PyObject *OtkDisplay_New(char *name);
57
58 //! Grabs the display
59 void OtkDisplay_Grab(OtkDisplay *self);
60
61 //! Ungrabs the display
62 void OtkDisplay_Ungrab(OtkDisplay *self);
63
64 //! Get the screen info for a specific screen
65 struct OtkScreenInfo *OtkDisplay_ScreenInfo(OtkDisplay *self, int num);
66
67 #endif // __display_h