gdk4_wayland/auto/wayland_surface.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::ffi;
6use glib::prelude::*;
7#[cfg(feature = "v4_18")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
9use glib::translate::*;
10
11glib::wrapper! {
12 /// The Wayland implementation of [`gdk::Surface`][crate::gdk::Surface].
13 ///
14 /// Beyond the [`gdk::Surface`][crate::gdk::Surface] API, the Wayland implementation offers
15 /// access to the Wayland `wl_surface` object with
16 /// [`WaylandSurfaceExtManual::wl_surface()`][crate::prelude::WaylandSurfaceExtManual::wl_surface()].
17 ///
18 /// # Implements
19 ///
20 /// [`WaylandSurfaceExt`][trait@crate::prelude::WaylandSurfaceExt], [`trait@gdk::prelude::SurfaceExt`], [`WaylandSurfaceExtManual`][trait@crate::prelude::WaylandSurfaceExtManual]
21 #[doc(alias = "GdkWaylandSurface")]
22 pub struct WaylandSurface(Object<ffi::GdkWaylandSurface>) @extends gdk::Surface;
23
24 match fn {
25 type_ => || ffi::gdk_wayland_surface_get_type(),
26 }
27}
28
29impl WaylandSurface {
30 pub const NONE: Option<&'static WaylandSurface> = None;
31}
32
33mod sealed {
34 pub trait Sealed {}
35 impl<T: super::IsA<super::WaylandSurface>> Sealed for T {}
36}
37
38/// Trait containing all [`struct@WaylandSurface`] methods.
39///
40/// # Implementors
41///
42/// [`WaylandPopup`][struct@crate::WaylandPopup], [`WaylandSurface`][struct@crate::WaylandSurface], [`WaylandToplevel`][struct@crate::WaylandToplevel]
43pub trait WaylandSurfaceExt: IsA<WaylandSurface> + sealed::Sealed + 'static {
44 /// Forces next commit.
45 #[cfg(feature = "v4_18")]
46 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
47 #[doc(alias = "gdk_wayland_surface_force_next_commit")]
48 fn force_next_commit(&self) {
49 unsafe {
50 ffi::gdk_wayland_surface_force_next_commit(self.as_ref().to_glib_none().0);
51 }
52 }
53}
54
55impl<O: IsA<WaylandSurface>> WaylandSurfaceExt for O {}