From 4793bd3399d47a43993a384846d60fbc47dac50e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 20 Dec 2010 13:47:35 +0100 Subject: [PATCH] gdk: Move gdk_cursor_get_display() out of the backends Now that we store the display inside the cursor, that change is obvious. --- gdk/gdkcursor.c | 20 ++++++++++++++++++++ gdk/quartz/gdkcursor-quartz.c | 8 -------- gdk/win32/gdkcursor-win32.c | 6 ------ gdk/x11/gdkcursor-x11.c | 19 ------------------- 4 files changed, 20 insertions(+), 33 deletions(-) diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index 2369478225..f6d229c36b 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -354,3 +354,23 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display, return GDK_DISPLAY_GET_CLASS (display)->get_cursor_for_pixbuf (display, pixbuf, x, y); } + +/** + * gdk_cursor_get_display: + * @cursor: a #GdkCursor. + * + * Returns the display on which the #GdkCursor is defined. + * + * Returns: (transfer none): the #GdkDisplay associated to @cursor + * + * Since: 2.2 + */ + +GdkDisplay * +gdk_cursor_get_display (GdkCursor *cursor) +{ + g_return_val_if_fail (GDK_IS_CURSOR (cursor), NULL); + + return cursor->display; +} + diff --git a/gdk/quartz/gdkcursor-quartz.c b/gdk/quartz/gdkcursor-quartz.c index 96dc7704e0..0e22fb7d24 100644 --- a/gdk/quartz/gdkcursor-quartz.c +++ b/gdk/quartz/gdkcursor-quartz.c @@ -391,14 +391,6 @@ gdk_display_get_maximal_cursor_size (GdkDisplay *display, *height = 65536; } -GdkDisplay * -gdk_cursor_get_display (GdkCursor *cursor) -{ - g_return_val_if_fail (cursor != NULL, NULL); - - return gdk_display_get_default (); -} - GdkPixbuf * gdk_cursor_get_image (GdkCursor *cursor) { diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c index 3053b917c0..631c1d26f8 100644 --- a/gdk/win32/gdkcursor-win32.c +++ b/gdk/win32/gdkcursor-win32.c @@ -249,12 +249,6 @@ _gdk_cursor_destroy (GdkCursor *cursor) g_free (private); } -GdkDisplay * -gdk_cursor_get_display (GdkCursor *cursor) -{ - return gdk_display_get_default (); -} - GdkPixbuf * gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon) { diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index ac579ab8a9..bc94fbedf1 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -321,25 +321,6 @@ gdk_x11_cursor_get_xcursor (GdkCursor *cursor) return ((GdkX11Cursor *)cursor)->xcursor; } -/** - * gdk_cursor_get_display: - * @cursor: a #GdkCursor. - * - * Returns the display on which the #GdkCursor is defined. - * - * Returns: (transfer none): the #GdkDisplay associated to @cursor - * - * Since: 2.2 - */ - -GdkDisplay * -gdk_cursor_get_display (GdkCursor *cursor) -{ - g_return_val_if_fail (cursor != NULL, NULL); - - return ((GdkX11Cursor *)cursor)->display; -} - #if defined(HAVE_XCURSOR) && defined(HAVE_XFIXES) && XFIXES_MAJOR >= 2 /**