gdk: Cursors are created generically
authorBenjamin Otte <otte@redhat.com>
Fri, 3 Nov 2017 21:49:04 +0000 (22:49 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 3 Nov 2017 23:07:13 +0000 (00:07 +0100)
There are no longer subclasses for cursors now.

16 files changed:
gdk/broadway/gdkcursor-broadway.c
gdk/broadway/gdkdisplay-broadway.c
gdk/gdkcursor.c
gdk/gdkdisplayprivate.h
gdk/mir/gdkmir-private.h
gdk/mir/gdkmirdisplay.c
gdk/quartz/gdkdisplay-quartz.c
gdk/quartz/gdkdisplay-quartz.h
gdk/wayland/gdkcursor-wayland.c
gdk/wayland/gdkdisplay-wayland.c
gdk/wayland/gdkprivate-wayland.h
gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkprivate-win32.h
gdk/x11/gdkcursor-x11.c
gdk/x11/gdkdisplay-x11.c
gdk/x11/gdkprivate-x11.h

index bc6682b6d323369cccbd61d74c219655504a3661..eb21658309a91a4d90257d90ee3081dc181a3e21 100644 (file)
@@ -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)
 {
index e02e1e306e4ede6e5589db199b333282df455987..b2e12c51069d390c4c7f98c7b9fec661a8e6568a 100644 (file)
@@ -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;
index 7be365c48ddfad36526157b392e1a8ded928e2c9..3d1c2d4e844662d8b29a17a621e4670f2e40274c 100644 (file)
@@ -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);
 }
 
 /**
index 208a7a4dbf18c4033bef95acb25506312bcb5296..ecba645f83db80eff0ee336d883a580f2ac95742 100644 (file)
@@ -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);
 
index 0e5ff514dada45de509e2757e679bc02a8c8466c..ca516e0e72577edcdcea3591f7d0183115509198 100644 (file)
@@ -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);
index 95802c9965ea6151a332e97c277be4a6c4e8263e..3c5410971182e9e9bbb3e5709f7e2b6fcb871fda 100644 (file)
@@ -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;
index 77752accdd59b7a0f188341252efaf06a7a0881b..f85173d3d42852f3c081d65e84632a16a74cc200 100644 (file)
@@ -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;
index d338be5e486c85bc0d82dd0017ea651721ceb014..9efe013d6f9a2e60f2de18e5656570034739077c 100644 (file)
@@ -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,
index 82f25e341aa190eeceacb03acab82c2822cf90bc..17128d89354dc933a8934fac2b3b57c1ef6fd717 100644 (file)
@@ -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,
index 677f03e1e40cb6e3f0794213a33404be5df1496e..b70c7067718cd59e0858f66469b367b71192a1af 100644 (file)
@@ -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;
index af8bb2c07eb4abc8b55578d9439bebcbd706a60e..223b963b4813d307acebf18f284344ac877caaa3 100644 (file)
@@ -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);
index 2d8eb2c95c854404e2e574df6f9dd96bd187a535..5cd08e02a93ff9f88743b5f9ae0fc4deb9871524 100644 (file)
@@ -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;
index ae44ba4f401ab28375d2cc6ba7615734e1dd0ff7..7401bdb60499d78dae45e3f7f293d1ef89403174 100644 (file)
@@ -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);
index a8dae1c391302a742fbe58f411456c6fdaf9c4b5..ec9db4a8a78391f0514d09a1370242a0a0e1cf76 100644 (file)
@@ -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*
index 1ad526b1c9e06ef06a28ef8972432fcc81d1face..e4b9bb837609fd86e648be724d1940e7b1d8db2e 100644 (file)
@@ -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;
index bffa8308d9151a9befe37af2ebe78e8f287d6ce8..eb0e6314d990e1476db538549a6073210b720f90 100644 (file)
@@ -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,