Commit Graph

40 Commits

Author SHA1 Message Date
Benjamin Otte
aa1f0cfd4f dnd: Remove GdkDragContext.is_source
All drag contexts are sources these days, the other ones are GdkDrop
now.
2018-06-18 23:49:53 +02:00
Benjamin Otte
316bd6a333 dnd: Add gdk_drop_finish()
and move the vfunc into GdkDrop.
2018-06-18 23:49:20 +02:00
Benjamin Otte
a05af1f0f3 dnd: Move the gdk_drag_status() function
It's now gdk_drop_status().

Also clarify the intended semantics.
2018-06-18 23:49:19 +02:00
Benjamin Otte
8366ef71c0 dnd: Remove gdk_drop_reply()
It was only necessary for Motif DND, and we don't support that anymore.
2018-05-03 01:31:40 +02:00
Benjamin Otte
fb53568c04 gdk: Remove gdk_drag_grop_succeeded()
It's unused and most backends don't implement it.
2018-05-03 01:31:39 +02:00
Benjamin Otte
4aaeb7de19 dnd: Make GdkDragContext::device a (construct-only) property
Also remove gdk_drag_context_set_device() and insist on backends using
the property.
2018-04-27 14:32:28 +02:00
Alexander Larsson
9a7e721181 GdkSurface: Rename various functions and variables
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
2018-03-20 12:05:26 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
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
2018-03-20 11:40:08 +01:00
Christoph Reiter
26e2af26ed macos: export gdk_quartz_drag_source_context()
It's used in the gtk dnd code but not exported in gdk.
Append a "_libgtk_only" suffix as with other internal exports and
export the symbol.

See #32
2018-03-01 14:36:44 +01:00
Christoph Reiter
94d6d56913 macos: Fix gdk_quartz_drag_context_get_dragging_info_libgtk_only symbol export
The header got included without config.h being included first which resulted in the
wrong _GDK_EXTERN macro being used. As a result some symbols weren't exported
and starting a DnD action would crash in the linker.

This patch adds config.h includes in all places where clang complained about
_GDK_EXTERN redefinitions.

See #32 for more info.
2018-02-27 20:04:34 +01:00
Benjamin Otte
3e0fab6b93 dnd: Remove 2 vfuncs that aren't needed
They're only used inside the X11 backend, and the backend can just call
its own function.
2018-01-31 13:21:26 +01:00
Benjamin Otte
b49a9b9933 dnd: Remove gdk_drag_get_selection()
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.
2017-12-14 04:39:22 +01:00
Benjamin Otte
218efa62ef dnd: Pass dx/dy instead of x_root/y_root
This way, we don't need root coordinates when computing the dnd start
position.
2017-12-11 01:02:31 +01:00
Benjamin Otte
0d31eb8670 dnd: Add gdk_drag_context_get_display()
Also turn it into a readable, construct-only property.

Every GDK object should have this. (Apart from GdkDisplay, obviously.)
2017-12-10 01:09:14 +01:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Matthias Clasen
f8cad19829 dnd: Drop GdkScreen from apis
Drop the screen argument from gdk_dnd_find_window_for_screen
and rename the function to gdk_dnd_find_window. The screen
argument does not add anything here since the drag context
is already tied to the display. Update all backends, and
update all callers.
2017-10-31 10:18:10 -04:00
Jonas Ådahl
1a4f000f3b gdk/dnd: Don't use default display when getting cursor
Always associate a drag context with a GdkDisplay and use that when
getting a cursor for a given action.

If we don't do this, dragging on a window that doesn't use the default
display will make us use cursors from the wrong display.

https://bugzilla.gnome.org/show_bug.cgi?id=765565
2016-04-26 23:03:24 +08:00
Matthias Clasen
268c7a3e44 gdk: Allow passing the start coordinates in drag_begin
Add a variant of gdk_drag_begin that takes the start position
in addition to the device. All backend implementation have been
updated to accept (and ignore) the new arguments.

