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