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