summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-11-29 20:16:43 -0500
committerMatthias Clasen <mclasen@redhat.com>2017-11-29 20:16:43 -0500
commitc750c0e57161cf54cbba8883a7a84aa5c770ed47 (patch)
tree7068a6525f6b22207b4d9403f7fcc19d8d0b9597
parent7217689e0280109340ed3a94b870cd1cdc412d8a (diff)
downloadgtk+-c750c0e57161cf54cbba8883a7a84aa5c770ed47.tar.gz
Drop gdk_cursor_new_from_pixbuf
Part of the push to remove GdkPixbuf from the API.
-rw-r--r--docs/reference/gdk/gdk4-sections.txt5
-rw-r--r--gdk/gdkcursor.c77
-rw-r--r--gdk/gdkcursor.h8
3 files changed, 3 insertions, 87 deletions
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index b199ea93c7..9097af5db1 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -811,15 +811,14 @@ GDK_IS_TEXTURE
<TITLE>Cursors</TITLE>
<FILE>cursors</FILE>
GdkCursor
-gdk_cursor_new_from_pixbuf
-gdk_cursor_new_from_surface
+gdk_cursor_new_from_texture
gdk_cursor_new_from_name
gdk_cursor_get_display
gdk_cursor_get_fallback
gdk_cursor_get_name
+gdk_cursor_get_texture
gdk_cursor_get_hotspot_x
gdk_cursor_get_hotspot_y
-gdk_cursor_get_texture
<SUBSECTION Standard>
GDK_TYPE_CURSOR
diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c
index 75c8661f70..d5e03d7c65 100644
--- a/gdk/gdkcursor.c
+++ b/gdk/gdkcursor.c
@@ -337,83 +337,6 @@ gdk_cursor_new_from_name (const gchar *name,
}
/**
- * gdk_cursor_new_from_pixbuf:
- * @pixbuf: the #GdkPixbuf containing the cursor image
- * @x: the horizontal offset of the “hotspot” of the cursor.
- * @y: the vertical offset of the “hotspot” of the cursor.
- * @fallback: (allow-none): %NULL or the #GdkCursor to fall back to when
- * this one cannot be supported
- *
- * Creates a new cursor from a pixbuf.
- *
- * Not all GDK backends support RGBA cursors. If they are not
- * supported, a monochrome approximation will be displayed.
- * The functions gdk_display_supports_cursor_alpha() and
- * gdk_display_supports_cursor_color() can be used to determine
- * whether RGBA cursors are supported;
- * gdk_display_get_default_cursor_size() and
- * gdk_display_get_maximal_cursor_size() give information about
- * cursor sizes.
- *
- * If @x or @y are `-1`, the pixbuf must have
- * options named “x_hot” and “y_hot”, resp., containing
- * integer values between `0` and the width resp. height of
- * the pixbuf. (Since: 3.0)
- *
- * On the X backend, support for RGBA cursors requires a
- * sufficently new version of the X Render extension.
- *
- * Returns: a new #GdkCursor.
- *
- * Since: 2.4
- */
-GdkCursor *
-gdk_cursor_new_from_pixbuf (GdkPixbuf *pixbuf,
- gint x,
- gint y,
- GdkCursor *fallback)
-{
- GdkTexture *texture;
- const char *option;
- char *end;
- gint64 value;
- GdkCursor *cursor;
-
- g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
- g_return_val_if_fail (fallback == NULL || GDK_IS_CURSOR (fallback), NULL);
-
- if (x == -1 && (option = gdk_pixbuf_get_option (pixbuf, "x_hot")))
- {
- errno = 0;
- end = NULL;
- value = g_ascii_strtoll (option, &end, 10);
- if (errno == 0 &&
- end != option &&
- value >= 0 && value < G_MAXINT)
- x = (gint) value;
- }
-
- if (y == -1 && (option = gdk_pixbuf_get_option (pixbuf, "y_hot")))
- {
- errno = 0;
- end = NULL;
- value = g_ascii_strtoll (option, &end, 10);
- if (errno == 0 &&
- end != option &&
- value >= 0 && value < G_MAXINT)
- y = (gint) value;
- }
-
- texture = gdk_texture_new_for_pixbuf (pixbuf);
-
- cursor = gdk_cursor_new_from_texture (texture, x, y, fallback);
-
- g_object_unref (texture);
-
- return cursor;
-}
-
-/**
* gdk_cursor_new_from_texture:
* @texture: the texture providing the pixel data
* @hotspot_x: the horizontal offset of the “hotspot” of the cursor
diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h
index 21210a0c3c..6f8c7590b1 100644
--- a/gdk/gdkcursor.h
+++ b/gdk/gdkcursor.h
@@ -31,7 +31,6 @@
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
G_BEGIN_DECLS
@@ -45,11 +44,6 @@ G_BEGIN_DECLS
GDK_AVAILABLE_IN_ALL
GType gdk_cursor_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
-GdkCursor* gdk_cursor_new_from_pixbuf (GdkPixbuf *pixbuf,
- gint x,
- gint y,
- GdkCursor *fallback);
GDK_AVAILABLE_IN_3_94
GdkCursor* gdk_cursor_new_from_texture (GdkTexture *texture,
int hotspot_x,
@@ -58,7 +52,7 @@ GdkCursor* gdk_cursor_new_from_texture (GdkTexture *texture,
GDK_AVAILABLE_IN_ALL
GdkCursor* gdk_cursor_new_from_name (const gchar *name,
GdkCursor *fallback);
-
+
GDK_AVAILABLE_IN_3_94
GdkCursor * gdk_cursor_get_fallback (GdkCursor *cursor);
GDK_AVAILABLE_IN_3_94