Commit Graph

105 Commits

Author SHA1 Message Date
Alexander Larsson
3dce0dcca7 GdkSurface: Rename lots of stuff from window->surface
Mostly these are internal things, but the major public change is
that event.window is now event.surface.
2018-03-20 15:14:10 +01: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
Matthias Clasen
4c150d8eb5 The big versioning cleanup
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.
2018-02-06 01:16:32 -05:00
Matthias Clasen
ca2a7c1efd Document more structs 2017-12-26 14:39:24 -05:00
Benjamin Otte
52b1a46549 device: Make axis label a regular string
Atoms are about to die.
2017-12-14 13:35:32 +01:00
Matthias Clasen
84eaf3da7d Drop atom-related cast macros
These don't really add anything, just drop them.
2017-12-13 23:47:02 -05:00
Matthias Clasen
7e40fcc344 Drop the ::device-manager property
Not used for anything anymore.
2017-11-25 11:04:15 -05:00
Matthias Clasen
a4cd4535dc Don't mention GdkDeviceManager in docs
It is going away.
2017-11-25 11:04:14 -05:00
Matthias Clasen
a129053ed9 gdk: Use G_PARAM_SPEC_STATIC_STRINGS throughout
This avoids some string copies at startup.
2017-11-17 21:38:08 -05:00
Matthias Clasen
a3cffa5072 Drop GdkScreen from GdkDevice apis
Returning the screen does not add anything here and
GdkScreen is going away.
2017-10-31 12:30:38 -04:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Carlos Garnacho
44cb3ccfa1 gdk: Remove motion hints
Motion hints are now literally a thing of the past. Everything should be
using the full motion event stream.
2017-09-19 18:40:51 +02:00
Matthias Clasen
127922cf44 Stop passing root window to gdk_device_query_state
The backends do the right thing now.
2017-08-11 15:45:24 -04:00
Matthias Clasen
c409fca703 Drop root windows from some internal apis
_gdk_device_query_state was needlessly shuffling
root windows around.
2017-08-11 15:45:23 -04:00
Matthias Clasen
cbe1337aa1 Revert "Remove gdk_device_grab/ungrab from the API"
This reverts commit efc37d0855.

Turns out we need to clean up the dnd code some more, first.
2016-10-25 21:24:37 -04:00
Matthias Clasen
efc37d0855 Remove gdk_device_grab/ungrab from the API
These are still used in a few places internally,
so make them private.
2016-10-25 20:03:34 -04:00
Alexander Larsson
70935f0952 Drop support for offscreen GdkWindows
These complicate a lot of GdkWindow internals to implement features
that not a lot of apps use, and will be better achieved using gsk.
So, we just drop it all.
2016-10-25 09:54:37 +02:00
Benjamin Otte
ed30f271f5 gdk: Insist axis.min_value < axis.max_value
Remove fallback code that would substitute screen size otherwise.
2016-10-16 18:17:21 +02:00
Benjamin Otte
2033b06cb6 gdk: Require passing screen size to translate_screen_coord() 2016-10-16 18:17:21 +02:00
Carlos Garnacho
7e11fcaa18 gdk: Fix GdkDevice::tool-changed signal marshaller
GdkDeviceTool is an object, not a boxed type.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-19 23:56:58 -04:00
Matthias Clasen
967e2e0cd3 Minor doc cleanup
gtk-doc is smart about plural links, nowadays.
2016-08-19 23:24:47 -04:00
Matthias Clasen
7f4b575fc3 gdk: Add a private getter for GdkDevice::input-mode 2016-04-30 20:52:23 -04:00
Matthias Clasen
6e47dad33d gdkdevice: Expose tool as property
This may occasionally be useful.
2016-04-11 12:08:21 -04:00
Matthias Clasen
9044f78751 Move GdkDeviceTool into its own files 2016-04-09 15:48:34 -04:00
Stephen Chandler Paul
9e72d24b23 GdkDeviceTool: Add GdkAxisFlags info to tablet tools
Different tools may have different sets of axes, we should store that
info somewhere.
2016-04-06 15:43:29 +02:00
Stephen Chandler Paul
8b2fd3ed1b GdkDeviceTool: Add GdkDeviceToolType to identify the physical tool type
Because there are multiple different types of styluses that can be used with
tablets, we have to have some sort of identifier for them attached to the
GdkDeviceTool, especially since knowing the actual tool type for a GdkDeviceTool
is necessary for matching up a GdkDeviceTool with it's appropriate
GdkInputSource in Wayland (eg. matching up a GdkDeviceTool eraser with the
GDK_SOURCE_ERASER GdkInputSource of a wayland tablet).

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
2016-04-06 15:43:29 +02:00
Carlos Garnacho
d5f141a9b7 gdkdevice: Add GdkDevice::tool-changed signal
On the devices and backends that support it, this signal will be emitted
on slave/floating devices whenever the tool they are interacting with
changes. These notifications may also work as a sort of proximity events,
as the tool will be unset when the pen moves too far.

