]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
Initial revision
[~andy/gtk] / gdk / gdktypes.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 #ifndef __GDK_TYPES_H__
19 #define __GDK_TYPES_H__
20
21
22 /* GDK uses "glib". (And so does GTK).
23  */
24 #include <glib.h>
25
26
27 #define GDK_NONE             0L
28 #define GDK_CURRENT_TIME     0L
29 #define GDK_PARENT_RELATIVE  1L
30
31 /* special deviceid for core pointer events */
32 #define GDK_CORE_POINTER 0xfedc
33
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38
39
40 /* Type definitions for the basic structures.
41  */
42
43 typedef gulong                    GdkAtom;
44 typedef struct _GdkColor          GdkColor;
45 typedef struct _GdkColormap       GdkColormap;
46 typedef struct _GdkVisual         GdkVisual;
47 typedef struct _GdkWindowAttr     GdkWindowAttr;
48 typedef struct _GdkWindow         GdkWindow;
49 typedef struct _GdkWindow         GdkPixmap;
50 typedef struct _GdkWindow         GdkBitmap;
51 typedef struct _GdkWindow         GdkDrawable;
52 typedef struct _GdkImage          GdkImage;
53 typedef struct _GdkGCValues       GdkGCValues;
54 typedef struct _GdkGC             GdkGC;
55 typedef struct _GdkPoint          GdkPoint;
56 typedef struct _GdkRectangle      GdkRectangle;
57 typedef struct _GdkSegment        GdkSegment;
58 typedef struct _GdkFont           GdkFont;
59 typedef struct _GdkCursor         GdkCursor;
60
61 typedef struct _GdkEventAny       GdkEventAny;
62 typedef struct _GdkEventExpose    GdkEventExpose;
63 typedef struct _GdkEventMotion    GdkEventMotion;
64 typedef struct _GdkEventButton    GdkEventButton;
65 typedef struct _GdkEventKey       GdkEventKey;
66 typedef struct _GdkEventFocus     GdkEventFocus;
67 typedef struct _GdkEventCrossing  GdkEventCrossing;
68 typedef struct _GdkEventConfigure GdkEventConfigure;
69 typedef struct _GdkEventProperty  GdkEventProperty;
70 typedef struct _GdkEventSelection GdkEventSelection;
71 typedef struct _GdkEventProximity GdkEventProximity;
72 typedef struct _GdkEventOther     GdkEventOther;
73 typedef struct _GdkEventDragBegin GdkEventDragBegin;
74 typedef struct _GdkEventDragRequest GdkEventDragRequest;
75 typedef struct _GdkEventDropEnter GdkEventDropEnter;
76 typedef struct _GdkEventDropDataAvailable GdkEventDropDataAvailable;
77 typedef struct _GdkEventDropLeave GdkEventDropLeave;
78 typedef struct _GdkEventClient    GdkEventClient;
79 typedef union  _GdkEvent          GdkEvent;
80 typedef struct _GdkDeviceInfo     GdkDeviceInfo;
81 typedef struct _GdkTimeCoord      GdkTimeCoord;
82 typedef gint (*GdkEventFunc) (GdkEvent *event,
83                               gpointer  data);
84
85
86 /* Types of windows.
87  *   Root: There is only 1 root window and it is initialized
88  *         at startup. Creating a window of type GDK_WINDOW_ROOT
89  *         is an error.
90  *   Toplevel: Windows which interact with the window manager.
91  *   Child: Windows which are children of some other type of window.
92  *          (Any other type of window). Most windows are child windows.
93  *   Dialog: A special kind of toplevel window which interacts with
94  *           the window manager slightly differently than a regular
95  *           toplevel window. Dialog windows should be used for any
96  *           transient window.
97  *   Pixmap: Pixmaps are really just another kind of window which
98  *           doesn't actually appear on the screen. It can't have
99  *           children, either and is really just a convenience so
100  *           that the drawing functions can work on both windows
101  *           and pixmaps transparently. (ie. You shouldn't pass a
102  *           pixmap to any procedure which accepts a window with the
103  *           exception of the drawing functions).
104  */
105 typedef enum
106 {
107   GDK_WINDOW_ROOT,
108   GDK_WINDOW_TOPLEVEL,
109   GDK_WINDOW_CHILD,
110   GDK_WINDOW_DIALOG,
111   GDK_WINDOW_TEMP,
112   GDK_WINDOW_PIXMAP
113 } GdkWindowType;
114
115 /* Classes of windows.
116  *   InputOutput: Almost every window should be of this type. Such windows
117  *                receive events and are also displayed on screen.
118  *   InputOnly: Used only in special circumstances when events need to be
119  *              stolen from another window or windows. Input only windows
120  *              have no visible output, so they are handy for placing over
121  *              top of a group of windows in order to grab the events (or
122  *              filter the events) from those windows.
123  */
124 typedef enum
125 {
126   GDK_INPUT_OUTPUT,
127   GDK_INPUT_ONLY
128 } GdkWindowClass;
129
130 /* Types of images.
131  *   Normal: Normal X image type. These are slow as they involve passing
132  *           the entire image through the X connection each time a draw
133  *           request is required.
134  *   Shared: Shared memory X image type. These are fast as the X server
135  *           and the program actually use the same piece of memory. They
136  *           should be used with care though as there is the possibility
137  *           for both the X server and the program to be reading/writing
138  *           the image simultaneously and producing undesired results.
139  */
140 typedef enum
141 {
142   GDK_IMAGE_NORMAL,
143   GDK_IMAGE_SHARED,
144   GDK_IMAGE_FASTEST
145 } GdkImageType;
146
147 /* Types of visuals.
148  *   StaticGray:
149  *   Grayscale:
150  *   StaticColor:
151  *   PseudoColor:
152  *   TrueColor:
153  *   DirectColor:
154  */
155 typedef enum
156 {
157   GDK_VISUAL_STATIC_GRAY,
158   GDK_VISUAL_GRAYSCALE,
159   GDK_VISUAL_STATIC_COLOR,
160   GDK_VISUAL_PSEUDO_COLOR,
161   GDK_VISUAL_TRUE_COLOR,
162   GDK_VISUAL_DIRECT_COLOR
163 } GdkVisualType;
164
165 /* Types of font.
166  *   GDK_FONT_FONT: the font is an XFontStruct.
167  *   GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
168  */
169 typedef enum
170 {
171   GDK_FONT_FONT,
172   GDK_FONT_FONTSET
173 } GdkFontType;
174
175 /* Window attribute mask values.
176  *   GDK_WA_TITLE: The "title" field is valid.
177  *   GDK_WA_X: The "x" field is valid.
178  *   GDK_WA_Y: The "y" field is valid.
179  *   GDK_WA_CURSOR: The "cursor" field is valid.
180  *   GDK_WA_COLORMAP: The "colormap" field is valid.
181  *   GDK_WA_VISUAL: The "visual" field is valid.
182  */
183 typedef enum
184 {
185   GDK_WA_TITLE    = 1 << 1,
186   GDK_WA_X        = 1 << 2,
187   GDK_WA_Y        = 1 << 3,
188   GDK_WA_CURSOR   = 1 << 4,
189   GDK_WA_COLORMAP = 1 << 5,
190   GDK_WA_VISUAL   = 1 << 6,
191   GDK_WA_WMCLASS  = 1 << 7
192 } GdkWindowAttributesType;
193
194 /* Size restriction enumeration.
195  */
196 typedef enum
197 {
198   GDK_HINT_POS       = 1 << 0,
199   GDK_HINT_MIN_SIZE  = 1 << 1,
200   GDK_HINT_MAX_SIZE  = 1 << 2
201 } GdkWindowHints;
202
203 /* GC function types.
204  *   Copy: Overwrites destination pixels with the source pixels.
205  *   Invert: Inverts the destination pixels.
206  *   Xor: Xor's the destination pixels with the source pixels.
207  */
208 typedef enum
209 {
210   GDK_COPY,
211   GDK_INVERT,
212   GDK_XOR
213 } GdkFunction;
214
215 /* GC fill types.
216  *  Solid:
217  *  Tiled:
218  *  Stippled:
219  *  OpaqueStippled:
220  */
221 typedef enum
222 {
223   GDK_SOLID,
224   GDK_TILED,
225   GDK_STIPPLED,
226   GDK_OPAQUE_STIPPLED
227 } GdkFill;
228
229 /* GC line styles
230  *  Solid:
231  *  OnOffDash:
232  *  DoubleDash:
233  */
234 typedef enum
235 {
236   GDK_LINE_SOLID,
237   GDK_LINE_ON_OFF_DASH,
238   GDK_LINE_DOUBLE_DASH
239 } GdkLineStyle;
240
241 /* GC cap styles
242  *  CapNotLast:
243  *  CapButt:
244  *  CapRound:
245  *  CapProjecting:
246  */
247 typedef enum
248 {
249   GDK_CAP_NOT_LAST,
250   GDK_CAP_BUTT,
251   GDK_CAP_ROUND,
252   GDK_CAP_PROJECTING
253 } GdkCapStyle;
254
255 /* GC join styles
256  *  JoinMiter:
257  *  JoinRound:
258  *  JoinBevel:
259  */
260 typedef enum
261 {
262   GDK_JOIN_MITER,
263   GDK_JOIN_ROUND,
264   GDK_JOIN_BEVEL
265 } GdkJoinStyle;
266
267 /* Cursor types.
268  */
269 typedef enum
270 {
271 #include <gdk/gdkcursors.h>
272   GDK_LAST_CURSOR
273 } GdkCursorType;
274
275 /* Event types.
276  *   Nothing: No event occurred.
277  *   Delete: A window delete event was sent by the window manager.
278  *           The specified window should be deleted.
279  *   Destroy: A window has been destroyed.
280  *   Expose: Part of a window has been uncovered.
281  *   MotionNotify: The mouse has moved.
282  *   ButtonPress: A mouse button was pressed.
283  *   ButtonRelease: A mouse button was release.
284  *   KeyPress: A key was pressed.
285  *   KeyRelease: A key was released.
286  *   EnterNotify: A window was entered.
287  *   LeaveNotify: A window was exited.
288  *   FocusChange: The focus window has changed. (The focus window gets
289  *                keyboard events).
290  *   Resize: A window has been resized.
291  *   Map: A window has been mapped. (It is now visible on the screen).
292  *   Unmap: A window has been unmapped. (It is no longer visible on
293  *          the screen).
294  */
295 typedef enum
296 {
297   GDK_NOTHING           = -1,
298   GDK_DELETE            = 0,
299   GDK_DESTROY           = 1,
300   GDK_EXPOSE            = 2,
301   GDK_MOTION_NOTIFY     = 3,
302   GDK_BUTTON_PRESS      = 4,
303   GDK_2BUTTON_PRESS     = 5,
304   GDK_3BUTTON_PRESS     = 6,
305   GDK_BUTTON_RELEASE    = 7,
306   GDK_KEY_PRESS         = 8,
307   GDK_KEY_RELEASE       = 9,
308   GDK_ENTER_NOTIFY      = 10,
309   GDK_LEAVE_NOTIFY      = 11,
310   GDK_FOCUS_CHANGE      = 12,
311   GDK_CONFIGURE         = 13,
312   GDK_MAP               = 14,
313   GDK_UNMAP             = 15,
314   GDK_PROPERTY_NOTIFY   = 16,
315   GDK_SELECTION_CLEAR   = 17,
316   GDK_SELECTION_REQUEST = 18,
317   GDK_SELECTION_NOTIFY  = 19,
318   GDK_PROXIMITY_IN      = 20,
319   GDK_PROXIMITY_OUT     = 21,
320   GDK_DRAG_BEGIN        = 22,
321   GDK_DRAG_REQUEST      = 23,
322   GDK_DROP_ENTER        = 24,
323   GDK_DROP_LEAVE        = 25,
324   GDK_DROP_DATA_AVAIL   = 26,
325   GDK_CLIENT_EVENT      = 27,
326   GDK_OTHER_EVENT       = 9999
327 } GdkEventType;
328
329 /* Event masks. (Used to select what types of events a window
330  *  will receive).
331  */
332 typedef enum
333 {
334   GDK_EXPOSURE_MASK             = 1 << 1,
335   GDK_POINTER_MOTION_MASK       = 1 << 2,
336   GDK_POINTER_MOTION_HINT_MASK  = 1 << 3,
337   GDK_BUTTON_MOTION_MASK        = 1 << 4,
338   GDK_BUTTON1_MOTION_MASK       = 1 << 5,
339   GDK_BUTTON2_MOTION_MASK       = 1 << 6,
340   GDK_BUTTON3_MOTION_MASK       = 1 << 7,
341   GDK_BUTTON_PRESS_MASK         = 1 << 8,
342   GDK_BUTTON_RELEASE_MASK       = 1 << 9,
343   GDK_KEY_PRESS_MASK            = 1 << 10,
344   GDK_KEY_RELEASE_MASK          = 1 << 11,
345   GDK_ENTER_NOTIFY_MASK         = 1 << 12,
346   GDK_LEAVE_NOTIFY_MASK         = 1 << 13,
347   GDK_FOCUS_CHANGE_MASK         = 1 << 14,
348   GDK_STRUCTURE_MASK            = 1 << 15,
349   GDK_PROPERTY_CHANGE_MASK      = 1 << 16,
350   GDK_PROXIMITY_IN_MASK         = 1 << 17,
351   GDK_PROXIMITY_OUT_MASK        = 1 << 18,
352   GDK_ALL_EVENTS_MASK           = 0x07FFFF
353 } GdkEventMask;
354
355 /* Types of enter/leave notifications.
356  *   Ancestor:
357  *   Virtual:
358  *   Inferior:
359  *   Nonlinear:
360  *   NonlinearVirtual:
361  *   Unknown: An unknown type of enter/leave event occurred.
362  */
363 typedef enum
364 {
365   GDK_NOTIFY_ANCESTOR           = 0,
366   GDK_NOTIFY_VIRTUAL            = 1,
367   GDK_NOTIFY_INFERIOR           = 2,
368   GDK_NOTIFY_NONLINEAR          = 3,
369   GDK_NOTIFY_NONLINEAR_VIRTUAL  = 4,
370   GDK_NOTIFY_UNKNOWN            = 5
371 } GdkNotifyType;
372
373 /* Types of modifiers.
374  */
375 typedef enum
376 {
377   GDK_SHIFT_MASK    = 1 << 0,
378   GDK_LOCK_MASK     = 1 << 1,
379   GDK_CONTROL_MASK  = 1 << 2,
380   GDK_MOD1_MASK     = 1 << 3,
381   GDK_MOD2_MASK     = 1 << 4,
382   GDK_MOD3_MASK     = 1 << 5,
383   GDK_MOD4_MASK     = 1 << 6,
384   GDK_MOD5_MASK     = 1 << 7,
385   GDK_BUTTON1_MASK  = 1 << 8,
386   GDK_BUTTON2_MASK  = 1 << 9,
387   GDK_BUTTON3_MASK  = 1 << 10,
388   GDK_BUTTON4_MASK  = 1 << 11,
389   GDK_BUTTON5_MASK  = 1 << 12
390 } GdkModifierType;
391
392 typedef enum
393 {
394   GDK_CLIP_BY_CHILDREN  = 0,
395   GDK_INCLUDE_INFERIORS = 1
396 } GdkSubwindowMode;
397
398 typedef enum
399 {
400   GDK_INPUT_READ       = 1 << 0,
401   GDK_INPUT_WRITE      = 1 << 1,
402   GDK_INPUT_EXCEPTION  = 1 << 2
403 } GdkInputCondition;
404
405 typedef enum
406 {
407   GDK_OK          = 0,
408   GDK_ERROR       = -1,
409   GDK_ERROR_PARAM = -2,
410   GDK_ERROR_FILE  = -3,
411   GDK_ERROR_MEM   = -4
412 } GdkStatus;
413
414 typedef enum
415 {
416   GDK_LSB_FIRST,
417   GDK_MSB_FIRST
418 } GdkByteOrder;
419
420 typedef enum
421 {
422   GDK_GC_FOREGROUND    = 1 << 0,
423   GDK_GC_BACKGROUND    = 1 << 1,
424   GDK_GC_FONT          = 1 << 2,
425   GDK_GC_FUNCTION      = 1 << 3,
426   GDK_GC_FILL          = 1 << 4,
427   GDK_GC_TILE          = 1 << 5,
428   GDK_GC_STIPPLE       = 1 << 6,
429   GDK_GC_CLIP_MASK     = 1 << 7,
430   GDK_GC_SUBWINDOW     = 1 << 8,
431   GDK_GC_TS_X_ORIGIN   = 1 << 9,
432   GDK_GC_TS_Y_ORIGIN   = 1 << 10,
433   GDK_GC_CLIP_X_ORIGIN = 1 << 11,
434   GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
435   GDK_GC_EXPOSURES     = 1 << 13,
436   GDK_GC_LINE_WIDTH    = 1 << 14,
437   GDK_GC_LINE_STYLE    = 1 << 15,
438   GDK_GC_CAP_STYLE     = 1 << 16,
439   GDK_GC_JOIN_STYLE    = 1 << 17
440 } GdkGCValuesMask;
441
442 typedef enum
443 {
444   GDK_SELECTION_PRIMARY = 1,
445   GDK_SELECTION_SECONDARY = 2
446 } GdkSelection;
447
448 typedef enum
449 {
450   GDK_PROPERTY_NEW_VALUE,
451   GDK_PROPERTY_DELETE
452 } GdkPropertyState;
453
454 typedef enum
455 {
456   GDK_PROP_MODE_REPLACE,
457   GDK_PROP_MODE_PREPEND,
458   GDK_PROP_MODE_APPEND
459 } GdkPropMode;
460
461 /* These definitions are for version 1 of the OffiX D&D protocol,
462    taken from <OffiX/DragAndDropTypes.h> */
463 typedef enum
464 {
465   GDK_DNDTYPE_NOTDND = -1,
466   GDK_DNDTYPE_UNKNOWN = 0,
467   GDK_DNDTYPE_RAWDATA = 1,
468   GDK_DNDTYPE_FILE = 2,
469   GDK_DNDTYPE_FILES = 3,
470   GDK_DNDTYPE_TEXT = 4,
471   GDK_DNDTYPE_DIR = 5,
472   GDK_DNDTYPE_LINK = 6,
473   GDK_DNDTYPE_EXE = 7,
474   GDK_DNDTYPE_URL = 8,
475   GDK_DNDTYPE_MIME = 9,
476   GDK_DNDTYPE_END = 10
477 } GdkDndType;
478
479 /* Enums for XInput support */
480
481 typedef enum
482 {
483   GDK_SOURCE_MOUSE,
484   GDK_SOURCE_PEN,
485   GDK_SOURCE_ERASER,
486   GDK_SOURCE_CURSOR
487 } GdkInputSource;
488
489 typedef enum
490 {
491   GDK_MODE_DISABLED,
492   GDK_MODE_SCREEN,
493   GDK_MODE_WINDOW
494 } GdkInputMode;
495
496 typedef enum
497 {
498   GDK_AXIS_IGNORE,
499   GDK_AXIS_X,
500   GDK_AXIS_Y,
501   GDK_AXIS_PRESSURE,
502   GDK_AXIS_XTILT,
503   GDK_AXIS_YTILT,
504   GDK_AXIS_LAST
505 } GdkAxisUse;
506
507 /* The next two types define enums for predefined atoms relating
508    to selections. In general, one will need to use gdk_intern_atom */
509
510 typedef enum
511 {
512   GDK_TARGET_BITMAP = 5,
513   GDK_TARGET_COLORMAP = 7,
514   GDK_TARGET_DRAWABLE = 17,
515   GDK_TARGET_PIXMAP = 20,
516   GDK_TARGET_STRING = 31
517 } GdkTarget;
518
519 typedef enum
520 {
521   GDK_SELECTION_TYPE_ATOM = 4,
522   GDK_SELECTION_TYPE_BITMAP = 5,
523   GDK_SELECTION_TYPE_COLORMAP = 7,
524   GDK_SELECTION_TYPE_DRAWABLE = 17,
525   GDK_SELECTION_TYPE_INTEGER = 19,
526   GDK_SELECTION_TYPE_PIXMAP = 20,
527   GDK_SELECTION_TYPE_WINDOW = 33,
528   GDK_SELECTION_TYPE_STRING = 31
529 } GdkSelectionType;
530
531 typedef enum
532 {
533   GDK_EXTENSION_EVENTS_NONE,
534   GDK_EXTENSION_EVENTS_ALL,
535   GDK_EXTENSION_EVENTS_CURSOR
536 } GdkExtensionMode;
537
538 typedef void (*GdkInputFunction) (gpointer          data,
539                                   gint              source,
540                                   GdkInputCondition condition);
541
542 /* The color type.
543  *   A color consists of red, green and blue values in the
544  *    range 0-65535 and a pixel value. The pixel value is highly
545  *    dependent on the depth and colormap which this color will
546  *    be used to draw into. Therefore, sharing colors between
547  *    colormaps is a bad idea.
548  */
549 struct _GdkColor
550 {
551   gulong  pixel;
552   gushort red;
553   gushort green;
554   gushort blue;
555 };
556
557 /* The colormap type.
558  *   Colormaps consist of 256 colors.
559  */
560 struct _GdkColormap
561 {
562   GdkColor colors[256];
563 };
564
565 /* The visual type.
566  *   "type" is the type of visual this is (PseudoColor, TrueColor, etc).
567  *   "depth" is the bit depth of this visual.
568  *   "colormap_size" is the size of a colormap for this visual.
569  *   "bits_per_rgb" is the number of significant bits per red, green and blue.
570  *  The red, green and blue masks, shifts and precisions refer
571  *   to value needed to calculate pixel values in TrueColor and DirectColor
572  *   visuals. The "mask" is the significant bits within the pixel. The
573  *   "shift" is the number of bits left we must shift a primary for it
574  *   to be in position (according to the "mask"). "prec" refers to how
575  *   much precision the pixel value contains for a particular primary.
576  */
577 struct _GdkVisual
578 {
579   GdkVisualType type;
580   gint depth;
581   GdkByteOrder byte_order;
582   gint colormap_size;
583   gint bits_per_rgb;
584
585   guint32 red_mask;
586   gint red_shift;
587   gint red_prec;
588
589   guint32 green_mask;
590   gint green_shift;
591   gint green_prec;
592
593   guint32 blue_mask;
594   gint blue_shift;
595   gint blue_prec;
596 };
597
598 struct _GdkWindowAttr
599 {
600   gchar *title;
601   gint event_mask;
602   gint16 x, y;
603   gint16 width;
604   gint16 height;
605   GdkWindowClass wclass;
606   GdkVisual *visual;
607   GdkColormap *colormap;
608   GdkWindowType window_type;
609   GdkCursor *cursor;
610   gchar *wmclass_name;
611   gchar *wmclass_class;
612 };
613
614 struct _GdkWindow
615 {
616   gpointer user_data;
617 };
618
619 struct _GdkImage
620 {
621   GdkImageType  type;
622   GdkVisual    *visual;     /* visual used to create the image */
623   GdkByteOrder  byte_order;
624   guint16       width;
625   guint16       height;
626   guint16       depth;
627   guint16       bpp;        /* bytes per pixel */
628   guint16       bpl;        /* bytes per line */
629   gpointer      mem;
630 };
631
632 struct _GdkGCValues
633 {
634   GdkColor          foreground;
635   GdkColor          background;
636   GdkFont          *font;
637   GdkFunction       function;
638   GdkFill           fill;
639   GdkPixmap        *tile;
640   GdkPixmap        *stipple;
641   GdkPixmap        *clip_mask;
642   GdkSubwindowMode  subwindow_mode;
643   gint              ts_x_origin;
644   gint              ts_y_origin;
645   gint              clip_x_origin;
646   gint              clip_y_origin;
647   gint              graphics_exposures;
648   gint              line_width;
649   GdkLineStyle      line_style;
650   GdkCapStyle       cap_style;
651   GdkJoinStyle      join_style;
652 };
653
654 struct _GdkGC
655 {
656   gint dummy_var;
657 };
658
659 struct _GdkPoint
660 {
661   gint16 x;
662   gint16 y;
663 };
664
665 struct _GdkRectangle
666 {
667   gint16 x;
668   gint16 y;
669   guint16 width;
670   guint16 height;
671 };
672
673 struct _GdkSegment
674 {
675   gint16 x1;
676   gint16 y1;
677   gint16 x2;
678   gint16 y2;
679 };
680
681 struct _GdkFont
682 {
683   GdkFontType type;
684   gint ascent;
685   gint descent;
686 };
687
688 struct _GdkCursor
689 {
690   GdkCursorType type;
691 };
692
693 /* Types for XInput support */
694
695 struct _GdkDeviceInfo
696 {
697   guint32 deviceid;
698   gchar *name;
699   GdkInputSource source;
700   GdkInputMode mode;
701   gint has_cursor;      /* TRUE if the X pointer follows device motion */
702   gint num_axes;
703   GdkAxisUse *axes;    /* Specifies use for each axis */
704 };
705
706 struct _GdkTimeCoord
707 {
708   guint32 time;
709   gdouble x;
710   gdouble y;
711   gdouble pressure;
712   gdouble xtilt;
713   gdouble ytilt;
714 };
715
716 struct _GdkEventAny
717 {
718   GdkEventType type;
719   GdkWindow *window;
720   gint8 send_event;
721 };
722
723 struct _GdkEventExpose
724 {
725   GdkEventType type;
726   GdkWindow *window;
727   GdkRectangle area;
728   gint count; /* If non-zero, how many more events follow. */
729 };
730
731 struct _GdkEventMotion
732 {
733   GdkEventType type;
734   GdkWindow *window;
735   guint32 time;
736   gdouble x;
737   gdouble y;
738   gdouble pressure;
739   gdouble xtilt;
740   gdouble ytilt;
741   guint state;
742   gint16 is_hint;
743   GdkInputSource source;
744   guint32 deviceid;
745 };
746
747 struct _GdkEventButton
748 {
749   GdkEventType type;
750   GdkWindow *window;
751   guint32 time;
752   gdouble x;
753   gdouble y;
754   gdouble pressure;
755   gdouble xtilt;
756   gdouble ytilt;
757   guint state;
758   guint button;
759   GdkInputSource source;
760   guint32 deviceid;
761 };
762
763 struct _GdkEventKey
764 {
765   GdkEventType type;
766   GdkWindow *window;
767   guint32 time;
768   guint state;
769   guint keyval;
770 };
771
772 struct _GdkEventCrossing
773 {
774   GdkEventType type;
775   GdkWindow *window;
776   GdkWindow *subwindow;
777   GdkNotifyType detail;
778 };
779
780 struct _GdkEventFocus
781 {
782   GdkEventType type;
783   GdkWindow *window;
784   gint16 in;
785 };
786
787 struct _GdkEventConfigure
788 {
789   GdkEventType type;
790   GdkWindow *window;
791   gint16 x, y;
792   gint16 width;
793   gint16 height;
794 };
795
796 struct _GdkEventProperty
797 {
798   GdkEventType type;
799   GdkWindow *window;
800   GdkAtom atom;
801   guint32 time;
802   guint state;
803 };
804
805 struct _GdkEventSelection
806 {
807   GdkEventType type;
808   GdkWindow *window;
809   GdkAtom selection;
810   GdkAtom target;
811   GdkAtom property;
812   guint32 requestor;
813   guint32 time;
814 };
815
816 /* This event type will be used pretty rarely. It only is important
817    for XInput aware programs that are drawing their own cursor */
818
819 struct _GdkEventProximity
820 {
821   GdkEventType type;
822   GdkWindow *window;
823   guint32 time;
824   GdkInputSource source;
825   guint32 deviceid;
826 };
827
828 struct _GdkEventDragRequest
829 {
830   GdkEventType type;
831   GdkWindow *window;
832   guint32 requestor;
833   union {
834     struct {
835       guint protocol_version:4;
836       guint sendreply:1;
837       guint willaccept:1;
838       guint delete_data:1; /* Do *not* delete if link is sent, only
839                               if data is sent */
840       guint senddata:1;
841       guint reserved:22;
842     } flags;
843     glong allflags;
844   } u;
845   guint8 isdrop; /* This gdk event can be generated by a couple of
846                     X events - this lets the app know whether the
847                     drop really occurred or we just set the data */
848
849   GdkPoint drop_coords;
850   gchar *data_type;
851 };
852
853 struct _GdkEventDragBegin
854 {
855   GdkEventType type;
856   GdkWindow *window;
857   union {
858     struct {
859       guint protocol_version:4;
860       guint reserved:28;
861     } flags;
862     glong allflags;
863   } u;
864 };
865
866 struct _GdkEventDropEnter
867 {
868   GdkEventType type;
869   GdkWindow *window;
870   guint32 requestor;
871   union {
872     struct {
873       guint protocol_version:4;
874       guint sendreply:1;
875       guint extended_typelist:1;
876       guint reserved:26;
877     } flags;
878     glong allflags;
879   } u;
880 };
881
882 struct _GdkEventDropLeave
883 {
884   GdkEventType type;
885   GdkWindow *window;
886   guint32 requestor;
887   union {
888     struct {
889       guint protocol_version:4;
890       guint reserved:28;
891     } flags;
892     glong allflags;
893   } u;
894 };
895
896 struct _GdkEventDropDataAvailable
897 {
898   GdkEventType type;
899   GdkWindow *window;
900   guint32 requestor;
901   union {
902     struct {
903       guint protocol_version:4;
904       guint isdrop:1;
905       guint reserved:25;
906     } flags;
907     glong allflags;
908   } u;
909   gchar *data_type; /* MIME type */
910   gulong data_numbytes;
911   gpointer data;
912 };
913
914 struct _GdkEventClient
915 {
916   GdkEventType type;
917   GdkWindow *window;
918   GdkAtom message_type;
919   gushort data_format;
920   union {
921     char b[20];
922     short s[10];
923     long l[5];
924   } data;
925 };
926
927 #ifndef _XLIB_H_
928 #define XEvent void
929 #endif
930
931 struct _GdkEventOther
932 {
933   GdkEventType type;
934   GdkWindow *window;
935   XEvent *xevent;
936 };
937
938 union _GdkEvent
939 {
940   GdkEventType      type;
941   GdkEventAny       any;
942   GdkEventExpose    expose;
943   GdkEventMotion    motion;
944   GdkEventButton    button;
945   GdkEventKey       key;
946   GdkEventCrossing  crossing;
947   GdkEventFocus     focus_change;
948   GdkEventConfigure configure;
949   GdkEventProperty  property;
950   GdkEventSelection selection;
951   GdkEventProximity proximity;
952   GdkEventDragBegin dragbegin;
953   GdkEventDragRequest dragrequest;
954   GdkEventDropEnter dropenter;
955   GdkEventDropLeave dropleave;
956   GdkEventDropDataAvailable dropdataavailable;
957   GdkEventClient    client;
958   GdkEventOther     other;
959 };
960
961
962 #ifdef __cplusplus
963 }
964 #endif /* __cplusplus */
965
966
967 #endif /* __GDK_TYPES_H__ */