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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -79,17 +79,6 @@ gboolean gdk_display_has_pending (GdkDisplay *display);
|
||||
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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user