[gtk+: 4/4] gdk: Drop some unused cursor apis
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+: 4/4] gdk: Drop some unused cursor apis
- Date: Wed, 17 Jan 2018 04:33:09 +0000 (UTC)
commit 77bab4e027c06dff7726d96fa4e477bc11b23835
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jan 16 23:22:41 2018 -0500
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.
gdk/broadway/gdkcursor-broadway.c | 37 ---------------
gdk/broadway/gdkdisplay-broadway.c | 4 --
gdk/gdkdisplay.c | 86 ------------------------------------
gdk/gdkdisplay.h | 11 -----
gdk/gdkdisplayprivate.h | 9 ----
gdk/wayland/gdkcursor-wayland.c | 30 ------------
gdk/wayland/gdkdisplay-wayland.c | 4 --
gdk/x11/gdkcursor-x11.c | 54 ----------------------
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 eb21658..e8df44e 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 834d5e2..1f5abd1 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 fd425d6..2e370c7 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 da37ce6..76fafc3 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 7eecaac..ddb1c14 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 cc3b5e3..ec6c19c 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 582d74d..e30c329 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 7faea3f..6fcad7d 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 edf18ab..fedfada 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]