gtk4/auto/
assistant_page.rs1#![allow(deprecated)]
5
6use crate::{ffi, AssistantPageType, Widget};
7use glib::{
8 prelude::*,
9 signal::{connect_raw, SignalHandlerId},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "GtkAssistantPage")]
16 pub struct AssistantPage(Object<ffi::GtkAssistantPage>);
17
18 match fn {
19 type_ => || ffi::gtk_assistant_page_get_type(),
20 }
21}
22
23impl AssistantPage {
24 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
25 #[allow(deprecated)]
26 #[doc(alias = "gtk_assistant_page_get_child")]
27 #[doc(alias = "get_child")]
28 pub fn child(&self) -> Widget {
29 unsafe { from_glib_none(ffi::gtk_assistant_page_get_child(self.to_glib_none().0)) }
30 }
31
32 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
33 pub fn is_complete(&self) -> bool {
34 ObjectExt::property(self, "complete")
35 }
36
37 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
38 pub fn set_complete(&self, complete: bool) {
39 ObjectExt::set_property(self, "complete", complete)
40 }
41
42 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
43 #[doc(alias = "page-type")]
44 pub fn page_type(&self) -> AssistantPageType {
45 ObjectExt::property(self, "page-type")
46 }
47
48 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
49 #[doc(alias = "page-type")]
50 pub fn set_page_type(&self, page_type: AssistantPageType) {
51 ObjectExt::set_property(self, "page-type", page_type)
52 }
53
54 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
55 pub fn title(&self) -> Option<glib::GString> {
56 ObjectExt::property(self, "title")
57 }
58
59 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
60 pub fn set_title(&self, title: Option<&str>) {
61 ObjectExt::set_property(self, "title", title)
62 }
63
64 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
65 #[doc(alias = "complete")]
66 pub fn connect_complete_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
67 unsafe extern "C" fn notify_complete_trampoline<F: Fn(&AssistantPage) + 'static>(
68 this: *mut ffi::GtkAssistantPage,
69 _param_spec: glib::ffi::gpointer,
70 f: glib::ffi::gpointer,
71 ) {
72 let f: &F = &*(f as *const F);
73 f(&from_glib_borrow(this))
74 }
75 unsafe {
76 let f: Box_<F> = Box_::new(f);
77 connect_raw(
78 self.as_ptr() as *mut _,
79 c"notify::complete".as_ptr() as *const _,
80 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
81 notify_complete_trampoline::<F> as *const (),
82 )),
83 Box_::into_raw(f),
84 )
85 }
86 }
87
88 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
89 #[doc(alias = "page-type")]
90 pub fn connect_page_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
91 unsafe extern "C" fn notify_page_type_trampoline<F: Fn(&AssistantPage) + 'static>(
92 this: *mut ffi::GtkAssistantPage,
93 _param_spec: glib::ffi::gpointer,
94 f: glib::ffi::gpointer,
95 ) {
96 let f: &F = &*(f as *const F);
97 f(&from_glib_borrow(this))
98 }
99 unsafe {
100 let f: Box_<F> = Box_::new(f);
101 connect_raw(
102 self.as_ptr() as *mut _,
103 c"notify::page-type".as_ptr() as *const _,
104 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
105 notify_page_type_trampoline::<F> as *const (),
106 )),
107 Box_::into_raw(f),
108 )
109 }
110 }
111
112 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
113 #[doc(alias = "title")]
114 pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
115 unsafe extern "C" fn notify_title_trampoline<F: Fn(&AssistantPage) + 'static>(
116 this: *mut ffi::GtkAssistantPage,
117 _param_spec: glib::ffi::gpointer,
118 f: glib::ffi::gpointer,
119 ) {
120 let f: &F = &*(f as *const F);
121 f(&from_glib_borrow(this))
122 }
123 unsafe {
124 let f: Box_<F> = Box_::new(f);
125 connect_raw(
126 self.as_ptr() as *mut _,
127 c"notify::title".as_ptr() as *const _,
128 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
129 notify_title_trampoline::<F> as *const (),
130 )),
131 Box_::into_raw(f),
132 )
133 }
134 }
135}