[gtk+/wip/matthiasc/no-unmanaged-dnd: 24/24] Remove GdkDragProtocol from the api



commit 3bc68b39ab5a458429b981413b2cd2e5d32524a2
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 24 17:40:16 2017 -0400

    Remove GdkDragProtocol from the api
    
    ...together with apis that return it. We were not using this
    information in GTK+ at all, so no need to provide it.

 gdk/gdkdnd.c                     |   20 +------------------
 gdk/gdkdnd.h                     |   39 --------------------------------------
 gdk/gdkdndprivate.h              |   35 ++++++++++++++++++++++++++++++++++
 gdk/gdkinternals.h               |    1 +
 gdk/gdkwindow.c                  |   22 ---------------------
 gdk/gdkwindow.h                  |    5 ----
 gdk/gdkwindowimpl.h              |    2 -
 gdk/wayland/gdkdnd-wayland.c     |    6 -----
 gdk/wayland/gdkprivate-wayland.h |    2 -
 gdk/wayland/gdkwindow-wayland.c  |    1 -
 gdk/x11/gdkwindow-x11.c          |   27 --------------------------
 11 files changed, 37 insertions(+), 123 deletions(-)
---
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index 591eef7..c1af080 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -181,24 +181,6 @@ gdk_drag_context_get_dest_window (GdkDragContext *context)
 }
 
 /**
- * gdk_drag_context_get_protocol:
- * @context: a #GdkDragContext
- *
- * Returns the drag protocol thats used by this context.
- *
- * Returns: the drag protocol
- *
- * Since: 3.0
- */
-GdkDragProtocol
-gdk_drag_context_get_protocol (GdkDragContext *context)
-{
-  g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_DRAG_PROTO_NONE);
-
-  return context->protocol;
-}
-
-/**
  * gdk_drag_context_set_device:
  * @context: a #GdkDragContext
  * @device: a #GdkDevice
@@ -360,7 +342,7 @@ gdk_drag_context_class_init (GdkDragContextClass *klass)
                   G_TYPE_NONE, 1, GDK_TYPE_DRAG_ACTION);
 }
 
-/**
+/*
  * gdk_drag_find_window_for_screen:
  * @context: a #GdkDragContext
  * @drag_window: a window which may be at the pointer position, but
diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h
index 5fc7cf3..9ab7d73 100644
--- a/gdk/gdkdnd.h
+++ b/gdk/gdkdnd.h
@@ -80,34 +80,6 @@ typedef enum {
   GDK_DRAG_CANCEL_ERROR
 } GdkDragCancelReason;
 
-/**
- * GdkDragProtocol:
- * @GDK_DRAG_PROTO_NONE: no protocol.
- * @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
- * @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
- * @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
- *  unclaimed root window drops.
- * @GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
- * @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
- * @GDK_DRAG_PROTO_LOCAL: Intra-application DND.
- * @GDK_DRAG_PROTO_WAYLAND: Wayland DND protocol.
- *
- * Used in #GdkDragContext to indicate the protocol according to
- * which DND is done.
- */
-typedef enum
-{
-  GDK_DRAG_PROTO_NONE = 0,
-  GDK_DRAG_PROTO_MOTIF,
-  GDK_DRAG_PROTO_XDND,
-  GDK_DRAG_PROTO_ROOTWIN,
-  GDK_DRAG_PROTO_WIN32_DROPFILES,
-  GDK_DRAG_PROTO_OLE2,
-  GDK_DRAG_PROTO_LOCAL,
-  GDK_DRAG_PROTO_WAYLAND
-} GdkDragProtocol;
-
-
 GDK_AVAILABLE_IN_ALL
 GType            gdk_drag_context_get_type             (void) G_GNUC_CONST;
 
@@ -130,8 +102,6 @@ GDK_AVAILABLE_IN_ALL
 GdkWindow       *gdk_drag_context_get_source_window    (GdkDragContext *context);
 GDK_AVAILABLE_IN_ALL
 GdkWindow       *gdk_drag_context_get_dest_window      (GdkDragContext *context);
