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