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