[balsa/gtk4: 202/312] mailbox: New GtkTreeDragSource API




commit d4076fb00d4ad9857ab3adc0c24fe0d15aa3e95a
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri Oct 9 20:48:47 2020 -0400

    mailbox: New GtkTreeDragSource API
    
    Does Balsa support dragging out of a mailbox?

 libbalsa/mailbox.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/libbalsa/mailbox.c b/libbalsa/mailbox.c
index 2619a38e9..b79a5682f 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -3481,12 +3481,11 @@ void libbalsa_mailbox_set_encr_icon(const char *name)
  * =================================================================== */
 
 static gboolean mailbox_row_draggable(GtkTreeDragSource * drag_source,
-                                   GtkTreePath * path);
-static gboolean mailbox_drag_data_delete(GtkTreeDragSource * drag_source,
                                       GtkTreePath * path);
-static gboolean mailbox_drag_data_get(GtkTreeDragSource * drag_source,
-                                   GtkTreePath * path,
-                                   GtkSelectionData * selection_data);
+static gboolean mailbox_drag_data_delete(GtkTreeDragSource * drag_source,
+                                         GtkTreePath * path);
+static GdkContentProvider *mailbox_drag_data_get(GtkTreeDragSource * drag_source,
+                                                 GtkTreePath * path);
 
 static void
 mailbox_drag_source_init(GtkTreeDragSourceIface * iface)
@@ -3515,13 +3514,16 @@ mailbox_drag_data_delete(GtkTreeDragSource * drag_source, GtkTreePath * path)
     return FALSE;
 }
 
-static gboolean
-mailbox_drag_data_get(GtkTreeDragSource * drag_source, GtkTreePath * path,
-                   GtkSelectionData * selection_data)
+static GdkContentProvider *
+mailbox_drag_data_get(GtkTreeDragSource * drag_source, GtkTreePath * path)
 {
-    /* The "drag-data-get" callback passes the list of selected messages
-     * to the GtkSelectionData, so we don't. */
-    return FALSE;
+    /* Asks the #GtkTreeDragSource to return a #GdkContentProvider representing
+     * the row at @path. Should robustly handle a @path no
+     * longer found in the model!
+     *
+     * Returns: (nullable) (transfer full): a #GdkContentProvider for the
+     *    given @path or %NULL if none exists */
+    return NULL;
 }
 
 /* =================================================================== *


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