Commit Graph

282 Commits

Author SHA1 Message Date
Timm Bäder
2146fd28f8 GdkDisplay: Use a GQueue for the events queue 2019-02-10 10:31:27 +01:00
Rico Tzschichholz
b80942ec88 gdk: Fix some g-i annotations warnings 2018-06-27 09:00:17 +02:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Benjamin Otte
d13843ee2a gdk: Remove GDK_SURFACE_FOREIGN
We don't create surfaces of that type anymore.
2018-06-26 00:47:40 +02:00
Matthias Clasen
cd99f82e0c Merge branch 'master' into 'issue1084'
# Conflicts:
#   gdk/gdk.c
2018-06-20 14:21:24 +00:00
Benjamin Otte
a1cee7fa65 surface: Kill event masks
In particular, this patch removes:
  gdk_surface_get_events()
  gdk_surface_set_events()
  gdk_surface_get_device_events()
  gdk_surface_set_device_events()

Event masks so far still exist for grabs.
2018-06-18 23:49:52 +02:00
Benjamin Otte
4aedf3d003 display: Don't wake up the main loop anymore
This is not needed because GTK must be run in the main thread these days,
which is the same one that runs the main loop. So when this function is
called, the main loop is awake.

https://bugzilla.gnome.org/show_bug.cgi?id=550989
2018-06-18 23:49:52 +02:00
Mario Sanchez Prada
938448e0ef display: Add new virtual gdk_display_get_startup_notification_id() method.
Includes implementation for Wayland and X11, which are the only backends
implementing the Startup Notification Protocol, returns NULL otherwise.

https://gitlab.gnome.org/GNOME/gtk/issues/1084
2018-06-11 16:28:24 +01:00
Benjamin Otte
7e574fa98c gdk: Get rid of gdk_event_free()
Events are objects, so use g_object_unref().
2018-05-29 21:53:44 +02:00
Benjamin Otte
5a32469303 surface: Remove GSK_SURFACE_ROOT
Root surface have been dead for a while now, no need to keep the enum
value around.
2018-03-21 00:58:01 +01:00
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
890080ebf7 GdkWindow -> GdkSurface: File renames
Rename all *window.[ch] source files.

This is an automatic operation, done by the following commands:

for i in $(git ls-files gdk | grep window); do
    git mv $i $(echo $i | sed s/window/surface/);
    git sed -f g $(basename $i) $(basename $i | sed s/window/surface/) ;
done

git checkout NEWS* po-properties po
2018-03-20 11:46:11 +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
77bab4e027 gdk: Drop some unused cursor apis
The query function for cursor sizes and capabilities
are not very interesting. At least, they are not used
in GTK+, and all backends but X11 just hardcode
made-up values anyway. So, lets drop them.
2018-01-16 23:32:01 -05:00
Matthias Clasen
e151058dff Make gdk logging per-display
As far as possible, use per-display debug flags.

This will minimize the debug spew that we get from
the inspector if it is running on a separate display.
2018-01-14 17:05:04 -05:00
Matthias Clasen
c5fc841285 gdk: Reorganize env vars
Drop GDK_GL, GDK_VULKAN and GDK_RENDERING_MODE.
Merge the useful bits into GDK_DEBUG.
Drop unused debug flags (CURSOR).
2018-01-14 17:05:04 -05:00
Matthias Clasen
5c9ea0cf4f display: Cosmetic doc changes 2017-12-26 14:39:49 -05:00
Matthias Clasen
ca2a7c1efd Document more structs 2017-12-26 14:39:24 -05:00
Matthias Clasen
d3920d17fa Document gdk_display_get_setting
New api needs documentation.
2017-12-26 11:51:28 -05:00
Matthias Clasen
ffe838e7de gdk: Document GdkDisplay::setting-changed
New api needs documentation.
2017-12-26 11:51:28 -05:00
Emmanuele Bassi
e847694e91 Update annotations for GdkDisplay
GdkDisplay is missing various annotations, and the introspection scanner
is complaining about it.
2017-12-21 19:13:28 +00:00
Matthias Clasen
fa27d171d0 Drop gdk_keymap_get_for_display
It has been replaced by gdk_display_get_keymap.
2017-12-15 07:46:35 -05:00
Matthias Clasen
1012bbeecf Add gdk_display_get_keymap
This is just a better name for gdk_keymap_get_for_display.
2017-12-15 06:53:13 -05:00
Benjamin Otte
5d70bbf4c4 display: Remove leftover old clipboard APIs 2017-12-14 13:35:32 +01:00
Benjamin Otte
65fcff87b2 gdk: Remove ability to request selection notifications
Without selections, that's kinda pointless.
2017-12-14 04:20:48 +01:00
Carlos Garnacho
2f65a2f5cc gdk: Make gdk_display_peek_event() Return a reference to the event
No need to copy it.
2017-12-14 01:05:48 +01:00
Carlos Garnacho
b9db0b55cb gdk: Refurbish GdkEvent struct hierarchy
Make all specific event structs contain a GdkEventAny, so the base
struct can be extended without modifying structs all over the place.
2017-12-14 00:58:32 +01:00
Benjamin Otte
c93ddf62c3 gdk: Clean up marshalers
Don't generate marshallers that are not needed.

