gdk4/auto/
app_launch_context.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, Display};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GdkAppLaunchContext")]
10    pub struct AppLaunchContext(Object<ffi::GdkAppLaunchContext>) @extends gio::AppLaunchContext;
11
12    match fn {
13        type_ => || ffi::gdk_app_launch_context_get_type(),
14    }
15}
16
17impl AppLaunchContext {
18    pub const NONE: Option<&'static AppLaunchContext> = None;
19}
20
21pub trait GdkAppLaunchContextExt: IsA<AppLaunchContext> + 'static {
22    #[doc(alias = "gdk_app_launch_context_get_display")]
23    #[doc(alias = "get_display")]
24    fn display(&self) -> Display {
25        unsafe {
26            from_glib_none(ffi::gdk_app_launch_context_get_display(
27                self.as_ref().to_glib_none().0,
28            ))
29        }
30    }
31
32    #[doc(alias = "gdk_app_launch_context_set_desktop")]
33    fn set_desktop(&self, desktop: i32) {
34        unsafe {
35            ffi::gdk_app_launch_context_set_desktop(self.as_ref().to_glib_none().0, desktop);
36        }
37    }
38
39    #[doc(alias = "gdk_app_launch_context_set_icon")]
40    fn set_icon(&self, icon: Option<&impl IsA<gio::Icon>>) {
41        unsafe {
42            ffi::gdk_app_launch_context_set_icon(
43                self.as_ref().to_glib_none().0,
44                icon.map(|p| p.as_ref()).to_glib_none().0,
45            );
46        }
47    }
48
49    #[doc(alias = "gdk_app_launch_context_set_icon_name")]
50    fn set_icon_name(&self, icon_name: Option<&str>) {
51        unsafe {
52            ffi::gdk_app_launch_context_set_icon_name(
53                self.as_ref().to_glib_none().0,
54                icon_name.to_glib_none().0,
55            );
56        }
57    }
58
59    #[doc(alias = "gdk_app_launch_context_set_timestamp")]
60    fn set_timestamp(&self, timestamp: u32) {
61        unsafe {
62            ffi::gdk_app_launch_context_set_timestamp(self.as_ref().to_glib_none().0, timestamp);
63        }
64    }
65}
66
67impl<O: IsA<AppLaunchContext>> GdkAppLaunchContextExt for O {}