4 * Replacements for some comomon Xlib functions
11 #include "wx/x11/nanox/X11/Xlib.h"
13 Colormap
DefaultColormapOfScreen(Screen
/* screen */)
15 static Colormap s_globalColormap
;
16 static bool s_init
= FALSE
;
20 GrGetSystemPalette(& s_globalColormap
);
24 return s_globalColormap
;
27 int XSetGraphicsExposures( Display
* /* display */, GC
/* gc */, Bool
/* graphics_exposures */)
32 int XWarpPointer( Display
* /* display */, Window
/* srcW */, Window
/* srcW */,
33 int /* srcX */, int /* srcY */,
34 unsigned int /* srcWidth */,
35 unsigned int /* srcHeight */,
38 GrMoveCursor(destX
, destY
);
42 int XSetInputFocus(Display
* /* display */, Window focus
, int /* revert_to */, Time
/* time */)
48 int XGetInputFocus(Display
* /* display */, Window
* /* focus_return */, int* /* revert_to_return */)
50 * focus_return
= GrGetFocus();
51 * revert_to_return
= 0;
55 int XGrabPointer(Display
* /* display */, Window
/* grab_window */,
56 Bool
/* owner_events */, unsigned int /* event_mask */,
57 int /* pointer_mode */, int /* keyboard_mode */,
58 Window
/* confine_to */, Cursor
/* cursor */, Time
/* time */)
60 /* According to comments in srvevent.c in Nano-X, the pointer
61 * is implicitly grabbed when a mouse button is down.
62 * We may be able to simulate this further in the event loop.
67 int XUngrabPointer(Display
/* display */, Time
/* time */)
72 int XCopyArea(Display
* /* display */, Drawable src
, Drawable dest
, GC gc
,
73 int src_x
, int src_y
, unsigned int width
, unsigned int height
,
74 int dest_x
, int dest_y
)
76 GrCopyArea(dest
, gc
, dest_x
, dest_y
,
82 int XCopyPlane(Display
* /* display */, Drawable src
, Drawable dest
, GC gc
,
83 int src_x
, int src_y
, unsigned int width
, unsigned int height
,
84 int dest_x
, int dest_y
, unsigned long /* plane */)
86 GrCopyArea(dest
, gc
, dest_x
, dest_y
,
94 GR_WINDOW_ID wid
; /* window id (or 0 if no such window) */
95 GR_WINDOW_ID parent
; /* parent window id */
96 GR_WINDOW_ID child
; /* first child window id (or 0) */
97 GR_WINDOW_ID sibling
; /* next sibling window id (or 0) */
98 GR_BOOL inputonly
; /* TRUE if window is input only */
99 GR_BOOL mapped
; /* TRUE if window is mapped */
100 GR_COUNT unmapcount
; /* reasons why window is unmapped */
101 GR_COORD x
; /* absolute x position of window */
102 GR_COORD y
; /* absolute y position of window */
103 GR_SIZE width
; /* width of window */
104 GR_SIZE height
; /* height of window */
105 GR_SIZE bordersize
; /* size of border */
106 GR_COLOR bordercolor
; /* color of border */
107 GR_COLOR background
; /* background color */
108 GR_EVENT_MASK eventmask
; /* current event mask for this client */
109 GR_WM_PROPS props
; /* window properties */
110 GR_CURSOR_ID cursor
; /* cursor id*/
111 unsigned long processid
; /* process id of owner*/
115 int x
, y
; /* location of window */
116 int width
, height
; /* width and height of window */
117 int border_width
; /* border width of window */
118 int depth
; /* depth of window */
119 Visual
*visual
; /* the associated visual structure */
120 Window root
; /* root of screen containing window */
121 int class; /* InputOutput, InputOnly*/
122 int bit_gravity
; /* one of the bit gravity values */
123 int win_gravity
; /* one of the window gravity values */
124 int backing_store
; /* NotUseful, WhenMapped, Always */
125 unsigned long backing_planes
;/* planes to be preserved if possible */
126 unsigned long backing_pixel
;/* value to be used when restoring planes */
127 Bool save_under
; /* boolean, should bits under be saved? */
128 Colormap colormap
; /* color map to be associated with window */
129 Bool map_installed
; /* boolean, is color map currently installed*/
130 int map_state
; /* IsUnmapped, IsUnviewable, IsViewable */
131 long all_event_masks
; /* set of events all people have interest in*/
132 long your_event_mask
; /* my event mask */
133 long do_not_propagate_mask
;/* set of events that should not propagate */
134 Bool override_redirect
; /* boolean value for override-redirect */
135 Screen
*screen
; /* back pointer to correct screen */
141 Status
XGetWindowAttributes(Display
* display
, Window w
,
142 XWindowAttributes
* window_attributes_return
)
145 GrGetWindowInfo(w
, & info
);
147 window_attributes
->x
= info
.x
;
148 window_attributes
->y
= info
.y
;
149 window_attributes
->width
= info
.width
;
150 window_attributes
->height
= info
.height
;
151 window_attributes
->border_width
= info
.bordersize
;
152 window_attributes
->depth
= 0;
153 window_attributes
->visual
= NULL
;
154 window_attributes
->root
= 0;
155 window_attributes
->class = info
.inputonly
? InputOnly
: InputOutput
;
156 window_attributes
->bit_gravity
= 0;
157 window_attributes
->win_gravity
= 0;
158 window_attributes
->backing_store
= 0;
159 window_attributes
->backing_planes
= 0;
160 window_attributes
->backing_pixel
= 0;
161 window_attributes
->save_under
= FALSE
;
162 window_attributes
->colormap
= DefaultColormapOfScreen(0);
163 window_attributes
->map_installed
= FALSE
;
164 window_attributes
->map_state
= info
.mapped
? IsViewable
: IsUnmapped
;
165 window_attributes
->all_event_masks
= 0;
166 window_attributes
->do_not_propagate_mask
= 0;
167 window_attributes
->override_redirect
= FALSE
;
168 window_attributes
->screen
= NULL
;