From ac44353f9b81fd0de45a7d5bb8ca37ebff38b6b7 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 8 May 2018 13:56:08 +0200 Subject: [PATCH] dnd: Remove GDK_ACTION_DEFAULT and GDK_ACTION_PRIVATE They're unused and nobody knows what they're supposed to men anyway. --- gdk/gdkdnd.c | 3 +-- gdk/gdkdnd.h | 13 ++++--------- gdk/quartz/GdkQuartzNSWindow.c | 10 ---------- gdk/wayland/gdkdnd-wayland.c | 2 +- gdk/win32/gdkdrag-win32.c | 6 ------ gdk/win32/gdkdrop-win32.c | 2 +- gdk/win32/gdkmain-win32.c | 2 -- 7 files changed, 7 insertions(+), 31 deletions(-) diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index debefb0796..47da69eda3 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -53,7 +53,6 @@ static struct { const gchar *name; GdkCursor *cursor; } drag_cursors[] = { - { GDK_ACTION_DEFAULT, NULL, NULL }, { GDK_ACTION_ASK, "dnd-ask", NULL }, { GDK_ACTION_COPY, "dnd-copy", NULL }, { GDK_ACTION_MOVE, "dnd-move", NULL }, @@ -167,7 +166,7 @@ gdk_drag_context_get_formats (GdkDragContext *context) GdkDragAction gdk_drag_context_get_actions (GdkDragContext *context) { - g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_ACTION_DEFAULT); + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), 0); return context->actions; } diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h index 205d7151d2..74c65e4f67 100644 --- a/gdk/gdkdnd.h +++ b/gdk/gdkdnd.h @@ -41,14 +41,11 @@ G_BEGIN_DECLS /** * GdkDragAction: - * @GDK_ACTION_DEFAULT: Means nothing, and should not be used. * @GDK_ACTION_COPY: Copy the data. * @GDK_ACTION_MOVE: Move the data, i.e. first copy it, then delete * it from the source using the DELETE target of the X selection protocol. * @GDK_ACTION_LINK: Add a link to the data. Note that this is only * useful if source and destination agree on what it means. - * @GDK_ACTION_PRIVATE: Special action which tells the source that the - * destination will do something that the source doesn’t understand. * @GDK_ACTION_ASK: Ask the user what to do with the data. * * Used in #GdkDragContext to indicate what the destination @@ -56,12 +53,10 @@ G_BEGIN_DECLS */ typedef enum { - GDK_ACTION_DEFAULT = 1 << 0, - GDK_ACTION_COPY = 1 << 1, - GDK_ACTION_MOVE = 1 << 2, - GDK_ACTION_LINK = 1 << 3, - GDK_ACTION_PRIVATE = 1 << 4, - GDK_ACTION_ASK = 1 << 5 + GDK_ACTION_COPY = 1 << 0, + GDK_ACTION_MOVE = 1 << 1, + GDK_ACTION_LINK = 1 << 2, + GDK_ACTION_ASK = 1 << 3 } GdkDragAction; /** diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c index bac6225d4e..edf2095b6d 100644 --- a/gdk/quartz/GdkQuartzNSWindow.c +++ b/gdk/quartz/GdkQuartzNSWindow.c @@ -527,16 +527,6 @@ drag_operation_to_drag_action (NSDragOperation operation) /* GDK and Quartz drag operations do not map 1:1. * This mapping represents about the best that we * can come up. - * - * Note that NSDragOperationPrivate and GDK_ACTION_PRIVATE - * have almost opposite meanings: the GDK one means that the - * destination is solely responsible for the action; the Quartz - * one means that the source and destination will agree - * privately on the action. NSOperationGeneric is close in meaning - * to GDK_ACTION_PRIVATE but there is a problem: it will be - * sent for any ordinary drag, and likely not understood - * by any intra-widget drag (since the source & dest are the - * same). */ if (operation & NSDragOperationGeneric) diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c index 9c9e77f9c7..98e85d6a38 100644 --- a/gdk/wayland/gdkdnd-wayland.c +++ b/gdk/wayland/gdkdnd-wayland.c @@ -136,7 +136,7 @@ gdk_to_wl_actions (GdkDragAction action) { uint32_t dnd_actions = 0; - if (action & (GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_PRIVATE)) + if (action & (GDK_ACTION_COPY | GDK_ACTION_LINK)) dnd_actions |= WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY; if (action & GDK_ACTION_MOVE) dnd_actions |= WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE; diff --git a/gdk/win32/gdkdrag-win32.c b/gdk/win32/gdkdrag-win32.c index be4b55955d..069e3c1e4f 100644 --- a/gdk/win32/gdkdrag-win32.c +++ b/gdk/win32/gdkdrag-win32.c @@ -903,9 +903,6 @@ action_for_drop_effect (DWORD effect) if (effect & DROPEFFECT_COPY) action |= GDK_ACTION_COPY; - if (action == 0) - action = GDK_ACTION_DEFAULT; - return action; } @@ -1739,9 +1736,6 @@ _gdk_win32_drag_context_send_local_status_event (GdkDragContext *src_context, if (src_context_win32->drag_status == GDK_DRAG_STATUS_MOTION_WAIT) src_context_win32->drag_status = GDK_DRAG_STATUS_DRAG; - if (action == GDK_ACTION_DEFAULT) - action = 0; - src_context->action = action; GDK_NOTE (DND, g_print ("gdk_dnd_handle_drag_status: 0x%p\n", diff --git a/gdk/win32/gdkdrop-win32.c b/gdk/win32/gdkdrop-win32.c index 1b2d19930c..f8b21e182c 100644 --- a/gdk/win32/gdkdrop-win32.c +++ b/gdk/win32/gdkdrop-win32.c @@ -436,7 +436,7 @@ idroptarget_dragenter (LPDROPTARGET This, source_context ? source_context->source_surface : NULL, ctx->dest_surface, query_targets (pDataObj, NULL), - GDK_ACTION_DEFAULT | GDK_ACTION_COPY | GDK_ACTION_MOVE, + GDK_ACTION_COPY | GDK_ACTION_MOVE, GDK_DRAG_PROTO_OLE2); context_win32 = GDK_WIN32_DROP_CONTEXT (context); gdk_content_formats_unref (query_targets (pDataObj, context_win32->droptarget_w32format_contentformat_map)); diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index cf73d6cf51..dc878fa522 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -438,11 +438,9 @@ _gdk_win32_drag_action_to_string (GdkDragAction actions) if (actions & GDK_ACTION_ ## x) \ (bufp += sprintf (bufp, "%s" #x, s), s = "|") - BIT (DEFAULT); BIT (COPY); BIT (MOVE); BIT (LINK); - BIT (PRIVATE); BIT (ASK); #undef BIT