summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove GDestroyNotify casts in g_clear_pointer() usesg-clear-pointer-propagateErnestas Kulik2018-07-251-1/+1
| | | | | | | | | GLib master propagates argument types in g_clear_pointer(), which causes the usual function pointer casts to GDestroyNotify to trip compiler warnings. Additionally, this commit changes some cleanup functions where appropriate (wl_data_source_destroy -> gtk_primary_selection_source_destroy for struct gtk_primary_selection_source).
* dnd: Rename gtk_drag_begin_with_coordinatesMatthias Clasen2018-07-121-18/+14
| | | | | Now that the coordiate-less variant is gone, rename this back to the shorter gtk_drag_begin.
* gdk: Rename GdkDragContext to GdkDragMatthias Clasen2018-07-021-108/+97
| | | | | | | This is to go along with the newly introduced GdkDrop. This commit includes the necessary updates to the X11, Wayland and Broadway backends. Other backends have to be updated separately.
* dnd: Use a GtkPicture in gtk_dnd_set_icon_paintable()Benjamin Otte2018-06-191-3/+5
| | | | | | | We don't want to get the paintable scaled down to icon size. Also set can-shrink = FALSE to replicate GTK3 behavior with size requests.
* widget: Remove time argument from drag_data_get() vfuncBenjamin Otte2018-06-181-9/+1
|
* dnd: Remove unused time argumentsBenjamin Otte2018-06-181-20/+11
|
* dnd: Implement gtk_drag_get_source_widget() differentlyBenjamin Otte2018-06-181-17/+5
| | | | | Instead of keeping a list of source contexts, just use the current drag's info.
* dnd: Add gdk_event_get_drop()Benjamin Otte2018-06-181-64/+53
| | | | | | And remove gdk_event_get_drag_context(). All GTK code now only uses GdkDrop for dropping.
* dnd: Make drag-motion and drag-drop signals use GdkDropBenjamin Otte2018-06-181-22/+29
|
* dnd: Make drag-data-received use a GdkDropBenjamin Otte2018-06-181-4/+2
|
* dnd: Get rid of gtk_drag_finish()Benjamin Otte2018-06-181-21/+2
| | | | It's just a wrapper around gdk_drag_finish(), so use that one instead.
* dnd: Rename gdk_drop_finish() => gdk_drag_finish()Benjamin Otte2018-06-181-1/+1
| | | | | This is a simple rename, so that we can reintroduce gdk_drop_finish() with the GdkDrop object.
* drop: Move gdk_drop_read_async() to GdkDrop classBenjamin Otte2018-06-181-2/+2
|
* dnd: Fix up a commentTimm Bäder2018-06-181-1/+1
| | | | The below function does not take a GtkIconHelper anymore.
* dnd: Ref the GdkDrop during the DND operationBenjamin Otte2018-06-101-1/+2
| | | | It might go away if the DND takes too long otherwise...
* dnd: Remove gdk_drop_reply()Benjamin Otte2018-05-031-9/+2
| | | | It was only necessary for Motif DND, and we don't support that anymore.
* dnd: Remove gtk_drag_set_icon_surface()Benjamin Otte2018-03-261-36/+0
| | | | All users are gone. Use gtk_drag_set_icon_paintable() instead.
* Continue renaming window to surfaceAlexander Larsson2018-03-211-4/+4
| | | | This renames a lot of arguments, local variables and functions.
* GtkWidget: Start renaming widget->windowAlexander Larsson2018-03-201-5/+5
| | | | | | | | | | | | | | | This is an automated change doing these command: git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface git sed -f g gtk_widget_set_window gtk_widget_set_surface git sed -f g gtk_widget_get_window gtk_widget_get_surface git sed -f g gtk_widget_register_window gtk_widget_register_surface git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface git checkout NEWS*
* GdkSurface: Rename various functions and variablesAlexander Larsson2018-03-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an automatic rename of various things related to the window->surface rename. Public symbols changed by this is: GDK_MODE_WINDOW gdk_device_get_window_at_position gdk_device_get_window_at_position_double gdk_device_get_last_event_window gdk_display_get_monitor_at_window gdk_drag_context_get_source_window gdk_drag_context_get_dest_window gdk_drag_context_get_drag_window gdk_draw_context_get_window gdk_drawing_context_get_window gdk_gl_context_get_window gdk_synthesize_window_state gdk_surface_get_window_type gdk_x11_display_set_window_scale gsk_renderer_new_for_window gsk_renderer_get_window gtk_text_view_buffer_to_window_coords gtk_tree_view_convert_widget_to_bin_window_coords gtk_tree_view_convert_tree_to_bin_window_coords The commands that generated this are: git sed -f g "GDK window" "GDK surface" git sed -f g window_impl surface_impl (cd gdk; git sed -f g impl_window impl_surface) git sed -f g WINDOW_IMPL SURFACE_IMPL git sed -f g GDK_MODE_WINDOW GDK_MODE_SURFACE git sed -f g gdk_draw_context_get_window gdk_draw_context_get_surface git sed -f g gdk_drawing_context_get_window gdk_drawing_context_get_surface git sed -f g gdk_gl_context_get_window gdk_gl_context_get_surface git sed -f g gsk_renderer_get_window gsk_renderer_get_surface git sed -f g gsk_renderer_new_for_window gsk_renderer_new_for_surface (cd gdk; git sed -f g window_type surface_type) git sed -f g gdk_surface_get_window_type gdk_surface_get_surface_type git sed -f g window_at_position surface_at_position git sed -f g event_window event_surface git sed -f g window_coord surface_coord git sed -f g window_state surface_state git sed -f g window_cursor surface_cursor git sed -f g window_scale surface_scale git sed -f g window_events surface_events git sed -f g monitor_at_window monitor_at_surface git sed -f g window_under_pointer surface_under_pointer (cd gdk; git sed -f g for_window for_surface) git sed -f g window_anchor surface_anchor git sed -f g WINDOW_IS_TOPLEVEL SURFACE_IS_TOPLEVEL git sed -f g native_window native_surface git sed -f g source_window source_surface git sed -f g dest_window dest_surface git sed -f g drag_window drag_surface git sed -f g input_window input_surface git checkout NEWS* po-properties po docs/reference/gtk/migrating-3to4.xml
* GdkWindow -> GdkSurface initial type renameAlexander Larsson2018-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames the GdkWindow class and related classes (impl, backend subclasses) to surface. Additionally it renames related types: GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType, GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge This is an automatic conversion using the below commands: git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass git sed -f g GdkWindow GdkSurface git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2" git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE" git sed -f g "broadway_window" "broadway_surface" git sed -f g "BroadwayWindow" "BroadwaySurface" git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE" git sed -f g "wayland_window" "wayland_surface" git sed -f g "WaylandWindow" "WaylandSurface" git sed -f g "X11_WINDOW" "X11_SURFACE" git sed -f g "x11_window" "x11_surface" git sed -f g "X11Window" "X11Surface" git sed -f g "WIN32_WINDOW" "WIN32_SURFACE" git sed -f g "win32_window" "win32_surface" git sed -f g "Win32Window" "Win32Surface" git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE" git sed -f g "quartz_window" "quartz_surface" git sed -f g "QuartzWindow" "QuartzSurface" git checkout NEWS* po-properties
* image: Remove gtk_image_set_texture()Benjamin Otte2018-03-161-1/+1
| | | | gtk_image_get_paintable() is a perfect replacement, so use that one.
* image: Don't handle surfaces anymoreBenjamin Otte2018-03-161-1/+5
| | | | | | | Lots of special cases that are no longer needed because no code uses surfaces. Also remove the GdkCellRendererPixbuf:surface property.
* dnd: Make dnd icon API take a paintableBenjamin Otte2018-03-161-8/+8
| | | | ... instead of a texture.
* Drop method annotation for gtk_drag_cancel()Emmanuele Bassi2018-02-121-1/+1
| | | | | | | | | The other method annotations were removed in commit c306e448b32e. There is no introspected ABI change, as g-ir-scanner would just ignore the annotation. This eliminates the last warning when building GTK on Linux.
* Fix overzalous method annotations for drag and dropAlban Browaeys2018-02-121-8/+8
| | | | | | | | | | | | | | | | | | | | Functional revert of commit 9c4892f2915. Fixes introspection scanner warnings like: Warning: Gtk: gtk_drag_finish: Methods must belong to the same namespace as the class they belong to That is, the gtk_drag_* functions cannot be methods as they have a "GdkDragContext" as the instance parameter, and that is not a valid type for the Gtk namespace. This is not an introspected ABI change, as the generated introspection data ignores the annotation. Signed-off-by: Emmanuele Bassi <ebassi@gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=692152
* pointerfocus: Don't include gtk.hBenjamin Otte2018-02-081-13/+10
| | | | | Also fix up gtktypes.h to include the required glib.h for G_BEGIN_DECLS and gtkdnd.c to include missing includes.
* The big versioning cleanupMatthias Clasen2018-02-061-8/+0
| | | | | | | Remove all the old 2.x and 3.x version annotations. GTK+ 4 is a new start, and from the perspective of a GTK+ 4 developer all these APIs have been around since the beginning.
* Replace gdk_threads_add_timeout* with g_timeout_add()Emmanuele Bassi2018-02-031-3/+1
| | | | | | | | | | | | | | | The main GDK thread lock is not portable and deprecated. The only reason why gdk_threads_add_timeout() and gdk_threads_add_timeout_full() exist is to allow invoking a callback with the GDK lock held, in case 3rd party libraries still use the deprecated gdk_threads_enter()/gdk_threads_leave() API. Since we're removing the GDK lock, and we're releasing a new major API, such code cannot exist any more; this means we can use the GLib API for installing timeout callbacks. https://bugzilla.gnome.org/show_bug.cgi?id=793124
* dnd: Drop docs that are no longer relevantMatthias Clasen2017-12-301-22/+0
| | | | | We no longer take an event as argument, so no need to explain how to obtain a suitable event.
* dnd: Get rid of IPC widgetsBenjamin Otte2017-12-161-103/+9
| | | | | | | Instead, pass the source window to gdk_drag_begin(). Also make Wayland use this window instead of the one under the pointer (though those 2 Windows are most likely the same anyway).
* dnd: Remove unused functionBenjamin Otte2017-12-161-72/+0
| | | | | | | | | | | The function was referencing itself in ways that bamboozled gcc: static void foo (void) { g_signal_handlers_disconnect_by_func (NULL, foo, NULL); } Well done, function, you get your own commit!
* x11: Use gdk_drag_context_get_display()Benjamin Otte2017-12-161-1/+1
|
* dnd: Remove handler for nonexisting signalBenjamin Otte2017-12-151-40/+0
| | | | The signal has been gone since e3e9bf4bea3307e9d0c6728d82f04994b069005f
* Drop gdk_atom_internMatthias Clasen2017-12-131-4/+4
| | | | | Atoms are just interned strings now, so we can just use g_intern_string.
* dnd: Remove gdk_drag_get_selection()Benjamin Otte2017-12-141-2/+0
| | | | | | | | | Without selections, drags can't have them either. Also included is removing the selection from GtkSelectionData. Includes a bunch of crude cleanups to Wayland code that no longer has to care about selection atoms.
* gtk: Avoid some event copiesCarlos Garnacho2017-12-141-1/+1
| | | | Those places can do with an extra reference.
* gtk: s/gdk_event_free/g_object_unref/Carlos Garnacho2017-12-141-1/+1
|
* gdk: Remove gdk_selection_convert()Benjamin Otte2017-12-141-1/+0
| | | | It's not used anymore.
* dnd: Only send DELETE request on X11Benjamin Otte2017-12-131-20/+1
| | | | This is Xdnd-specific and doesn't need to happen elsewhere.
* xxx: don't claim dnd selectionBenjamin Otte2017-12-131-18/+0
|
* x11: Move selection handling to GDKBenjamin Otte2017-12-131-18/+0
| | | | | Instead of claiming the selection in GTK, claim it in the X11 dnd code. Also handle SelectionRequest and SelectionClear X events there.
* dnd: Pass content to gdk_drag_begin()Benjamin Otte2017-12-131-1/+155
| | | | | | | | | | | | | | | | Instead of just passing the GdkContentFormats, we are now passing the GdkContentProvider to gdk_drag_begin(). This means that GDK itself can now query the data from the provider directly instead of having to send selection events. Use this to provide the private API gdk_drag_context_write() that allows backends to pass an output stream that this data will be written to. Implement this as the mechanism for providing drag data on Wayland. And to make this all work, implement a content provider named GtkDragContent that is implemented by reverting to the old DND drag-data-get machinery inside GTK, so for widgets everything works just like before.
* dnd: Pass device, not eventBenjamin Otte2017-12-121-31/+25
| | | | | You don't start a dnd operation with a device, you start it with an event.
* dnd: No longer allow passing -1Benjamin Otte2017-12-121-38/+12
| | | | Nobody ever does that and special cases are evil.
* dnd: Remove button argument from drag_begin()Benjamin Otte2017-12-121-88/+1
| | | | It was unused.
* Set a style class for drag iconsMatthias Clasen2017-12-101-3/+1
| | | | | | This lets us use the new icon-size machinery to ensure we don't have tiny drag icons when using named icons.
* gdk: Remove gdk_drag_manage_dnd()Benjamin Otte2017-12-111-4/+2
| | | | | | | Instead, pass the actions as part of gdk_drag_begin() and insist DND is always managed. A new side effect is that gdk_drag_begin() can now return %NULL.
* dnd: No point in determining the keyboardBenjamin Otte2017-12-111-9/+2
| | | | We only use the pointer.
* dnd: Pass dx/dy instead of x_root/y_rootBenjamin Otte2017-12-111-9/+25
| | | | | This way, we don't need root coordinates when computing the dnd start position.