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_CURSOR_H__ |
26 | #define __GDK_CURSOR_H__ |
27 | |
28 | #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) |
29 | #error "Only <gdk/gdk.h> can be included directly." |
30 | #endif |
31 | |
32 | #include <gdk/gdkversionmacros.h> |
33 | #include <gdk/gdktypes.h> |
34 | #include <gdk-pixbuf/gdk-pixbuf.h> |
35 | |
36 | G_BEGIN_DECLS |
37 | |
38 | #define GDK_TYPE_CURSOR (gdk_cursor_get_type ()) |
39 | #define GDK_CURSOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_CURSOR, GdkCursor)) |
40 | #define GDK_IS_CURSOR(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_CURSOR)) |
41 | |
42 | |
43 | /** |
44 | * GdkCursorType: |
45 | * @GDK_X_CURSOR:  |
46 | * @GDK_ARROW:  |
47 | * @GDK_BASED_ARROW_DOWN:  |
48 | * @GDK_BASED_ARROW_UP:  |
49 | * @GDK_BOAT:  |
50 | * @GDK_BOGOSITY:  |
51 | * @GDK_BOTTOM_LEFT_CORNER:  |
52 | * @GDK_BOTTOM_RIGHT_CORNER:  |
53 | * @GDK_BOTTOM_SIDE:  |
54 | * @GDK_BOTTOM_TEE:  |
55 | * @GDK_BOX_SPIRAL:  |
56 | * @GDK_CENTER_PTR:  |
57 | * @GDK_CIRCLE:  |
58 | * @GDK_CLOCK:  |
59 | * @GDK_COFFEE_MUG:  |
60 | * @GDK_CROSS:  |
61 | * @GDK_CROSS_REVERSE:  |
62 | * @GDK_CROSSHAIR:  |
63 | * @GDK_DIAMOND_CROSS:  |
64 | * @GDK_DOT:  |
65 | * @GDK_DOTBOX:  |
66 | * @GDK_DOUBLE_ARROW:  |
67 | * @GDK_DRAFT_LARGE:  |
68 | * @GDK_DRAFT_SMALL:  |
69 | * @GDK_DRAPED_BOX:  |
70 | * @GDK_EXCHANGE:  |
71 | * @GDK_FLEUR:  |
72 | * @GDK_GOBBLER:  |
73 | * @GDK_GUMBY:  |
74 | * @GDK_HAND1:  |
75 | * @GDK_HAND2:  |
76 | * @GDK_HEART:  |
77 | * @GDK_ICON:  |
78 | * @GDK_IRON_CROSS:  |
79 | * @GDK_LEFT_PTR:  |
80 | * @GDK_LEFT_SIDE:  |
81 | * @GDK_LEFT_TEE:  |
82 | * @GDK_LEFTBUTTON:  |
83 | * @GDK_LL_ANGLE:  |
84 | * @GDK_LR_ANGLE:  |
85 | * @GDK_MAN:  |
86 | * @GDK_MIDDLEBUTTON:  |
87 | * @GDK_MOUSE:  |
88 | * @GDK_PENCIL:  |
89 | * @GDK_PIRATE:  |
90 | * @GDK_PLUS:  |
91 | * @GDK_QUESTION_ARROW:  |
92 | * @GDK_RIGHT_PTR:  |
93 | * @GDK_RIGHT_SIDE:  |
94 | * @GDK_RIGHT_TEE:  |
95 | * @GDK_RIGHTBUTTON:  |
96 | * @GDK_RTL_LOGO:  |
97 | * @GDK_SAILBOAT:  |
98 | * @GDK_SB_DOWN_ARROW:  |
99 | * @GDK_SB_H_DOUBLE_ARROW:  |
100 | * @GDK_SB_LEFT_ARROW:  |
101 | * @GDK_SB_RIGHT_ARROW:  |
102 | * @GDK_SB_UP_ARROW:  |
103 | * @GDK_SB_V_DOUBLE_ARROW:  |
104 | * @GDK_SHUTTLE:  |
105 | * @GDK_SIZING:  |
106 | * @GDK_SPIDER:  |
107 | * @GDK_SPRAYCAN:  |
108 | * @GDK_STAR:  |
109 | * @GDK_TARGET:  |
110 | * @GDK_TCROSS:  |
111 | * @GDK_TOP_LEFT_ARROW:  |
112 | * @GDK_TOP_LEFT_CORNER:  |
113 | * @GDK_TOP_RIGHT_CORNER:  |
114 | * @GDK_TOP_SIDE:  |
115 | * @GDK_TOP_TEE:  |
116 | * @GDK_TREK:  |
117 | * @GDK_UL_ANGLE:  |
118 | * @GDK_UMBRELLA:  |
119 | * @GDK_UR_ANGLE:  |
120 | * @GDK_WATCH:  |
121 | * @GDK_XTERM:  |
122 | * @GDK_LAST_CURSOR: last cursor type |
123 | * @GDK_BLANK_CURSOR: Blank cursor. Since 2.16 |
124 | * @GDK_CURSOR_IS_PIXMAP: type of cursors constructed with |
125 | * gdk_cursor_new_from_pixbuf() |
126 | * |
127 | * Predefined cursors. |
128 | * |
129 | * Note that these IDs are directly taken from the X cursor font, and many |
130 | * of these cursors are either not useful, or are not available on other platforms. |
131 | * |
132 | * The recommended way to create cursors is to use gdk_cursor_new_from_name(). |
133 | */ |
134 | typedef enum |
135 | { |
136 | GDK_X_CURSOR = 0, |
137 | GDK_ARROW = 2, |
138 | GDK_BASED_ARROW_DOWN = 4, |
139 | GDK_BASED_ARROW_UP = 6, |
140 | GDK_BOAT = 8, |
141 | GDK_BOGOSITY = 10, |
142 | GDK_BOTTOM_LEFT_CORNER = 12, |
143 | GDK_BOTTOM_RIGHT_CORNER = 14, |
144 | GDK_BOTTOM_SIDE = 16, |
145 | GDK_BOTTOM_TEE = 18, |
146 | GDK_BOX_SPIRAL = 20, |
147 | GDK_CENTER_PTR = 22, |
148 | GDK_CIRCLE = 24, |
149 | GDK_CLOCK = 26, |
150 | GDK_COFFEE_MUG = 28, |
151 | GDK_CROSS = 30, |
152 | GDK_CROSS_REVERSE = 32, |
153 | GDK_CROSSHAIR = 34, |
154 | GDK_DIAMOND_CROSS = 36, |
155 | GDK_DOT = 38, |
156 | GDK_DOTBOX = 40, |
157 | GDK_DOUBLE_ARROW = 42, |
158 | GDK_DRAFT_LARGE = 44, |
159 | GDK_DRAFT_SMALL = 46, |
160 | GDK_DRAPED_BOX = 48, |
161 | GDK_EXCHANGE = 50, |
162 | GDK_FLEUR = 52, |
163 | GDK_GOBBLER = 54, |
164 | GDK_GUMBY = 56, |
165 | GDK_HAND1 = 58, |
166 | GDK_HAND2 = 60, |
167 | GDK_HEART = 62, |
168 | GDK_ICON = 64, |
169 | GDK_IRON_CROSS = 66, |
170 | GDK_LEFT_PTR = 68, |
171 | GDK_LEFT_SIDE = 70, |
172 | GDK_LEFT_TEE = 72, |
173 | GDK_LEFTBUTTON = 74, |
174 | GDK_LL_ANGLE = 76, |
175 | GDK_LR_ANGLE = 78, |
176 | GDK_MAN = 80, |
177 | GDK_MIDDLEBUTTON = 82, |
178 | GDK_MOUSE = 84, |
179 | GDK_PENCIL = 86, |
180 | GDK_PIRATE = 88, |
181 | GDK_PLUS = 90, |
182 | GDK_QUESTION_ARROW = 92, |
183 | GDK_RIGHT_PTR = 94, |
184 | GDK_RIGHT_SIDE = 96, |
185 | GDK_RIGHT_TEE = 98, |
186 | GDK_RIGHTBUTTON = 100, |
187 | GDK_RTL_LOGO = 102, |
188 | GDK_SAILBOAT = 104, |
189 | GDK_SB_DOWN_ARROW = 106, |
190 | GDK_SB_H_DOUBLE_ARROW = 108, |
191 | GDK_SB_LEFT_ARROW = 110, |
192 | GDK_SB_RIGHT_ARROW = 112, |
193 | GDK_SB_UP_ARROW = 114, |
194 | GDK_SB_V_DOUBLE_ARROW = 116, |
195 | GDK_SHUTTLE = 118, |
196 | GDK_SIZING = 120, |
197 | GDK_SPIDER = 122, |
198 | GDK_SPRAYCAN = 124, |
199 | GDK_STAR = 126, |
200 | GDK_TARGET = 128, |
201 | GDK_TCROSS = 130, |
202 | GDK_TOP_LEFT_ARROW = 132, |
203 | GDK_TOP_LEFT_CORNER = 134, |
204 | GDK_TOP_RIGHT_CORNER = 136, |
205 | GDK_TOP_SIDE = 138, |
206 | GDK_TOP_TEE = 140, |
207 | GDK_TREK = 142, |
208 | GDK_UL_ANGLE = 144, |
209 | GDK_UMBRELLA = 146, |
210 | GDK_UR_ANGLE = 148, |
211 | GDK_WATCH = 150, |
212 | GDK_XTERM = 152, |
213 | GDK_LAST_CURSOR, |
214 | GDK_BLANK_CURSOR = -2, |
215 | GDK_CURSOR_IS_PIXMAP = -1 |
216 | } GdkCursorType; |
217 | |
218 | /* Cursors |
219 | */ |
220 | |
221 | GDK_AVAILABLE_IN_ALL |
222 | GType gdk_cursor_get_type (void) G_GNUC_CONST; |
223 | |
224 | GDK_AVAILABLE_IN_ALL |
225 | GdkCursor* gdk_cursor_new_for_display (GdkDisplay *display, |
226 | GdkCursorType cursor_type); |
227 | GDK_DEPRECATED_IN_3_16_FOR(gdk_cursor_new_for_display) |
228 | GdkCursor* gdk_cursor_new (GdkCursorType cursor_type); |
229 | GDK_AVAILABLE_IN_ALL |
230 | GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display, |
231 | GdkPixbuf *pixbuf, |
232 | gint x, |
233 | gint y); |
234 | GDK_AVAILABLE_IN_3_10 |
235 | GdkCursor* gdk_cursor_new_from_surface (GdkDisplay *display, |
236 | cairo_surface_t *surface, |
237 | gdouble x, |
238 | gdouble y); |
239 | GDK_AVAILABLE_IN_ALL |
240 | GdkCursor* gdk_cursor_new_from_name (GdkDisplay *display, |
241 | const gchar *name); |
242 | GDK_AVAILABLE_IN_ALL |
243 | GdkDisplay* gdk_cursor_get_display (GdkCursor *cursor); |
244 | GDK_DEPRECATED_IN_3_0_FOR(g_object_ref) |
245 | GdkCursor * gdk_cursor_ref (GdkCursor *cursor); |
246 | GDK_DEPRECATED_IN_3_0_FOR(g_object_unref) |
247 | void gdk_cursor_unref (GdkCursor *cursor); |
248 | GDK_AVAILABLE_IN_ALL |
249 | GdkPixbuf* gdk_cursor_get_image (GdkCursor *cursor); |
250 | GDK_AVAILABLE_IN_3_10 |
251 | cairo_surface_t *gdk_cursor_get_surface (GdkCursor *cursor, |
252 | gdouble *x_hot, |
253 | gdouble *y_hot); |
254 | GDK_AVAILABLE_IN_ALL |
255 | GdkCursorType gdk_cursor_get_cursor_type (GdkCursor *cursor); |
256 | |
257 | |
258 | G_END_DECLS |
259 | |
260 | #endif /* __GDK_CURSOR_H__ */ |
261 | |