[gtk+] Remove GdkDragProtocol from the api
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Remove GdkDragProtocol from the api
- Date: Sun, 3 Dec 2017 05:42:19 +0000 (UTC)
commit 6ab72b2653cf2b3653cdf32e53eb528e441ebebe
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/broadway/gdkdnd-broadway.c | 7 ------
gdk/broadway/gdkprivate-broadway.h | 2 -
gdk/broadway/gdkwindow-broadway.c | 1 -
gdk/gdkdnd.c | 20 +------------------
gdk/gdkdnd.h | 38 ------------------------------------
gdk/gdkdndprivate.h | 34 ++++++++++++++++++++++++++++++++
gdk/gdkinternals.h | 1 +
gdk/gdkwindow.c | 22 --------------------
gdk/gdkwindow.h | 5 ----
gdk/gdkwindowimpl.h | 2 -
gdk/mir/gdkmirwindowimpl.c | 8 -------
gdk/wayland/gdkdnd-wayland.c | 6 -----
gdk/wayland/gdkprivate-wayland.h | 2 -
gdk/wayland/gdkwindow-wayland.c | 1 -
gdk/win32/gdkdnd-win32.c | 28 --------------------------
gdk/win32/gdkprivate-win32.h | 3 --
gdk/win32/gdkwindow-win32.c | 1 -
gdk/x11/gdkwindow-x11.c | 27 -------------------------
18 files changed, 36 insertions(+), 172 deletions(-)
---
diff --git a/gdk/broadway/gdkdnd-broadway.c b/gdk/broadway/gdkdnd-broadway.c
index ebb3679..264da5e 100644
--- a/gdk/broadway/gdkdnd-broadway.c
+++ b/gdk/broadway/gdkdnd-broadway.c
@@ -102,13 +102,6 @@ _gdk_broadway_window_drag_begin (GdkWindow *window,
return new_context;
}
-GdkDragProtocol
-_gdk_broadway_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- return GDK_DRAG_PROTO_NONE;
-}
-
static GdkWindow *
gdk_broadway_drag_context_find_window (GdkDragContext *context,
GdkWindow *drag_window,
diff --git a/gdk/broadway/gdkprivate-broadway.h b/gdk/broadway/gdkprivate-broadway.h
index 3d8faaa..250c81c 100644
--- a/gdk/broadway/gdkprivate-broadway.h
+++ b/gdk/broadway/gdkprivate-broadway.h
@@ -104,8 +104,6 @@ void _gdk_broadway_display_init_root_window (GdkDisplay *display);
void _gdk_broadway_display_init_dnd (GdkDisplay *display);
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
void _gdk_broadway_display_queue_events (GdkDisplay *display);
-GdkDragProtocol _gdk_broadway_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target);
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
GdkCursor *_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 9eb8173..0dec3ab 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -1499,5 +1499,4 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->get_property = _gdk_broadway_window_get_property;
impl_class->change_property = _gdk_broadway_window_change_property;
impl_class->delete_property = _gdk_broadway_window_delete_property;
- impl_class->get_drag_protocol = _gdk_broadway_window_get_drag_protocol;
}
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index 94d2565..5bf0ab3 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -183,24 +183,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
@@ -362,7 +344,7 @@ gdk_drag_context_class_init (GdkDragContextClass *klass)
G_TYPE_NONE, 1, GDK_TYPE_DRAG_ACTION);
}
-/**
+/*
* gdk_drag_find_window:
* @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 e29a07d..d7eac34 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,14 +137,6 @@ GdkDragContext * gdk_drag_begin_from_point (GdkWindow
gint y_root);
GDK_AVAILABLE_IN_ALL
-void gdk_drag_find_window (GdkDragContext *context,
- GdkWindow *drag_window,
- 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 e4c223b..78ae19b 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))
@@ -136,6 +163,13 @@ void gdk_drag_abort (GdkDragContext *context,
void gdk_drag_drop (GdkDragContext *context,
guint32 time_);
+void gdk_drag_find_window (GdkDragContext *context,
+ GdkWindow *drag_window,
+ 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 4dd2c93..85d51a0 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -33,6 +33,7 @@
#include "gdkdisplay.h"
#include "gdkeventsprivate.h"
#include "gdkenumtypes.h"
+#include "gdkdndprivate.h"
G_BEGIN_DECLS
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index ec1bb02..682893e 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6924,28 +6924,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.
* @formats: (transfer none): the offered formats
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index a75d296..61f66ce 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -789,11 +789,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 8c15aeb..af063a8 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -216,8 +216,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/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index e71f19c..a820170 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -1659,13 +1659,6 @@ gdk_mir_window_impl_destroy_notify (GdkWindow *window)
{
}
-static GdkDragProtocol
-gdk_mir_window_impl_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- return 0;
-}
-
static void
gdk_mir_window_impl_register_dnd (GdkWindow *window)
{
@@ -2272,7 +2265,6 @@ gdk_mir_window_impl_class_init (GdkMirWindowImplClass *klass)
impl_class->configure_finished = gdk_mir_window_impl_configure_finished;
impl_class->set_opacity = gdk_mir_window_impl_set_opacity;
impl_class->destroy_notify = gdk_mir_window_impl_destroy_notify;
- impl_class->get_drag_protocol = gdk_mir_window_impl_get_drag_protocol;
impl_class->register_dnd = gdk_mir_window_impl_register_dnd;
impl_class->drag_begin = gdk_mir_window_impl_drag_begin;
impl_class->process_updates_recurse = gdk_mir_window_impl_process_updates_recurse;
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index febd0e0..d8a3d4e 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -484,12 +484,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 ef7f52a..f650b31 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -89,8 +89,6 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
guint *next_image_delay);
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 224c642..a2a4c03 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -3686,7 +3686,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/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index acc04ea..ea4deb0 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -2152,34 +2152,6 @@ _gdk_win32_dnd_do_dragdrop (void)
}
}
-/* Untested, may not work ...
- * ... but as of this writing is only used by exlusive X11 gtksocket.c
- */
-GdkDragProtocol
-_gdk_win32_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- GdkDragProtocol protocol = GDK_DRAG_PROTO_NONE;
-
- if (gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN)
- {
- if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
- {
- if (use_ole2_dnd)
- protocol = GDK_DRAG_PROTO_OLE2;
- else
- protocol = GDK_DRAG_PROTO_LOCAL;
- }
- }
-
- if (target)
- {
- *target = NULL;
- }
-
- return protocol;
-}
-
typedef struct {
gint x;
gint y;
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index 414e972..ae2be8c 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -177,9 +177,6 @@ void _gdk_win32_window_move_region (GdkWindow *window,
void _gdk_win32_selection_init (void);
void _gdk_win32_dnd_exit (void);
-GdkDragProtocol _gdk_win32_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target);
-
void gdk_win32_handle_table_insert (HANDLE *handle,
gpointer data);
void gdk_win32_handle_table_remove (HANDLE handle);
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 24db897..5e784e8 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -5941,7 +5941,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
impl_class->begin_move_drag = gdk_win32_window_begin_move_drag;
impl_class->set_opacity = gdk_win32_window_set_opacity;
impl_class->destroy_notify = gdk_win32_window_destroy_notify;
- impl_class->get_drag_protocol = _gdk_win32_window_get_drag_protocol;
impl_class->register_dnd = _gdk_win32_window_register_dnd;
impl_class->drag_begin = _gdk_win32_window_drag_begin;
impl_class->get_property = _gdk_win32_window_get_property;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 3764d4c..3c9106a 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1224,32 +1224,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)
@@ -4993,7 +4967,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]