-GDK_AVAILABLE_IN_ALL
-GdkDragProtocol  gdk_drag_context_get_protocol         (GdkDragContext *context);
 
 /* Destination side */
 GDK_AVAILABLE_IN_ALL
@@ -167,15 +137,6 @@ GdkDragContext * gdk_drag_begin_from_point  (GdkWindow      *window,
                                              gint            y_root);
 
 GDK_AVAILABLE_IN_ALL
-void    gdk_drag_find_window_for_screen   (GdkDragContext   *context,
-                                           GdkWindow        *drag_window,
-                                           GdkScreen        *screen,
-                                           gint              x_root,
-                                           gint              y_root,
-                                           GdkWindow       **dest_window,
-                                           GdkDragProtocol  *protocol);
-
-GDK_AVAILABLE_IN_ALL
 gboolean        gdk_drag_drop_succeeded (GdkDragContext *context);
 
 GDK_AVAILABLE_IN_3_20
diff --git a/gdk/gdkdndprivate.h b/gdk/gdkdndprivate.h
index e9429c0..0491446 100644
--- a/gdk/gdkdndprivate.h
+++ b/gdk/gdkdndprivate.h
@@ -23,6 +23,33 @@
 G_BEGIN_DECLS
 
 
+/*
+ * GdkDragProtocol:
+ * @GDK_DRAG_PROTO_NONE: no protocol.
+ * @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
+ * @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
+ * @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
+ *  unclaimed root window drops.
+ * @GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
+ * @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
+ * @GDK_DRAG_PROTO_LOCAL: Intra-application DND.
+ * @GDK_DRAG_PROTO_WAYLAND: Wayland DND protocol.
+ *
+ * Used in #GdkDragContext to indicate the protocol according to
+ * which DND is done.
+ */
+typedef enum
+{
+  GDK_DRAG_PROTO_NONE = 0,
+  GDK_DRAG_PROTO_MOTIF,
+  GDK_DRAG_PROTO_XDND,
+  GDK_DRAG_PROTO_ROOTWIN,
+  GDK_DRAG_PROTO_WIN32_DROPFILES,
+  GDK_DRAG_PROTO_OLE2,
+  GDK_DRAG_PROTO_LOCAL,
+  GDK_DRAG_PROTO_WAYLAND
+} GdkDragProtocol;
+
 #define GDK_DRAG_CONTEXT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, 
GdkDragContextClass))
 #define GDK_IS_DRAG_CONTEXT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
 #define GDK_DRAG_CONTEXT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, 
