libpanel/auto/
action_muxer.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    #[doc(alias = "PanelActionMuxer")]
11    pub struct ActionMuxer(Object<ffi::PanelActionMuxer, ffi::PanelActionMuxerClass>) @implements gio::ActionGroup;
12
13    match fn {
14        type_ => || ffi::panel_action_muxer_get_type(),
15    }
16}
17
18impl ActionMuxer {
19    #[doc(alias = "panel_action_muxer_new")]
20    pub fn new() -> ActionMuxer {
21        assert_initialized_main_thread!();
22        unsafe { from_glib_full(ffi::panel_action_muxer_new()) }
23    }
24
25    #[doc(alias = "panel_action_muxer_get_action_group")]
26    #[doc(alias = "get_action_group")]
27    pub fn action_group(&self, prefix: &str) -> Option<gio::ActionGroup> {
28        unsafe {
29            from_glib_none(ffi::panel_action_muxer_get_action_group(
30                self.to_glib_none().0,
31                prefix.to_glib_none().0,
32            ))
33        }
34    }
35
36    #[doc(alias = "panel_action_muxer_insert_action_group")]
37    pub fn insert_action_group(&self, prefix: &str, action_group: &impl IsA<gio::ActionGroup>) {
38        unsafe {
39            ffi::panel_action_muxer_insert_action_group(
40                self.to_glib_none().0,
41                prefix.to_glib_none().0,
42                action_group.as_ref().to_glib_none().0,
43            );
44        }
45    }
46
47    #[doc(alias = "panel_action_muxer_list_groups")]
48    pub fn list_groups(&self) -> Vec<glib::GString> {
49        unsafe {
50            FromGlibPtrContainer::from_glib_full(ffi::panel_action_muxer_list_groups(
51                self.to_glib_none().0,
52            ))
53        }
54    }
55
56    #[doc(alias = "panel_action_muxer_remove_action_group")]
57    pub fn remove_action_group(&self, prefix: &str) {
58        unsafe {
59            ffi::panel_action_muxer_remove_action_group(
60                self.to_glib_none().0,
61                prefix.to_glib_none().0,
62            );
63        }
64    }
65
66    #[doc(alias = "panel_action_muxer_remove_all")]
67    pub fn remove_all(&self) {
68        unsafe {
69            ffi::panel_action_muxer_remove_all(self.to_glib_none().0);
70        }
71    }
72}
73
74impl Default for ActionMuxer {
75    fn default() -> Self {
76        Self::new()
77    }
78}