]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
gdk/gdktypes.h gdk/gdkprivate.h gtk/gtk*.h gtk/Makefile.am gtk/makenums.pl
[~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   GDK_MODIFIER_MASK = 0x1fff
445 } GdkModifierType;
446
447 typedef enum
448 {
449   GDK_CLIP_BY_CHILDREN  = 0,
450   GDK_INCLUDE_INFERIORS = 1
451 } GdkSubwindowMode;
452
453 typedef enum
454 {
455   GDK_INPUT_READ       = 1 << 0,
456   GDK_INPUT_WRITE      = 1 << 1,
457   GDK_INPUT_EXCEPTION  = 1 << 2
458 } GdkInputCondition;
459
460 typedef enum
461 {
462   GDK_OK          = 0,
463   GDK_ERROR       = -1,
464   GDK_ERROR_PARAM = -2,
465   GDK_ERROR_FILE  = -3,
466   GDK_ERROR_MEM   = -4
467 } GdkStatus;
468
469 typedef enum
470 {
471   GDK_LSB_FIRST,
472   GDK_MSB_FIRST
473 } GdkByteOrder;
474
475 typedef enum
476 {
477   GDK_GC_FOREGROUND    = 1 << 0,
478   GDK_GC_BACKGROUND    = 1 << 1,
479   GDK_GC_FONT          = 1 << 2,
480   GDK_GC_FUNCTION      = 1 << 3,
481   GDK_GC_FILL          = 1 << 4,
482   GDK_GC_TILE          = 1 << 5,
483   GDK_GC_STIPPLE       = 1 << 6,
484   GDK_GC_CLIP_MASK     = 1 << 7,
485   GDK_GC_SUBWINDOW     = 1 << 8,
486   GDK_GC_TS_X_ORIGIN   = 1 << 9,
487   GDK_GC_TS_Y_ORIGIN   = 1 << 10,
488   GDK_GC_CLIP_X_ORIGIN = 1 << 11,
489   GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
490   GDK_GC_EXPOSURES     = 1 << 13,
491   GDK_GC_LINE_WIDTH    = 1 << 14,
492   GDK_GC_LINE_STYLE    = 1 << 15,
493   GDK_GC_CAP_STYLE     = 1 << 16,
494   GDK_GC_JOIN_STYLE    = 1 << 17
495 } GdkGCValuesMask;
496
497 typedef enum
498 {
499   GDK_SELECTION_PRIMARY = 1,
500   GDK_SELECTION_SECONDARY = 2
501 } GdkSelection;
502
503 typedef enum
504 {
505   GDK_PROPERTY_NEW_VALUE,
506   GDK_PROPERTY_DELETE
507 } GdkPropertyState;
508
509 typedef enum
510 {
511   GDK_PROP_MODE_REPLACE,
512   GDK_PROP_MODE_PREPEND,
513   GDK_PROP_MODE_APPEND
514 } GdkPropMode;
515
516 /* These definitions are for version 1 of the OffiX D&D protocol,
517    taken from <OffiX/DragAndDropTypes.h> */
518 typedef enum
519 {
520   GDK_DNDTYPE_NOTDND = -1,
521   GDK_DNDTYPE_UNKNOWN = 0,
522   GDK_DNDTYPE_RAWDATA = 1,
523   GDK_DNDTYPE_FILE = 2,
524   GDK_DNDTYPE_FILES = 3,
525   GDK_DNDTYPE_TEXT = 4,
526   GDK_DNDTYPE_DIR = 5,
527   GDK_DNDTYPE_LINK = 6,
528   GDK_DNDTYPE_EXE = 7,
529   GDK_DNDTYPE_URL = 8,
530   GDK_DNDTYPE_MIME = 9,
531   GDK_DNDTYPE_END = 10
532 } GdkDndType;
533
534 /* Enums for XInput support */
535
536 typedef enum
537 {
538   GDK_SOURCE_MOUSE,
539   GDK_SOURCE_PEN,
540   GDK_SOURCE_ERASER,
541   GDK_SOURCE_CURSOR
542 } GdkInputSource;
543
544 typedef enum
545 {
546   GDK_MODE_DISABLED,
547   GDK_MODE_SCREEN,
548   GDK_MODE_WINDOW
549 } GdkInputMode;
550
551 typedef enum
552 {
553   GDK_AXIS_IGNORE,
554   GDK_AXIS_X,
555   GDK_AXIS_Y,
556   GDK_AXIS_PRESSURE,
557   GDK_AXIS_XTILT,
558   GDK_AXIS_YTILT,
559   GDK_AXIS_LAST
560 } GdkAxisUse;
561
562 /* The next two types define enums for predefined atoms relating
563    to selections. In general, one will need to use gdk_intern_atom */
564
565 typedef enum
566 {
567   GDK_TARGET_BITMAP = 5,
568   GDK_TARGET_COLORMAP = 7,
569   GDK_TARGET_DRAWABLE = 17,
570   GDK_TARGET_PIXMAP = 20,
571   GDK_TARGET_STRING = 31
572 } GdkTarget;
573
574 typedef enum
575 {
576   GDK_SELECTION_TYPE_ATOM = 4,
577   GDK_SELECTION_TYPE_BITMAP = 5,
578   GDK_SELECTION_TYPE_COLORMAP = 7,
579   GDK_SELECTION_TYPE_DRAWABLE = 17,
580   GDK_SELECTION_TYPE_INTEGER = 19,
581   GDK_SELECTION_TYPE_PIXMAP = 20,
582   GDK_SELECTION_TYPE_WINDOW = 33,
583   GDK_SELECTION_TYPE_STRING = 31
584 } GdkSelectionType;
585
586 typedef enum
587 {
588   GDK_EXTENSION_EVENTS_NONE,
589   GDK_EXTENSION_EVENTS_ALL,
590   GDK_EXTENSION_EVENTS_CURSOR
591 } GdkExtensionMode;
592
593 typedef enum                    /*< flags >*/
594 {
595   GdkIMPreeditArea      = 0x0001L, /*< nick=preedit-area >*/
596   GdkIMPreeditCallbacks = 0x0002L, /*< nick=preedit-callbacks >*/
597   GdkIMPreeditPosition  = 0x0004L, /*< nick=preedit-position >*/
598   GdkIMPreeditNothing   = 0x0008L, /*< nick=preedit-nothing >*/
599   GdkIMPreeditNone      = 0x0010L, /*< nick=preedit-none >*/
600   GdkIMStatusArea       = 0x0100L, /*< nick=status-area >*/
601   GdkIMStatusCallbacks  = 0x0200L, /*< nick=status-callbacks >*/
602   GdkIMStatusNothing    = 0x0400L, /*< nick=status-nothing >*/
603   GdkIMStatusNone       = 0x0800L  /*< nick=status-none >*/
604 } GdkIMStyle;
605
606 /* The next two enumeration values current match the
607  * Motif constants. If this is changed, the implementation
608  * of gdk_window_set_decorations/gdk_window_set_functions
609  * will need to change as well.
610  */
611 typedef enum
612 {
613   GDK_DECOR_ALL         = 1 << 0,
614   GDK_DECOR_BORDER      = 1 << 1,
615   GDK_DECOR_RESIZEH     = 1 << 2,
616   GDK_DECOR_TITLE       = 1 << 3,
617   GDK_DECOR_MENU        = 1 << 4,
618   GDK_DECOR_MINIMIZE    = 1 << 5,
619   GDK_DECOR_MAXIMIZE    = 1 << 6
620 } GdkWMDecoration;
621
622 typedef enum
623 {
624   GDK_FUNC_ALL          = 1 << 0,
625   GDK_FUNC_RESIZE       = 1 << 1,
626   GDK_FUNC_MOVE         = 1 << 2,
627   GDK_FUNC_MINIMIZE     = 1 << 3,
628   GDK_FUNC_MAXIMIZE     = 1 << 4,
629   GDK_FUNC_CLOSE        = 1 << 5
630 } GdkWMFunction;
631
632 #define GdkIMPreeditMask \
633         ( GdkIMPreeditArea     | GdkIMPreeditCallbacks | \
634           GdkIMPreeditPosition | GdkIMPreeditNothing | \
635           GdkIMPreeditNone )
636
637 #define GdkIMStatusMask \
638         ( GdkIMStatusArea | GdkIMStatusCallbacks | \
639           GdkIMStatusNothing | GdkIMStatusNone )
640
641 typedef void (*GdkInputFunction) (gpointer          data,
642                                   gint              source,
643                                   GdkInputCondition condition);
644
645 typedef void (*GdkDestroyNotify) (gpointer data);
646
647 /* Color Context modes.
648  *
649  * GDK_CC_MODE_UNDEFINED - unknown
650  * GDK_CC_MODE_BW        - default B/W
651  * GDK_CC_MODE_STD_CMAP  - has a standard colormap
652  * GDK_CC_MODE_TRUE      - is a TrueColor/DirectColor visual
653  * GDK_CC_MODE_MY_GRAY   - my grayramp
654  * GDK_CC_MODE_PALETTE   - has a pre-allocated palette
655  */ 
656
657 typedef enum
658 {
659   GDK_CC_MODE_UNDEFINED,
660   GDK_CC_MODE_BW,
661   GDK_CC_MODE_STD_CMAP,
662   GDK_CC_MODE_TRUE,
663   GDK_CC_MODE_MY_GRAY,
664   GDK_CC_MODE_PALETTE
665 } GdkColorContextMode;
666
667 /* Types of overlapping between a rectangle and a region
668  * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
669  * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
670  * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
671  */
672
673 typedef enum
674 {
675   GDK_OVERLAP_RECTANGLE_IN,
676   GDK_OVERLAP_RECTANGLE_OUT,
677   GDK_OVERLAP_RECTANGLE_PART
678 } GdkOverlapType;
679
680 /* The color type.
681  *   A color consists of red, green and blue values in the
682  *    range 0-65535 and a pixel value. The pixel value is highly
683  *    dependent on the depth and colormap which this color will
684  *    be used to draw into. Therefore, sharing colors between
685  *    colormaps is a bad idea.
686  */
687 struct _GdkColor
688 {
689   gulong  pixel;
690   gushort red;
691   gushort green;
692   gushort blue;
693 };
694
695 /* The colormap type.
696  *   Colormaps consist of 256 colors.
697  */
698 struct _GdkColormap
699 {
700   gint      size;
701   GdkColor *colors;
702 };
703
704 /* The visual type.
705  *   "type" is the type of visual this is (PseudoColor, TrueColor, etc).
706  *   "depth" is the bit depth of this visual.
707  *   "colormap_size" is the size of a colormap for this visual.
708  *   "bits_per_rgb" is the number of significant bits per red, green and blue.
709  *  The red, green and blue masks, shifts and precisions refer
710  *   to value needed to calculate pixel values in TrueColor and DirectColor
711  *   visuals. The "mask" is the significant bits within the pixel. The
712  *   "shift" is the number of bits left we must shift a primary for it
713  *   to be in position (according to the "mask"). "prec" refers to how
714  *   much precision the pixel value contains for a particular primary.
715  */
716 struct _GdkVisual
717 {
718   GdkVisualType type;
719   gint depth;
720   GdkByteOrder byte_order;
721   gint colormap_size;
722   gint bits_per_rgb;
723
724   guint32 red_mask;
725   gint red_shift;
726   gint red_prec;
727
728   guint32 green_mask;
729   gint green_shift;
730   gint green_prec;
731
732   guint32 blue_mask;
733   gint blue_shift;
734   gint blue_prec;
735 };
736
737 struct _GdkWindowAttr
738 {
739   gchar *title;
740   gint event_mask;
741   gint16 x, y;
742   gint16 width;
743   gint16 height;
744   GdkWindowClass wclass;
745   GdkVisual *visual;
746   GdkColormap *colormap;
747   GdkWindowType window_type;
748   GdkCursor *cursor;
749   gchar *wmclass_name;
750   gchar *wmclass_class;
751   gboolean override_redirect;
752 };
753
754 struct _GdkWindow
755 {
756   gpointer user_data;
757 };
758
759 struct _GdkImage
760 {
761   GdkImageType  type;
762   GdkVisual    *visual;     /* visual used to create the image */
763   GdkByteOrder  byte_order;
764   guint16       width;
765   guint16       height;
766   guint16       depth;
767   guint16       bpp;        /* bytes per pixel */
768   guint16       bpl;        /* bytes per line */
769   gpointer      mem;
770 };
771
772 struct _GdkGCValues
773 {
774   GdkColor          foreground;
775   GdkColor          background;
776   GdkFont          *font;
777   GdkFunction       function;
778   GdkFill           fill;
779   GdkPixmap        *tile;
780   GdkPixmap        *stipple;
781   GdkPixmap        *clip_mask;
782   GdkSubwindowMode  subwindow_mode;
783   gint              ts_x_origin;
784   gint              ts_y_origin;
785   gint              clip_x_origin;
786   gint              clip_y_origin;
787   gint              graphics_exposures;
788   gint              line_width;
789   GdkLineStyle      line_style;
790   GdkCapStyle       cap_style;
791   GdkJoinStyle      join_style;
792 };
793
794 struct _GdkGC
795 {
796   gint dummy_var;
797 };
798
799 struct _GdkPoint
800 {
801   gint16 x;
802   gint16 y;
803 };
804
805 struct _GdkRectangle
806 {
807   gint16 x;
808   gint16 y;
809   guint16 width;
810   guint16 height;
811 };
812
813 struct _GdkSegment
814 {
815   gint16 x1;
816   gint16 y1;
817   gint16 x2;
818   gint16 y2;
819 };
820
821 struct _GdkFont
822 {
823   GdkFontType type;
824   gint ascent;
825   gint descent;
826 };
827
828 struct _GdkCursor
829 {
830   GdkCursorType type;
831 };
832
833 struct _GdkColorContextDither
834 {
835   gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
836   gint fast_err[32][32][32]; /* internal RGB error information */
837   gint fast_erg[32][32][32];
838   gint fast_erb[32][32][32];
839 };
840
841 struct _GdkColorContext
842 {
843   GdkVisual *visual;
844   GdkColormap *colormap;
845
846   gint num_colors;              /* available no. of colors in colormap */
847   gint max_colors;              /* maximum no. of colors */
848   gint num_allocated;           /* no. of allocated colors */
849
850   GdkColorContextMode mode;
851   gint need_to_free_colormap;
852   GdkAtom std_cmap_atom;
853
854   gulong *clut;                 /* color look-up table */
855   GdkColor *cmap;               /* colormap */
856
857   GHashTable *color_hash;       /* hash table of allocated colors */
858   GdkColor *palette;            /* preallocated palette */
859   gint num_palette;             /* size of palette */
860
861   GdkColorContextDither *fast_dither;   /* fast dither matrix */
862
863   struct
864   {
865     gint red;
866     gint green;
867     gint blue;
868   } shifts;
869
870   struct
871   {
872     gulong red;
873     gulong green;
874     gulong blue;
875   } masks;
876
877   struct
878   {
879     gint red;
880     gint green;
881     gint blue;
882   } bits;
883
884   gulong max_entry;
885
886   gulong black_pixel;
887   gulong white_pixel;
888 };
889
890 /* Types for XInput support */
891
892 struct _GdkDeviceKey
893 {
894   guint keyval;
895   GdkModifierType modifiers;
896 };
897
898 struct _GdkDeviceInfo
899 {
900   guint32 deviceid;
901   gchar *name;
902   GdkInputSource source;
903   GdkInputMode mode;
904   gint has_cursor;      /* TRUE if the X pointer follows device motion */
905   gint num_axes;
906   GdkAxisUse *axes;    /* Specifies use for each axis */
907   gint num_keys;
908   GdkDeviceKey *keys;
909 };
910
911 struct _GdkTimeCoord
912 {
913   guint32 time;
914   gdouble x;
915   gdouble y;
916   gdouble pressure;
917   gdouble xtilt;
918   gdouble ytilt;
919 };
920
921 /* Event filtering */
922
923 typedef void GdkXEvent;   /* Can be cast to XEvent */
924
925 typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
926                                           GdkEvent *event,
927                                           gpointer  data);
928
929 struct _GdkEventAny
930 {
931   GdkEventType type;
932   GdkWindow *window;
933   gint8 send_event;
934 };
935
936 struct _GdkEventExpose
937 {
938   GdkEventType type;
939   GdkWindow *window;
940   gint8 send_event;
941   GdkRectangle area;
942   gint count; /* If non-zero, how many more events follow. */
943 };
944
945 struct _GdkEventNoExpose
946 {
947   GdkEventType type;
948   GdkWindow *window;
949   gint8 send_event;
950   /* XXX: does anyone need the X major_code or minor_code fields? */
951 };
952
953 struct _GdkEventVisibility
954 {
955   GdkEventType type;
956   GdkWindow *window;
957   gint8 send_event;
958   GdkVisibilityState state;
959 };
960
961 struct _GdkEventMotion
962 {
963   GdkEventType type;
964   GdkWindow *window;
965   gint8 send_event;
966   guint32 time;
967   gdouble x;
968   gdouble y;
969   gdouble pressure;
970   gdouble xtilt;
971   gdouble ytilt;
972   guint state;
973   gint16 is_hint;
974   GdkInputSource source;
975   guint32 deviceid;
976   gdouble x_root, y_root;
977 };
978
979 struct _GdkEventButton
980 {
981   GdkEventType type;
982   GdkWindow *window;
983   gint8 send_event;
984   guint32 time;
985   gdouble x;
986   gdouble y;
987   gdouble pressure;
988   gdouble xtilt;
989   gdouble ytilt;
990   guint state;
991   guint button;
992   GdkInputSource source;
993   guint32 deviceid;
994   gdouble x_root, y_root;
995 };
996
997 struct _GdkEventKey
998 {
999   GdkEventType type;
1000   GdkWindow *window;
1001   gint8 send_event;
1002   guint32 time;
1003   guint state;
1004   guint keyval;
1005   gint length;
1006   gchar *string;
1007 };
1008
1009 struct _GdkEventCrossing
1010 {
1011   GdkEventType type;
1012   GdkWindow *window;
1013   gint8 send_event;
1014   GdkWindow *subwindow;
1015   guint32 time;
1016   gdouble x;
1017   gdouble y;
1018   gdouble x_root;
1019   gdouble y_root;
1020   GdkCrossingMode mode;
1021   GdkNotifyType detail;
1022   gboolean focus;
1023   guint state;
1024 };
1025
1026 struct _GdkEventFocus
1027 {
1028   GdkEventType type;
1029   GdkWindow *window;
1030   gint8 send_event;
1031   gint16 in;
1032 };
1033
1034 struct _GdkEventConfigure
1035 {
1036   GdkEventType type;
1037   GdkWindow *window;
1038   gint8 send_event;
1039   gint16 x, y;
1040   gint16 width;
1041   gint16 height;
1042 };
1043
1044 struct _GdkEventProperty
1045 {
1046   GdkEventType type;
1047   GdkWindow *window;
1048   gint8 send_event;
1049   GdkAtom atom;
1050   guint32 time;
1051   guint state;
1052 };
1053
1054 struct _GdkEventSelection
1055 {
1056   GdkEventType type;
1057   GdkWindow *window;
1058   gint8 send_event;
1059   GdkAtom selection;
1060   GdkAtom target;
1061   GdkAtom property;
1062   guint32 requestor;
1063   guint32 time;
1064 };
1065
1066 /* This event type will be used pretty rarely. It only is important
1067    for XInput aware programs that are drawing their own cursor */
1068
1069 struct _GdkEventProximity
1070 {
1071   GdkEventType type;
1072   GdkWindow *window;
1073   gint8 send_event;
1074   guint32 time;
1075   GdkInputSource source;
1076   guint32 deviceid;
1077 };
1078
1079 struct _GdkEventDragRequest
1080 {
1081   GdkEventType type;
1082   GdkWindow *window;
1083   gint8 send_event;
1084   guint32 requestor;
1085   union {
1086     struct {
1087       guint protocol_version:4;
1088       guint sendreply:1;
1089       guint willaccept:1;
1090       guint delete_data:1; /* Do *not* delete if link is sent, only
1091                               if data is sent */
1092       guint senddata:1;
1093       guint reserved:22;
1094     } flags;
1095     glong allflags;
1096   } u;
1097   guint8 isdrop; /* This gdk event can be generated by a couple of
1098                     X events - this lets the app know whether the
1099                     drop really occurred or we just set the data */
1100
1101   GdkPoint drop_coords;
1102   gchar *data_type;
1103   guint32 timestamp;
1104 };
1105
1106 struct _GdkEventDragBegin
1107 {
1108   GdkEventType type;
1109   GdkWindow *window;
1110   gint8 send_event;
1111   union {
1112     struct {
1113       guint protocol_version:4;
1114       guint reserved:28;
1115     } flags;
1116     glong allflags;
1117   } u;
1118 };
1119
1120 struct _GdkEventDropEnter
1121 {
1122   GdkEventType type;
1123   GdkWindow *window;
1124   gint8 send_event;
1125   guint32 requestor;
1126   union {
1127     struct {
1128       guint protocol_version:4;
1129       guint sendreply:1;
1130       guint extended_typelist:1;
1131       guint reserved:26;
1132     } flags;
1133     glong allflags;
1134   } u;
1135 };
1136
1137 struct _GdkEventDropLeave
1138 {
1139   GdkEventType type;
1140   GdkWindow *window;
1141   gint8 send_event;
1142   guint32 requestor;
1143   union {
1144     struct {
1145       guint protocol_version:4;
1146       guint reserved:28;
1147     } flags;
1148     glong allflags;
1149   } u;
1150 };
1151
1152 struct _GdkEventDropDataAvailable
1153 {
1154   GdkEventType type;
1155   GdkWindow *window;
1156   gint8 send_event;
1157   guint32 requestor;
1158   union {
1159     struct {
1160       guint protocol_version:4;
1161       guint isdrop:1;
1162       guint reserved:25;
1163     } flags;
1164     glong allflags;
1165   } u;
1166   gchar *data_type; /* MIME type */
1167   gulong data_numbytes;
1168   gpointer data;
1169   guint32 timestamp;
1170   GdkPoint coords;
1171 };
1172
1173 struct _GdkEventClient
1174 {
1175   GdkEventType type;
1176   GdkWindow *window;
1177   gint8 send_event;
1178   GdkAtom message_type;
1179   gushort data_format;
1180   union {
1181     char b[20];
1182     short s[10];
1183     long l[5];
1184   } data;
1185 };
1186
1187 struct _GdkEventOther
1188 {
1189   GdkEventType type;
1190   GdkWindow *window;
1191   gint8 send_event;
1192   GdkXEvent *xevent;
1193 };
1194
1195 union _GdkEvent
1196 {
1197   GdkEventType              type;
1198   GdkEventAny               any;
1199   GdkEventExpose            expose;
1200   GdkEventNoExpose          no_expose;
1201   GdkEventVisibility        visibility;
1202   GdkEventMotion            motion;
1203   GdkEventButton            button;
1204   GdkEventKey               key;
1205   GdkEventCrossing          crossing;
1206   GdkEventFocus             focus_change;
1207   GdkEventConfigure         configure;
1208   GdkEventProperty          property;
1209   GdkEventSelection         selection;
1210   GdkEventProximity         proximity;
1211   GdkEventDragBegin         dragbegin;
1212   GdkEventDragRequest       dragrequest;
1213   GdkEventDropEnter         dropenter;
1214   GdkEventDropLeave         dropleave;
1215   GdkEventDropDataAvailable dropdataavailable;
1216   GdkEventClient            client;
1217   GdkEventOther             other;
1218 };
1219
1220 struct _GdkRegion
1221 {
1222   gpointer user_data;
1223 };
1224
1225
1226
1227 #ifdef __cplusplus
1228 }
1229 #endif /* __cplusplus */
1230
1231
1232 #endif /* __GDK_TYPES_H__ */