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.
This commit is contained in:
Matthias Clasen 2017-08-24 17:40:16 -04:00 committed by Benjamin Otte
parent 8b1b9f8c55
commit 6ab72b2653
18 changed files with 36 additions and 172 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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;
}

View File

@ -182,24 +182,6 @@ gdk_drag_context_get_dest_window (GdkDragContext *context)
return context->dest_window;
}
/**
* 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
@ -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

View File

@ -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
@ -166,14 +136,6 @@ GdkDragContext * gdk_drag_begin_from_point (GdkWindow
gint x_root,
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);

View File

@ -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

View File

@ -33,6 +33,7 @@
#include "gdkdisplay.h"
#include "gdkeventsprivate.h"
#include "gdkenumtypes.h"
#include "gdkdndprivate.h"
G_BEGIN_DECLS

View File

@ -6923,28 +6923,6 @@ gdk_window_register_dnd (GdkWindow *window)
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->register_dnd (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.

View File

@ -788,11 +788,6 @@ void gdk_window_set_opacity (GdkWindow *window,
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,

View File

@ -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,

View File

@ -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;

View File

@ -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)
{

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;