GdkDragContextClass))
@@ -137,6 +164,14 @@ void     gdk_drag_abort  (GdkDragContext *context,
 void     gdk_drag_drop   (GdkDragContext *context,
                           guint32         time_);
 
+void     gdk_drag_find_window_for_screen  (GdkDragContext   *context,
+                                           GdkWindow        *drag_window,
+                                           GdkScreen        *screen,
+                                           gint              x_root,
+                                           gint              y_root,
+                                           GdkWindow       **dest_window,
+                                           GdkDragProtocol  *protocol);
+
 
 
 G_END_DECLS
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 7e17aee..73a8175 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -31,6 +31,7 @@
 #include "gdkwindowimpl.h"
 #include "gdkdisplay.h"
 #include "gdkprivate.h"
+#include "gdkdndprivate.h"
 
 G_BEGIN_DECLS
 
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 09d136c..b4dadbe 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -7725,28 +7725,6 @@ gdk_window_register_dnd (GdkWindow *window)
 }
 
 /**
- * gdk_window_get_drag_protocol:
- * @window: the destination window
- * @target: (out) (allow-none) (transfer full): location of the window
- *    where the drop should happen. This may be @window or a proxy window,
- *    or %NULL if @window does not support Drag and Drop.
- *
- * Finds out the DND protocol supported by a window.
- *
- * Returns: the supported DND protocol.
- *
- * Since: 3.0
- */
-GdkDragProtocol
-gdk_window_get_drag_protocol (GdkWindow  *window,
-                              GdkWindow **target)
-{
-  g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_DRAG_PROTO_NONE);
-
-  return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_drag_protocol (window, target);
-}
-
-/**
  * gdk_drag_begin:
  * @window: the source window for this drag.
  * @targets: (transfer none) (element-type GdkAtom): the offered targets,
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 261762f..b1cd3b7 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -801,11 +801,6 @@ GDK_AVAILABLE_IN_ALL
 void          gdk_window_register_dnd    (GdkWindow       *window);
 
 GDK_AVAILABLE_IN_ALL
-GdkDragProtocol
-              gdk_window_get_drag_protocol(GdkWindow      *window,
-                                           GdkWindow     **target);
-
-GDK_AVAILABLE_IN_ALL
 void gdk_window_begin_resize_drag            (GdkWindow     *window,
                                               GdkWindowEdge  edge,
                                               gint           button,
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index 6d76379..3e366bd 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -219,8 +219,6 @@ struct _GdkWindowImplClass
   void         (* set_opacity)          (GdkWindow *window,
                                         gdouble    opacity);
   void         (* destroy_notify)       (GdkWindow *window);
-  GdkDragProtocol (* get_drag_protocol) (GdkWindow *window,
-                                         GdkWindow **target);
   void         (* register_dnd)         (GdkWindow *window);
   GdkDragContext * (*drag_begin)        (GdkWindow *window,
                                          GdkDevice *device,
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index 184c6a0..b2ba3da 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -486,12 +486,6 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
   context_class->commit_drag_status = gdk_wayland_drag_context_commit_status;
 }
 
-GdkDragProtocol
-_gdk_wayland_window_get_drag_protocol (GdkWindow *window, GdkWindow **target)
-{
-  return GDK_DRAG_PROTO_WAYLAND;
-}
-
 void
 _gdk_wayland_window_register_dnd (GdkWindow *window)
 {
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index 09590b8..41de2c7 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -101,8 +101,6 @@ void       _gdk_wayland_cursor_set_scale (GdkCursor *cursor,
                                           guint      scale);
 
 void       gdk_wayland_window_sync (GdkWindow *window);
-GdkDragProtocol _gdk_wayland_window_get_drag_protocol (GdkWindow *window,
-                                                      GdkWindow **target);
 
 void            _gdk_wayland_window_register_dnd (GdkWindow *window);
 GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *window,
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 1b01534..e8109fb 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -3653,7 +3653,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
   impl_class->begin_move_drag = gdk_wayland_window_begin_move_drag;
   impl_class->set_opacity = gdk_wayland_window_set_opacity;
   impl_class->destroy_notify = gdk_wayland_window_destroy_notify;
-  impl_class->get_drag_protocol = _gdk_wayland_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_wayland_window_register_dnd;
   impl_class->drag_begin = _gdk_wayland_window_drag_begin;
   impl_class->get_property = gdk_wayland_window_get_property;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 7d36907..65efa07 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1250,32 +1250,6 @@ gdk_x11_window_destroy_notify (GdkWindow *window)
   g_object_unref (window);
 }
 
-static GdkDragProtocol
-gdk_x11_window_get_drag_protocol (GdkWindow *window,
-                                  GdkWindow **target)
-{
-  GdkDragProtocol protocol;
-  GdkDisplay *display;
-  guint version;
-  Window xid;
-
-  display = gdk_window_get_display (window);
-  xid = _gdk_x11_display_get_drag_protocol (display,
-                                            GDK_WINDOW_XID (window->impl_window),
-                                            &protocol,
-                                            &version);
-
-  if (target)
-    {
-      if (xid != None)
-        *target = gdk_x11_window_foreign_new_for_display (display, xid);
-      else
-        *target = NULL;
-    }
-
-  return protocol;
-}
-
 static void
 update_wm_hints (GdkWindow *window,
                 gboolean   force)
@@ -5059,7 +5033,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
   impl_class->begin_move_drag = gdk_x11_window_begin_move_drag;
   impl_class->set_opacity = gdk_x11_window_set_opacity;
   impl_class->destroy_notify = gdk_x11_window_destroy_notify;
-  impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_x11_window_register_dnd;
   impl_class->drag_begin = _gdk_x11_window_drag_begin;
   impl_class->get_property = _gdk_x11_window_get_property;


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