gint y,
guint time);
static void gtk_calendar_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time);
+ GdkDrop *drop);
static gboolean gtk_calendar_drag_drop (GtkWidget *widget,
GdkDragContext *context,
gint x,
}
static void
-gtk_calendar_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_calendar_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkCalendarPrivate *priv = GTK_CALENDAR (widget)->priv;
priv->drag_highlight = 0;
gtk_drag_unhighlight (widget);
-
}
static gboolean
gint y,
guint time);
static void gtk_entry_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time);
+ GdkDrop *drop);
static void gtk_entry_drag_data_received (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection_data,
}
static void
-gtk_entry_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_entry_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkEntry *entry = GTK_ENTRY (widget);
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
gint y,
guint time);
static void gtk_expander_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time);
+ GdkDrop *drop);
static void gtk_expander_add (GtkContainer *container,
GtkWidget *widget);
}
static void
-gtk_expander_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_expander_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkExpander *expander = GTK_EXPANDER (widget);
GtkExpanderPrivate *priv = gtk_expander_get_instance_private (expander);
static void
file_list_drag_begin_cb (GtkWidget *widget,
- GdkDragContext *context,
+ GdkDrop *drop,
GtkFileChooserWidget *impl)
{
gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (impl->priv->places_sidebar),
TRUE,
- context);
+ drop);
}
/* Disable the normal tree drag motion handler, it makes it look like you're
static void
file_list_drag_end_cb (GtkWidget *widget,
- GdkDragContext *context,
+ GdkDrop *drop,
gpointer user_data)
{
GtkFileChooserWidget *impl;
impl = GTK_FILE_CHOOSER_WIDGET (user_data);
gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (impl->priv->places_sidebar),
FALSE,
- context);
+ drop);
}
/* Sensitizes the "Copy file’s location" and other context menu items if there is actually
/* Target side drag signals */
static void gtk_icon_view_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time);
+ GdkDrop *drop);
static gboolean gtk_icon_view_drag_motion (GtkWidget *widget,
GdkDragContext *context,
gint x,
/* Target side drag signals */
static void
-gtk_icon_view_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_icon_view_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkIconView *icon_view;
const GtkAllocation *allocation,
int baseline);
static void gtk_list_box_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time_);
+ GdkDrop *drop);
static void gtk_list_box_activate_cursor_row (GtkListBox *box);
static void gtk_list_box_toggle_cursor_row (GtkListBox *box);
static void gtk_list_box_move_cursor (GtkListBox *box,
}
static void
-gtk_list_box_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time_)
+gtk_list_box_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
gtk_list_box_drag_unhighlight_row (GTK_LIST_BOX (widget));
}
gint y,
guint time);
static void gtk_notebook_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time);
+ GdkDrop *drop);
static gboolean gtk_notebook_drag_drop (GtkWidget *widget,
GdkDragContext *context,
gint x,
}
static void
-gtk_notebook_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_notebook_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
static GdkDragAction
emit_drag_action_requested (GtkPlacesSidebar *sidebar,
- GdkDragContext *context,
+ GdkDrop *drop,
GFile *dest_file,
GList *source_file_list)
{
GdkDragAction ret_action = 0;
g_signal_emit (sidebar, places_sidebar_signals[DRAG_ACTION_REQUESTED], 0,
- context, dest_file, source_file_list, &ret_action);
+ drop, dest_file, source_file_list, &ret_action);
return ret_action;
}
static gboolean
check_valid_drop_target (GtkPlacesSidebar *sidebar,
GtkSidebarRow *row,
- GdkDragContext *context)
+ GdkDrop *drop)
{
GtkPlacesSidebarPlaceType place_type;
GtkPlacesSidebarSectionType section_type;
else
{
/* Dragging a file */
- if (context)
+ if (drop)
{
if (uri != NULL)
{
dest_file = g_file_new_for_uri (uri);
- drag_action = emit_drag_action_requested (sidebar, context, dest_file, sidebar->drag_list);
+ drag_action = emit_drag_action_requested (sidebar, drop, dest_file, sidebar->drag_list);
valid = drag_action > 0;
g_object_unref (dest_file);
}
else
{
- /* We cannot discern if it is valid or not because there is not drag
- * context available to ask the client.
+ /* We cannot discern if it is valid or not because there is not drop
+ * available to ask the client.
* Simply make insensitive the drop targets we know are not valid for
* files, that are the ones remaining.
*/
static void
update_possible_drop_targets (GtkPlacesSidebar *sidebar,
gboolean dragging,
- GdkDragContext *context)
+ GdkDrop *drop)
{
GList *rows;
GList *l;
for (l = rows; l != NULL; l = l->next)
{
- sensitive = !dragging || check_valid_drop_target (sidebar, GTK_SIDEBAR_ROW (l->data), context);
+ sensitive = !dragging || check_valid_drop_target (sidebar, GTK_SIDEBAR_ROW (l->data), drop);
gtk_widget_set_sensitive (GTK_WIDGET (l->data), sensitive);
}
static void
start_drop_feedback (GtkPlacesSidebar *sidebar,
GtkSidebarRow *row,
- GdkDragContext *context)
+ GdkDrop *drop)
{
if (sidebar->drag_data_info != DND_GTK_SIDEBAR_ROW)
{
sidebar->drop_state = DROP_STATE_NEW_BOOKMARK_ARMED;
}
- update_possible_drop_targets (sidebar, TRUE, context);
+ update_possible_drop_targets (sidebar, TRUE, drop);
}
static void
guint time,
gpointer user_data)
{
+ GdkDrop *drop = GDK_DROP (context);
gint action;
GtkListBoxRow *row;
GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);
goto out;
/* Nothing to do if the target is not valid drop destination */
- if (!check_valid_drop_target (sidebar, GTK_SIDEBAR_ROW (row), context))
+ if (!check_valid_drop_target (sidebar, GTK_SIDEBAR_ROW (row), drop))
goto out;
if (sidebar->drag_data_received &&
{
GFile *dest_file = g_file_new_for_uri (drop_target_uri);
- action = emit_drag_action_requested (sidebar, context, dest_file, sidebar->drag_list);
+ action = emit_drag_action_requested (sidebar, drop, dest_file, sidebar->drag_list);
g_object_unref (dest_file);
}
}
out:
- start_drop_feedback (sidebar, GTK_SIDEBAR_ROW (row), context);
+ start_drop_feedback (sidebar, GTK_SIDEBAR_ROW (row), drop);
g_signal_stop_emission_by_name (sidebar->list_box, "drag-motion");
success = FALSE;
- if (!check_valid_drop_target (sidebar, GTK_SIDEBAR_ROW (target_row), context))
+ if (!check_valid_drop_target (sidebar, GTK_SIDEBAR_ROW (target_row), GDK_DROP (context)))
goto out;
if (sidebar->drag_data_info == DND_GTK_SIDEBAR_ROW)
* we build new drag data in drag_data_received.
*/
static void
-drag_leave_callback (GtkWidget *widget,
- GdkDragContext *context,
- guint time,
- gpointer user_data)
+drag_leave_callback (GtkWidget *widget,
+ GdkDrop *drop,
+ gpointer user_data)
{
GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);
if (sidebar->drop_state != DROP_STATE_NEW_BOOKMARK_ARMED_PERMANENT)
{
- update_possible_drop_targets (sidebar, FALSE, context);
+ update_possible_drop_targets (sidebar, FALSE, drop);
gtk_sidebar_row_hide (GTK_SIDEBAR_ROW (sidebar->new_bookmark_row), FALSE);
sidebar->drop_state = DROP_STATE_NORMAL;
}
/*
* GtkPlacesSidebar::drag-action-requested:
* @sidebar: the object which received the signal.
- * @context: (type Gdk.DragContext): #GdkDragContext with information about the drag operation
+ * @drop: (type Gdk.Drop): #GdkDrop with information about the drag operation
* @dest_file: (type Gio.File): #GFile with the tentative location that is being hovered for a drop
* @source_file_list: (type GLib.List) (element-type GFile) (transfer none):
* List of #GFile that are being dragged
NULL, NULL,
_gtk_marshal_INT__OBJECT_OBJECT_POINTER,
G_TYPE_INT, 3,
- GDK_TYPE_DRAG_CONTEXT,
+ GDK_TYPE_DROP,
G_TYPE_OBJECT,
G_TYPE_POINTER /* GList of GFile */ );
* gtk_places_sidebar_set_drop_targets_visible:
* @sidebar: a places sidebar.
* @visible: whether to show the valid targets or not.
- * @context: drag context used to ask the source about the action that wants to
+ * @drop: #GdkDrop used to ask the source about the action that wants to
* perform, so hints are more accurate.
*
* Make the GtkPlacesSidebar show drop targets, so it can show the available
void
gtk_places_sidebar_set_drop_targets_visible (GtkPlacesSidebar *sidebar,
gboolean visible,
- GdkDragContext *context)
+ GdkDrop *drop)
{
if (visible)
{
sidebar->drop_state = DROP_STATE_NEW_BOOKMARK_ARMED_PERMANENT;
- start_drop_feedback (sidebar, NULL, context);
+ start_drop_feedback (sidebar, NULL, drop);
}
else
{
gint n);
void gtk_places_sidebar_set_drop_targets_visible (GtkPlacesSidebar *sidebar,
gboolean visible,
- GdkDragContext *context);
+ GdkDrop *drop);
gboolean gtk_places_sidebar_get_show_trash (GtkPlacesSidebar *sidebar);
void gtk_places_sidebar_set_show_trash (GtkPlacesSidebar *sidebar,
gboolean show_trash);
}
static void
-gtk_stack_switcher_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_stack_switcher_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkStackSwitcher *self = GTK_STACK_SWITCHER (widget);
/* Target side drag signals */
static void gtk_text_view_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time);
+ GdkDrop *drop);
static gboolean gtk_text_view_drag_motion (GtkWidget *widget,
GdkDragContext *context,
gint x,
}
static void
-gtk_text_view_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_text_view_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkTextView *text_view;
GtkTextViewPrivate *priv;
/* Target side drag signals */
static void gtk_tree_view_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time);
+ GdkDrop *drop);
static gboolean gtk_tree_view_drag_motion (GtkWidget *widget,
GdkDragContext *context,
gint x,
}
static void
-gtk_tree_view_drag_leave (GtkWidget *widget,
- GdkDragContext *context,
- guint time)
+gtk_tree_view_drag_leave (GtkWidget *widget,
+ GdkDrop *drop)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkWidgetClass, drag_leave),
NULL, NULL,
- _gtk_marshal_VOID__OBJECT_UINT,
- G_TYPE_NONE, 2,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_UINT);
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GDK_TYPE_DROP);
/**
* GtkWidget::drag-begin:
/* Target side drag signals */
void (* drag_leave) (GtkWidget *widget,
- GdkDragContext *context,
- guint time_);
+ GdkDrop *drop);
gboolean (* drag_motion) (GtkWidget *widget,
GdkDragContext *context,
gint x,
}
static void
-toolbar_drag_leave (GtkToolbar *toolbar,
- GdkDragContext *context,
- guint time,
- gpointer null)
+toolbar_drag_leave (GtkToolbar *toolbar,
+ GdkDrop *drop,
+ gpointer null)
{
if (drag_item)
{