1// included by gdk2.pp
2
3{$IFDEF read_forward_definitions}
4{ Forward declarations of commonly used types }
5   PGdkInputCondition = ^TGdkInputCondition;
6   TGdkInputCondition = longint; // see below for possible values
7
8   PGdkStatus = ^TGdkStatus;
9   TGdkStatus = longint;
10
11   TGdkPoint  = record
12        x : gint;
13        y : gint;
14     end;
15   PGdkPoint  = ^TGdkPoint;
16   PPGdkPoint = ^PGdkPoint;
17
18   PGdkSpan = ^TGdkSpan;
19
20{   Note that on some platforms the wchar_t type
21   is not the same as GdkWChar. For instance
22   on Win32, wchar_t is unsigned short.
23  }
24   PGdkWChar = ^TGdkWChar;
25   TGdkWChar = guint32;
26
27   PGdkSegment = ^TGdkSegment;
28   TGdkSegment = record
29        x1 : gint;
30        y1 : gint;
31        x2 : gint;
32        y2 : gint;
33     end;
34
35   PGdkRectangle = ^TGdkRectangle;
36   TGdkRectangle = record
37        x : gint;
38        y : gint;
39        width : gint;
40        height : gint;
41     end;
42
43   PPGdkAtom = ^PGdkAtom;
44   PGdkAtom = ^TGdkAtom;
45   // internal type
46   TGdkAtom = PtrUInt;
47
48   PGdkByteOrder = ^TGdkByteOrder;
49   TGdkByteOrder = (
50     GDK_LSB_FIRST,
51     GDK_MSB_FIRST
52   );
53
54{$ifdef GDK_NATIVE_WINDOW_POINTER}
55   PGdkNativeWindow = ^TGdkNativeWindow;
56   TGdkNativeWindow = gpointer;
57{$else}
58   PGdkNativeWindow = ^TGdkNativeWindow;
59   TGdkNativeWindow = guint32;
60{$endif}
61
62{ Types of modifiers. }
63{ The next few modifiers are used by XKB, so we skip to the theEnd }
64   PGdkModifierType = ^TGdkModifierType;
65   TGdkModifierType = gint;
66
67{$ENDIF read_forward_definitions}
68
69//------------------------------------------------------------------------------
70
71{$IFDEF read_interface_types}
72{ Type definitions for the basic structures. }
73
74{ We define specific numeric values for these constants,
75   since old application code may depend on them matching the X values
76   We don't actually depend on the matchup ourselves.
77  }
78
79   PGdkGrabStatus = ^TGdkGrabStatus;
80   TGdkGrabStatus = integer; // see below for possible values
81
82   TGdkInputFunction = procedure (data:gpointer; source:gint;
83                                  condition:TGdkInputCondition); cdecl;
84
85   TGdkDestroyNotify = procedure (data:gpointer); cdecl;
86
87   TGdkSpan = record
88        x : gint;
89        y : gint;
90        width : gint;
91     end;
92
93{$ENDIF read_interface_types}
94
95//------------------------------------------------------------------------------
96
97{$IFDEF read_interface_rest}
98
99{ some common magic values  }
100const
101   GDK_CURRENT_TIME = 0;
102   GDK_PARENT_RELATIVE = 1;
103
104   GDK_OK = 0;
105   GDK_ERROR = -(1);
106   GDK_ERROR_PARAM = -(2);
107   GDK_ERROR_FILE = -(3);
108   GDK_ERROR_MEM = -(4);
109
110   GDK_SHIFT_MASK = 1 shl 0;
111   GDK_LOCK_MASK = 1 shl 1;
112   GDK_CONTROL_MASK = 1 shl 2;
113   GDK_MOD1_MASK = 1 shl 3;
114   GDK_MOD2_MASK = 1 shl 4;
115   GDK_MOD3_MASK = 1 shl 5;
116   GDK_MOD4_MASK = 1 shl 6;
117   GDK_MOD5_MASK = 1 shl 7;
118   GDK_BUTTON1_MASK = 1 shl 8;
119   GDK_BUTTON2_MASK = 1 shl 9;
120   GDK_BUTTON3_MASK = 1 shl 10;
121   GDK_BUTTON4_MASK = 1 shl 11;
122   GDK_BUTTON5_MASK = 1 shl 12;
123   GDK_RELEASE_MASK = 1 shl 30;
124   GDK_MODIFIER_MASK = ord(GDK_RELEASE_MASK) or $1fff;
125
126   // values for TGdkInputCondition
127   GDK_INPUT_READ = 1 shl 0;
128   GDK_INPUT_WRITE = 1 shl 1;
129   GDK_INPUT_EXCEPTION = 1 shl 2;
130
131   //  values for TGdkGrabStatus
132   GDK_GRAB_SUCCESS = 0;
133   GDK_GRAB_ALREADY_GRABBED = 1;
134   GDK_GRAB_INVALID_TIME = 2;
135   GDK_GRAB_NOT_VIEWABLE = 3;
136   GDK_GRAB_FROZEN = 4;
137
138
139function GDK_ATOM_TO_POINTER(atom : TGdkAtom) : Pointer;
140function GDK_POINTER_TO_ATOM(ptr : Pointer) : TGdkAtom;
141function _GDK_MAKE_ATOM(val : guint) : TGdkAtom;
142function GDK_NONE : TGdkAtom;
143
144{$endif read_interface_rest}
145
146//------------------------------------------------------------------------------
147
148{$IFDEF read_implementation}
149function GDK_ATOM_TO_POINTER(atom : TGdkAtom) : pointer;
150begin
151  GDK_ATOM_TO_POINTER:=Pointer(PtrInt(atom));
152end;
153
154function GDK_POINTER_TO_ATOM(ptr : Pointer) : TGdkAtom;
155begin
156  GDK_POINTER_TO_ATOM:=TGdkAtom(PtrInt(ptr));
157end;
158
159function _GDK_MAKE_ATOM(val : guint) : TGdkAtom;
160begin
161  _GDK_MAKE_ATOM:=TGdkAtom(PtrInt(GUINT_TO_POINTER(val)));
162end;
163
164function GDK_NONE : TGdkAtom;
165begin
166  GDK_NONE:=_GDK_MAKE_ATOM(0);
167end;
168{$ENDIF}
169
170