Skip to main content

atk/auto/
enums.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 glib::{prelude::*, translate::*};
6use std::fmt;
7
8/// Specifies how xy coordinates are to be interpreted. Used by functions such
9/// as [`ComponentExt::position()`][crate::prelude::ComponentExt::position()] and [`TextExt::character_extents()`][crate::prelude::TextExt::character_extents()]
10#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
11#[non_exhaustive]
12#[doc(alias = "AtkCoordType")]
13pub enum CoordType {
14    /// specifies xy coordinates relative to the screen
15    #[doc(alias = "ATK_XY_SCREEN")]
16    Screen,
17    /// specifies xy coordinates relative to the widget's
18    /// top-level window
19    #[doc(alias = "ATK_XY_WINDOW")]
20    Window,
21    /// specifies xy coordinates relative to the widget's
22    /// immediate parent. Since: 2.30
23    #[doc(alias = "ATK_XY_PARENT")]
24    Parent,
25    #[doc(hidden)]
26    __Unknown(i32),
27}
28
29impl fmt::Display for CoordType {
30    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
31        write!(
32            f,
33            "CoordType::{}",
34            match *self {
35                Self::Screen => "Screen",
36                Self::Window => "Window",
37                Self::Parent => "Parent",
38                _ => "Unknown",
39            }
40        )
41    }
42}
43
44#[doc(hidden)]
45impl IntoGlib for CoordType {
46    type GlibType = ffi::AtkCoordType;
47
48    #[inline]
49    fn into_glib(self) -> ffi::AtkCoordType {
50        match self {
51            Self::Screen => ffi::ATK_XY_SCREEN,
52            Self::Window => ffi::ATK_XY_WINDOW,
53            Self::Parent => ffi::ATK_XY_PARENT,
54            Self::__Unknown(value) => value,
55        }
56    }
57}
58
59#[doc(hidden)]
60impl FromGlib<ffi::AtkCoordType> for CoordType {
61    #[inline]
62    unsafe fn from_glib(value: ffi::AtkCoordType) -> Self {
63        skip_assert_initialized!();
64
65        match value {
66            ffi::ATK_XY_SCREEN => Self::Screen,
67            ffi::ATK_XY_WINDOW => Self::Window,
68            ffi::ATK_XY_PARENT => Self::Parent,
69            value => Self::__Unknown(value),
70        }
71    }
72}
73
74impl StaticType for CoordType {
75    #[inline]
76    fn static_type() -> glib::Type {
77        unsafe { from_glib(ffi::atk_coord_type_get_type()) }
78    }
79}
80
81impl glib::HasParamSpec for CoordType {
82    type ParamSpec = glib::ParamSpecEnum;
83    type SetValue = Self;
84    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
85
86    fn param_spec_builder() -> Self::BuilderFn {
87        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
88    }
89}
90
91impl glib::value::ValueType for CoordType {
92    type Type = Self;
93}
94
95unsafe impl<'a> glib::value::FromValue<'a> for CoordType {
96    type Checker = glib::value::GenericValueTypeChecker<Self>;
97
98    #[inline]
99    unsafe fn from_value(value: &'a glib::Value) -> Self {
100        skip_assert_initialized!();
101        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
102    }
103}
104
105impl ToValue for CoordType {
106    #[inline]
107    fn to_value(&self) -> glib::Value {
108        let mut value = glib::Value::for_value_type::<Self>();
109        unsafe {
110            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
111        }
112        value
113    }
114
115    #[inline]
116    fn value_type(&self) -> glib::Type {
117        Self::static_type()
118    }
119}
120
121impl From<CoordType> for glib::Value {
122    #[inline]
123    fn from(v: CoordType) -> Self {
124        skip_assert_initialized!();
125        ToValue::to_value(&v)
126    }
127}
128
129/// Describes the layer of a component
130///
131/// These enumerated "layer values" are used when determining which UI
132/// rendering layer a component is drawn into, which can help in making
133/// determinations of when components occlude one another.
134#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
135#[non_exhaustive]
136#[doc(alias = "AtkLayer")]
137pub enum Layer {
138    /// The object does not have a layer
139    #[doc(alias = "ATK_LAYER_INVALID")]
140    Invalid,
141    /// This layer is reserved for the desktop background
142    #[doc(alias = "ATK_LAYER_BACKGROUND")]
143    Background,
144    /// This layer is used for Canvas components
145    #[doc(alias = "ATK_LAYER_CANVAS")]
146    Canvas,
147    /// This layer is normally used for components
148    #[doc(alias = "ATK_LAYER_WIDGET")]
149    Widget,
150    /// This layer is used for layered components
151    #[doc(alias = "ATK_LAYER_MDI")]
152    Mdi,
153    /// This layer is used for popup components, such as menus
154    #[doc(alias = "ATK_LAYER_POPUP")]
155    Popup,
156    /// This layer is reserved for future use.
157    #[doc(alias = "ATK_LAYER_OVERLAY")]
158    Overlay,
159    /// This layer is used for toplevel windows.
160    #[doc(alias = "ATK_LAYER_WINDOW")]
161    Window,
162    #[doc(hidden)]
163    __Unknown(i32),
164}
165
166impl fmt::Display for Layer {
167    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
168        write!(
169            f,
170            "Layer::{}",
171            match *self {
172                Self::Invalid => "Invalid",
173                Self::Background => "Background",
174                Self::Canvas => "Canvas",
175                Self::Widget => "Widget",
176                Self::Mdi => "Mdi",
177                Self::Popup => "Popup",
178                Self::Overlay => "Overlay",
179                Self::Window => "Window",
180                _ => "Unknown",
181            }
182        )
183    }
184}
185
186#[doc(hidden)]
187impl IntoGlib for Layer {
188    type GlibType = ffi::AtkLayer;
189
190    #[inline]
191    fn into_glib(self) -> ffi::AtkLayer {
192        match self {
193            Self::Invalid => ffi::ATK_LAYER_INVALID,
194            Self::Background => ffi::ATK_LAYER_BACKGROUND,
195            Self::Canvas => ffi::ATK_LAYER_CANVAS,
196            Self::Widget => ffi::ATK_LAYER_WIDGET,
197            Self::Mdi => ffi::ATK_LAYER_MDI,
198            Self::Popup => ffi::ATK_LAYER_POPUP,
199            Self::Overlay => ffi::ATK_LAYER_OVERLAY,
200            Self::Window => ffi::ATK_LAYER_WINDOW,
201            Self::__Unknown(value) => value,
202        }
203    }
204}
205
206#[doc(hidden)]
207impl FromGlib<ffi::AtkLayer> for Layer {
208    #[inline]
209    unsafe fn from_glib(value: ffi::AtkLayer) -> Self {
210        skip_assert_initialized!();
211
212        match value {
213            ffi::ATK_LAYER_INVALID => Self::Invalid,
214            ffi::ATK_LAYER_BACKGROUND => Self::Background,
215            ffi::ATK_LAYER_CANVAS => Self::Canvas,
216            ffi::ATK_LAYER_WIDGET => Self::Widget,
217            ffi::ATK_LAYER_MDI => Self::Mdi,
218            ffi::ATK_LAYER_POPUP => Self::Popup,
219            ffi::ATK_LAYER_OVERLAY => Self::Overlay,
220            ffi::ATK_LAYER_WINDOW => Self::Window,
221            value => Self::__Unknown(value),
222        }
223    }
224}
225
226impl StaticType for Layer {
227    #[inline]
228    fn static_type() -> glib::Type {
229        unsafe { from_glib(ffi::atk_layer_get_type()) }
230    }
231}
232
233impl glib::HasParamSpec for Layer {
234    type ParamSpec = glib::ParamSpecEnum;
235    type SetValue = Self;
236    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
237
238    fn param_spec_builder() -> Self::BuilderFn {
239        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
240    }
241}
242
243impl glib::value::ValueType for Layer {
244    type Type = Self;
245}
246
247unsafe impl<'a> glib::value::FromValue<'a> for Layer {
248    type Checker = glib::value::GenericValueTypeChecker<Self>;
249
250    #[inline]
251    unsafe fn from_value(value: &'a glib::Value) -> Self {
252        skip_assert_initialized!();
253        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
254    }
255}
256
257impl ToValue for Layer {
258    #[inline]
259    fn to_value(&self) -> glib::Value {
260        let mut value = glib::Value::for_value_type::<Self>();
261        unsafe {
262            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
263        }
264        value
265    }
266
267    #[inline]
268    fn value_type(&self) -> glib::Type {
269        Self::static_type()
270    }
271}
272
273impl From<Layer> for glib::Value {
274    #[inline]
275    fn from(v: Layer) -> Self {
276        skip_assert_initialized!();
277        ToValue::to_value(&v)
278    }
279}
280
281/// Enumeration used to indicate a type of live region and how assertive it
282/// should be in terms of speaking notifications. Currently, this is only used
283/// for "notification" events, but it may be used for additional purposes
284/// in the future.
285#[cfg(feature = "v2_50")]
286#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
287#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
288#[non_exhaustive]
289#[doc(alias = "AtkLive")]
290pub enum Live {
291    /// No live region.
292    #[doc(alias = "ATK_LIVE_NONE")]
293    None,
294    /// This live region should be considered polite.
295    #[doc(alias = "ATK_LIVE_POLITE")]
296    Polite,
297    /// This live region should be considered assertive.
298    #[doc(alias = "ATK_LIVE_ASSERTIVE")]
299    Assertive,
300    #[doc(hidden)]
301    __Unknown(i32),
302}
303
304#[cfg(feature = "v2_50")]
305#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
306impl fmt::Display for Live {
307    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
308        write!(
309            f,
310            "Live::{}",
311            match *self {
312                Self::None => "None",
313                Self::Polite => "Polite",
314                Self::Assertive => "Assertive",
315                _ => "Unknown",
316            }
317        )
318    }
319}
320
321#[cfg(feature = "v2_50")]
322#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
323#[doc(hidden)]
324impl IntoGlib for Live {
325    type GlibType = ffi::AtkLive;
326
327    #[inline]
328    fn into_glib(self) -> ffi::AtkLive {
329        match self {
330            Self::None => ffi::ATK_LIVE_NONE,
331            Self::Polite => ffi::ATK_LIVE_POLITE,
332            Self::Assertive => ffi::ATK_LIVE_ASSERTIVE,
333            Self::__Unknown(value) => value,
334        }
335    }
336}
337
338#[cfg(feature = "v2_50")]
339#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
340#[doc(hidden)]
341impl FromGlib<ffi::AtkLive> for Live {
342    #[inline]
343    unsafe fn from_glib(value: ffi::AtkLive) -> Self {
344        skip_assert_initialized!();
345
346        match value {
347            ffi::ATK_LIVE_NONE => Self::None,
348            ffi::ATK_LIVE_POLITE => Self::Polite,
349            ffi::ATK_LIVE_ASSERTIVE => Self::Assertive,
350            value => Self::__Unknown(value),
351        }
352    }
353}
354
355#[cfg(feature = "v2_50")]
356#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
357impl StaticType for Live {
358    #[inline]
359    fn static_type() -> glib::Type {
360        unsafe { from_glib(ffi::atk_live_get_type()) }
361    }
362}
363
364#[cfg(feature = "v2_50")]
365#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
366impl glib::HasParamSpec for Live {
367    type ParamSpec = glib::ParamSpecEnum;
368    type SetValue = Self;
369    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
370
371    fn param_spec_builder() -> Self::BuilderFn {
372        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
373    }
374}
375
376#[cfg(feature = "v2_50")]
377#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
378impl glib::value::ValueType for Live {
379    type Type = Self;
380}
381
382#[cfg(feature = "v2_50")]
383#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
384unsafe impl<'a> glib::value::FromValue<'a> for Live {
385    type Checker = glib::value::GenericValueTypeChecker<Self>;
386
387    #[inline]
388    unsafe fn from_value(value: &'a glib::Value) -> Self {
389        skip_assert_initialized!();
390        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
391    }
392}
393
394#[cfg(feature = "v2_50")]
395#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
396impl ToValue for Live {
397    #[inline]
398    fn to_value(&self) -> glib::Value {
399        let mut value = glib::Value::for_value_type::<Self>();
400        unsafe {
401            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
402        }
403        value
404    }
405
406    #[inline]
407    fn value_type(&self) -> glib::Type {
408        Self::static_type()
409    }
410}
411
412#[cfg(feature = "v2_50")]
413#[cfg_attr(docsrs, doc(cfg(feature = "v2_50")))]
414impl From<Live> for glib::Value {
415    #[inline]
416    fn from(v: Live) -> Self {
417        skip_assert_initialized!();
418        ToValue::to_value(&v)
419    }
420}
421
422/// Describes the type of the relation
423#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
424#[non_exhaustive]
425#[doc(alias = "AtkRelationType")]
426pub enum RelationType {
427    /// Not used, represens "no relationship" or an error condition.
428    #[doc(alias = "ATK_RELATION_NULL")]
429    Null,
430    /// Indicates an object controlled by one or more target objects.
431    #[doc(alias = "ATK_RELATION_CONTROLLED_BY")]
432    ControlledBy,
433    /// Indicates an object is an controller for one or more target objects.
434    #[doc(alias = "ATK_RELATION_CONTROLLER_FOR")]
435    ControllerFor,
436    /// Indicates an object is a label for one or more target objects.
437    #[doc(alias = "ATK_RELATION_LABEL_FOR")]
438    LabelFor,
439    /// Indicates an object is labelled by one or more target objects.
440    #[doc(alias = "ATK_RELATION_LABELLED_BY")]
441    LabelledBy,
442    /// Indicates an object is a member of a group of one or more target objects.
443    #[doc(alias = "ATK_RELATION_MEMBER_OF")]
444    MemberOf,
445    /// Indicates an object is a cell in a treetable which is displayed because a cell in the same column is expanded and identifies that cell.
446    #[doc(alias = "ATK_RELATION_NODE_CHILD_OF")]
447    NodeChildOf,
448    /// Indicates that the object has content that flows logically to another
449    ///  AtkObject in a sequential way, (for instance text-flow).
450    #[doc(alias = "ATK_RELATION_FLOWS_TO")]
451    FlowsTo,
452    /// Indicates that the object has content that flows logically from
453    ///  another AtkObject in a sequential way, (for instance text-flow).
454    #[doc(alias = "ATK_RELATION_FLOWS_FROM")]
455    FlowsFrom,
456    /// Indicates a subwindow attached to a component but otherwise has no connection in the UI heirarchy to that component.
457    #[doc(alias = "ATK_RELATION_SUBWINDOW_OF")]
458    SubwindowOf,
459    /// Indicates that the object visually embeds
460    ///  another object's content, i.e. this object's content flows around
461    ///  another's content.
462    #[doc(alias = "ATK_RELATION_EMBEDS")]
463    Embeds,
464    /// Reciprocal of [`Embeds`][Self::Embeds], indicates that
465    ///  this object's content is visualy embedded in another object.
466    #[doc(alias = "ATK_RELATION_EMBEDDED_BY")]
467    EmbeddedBy,
468    /// Indicates that an object is a popup for another object.
469    #[doc(alias = "ATK_RELATION_POPUP_FOR")]
470    PopupFor,
471    /// Indicates that an object is a parent window of another object.
472    #[doc(alias = "ATK_RELATION_PARENT_WINDOW_OF")]
473    ParentWindowOf,
474    /// Reciprocal of [`DescriptionFor`][Self::DescriptionFor]. Indicates that one
475    /// or more target objects provide descriptive information about this object. This relation
476    /// type is most appropriate for information that is not essential as its presentation may
477    /// be user-configurable and/or limited to an on-demand mechanism such as an assistive
478    /// technology command. For brief, essential information such as can be found in a widget's
479    /// on-screen label, use [`LabelledBy`][Self::LabelledBy]. For an on-screen error message, use
480    /// [`ErrorMessage`][Self::ErrorMessage]. For lengthy extended descriptive information contained in
481    /// an on-screen object, consider using [`Details`][Self::Details] as assistive technologies may
482    /// provide a means for the user to navigate to objects containing detailed descriptions so
483    /// that their content can be more closely reviewed.
484    #[doc(alias = "ATK_RELATION_DESCRIBED_BY")]
485    DescribedBy,
486    /// Reciprocal of [`DescribedBy`][Self::DescribedBy]. Indicates that this
487    /// object provides descriptive information about the target object(s). See also
488    /// [`DetailsFor`][Self::DetailsFor] and [`ErrorFor`][Self::ErrorFor].
489    #[doc(alias = "ATK_RELATION_DESCRIPTION_FOR")]
490    DescriptionFor,
491    /// Indicates an object is a cell in a treetable and is expanded to display other cells in the same column.
492    #[doc(alias = "ATK_RELATION_NODE_PARENT_OF")]
493    NodeParentOf,
494    /// Reciprocal of [`DetailsFor`][Self::DetailsFor]. Indicates that this object
495    /// has a detailed or extended description, the contents of which can be found in the target
496    /// object(s). This relation type is most appropriate for information that is sufficiently
497    /// lengthy as to make navigation to the container of that information desirable. For less
498    /// verbose information suitable for announcement only, see [`DescribedBy`][Self::DescribedBy]. If
499    /// the detailed information describes an error condition, [`ErrorFor`][Self::ErrorFor] should be
500    /// used instead. `Since`: ATK-2.26.
501    #[doc(alias = "ATK_RELATION_DETAILS")]
502    Details,
503    /// Reciprocal of [`Details`][Self::Details]. Indicates that this object
504    /// provides a detailed or extended description about the target object(s). See also
505    /// [`DescriptionFor`][Self::DescriptionFor] and [`ErrorFor`][Self::ErrorFor]. `Since`: ATK-2.26.
506    #[doc(alias = "ATK_RELATION_DETAILS_FOR")]
507    DetailsFor,
508    /// Reciprocal of [`ErrorFor`][Self::ErrorFor]. Indicates that this object
509    /// has one or more errors, the nature of which is described in the contents of the target
510    /// object(s). Objects that have this relation type should also contain [`StateType::InvalidEntry`][crate::StateType::InvalidEntry]
511    /// in their [`StateSet`][crate::StateSet]. `Since`: ATK-2.26.
512    #[doc(alias = "ATK_RELATION_ERROR_MESSAGE")]
513    ErrorMessage,
514    /// Reciprocal of [`ErrorMessage`][Self::ErrorMessage]. Indicates that this object
515    /// contains an error message describing an invalid condition in the target object(s). `Since`:
516    /// ATK_2.26.
517    #[doc(alias = "ATK_RELATION_ERROR_FOR")]
518    ErrorFor,
519    /// Not used, this value indicates the end of the enumeration.
520    #[doc(alias = "ATK_RELATION_LAST_DEFINED")]
521    LastDefined,
522    #[doc(hidden)]
523    __Unknown(i32),
524}
525
526impl RelationType {
527    #[doc(alias = "atk_relation_type_for_name")]
528    pub fn for_name(name: &str) -> RelationType {
529        assert_initialized_main_thread!();
530        unsafe { from_glib(ffi::atk_relation_type_for_name(name.to_glib_none().0)) }
531    }
532
533    #[doc(alias = "atk_relation_type_get_name")]
534    #[doc(alias = "get_name")]
535    pub fn name(self) -> Option<glib::GString> {
536        assert_initialized_main_thread!();
537        unsafe { from_glib_none(ffi::atk_relation_type_get_name(self.into_glib())) }
538    }
539}
540
541impl fmt::Display for RelationType {
542    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
543        write!(
544            f,
545            "RelationType::{}",
546            match *self {
547                Self::Null => "Null",
548                Self::ControlledBy => "ControlledBy",
549                Self::ControllerFor => "ControllerFor",
550                Self::LabelFor => "LabelFor",
551                Self::LabelledBy => "LabelledBy",
552                Self::MemberOf => "MemberOf",
553                Self::NodeChildOf => "NodeChildOf",
554                Self::FlowsTo => "FlowsTo",
555                Self::FlowsFrom => "FlowsFrom",
556                Self::SubwindowOf => "SubwindowOf",
557                Self::Embeds => "Embeds",
558                Self::EmbeddedBy => "EmbeddedBy",
559                Self::PopupFor => "PopupFor",
560                Self::ParentWindowOf => "ParentWindowOf",
561                Self::DescribedBy => "DescribedBy",
562                Self::DescriptionFor => "DescriptionFor",
563                Self::NodeParentOf => "NodeParentOf",
564                Self::Details => "Details",
565                Self::DetailsFor => "DetailsFor",
566                Self::ErrorMessage => "ErrorMessage",
567                Self::ErrorFor => "ErrorFor",
568                Self::LastDefined => "LastDefined",
569                _ => "Unknown",
570            }
571        )
572    }
573}
574
575#[doc(hidden)]
576impl IntoGlib for RelationType {
577    type GlibType = ffi::AtkRelationType;
578
579    fn into_glib(self) -> ffi::AtkRelationType {
580        match self {
581            Self::Null => ffi::ATK_RELATION_NULL,
582            Self::ControlledBy => ffi::ATK_RELATION_CONTROLLED_BY,
583            Self::ControllerFor => ffi::ATK_RELATION_CONTROLLER_FOR,
584            Self::LabelFor => ffi::ATK_RELATION_LABEL_FOR,
585            Self::LabelledBy => ffi::ATK_RELATION_LABELLED_BY,
586            Self::MemberOf => ffi::ATK_RELATION_MEMBER_OF,
587            Self::NodeChildOf => ffi::ATK_RELATION_NODE_CHILD_OF,
588            Self::FlowsTo => ffi::ATK_RELATION_FLOWS_TO,
589            Self::FlowsFrom => ffi::ATK_RELATION_FLOWS_FROM,
590            Self::SubwindowOf => ffi::ATK_RELATION_SUBWINDOW_OF,
591            Self::Embeds => ffi::ATK_RELATION_EMBEDS,
592            Self::EmbeddedBy => ffi::ATK_RELATION_EMBEDDED_BY,
593            Self::PopupFor => ffi::ATK_RELATION_POPUP_FOR,
594            Self::ParentWindowOf => ffi::ATK_RELATION_PARENT_WINDOW_OF,
595            Self::DescribedBy => ffi::ATK_RELATION_DESCRIBED_BY,
596            Self::DescriptionFor => ffi::ATK_RELATION_DESCRIPTION_FOR,
597            Self::NodeParentOf => ffi::ATK_RELATION_NODE_PARENT_OF,
598            Self::Details => ffi::ATK_RELATION_DETAILS,
599            Self::DetailsFor => ffi::ATK_RELATION_DETAILS_FOR,
600            Self::ErrorMessage => ffi::ATK_RELATION_ERROR_MESSAGE,
601            Self::ErrorFor => ffi::ATK_RELATION_ERROR_FOR,
602            Self::LastDefined => ffi::ATK_RELATION_LAST_DEFINED,
603            Self::__Unknown(value) => value,
604        }
605    }
606}
607
608#[doc(hidden)]
609impl FromGlib<ffi::AtkRelationType> for RelationType {
610    unsafe fn from_glib(value: ffi::AtkRelationType) -> Self {
611        skip_assert_initialized!();
612
613        match value {
614            ffi::ATK_RELATION_NULL => Self::Null,
615            ffi::ATK_RELATION_CONTROLLED_BY => Self::ControlledBy,
616            ffi::ATK_RELATION_CONTROLLER_FOR => Self::ControllerFor,
617            ffi::ATK_RELATION_LABEL_FOR => Self::LabelFor,
618            ffi::ATK_RELATION_LABELLED_BY => Self::LabelledBy,
619            ffi::ATK_RELATION_MEMBER_OF => Self::MemberOf,
620            ffi::ATK_RELATION_NODE_CHILD_OF => Self::NodeChildOf,
621            ffi::ATK_RELATION_FLOWS_TO => Self::FlowsTo,
622            ffi::ATK_RELATION_FLOWS_FROM => Self::FlowsFrom,
623            ffi::ATK_RELATION_SUBWINDOW_OF => Self::SubwindowOf,
624            ffi::ATK_RELATION_EMBEDS => Self::Embeds,
625            ffi::ATK_RELATION_EMBEDDED_BY => Self::EmbeddedBy,
626            ffi::ATK_RELATION_POPUP_FOR => Self::PopupFor,
627            ffi::ATK_RELATION_PARENT_WINDOW_OF => Self::ParentWindowOf,
628            ffi::ATK_RELATION_DESCRIBED_BY => Self::DescribedBy,
629            ffi::ATK_RELATION_DESCRIPTION_FOR => Self::DescriptionFor,
630            ffi::ATK_RELATION_NODE_PARENT_OF => Self::NodeParentOf,
631            ffi::ATK_RELATION_DETAILS => Self::Details,
632            ffi::ATK_RELATION_DETAILS_FOR => Self::DetailsFor,
633            ffi::ATK_RELATION_ERROR_MESSAGE => Self::ErrorMessage,
634            ffi::ATK_RELATION_ERROR_FOR => Self::ErrorFor,
635            ffi::ATK_RELATION_LAST_DEFINED => Self::LastDefined,
636            value => Self::__Unknown(value),
637        }
638    }
639}
640
641impl StaticType for RelationType {
642    #[inline]
643    fn static_type() -> glib::Type {
644        unsafe { from_glib(ffi::atk_relation_type_get_type()) }
645    }
646}
647
648impl glib::HasParamSpec for RelationType {
649    type ParamSpec = glib::ParamSpecEnum;
650    type SetValue = Self;
651    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
652
653    fn param_spec_builder() -> Self::BuilderFn {
654        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
655    }
656}
657
658impl glib::value::ValueType for RelationType {
659    type Type = Self;
660}
661
662unsafe impl<'a> glib::value::FromValue<'a> for RelationType {
663    type Checker = glib::value::GenericValueTypeChecker<Self>;
664
665    #[inline]
666    unsafe fn from_value(value: &'a glib::Value) -> Self {
667        skip_assert_initialized!();
668        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
669    }
670}
671
672impl ToValue for RelationType {
673    #[inline]
674    fn to_value(&self) -> glib::Value {
675        let mut value = glib::Value::for_value_type::<Self>();
676        unsafe {
677            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
678        }
679        value
680    }
681
682    #[inline]
683    fn value_type(&self) -> glib::Type {
684        Self::static_type()
685    }
686}
687
688impl From<RelationType> for glib::Value {
689    #[inline]
690    fn from(v: RelationType) -> Self {
691        skip_assert_initialized!();
692        ToValue::to_value(&v)
693    }
694}
695
696/// Describes the role of an object
697///
698/// These are the built-in enumerated roles that UI components can have
699/// in ATK. Other roles may be added at runtime, so an AtkRole >=
700/// [`LastDefined`][Self::LastDefined] is not necessarily an error.
701#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
702#[non_exhaustive]
703#[doc(alias = "AtkRole")]
704pub enum Role {
705    /// Invalid role
706    #[doc(alias = "ATK_ROLE_INVALID")]
707    Invalid,
708    /// A label which represents an accelerator
709    #[doc(alias = "ATK_ROLE_ACCEL_LABEL")]
710    AcceleratorLabel,
711    /// An object which is an alert to the user. Assistive Technologies typically respond to ATK_ROLE_ALERT by reading the entire onscreen contents of containers advertising this role. Should be used for warning dialogs, etc.
712    #[doc(alias = "ATK_ROLE_ALERT")]
713    Alert,
714    /// An object which is an animated image
715    #[doc(alias = "ATK_ROLE_ANIMATION")]
716    Animation,
717    /// An arrow in one of the four cardinal directions
718    #[doc(alias = "ATK_ROLE_ARROW")]
719    Arrow,
720    /// An object that displays a calendar and allows the user to select a date
721    #[doc(alias = "ATK_ROLE_CALENDAR")]
722    Calendar,
723    /// An object that can be drawn into and is used to trap events
724    #[doc(alias = "ATK_ROLE_CANVAS")]
725    Canvas,
726    /// A choice that can be checked or unchecked and provides a separate indicator for the current state
727    #[doc(alias = "ATK_ROLE_CHECK_BOX")]
728    CheckBox,
729    /// A menu item with a check box
730    #[doc(alias = "ATK_ROLE_CHECK_MENU_ITEM")]
731    CheckMenuItem,
732    /// A specialized dialog that lets the user choose a color
733    #[doc(alias = "ATK_ROLE_COLOR_CHOOSER")]
734    ColorChooser,
735    /// The header for a column of data
736    #[doc(alias = "ATK_ROLE_COLUMN_HEADER")]
737    ColumnHeader,
738    /// A collapsible list of choices the user can select from
739    #[doc(alias = "ATK_ROLE_COMBO_BOX")]
740    ComboBox,
741    /// An object whose purpose is to allow a user to edit a date
742    #[doc(alias = "ATK_ROLE_DATE_EDITOR")]
743    DateEditor,
744    /// An inconifed internal frame within a DESKTOP_PANE
745    #[doc(alias = "ATK_ROLE_DESKTOP_ICON")]
746    DesktopIcon,
747    /// A pane that supports internal frames and iconified versions of those internal frames
748    #[doc(alias = "ATK_ROLE_DESKTOP_FRAME")]
749    DesktopFrame,
750    /// An object whose purpose is to allow a user to set a value
751    #[doc(alias = "ATK_ROLE_DIAL")]
752    Dial,
753    /// A top level window with title bar and a border
754    #[doc(alias = "ATK_ROLE_DIALOG")]
755    Dialog,
756    /// A pane that allows the user to navigate through and select the contents of a directory
757    #[doc(alias = "ATK_ROLE_DIRECTORY_PANE")]
758    DirectoryPane,
759    /// An object used for drawing custom user interface elements
760    #[doc(alias = "ATK_ROLE_DRAWING_AREA")]
761    DrawingArea,
762    /// A specialized dialog that lets the user choose a file
763    #[doc(alias = "ATK_ROLE_FILE_CHOOSER")]
764    FileChooser,
765    /// A object that fills up space in a user interface
766    #[doc(alias = "ATK_ROLE_FILLER")]
767    Filler,
768    /// A specialized dialog that lets the user choose a font
769    #[doc(alias = "ATK_ROLE_FONT_CHOOSER")]
770    FontChooser,
771    /// A top level window with a title bar, border, menubar, etc.
772    #[doc(alias = "ATK_ROLE_FRAME")]
773    Frame,
774    /// A pane that is guaranteed to be painted on top of all panes beneath it
775    #[doc(alias = "ATK_ROLE_GLASS_PANE")]
776    GlassPane,
777    /// A document container for HTML, whose children represent the document content
778    #[doc(alias = "ATK_ROLE_HTML_CONTAINER")]
779    HtmlContainer,
780    /// A small fixed size picture, typically used to decorate components
781    #[doc(alias = "ATK_ROLE_ICON")]
782    Icon,
783    /// An object whose primary purpose is to display an image
784    #[doc(alias = "ATK_ROLE_IMAGE")]
785    Image,
786    /// A frame-like object that is clipped by a desktop pane
787    #[doc(alias = "ATK_ROLE_INTERNAL_FRAME")]
788    InternalFrame,
789    /// An object used to present an icon or short string in an interface
790    #[doc(alias = "ATK_ROLE_LABEL")]
791    Label,
792    /// A specialized pane that allows its children to be drawn in layers, providing a form of stacking order
793    #[doc(alias = "ATK_ROLE_LAYERED_PANE")]
794    LayeredPane,
795    /// An object that presents a list of objects to the user and allows the user to select one or more of them
796    #[doc(alias = "ATK_ROLE_LIST")]
797    List,
798    /// An object that represents an element of a list
799    #[doc(alias = "ATK_ROLE_LIST_ITEM")]
800    ListItem,
801    /// An object usually found inside a menu bar that contains a list of actions the user can choose from
802    #[doc(alias = "ATK_ROLE_MENU")]
803    Menu,
804    /// An object usually drawn at the top of the primary dialog box of an application that contains a list of menus the user can choose from
805    #[doc(alias = "ATK_ROLE_MENU_BAR")]
806    MenuBar,
807    /// An object usually contained in a menu that presents an action the user can choose
808    #[doc(alias = "ATK_ROLE_MENU_ITEM")]
809    MenuItem,
810    /// A specialized pane whose primary use is inside a DIALOG
811    #[doc(alias = "ATK_ROLE_OPTION_PANE")]
812    OptionPane,
813    /// An object that is a child of a page tab list
814    #[doc(alias = "ATK_ROLE_PAGE_TAB")]
815    PageTab,
816    /// An object that presents a series of panels (or page tabs), one at a time, through some mechanism provided by the object
817    #[doc(alias = "ATK_ROLE_PAGE_TAB_LIST")]
818    PageTabList,
819    /// A generic container that is often used to group objects
820    #[doc(alias = "ATK_ROLE_PANEL")]
821    Panel,
822    /// A text object uses for passwords, or other places where the text content is not shown visibly to the user
823    #[doc(alias = "ATK_ROLE_PASSWORD_TEXT")]
824    PasswordText,
825    /// A temporary window that is usually used to offer the user a list of choices, and then hides when the user selects one of those choices
826    #[doc(alias = "ATK_ROLE_POPUP_MENU")]
827    PopupMenu,
828    /// An object used to indicate how much of a task has been completed
829    #[doc(alias = "ATK_ROLE_PROGRESS_BAR")]
830    ProgressBar,
831    /// An object the user can manipulate to tell the application to do something
832    #[doc(alias = "ATK_ROLE_PUSH_BUTTON")]
833    PushButton,
834    /// A specialized check box that will cause other radio buttons in the same group to become unchecked when this one is checked
835    #[doc(alias = "ATK_ROLE_RADIO_BUTTON")]
836    RadioButton,
837    /// A check menu item which belongs to a group. At each instant exactly one of the radio menu items from a group is selected
838    #[doc(alias = "ATK_ROLE_RADIO_MENU_ITEM")]
839    RadioMenuItem,
840    /// A specialized pane that has a glass pane and a layered pane as its children
841    #[doc(alias = "ATK_ROLE_ROOT_PANE")]
842    RootPane,
843    /// The header for a row of data
844    #[doc(alias = "ATK_ROLE_ROW_HEADER")]
845    RowHeader,
846    /// An object usually used to allow a user to incrementally view a large amount of data.
847    #[doc(alias = "ATK_ROLE_SCROLL_BAR")]
848    ScrollBar,
849    /// An object that allows a user to incrementally view a large amount of information
850    #[doc(alias = "ATK_ROLE_SCROLL_PANE")]
851    ScrollPane,
852    /// An object usually contained in a menu to provide a visible and logical separation of the contents in a menu
853    #[doc(alias = "ATK_ROLE_SEPARATOR")]
854    Separator,
855    /// An object that allows the user to select from a bounded range
856    #[doc(alias = "ATK_ROLE_SLIDER")]
857    Slider,
858    /// A specialized panel that presents two other panels at the same time
859    #[doc(alias = "ATK_ROLE_SPLIT_PANE")]
860    SplitPane,
861    /// An object used to get an integer or floating point number from the user
862    #[doc(alias = "ATK_ROLE_SPIN_BUTTON")]
863    SpinButton,
864    /// An object which reports messages of minor importance to the user
865    #[doc(alias = "ATK_ROLE_STATUSBAR")]
866    Statusbar,
867    /// An object used to represent information in terms of rows and columns
868    #[doc(alias = "ATK_ROLE_TABLE")]
869    Table,
870    /// A cell in a table
871    #[doc(alias = "ATK_ROLE_TABLE_CELL")]
872    TableCell,
873    /// The header for a column of a table
874    #[doc(alias = "ATK_ROLE_TABLE_COLUMN_HEADER")]
875    TableColumnHeader,
876    /// The header for a row of a table
877    #[doc(alias = "ATK_ROLE_TABLE_ROW_HEADER")]
878    TableRowHeader,
879    /// A menu item used to tear off and reattach its menu
880    #[doc(alias = "ATK_ROLE_TEAR_OFF_MENU_ITEM")]
881    TearOffMenuItem,
882    /// An object that represents an accessible terminal. (Since: 0.6)
883    #[doc(alias = "ATK_ROLE_TERMINAL")]
884    Terminal,
885    /// An interactive widget that supports multiple lines of text and
886    /// optionally accepts user input, but whose purpose is not to solicit user input.
887    /// Thus ATK_ROLE_TEXT is appropriate for the text view in a plain text editor
888    /// but inappropriate for an input field in a dialog box or web form. For widgets
889    /// whose purpose is to solicit input from the user, see ATK_ROLE_ENTRY and
890    /// ATK_ROLE_PASSWORD_TEXT. For generic objects which display a brief amount of
891    /// textual information, see ATK_ROLE_STATIC.
892    #[doc(alias = "ATK_ROLE_TEXT")]
893    Text,
894    /// A specialized push button that can be checked or unchecked, but does not provide a separate indicator for the current state
895    #[doc(alias = "ATK_ROLE_TOGGLE_BUTTON")]
896    ToggleButton,
897    /// A bar or palette usually composed of push buttons or toggle buttons
898    #[doc(alias = "ATK_ROLE_TOOL_BAR")]
899    ToolBar,
900    /// An object that provides information about another object
901    #[doc(alias = "ATK_ROLE_TOOL_TIP")]
902    ToolTip,
903    /// An object used to represent hierarchical information to the user
904    #[doc(alias = "ATK_ROLE_TREE")]
905    Tree,
906    /// An object capable of expanding and collapsing rows as well as showing multiple columns of data. (Since: 0.7)
907    #[doc(alias = "ATK_ROLE_TREE_TABLE")]
908    TreeTable,
909    /// The object contains some Accessible information, but its role is not known
910    #[doc(alias = "ATK_ROLE_UNKNOWN")]
911    Unknown,
912    /// An object usually used in a scroll pane
913    #[doc(alias = "ATK_ROLE_VIEWPORT")]
914    Viewport,
915    /// A top level window with no title or border.
916    #[doc(alias = "ATK_ROLE_WINDOW")]
917    Window,
918    /// An object that serves as a document header. (Since: 1.1.1)
919    #[doc(alias = "ATK_ROLE_HEADER")]
920    Header,
921    /// An object that serves as a document footer. (Since: 1.1.1)
922    #[doc(alias = "ATK_ROLE_FOOTER")]
923    Footer,
924    /// An object which is contains a paragraph of text content. (Since: 1.1.1)
925    #[doc(alias = "ATK_ROLE_PARAGRAPH")]
926    Paragraph,
927    /// An object which describes margins and tab stops, etc. for text objects which it controls (should have CONTROLLER_FOR relation to such). (Since: 1.1.1)
928    #[doc(alias = "ATK_ROLE_RULER")]
929    Ruler,
930    /// The object is an application object, which may contain [`Frame`][Self::Frame] objects or other types of accessibles. The root accessible of any application's ATK hierarchy should have ATK_ROLE_APPLICATION. (Since: 1.1.4)
931    #[doc(alias = "ATK_ROLE_APPLICATION")]
932    Application,
933    /// The object is a dialog or list containing items for insertion into an entry widget, for instance a list of words for completion of a text entry. (Since: 1.3)
934    #[doc(alias = "ATK_ROLE_AUTOCOMPLETE")]
935    Autocomplete,
936    /// The object is an editable text object in a toolbar. (Since: 1.5)
937    #[doc(alias = "ATK_ROLE_EDITBAR")]
938    EditBar,
939    /// The object is an embedded container within a document or panel. This role is a grouping "hint" indicating that the contained objects share a context. (Since: 1.7.2)
940    #[doc(alias = "ATK_ROLE_EMBEDDED")]
941    Embedded,
942    /// The object is a component whose textual content may be entered or modified by the user, provided [`StateType::Editable`][crate::StateType::Editable] is present. (Since: 1.11)
943    #[doc(alias = "ATK_ROLE_ENTRY")]
944    Entry,
945    /// The object is a graphical depiction of quantitative data. It may contain multiple subelements whose attributes and/or description may be queried to obtain both the quantitative data and information about how the data is being presented. The LABELLED_BY relation is particularly important in interpreting objects of this type, as is the accessible-description property. (Since: 1.11)
946    #[doc(alias = "ATK_ROLE_CHART")]
947    Chart,
948    /// The object contains descriptive information, usually textual, about another user interface element such as a table, chart, or image. (Since: 1.11)
949    #[doc(alias = "ATK_ROLE_CAPTION")]
950    Caption,
951    /// The object is a visual frame or container which contains a view of document content. Document frames may occur within another Document instance, in which case the second document may be said to be embedded in the containing instance. HTML frames are often ROLE_DOCUMENT_FRAME. Either this object, or a singleton descendant, should implement the Document interface. (Since: 1.11)
952    #[doc(alias = "ATK_ROLE_DOCUMENT_FRAME")]
953    DocumentFrame,
954    /// The object serves as a heading for content which follows it in a document. The 'heading level' of the heading, if availabe, may be obtained by querying the object's attributes.
955    #[doc(alias = "ATK_ROLE_HEADING")]
956    Heading,
957    /// The object is a containing instance which encapsulates a page of information. [`Page`][Self::Page] is used in documents and content which support a paginated navigation model. (Since: 1.11)
958    #[doc(alias = "ATK_ROLE_PAGE")]
959    Page,
960    /// The object is a containing instance of document content which constitutes a particular 'logical' section of the document. The type of content within a section, and the nature of the section division itself, may be obtained by querying the object's attributes. Sections may be nested. (Since: 1.11)
961    #[doc(alias = "ATK_ROLE_SECTION")]
962    Section,
963    /// The object is redundant with another object in the hierarchy, and is exposed for purely technical reasons. Objects of this role should normally be ignored by clients. (Since: 1.11)
964    #[doc(alias = "ATK_ROLE_REDUNDANT_OBJECT")]
965    RedundantObject,
966    /// The object is a container for form controls, for instance as part of a
967    /// web form or user-input form within a document. This role is primarily a tag/convenience for
968    /// clients when navigating complex documents, it is not expected that ordinary GUI containers will
969    /// always have ATK_ROLE_FORM. (Since: 1.12.0)
970    #[doc(alias = "ATK_ROLE_FORM")]
971    Form,
972    /// The object is a hypertext anchor, i.e. a "link" in a
973    /// hypertext document. Such objects are distinct from 'inline'
974    /// content which may also use the Hypertext/Hyperlink interfaces
975    /// to indicate the range/location within a text object where
976    /// an inline or embedded object lies. (Since: 1.12.1)
977    #[doc(alias = "ATK_ROLE_LINK")]
978    Link,
979    /// The object is a window or similar viewport
980    /// which is used to allow composition or input of a 'complex character',
981    /// in other words it is an "input method window." (Since: 1.12.1)
982    #[doc(alias = "ATK_ROLE_INPUT_METHOD_WINDOW")]
983    InputMethodWindow,
984    /// A row in a table. (Since: 2.1.0)
985    #[doc(alias = "ATK_ROLE_TABLE_ROW")]
986    TableRow,
987    /// An object that represents an element of a tree. (Since: 2.1.0)
988    #[doc(alias = "ATK_ROLE_TREE_ITEM")]
989    TreeItem,
990    /// A document frame which contains a spreadsheet. (Since: 2.1.0)
991    #[doc(alias = "ATK_ROLE_DOCUMENT_SPREADSHEET")]
992    DocumentSpreadsheet,
993    /// A document frame which contains a presentation or slide content. (Since: 2.1.0)
994    #[doc(alias = "ATK_ROLE_DOCUMENT_PRESENTATION")]
995    DocumentPresentation,
996    /// A document frame which contains textual content, such as found in a word processing application. (Since: 2.1.0)
997    #[doc(alias = "ATK_ROLE_DOCUMENT_TEXT")]
998    DocumentText,
999    /// A document frame which contains HTML or other markup suitable for display in a web browser. (Since: 2.1.0)
1000    #[doc(alias = "ATK_ROLE_DOCUMENT_WEB")]
1001    DocumentWeb,
1002    /// A document frame which contains email content to be displayed or composed either in plain text or HTML. (Since: 2.1.0)
1003    #[doc(alias = "ATK_ROLE_DOCUMENT_EMAIL")]
1004    DocumentEmail,
1005    /// An object found within a document and designed to present a comment, note, or other annotation. In some cases, this object might not be visible until activated. (Since: 2.1.0)
1006    #[doc(alias = "ATK_ROLE_COMMENT")]
1007    Comment,
1008    /// A non-collapsible list of choices the user can select from. (Since: 2.1.0)
1009    #[doc(alias = "ATK_ROLE_LIST_BOX")]
1010    ListBox,
1011    /// A group of related widgets. This group typically has a label. (Since: 2.1.0)
1012    #[doc(alias = "ATK_ROLE_GROUPING")]
1013    Grouping,
1014    /// An image map object. Usually a graphic with multiple hotspots, where each hotspot can be activated resulting in the loading of another document or section of a document. (Since: 2.1.0)
1015    #[doc(alias = "ATK_ROLE_IMAGE_MAP")]
1016    ImageMap,
1017    /// A transitory object designed to present a message to the user, typically at the desktop level rather than inside a particular application. (Since: 2.1.0)
1018    #[doc(alias = "ATK_ROLE_NOTIFICATION")]
1019    Notification,
1020    /// An object designed to present a message to the user within an existing window. (Since: 2.1.0)
1021    #[doc(alias = "ATK_ROLE_INFO_BAR")]
1022    InfoBar,
1023    /// A bar that serves as a level indicator to, for instance, show the strength of a password or the state of a battery. (Since: 2.7.3)
1024    #[doc(alias = "ATK_ROLE_LEVEL_BAR")]
1025    LevelBar,
1026    /// A bar that serves as the title of a window or a
1027    /// dialog. (Since: 2.12)
1028    #[doc(alias = "ATK_ROLE_TITLE_BAR")]
1029    TitleBar,
1030    /// An object which contains a text section
1031    /// that is quoted from another source. (Since: 2.12)
1032    #[doc(alias = "ATK_ROLE_BLOCK_QUOTE")]
1033    BlockQuote,
1034    /// An object which represents an audio element. (Since: 2.12)
1035    #[doc(alias = "ATK_ROLE_AUDIO")]
1036    Audio,
1037    /// An object which represents a video element. (Since: 2.12)
1038    #[doc(alias = "ATK_ROLE_VIDEO")]
1039    Video,
1040    /// A definition of a term or concept. (Since: 2.12)
1041    #[doc(alias = "ATK_ROLE_DEFINITION")]
1042    Definition,
1043    /// A section of a page that consists of a
1044    /// composition that forms an independent part of a document, page, or
1045    /// site. Examples: A blog entry, a news story, a forum post. (Since: 2.12)
1046    #[doc(alias = "ATK_ROLE_ARTICLE")]
1047    Article,
1048    /// A region of a web page intended as a
1049    /// navigational landmark. This is designed to allow Assistive
1050    /// Technologies to provide quick navigation among key regions within a
1051    /// document. (Since: 2.12)
1052    #[doc(alias = "ATK_ROLE_LANDMARK")]
1053    Landmark,
1054    /// A text widget or container holding log content, such
1055    /// as chat history and error logs. In this role there is a
1056    /// relationship between the arrival of new items in the log and the
1057    /// reading order. The log contains a meaningful sequence and new
1058    /// information is added only to the end of the log, not at arbitrary
1059    /// points. (Since: 2.12)
1060    #[doc(alias = "ATK_ROLE_LOG")]
1061    Log,
1062    /// A container where non-essential information
1063    /// changes frequently. Common usages of marquee include stock tickers
1064    /// and ad banners. The primary difference between a marquee and a log
1065    /// is that logs usually have a meaningful order or sequence of
1066    /// important content changes. (Since: 2.12)
1067    #[doc(alias = "ATK_ROLE_MARQUEE")]
1068    Marquee,
1069    /// A text widget or container that holds a mathematical
1070    /// expression. (Since: 2.12)
1071    #[doc(alias = "ATK_ROLE_MATH")]
1072    Math,
1073    /// A widget whose purpose is to display a rating,
1074    /// such as the number of stars associated with a song in a media
1075    /// player. Objects of this role should also implement
1076    /// AtkValue. (Since: 2.12)
1077    #[doc(alias = "ATK_ROLE_RATING")]
1078    Rating,
1079    /// An object containing a numerical counter which
1080    /// indicates an amount of elapsed time from a start point, or the time
1081    /// remaining until an end point. (Since: 2.12)
1082    #[doc(alias = "ATK_ROLE_TIMER")]
1083    Timer,
1084    /// An object that represents a list of
1085    /// term-value groups. A term-value group represents a individual
1086    /// description and consist of one or more names
1087    /// (ATK_ROLE_DESCRIPTION_TERM) followed by one or more values
1088    /// (ATK_ROLE_DESCRIPTION_VALUE). For each list, there should not be
1089    /// more than one group with the same term name. (Since: 2.12)
1090    #[doc(alias = "ATK_ROLE_DESCRIPTION_LIST")]
1091    DescriptionList,
1092    /// An object that represents a term or phrase
1093    /// with a corresponding definition. (Since: 2.12)
1094    #[doc(alias = "ATK_ROLE_DESCRIPTION_TERM")]
1095    DescriptionTerm,
1096    /// An object that represents the
1097    /// description, definition or value of a term. (Since: 2.12)
1098    #[doc(alias = "ATK_ROLE_DESCRIPTION_VALUE")]
1099    DescriptionValue,
1100    /// A generic non-container object whose purpose is to display a
1101    /// brief amount of information to the user and whose role is known by the
1102    /// implementor but lacks semantic value for the user. Examples in which
1103    /// [`Static`][Self::Static] is appropriate include the message displayed in a message box
1104    /// and an image used as an alternative means to display text. [`Static`][Self::Static]
1105    /// should not be applied to widgets which are traditionally interactive, objects
1106    /// which display a significant amount of content, or any object which has an
1107    /// accessible relation pointing to another object. Implementors should expose the
1108    /// displayed information through the accessible name of the object. If doing so seems
1109    /// inappropriate, it may indicate that a different role should be used. For
1110    /// labels which describe another widget, see [`Label`][Self::Label]. For text views, see
1111    /// [`Text`][Self::Text]. For generic containers, see [`Panel`][Self::Panel]. For objects whose
1112    /// role is not known by the implementor, see [`Unknown`][Self::Unknown]. (Since: 2.16)
1113    #[doc(alias = "ATK_ROLE_STATIC")]
1114    Static,
1115    /// An object that represents a mathematical fraction.
1116    /// (Since: 2.16)
1117    #[doc(alias = "ATK_ROLE_MATH_FRACTION")]
1118    MathFraction,
1119    /// An object that represents a mathematical expression
1120    /// displayed with a radical. (Since: 2.16)
1121    #[doc(alias = "ATK_ROLE_MATH_ROOT")]
1122    MathRoot,
1123    /// An object that contains text that is displayed as a
1124    /// subscript. (Since: 2.16)
1125    #[doc(alias = "ATK_ROLE_SUBSCRIPT")]
1126    Subscript,
1127    /// An object that contains text that is displayed as a
1128    /// superscript. (Since: 2.16)
1129    #[doc(alias = "ATK_ROLE_SUPERSCRIPT")]
1130    Superscript,
1131    /// An object that contains the text of a footnote. (Since: 2.26)
1132    #[doc(alias = "ATK_ROLE_FOOTNOTE")]
1133    Footnote,
1134    /// Content previously deleted or proposed to be
1135    /// deleted, e.g. in revision history or a content view providing suggestions
1136    /// from reviewers. (Since: 2.34)
1137    #[doc(alias = "ATK_ROLE_CONTENT_DELETION")]
1138    ContentDeletion,
1139    /// Content previously inserted or proposed to be
1140    /// inserted, e.g. in revision history or a content view providing suggestions
1141    /// from reviewers. (Since: 2.34)
1142    #[doc(alias = "ATK_ROLE_CONTENT_INSERTION")]
1143    ContentInsertion,
1144    /// A run of content that is marked or highlighted, such as for
1145    /// reference purposes, or to call it out as having a special purpose. If the
1146    /// marked content has an associated section in the document elaborating on the
1147    /// reason for the mark, then [`RelationType::Details`][crate::RelationType::Details] should be used on the mark
1148    /// to point to that associated section. In addition, the reciprocal relation
1149    /// [`RelationType::DetailsFor`][crate::RelationType::DetailsFor] should be used on the associated content section
1150    /// to point back to the mark. (Since: 2.36)
1151    #[doc(alias = "ATK_ROLE_MARK")]
1152    Mark,
1153    /// A container for content that is called out as a proposed
1154    /// change from the current version of the document, such as by a reviewer of the
1155    /// content. This role should include either [`ContentDeletion`][Self::ContentDeletion] and/or
1156    /// [`ContentInsertion`][Self::ContentInsertion] children, in any order, to indicate what the
1157    /// actual change is. (Since: 2.36)
1158    #[doc(alias = "ATK_ROLE_SUGGESTION")]
1159    Suggestion,
1160    /// A specialized push button to open a menu.
1161    /// (Since: 2.46)
1162    #[doc(alias = "ATK_ROLE_PUSH_BUTTON_MENU")]
1163    PushButtonMenu,
1164    /// not a valid role, used for finding end of the enumeration
1165    #[doc(alias = "ATK_ROLE_LAST_DEFINED")]
1166    LastDefined,
1167    #[doc(hidden)]
1168    __Unknown(i32),
1169}
1170
1171impl Role {
1172    #[doc(alias = "atk_role_for_name")]
1173    pub fn for_name(name: &str) -> Role {
1174        assert_initialized_main_thread!();
1175        unsafe { from_glib(ffi::atk_role_for_name(name.to_glib_none().0)) }
1176    }
1177
1178    #[doc(alias = "atk_role_get_localized_name")]
1179    #[doc(alias = "get_localized_name")]
1180    pub fn localized_name(self) -> Option<glib::GString> {
1181        assert_initialized_main_thread!();
1182        unsafe { from_glib_none(ffi::atk_role_get_localized_name(self.into_glib())) }
1183    }
1184
1185    #[doc(alias = "atk_role_get_name")]
1186    #[doc(alias = "get_name")]
1187    pub fn name(self) -> Option<glib::GString> {
1188        assert_initialized_main_thread!();
1189        unsafe { from_glib_none(ffi::atk_role_get_name(self.into_glib())) }
1190    }
1191}
1192
1193impl fmt::Display for Role {
1194    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1195        write!(
1196            f,
1197            "Role::{}",
1198            match *self {
1199                Self::Invalid => "Invalid",
1200                Self::AcceleratorLabel => "AcceleratorLabel",
1201                Self::Alert => "Alert",
1202                Self::Animation => "Animation",
1203                Self::Arrow => "Arrow",
1204                Self::Calendar => "Calendar",
1205                Self::Canvas => "Canvas",
1206                Self::CheckBox => "CheckBox",
1207                Self::CheckMenuItem => "CheckMenuItem",
1208                Self::ColorChooser => "ColorChooser",
1209                Self::ColumnHeader => "ColumnHeader",
1210                Self::ComboBox => "ComboBox",
1211                Self::DateEditor => "DateEditor",
1212                Self::DesktopIcon => "DesktopIcon",
1213                Self::DesktopFrame => "DesktopFrame",
1214                Self::Dial => "Dial",
1215                Self::Dialog => "Dialog",
1216                Self::DirectoryPane => "DirectoryPane",
1217                Self::DrawingArea => "DrawingArea",
1218                Self::FileChooser => "FileChooser",
1219                Self::Filler => "Filler",
1220                Self::FontChooser => "FontChooser",
1221                Self::Frame => "Frame",
1222                Self::GlassPane => "GlassPane",
1223                Self::HtmlContainer => "HtmlContainer",
1224                Self::Icon => "Icon",
1225                Self::Image => "Image",
1226                Self::InternalFrame => "InternalFrame",
1227                Self::Label => "Label",
1228                Self::LayeredPane => "LayeredPane",
1229                Self::List => "List",
1230                Self::ListItem => "ListItem",
1231                Self::Menu => "Menu",
1232                Self::MenuBar => "MenuBar",
1233                Self::MenuItem => "MenuItem",
1234                Self::OptionPane => "OptionPane",
1235                Self::PageTab => "PageTab",
1236                Self::PageTabList => "PageTabList",
1237                Self::Panel => "Panel",
1238                Self::PasswordText => "PasswordText",
1239                Self::PopupMenu => "PopupMenu",
1240                Self::ProgressBar => "ProgressBar",
1241                Self::PushButton => "PushButton",
1242                Self::RadioButton => "RadioButton",
1243                Self::RadioMenuItem => "RadioMenuItem",
1244                Self::RootPane => "RootPane",
1245                Self::RowHeader => "RowHeader",
1246                Self::ScrollBar => "ScrollBar",
1247                Self::ScrollPane => "ScrollPane",
1248                Self::Separator => "Separator",
1249                Self::Slider => "Slider",
1250                Self::SplitPane => "SplitPane",
1251                Self::SpinButton => "SpinButton",
1252                Self::Statusbar => "Statusbar",
1253                Self::Table => "Table",
1254                Self::TableCell => "TableCell",
1255                Self::TableColumnHeader => "TableColumnHeader",
1256                Self::TableRowHeader => "TableRowHeader",
1257                Self::TearOffMenuItem => "TearOffMenuItem",
1258                Self::Terminal => "Terminal",
1259                Self::Text => "Text",
1260                Self::ToggleButton => "ToggleButton",
1261                Self::ToolBar => "ToolBar",
1262                Self::ToolTip => "ToolTip",
1263                Self::Tree => "Tree",
1264                Self::TreeTable => "TreeTable",
1265                Self::Unknown => "Unknown",
1266                Self::Viewport => "Viewport",
1267                Self::Window => "Window",
1268                Self::Header => "Header",
1269                Self::Footer => "Footer",
1270                Self::Paragraph => "Paragraph",
1271                Self::Ruler => "Ruler",
1272                Self::Application => "Application",
1273                Self::Autocomplete => "Autocomplete",
1274                Self::EditBar => "EditBar",
1275                Self::Embedded => "Embedded",
1276                Self::Entry => "Entry",
1277                Self::Chart => "Chart",
1278                Self::Caption => "Caption",
1279                Self::DocumentFrame => "DocumentFrame",
1280                Self::Heading => "Heading",
1281                Self::Page => "Page",
1282                Self::Section => "Section",
1283                Self::RedundantObject => "RedundantObject",
1284                Self::Form => "Form",
1285                Self::Link => "Link",
1286                Self::InputMethodWindow => "InputMethodWindow",
1287                Self::TableRow => "TableRow",
1288                Self::TreeItem => "TreeItem",
1289                Self::DocumentSpreadsheet => "DocumentSpreadsheet",
1290                Self::DocumentPresentation => "DocumentPresentation",
1291                Self::DocumentText => "DocumentText",
1292                Self::DocumentWeb => "DocumentWeb",
1293                Self::DocumentEmail => "DocumentEmail",
1294                Self::Comment => "Comment",
1295                Self::ListBox => "ListBox",
1296                Self::Grouping => "Grouping",
1297                Self::ImageMap => "ImageMap",
1298                Self::Notification => "Notification",
1299                Self::InfoBar => "InfoBar",
1300                Self::LevelBar => "LevelBar",
1301                Self::TitleBar => "TitleBar",
1302                Self::BlockQuote => "BlockQuote",
1303                Self::Audio => "Audio",
1304                Self::Video => "Video",
1305                Self::Definition => "Definition",
1306                Self::Article => "Article",
1307                Self::Landmark => "Landmark",
1308                Self::Log => "Log",
1309                Self::Marquee => "Marquee",
1310                Self::Math => "Math",
1311                Self::Rating => "Rating",
1312                Self::Timer => "Timer",
1313                Self::DescriptionList => "DescriptionList",
1314                Self::DescriptionTerm => "DescriptionTerm",
1315                Self::DescriptionValue => "DescriptionValue",
1316                Self::Static => "Static",
1317                Self::MathFraction => "MathFraction",
1318                Self::MathRoot => "MathRoot",
1319                Self::Subscript => "Subscript",
1320                Self::Superscript => "Superscript",
1321                Self::Footnote => "Footnote",
1322                Self::ContentDeletion => "ContentDeletion",
1323                Self::ContentInsertion => "ContentInsertion",
1324                Self::Mark => "Mark",
1325                Self::Suggestion => "Suggestion",
1326                Self::PushButtonMenu => "PushButtonMenu",
1327                Self::LastDefined => "LastDefined",
1328                _ => "Unknown",
1329            }
1330        )
1331    }
1332}
1333
1334#[doc(hidden)]
1335impl IntoGlib for Role {
1336    type GlibType = ffi::AtkRole;
1337
1338    fn into_glib(self) -> ffi::AtkRole {
1339        match self {
1340            Self::Invalid => ffi::ATK_ROLE_INVALID,
1341            Self::AcceleratorLabel => ffi::ATK_ROLE_ACCEL_LABEL,
1342            Self::Alert => ffi::ATK_ROLE_ALERT,
1343            Self::Animation => ffi::ATK_ROLE_ANIMATION,
1344            Self::Arrow => ffi::ATK_ROLE_ARROW,
1345            Self::Calendar => ffi::ATK_ROLE_CALENDAR,
1346            Self::Canvas => ffi::ATK_ROLE_CANVAS,
1347            Self::CheckBox => ffi::ATK_ROLE_CHECK_BOX,
1348            Self::CheckMenuItem => ffi::ATK_ROLE_CHECK_MENU_ITEM,
1349            Self::ColorChooser => ffi::ATK_ROLE_COLOR_CHOOSER,
1350            Self::ColumnHeader => ffi::ATK_ROLE_COLUMN_HEADER,
1351            Self::ComboBox => ffi::ATK_ROLE_COMBO_BOX,
1352            Self::DateEditor => ffi::ATK_ROLE_DATE_EDITOR,
1353            Self::DesktopIcon => ffi::ATK_ROLE_DESKTOP_ICON,
1354            Self::DesktopFrame => ffi::ATK_ROLE_DESKTOP_FRAME,
1355            Self::Dial => ffi::ATK_ROLE_DIAL,
1356            Self::Dialog => ffi::ATK_ROLE_DIALOG,
1357            Self::DirectoryPane => ffi::ATK_ROLE_DIRECTORY_PANE,
1358            Self::DrawingArea => ffi::ATK_ROLE_DRAWING_AREA,
1359            Self::FileChooser => ffi::ATK_ROLE_FILE_CHOOSER,
1360            Self::Filler => ffi::ATK_ROLE_FILLER,
1361            Self::FontChooser => ffi::ATK_ROLE_FONT_CHOOSER,
1362            Self::Frame => ffi::ATK_ROLE_FRAME,
1363            Self::GlassPane => ffi::ATK_ROLE_GLASS_PANE,
1364            Self::HtmlContainer => ffi::ATK_ROLE_HTML_CONTAINER,
1365            Self::Icon => ffi::ATK_ROLE_ICON,
1366            Self::Image => ffi::ATK_ROLE_IMAGE,
1367            Self::InternalFrame => ffi::ATK_ROLE_INTERNAL_FRAME,
1368            Self::Label => ffi::ATK_ROLE_LABEL,
1369            Self::LayeredPane => ffi::ATK_ROLE_LAYERED_PANE,
1370            Self::List => ffi::ATK_ROLE_LIST,
1371            Self::ListItem => ffi::ATK_ROLE_LIST_ITEM,
1372            Self::Menu => ffi::ATK_ROLE_MENU,
1373            Self::MenuBar => ffi::ATK_ROLE_MENU_BAR,
1374            Self::MenuItem => ffi::ATK_ROLE_MENU_ITEM,
1375            Self::OptionPane => ffi::ATK_ROLE_OPTION_PANE,
1376            Self::PageTab => ffi::ATK_ROLE_PAGE_TAB,
1377            Self::PageTabList => ffi::ATK_ROLE_PAGE_TAB_LIST,
1378            Self::Panel => ffi::ATK_ROLE_PANEL,
1379            Self::PasswordText => ffi::ATK_ROLE_PASSWORD_TEXT,
1380            Self::PopupMenu => ffi::ATK_ROLE_POPUP_MENU,
1381            Self::ProgressBar => ffi::ATK_ROLE_PROGRESS_BAR,
1382            Self::PushButton => ffi::ATK_ROLE_PUSH_BUTTON,
1383            Self::RadioButton => ffi::ATK_ROLE_RADIO_BUTTON,
1384            Self::RadioMenuItem => ffi::ATK_ROLE_RADIO_MENU_ITEM,
1385            Self::RootPane => ffi::ATK_ROLE_ROOT_PANE,
1386            Self::RowHeader => ffi::ATK_ROLE_ROW_HEADER,
1387            Self::ScrollBar => ffi::ATK_ROLE_SCROLL_BAR,
1388            Self::ScrollPane => ffi::ATK_ROLE_SCROLL_PANE,
1389            Self::Separator => ffi::ATK_ROLE_SEPARATOR,
1390            Self::Slider => ffi::ATK_ROLE_SLIDER,
1391            Self::SplitPane => ffi::ATK_ROLE_SPLIT_PANE,
1392            Self::SpinButton => ffi::ATK_ROLE_SPIN_BUTTON,
1393            Self::Statusbar => ffi::ATK_ROLE_STATUSBAR,
1394            Self::Table => ffi::ATK_ROLE_TABLE,
1395            Self::TableCell => ffi::ATK_ROLE_TABLE_CELL,
1396            Self::TableColumnHeader => ffi::ATK_ROLE_TABLE_COLUMN_HEADER,
1397            Self::TableRowHeader => ffi::ATK_ROLE_TABLE_ROW_HEADER,
1398            Self::TearOffMenuItem => ffi::ATK_ROLE_TEAR_OFF_MENU_ITEM,
1399            Self::Terminal => ffi::ATK_ROLE_TERMINAL,
1400            Self::Text => ffi::ATK_ROLE_TEXT,
1401            Self::ToggleButton => ffi::ATK_ROLE_TOGGLE_BUTTON,
1402            Self::ToolBar => ffi::ATK_ROLE_TOOL_BAR,
1403            Self::ToolTip => ffi::ATK_ROLE_TOOL_TIP,
1404            Self::Tree => ffi::ATK_ROLE_TREE,
1405            Self::TreeTable => ffi::ATK_ROLE_TREE_TABLE,
1406            Self::Unknown => ffi::ATK_ROLE_UNKNOWN,
1407            Self::Viewport => ffi::ATK_ROLE_VIEWPORT,
1408            Self::Window => ffi::ATK_ROLE_WINDOW,
1409            Self::Header => ffi::ATK_ROLE_HEADER,
1410            Self::Footer => ffi::ATK_ROLE_FOOTER,
1411            Self::Paragraph => ffi::ATK_ROLE_PARAGRAPH,
1412            Self::Ruler => ffi::ATK_ROLE_RULER,
1413            Self::Application => ffi::ATK_ROLE_APPLICATION,
1414            Self::Autocomplete => ffi::ATK_ROLE_AUTOCOMPLETE,
1415            Self::EditBar => ffi::ATK_ROLE_EDITBAR,
1416            Self::Embedded => ffi::ATK_ROLE_EMBEDDED,
1417            Self::Entry => ffi::ATK_ROLE_ENTRY,
1418            Self::Chart => ffi::ATK_ROLE_CHART,
1419            Self::Caption => ffi::ATK_ROLE_CAPTION,
1420            Self::DocumentFrame => ffi::ATK_ROLE_DOCUMENT_FRAME,
1421            Self::Heading => ffi::ATK_ROLE_HEADING,
1422            Self::Page => ffi::ATK_ROLE_PAGE,
1423            Self::Section => ffi::ATK_ROLE_SECTION,
1424            Self::RedundantObject => ffi::ATK_ROLE_REDUNDANT_OBJECT,
1425            Self::Form => ffi::ATK_ROLE_FORM,
1426            Self::Link => ffi::ATK_ROLE_LINK,
1427            Self::InputMethodWindow => ffi::ATK_ROLE_INPUT_METHOD_WINDOW,
1428            Self::TableRow => ffi::ATK_ROLE_TABLE_ROW,
1429            Self::TreeItem => ffi::ATK_ROLE_TREE_ITEM,
1430            Self::DocumentSpreadsheet => ffi::ATK_ROLE_DOCUMENT_SPREADSHEET,
1431            Self::DocumentPresentation => ffi::ATK_ROLE_DOCUMENT_PRESENTATION,
1432            Self::DocumentText => ffi::ATK_ROLE_DOCUMENT_TEXT,
1433            Self::DocumentWeb => ffi::ATK_ROLE_DOCUMENT_WEB,
1434            Self::DocumentEmail => ffi::ATK_ROLE_DOCUMENT_EMAIL,
1435            Self::Comment => ffi::ATK_ROLE_COMMENT,
1436            Self::ListBox => ffi::ATK_ROLE_LIST_BOX,
1437            Self::Grouping => ffi::ATK_ROLE_GROUPING,
1438            Self::ImageMap => ffi::ATK_ROLE_IMAGE_MAP,
1439            Self::Notification => ffi::ATK_ROLE_NOTIFICATION,
1440            Self::InfoBar => ffi::ATK_ROLE_INFO_BAR,
1441            Self::LevelBar => ffi::ATK_ROLE_LEVEL_BAR,
1442            Self::TitleBar => ffi::ATK_ROLE_TITLE_BAR,
1443            Self::BlockQuote => ffi::ATK_ROLE_BLOCK_QUOTE,
1444            Self::Audio => ffi::ATK_ROLE_AUDIO,
1445            Self::Video => ffi::ATK_ROLE_VIDEO,
1446            Self::Definition => ffi::ATK_ROLE_DEFINITION,
1447            Self::Article => ffi::ATK_ROLE_ARTICLE,
1448            Self::Landmark => ffi::ATK_ROLE_LANDMARK,
1449            Self::Log => ffi::ATK_ROLE_LOG,
1450            Self::Marquee => ffi::ATK_ROLE_MARQUEE,
1451            Self::Math => ffi::ATK_ROLE_MATH,
1452            Self::Rating => ffi::ATK_ROLE_RATING,
1453            Self::Timer => ffi::ATK_ROLE_TIMER,
1454            Self::DescriptionList => ffi::ATK_ROLE_DESCRIPTION_LIST,
1455            Self::DescriptionTerm => ffi::ATK_ROLE_DESCRIPTION_TERM,
1456            Self::DescriptionValue => ffi::ATK_ROLE_DESCRIPTION_VALUE,
1457            Self::Static => ffi::ATK_ROLE_STATIC,
1458            Self::MathFraction => ffi::ATK_ROLE_MATH_FRACTION,
1459            Self::MathRoot => ffi::ATK_ROLE_MATH_ROOT,
1460            Self::Subscript => ffi::ATK_ROLE_SUBSCRIPT,
1461            Self::Superscript => ffi::ATK_ROLE_SUPERSCRIPT,
1462            Self::Footnote => ffi::ATK_ROLE_FOOTNOTE,
1463            Self::ContentDeletion => ffi::ATK_ROLE_CONTENT_DELETION,
1464            Self::ContentInsertion => ffi::ATK_ROLE_CONTENT_INSERTION,
1465            Self::Mark => ffi::ATK_ROLE_MARK,
1466            Self::Suggestion => ffi::ATK_ROLE_SUGGESTION,
1467            Self::PushButtonMenu => ffi::ATK_ROLE_PUSH_BUTTON_MENU,
1468            Self::LastDefined => ffi::ATK_ROLE_LAST_DEFINED,
1469            Self::__Unknown(value) => value,
1470        }
1471    }
1472}
1473
1474#[doc(hidden)]
1475impl FromGlib<ffi::AtkRole> for Role {
1476    unsafe fn from_glib(value: ffi::AtkRole) -> Self {
1477        skip_assert_initialized!();
1478
1479        match value {
1480            ffi::ATK_ROLE_INVALID => Self::Invalid,
1481            ffi::ATK_ROLE_ACCEL_LABEL => Self::AcceleratorLabel,
1482            ffi::ATK_ROLE_ALERT => Self::Alert,
1483            ffi::ATK_ROLE_ANIMATION => Self::Animation,
1484            ffi::ATK_ROLE_ARROW => Self::Arrow,
1485            ffi::ATK_ROLE_CALENDAR => Self::Calendar,
1486            ffi::ATK_ROLE_CANVAS => Self::Canvas,
1487            ffi::ATK_ROLE_CHECK_BOX => Self::CheckBox,
1488            ffi::ATK_ROLE_CHECK_MENU_ITEM => Self::CheckMenuItem,
1489            ffi::ATK_ROLE_COLOR_CHOOSER => Self::ColorChooser,
1490            ffi::ATK_ROLE_COLUMN_HEADER => Self::ColumnHeader,
1491            ffi::ATK_ROLE_COMBO_BOX => Self::ComboBox,
1492            ffi::ATK_ROLE_DATE_EDITOR => Self::DateEditor,
1493            ffi::ATK_ROLE_DESKTOP_ICON => Self::DesktopIcon,
1494            ffi::ATK_ROLE_DESKTOP_FRAME => Self::DesktopFrame,
1495            ffi::ATK_ROLE_DIAL => Self::Dial,
1496            ffi::ATK_ROLE_DIALOG => Self::Dialog,
1497            ffi::ATK_ROLE_DIRECTORY_PANE => Self::DirectoryPane,
1498            ffi::ATK_ROLE_DRAWING_AREA => Self::DrawingArea,
1499            ffi::ATK_ROLE_FILE_CHOOSER => Self::FileChooser,
1500            ffi::ATK_ROLE_FILLER => Self::Filler,
1501            ffi::ATK_ROLE_FONT_CHOOSER => Self::FontChooser,
1502            ffi::ATK_ROLE_FRAME => Self::Frame,
1503            ffi::ATK_ROLE_GLASS_PANE => Self::GlassPane,
1504            ffi::ATK_ROLE_HTML_CONTAINER => Self::HtmlContainer,
1505            ffi::ATK_ROLE_ICON => Self::Icon,
1506            ffi::ATK_ROLE_IMAGE => Self::Image,
1507            ffi::ATK_ROLE_INTERNAL_FRAME => Self::InternalFrame,
1508            ffi::ATK_ROLE_LABEL => Self::Label,
1509            ffi::ATK_ROLE_LAYERED_PANE => Self::LayeredPane,
1510            ffi::ATK_ROLE_LIST => Self::List,
1511            ffi::ATK_ROLE_LIST_ITEM => Self::ListItem,
1512            ffi::ATK_ROLE_MENU => Self::Menu,
1513            ffi::ATK_ROLE_MENU_BAR => Self::MenuBar,
1514            ffi::ATK_ROLE_MENU_ITEM => Self::MenuItem,
1515            ffi::ATK_ROLE_OPTION_PANE => Self::OptionPane,
1516            ffi::ATK_ROLE_PAGE_TAB => Self::PageTab,
1517            ffi::ATK_ROLE_PAGE_TAB_LIST => Self::PageTabList,
1518            ffi::ATK_ROLE_PANEL => Self::Panel,
1519            ffi::ATK_ROLE_PASSWORD_TEXT => Self::PasswordText,
1520            ffi::ATK_ROLE_POPUP_MENU => Self::PopupMenu,
1521            ffi::ATK_ROLE_PROGRESS_BAR => Self::ProgressBar,
1522            ffi::ATK_ROLE_PUSH_BUTTON => Self::PushButton,
1523            ffi::ATK_ROLE_RADIO_BUTTON => Self::RadioButton,
1524            ffi::ATK_ROLE_RADIO_MENU_ITEM => Self::RadioMenuItem,
1525            ffi::ATK_ROLE_ROOT_PANE => Self::RootPane,
1526            ffi::ATK_ROLE_ROW_HEADER => Self::RowHeader,
1527            ffi::ATK_ROLE_SCROLL_BAR => Self::ScrollBar,
1528            ffi::ATK_ROLE_SCROLL_PANE => Self::ScrollPane,
1529            ffi::ATK_ROLE_SEPARATOR => Self::Separator,
1530            ffi::ATK_ROLE_SLIDER => Self::Slider,
1531            ffi::ATK_ROLE_SPLIT_PANE => Self::SplitPane,
1532            ffi::ATK_ROLE_SPIN_BUTTON => Self::SpinButton,
1533            ffi::ATK_ROLE_STATUSBAR => Self::Statusbar,
1534            ffi::ATK_ROLE_TABLE => Self::Table,
1535            ffi::ATK_ROLE_TABLE_CELL => Self::TableCell,
1536            ffi::ATK_ROLE_TABLE_COLUMN_HEADER => Self::TableColumnHeader,
1537            ffi::ATK_ROLE_TABLE_ROW_HEADER => Self::TableRowHeader,
1538            ffi::ATK_ROLE_TEAR_OFF_MENU_ITEM => Self::TearOffMenuItem,
1539            ffi::ATK_ROLE_TERMINAL => Self::Terminal,
1540            ffi::ATK_ROLE_TEXT => Self::Text,
1541            ffi::ATK_ROLE_TOGGLE_BUTTON => Self::ToggleButton,
1542            ffi::ATK_ROLE_TOOL_BAR => Self::ToolBar,
1543            ffi::ATK_ROLE_TOOL_TIP => Self::ToolTip,
1544            ffi::ATK_ROLE_TREE => Self::Tree,
1545            ffi::ATK_ROLE_TREE_TABLE => Self::TreeTable,
1546            ffi::ATK_ROLE_UNKNOWN => Self::Unknown,
1547            ffi::ATK_ROLE_VIEWPORT => Self::Viewport,
1548            ffi::ATK_ROLE_WINDOW => Self::Window,
1549            ffi::ATK_ROLE_HEADER => Self::Header,
1550            ffi::ATK_ROLE_FOOTER => Self::Footer,
1551            ffi::ATK_ROLE_PARAGRAPH => Self::Paragraph,
1552            ffi::ATK_ROLE_RULER => Self::Ruler,
1553            ffi::ATK_ROLE_APPLICATION => Self::Application,
1554            ffi::ATK_ROLE_AUTOCOMPLETE => Self::Autocomplete,
1555            ffi::ATK_ROLE_EDITBAR => Self::EditBar,
1556            ffi::ATK_ROLE_EMBEDDED => Self::Embedded,
1557            ffi::ATK_ROLE_ENTRY => Self::Entry,
1558            ffi::ATK_ROLE_CHART => Self::Chart,
1559            ffi::ATK_ROLE_CAPTION => Self::Caption,
1560            ffi::ATK_ROLE_DOCUMENT_FRAME => Self::DocumentFrame,
1561            ffi::ATK_ROLE_HEADING => Self::Heading,
1562            ffi::ATK_ROLE_PAGE => Self::Page,
1563            ffi::ATK_ROLE_SECTION => Self::Section,
1564            ffi::ATK_ROLE_REDUNDANT_OBJECT => Self::RedundantObject,
1565            ffi::ATK_ROLE_FORM => Self::Form,
1566            ffi::ATK_ROLE_LINK => Self::Link,
1567            ffi::ATK_ROLE_INPUT_METHOD_WINDOW => Self::InputMethodWindow,
1568            ffi::ATK_ROLE_TABLE_ROW => Self::TableRow,
1569            ffi::ATK_ROLE_TREE_ITEM => Self::TreeItem,
1570            ffi::ATK_ROLE_DOCUMENT_SPREADSHEET => Self::DocumentSpreadsheet,
1571            ffi::ATK_ROLE_DOCUMENT_PRESENTATION => Self::DocumentPresentation,
1572            ffi::ATK_ROLE_DOCUMENT_TEXT => Self::DocumentText,
1573            ffi::ATK_ROLE_DOCUMENT_WEB => Self::DocumentWeb,
1574            ffi::ATK_ROLE_DOCUMENT_EMAIL => Self::DocumentEmail,
1575            ffi::ATK_ROLE_COMMENT => Self::Comment,
1576            ffi::ATK_ROLE_LIST_BOX => Self::ListBox,
1577            ffi::ATK_ROLE_GROUPING => Self::Grouping,
1578            ffi::ATK_ROLE_IMAGE_MAP => Self::ImageMap,
1579            ffi::ATK_ROLE_NOTIFICATION => Self::Notification,
1580            ffi::ATK_ROLE_INFO_BAR => Self::InfoBar,
1581            ffi::ATK_ROLE_LEVEL_BAR => Self::LevelBar,
1582            ffi::ATK_ROLE_TITLE_BAR => Self::TitleBar,
1583            ffi::ATK_ROLE_BLOCK_QUOTE => Self::BlockQuote,
1584            ffi::ATK_ROLE_AUDIO => Self::Audio,
1585            ffi::ATK_ROLE_VIDEO => Self::Video,
1586            ffi::ATK_ROLE_DEFINITION => Self::Definition,
1587            ffi::ATK_ROLE_ARTICLE => Self::Article,
1588            ffi::ATK_ROLE_LANDMARK => Self::Landmark,
1589            ffi::ATK_ROLE_LOG => Self::Log,
1590            ffi::ATK_ROLE_MARQUEE => Self::Marquee,
1591            ffi::ATK_ROLE_MATH => Self::Math,
1592            ffi::ATK_ROLE_RATING => Self::Rating,
1593            ffi::ATK_ROLE_TIMER => Self::Timer,
1594            ffi::ATK_ROLE_DESCRIPTION_LIST => Self::DescriptionList,
1595            ffi::ATK_ROLE_DESCRIPTION_TERM => Self::DescriptionTerm,
1596            ffi::ATK_ROLE_DESCRIPTION_VALUE => Self::DescriptionValue,
1597            ffi::ATK_ROLE_STATIC => Self::Static,
1598            ffi::ATK_ROLE_MATH_FRACTION => Self::MathFraction,
1599            ffi::ATK_ROLE_MATH_ROOT => Self::MathRoot,
1600            ffi::ATK_ROLE_SUBSCRIPT => Self::Subscript,
1601            ffi::ATK_ROLE_SUPERSCRIPT => Self::Superscript,
1602            ffi::ATK_ROLE_FOOTNOTE => Self::Footnote,
1603            ffi::ATK_ROLE_CONTENT_DELETION => Self::ContentDeletion,
1604            ffi::ATK_ROLE_CONTENT_INSERTION => Self::ContentInsertion,
1605            ffi::ATK_ROLE_MARK => Self::Mark,
1606            ffi::ATK_ROLE_SUGGESTION => Self::Suggestion,
1607            ffi::ATK_ROLE_PUSH_BUTTON_MENU => Self::PushButtonMenu,
1608            ffi::ATK_ROLE_LAST_DEFINED => Self::LastDefined,
1609            value => Self::__Unknown(value),
1610        }
1611    }
1612}
1613
1614impl StaticType for Role {
1615    #[inline]
1616    fn static_type() -> glib::Type {
1617        unsafe { from_glib(ffi::atk_role_get_type()) }
1618    }
1619}
1620
1621impl glib::HasParamSpec for Role {
1622    type ParamSpec = glib::ParamSpecEnum;
1623    type SetValue = Self;
1624    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1625
1626    fn param_spec_builder() -> Self::BuilderFn {
1627        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1628    }
1629}
1630
1631impl glib::value::ValueType for Role {
1632    type Type = Self;
1633}
1634
1635unsafe impl<'a> glib::value::FromValue<'a> for Role {
1636    type Checker = glib::value::GenericValueTypeChecker<Self>;
1637
1638    #[inline]
1639    unsafe fn from_value(value: &'a glib::Value) -> Self {
1640        skip_assert_initialized!();
1641        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1642    }
1643}
1644
1645impl ToValue for Role {
1646    #[inline]
1647    fn to_value(&self) -> glib::Value {
1648        let mut value = glib::Value::for_value_type::<Self>();
1649        unsafe {
1650            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1651        }
1652        value
1653    }
1654
1655    #[inline]
1656    fn value_type(&self) -> glib::Type {
1657        Self::static_type()
1658    }
1659}
1660
1661impl From<Role> for glib::Value {
1662    #[inline]
1663    fn from(v: Role) -> Self {
1664        skip_assert_initialized!();
1665        ToValue::to_value(&v)
1666    }
1667}
1668
1669/// Specifies where an object should be placed on the screen when using scroll_to.
1670#[cfg(feature = "v2_30")]
1671#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1672#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1673#[non_exhaustive]
1674#[doc(alias = "AtkScrollType")]
1675pub enum ScrollType {
1676    /// Scroll the object vertically and horizontally to bring
1677    ///  its top left corner to the top left corner of the window.
1678    #[doc(alias = "ATK_SCROLL_TOP_LEFT")]
1679    TopLeft,
1680    /// Scroll the object vertically and horizontally to
1681    ///  bring its bottom right corner to the bottom right corner of the window.
1682    #[doc(alias = "ATK_SCROLL_BOTTOM_RIGHT")]
1683    BottomRight,
1684    /// Scroll the object vertically to bring its top edge to
1685    ///  the top edge of the window.
1686    #[doc(alias = "ATK_SCROLL_TOP_EDGE")]
1687    TopEdge,
1688    /// Scroll the object vertically to bring its bottom
1689    ///  edge to the bottom edge of the window.
1690    #[doc(alias = "ATK_SCROLL_BOTTOM_EDGE")]
1691    BottomEdge,
1692    /// Scroll the object vertically and horizontally to bring
1693    ///  its left edge to the left edge of the window.
1694    #[doc(alias = "ATK_SCROLL_LEFT_EDGE")]
1695    LeftEdge,
1696    /// Scroll the object vertically and horizontally to
1697    ///  bring its right edge to the right edge of the window.
1698    #[doc(alias = "ATK_SCROLL_RIGHT_EDGE")]
1699    RightEdge,
1700    /// Scroll the object vertically and horizontally so that
1701    ///  as much as possible of the object becomes visible. The exact placement is
1702    ///  determined by the application.
1703    #[doc(alias = "ATK_SCROLL_ANYWHERE")]
1704    Anywhere,
1705    #[doc(hidden)]
1706    __Unknown(i32),
1707}
1708
1709#[cfg(feature = "v2_30")]
1710#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1711impl fmt::Display for ScrollType {
1712    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1713        write!(
1714            f,
1715            "ScrollType::{}",
1716            match *self {
1717                Self::TopLeft => "TopLeft",
1718                Self::BottomRight => "BottomRight",
1719                Self::TopEdge => "TopEdge",
1720                Self::BottomEdge => "BottomEdge",
1721                Self::LeftEdge => "LeftEdge",
1722                Self::RightEdge => "RightEdge",
1723                Self::Anywhere => "Anywhere",
1724                _ => "Unknown",
1725            }
1726        )
1727    }
1728}
1729
1730#[cfg(feature = "v2_30")]
1731#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1732#[doc(hidden)]
1733impl IntoGlib for ScrollType {
1734    type GlibType = ffi::AtkScrollType;
1735
1736    #[inline]
1737    fn into_glib(self) -> ffi::AtkScrollType {
1738        match self {
1739            Self::TopLeft => ffi::ATK_SCROLL_TOP_LEFT,
1740            Self::BottomRight => ffi::ATK_SCROLL_BOTTOM_RIGHT,
1741            Self::TopEdge => ffi::ATK_SCROLL_TOP_EDGE,
1742            Self::BottomEdge => ffi::ATK_SCROLL_BOTTOM_EDGE,
1743            Self::LeftEdge => ffi::ATK_SCROLL_LEFT_EDGE,
1744            Self::RightEdge => ffi::ATK_SCROLL_RIGHT_EDGE,
1745            Self::Anywhere => ffi::ATK_SCROLL_ANYWHERE,
1746            Self::__Unknown(value) => value,
1747        }
1748    }
1749}
1750
1751#[cfg(feature = "v2_30")]
1752#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1753#[doc(hidden)]
1754impl FromGlib<ffi::AtkScrollType> for ScrollType {
1755    #[inline]
1756    unsafe fn from_glib(value: ffi::AtkScrollType) -> Self {
1757        skip_assert_initialized!();
1758
1759        match value {
1760            ffi::ATK_SCROLL_TOP_LEFT => Self::TopLeft,
1761            ffi::ATK_SCROLL_BOTTOM_RIGHT => Self::BottomRight,
1762            ffi::ATK_SCROLL_TOP_EDGE => Self::TopEdge,
1763            ffi::ATK_SCROLL_BOTTOM_EDGE => Self::BottomEdge,
1764            ffi::ATK_SCROLL_LEFT_EDGE => Self::LeftEdge,
1765            ffi::ATK_SCROLL_RIGHT_EDGE => Self::RightEdge,
1766            ffi::ATK_SCROLL_ANYWHERE => Self::Anywhere,
1767            value => Self::__Unknown(value),
1768        }
1769    }
1770}
1771
1772#[cfg(feature = "v2_30")]
1773#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1774impl StaticType for ScrollType {
1775    #[inline]
1776    fn static_type() -> glib::Type {
1777        unsafe { from_glib(ffi::atk_scroll_type_get_type()) }
1778    }
1779}
1780
1781#[cfg(feature = "v2_30")]
1782#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1783impl glib::HasParamSpec for ScrollType {
1784    type ParamSpec = glib::ParamSpecEnum;
1785    type SetValue = Self;
1786    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
1787
1788    fn param_spec_builder() -> Self::BuilderFn {
1789        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
1790    }
1791}
1792
1793#[cfg(feature = "v2_30")]
1794#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1795impl glib::value::ValueType for ScrollType {
1796    type Type = Self;
1797}
1798
1799#[cfg(feature = "v2_30")]
1800#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1801unsafe impl<'a> glib::value::FromValue<'a> for ScrollType {
1802    type Checker = glib::value::GenericValueTypeChecker<Self>;
1803
1804    #[inline]
1805    unsafe fn from_value(value: &'a glib::Value) -> Self {
1806        skip_assert_initialized!();
1807        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
1808    }
1809}
1810
1811#[cfg(feature = "v2_30")]
1812#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1813impl ToValue for ScrollType {
1814    #[inline]
1815    fn to_value(&self) -> glib::Value {
1816        let mut value = glib::Value::for_value_type::<Self>();
1817        unsafe {
1818            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
1819        }
1820        value
1821    }
1822
1823    #[inline]
1824    fn value_type(&self) -> glib::Type {
1825        Self::static_type()
1826    }
1827}
1828
1829#[cfg(feature = "v2_30")]
1830#[cfg_attr(docsrs, doc(cfg(feature = "v2_30")))]
1831impl From<ScrollType> for glib::Value {
1832    #[inline]
1833    fn from(v: ScrollType) -> Self {
1834        skip_assert_initialized!();
1835        ToValue::to_value(&v)
1836    }
1837}
1838
1839/// The possible types of states of an object
1840#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1841#[non_exhaustive]
1842#[doc(alias = "AtkStateType")]
1843pub enum StateType {
1844    /// Indicates an invalid state - probably an error condition.
1845    #[doc(alias = "ATK_STATE_INVALID")]
1846    Invalid,
1847    /// Indicates a window is currently the active window, or an object is the active subelement within a container or table. ATK_STATE_ACTIVE should not be used for objects which have ATK_STATE_FOCUSABLE or ATK_STATE_SELECTABLE: Those objects should use ATK_STATE_FOCUSED and ATK_STATE_SELECTED respectively. ATK_STATE_ACTIVE is a means to indicate that an object which is not focusable and not selectable is the currently-active item within its parent container.
1848    #[doc(alias = "ATK_STATE_ACTIVE")]
1849    Active,
1850    /// Indicates that the object is 'armed', i.e. will be activated by if a pointer button-release event occurs within its bounds. Buttons often enter this state when a pointer click occurs within their bounds, as a precursor to activation. ATK_STATE_ARMED has been deprecated since ATK-2.16 and should not be used in newly-written code.
1851    #[doc(alias = "ATK_STATE_ARMED")]
1852    Armed,
1853    /// Indicates the current object is busy, i.e. onscreen representation is in the process of changing, or the object is temporarily unavailable for interaction due to activity already in progress. This state may be used by implementors of Document to indicate that content loading is underway. It also may indicate other 'pending' conditions; clients may wish to interrogate this object when the ATK_STATE_BUSY flag is removed.
1854    #[doc(alias = "ATK_STATE_BUSY")]
1855    Busy,
1856    /// Indicates this object is currently checked, for instance a checkbox is 'non-empty'.
1857    #[doc(alias = "ATK_STATE_CHECKED")]
1858    Checked,
1859    /// Indicates that this object no longer has a valid backing widget (for instance, if its peer object has been destroyed)
1860    #[doc(alias = "ATK_STATE_DEFUNCT")]
1861    Defunct,
1862    /// Indicates that this object can contain text, and that the
1863    /// user can change the textual contents of this object by editing those contents
1864    /// directly. For an object which is expected to be editable due to its type, but
1865    /// which cannot be edited due to the application or platform preventing the user
1866    /// from doing so, that object's [`StateSet`][crate::StateSet] should lack ATK_STATE_EDITABLE and
1867    /// should contain ATK_STATE_READ_ONLY.
1868    #[doc(alias = "ATK_STATE_EDITABLE")]
1869    Editable,
1870    /// Indicates that this object is enabled, i.e. that it currently reflects some application state. Objects that are "greyed out" may lack this state, and may lack the STATE_SENSITIVE if direct user interaction cannot cause them to acquire STATE_ENABLED. See also: ATK_STATE_SENSITIVE
1871    #[doc(alias = "ATK_STATE_ENABLED")]
1872    Enabled,
1873    /// Indicates this object allows progressive disclosure of its children
1874    #[doc(alias = "ATK_STATE_EXPANDABLE")]
1875    Expandable,
1876    /// Indicates this object its expanded - see ATK_STATE_EXPANDABLE above
1877    #[doc(alias = "ATK_STATE_EXPANDED")]
1878    Expanded,
1879    /// Indicates this object can accept keyboard focus, which means all events resulting from typing on the keyboard will normally be passed to it when it has focus
1880    #[doc(alias = "ATK_STATE_FOCUSABLE")]
1881    Focusable,
1882    /// Indicates this object currently has the keyboard focus
1883    #[doc(alias = "ATK_STATE_FOCUSED")]
1884    Focused,
1885    /// Indicates the orientation of this object is horizontal; used, for instance, by objects of ATK_ROLE_SCROLL_BAR. For objects where vertical/horizontal orientation is especially meaningful.
1886    #[doc(alias = "ATK_STATE_HORIZONTAL")]
1887    Horizontal,
1888    /// Indicates this object is minimized and is represented only by an icon
1889    #[doc(alias = "ATK_STATE_ICONIFIED")]
1890    Iconified,
1891    /// Indicates something must be done with this object before the user can interact with an object in a different window
1892    #[doc(alias = "ATK_STATE_MODAL")]
1893    Modal,
1894    /// Indicates this (text) object can contain multiple lines of text
1895    #[doc(alias = "ATK_STATE_MULTI_LINE")]
1896    MultiLine,
1897    /// Indicates this object allows more than one of its children to be selected at the same time, or in the case of text objects, that the object supports non-contiguous text selections.
1898    #[doc(alias = "ATK_STATE_MULTISELECTABLE")]
1899    Multiselectable,
1900    /// Indicates this object paints every pixel within its rectangular region.
1901    #[doc(alias = "ATK_STATE_OPAQUE")]
1902    Opaque,
1903    /// Indicates this object is currently pressed.
1904    #[doc(alias = "ATK_STATE_PRESSED")]
1905    Pressed,
1906    /// Indicates the size of this object is not fixed
1907    #[doc(alias = "ATK_STATE_RESIZABLE")]
1908    Resizable,
1909    /// Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that can be selected
1910    #[doc(alias = "ATK_STATE_SELECTABLE")]
1911    Selectable,
1912    /// Indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected
1913    #[doc(alias = "ATK_STATE_SELECTED")]
1914    Selected,
1915    /// Indicates this object is sensitive, e.g. to user interaction.
1916    /// STATE_SENSITIVE usually accompanies STATE_ENABLED for user-actionable controls,
1917    /// but may be found in the absence of STATE_ENABLED if the current visible state of the
1918    /// control is "disconnected" from the application state. In such cases, direct user interaction
1919    /// can often result in the object gaining STATE_SENSITIVE, for instance if a user makes
1920    /// an explicit selection using an object whose current state is ambiguous or undefined.
1921    /// `see` STATE_ENABLED, STATE_INDETERMINATE.
1922    #[doc(alias = "ATK_STATE_SENSITIVE")]
1923    Sensitive,
1924    /// Indicates this object, the object's parent, the object's parent's parent, and so on,
1925    /// are all 'shown' to the end-user, i.e. subject to "exposure" if blocking or obscuring objects do not interpose
1926    /// between this object and the top of the window stack.
1927    #[doc(alias = "ATK_STATE_SHOWING")]
1928    Showing,
1929    /// Indicates this (text) object can contain only a single line of text
1930    #[doc(alias = "ATK_STATE_SINGLE_LINE")]
1931    SingleLine,
1932    /// Indicates that the information returned for this object may no longer be
1933    /// synchronized with the application state. This is implied if the object has STATE_TRANSIENT,
1934    /// and can also occur towards the end of the object peer's lifecycle. It can also be used to indicate that
1935    /// the index associated with this object has changed since the user accessed the object (in lieu of
1936    /// "index-in-parent-changed" events).
1937    #[doc(alias = "ATK_STATE_STALE")]
1938    Stale,
1939    /// Indicates this object is transient, i.e. a snapshot which may not emit events when its
1940    /// state changes. Data from objects with ATK_STATE_TRANSIENT should not be cached, since there may be no
1941    /// notification given when the cached data becomes obsolete.
1942    #[doc(alias = "ATK_STATE_TRANSIENT")]
1943    Transient,
1944    /// Indicates the orientation of this object is vertical
1945    #[doc(alias = "ATK_STATE_VERTICAL")]
1946    Vertical,
1947    /// Indicates this object is visible, e.g. has been explicitly marked for exposure to the user.
1948    /// **note**: [`Visible`][Self::Visible] is no guarantee that the object is actually unobscured on the screen, only
1949    /// that it is 'potentially' visible, barring obstruction, being scrolled or clipped out of the
1950    /// field of view, or having an ancestor container that has not yet made visible.
1951    /// A widget is potentially onscreen if it has both [`Visible`][Self::Visible] and [`Showing`][Self::Showing].
1952    /// The absence of [`Visible`][Self::Visible] and [`Showing`][Self::Showing] is semantically equivalent to saying
1953    /// that an object is 'hidden'. See also [`Truncated`][Self::Truncated], which applies if an object with
1954    /// [`Visible`][Self::Visible] and [`Showing`][Self::Showing] set lies within a viewport which means that its
1955    /// contents are clipped, e.g. a truncated spreadsheet cell or
1956    /// an image within a scrolling viewport. Mostly useful for screen-review and magnification
1957    /// algorithms.
1958    #[doc(alias = "ATK_STATE_VISIBLE")]
1959    Visible,
1960    /// Indicates that "active-descendant-changed" event
1961    /// is sent when children become 'active' (i.e. are selected or navigated to onscreen).
1962    /// Used to prevent need to enumerate all children in very large containers, like tables.
1963    /// The presence of STATE_MANAGES_DESCENDANTS is an indication to the client.
1964    /// that the children should not, and need not, be enumerated by the client.
1965    /// Objects implementing this state are expected to provide relevant state
1966    /// notifications to listening clients, for instance notifications of visibility
1967    /// changes and activation of their contained child objects, without the client
1968    /// having previously requested references to those children.
1969    #[doc(alias = "ATK_STATE_MANAGES_DESCENDANTS")]
1970    ManagesDescendants,
1971    /// Indicates that the value, or some other quantifiable
1972    /// property, of this AtkObject cannot be fully determined. In the case of a large
1973    /// data set in which the total number of items in that set is unknown (e.g. 1 of
1974    /// 999+), implementors should expose the currently-known set size (999) along
1975    /// with this state. In the case of a check box, this state should be used to
1976    /// indicate that the check box is a tri-state check box which is currently
1977    /// neither checked nor unchecked.
1978    #[doc(alias = "ATK_STATE_INDETERMINATE")]
1979    Indeterminate,
1980    /// Indicates that an object is truncated, e.g. a text value in a speradsheet cell.
1981    #[doc(alias = "ATK_STATE_TRUNCATED")]
1982    Truncated,
1983    /// Indicates that explicit user interaction with an object is required by the user interface, e.g. a required field in a "web-form" interface.
1984    #[doc(alias = "ATK_STATE_REQUIRED")]
1985    Required,
1986    /// Indicates that the object has encountered an error condition due to failure of input validation. For instance, a form control may acquire this state in response to invalid or malformed user input.
1987    #[doc(alias = "ATK_STATE_INVALID_ENTRY")]
1988    InvalidEntry,
1989    /// Indicates that the object in question implements some form of ¨typeahead¨ or
1990    /// pre-selection behavior whereby entering the first character of one or more sub-elements
1991    /// causes those elements to scroll into view or become selected. Subsequent character input
1992    /// may narrow the selection further as long as one or more sub-elements match the string.
1993    /// This state is normally only useful and encountered on objects that implement Selection.
1994    /// In some cases the typeahead behavior may result in full or partial ¨completion¨ of
1995    /// the data in the input field, in which case these input events may trigger text-changed
1996    /// events from the AtkText interface. This state supplants [`Role::Autocomplete`][crate::Role::Autocomplete].
1997    #[doc(alias = "ATK_STATE_SUPPORTS_AUTOCOMPLETION")]
1998    SupportsAutocompletion,
1999    /// Indicates that the object in question supports text selection. It should only be exposed on objects which implement the Text interface, in order to distinguish this state from [`Selectable`][Self::Selectable], which infers that the object in question is a selectable child of an object which implements Selection. While similar, text selection and subelement selection are distinct operations.
2000    #[doc(alias = "ATK_STATE_SELECTABLE_TEXT")]
2001    SelectableText,
2002    /// Indicates that the object is the "default" active component, i.e. the object which is activated by an end-user press of the "Enter" or "Return" key. Typically a "close" or "submit" button.
2003    #[doc(alias = "ATK_STATE_DEFAULT")]
2004    Default,
2005    /// Indicates that the object changes its appearance dynamically as an inherent part of its presentation. This state may come and go if an object is only temporarily animated on the way to a 'final' onscreen presentation.
2006    /// **note**: some applications, notably content viewers, may not be able to detect
2007    /// all kinds of animated content. Therefore the absence of this state should not
2008    /// be taken as definitive evidence that the object's visual representation is
2009    /// static; this state is advisory.
2010    #[doc(alias = "ATK_STATE_ANIMATED")]
2011    Animated,
2012    /// Indicates that the object (typically a hyperlink) has already been 'activated', and/or its backing data has already been downloaded, rendered, or otherwise "visited".
2013    #[doc(alias = "ATK_STATE_VISITED")]
2014    Visited,
2015    /// Indicates this object has the potential to be
2016    ///  checked, such as a checkbox or toggle-able table cell. `Since`:
2017    ///  ATK-2.12
2018    #[doc(alias = "ATK_STATE_CHECKABLE")]
2019    Checkable,
2020    /// Indicates that the object has a popup context
2021    /// menu or sub-level menu which may or may not be showing. This means
2022    /// that activation renders conditional content. Note that ordinary
2023    /// tooltips are not considered popups in this context. `Since`: ATK-2.12
2024    #[doc(alias = "ATK_STATE_HAS_POPUP")]
2025    HasPopup,
2026    /// Indicates this object has a tooltip. `Since`: ATK-2.16
2027    #[doc(alias = "ATK_STATE_HAS_TOOLTIP")]
2028    HasTooltip,
2029    /// Indicates that a widget which is ENABLED and SENSITIVE
2030    /// has a value which can be read, but not modified, by the user. Note that this
2031    /// state should only be applied to widget types whose value is normally directly
2032    /// user modifiable, such as check boxes, radio buttons, spin buttons, text input
2033    /// fields, and combo boxes, as a means to convey that the expected interaction
2034    /// with that widget is not possible. When the expected interaction with a
2035    /// widget does not include modification by the user, as is the case with
2036    /// labels and containers, ATK_STATE_READ_ONLY should not be applied. See also
2037    /// ATK_STATE_EDITABLE. `Since`: ATK-2-16
2038    #[doc(alias = "ATK_STATE_READ_ONLY")]
2039    ReadOnly,
2040    /// Indicates this object is collapsed. `Since`: ATK-2.38
2041    #[cfg(feature = "v2_38")]
2042    #[cfg_attr(docsrs, doc(cfg(feature = "v2_38")))]
2043    #[doc(alias = "ATK_STATE_COLLAPSED")]
2044    Collapsed,
2045    #[doc(hidden)]
2046    __Unknown(i32),
2047}
2048
2049impl StateType {
2050    #[doc(alias = "atk_state_type_for_name")]
2051    pub fn for_name(name: &str) -> StateType {
2052        assert_initialized_main_thread!();
2053        unsafe { from_glib(ffi::atk_state_type_for_name(name.to_glib_none().0)) }
2054    }
2055
2056    #[doc(alias = "atk_state_type_get_name")]
2057    #[doc(alias = "get_name")]
2058    pub fn name(self) -> Option<glib::GString> {
2059        assert_initialized_main_thread!();
2060        unsafe { from_glib_none(ffi::atk_state_type_get_name(self.into_glib())) }
2061    }
2062}
2063
2064impl fmt::Display for StateType {
2065    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2066        write!(
2067            f,
2068            "StateType::{}",
2069            match *self {
2070                Self::Invalid => "Invalid",
2071                Self::Active => "Active",
2072                Self::Armed => "Armed",
2073                Self::Busy => "Busy",
2074                Self::Checked => "Checked",
2075                Self::Defunct => "Defunct",
2076                Self::Editable => "Editable",
2077                Self::Enabled => "Enabled",
2078                Self::Expandable => "Expandable",
2079                Self::Expanded => "Expanded",
2080                Self::Focusable => "Focusable",
2081                Self::Focused => "Focused",
2082                Self::Horizontal => "Horizontal",
2083                Self::Iconified => "Iconified",
2084                Self::Modal => "Modal",
2085                Self::MultiLine => "MultiLine",
2086                Self::Multiselectable => "Multiselectable",
2087                Self::Opaque => "Opaque",
2088                Self::Pressed => "Pressed",
2089                Self::Resizable => "Resizable",
2090                Self::Selectable => "Selectable",
2091                Self::Selected => "Selected",
2092                Self::Sensitive => "Sensitive",
2093                Self::Showing => "Showing",
2094                Self::SingleLine => "SingleLine",
2095                Self::Stale => "Stale",
2096                Self::Transient => "Transient",
2097                Self::Vertical => "Vertical",
2098                Self::Visible => "Visible",
2099                Self::ManagesDescendants => "ManagesDescendants",
2100                Self::Indeterminate => "Indeterminate",
2101                Self::Truncated => "Truncated",
2102                Self::Required => "Required",
2103                Self::InvalidEntry => "InvalidEntry",
2104                Self::SupportsAutocompletion => "SupportsAutocompletion",
2105                Self::SelectableText => "SelectableText",
2106                Self::Default => "Default",
2107                Self::Animated => "Animated",
2108                Self::Visited => "Visited",
2109                Self::Checkable => "Checkable",
2110                Self::HasPopup => "HasPopup",
2111                Self::HasTooltip => "HasTooltip",
2112                Self::ReadOnly => "ReadOnly",
2113                #[cfg(feature = "v2_38")]
2114                Self::Collapsed => "Collapsed",
2115                _ => "Unknown",
2116            }
2117        )
2118    }
2119}
2120
2121#[doc(hidden)]
2122impl IntoGlib for StateType {
2123    type GlibType = ffi::AtkStateType;
2124
2125    fn into_glib(self) -> ffi::AtkStateType {
2126        match self {
2127            Self::Invalid => ffi::ATK_STATE_INVALID,
2128            Self::Active => ffi::ATK_STATE_ACTIVE,
2129            Self::Armed => ffi::ATK_STATE_ARMED,
2130            Self::Busy => ffi::ATK_STATE_BUSY,
2131            Self::Checked => ffi::ATK_STATE_CHECKED,
2132            Self::Defunct => ffi::ATK_STATE_DEFUNCT,
2133            Self::Editable => ffi::ATK_STATE_EDITABLE,
2134            Self::Enabled => ffi::ATK_STATE_ENABLED,
2135            Self::Expandable => ffi::ATK_STATE_EXPANDABLE,
2136            Self::Expanded => ffi::ATK_STATE_EXPANDED,
2137            Self::Focusable => ffi::ATK_STATE_FOCUSABLE,
2138            Self::Focused => ffi::ATK_STATE_FOCUSED,
2139            Self::Horizontal => ffi::ATK_STATE_HORIZONTAL,
2140            Self::Iconified => ffi::ATK_STATE_ICONIFIED,
2141            Self::Modal => ffi::ATK_STATE_MODAL,
2142            Self::MultiLine => ffi::ATK_STATE_MULTI_LINE,
2143            Self::Multiselectable => ffi::ATK_STATE_MULTISELECTABLE,
2144            Self::Opaque => ffi::ATK_STATE_OPAQUE,
2145            Self::Pressed => ffi::ATK_STATE_PRESSED,
2146            Self::Resizable => ffi::ATK_STATE_RESIZABLE,
2147            Self::Selectable => ffi::ATK_STATE_SELECTABLE,
2148            Self::Selected => ffi::ATK_STATE_SELECTED,
2149            Self::Sensitive => ffi::ATK_STATE_SENSITIVE,
2150            Self::Showing => ffi::ATK_STATE_SHOWING,
2151            Self::SingleLine => ffi::ATK_STATE_SINGLE_LINE,
2152            Self::Stale => ffi::ATK_STATE_STALE,
2153            Self::Transient => ffi::ATK_STATE_TRANSIENT,
2154            Self::Vertical => ffi::ATK_STATE_VERTICAL,
2155            Self::Visible => ffi::ATK_STATE_VISIBLE,
2156            Self::ManagesDescendants => ffi::ATK_STATE_MANAGES_DESCENDANTS,
2157            Self::Indeterminate => ffi::ATK_STATE_INDETERMINATE,
2158            Self::Truncated => ffi::ATK_STATE_TRUNCATED,
2159            Self::Required => ffi::ATK_STATE_REQUIRED,
2160            Self::InvalidEntry => ffi::ATK_STATE_INVALID_ENTRY,
2161            Self::SupportsAutocompletion => ffi::ATK_STATE_SUPPORTS_AUTOCOMPLETION,
2162            Self::SelectableText => ffi::ATK_STATE_SELECTABLE_TEXT,
2163            Self::Default => ffi::ATK_STATE_DEFAULT,
2164            Self::Animated => ffi::ATK_STATE_ANIMATED,
2165            Self::Visited => ffi::ATK_STATE_VISITED,
2166            Self::Checkable => ffi::ATK_STATE_CHECKABLE,
2167            Self::HasPopup => ffi::ATK_STATE_HAS_POPUP,
2168            Self::HasTooltip => ffi::ATK_STATE_HAS_TOOLTIP,
2169            Self::ReadOnly => ffi::ATK_STATE_READ_ONLY,
2170            #[cfg(feature = "v2_38")]
2171            Self::Collapsed => ffi::ATK_STATE_COLLAPSED,
2172            Self::__Unknown(value) => value,
2173        }
2174    }
2175}
2176
2177#[doc(hidden)]
2178impl FromGlib<ffi::AtkStateType> for StateType {
2179    unsafe fn from_glib(value: ffi::AtkStateType) -> Self {
2180        skip_assert_initialized!();
2181
2182        match value {
2183            ffi::ATK_STATE_INVALID => Self::Invalid,
2184            ffi::ATK_STATE_ACTIVE => Self::Active,
2185            ffi::ATK_STATE_ARMED => Self::Armed,
2186            ffi::ATK_STATE_BUSY => Self::Busy,
2187            ffi::ATK_STATE_CHECKED => Self::Checked,
2188            ffi::ATK_STATE_DEFUNCT => Self::Defunct,
2189            ffi::ATK_STATE_EDITABLE => Self::Editable,
2190            ffi::ATK_STATE_ENABLED => Self::Enabled,
2191            ffi::ATK_STATE_EXPANDABLE => Self::Expandable,
2192            ffi::ATK_STATE_EXPANDED => Self::Expanded,
2193            ffi::ATK_STATE_FOCUSABLE => Self::Focusable,
2194            ffi::ATK_STATE_FOCUSED => Self::Focused,
2195            ffi::ATK_STATE_HORIZONTAL => Self::Horizontal,
2196            ffi::ATK_STATE_ICONIFIED => Self::Iconified,
2197            ffi::ATK_STATE_MODAL => Self::Modal,
2198            ffi::ATK_STATE_MULTI_LINE => Self::MultiLine,
2199            ffi::ATK_STATE_MULTISELECTABLE => Self::Multiselectable,
2200            ffi::ATK_STATE_OPAQUE => Self::Opaque,
2201            ffi::ATK_STATE_PRESSED => Self::Pressed,
2202            ffi::ATK_STATE_RESIZABLE => Self::Resizable,
2203            ffi::ATK_STATE_SELECTABLE => Self::Selectable,
2204            ffi::ATK_STATE_SELECTED => Self::Selected,
2205            ffi::ATK_STATE_SENSITIVE => Self::Sensitive,
2206            ffi::ATK_STATE_SHOWING => Self::Showing,
2207            ffi::ATK_STATE_SINGLE_LINE => Self::SingleLine,
2208            ffi::ATK_STATE_STALE => Self::Stale,
2209            ffi::ATK_STATE_TRANSIENT => Self::Transient,
2210            ffi::ATK_STATE_VERTICAL => Self::Vertical,
2211            ffi::ATK_STATE_VISIBLE => Self::Visible,
2212            ffi::ATK_STATE_MANAGES_DESCENDANTS => Self::ManagesDescendants,
2213            ffi::ATK_STATE_INDETERMINATE => Self::Indeterminate,
2214            ffi::ATK_STATE_TRUNCATED => Self::Truncated,
2215            ffi::ATK_STATE_REQUIRED => Self::Required,
2216            ffi::ATK_STATE_INVALID_ENTRY => Self::InvalidEntry,
2217            ffi::ATK_STATE_SUPPORTS_AUTOCOMPLETION => Self::SupportsAutocompletion,
2218            ffi::ATK_STATE_SELECTABLE_TEXT => Self::SelectableText,
2219            ffi::ATK_STATE_DEFAULT => Self::Default,
2220            ffi::ATK_STATE_ANIMATED => Self::Animated,
2221            ffi::ATK_STATE_VISITED => Self::Visited,
2222            ffi::ATK_STATE_CHECKABLE => Self::Checkable,
2223            ffi::ATK_STATE_HAS_POPUP => Self::HasPopup,
2224            ffi::ATK_STATE_HAS_TOOLTIP => Self::HasTooltip,
2225            ffi::ATK_STATE_READ_ONLY => Self::ReadOnly,
2226            #[cfg(feature = "v2_38")]
2227            ffi::ATK_STATE_COLLAPSED => Self::Collapsed,
2228            value => Self::__Unknown(value),
2229        }
2230    }
2231}
2232
2233impl StaticType for StateType {
2234    #[inline]
2235    fn static_type() -> glib::Type {
2236        unsafe { from_glib(ffi::atk_state_type_get_type()) }
2237    }
2238}
2239
2240impl glib::HasParamSpec for StateType {
2241    type ParamSpec = glib::ParamSpecEnum;
2242    type SetValue = Self;
2243    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2244
2245    fn param_spec_builder() -> Self::BuilderFn {
2246        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2247    }
2248}
2249
2250impl glib::value::ValueType for StateType {
2251    type Type = Self;
2252}
2253
2254unsafe impl<'a> glib::value::FromValue<'a> for StateType {
2255    type Checker = glib::value::GenericValueTypeChecker<Self>;
2256
2257    #[inline]
2258    unsafe fn from_value(value: &'a glib::Value) -> Self {
2259        skip_assert_initialized!();
2260        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2261    }
2262}
2263
2264impl ToValue for StateType {
2265    #[inline]
2266    fn to_value(&self) -> glib::Value {
2267        let mut value = glib::Value::for_value_type::<Self>();
2268        unsafe {
2269            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2270        }
2271        value
2272    }
2273
2274    #[inline]
2275    fn value_type(&self) -> glib::Type {
2276        Self::static_type()
2277    }
2278}
2279
2280impl From<StateType> for glib::Value {
2281    #[inline]
2282    fn from(v: StateType) -> Self {
2283        skip_assert_initialized!();
2284        ToValue::to_value(&v)
2285    }
2286}
2287
2288/// Describes the text attributes supported
2289#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2290#[non_exhaustive]
2291#[doc(alias = "AtkTextAttribute")]
2292pub enum TextAttribute {
2293    /// Invalid attribute, like bad spelling or grammar.
2294    #[doc(alias = "ATK_TEXT_ATTR_INVALID")]
2295    Invalid,
2296    /// The pixel width of the left margin
2297    #[doc(alias = "ATK_TEXT_ATTR_LEFT_MARGIN")]
2298    LeftMargin,
2299    /// The pixel width of the right margin
2300    #[doc(alias = "ATK_TEXT_ATTR_RIGHT_MARGIN")]
2301    RightMargin,
2302    /// The number of pixels that the text is indented
2303    #[doc(alias = "ATK_TEXT_ATTR_INDENT")]
2304    Indent,
2305    /// Either "true" or "false" indicating whether text is visible or not
2306    #[doc(alias = "ATK_TEXT_ATTR_INVISIBLE")]
2307    Invisible,
2308    /// Either "true" or "false" indicating whether text is editable or not
2309    #[doc(alias = "ATK_TEXT_ATTR_EDITABLE")]
2310    Editable,
2311    /// Pixels of blank space to leave above each newline-terminated line.
2312    #[doc(alias = "ATK_TEXT_ATTR_PIXELS_ABOVE_LINES")]
2313    PixelsAboveLines,
2314    /// Pixels of blank space to leave below each newline-terminated line.
2315    #[doc(alias = "ATK_TEXT_ATTR_PIXELS_BELOW_LINES")]
2316    PixelsBelowLines,
2317    /// Pixels of blank space to leave between wrapped lines inside the same newline-terminated line (paragraph).
2318    #[doc(alias = "ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP")]
2319    PixelsInsideWrap,
2320    /// "true" or "false" whether to make the background color for each character the height of the highest font used on the current line, or the height of the font used for the current character.
2321    #[doc(alias = "ATK_TEXT_ATTR_BG_FULL_HEIGHT")]
2322    BgFullHeight,
2323    /// Number of pixels that the characters are risen above the baseline. See also ATK_TEXT_ATTR_TEXT_POSITION.
2324    #[doc(alias = "ATK_TEXT_ATTR_RISE")]
2325    Rise,
2326    /// "none", "single", "double", "low", or "error"
2327    #[doc(alias = "ATK_TEXT_ATTR_UNDERLINE")]
2328    Underline,
2329    /// "true" or "false" whether the text is strikethrough
2330    #[doc(alias = "ATK_TEXT_ATTR_STRIKETHROUGH")]
2331    Strikethrough,
2332    /// The size of the characters in points. eg: 10
2333    #[doc(alias = "ATK_TEXT_ATTR_SIZE")]
2334    Size,
2335    /// The scale of the characters. The value is a string representation of a double
2336    #[doc(alias = "ATK_TEXT_ATTR_SCALE")]
2337    Scale,
2338    /// The weight of the characters.
2339    #[doc(alias = "ATK_TEXT_ATTR_WEIGHT")]
2340    Weight,
2341    /// The language used
2342    #[doc(alias = "ATK_TEXT_ATTR_LANGUAGE")]
2343    Language,
2344    /// The font family name
2345    #[doc(alias = "ATK_TEXT_ATTR_FAMILY_NAME")]
2346    FamilyName,
2347    /// The background color. The value is an RGB value of the format "`u`,`u`,`u`"
2348    #[doc(alias = "ATK_TEXT_ATTR_BG_COLOR")]
2349    BgColor,
2350    /// The foreground color. The value is an RGB value of the format "`u`,`u`,`u`"
2351    #[doc(alias = "ATK_TEXT_ATTR_FG_COLOR")]
2352    FgColor,
2353    /// "true" if a `GdkBitmap` is set for stippling the background color.
2354    #[doc(alias = "ATK_TEXT_ATTR_BG_STIPPLE")]
2355    BgStipple,
2356    /// "true" if a `GdkBitmap` is set for stippling the foreground color.
2357    #[doc(alias = "ATK_TEXT_ATTR_FG_STIPPLE")]
2358    FgStipple,
2359    /// The wrap mode of the text, if any. Values are "none", "char", "word", or "word_char".
2360    #[doc(alias = "ATK_TEXT_ATTR_WRAP_MODE")]
2361    WrapMode,
2362    /// The direction of the text, if set. Values are "none", "ltr" or "rtl"
2363    #[doc(alias = "ATK_TEXT_ATTR_DIRECTION")]
2364    Direction,
2365    /// The justification of the text, if set. Values are "left", "right", "center" or "fill"
2366    #[doc(alias = "ATK_TEXT_ATTR_JUSTIFICATION")]
2367    Justification,
2368    /// The stretch of the text, if set. Values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" or "ultra_expanded"
2369    #[doc(alias = "ATK_TEXT_ATTR_STRETCH")]
2370    Stretch,
2371    /// The capitalization variant of the text, if set. Values are "normal" or "small_caps"
2372    #[doc(alias = "ATK_TEXT_ATTR_VARIANT")]
2373    Variant,
2374    /// The slant style of the text, if set. Values are "normal", "oblique" or "italic"
2375    #[doc(alias = "ATK_TEXT_ATTR_STYLE")]
2376    Style,
2377    /// The vertical position with respect to the baseline. Values are "baseline", "super", or "sub". Note that a super or sub text attribute refers to position with respect to the baseline of the prior character.
2378    #[doc(alias = "ATK_TEXT_ATTR_TEXT_POSITION")]
2379    TextPosition,
2380    /// not a valid text attribute, used for finding end of enumeration
2381    #[doc(alias = "ATK_TEXT_ATTR_LAST_DEFINED")]
2382    LastDefined,
2383    #[doc(hidden)]
2384    __Unknown(i32),
2385}
2386
2387impl TextAttribute {
2388    #[doc(alias = "atk_text_attribute_for_name")]
2389    pub fn for_name(name: &str) -> TextAttribute {
2390        assert_initialized_main_thread!();
2391        unsafe { from_glib(ffi::atk_text_attribute_for_name(name.to_glib_none().0)) }
2392    }
2393
2394    #[doc(alias = "atk_text_attribute_get_name")]
2395    #[doc(alias = "get_name")]
2396    pub fn name(self) -> Option<glib::GString> {
2397        assert_initialized_main_thread!();
2398        unsafe { from_glib_none(ffi::atk_text_attribute_get_name(self.into_glib())) }
2399    }
2400
2401    #[doc(alias = "atk_text_attribute_get_value")]
2402    #[doc(alias = "get_value")]
2403    pub fn value(self, index_: i32) -> Option<glib::GString> {
2404        assert_initialized_main_thread!();
2405        unsafe { from_glib_none(ffi::atk_text_attribute_get_value(self.into_glib(), index_)) }
2406    }
2407}
2408
2409impl fmt::Display for TextAttribute {
2410    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2411        write!(
2412            f,
2413            "TextAttribute::{}",
2414            match *self {
2415                Self::Invalid => "Invalid",
2416                Self::LeftMargin => "LeftMargin",
2417                Self::RightMargin => "RightMargin",
2418                Self::Indent => "Indent",
2419                Self::Invisible => "Invisible",
2420                Self::Editable => "Editable",
2421                Self::PixelsAboveLines => "PixelsAboveLines",
2422                Self::PixelsBelowLines => "PixelsBelowLines",
2423                Self::PixelsInsideWrap => "PixelsInsideWrap",
2424                Self::BgFullHeight => "BgFullHeight",
2425                Self::Rise => "Rise",
2426                Self::Underline => "Underline",
2427                Self::Strikethrough => "Strikethrough",
2428                Self::Size => "Size",
2429                Self::Scale => "Scale",
2430                Self::Weight => "Weight",
2431                Self::Language => "Language",
2432                Self::FamilyName => "FamilyName",
2433                Self::BgColor => "BgColor",
2434                Self::FgColor => "FgColor",
2435                Self::BgStipple => "BgStipple",
2436                Self::FgStipple => "FgStipple",
2437                Self::WrapMode => "WrapMode",
2438                Self::Direction => "Direction",
2439                Self::Justification => "Justification",
2440                Self::Stretch => "Stretch",
2441                Self::Variant => "Variant",
2442                Self::Style => "Style",
2443                Self::TextPosition => "TextPosition",
2444                Self::LastDefined => "LastDefined",
2445                _ => "Unknown",
2446            }
2447        )
2448    }
2449}
2450
2451#[doc(hidden)]
2452impl IntoGlib for TextAttribute {
2453    type GlibType = ffi::AtkTextAttribute;
2454
2455    fn into_glib(self) -> ffi::AtkTextAttribute {
2456        match self {
2457            Self::Invalid => ffi::ATK_TEXT_ATTR_INVALID,
2458            Self::LeftMargin => ffi::ATK_TEXT_ATTR_LEFT_MARGIN,
2459            Self::RightMargin => ffi::ATK_TEXT_ATTR_RIGHT_MARGIN,
2460            Self::Indent => ffi::ATK_TEXT_ATTR_INDENT,
2461            Self::Invisible => ffi::ATK_TEXT_ATTR_INVISIBLE,
2462            Self::Editable => ffi::ATK_TEXT_ATTR_EDITABLE,
2463            Self::PixelsAboveLines => ffi::ATK_TEXT_ATTR_PIXELS_ABOVE_LINES,
2464            Self::PixelsBelowLines => ffi::ATK_TEXT_ATTR_PIXELS_BELOW_LINES,
2465            Self::PixelsInsideWrap => ffi::ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP,
2466            Self::BgFullHeight => ffi::ATK_TEXT_ATTR_BG_FULL_HEIGHT,
2467            Self::Rise => ffi::ATK_TEXT_ATTR_RISE,
2468            Self::Underline => ffi::ATK_TEXT_ATTR_UNDERLINE,
2469            Self::Strikethrough => ffi::ATK_TEXT_ATTR_STRIKETHROUGH,
2470            Self::Size => ffi::ATK_TEXT_ATTR_SIZE,
2471            Self::Scale => ffi::ATK_TEXT_ATTR_SCALE,
2472            Self::Weight => ffi::ATK_TEXT_ATTR_WEIGHT,
2473            Self::Language => ffi::ATK_TEXT_ATTR_LANGUAGE,
2474            Self::FamilyName => ffi::ATK_TEXT_ATTR_FAMILY_NAME,
2475            Self::BgColor => ffi::ATK_TEXT_ATTR_BG_COLOR,
2476            Self::FgColor => ffi::ATK_TEXT_ATTR_FG_COLOR,
2477            Self::BgStipple => ffi::ATK_TEXT_ATTR_BG_STIPPLE,
2478            Self::FgStipple => ffi::ATK_TEXT_ATTR_FG_STIPPLE,
2479            Self::WrapMode => ffi::ATK_TEXT_ATTR_WRAP_MODE,
2480            Self::Direction => ffi::ATK_TEXT_ATTR_DIRECTION,
2481            Self::Justification => ffi::ATK_TEXT_ATTR_JUSTIFICATION,
2482            Self::Stretch => ffi::ATK_TEXT_ATTR_STRETCH,
2483            Self::Variant => ffi::ATK_TEXT_ATTR_VARIANT,
2484            Self::Style => ffi::ATK_TEXT_ATTR_STYLE,
2485            Self::TextPosition => ffi::ATK_TEXT_ATTR_TEXT_POSITION,
2486            Self::LastDefined => ffi::ATK_TEXT_ATTR_LAST_DEFINED,
2487            Self::__Unknown(value) => value,
2488        }
2489    }
2490}
2491
2492#[doc(hidden)]
2493impl FromGlib<ffi::AtkTextAttribute> for TextAttribute {
2494    unsafe fn from_glib(value: ffi::AtkTextAttribute) -> Self {
2495        skip_assert_initialized!();
2496
2497        match value {
2498            ffi::ATK_TEXT_ATTR_INVALID => Self::Invalid,
2499            ffi::ATK_TEXT_ATTR_LEFT_MARGIN => Self::LeftMargin,
2500            ffi::ATK_TEXT_ATTR_RIGHT_MARGIN => Self::RightMargin,
2501            ffi::ATK_TEXT_ATTR_INDENT => Self::Indent,
2502            ffi::ATK_TEXT_ATTR_INVISIBLE => Self::Invisible,
2503            ffi::ATK_TEXT_ATTR_EDITABLE => Self::Editable,
2504            ffi::ATK_TEXT_ATTR_PIXELS_ABOVE_LINES => Self::PixelsAboveLines,
2505            ffi::ATK_TEXT_ATTR_PIXELS_BELOW_LINES => Self::PixelsBelowLines,
2506            ffi::ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP => Self::PixelsInsideWrap,
2507            ffi::ATK_TEXT_ATTR_BG_FULL_HEIGHT => Self::BgFullHeight,
2508            ffi::ATK_TEXT_ATTR_RISE => Self::Rise,
2509            ffi::ATK_TEXT_ATTR_UNDERLINE => Self::Underline,
2510            ffi::ATK_TEXT_ATTR_STRIKETHROUGH => Self::Strikethrough,
2511            ffi::ATK_TEXT_ATTR_SIZE => Self::Size,
2512            ffi::ATK_TEXT_ATTR_SCALE => Self::Scale,
2513            ffi::ATK_TEXT_ATTR_WEIGHT => Self::Weight,
2514            ffi::ATK_TEXT_ATTR_LANGUAGE => Self::Language,
2515            ffi::ATK_TEXT_ATTR_FAMILY_NAME => Self::FamilyName,
2516            ffi::ATK_TEXT_ATTR_BG_COLOR => Self::BgColor,
2517            ffi::ATK_TEXT_ATTR_FG_COLOR => Self::FgColor,
2518            ffi::ATK_TEXT_ATTR_BG_STIPPLE => Self::BgStipple,
2519            ffi::ATK_TEXT_ATTR_FG_STIPPLE => Self::FgStipple,
2520            ffi::ATK_TEXT_ATTR_WRAP_MODE => Self::WrapMode,
2521            ffi::ATK_TEXT_ATTR_DIRECTION => Self::Direction,
2522            ffi::ATK_TEXT_ATTR_JUSTIFICATION => Self::Justification,
2523            ffi::ATK_TEXT_ATTR_STRETCH => Self::Stretch,
2524            ffi::ATK_TEXT_ATTR_VARIANT => Self::Variant,
2525            ffi::ATK_TEXT_ATTR_STYLE => Self::Style,
2526            ffi::ATK_TEXT_ATTR_TEXT_POSITION => Self::TextPosition,
2527            ffi::ATK_TEXT_ATTR_LAST_DEFINED => Self::LastDefined,
2528            value => Self::__Unknown(value),
2529        }
2530    }
2531}
2532
2533impl StaticType for TextAttribute {
2534    #[inline]
2535    fn static_type() -> glib::Type {
2536        unsafe { from_glib(ffi::atk_text_attribute_get_type()) }
2537    }
2538}
2539
2540impl glib::HasParamSpec for TextAttribute {
2541    type ParamSpec = glib::ParamSpecEnum;
2542    type SetValue = Self;
2543    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2544
2545    fn param_spec_builder() -> Self::BuilderFn {
2546        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2547    }
2548}
2549
2550impl glib::value::ValueType for TextAttribute {
2551    type Type = Self;
2552}
2553
2554unsafe impl<'a> glib::value::FromValue<'a> for TextAttribute {
2555    type Checker = glib::value::GenericValueTypeChecker<Self>;
2556
2557    #[inline]
2558    unsafe fn from_value(value: &'a glib::Value) -> Self {
2559        skip_assert_initialized!();
2560        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2561    }
2562}
2563
2564impl ToValue for TextAttribute {
2565    #[inline]
2566    fn to_value(&self) -> glib::Value {
2567        let mut value = glib::Value::for_value_type::<Self>();
2568        unsafe {
2569            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2570        }
2571        value
2572    }
2573
2574    #[inline]
2575    fn value_type(&self) -> glib::Type {
2576        Self::static_type()
2577    }
2578}
2579
2580impl From<TextAttribute> for glib::Value {
2581    #[inline]
2582    fn from(v: TextAttribute) -> Self {
2583        skip_assert_initialized!();
2584        ToValue::to_value(&v)
2585    }
2586}
2587
2588/// Text boundary types used for specifying boundaries for regions of text.
2589/// This enumeration is deprecated since 2.9.4 and should not be used. Use
2590/// AtkTextGranularity with `atk_text_get_string_at_offset` instead.
2591#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2592#[non_exhaustive]
2593#[doc(alias = "AtkTextBoundary")]
2594pub enum TextBoundary {
2595    /// Boundary is the boundary between characters
2596    /// (including non-printing characters)
2597    #[doc(alias = "ATK_TEXT_BOUNDARY_CHAR")]
2598    Char,
2599    /// Boundary is the start (i.e. first character) of a word.
2600    #[doc(alias = "ATK_TEXT_BOUNDARY_WORD_START")]
2601    WordStart,
2602    /// Boundary is the end (i.e. last
2603    /// character) of a word.
2604    #[doc(alias = "ATK_TEXT_BOUNDARY_WORD_END")]
2605    WordEnd,
2606    /// Boundary is the first character in a sentence.
2607    #[doc(alias = "ATK_TEXT_BOUNDARY_SENTENCE_START")]
2608    SentenceStart,
2609    /// Boundary is the last (terminal)
2610    /// character in a sentence; in languages which use "sentence stop"
2611    /// punctuation such as English, the boundary is thus the '.', '?', or
2612    /// similar terminal punctuation character.
2613    #[doc(alias = "ATK_TEXT_BOUNDARY_SENTENCE_END")]
2614    SentenceEnd,
2615    /// Boundary is the initial character of the content or a
2616    /// character immediately following a newline, linefeed, or return character.
2617    #[doc(alias = "ATK_TEXT_BOUNDARY_LINE_START")]
2618    LineStart,
2619    /// Boundary is the linefeed, or return
2620    /// character.
2621    #[doc(alias = "ATK_TEXT_BOUNDARY_LINE_END")]
2622    LineEnd,
2623    #[doc(hidden)]
2624    __Unknown(i32),
2625}
2626
2627impl fmt::Display for TextBoundary {
2628    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2629        write!(
2630            f,
2631            "TextBoundary::{}",
2632            match *self {
2633                Self::Char => "Char",
2634                Self::WordStart => "WordStart",
2635                Self::WordEnd => "WordEnd",
2636                Self::SentenceStart => "SentenceStart",
2637                Self::SentenceEnd => "SentenceEnd",
2638                Self::LineStart => "LineStart",
2639                Self::LineEnd => "LineEnd",
2640                _ => "Unknown",
2641            }
2642        )
2643    }
2644}
2645
2646#[doc(hidden)]
2647impl IntoGlib for TextBoundary {
2648    type GlibType = ffi::AtkTextBoundary;
2649
2650    #[inline]
2651    fn into_glib(self) -> ffi::AtkTextBoundary {
2652        match self {
2653            Self::Char => ffi::ATK_TEXT_BOUNDARY_CHAR,
2654            Self::WordStart => ffi::ATK_TEXT_BOUNDARY_WORD_START,
2655            Self::WordEnd => ffi::ATK_TEXT_BOUNDARY_WORD_END,
2656            Self::SentenceStart => ffi::ATK_TEXT_BOUNDARY_SENTENCE_START,
2657            Self::SentenceEnd => ffi::ATK_TEXT_BOUNDARY_SENTENCE_END,
2658            Self::LineStart => ffi::ATK_TEXT_BOUNDARY_LINE_START,
2659            Self::LineEnd => ffi::ATK_TEXT_BOUNDARY_LINE_END,
2660            Self::__Unknown(value) => value,
2661        }
2662    }
2663}
2664
2665#[doc(hidden)]
2666impl FromGlib<ffi::AtkTextBoundary> for TextBoundary {
2667    #[inline]
2668    unsafe fn from_glib(value: ffi::AtkTextBoundary) -> Self {
2669        skip_assert_initialized!();
2670
2671        match value {
2672            ffi::ATK_TEXT_BOUNDARY_CHAR => Self::Char,
2673            ffi::ATK_TEXT_BOUNDARY_WORD_START => Self::WordStart,
2674            ffi::ATK_TEXT_BOUNDARY_WORD_END => Self::WordEnd,
2675            ffi::ATK_TEXT_BOUNDARY_SENTENCE_START => Self::SentenceStart,
2676            ffi::ATK_TEXT_BOUNDARY_SENTENCE_END => Self::SentenceEnd,
2677            ffi::ATK_TEXT_BOUNDARY_LINE_START => Self::LineStart,
2678            ffi::ATK_TEXT_BOUNDARY_LINE_END => Self::LineEnd,
2679            value => Self::__Unknown(value),
2680        }
2681    }
2682}
2683
2684impl StaticType for TextBoundary {
2685    #[inline]
2686    fn static_type() -> glib::Type {
2687        unsafe { from_glib(ffi::atk_text_boundary_get_type()) }
2688    }
2689}
2690
2691impl glib::HasParamSpec for TextBoundary {
2692    type ParamSpec = glib::ParamSpecEnum;
2693    type SetValue = Self;
2694    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2695
2696    fn param_spec_builder() -> Self::BuilderFn {
2697        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2698    }
2699}
2700
2701impl glib::value::ValueType for TextBoundary {
2702    type Type = Self;
2703}
2704
2705unsafe impl<'a> glib::value::FromValue<'a> for TextBoundary {
2706    type Checker = glib::value::GenericValueTypeChecker<Self>;
2707
2708    #[inline]
2709    unsafe fn from_value(value: &'a glib::Value) -> Self {
2710        skip_assert_initialized!();
2711        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2712    }
2713}
2714
2715impl ToValue for TextBoundary {
2716    #[inline]
2717    fn to_value(&self) -> glib::Value {
2718        let mut value = glib::Value::for_value_type::<Self>();
2719        unsafe {
2720            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2721        }
2722        value
2723    }
2724
2725    #[inline]
2726    fn value_type(&self) -> glib::Type {
2727        Self::static_type()
2728    }
2729}
2730
2731impl From<TextBoundary> for glib::Value {
2732    #[inline]
2733    fn from(v: TextBoundary) -> Self {
2734        skip_assert_initialized!();
2735        ToValue::to_value(&v)
2736    }
2737}
2738
2739/// Describes the type of clipping required.
2740#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2741#[non_exhaustive]
2742#[doc(alias = "AtkTextClipType")]
2743pub enum TextClipType {
2744    /// No clipping to be done
2745    #[doc(alias = "ATK_TEXT_CLIP_NONE")]
2746    None,
2747    /// Text clipped by min coordinate is omitted
2748    #[doc(alias = "ATK_TEXT_CLIP_MIN")]
2749    Min,
2750    /// Text clipped by max coordinate is omitted
2751    #[doc(alias = "ATK_TEXT_CLIP_MAX")]
2752    Max,
2753    /// Only text fully within mix/max bound is retained
2754    #[doc(alias = "ATK_TEXT_CLIP_BOTH")]
2755    Both,
2756    #[doc(hidden)]
2757    __Unknown(i32),
2758}
2759
2760impl fmt::Display for TextClipType {
2761    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2762        write!(
2763            f,
2764            "TextClipType::{}",
2765            match *self {
2766                Self::None => "None",
2767                Self::Min => "Min",
2768                Self::Max => "Max",
2769                Self::Both => "Both",
2770                _ => "Unknown",
2771            }
2772        )
2773    }
2774}
2775
2776#[doc(hidden)]
2777impl IntoGlib for TextClipType {
2778    type GlibType = ffi::AtkTextClipType;
2779
2780    #[inline]
2781    fn into_glib(self) -> ffi::AtkTextClipType {
2782        match self {
2783            Self::None => ffi::ATK_TEXT_CLIP_NONE,
2784            Self::Min => ffi::ATK_TEXT_CLIP_MIN,
2785            Self::Max => ffi::ATK_TEXT_CLIP_MAX,
2786            Self::Both => ffi::ATK_TEXT_CLIP_BOTH,
2787            Self::__Unknown(value) => value,
2788        }
2789    }
2790}
2791
2792#[doc(hidden)]
2793impl FromGlib<ffi::AtkTextClipType> for TextClipType {
2794    #[inline]
2795    unsafe fn from_glib(value: ffi::AtkTextClipType) -> Self {
2796        skip_assert_initialized!();
2797
2798        match value {
2799            ffi::ATK_TEXT_CLIP_NONE => Self::None,
2800            ffi::ATK_TEXT_CLIP_MIN => Self::Min,
2801            ffi::ATK_TEXT_CLIP_MAX => Self::Max,
2802            ffi::ATK_TEXT_CLIP_BOTH => Self::Both,
2803            value => Self::__Unknown(value),
2804        }
2805    }
2806}
2807
2808impl StaticType for TextClipType {
2809    #[inline]
2810    fn static_type() -> glib::Type {
2811        unsafe { from_glib(ffi::atk_text_clip_type_get_type()) }
2812    }
2813}
2814
2815impl glib::HasParamSpec for TextClipType {
2816    type ParamSpec = glib::ParamSpecEnum;
2817    type SetValue = Self;
2818    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2819
2820    fn param_spec_builder() -> Self::BuilderFn {
2821        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2822    }
2823}
2824
2825impl glib::value::ValueType for TextClipType {
2826    type Type = Self;
2827}
2828
2829unsafe impl<'a> glib::value::FromValue<'a> for TextClipType {
2830    type Checker = glib::value::GenericValueTypeChecker<Self>;
2831
2832    #[inline]
2833    unsafe fn from_value(value: &'a glib::Value) -> Self {
2834        skip_assert_initialized!();
2835        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2836    }
2837}
2838
2839impl ToValue for TextClipType {
2840    #[inline]
2841    fn to_value(&self) -> glib::Value {
2842        let mut value = glib::Value::for_value_type::<Self>();
2843        unsafe {
2844            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2845        }
2846        value
2847    }
2848
2849    #[inline]
2850    fn value_type(&self) -> glib::Type {
2851        Self::static_type()
2852    }
2853}
2854
2855impl From<TextClipType> for glib::Value {
2856    #[inline]
2857    fn from(v: TextClipType) -> Self {
2858        skip_assert_initialized!();
2859        ToValue::to_value(&v)
2860    }
2861}
2862
2863/// Text granularity types used for specifying the granularity of the region of
2864/// text we are interested in.
2865#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2866#[non_exhaustive]
2867#[doc(alias = "AtkTextGranularity")]
2868pub enum TextGranularity {
2869    /// Granularity is defined by the boundaries between characters
2870    /// (including non-printing characters)
2871    #[doc(alias = "ATK_TEXT_GRANULARITY_CHAR")]
2872    Char,
2873    /// Granularity is defined by the boundaries of a word,
2874    /// starting at the beginning of the current word and finishing at the beginning of
2875    /// the following one, if present.
2876    #[doc(alias = "ATK_TEXT_GRANULARITY_WORD")]
2877    Word,
2878    /// Granularity is defined by the boundaries of a sentence,
2879    /// starting at the beginning of the current sentence and finishing at the beginning of
2880    /// the following one, if present.
2881    #[doc(alias = "ATK_TEXT_GRANULARITY_SENTENCE")]
2882    Sentence,
2883    /// Granularity is defined by the boundaries of a line,
2884    /// starting at the beginning of the current line and finishing at the beginning of
2885    /// the following one, if present.
2886    #[doc(alias = "ATK_TEXT_GRANULARITY_LINE")]
2887    Line,
2888    /// Granularity is defined by the boundaries of a paragraph,
2889    /// starting at the beginning of the current paragraph and finishing at the beginning of
2890    /// the following one, if present.
2891    #[doc(alias = "ATK_TEXT_GRANULARITY_PARAGRAPH")]
2892    Paragraph,
2893    #[doc(hidden)]
2894    __Unknown(i32),
2895}
2896
2897impl fmt::Display for TextGranularity {
2898    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2899        write!(
2900            f,
2901            "TextGranularity::{}",
2902            match *self {
2903                Self::Char => "Char",
2904                Self::Word => "Word",
2905                Self::Sentence => "Sentence",
2906                Self::Line => "Line",
2907                Self::Paragraph => "Paragraph",
2908                _ => "Unknown",
2909            }
2910        )
2911    }
2912}
2913
2914#[doc(hidden)]
2915impl IntoGlib for TextGranularity {
2916    type GlibType = ffi::AtkTextGranularity;
2917
2918    #[inline]
2919    fn into_glib(self) -> ffi::AtkTextGranularity {
2920        match self {
2921            Self::Char => ffi::ATK_TEXT_GRANULARITY_CHAR,
2922            Self::Word => ffi::ATK_TEXT_GRANULARITY_WORD,
2923            Self::Sentence => ffi::ATK_TEXT_GRANULARITY_SENTENCE,
2924            Self::Line => ffi::ATK_TEXT_GRANULARITY_LINE,
2925            Self::Paragraph => ffi::ATK_TEXT_GRANULARITY_PARAGRAPH,
2926            Self::__Unknown(value) => value,
2927        }
2928    }
2929}
2930
2931#[doc(hidden)]
2932impl FromGlib<ffi::AtkTextGranularity> for TextGranularity {
2933    #[inline]
2934    unsafe fn from_glib(value: ffi::AtkTextGranularity) -> Self {
2935        skip_assert_initialized!();
2936
2937        match value {
2938            ffi::ATK_TEXT_GRANULARITY_CHAR => Self::Char,
2939            ffi::ATK_TEXT_GRANULARITY_WORD => Self::Word,
2940            ffi::ATK_TEXT_GRANULARITY_SENTENCE => Self::Sentence,
2941            ffi::ATK_TEXT_GRANULARITY_LINE => Self::Line,
2942            ffi::ATK_TEXT_GRANULARITY_PARAGRAPH => Self::Paragraph,
2943            value => Self::__Unknown(value),
2944        }
2945    }
2946}
2947
2948impl StaticType for TextGranularity {
2949    #[inline]
2950    fn static_type() -> glib::Type {
2951        unsafe { from_glib(ffi::atk_text_granularity_get_type()) }
2952    }
2953}
2954
2955impl glib::HasParamSpec for TextGranularity {
2956    type ParamSpec = glib::ParamSpecEnum;
2957    type SetValue = Self;
2958    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
2959
2960    fn param_spec_builder() -> Self::BuilderFn {
2961        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
2962    }
2963}
2964
2965impl glib::value::ValueType for TextGranularity {
2966    type Type = Self;
2967}
2968
2969unsafe impl<'a> glib::value::FromValue<'a> for TextGranularity {
2970    type Checker = glib::value::GenericValueTypeChecker<Self>;
2971
2972    #[inline]
2973    unsafe fn from_value(value: &'a glib::Value) -> Self {
2974        skip_assert_initialized!();
2975        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
2976    }
2977}
2978
2979impl ToValue for TextGranularity {
2980    #[inline]
2981    fn to_value(&self) -> glib::Value {
2982        let mut value = glib::Value::for_value_type::<Self>();
2983        unsafe {
2984            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
2985        }
2986        value
2987    }
2988
2989    #[inline]
2990    fn value_type(&self) -> glib::Type {
2991        Self::static_type()
2992    }
2993}
2994
2995impl From<TextGranularity> for glib::Value {
2996    #[inline]
2997    fn from(v: TextGranularity) -> Self {
2998        skip_assert_initialized!();
2999        ToValue::to_value(&v)
3000    }
3001}
3002
3003/// Default types for a given value. Those are defined in order to
3004/// easily get localized strings to describe a given value or a given
3005/// subrange, using [`localized_name()`][Self::localized_name()].
3006#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3007#[non_exhaustive]
3008#[doc(alias = "AtkValueType")]
3009pub enum ValueType {
3010    #[doc(alias = "ATK_VALUE_VERY_WEAK")]
3011    VeryWeak,
3012    #[doc(alias = "ATK_VALUE_WEAK")]
3013    Weak,
3014    #[doc(alias = "ATK_VALUE_ACCEPTABLE")]
3015    Acceptable,
3016    #[doc(alias = "ATK_VALUE_STRONG")]
3017    Strong,
3018    #[doc(alias = "ATK_VALUE_VERY_STRONG")]
3019    VeryStrong,
3020    #[doc(alias = "ATK_VALUE_VERY_LOW")]
3021    VeryLow,
3022    #[doc(alias = "ATK_VALUE_LOW")]
3023    Low,
3024    #[doc(alias = "ATK_VALUE_MEDIUM")]
3025    Medium,
3026    #[doc(alias = "ATK_VALUE_HIGH")]
3027    High,
3028    #[doc(alias = "ATK_VALUE_VERY_HIGH")]
3029    VeryHigh,
3030    #[doc(alias = "ATK_VALUE_VERY_BAD")]
3031    VeryBad,
3032    #[doc(alias = "ATK_VALUE_BAD")]
3033    Bad,
3034    #[doc(alias = "ATK_VALUE_GOOD")]
3035    Good,
3036    #[doc(alias = "ATK_VALUE_VERY_GOOD")]
3037    VeryGood,
3038    #[doc(alias = "ATK_VALUE_BEST")]
3039    Best,
3040    #[doc(alias = "ATK_VALUE_LAST_DEFINED")]
3041    LastDefined,
3042    #[doc(hidden)]
3043    __Unknown(i32),
3044}
3045
3046impl ValueType {
3047    #[doc(alias = "atk_value_type_get_localized_name")]
3048    #[doc(alias = "get_localized_name")]
3049    pub fn localized_name(self) -> Option<glib::GString> {
3050        assert_initialized_main_thread!();
3051        unsafe { from_glib_none(ffi::atk_value_type_get_localized_name(self.into_glib())) }
3052    }
3053
3054    #[doc(alias = "atk_value_type_get_name")]
3055    #[doc(alias = "get_name")]
3056    pub fn name(self) -> Option<glib::GString> {
3057        assert_initialized_main_thread!();
3058        unsafe { from_glib_none(ffi::atk_value_type_get_name(self.into_glib())) }
3059    }
3060}
3061
3062impl fmt::Display for ValueType {
3063    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3064        write!(
3065            f,
3066            "ValueType::{}",
3067            match *self {
3068                Self::VeryWeak => "VeryWeak",
3069                Self::Weak => "Weak",
3070                Self::Acceptable => "Acceptable",
3071                Self::Strong => "Strong",
3072                Self::VeryStrong => "VeryStrong",
3073                Self::VeryLow => "VeryLow",
3074                Self::Low => "Low",
3075                Self::Medium => "Medium",
3076                Self::High => "High",
3077                Self::VeryHigh => "VeryHigh",
3078                Self::VeryBad => "VeryBad",
3079                Self::Bad => "Bad",
3080                Self::Good => "Good",
3081                Self::VeryGood => "VeryGood",
3082                Self::Best => "Best",
3083                Self::LastDefined => "LastDefined",
3084                _ => "Unknown",
3085            }
3086        )
3087    }
3088}
3089
3090#[doc(hidden)]
3091impl IntoGlib for ValueType {
3092    type GlibType = ffi::AtkValueType;
3093
3094    fn into_glib(self) -> ffi::AtkValueType {
3095        match self {
3096            Self::VeryWeak => ffi::ATK_VALUE_VERY_WEAK,
3097            Self::Weak => ffi::ATK_VALUE_WEAK,
3098            Self::Acceptable => ffi::ATK_VALUE_ACCEPTABLE,
3099            Self::Strong => ffi::ATK_VALUE_STRONG,
3100            Self::VeryStrong => ffi::ATK_VALUE_VERY_STRONG,
3101            Self::VeryLow => ffi::ATK_VALUE_VERY_LOW,
3102            Self::Low => ffi::ATK_VALUE_LOW,
3103            Self::Medium => ffi::ATK_VALUE_MEDIUM,
3104            Self::High => ffi::ATK_VALUE_HIGH,
3105            Self::VeryHigh => ffi::ATK_VALUE_VERY_HIGH,
3106            Self::VeryBad => ffi::ATK_VALUE_VERY_BAD,
3107            Self::Bad => ffi::ATK_VALUE_BAD,
3108            Self::Good => ffi::ATK_VALUE_GOOD,
3109            Self::VeryGood => ffi::ATK_VALUE_VERY_GOOD,
3110            Self::Best => ffi::ATK_VALUE_BEST,
3111            Self::LastDefined => ffi::ATK_VALUE_LAST_DEFINED,
3112            Self::__Unknown(value) => value,
3113        }
3114    }
3115}
3116
3117#[doc(hidden)]
3118impl FromGlib<ffi::AtkValueType> for ValueType {
3119    unsafe fn from_glib(value: ffi::AtkValueType) -> Self {
3120        skip_assert_initialized!();
3121
3122        match value {
3123            ffi::ATK_VALUE_VERY_WEAK => Self::VeryWeak,
3124            ffi::ATK_VALUE_WEAK => Self::Weak,
3125            ffi::ATK_VALUE_ACCEPTABLE => Self::Acceptable,
3126            ffi::ATK_VALUE_STRONG => Self::Strong,
3127            ffi::ATK_VALUE_VERY_STRONG => Self::VeryStrong,
3128            ffi::ATK_VALUE_VERY_LOW => Self::VeryLow,
3129            ffi::ATK_VALUE_LOW => Self::Low,
3130            ffi::ATK_VALUE_MEDIUM => Self::Medium,
3131            ffi::ATK_VALUE_HIGH => Self::High,
3132            ffi::ATK_VALUE_VERY_HIGH => Self::VeryHigh,
3133            ffi::ATK_VALUE_VERY_BAD => Self::VeryBad,
3134            ffi::ATK_VALUE_BAD => Self::Bad,
3135            ffi::ATK_VALUE_GOOD => Self::Good,
3136            ffi::ATK_VALUE_VERY_GOOD => Self::VeryGood,
3137            ffi::ATK_VALUE_BEST => Self::Best,
3138            ffi::ATK_VALUE_LAST_DEFINED => Self::LastDefined,
3139            value => Self::__Unknown(value),
3140        }
3141    }
3142}
3143
3144impl StaticType for ValueType {
3145    #[inline]
3146    fn static_type() -> glib::Type {
3147        unsafe { from_glib(ffi::atk_value_type_get_type()) }
3148    }
3149}
3150
3151impl glib::HasParamSpec for ValueType {
3152    type ParamSpec = glib::ParamSpecEnum;
3153    type SetValue = Self;
3154    type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
3155
3156    fn param_spec_builder() -> Self::BuilderFn {
3157        |name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
3158    }
3159}
3160
3161impl glib::value::ValueType for ValueType {
3162    type Type = Self;
3163}
3164
3165unsafe impl<'a> glib::value::FromValue<'a> for ValueType {
3166    type Checker = glib::value::GenericValueTypeChecker<Self>;
3167
3168    #[inline]
3169    unsafe fn from_value(value: &'a glib::Value) -> Self {
3170        skip_assert_initialized!();
3171        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
3172    }
3173}
3174
3175impl ToValue for ValueType {
3176    #[inline]
3177    fn to_value(&self) -> glib::Value {
3178        let mut value = glib::Value::for_value_type::<Self>();
3179        unsafe {
3180            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
3181        }
3182        value
3183    }
3184
3185    #[inline]
3186    fn value_type(&self) -> glib::Type {
3187        Self::static_type()
3188    }
3189}
3190
3191impl From<ValueType> for glib::Value {
3192    #[inline]
3193    fn from(v: ValueType) -> Self {
3194        skip_assert_initialized!();
3195        ToValue::to_value(&v)
3196    }
3197}