[gtk/dnd-gestures-2: 115/173] dragsource: Drop gtk_drag_source_get_origin



commit bd20ae4fa5b2ef078e9e518b4a8220be7a6fe075
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 6 19:55:43 2020 -0500

    dragsource: Drop gtk_drag_source_get_origin

 gtk/gtkdragsource.c | 67 -----------------------------------------------------
 gtk/gtkdragsource.h | 11 ---------
 2 files changed, 78 deletions(-)
---
diff --git a/gtk/gtkdragsource.c b/gtk/gtkdragsource.c
index 62787e537e..4ab51bc148 100644
--- a/gtk/gtkdragsource.c
+++ b/gtk/gtkdragsource.c
@@ -139,8 +139,6 @@ gtk_drag_source_finalize (GObject *object)
 {
   GtkDragSource *source = GTK_DRAG_SOURCE (object);
 
-  gtk_drag_source_detach (source);
-
   g_clear_object (&source->content);
   g_clear_object (&source->paintable);
 
@@ -620,55 +618,6 @@ gtk_drag_source_set_icon (GtkDragSource *source,
   source->hot_y = hot_y;
 }
 
-/**
- * gtk_drag_source_attach:
- * @source: (transfer full): a #GtkDragSource
- * @widget: the widget to attach @source to
- * @start_button_mask: mask determining which mouse buttons trigger
- *
- * Attaches the @source to a @widget by creating a drag gesture
- * on @widget that will trigger DND operations with @source.
- *
- * The @start_button_mask determines which mouse buttons trigger
- * a DND operation.
- *
- * To undo the effect of this call, use gtk_drag_source_detach().
- */
-void
-gtk_drag_source_attach (GtkDragSource   *source,
-                        GtkWidget       *widget,
-                        GdkModifierType  start_button_mask)
-{
-  g_return_if_fail (GTK_IS_DRAG_SOURCE (source));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (start_button_mask != 0);
-  g_return_if_fail ((start_button_mask & ~(GDK_BUTTON1_MASK |
-                                           GDK_BUTTON2_MASK |
-                                           GDK_BUTTON3_MASK |
-                                           GDK_BUTTON4_MASK |
-                                           GDK_BUTTON5_MASK)) == 0);
-
-  gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (source));
-}
-
-/**
- * gtk_drag_source_detach:
- * @source: a #GtkDragSource
- *
- * Undoes the effect of a prior gtk_drag_source_attach() call.
- */
-void
-gtk_drag_source_detach (GtkDragSource *source)
-{
-  GtkWidget *widget;
-
-  g_return_if_fail (GTK_IS_DRAG_SOURCE (source));
-
-  widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
-  if (widget)
-    gtk_widget_remove_controller (widget, GTK_EVENT_CONTROLLER (source));
-}
-
 /**
  * gtk_drag_get_source:
  * @drag: a #GdkDrag
@@ -696,22 +645,6 @@ gtk_drag_get_source (GdkDrag *drag)
   return NULL;
 }
 
-/**
- * gtk_drag_source_get_origin:
- * @source: a #GtkDragSource
- *
- * Returns the widget that an ongoing drag is started from.
- *
- * Returns: (nullable): the origin of the current drag operation, or %NULL
- */
-GtkWidget *
-gtk_drag_source_get_origin (GtkDragSource *source)
-{
-  g_return_val_if_fail (GTK_IS_DRAG_SOURCE (source), NULL);
-
-  return gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
-}
-
 /**
  * gtk_drag_source_get_drag:
  * @source: a #GtkDragSource
diff --git a/gtk/gtkdragsource.h b/gtk/gtkdragsource.h
index bf8785beaa..daca3f0752 100644
--- a/gtk/gtkdragsource.h
+++ b/gtk/gtkdragsource.h
@@ -83,20 +83,9 @@ void               gtk_drag_source_drag_cancel (GtkDragSource     *sourcei);
 GDK_AVAILABLE_IN_ALL
 GtkDragSource *    gtk_drag_get_source         (GdkDrag           *drag);
 
-GDK_AVAILABLE_IN_ALL
-GtkWidget *        gtk_drag_source_get_origin  (GtkDragSource     *source);
-
 GDK_AVAILABLE_IN_ALL
 GdkDrag *          gtk_drag_source_get_drag    (GtkDragSource     *source);
 
-GDK_AVAILABLE_IN_ALL
-void               gtk_drag_source_attach      (GtkDragSource     *source,
-                                                GtkWidget         *widget,
-                                                GdkModifierType    start_button_mask);
-
-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,


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