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: ![](X_cursor.png) |
46 | * @GDK_ARROW: ![](arrow.png) |
47 | * @GDK_BASED_ARROW_DOWN: ![](based_arrow_down.png) |
48 | * @GDK_BASED_ARROW_UP: ![](based_arrow_up.png) |
49 | * @GDK_BOAT: ![](boat.png) |
50 | * @GDK_BOGOSITY: ![](bogosity.png) |
51 | * @GDK_BOTTOM_LEFT_CORNER: ![](bottom_left_corner.png) |
52 | * @GDK_BOTTOM_RIGHT_CORNER: ![](bottom_right_corner.png) |
53 | * @GDK_BOTTOM_SIDE: ![](bottom_side.png) |
54 | * @GDK_BOTTOM_TEE: ![](bottom_tee.png) |
55 | * @GDK_BOX_SPIRAL: ![](box_spiral.png) |
56 | * @GDK_CENTER_PTR: ![](center_ptr.png) |
57 | * @GDK_CIRCLE: ![](circle.png) |
58 | * @GDK_CLOCK: ![](clock.png) |
59 | * @GDK_COFFEE_MUG: ![](coffee_mug.png) |
60 | * @GDK_CROSS: ![](cross.png) |
61 | * @GDK_CROSS_REVERSE: ![](cross_reverse.png) |
62 | * @GDK_CROSSHAIR: ![](crosshair.png) |
63 | * @GDK_DIAMOND_CROSS: ![](diamond_cross.png) |
64 | * @GDK_DOT: ![](dot.png) |
65 | * @GDK_DOTBOX: ![](dotbox.png) |
66 | * @GDK_DOUBLE_ARROW: ![](double_arrow.png) |
67 | * @GDK_DRAFT_LARGE: ![](draft_large.png) |
68 | * @GDK_DRAFT_SMALL: ![](draft_small.png) |
69 | * @GDK_DRAPED_BOX: ![](draped_box.png) |
70 | * @GDK_EXCHANGE: ![](exchange.png) |
71 | * @GDK_FLEUR: ![](fleur.png) |
72 | * @GDK_GOBBLER: ![](gobbler.png) |
73 | * @GDK_GUMBY: ![](gumby.png) |
74 | * @GDK_HAND1: ![](hand1.png) |
75 | * @GDK_HAND2: ![](hand2.png) |
76 | * @GDK_HEART: ![](heart.png) |
77 | * @GDK_ICON: ![](icon.png) |
78 | * @GDK_IRON_CROSS: ![](iron_cross.png) |
79 | * @GDK_LEFT_PTR: ![](left_ptr.png) |
80 | * @GDK_LEFT_SIDE: ![](left_side.png) |
81 | * @GDK_LEFT_TEE: ![](left_tee.png) |
82 | * @GDK_LEFTBUTTON: ![](leftbutton.png) |
83 | * @GDK_LL_ANGLE: ![](ll_angle.png) |
84 | * @GDK_LR_ANGLE: ![](lr_angle.png) |
85 | * @GDK_MAN: ![](man.png) |
86 | * @GDK_MIDDLEBUTTON: ![](middlebutton.png) |
87 | * @GDK_MOUSE: ![](mouse.png) |
88 | * @GDK_PENCIL: ![](pencil.png) |
89 | * @GDK_PIRATE: ![](pirate.png) |
90 | * @GDK_PLUS: ![](plus.png) |
91 | * @GDK_QUESTION_ARROW: ![](question_arrow.png) |
92 | * @GDK_RIGHT_PTR: ![](right_ptr.png) |
93 | * @GDK_RIGHT_SIDE: ![](right_side.png) |
94 | * @GDK_RIGHT_TEE: ![](right_tee.png) |
95 | * @GDK_RIGHTBUTTON: ![](rightbutton.png) |
96 | * @GDK_RTL_LOGO: ![](rtl_logo.png) |
97 | * @GDK_SAILBOAT: ![](sailboat.png) |
98 | * @GDK_SB_DOWN_ARROW: ![](sb_down_arrow.png) |
99 | * @GDK_SB_H_DOUBLE_ARROW: ![](sb_h_double_arrow.png) |
100 | * @GDK_SB_LEFT_ARROW: ![](sb_left_arrow.png) |
101 | * @GDK_SB_RIGHT_ARROW: ![](sb_right_arrow.png) |
102 | * @GDK_SB_UP_ARROW: ![](sb_up_arrow.png) |
103 | * @GDK_SB_V_DOUBLE_ARROW: ![](sb_v_double_arrow.png) |
104 | * @GDK_SHUTTLE: ![](shuttle.png) |
105 | * @GDK_SIZING: ![](sizing.png) |
106 | * @GDK_SPIDER: ![](spider.png) |
107 | * @GDK_SPRAYCAN: ![](spraycan.png) |
108 | * @GDK_STAR: ![](star.png) |
109 | * @GDK_TARGET: ![](target.png) |
110 | * @GDK_TCROSS: ![](tcross.png) |
111 | * @GDK_TOP_LEFT_ARROW: ![](top_left_arrow.png) |
112 | * @GDK_TOP_LEFT_CORNER: ![](top_left_corner.png) |
113 | * @GDK_TOP_RIGHT_CORNER: ![](top_right_corner.png) |
114 | * @GDK_TOP_SIDE: ![](top_side.png) |
115 | * @GDK_TOP_TEE: ![](top_tee.png) |
116 | * @GDK_TREK: ![](trek.png) |
117 | * @GDK_UL_ANGLE: ![](ul_angle.png) |
118 | * @GDK_UMBRELLA: ![](umbrella.png) |
119 | * @GDK_UR_ANGLE: ![](ur_angle.png) |
120 | * @GDK_WATCH: ![](watch.png) |
121 | * @GDK_XTERM: ![](xterm.png) |
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 | |