mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
Rename a property
Change GdkDrag::action to GdkDrag::selected-action, which is more clearly different from actions, and follows the existing name of the struct field and getter.
This commit is contained in:
parent
40841ec3be
commit
94af080fb6
@ -53,7 +53,8 @@ enum {
|
||||
PROP_DEVICE,
|
||||
PROP_DISPLAY,
|
||||
PROP_FORMATS,
|
||||
PROP_ACTION,
|
||||
PROP_SELECTED_ACTION,
|
||||
PROP_ACTIONS,
|
||||
N_PROPERTIES
|
||||
};
|
||||
|
||||
@ -238,10 +239,10 @@ gdk_drag_set_property (GObject *gobject,
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ACTION:
|
||||
case PROP_SELECTED_ACTION:
|
||||
{
|
||||
GdkDragAction action = g_value_get_flags (value);
|
||||
gdk_drag_set_action (drag, action);
|
||||
gdk_drag_set_selected_action (drag, action);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -277,7 +278,7 @@ gdk_drag_get_property (GObject *gobject,
|
||||
g_value_set_boxed (value, drag->formats);
|
||||
break;
|
||||
|
||||
case PROP_ACTION:
|
||||
case PROP_SELECTED_ACTION:
|
||||
g_value_set_flags (value, drag->selected_action);
|
||||
break;
|
||||
|
||||
@ -371,9 +372,9 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
properties[PROP_ACTION] =
|
||||
g_param_spec_flags ("action",
|
||||
"Action",
|
||||
properties[PROP_SELECTED_ACTION] =
|
||||
g_param_spec_flags ("selected-action",
|
||||
"Selected action",
|
||||
"The currently selected action",
|
||||
GDK_TYPE_DRAG_ACTION,
|
||||
0,
|
||||
@ -597,8 +598,8 @@ gdk_drag_set_actions (GdkDrag *drag,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_drag_set_action (GdkDrag *drag,
|
||||
GdkDragAction action)
|
||||
gdk_drag_set_selected_action (GdkDrag *drag,
|
||||
GdkDragAction action)
|
||||
{
|
||||
GdkCursor *cursor;
|
||||
|
||||
@ -610,7 +611,7 @@ gdk_drag_set_action (GdkDrag *drag,
|
||||
cursor = gdk_drag_get_cursor (drag, action);
|
||||
gdk_drag_set_cursor (drag, cursor);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (drag), properties[PROP_ACTION]);
|
||||
g_object_notify_by_pspec (G_OBJECT (drag), properties[PROP_SELECTED_ACTION]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,7 +80,7 @@ void gdk_drag_set_cursor (GdkDrag *drag,
|
||||
void gdk_drag_set_actions (GdkDrag *drag,
|
||||
GdkDragAction actions,
|
||||
GdkDragAction suggested_action);
|
||||
void gdk_drag_set_action (GdkDrag *drag,
|
||||
void gdk_drag_set_selected_action (GdkDrag *drag,
|
||||
GdkDragAction action);
|
||||
|
||||
void gdk_drag_cancel (GdkDrag *drag,
|
||||
|
@ -124,7 +124,7 @@ gdk_wayland_drag_init (GdkWaylandDrag *drag_wayland)
|
||||
drag = GDK_DRAG (drag_wayland);
|
||||
drags = g_list_prepend (drags, drag);
|
||||
|
||||
gdk_drag_set_action (drag, GDK_ACTION_COPY);
|
||||
gdk_drag_set_selected_action (drag, GDK_ACTION_COPY);
|
||||
}
|
||||
|
||||
static GdkSurface *
|
||||
@ -335,7 +335,7 @@ data_source_action (void *data,
|
||||
g_message ("data source action, source = %p action=%x",
|
||||
source, action));
|
||||
|
||||
gdk_drag_set_action (drag, _wl_to_gdk_actions (action));
|
||||
gdk_drag_set_selected_action (drag, _wl_to_gdk_actions (action));
|
||||
}
|
||||
|
||||
static const struct wl_data_source_listener data_source_listener = {
|
||||
|
@ -806,7 +806,7 @@ gdk_drag_new (GdkDisplay *display,
|
||||
else
|
||||
drag_win32->scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, NULL, NULL);
|
||||
|
||||
gdk_drag_set_actions (drag, actions, actions);
|
||||
gdk_drag_set_selected_actions (drag, actions, actions);
|
||||
drag_win32->protocol = protocol;
|
||||
|
||||
return drag;
|
||||
|
@ -879,7 +879,7 @@ gdk_x11_drag_handle_status (GdkDisplay *display,
|
||||
action = 0;
|
||||
}
|
||||
|
||||
gdk_drag_set_action (drag, xdnd_action_from_atom (display, action));
|
||||
gdk_drag_set_selected_action (drag, xdnd_action_from_atom (display, action));
|
||||
drag_x11->current_action = action;
|
||||
}
|
||||
}
|
||||
@ -1002,7 +1002,7 @@ send_client_message_async_cb (Window window,
|
||||
window == drag_x11->proxy_xid)
|
||||
{
|
||||
drag_x11->proxy_xid = None;
|
||||
gdk_drag_set_action (drag, 0);
|
||||
gdk_drag_set_selected_action (drag, 0);
|
||||
drag_x11->current_action = 0;
|
||||
drag_x11->drag_status = GDK_DRAG_STATUS_DRAG;
|
||||
}
|
||||
@ -1546,7 +1546,7 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
|
||||
{
|
||||
drag_x11->proxy_xid = None;
|
||||
drag_x11->drop_xid = None;
|
||||
gdk_drag_set_action (drag, 0);
|
||||
gdk_drag_set_selected_action (drag, 0);
|
||||
}
|
||||
|
||||
/* Push a status event, to let the client know that
|
||||
@ -1581,9 +1581,9 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
|
||||
*/
|
||||
if (gdk_content_formats_contain_mime_type (formats, "application/x-rootwindow-drop") ||
|
||||
gdk_content_formats_contain_mime_type (formats, "application/x-rootwin-drop"))
|
||||
gdk_drag_set_action (drag, gdk_drag_get_suggested_action (drag));
|
||||
gdk_drag_set_selected_action (drag, gdk_drag_get_suggested_action (drag));
|
||||
else
|
||||
gdk_drag_set_action (drag, 0);
|
||||
gdk_drag_set_selected_action (drag, 0);
|
||||
|
||||
drag_x11->current_action = gdk_drag_get_selected_action (drag);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user