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