[balsa/gtk4: 187/193] mailbox: New GtkTreeDragSource API




commit 7337f885ddfbecaf54858cccc5604b8e8faff682
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 27260f046..f57c8ce3d 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -3498,12 +3498,11 @@ void libbalsa_mailbox_set_encr_icon(GdkPixbuf * pixbuf)
  * =================================================================== */
 
 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)
@@ -3532,13 +3531,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]