From b1e10f5312394c143bd4d09700c8522863b159ff Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 8 May 2015 09:00:15 -0400 Subject: [PATCH] Wayland: trivial reshuffle Avoid a forward declaration by moving things around. --- gdk/wayland/gdkcursor-wayland.c | 73 +++++++++++++++------------------ 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c index 665c224d17..cdb799c1c6 100644 --- a/gdk/wayland/gdkcursor-wayland.c +++ b/gdk/wayland/gdkcursor-wayland.c @@ -262,45 +262,6 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor) { } -static GdkCursor * -_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display, - const gchar *name, - guint scale); - -GdkCursor * -_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display, - GdkCursorType cursor_type, - guint scale) -{ - GEnumClass *enum_class; - GEnumValue *enum_value; - gchar *cursor_name; - GdkCursor *result; - - enum_class = g_type_class_ref (GDK_TYPE_CURSOR_TYPE); - enum_value = g_enum_get_value (enum_class, cursor_type); - cursor_name = g_strdup (enum_value->value_nick); - g_strdelimit (cursor_name, "-", '_'); - g_type_class_unref (enum_class); - - result = _gdk_wayland_display_get_cursor_for_name_with_scale (display, - cursor_name, - scale); - - g_free (cursor_name); - - return result; -} - -GdkCursor * -_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display, - GdkCursorType cursor_type) -{ - return _gdk_wayland_display_get_cursor_for_type_with_scale (display, - cursor_type, - 1); -} - static GdkCursor * _gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display, const gchar *name, @@ -341,6 +302,40 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display, return _gdk_wayland_display_get_cursor_for_name_with_scale (display, name, 1); } +GdkCursor * +_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display, + GdkCursorType cursor_type, + guint scale) +{ + GEnumClass *enum_class; + GEnumValue *enum_value; + gchar *cursor_name; + GdkCursor *result; + + enum_class = g_type_class_ref (GDK_TYPE_CURSOR_TYPE); + enum_value = g_enum_get_value (enum_class, cursor_type); + cursor_name = g_strdup (enum_value->value_nick); + g_strdelimit (cursor_name, "-", '_'); + g_type_class_unref (enum_class); + + result = _gdk_wayland_display_get_cursor_for_name_with_scale (display, + cursor_name, + scale); + + g_free (cursor_name); + + return result; +} + +GdkCursor * +_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display, + GdkCursorType cursor_type) +{ + return _gdk_wayland_display_get_cursor_for_type_with_scale (display, + cursor_type, + 1); +} + GdkCursor * _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display, cairo_surface_t *surface,