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_cursor_update_theme (GdkCursor *cursor)
113 g_return_if_fail (cursor != NULL);
117 gdk_cursor_new_from_pixbuf (GdkDisplay *display,
122 GdkCursorPrivate *private;
125 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
126 g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
128 private = g_new (GdkCursorPrivate, 1);
129 private->display = display;
131 cursor = (GdkCursor *) private;
132 cursor->type = GDK_CURSOR_IS_PIXMAP;
133 cursor->ref_count = 1;
139 gdk_cursor_new_from_name (GdkDisplay *display,
142 GdkCursorPrivate *private;
145 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
147 private = g_new (GdkCursorPrivate, 1);
148 private->display = display;
150 cursor = (GdkCursor *) private;
151 cursor->type = GDK_CURSOR_IS_PIXMAP;
152 cursor->ref_count = 1;
158 gdk_display_supports_cursor_alpha (GdkDisplay *display)
160 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
166 gdk_display_supports_cursor_color (GdkDisplay *display)
168 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
174 gdk_display_get_default_cursor_size (GdkDisplay *display)
176 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
182 gdk_display_get_maximal_cursor_size (GdkDisplay *display,
186 g_return_if_fail (GDK_IS_DISPLAY (display));