1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Take a look at the license at the top of the repository in the LICENSE file.

use glib::{translate::*, Variant};

use crate::{prelude::*, Actionable};

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::Actionable>> Sealed for T {}
}

// rustdoc-stripper-ignore-next
/// Trait containing manually implemented methods of
/// [`Actionable`](crate::Actionable).
pub trait ActionableExtManual: sealed::Sealed + IsA<Actionable> + 'static {
    #[doc(alias = "gtk_actionable_set_action_target")]
    #[doc(alias = "gtk_actionable_set_action_target_value")]
    fn set_action_target(&self, target: Option<impl Into<Variant>>) {
        unsafe {
            ffi::gtk_actionable_set_action_target_value(
                self.as_ref().to_glib_none().0,
                target.map(|v| v.into()).to_glib_none().0,
            );
        }
    }
}

impl<O: IsA<Actionable>> ActionableExtManual for O {}