[gtk/wip/otte/dnd] treeview, iconview: Don't return the drop target
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/dnd] treeview, iconview: Don't return the drop target
- Date: Sun, 1 Mar 2020 05:57:06 +0000 (UTC)
commit 5be975bf4bffa12d5b5b38852d6eeca9e4dacb4a
Author: Benjamin Otte <otte redhat com>
Date: Fri Feb 28 04:19:36 2020 +0100
treeview, iconview: Don't return the drop target
Not a good idea to hand internal event controllers out to public API.
gtk/gtkiconview.c | 9 +++------
gtk/gtkiconview.h | 4 +---
gtk/gtkiconviewprivate.h | 1 +
gtk/gtktreeview.c | 8 ++------
gtk/gtktreeview.h | 4 +---
gtk/gtktreeviewcolumn.c | 1 +
6 files changed, 9 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 076ca4dfbb..9400fdd24b 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -6397,17 +6397,16 @@ gtk_icon_view_enable_model_drag_source (GtkIconView *icon_view,
*
* Turns @icon_view into a drop destination for automatic DND. Calling this
* method sets #GtkIconView:reorderable to %FALSE.
- *
- * Returns: (transfer none): the drop target that was attached
**/
-GtkDropTarget *
+void
gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
GdkContentFormats *formats,
GdkDragAction actions)
{
- g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), NULL);
GtkCssNode *widget_node;
+ g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
+
icon_view->priv->dest = gtk_drop_target_new (gdk_content_formats_ref (formats), actions);
g_signal_connect (icon_view->priv->dest, "drag-leave", G_CALLBACK (gtk_icon_view_drag_leave), icon_view);
g_signal_connect (icon_view->priv->dest, "drag-motion", G_CALLBACK (gtk_icon_view_drag_motion), icon_view);
@@ -6426,8 +6425,6 @@ gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
gtk_css_node_set_parent (icon_view->priv->dndnode, widget_node);
gtk_css_node_set_state (icon_view->priv->dndnode, gtk_css_node_get_state (widget_node));
g_object_unref (icon_view->priv->dndnode);
-
- return icon_view->priv->dest;
}
/**
diff --git a/gtk/gtkiconview.h b/gtk/gtkiconview.h
index ffde51b90a..51e1a8be4d 100644
--- a/gtk/gtkiconview.h
+++ b/gtk/gtkiconview.h
@@ -27,8 +27,6 @@
#include <gtk/gtkcellrenderer.h>
#include <gtk/gtkcellarea.h>
#include <gtk/gtktooltip.h>
-#include <gtk/gtkdragsource.h>
-#include <gtk/gtkdragdest.h>
G_BEGIN_DECLS
@@ -219,7 +217,7 @@ void gtk_icon_view_enable_model_drag_source (GtkIconView
GdkContentFormats *formats,
GdkDragAction actions);
GDK_AVAILABLE_IN_ALL
-GtkDropTarget * gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
+void gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
GdkContentFormats *formats,
GdkDragAction actions);
GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtkiconviewprivate.h b/gtk/gtkiconviewprivate.h
index 97ceed2986..c45c3ba3e9 100644
--- a/gtk/gtkiconviewprivate.h
+++ b/gtk/gtkiconviewprivate.h
@@ -17,6 +17,7 @@
#include "gtk/gtkiconview.h"
#include "gtk/gtkcssnodeprivate.h"
+#include "gtk/gtkdragdest.h"
#include "gtk/gtkgestureclick.h"
#include "gtk/gtkeventcontrollermotion.h"
#include "gtk/gtkdragsource.h"
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 9790d91bcd..4a4375e6bc 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -12854,10 +12854,8 @@ gtk_tree_view_enable_model_drag_source (GtkTreeView *tree_view,
*
* Turns @tree_view into a drop destination for automatic DND. Calling
* this method sets #GtkTreeView:reorderable to %FALSE.
- *
- * Returns: (transfer none): the drop target that has been attached
**/
-GtkDropTarget *
+void
gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
GdkContentFormats *formats,
GdkDragAction actions)
@@ -12865,7 +12863,7 @@ gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
TreeViewDragInfo *di;
GtkCssNode *widget_node;
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
+ g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
di = ensure_info (tree_view);
di->dest_set = TRUE;
@@ -12885,8 +12883,6 @@ gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
g_object_unref (di->cssnode);
unset_reorderable (tree_view);
-
- return di->dest;
}
/**
diff --git a/gtk/gtktreeview.h b/gtk/gtktreeview.h
index d9d400034a..f4df3fc0b3 100644
--- a/gtk/gtktreeview.h
+++ b/gtk/gtktreeview.h
@@ -26,8 +26,6 @@
#include <gtk/gtktreemodel.h>
#include <gtk/gtktreeviewcolumn.h>
#include <gtk/gtkentry.h>
-#include <gtk/gtkdragsource.h>
-#include <gtk/gtkdragdest.h>
G_BEGIN_DECLS
@@ -320,7 +318,7 @@ void gtk_tree_view_enable_model_drag_source (GtkTreeView
GdkContentFormats *formats,
GdkDragAction actions);
GDK_AVAILABLE_IN_ALL
-GtkDropTarget * gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
+void gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
GdkContentFormats *formats,
GdkDragAction actions);
GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index a9d8a104c0..d5152fdecb 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -24,6 +24,7 @@
#include "gtkcellareabox.h"
#include "gtkcellareacontext.h"
#include "gtkcelllayout.h"
+#include "gtkdragsource.h"
#include "gtkframe.h"
#include "gtkimage.h"
#include "gtkintl.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]