gtk4/
actionable.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::{translate::*, Variant};
4
5use crate::{prelude::*, Actionable};
6
7mod sealed {
8    pub trait Sealed {}
9    impl<T: super::IsA<super::Actionable>> Sealed for T {}
10}
11
12// rustdoc-stripper-ignore-next
13/// Trait containing manually implemented methods of
14/// [`Actionable`](crate::Actionable).
15pub trait ActionableExtManual: sealed::Sealed + IsA<Actionable> + 'static {
16    #[doc(alias = "gtk_actionable_set_action_target")]
17    #[doc(alias = "gtk_actionable_set_action_target_value")]
18    fn set_action_target(&self, target: Option<impl Into<Variant>>) {
19        unsafe {
20            crate::ffi::gtk_actionable_set_action_target_value(
21                self.as_ref().to_glib_none().0,
22                target.map(|v| v.into()).to_glib_none().0,
23            );
24        }
25    }
26}
27
28impl<O: IsA<Actionable>> ActionableExtManual for O {}