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