root/trunk/X11/Xlib.d

Revision 202, 90.4 kB (checked in by sligor, 1 year ago)

X11 binding for D version 0.1
->Complete binding for X11/Xlib.h & X11/X.h

Line 
1 /*  Xlib binding for D language
2     Copyright 2007 TEISSIER Sylvere sligor(at)free.fr
3     version 0.1 2007/08/29
4     This binding is an alpha release and need to be more tested
5     
6     This file is free software, please read COPYING file for more informations
7 */
8
9 /* This file is binding from:
10  $XdotOrg: lib/X11/include/X11/Xlib.h,v 1.6 2005-11-08 06:33:25 jkj Exp $
11  $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $
12 */
13
14
15 module std.c.linux.X11.Xlib;
16 public import std.c.linux.X11.X;
17
18 const int XlibSpecificationRelease=6;
19 version = X_HAVE_UTF8_STRING;
20
21 typedef void* XPointer;
22 typedef int Status ;
23 enum Bool:int{False,True}; //xlib boolean is int type, D bool is only byte
24 enum QueueMode{QueuedAlready,QueuedAfterReading,QueuedAfterFlush};
25
26 /+
27 TODO Nested struc or union verify
28 +/
29
30 int     ConnectionNumber(Display *dpy)  {return dpy.fd;}
31 Window  RootWindow(Display *dpy,int scr)    {return ScreenOfDisplay(dpy,scr).root;}
32 int     DefaultScreen(Display *dpy)         {return dpy.default_screen;}
33 Window  DefaultRootWindow(Display *dpy)     {return ScreenOfDisplay(dpy,DefaultScreen(dpy)).root;}
34 Visual* DefaultVisual(Display *dpy,int scr) {return ScreenOfDisplay(dpy,scr).root_visual;}
35 GC      DefaultGC(Display *dpy,int scr)     {return ScreenOfDisplay(dpy,scr).default_gc;}
36 uint    BlackPixel(Display *dpy,int scr)    {return ScreenOfDisplay(dpy,scr).black_pixel;}
37 uint    WhitePixel(Display *dpy,int scr)    {return ScreenOfDisplay(dpy,scr).white_pixel;}
38 uint    AllPlanes()                         {return 0xFFFFFFFF;}
39 int     QLength(Display *dpy)               {return dpy.qlen;}
40 int     DisplayWidth(Display *dpy,int scr)  {return ScreenOfDisplay(dpy,scr).width;}
41 int     DisplayHeight(Display *dpy,int scr) {return ScreenOfDisplay(dpy,scr).height;}
42 int     DisplayWidthMM(Display *dpy,int scr){return ScreenOfDisplay(dpy,scr).mwidth;}
43 int     DisplayHeightMM(Display *dpy,int scr){return ScreenOfDisplay(dpy,scr).mheight;}
44 int     DisplayPlanes(Display *dpy,int scr) {return ScreenOfDisplay(dpy,scr).root_depth;}
45 int     DisplayCells(Display *dpy,int scr)  {return DefaultVisual(dpy,scr).map_entries;}
46 int     ScreenCount(Display *dpy)           {return dpy.nscreens;}
47 char*   ServerVendor(Display *dpy)          {return dpy.vendor;}
48 int     ProtocolVersion(Display *dpy)       {return dpy.proto_major_version;}
49 int     ProtocolRevision(Display *dpy)      {return dpy.proto_minor_version;}
50 int     VendorRelease(Display *dpy)             {return dpy.release;}
51 char*   DisplayString(Display *dpy)             {return dpy.display_name;}
52 int     DefaultDepth(Display *dpy,int scr)  {return ScreenOfDisplay(dpy,scr).root_depth;}
53 Colormap DefaultColormap(Display *dpy,int scr){return ScreenOfDisplay(dpy,scr).cmap;}
54 int     BitmapUnit(Display *dpy)            {return dpy.bitmap_unit;}
55 int     BitmapBitOrder(Display *dpy)        {return dpy.bitmap_bit_order;}
56 int     BitmapPad(Display *dpy)             {return dpy.bitmap_pad;}
57 int     ImageByteOrder(Display *dpy)        {return dpy.byte_order;}
58 uint    NextRequest(Display *dpy)           {return dpy.request + 1;}
59
60 uint    LastKnownRequestProcessed(Display *dpy) {return dpy.last_request_read;}
61
62 /* macros for screen oriented applications (toolkit) */
63 Screen* ScreenOfDisplay(Display *dpy,int scr)   {return &dpy.screens[scr];}
64 Screen* DefaultScreenOfDisplay(Display *dpy) {return ScreenOfDisplay(dpy,DefaultScreen(dpy));}
65 Display* DisplayOfScreen(Screen s)          {return s.display;}
66 Window  RootWindowOfScreen(Screen s)        {return s.root;}
67 uint    BlackPixelOfScreen(Screen s)        {return s.black_pixel;}
68 uint    WhitePixelOfScreen(Screen s)        {return s.white_pixel;}
69 Colormap DefaultColormapOfScreen(Screen s)  {return s.cmap;}
70 int     DefaultDepthOfScreen(Screen s)      {return s.root_depth;}
71 GC      DefaultGCOfScreen(Screen s)     {return s.default_gc;}
72 Visual* DefaultVisualOfScreen(Screen s) {return s.root_visual;}
73 int     WidthOfScreen(Screen s)         {return s.width;}
74 int     HeightOfScreen(Screen s)        {return s.height;}
75 int     WidthMMOfScreen(Screen s)       {return s.mwidth;}
76 int     HeightMMOfScreen(Screen s)      {return s.mheight;}
77 int     PlanesOfScreen(Screen s)        {return s.root_depth;}
78 int     CellsOfScreen(Screen s)         {return DefaultVisualOfScreen(s).map_entries;}
79 int     MinCmapsOfScreen(Screen s)      {return s.min_maps;}
80 int     MaxCmapsOfScreen(Screen s)      {return s.max_maps;}
81 Bool    DoesSaveUnders(Screen s)        {return s.save_unders;}
82 int     DoesBackingStore(Screen s)      {return s.backing_store;}
83 int     EventMaskOfScreen(Screen s)     {return s.root_input_mask;}
84
85
86
87 /*
88  * Extensions need a way to hang private data on some structures.
89  */
90 struct XExtData
91 {
92     int number;     /* number returned by XRegisterExtension */
93     XExtData *next;     /* next item on list of data for structure */
94     int function(XExtData *extension) free_private; /* called to free private storage */
95     XPointer private_data;  /* data private to this extension. */
96 };
97
98 /*
99  * This file contains structures used by the extension mechanism.
100  */
101 struct XExtCodes
102 {                       /* public to extension, cannot be changed */
103     int extension;      /* extension number */
104     int major_opcode;   /* major op-code assigned by server */
105     int first_event;    /* first event number for the extension */
106     int first_error;    /* first error number for the extension */
107 };
108
109 /*
110  * Data structure for retrieving info about pixmap formats.
111  */
112
113 struct XPixmapFormatValues
114 {
115     int depth;
116     int bits_per_pixel;
117     int scanline_pad;
118 };
119
120 struct XGCValues
121 {
122     GraphicFunction function_;      /* logical operation*/
123     uint plane_mask;                /* plane mask */
124     uint foreground;                /* foreground pixel */
125     uint background;                /* background pixel */
126     int line_width;                 /* line width */
127     LineStyle line_style;           /* LineSolid, LineOnOffDash, LineDoubleDash */
128     CapStyle cap_style;             /* CapNotLast, CapButt, CapRound, CapProjecting */
129     LineStyle join_style;           /* JoinMiter, JoinRound, JoinBevel */
130     FillStyle fill_style;           /* FillSolid, FillTiled,FillStippled, FillOpaeueStippled */
131     FillRule fill_rule;             /* EvenOddRule, WindingRule */
132     ArcMode arc_mode;               /* ArcChord, ArcPieSlice */
133     Pixmap tile;                    /* tile pixmap for tiling operations */
134     Pixmap stipple;             /* stipple 1 plane pixmap for stipping */
135     int ts_x_origin;                /* offset for tile or stipple operations */
136     int ts_y_origin;
137     Font font;                      /* default text font for text operations */
138     SubwindowMode subwindow_mode;   /* ClipByChildren, IncludeInferiors */
139     Bool graphics_exposures;        /* Boolean, should exposures be generated */
140     int clip_x_origin;              /* origin for clipping */
141     int clip_y_origin;
142     Pixmap clip_mask;               /* bitmap clipping; other calls for rects */
143     int dash_offset;                /* patterned/dashed line information */
144     byte dashes;
145 };
146
147 typedef void* GC;
148
149 /*
150  * Visual structure; contains information about colormapping possible.
151  */
152 struct Visual
153 {
154     XExtData *ext_data; /* hook for extension to hang data */
155     VisualID visualid;  /* visual id of this visual */
156     int class_;         /* class of screen (monochrome, etc.) */
157     uint red_mask, green_mask, blue_mask;   /* mask values */
158     int bits_per_rgb;   /* log base 2 of distinct color values */
159     int map_entries;    /* color map entries */
160 } ;
161
162 /*
163  * Depth structure; contains information for each possible depth.
164  */
165 struct Depth
166 {
167     int depth;      /* this depth (Z) of the depth */
168     int nvisuals;       /* number of Visual types at this depth */
169     Visual *visuals;    /* list of visuals possible at this depth */
170 };
171
172 alias Display XDisplay;
173
174 struct Screen{
175     XExtData *ext_data;     /* hook for extension to hang data */
176     XDisplay *display;      /* back pointer to display structure */
177     Window root;            /* Root window id. */
178     int width, height;      /* width and height of screen */
179     int mwidth, mheight;    /* width and height of  in millimeters */
180     int ndepths;            /* number of depths possible */
181     Depth *depths;          /* list of allowable depths on the screen */
182     int root_depth;         /* bits per pixel */
183     Visual *root_visual;    /* root visual */
184     GC default_gc;          /* GC for the root root visual */
185     Colormap cmap;          /* default color map */
186     uint white_pixel;
187     uint black_pixel;       /* White and Black pixel values */
188     int max_maps, min_maps; /* max and min color maps */
189     int backing_store;      /* Never, WhenMapped, Always */
190     Bool save_unders;   
191     int root_input_mask;    /* initial root input mask */
192 };
193
194 /*
195  * Format structure; describes ZFormat data the screen will understand.
196  */
197 struct ScreenFormat
198 {
199     XExtData *ext_data; /* hook for extension to hang data */
200     int depth;          /* depth of this image format */
201     int bits_per_pixel; /* bits/pixel at this depth */
202     int scanline_pad;   /* scanline must padded to this multiple */
203 };
204
205 /*
206  * Data structure for setting window attributes.
207  */
208 struct  XSetWindowAttributes
209 {
210     Pixmap background_pixmap;   /* background or None or ParentRelative */
211     uint background_pixel;      /* background pixel */
212     Pixmap border_pixmap;       /* border of the window */
213     uint border_pixel;          /* border pixel value */
214     BitGravity bit_gravity;     /* one of bit gravity values */
215     BitGravity win_gravity;     /* one of the window gravity values */
216     BackingStoreHint backing_store;     /* NotUseful, WhenMapped, Always */
217     uint backing_planes;        /* planes to be preseved if possible */
218     uint backing_pixel;         /* value to use in restoring planes */
219     Bool save_under;            /* should bits under be saved? (popups) */
220     long event_mask;            /* set of events that should be saved */
221     long do_not_propagate_mask;/* set of events that should not propagate */
222     Bool override_redirect;     /* Boolean value for override-redirect */
223     Colormap colormap;          /* color map to be associated with window */
224     Cursor cursor;              /* cursor to be displayed (or None) */
225 };
226
227 struct XWindowAttributes
228 {
229     int x, y;                   /* location of window */
230     int width, height;          /* width and height of window */
231     int border_width;           /* border width of window */
232     int depth;                  /* depth of window */
233     Visual *visual;             /* the associated visual structure */
234     Window root;                /* root of screen containing window */
235     WindowClass class_;         /* InputOutput, InputOnly*/
236     BitGravity bit_gravity;     /* one of bit gravity values */
237     BitGravity win_gravity;     /* one of the window gravity values */
238     BackingStoreHint backing_store; /* NotUseful, WhenMapped, Always */
239     uint backing_planes;        /* planes to be preserved if possible */
240     uint backing_pixel; /* value to be used when restoring planes */
241     Bool save_under;            /* Boolean, should bits under be saved? */
242     Colormap colormap;          /* color map to be associated with window */
243     Bool map_installed;     /* Boolean, is color map currently installed*/
244     MapState map_state;     /* IsUnmapped, IsUnviewable, IsViewable */
245     EventMask all_event_masks;  /* set of events all people have interest in*/
246     EventMask your_event_mask;  /* my event mask */
247     EventMask do_not_propagate_mask; /* set of events that should not propagate */
248     Bool override_redirect;     /* Boolean value for override-redirect */
249     Screen *screen;             /* back pointer to correct screen */
250 };
251
252 /*
253  * Data structure for host setting; getting routines.
254  *
255  */
256
257 struct XHostAddress
258 {
259     ProtocolFamlily family; /* for example FamilyInternet */
260     int length;                 /* length of address, in bytes */
261     void *address;              /* pointer to where to find the bytes */
262 };
263
264 /*
265  * Data structure for ServerFamilyInterpreted addresses in host routines
266  */
267 struct XServerInterpretedAddress
268 {
269     int typelength;     /* length of type string, in bytes */
270     int valuelength;    /* length of value string, in bytes */
271     void *type;         /* pointer to where to find the type string */
272     void *value;        /* pointer to where to find the address */
273 };
274
275 /*
276  * Data structure for "image" data, used by image manipulation routines.
277  */
278 struct XImage
279 {
280     int width, height;          /* size of image */
281     int xoffset;                /* number of pixels offset in X direction */
282     ImageFormat format;     /* XYBitmap, XYPixmap, ZPixmap */
283     void *data;                 /* pointer to image data */
284     ByteOrder byte_order;       /* data byte order, LSBFirst, MSBFirst */
285     int bitmap_unit;            /* quant. of scanline 8, 16, 32 */
286     int bitmap_bit_order;       /* LSBFirst, MSBFirst */
287     int bitmap_pad;         /* 8, 16, 32 either XY or ZPixmap */
288     int depth;                  /* depth of image */
289     int bytes_per_line;         /* accelarator to next line */
290     int bits_per_pixel;         /* bits per pixel (ZPixmap) */
291     uint red_mask;  /* bits in z arrangment */
292     uint green_mask;
293     uint blue_mask;
294     XPointer obdata;            /* hook for the object routines to hang on */
295     struct f {              /* image manipulation routines */
296         XImage* function(
297             XDisplay*           /* display */,
298             Visual*             /* visual */,
299             uint                /* depth */,
300             int                 /* format */,
301             int                 /* offset */,
302             byte*               /* data */,
303             uint                /* width */,
304             uint                /* height */,
305             int                 /* bitmap_pad */,
306             int                 /* bytes_per_line */) create_image;
307         int  function(XImage *)destroy_image;
308         uint function(XImage *, int, int)get_pixel;
309         int  function(XImage *, int, int, uint)put_pixel;
310         XImage function(XImage *, int, int, uint, uint)sub_image;
311         int function(XImage *, int)add_pixel;
312     };
313 };
314
315 /*
316  * Data structure for XReconfigureWindow
317  */
318 struct XWindowChanges{
319     int x, y;
320     int width, height;
321     int border_width;
322     Window sibling;
323     WindowStackingMethod stack_mode;
324 };
325
326 /*
327  * Data structure used by color operations
328  */
329 struct XColor
330 {
331     uint pixel;
332     ushort red, green, blue;
333     StoreColor flags;  /* do_red, do_green, do_blue */
334     byte pad;
335 };
336
337 /*
338  * Data structures for graphics operations.  On most machines, these are
339  * congruent with the wire protocol structures, so reformatting the data
340  * can be avoided on these architectures.
341  */
342 struct XSegment
343 {
344     short x1, y1, x2, y2;
345 };
346
347 struct XPoint
348 {
349     short x, y;
350 };
351    
352 struct XRectangle
353 {
354     short x, y;
355     ushort width, height;
356 };
357    
358 struct XArc
359 {
360     short x, y;
361     ushort width, height;
362     short angle1, angle2;
363 };
364
365
366 /* Data structure for XChangeKeyboardControl */
367
368 struct XKeyboardControl
369 {
370     int key_click_percent;
371     int bell_percent;
372     int bell_pitch;
373     int bell_duration;
374     int led;
375     LedMode led_mode;
376     int key;
377     AutoRepeatMode auto_repeat_mode;   /* On, Off, Default */
378 };
379
380 /* Data structure for XGetKeyboardControl */
381
382 struct XKeyboardState
383 {
384     int key_click_percent;
385     int bell_percent;
386     uint bell_pitch, bell_duration;
387     uint led_mask;
388     int global_auto_repeat;
389     byte auto_repeats[32];
390 };
391
392 struct XTimeCoord
393 {
394     Time time;
395     short x, y;
396 };
397
398 /* Data structure for X{Set,Get}ModifierMapping */
399
400 struct XModifierKeymap
401 {
402     int max_keypermod;  /* The server's max # of keys per modifier */
403     KeyCode *modifiermap;   /* An 8 by max_keypermod array of modifiers */
404 };
405
406
407 /+ todo Verify Here+/
408 /*
409  * Display datatype maintaining display specific data.
410  * The contents of this structure are implementation dependent.
411  * A Display should be treated as opaque by application code.
412  */
413
414 struct _XPrivate{}      /* Forward declare before use for C++ */
415 struct _XrmHashBucketRec{}
416
417 struct Display
418 {
419     XExtData *ext_data; /* hook for extension to hang data */
420     _XPrivate *private1;
421     int fd;         /* Network socket. */
422     int private2;
423     int proto_major_version;/* major version of server's X protocol */
424     int proto_minor_version;/* minor version of servers X protocol */
425     char *vendor;       /* vendor of the server hardware */
426     XID private3;
427     XID private4;
428     XID private5;
429     int private6;
430     XID function(Display*)resource_alloc;/* allocator function */
431     ByteOrder byte_order;       /* screen byte order, LSBFirst, MSBFirst */
432     int bitmap_unit;    /* padding and data requirements */
433     int bitmap_pad;     /* padding requirements on bitmaps */
434     ByteOrder bitmap_bit_order; /* LeastSignificant or MostSignificant */
435     int nformats;       /* number of pixmap formats in list */
436     ScreenFormat *pixmap_format;    /* pixmap format list */
437     int private8;
438     int release;        /* release of the server */
439     _XPrivate *private9;
440     _XPrivate *private10;
441     int qlen;       /* Length of input event queue */
442     uint last_request_read; /* seq number of last event read */
443     uint request;   /* sequence number of last request. */
444     XPointer private11;
445     XPointer private12;
446     XPointer private13;
447     XPointer private14;
448     uint max_request_size; /* maximum number 32 bit words in request*/
449     _XrmHashBucketRec *db;
450     int function  (Display*)private15;
451     char *display_name; /* "host:display" string used on this connect*/
452     int default_screen; /* default screen for operations */
453     int nscreens;       /* number of screens on this server*/
454     Screen *screens;    /* pointer to list of screens */
455     uint motion_buffer; /* size of motion buffer */
456     uint private16;
457     int min_keycode;    /* minimum defined keycode */
458     int max_keycode;    /* maximum defined keycode */
459     XPointer private17;
460     XPointer private18;
461     int private19;
462     byte *xdefaults;    /* contents of defaults from server */
463     /* there is more to this structure, but it is private to Xlib */
464 }
465
466 typedef Display *_XPrivDisplay;
467 struct XrmHashBucketRec{};
468
469
470 /*
471  * Definitions of specific events.
472  */
473 struct XKeyEvent
474 {
475     int type;           /* of event */
476     uint serial;        /* # of last request processed by server */
477     Bool send_event;    /* true if this came from a SendEvent request */
478     Display *display;   /* Display the event was read from */
479     Window window;          /* "event" window it is reported relative to */
480     Window root;            /* root window that the event occurred on */
481     Window subwindow;   /* child window */
482     Time time;      /* milliseconds */
483     int x, y;       /* pointer x, y coordinates in event window */
484     int x_root, y_root; /* coordinates relative to root */
485     KeyOrButtonMask state;  /* key or button mask */
486     uint keycode;   /* detail */
487     Bool same_screen;   /* same screen flag */
488 };
489 typedef XKeyEvent XKeyPressedEvent;
490 typedef XKeyEvent XKeyReleasedEvent;
491
492 struct XButtonEvent
493 {
494     int type;       /* of event */
495     uint serial;    /* # of last request processed by server */
496     Bool send_event;    /* true if this came from a SendEvent request */
497     Display *display;   /* Display the event was read from */
498     Window window;          /* "event" window it is reported relative to */
499     Window root;            /* root window that the event occurred on */
500     Window subwindow;   /* child window */
501     Time time;      /* milliseconds */
502     int x, y;       /* pointer x, y coordinates in event window */
503     int x_root, y_root; /* coordinates relative to root */
504     KeyOrButtonMask state;  /* key or button mask */
505     uint button;    /* detail */
506     Bool same_screen;   /* same screen flag */
507 };
508 typedef XButtonEvent XButtonPressedEvent;
509 typedef XButtonEvent XButtonReleasedEvent;
510
511 struct XMotionEvent{
512     int type;       /* of event */
513     uint serial;    /* # of last request processed by server */
514     Bool send_event;    /* true if this came from a SendEvent request */
515     Display *display;   /* Display the event was read from */
516     Window window;          /* "event" window reported relative to */
517     Window root;            /* root window that the event occurred on */
518     Window subwindow;   /* child window */
519     Time time;      /* milliseconds */
520     int x, y;       /* pointer x, y coordinates in event window */
521     int x_root, y_root; /* coordinates relative to root */
522     KeyOrButtonMask state;  /* key or button mask */
523     byte is_hint;       /* detail */
524     Bool same_screen;   /* same screen flag */
525 };
526 typedef XMotionEvent XPointerMovedEvent;
527
528 struct XCrossingEvent{
529     int type;       /* of event */
530     uint serial;    /* # of last request processed by server */
531     Bool send_event;    /* true if this came from a SendEvent request */
532     Display *display;   /* Display the event was read from */
533     Window window;          /* "event" window reported relative to */
534     Window root;            /* root window that the event occurred on */
535     Window subwindow;   /* child window */
536     Time time;      /* milliseconds */
537     int x, y;       /* pointer x, y coordinates in event window */
538     int x_root, y_root; /* coordinates relative to root */
539     NotifyModes mode;       /* NotifyNormal, NotifyGrab, NotifyUngrab */
540     NotifyDetail detail;
541     /*
542      * NotifyAncestor, NotifyVirtual, NotifyInferior,
543      * NotifyNonlinear,NotifyNonlinearVirtual
544      */
545     Bool same_screen;   /* same screen flag */
546     Bool focus;     /* Boolean focus */
547     KeyOrButtonMask state;  /* key or button mask */
548 };
549 typedef XCrossingEvent XEnterWindowEvent;
550 typedef XCrossingEvent XLeaveWindowEvent;
551
552 struct XFocusChangeEvent{
553     int type;       /* FocusIn or FocusOut */
554     uint serial;    /* # of last request processed by server */
555     Bool send_event;    /* true if this came from a SendEvent request */
556     Display *display;   /* Display the event was read from */
557     Window window;      /* window of event */
558     NotifyModes mode;       /* NotifyNormal, NotifyWhileGrabbed,
559                    NotifyGrab, NotifyUngrab */
560     NotifyDetail detail;
561     /*
562      * NotifyAncestor, NotifyVirtual, NotifyInferior,
563      * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
564      * NotifyPointerRoot, NotifyDetailNone
565      */
566 };
567 typedef XFocusChangeEvent XFocusInEvent;
568 typedef XFocusChangeEvent XFocusOutEvent;
569
570 /* generated on EnterWindow and FocusIn  when KeyMapState selected */
571 struct XKeymapEvent
572 {
573     int type;
574     uint serial;    /* # of last request processed by server */
575     Bool send_event;    /* true if this came from a SendEvent request */
576     Display *display;   /* Display the event was read from */
577     Window window;
578     byte key_vector[32];
579 }; 
580
581 struct XExposeEvent
582 {
583     int type;
584     uint serial;    /* # of last request processed by server */
585     Bool send_event;    /* true if this came from a SendEvent request */
586     Display *display;   /* Display the event was read from */
587     Window window;
588     int x, y;
589     int width, height;
590     int count;      /* if non-zero, at least this many more */
591 };
592
593 struct XGraphicsExposeEvent{
594     int type;
595     uint serial;    /* # of last request processed by server */
596     Bool send_event;    /* true if this came from a SendEvent request */
597     Display *display;   /* Display the event was read from */
598     Drawable drawable;
599     int x, y;
600     int width, height;
601     int count;      /* if non-zero, at least this many more */
602     int major_code;     /* core is CopyArea or CopyPlane */
603     int minor_code;     /* not defined in the core */
604 };
605
606 struct XNoExposeEvent{
607     int