diff options
author | Benjamin Otte <otte@redhat.com> | 2017-11-14 22:32:23 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-11-15 19:07:17 +0100 |
commit | 5a1a11bcde0acacb455fc3df10d6bd8f67f62850 (patch) | |
tree | 859a7f528af6d5407eed89fd127914ac3103f7c9 /gtk/gtkdragsource.c | |
parent | 7efc5a1558449194caedaae5f27e4c9c48d88ab7 (diff) | |
download | gtk+-5a1a11bcde0acacb455fc3df10d6bd8f67f62850.tar.gz |
dnd: Make GtkDragDest and GtkDragSource use GtkTargetList
This gets rid of GtkTargetEntry in the API and consistently uses
GtkTargetList.
Diffstat (limited to 'gtk/gtkdragsource.c')
-rw-r--r-- | gtk/gtkdragsource.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gtk/gtkdragsource.c b/gtk/gtkdragsource.c index 6ed5e942d9..b60f984f57 100644 --- a/gtk/gtkdragsource.c +++ b/gtk/gtkdragsource.c @@ -125,20 +125,18 @@ gtk_drag_source_site_destroy (gpointer data) * gtk_drag_source_set: (method) * @widget: a #GtkWidget * @start_button_mask: the bitmask of buttons that can start the drag - * @targets: (allow-none) (array length=n_targets): the table of targets - * that the drag will support, may be %NULL - * @n_targets: the number of items in @targets + * @targets: (allow-none): the targets that the drag will support, + * may be %NULL * @actions: the bitmask of possible actions for a drag from this widget * * Sets up a widget so that GTK+ will start a drag operation when the user * clicks and drags on the widget. The widget must have a window. */ void -gtk_drag_source_set (GtkWidget *widget, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +gtk_drag_source_set (GtkWidget *widget, + GdkModifierType start_button_mask, + GtkTargetList *targets, + GdkDragAction actions) { GtkDragSourceSite *site; @@ -179,7 +177,10 @@ gtk_drag_source_set (GtkWidget *widget, site->start_button_mask = start_button_mask; - site->target_list = gtk_target_list_new (targets, n_targets); + if (targets) + site->target_list = gtk_target_list_ref (targets); + else + site->target_list = NULL; site->actions = actions; } |