Skip to main content

atk/auto/
no_op_object_factory.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::ObjectFactory;
6use glib::{prelude::*, translate::*};
7use std::fmt;
8
9glib::wrapper! {
10    /// The AtkObjectFactory which creates an AtkNoOpObject.
11    ///
12    /// The AtkObjectFactory which creates an AtkNoOpObject. An instance of
13    /// this is created by an AtkRegistry if no factory type has not been
14    /// specified to create an accessible object of a particular type.
15    ///
16    /// # Implements
17    ///
18    /// [`ObjectFactoryExt`][trait@crate::prelude::ObjectFactoryExt], [`trait@glib::ObjectExt`]
19    #[doc(alias = "AtkNoOpObjectFactory")]
20    pub struct NoOpObjectFactory(Object<ffi::AtkNoOpObjectFactory, ffi::AtkNoOpObjectFactoryClass>) @extends ObjectFactory;
21
22    match fn {
23        type_ => || ffi::atk_no_op_object_factory_get_type(),
24    }
25}
26
27impl NoOpObjectFactory {
28    pub const NONE: Option<&'static NoOpObjectFactory> = None;
29
30    /// Creates an instance of an [`ObjectFactory`][crate::ObjectFactory] which generates primitive
31    /// (non-functioning) `AtkObjects`.
32    ///
33    /// # Returns
34    ///
35    /// an instance of an [`ObjectFactory`][crate::ObjectFactory]
36    #[doc(alias = "atk_no_op_object_factory_new")]
37    pub fn new() -> NoOpObjectFactory {
38        assert_initialized_main_thread!();
39        unsafe { ObjectFactory::from_glib_full(ffi::atk_no_op_object_factory_new()).unsafe_cast() }
40    }
41}
42
43impl Default for NoOpObjectFactory {
44    fn default() -> Self {
45        Self::new()
46    }
47}
48
49impl fmt::Display for NoOpObjectFactory {
50    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
51        f.write_str("NoOpObjectFactory")
52    }
53}