1#[cfg(feature = "v4_14")]
6#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
7use crate::AccessibleText;
8use crate::{
9 ffi, Accessible, AccessibleRole, Align, Buildable, ConstraintTarget, InscriptionOverflow,
10 LayoutManager, Overflow, Widget,
11};
12use glib::{
13 prelude::*,
14 signal::{connect_raw, SignalHandlerId},
15 translate::*,
16};
17use std::boxed::Box as Box_;
18
19#[cfg(feature = "v4_14")]
20#[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
21glib::wrapper! {
22 #[doc(alias = "GtkInscription")]
23 pub struct Inscription(Object<ffi::GtkInscription, ffi::GtkInscriptionClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, AccessibleText;
24
25 match fn {
26 type_ => || ffi::gtk_inscription_get_type(),
27 }
28}
29
30#[cfg(not(any(feature = "v4_14")))]
31glib::wrapper! {
32 #[doc(alias = "GtkInscription")]
33 pub struct Inscription(Object<ffi::GtkInscription, ffi::GtkInscriptionClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget;
34
35 match fn {
36 type_ => || ffi::gtk_inscription_get_type(),
37 }
38}
39
40impl Inscription {
41 #[doc(alias = "gtk_inscription_new")]
42 pub fn new(text: Option<&str>) -> Inscription {
43 assert_initialized_main_thread!();
44 unsafe {
45 Widget::from_glib_none(ffi::gtk_inscription_new(text.to_glib_none().0)).unsafe_cast()
46 }
47 }
48
49 pub fn builder() -> InscriptionBuilder {
54 InscriptionBuilder::new()
55 }
56
57 #[doc(alias = "gtk_inscription_get_attributes")]
58 #[doc(alias = "get_attributes")]
59 pub fn attributes(&self) -> Option<pango::AttrList> {
60 unsafe { from_glib_none(ffi::gtk_inscription_get_attributes(self.to_glib_none().0)) }
61 }
62
63 #[doc(alias = "gtk_inscription_get_min_chars")]
64 #[doc(alias = "get_min_chars")]
65 #[doc(alias = "min-chars")]
66 pub fn min_chars(&self) -> u32 {
67 unsafe { ffi::gtk_inscription_get_min_chars(self.to_glib_none().0) }
68 }
69
70 #[doc(alias = "gtk_inscription_get_min_lines")]
71 #[doc(alias = "get_min_lines")]
72 #[doc(alias = "min-lines")]
73 pub fn min_lines(&self) -> u32 {
74 unsafe { ffi::gtk_inscription_get_min_lines(self.to_glib_none().0) }
75 }
76
77 #[doc(alias = "gtk_inscription_get_nat_chars")]
78 #[doc(alias = "get_nat_chars")]
79 #[doc(alias = "nat-chars")]
80 pub fn nat_chars(&self) -> u32 {
81 unsafe { ffi::gtk_inscription_get_nat_chars(self.to_glib_none().0) }
82 }
83
84 #[doc(alias = "gtk_inscription_get_nat_lines")]
85 #[doc(alias = "get_nat_lines")]
86 #[doc(alias = "nat-lines")]
87 pub fn nat_lines(&self) -> u32 {
88 unsafe { ffi::gtk_inscription_get_nat_lines(self.to_glib_none().0) }
89 }
90
91 #[doc(alias = "gtk_inscription_get_text")]
92 #[doc(alias = "get_text")]
93 pub fn text(&self) -> Option<glib::GString> {
94 unsafe { from_glib_none(ffi::gtk_inscription_get_text(self.to_glib_none().0)) }
95 }
96
97 #[doc(alias = "gtk_inscription_get_text_overflow")]
98 #[doc(alias = "get_text_overflow")]
99 #[doc(alias = "text-overflow")]
100 pub fn text_overflow(&self) -> InscriptionOverflow {
101 unsafe {
102 from_glib(ffi::gtk_inscription_get_text_overflow(
103 self.to_glib_none().0,
104 ))
105 }
106 }
107
108 #[doc(alias = "gtk_inscription_get_wrap_mode")]
109 #[doc(alias = "get_wrap_mode")]
110 #[doc(alias = "wrap-mode")]
111 pub fn wrap_mode(&self) -> pango::WrapMode {
112 unsafe { from_glib(ffi::gtk_inscription_get_wrap_mode(self.to_glib_none().0)) }
113 }
114
115 #[doc(alias = "gtk_inscription_get_xalign")]
116 #[doc(alias = "get_xalign")]
117 pub fn xalign(&self) -> f32 {
118 unsafe { ffi::gtk_inscription_get_xalign(self.to_glib_none().0) }
119 }
120
121 #[doc(alias = "gtk_inscription_get_yalign")]
122 #[doc(alias = "get_yalign")]
123 pub fn yalign(&self) -> f32 {
124 unsafe { ffi::gtk_inscription_get_yalign(self.to_glib_none().0) }
125 }
126
127 #[doc(alias = "gtk_inscription_set_attributes")]
128 #[doc(alias = "attributes")]
129 pub fn set_attributes(&self, attrs: Option<&pango::AttrList>) {
130 unsafe {
131 ffi::gtk_inscription_set_attributes(self.to_glib_none().0, attrs.to_glib_none().0);
132 }
133 }
134
135 #[doc(alias = "gtk_inscription_set_markup")]
136 #[doc(alias = "markup")]
137 pub fn set_markup(&self, markup: Option<&str>) {
138 unsafe {
139 ffi::gtk_inscription_set_markup(self.to_glib_none().0, markup.to_glib_none().0);
140 }
141 }
142
143 #[doc(alias = "gtk_inscription_set_min_chars")]
144 #[doc(alias = "min-chars")]
145 pub fn set_min_chars(&self, min_chars: u32) {
146 unsafe {
147 ffi::gtk_inscription_set_min_chars(self.to_glib_none().0, min_chars);
148 }
149 }
150
151 #[doc(alias = "gtk_inscription_set_min_lines")]
152 #[doc(alias = "min-lines")]
153 pub fn set_min_lines(&self, min_lines: u32) {
154 unsafe {
155 ffi::gtk_inscription_set_min_lines(self.to_glib_none().0, min_lines);
156 }
157 }
158
159 #[doc(alias = "gtk_inscription_set_nat_chars")]
160 #[doc(alias = "nat-chars")]
161 pub fn set_nat_chars(&self, nat_chars: u32) {
162 unsafe {
163 ffi::gtk_inscription_set_nat_chars(self.to_glib_none().0, nat_chars);
164 }
165 }
166
167 #[doc(alias = "gtk_inscription_set_nat_lines")]
168 #[doc(alias = "nat-lines")]
169 pub fn set_nat_lines(&self, nat_lines: u32) {
170 unsafe {
171 ffi::gtk_inscription_set_nat_lines(self.to_glib_none().0, nat_lines);
172 }
173 }
174
175 #[doc(alias = "gtk_inscription_set_text")]
176 #[doc(alias = "text")]
177 pub fn set_text(&self, text: Option<&str>) {
178 unsafe {
179 ffi::gtk_inscription_set_text(self.to_glib_none().0, text.to_glib_none().0);
180 }
181 }
182
183 #[doc(alias = "gtk_inscription_set_text_overflow")]
184 #[doc(alias = "text-overflow")]
185 pub fn set_text_overflow(&self, overflow: InscriptionOverflow) {
186 unsafe {
187 ffi::gtk_inscription_set_text_overflow(self.to_glib_none().0, overflow.into_glib());
188 }
189 }
190
191 #[doc(alias = "gtk_inscription_set_wrap_mode")]
192 #[doc(alias = "wrap-mode")]
193 pub fn set_wrap_mode(&self, wrap_mode: pango::WrapMode) {
194 unsafe {
195 ffi::gtk_inscription_set_wrap_mode(self.to_glib_none().0, wrap_mode.into_glib());
196 }
197 }
198
199 #[doc(alias = "gtk_inscription_set_xalign")]
200 #[doc(alias = "xalign")]
201 pub fn set_xalign(&self, xalign: f32) {
202 unsafe {
203 ffi::gtk_inscription_set_xalign(self.to_glib_none().0, xalign);
204 }
205 }
206
207 #[doc(alias = "gtk_inscription_set_yalign")]
208 #[doc(alias = "yalign")]
209 pub fn set_yalign(&self, yalign: f32) {
210 unsafe {
211 ffi::gtk_inscription_set_yalign(self.to_glib_none().0, yalign);
212 }
213 }
214
215 #[cfg(feature = "v4_8")]
216 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
217 #[doc(alias = "attributes")]
218 pub fn connect_attributes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
219 unsafe extern "C" fn notify_attributes_trampoline<F: Fn(&Inscription) + 'static>(
220 this: *mut ffi::GtkInscription,
221 _param_spec: glib::ffi::gpointer,
222 f: glib::ffi::gpointer,
223 ) {
224 let f: &F = &*(f as *const F);
225 f(&from_glib_borrow(this))
226 }
227 unsafe {
228 let f: Box_<F> = Box_::new(f);
229 connect_raw(
230 self.as_ptr() as *mut _,
231 c"notify::attributes".as_ptr() as *const _,
232 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
233 notify_attributes_trampoline::<F> as *const (),
234 )),
235 Box_::into_raw(f),
236 )
237 }
238 }
239
240 #[cfg(feature = "v4_8")]
241 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
242 #[doc(alias = "markup")]
243 pub fn connect_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
244 unsafe extern "C" fn notify_markup_trampoline<F: Fn(&Inscription) + 'static>(
245 this: *mut ffi::GtkInscription,
246 _param_spec: glib::ffi::gpointer,
247 f: glib::ffi::gpointer,
248 ) {
249 let f: &F = &*(f as *const F);
250 f(&from_glib_borrow(this))
251 }
252 unsafe {
253 let f: Box_<F> = Box_::new(f);
254 connect_raw(
255 self.as_ptr() as *mut _,
256 c"notify::markup".as_ptr() as *const _,
257 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
258 notify_markup_trampoline::<F> as *const (),
259 )),
260 Box_::into_raw(f),
261 )
262 }
263 }
264
265 #[cfg(feature = "v4_8")]
266 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
267 #[doc(alias = "min-chars")]
268 pub fn connect_min_chars_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
269 unsafe extern "C" fn notify_min_chars_trampoline<F: Fn(&Inscription) + 'static>(
270 this: *mut ffi::GtkInscription,
271 _param_spec: glib::ffi::gpointer,
272 f: glib::ffi::gpointer,
273 ) {
274 let f: &F = &*(f as *const F);
275 f(&from_glib_borrow(this))
276 }
277 unsafe {
278 let f: Box_<F> = Box_::new(f);
279 connect_raw(
280 self.as_ptr() as *mut _,
281 c"notify::min-chars".as_ptr() as *const _,
282 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
283 notify_min_chars_trampoline::<F> as *const (),
284 )),
285 Box_::into_raw(f),
286 )
287 }
288 }
289
290 #[cfg(feature = "v4_8")]
291 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
292 #[doc(alias = "min-lines")]
293 pub fn connect_min_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
294 unsafe extern "C" fn notify_min_lines_trampoline<F: Fn(&Inscription) + 'static>(
295 this: *mut ffi::GtkInscription,
296 _param_spec: glib::ffi::gpointer,
297 f: glib::ffi::gpointer,
298 ) {
299 let f: &F = &*(f as *const F);
300 f(&from_glib_borrow(this))
301 }
302 unsafe {
303 let f: Box_<F> = Box_::new(f);
304 connect_raw(
305 self.as_ptr() as *mut _,
306 c"notify::min-lines".as_ptr() as *const _,
307 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
308 notify_min_lines_trampoline::<F> as *const (),
309 )),
310 Box_::into_raw(f),
311 )
312 }
313 }
314
315 #[cfg(feature = "v4_8")]
316 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
317 #[doc(alias = "nat-chars")]
318 pub fn connect_nat_chars_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
319 unsafe extern "C" fn notify_nat_chars_trampoline<F: Fn(&Inscription) + 'static>(
320 this: *mut ffi::GtkInscription,
321 _param_spec: glib::ffi::gpointer,
322 f: glib::ffi::gpointer,
323 ) {
324 let f: &F = &*(f as *const F);
325 f(&from_glib_borrow(this))
326 }
327 unsafe {
328 let f: Box_<F> = Box_::new(f);
329 connect_raw(
330 self.as_ptr() as *mut _,
331 c"notify::nat-chars".as_ptr() as *const _,
332 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
333 notify_nat_chars_trampoline::<F> as *const (),
334 )),
335 Box_::into_raw(f),
336 )
337 }
338 }
339
340 #[cfg(feature = "v4_8")]
341 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
342 #[doc(alias = "nat-lines")]
343 pub fn connect_nat_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
344 unsafe extern "C" fn notify_nat_lines_trampoline<F: Fn(&Inscription) + 'static>(
345 this: *mut ffi::GtkInscription,
346 _param_spec: glib::ffi::gpointer,
347 f: glib::ffi::gpointer,
348 ) {
349 let f: &F = &*(f as *const F);
350 f(&from_glib_borrow(this))
351 }
352 unsafe {
353 let f: Box_<F> = Box_::new(f);
354 connect_raw(
355 self.as_ptr() as *mut _,
356 c"notify::nat-lines".as_ptr() as *const _,
357 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
358 notify_nat_lines_trampoline::<F> as *const (),
359 )),
360 Box_::into_raw(f),
361 )
362 }
363 }
364
365 #[cfg(feature = "v4_8")]
366 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
367 #[doc(alias = "text")]
368 pub fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
369 unsafe extern "C" fn notify_text_trampoline<F: Fn(&Inscription) + 'static>(
370 this: *mut ffi::GtkInscription,
371 _param_spec: glib::ffi::gpointer,
372 f: glib::ffi::gpointer,
373 ) {
374 let f: &F = &*(f as *const F);
375 f(&from_glib_borrow(this))
376 }
377 unsafe {
378 let f: Box_<F> = Box_::new(f);
379 connect_raw(
380 self.as_ptr() as *mut _,
381 c"notify::text".as_ptr() as *const _,
382 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
383 notify_text_trampoline::<F> as *const (),
384 )),
385 Box_::into_raw(f),
386 )
387 }
388 }
389
390 #[cfg(feature = "v4_8")]
391 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
392 #[doc(alias = "text-overflow")]
393 pub fn connect_text_overflow_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
394 unsafe extern "C" fn notify_text_overflow_trampoline<F: Fn(&Inscription) + 'static>(
395 this: *mut ffi::GtkInscription,
396 _param_spec: glib::ffi::gpointer,
397 f: glib::ffi::gpointer,
398 ) {
399 let f: &F = &*(f as *const F);
400 f(&from_glib_borrow(this))
401 }
402 unsafe {
403 let f: Box_<F> = Box_::new(f);
404 connect_raw(
405 self.as_ptr() as *mut _,
406 c"notify::text-overflow".as_ptr() as *const _,
407 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
408 notify_text_overflow_trampoline::<F> as *const (),
409 )),
410 Box_::into_raw(f),
411 )
412 }
413 }
414
415 #[cfg(feature = "v4_8")]
416 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
417 #[doc(alias = "wrap-mode")]
418 pub fn connect_wrap_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
419 unsafe extern "C" fn notify_wrap_mode_trampoline<F: Fn(&Inscription) + 'static>(
420 this: *mut ffi::GtkInscription,
421 _param_spec: glib::ffi::gpointer,
422 f: glib::ffi::gpointer,
423 ) {
424 let f: &F = &*(f as *const F);
425 f(&from_glib_borrow(this))
426 }
427 unsafe {
428 let f: Box_<F> = Box_::new(f);
429 connect_raw(
430 self.as_ptr() as *mut _,
431 c"notify::wrap-mode".as_ptr() as *const _,
432 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
433 notify_wrap_mode_trampoline::<F> as *const (),
434 )),
435 Box_::into_raw(f),
436 )
437 }
438 }
439
440 #[cfg(feature = "v4_8")]
441 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
442 #[doc(alias = "xalign")]
443 pub fn connect_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
444 unsafe extern "C" fn notify_xalign_trampoline<F: Fn(&Inscription) + 'static>(
445 this: *mut ffi::GtkInscription,
446 _param_spec: glib::ffi::gpointer,
447 f: glib::ffi::gpointer,
448 ) {
449 let f: &F = &*(f as *const F);
450 f(&from_glib_borrow(this))
451 }
452 unsafe {
453 let f: Box_<F> = Box_::new(f);
454 connect_raw(
455 self.as_ptr() as *mut _,
456 c"notify::xalign".as_ptr() as *const _,
457 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
458 notify_xalign_trampoline::<F> as *const (),
459 )),
460 Box_::into_raw(f),
461 )
462 }
463 }
464
465 #[cfg(feature = "v4_8")]
466 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
467 #[doc(alias = "yalign")]
468 pub fn connect_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
469 unsafe extern "C" fn notify_yalign_trampoline<F: Fn(&Inscription) + 'static>(
470 this: *mut ffi::GtkInscription,
471 _param_spec: glib::ffi::gpointer,
472 f: glib::ffi::gpointer,
473 ) {
474 let f: &F = &*(f as *const F);
475 f(&from_glib_borrow(this))
476 }
477 unsafe {
478 let f: Box_<F> = Box_::new(f);
479 connect_raw(
480 self.as_ptr() as *mut _,
481 c"notify::yalign".as_ptr() as *const _,
482 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
483 notify_yalign_trampoline::<F> as *const (),
484 )),
485 Box_::into_raw(f),
486 )
487 }
488 }
489}
490
491#[cfg(feature = "v4_8")]
492#[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
493impl Default for Inscription {
494 fn default() -> Self {
495 glib::object::Object::new::<Self>()
496 }
497}
498
499#[must_use = "The builder must be built to be used"]
504pub struct InscriptionBuilder {
505 builder: glib::object::ObjectBuilder<'static, Inscription>,
506}
507
508impl InscriptionBuilder {
509 fn new() -> Self {
510 Self {
511 builder: glib::object::Object::builder(),
512 }
513 }
514
515 #[cfg(feature = "v4_8")]
516 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
517 pub fn attributes(self, attributes: &pango::AttrList) -> Self {
518 Self {
519 builder: self.builder.property("attributes", attributes.clone()),
520 }
521 }
522
523 #[cfg(feature = "v4_8")]
524 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
525 pub fn markup(self, markup: impl Into<glib::GString>) -> Self {
526 Self {
527 builder: self.builder.property("markup", markup.into()),
528 }
529 }
530
531 #[cfg(feature = "v4_8")]
532 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
533 pub fn min_chars(self, min_chars: u32) -> Self {
534 Self {
535 builder: self.builder.property("min-chars", min_chars),
536 }
537 }
538
539 #[cfg(feature = "v4_8")]
540 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
541 pub fn min_lines(self, min_lines: u32) -> Self {
542 Self {
543 builder: self.builder.property("min-lines", min_lines),
544 }
545 }
546
547 #[cfg(feature = "v4_8")]
548 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
549 pub fn nat_chars(self, nat_chars: u32) -> Self {
550 Self {
551 builder: self.builder.property("nat-chars", nat_chars),
552 }
553 }
554
555 #[cfg(feature = "v4_8")]
556 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
557 pub fn nat_lines(self, nat_lines: u32) -> Self {
558 Self {
559 builder: self.builder.property("nat-lines", nat_lines),
560 }
561 }
562
563 #[cfg(feature = "v4_8")]
564 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
565 pub fn text(self, text: impl Into<glib::GString>) -> Self {
566 Self {
567 builder: self.builder.property("text", text.into()),
568 }
569 }
570
571 #[cfg(feature = "v4_8")]
572 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
573 pub fn text_overflow(self, text_overflow: InscriptionOverflow) -> Self {
574 Self {
575 builder: self.builder.property("text-overflow", text_overflow),
576 }
577 }
578
579 #[cfg(feature = "v4_8")]
580 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
581 pub fn wrap_mode(self, wrap_mode: pango::WrapMode) -> Self {
582 Self {
583 builder: self.builder.property("wrap-mode", wrap_mode),
584 }
585 }
586
587 #[cfg(feature = "v4_8")]
588 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
589 pub fn xalign(self, xalign: f32) -> Self {
590 Self {
591 builder: self.builder.property("xalign", xalign),
592 }
593 }
594
595 #[cfg(feature = "v4_8")]
596 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
597 pub fn yalign(self, yalign: f32) -> Self {
598 Self {
599 builder: self.builder.property("yalign", yalign),
600 }
601 }
602
603 pub fn can_focus(self, can_focus: bool) -> Self {
604 Self {
605 builder: self.builder.property("can-focus", can_focus),
606 }
607 }
608
609 pub fn can_target(self, can_target: bool) -> Self {
610 Self {
611 builder: self.builder.property("can-target", can_target),
612 }
613 }
614
615 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
616 Self {
617 builder: self.builder.property("css-classes", css_classes.into()),
618 }
619 }
620
621 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
622 Self {
623 builder: self.builder.property("css-name", css_name.into()),
624 }
625 }
626
627 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
628 Self {
629 builder: self.builder.property("cursor", cursor.clone()),
630 }
631 }
632
633 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
634 Self {
635 builder: self.builder.property("focus-on-click", focus_on_click),
636 }
637 }
638
639 pub fn focusable(self, focusable: bool) -> Self {
640 Self {
641 builder: self.builder.property("focusable", focusable),
642 }
643 }
644
645 pub fn halign(self, halign: Align) -> Self {
646 Self {
647 builder: self.builder.property("halign", halign),
648 }
649 }
650
651 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
652 Self {
653 builder: self.builder.property("has-tooltip", has_tooltip),
654 }
655 }
656
657 pub fn height_request(self, height_request: i32) -> Self {
658 Self {
659 builder: self.builder.property("height-request", height_request),
660 }
661 }
662
663 pub fn hexpand(self, hexpand: bool) -> Self {
664 Self {
665 builder: self.builder.property("hexpand", hexpand),
666 }
667 }
668
669 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
670 Self {
671 builder: self.builder.property("hexpand-set", hexpand_set),
672 }
673 }
674
675 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
676 Self {
677 builder: self
678 .builder
679 .property("layout-manager", layout_manager.clone().upcast()),
680 }
681 }
682
683 #[cfg(feature = "v4_18")]
684 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
685 pub fn limit_events(self, limit_events: bool) -> Self {
686 Self {
687 builder: self.builder.property("limit-events", limit_events),
688 }
689 }
690
691 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
692 Self {
693 builder: self.builder.property("margin-bottom", margin_bottom),
694 }
695 }
696
697 pub fn margin_end(self, margin_end: i32) -> Self {
698 Self {
699 builder: self.builder.property("margin-end", margin_end),
700 }
701 }
702
703 pub fn margin_start(self, margin_start: i32) -> Self {
704 Self {
705 builder: self.builder.property("margin-start", margin_start),
706 }
707 }
708
709 pub fn margin_top(self, margin_top: i32) -> Self {
710 Self {
711 builder: self.builder.property("margin-top", margin_top),
712 }
713 }
714
715 pub fn name(self, name: impl Into<glib::GString>) -> Self {
716 Self {
717 builder: self.builder.property("name", name.into()),
718 }
719 }
720
721 pub fn opacity(self, opacity: f64) -> Self {
722 Self {
723 builder: self.builder.property("opacity", opacity),
724 }
725 }
726
727 pub fn overflow(self, overflow: Overflow) -> Self {
728 Self {
729 builder: self.builder.property("overflow", overflow),
730 }
731 }
732
733 pub fn receives_default(self, receives_default: bool) -> Self {
734 Self {
735 builder: self.builder.property("receives-default", receives_default),
736 }
737 }
738
739 pub fn sensitive(self, sensitive: bool) -> Self {
740 Self {
741 builder: self.builder.property("sensitive", sensitive),
742 }
743 }
744
745 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
746 Self {
747 builder: self
748 .builder
749 .property("tooltip-markup", tooltip_markup.into()),
750 }
751 }
752
753 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
754 Self {
755 builder: self.builder.property("tooltip-text", tooltip_text.into()),
756 }
757 }
758
759 pub fn valign(self, valign: Align) -> Self {
760 Self {
761 builder: self.builder.property("valign", valign),
762 }
763 }
764
765 pub fn vexpand(self, vexpand: bool) -> Self {
766 Self {
767 builder: self.builder.property("vexpand", vexpand),
768 }
769 }
770
771 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
772 Self {
773 builder: self.builder.property("vexpand-set", vexpand_set),
774 }
775 }
776
777 pub fn visible(self, visible: bool) -> Self {
778 Self {
779 builder: self.builder.property("visible", visible),
780 }
781 }
782
783 pub fn width_request(self, width_request: i32) -> Self {
784 Self {
785 builder: self.builder.property("width-request", width_request),
786 }
787 }
788
789 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
790 Self {
791 builder: self.builder.property("accessible-role", accessible_role),
792 }
793 }
794
795 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
798 pub fn build(self) -> Inscription {
799 assert_initialized_main_thread!();
800 self.builder.build()
801 }
802}