dnd: Make dnd icon API take a paintable
authorBenjamin Otte <otte@redhat.com>
Sun, 18 Feb 2018 04:27:59 +0000 (05:27 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 16 Mar 2018 05:04:44 +0000 (06:04 +0100)
... instead of a texture.

demos/gtk-demo/clipboard.c
docs/reference/gtk/gtk4-sections.txt
gtk/gtkdnd.c
gtk/gtkdnd.h

index 4615cdc0c6d82ab034e57508445e68266a4b1848..5196b316fe63b90d0dd299d969360d74c9638080 100644 (file)
@@ -127,7 +127,10 @@ drag_begin (GtkWidget      *widget,
 
   texture = get_image_texture (GTK_IMAGE (widget));
   if (texture)
-    gtk_drag_set_icon_texture (context, texture, -2, -2);
+    {
+      gtk_drag_set_icon_paintable (context, GDK_PAINTABLE (texture), -2, -2);
+      g_object_unref (texture);
+    }
 }
 
 void
index 64f11cb4c34c89ef2b3da749596df866536dd6a6..f1a23656d7319d9e6167767f257468fe3a9e4589 100644 (file)
@@ -4993,7 +4993,7 @@ gtk_drag_begin_with_coordinates
 gtk_drag_cancel
 gtk_drag_set_icon_widget
 gtk_drag_set_icon_surface
-gtk_drag_set_icon_texture
+gtk_drag_set_icon_paintable
 gtk_drag_set_icon_name
 gtk_drag_set_icon_gicon
 gtk_drag_set_icon_default
index f621070850d7a31c62ec7973453c2ec3a74fb77e..ef96eeda959f59c4574a8b87f01eb67145224da3 100644 (file)
@@ -1208,10 +1208,10 @@ gtk_drag_set_icon_surface (GdkDragContext  *context,
 }
 
 /**
- * gtk_drag_set_icon_texture:
+ * gtk_drag_set_icon_paintable:
  * @context: the context for a drag (This must be called
  *     with a context for the source side of a drag)
- * @texture: the #GdkTexture to use as icon
+ * @paintable: the #GdkPaintable to use as icon
  * @hot_x: the X offset of the hotspot within the icon
  * @hot_y: the Y offset of the hotspot within the icon
  *
@@ -1224,17 +1224,17 @@ gtk_drag_set_icon_surface (GdkDragContext  *context,
  * mouse cursor.
  */
 void
-gtk_drag_set_icon_texture (GdkDragContext *context,
-                           GdkTexture     *texture,
-                           int             hot_x,
-                           int             hot_y)
+gtk_drag_set_icon_paintable (GdkDragContext *context,
+                             GdkPaintable   *paintable,
+                             int             hot_x,
+                             int             hot_y)
 {
   GtkWidget *widget;
 
   g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
-  g_return_if_fail (GDK_IS_TEXTURE (texture));
+  g_return_if_fail (GDK_IS_PAINTABLE (paintable));
 
-  widget = gtk_image_new_from_texture (texture);
+  widget = gtk_image_new_from_paintable (paintable);
 
   gtk_drag_set_icon_widget_internal (context, widget, hot_x, hot_y, TRUE);
 }
index 50f7270a65223a948b5f262443ca8a20f8f5642a..58b2aca5f9d63c22141f1b642e3920593a426407 100644 (file)
@@ -79,8 +79,8 @@ GDK_AVAILABLE_IN_ALL
 void gtk_drag_set_icon_surface(GdkDragContext *context,
                               cairo_surface_t *surface);
 GDK_AVAILABLE_IN_ALL
-void gtk_drag_set_icon_texture(GdkDragContext *context,
-                              GdkTexture     *texture,
+void gtk_drag_set_icon_paintable (GdkDragContext *context,
+                              GdkPaintable   *paintable,
                                int             hot_x,
                                int             hot_y);
 GDK_AVAILABLE_IN_ALL