Move the rest of the drag-source api over
authorMatthias Clasen <mclasen@redhat.com>
Wed, 1 Jan 2020 18:22:29 +0000 (13:22 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 8 Jan 2020 23:48:20 +0000 (18:48 -0500)
Just reshuffling some source.

gtk/gtkdnd.c
gtk/gtkdnd.h
gtk/gtkdragsource.c
gtk/gtkdragsource.h
gtk/gtkgesturelongpress.c

index bd6067df9e1431fd5c8ed272232641373d59cd15..20bcb774e1c23a3307d892718641aa210ede7bd7 100644 (file)
@@ -631,38 +631,3 @@ gtk_drag_dest_drop (GtkWidget *widget,
 
   return (site->flags & GTK_DEST_DEFAULT_DROP) ? TRUE : retval;
 }
-
-/***************
- * Source side *
- ***************/
-
-/**
- * gtk_drag_check_threshold: (method)
- * @widget: a #GtkWidget
- * @start_x: X coordinate of start of drag
- * @start_y: Y coordinate of start of drag
- * @current_x: current X coordinate
- * @current_y: current Y coordinate
- * 
- * Checks to see if a mouse drag starting at (@start_x, @start_y) and ending
- * at (@current_x, @current_y) has passed the GTK+ drag threshold, and thus
- * should trigger the beginning of a drag-and-drop operation.
- *
- * Returns: %TRUE if the drag threshold has been passed.
- */
-gboolean
-gtk_drag_check_threshold (GtkWidget *widget,
-                          gint       start_x,
-                          gint       start_y,
-                          gint       current_x,
-                          gint       current_y)
-{
-  gint drag_threshold;
-
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-
-  drag_threshold = gtk_settings_get_dnd_drag_threshold (gtk_widget_get_settings (widget));
-
-  return (ABS (current_x - start_x) > drag_threshold ||
-          ABS (current_y - start_y) > drag_threshold);
-}
index e55a587ac43909deae1ec9333143e1cbe434a6b9..c8b0c8c44a3d02c947a86067f3831c10e9984085 100644 (file)
@@ -49,15 +49,6 @@ void gtk_drag_highlight   (GtkWidget  *widget);
 GDK_AVAILABLE_IN_ALL
 void gtk_drag_unhighlight (GtkWidget  *widget);
 
-/* Source side */
-
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_drag_check_threshold (GtkWidget *widget,
-                                  gint       start_x,
-                                  gint       start_y,
-                                  gint       current_x,
-                                  gint       current_y);
-
 
 G_END_DECLS
 
index b0300df724511dc9fdb3fc0580ead0c074907132..1f4930b3a9861ac5bee5f115374c405a8e25f075 100644 (file)
@@ -39,6 +39,7 @@
 #include "gtkdragiconprivate.h"
 #include "gtkprivate.h"
 #include "gtkmarshalers.h"
+#include "gtksettingsprivate.h"
 
 /**
  * SECTION:gtkdragsource
@@ -781,3 +782,34 @@ gtk_drag_source_drag_cancel (GtkDragSource *source)
       gdk_drag_drop_done (source->drag, success);
     }
 }
+
+/**
+ * gtk_drag_check_threshold: (method)
+ * @widget: a #GtkWidget
+ * @start_x: X coordinate of start of drag
+ * @start_y: Y coordinate of start of drag
+ * @current_x: current X coordinate
+ * @current_y: current Y coordinate
+ * 
+ * Checks to see if a mouse drag starting at (@start_x, @start_y) and ending
+ * at (@current_x, @current_y) has passed the GTK drag threshold, and thus
+ * should trigger the beginning of a drag-and-drop operation.
+ *
+ * Returns: %TRUE if the drag threshold has been passed.
+ */
+gboolean
+gtk_drag_check_threshold (GtkWidget *widget,
+                          int        start_x,
+                          int        start_y,
+                          int        current_x,
+                          int        current_y)
+{
+  gint drag_threshold;
+
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+
+  drag_threshold = gtk_settings_get_dnd_drag_threshold (gtk_widget_get_settings (widget));
+
+  return (ABS (current_x - start_x) > drag_threshold ||
+          ABS (current_y - start_y) > drag_threshold);
+}
index 729a6e258ddeec51c70db49114474bc10e625a74..8a7a8d0ec5fb8aca25d0e48e680326b4268ec4b9 100644 (file)
@@ -98,6 +98,13 @@ void               gtk_drag_source_attach      (GtkDragSource     *source,
 GDK_AVAILABLE_IN_ALL
 void               gtk_drag_source_detach      (GtkDragSource     *source);
 
+GDK_AVAILABLE_IN_ALL
+gboolean           gtk_drag_check_threshold    (GtkWidget         *widget,
+                                                int                start_x,
+                                                int                start_y,
+                                                int                current_x,
+                                                int                current_y);
+
 
 G_END_DECLS
 
index fc28c32f578a6262ff121f14ce917b6d691a66ad..9639ea151c65c32f78674c5ec161c4fd70cdc93c 100644 (file)
@@ -37,7 +37,7 @@
 #include "gtkgesturelongpressprivate.h"
 #include "gtkgestureprivate.h"
 #include "gtkmarshalers.h"
-#include "gtkdnd.h"
+#include "gtkdragsource.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 #include "gtkmarshalers.h"