]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
Make this compile without framebuffer enabled
[~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
20 /*
21  * Modified by the GTK+ Team and others 1997-1999.  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_NONE             0L
55 #define GDK_CURRENT_TIME     0L
56 #define GDK_PARENT_RELATIVE  1L
57
58 /* special deviceid for core pointer events */
59 #define GDK_CORE_POINTER 0xfedc
60
61
62 #ifdef __cplusplus
63 extern "C" {
64 #endif /* __cplusplus */
65
66
67 /* Type definitions for the basic structures.
68  */
69 typedef struct _GdkPoint              GdkPoint;
70 typedef struct _GdkRectangle          GdkRectangle;
71 typedef struct _GdkSegment            GdkSegment;
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 typedef gulong                      GdkAtom;
80
81 #ifdef GDK_NATIVE_WINDOW_POINTER
82 typedef gpointer GdkNativeWindow;
83 #else
84 typedef guint32 GdkNativeWindow;
85 #endif
86  
87 /* Forward declarations of commonly used types
88  */
89 typedef struct _GdkColor              GdkColor;
90 typedef struct _GdkColormap           GdkColormap;
91 typedef struct _GdkCursor             GdkCursor;
92 typedef struct _GdkFont               GdkFont;
93 typedef struct _GdkGC                 GdkGC;
94 typedef struct _GdkImage              GdkImage;
95 typedef struct _GdkRegion             GdkRegion;
96 typedef struct _GdkVisual             GdkVisual;
97
98 typedef struct _GdkDrawable           GdkDrawable;
99 typedef struct _GdkDrawable           GdkBitmap;
100 typedef struct _GdkDrawable           GdkPixmap;
101 typedef struct _GdkDrawable           GdkWindow;
102
103 typedef enum
104 {
105   GDK_LSB_FIRST,
106   GDK_MSB_FIRST
107 } GdkByteOrder;
108
109 /* Types of modifiers.
110  */
111 typedef enum
112 {
113   GDK_SHIFT_MASK    = 1 << 0,
114   GDK_LOCK_MASK     = 1 << 1,
115   GDK_CONTROL_MASK  = 1 << 2,
116   GDK_MOD1_MASK     = 1 << 3,
117   GDK_MOD2_MASK     = 1 << 4,
118   GDK_MOD3_MASK     = 1 << 5,
119   GDK_MOD4_MASK     = 1 << 6,
120   GDK_MOD5_MASK     = 1 << 7,
121   GDK_BUTTON1_MASK  = 1 << 8,
122   GDK_BUTTON2_MASK  = 1 << 9,
123   GDK_BUTTON3_MASK  = 1 << 10,
124   GDK_BUTTON4_MASK  = 1 << 11,
125   GDK_BUTTON5_MASK  = 1 << 12,
126   /* The next few modifiers are used by XKB, so we skip to the end
127    */
128   GDK_RELEASE_MASK  = 1 << 31,
129   GDK_MODIFIER_MASK = GDK_RELEASE_MASK | 0x1fff
130 } GdkModifierType;
131
132 typedef enum
133 {
134   GDK_INPUT_READ       = 1 << 0,
135   GDK_INPUT_WRITE      = 1 << 1,
136   GDK_INPUT_EXCEPTION  = 1 << 2
137 } GdkInputCondition;
138
139 typedef enum
140 {
141   GDK_OK          = 0,
142   GDK_ERROR       = -1,
143   GDK_ERROR_PARAM = -2,
144   GDK_ERROR_FILE  = -3,
145   GDK_ERROR_MEM   = -4
146 } GdkStatus;
147
148 typedef void (*GdkInputFunction) (gpointer          data,
149                                   gint              source,
150                                   GdkInputCondition condition);
151
152 typedef void (*GdkDestroyNotify) (gpointer data);
153
154 struct _GdkPoint
155 {
156   gint x;
157   gint y;
158 };
159
160 struct _GdkRectangle
161 {
162   gint x;
163   gint y;
164   gint width;
165   gint height;
166 };
167
168 struct _GdkSegment
169 {
170   gint x1;
171   gint y1;
172   gint x2;
173   gint y2;
174 };
175
176 #ifdef __cplusplus
177 }
178 #endif /* __cplusplus */
179
180
181 #endif /* __GDK_TYPES_H__ */