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        /// the font stretch is specified.
27        #[doc(alias = "PANGO_FONT_MASK_STRETCH")]
28        const STRETCH = ffi::PANGO_FONT_MASK_STRETCH as _;
29        /// the font size is specified.
30        #[doc(alias = "PANGO_FONT_MASK_SIZE")]
31        const SIZE = ffi::PANGO_FONT_MASK_SIZE as _;
32        /// The font gravity is specified.
33        #[doc(alias = "PANGO_FONT_MASK_GRAVITY")]
34        const GRAVITY = ffi::PANGO_FONT_MASK_GRAVITY as _;
35        /// OpenType font variations are specified.
36        #[cfg(feature = "v1_42")]
37        #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
38        #[doc(alias = "PANGO_FONT_MASK_VARIATIONS")]
39        const VARIATIONS = ffi::PANGO_FONT_MASK_VARIATIONS as _;
40        /// OpenType font features are specified.
41        #[cfg(feature = "v1_56")]
42        #[cfg_attr(docsrs, doc(cfg(feature = "v1_56")))]
43        #[doc(alias = "PANGO_FONT_MASK_FEATURES")]
44        const FEATURES = ffi::PANGO_FONT_MASK_FEATURES as _;
45    }
46}
47
48#[doc(hidden)]
49impl IntoGlib for FontMask {
50    type GlibType = ffi::PangoFontMask;
51
52    #[inline]
53    fn into_glib(self) -> ffi::PangoFontMask {
54        self.bits()
55    }
56}
57
58#[doc(hidden)]
59impl FromGlib<ffi::PangoFontMask> for FontMask {
60    #[inline]
61    unsafe fn from_glib(value: ffi::PangoFontMask) -> Self {
62        Self::from_bits_truncate(value)
63    }
64}
65
66impl StaticType for FontMask {
67    #[inline]
68    #[doc(alias = "pango_font_mask_get_type")]
69    fn static_type() -> glib::Type {
70        unsafe { from_glib(ffi::pango_font_mask_get_type()) }
71    }
72}
73
74impl glib::HasParamSpec for FontMask {
75    type ParamSpec = glib::ParamSpecFlags;
76    type SetValue = Self;
77    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
78
79    fn param_spec_builder() -> Self::BuilderFn {
80        Self::ParamSpec::builder
81    }
82}
83
84impl glib::value::ValueType for FontMask {
85    type Type = Self;
86}
87
88unsafe impl<'a> glib::value::FromValue<'a> for FontMask {
89    type Checker = glib::value::GenericValueTypeChecker<Self>;
90
91    #[inline]
92    unsafe fn from_value(value: &'a glib::Value) -> Self {
93        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
94    }
95}
96
97impl ToValue for FontMask {
98    #[inline]
99    fn to_value(&self) -> glib::Value {
100        let mut value = glib::Value::for_value_type::<Self>();
101        unsafe {
102            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
103        }
104        value
105    }
106
107    #[inline]
108    fn value_type(&self) -> glib::Type {
109        Self::static_type()
110    }
111}
112
113impl From<FontMask> for glib::Value {
114    #[inline]
115    fn from(v: FontMask) -> Self {
116        ToValue::to_value(&v)
117    }
118}
119
120#[cfg(feature = "v1_50")]
121bitflags! {
122    /// Flags that influence the behavior of `Pango::Layout::deserialize()`.
123    ///
124    /// New members may be added to this enumeration over time.
125    #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
126    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
127    #[doc(alias = "PangoLayoutDeserializeFlags")]
128    pub struct LayoutDeserializeFlags: u32 {
129        /// Default behavior
130        #[doc(alias = "PANGO_LAYOUT_DESERIALIZE_DEFAULT")]
131        const DEFAULT = ffi::PANGO_LAYOUT_DESERIALIZE_DEFAULT as _;
132        /// Apply context information
133        ///   from the serialization to the [`Context`][crate::Context]
134        #[doc(alias = "PANGO_LAYOUT_DESERIALIZE_CONTEXT")]
135        const CONTEXT = ffi::PANGO_LAYOUT_DESERIALIZE_CONTEXT as _;
136    }
137}
138
139#[cfg(feature = "v1_50")]
140#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
141#[doc(hidden)]
142impl IntoGlib for LayoutDeserializeFlags {
143    type GlibType = ffi::PangoLayoutDeserializeFlags;
144
145    #[inline]
146    fn into_glib(self) -> ffi::PangoLayoutDeserializeFlags {
147        self.bits()
148    }
149}
150
151#[cfg(feature = "v1_50")]
152#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
153#[doc(hidden)]
154impl FromGlib<ffi::PangoLayoutDeserializeFlags> for LayoutDeserializeFlags {
155    #[inline]
156    unsafe fn from_glib(value: ffi::PangoLayoutDeserializeFlags) -> Self {
157        Self::from_bits_truncate(value)
158    }
159}
160
161#[cfg(feature = "v1_50")]
162#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
163impl StaticType for LayoutDeserializeFlags {
164    #[inline]
165    #[doc(alias = "pango_layout_deserialize_flags_get_type")]
166    fn static_type() -> glib::Type {
167        unsafe { from_glib(ffi::pango_layout_deserialize_flags_get_type()) }
168    }
169}
170
171#[cfg(feature = "v1_50")]
172#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
173impl glib::HasParamSpec for LayoutDeserializeFlags {
174    type ParamSpec = glib::ParamSpecFlags;
175    type SetValue = Self;
176    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
177
178    fn param_spec_builder() -> Self::BuilderFn {
179        Self::ParamSpec::builder
180    }
181}
182
183#[cfg(feature = "v1_50")]
184#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
185impl glib::value::ValueType for LayoutDeserializeFlags {
186    type Type = Self;
187}
188
189#[cfg(feature = "v1_50")]
190#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
191unsafe impl<'a> glib::value::FromValue<'a> for LayoutDeserializeFlags {
192    type Checker = glib::value::GenericValueTypeChecker<Self>;
193
194    #[inline]
195    unsafe fn from_value(value: &'a glib::Value) -> Self {
196        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
197    }
198}
199
200#[cfg(feature = "v1_50")]
201#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
202impl ToValue for LayoutDeserializeFlags {
203    #[inline]
204    fn to_value(&self) -> glib::Value {
205        let mut value = glib::Value::for_value_type::<Self>();
206        unsafe {
207            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
208        }
209        value
210    }
211
212    #[inline]
213    fn value_type(&self) -> glib::Type {
214        Self::static_type()
215    }
216}
217
218#[cfg(feature = "v1_50")]
219#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
220impl From<LayoutDeserializeFlags> for glib::Value {
221    #[inline]
222    fn from(v: LayoutDeserializeFlags) -> Self {
223        ToValue::to_value(&v)
224    }
225}
226
227#[cfg(feature = "v1_50")]
228bitflags! {
229    /// Flags that influence the behavior of [`Layout::serialize()`][crate::Layout::serialize()].
230    ///
231    /// New members may be added to this enumeration over time.
232    #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
233    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
234    #[doc(alias = "PangoLayoutSerializeFlags")]
235    pub struct LayoutSerializeFlags: u32 {
236        /// Default behavior
237        #[doc(alias = "PANGO_LAYOUT_SERIALIZE_DEFAULT")]
238        const DEFAULT = ffi::PANGO_LAYOUT_SERIALIZE_DEFAULT as _;
239        /// Include context information
240        #[doc(alias = "PANGO_LAYOUT_SERIALIZE_CONTEXT")]
241        const CONTEXT = ffi::PANGO_LAYOUT_SERIALIZE_CONTEXT as _;
242        /// Include information about the formatted output
243        #[doc(alias = "PANGO_LAYOUT_SERIALIZE_OUTPUT")]
244        const OUTPUT = ffi::PANGO_LAYOUT_SERIALIZE_OUTPUT as _;
245    }
246}
247
248#[cfg(feature = "v1_50")]
249#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
250#[doc(hidden)]
251impl IntoGlib for LayoutSerializeFlags {
252    type GlibType = ffi::PangoLayoutSerializeFlags;
253
254    #[inline]
255    fn into_glib(self) -> ffi::PangoLayoutSerializeFlags {
256        self.bits()
257    }
258}
259
260#[cfg(feature = "v1_50")]
261#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
262#[doc(hidden)]
263impl FromGlib<ffi::PangoLayoutSerializeFlags> for LayoutSerializeFlags {
264    #[inline]
265    unsafe fn from_glib(value: ffi::PangoLayoutSerializeFlags) -> Self {
266        Self::from_bits_truncate(value)
267    }
268}
269
270#[cfg(feature = "v1_50")]
271#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
272impl StaticType for LayoutSerializeFlags {
273    #[inline]
274    #[doc(alias = "pango_layout_serialize_flags_get_type")]
275    fn static_type() -> glib::Type {
276        unsafe { from_glib(ffi::pango_layout_serialize_flags_get_type()) }
277    }
278}
279
280#[cfg(feature = "v1_50")]
281#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
282impl glib::HasParamSpec for LayoutSerializeFlags {
283    type ParamSpec = glib::ParamSpecFlags;
284    type SetValue = Self;
285    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
286
287    fn param_spec_builder() -> Self::BuilderFn {
288        Self::ParamSpec::builder
289    }
290}
291
292#[cfg(feature = "v1_50")]
293#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
294impl glib::value::ValueType for LayoutSerializeFlags {
295    type Type = Self;
296}
297
298#[cfg(feature = "v1_50")]
299#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
300unsafe impl<'a> glib::value::FromValue<'a> for LayoutSerializeFlags {
301    type Checker = glib::value::GenericValueTypeChecker<Self>;
302
303    #[inline]
304    unsafe fn from_value(value: &'a glib::Value) -> Self {
305        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
306    }
307}
308
309#[cfg(feature = "v1_50")]
310#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
311impl ToValue for LayoutSerializeFlags {
312    #[inline]
313    fn to_value(&self) -> glib::Value {
314        let mut value = glib::Value::for_value_type::<Self>();
315        unsafe {
316            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
317        }
318        value
319    }
320
321    #[inline]
322    fn value_type(&self) -> glib::Type {
323        Self::static_type()
324    }
325}
326
327#[cfg(feature = "v1_50")]
328#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
329impl From<LayoutSerializeFlags> for glib::Value {
330    #[inline]
331    fn from(v: LayoutSerializeFlags) -> Self {
332        ToValue::to_value(&v)
333    }
334}
335
336#[cfg(feature = "v1_44")]
337bitflags! {
338    /// Flags influencing the shaping process.
339    ///
340    /// [`ShapeFlags`][crate::ShapeFlags] can be passed to [`shape_with_flags()`][crate::shape_with_flags()].
341    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
342    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
343    #[doc(alias = "PangoShapeFlags")]
344    pub struct ShapeFlags: u32 {
345        /// Default value
346        #[doc(alias = "PANGO_SHAPE_NONE")]
347        const NONE = ffi::PANGO_SHAPE_NONE as _;
348        /// Round glyph positions and widths to whole device units
349        ///   This option should be set if the target renderer can't do subpixel positioning of glyphs
350        #[doc(alias = "PANGO_SHAPE_ROUND_POSITIONS")]
351        const ROUND_POSITIONS = ffi::PANGO_SHAPE_ROUND_POSITIONS as _;
352    }
353}
354
355#[cfg(feature = "v1_44")]
356#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
357#[doc(hidden)]
358impl IntoGlib for ShapeFlags {
359    type GlibType = ffi::PangoShapeFlags;
360
361    #[inline]
362    fn into_glib(self) -> ffi::PangoShapeFlags {
363        self.bits()
364    }
365}
366
367#[cfg(feature = "v1_44")]
368#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
369#[doc(hidden)]
370impl FromGlib<ffi::PangoShapeFlags> for ShapeFlags {
371    #[inline]
372    unsafe fn from_glib(value: ffi::PangoShapeFlags) -> Self {
373        Self::from_bits_truncate(value)
374    }
375}
376
377#[cfg(feature = "v1_44")]
378#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
379impl StaticType for ShapeFlags {
380    #[inline]
381    #[doc(alias = "pango_shape_flags_get_type")]
382    fn static_type() -> glib::Type {
383        unsafe { from_glib(ffi::pango_shape_flags_get_type()) }
384    }
385}
386
387#[cfg(feature = "v1_44")]
388#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
389impl glib::HasParamSpec for ShapeFlags {
390    type ParamSpec = glib::ParamSpecFlags;
391    type SetValue = Self;
392    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
393
394    fn param_spec_builder() -> Self::BuilderFn {
395        Self::ParamSpec::builder
396    }
397}
398
399#[cfg(feature = "v1_44")]
400#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
401impl glib::value::ValueType for ShapeFlags {
402    type Type = Self;
403}
404
405#[cfg(feature = "v1_44")]
406#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
407unsafe impl<'a> glib::value::FromValue<'a> for ShapeFlags {
408    type Checker = glib::value::GenericValueTypeChecker<Self>;
409
410    #[inline]
411    unsafe fn from_value(value: &'a glib::Value) -> Self {
412        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
413    }
414}
415
416#[cfg(feature = "v1_44")]
417#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
418impl ToValue for ShapeFlags {
419    #[inline]
420    fn to_value(&self) -> glib::Value {
421        let mut value = glib::Value::for_value_type::<Self>();
422        unsafe {
423            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
424        }
425        value
426    }
427
428    #[inline]
429    fn value_type(&self) -> glib::Type {
430        Self::static_type()
431    }
432}
433
434#[cfg(feature = "v1_44")]
435#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
436impl From<ShapeFlags> for glib::Value {
437    #[inline]
438    fn from(v: ShapeFlags) -> Self {
439        ToValue::to_value(&v)
440    }
441}
442
443#[cfg(feature = "v1_44")]
444bitflags! {
445    /// These flags affect how Pango treats characters that are normally
446    /// not visible in the output.
447    #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
448    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
449    #[doc(alias = "PangoShowFlags")]
450    pub struct ShowFlags: u32 {
451        /// No special treatment for invisible characters
452        #[doc(alias = "PANGO_SHOW_NONE")]
453        const NONE = ffi::PANGO_SHOW_NONE as _;
454        /// Render spaces, tabs and newlines visibly
455        #[doc(alias = "PANGO_SHOW_SPACES")]
456        const SPACES = ffi::PANGO_SHOW_SPACES as _;
457        /// Render line breaks visibly
458        #[doc(alias = "PANGO_SHOW_LINE_BREAKS")]
459        const LINE_BREAKS = ffi::PANGO_SHOW_LINE_BREAKS as _;
460        /// Render default-ignorable Unicode
461        ///   characters visibly
462        #[doc(alias = "PANGO_SHOW_IGNORABLES")]
463        const IGNORABLES = ffi::PANGO_SHOW_IGNORABLES as _;
464    }
465}
466
467#[cfg(feature = "v1_44")]
468#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
469#[doc(hidden)]
470impl IntoGlib for ShowFlags {
471    type GlibType = ffi::PangoShowFlags;
472
473    #[inline]
474    fn into_glib(self) -> ffi::PangoShowFlags {
475        self.bits()
476    }
477}
478
479#[cfg(feature = "v1_44")]
480#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
481#[doc(hidden)]
482impl FromGlib<ffi::PangoShowFlags> for ShowFlags {
483    #[inline]
484    unsafe fn from_glib(value: ffi::PangoShowFlags) -> Self {
485        Self::from_bits_truncate(value)
486    }
487}
488
489#[cfg(feature = "v1_44")]
490#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
491impl StaticType for ShowFlags {
492    #[inline]
493    #[doc(alias = "pango_show_flags_get_type")]
494    fn static_type() -> glib::Type {
495        unsafe { from_glib(ffi::pango_show_flags_get_type()) }
496    }
497}
498
499#[cfg(feature = "v1_44")]
500#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
501impl glib::HasParamSpec for ShowFlags {
502    type ParamSpec = glib::ParamSpecFlags;
503    type SetValue = Self;
504    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
505
506    fn param_spec_builder() -> Self::BuilderFn {
507        Self::ParamSpec::builder
508    }
509}
510
511#[cfg(feature = "v1_44")]
512#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
513impl glib::value::ValueType for ShowFlags {
514    type Type = Self;
515}
516
517#[cfg(feature = "v1_44")]
518#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
519unsafe impl<'a> glib::value::FromValue<'a> for ShowFlags {
520    type Checker = glib::value::GenericValueTypeChecker<Self>;
521
522    #[inline]
523    unsafe fn from_value(value: &'a glib::Value) -> Self {
524        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
525    }
526}
527
528#[cfg(feature = "v1_44")]
529#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
530impl ToValue for ShowFlags {
531    #[inline]
532    fn to_value(&self) -> glib::Value {
533        let mut value = glib::Value::for_value_type::<Self>();
534        unsafe {
535            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
536        }
537        value
538    }
539
540    #[inline]
541    fn value_type(&self) -> glib::Type {
542        Self::static_type()
543    }
544}
545
546#[cfg(feature = "v1_44")]
547#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
548impl From<ShowFlags> for glib::Value {
549    #[inline]
550    fn from(v: ShowFlags) -> Self {
551        ToValue::to_value(&v)
552    }
553}