dnd: Remove GDK_ACTION_DEFAULT and GDK_ACTION_PRIVATE

They're unused and nobody knows what they're supposed to men anyway.
This commit is contained in:
Benjamin Otte 2018-05-08 13:56:08 +02:00
parent 6919d8c532
commit ac44353f9b
7 changed files with 7 additions and 31 deletions

View File

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

View File

@ -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 doesnt 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;
/**

View File

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

View File

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

View File

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

View File

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

View File

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