]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
67f9fb3533f7360196b8390150b1e8b4b8b3781e
[~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
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __GDK_TYPES_H__
20 #define __GDK_TYPES_H__
21
22
23 /* GDK uses "glib". (And so does GTK).
24  */
25 #include <glib.h>
26
27
28 #define GDK_NONE             0L
29 #define GDK_CURRENT_TIME     0L
30 #define GDK_PARENT_RELATIVE  1L
31
32 /* special deviceid for core pointer events */
33 #define GDK_CORE_POINTER 0xfedc
34
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif /* __cplusplus */
39
40
41 /* Type definitions for the basic structures.
42  */
43
44 typedef gulong                        GdkAtom;
45 typedef struct _GdkColor              GdkColor;
46 typedef struct _GdkColormap           GdkColormap;
47 typedef struct _GdkVisual             GdkVisual;
48 typedef struct _GdkWindowAttr         GdkWindowAttr;
49 typedef struct _GdkWindow             GdkWindow;
50 typedef struct _GdkWindow             GdkPixmap;
51 typedef struct _GdkWindow             GdkBitmap;
52 typedef struct _GdkWindow             GdkDrawable;
53 typedef struct _GdkImage              GdkImage;
54 typedef struct _GdkGCValues           GdkGCValues;
55 typedef struct _GdkGC                 GdkGC;
56 typedef struct _GdkPoint              GdkPoint;
57 typedef struct _GdkRectangle          GdkRectangle;
58 typedef struct _GdkSegment            GdkSegment;
59 typedef struct _GdkFont               GdkFont;
60 typedef struct _GdkCursor             GdkCursor;
61 typedef struct _GdkColorContextDither GdkColorContextDither;
62 typedef struct _GdkColorContext       GdkColorContext;
63
64 typedef struct _GdkEventAny         GdkEventAny;
65 typedef struct _GdkEventExpose      GdkEventExpose;
66 typedef struct _GdkEventNoExpose    GdkEventNoExpose;
67 typedef struct _GdkEventVisibility  GdkEventVisibility;
68 typedef struct _GdkEventMotion      GdkEventMotion;
69 typedef struct _GdkEventButton      GdkEventButton;
70 typedef struct _GdkEventKey         GdkEventKey;
71 typedef struct _GdkEventFocus       GdkEventFocus;
72 typedef struct _GdkEventCrossing    GdkEventCrossing;
73 typedef struct _GdkEventConfigure   GdkEventConfigure;
74 typedef struct _GdkEventProperty    GdkEventProperty;
75 typedef struct _GdkEventSelection   GdkEventSelection;
76 typedef struct _GdkEventProximity   GdkEventProximity;
77 typedef struct _GdkEventOther       GdkEventOther;
78 typedef struct _GdkEventDragBegin   GdkEventDragBegin;
79 typedef struct _GdkEventDragRequest GdkEventDragRequest;
80 typedef struct _GdkEventDropEnter   GdkEventDropEnter;
81 typedef struct _GdkEventDropDataAvailable GdkEventDropDataAvailable;
82 typedef struct _GdkEventDropLeave   GdkEventDropLeave;
83 typedef struct _GdkEventClient      GdkEventClient;
84 typedef union  _GdkEvent            GdkEvent;
85 typedef struct _GdkDeviceKey        GdkDeviceKey;
86 typedef struct _GdkDeviceInfo       GdkDeviceInfo;
87 typedef struct _GdkTimeCoord        GdkTimeCoord;
88 typedef struct _GdkRegion           GdkRegion;
89 typedef gint (*GdkEventFunc) (GdkEvent *event,
90                               gpointer  data);
91
92 typedef void*                     GdkIC;
93 typedef void*                     GdkIM;
94
95
96 /* Types of windows.
97  *   Root: There is only 1 root window and it is initialized
98  *         at startup. Creating a window of type GDK_WINDOW_ROOT
99  *         is an error.
100  *   Toplevel: Windows which interact with the window manager.
101  *   Child: Windows which are children of some other type of window.
102  *          (Any other type of window). Most windows are child windows.
103  *   Dialog: A special kind of toplevel window which interacts with
104  *           the window manager slightly differently than a regular
105  *           toplevel window. Dialog windows should be used for any
106  *           transient window.
107  *   Pixmap: Pixmaps are really just another kind of window which
108  *           doesn't actually appear on the screen. It can't have
109  *           children, either and is really just a convenience so
110  *           that the drawing functions can work on both windows
111  *           and pixmaps transparently. (ie. You shouldn't pass a
112  *           pixmap to any procedure which accepts a window with the
113  *           exception of the drawing functions).
114  *   Foreign: A window that actually belongs to another application
115  */
116 typedef enum
117 {
118   GDK_WINDOW_ROOT,
119   GDK_WINDOW_TOPLEVEL,
120   GDK_WINDOW_CHILD,
121   GDK_WINDOW_DIALOG,
122   GDK_WINDOW_TEMP,
123   GDK_WINDOW_PIXMAP,
124   GDK_WINDOW_FOREIGN
125 } GdkWindowType;
126
127 /* Classes of windows.
128  *   InputOutput: Almost every window should be of this type. Such windows
129  *                receive events and are also displayed on screen.
130  *   InputOnly: Used only in special circumstances when events need to be
131  *              stolen from another window or windows. Input only windows
132  *              have no visible output, so they are handy for placing over
133  *              top of a group of windows in order to grab the events (or
134  *              filter the events) from those windows.
135  */
136 typedef enum
137 {
138   GDK_INPUT_OUTPUT,
139   GDK_INPUT_ONLY
140 } GdkWindowClass;
141
142 /* Types of images.
143  *   Normal: Normal X image type. These are slow as they involve passing
144  *           the entire image through the X connection each time a draw
145  *           request is required.
146  *   Shared: Shared memory X image type. These are fast as the X server
147  *           and the program actually use the same piece of memory. They
148  *           should be used with care though as there is the possibility
149  *           for both the X server and the program to be reading/writing
150  *           the image simultaneously and producing undesired results.
151  */
152 typedef enum
153 {
154   GDK_IMAGE_NORMAL,
155   GDK_IMAGE_SHARED,
156   GDK_IMAGE_FASTEST
157 } GdkImageType;
158
159 /* Types of visuals.
160  *   StaticGray:
161  *   Grayscale:
162  *   StaticColor:
163  *   PseudoColor:
164  *   TrueColor:
165  *   DirectColor:
166  */
167 typedef enum
168 {
169   GDK_VISUAL_STATIC_GRAY,
170   GDK_VISUAL_GRAYSCALE,
171   GDK_VISUAL_STATIC_COLOR,
172   GDK_VISUAL_PSEUDO_COLOR,
173   GDK_VISUAL_TRUE_COLOR,
174   GDK_VISUAL_DIRECT_COLOR
175 } GdkVisualType;
176
177 /* Types of font.
178  *   GDK_FONT_FONT: the font is an XFontStruct.
179  *   GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
180  */
181 typedef enum
182 {
183   GDK_FONT_FONT,
184   GDK_FONT_FONTSET
185 } GdkFontType;
186
187 /* Window attribute mask values.
188  *   GDK_WA_TITLE: The "title" field is valid.
189  *   GDK_WA_X: The "x" field is valid.
190  *   GDK_WA_Y: The "y" field is valid.
191  *   GDK_WA_CURSOR: The "cursor" field is valid.
192  *   GDK_WA_COLORMAP: The "colormap" field is valid.
193  *   GDK_WA_VISUAL: The "visual" field is valid.
194  */
195 typedef enum
196 {
197   GDK_WA_TITLE    = 1 << 1,
198   GDK_WA_X        = 1 << 2,
199   GDK_WA_Y        = 1 << 3,
200   GDK_WA_CURSOR   = 1 << 4,
201   GDK_WA_COLORMAP = 1 << 5,
202   GDK_WA_VISUAL   = 1 << 6,
203   GDK_WA_WMCLASS  = 1 << 7,
204   GDK_WA_NOREDIR  = 1 << 8
205 } GdkWindowAttributesType;
206
207 /* Size restriction enumeration.
208  */
209 typedef enum
210 {
211   GDK_HINT_POS       = 1 << 0,
212   GDK_HINT_MIN_SIZE  = 1 << 1,
213   GDK_HINT_MAX_SIZE  = 1 << 2
214 } GdkWindowHints;
215
216 /* GC function types.
217  *   Copy: Overwrites destination pixels with the source pixels.
218  *   Invert: Inverts the destination pixels.
219  *   Xor: Xor's the destination pixels with the source pixels.
220  *   Clear: set pixels to 0
221  *   And: source AND destination
222  *   And Reverse: source AND (NOT destination)
223  *   And Invert: (NOT source) AND destination
224  *   Noop: destination
225  *   Or: source OR destination
226  *   Nor: (NOT source) AND (NOT destination)
227  *   Equiv: (NOT source) XOR destination
228  *   Xor Reverse: source OR (NOT destination)
229  *   Copy Inverted: NOT source
230  *   Xor Inverted: (NOT source) OR destination
231  *   Nand: (NOT source) OR (NOT destination)
232  *   Set: set pixels to 1
233  */
234 typedef enum
235 {
236   GDK_COPY,
237   GDK_INVERT,
238   GDK_XOR,
239   GDK_CLEAR,
240   GDK_AND,
241   GDK_AND_REVERSE,
242   GDK_AND_INVERT,
243   GDK_NOOP,
244   GDK_OR,
245   GDK_EQUIV,
246   GDK_OR_REVERSE,
247   GDK_COPY_INVERT,
248   GDK_OR_INVERT,
249   GDK_NAND,
250   GDK_SET
251 } GdkFunction;
252
253 /* GC fill types.
254  *  Solid:
255  *  Tiled:
256  *  Stippled:
257  *  OpaqueStippled:
258  */
259 typedef enum
260 {
261   GDK_SOLID,
262   GDK_TILED,
263   GDK_STIPPLED,
264   GDK_OPAQUE_STIPPLED
265 } GdkFill;
266
267 /* GC fill rule for polygons
268  *  EvenOddRule
269  *  WindingRule
270  */
271 typedef enum
272 {
273   GDK_EVEN_ODD_RULE,
274   GDK_WINDING_RULE
275 } GdkFillRule;
276
277 /* GC line styles
278  *  Solid:
279  *  OnOffDash:
280  *  DoubleDash:
281  */
282 typedef enum
283 {
284   GDK_LINE_SOLID,
285   GDK_LINE_ON_OFF_DASH,
286   GDK_LINE_DOUBLE_DASH
287 } GdkLineStyle;
288
289 /* GC cap styles
290  *  CapNotLast:
291  *  CapButt:
292  *  CapRound:
293  *  CapProjecting:
294  */
295 typedef enum
296 {
297   GDK_CAP_NOT_LAST,
298   GDK_CAP_BUTT,
299   GDK_CAP_ROUND,
300   GDK_CAP_PROJECTING
301 } GdkCapStyle;
302
303 /* GC join styles
304  *  JoinMiter:
305  *  JoinRound:
306  *  JoinBevel:
307  */
308 typedef enum
309 {
310   GDK_JOIN_MITER,
311   GDK_JOIN_ROUND,
312   GDK_JOIN_BEVEL
313 } GdkJoinStyle;
314
315 /* Cursor types.
316  */
317 typedef enum
318 {
319 #include <gdk/gdkcursors.h>
320   GDK_LAST_CURSOR,
321   GDK_CURSOR_IS_PIXMAP = -1
322 } GdkCursorType;
323
324 typedef enum {
325   GDK_FILTER_CONTINUE,    /* Event not handled, continue processesing */
326   GDK_FILTER_TRANSLATE,   /* Translated event stored */
327   GDK_FILTER_REMOVE       /* Terminate processing, removing event */
328 } GdkFilterReturn;
329
330 typedef enum {
331   GDK_VISIBILITY_UNOBSCURED,
332   GDK_VISIBILITY_PARTIAL,
333   GDK_VISIBILITY_FULLY_OBSCURED
334 } GdkVisibilityState;
335
336 /* Event types.
337  *   Nothing: No event occurred.
338  *   Delete: A window delete event was sent by the window manager.
339  *           The specified window should be deleted.
340  *   Destroy: A window has been destroyed.
341  *   Expose: Part of a window has been uncovered.
342  *   NoExpose: Same as expose, but no expose event was generated.
343  *   VisibilityNotify: A window has become fully/partially/not obscured.
344  *   MotionNotify: The mouse has moved.
345  *   ButtonPress: A mouse button was pressed.
346  *   ButtonRelease: A mouse button was release.
347  *   KeyPress: A key was pressed.
348  *   KeyRelease: A key was released.
349  *   EnterNotify: A window was entered.
350  *   LeaveNotify: A window was exited.
351  *   FocusChange: The focus window has changed. (The focus window gets
352  *                keyboard events).
353  *   Resize: A window has been resized.
354  *   Map: A window has been mapped. (It is now visible on the screen).
355  *   Unmap: A window has been unmapped. (It is no longer visible on
356  *          the screen).
357  */
358 typedef enum
359 {
360   GDK_NOTHING           = -1,
361   GDK_DELETE            = 0,
362   GDK_DESTROY           = 1,
363   GDK_EXPOSE            = 2,
364   GDK_MOTION_NOTIFY     = 3,
365   GDK_BUTTON_PRESS      = 4,
366   GDK_2BUTTON_PRESS     = 5,
367   GDK_3BUTTON_PRESS     = 6,
368   GDK_BUTTON_RELEASE    = 7,
369   GDK_KEY_PRESS         = 8,
370   GDK_KEY_RELEASE       = 9,
371   GDK_ENTER_NOTIFY      = 10,
372   GDK_LEAVE_NOTIFY      = 11,
373   GDK_FOCUS_CHANGE      = 12,
374   GDK_CONFIGURE         = 13,
375   GDK_MAP               = 14,
376   GDK_UNMAP             = 15,
377   GDK_PROPERTY_NOTIFY   = 16,
378   GDK_SELECTION_CLEAR   = 17,
379   GDK_SELECTION_REQUEST = 18,
380   GDK_SELECTION_NOTIFY  = 19,
381   GDK_PROXIMITY_IN      = 20,
382   GDK_PROXIMITY_OUT     = 21,
383   GDK_DRAG_BEGIN        = 22,
384   GDK_DRAG_REQUEST      = 23,
385   GDK_DROP_ENTER        = 24,
386   GDK_DROP_LEAVE        = 25,
387   GDK_DROP_DATA_AVAIL   = 26,
388   GDK_CLIENT_EVENT      = 27,
389   GDK_VISIBILITY_NOTIFY = 28,
390   GDK_NO_EXPOSE         = 29,
391   GDK_OTHER_EVENT       = 9999  /* Deprecated, use filters instead */
392 } GdkEventType;
393
394 /* Event masks. (Used to select what types of events a window
395  *  will receive).
396  */
397 typedef enum
398 {
399   GDK_EXPOSURE_MASK             = 1 << 1,
400   GDK_POINTER_MOTION_MASK       = 1 << 2,
401   GDK_POINTER_MOTION_HINT_MASK  = 1 << 3,
402   GDK_BUTTON_MOTION_MASK        = 1 << 4,
403   GDK_BUTTON1_MOTION_MASK       = 1 << 5,
404   GDK_BUTTON2_MOTION_MASK       = 1 << 6,
405   GDK_BUTTON3_MOTION_MASK       = 1 << 7,
406   GDK_BUTTON_PRESS_MASK         = 1 << 8,
407   GDK_BUTTON_RELEASE_MASK       = 1 << 9,
408   GDK_KEY_PRESS_MASK            = 1 << 10,
409   GDK_KEY_RELEASE_MASK          = 1 << 11,
410   GDK_ENTER_NOTIFY_MASK         = 1 << 12,
411   GDK_LEAVE_NOTIFY_MASK         = 1 << 13,
412   GDK_FOCUS_CHANGE_MASK         = 1 << 14,
413   GDK_STRUCTURE_MASK            = 1 << 15,
414   GDK_PROPERTY_CHANGE_MASK      = 1 << 16,
415   GDK_VISIBILITY_NOTIFY_MASK    = 1 << 17,
416   GDK_PROXIMITY_IN_MASK         = 1 << 18,
417   GDK_PROXIMITY_OUT_MASK        = 1 << 19,
418   GDK_SUBSTRUCTURE_MASK         = 1 << 20,
419   GDK_ALL_EVENTS_MASK           = 0x0FFFFF
420 } GdkEventMask;
421
422 /* Types of enter/leave notifications.
423  *   Ancestor:
424  *   Virtual:
425  *   Inferior:
426  *   Nonlinear:
427  *   NonlinearVirtual:
428  *   Unknown: An unknown type of enter/leave event occurred.
429  */
430 typedef enum
431 {
432   GDK_NOTIFY_ANCESTOR           = 0,
433   GDK_NOTIFY_VIRTUAL            = 1,
434   GDK_NOTIFY_INFERIOR           = 2,
435   GDK_NOTIFY_NONLINEAR          = 3,
436   GDK_NOTIFY_NONLINEAR_VIRTUAL  = 4,
437   GDK_NOTIFY_UNKNOWN            = 5
438 } GdkNotifyType;
439
440 /* Enter/leave event modes.
441  *   NotifyNormal
442  *   NotifyGrab
443  *   NotifyUngrab
444  */
445 typedef enum
446 {
447   GDK_CROSSING_NORMAL,
448   GDK_CROSSING_GRAB,
449   GDK_CROSSING_UNGRAB
450 } GdkCrossingMode;
451
452 /* Types of modifiers.
453  */
454 typedef enum
455 {
456   GDK_SHIFT_MASK    = 1 << 0,
457   GDK_LOCK_MASK     = 1 << 1,
458   GDK_CONTROL_MASK  = 1 << 2,
459   GDK_MOD1_MASK     = 1 << 3,
460   GDK_MOD2_MASK     = 1 << 4,
461   GDK_MOD3_MASK     = 1 << 5,
462   GDK_MOD4_MASK     = 1 << 6,
463   GDK_MOD5_MASK     = 1 << 7,
464   GDK_BUTTON1_MASK  = 1 << 8,
465   GDK_BUTTON2_MASK  = 1 << 9,
466   GDK_BUTTON3_MASK  = 1 << 10,
467   GDK_BUTTON4_MASK  = 1 << 11,
468   GDK_BUTTON5_MASK  = 1 << 12,
469   GDK_RELEASE_MASK  = 1 << 13,
470   GDK_MODIFIER_MASK = 0x3fff
471 } GdkModifierType;
472
473 typedef enum
474 {
475   GDK_CLIP_BY_CHILDREN  = 0,
476   GDK_INCLUDE_INFERIORS = 1
477 } GdkSubwindowMode;
478
479 typedef enum
480 {
481   GDK_INPUT_READ       = 1 << 0,
482   GDK_INPUT_WRITE      = 1 << 1,
483   GDK_INPUT_EXCEPTION  = 1 << 2
484 } GdkInputCondition;
485
486 typedef enum
487 {
488   GDK_OK          = 0,
489   GDK_ERROR       = -1,
490   GDK_ERROR_PARAM = -2,
491   GDK_ERROR_FILE  = -3,
492   GDK_ERROR_MEM   = -4
493 } GdkStatus;
494
495 typedef enum
496 {
497   GDK_LSB_FIRST,
498   GDK_MSB_FIRST
499 } GdkByteOrder;
500
501 typedef enum
502 {
503   GDK_GC_FOREGROUND    = 1 << 0,
504   GDK_GC_BACKGROUND    = 1 << 1,
505   GDK_GC_FONT          = 1 << 2,
506   GDK_GC_FUNCTION      = 1 << 3,
507   GDK_GC_FILL          = 1 << 4,
508   GDK_GC_TILE          = 1 << 5,
509   GDK_GC_STIPPLE       = 1 << 6,
510   GDK_GC_CLIP_MASK     = 1 << 7,
511   GDK_GC_SUBWINDOW     = 1 << 8,
512   GDK_GC_TS_X_ORIGIN   = 1 << 9,
513   GDK_GC_TS_Y_ORIGIN   = 1 << 10,
514   GDK_GC_CLIP_X_ORIGIN = 1 << 11,
515   GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
516   GDK_GC_EXPOSURES     = 1 << 13,
517   GDK_GC_LINE_WIDTH    = 1 << 14,
518   GDK_GC_LINE_STYLE    = 1 << 15,
519   GDK_GC_CAP_STYLE     = 1 << 16,
520   GDK_GC_JOIN_STYLE    = 1 << 17
521 } GdkGCValuesMask;
522
523 typedef enum
524 {
525   GDK_SELECTION_PRIMARY = 1,
526   GDK_SELECTION_SECONDARY = 2
527 } GdkSelection;
528
529 typedef enum
530 {
531   GDK_PROPERTY_NEW_VALUE,
532   GDK_PROPERTY_DELETE
533 } GdkPropertyState;
534
535 typedef enum
536 {
537   GDK_PROP_MODE_REPLACE,
538   GDK_PROP_MODE_PREPEND,
539   GDK_PROP_MODE_APPEND
540 } GdkPropMode;
541
542 /* These definitions are for version 1 of the OffiX D&D protocol,
543    taken from <OffiX/DragAndDropTypes.h> */
544 typedef enum
545 {
546   GDK_DNDTYPE_NOTDND = -1,
547   GDK_DNDTYPE_UNKNOWN = 0,
548   GDK_DNDTYPE_RAWDATA = 1,
549   GDK_DNDTYPE_FILE = 2,
550   GDK_DNDTYPE_FILES = 3,
551   GDK_DNDTYPE_TEXT = 4,
552   GDK_DNDTYPE_DIR = 5,
553   GDK_DNDTYPE_LINK = 6,
554   GDK_DNDTYPE_EXE = 7,
555   GDK_DNDTYPE_URL = 8,
556   GDK_DNDTYPE_MIME = 9,
557   GDK_DNDTYPE_END = 10
558 } GdkDndType;
559
560 /* Enums for XInput support */
561
562 typedef enum
563 {
564   GDK_SOURCE_MOUSE,
565   GDK_SOURCE_PEN,
566   GDK_SOURCE_ERASER,
567   GDK_SOURCE_CURSOR
568 } GdkInputSource;
569
570 typedef enum
571 {
572   GDK_MODE_DISABLED,
573   GDK_MODE_SCREEN,
574   GDK_MODE_WINDOW
575 } GdkInputMode;
576
577 typedef enum
578 {
579   GDK_AXIS_IGNORE,
580   GDK_AXIS_X,
581   GDK_AXIS_Y,
582   GDK_AXIS_PRESSURE,
583   GDK_AXIS_XTILT,
584   GDK_AXIS_YTILT,
585   GDK_AXIS_LAST
586 } GdkAxisUse;
587
588 /* The next two types define enums for predefined atoms relating
589    to selections. In general, one will need to use gdk_intern_atom */
590
591 typedef enum
592 {
593   GDK_TARGET_BITMAP = 5,
594   GDK_TARGET_COLORMAP = 7,
595   GDK_TARGET_DRAWABLE = 17,
596   GDK_TARGET_PIXMAP = 20,
597   GDK_TARGET_STRING = 31
598 } GdkTarget;
599
600 typedef enum
601 {
602   GDK_SELECTION_TYPE_ATOM = 4,
603   GDK_SELECTION_TYPE_BITMAP = 5,
604   GDK_SELECTION_TYPE_COLORMAP = 7,
605   GDK_SELECTION_TYPE_DRAWABLE = 17,
606   GDK_SELECTION_TYPE_INTEGER = 19,
607   GDK_SELECTION_TYPE_PIXMAP = 20,
608   GDK_SELECTION_TYPE_WINDOW = 33,
609   GDK_SELECTION_TYPE_STRING = 31
610 } GdkSelectionType;
611
612 typedef enum
613 {
614   GDK_EXTENSION_EVENTS_NONE,
615   GDK_EXTENSION_EVENTS_ALL,
616   GDK_EXTENSION_EVENTS_CURSOR
617 } GdkExtensionMode;
618
619 typedef enum                    /*< flags >*/
620 {
621   GDK_IM_PREEDIT_AREA      = 0x0001, 
622   GDK_IM_PREEDIT_CALLBACKS = 0x0002, 
623   GDK_IM_PREEDIT_POSITION  = 0x0004,
624   GDK_IM_PREEDIT_NOTHING   = 0x0008,
625   GDK_IM_PREEDIT_NONE      = 0x0010,
626   GDK_IM_PREEDIT_MASK      = 0x001f,
627
628   GDK_IM_STATUS_AREA       = 0x0100, 
629   GDK_IM_STATUS_CALLBACKS  = 0x0200,
630   GDK_IM_STATUS_NOTHING    = 0x0400,
631   GDK_IM_STATUS_NONE       = 0x0800,
632   GDK_IM_STATUS_MASK       = 0x0f00 
633 } GdkIMStyle;
634
635 /* The next two enumeration values current match the
636  * Motif constants. If this is changed, the implementation
637  * of gdk_window_set_decorations/gdk_window_set_functions
638  * will need to change as well.
639  */
640 typedef enum
641 {
642   GDK_DECOR_ALL         = 1 << 0,
643   GDK_DECOR_BORDER      = 1 << 1,
644   GDK_DECOR_RESIZEH     = 1 << 2,
645   GDK_DECOR_TITLE       = 1 << 3,
646   GDK_DECOR_MENU        = 1 << 4,
647   GDK_DECOR_MINIMIZE    = 1 << 5,
648   GDK_DECOR_MAXIMIZE    = 1 << 6
649 } GdkWMDecoration;
650
651 typedef enum
652 {
653   GDK_FUNC_ALL          = 1 << 0,
654   GDK_FUNC_RESIZE       = 1 << 1,
655   GDK_FUNC_MOVE         = 1 << 2,
656   GDK_FUNC_MINIMIZE     = 1 << 3,
657   GDK_FUNC_MAXIMIZE     = 1 << 4,
658   GDK_FUNC_CLOSE        = 1 << 5
659 } GdkWMFunction;
660
661 typedef void (*GdkInputFunction) (gpointer          data,
662                                   gint              source,
663                                   GdkInputCondition condition);
664
665 typedef void (*GdkDestroyNotify) (gpointer data);
666
667 /* Color Context modes.
668  *
669  * GDK_CC_MODE_UNDEFINED - unknown
670  * GDK_CC_MODE_BW        - default B/W
671  * GDK_CC_MODE_STD_CMAP  - has a standard colormap
672  * GDK_CC_MODE_TRUE      - is a TrueColor/DirectColor visual
673  * GDK_CC_MODE_MY_GRAY   - my grayramp
674  * GDK_CC_MODE_PALETTE   - has a pre-allocated palette
675  */ 
676
677 typedef enum
678 {
679   GDK_CC_MODE_UNDEFINED,
680   GDK_CC_MODE_BW,
681   GDK_CC_MODE_STD_CMAP,
682   GDK_CC_MODE_TRUE,
683   GDK_CC_MODE_MY_GRAY,
684   GDK_CC_MODE_PALETTE
685 } GdkColorContextMode;
686
687 /* Types of overlapping between a rectangle and a region
688  * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
689  * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
690  * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
691  */
692
693 typedef enum
694 {
695   GDK_OVERLAP_RECTANGLE_IN,
696   GDK_OVERLAP_RECTANGLE_OUT,
697   GDK_OVERLAP_RECTANGLE_PART
698 } GdkOverlapType;
699
700 /* The color type.
701  *   A color consists of red, green and blue values in the
702  *    range 0-65535 and a pixel value. The pixel value is highly
703  *    dependent on the depth and colormap which this color will
704  *    be used to draw into. Therefore, sharing colors between
705  *    colormaps is a bad idea.
706  */
707 struct _GdkColor
708 {
709   gulong  pixel;
710   gushort red;
711   gushort green;
712   gushort blue;
713 };
714
715 /* The colormap type.
716  *   Colormaps consist of 256 colors.
717  */
718 struct _GdkColormap
719 {
720   gint      size;
721   GdkColor *colors;
722 };
723
724 /* The visual type.
725  *   "type" is the type of visual this is (PseudoColor, TrueColor, etc).
726  *   "depth" is the bit depth of this visual.
727  *   "colormap_size" is the size of a colormap for this visual.
728  *   "bits_per_rgb" is the number of significant bits per red, green and blue.
729  *  The red, green and blue masks, shifts and precisions refer
730  *   to value needed to calculate pixel values in TrueColor and DirectColor
731  *   visuals. The "mask" is the significant bits within the pixel. The
732  *   "shift" is the number of bits left we must shift a primary for it
733  *   to be in position (according to the "mask"). "prec" refers to how
734  *   much precision the pixel value contains for a particular primary.
735  */
736 struct _GdkVisual
737 {
738   GdkVisualType type;
739   gint depth;
740   GdkByteOrder byte_order;
741   gint colormap_size;
742   gint bits_per_rgb;
743
744   guint32 red_mask;
745   gint red_shift;
746   gint red_prec;
747
748   guint32 green_mask;
749   gint green_shift;
750   gint green_prec;
751
752   guint32 blue_mask;
753   gint blue_shift;
754   gint blue_prec;
755 };
756
757 struct _GdkWindowAttr
758 {
759   gchar *title;
760   gint event_mask;
761   gint16 x, y;
762   gint16 width;
763   gint16 height;
764   GdkWindowClass wclass;
765   GdkVisual *visual;
766   GdkColormap *colormap;
767   GdkWindowType window_type;
768   GdkCursor *cursor;
769   gchar *wmclass_name;
770   gchar *wmclass_class;
771   gboolean override_redirect;
772 };
773
774 struct _GdkWindow
775 {
776   gpointer user_data;
777 };
778
779 struct _GdkImage
780 {
781   GdkImageType  type;
782   GdkVisual    *visual;     /* visual used to create the image */
783   GdkByteOrder  byte_order;
784   guint16       width;
785   guint16       height;
786   guint16       depth;
787   guint16       bpp;        /* bytes per pixel */
788   guint16       bpl;        /* bytes per line */
789   gpointer      mem;
790 };
791
792 struct _GdkGCValues
793 {
794   GdkColor          foreground;
795   GdkColor          background;
796   GdkFont          *font;
797   GdkFunction       function;
798   GdkFill           fill;
799   GdkPixmap        *tile;
800   GdkPixmap        *stipple;
801   GdkPixmap        *clip_mask;
802   GdkSubwindowMode  subwindow_mode;
803   gint              ts_x_origin;
804   gint              ts_y_origin;
805   gint              clip_x_origin;
806   gint              clip_y_origin;
807   gint              graphics_exposures;
808   gint              line_width;
809   GdkLineStyle      line_style;
810   GdkCapStyle       cap_style;
811   GdkJoinStyle      join_style;
812 };
813
814 struct _GdkGC
815 {
816   gint dummy_var;
817 };
818
819 struct _GdkPoint
820 {
821   gint16 x;
822   gint16 y;
823 };
824
825 struct _GdkRectangle
826 {
827   gint16 x;
828   gint16 y;
829   guint16 width;
830   guint16 height;
831 };
832
833 struct _GdkSegment
834 {
835   gint16 x1;
836   gint16 y1;
837   gint16 x2;
838   gint16 y2;
839 };
840
841 struct _GdkFont
842 {
843   GdkFontType type;
844   gint ascent;
845   gint descent;
846 };
847
848 struct _GdkCursor
849 {
850   GdkCursorType type;
851 };
852
853 struct _GdkColorContextDither
854 {
855   gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
856   gint fast_err[32][32][32]; /* internal RGB error information */
857   gint fast_erg[32][32][32];
858   gint fast_erb[32][32][32];
859 };
860
861 struct _GdkColorContext
862 {
863   GdkVisual *visual;
864   GdkColormap *colormap;
865
866   gint num_colors;              /* available no. of colors in colormap */
867   gint max_colors;              /* maximum no. of colors */
868   gint num_allocated;           /* no. of allocated colors */
869
870   GdkColorContextMode mode;
871   gint need_to_free_colormap;
872   GdkAtom std_cmap_atom;
873
874   gulong *clut;                 /* color look-up table */
875   GdkColor *cmap;               /* colormap */
876
877   GHashTable *color_hash;       /* hash table of allocated colors */
878   GdkColor *palette;            /* preallocated palette */
879   gint num_palette;             /* size of palette */
880
881   GdkColorContextDither *fast_dither;   /* fast dither matrix */
882
883   struct
884   {
885     gint red;
886     gint green;
887     gint blue;
888   } shifts;
889
890   struct
891   {
892     gulong red;
893     gulong green;
894     gulong blue;
895   } masks;
896
897   struct
898   {
899     gint red;
900     gint green;
901     gint blue;
902   } bits;
903
904   gulong max_entry;
905
906   gulong black_pixel;
907   gulong white_pixel;
908 };
909
910 /* Types for XInput support */
911
912 struct _GdkDeviceKey
913 {
914   guint keyval;
915   GdkModifierType modifiers;
916 };
917
918 struct _GdkDeviceInfo
919 {
920   guint32 deviceid;
921   gchar *name;
922   GdkInputSource source;
923   GdkInputMode mode;
924   gint has_cursor;      /* TRUE if the X pointer follows device motion */
925   gint num_axes;
926   GdkAxisUse *axes;    /* Specifies use for each axis */
927   gint num_keys;
928   GdkDeviceKey *keys;
929 };
930
931 struct _GdkTimeCoord
932 {
933   guint32 time;
934   gdouble x;
935   gdouble y;
936   gdouble pressure;
937   gdouble xtilt;
938   gdouble ytilt;
939 };
940
941 /* Event filtering */
942
943 typedef void GdkXEvent;   /* Can be cast to XEvent */
944
945 typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
946                                           GdkEvent *event,
947                                           gpointer  data);
948
949 struct _GdkEventAny
950 {
951   GdkEventType type;
952   GdkWindow *window;
953   gint8 send_event;
954 };
955
956 struct _GdkEventExpose
957 {
958   GdkEventType type;
959   GdkWindow *window;
960   gint8 send_event;
961   GdkRectangle area;
962   gint count; /* If non-zero, how many more events follow. */
963 };
964
965 struct _GdkEventNoExpose
966 {
967   GdkEventType type;
968   GdkWindow *window;
969   gint8 send_event;
970   /* XXX: does anyone need the X major_code or minor_code fields? */
971 };
972
973 struct _GdkEventVisibility
974 {
975   GdkEventType type;
976   GdkWindow *window;
977   gint8 send_event;
978   GdkVisibilityState state;
979 };
980
981 struct _GdkEventMotion
982 {
983   GdkEventType type;
984   GdkWindow *window;
985   gint8 send_event;
986   guint32 time;
987   gdouble x;
988   gdouble y;
989   gdouble pressure;
990   gdouble xtilt;
991   gdouble ytilt;
992   guint state;
993   gint16 is_hint;
994   GdkInputSource source;
995   guint32 deviceid;
996   gdouble x_root, y_root;
997 };
998
999 struct _GdkEventButton
1000 {
1001   GdkEventType type;
1002   GdkWindow *window;
1003   gint8 send_event;
1004   guint32 time;
1005   gdouble x;
1006   gdouble y;
1007   gdouble pressure;
1008   gdouble xtilt;
1009   gdouble ytilt;
1010   guint state;
1011   guint button;
1012   GdkInputSource source;
1013   guint32 deviceid;
1014   gdouble x_root, y_root;
1015 };
1016
1017 struct _GdkEventKey
1018 {
1019   GdkEventType type;
1020   GdkWindow *window;
1021   gint8 send_event;
1022   guint32 time;
1023   guint state;
1024   guint keyval;
1025   gint length;
1026   gchar *string;
1027 };
1028
1029 struct _GdkEventCrossing
1030 {
1031   GdkEventType type;
1032   GdkWindow *window;
1033   gint8 send_event;
1034   GdkWindow *subwindow;
1035   guint32 time;
1036   gdouble x;
1037   gdouble y;
1038   gdouble x_root;
1039   gdouble y_root;
1040   GdkCrossingMode mode;
1041   GdkNotifyType detail;
1042   gboolean focus;
1043   guint state;
1044 };
1045
1046 struct _GdkEventFocus
1047 {
1048   GdkEventType type;
1049   GdkWindow *window;
1050   gint8 send_event;
1051   gint16 in;
1052 };
1053
1054 struct _GdkEventConfigure
1055 {
1056   GdkEventType type;
1057   GdkWindow *window;
1058   gint8 send_event;
1059   gint16 x, y;
1060   gint16 width;
1061   gint16 height;
1062 };
1063
1064 struct _GdkEventProperty
1065 {
1066   GdkEventType type;
1067   GdkWindow *window;
1068   gint8 send_event;
1069   GdkAtom atom;
1070   guint32 time;
1071   guint state;
1072 };
1073
1074 struct _GdkEventSelection
1075 {
1076   GdkEventType type;
1077   GdkWindow *window;
1078   gint8 send_event;
1079   GdkAtom selection;
1080   GdkAtom target;
1081   GdkAtom property;
1082   guint32 requestor;
1083   guint32 time;
1084 };
1085
1086 /* This event type will be used pretty rarely. It only is important
1087    for XInput aware programs that are drawing their own cursor */
1088
1089 struct _GdkEventProximity
1090 {
1091   GdkEventType type;
1092   GdkWindow *window;
1093   gint8 send_event;
1094   guint32 time;
1095   GdkInputSource source;
1096   guint32 deviceid;
1097 };
1098
1099 struct _GdkEventDragRequest
1100 {
1101   GdkEventType type;
1102   GdkWindow *window;
1103   gint8 send_event;
1104   guint32 requestor;
1105   union {
1106     struct {
1107       guint protocol_version:4;
1108       guint sendreply:1;
1109       guint willaccept:1;
1110       guint delete_data:1; /* Do *not* delete if link is sent, only
1111                               if data is sent */
1112       guint senddata:1;
1113       guint reserved:22;
1114     } flags;
1115     glong allflags;
1116   } u;
1117   guint8 isdrop; /* This gdk event can be generated by a couple of
1118                     X events - this lets the app know whether the
1119                     drop really occurred or we just set the data */
1120
1121   GdkPoint drop_coords;
1122   gchar *data_type;
1123   guint32 timestamp;
1124 };
1125
1126 struct _GdkEventDragBegin
1127 {
1128   GdkEventType type;
1129   GdkWindow *window;
1130   gint8 send_event;
1131   union {
1132     struct {
1133       guint protocol_version:4;
1134       guint reserved:28;
1135     } flags;
1136     glong allflags;
1137   } u;
1138 };
1139
1140 struct _GdkEventDropEnter
1141 {
1142   GdkEventType type;
1143   GdkWindow *window;
1144   gint8 send_event;
1145   guint32 requestor;
1146   union {
1147     struct {
1148       guint protocol_version:4;
1149       guint sendreply:1;
1150       guint extended_typelist:1;
1151       guint reserved:26;
1152     } flags;
1153     glong allflags;
1154   } u;
1155 };
1156
1157 struct _GdkEventDropLeave
1158 {
1159   GdkEventType type;
1160   GdkWindow *window;
1161   gint8 send_event;
1162   guint32 requestor;
1163   union {
1164     struct {
1165       guint protocol_version:4;
1166       guint reserved:28;
1167     } flags;
1168     glong allflags;
1169   } u;
1170 };
1171
1172 struct _GdkEventDropDataAvailable
1173 {
1174   GdkEventType type;
1175   GdkWindow *window;
1176   gint8 send_event;
1177   guint32 requestor;
1178   union {
1179     struct {
1180       guint protocol_version:4;
1181       guint isdrop:1;
1182       guint reserved:25;
1183     } flags;
1184     glong allflags;
1185   } u;
1186   gchar *data_type; /* MIME type */
1187   gulong data_numbytes;
1188   gpointer data;
1189   guint32 timestamp;
1190   GdkPoint coords;
1191 };
1192
1193 struct _GdkEventClient
1194 {
1195   GdkEventType type;
1196   GdkWindow *window;
1197   gint8 send_event;
1198   GdkAtom message_type;
1199   gushort data_format;
1200   union {
1201     char b[20];
1202     short s[10];
1203     long l[5];
1204   } data;
1205 };
1206
1207 struct _GdkEventOther
1208 {
1209   GdkEventType type;
1210   GdkWindow *window;
1211   gint8 send_event;
1212   GdkXEvent *xevent;
1213 };
1214
1215 union _GdkEvent
1216 {
1217   GdkEventType              type;
1218   GdkEventAny               any;
1219   GdkEventExpose            expose;
1220   GdkEventNoExpose          no_expose;
1221   GdkEventVisibility        visibility;
1222   GdkEventMotion            motion;
1223   GdkEventButton            button;
1224   GdkEventKey               key;
1225   GdkEventCrossing          crossing;
1226   GdkEventFocus             focus_change;
1227   GdkEventConfigure         configure;
1228   GdkEventProperty          property;
1229   GdkEventSelection         selection;
1230   GdkEventProximity         proximity;
1231   GdkEventDragBegin         dragbegin;
1232   GdkEventDragRequest       dragrequest;
1233   GdkEventDropEnter         dropenter;
1234   GdkEventDropLeave         dropleave;
1235   GdkEventDropDataAvailable dropdataavailable;
1236   GdkEventClient            client;
1237   GdkEventOther             other;
1238 };
1239
1240 struct _GdkRegion
1241 {
1242   gpointer user_data;
1243 };
1244
1245
1246
1247 #ifdef __cplusplus
1248 }
1249 #endif /* __cplusplus */
1250
1251
1252 #endif /* __GDK_TYPES_H__ */