Subsequent commits will make use of the data in some backends.
2015-12-13 10:39:43 -05:00
Jesse van den Kieboom
b57bef989a quartz-dnd: make sure to set source window
https://bugzilla.gnome.org/show_bug.cgi?id=658722
2014-08-27 20:57:17 +02:00
John Ralls
f86dc163b9 Quartz: Set the drag context target list
So that gdk_drag_context_list_targets() actually returns something.
2013-10-10 15:37:27 -07:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
John Ralls
cfaed624be Update quartz to reflect deletion of GdkNativeWindow and client_message functions. 2011-02-01 13:53:00 -08:00
Kristian Rietveld
0840b25165 quartz: fix some more typos 2010-12-23 14:17:42 +01:00
Kristian Rietveld
1e814709d7 quartz: fix typo 2010-12-23 14:17:41 +01:00
Kristian Rietveld
caa9794af8 quartz: Clean up header files, use same arrangement as X11 backend 2010-12-23 14:17:41 +01:00
Kristian Rietveld
b2844cb48b quartz: Make GdkQuartzDisplay compile 2010-12-22 17:47:02 +01:00
Kristian Rietveld
71404825c3 quartz: fix up GdkDragContext conversion 2010-12-22 17:47:01 +01:00
Matthias Clasen
25271f5e9a Implement dnd vtables for quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen
064bfceaad Convert all gdk_window methods to vtable calls in the quartz backend 2010-12-22 17:46:59 +01:00
Matthias Clasen
c53ec081ce Add vtables for DND
This commit hides GdkDragContext and GdkDragContextClass, adds
vfuncs for most drag context functionality, and turns the X11 DND
implementation into GdkDragContextX11. We also add vfuncs to
GdkDisplay for gdk_drag_get_protocol and to GdkWindow for
gdk_drag_begin, and implemenet them for X11.
Other backends need similar treatment and are broken now.
2010-12-21 12:06:56 -05:00
Javier Jardón
9c3d1080d6 Do not use deprecated gdk_display_get_core_pointer()
Use gdk_device_manager_get_client_pointer() instead
2010-09-22 03:42:15 +02:00
Kristian Rietveld
53fbf2a30a Update Quartz DnD code to set device on DnD events 2010-06-30 10:56:44 +02:00
Kristian Rietveld
03a313d2a9 Implement gdk_drag_context_{get,set}_device in Quartz backend 2010-06-30 10:56:44 +02:00
Javier Jardón
8c46ef830b Remove deprecated code from GdkDnd 2010-05-03 01:45:00 +02:00
Nicola Fontana
1e1131c959 Do not use static GTypeInfo and GInterfaceInfo
Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.

https://bugzilla.gnome.org/show_bug.cgi?id=600158
2009-11-06 01:21:09 +01:00
Kristian Rietveld
a4145bfeef Bug 588449 - DnD doesn't work on GDK/Quartz
Patch from Paul Davis.  This gets the basics of drag and drop properly
working on Mac OS X.
2009-09-30 15:07:37 +02:00
Richard Hult
5cb6747339 Redo the fix for bug #492117, by adding a getter for the private drag
2007-11-01  Richard Hult  <richard@imendio.com>

	* gdk/quartz/GdkQuartzWindow.c:
	* gdk/quartz/GdkQuartzWindow.h:
	* gdk/quartz/gdkdnd-quartz.c:
	* gdk/quartz/gdkquartz.h:
	* gtk/gtkdnd-quartz.c: Redo the fix for bug #492117, by adding a
	getter for the private drag context info so we don't need to
	expose so much in the public quartz header file.

svn path=/trunk/; revision=18959
2007-11-01 08:45:30 +00:00
Richard Hult
ce823f5b28 Add more stubs.
2006-03-27  Richard Hult  <richard@imendio.com>

	* gdk/quartz: Add more stubs.
2006-03-27 10:47:29 +00:00
Anders Carlsson
6b1510bf23 Add the GDK part of the DND implementation.
2006-03-21  Anders Carlsson  <andersca@imendio.com>

        * gdk/quartz/GdkQuartzWindow.c:
        (drag_operation_to_drag_action):
        (drag_action_to_drag_operation):
        (update_context_from_dragging_info):
        (-[GdkQuartzWindow draggingEntered:]):
        (-[GdkQuartzWindow draggingEnded:]):
        (-[GdkQuartzWindow draggingExited:]):
        (-[GdkQuartzWindow draggingUpdated:]):
        (-[GdkQuartzWindow performDragOperation:]):
        (-[GdkQuartzWindow wantsPeriodicDraggingUpdates]):
        (-[GdkQuartzWindow draggedImage:endedAt:operation:]):
        * gdk/quartz/gdkdnd-quartz.c:
        (gdk_drag_context_finalize):
        (gdk_drag_context_init):
        (gdk_drag_context_class_init):
        (gdk_drag_begin):
        (gdk_drag_status):
        Add the GDK part of the DND implementation.

        * gdk/quartz/Makefile.am:
        Add some missing headers.

        * gdk/quartz/gdkdrawable-quartz.h:
        * gdk/quartz/gdkprivate-quartz.h:
        * gdk/quartz/gdkquartz.h:
        * gdk/quartz/gdkwindow-quartz.c:
        (gdk_quartz_window_get_nsview):
        New function, for use by the GTK part of the DND implementation
2006-03-21 08:02:17 +00:00
Anders Carlsson
1097260aa7 Add quartz backend.
2005-11-21  Anders Carlsson  <andersca@imendio.com>

        * configure.in:
        * gtk/Makefile.am:
        * gdk/Makefile.am:
	* gdk/quartz/*:
	Add quartz backend.

        * docs/tools/Makefile.am:
	Only build docshooter when the X11 backend is used.

        * gtk/gtkplug-stub.c:
	Include gtkplug.h here.

        * gtk/gtksocket-stub.c:
	Include gtksocket.h here.
2005-11-22 10:03:32 +00:00