For backends, gdk_device_update_tool() has been included, all that should
be done on their side is just calling this whenever any tool might have
changed.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
4ba95b09ba gdkdevice: Add GdkDeviceTool to identify device tools
GdkDeviceTool is an opaque object that can be used to identify a given
tool (eg. pens on tablets) during the app/device lifetime. Tools are only
set on non-master devices, and are owned by these.

The accounting functions are made private, the only public call on
GdkDeviceTool so far is gdk_device_tool_get_serial(), useful to identify
the tool across runs.
2016-04-06 15:43:29 +02:00
Carlos Garnacho
0f962f1075 device: Add gdk_device_get_axes(), and ::axes property
This returns a GdkAxisFlags, holding the axes currently available
through this device.
2016-04-06 15:43:29 +02:00
Matthias Clasen
f468f0fbb2 device: Add a num-touches property
Some backends can provide this information for touch devices,
and it can be useful to have, so add this property.
2016-02-25 08:27:08 -05:00
Carlos Garnacho
4065bd1e96 gdk: Deprecate GdkDeviceManager and gdk_device_grab/ungrab()
GdkSeat is now the preferred way to deal with input devices and grabs.

https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:40:21 +01:00
Carlos Garnacho
d24f63e9ce GdkDevice: Add GdkSeat property and getter
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:16:15 +01:00
Carlos Garnacho
cc2e77295e device: Fix dispose
The way master devices detach from their other master counterpart is
vulnerable to infinite recursion due to the way we first recurse on
the other device before clearing the pointer, this may happen if
that last reference to the other master device is held by the
device->associated field.

https://bugzilla.gnome.org/show_bug.cgi?id=732742
2015-11-24 20:52:12 +01:00
Carlos Garnacho
7d8a3a52ce GdkDevice: Do not free construct-only properties data on dispose()
Those are not references to other objects, and the device will be mostly
useless if those can't be set again anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=756625
2015-11-03 13:28:07 +01:00
Matthias Clasen
4307fff677 device: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:00 -04:00
Carlos Garnacho
5e53676b46 device: Add property/getters for vendor/product identifiers
These are a construct only properties, expected to be filled in from
platform specific code.

https://bugzilla.gnome.org/show_bug.cgi?id=740758
2015-01-19 15:09:19 +01:00
Matthias Clasen
c304f2ea68 docs: Add a missing word 2014-11-28 14:25:42 -05:00
Matthias Clasen
abe7187cfb Add another multi-device invariant
The device and window passed to gdk_device_grab() must be
on the same display, or things are unlikely to work.
Document and assert this.
2014-10-28 00:54:39 -04:00
Matthias Clasen
4c69dabb6e Don't return GDK_GRAB_SUCCESS on failure
That seems ... counterproductive.
2014-10-28 00:51:32 -04:00
Matthias Clasen
919bdff7ac GdkDevice: Avoid unnecessary critical
There is no need for a critical warning just because somebody
asked for a property that is not meaningful for the device.
Just document it as not useful for keyboard devices.
2014-10-05 19:43:06 -04:00
Marek Kasik
8b5d30d439 Remove redundant checks for NULL
Remove checks for NULL before g_free() and g_clear_object().
Merge check for NULL, freeing of pointer and its setting
to NULL by g_clear_pointer().

https://bugzilla.gnome.org/show_bug.cgi?id=733157
2014-10-02 19:06:03 +02:00
Carlos Garnacho
7995cd59d0 gdk: Explain the relation between device type and mode
GdkInputMode doesn't apply to all device types, explain why
and how do these interact.
2014-07-21 22:16:04 +02:00
Matthias Clasen
5727a86760 GdkDevice: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:30:53 -04:00
Evan Nemerson
701adf81b6 gdk: assorted introspection and documentation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=729983
2014-05-19 11:47:59 -07:00
Evan Nemerson
38d2458f53 gdk: add many missing (nullable) return value annotations
https://bugzilla.gnome.org/show_bug.cgi?id=729834
2014-05-11 11:48:32 -04:00
Matthias Clasen
5b2236e3d7 Add a Since annotation to gdk_device_get_last_event_window 2014-03-12 23:04:37 -04:00
Owen W. Taylor
40b6d907bf Use GDK's current window tracking when synthesizing events in GTK+
Add gdk_device_get_last_event_window(), and use to implement the window
tracking we need for synthesizing crossing events for sensitivity changes
and gtk grabs, rather than keeping the information in qdata and updating
it based when GTK+ gets events.

https://bugzilla.gnome.org/show_bug.cgi?id=726187
2014-03-12 23:03:53 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00