Use the default ones if they exist.
2017-12-13 00:56:52 +01:00
Matthias Clasen
e94b9b9a62 gdk: A GdkClipboard API draft
This commit adds a GdkClipboard object which is intended to
replace GtkClipboard, eventually.
2017-12-03 05:43:24 +01:00
Matthias Clasen
cd3d2badf0 display: Drop the device_manager for good
This is now entirely the backends responsibility.
2017-11-25 11:04:14 -05:00
Matthias Clasen
903959301b display: Stop using devicemanager internally
We can just use the seats to find out about device removals.
2017-11-25 11:04:14 -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
0cfc812a5d Drop gdk_display_get_device_manager API
GdkDeviceManager is being replaced by GdkSeat.
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
c2f6208ce5 Add private api for setting cursor theme
This is implemented in multiple gdk backends,
and we can avoid and ugly ifdef cascade in gtk
by adding a vfunc for this.
2017-11-17 17:42:12 -05:00
Matthias Clasen
2d591cde78 Include gdk-private.h
This gives us access to private gdk api.
2017-11-17 16:34:04 -05:00
Matthias Clasen
1ec93bdda6 gdk: Move code around
Move the gdk_display functions to gdkdisplay.c.
They are misplaced in gdkevents.c.
2017-11-17 16:22:21 -05:00
Matthias Clasen
dbb18ad5d8 gdk: Add a private method to get a server timestamp
This is needed in the clipboard code. We don't make
it public, since that code is destined to eventually
live in gdk anyway.
2017-11-17 15:39:08 -05:00
Matthias Clasen
6263286c4a Drop gdkscreen.h
Nothing uses GdkScreen anymore, so we can get rid of it.
2017-11-17 13:54:04 -05:00
Benjamin Otte
f4ec6290f8 gdk: Remove gdk_flush()
If you need to flush a display, use gdk_display_flush().

There is never a need to flush displays you don't know about.
2017-11-17 08:36:35 +01:00
Matthias Clasen
30e6a4c29d Drop the generic error trap api
This is only implemented on X11, so we don't
need generic api for it.
2017-11-17 00:08:24 -05:00
Matthias Clasen
211f16d68b Drop gdk_notify_startup_complete
This function and its variant are just wrappers
around the display-specific function.
2017-11-16 22:45:52 -05:00
Matthias Clasen
baf40d35c5 Drop gdk_beep
This is an unnecessary wrapper around gdk_display_beep.
2017-11-16 22:10:26 -05:00
Matthias Clasen
20fab69c38 Drop gdk_display_get_root_window
This is no longer used.
2017-11-05 21:45:51 -05:00
Matthias Clasen
c16a0bd9b7 Drop gdk_display_get_toplevel_windows
Nothing uses this private api anymore, so we can drop it.
2017-11-05 18:39:01 -05:00
Matthias Clasen
8144d31ebe Stop talking about GdkScreen in the docs
This api is going away.
2017-11-01 19:44:28 -04:00
Matthias Clasen
7f0b5297c6 Drop gdk_display_get_default_screen
Also remove the backend implementations.
This api is no longer used.
2017-11-01 19:44:28 -04:00
Matthias Clasen
463fba18a6 Port to gdk_display_get_root_window
This is the replacement for the GdkScreen api of the same name.
2017-10-31 21:27:24 -04:00