diff options
author | Federico Mena Quintero <federico@gnome.org> | 2012-12-04 12:44:46 -0600 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2012-12-04 12:44:46 -0600 |
commit | 221ea9d4c531f793a7a7947877db6faacc91373e (patch) | |
tree | 8c247af82df759d10a53a564d40ba058cb82f807 | |
parent | f46b26d245d672e5b1d1954f970be91373822285 (diff) | |
download | gtk+-221ea9d4c531f793a7a7947877db6faacc91373e.tar.gz |
New signal drag-perform-drop
The caller is supposed to take action with the specified URIs.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
-rw-r--r-- | gtk/gtkmarshalers.list | 1 | ||||
-rw-r--r-- | gtk/gtkplacessidebar.c | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list index e94fb15aa1..d39a768e5c 100644 --- a/gtk/gtkmarshalers.list +++ b/gtk/gtkmarshalers.list @@ -123,3 +123,4 @@ OBJECT:OBJECT,INT,INT VOID:POINTER,POINTER,POINTER,POINTER,STRING VOID:OBJECT,STRING,POINTER,POINTER INT:INT +VOID:POINTER,STRING,INT diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 80cbf2286a..f90bf5c91d 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -152,6 +152,10 @@ struct _GtkPlacesSidebarClass { int *action); GdkDragAction (* drag_action_ask) (GtkPlacesSidebar *sidebar, GdkDragAction actions); + void (* drag_perform_drop) (GtkPlacesSidebar *sidebar, + GList *uris, + const char *drop_uri, + GdkDragAction action); }; enum { @@ -197,6 +201,7 @@ enum { SHOW_ERROR_MESSAGE, DRAG_ACTION_REQUESTED, DRAG_ACTION_ASK, + DRAG_PERFORM_DROP, LAST_SIGNAL, }; @@ -351,6 +356,18 @@ emit_drag_action_ask (GtkPlacesSidebar *sidebar, return ret_action; } +static void +emit_drag_perform_drop (GtkPlacesSidebar *sidebar, + GList *uris, + const char *drop_uri, + GdkDragAction action) +{ + g_signal_emit (sidebar, places_sidebar_signals[DRAG_PERFORM_DROP], 0, + uris, + drop_uri, + action); +} + static gint get_icon_size (GtkPlacesSidebar *sidebar) { @@ -3761,6 +3778,18 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class) _gtk_marshal_INT__INT, G_TYPE_INT, 1, G_TYPE_INT); + + places_sidebar_signals [DRAG_ACTION_ASK] = + g_signal_new (I_("drag-perform-drop"), + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GtkPlacesSidebarClass, drag_perform_drop), + NULL, NULL, + _gtk_marshal_VOID__POINTER_STRING_INT, + G_TYPE_NONE, 3, + G_TYPE_POINTER, /* FIXME: (GList *) is there something friendlier to language bindings? */ + G_TYPE_STRING, + G_TYPE_INT); } static void |