gtk4/auto/requisition.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::ffi;
6use glib::translate::*;
7
8glib::wrapper! {
9 /// Represents the desired size of a widget.
10 ///
11 /// See [GtkWidget’s geometry management section](class.Widget.html#height-for-width-geometry-management)
12 /// for more information.
13 pub struct Requisition(BoxedInline<ffi::GtkRequisition>);
14
15 match fn {
16 copy => |ptr| ffi::gtk_requisition_copy(ptr),
17 free => |ptr| ffi::gtk_requisition_free(ptr),
18 type_ => || ffi::gtk_requisition_get_type(),
19 }
20}
21
22impl Requisition {
23 /// Allocates a new [`Requisition`][crate::Requisition].
24 ///
25 /// The struct is initialized to zero.
26 ///
27 /// # Returns
28 ///
29 /// a new empty [`Requisition`][crate::Requisition]
30 #[doc(alias = "gtk_requisition_new")]
31 pub fn new() -> Requisition {
32 assert_initialized_main_thread!();
33 unsafe { from_glib_full(ffi::gtk_requisition_new()) }
34 }
35}
36
37impl Default for Requisition {
38 fn default() -> Self {
39 Self::new()
40 }
41}