]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann, #72182.
[~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 #ifndef __GDK_TYPES_H__
28 #define __GDK_TYPES_H__
29
30 /* GDK uses "glib". (And so does GTK).
31  */
32 #include <glib.h>
33 #include <pango/pango.h>
34 #include <glib-object.h>
35
36 #ifdef G_OS_WIN32
37 #  ifdef GDK_COMPILATION
38 #    define GDKVAR __declspec(dllexport)
39 #  else
40 #    define GDKVAR extern __declspec(dllimport)
41 #  endif
42 #else
43 #  define GDKVAR extern
44 #endif
45
46 /* The system specific file gdkconfig.h contains such configuration
47  * settings that are needed not only when compiling GDK (or GTK)
48  * itself, but also occasionally when compiling programs that use GDK
49  * (or GTK). One such setting is what windowing API backend is in use.
50  */
51 #include <gdkconfig.h>
52
53 /* some common magic values */
54 #define GDK_CURRENT_TIME     0L
55 #define GDK_PARENT_RELATIVE  1L
56
57
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif /* __cplusplus */
62
63
64 /* Type definitions for the basic structures.
65  */
66 typedef struct _GdkPoint              GdkPoint;
67 typedef struct _GdkRectangle          GdkRectangle;
68 typedef struct _GdkSegment            GdkSegment;
69 typedef struct _GdkSpan               GdkSpan;
70
71 /*
72  * Note that on some platforms the wchar_t type
73  * is not the same as GdkWChar. For instance
74  * on Win32, wchar_t is unsigned short.
75  */
76 typedef guint32                     GdkWChar;
77
78 typedef struct _GdkAtom            *GdkAtom;
79
80 #define GDK_ATOM_TO_POINTER(atom) (atom)
81 #define GDK_POINTER_TO_ATOM(ptr)  ((GdkAtom)(ptr))
82
83 #define _GDK_MAKE_ATOM(val) ((GdkAtom)GUINT_TO_POINTER(val))
84 #define GDK_NONE            _GDK_MAKE_ATOM (0)
85
86 #ifdef GDK_NATIVE_WINDOW_POINTER
87 typedef gpointer GdkNativeWindow;
88 #else
89 typedef guint32 GdkNativeWindow;
90 #endif
91  
92 /* Forward declarations of commonly used types
93  */
94 typedef struct _GdkColor              GdkColor;
95 typedef struct _GdkColormap           GdkColormap;
96 typedef struct _GdkCursor             GdkCursor;
97 typedef struct _GdkFont               GdkFont;
98 typedef struct _GdkGC                 GdkGC;
99 typedef struct _GdkImage              GdkImage;
100 typedef struct _GdkRegion             GdkRegion;
101 typedef struct _GdkVisual             GdkVisual;
102
103 typedef struct _GdkDrawable           GdkDrawable;
104 typedef struct _GdkDrawable           GdkBitmap;
105 typedef struct _GdkDrawable           GdkPixmap;
106 typedef struct _GdkDrawable           GdkWindow;
107
108 typedef enum
109 {
110   GDK_LSB_FIRST,
111   GDK_MSB_FIRST
112 } GdkByteOrder;
113
114 /* Types of modifiers.
115  */
116 typedef enum
117 {
118   GDK_SHIFT_MASK    = 1 << 0,
119   GDK_LOCK_MASK     = 1 << 1,
120   GDK_CONTROL_MASK  = 1 << 2,
121   GDK_MOD1_MASK     = 1 << 3,
122   GDK_MOD2_MASK     = 1 << 4,
123   GDK_MOD3_MASK     = 1 << 5,
124   GDK_MOD4_MASK     = 1 << 6,
125   GDK_MOD5_MASK     = 1 << 7,
126   GDK_BUTTON1_MASK  = 1 << 8,
127   GDK_BUTTON2_MASK  = 1 << 9,
128   GDK_BUTTON3_MASK  = 1 << 10,
129   GDK_BUTTON4_MASK  = 1 << 11,
130   GDK_BUTTON5_MASK  = 1 << 12,
131   /* The next few modifiers are used by XKB, so we skip to the end
132    */
133   GDK_RELEASE_MASK  = 1 << 30,
134   GDK_MODIFIER_MASK = GDK_RELEASE_MASK | 0x1fff
135 } GdkModifierType;
136
137 typedef enum
138 {
139   GDK_INPUT_READ       = 1 << 0,
140   GDK_INPUT_WRITE      = 1 << 1,
141   GDK_INPUT_EXCEPTION  = 1 << 2
142 } GdkInputCondition;
143
144 typedef enum
145 {
146   GDK_OK          = 0,
147   GDK_ERROR       = -1,
148   GDK_ERROR_PARAM = -2,
149   GDK_ERROR_FILE  = -3,
150   GDK_ERROR_MEM   = -4
151 } GdkStatus;
152
153 /* We define specific numeric values for these constants,
154  * since old application code may depend on them matching the X values
155  * We don't actually depend on the matchup ourselves.
156  */
157 typedef enum
158 {
159   GDK_GRAB_SUCCESS         = 0,
160   GDK_GRAB_ALREADY_GRABBED = 1,
161   GDK_GRAB_INVALID_TIME    = 2,
162   GDK_GRAB_NOT_VIEWABLE    = 3,
163   GDK_GRAB_FROZEN          = 4
164 } GdkGrabStatus;
165
166 typedef void (*GdkInputFunction) (gpointer          data,
167                                   gint              source,
168                                   GdkInputCondition condition);
169
170 typedef void (*GdkDestroyNotify) (gpointer data);
171
172 struct _GdkPoint
173 {
174   gint x;
175   gint y;
176 };
177
178 struct _GdkRectangle
179 {
180   gint x;
181   gint y;
182   gint width;
183   gint height;
184 };
185
186 struct _GdkSegment
187 {
188   gint x1;
189   gint y1;
190   gint x2;
191   gint y2;
192 };
193
194 struct _GdkSpan
195 {
196   gint x;
197   gint y;
198   gint width;
199 };
200
201 #ifdef __cplusplus
202 }
203 #endif /* __cplusplus */
204
205
206 #endif /* __GDK_TYPES_H__ */