gtk4/auto/
assistant_page.rs1#![allow(deprecated)]
5
6use crate::{AssistantPageType, Widget, ffi};
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 #[doc(alias = "GtkAssistantPage")]
51 pub struct AssistantPage(Object<ffi::GtkAssistantPage>);
52
53 match fn {
54 type_ => || ffi::gtk_assistant_page_get_type(),
55 }
56}
57
58impl AssistantPage {
59 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
69 #[allow(deprecated)]
70 #[doc(alias = "gtk_assistant_page_get_child")]
71 #[doc(alias = "get_child")]
72 pub fn child(&self) -> Widget {
73 unsafe { from_glib_none(ffi::gtk_assistant_page_get_child(self.to_glib_none().0)) }
74 }
75
76 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
85 pub fn is_complete(&self) -> bool {
86 ObjectExt::property(self, "complete")
87 }
88
89 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
98 pub fn set_complete(&self, complete: bool) {
99 ObjectExt::set_property(self, "complete", complete)
100 }
101
102 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
108 #[doc(alias = "page-type")]
109 pub fn page_type(&self) -> AssistantPageType {
110 ObjectExt::property(self, "page-type")
111 }
112
113 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
119 #[doc(alias = "page-type")]
120 pub fn set_page_type(&self, page_type: AssistantPageType) {
121 ObjectExt::set_property(self, "page-type", page_type)
122 }
123
124 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
130 pub fn title(&self) -> Option<glib::GString> {
131 ObjectExt::property(self, "title")
132 }
133
134 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
140 pub fn set_title(&self, title: Option<&str>) {
141 ObjectExt::set_property(self, "title", title)
142 }
143
144 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
145 #[doc(alias = "complete")]
146 pub fn connect_complete_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
147 unsafe extern "C" fn notify_complete_trampoline<F: Fn(&AssistantPage) + 'static>(
148 this: *mut ffi::GtkAssistantPage,
149 _param_spec: glib::ffi::gpointer,
150 f: glib::ffi::gpointer,
151 ) {
152 unsafe {
153 let f: &F = &*(f as *const F);
154 f(&from_glib_borrow(this))
155 }
156 }
157 unsafe {
158 let f: Box_<F> = Box_::new(f);
159 connect_raw(
160 self.as_ptr() as *mut _,
161 c"notify::complete".as_ptr() as *const _,
162 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
163 notify_complete_trampoline::<F> as *const (),
164 )),
165 Box_::into_raw(f),
166 )
167 }
168 }
169
170 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
171 #[doc(alias = "page-type")]
172 pub fn connect_page_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
173 unsafe extern "C" fn notify_page_type_trampoline<F: Fn(&AssistantPage) + 'static>(
174 this: *mut ffi::GtkAssistantPage,
175 _param_spec: glib::ffi::gpointer,
176 f: glib::ffi::gpointer,
177 ) {
178 unsafe {
179 let f: &F = &*(f as *const F);
180 f(&from_glib_borrow(this))
181 }
182 }
183 unsafe {
184 let f: Box_<F> = Box_::new(f);
185 connect_raw(
186 self.as_ptr() as *mut _,
187 c"notify::page-type".as_ptr() as *const _,
188 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
189 notify_page_type_trampoline::<F> as *const (),
190 )),
191 Box_::into_raw(f),
192 )
193 }
194 }
195
196 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
197 #[doc(alias = "title")]
198 pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
199 unsafe extern "C" fn notify_title_trampoline<F: Fn(&AssistantPage) + 'static>(
200 this: *mut ffi::GtkAssistantPage,
201 _param_spec: glib::ffi::gpointer,
202 f: glib::ffi::gpointer,
203 ) {
204 unsafe {
205 let f: &F = &*(f as *const F);
206 f(&from_glib_borrow(this))
207 }
208 }
209 unsafe {
210 let f: Box_<F> = Box_::new(f);
211 connect_raw(
212 self.as_ptr() as *mut _,
213 c"notify::title".as_ptr() as *const _,
214 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
215 notify_title_trampoline::<F> as *const (),
216 )),
217 Box_::into_raw(f),
218 )
219 }
220 }
221}