]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
New enumeration for the "mode" field of crossing events. (struct
[~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  */
221 typedef enum
222 {
223   GDK_COPY,
224   GDK_INVERT,
225   GDK_XOR
226 } GdkFunction;
227
228 /* GC fill types.
229  *  Solid:
230  *  Tiled:
231  *  Stippled:
232  *  OpaqueStippled:
233  */
234 typedef enum
235 {
236   GDK_SOLID,
237   GDK_TILED,
238   GDK_STIPPLED,
239   GDK_OPAQUE_STIPPLED
240 } GdkFill;
241
242 /* GC fill rule for polygons
243  *  EvenOddRule
244  *  WindingRule
245  */
246 typedef enum
247 {
248   GDK_EVEN_ODD_RULE,
249   GDK_WINDING_RULE
250 } GdkFillRule;
251
252 /* GC line styles
253  *  Solid:
254  *  OnOffDash:
255  *  DoubleDash:
256  */
257 typedef enum
258 {
259   GDK_LINE_SOLID,
260   GDK_LINE_ON_OFF_DASH,
261   GDK_LINE_DOUBLE_DASH
262 } GdkLineStyle;
263
264 /* GC cap styles
265  *  CapNotLast:
266  *  CapButt:
267  *  CapRound:
268  *  CapProjecting:
269  */
270 typedef enum
271 {
272   GDK_CAP_NOT_LAST,
273   GDK_CAP_BUTT,
274   GDK_CAP_ROUND,
275   GDK_CAP_PROJECTING
276 } GdkCapStyle;
277
278 /* GC join styles
279  *  JoinMiter:
280  *  JoinRound:
281  *  JoinBevel:
282  */
283 typedef enum
284 {
285   GDK_JOIN_MITER,
286   GDK_JOIN_ROUND,
287   GDK_JOIN_BEVEL
288 } GdkJoinStyle;
289
290 /* Cursor types.
291  */
292 typedef enum
293 {
294 #include <gdk/gdkcursors.h>
295   GDK_LAST_CURSOR,
296   GDK_CURSOR_IS_PIXMAP = -1
297 } GdkCursorType;
298
299 typedef enum {
300   GDK_FILTER_CONTINUE,    /* Event not handled, continue processesing */
301   GDK_FILTER_TRANSLATE,   /* Translated event stored */
302   GDK_FILTER_REMOVE       /* Terminate processing, removing event */
303 } GdkFilterReturn;
304
305 typedef enum {
306   GDK_VISIBILITY_UNOBSCURED,
307   GDK_VISIBILITY_PARTIAL,
308   GDK_VISIBILITY_FULLY_OBSCURED
309 } GdkVisibilityState;
310
311 /* Event types.
312  *   Nothing: No event occurred.
313  *   Delete: A window delete event was sent by the window manager.
314  *           The specified window should be deleted.
315  *   Destroy: A window has been destroyed.
316  *   Expose: Part of a window has been uncovered.
317  *   NoExpose: Same as expose, but no expose event was generated.
318  *   VisibilityNotify: A window has become fully/partially/not obscured.
319  *   MotionNotify: The mouse has moved.
320  *   ButtonPress: A mouse button was pressed.
321  *   ButtonRelease: A mouse button was release.
322  *   KeyPress: A key was pressed.
323  *   KeyRelease: A key was released.
324  *   EnterNotify: A window was entered.
325  *   LeaveNotify: A window was exited.
326  *   FocusChange: The focus window has changed. (The focus window gets
327  *                keyboard events).
328  *   Resize: A window has been resized.
329  *   Map: A window has been mapped. (It is now visible on the screen).
330  *   Unmap: A window has been unmapped. (It is no longer visible on
331  *          the screen).
332  */
333 typedef enum
334 {
335   GDK_NOTHING           = -1,
336   GDK_DELETE            = 0,
337   GDK_DESTROY           = 1,
338   GDK_EXPOSE            = 2,
339   GDK_MOTION_NOTIFY     = 3,
340   GDK_BUTTON_PRESS      = 4,
341   GDK_2BUTTON_PRESS     = 5,
342   GDK_3BUTTON_PRESS     = 6,
343   GDK_BUTTON_RELEASE    = 7,
344   GDK_KEY_PRESS         = 8,
345   GDK_KEY_RELEASE       = 9,
346   GDK_ENTER_NOTIFY      = 10,
347   GDK_LEAVE_NOTIFY      = 11,
348   GDK_FOCUS_CHANGE      = 12,
349   GDK_CONFIGURE         = 13,
350   GDK_MAP               = 14,
351   GDK_UNMAP             = 15,
352   GDK_PROPERTY_NOTIFY   = 16,
353   GDK_SELECTION_CLEAR   = 17,
354   GDK_SELECTION_REQUEST = 18,
355   GDK_SELECTION_NOTIFY  = 19,
356   GDK_PROXIMITY_IN      = 20,
357   GDK_PROXIMITY_OUT     = 21,
358   GDK_DRAG_BEGIN        = 22,
359   GDK_DRAG_REQUEST      = 23,
360   GDK_DROP_ENTER        = 24,
361   GDK_DROP_LEAVE        = 25,
362   GDK_DROP_DATA_AVAIL   = 26,
363   GDK_CLIENT_EVENT      = 27,
364   GDK_VISIBILITY_NOTIFY = 28,
365   GDK_NO_EXPOSE         = 29,
366   GDK_OTHER_EVENT       = 9999  /* Deprecated, use filters instead */
367 } GdkEventType;
368
369 /* Event masks. (Used to select what types of events a window
370  *  will receive).
371  */
372 typedef enum
373 {
374   GDK_EXPOSURE_MASK             = 1 << 1,
375   GDK_POINTER_MOTION_MASK       = 1 << 2,
376   GDK_POINTER_MOTION_HINT_MASK  = 1 << 3,
377   GDK_BUTTON_MOTION_MASK        = 1 << 4,
378   GDK_BUTTON1_MOTION_MASK       = 1 << 5,
379   GDK_BUTTON2_MOTION_MASK       = 1 << 6,
380   GDK_BUTTON3_MOTION_MASK       = 1 << 7,
381   GDK_BUTTON_PRESS_MASK         = 1 << 8,
382   GDK_BUTTON_RELEASE_MASK       = 1 << 9,
383   GDK_KEY_PRESS_MASK            = 1 << 10,
384   GDK_KEY_RELEASE_MASK          = 1 << 11,
385   GDK_ENTER_NOTIFY_MASK         = 1 << 12,
386   GDK_LEAVE_NOTIFY_MASK         = 1 << 13,
387   GDK_FOCUS_CHANGE_MASK         = 1 << 14,
388   GDK_STRUCTURE_MASK            = 1 << 15,
389   GDK_PROPERTY_CHANGE_MASK      = 1 << 16,
390   GDK_VISIBILITY_NOTIFY_MASK    = 1 << 17,
391   GDK_PROXIMITY_IN_MASK         = 1 << 18,
392   GDK_PROXIMITY_OUT_MASK        = 1 << 19,
393   GDK_SUBSTRUCTURE_MASK         = 1 << 20,
394   GDK_ALL_EVENTS_MASK           = 0x0FFFFF
395 } GdkEventMask;
396
397 /* Types of enter/leave notifications.
398  *   Ancestor:
399  *   Virtual:
400  *   Inferior:
401  *   Nonlinear:
402  *   NonlinearVirtual:
403  *   Unknown: An unknown type of enter/leave event occurred.
404  */
405 typedef enum
406 {
407   GDK_NOTIFY_ANCESTOR           = 0,
408   GDK_NOTIFY_VIRTUAL            = 1,
409   GDK_NOTIFY_INFERIOR           = 2,
410   GDK_NOTIFY_NONLINEAR          = 3,
411   GDK_NOTIFY_NONLINEAR_VIRTUAL  = 4,
412   GDK_NOTIFY_UNKNOWN            = 5
413 } GdkNotifyType;
414
415 /* Enter/leave event modes.
416  *   NotifyNormal
417  *   NotifyGrab
418  *   NotifyUngrab
419  */
420 typedef enum
421 {
422   GDK_CROSSING_NORMAL,
423   GDK_CROSSING_GRAB,
424   GDK_CROSSING_UNGRAB
425 } GdkCrossingMode;
426
427 /* Types of modifiers.
428  */
429 typedef enum
430 {
431   GDK_SHIFT_MASK    = 1 << 0,
432   GDK_LOCK_MASK     = 1 << 1,
433   GDK_CONTROL_MASK  = 1 << 2,
434   GDK_MOD1_MASK     = 1 << 3,
435   GDK_MOD2_MASK     = 1 << 4,
436   GDK_MOD3_MASK     = 1 << 5,
437   GDK_MOD4_MASK     = 1 << 6,
438   GDK_MOD5_MASK     = 1 << 7,
439   GDK_BUTTON1_MASK  = 1 << 8,
440   GDK_BUTTON2_MASK  = 1 << 9,
441   GDK_BUTTON3_MASK  = 1 << 10,
442   GDK_BUTTON4_MASK  = 1 << 11,
443   GDK_BUTTON5_MASK  = 1 << 12
444 } GdkModifierType;
445
446 typedef enum
447 {
448   GDK_CLIP_BY_CHILDREN  = 0,
449   GDK_INCLUDE_INFERIORS = 1
450 } GdkSubwindowMode;
451
452 typedef enum
453 {
454   GDK_INPUT_READ       = 1 << 0,
455   GDK_INPUT_WRITE      = 1 << 1,
456   GDK_INPUT_EXCEPTION  = 1 << 2
457 } GdkInputCondition;
458
459 typedef enum
460 {
461   GDK_OK          = 0,
462   GDK_ERROR       = -1,
463   GDK_ERROR_PARAM = -2,
464   GDK_ERROR_FILE  = -3,
465   GDK_ERROR_MEM   = -4
466 } GdkStatus;
467
468 typedef enum
469 {
470   GDK_LSB_FIRST,
471   GDK_MSB_FIRST
472 } GdkByteOrder;
473
474 typedef enum
475 {
476   GDK_GC_FOREGROUND    = 1 << 0,
477   GDK_GC_BACKGROUND    = 1 << 1,
478   GDK_GC_FONT          = 1 << 2,
479   GDK_GC_FUNCTION      = 1 << 3,
480   GDK_GC_FILL          = 1 << 4,
481   GDK_GC_TILE          = 1 << 5,
482   GDK_GC_STIPPLE       = 1 << 6,
483   GDK_GC_CLIP_MASK     = 1 << 7,
484   GDK_GC_SUBWINDOW     = 1 << 8,
485   GDK_GC_TS_X_ORIGIN   = 1 << 9,
486   GDK_GC_TS_Y_ORIGIN   = 1 << 10,
487   GDK_GC_CLIP_X_ORIGIN = 1 << 11,
488   GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
489   GDK_GC_EXPOSURES     = 1 << 13,
490   GDK_GC_LINE_WIDTH    = 1 << 14,
491   GDK_GC_LINE_STYLE    = 1 << 15,
492   GDK_GC_CAP_STYLE     = 1 << 16,
493   GDK_GC_JOIN_STYLE    = 1 << 17
494 } GdkGCValuesMask;
495
496 typedef enum
497 {
498   GDK_SELECTION_PRIMARY = 1,
499   GDK_SELECTION_SECONDARY = 2
500 } GdkSelection;
501
502 typedef enum
503 {
504   GDK_PROPERTY_NEW_VALUE,
505   GDK_PROPERTY_DELETE
506 } GdkPropertyState;
507
508 typedef enum
509 {
510   GDK_PROP_MODE_REPLACE,
511   GDK_PROP_MODE_PREPEND,
512   GDK_PROP_MODE_APPEND
513 } GdkPropMode;
514
515 /* These definitions are for version 1 of the OffiX D&D protocol,
516    taken from <OffiX/DragAndDropTypes.h> */
517 typedef enum
518 {
519   GDK_DNDTYPE_NOTDND = -1,
520   GDK_DNDTYPE_UNKNOWN = 0,
521   GDK_DNDTYPE_RAWDATA = 1,
522   GDK_DNDTYPE_FILE = 2,
523   GDK_DNDTYPE_FILES = 3,
524   GDK_DNDTYPE_TEXT = 4,
525   GDK_DNDTYPE_DIR = 5,
526   GDK_DNDTYPE_LINK = 6,
527   GDK_DNDTYPE_EXE = 7,
528   GDK_DNDTYPE_URL = 8,
529   GDK_DNDTYPE_MIME = 9,
530   GDK_DNDTYPE_END = 10
531 } GdkDndType;
532
533 /* Enums for XInput support */
534
535 typedef enum
536 {
537   GDK_SOURCE_MOUSE,
538   GDK_SOURCE_PEN,
539   GDK_SOURCE_ERASER,
540   GDK_SOURCE_CURSOR
541 } GdkInputSource;
542
543 typedef enum
544 {
545   GDK_MODE_DISABLED,
546   GDK_MODE_SCREEN,
547   GDK_MODE_WINDOW
548 } GdkInputMode;
549
550 typedef enum
551 {
552   GDK_AXIS_IGNORE,
553   GDK_AXIS_X,
554   GDK_AXIS_Y,
555   GDK_AXIS_PRESSURE,
556   GDK_AXIS_XTILT,
557   GDK_AXIS_YTILT,
558   GDK_AXIS_LAST
559 } GdkAxisUse;
560
561 /* The next two types define enums for predefined atoms relating
562    to selections. In general, one will need to use gdk_intern_atom */
563
564 typedef enum
565 {
566   GDK_TARGET_BITMAP = 5,
567   GDK_TARGET_COLORMAP = 7,
568   GDK_TARGET_DRAWABLE = 17,
569   GDK_TARGET_PIXMAP = 20,
570   GDK_TARGET_STRING = 31
571 } GdkTarget;
572
573 typedef enum
574 {
575   GDK_SELECTION_TYPE_ATOM = 4,
576   GDK_SELECTION_TYPE_BITMAP = 5,
577   GDK_SELECTION_TYPE_COLORMAP = 7,
578   GDK_SELECTION_TYPE_DRAWABLE = 17,
579   GDK_SELECTION_TYPE_INTEGER = 19,
580   GDK_SELECTION_TYPE_PIXMAP = 20,
581   GDK_SELECTION_TYPE_WINDOW = 33,
582   GDK_SELECTION_TYPE_STRING = 31
583 } GdkSelectionType;
584
585 typedef enum
586 {
587   GDK_EXTENSION_EVENTS_NONE,
588   GDK_EXTENSION_EVENTS_ALL,
589   GDK_EXTENSION_EVENTS_CURSOR
590 } GdkExtensionMode;
591
592 typedef enum
593 {
594   GdkIMPreeditArea      = 0x0001L,
595   GdkIMPreeditCallbacks = 0x0002L,
596   GdkIMPreeditPosition  = 0x0004L,
597   GdkIMPreeditNothing   = 0x0008L,
598   GdkIMPreeditNone      = 0x0010L,
599   GdkIMStatusArea       = 0x0100L,
600   GdkIMStatusCallbacks  = 0x0200L,
601   GdkIMStatusNothing    = 0x0400L,
602   GdkIMStatusNone       = 0x0800L
603 } GdkIMStyle;
604
605 /* The next two enumeration values current match the
606  * Motif constants. If this is changed, the implementation
607  * of gdk_window_set_decorations/gdk_window_set_functions
608  * will need to change as well.
609  */
610 typedef enum
611 {
612   GDK_DECOR_ALL         = 1 << 0,
613   GDK_DECOR_BORDER      = 1 << 1,
614   GDK_DECOR_RESIZEH     = 1 << 2,
615   GDK_DECOR_TITLE       = 1 << 3,
616   GDK_DECOR_MENU        = 1 << 4,
617   GDK_DECOR_MINIMIZE    = 1 << 5,
618   GDK_DECOR_MAXIMIZE    = 1 << 6
619 } GdkWMDecoration;
620
621 typedef enum
622 {
623   GDK_FUNC_ALL          = 1 << 0,
624   GDK_FUNC_RESIZE       = 1 << 1,
625   GDK_FUNC_MOVE         = 1 << 2,
626   GDK_FUNC_MINIMIZE     = 1 << 3,
627   GDK_FUNC_MAXIMIZE     = 1 << 4,
628   GDK_FUNC_CLOSE        = 1 << 5
629 } GdkWMFunction;
630
631 #define GdkIMPreeditMask \
632         ( GdkIMPreeditArea     | GdkIMPreeditCallbacks | \
633           GdkIMPreeditPosition | GdkIMPreeditNothing | \
634           GdkIMPreeditNone )
635
636 #define GdkIMStatusMask \
637         ( GdkIMStatusArea | GdkIMStatusCallbacks | \
638           GdkIMStatusNothing | GdkIMStatusNone )
639
640 typedef void (*GdkInputFunction) (gpointer          data,
641                                   gint              source,
642                                   GdkInputCondition condition);
643
644 typedef void (*GdkDestroyNotify) (gpointer data);
645
646 /* Color Context modes.
647  *
648  * GDK_CC_MODE_UNDEFINED - unknown
649  * GDK_CC_MODE_BW        - default B/W
650  * GDK_CC_MODE_STD_CMAP  - has a standard colormap
651  * GDK_CC_MODE_TRUE      - is a TrueColor/DirectColor visual
652  * GDK_CC_MODE_MY_GRAY   - my grayramp
653  * GDK_CC_MODE_PALETTE   - has a pre-allocated palette
654  */ 
655
656 typedef enum
657 {
658   GDK_CC_MODE_UNDEFINED,
659   GDK_CC_MODE_BW,
660   GDK_CC_MODE_STD_CMAP,
661   GDK_CC_MODE_TRUE,
662   GDK_CC_MODE_MY_GRAY,
663   GDK_CC_MODE_PALETTE
664 } GdkColorContextMode;
665
666 /* Types of overlapping between a rectangle and a region
667  * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
668  * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
669  * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
670  */
671
672 typedef enum
673 {
674   GDK_OVERLAP_RECTANGLE_IN,
675   GDK_OVERLAP_RECTANGLE_OUT,
676   GDK_OVERLAP_RECTANGLE_PART
677 } GdkOverlapType;
678
679 /* The color type.
680  *   A color consists of red, green and blue values in the
681  *    range 0-65535 and a pixel value. The pixel value is highly
682  *    dependent on the depth and colormap which this color will
683  *    be used to draw into. Therefore, sharing colors between
684  *    colormaps is a bad idea.
685  */
686 struct _GdkColor
687 {
688   gulong  pixel;
689   gushort red;
690   gushort green;
691   gushort blue;
692 };
693
694 /* The colormap type.
695  *   Colormaps consist of 256 colors.
696  */
697 struct _GdkColormap
698 {
699   gint      size;
700   GdkColor *colors;
701 };
702
703 /* The visual type.
704  *   "type" is the type of visual this is (PseudoColor, TrueColor, etc).
705  *   "depth" is the bit depth of this visual.
706  *   "colormap_size" is the size of a colormap for this visual.
707  *   "bits_per_rgb" is the number of significant bits per red, green and blue.
708  *  The red, green and blue masks, shifts and precisions refer
709  *   to value needed to calculate pixel values in TrueColor and DirectColor
710  *   visuals. The "mask" is the significant bits within the pixel. The
711  *   "shift" is the number of bits left we must shift a primary for it
712  *   to be in position (according to the "mask"). "prec" refers to how
713  *   much precision the pixel value contains for a particular primary.
714  */
715 struct _GdkVisual
716 {
717   GdkVisualType type;
718   gint depth;
719   GdkByteOrder byte_order;
720   gint colormap_size;
721   gint bits_per_rgb;
722
723   guint32 red_mask;
724   gint red_shift;
725   gint red_prec;
726
727   guint32 green_mask;
728   gint green_shift;
729   gint green_prec;
730
731   guint32 blue_mask;
732   gint blue_shift;
733   gint blue_prec;
734 };
735
736 struct _GdkWindowAttr
737 {
738   gchar *title;
739   gint event_mask;
740   gint16 x, y;
741   gint16 width;
742   gint16 height;
743   GdkWindowClass wclass;
744   GdkVisual *visual;
745   GdkColormap *colormap;
746   GdkWindowType window_type;
747   GdkCursor *cursor;
748   gchar *wmclass_name;
749   gchar *wmclass_class;
750   gboolean override_redirect;
751 };
752
753 struct _GdkWindow
754 {
755   gpointer user_data;
756 };
757
758 struct _GdkImage
759 {
760   GdkImageType  type;
761   GdkVisual    *visual;     /* visual used to create the image */
762   GdkByteOrder  byte_order;
763   guint16       width;
764   guint16       height;
765   guint16       depth;
766   guint16       bpp;        /* bytes per pixel */
767   guint16       bpl;        /* bytes per line */
768   gpointer      mem;
769 };
770
771 struct _GdkGCValues
772 {
773   GdkColor          foreground;
774   GdkColor          background;
775   GdkFont          *font;
776   GdkFunction       function;
777   GdkFill           fill;
778   GdkPixmap        *tile;
779   GdkPixmap        *stipple;
780   GdkPixmap        *clip_mask;
781   GdkSubwindowMode  subwindow_mode;
782   gint              ts_x_origin;
783   gint              ts_y_origin;
784   gint              clip_x_origin;
785   gint              clip_y_origin;
786   gint              graphics_exposures;
787   gint              line_width;
788   GdkLineStyle      line_style;
789   GdkCapStyle       cap_style;
790   GdkJoinStyle      join_style;
791 };
792
793 struct _GdkGC
794 {
795   gint dummy_var;
796 };
797
798 struct _GdkPoint
799 {
800   gint16 x;
801   gint16 y;
802 };
803
804 struct _GdkRectangle
805 {
806   gint16 x;
807   gint16 y;
808   guint16 width;
809   guint16 height;
810 };
811
812 struct _GdkSegment
813 {
814   gint16 x1;
815   gint16 y1;
816   gint16 x2;
817   gint16 y2;
818 };
819
820 struct _GdkFont
821 {
822   GdkFontType type;
823   gint ascent;
824   gint descent;
825 };
826
827 struct _GdkCursor
828 {
829   GdkCursorType type;
830 };
831
832 struct _GdkColorContextDither
833 {
834   gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
835   gint fast_err[32][32][32]; /* internal RGB error information */
836   gint fast_erg[32][32][32];
837   gint fast_erb[32][32][32];
838 };
839
840 struct _GdkColorContext
841 {
842   GdkVisual *visual;
843   GdkColormap *colormap;
844
845   gint num_colors;              /* available no. of colors in colormap */
846   gint max_colors;              /* maximum no. of colors */
847   gint num_allocated;           /* no. of allocated colors */
848
849   GdkColorContextMode mode;
850   gint need_to_free_colormap;
851   GdkAtom std_cmap_atom;
852
853   gulong *clut;                 /* color look-up table */
854   GdkColor *cmap;               /* colormap */
855
856   GHashTable *color_hash;       /* hash table of allocated colors */
857   GdkColor *palette;            /* preallocated palette */
858   gint num_palette;             /* size of palette */
859
860   GdkColorContextDither *fast_dither;   /* fast dither matrix */
861
862   struct
863   {
864     gint red;
865     gint green;
866     gint blue;
867   } shifts;
868
869   struct
870   {
871     gulong red;
872     gulong green;
873     gulong blue;
874   } masks;
875
876   struct
877   {
878     gint red;
879     gint green;
880     gint blue;
881   } bits;
882
883   gulong max_entry;
884
885   gulong black_pixel;
886   gulong white_pixel;
887 };
888
889 /* Types for XInput support */
890
891 struct _GdkDeviceKey
892 {
893   guint keyval;
894   GdkModifierType modifiers;
895 };
896
897 struct _GdkDeviceInfo
898 {
899   guint32 deviceid;
900   gchar *name;
901   GdkInputSource source;
902   GdkInputMode mode;
903   gint has_cursor;      /* TRUE if the X pointer follows device motion */
904   gint num_axes;
905   GdkAxisUse *axes;    /* Specifies use for each axis */
906   gint num_keys;
907   GdkDeviceKey *keys;
908 };
909
910 struct _GdkTimeCoord
911 {
912   guint32 time;
913   gdouble x;
914   gdouble y;
915   gdouble pressure;
916   gdouble xtilt;
917   gdouble ytilt;
918 };
919
920 /* Event filtering */
921
922 typedef void GdkXEvent;   /* Can be cast to XEvent */
923
924 typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
925                                           GdkEvent *event,
926                                           gpointer  data);
927
928 struct _GdkEventAny
929 {
930   GdkEventType type;
931   GdkWindow *window;
932   gint8 send_event;
933 };
934
935 struct _GdkEventExpose
936 {
937   GdkEventType type;
938   GdkWindow *window;
939   gint8 send_event;
940   GdkRectangle area;
941   gint count; /* If non-zero, how many more events follow. */
942 };
943
944 struct _GdkEventNoExpose
945 {
946   GdkEventType type;
947   GdkWindow *window;
948   gint8 send_event;
949   /* XXX: does anyone need the X major_code or minor_code fields? */
950 };
951
952 struct _GdkEventVisibility
953 {
954   GdkEventType type;
955   GdkWindow *window;
956   gint8 send_event;
957   GdkVisibilityState state;
958 };
959
960 struct _GdkEventMotion
961 {
962   GdkEventType type;
963   GdkWindow *window;
964   gint8 send_event;
965   guint32 time;
966   gdouble x;
967   gdouble y;
968   gdouble pressure;
969   gdouble xtilt;
970   gdouble ytilt;
971   guint state;
972   gint16 is_hint;
973   GdkInputSource source;
974   guint32 deviceid;
975   gdouble x_root, y_root;
976 };
977
978 struct _GdkEventButton
979 {
980   GdkEventType type;
981   GdkWindow *window;
982   gint8 send_event;
983   guint32 time;
984   gdouble x;
985   gdouble y;
986   gdouble pressure;
987   gdouble xtilt;
988   gdouble ytilt;
989   guint state;
990   guint button;
991   GdkInputSource source;
992   guint32 deviceid;
993   gdouble x_root, y_root;
994 };
995
996 struct _GdkEventKey
997 {
998   GdkEventType type;
999   GdkWindow *window;
1000   gint8 send_event;
1001   guint32 time;
1002   guint state;
1003   guint keyval;
1004   gint length;
1005   gchar *string;
1006 };
1007
1008 struct _GdkEventCrossing
1009 {
1010   GdkEventType type;
1011   GdkWindow *window;
1012   gint8 send_event;
1013   GdkWindow *subwindow;
1014   guint32 time;
1015   gdouble x;
1016   gdouble y;
1017   gdouble x_root;
1018   gdouble y_root;
1019   GdkCrossingMode mode;
1020   GdkNotifyType detail;
1021   gboolean focus;
1022   guint state;
1023 };
1024
1025 struct _GdkEventFocus
1026 {
1027   GdkEventType type;
1028   GdkWindow *window;
1029   gint8 send_event;
1030   gint16 in;
1031 };
1032
1033 struct _GdkEventConfigure
1034 {
1035   GdkEventType type;
1036   GdkWindow *window;
1037   gint8 send_event;
1038   gint16 x, y;
1039   gint16 width;
1040   gint16 height;
1041 };
1042
1043 struct _GdkEventProperty
1044 {
1045   GdkEventType type;
1046   GdkWindow *window;
1047   gint8 send_event;
1048   GdkAtom atom;
1049   guint32 time;
1050   guint state;
1051 };
1052
1053 struct _GdkEventSelection
1054 {
1055   GdkEventType type;
1056   GdkWindow *window;
1057   gint8 send_event;
1058   GdkAtom selection;
1059   GdkAtom target;
1060   GdkAtom property;
1061   guint32 requestor;
1062   guint32 time;
1063 };
1064
1065 /* This event type will be used pretty rarely. It only is important
1066    for XInput aware programs that are drawing their own cursor */
1067
1068 struct _GdkEventProximity
1069 {
1070   GdkEventType type;
1071   GdkWindow *window;
1072   gint8 send_event;
1073   guint32 time;
1074   GdkInputSource source;
1075   guint32 deviceid;
1076 };
1077
1078 struct _GdkEventDragRequest
1079 {
1080   GdkEventType type;
1081   GdkWindow *window;
1082   gint8 send_event;
1083   guint32 requestor;
1084   union {
1085     struct {
1086       guint protocol_version:4;
1087       guint sendreply:1;
1088       guint willaccept:1;
1089       guint delete_data:1; /* Do *not* delete if link is sent, only
1090                               if data is sent */
1091       guint senddata:1;
1092       guint reserved:22;
1093     } flags;
1094     glong allflags;
1095   } u;
1096   guint8 isdrop; /* This gdk event can be generated by a couple of
1097                     X events - this lets the app know whether the
1098                     drop really occurred or we just set the data */
1099
1100   GdkPoint drop_coords;
1101   gchar *data_type;
1102   guint32 timestamp;
1103 };
1104
1105 struct _GdkEventDragBegin
1106 {
1107   GdkEventType type;
1108   GdkWindow *window;
1109   gint8 send_event;
1110   union {
1111     struct {
1112       guint protocol_version:4;
1113       guint reserved:28;
1114     } flags;
1115     glong allflags;
1116   } u;
1117 };
1118
1119 struct _GdkEventDropEnter
1120 {
1121   GdkEventType type;
1122   GdkWindow *window;
1123   gint8 send_event;
1124   guint32 requestor;
1125   union {
1126     struct {
1127       guint protocol_version:4;
1128       guint sendreply:1;
1129       guint extended_typelist:1;
1130       guint reserved:26;
1131     } flags;
1132     glong allflags;
1133   } u;
1134 };
1135
1136 struct _GdkEventDropLeave
1137 {
1138   GdkEventType type;
1139   GdkWindow *window;
1140   gint8 send_event;
1141   guint32 requestor;
1142   union {
1143     struct {
1144       guint protocol_version:4;
1145       guint reserved:28;
1146     } flags;
1147     glong allflags;
1148   } u;
1149 };
1150
1151 struct _GdkEventDropDataAvailable
1152 {
1153   GdkEventType type;
1154   GdkWindow *window;
1155   gint8 send_event;
1156   guint32 requestor;
1157   union {
1158     struct {
1159       guint protocol_version:4;
1160       guint isdrop:1;
1161       guint reserved:25;
1162     } flags;
1163     glong allflags;
1164   } u;
1165   gchar *data_type; /* MIME type */
1166   gulong data_numbytes;
1167   gpointer data;
1168   guint32 timestamp;
1169   GdkPoint coords;
1170 };
1171
1172 struct _GdkEventClient
1173 {
1174   GdkEventType type;
1175   GdkWindow *window;
1176   gint8 send_event;
1177   GdkAtom message_type;
1178   gushort data_format;
1179   union {
1180     char b[20];
1181     short s[10];
1182     long l[5];
1183   } data;
1184 };
1185
1186 struct _GdkEventOther
1187 {
1188   GdkEventType type;
1189   GdkWindow *window;
1190   gint8 send_event;
1191   GdkXEvent *xevent;
1192 };
1193
1194 union _GdkEvent
1195 {
1196   GdkEventType              type;
1197   GdkEventAny               any;
1198   GdkEventExpose            expose;
1199   GdkEventNoExpose          no_expose;
1200   GdkEventVisibility        visibility;
1201   GdkEventMotion            motion;
1202   GdkEventButton            button;
1203   GdkEventKey               key;
1204   GdkEventCrossing          crossing;
1205   GdkEventFocus             focus_change;
1206   GdkEventConfigure         configure;
1207   GdkEventProperty          property;
1208   GdkEventSelection         selection;
1209   GdkEventProximity         proximity;
1210   GdkEventDragBegin         dragbegin;
1211   GdkEventDragRequest       dragrequest;
1212   GdkEventDropEnter         dropenter;
1213   GdkEventDropLeave         dropleave;
1214   GdkEventDropDataAvailable dropdataavailable;
1215   GdkEventClient            client;
1216   GdkEventOther             other;
1217 };
1218
1219 struct _GdkRegion
1220 {
1221   gpointer user_data;
1222 };
1223
1224
1225
1226 #ifdef __cplusplus
1227 }
1228 #endif /* __cplusplus */
1229
1230
1231 #endif /* __GDK_TYPES_H__ */