summaryrefslogtreecommitdiff
path: root/gdk/broadway/gdkcursor-broadway.c
blob: 3e947de29b72bf6cc9a8f9978224c9ca094a3226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* GDK - The GIMP Drawing Kit
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
 */

#include "config.h"

/* needs to be first because any header might include gdk-pixbuf.h otherwise */
#define GDK_PIXBUF_ENABLE_BACKEND
#include <gdk-pixbuf/gdk-pixbuf.h>

#include "gdkcursor.h"
#include "gdkcursorprivate.h"

#include "gdkprivate-broadway.h"
#include "gdkdisplay-broadway.h"

#include <string.h>
#include <errno.h>

struct _GdkBroadwayCursor
{
  GdkCursor cursor;
};

struct _GdkBroadwayCursorClass
{
  GdkCursorClass cursor_class;
};

/*** GdkBroadwayCursor ***/

G_DEFINE_TYPE (GdkBroadwayCursor, gdk_broadway_cursor, GDK_TYPE_CURSOR)

static GdkPixbuf* gdk_broadway_cursor_get_image (GdkCursor *cursor);

static void
gdk_broadway_cursor_finalize (GObject *object)
{
  G_OBJECT_CLASS (gdk_broadway_cursor_parent_class)->finalize (object);
}

static void
gdk_broadway_cursor_class_init (GdkBroadwayCursorClass *xcursor_class)
{
  GdkCursorClass *cursor_class = GDK_CURSOR_CLASS (xcursor_class);
  GObjectClass *object_class = G_OBJECT_CLASS (xcursor_class);

  object_class->finalize = gdk_broadway_cursor_finalize;

  cursor_class->get_image = gdk_broadway_cursor_get_image;
}

static void
gdk_broadway_cursor_init (GdkBroadwayCursor *cursor)
{
}

/* Called by gdk_display_broadway_finalize to flush any cached cursors
 * for a dead display.
 */
void
_gdk_broadway_cursor_display_finalize (GdkDisplay *display)
{
}

GdkCursor*
_gdk_broadway_display_get_cursor_for_type (GdkDisplay    *display,
					   GdkCursorType  cursor_type)
{
  GdkBroadwayCursor *private;

  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);

  private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
                          "cursor-type", cursor_type,
                          "display", display,
			  NULL);

  return GDK_CURSOR (private);
}

static GdkPixbuf*
gdk_broadway_cursor_get_image (GdkCursor *cursor)
{
  g_return_val_if_fail (cursor != NULL, NULL);

  return NULL;
}

void
_gdk_broadway_cursor_update_theme (GdkCursor *cursor)
{
  g_return_if_fail (cursor != NULL);
}

GdkCursor *
_gdk_broadway_display_get_cursor_for_pixbuf (GdkDisplay *display,
					     GdkPixbuf  *pixbuf,
					     gint        x,
					     gint        y)
{
  GdkBroadwayCursor *private;
  GdkCursor *cursor;

  private = g_object_new (GDK_TYPE_BROADWAY_CURSOR, 
                          "cursor-type", GDK_CURSOR_IS_PIXMAP,
                          "display", display,
                          NULL);
  cursor = (GdkCursor *) private;

  return cursor;
}

GdkCursor*
_gdk_broadway_display_get_cursor_for_name (GdkDisplay  *display,
					   const gchar *name)
{
  GdkBroadwayCursor *private;

  private = g_object_new (GDK_TYPE_BROADWAY_CURSOR,
                          "cursor-type", GDK_CURSOR_IS_PIXMAP,
                          "display", display,
                          NULL);

  return GDK_CURSOR (private);
}

gboolean
_gdk_broadway_display_supports_cursor_alpha (GdkDisplay *display)
{
  g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);

  return TRUE;
}

gboolean
_gdk_broadway_display_supports_cursor_color (GdkDisplay *display)
{
  g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);

  return TRUE;
}

void
_gdk_broadway_display_get_default_cursor_size (GdkDisplay *display,
					       guint      *width,
					       guint      *height)
{
  g_return_if_fail (GDK_IS_DISPLAY (display));

  *width = *height = 20;
}

void
_gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
					       guint       *width,
					       guint       *height)
{
  g_return_if_fail (GDK_IS_DISPLAY (display));

  *width = 128;
  *height = 128;
}