1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
19 #ifndef __GDK_TYPES_H__
20 #define __GDK_TYPES_H__
23 /* GDK uses "glib". (And so does GTK).
29 #define GDK_CURRENT_TIME 0L
30 #define GDK_PARENT_RELATIVE 1L
32 /* special deviceid for core pointer events */
33 #define GDK_CORE_POINTER 0xfedc
39 #endif /* __cplusplus */
42 /* Type definitions for the basic structures.
45 typedef gulong GdkAtom;
46 typedef struct _GdkColor GdkColor;
47 typedef struct _GdkColormap GdkColormap;
48 typedef struct _GdkVisual GdkVisual;
49 typedef struct _GdkWindowAttr GdkWindowAttr;
50 typedef struct _GdkWindow GdkWindow;
51 typedef struct _GdkWindow GdkPixmap;
52 typedef struct _GdkWindow GdkBitmap;
53 typedef struct _GdkWindow GdkDrawable;
54 typedef struct _GdkImage GdkImage;
55 typedef struct _GdkGCValues GdkGCValues;
56 typedef struct _GdkGC GdkGC;
57 typedef struct _GdkPoint GdkPoint;
58 typedef struct _GdkRectangle GdkRectangle;
59 typedef struct _GdkSegment GdkSegment;
60 typedef struct _GdkFont GdkFont;
61 typedef struct _GdkCursor GdkCursor;
62 typedef struct _GdkColorContextDither GdkColorContextDither;
63 typedef struct _GdkColorContext GdkColorContext;
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 _GdkEventOther GdkEventOther;
79 typedef struct _GdkEventDragBegin GdkEventDragBegin;
80 typedef struct _GdkEventDragRequest GdkEventDragRequest;
81 typedef struct _GdkEventDropEnter GdkEventDropEnter;
82 typedef struct _GdkEventDropDataAvailable GdkEventDropDataAvailable;
83 typedef struct _GdkEventDropLeave GdkEventDropLeave;
84 typedef struct _GdkEventClient GdkEventClient;
85 typedef union _GdkEvent GdkEvent;
86 typedef struct _GdkDeviceKey GdkDeviceKey;
87 typedef struct _GdkDeviceInfo GdkDeviceInfo;
88 typedef struct _GdkTimeCoord GdkTimeCoord;
89 typedef struct _GdkRegion GdkRegion;
90 typedef gint (*GdkEventFunc) (GdkEvent *event,
98 * Root: There is only 1 root window and it is initialized
99 * at startup. Creating a window of type GDK_WINDOW_ROOT
101 * Toplevel: Windows which interact with the window manager.
102 * Child: Windows which are children of some other type of window.
103 * (Any other type of window). Most windows are child windows.
104 * Dialog: A special kind of toplevel window which interacts with
105 * the window manager slightly differently than a regular
106 * toplevel window. Dialog windows should be used for any
108 * Pixmap: Pixmaps are really just another kind of window which
109 * doesn't actually appear on the screen. It can't have
110 * children, either and is really just a convenience so
111 * that the drawing functions can work on both windows
112 * and pixmaps transparently. (ie. You shouldn't pass a
113 * pixmap to any procedure which accepts a window with the
114 * exception of the drawing functions).
115 * Foreign: A window that actually belongs to another application
119 G_SV (GDK_WINDOW_ROOT, root),
120 G_SV (GDK_WINDOW_TOPLEVEL, toplevel),
121 G_SV (GDK_WINDOW_CHILD, child),
122 G_SV (GDK_WINDOW_DIALOG, dialog),
123 G_SV (GDK_WINDOW_TEMP, temp),
124 G_SV (GDK_WINDOW_PIXMAP, pixmap),
125 G_SV (GDK_WINDOW_FOREIGN, foreign)
126 } G_ENUM (GdkWindowType);
128 /* Classes of windows.
129 * InputOutput: Almost every window should be of this type. Such windows
130 * receive events and are also displayed on screen.
131 * InputOnly: Used only in special circumstances when events need to be
132 * stolen from another window or windows. Input only windows
133 * have no visible output, so they are handy for placing over
134 * top of a group of windows in order to grab the events (or
135 * filter the events) from those windows.
139 G_SV (GDK_INPUT_OUTPUT, input-output),
140 G_SV (GDK_INPUT_ONLY, input-only)
141 } G_ENUM (GdkWindowClass);
144 * Normal: Normal X image type. These are slow as they involve passing
145 * the entire image through the X connection each time a draw
146 * request is required.
147 * Shared: Shared memory X image type. These are fast as the X server
148 * and the program actually use the same piece of memory. They
149 * should be used with care though as there is the possibility
150 * for both the X server and the program to be reading/writing
151 * the image simultaneously and producing undesired results.
155 G_SV (GDK_IMAGE_NORMAL, normal),
156 G_SV (GDK_IMAGE_SHARED, shared),
157 G_SV (GDK_IMAGE_FASTEST, fastest)
158 } G_ENUM (GdkImageType);
170 G_SV (GDK_VISUAL_STATIC_GRAY, static-gray),
171 G_SV (GDK_VISUAL_GRAYSCALE, grayscale),
172 G_SV (GDK_VISUAL_STATIC_COLOR, static-color),
173 G_SV (GDK_VISUAL_PSEUDO_COLOR, pseudo-color),
174 G_SV (GDK_VISUAL_TRUE_COLOR, true-color),
175 G_SV (GDK_VISUAL_DIRECT_COLOR, direct-color)
176 } G_ENUM (GdkVisualType);
179 * GDK_FONT_FONT: the font is an XFontStruct.
180 * GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
184 G_SV (GDK_FONT_FONT, font),
185 G_SV (GDK_FONT_FONTSET, fontset)
186 } G_ENUM (GdkFontType);
188 /* Window attribute mask values.
189 * GDK_WA_TITLE: The "title" field is valid.
190 * GDK_WA_X: The "x" field is valid.
191 * GDK_WA_Y: The "y" field is valid.
192 * GDK_WA_CURSOR: The "cursor" field is valid.
193 * GDK_WA_COLORMAP: The "colormap" field is valid.
194 * GDK_WA_VISUAL: The "visual" field is valid.
198 G_NV (GDK_WA_TITLE, title, 1 << 1),
199 G_NV (GDK_WA_X, x, 1 << 2),
200 G_NV (GDK_WA_Y, y, 1 << 3),
201 G_NV (GDK_WA_CURSOR, cursor, 1 << 4),
202 G_NV (GDK_WA_COLORMAP, colormap, 1 << 5),
203 G_NV (GDK_WA_VISUAL, visual, 1 << 6),
204 G_NV (GDK_WA_WMCLASS, wmclass, 1 << 7),
205 G_NV (GDK_WA_NOREDIR, noredir, 1 << 8)
206 } G_FLAGS (GdkWindowAttributesType);
208 /* Size restriction enumeration.
212 G_NV (GDK_HINT_POS, pos, 1 << 0),
213 G_NV (GDK_HINT_MIN_SIZE, min-size, 1 << 1),
214 G_NV (GDK_HINT_MAX_SIZE, max-size, 1 << 2)
215 } G_FLAGS (GdkWindowHints);
217 /* GC function types.
218 * Copy: Overwrites destination pixels with the source pixels.
219 * Invert: Inverts the destination pixels.
220 * Xor: Xor's the destination pixels with the source pixels.
224 G_SV (GDK_COPY, copy),
225 G_SV (GDK_INVERT, invert),
227 } G_ENUM (GdkFunction);
237 G_SV (GDK_SOLID, solid),
238 G_SV (GDK_TILED, tiled),
239 G_SV (GDK_STIPPLED, stippled),
240 G_SV (GDK_OPAQUE_STIPPLED, opaque-stippled)
243 /* GC fill rule for polygons
249 G_SV (GDK_EVEN_ODD_RULE, even-odd-rule),
250 G_SV (GDK_WINDING_RULE, winding-rule)
251 } G_ENUM (GdkFillRule);
260 G_SV (GDK_LINE_SOLID, solid),
261 G_SV (GDK_LINE_ON_OFF_DASH, on-off-dash),
262 G_SV (GDK_LINE_DOUBLE_DASH, double-dash)
263 } G_ENUM (GdkLineStyle);
273 G_SV (GDK_CAP_NOT_LAST, not-last),
274 G_SV (GDK_CAP_BUTT, butt),
275 G_SV (GDK_CAP_ROUND, round),
276 G_SV (GDK_CAP_PROJECTING, projecting)
277 } G_ENUM (GdkCapStyle);
286 G_SV (GDK_JOIN_MITER, miter),
287 G_SV (GDK_JOIN_ROUND, round),
288 G_SV (GDK_JOIN_BEVEL, bevel)
289 } G_ENUM (GdkJoinStyle);
295 #include <gdk/gdkcursors.h>
297 GDK_CURSOR_IS_PIXMAP = -1
301 G_SV (GDK_FILTER_CONTINUE, continue), /* Event not handled,
302 * continue processesing */
303 G_SV (GDK_FILTER_TRANSLATE, translate), /* Translated event stored */
304 G_SV (GDK_FILTER_REMOVE, remove) /* Terminate processing,
306 } G_ENUM (GdkFilterReturn);
309 G_SV (GDK_VISIBILITY_UNOBSCURED, unobscured),
310 G_SV (GDK_VISIBILITY_PARTIAL, partial),
311 G_SV (GDK_VISIBILITY_FULLY_OBSCURED, fully-obscured)
312 } G_ENUM (GdkVisibilityState);
315 * Nothing: No event occurred.
316 * Delete: A window delete event was sent by the window manager.
317 * The specified window should be deleted.
318 * Destroy: A window has been destroyed.
319 * Expose: Part of a window has been uncovered.
320 * NoExpose: Same as expose, but no expose event was generated.
321 * VisibilityNotify: A window has become fully/partially/not obscured.
322 * MotionNotify: The mouse has moved.
323 * ButtonPress: A mouse button was pressed.
324 * ButtonRelease: A mouse button was release.
325 * KeyPress: A key was pressed.
326 * KeyRelease: A key was released.
327 * EnterNotify: A window was entered.
328 * LeaveNotify: A window was exited.
329 * FocusChange: The focus window has changed. (The focus window gets
331 * Resize: A window has been resized.
332 * Map: A window has been mapped. (It is now visible on the screen).
333 * Unmap: A window has been unmapped. (It is no longer visible on
338 G_NV (GDK_NOTHING, NOTHING, -1),
339 G_NV (GDK_DELETE, delete, 0),
340 G_NV (GDK_DESTROY, destroy, 1),
341 G_NV (GDK_EXPOSE, expose, 2),
342 G_NV (GDK_MOTION_NOTIFY, motion-notify, 3),
343 G_NV (GDK_BUTTON_PRESS, button-press, 4),
344 G_NV (GDK_2BUTTON_PRESS, 2button-press, 5),
345 G_NV (GDK_3BUTTON_PRESS, 3button-press, 6),
346 G_NV (GDK_BUTTON_RELEASE, button-release, 7),
347 G_NV (GDK_KEY_PRESS, key-press, 8),
348 G_NV (GDK_KEY_RELEASE, key-release, 9),
349 G_NV (GDK_ENTER_NOTIFY, enter-notify, 10),
350 G_NV (GDK_LEAVE_NOTIFY, leave-notify, 11),
351 G_NV (GDK_FOCUS_CHANGE, focus-change, 12),
352 G_NV (GDK_CONFIGURE, configure, 13),
353 G_NV (GDK_MAP, map, 14),
354 G_NV (GDK_UNMAP, unmap, 15),
355 G_NV (GDK_PROPERTY_NOTIFY, property-notify, 16),
356 G_NV (GDK_SELECTION_CLEAR, selection-clear, 17),
357 G_NV (GDK_SELECTION_REQUEST, selection-request,18),
358 G_NV (GDK_SELECTION_NOTIFY, selection-notify,19),
359 G_NV (GDK_PROXIMITY_IN, proximity-in, 20),
360 G_NV (GDK_PROXIMITY_OUT, proximity-out, 21),
361 G_NV (GDK_DRAG_BEGIN, drag-begin, 22),
362 G_NV (GDK_DRAG_REQUEST, drag-request, 23),
363 G_NV (GDK_DROP_ENTER, drop-enter, 24),
364 G_NV (GDK_DROP_LEAVE, drop-leave, 25),
365 G_NV (GDK_DROP_DATA_AVAIL, drop-data-avail, 26),
366 G_NV (GDK_CLIENT_EVENT, client-event, 27),
367 G_NV (GDK_VISIBILITY_NOTIFY, visibility-notify, 28),
368 G_NV (GDK_NO_EXPOSE, no-expose, 29),
369 G_NV (GDK_OTHER_EVENT, other-event, 9999) /* Deprecated, use
371 } G_ENUM (GdkEventType);
373 /* Event masks. (Used to select what types of events a window
378 G_NV (GDK_EXPOSURE_MASK, exposure-mask, 1 << 1),
379 G_NV (GDK_POINTER_MOTION_MASK, pointer-motion-mask, 1 << 2),
380 G_NV (GDK_POINTER_MOTION_HINT_MASK, pointer-motion-hint-mask, 1 << 3),
381 G_NV (GDK_BUTTON_MOTION_MASK, button-motion-mask, 1 << 4),
382 G_NV (GDK_BUTTON1_MOTION_MASK, button1-motion-mask, 1 << 5),
383 G_NV (GDK_BUTTON2_MOTION_MASK, button2-motion-mask, 1 << 6),
384 G_NV (GDK_BUTTON3_MOTION_MASK, button3-motion-mask, 1 << 7),
385 G_NV (GDK_BUTTON_PRESS_MASK, button-press-mask, 1 << 8),
386 G_NV (GDK_BUTTON_RELEASE_MASK, button-release-mask, 1 << 9),
387 G_NV (GDK_KEY_PRESS_MASK, key-press-mask, 1 << 10),
388 G_NV (GDK_KEY_RELEASE_MASK, key-release-mask, 1 << 11),
389 G_NV (GDK_ENTER_NOTIFY_MASK, enter-notify-mask, 1 << 12),
390 G_NV (GDK_LEAVE_NOTIFY_MASK, leave-notify-mask, 1 << 13),
391 G_NV (GDK_FOCUS_CHANGE_MASK, focus-change-mask, 1 << 14),
392 G_NV (GDK_STRUCTURE_MASK, structure-mask, 1 << 15),
393 G_NV (GDK_PROPERTY_CHANGE_MASK, property-change-mask, 1 << 16),
394 G_NV (GDK_VISIBILITY_NOTIFY_MASK, visibility-notify-mask, 1 << 17),
395 G_NV (GDK_PROXIMITY_IN_MASK, proximity-in-mask, 1 << 18),
396 G_NV (GDK_PROXIMITY_OUT_MASK, proximity-out-mask, 1 << 19),
397 G_NV (GDK_SUBSTRUCTURE_MASK, substructure-mask, 1 << 20),
398 G_NV (GDK_ALL_EVENTS_MASK, all-events-mask, 0x0FFFFF)
399 } G_FLAGS (GdkEventMask);
401 /* Types of enter/leave notifications.
407 * Unknown: An unknown type of enter/leave event occurred.
411 G_NV (GDK_NOTIFY_ANCESTOR, ancestor, 0),
412 G_NV (GDK_NOTIFY_VIRTUAL, virtual, 1),
413 G_NV (GDK_NOTIFY_INFERIOR, inferior, 2),
414 G_NV (GDK_NOTIFY_NONLINEAR, nonlinear, 3),
415 G_NV (GDK_NOTIFY_NONLINEAR_VIRTUAL, nonlinear-virtual, 4),
416 G_NV (GDK_NOTIFY_UNKNOWN, unknown, 5)
417 } G_ENUM (GdkNotifyType);
419 /* Enter/leave event modes.
426 G_SV (GDK_CROSSING_NORMAL, crossing-normal),
427 G_SV (GDK_CROSSING_GRAB, crossing-grab),
428 G_SV (GDK_CROSSING_UNGRAB, crossing-ungrab)
429 } G_ENUM (GdkCrossingMode);
431 /* Types of modifiers.
435 G_NV (GDK_SHIFT_MASK, shift-mask, 1 << 0),
436 G_NV (GDK_LOCK_MASK, lock-mask, 1 << 1),
437 G_NV (GDK_CONTROL_MASK, control-mask, 1 << 2),
438 G_NV (GDK_MOD1_MASK, mod1-mask, 1 << 3),
439 G_NV (GDK_MOD2_MASK, mod2-mask, 1 << 4),
440 G_NV (GDK_MOD3_MASK, mod3-mask, 1 << 5),
441 G_NV (GDK_MOD4_MASK, mod4-mask, 1 << 6),
442 G_NV (GDK_MOD5_MASK, mod5-mask, 1 << 7),
443 G_NV (GDK_BUTTON1_MASK, button1-mask, 1 << 8),
444 G_NV (GDK_BUTTON2_MASK, button2-mask, 1 << 9),
445 G_NV (GDK_BUTTON3_MASK, button3-mask, 1 << 10),
446 G_NV (GDK_BUTTON4_MASK, button4-mask, 1 << 11),
447 G_NV (GDK_BUTTON5_MASK, button5-mask, 1 << 12),
448 G_NV (GDK_MODIFIER_MASK, modifier-mask, 0x1fff)
449 } G_FLAGS (GdkModifierType);
453 G_NV (GDK_CLIP_BY_CHILDREN, clip-by-children, 0),
454 G_NV (GDK_INCLUDE_INFERIORS, include-inferiors, 1)
455 } G_ENUM (GdkSubwindowMode);
459 G_NV (GDK_INPUT_READ, read, 1 << 0),
460 G_NV (GDK_INPUT_WRITE, write, 1 << 1),
461 G_NV (GDK_INPUT_EXCEPTION, exception, 1 << 2)
462 } G_FLAGS (GdkInputCondition);
466 G_NV (GDK_OK, ok, 0),
467 G_NV (GDK_ERROR, error, -1),
468 G_NV (GDK_ERROR_PARAM, error-param, -2),
469 G_NV (GDK_ERROR_FILE, error-file, -3),
470 G_NV (GDK_ERROR_MEM, error-mem, -4)
471 } G_ENUM (GdkStatus);
475 G_SV (GDK_LSB_FIRST, lsb-first),
476 G_SV (GDK_MSB_FIRST, msb-first)
477 } G_ENUM (GdkByteOrder);
481 G_NV (GDK_GC_FOREGROUND, foreground, 1 << 0),
482 G_NV (GDK_GC_BACKGROUND, background, 1 << 1),
483 G_NV (GDK_GC_FONT, font, 1 << 2),
484 G_NV (GDK_GC_FUNCTION, function, 1 << 3),
485 G_NV (GDK_GC_FILL, fill, 1 << 4),
486 G_NV (GDK_GC_TILE, tile, 1 << 5),
487 G_NV (GDK_GC_STIPPLE, stipple, 1 << 6),
488 G_NV (GDK_GC_CLIP_MASK, clip-mask, 1 << 7),
489 G_NV (GDK_GC_SUBWINDOW, subwindow, 1 << 8),
490 G_NV (GDK_GC_TS_X_ORIGIN, ts-x-origin, 1 << 9),
491 G_NV (GDK_GC_TS_Y_ORIGIN, ts-y-origin, 1 << 10),
492 G_NV (GDK_GC_CLIP_X_ORIGIN, clip-x-origin, 1 << 11),
493 G_NV (GDK_GC_CLIP_Y_ORIGIN, clip-y-origin, 1 << 12),
494 G_NV (GDK_GC_EXPOSURES, exposures, 1 << 13),
495 G_NV (GDK_GC_LINE_WIDTH, line-width, 1 << 14),
496 G_NV (GDK_GC_LINE_STYLE, line-style, 1 << 15),
497 G_NV (GDK_GC_CAP_STYLE, cap-style, 1 << 16),
498 G_NV (GDK_GC_JOIN_STYLE, join-style, 1 << 17)
499 } G_FLAGS (GdkGCValuesMask);
503 G_NV (GDK_SELECTION_PRIMARY, primary, 1),
504 G_NV (GDK_SELECTION_SECONDARY, secondary, 2)
505 } G_ENUM (GdkSelection);
509 G_SV (GDK_PROPERTY_NEW_VALUE, new-value),
510 G_SV (GDK_PROPERTY_DELETE, delete)
511 } G_ENUM (GdkPropertyState);
515 G_SV (GDK_PROP_MODE_REPLACE, replace),
516 G_SV (GDK_PROP_MODE_PREPEND, prepend),
517 G_SV (GDK_PROP_MODE_APPEND, append)
518 } G_ENUM (GdkPropMode);
520 /* These definitions are for version 1 of the OffiX D&D protocol,
521 taken from <OffiX/DragAndDropTypes.h> */
524 G_NV (GDK_DNDTYPE_NOTDND, NOTDND, -1),
525 G_NV (GDK_DNDTYPE_UNKNOWN, UNKNOWN, 0),
526 G_NV (GDK_DNDTYPE_RAWDATA, RAWDATA, 1),
527 G_NV (GDK_DNDTYPE_FILE, FILE, 2),
528 G_NV (GDK_DNDTYPE_FILES, FILES, 3),
529 G_NV (GDK_DNDTYPE_TEXT, text, 4),
530 G_NV (GDK_DNDTYPE_DIR, dir, 5),
531 G_NV (GDK_DNDTYPE_LINK, link, 6),
532 G_NV (GDK_DNDTYPE_EXE, exe, 7),
533 G_NV (GDK_DNDTYPE_URL, url, 8),
534 G_NV (GDK_DNDTYPE_MIME, mime, 9),
535 G_NV (GDK_DNDTYPE_END, end, 10)
536 } G_ENUM (GdkDndType);
538 /* Enums for XInput support */
542 G_SV (GDK_SOURCE_MOUSE, mouse),
543 G_SV (GDK_SOURCE_PEN, pen),
544 G_SV (GDK_SOURCE_ERASER, eraser),
545 G_SV (GDK_SOURCE_CURSOR, cursor)
546 } G_ENUM (GdkInputSource);
550 G_SV (GDK_MODE_DISABLED, disabled),
551 G_SV (GDK_MODE_SCREEN, screen),
552 G_SV (GDK_MODE_WINDOW, window)
553 } G_ENUM (GdkInputMode);
557 G_SV (GDK_AXIS_IGNORE, ignore),
558 G_SV (GDK_AXIS_X, x),
559 G_SV (GDK_AXIS_Y, y),
560 G_SV (GDK_AXIS_PRESSURE, pressure),
561 G_SV (GDK_AXIS_XTILT, xtilt),
562 G_SV (GDK_AXIS_YTILT, ytilt),
563 G_SV (GDK_AXIS_LAST, last)
564 } G_ENUM (GdkAxisUse);
566 /* The next two types define enums for predefined atoms relating
567 * to selections. In general, one will need to use gdk_intern_atom
571 G_NV (GDK_TARGET_BITMAP, bitmap, 5),
572 G_NV (GDK_TARGET_COLORMAP, colormap, 7),
573 G_NV (GDK_TARGET_DRAWABLE, drawable, 17),
574 G_NV (GDK_TARGET_PIXMAP, pixmap, 20),
575 G_NV (GDK_TARGET_STRING, string, 31)
576 } G_ENUM (GdkTarget);
580 G_NV (GDK_SELECTION_TYPE_ATOM, atom, 4),
581 G_NV (GDK_SELECTION_TYPE_BITMAP, bitmap, 5),
582 G_NV (GDK_SELECTION_TYPE_COLORMAP, colormap, 7),
583 G_NV (GDK_SELECTION_TYPE_DRAWABLE, drawable, 17),
584 G_NV (GDK_SELECTION_TYPE_INTEGER, integer, 19),
585 G_NV (GDK_SELECTION_TYPE_PIXMAP, pixmap, 20),
586 G_NV (GDK_SELECTION_TYPE_WINDOW, window, 33),
587 G_NV (GDK_SELECTION_TYPE_STRING, string, 31)
588 } G_ENUM (GdkSelectionType);
592 G_SV (GDK_EXTENSION_EVENTS_NONE, none),
593 G_SV (GDK_EXTENSION_EVENTS_ALL, all),
594 G_SV (GDK_EXTENSION_EVENTS_CURSOR, cursor)
595 } G_ENUM (GdkExtensionMode);
599 GdkIMPreeditArea = 0x0001L,
600 GdkIMPreeditCallbacks = 0x0002L,
601 GdkIMPreeditPosition = 0x0004L,
602 GdkIMPreeditNothing = 0x0008L,
603 GdkIMPreeditNone = 0x0010L,
604 GdkIMStatusArea = 0x0100L,
605 GdkIMStatusCallbacks = 0x0200L,
606 GdkIMStatusNothing = 0x0400L,
607 GdkIMStatusNone = 0x0800L
610 /* The next two enumeration values current match the
611 * Motif constants. If this is changed, the implementation
612 * of gdk_window_set_decorations/gdk_window_set_functions
613 * will need to change as well.
617 G_NV (GDK_DECOR_ALL, all, 1 << 0),
618 G_NV (GDK_DECOR_BORDER, border, 1 << 1),
619 G_NV (GDK_DECOR_RESIZEH, resizeh, 1 << 2),
620 G_NV (GDK_DECOR_TITLE, title, 1 << 3),
621 G_NV (GDK_DECOR_MENU, menu, 1 << 4),
622 G_NV (GDK_DECOR_MINIMIZE, minimize, 1 << 5),
623 G_NV (GDK_DECOR_MAXIMIZE, maximize, 1 << 6)
624 } G_FLAGS (GdkWMDecoration);
628 G_NV (GDK_FUNC_ALL, all, 1 << 0),
629 G_NV (GDK_FUNC_RESIZE, resize, 1 << 1),
630 G_NV (GDK_FUNC_MOVE, move, 1 << 2),
631 G_NV (GDK_FUNC_MINIMIZE, minimize, 1 << 3),
632 G_NV (GDK_FUNC_MAXIMIZE, maximize, 1 << 4),
633 G_NV (GDK_FUNC_CLOSE, close, 1 << 5)
634 } G_FLAGS (GdkWMFunction);
636 #define GdkIMPreeditMask \
637 ( GdkIMPreeditArea | GdkIMPreeditCallbacks | \
638 GdkIMPreeditPosition | GdkIMPreeditNothing | \
641 #define GdkIMStatusMask \
642 ( GdkIMStatusArea | GdkIMStatusCallbacks | \
643 GdkIMStatusNothing | GdkIMStatusNone )
645 typedef void (*GdkInputFunction) (gpointer data,
647 GdkInputCondition condition);
649 typedef void (*GdkDestroyNotify) (gpointer data);
651 /* Color Context modes.
653 * GDK_CC_MODE_UNDEFINED - unknown
654 * GDK_CC_MODE_BW - default B/W
655 * GDK_CC_MODE_STD_CMAP - has a standard colormap
656 * GDK_CC_MODE_TRUE - is a TrueColor/DirectColor visual
657 * GDK_CC_MODE_MY_GRAY - my grayramp
658 * GDK_CC_MODE_PALETTE - has a pre-allocated palette
663 G_SV (GDK_CC_MODE_UNDEFINED, undefined),
664 G_SV (GDK_CC_MODE_BW, bw),
665 G_SV (GDK_CC_MODE_STD_CMAP, std-cmap),
666 G_SV (GDK_CC_MODE_TRUE, true),
667 G_SV (GDK_CC_MODE_MY_GRAY, my-gray),
668 G_SV (GDK_CC_MODE_PALETTE, palette)
669 } G_ENUM (GdkColorContextMode);
671 /* Types of overlapping between a rectangle and a region
672 * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
673 * GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
674 * GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
679 G_SV (GDK_OVERLAP_RECTANGLE_IN, in),
680 G_SV (GDK_OVERLAP_RECTANGLE_OUT, out),
681 G_SV (GDK_OVERLAP_RECTANGLE_PART, part)
682 } G_ENUM (GdkOverlapType);
685 * A color consists of red, green and blue values in the
686 * range 0-65535 and a pixel value. The pixel value is highly
687 * dependent on the depth and colormap which this color will
688 * be used to draw into. Therefore, sharing colors between
689 * colormaps is a bad idea.
699 /* The colormap type.
700 * Colormaps consist of 256 colors.
709 * "type" is the type of visual this is (PseudoColor, TrueColor, etc).
710 * "depth" is the bit depth of this visual.
711 * "colormap_size" is the size of a colormap for this visual.
712 * "bits_per_rgb" is the number of significant bits per red, green and blue.
713 * The red, green and blue masks, shifts and precisions refer
714 * to value needed to calculate pixel values in TrueColor and DirectColor
715 * visuals. The "mask" is the significant bits within the pixel. The
716 * "shift" is the number of bits left we must shift a primary for it
717 * to be in position (according to the "mask"). "prec" refers to how
718 * much precision the pixel value contains for a particular primary.
724 GdkByteOrder byte_order;
741 struct _GdkWindowAttr
748 GdkWindowClass wclass;
750 GdkColormap *colormap;
751 GdkWindowType window_type;
754 gchar *wmclass_class;
755 gboolean override_redirect;
766 GdkVisual *visual; /* visual used to create the image */
767 GdkByteOrder byte_order;
771 guint16 bpp; /* bytes per pixel */
772 guint16 bpl; /* bytes per line */
781 GdkFunction function;
785 GdkPixmap *clip_mask;
786 GdkSubwindowMode subwindow_mode;
791 gint graphics_exposures;
793 GdkLineStyle line_style;
794 GdkCapStyle cap_style;
795 GdkJoinStyle join_style;
837 struct _GdkColorContextDither
839 gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
840 gint fast_err[32][32][32]; /* internal RGB error information */
841 gint fast_erg[32][32][32];
842 gint fast_erb[32][32][32];
845 struct _GdkColorContext
848 GdkColormap *colormap;
850 gint num_colors; /* available no. of colors in colormap */
851 gint max_colors; /* maximum no. of colors */
852 gint num_allocated; /* no. of allocated colors */
854 GdkColorContextMode mode;
855 gint need_to_free_colormap;
856 GdkAtom std_cmap_atom;
858 gulong *clut; /* color look-up table */
859 GdkColor *cmap; /* colormap */
861 GHashTable *color_hash; /* hash table of allocated colors */
862 GdkColor *palette; /* preallocated palette */
863 gint num_palette; /* size of palette */
865 GdkColorContextDither *fast_dither; /* fast dither matrix */
894 /* Types for XInput support */
899 GdkModifierType modifiers;
902 struct _GdkDeviceInfo
906 GdkInputSource source;
908 gint has_cursor; /* TRUE if the X pointer follows device motion */
910 GdkAxisUse *axes; /* Specifies use for each axis */
925 /* Event filtering */
927 typedef void GdkXEvent; /* Can be cast to XEvent */
929 typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
940 struct _GdkEventExpose
946 gint count; /* If non-zero, how many more events follow. */
949 struct _GdkEventNoExpose
954 /* XXX: does anyone need the X major_code or minor_code fields? */
957 struct _GdkEventVisibility
962 GdkVisibilityState state;
965 struct _GdkEventMotion
978 GdkInputSource source;
980 gdouble x_root, y_root;
983 struct _GdkEventButton
996 GdkInputSource source;
998 gdouble x_root, y_root;
1013 struct _GdkEventCrossing
1018 GdkWindow *subwindow;
1024 GdkCrossingMode mode;
1025 GdkNotifyType detail;
1030 struct _GdkEventFocus
1038 struct _GdkEventConfigure
1048 struct _GdkEventProperty
1058 struct _GdkEventSelection
1070 /* This event type will be used pretty rarely. It only is important
1071 for XInput aware programs that are drawing their own cursor */
1073 struct _GdkEventProximity
1079 GdkInputSource source;
1083 struct _GdkEventDragRequest
1091 guint protocol_version:4;
1094 guint delete_data:1; /* Do *not* delete if link is sent, only
1101 guint8 isdrop; /* This gdk event can be generated by a couple of
1102 X events - this lets the app know whether the
1103 drop really occurred or we just set the data */
1105 GdkPoint drop_coords;
1110 struct _GdkEventDragBegin
1117 guint protocol_version:4;
1124 struct _GdkEventDropEnter
1132 guint protocol_version:4;
1134 guint extended_typelist:1;
1141 struct _GdkEventDropLeave
1149 guint protocol_version:4;
1156 struct _GdkEventDropDataAvailable
1164 guint protocol_version:4;
1170 gchar *data_type; /* MIME type */
1171 gulong data_numbytes;
1177 struct _GdkEventClient
1182 GdkAtom message_type;
1183 gushort data_format;
1191 struct _GdkEventOther
1203 GdkEventExpose expose;
1204 GdkEventNoExpose no_expose;
1205 GdkEventVisibility visibility;
1206 GdkEventMotion motion;
1207 GdkEventButton button;
1209 GdkEventCrossing crossing;
1210 GdkEventFocus focus_change;
1211 GdkEventConfigure configure;
1212 GdkEventProperty property;
1213 GdkEventSelection selection;
1214 GdkEventProximity proximity;
1215 GdkEventDragBegin dragbegin;
1216 GdkEventDragRequest dragrequest;
1217 GdkEventDropEnter dropenter;
1218 GdkEventDropLeave dropleave;
1219 GdkEventDropDataAvailable dropdataavailable;
1220 GdkEventClient client;
1221 GdkEventOther other;
1233 #endif /* __cplusplus */
1236 #endif /* __GDK_TYPES_H__ */