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, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | /* |
19 | * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS |
20 | * file for a list of people on the GTK+ Team. See the ChangeLog |
21 | * files for a list of changes. These files are distributed with |
22 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
23 | */ |
24 | |
25 | #ifndef __GDK_ENUMS_H__ |
26 | #define __GDK_ENUMS_H__ |
27 | |
28 | #if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION) |
29 | #error "Only <gdk/gdk.h> can be included directly." |
30 | #endif |
31 | |
32 | #include <glib.h> |
33 | |
34 | G_BEGIN_DECLS |
35 | |
36 | /* Currently, these are the same values numerically as in the |
37 | * X protocol. If you change that, gdksurface-x11.c/gdk_surface_set_geometry_hints() |
38 | * will need fixing. |
39 | */ |
40 | /** |
41 | * GdkGravity: |
42 | * @GDK_GRAVITY_NORTH_WEST: the reference point is at the top left corner. |
43 | * @GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge. |
44 | * @GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner. |
45 | * @GDK_GRAVITY_WEST: the reference point is at the middle of the left edge. |
46 | * @GDK_GRAVITY_CENTER: the reference point is at the center of the surface. |
47 | * @GDK_GRAVITY_EAST: the reference point is at the middle of the right edge. |
48 | * @GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner. |
49 | * @GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge. |
50 | * @GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner. |
51 | * @GDK_GRAVITY_STATIC: the reference point is at the top left corner of the |
52 | * surface itself, ignoring window manager decorations. |
53 | * |
54 | * Defines the reference point of a surface and is used in `GdkPopupLayout`. |
55 | */ |
56 | typedef enum |
57 | { |
58 | GDK_GRAVITY_NORTH_WEST = 1, |
59 | GDK_GRAVITY_NORTH, |
60 | GDK_GRAVITY_NORTH_EAST, |
61 | GDK_GRAVITY_WEST, |
62 | GDK_GRAVITY_CENTER, |
63 | GDK_GRAVITY_EAST, |
64 | GDK_GRAVITY_SOUTH_WEST, |
65 | GDK_GRAVITY_SOUTH, |
66 | GDK_GRAVITY_SOUTH_EAST, |
67 | GDK_GRAVITY_STATIC |
68 | } GdkGravity; |
69 | |
70 | /* Types of modifiers. |
71 | */ |
72 | /** |
73 | * GdkModifierType: |
74 | * @GDK_SHIFT_MASK: the Shift key. |
75 | * @GDK_LOCK_MASK: a Lock key (depending on the modifier mapping of the |
76 | * X server this may either be CapsLock or ShiftLock). |
77 | * @GDK_CONTROL_MASK: the Control key. |
78 | * @GDK_ALT_MASK: the fourth modifier key (it depends on the modifier |
79 | * mapping of the X server which key is interpreted as this modifier, but |
80 | * normally it is the Alt key). |
81 | * @GDK_BUTTON1_MASK: the first mouse button. |
82 | * @GDK_BUTTON2_MASK: the second mouse button. |
83 | * @GDK_BUTTON3_MASK: the third mouse button. |
84 | * @GDK_BUTTON4_MASK: the fourth mouse button. |
85 | * @GDK_BUTTON5_MASK: the fifth mouse button. |
86 | * @GDK_SUPER_MASK: the Super modifier |
87 | * @GDK_HYPER_MASK: the Hyper modifier |
88 | * @GDK_META_MASK: the Meta modifier |
89 | * |
90 | * Flags to indicate the state of modifier keys and mouse buttons |
91 | * in events. |
92 | * |
93 | * Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose, |
94 | * Apple, CapsLock or ShiftLock. |
95 | * |
96 | * Note that GDK may add internal values to events which include values outside |
97 | * of this enumeration. Your code should preserve and ignore them. You can use |
98 | * %GDK_MODIFIER_MASK to remove all private values. |
99 | */ |
100 | typedef enum |
101 | { |
102 | GDK_SHIFT_MASK = 1 << 0, |
103 | GDK_LOCK_MASK = 1 << 1, |
104 | GDK_CONTROL_MASK = 1 << 2, |
105 | GDK_ALT_MASK = 1 << 3, |
106 | |
107 | GDK_BUTTON1_MASK = 1 << 8, |
108 | GDK_BUTTON2_MASK = 1 << 9, |
109 | GDK_BUTTON3_MASK = 1 << 10, |
110 | GDK_BUTTON4_MASK = 1 << 11, |
111 | GDK_BUTTON5_MASK = 1 << 12, |
112 | |
113 | GDK_SUPER_MASK = 1 << 26, |
114 | GDK_HYPER_MASK = 1 << 27, |
115 | GDK_META_MASK = 1 << 28, |
116 | } GdkModifierType; |
117 | |
118 | |
119 | /** |
120 | * GDK_MODIFIER_MASK: |
121 | * |
122 | * A mask covering all entries in `GdkModifierType`. |
123 | */ |
124 | #define GDK_MODIFIER_MASK (GDK_SHIFT_MASK|GDK_LOCK_MASK|GDK_CONTROL_MASK| \ |
125 | GDK_ALT_MASK|GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK| \ |
126 | GDK_BUTTON1_MASK|GDK_BUTTON2_MASK|GDK_BUTTON3_MASK| \ |
127 | GDK_BUTTON4_MASK|GDK_BUTTON5_MASK) |
128 | |
129 | |
130 | /** |
131 | * GdkGLError: |
132 | * @GDK_GL_ERROR_NOT_AVAILABLE: OpenGL support is not available |
133 | * @GDK_GL_ERROR_UNSUPPORTED_FORMAT: The requested visual format is not supported |
134 | * @GDK_GL_ERROR_UNSUPPORTED_PROFILE: The requested profile is not supported |
135 | * @GDK_GL_ERROR_COMPILATION_FAILED: The shader compilation failed |
136 | * @GDK_GL_ERROR_LINK_FAILED: The shader linking failed |
137 | * |
138 | * Error enumeration for `GdkGLContext`. |
139 | */ |
140 | typedef enum { |
141 | GDK_GL_ERROR_NOT_AVAILABLE, |
142 | GDK_GL_ERROR_UNSUPPORTED_FORMAT, |
143 | GDK_GL_ERROR_UNSUPPORTED_PROFILE, |
144 | GDK_GL_ERROR_COMPILATION_FAILED, |
145 | GDK_GL_ERROR_LINK_FAILED |
146 | } GdkGLError; |
147 | |
148 | /** |
149 | * GdkVulkanError: |
150 | * @GDK_VULKAN_ERROR_UNSUPPORTED: Vulkan is not supported on this backend or has not been |
151 | * compiled in. |
152 | * @GDK_VULKAN_ERROR_NOT_AVAILABLE: Vulkan support is not available on this Surface |
153 | * |
154 | * Error enumeration for `GdkVulkanContext`. |
155 | */ |
156 | typedef enum { |
157 | GDK_VULKAN_ERROR_UNSUPPORTED, |
158 | GDK_VULKAN_ERROR_NOT_AVAILABLE, |
159 | } GdkVulkanError; |
160 | |
161 | /** |
162 | * GdkAxisUse: |
163 | * @GDK_AXIS_IGNORE: the axis is ignored. |
164 | * @GDK_AXIS_X: the axis is used as the x axis. |
165 | * @GDK_AXIS_Y: the axis is used as the y axis. |
166 | * @GDK_AXIS_DELTA_X: the axis is used as the scroll x delta |
167 | * @GDK_AXIS_DELTA_Y: the axis is used as the scroll y delta |
168 | * @GDK_AXIS_PRESSURE: the axis is used for pressure information. |
169 | * @GDK_AXIS_XTILT: the axis is used for x tilt information. |
170 | * @GDK_AXIS_YTILT: the axis is used for y tilt information. |
171 | * @GDK_AXIS_WHEEL: the axis is used for wheel information. |
172 | * @GDK_AXIS_DISTANCE: the axis is used for pen/tablet distance information |
173 | * @GDK_AXIS_ROTATION: the axis is used for pen rotation information |
174 | * @GDK_AXIS_SLIDER: the axis is used for pen slider information |
175 | * @GDK_AXIS_LAST: a constant equal to the numerically highest axis value. |
176 | * |
177 | * Defines how device axes are interpreted by GTK. |
178 | * |
179 | * Note that the X and Y axes are not really needed; pointer devices |
180 | * report their location via the x/y members of events regardless. Whether |
181 | * X and Y are present as axes depends on the GDK backend. |
182 | */ |
183 | typedef enum |
184 | { |
185 | GDK_AXIS_IGNORE, |
186 | GDK_AXIS_X, |
187 | GDK_AXIS_Y, |
188 | GDK_AXIS_DELTA_X, |
189 | GDK_AXIS_DELTA_Y, |
190 | GDK_AXIS_PRESSURE, |
191 | GDK_AXIS_XTILT, |
192 | GDK_AXIS_YTILT, |
193 | GDK_AXIS_WHEEL, |
194 | GDK_AXIS_DISTANCE, |
195 | GDK_AXIS_ROTATION, |
196 | GDK_AXIS_SLIDER, |
197 | GDK_AXIS_LAST |
198 | } GdkAxisUse; |
199 | |
200 | /** |
201 | * GdkAxisFlags: |
202 | * @GDK_AXIS_FLAG_X: X axis is present |
203 | * @GDK_AXIS_FLAG_Y: Y axis is present |
204 | * @GDK_AXIS_FLAG_DELTA_X: Scroll X delta axis is present |
205 | * @GDK_AXIS_FLAG_DELTA_Y: Scroll Y delta axis is present |
206 | * @GDK_AXIS_FLAG_PRESSURE: Pressure axis is present |
207 | * @GDK_AXIS_FLAG_XTILT: X tilt axis is present |
208 | * @GDK_AXIS_FLAG_YTILT: Y tilt axis is present |
209 | * @GDK_AXIS_FLAG_WHEEL: Wheel axis is present |
210 | * @GDK_AXIS_FLAG_DISTANCE: Distance axis is present |
211 | * @GDK_AXIS_FLAG_ROTATION: Z-axis rotation is present |
212 | * @GDK_AXIS_FLAG_SLIDER: Slider axis is present |
213 | * |
214 | * Flags describing the current capabilities of a device/tool. |
215 | */ |
216 | typedef enum |
217 | { |
218 | GDK_AXIS_FLAG_X = 1 << GDK_AXIS_X, |
219 | GDK_AXIS_FLAG_Y = 1 << GDK_AXIS_Y, |
220 | GDK_AXIS_FLAG_DELTA_X = 1 << GDK_AXIS_DELTA_X, |
221 | GDK_AXIS_FLAG_DELTA_Y = 1 << GDK_AXIS_DELTA_Y, |
222 | GDK_AXIS_FLAG_PRESSURE = 1 << GDK_AXIS_PRESSURE, |
223 | GDK_AXIS_FLAG_XTILT = 1 << GDK_AXIS_XTILT, |
224 | GDK_AXIS_FLAG_YTILT = 1 << GDK_AXIS_YTILT, |
225 | GDK_AXIS_FLAG_WHEEL = 1 << GDK_AXIS_WHEEL, |
226 | GDK_AXIS_FLAG_DISTANCE = 1 << GDK_AXIS_DISTANCE, |
227 | GDK_AXIS_FLAG_ROTATION = 1 << GDK_AXIS_ROTATION, |
228 | GDK_AXIS_FLAG_SLIDER = 1 << GDK_AXIS_SLIDER, |
229 | } GdkAxisFlags; |
230 | |
231 | /** |
232 | * GdkDragAction: |
233 | * @GDK_ACTION_COPY: Copy the data. |
234 | * @GDK_ACTION_MOVE: Move the data, i.e. first copy it, then delete |
235 | * it from the source using the DELETE target of the X selection protocol. |
236 | * @GDK_ACTION_LINK: Add a link to the data. Note that this is only |
237 | * useful if source and destination agree on what it means, and is not |
238 | * supported on all platforms. |
239 | * @GDK_ACTION_ASK: Ask the user what to do with the data. |
240 | * |
241 | * Used in `GdkDrop` and `GdkDrag` to indicate the actions that the |
242 | * destination can and should do with the dropped data. |
243 | */ |
244 | typedef enum |
245 | { |
246 | GDK_ACTION_COPY = 1 << 0, |
247 | GDK_ACTION_MOVE = 1 << 1, |
248 | GDK_ACTION_LINK = 1 << 2, |
249 | GDK_ACTION_ASK = 1 << 3 |
250 | } GdkDragAction; |
251 | |
252 | /** |
253 | * GDK_ACTION_ALL: |
254 | * |
255 | * Defines all possible DND actions. |
256 | * |
257 | * This can be used in [method@Gdk.Drop.status] messages when any drop |
258 | * can be accepted or a more specific drop method is not yet known. |
259 | */ |
260 | #define GDK_ACTION_ALL (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK) |
261 | |
262 | /** |
263 | * GdkMemoryFormat: |
264 | * @GDK_MEMORY_B8G8R8A8_PREMULTIPLIED: 4 bytes; for blue, green, red, alpha. |
265 | * The color values are premultiplied with the alpha value. |
266 | * @GDK_MEMORY_A8R8G8B8_PREMULTIPLIED: 4 bytes; for alpha, red, green, blue. |
267 | * The color values are premultiplied with the alpha value. |
268 | * @GDK_MEMORY_R8G8B8A8_PREMULTIPLIED: 4 bytes; for red, green, blue, alpha |
269 | * The color values are premultiplied with the alpha value. |
270 | * @GDK_MEMORY_B8G8R8A8: 4 bytes; for blue, green, red, alpha. |
271 | * @GDK_MEMORY_A8R8G8B8: 4 bytes; for alpha, red, green, blue. |
272 | * @GDK_MEMORY_R8G8B8A8: 4 bytes; for red, green, blue, alpha. |
273 | * @GDK_MEMORY_A8B8G8R8: 4 bytes; for alpha, blue, green, red. |
274 | * @GDK_MEMORY_R8G8B8: 3 bytes; for red, green, blue. The data is opaque. |
275 | * @GDK_MEMORY_B8G8R8: 3 bytes; for blue, green, red. The data is opaque. |
276 | * @GDK_MEMORY_R16G16B16: 3 guint16 values; for red, green, blue. Since: 4.6 |
277 | * @GDK_MEMORY_R16G16B16A16_PREMULTIPLIED: 4 guint16 values; for red, green, |
278 | * blue, alpha. The color values are premultiplied with the alpha value. |
279 | * Since: 4.6 |
280 | * @GDK_MEMORY_R16G16B16A16: 4 guint16 values; for red, green, blue, alpha. |
281 | * Since: 4.6 |
282 | * @GDK_MEMORY_R16G16B16_FLOAT: 3 half-float values; for red, green, blue. |
283 | * The data is opaque. Since: 4.6 |
284 | * @GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED: 4 half-float values; for |
285 | * red, green, blue and alpha. The color values are premultiplied with |
286 | * the alpha value. Since: 4.6 |
287 | * @GDK_MEMORY_R16G16B16A16_FLOAT: 4 half-float values; for red, green, |
288 | * blue and alpha. Since: 4.6 |
289 | * @GDK_MEMORY_B32G32R32_FLOAT: 3 float values; for blue, green, red. |
290 | * The data is opaque. Since: 4.6 |
291 | * @GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED: 4 float values; for |
292 | * red, green, blue and alpha. The color values are premultiplied with |
293 | * the alpha value. Since: 4.6 |
294 | * @GDK_MEMORY_R32G32B32A32_FLOAT: 4 float values; for red, green, blue and |
295 | * alpha. Since: 4.6 |
296 | * @GDK_MEMORY_N_FORMATS: The number of formats. This value will change as |
297 | * more formats get added, so do not rely on its concrete integer. |
298 | * |
299 | * `GdkMemoryFormat` describes formats that image data can have in memory. |
300 | * |
301 | * It describes formats by listing the contents of the memory passed to it. |
302 | * So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a |
303 | * byte each of red, green and blue. It is not endian-dependent, so |
304 | * CAIRO_FORMAT_ARGB32 is represented by different `GdkMemoryFormats` |
305 | * on architectures with different endiannesses. |
306 | * |
307 | * Its naming is modelled after |
308 | * [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat) |
309 | * for details). |
310 | */ |
311 | typedef enum { |
312 | GDK_MEMORY_B8G8R8A8_PREMULTIPLIED, |
313 | GDK_MEMORY_A8R8G8B8_PREMULTIPLIED, |
314 | GDK_MEMORY_R8G8B8A8_PREMULTIPLIED, |
315 | GDK_MEMORY_B8G8R8A8, |
316 | GDK_MEMORY_A8R8G8B8, |
317 | GDK_MEMORY_R8G8B8A8, |
318 | GDK_MEMORY_A8B8G8R8, |
319 | GDK_MEMORY_R8G8B8, |
320 | GDK_MEMORY_B8G8R8, |
321 | GDK_MEMORY_R16G16B16, |
322 | GDK_MEMORY_R16G16B16A16_PREMULTIPLIED, |
323 | GDK_MEMORY_R16G16B16A16, |
324 | GDK_MEMORY_R16G16B16_FLOAT, |
325 | GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED, |
326 | GDK_MEMORY_R16G16B16A16_FLOAT, |
327 | GDK_MEMORY_R32G32B32_FLOAT, |
328 | GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED, |
329 | GDK_MEMORY_R32G32B32A32_FLOAT, |
330 | |
331 | GDK_MEMORY_N_FORMATS |
332 | } GdkMemoryFormat; |
333 | |
334 | G_END_DECLS |
335 | |
336 | #endif /* __GDK_ENUMS_H__ */ |
337 | |