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