[gtk+] gdk: Cursors are created generically
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk: Cursors are created generically
- Date: Fri, 3 Nov 2017 23:26:35 +0000 (UTC)
commit 4e7a0567772a96ef8adea7d5cebef693b38d7824
Author: Benjamin Otte <otte redhat com>
Date: Fri Nov 3 22:49:04 2017 +0100
gdk: Cursors are created generically
There are no longer subclasses for cursors now.
gdk/broadway/gdkcursor-broadway.c | 24 ------------------------
gdk/broadway/gdkdisplay-broadway.c | 2 --
gdk/gdkcursor.c | 14 ++++++++++----
gdk/gdkdisplayprivate.h | 6 ------
gdk/mir/gdkmir-private.h | 4 ----
gdk/mir/gdkmirdisplay.c | 26 --------------------------
gdk/quartz/gdkdisplay-quartz.c | 2 --
gdk/quartz/gdkdisplay-quartz.h | 8 --------
gdk/wayland/gdkcursor-wayland.c | 24 ------------------------
gdk/wayland/gdkdisplay-wayland.c | 2 --
gdk/wayland/gdkprivate-wayland.h | 9 ---------
gdk/win32/gdkdisplay-win32.c | 2 --
gdk/win32/gdkprivate-win32.h | 8 --------
gdk/x11/gdkcursor-x11.c | 24 ------------------------
gdk/x11/gdkdisplay-x11.c | 2 --
gdk/x11/gdkprivate-x11.h | 6 ------
16 files changed, 10 insertions(+), 153 deletions(-)
---
diff --git a/gdk/broadway/gdkcursor-broadway.c b/gdk/broadway/gdkcursor-broadway.c
index bc6682b..eb21658 100644
--- a/gdk/broadway/gdkcursor-broadway.c
+++ b/gdk/broadway/gdkcursor-broadway.c
@@ -48,30 +48,6 @@ _gdk_broadway_cursor_update_theme (GdkCursor *cursor)
g_return_if_fail (cursor != NULL);
}
-GdkCursor *
-_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
- GdkTexture *texture,
- int x,
- int y)
-{
- return g_object_new (GDK_TYPE_CURSOR,
- "display", display,
- "texture", texture,
- "x", x,
- "y", y,
- NULL);
-}
-
-GdkCursor*
-_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name)
-{
- return g_object_new (GDK_TYPE_CURSOR,
- "display", display,
- "name", name,
- NULL);
-}
-
gboolean
_gdk_broadway_display_supports_cursor_alpha (GdkDisplay *display)
{
diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c
index e02e1e3..b2e12c5 100644
--- a/gdk/broadway/gdkdisplay-broadway.c
+++ b/gdk/broadway/gdkdisplay-broadway.c
@@ -358,8 +358,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
display_class->store_clipboard = gdk_broadway_display_store_clipboard;
display_class->supports_shapes = gdk_broadway_display_supports_shapes;
display_class->supports_input_shapes = gdk_broadway_display_supports_input_shapes;
- display_class->get_cursor_for_name = _gdk_broadway_display_get_cursor_for_name;
- display_class->get_cursor_for_texture = _gdk_broadway_display_get_cursor_for_texture;
display_class->get_default_cursor_size = _gdk_broadway_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = _gdk_broadway_display_get_maximal_cursor_size;
display_class->supports_cursor_alpha = _gdk_broadway_display_supports_cursor_alpha;
diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c
index 7be365c..3d1c2d4 100644
--- a/gdk/gdkcursor.c
+++ b/gdk/gdkcursor.c
@@ -340,7 +340,10 @@ gdk_cursor_new_from_name (GdkDisplay *display,
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
g_return_val_if_fail (name != NULL, NULL);
- return GDK_DISPLAY_GET_CLASS (display)->get_cursor_for_name (display, name);
+ return g_object_new (GDK_TYPE_CURSOR,
+ "display", display,
+ "name", name,
+ NULL);
}
/**
@@ -455,9 +458,12 @@ gdk_cursor_new_from_texture (GdkDisplay *display,
g_return_val_if_fail (0 <= hotspot_x && hotspot_x < gdk_texture_get_width (texture), NULL);
g_return_val_if_fail (0 <= hotspot_y && hotspot_y < gdk_texture_get_height (texture), NULL);
- return GDK_DISPLAY_GET_CLASS (display)->get_cursor_for_texture (display,
- texture,
- hotspot_x, hotspot_y);
+ return g_object_new (GDK_TYPE_CURSOR,
+ "display", display,
+ "texture", texture,
+ "hotspot-x", hotspot_x,
+ "hotspot-y", hotspot_y,
+ NULL);
}
/**
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 208a7a4..ecba645 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -145,12 +145,6 @@ struct _GdkDisplayClass
void (*get_maximal_cursor_size) (GdkDisplay *display,
guint *width,
guint *height);
- GdkCursor * (*get_cursor_for_name) (GdkDisplay *display,
- const gchar *name);
- GdkCursor * (*get_cursor_for_texture) (GdkDisplay *display,
- GdkTexture *texture,
- int x,
- int y);
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
diff --git a/gdk/mir/gdkmir-private.h b/gdk/mir/gdkmir-private.h
index 0e5ff51..ca516e0 100644
--- a/gdk/mir/gdkmir-private.h
+++ b/gdk/mir/gdkmir-private.h
@@ -77,10 +77,6 @@ GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *
void _gdk_mir_pointer_set_location (GdkDevice *pointer, gdouble x, gdouble y, GdkWindow *window,
GdkModifierType mask);
-GdkCursor *_gdk_mir_cursor_new_for_type (GdkDisplay *display, GdkCursorType type);
-
-GdkCursor *_gdk_mir_cursor_new_for_name (GdkDisplay *display, const gchar *name);
-
const gchar *_gdk_mir_cursor_get_name (GdkCursor *cursor);
MirWindow *_gdk_mir_window_get_mir_window (GdkWindow *window);
diff --git a/gdk/mir/gdkmirdisplay.c b/gdk/mir/gdkmirdisplay.c
index 95802c9..3c54109 100644
--- a/gdk/mir/gdkmirdisplay.c
+++ b/gdk/mir/gdkmirdisplay.c
@@ -429,29 +429,6 @@ gdk_mir_display_get_maximal_cursor_size (GdkDisplay *display,
*width = *height = 32; // FIXME: Random value
}
-static GdkCursor *
-gdk_mir_display_get_cursor_for_type (GdkDisplay *display,
- GdkCursorType cursor_type)
-{
- return _gdk_mir_cursor_new_for_type (display, cursor_type);
-}
-
-static GdkCursor *
-gdk_mir_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name)
-{
- return _gdk_mir_cursor_new_for_name (display, name);
-}
-
-static GdkCursor *
-gdk_mir_display_get_cursor_for_surface (GdkDisplay *display,
- cairo_surface_t *surface,
- gdouble x,
- gdouble y)
-{
- return NULL;
-}
-
static GdkAppLaunchContext *
gdk_mir_display_get_app_launch_context (GdkDisplay *display)
{
@@ -1222,9 +1199,6 @@ gdk_mir_display_class_init (GdkMirDisplayClass *klass)
display_class->store_clipboard = gdk_mir_display_store_clipboard;
display_class->get_default_cursor_size = gdk_mir_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = gdk_mir_display_get_maximal_cursor_size;
- display_class->get_cursor_for_type = gdk_mir_display_get_cursor_for_type;
- display_class->get_cursor_for_name = gdk_mir_display_get_cursor_for_name;
- display_class->get_cursor_for_surface = gdk_mir_display_get_cursor_for_surface;
display_class->get_app_launch_context = gdk_mir_display_get_app_launch_context;
display_class->get_next_serial = gdk_mir_display_get_next_serial;
display_class->notify_startup_complete = gdk_mir_display_notify_startup_complete;
diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c
index 77752ac..f85173d 100644
--- a/gdk/quartz/gdkdisplay-quartz.c
+++ b/gdk/quartz/gdkdisplay-quartz.c
@@ -272,8 +272,6 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
display_class->store_clipboard = gdk_quartz_display_store_clipboard;
display_class->supports_shapes = gdk_quartz_display_supports_shapes;
display_class->supports_input_shapes = gdk_quartz_display_supports_input_shapes;
- display_class->get_cursor_for_name = _gdk_quartz_display_get_cursor_for_name;
- display_class->get_cursor_for_surface = _gdk_quartz_display_get_cursor_for_surface;
display_class->get_default_cursor_size = _gdk_quartz_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = _gdk_quartz_display_get_maximal_cursor_size;
display_class->supports_cursor_alpha = _gdk_quartz_display_supports_cursor_alpha;
diff --git a/gdk/quartz/gdkdisplay-quartz.h b/gdk/quartz/gdkdisplay-quartz.h
index d338be5..9efe013 100644
--- a/gdk/quartz/gdkdisplay-quartz.h
+++ b/gdk/quartz/gdkdisplay-quartz.h
@@ -51,14 +51,6 @@ void _gdk_quartz_display_event_data_free (GdkDisplay *display,
GdkEvent *event);
/* Display methods - cursor */
-GdkCursor *_gdk_quartz_display_get_cursor_for_type (GdkDisplay *display,
- GdkCursorType type);
-GdkCursor *_gdk_quartz_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name);
-GdkCursor *_gdk_quartz_display_get_cursor_for_surface (GdkDisplay *display,
- cairo_surface_t *surface,
- gdouble x,
- gdouble y);
gboolean _gdk_quartz_display_supports_cursor_alpha (GdkDisplay *display);
gboolean _gdk_quartz_display_supports_cursor_color (GdkDisplay *display);
void _gdk_quartz_display_get_default_cursor_size (GdkDisplay *display,
diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c
index 82f25e3..17128d8 100644
--- a/gdk/wayland/gdkcursor-wayland.c
+++ b/gdk/wayland/gdkcursor-wayland.c
@@ -306,30 +306,6 @@ _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
return current_image_index;
}
-GdkCursor *
-_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name)
-{
- return g_object_new (GDK_TYPE_CURSOR,
- "display", display,
- "name", name,
- NULL);
-}
-
-GdkCursor *
-_gdk_wayland_display_get_cursor_for_texture (GdkDisplay *display,
- GdkTexture *texture,
- int x,
- int y)
-{
- return g_object_new (GDK_TYPE_CURSOR,
- "display", display,
- "texture", texture,
- "x", x,
- "y", y,
- NULL);
-}
-
void
_gdk_wayland_display_get_default_cursor_size (GdkDisplay *display,
guint *width,
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 677f03e..b70c706 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -1036,8 +1036,6 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
display_class->get_app_launch_context = _gdk_wayland_display_get_app_launch_context;
display_class->get_default_cursor_size = _gdk_wayland_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = _gdk_wayland_display_get_maximal_cursor_size;
- display_class->get_cursor_for_name = _gdk_wayland_display_get_cursor_for_name;
- display_class->get_cursor_for_texture = _gdk_wayland_display_get_cursor_for_texture;
display_class->supports_cursor_alpha = _gdk_wayland_display_supports_cursor_alpha;
display_class->supports_cursor_color = _gdk_wayland_display_supports_cursor_color;
display_class->get_next_serial = gdk_wayland_display_get_next_serial;
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index af8bb2c..223b963 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -62,15 +62,6 @@ void _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display);
struct wl_cursor_theme * _gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *display_wayland,
guint scale);
-GdkCursor *_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
- const char *name,
- guint scale);
-GdkCursor *_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name);
-GdkCursor *_gdk_wayland_display_get_cursor_for_texture (GdkDisplay *display,
- GdkTexture *texture,
- int x,
- int y);
void _gdk_wayland_display_get_default_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 2d8eb2c..5cd08e0 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -1258,8 +1258,6 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->supports_input_shapes = gdk_win32_display_supports_input_shapes;
//? display_class->get_app_launch_context = _gdk_win32_display_get_app_launch_context;
- display_class->get_cursor_for_name = _gdk_win32_display_get_cursor_for_name;
- display_class->get_cursor_for_surface = _gdk_win32_display_get_cursor_for_surface;
display_class->get_default_cursor_size = _gdk_win32_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = _gdk_win32_display_get_maximal_cursor_size;
display_class->supports_cursor_alpha = _gdk_win32_display_supports_cursor_alpha;
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index ae44ba4..7401bdb 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -404,14 +404,6 @@ void win32_cursor_theme_destroy (Win32CursorTheme *theme);
Win32CursorTheme *_gdk_win32_display_get_cursor_theme (GdkWin32Display *win32_display);
/* GdkDisplay member functions */
-GdkCursor *_gdk_win32_display_get_cursor_for_type (GdkDisplay *display,
- GdkCursorType cursor_type);
-GdkCursor *_gdk_win32_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name);
-GdkCursor *_gdk_win32_display_get_cursor_for_surface (GdkDisplay *display,
- cairo_surface_t *surface,
- gdouble x,
- gdouble y);
void _gdk_win32_display_get_default_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index a8dae1c..ec9db4a 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -143,30 +143,6 @@ static const struct {
{ NULL, NULL, XC_X_cursor }
};
-GdkCursor*
-_gdk_x11_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name)
-{
- return g_object_new (GDK_TYPE_CURSOR,
- "display", display,
- "name", name,
- NULL);
-}
-
-GdkCursor *
-_gdk_x11_display_get_cursor_for_texture (GdkDisplay *display,
- GdkTexture *texture,
- int x,
- int y)
-{
- return g_object_new (GDK_TYPE_CURSOR,
- "display", display,
- "texture", texture,
- "x", x,
- "y", y,
- NULL);
-}
-
#ifdef HAVE_XCURSOR
static XcursorImage*
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 1ad526b..e4b9bb8 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -3190,8 +3190,6 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
display_class->supports_shapes = gdk_x11_display_supports_shapes;
display_class->supports_input_shapes = gdk_x11_display_supports_input_shapes;
display_class->get_app_launch_context = _gdk_x11_display_get_app_launch_context;
- display_class->get_cursor_for_name = _gdk_x11_display_get_cursor_for_name;
- display_class->get_cursor_for_texture = _gdk_x11_display_get_cursor_for_texture;
display_class->get_default_cursor_size = _gdk_x11_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = _gdk_x11_display_get_maximal_cursor_size;
display_class->supports_cursor_alpha = _gdk_x11_display_supports_cursor_alpha;
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index bffa830..eb0e631 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -230,12 +230,6 @@ GdkAtom _gdk_x11_display_manager_atom_intern (GdkDisplayManager *manager,
gchar * _gdk_x11_display_manager_get_atom_name (GdkDisplayManager *manager,
GdkAtom atom);
-GdkCursor *_gdk_x11_display_get_cursor_for_name (GdkDisplay *display,
- const gchar *name);
-GdkCursor *_gdk_x11_display_get_cursor_for_texture (GdkDisplay *display,
- GdkTexture *texture,
- int x,
- int y);
gboolean _gdk_x11_display_supports_cursor_alpha (GdkDisplay *display);
gboolean _gdk_x11_display_supports_cursor_color (GdkDisplay *display);
void _gdk_x11_display_get_default_cursor_size (GdkDisplay *display,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]