Skip to main content

pango/auto/
flags.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::{bitflags::bitflags, prelude::*, translate::*};
7
8bitflags! {
9    /// The bits in a [`FontMask`][crate::FontMask] correspond to the set fields in a
10    /// [`FontDescription`][crate::FontDescription].
11    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12    #[doc(alias = "PangoFontMask")]
13    pub struct FontMask: u32 {
14        /// the font family is specified.
15        #[doc(alias = "PANGO_FONT_MASK_FAMILY")]
16        const FAMILY = ffi::PANGO_FONT_MASK_FAMILY as _;
17        /// the font style is specified.
18        #[doc(alias = "PANGO_FONT_MASK_STYLE")]
19        const STYLE = ffi::PANGO_FONT_MASK_STYLE as _;
20        /// the font variant is specified.
21        #[doc(alias = "PANGO_FONT_MASK_VARIANT")]
22        const VARIANT = ffi::PANGO_FONT_MASK_VARIANT as _;
23        /// the font weight is specified.
24        #[doc(alias = "PANGO_FONT_MASK_WEIGHT")]
25        const WEIGHT = ffi::PANGO_FONT_MASK_WEIGHT as _;
26        /// Font width is specified.
27        ///
28        /// This is an alias for [flags@Pango.FontMask.STRETCH].
29        ///
30        /// 1.58
31        #[doc(alias = "PANGO_FONT_MASK_WIDTH")]
32        const WIDTH = ffi::PANGO_FONT_MASK_WIDTH as _;
33        /// the font stretch/width is specified.
34        #[doc(alias = "PANGO_FONT_MASK_STRETCH")]
35        const STRETCH = ffi::PANGO_FONT_MASK_STRETCH as _;
36        /// the font size is specified.
37        #[doc(alias = "PANGO_FONT_MASK_SIZE")]
38        const SIZE = ffi::PANGO_FONT_MASK_SIZE as _;
39        /// The font gravity is specified.
40        #[doc(alias = "PANGO_FONT_MASK_GRAVITY")]
41        const GRAVITY = ffi::PANGO_FONT_MASK_GRAVITY as _;
42        /// OpenType font variations are specified.
43        #[cfg(feature = "v1_42")]
44        #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
45        #[doc(alias = "PANGO_FONT_MASK_VARIATIONS")]
46        const VARIATIONS = ffi::PANGO_FONT_MASK_VARIATIONS as _;
47        /// OpenType font features are specified.
48        #[cfg(feature = "v1_56")]
49        #[cfg_attr(docsrs, doc(cfg(feature = "v1_56")))]
50        #[doc(alias = "PANGO_FONT_MASK_FEATURES")]
51        const FEATURES = ffi::PANGO_FONT_MASK_FEATURES as _;
52        /// Font color is specified.
53        #[cfg(feature = "v1_57")]
54        #[cfg_attr(docsrs, doc(cfg(feature = "v1_57")))]
55        #[doc(alias = "PANGO_FONT_MASK_COLOR")]
56        const COLOR = ffi::PANGO_FONT_MASK_COLOR as _;
57    }
58}
59
60#[doc(hidden)]
61impl IntoGlib for FontMask {
62    type GlibType = ffi::PangoFontMask;
63
64    #[inline]
65    fn into_glib(self) -> ffi::PangoFontMask {
66        self.bits()
67    }
68}
69
70#[doc(hidden)]
71impl FromGlib<ffi::PangoFontMask> for FontMask {
72    #[inline]
73    unsafe fn from_glib(value: ffi::PangoFontMask) -> Self {
74        Self::from_bits_truncate(value)
75    }
76}
77
78impl StaticType for FontMask {
79    #[inline]
80    #[doc(alias = "pango_font_mask_get_type")]
81    fn static_type() -> glib::Type {
82        unsafe { from_glib(ffi::pango_font_mask_get_type()) }
83    }
84}
85
86impl glib::HasParamSpec for FontMask {
87    type ParamSpec = glib::ParamSpecFlags;
88    type SetValue = Self;
89    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
90
91    fn param_spec_builder() -> Self::BuilderFn {
92        Self::ParamSpec::builder
93    }
94}
95
96impl glib::value::ValueType for FontMask {
97    type Type = Self;
98}
99
100unsafe impl<'a> glib::value::FromValue<'a> for FontMask {
101    type Checker = glib::value::GenericValueTypeChecker<Self>;
102
103    #[inline]
104    unsafe fn from_value(value: &'a glib::Value) -> Self {
105        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
106    }
107}
108
109impl ToValue for FontMask {
110    #[inline]
111    fn to_value(&self) -> glib::Value {
112        let mut value = glib::Value::for_value_type::<Self>();
113        unsafe {
114            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
115        }
116        value
117    }
118
119    #[inline]
120    fn value_type(&self) -> glib::Type {
121        Self::static_type()
122    }
123}
124
125impl From<FontMask> for glib::Value {
126    #[inline]
127    fn from(v: FontMask) -> Self {
128        ToValue::to_value(&v)
129    }
130}
131
132#[cfg(feature = "v1_50")]
133bitflags! {
134    /// Flags that influence the behavior of `Pango::Layout::deserialize()`.
135    ///
136    /// New members may be added to this enumeration over time.
137    #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
138    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
139    #[doc(alias = "PangoLayoutDeserializeFlags")]
140    pub struct LayoutDeserializeFlags: u32 {
141        /// Default behavior
142        #[doc(alias = "PANGO_LAYOUT_DESERIALIZE_DEFAULT")]
143        const DEFAULT = ffi::PANGO_LAYOUT_DESERIALIZE_DEFAULT as _;
144        /// Apply context information
145        ///   from the serialization to the [`Context`][crate::Context]
146        #[doc(alias = "PANGO_LAYOUT_DESERIALIZE_CONTEXT")]
147        const CONTEXT = ffi::PANGO_LAYOUT_DESERIALIZE_CONTEXT as _;
148    }
149}
150
151#[cfg(feature = "v1_50")]
152#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
153#[doc(hidden)]
154impl IntoGlib for LayoutDeserializeFlags {
155    type GlibType = ffi::PangoLayoutDeserializeFlags;
156
157    #[inline]
158    fn into_glib(self) -> ffi::PangoLayoutDeserializeFlags {
159        self.bits()
160    }
161}
162
163#[cfg(feature = "v1_50")]
164#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
165#[doc(hidden)]
166impl FromGlib<ffi::PangoLayoutDeserializeFlags> for LayoutDeserializeFlags {
167    #[inline]
168    unsafe fn from_glib(value: ffi::PangoLayoutDeserializeFlags) -> Self {
169        Self::from_bits_truncate(value)
170    }
171}
172
173#[cfg(feature = "v1_50")]
174#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
175impl StaticType for LayoutDeserializeFlags {
176    #[inline]
177    #[doc(alias = "pango_layout_deserialize_flags_get_type")]
178    fn static_type() -> glib::Type {
179        unsafe { from_glib(ffi::pango_layout_deserialize_flags_get_type()) }
180    }
181}
182
183#[cfg(feature = "v1_50")]
184#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
185impl glib::HasParamSpec for LayoutDeserializeFlags {
186    type ParamSpec = glib::ParamSpecFlags;
187    type SetValue = Self;
188    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
189
190    fn param_spec_builder() -> Self::BuilderFn {
191        Self::ParamSpec::builder
192    }
193}
194
195#[cfg(feature = "v1_50")]
196#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
197impl glib::value::ValueType for LayoutDeserializeFlags {
198    type Type = Self;
199}
200
201#[cfg(feature = "v1_50")]
202#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
203unsafe impl<'a> glib::value::FromValue<'a> for LayoutDeserializeFlags {
204    type Checker = glib::value::GenericValueTypeChecker<Self>;
205
206    #[inline]
207    unsafe fn from_value(value: &'a glib::Value) -> Self {
208        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
209    }
210}
211
212#[cfg(feature = "v1_50")]
213#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
214impl ToValue for LayoutDeserializeFlags {
215    #[inline]
216    fn to_value(&self) -> glib::Value {
217        let mut value = glib::Value::for_value_type::<Self>();
218        unsafe {
219            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
220        }
221        value
222    }
223
224    #[inline]
225    fn value_type(&self) -> glib::Type {
226        Self::static_type()
227    }
228}
229
230#[cfg(feature = "v1_50")]
231#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
232impl From<LayoutDeserializeFlags> for glib::Value {
233    #[inline]
234    fn from(v: LayoutDeserializeFlags) -> Self {
235        ToValue::to_value(&v)
236    }
237}
238
239#[cfg(feature = "v1_50")]
240bitflags! {
241    /// Flags that influence the behavior of [`Layout::serialize()`][crate::Layout::serialize()].
242    ///
243    /// New members may be added to this enumeration over time.
244    #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
245    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
246    #[doc(alias = "PangoLayoutSerializeFlags")]
247    pub struct LayoutSerializeFlags: u32 {
248        /// Default behavior
249        #[doc(alias = "PANGO_LAYOUT_SERIALIZE_DEFAULT")]
250        const DEFAULT = ffi::PANGO_LAYOUT_SERIALIZE_DEFAULT as _;
251        /// Include context information
252        #[doc(alias = "PANGO_LAYOUT_SERIALIZE_CONTEXT")]
253        const CONTEXT = ffi::PANGO_LAYOUT_SERIALIZE_CONTEXT as _;
254        /// Include information about the formatted output
255        #[doc(alias = "PANGO_LAYOUT_SERIALIZE_OUTPUT")]
256        const OUTPUT = ffi::PANGO_LAYOUT_SERIALIZE_OUTPUT as _;
257    }
258}
259
260#[cfg(feature = "v1_50")]
261#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
262#[doc(hidden)]
263impl IntoGlib for LayoutSerializeFlags {
264    type GlibType = ffi::PangoLayoutSerializeFlags;
265
266    #[inline]
267    fn into_glib(self) -> ffi::PangoLayoutSerializeFlags {
268        self.bits()
269    }
270}
271
272#[cfg(feature = "v1_50")]
273#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
274#[doc(hidden)]
275impl FromGlib<ffi::PangoLayoutSerializeFlags> for LayoutSerializeFlags {
276    #[inline]
277    unsafe fn from_glib(value: ffi::PangoLayoutSerializeFlags) -> Self {
278        Self::from_bits_truncate(value)
279    }
280}
281
282#[cfg(feature = "v1_50")]
283#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
284impl StaticType for LayoutSerializeFlags {
285    #[inline]
286    #[doc(alias = "pango_layout_serialize_flags_get_type")]
287    fn static_type() -> glib::Type {
288        unsafe { from_glib(ffi::pango_layout_serialize_flags_get_type()) }
289    }
290}
291
292#[cfg(feature = "v1_50")]
293#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
294impl glib::HasParamSpec for LayoutSerializeFlags {
295    type ParamSpec = glib::ParamSpecFlags;
296    type SetValue = Self;
297    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
298
299    fn param_spec_builder() -> Self::BuilderFn {
300        Self::ParamSpec::builder
301    }
302}
303
304#[cfg(feature = "v1_50")]
305#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
306impl glib::value::ValueType for LayoutSerializeFlags {
307    type Type = Self;
308}
309
310#[cfg(feature = "v1_50")]
311#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
312unsafe impl<'a> glib::value::FromValue<'a> for LayoutSerializeFlags {
313    type Checker = glib::value::GenericValueTypeChecker<Self>;
314
315    #[inline]
316    unsafe fn from_value(value: &'a glib::Value) -> Self {
317        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
318    }
319}
320
321#[cfg(feature = "v1_50")]
322#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
323impl ToValue for LayoutSerializeFlags {
324    #[inline]
325    fn to_value(&self) -> glib::Value {
326        let mut value = glib::Value::for_value_type::<Self>();
327        unsafe {
328            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
329        }
330        value
331    }
332
333    #[inline]
334    fn value_type(&self) -> glib::Type {
335        Self::static_type()
336    }
337}
338
339#[cfg(feature = "v1_50")]
340#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
341impl From<LayoutSerializeFlags> for glib::Value {
342    #[inline]
343    fn from(v: LayoutSerializeFlags) -> Self {
344        ToValue::to_value(&v)
345    }
346}
347
348#[cfg(feature = "v1_58")]
349bitflags! {
350    /// Flags that specify which components of a layout to include
351    /// in renderer output.
352    ///
353    /// This is more or less parallel to the [`RenderPart`][crate::RenderPart] enum,
354    /// but allows separating plain and color glyphs, and specifying more
355    /// than one component.
356    #[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
357    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
358    #[doc(alias = "PangoRenderComponent")]
359    pub struct RenderComponent: u32 {
360        /// No components
361        #[doc(alias = "PANGO_RENDER_COMPONENT_NONE")]
362        const NONE = ffi::PANGO_RENDER_COMPONENT_NONE as _;
363        /// The plain glyphs of the layout
364        #[doc(alias = "PANGO_RENDER_COMPONENT_PLAIN_GLYPH")]
365        const PLAIN_GLYPH = ffi::PANGO_RENDER_COMPONENT_PLAIN_GLYPH as _;
366        /// The color glyphs of the layout
367        #[doc(alias = "PANGO_RENDER_COMPONENT_COLOR_GLYPH")]
368        const COLOR_GLYPH = ffi::PANGO_RENDER_COMPONENT_COLOR_GLYPH as _;
369        /// Background of the layout
370        #[doc(alias = "PANGO_RENDER_COMPONENT_BACKGROUND")]
371        const BACKGROUND = ffi::PANGO_RENDER_COMPONENT_BACKGROUND as _;
372        /// Underlines of the layout
373        #[doc(alias = "PANGO_RENDER_COMPONENT_UNDERLINE")]
374        const UNDERLINE = ffi::PANGO_RENDER_COMPONENT_UNDERLINE as _;
375        /// Strikethrough lines of the layout
376        #[doc(alias = "PANGO_RENDER_COMPONENT_STRIKETHROUGH")]
377        const STRIKETHROUGH = ffi::PANGO_RENDER_COMPONENT_STRIKETHROUGH as _;
378        /// Overlines of the layout
379        #[doc(alias = "PANGO_RENDER_COMPONENT_OVERLINE")]
380        const OVERLINE = ffi::PANGO_RENDER_COMPONENT_OVERLINE as _;
381    }
382}
383
384#[cfg(feature = "v1_58")]
385#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
386#[doc(hidden)]
387impl IntoGlib for RenderComponent {
388    type GlibType = ffi::PangoRenderComponent;
389
390    #[inline]
391    fn into_glib(self) -> ffi::PangoRenderComponent {
392        self.bits()
393    }
394}
395
396#[cfg(feature = "v1_58")]
397#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
398#[doc(hidden)]
399impl FromGlib<ffi::PangoRenderComponent> for RenderComponent {
400    #[inline]
401    unsafe fn from_glib(value: ffi::PangoRenderComponent) -> Self {
402        Self::from_bits_truncate(value)
403    }
404}
405
406#[cfg(feature = "v1_58")]
407#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
408impl StaticType for RenderComponent {
409    #[inline]
410    #[doc(alias = "pango_render_component_get_type")]
411    fn static_type() -> glib::Type {
412        unsafe { from_glib(ffi::pango_render_component_get_type()) }
413    }
414}
415
416#[cfg(feature = "v1_58")]
417#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
418impl glib::HasParamSpec for RenderComponent {
419    type ParamSpec = glib::ParamSpecFlags;
420    type SetValue = Self;
421    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
422
423    fn param_spec_builder() -> Self::BuilderFn {
424        Self::ParamSpec::builder
425    }
426}
427
428#[cfg(feature = "v1_58")]
429#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
430impl glib::value::ValueType for RenderComponent {
431    type Type = Self;
432}
433
434#[cfg(feature = "v1_58")]
435#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
436unsafe impl<'a> glib::value::FromValue<'a> for RenderComponent {
437    type Checker = glib::value::GenericValueTypeChecker<Self>;
438
439    #[inline]
440    unsafe fn from_value(value: &'a glib::Value) -> Self {
441        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
442    }
443}
444
445#[cfg(feature = "v1_58")]
446#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
447impl ToValue for RenderComponent {
448    #[inline]
449    fn to_value(&self) -> glib::Value {
450        let mut value = glib::Value::for_value_type::<Self>();
451        unsafe {
452            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
453        }
454        value
455    }
456
457    #[inline]
458    fn value_type(&self) -> glib::Type {
459        Self::static_type()
460    }
461}
462
463#[cfg(feature = "v1_58")]
464#[cfg_attr(docsrs, doc(cfg(feature = "v1_58")))]
465impl From<RenderComponent> for glib::Value {
466    #[inline]
467    fn from(v: RenderComponent) -> Self {
468        ToValue::to_value(&v)
469    }
470}
471
472#[cfg(feature = "v1_44")]
473bitflags! {
474    /// Flags influencing the shaping process.
475    ///
476    /// [`ShapeFlags`][crate::ShapeFlags] can be passed to [`shape_with_flags()`][crate::shape_with_flags()].
477    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
478    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
479    #[doc(alias = "PangoShapeFlags")]
480    pub struct ShapeFlags: u32 {
481        /// Default value
482        #[doc(alias = "PANGO_SHAPE_NONE")]
483        const NONE = ffi::PANGO_SHAPE_NONE as _;
484        /// Round glyph positions and widths to whole device units
485        ///   This option should be set if the target renderer can't do subpixel positioning of glyphs
486        #[doc(alias = "PANGO_SHAPE_ROUND_POSITIONS")]
487        const ROUND_POSITIONS = ffi::PANGO_SHAPE_ROUND_POSITIONS as _;
488    }
489}
490
491#[cfg(feature = "v1_44")]
492#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
493#[doc(hidden)]
494impl IntoGlib for ShapeFlags {
495    type GlibType = ffi::PangoShapeFlags;
496
497    #[inline]
498    fn into_glib(self) -> ffi::PangoShapeFlags {
499        self.bits()
500    }
501}
502
503#[cfg(feature = "v1_44")]
504#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
505#[doc(hidden)]
506impl FromGlib<ffi::PangoShapeFlags> for ShapeFlags {
507    #[inline]
508    unsafe fn from_glib(value: ffi::PangoShapeFlags) -> Self {
509        Self::from_bits_truncate(value)
510    }
511}
512
513#[cfg(feature = "v1_44")]
514#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
515impl StaticType for ShapeFlags {
516    #[inline]
517    #[doc(alias = "pango_shape_flags_get_type")]
518    fn static_type() -> glib::Type {
519        unsafe { from_glib(ffi::pango_shape_flags_get_type()) }
520    }
521}
522
523#[cfg(feature = "v1_44")]
524#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
525impl glib::HasParamSpec for ShapeFlags {
526    type ParamSpec = glib::ParamSpecFlags;
527    type SetValue = Self;
528    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
529
530    fn param_spec_builder() -> Self::BuilderFn {
531        Self::ParamSpec::builder
532    }
533}
534
535#[cfg(feature = "v1_44")]
536#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
537impl glib::value::ValueType for ShapeFlags {
538    type Type = Self;
539}
540
541#[cfg(feature = "v1_44")]
542#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
543unsafe impl<'a> glib::value::FromValue<'a> for ShapeFlags {
544    type Checker = glib::value::GenericValueTypeChecker<Self>;
545
546    #[inline]
547    unsafe fn from_value(value: &'a glib::Value) -> Self {
548        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
549    }
550}
551
552#[cfg(feature = "v1_44")]
553#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
554impl ToValue for ShapeFlags {
555    #[inline]
556    fn to_value(&self) -> glib::Value {
557        let mut value = glib::Value::for_value_type::<Self>();
558        unsafe {
559            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
560        }
561        value
562    }
563
564    #[inline]
565    fn value_type(&self) -> glib::Type {
566        Self::static_type()
567    }
568}
569
570#[cfg(feature = "v1_44")]
571#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
572impl From<ShapeFlags> for glib::Value {
573    #[inline]
574    fn from(v: ShapeFlags) -> Self {
575        ToValue::to_value(&v)
576    }
577}
578
579#[cfg(feature = "v1_44")]
580bitflags! {
581    /// These flags affect how Pango treats characters that are normally
582    /// not visible in the output.
583    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
584    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
585    #[doc(alias = "PangoShowFlags")]
586    pub struct ShowFlags: u32 {
587        /// No special treatment for invisible characters
588        #[doc(alias = "PANGO_SHOW_NONE")]
589        const NONE = ffi::PANGO_SHOW_NONE as _;
590        /// Render spaces, tabs and newlines visibly
591        #[doc(alias = "PANGO_SHOW_SPACES")]
592        const SPACES = ffi::PANGO_SHOW_SPACES as _;
593        /// Render line breaks visibly
594        #[doc(alias = "PANGO_SHOW_LINE_BREAKS")]
595        const LINE_BREAKS = ffi::PANGO_SHOW_LINE_BREAKS as _;
596        /// Render default-ignorable Unicode
597        ///   characters visibly
598        #[doc(alias = "PANGO_SHOW_IGNORABLES")]
599        const IGNORABLES = ffi::PANGO_SHOW_IGNORABLES as _;
600    }
601}
602
603#[cfg(feature = "v1_44")]
604#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
605#[doc(hidden)]
606impl IntoGlib for ShowFlags {
607    type GlibType = ffi::PangoShowFlags;
608
609    #[inline]
610    fn into_glib(self) -> ffi::PangoShowFlags {
611        self.bits()
612    }
613}
614
615#[cfg(feature = "v1_44")]
616#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
617#[doc(hidden)]
618impl FromGlib<ffi::PangoShowFlags> for ShowFlags {
619    #[inline]
620    unsafe fn from_glib(value: ffi::PangoShowFlags) -> Self {
621        Self::from_bits_truncate(value)
622    }
623}
624
625#[cfg(feature = "v1_44")]
626#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
627impl StaticType for ShowFlags {
628    #[inline]
629    #[doc(alias = "pango_show_flags_get_type")]
630    fn static_type() -> glib::Type {
631        unsafe { from_glib(ffi::pango_show_flags_get_type()) }
632    }
633}
634
635#[cfg(feature = "v1_44")]
636#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
637impl glib::HasParamSpec for ShowFlags {
638    type ParamSpec = glib::ParamSpecFlags;
639    type SetValue = Self;
640    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
641
642    fn param_spec_builder() -> Self::BuilderFn {
643        Self::ParamSpec::builder
644    }
645}
646
647#[cfg(feature = "v1_44")]
648#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
649impl glib::value::ValueType for ShowFlags {
650    type Type = Self;
651}
652
653#[cfg(feature = "v1_44")]
654#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
655unsafe impl<'a> glib::value::FromValue<'a> for ShowFlags {
656    type Checker = glib::value::GenericValueTypeChecker<Self>;
657
658    #[inline]
659    unsafe fn from_value(value: &'a glib::Value) -> Self {
660        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
661    }
662}
663
664#[cfg(feature = "v1_44")]
665#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
666impl ToValue for ShowFlags {
667    #[inline]
668    fn to_value(&self) -> glib::Value {
669        let mut value = glib::Value::for_value_type::<Self>();
670        unsafe {
671            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
672        }
673        value
674    }
675
676    #[inline]
677    fn value_type(&self) -> glib::Type {
678        Self::static_type()
679    }
680}
681
682#[cfg(feature = "v1_44")]
683#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
684impl From<ShowFlags> for glib::Value {
685    #[inline]
686    fn from(v: ShowFlags) -> Self {
687        ToValue::to_value(&v)
688    }
689}