atk/auto/no_op_object.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::{
6 Action, Component, Document, EditableText, Hypertext, Image, Object, Selection, Table,
7 TableCell, Text, Value, Window,
8};
9use glib::{prelude::*, translate::*};
10use std::fmt;
11
12glib::wrapper! {
13 /// An AtkObject which purports to implement all ATK interfaces.
14 ///
15 /// An AtkNoOpObject is an AtkObject which purports to implement all
16 /// ATK interfaces. It is the type of AtkObject which is created if an
17 /// accessible object is requested for an object type for which no
18 /// factory type is specified.
19 ///
20 /// # Implements
21 ///
22 /// [`AtkObjectExt`][trait@crate::prelude::AtkObjectExt], [`trait@glib::ObjectExt`], [`AtkActionExt`][trait@crate::prelude::AtkActionExt], [`ComponentExt`][trait@crate::prelude::ComponentExt], [`DocumentExt`][trait@crate::prelude::DocumentExt], [`EditableTextExt`][trait@crate::prelude::EditableTextExt], [`HypertextExt`][trait@crate::prelude::HypertextExt], [`AtkImageExt`][trait@crate::prelude::AtkImageExt], [`SelectionExt`][trait@crate::prelude::SelectionExt], [`TableExt`][trait@crate::prelude::TableExt], [`TableCellExt`][trait@crate::prelude::TableCellExt], [`TextExt`][trait@crate::prelude::TextExt], [`ValueExt`][trait@crate::prelude::ValueExt], [`AtkWindowExt`][trait@crate::prelude::AtkWindowExt], [`EditableTextExtManual`][trait@crate::prelude::EditableTextExtManual], [`TableExtManual`][trait@crate::prelude::TableExtManual]
23 #[doc(alias = "AtkNoOpObject")]
24 pub struct NoOpObject(Object<ffi::AtkNoOpObject, ffi::AtkNoOpObjectClass>) @extends Object, @implements Action, Component, Document, EditableText, Hypertext, Image, Selection, Table, TableCell, Text, Value, Window;
25
26 match fn {
27 type_ => || ffi::atk_no_op_object_get_type(),
28 }
29}
30
31impl NoOpObject {
32 pub const NONE: Option<&'static NoOpObject> = None;
33
34 /// Provides a default (non-functioning stub) [`Object`][crate::Object].
35 /// Application maintainers should not use this method.
36 /// ## `obj`
37 /// a [`glib::Object`][crate::glib::Object]
38 ///
39 /// # Returns
40 ///
41 /// a default (non-functioning stub) [`Object`][crate::Object]
42 #[doc(alias = "atk_no_op_object_new")]
43 pub fn new(obj: &impl IsA<glib::Object>) -> NoOpObject {
44 assert_initialized_main_thread!();
45 unsafe {
46 Object::from_glib_full(ffi::atk_no_op_object_new(obj.as_ref().to_glib_none().0))
47 .unsafe_cast()
48 }
49 }
50}
51
52impl fmt::Display for NoOpObject {
53 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
54 f.write_str("NoOpObject")
55 }
56}