]> Pileus Git - ~andy/gtk/blob - gdk/gdktypes.h
Add new keysyms from X11R6.4 (including EuroSign).
[~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
34 #ifdef G_OS_WIN32
35 #  ifdef GDK_COMPILATION
36 #    define GDKVAR __declspec(dllexport)
37 #  else
38 #    define GDKVAR extern __declspec(dllimport)
39 #  endif
40 #else
41 #  define GDKVAR extern
42 #endif
43
44 /* The system specific file gdkconfig.h contains such configuration
45  * settings that are needed not only when compiling GDK (or GTK)
46  * itself, but also occasionally when compiling programs that use GDK
47  * (or GTK). One such setting is what windowing API backend is in use.
48  */
49 #include <gdkconfig.h>
50
51 /* some common magic values */
52 #define GDK_NONE             0L
53 #define GDK_CURRENT_TIME     0L
54 #define GDK_PARENT_RELATIVE  1L
55
56 /* special deviceid for core pointer events */
57 #define GDK_CORE_POINTER 0xfedc
58
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif /* __cplusplus */
63
64
65 /* Type definitions for the basic structures.
66  */
67 typedef struct _GdkPoint              GdkPoint;
68 typedef struct _GdkRectangle          GdkRectangle;
69 typedef struct _GdkSegment            GdkSegment;
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 typedef gulong                      GdkAtom;
78  
79 /* Forward declarations of commonly used types
80  */
81 typedef struct _GdkColor              GdkColor;
82 typedef struct _GdkColormap           GdkColormap;
83 typedef struct _GdkCursor             GdkCursor;
84 typedef struct _GdkFont               GdkFont;
85 typedef struct _GdkGC                 GdkGC;
86 typedef struct _GdkImage              GdkImage;
87 typedef struct _GdkRegion             GdkRegion;
88 typedef struct _GdkVisual             GdkVisual;
89
90 typedef struct _GdkDrawable           GdkDrawable;
91 typedef struct _GdkDrawable           GdkBitmap;
92 typedef struct _GdkDrawable           GdkPixmap;
93 typedef struct _GdkDrawable           GdkWindow;
94
95 typedef enum
96 {
97   GDK_LSB_FIRST,
98   GDK_MSB_FIRST
99 } GdkByteOrder;
100
101 /* Types of modifiers.
102  */
103 typedef enum
104 {
105   GDK_SHIFT_MASK    = 1 << 0,
106   GDK_LOCK_MASK     = 1 << 1,
107   GDK_CONTROL_MASK  = 1 << 2,
108   GDK_MOD1_MASK     = 1 << 3,
109   GDK_MOD2_MASK     = 1 << 4,
110   GDK_MOD3_MASK     = 1 << 5,
111   GDK_MOD4_MASK     = 1 << 6,
112   GDK_MOD5_MASK     = 1 << 7,
113   GDK_BUTTON1_MASK  = 1 << 8,
114   GDK_BUTTON2_MASK  = 1 << 9,
115   GDK_BUTTON3_MASK  = 1 << 10,
116   GDK_BUTTON4_MASK  = 1 << 11,
117   GDK_BUTTON5_MASK  = 1 << 12,
118   GDK_RELEASE_MASK  = 1 << 13,
119   GDK_MODIFIER_MASK = 0x3fff
120 } GdkModifierType;
121
122 typedef enum
123 {
124   GDK_INPUT_READ       = 1 << 0,
125   GDK_INPUT_WRITE      = 1 << 1,
126   GDK_INPUT_EXCEPTION  = 1 << 2
127 } GdkInputCondition;
128
129 typedef enum
130 {
131   GDK_OK          = 0,
132   GDK_ERROR       = -1,
133   GDK_ERROR_PARAM = -2,
134   GDK_ERROR_FILE  = -3,
135   GDK_ERROR_MEM   = -4
136 } GdkStatus;
137
138 typedef void (*GdkInputFunction) (gpointer          data,
139                                   gint              source,
140                                   GdkInputCondition condition);
141
142 typedef void (*GdkDestroyNotify) (gpointer data);
143
144 struct _GdkPoint
145 {
146   gint16 x;
147   gint16 y;
148 };
149
150 struct _GdkRectangle
151 {
152   gint16 x;
153   gint16 y;
154   guint16 width;
155   guint16 height;
156 };
157
158 struct _GdkSegment
159 {
160   gint16 x1;
161   gint16 y1;
162   gint16 x2;
163   gint16 y2;
164 };
165
166
167 #ifdef __cplusplus
168 }
169 #endif /* __cplusplus */
170
171
172 #endif /* __GDK_TYPES_H__ */