diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-01-16 23:22:41 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-01-16 23:32:01 -0500 |
commit | 77bab4e027c06dff7726d96fa4e477bc11b23835 (patch) | |
tree | 72afdb2b5aee754d40bc736c197fcfcfaea0e986 /gdk | |
parent | ab1f17cb9a18301a5688cdecc35fa147ef2140f5 (diff) | |
download | gtk+-77bab4e027c06dff7726d96fa4e477bc11b23835.tar.gz |
gdk: Drop some unused cursor apis
The query function for cursor sizes and capabilities
are not very interesting. At least, they are not used
in GTK+, and all backends but X11 just hardcode
made-up values anyway. So, lets drop them.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/broadway/gdkcursor-broadway.c | 37 | ||||
-rw-r--r-- | gdk/broadway/gdkdisplay-broadway.c | 4 | ||||
-rw-r--r-- | gdk/gdkdisplay.c | 86 | ||||
-rw-r--r-- | gdk/gdkdisplay.h | 11 | ||||
-rw-r--r-- | gdk/gdkdisplayprivate.h | 9 | ||||
-rw-r--r-- | gdk/wayland/gdkcursor-wayland.c | 30 | ||||
-rw-r--r-- | gdk/wayland/gdkdisplay-wayland.c | 4 | ||||
-rw-r--r-- | gdk/x11/gdkcursor-x11.c | 54 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 4 |
9 files changed, 0 insertions, 239 deletions
diff --git a/gdk/broadway/gdkcursor-broadway.c b/gdk/broadway/gdkcursor-broadway.c index eb21658309..e8df44e9a4 100644 --- a/gdk/broadway/gdkcursor-broadway.c +++ b/gdk/broadway/gdkcursor-broadway.c @@ -47,40 +47,3 @@ _gdk_broadway_cursor_update_theme (GdkCursor *cursor) { g_return_if_fail (cursor != NULL); } - -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; -} diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c index 834d5e2ea4..1f5abd1c27 100644 --- a/gdk/broadway/gdkdisplay-broadway.c +++ b/gdk/broadway/gdkdisplay-broadway.c @@ -531,10 +531,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class) display_class->get_default_group = gdk_broadway_display_get_default_group; display_class->supports_shapes = gdk_broadway_display_supports_shapes; display_class->supports_input_shapes = gdk_broadway_display_supports_input_shapes; - 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; - display_class->supports_cursor_color = _gdk_broadway_display_supports_cursor_color; display_class->get_next_serial = gdk_broadway_display_get_next_serial; display_class->notify_startup_complete = gdk_broadway_display_notify_startup_complete; diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index fd425d6ff7..2e370c783a 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -1301,92 +1301,6 @@ gdk_display_has_pending (GdkDisplay *display) return GDK_DISPLAY_GET_CLASS (display)->has_pending (display); } -/** - * gdk_display_supports_cursor_alpha: - * @display: a #GdkDisplay - * - * Returns %TRUE if cursors can use an 8bit alpha channel - * on @display. Otherwise, cursors are restricted to bilevel - * alpha (i.e. a mask). - * - * Returns: whether cursors can have alpha channels. - * - * Since: 2.4 - */ -gboolean -gdk_display_supports_cursor_alpha (GdkDisplay *display) -{ - g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); - - return GDK_DISPLAY_GET_CLASS (display)->supports_cursor_alpha (display); -} - -/** - * gdk_display_supports_cursor_color: - * @display: a #GdkDisplay - * - * Returns %TRUE if multicolored cursors are supported - * on @display. Otherwise, cursors have only a forground - * and a background color. - * - * Returns: whether cursors can have multiple colors. - * - * Since: 2.4 - */ -gboolean -gdk_display_supports_cursor_color (GdkDisplay *display) -{ - g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); - - return GDK_DISPLAY_GET_CLASS (display)->supports_cursor_color (display); -} - -/** - * gdk_display_get_default_cursor_size: - * @display: a #GdkDisplay - * - * Returns the default size to use for cursors on @display. - * - * Returns: the default cursor size. - * - * Since: 2.4 - */ -guint -gdk_display_get_default_cursor_size (GdkDisplay *display) -{ - guint width, height; - - g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); - - GDK_DISPLAY_GET_CLASS (display)->get_default_cursor_size (display, - &width, - &height); - - return MIN (width, height); -} - -/** - * gdk_display_get_maximal_cursor_size: - * @display: a #GdkDisplay - * @width: (out): the return location for the maximal cursor width - * @height: (out): the return location for the maximal cursor height - * - * Gets the maximal size to use for cursors on @display. - * - * Since: 2.4 - */ -void -gdk_display_get_maximal_cursor_size (GdkDisplay *display, - guint *width, - guint *height) -{ - g_return_if_fail (GDK_IS_DISPLAY (display)); - - GDK_DISPLAY_GET_CLASS (display)->get_maximal_cursor_size (display, - width, - height); -} - gulong _gdk_display_get_next_serial (GdkDisplay *display) { diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index da37ce6c52..76fafc3b4a 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -80,17 +80,6 @@ GDK_AVAILABLE_IN_ALL GdkDisplay *gdk_display_get_default (void); GDK_AVAILABLE_IN_ALL -gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display); -GDK_AVAILABLE_IN_ALL -gboolean gdk_display_supports_cursor_color (GdkDisplay *display); -GDK_AVAILABLE_IN_ALL -guint gdk_display_get_default_cursor_size (GdkDisplay *display); -GDK_AVAILABLE_IN_ALL -void gdk_display_get_maximal_cursor_size (GdkDisplay *display, - guint *width, - guint *height); - -GDK_AVAILABLE_IN_ALL GdkWindow *gdk_display_get_default_group (GdkDisplay *display); GDK_AVAILABLE_IN_3_94 diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index 7eecaac518..ddb1c14f72 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -128,15 +128,6 @@ struct _GdkDisplayClass GdkWindow * (*get_default_group) (GdkDisplay *display); gboolean (*supports_shapes) (GdkDisplay *display); gboolean (*supports_input_shapes) (GdkDisplay *display); - gboolean (*supports_cursor_alpha) (GdkDisplay *display); - gboolean (*supports_cursor_color) (GdkDisplay *display); - - void (*get_default_cursor_size) (GdkDisplay *display, - guint *width, - guint *height); - void (*get_maximal_cursor_size) (GdkDisplay *display, - guint *width, - guint *height); GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display); diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c index cc3b5e38a6..ec6c19ca63 100644 --- a/gdk/wayland/gdkcursor-wayland.c +++ b/gdk/wayland/gdkcursor-wayland.c @@ -304,33 +304,3 @@ _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display, *next_image_delay = 0; return current_image_index; } - -void -_gdk_wayland_display_get_default_cursor_size (GdkDisplay *display, - guint *width, - guint *height) -{ - *width = 32; - *height = 32; -} - -void -_gdk_wayland_display_get_maximal_cursor_size (GdkDisplay *display, - guint *width, - guint *height) -{ - *width = 256; - *height = 256; -} - -gboolean -_gdk_wayland_display_supports_cursor_alpha (GdkDisplay *display) -{ - return TRUE; -} - -gboolean -_gdk_wayland_display_supports_cursor_color (GdkDisplay *display) -{ - return TRUE; -} diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 582d74d5b9..e30c3292e5 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -977,10 +977,6 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) display_class->supports_shapes = gdk_wayland_display_supports_shapes; display_class->supports_input_shapes = gdk_wayland_display_supports_input_shapes; 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->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; display_class->notify_startup_complete = gdk_wayland_display_notify_startup_complete; display_class->create_window_impl = _gdk_wayland_display_create_window_impl; diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index 7faea3f2fa..6fcad7d574 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -226,26 +226,6 @@ gdk_x11_cursor_create_for_name (GdkDisplay *display, return xcursor; } -gboolean -_gdk_x11_display_supports_cursor_alpha (GdkDisplay *display) -{ - return XcursorSupportsARGB (GDK_DISPLAY_XDISPLAY (display)); -} - -gboolean -_gdk_x11_display_supports_cursor_color (GdkDisplay *display) -{ - return XcursorSupportsARGB (GDK_DISPLAY_XDISPLAY (display)); -} - -void -_gdk_x11_display_get_default_cursor_size (GdkDisplay *display, - guint *width, - guint *height) -{ - *width = *height = XcursorGetDefaultSize (GDK_DISPLAY_XDISPLAY (display)); -} - #else static Cursor @@ -276,42 +256,8 @@ gdk_x11_cursor_create_for_name (GdkDisplay *display, return None; } -gboolean -_gdk_x11_display_supports_cursor_alpha (GdkDisplay *display) -{ - return FALSE; -} - -gboolean -_gdk_x11_display_supports_cursor_color (GdkDisplay *display) -{ - return FALSE; -} - -void -_gdk_x11_display_get_default_cursor_size (GdkDisplay *display, - guint *width, - guint *height) -{ - /* no idea, really */ - *width = *height = 20; - return; -} - #endif -void -_gdk_x11_display_get_maximal_cursor_size (GdkDisplay *display, - guint *width, - guint *height) -{ - g_return_if_fail (GDK_IS_DISPLAY (display)); - - XQueryBestCursor (GDK_DISPLAY_XDISPLAY (display), - GDK_SCREEN_XROOTWIN (GDK_X11_DISPLAY (display)->screen), - 128, 128, width, height); -} - /** * gdk_x11_display_set_cursor_theme: * @display: (type GdkX11Display): a #GdkDisplay diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index edf18abe67..fedfada7c1 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -3081,10 +3081,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_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; - display_class->supports_cursor_color = _gdk_x11_display_supports_cursor_color; display_class->get_next_serial = gdk_x11_display_get_next_serial; display_class->notify_startup_complete = gdk_x11_display_notify_startup_complete; |