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"
34 #include "gdkcursorprivate.h"
36 #include "gdkprivate-broadway.h"
37 #include "gdkdisplay-broadway.h"
42 struct _GdkBroadwayCursor
47 struct _GdkBroadwayCursorClass
49 GdkCursorClass cursor_class;
52 /*** GdkBroadwayCursor ***/
54 G_DEFINE_TYPE (GdkBroadwayCursor, gdk_broadway_cursor, GDK_TYPE_CURSOR)
56 static GdkPixbuf* gdk_broadway_cursor_get_image (GdkCursor *cursor);
59 gdk_broadway_cursor_finalize (GObject *object)
61 G_OBJECT_CLASS (gdk_broadway_cursor_parent_class)->finalize (object);
65 gdk_broadway_cursor_class_init (GdkBroadwayCursorClass *xcursor_class)
67 GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (xcursor_class);
68 GObjectClass *object_class = G_OBJECT_CLASS (xcursor_class);
70 object_class->finalize = gdk_broadway_cursor_finalize;
72 cursor_class->get_image = gdk_broadway_cursor_get_image;
76 gdk_broadway_cursor_init (GdkBroadwayCursor *cursor)
80 /* Called by gdk_display_broadway_finalize to flush any cached cursors
84 _gdk_broadway_cursor_display_finalize (GdkDisplay *display)
89 _gdk_broadway_display_get_cursor_for_type (GdkDisplay *display,
90 GdkCursorType cursor_type)
92 GdkBroadwayCursor *private;
94 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
96 private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
97 "cursor-type", cursor_type,
101 return GDK_CURSOR (private);
105 gdk_broadway_cursor_get_image (GdkCursor *cursor)
107 g_return_val_if_fail (cursor != NULL, NULL);
113 _gdk_broadway_cursor_update_theme (GdkCursor *cursor)
115 g_return_if_fail (cursor != NULL);
119 _gdk_broadway_display_get_cursor_for_pixbuf (GdkDisplay *display,
124 GdkBroadwayCursor *private;
127 private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
128 "cursor-type", GDK_CURSOR_IS_PIXMAP,
131 cursor = (GdkCursor *) private;
137 _gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
140 GdkBroadwayCursor *private;
142 private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
143 "cursor-type", GDK_CURSOR_IS_PIXMAP,
147 return GDK_CURSOR (private);
151 _gdk_broadway_display_supports_cursor_alpha (GdkDisplay *display)
153 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
159 _gdk_broadway_display_supports_cursor_color (GdkDisplay *display)
161 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
167 _gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
171 g_return_if_fail (GDK_IS_DISPLAY (display));
173 *width = *height = 20;
177 _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
181 g_return_if_fail (GDK_IS_DISPLAY (display));