]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
put text after #endif in comment
[~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 | GDK_IC_SPOT_LOCATION |
654                                   GDK_IC_PREEDIT_FONTSET,
655
656   GDK_IC_STATUS_AREA_REQ        = GDK_IC_STATUS_AREA | 
657                                   GDK_IC_STATUS_FONTSET
658 } GdkICAttributesType;
659
660 /* The next two enumeration values current match the
661  * Motif constants. If this is changed, the implementation
662  * of gdk_window_set_decorations/gdk_window_set_functions
663  * will need to change as well.
664  */
665 typedef enum
666 {
667   GDK_DECOR_ALL         = 1 << 0,
668   GDK_DECOR_BORDER      = 1 << 1,
669   GDK_DECOR_RESIZEH     = 1 << 2,
670   GDK_DECOR_TITLE       = 1 << 3,
671   GDK_DECOR_MENU        = 1 << 4,
672   GDK_DECOR_MINIMIZE    = 1 << 5,
673   GDK_DECOR_MAXIMIZE    = 1 << 6
674 } GdkWMDecoration;
675
676 typedef enum
677 {
678   GDK_FUNC_ALL          = 1 << 0,
679   GDK_FUNC_RESIZE       = 1 << 1,
680   GDK_FUNC_MOVE         = 1 << 2,
681   GDK_FUNC_MINIMIZE     = 1 << 3,
682   GDK_FUNC_MAXIMIZE     = 1 << 4,
683   GDK_FUNC_CLOSE        = 1 << 5
684 } GdkWMFunction;
685
686 typedef void (*GdkInputFunction) (gpointer          data,
687                                   gint              source,
688                                   GdkInputCondition condition);
689
690 typedef void (*GdkDestroyNotify) (gpointer data);
691
692 /* Color Context modes.
693  *
694  * GDK_CC_MODE_UNDEFINED - unknown
695  * GDK_CC_MODE_BW        - default B/W
696  * GDK_CC_MODE_STD_CMAP  - has a standard colormap
697  * GDK_CC_MODE_TRUE      - is a TrueColor/DirectColor visual
698  * GDK_CC_MODE_MY_GRAY   - my grayramp
699  * GDK_CC_MODE_PALETTE   - has a pre-allocated palette
700  */ 
701
702 typedef enum
703 {
704   GDK_CC_MODE_UNDEFINED,
705   GDK_CC_MODE_BW,
706   GDK_CC_MODE_STD_CMAP,
707   GDK_CC_MODE_TRUE,
708   GDK_CC_MODE_MY_GRAY,
709   GDK_CC_MODE_PALETTE
710 } GdkColorContextMode;
711
712 /* Types of overlapping between a rectangle and a region
713  * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
714  * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
715  * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
716  */
717
718 typedef enum
719 {
720   GDK_OVERLAP_RECTANGLE_IN,
721   GDK_OVERLAP_RECTANGLE_OUT,
722   GDK_OVERLAP_RECTANGLE_PART
723 } GdkOverlapType;
724
725 typedef enum {
726   GDK_ACTION_DEFAULT = 1 << 0,
727   GDK_ACTION_COPY    = 1 << 1,
728   GDK_ACTION_MOVE    = 1 << 2,
729   GDK_ACTION_LINK    = 1 << 3,
730   GDK_ACTION_PRIVATE = 1 << 4,
731   GDK_ACTION_ASK     = 1 << 5
732 } GdkDragAction;
733
734 typedef enum {
735   GDK_DRAG_PROTO_MOTIF,
736   GDK_DRAG_PROTO_XDND,
737   GDK_DRAG_PROTO_ROOTWIN        /* A root window with nobody claiming
738                                  * drags */
739 } GdkDragProtocol;
740
741 /* The color type.
742  *   A color consists of red, green and blue values in the
743  *    range 0-65535 and a pixel value. The pixel value is highly
744  *    dependent on the depth and colormap which this color will
745  *    be used to draw into. Therefore, sharing colors between
746  *    colormaps is a bad idea.
747  */
748 struct _GdkColor
749 {
750   gulong  pixel;
751   gushort red;
752   gushort green;
753   gushort blue;
754 };
755
756 /* The colormap type.
757  *   Colormaps consist of 256 colors.
758  */
759 struct _GdkColormap
760 {
761   gint      size;
762   GdkColor *colors;
763 };
764
765 /* The visual type.
766  *   "type" is the type of visual this is (PseudoColor, TrueColor, etc).
767  *   "depth" is the bit depth of this visual.
768  *   "colormap_size" is the size of a colormap for this visual.
769  *   "bits_per_rgb" is the number of significant bits per red, green and blue.
770  *  The red, green and blue masks, shifts and precisions refer
771  *   to value needed to calculate pixel values in TrueColor and DirectColor
772  *   visuals. The "mask" is the significant bits within the pixel. The
773  *   "shift" is the number of bits left we must shift a primary for it
774  *   to be in position (according to the "mask"). "prec" refers to how
775  *   much precision the pixel value contains for a particular primary.
776  */
777 struct _GdkVisual
778 {
779   GdkVisualType type;
780   gint depth;
781   GdkByteOrder byte_order;
782   gint colormap_size;
783   gint bits_per_rgb;
784
785   guint32 red_mask;
786   gint red_shift;
787   gint red_prec;
788
789   guint32 green_mask;
790   gint green_shift;
791   gint green_prec;
792
793   guint32 blue_mask;
794   gint blue_shift;
795   gint blue_prec;
796 };
797
798 struct _GdkWindowAttr
799 {
800   gchar *title;
801   gint event_mask;
802   gint16 x, y;
803   gint16 width;
804   gint16 height;
805   GdkWindowClass wclass;
806   GdkVisual *visual;
807   GdkColormap *colormap;
808   GdkWindowType window_type;
809   GdkCursor *cursor;
810   gchar *wmclass_name;
811   gchar *wmclass_class;
812   gboolean override_redirect;
813 };
814
815 struct _GdkWindow
816 {
817   gpointer user_data;
818 };
819
820 struct _GdkGeometry {
821   gint min_width;
822   gint min_height;
823   gint max_width;
824   gint max_height;
825   gint base_width;
826   gint base_height;
827   gint width_inc;
828   gint height_inc;
829   gdouble min_aspect;
830   gdouble max_aspect;
831   /* GdkGravity gravity; */
832 };
833
834 struct _GdkImage
835 {
836   GdkImageType  type;
837   GdkVisual    *visual;     /* visual used to create the image */
838   GdkByteOrder  byte_order;
839   guint16       width;
840   guint16       height;
841   guint16       depth;
842   guint16       bpp;        /* bytes per pixel */
843   guint16       bpl;        /* bytes per line */
844   gpointer      mem;
845 };
846
847 struct _GdkGCValues
848 {
849   GdkColor          foreground;
850   GdkColor          background;
851   GdkFont          *font;
852   GdkFunction       function;
853   GdkFill           fill;
854   GdkPixmap        *tile;
855   GdkPixmap        *stipple;
856   GdkPixmap        *clip_mask;
857   GdkSubwindowMode  subwindow_mode;
858   gint              ts_x_origin;
859   gint              ts_y_origin;
860   gint              clip_x_origin;
861   gint              clip_y_origin;
862   gint              graphics_exposures;
863   gint              line_width;
864   GdkLineStyle      line_style;
865   GdkCapStyle       cap_style;
866   GdkJoinStyle      join_style;
867 };
868
869 struct _GdkGC
870 {
871   gint dummy_var;
872 };
873
874 struct _GdkPoint
875 {
876   gint16 x;
877   gint16 y;
878 };
879
880 struct _GdkRectangle
881 {
882   gint16 x;
883   gint16 y;
884   guint16 width;
885   guint16 height;
886 };
887
888 struct _GdkSegment
889 {
890   gint16 x1;
891   gint16 y1;
892   gint16 x2;
893   gint16 y2;
894 };
895
896 struct _GdkFont
897 {
898   GdkFontType type;
899   gint ascent;
900   gint descent;
901 };
902
903 struct _GdkCursor
904 {
905   GdkCursorType type;
906 };
907
908
909 struct _GdkColorContextDither
910 {
911   gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
912   gint fast_err[32][32][32]; /* internal RGB error information */
913   gint fast_erg[32][32][32];
914   gint fast_erb[32][32][32];
915 };
916
917 struct _GdkColorContext
918 {
919   GdkVisual *visual;
920   GdkColormap *colormap;
921
922   gint num_colors;              /* available no. of colors in colormap */
923   gint max_colors;              /* maximum no. of colors */
924   gint num_allocated;           /* no. of allocated colors */
925
926   GdkColorContextMode mode;
927   gint need_to_free_colormap;
928   GdkAtom std_cmap_atom;
929
930   gulong *clut;                 /* color look-up table */
931   GdkColor *cmap;               /* colormap */
932
933   GHashTable *color_hash;       /* hash table of allocated colors */
934   GdkColor *palette;            /* preallocated palette */
935   gint num_palette;             /* size of palette */
936
937   GdkColorContextDither *fast_dither;   /* fast dither matrix */
938
939   struct
940   {
941     gint red;
942     gint green;
943     gint blue;
944   } shifts;
945
946   struct
947   {
948     gulong red;
949     gulong green;
950     gulong blue;
951   } masks;
952
953   struct
954   {
955     gint red;
956     gint green;
957     gint blue;
958   } bits;
959
960   gulong max_entry;
961
962   gulong black_pixel;
963   gulong white_pixel;
964 };
965
966 /* Types for XInput support */
967
968 struct _GdkDeviceKey
969 {
970   guint keyval;
971   GdkModifierType modifiers;
972 };
973
974 struct _GdkDeviceInfo
975 {
976   guint32 deviceid;
977   gchar *name;
978   GdkInputSource source;
979   GdkInputMode mode;
980   gint has_cursor;      /* TRUE if the X pointer follows device motion */
981   gint num_axes;
982   GdkAxisUse *axes;    /* Specifies use for each axis */
983   gint num_keys;
984   GdkDeviceKey *keys;
985 };
986
987 struct _GdkTimeCoord
988 {
989   guint32 time;
990   gdouble x;
991   gdouble y;
992   gdouble pressure;
993   gdouble xtilt;
994   gdouble ytilt;
995 };
996
997 /* Structure that holds information about a drag in progress.
998  * this is used on both source and destination sides.
999  */
1000 struct _GdkDragContext {
1001   GdkDragProtocol protocol;
1002   
1003   gboolean is_source;
1004   
1005   GdkWindow *source_window;
1006   GdkWindow *dest_window;
1007
1008   GList *targets;
1009   GdkDragAction actions;
1010   GdkDragAction suggested_action;
1011   GdkDragAction action; 
1012
1013   guint32 start_time;
1014 };
1015
1016 /* Event filtering */
1017
1018 typedef void GdkXEvent;   /* Can be cast to XEvent */
1019
1020 typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
1021                                           GdkEvent *event,
1022                                           gpointer  data);
1023
1024 struct _GdkEventAny
1025 {
1026   GdkEventType type;
1027   GdkWindow *window;
1028   gint8 send_event;
1029 };
1030
1031 struct _GdkEventExpose
1032 {
1033   GdkEventType type;
1034   GdkWindow *window;
1035   gint8 send_event;
1036   GdkRectangle area;
1037   gint count; /* If non-zero, how many more events follow. */
1038 };
1039
1040 struct _GdkEventNoExpose
1041 {
1042   GdkEventType type;
1043   GdkWindow *window;
1044   gint8 send_event;
1045   /* XXX: does anyone need the X major_code or minor_code fields? */
1046 };
1047
1048 struct _GdkEventVisibility
1049 {
1050   GdkEventType type;
1051   GdkWindow *window;
1052   gint8 send_event;
1053   GdkVisibilityState state;
1054 };
1055
1056 struct _GdkEventMotion
1057 {
1058   GdkEventType type;
1059   GdkWindow *window;
1060   gint8 send_event;
1061   guint32 time;
1062   gdouble x;
1063   gdouble y;
1064   gdouble pressure;
1065   gdouble xtilt;
1066   gdouble ytilt;
1067   guint state;
1068   gint16 is_hint;
1069   GdkInputSource source;
1070   guint32 deviceid;
1071   gdouble x_root, y_root;
1072 };
1073
1074 struct _GdkEventButton
1075 {
1076   GdkEventType type;
1077   GdkWindow *window;
1078   gint8 send_event;
1079   guint32 time;
1080   gdouble x;
1081   gdouble y;
1082   gdouble pressure;
1083   gdouble xtilt;
1084   gdouble ytilt;
1085   guint state;
1086   guint button;
1087   GdkInputSource source;
1088   guint32 deviceid;
1089   gdouble x_root, y_root;
1090 };
1091
1092 struct _GdkEventKey
1093 {
1094   GdkEventType type;
1095   GdkWindow *window;
1096   gint8 send_event;
1097   guint32 time;
1098   guint state;
1099   guint keyval;
1100   gint length;
1101   gchar *string;
1102 };
1103
1104 struct _GdkEventCrossing
1105 {
1106   GdkEventType type;
1107   GdkWindow *window;
1108   gint8 send_event;
1109   GdkWindow *subwindow;
1110   guint32 time;
1111   gdouble x;
1112   gdouble y;
1113   gdouble x_root;
1114   gdouble y_root;
1115   GdkCrossingMode mode;
1116   GdkNotifyType detail;
1117   gboolean focus;
1118   guint state;
1119 };
1120
1121 struct _GdkEventFocus
1122 {
1123   GdkEventType type;
1124   GdkWindow *window;
1125   gint8 send_event;
1126   gint16 in;
1127 };
1128
1129 struct _GdkEventConfigure
1130 {
1131   GdkEventType type;
1132   GdkWindow *window;
1133   gint8 send_event;
1134   gint16 x, y;
1135   gint16 width;
1136   gint16 height;
1137 };
1138
1139 struct _GdkEventProperty
1140 {
1141   GdkEventType type;
1142   GdkWindow *window;
1143   gint8 send_event;
1144   GdkAtom atom;
1145   guint32 time;
1146   guint state;
1147 };
1148
1149 struct _GdkEventSelection
1150 {
1151   GdkEventType type;
1152   GdkWindow *window;
1153   gint8 send_event;
1154   GdkAtom selection;
1155   GdkAtom target;
1156   GdkAtom property;
1157   guint32 requestor;
1158   guint32 time;
1159 };
1160
1161 /* This event type will be used pretty rarely. It only is important
1162    for XInput aware programs that are drawing their own cursor */
1163
1164 struct _GdkEventProximity
1165 {
1166   GdkEventType type;
1167   GdkWindow *window;
1168   gint8 send_event;
1169   guint32 time;
1170   GdkInputSource source;
1171   guint32 deviceid;
1172 };
1173
1174 struct _GdkEventClient
1175 {
1176   GdkEventType type;
1177   GdkWindow *window;
1178   gint8 send_event;
1179   GdkAtom message_type;
1180   gushort data_format;
1181   union {
1182     char b[20];
1183     short s[10];
1184     long l[5];
1185   } data;
1186 };
1187
1188 /* Event types for DND */
1189
1190 struct _GdkEventDND {
1191   GdkEventType type;
1192   GdkWindow *window;
1193   gint8 send_event;
1194   GdkDragContext *context;
1195
1196   guint32 time;
1197   gshort x_root, y_root;
1198 };
1199
1200 union _GdkEvent
1201 {
1202   GdkEventType              type;
1203   GdkEventAny               any;
1204   GdkEventExpose            expose;
1205   GdkEventNoExpose          no_expose;
1206   GdkEventVisibility        visibility;
1207   GdkEventMotion            motion;
1208   GdkEventButton            button;
1209   GdkEventKey               key;
1210   GdkEventCrossing          crossing;
1211   GdkEventFocus             focus_change;
1212   GdkEventConfigure         configure;
1213   GdkEventProperty          property;
1214   GdkEventSelection         selection;
1215   GdkEventProximity         proximity;
1216   GdkEventClient            client;
1217   GdkEventDND               dnd;
1218 };
1219
1220 struct _GdkRegion
1221 {
1222   gpointer user_data;
1223 };
1224
1225 struct _GdkICAttr
1226 {
1227   GdkIMStyle style;
1228   GdkWindow *client_window;
1229   GdkWindow *focus_window;
1230   GdkEventMask filter_events;
1231   GdkPoint spot_location;
1232   gint line_spacing;
1233   GdkCursor *cursor;
1234
1235   GdkFont *preedit_fontset;
1236   GdkRectangle preedit_area;
1237   GdkRectangle preedit_area_needed; 
1238   GdkColor preedit_foreground;
1239   GdkColor preedit_background;
1240   GdkPixmap *preedit_pixmap;
1241   GdkColormap *preedit_colormap;
1242
1243   GdkFont *status_fontset;
1244   GdkRectangle status_area;
1245   GdkRectangle status_area_needed; 
1246   GdkColor status_foreground;
1247   GdkColor status_background;
1248   GdkPixmap *status_pixmap;
1249   GdkColormap *status_colormap;
1250 };
1251
1252 #ifdef __cplusplus
1253 }
1254 #endif /* __cplusplus */
1255
1256
1257 #endif /* __GDK_TYPES_H__ */