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, see <http://www.gnu.org/licenses/>.
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/.
27 /* needs to be first because any header might include gdk-pixbuf.h otherwise */
28 #define GDK_PIXBUF_ENABLE_BACKEND
29 #include <gdk-pixbuf/gdk-pixbuf.h>
31 #include "gdkcursor.h"
32 #include "gdkcursorprivate.h"
34 #include "gdkprivate-broadway.h"
35 #include "gdkdisplay-broadway.h"
40 struct _GdkBroadwayCursor
45 struct _GdkBroadwayCursorClass
47 GdkCursorClass cursor_class;
50 /*** GdkBroadwayCursor ***/
52 G_DEFINE_TYPE (GdkBroadwayCursor, gdk_broadway_cursor, GDK_TYPE_CURSOR)
54 static GdkPixbuf* gdk_broadway_cursor_get_image (GdkCursor *cursor);
57 gdk_broadway_cursor_finalize (GObject *object)
59 G_OBJECT_CLASS (gdk_broadway_cursor_parent_class)->finalize (object);
63 gdk_broadway_cursor_class_init (GdkBroadwayCursorClass *xcursor_class)
65 GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (xcursor_class);
66 GObjectClass *object_class = G_OBJECT_CLASS (xcursor_class);
68 object_class->finalize = gdk_broadway_cursor_finalize;
70 cursor_class->get_image = gdk_broadway_cursor_get_image;
74 gdk_broadway_cursor_init (GdkBroadwayCursor *cursor)
78 /* Called by gdk_display_broadway_finalize to flush any cached cursors
82 _gdk_broadway_cursor_display_finalize (GdkDisplay *display)
87 _gdk_broadway_display_get_cursor_for_type (GdkDisplay *display,
88 GdkCursorType cursor_type)
90 GdkBroadwayCursor *private;
92 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
94 private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
95 "cursor-type", cursor_type,
99 return GDK_CURSOR (private);
103 gdk_broadway_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_broadway_display_get_cursor_for_pixbuf (GdkDisplay *display,
122 GdkBroadwayCursor *private;
125 private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
126 "cursor-type", GDK_CURSOR_IS_PIXMAP,
129 cursor = (GdkCursor *) private;
135 _gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
138 GdkBroadwayCursor *private;
140 private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
141 "cursor-type", GDK_CURSOR_IS_PIXMAP,
145 return GDK_CURSOR (private);
149 _gdk_broadway_display_supports_cursor_alpha (GdkDisplay *display)
151 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
157 _gdk_broadway_display_supports_cursor_color (GdkDisplay *display)
159 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
165 _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
169 g_return_if_fail (GDK_IS_DISPLAY (display));
171 *width = *height = 20;
175 _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
179 g_return_if_fail (GDK_IS_DISPLAY (display));