// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
#![allow(deprecated)]

use crate::{ffi, WaylandSurface};
use glib::translate::*;

glib::wrapper! {
    #[doc(alias = "GdkWaylandToplevel")]
    pub struct WaylandToplevel(Object<ffi::GdkWaylandToplevel>) @extends WaylandSurface, gdk::Surface, @implements gdk::Toplevel;

    match fn {
        type_ => || ffi::gdk_wayland_toplevel_get_type(),
    }
}

impl WaylandToplevel {
    #[cfg(feature = "v4_12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
    #[doc(alias = "gdk_wayland_toplevel_drop_exported_handle")]
    pub fn drop_exported_handle(&self, handle: &str) {
        unsafe {
            ffi::gdk_wayland_toplevel_drop_exported_handle(
                self.to_glib_none().0,
                handle.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gdk_wayland_toplevel_set_application_id")]
    pub fn set_application_id(&self, application_id: &str) {
        unsafe {
            ffi::gdk_wayland_toplevel_set_application_id(
                self.to_glib_none().0,
                application_id.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "gdk_wayland_toplevel_set_transient_for_exported")]
    pub fn set_transient_for_exported(&self, parent_handle_str: &str) -> bool {
        unsafe {
            from_glib(ffi::gdk_wayland_toplevel_set_transient_for_exported(
                self.to_glib_none().0,
                parent_handle_str.to_glib_none().0,
            ))
        }
    }

    #[cfg_attr(feature = "v4_12", deprecated = "Since 4.12")]
    #[allow(deprecated)]
    #[doc(alias = "gdk_wayland_toplevel_unexport_handle")]
    pub fn unexport_handle(&self) {
        unsafe {
            ffi::gdk_wayland_toplevel_unexport_handle(self.to_glib_none().0);
        }
    }
}
