1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
14 * You should have received a copy of the GNU Lesser 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.
21 * Modified by the GTK+ Team and others 1997-2000. 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/.
29 /* needs to be first because any header might include gdk-pixbuf.h otherwise */
30 #define GDK_PIXBUF_ENABLE_BACKEND
31 #include <gdk-pixbuf/gdk-pixbuf.h>
33 #include "gdkcursor.h"
35 #include "gdkprivate-broadway.h"
36 #include "gdkdisplay-broadway.h"
42 /* Called by gdk_display_broadway_finalize to flush any cached cursors
46 _gdk_broadway_cursor_display_finalize (GdkDisplay *display)
51 gdk_cursor_new_for_display (GdkDisplay *display,
52 GdkCursorType cursor_type)
54 GdkCursorPrivate *private;
57 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
59 private = g_new (GdkCursorPrivate, 1);
60 private->display = display;
62 cursor = (GdkCursor *) private;
63 cursor->type = cursor_type;
64 cursor->ref_count = 1;
70 _gdk_cursor_destroy (GdkCursor *cursor)
72 GdkCursorPrivate *private;
74 g_return_if_fail (cursor != NULL);
75 g_return_if_fail (cursor->ref_count == 0);
77 private = (GdkCursorPrivate *) cursor;
84 * gdk_cursor_get_display:
85 * @cursor: a #GdkCursor.
87 * Returns the display on which the #GdkCursor is defined.
89 * Returns: the #GdkDisplay associated to @cursor
95 gdk_cursor_get_display (GdkCursor *cursor)
97 g_return_val_if_fail (cursor != NULL, NULL);
99 return ((GdkCursorPrivate *)cursor)->display;
103 gdk_cursor_get_image (GdkCursor *cursor)
105 g_return_val_if_fail (cursor != NULL, NULL);
111 gdk_broadway_display_set_cursor_theme (GdkDisplay *display,
115 g_return_if_fail (GDK_IS_DISPLAY (display));
119 _gdk_broadway_cursor_update_theme (GdkCursor *cursor)
121 g_return_if_fail (cursor != NULL);
125 gdk_cursor_new_from_pixbuf (GdkDisplay *display,
130 GdkCursorPrivate *private;
133 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
134 g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
136 private = g_new (GdkCursorPrivate, 1);
137 private->display = display;
139 cursor = (GdkCursor *) private;
140 cursor->type = GDK_CURSOR_IS_PIXMAP;
141 cursor->ref_count = 1;
147 gdk_cursor_new_from_name (GdkDisplay *display,
150 GdkCursorPrivate *private;
153 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
155 private = g_new (GdkCursorPrivate, 1);
156 private->display = display;
158 cursor = (GdkCursor *) private;
159 cursor->type = GDK_CURSOR_IS_PIXMAP;
160 cursor->ref_count = 1;
166 gdk_display_supports_cursor_alpha (GdkDisplay *display)
168 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
174 gdk_display_supports_cursor_color (GdkDisplay *display)
176 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
182 gdk_display_get_default_cursor_size (GdkDisplay *display)
184 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
190 gdk_display_get_maximal_cursor_size (GdkDisplay *display,
194 g_return_if_fail (GDK_IS_DISPLAY (display));