Commit Graph

21 Commits

Author SHA1 Message Date
Robert Ancell
2b6162116d Fix docstring errors with drag and drop code 2020-01-13 12:30:17 +13:00
Matthias Clasen
eab6df31ac dragdest: Allow denying drops asynchronously
Add an api to deny a drop, this is meant to be used
when delaying the decision on whether to accept a
drop until after reading the data.
2020-01-08 18:48:23 -05:00
Matthias Clasen
579d8e427b Drop gtk_drag_(un)highlight 2020-01-08 18:48:22 -05:00
Matthias Clasen
508570864d Remove gtk_drop_target_get_target
Now that drop targets are event controllers,
we can just use gtk_event_controller_get_widget.
Update all callers.
2020-01-08 18:48:21 -05:00
Matthias Clasen
e9067ae2db Replace gtk_drop_target_attach/detach
Since drop targets are now just event controller,
gtk_widget_add/remove_controller works just fine
for them.
2020-01-08 18:48:21 -05:00
Matthias Clasen
1262184269 droptarget: Drop the track-motion property
It does not have any effect anymore.

Update all callers
2020-01-08 18:48:20 -05:00
Matthias Clasen
46f42fc53d droptarget: Drop defaults flags
These no longer have any effect.

Update all callers.
2020-01-08 18:48:20 -05:00
Matthias Clasen
1a3eeb1233 Drop GTK_DEST_DEFAULT_HIGHLIGHT
Redo highlight handling slightly. GtkDropTarget now has
a ::armed property that can be tracked to do custom highlighting,
and we always add the dnd style class to armed drop sites.
2020-01-08 18:48:20 -05:00
Matthias Clasen
19ee9b4c57 Remove gdk_drag_get_data
This is not used anymore, so we can remove it,
and the GtkDropTarget::drag-data-received signal
that it emits.
2020-01-08 18:48:20 -05:00
Matthias Clasen
c290bd6367 Add an async read function for selection
This is meant as a replacement for ::drag-data-received
in cases where a #GtkSelectionData object is still needed,
such as when using GtkTreeModel DND support.
2020-01-08 18:48:20 -05:00
Matthias Clasen
853063bea7 Remove old drag dest api 2020-01-08 18:48:20 -05:00
Matthias Clasen
69e3fee5e2 Move some remaining api over 2020-01-08 18:48:20 -05:00
Matthias Clasen
6dc8fc3a4d Add a GtkDropTarget object
Add an explicit GtkDropTarget object, and move the destination-side
DND signals here. The object is used by connecting to its signals
and attaching it to a widget with gtk_drop_target_attach().
2020-01-08 18:48:20 -05:00
Benjamin Otte
b00609c21c dnd: Make drag-motion and drag-drop signals use GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
5b0a6a52c1 dnd: Get rid of gtk_drag_finish()
It's just a wrapper around gdk_drag_finish(), so use that one instead.
2018-06-18 23:49:20 +02:00
Benjamin Otte
7426f1a16b gdkcontentformats: Change the matching API
Instead of having just one function that has the gtype and mime type as
out arguments, have 3 functions: 1 that finds any match, 1 that finds a
GType match and one for a mime type match.

This makes the API way more convenient to use.
2017-12-03 05:46:47 +01:00
Rico Tzschichholz
2d797dd816 Fix some parameter name mismatches to make g-ir-scanner happier 2017-11-28 15:24:49 +01:00
Benjamin Otte
9a6ec4e959 contentformats: Rename GtkTargetList
It's now called GdkContentsFormat
2017-11-20 23:12:33 +01:00
Benjamin Otte
5a1a11bcde dnd: Make GtkDragDest and GtkDragSource use GtkTargetList
This gets rid of GtkTargetEntry in the API and consistently uses
GtkTargetList.
2017-11-15 19:07:17 +01:00
Benjamin Otte
380494c1d7 API: Remove gtk_drag_dest_set_proxy()
Proxies were only used by GtkSocket.
2016-10-16 18:17:21 +02:00
Matthias Clasen
6ac7b54378 dnd: Move GtkDragDest to a separate file
This follows what was done for GtkDragSource in
415030d25f and shaves another
500 lines off gtkdnd.c.
2016-03-25 15:37:20 -04:00