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