[go: up one dir, main page]

gtk4/auto/
object_expression.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::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GtkObjectExpression")]
10    pub struct ObjectExpression(Shared<ffi::GtkObjectExpression>);
11
12    match fn {
13        ref => |ptr| ffi::gtk_expression_ref(ptr as *mut ffi::GtkExpression),
14        unref => |ptr| ffi::gtk_expression_unref(ptr as *mut ffi::GtkExpression),
15    }
16}
17
18impl StaticType for ObjectExpression {
19    fn static_type() -> glib::Type {
20        unsafe { from_glib(ffi::gtk_object_expression_get_type()) }
21    }
22}
23
24impl ObjectExpression {
25    #[doc(alias = "gtk_object_expression_new")]
26    pub fn new(object: &impl IsA<glib::Object>) -> ObjectExpression {
27        assert_initialized_main_thread!();
28        unsafe {
29            from_glib_full(ffi::gtk_object_expression_new(
30                object.as_ref().to_glib_none().0,
31            ))
32        }
33    }
34
35    #[doc(alias = "gtk_object_expression_get_object")]
36    #[doc(alias = "get_object")]
37    pub fn object(&self) -> Option<glib::Object> {
38        unsafe { from_glib_none(ffi::gtk_object_expression_get_object(self.to_glib_none().0)) }
39    }
40}