]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
deprecate GdkDestroyNotify.
[~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 Lesser 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
29 #endif
30
31 #ifndef __GDK_TYPES_H__
32 #define __GDK_TYPES_H__
33
34 /* GDK uses "glib". (And so does GTK).
35  */
36 #include <glib.h>
37 #include <pango/pango.h>
38 #include <glib-object.h>
39
40 #ifdef G_OS_WIN32
41 #  ifdef GDK_COMPILATION
42 #    define GDKVAR __declspec(dllexport)
43 #  else
44 #    define GDKVAR extern __declspec(dllimport)
45 #  endif
46 #else
47 #  define GDKVAR extern
48 #endif
49
50 /* The system specific file gdkconfig.h contains such configuration
51  * settings that are needed not only when compiling GDK (or GTK)
52  * itself, but also occasionally when compiling programs that use GDK
53  * (or GTK). One such setting is what windowing API backend is in use.
54  */
55 #include <gdkconfig.h>
56
57 /* some common magic values */
58 #define GDK_CURRENT_TIME     0L
59 #define GDK_PARENT_RELATIVE  1L
60
61
62
63 G_BEGIN_DECLS
64
65
66 /* Type definitions for the basic structures.
67  */
68 typedef struct _GdkPoint              GdkPoint;
69 typedef struct _GdkRectangle          GdkRectangle;
70 typedef struct _GdkSegment            GdkSegment;
71 typedef struct _GdkSpan               GdkSpan;
72
73 /*
74  * Note that on some platforms the wchar_t type
75  * is not the same as GdkWChar. For instance
76  * on Win32, wchar_t is unsigned short.
77  */
78 typedef guint32                     GdkWChar;
79
80 typedef struct _GdkAtom            *GdkAtom;
81
82 #define GDK_ATOM_TO_POINTER(atom) (atom)
83 #define GDK_POINTER_TO_ATOM(ptr)  ((GdkAtom)(ptr))
84
85 #define _GDK_MAKE_ATOM(val) ((GdkAtom)GUINT_TO_POINTER(val))
86 #define GDK_NONE            _GDK_MAKE_ATOM (0)
87
88 #ifdef GDK_NATIVE_WINDOW_POINTER
89 typedef gpointer GdkNativeWindow;
90 #else
91 typedef guint32 GdkNativeWindow;
92 #endif
93  
94 /* Forward declarations of commonly used types
95  */
96 typedef struct _GdkColor              GdkColor;
97 typedef struct _GdkColormap           GdkColormap;
98 typedef struct _GdkCursor             GdkCursor;
99 typedef struct _GdkFont               GdkFont;
100 typedef struct _GdkGC                 GdkGC;
101 typedef struct _GdkImage              GdkImage;
102 typedef struct _GdkRegion             GdkRegion;
103 typedef struct _GdkVisual             GdkVisual;
104
105 typedef struct _GdkDrawable           GdkDrawable;
106 typedef struct _GdkDrawable           GdkBitmap;
107 typedef struct _GdkDrawable           GdkPixmap;
108 typedef struct _GdkDrawable           GdkWindow;
109 typedef struct _GdkDisplay            GdkDisplay;
110 typedef struct _GdkScreen             GdkScreen;
111
112 typedef enum
113 {
114   GDK_LSB_FIRST,
115   GDK_MSB_FIRST
116 } GdkByteOrder;
117
118 /* Types of modifiers.
119  */
120 typedef enum
121 {
122   GDK_SHIFT_MASK    = 1 << 0,
123   GDK_LOCK_MASK     = 1 << 1,
124   GDK_CONTROL_MASK  = 1 << 2,
125   GDK_MOD1_MASK     = 1 << 3,
126   GDK_MOD2_MASK     = 1 << 4,
127   GDK_MOD3_MASK     = 1 << 5,
128   GDK_MOD4_MASK     = 1 << 6,
129   GDK_MOD5_MASK     = 1 << 7,
130   GDK_BUTTON1_MASK  = 1 << 8,
131   GDK_BUTTON2_MASK  = 1 << 9,
132   GDK_BUTTON3_MASK  = 1 << 10,
133   GDK_BUTTON4_MASK  = 1 << 11,
134   GDK_BUTTON5_MASK  = 1 << 12,
135
136   /* The next few modifiers are used by XKB, so we skip to the end.
137    * Bits 15 - 25 are currently unused. Bit 29 is used internally.
138    */
139   
140   GDK_SUPER_MASK    = 1 << 26,
141   GDK_HYPER_MASK    = 1 << 27,
142   GDK_META_MASK     = 1 << 28,
143   
144   GDK_RELEASE_MASK  = 1 << 30,
145
146   GDK_MODIFIER_MASK = 0x5c001fff
147 } GdkModifierType;
148
149 typedef enum
150 {
151   GDK_INPUT_READ       = 1 << 0,
152   GDK_INPUT_WRITE      = 1 << 1,
153   GDK_INPUT_EXCEPTION  = 1 << 2
154 } GdkInputCondition;
155
156 typedef enum
157 {
158   GDK_OK          = 0,
159   GDK_ERROR       = -1,
160   GDK_ERROR_PARAM = -2,
161   GDK_ERROR_FILE  = -3,
162   GDK_ERROR_MEM   = -4
163 } GdkStatus;
164
165 /* We define specific numeric values for these constants,
166  * since old application code may depend on them matching the X values
167  * We don't actually depend on the matchup ourselves.
168  */
169 typedef enum
170 {
171   GDK_GRAB_SUCCESS         = 0,
172   GDK_GRAB_ALREADY_GRABBED = 1,
173   GDK_GRAB_INVALID_TIME    = 2,
174   GDK_GRAB_NOT_VIEWABLE    = 3,
175   GDK_GRAB_FROZEN          = 4
176 } GdkGrabStatus;
177
178 typedef void (*GdkInputFunction) (gpointer          data,
179                                   gint              source,
180                                   GdkInputCondition condition);
181
182 #ifndef GDK_DISABLE_DEPRECATED
183
184 typedef void (*GdkDestroyNotify) (gpointer data);
185
186 #endif /* GDK_DISABLE_DEPRECATED */
187
188 struct _GdkPoint
189 {
190   gint x;
191   gint y;
192 };
193
194 struct _GdkRectangle
195 {
196   gint x;
197   gint y;
198   gint width;
199   gint height;
200 };
201
202 struct _GdkSegment
203 {
204   gint x1;
205   gint y1;
206   gint x2;
207   gint y2;
208 };
209
210 struct _GdkSpan
211 {
212   gint x;
213   gint y;
214   gint width;
215 };
216
217 G_END_DECLS
218
219
220 #endif /* __GDK_TYPES_H__ */