]> Pileus Git - ~andy/gtk/blob - gdk/broadway/gdkcursor-broadway.c
[broadway] Remove unnecessary backend-specific function
[~andy/gtk] / gdk / broadway / gdkcursor-broadway.c
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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
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/.
25  */
26
27 #include "config.h"
28
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>
32
33 #include "gdkcursor.h"
34
35 #include "gdkprivate-broadway.h"
36 #include "gdkdisplay-broadway.h"
37
38 #include <string.h>
39 #include <errno.h>
40
41
42 /* Called by gdk_display_broadway_finalize to flush any cached cursors
43  * for a dead display.
44  */
45 void
46 _gdk_broadway_cursor_display_finalize (GdkDisplay *display)
47 {
48 }
49
50 GdkCursor*
51 gdk_cursor_new_for_display (GdkDisplay    *display,
52                             GdkCursorType  cursor_type)
53 {
54   GdkCursorPrivate *private;
55   GdkCursor *cursor;
56
57   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
58
59   private = g_new (GdkCursorPrivate, 1);
60   private->display = display;
61
62   cursor = (GdkCursor *) private;
63   cursor->type = cursor_type;
64   cursor->ref_count = 1;
65
66   return cursor;
67 }
68
69 void
70 _gdk_cursor_destroy (GdkCursor *cursor)
71 {
72   GdkCursorPrivate *private;
73
74   g_return_if_fail (cursor != NULL);
75   g_return_if_fail (cursor->ref_count == 0);
76
77   private = (GdkCursorPrivate *) cursor;
78
79   g_free (private);
80 }
81
82
83 /**
84  * gdk_cursor_get_display:
85  * @cursor: a #GdkCursor.
86  *
87  * Returns the display on which the #GdkCursor is defined.
88  *
89  * Returns: the #GdkDisplay associated to @cursor
90  *
91  * Since: 2.2
92  */
93
94 GdkDisplay *
95 gdk_cursor_get_display (GdkCursor *cursor)
96 {
97   g_return_val_if_fail (cursor != NULL, NULL);
98
99   return ((GdkCursorPrivate *)cursor)->display;
100 }
101
102 GdkPixbuf*
103 gdk_cursor_get_image (GdkCursor *cursor)
104 {
105   g_return_val_if_fail (cursor != NULL, NULL);
106
107   return NULL;
108 }
109
110 void
111 _gdk_broadway_cursor_update_theme (GdkCursor *cursor)
112 {
113   g_return_if_fail (cursor != NULL);
114 }
115
116 GdkCursor *
117 gdk_cursor_new_from_pixbuf (GdkDisplay *display,
118                             GdkPixbuf  *pixbuf,
119                             gint        x,
120                             gint        y)
121 {
122   GdkCursorPrivate *private;
123   GdkCursor *cursor;
124
125   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
126   g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
127
128   private = g_new (GdkCursorPrivate, 1);
129   private->display = display;
130
131   cursor = (GdkCursor *) private;
132   cursor->type = GDK_CURSOR_IS_PIXMAP;
133   cursor->ref_count = 1;
134
135   return cursor;
136 }
137
138 GdkCursor*
139 gdk_cursor_new_from_name (GdkDisplay  *display,
140                           const gchar *name)
141 {
142   GdkCursorPrivate *private;
143   GdkCursor *cursor;
144
145   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
146
147   private = g_new (GdkCursorPrivate, 1);
148   private->display = display;
149
150   cursor = (GdkCursor *) private;
151   cursor->type = GDK_CURSOR_IS_PIXMAP;
152   cursor->ref_count = 1;
153
154   return cursor;
155 }
156
157 gboolean
158 gdk_display_supports_cursor_alpha (GdkDisplay *display)
159 {
160   g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
161
162   return TRUE;
163 }
164
165 gboolean
166 gdk_display_supports_cursor_color (GdkDisplay *display)
167 {
168   g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
169
170   return TRUE;
171 }
172
173 guint
174 gdk_display_get_default_cursor_size (GdkDisplay *display)
175 {
176   g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
177
178   return 20;
179 }
180
181 void
182 gdk_display_get_maximal_cursor_size (GdkDisplay *display,
183                                      guint       *width,
184                                      guint       *height)
185 {
186   g_return_if_fail (GDK_IS_DISPLAY (display));
187
188   *width = 128;
189   *height = 128;
190 }