Merge branch 'ebassi/for-master' into 'master'

Ebassi/for master

See merge request GNOME/gtk!2683
This commit is contained in:
Matthias Clasen
2020-10-12 14:39:39 +00:00
5 changed files with 92 additions and 24 deletions

View File

@@ -942,7 +942,7 @@ gdk_wayland_device_pad_init (GdkWaylandDevicePad *pad)
}
/**
* gdk_wayland_device_get_wl_seat:
* gdk_wayland_device_get_wl_seat: (skip)
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_seat of a #GdkDevice.
@@ -961,7 +961,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
}
/**
* gdk_wayland_device_get_wl_pointer:
* gdk_wayland_device_get_wl_pointer: (skip)
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_pointer of a #GdkDevice.
@@ -980,7 +980,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
}
/**
* gdk_wayland_device_get_wl_keyboard:
* gdk_wayland_device_get_wl_keyboard: (skip)
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the Wayland wl_keyboard of a #GdkDevice.
@@ -4971,6 +4971,12 @@ gdk_wayland_seat_set_drag (GdkSeat *seat,
g_set_object (&wayland_seat->drag, drag);
}
/**
* gdk_wayland_device_get_data_device: (skip)
* @gdk_device: (type GdkWaylandDevice): a #GdkDevice
*
* ...
*/
struct wl_data_device *
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
{
@@ -4982,6 +4988,13 @@ gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
return seat->data_device;
}
/**
* gdk_wayland_device_set_selection: (skip)
* @gdk_device: (type GdkWaylandDevice): a #GdkDevice
* @source: the data source for the selection
*
* ...
*/
void
gdk_wayland_device_set_selection (GdkDevice *gdk_device,
struct wl_data_source *source)
@@ -4999,8 +5012,8 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
}
/**
* gdk_wayland_seat_get_wl_seat:
* @seat: (type GdkWaylandSeat): a #GdkSeat
* gdk_wayland_seat_get_wl_seat: (skip)
* @seat: a #GdkSeat
*
* Returns the Wayland wl_seat of a #GdkSeat.
*
@@ -5016,9 +5029,10 @@ gdk_wayland_seat_get_wl_seat (GdkSeat *seat)
/**
* gdk_wayland_device_get_node_path:
* @device: a #GdkDevice
* @device: (type GdkWaylandDevice): a #GdkDevice
*
* Returns the `/dev/input/event*` path of this device.
*
* Returns the /dev/input/event* path of this device.
* For #GdkDevices that possibly coalesce multiple hardware
* devices (eg. mouse, keyboard, touch,...), this function
* will return %NULL.
@@ -5026,8 +5040,8 @@ gdk_wayland_seat_get_wl_seat (GdkSeat *seat)
* This is most notably implemented for devices of type
* %GDK_SOURCE_PEN, %GDK_SOURCE_TABLET_PAD.
*
* Returns: the /dev/input/event* path of this device
**/
* Returns: (nullable) (transfer none): the `/dev/input/event*` path of this device
*/
const char *
gdk_wayland_device_get_node_path (GdkDevice *device)
{
@@ -5052,7 +5066,7 @@ gdk_wayland_device_get_node_path (GdkDevice *device)
/**
* gdk_wayland_device_pad_set_feedback:
* @device: a %GDK_SOURCE_TABLET_PAD device
* @device: (type GdkWaylandDevice): a %GDK_SOURCE_TABLET_PAD device
* @feature: Feature to set the feedback label for
* @feature_idx: 0-indexed index of the feature to set the feedback label for
* @label: Feedback label

View File

@@ -384,6 +384,15 @@ static const struct org_kde_kwin_server_decoration_manager_listener server_decor
.default_mode = server_decoration_manager_default_mode
};
/**
* gdk_wayland_display_prefers_ssd:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Checks whether the Wayland compositor prefers to draw the window
* decorations or if it leaves decorations to the application.
*
* Returns: %TRUE if the compositor prefers server-side decorations
*/
gboolean
gdk_wayland_display_prefers_ssd (GdkDisplay *display)
{
@@ -859,7 +868,7 @@ gdk_wayland_display_get_next_serial (GdkDisplay *display)
/**
* gdk_wayland_display_get_startup_notification_id:
* @display: (type GdkX11Display): a #GdkDisplay
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Gets the startup notification ID for a Wayland display, or %NULL
* if no ID has been defined.
@@ -1064,6 +1073,12 @@ get_cursor_theme (GdkWaylandDisplay *display_wayland,
return wl_cursor_theme_create ("/usr/share/icons/default/cursors", size, display_wayland->shm);
}
/**
* gdk_wayland_display_set_cursor_theme:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Sets the cursor theme for the given @display.
*/
void
gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
const char *name,
@@ -1154,7 +1169,7 @@ _gdk_wayland_display_update_serial (GdkWaylandDisplay *display_wayland,
}
/**
* gdk_wayland_display_get_wl_display:
* gdk_wayland_display_get_wl_display: (skip)
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Returns the Wayland wl_display of a #GdkDisplay.
@@ -1170,7 +1185,7 @@ gdk_wayland_display_get_wl_display (GdkDisplay *display)
}
/**
* gdk_wayland_display_get_wl_compositor:
* gdk_wayland_display_get_wl_compositor: (skip)
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
* Returns the Wayland global singleton compositor of a #GdkDisplay.
@@ -2617,11 +2632,11 @@ gdk_wayland_display_get_output_scale (GdkWaylandDisplay *display_wayland,
/**
* gdk_wayland_display_query_registry:
* @display: a wayland #GdkDisplay
* @display: (type GdkWaylandDisplay): a #GdkDisplay
* @global: global interface to query in the registry
*
* Returns %TRUE if the the interface was found in the display
* wl_registry.global handler.
* `wl_registry.global` handler.
*
* Returns: %TRUE if the global is offered by the compositor
**/

View File

@@ -49,7 +49,7 @@ gdk_wayland_monitor_class_init (GdkWaylandMonitorClass *class)
}
/**
* gdk_wayland_monitor_get_wl_output:
* gdk_wayland_monitor_get_wl_output: (skip)
* @monitor: (type GdkWaylandMonitor): a #GdkMonitor
*
* Returns the Wayland wl_output of a #GdkMonitor.

View File

@@ -1694,6 +1694,13 @@ create_zxdg_toplevel_v6_resources (GdkSurface *surface)
surface);
}
/**
* gdk_wayland_toplevel_set_application_id:
* @toplevel: (type GdkWaylandToplevel): a #GdkToplevel
* @application_id: the application id for the @toplevel
*
* Sets the application id on a #GdkToplevel.
*/
void
gdk_wayland_toplevel_set_application_id (GdkToplevel *toplevel,
const char *application_id)
@@ -4033,7 +4040,7 @@ _gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
}
/**
* gdk_wayland_surface_get_wl_surface:
* gdk_wayland_surface_get_wl_surface: (skip)
* @surface: (type GdkWaylandSurface): a #GdkSurface
*
* Returns the Wayland surface of a #GdkSurface.
@@ -4225,12 +4232,12 @@ static const struct zxdg_exported_v1_listener xdg_exported_listener = {
/**
* GdkWaylandToplevelExported:
* @toplevel: the #GdkToplevel that is exported
* @toplevel: (type GdkWaylandToplevel): the #GdkToplevel that is exported
* @handle: the handle
* @user_data: user data that was passed to gdk_wayland_toplevel_export_handle()
*
* Callback that gets called when the handle for a surface has been
* obtained from the Wayland compositor. The handle can be passed
* obtained from the Wayland compositor. The @handle can be passed
* to other processes, for the purpose of marking surfaces as transient
* for out-of-process surfaces.
*/
@@ -4243,7 +4250,7 @@ gdk_wayland_surface_is_exported (GdkWaylandSurface *impl)
/**
* gdk_wayland_toplevel_export_handle:
* @toplevel: the #GdkToplevel to obtain a handle for
* @toplevel: (type GdkWaylandToplevel): the #GdkToplevel to obtain a handle for
* @callback: callback to call with the handle
* @user_data: (closure): user data for @callback
* @destroy_func: destroy notify for @user_data
@@ -4307,7 +4314,7 @@ gdk_wayland_toplevel_export_handle (GdkToplevel *toplevel,
/**
* gdk_wayland_toplevel_unexport_handle:
* @toplevel: the #GdkToplevel to unexport
* @toplevel: (type GdkWaylandToplevel): the #GdkToplevel to unexport
*
* Destroys the handle that was obtained with
* gdk_wayland_toplevel_export_handle().
@@ -4361,7 +4368,7 @@ static const struct zxdg_imported_v1_listener xdg_imported_listener = {
/**
* gdk_wayland_toplevel_set_transient_for_exported:
* @toplevel: the #GdkToplevel to make as transient
* @toplevel: (type GdkWaylandToplevel): the #GdkToplevel to make as transient
* @parent_handle_str: an exported handle for a surface
*
* Marks @toplevel as transient for the surface to which the given
@@ -4414,6 +4421,13 @@ gdk_wayland_surface_get_inhibitor (GdkWaylandSurface *impl,
return g_hash_table_lookup (impl->shortcuts_inhibitors, gdk_seat);
}
/*
* gdk_wayland_surface_inhibit_shortcuts:
* @surface: (type GdkWaylandSurface): a #GdkSurface
* @seat: the seat to inhibit
*
* Inhibits the shortcuts coming from the given @seat.
*/
void
gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
@@ -4437,6 +4451,14 @@ gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
g_hash_table_insert (impl->shortcuts_inhibitors, gdk_seat, inhibitor);
}
/*
* gdk_wayland_surface_restore_shortcuts:
* @surface: (type GdkWaylandSurface): a #GdkSurface
* @seat: the seat to inhibit
*
* Restores the shortcuts on the given @seat inhibited by calling
* gdk_wayland_surface_inhibit_shortcuts().
*/
void
gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)

View File

@@ -1165,6 +1165,23 @@ if build_gir
gtk_dep_sources += gdk_x11_gir
endif
if wayland_enabled
gdk_wayland_gir = gnome.generate_gir(libgtk,
sources: gdk_wayland_public_headers + gdk_wayland_sources,
namespace: 'GdkWayland',
nsversion: gtk_api_version,
identifier_prefix: 'Gdk',
symbol_prefix: 'gdk',
export_packages: 'gtk4-wayland',
includes: [ gdk_gir[0], ],
install: true,
dependencies: gdk_gir_dep,
header: 'gdk/gdkwayland.h',
extra_args: gir_args,
)
gtk_dep_sources += gdk_wayland_gir
endif
gsk_gir_inc = [ gdk_gir[0] ]
gsk_gir = gnome.generate_gir(libgtk,