Add private api for setting cursor theme

This is implemented in multiple gdk backends,
and we can avoid and ugly ifdef cascade in gtk
by adding a vfunc for this.
This commit is contained in:
Matthias Clasen 2017-11-17 17:42:12 -05:00
parent 2d591cde78
commit c2f6208ce5
6 changed files with 18 additions and 0 deletions

View File

@ -45,5 +45,8 @@ void gdk_display_set_double_click_time (GdkDisplay *display,
guint msec);
void gdk_display_set_double_click_distance (GdkDisplay *display,
guint distance);
void gdk_display_set_cursor_theme (GdkDisplay *display,
const char *theme,
int size);
#endif /* __GDK__PRIVATE_H__ */

View File

@ -2038,3 +2038,12 @@ gdk_display_set_double_click_distance (GdkDisplay *display,
{
display->double_click_distance = distance;
}
void
gdk_display_set_cursor_theme (GdkDisplay *display,
const char *name,
int size)
{
if (GDK_DISPLAY_GET_CLASS (display)->set_cursor_theme)
GDK_DISPLAY_GET_CLASS (display)->set_cursor_theme (display, name, size);
}

View File

@ -220,6 +220,9 @@ struct _GdkDisplayClass
const char *name,
GValue *value);
guint32 (*get_last_seen_time) (GdkDisplay *display);
void (*set_cursor_theme) (GdkDisplay *display,
const char *name,
int size);
/* Signals */
void (*opened) (GdkDisplay *display);

View File

@ -1041,6 +1041,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
display_class->get_monitor = gdk_wayland_display_get_monitor;
display_class->get_monitor_at_window = gdk_wayland_display_get_monitor_at_window;
display_class->get_setting = gdk_wayland_display_get_setting;
display_class->set_cursor_theme = gdk_wayland_display_set_cursor_theme;
}
static void

View File

@ -1273,6 +1273,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->get_setting = gdk_win32_display_get_setting;
display_class->get_last_seen_time = gdk_win32_display_get_last_seen_time;
display_class->set_cursor_theme = gdk_win32_display_set_cursor_theme;
_gdk_win32_windowing_init ();
}

View File

@ -3222,6 +3222,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
display_class->get_primary_monitor = gdk_x11_display_get_primary_monitor;
display_class->get_setting = gdk_x11_display_get_setting;
display_class->get_last_seen_time = gdk_x11_display_get_last_seen_time;
display_class->set_cursor_theme = gdk_x11_display_set_cursor_theme;
_gdk_x11_windowing_init ();
}