[balsa/gtk4: 191/289] mailbox: New GtkTreeDragSource API




commit 3062f5c0658506a748707fd00c5350c3fd9eeef6
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 8a8b5a9e8..8190ee69e 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -3469,12 +3469,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)
@@ -3503,13 +3502,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]