[gtk+/wip/matthiasc/dnd-animation: 5/7] gdk: Add gdk_drag_drop_done



commit 80ef55172cfd39823d9498490ad8d2e6f6a7b302
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 7 15:07:13 2015 -0500

    gdk: Add gdk_drag_drop_done
    
    This will allow us to move the drag cancel animation to GDK.
    For now, it does nothing.

 gdk/gdkdnd.c        |   24 ++++++++++++++++++++++++
 gdk/gdkdnd.h        |    4 ++++
 gdk/gdkdndprivate.h |    2 ++
 3 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index 691b52b..6eda466 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -480,3 +480,27 @@ gdk_drag_context_get_drag_window (GdkDragContext *context)
 
   return NULL;
 }
+
+/**
+ * gdk_drag_drop_done:
+ * @context: a #GdkDragContext
+ * @success: whether the drag was ultimatively successful
+ *
+ * Inform GDK if the drop ended successfully. Passing %FALSE
+ * for @success may trigger a drag cancellation animation.
+ *
+ * This function is called by the drag source, and should
+ * be the last call before dropping the reference to the
+ * @context.
+ *
+ * Since: 3.20
+ */
+void
+gdk_drag_drop_done (GdkDragContext *context,
+                    gboolean        success)
+{
+  g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
+
+  if (GDK_DRAG_CONTEXT_GET_CLASS (context)->drop_done)
+    GDK_DRAG_CONTEXT_GET_CLASS (context)->drop_done (context, success);
+}
diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h
index acd32b1..a9ccb87 100644
--- a/gdk/gdkdnd.h
+++ b/gdk/gdkdnd.h
@@ -179,6 +179,10 @@ GDK_AVAILABLE_IN_ALL
 gboolean        gdk_drag_drop_succeeded (GdkDragContext *context);
 
 GDK_AVAILABLE_IN_3_20
+void            gdk_drag_drop_done   (GdkDragContext *context,
+                                      gboolean        success);
+
+GDK_AVAILABLE_IN_3_20
 GdkWindow      *gdk_drag_context_get_drag_window (GdkDragContext *context);
 
 G_END_DECLS
diff --git a/gdk/gdkdndprivate.h b/gdk/gdkdndprivate.h
index be1626f..39742f3 100644
--- a/gdk/gdkdndprivate.h
+++ b/gdk/gdkdndprivate.h
@@ -63,6 +63,8 @@ struct _GdkDragContextClass {
                                 guint32          time_);
   gboolean    (*drop_status)   (GdkDragContext  *context);
   GdkWindow*  (*get_drag_window) (GdkDragContext *context);
+  void        (*drop_done)     (GdkDragContext   *context,
+                                gboolean          success);
 };
 
 struct _GdkDragContext {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]