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
45use crate::ffi;
6use glib::translate::*;
78#[cfg(feature = "v1_44")]
9#[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))]
10glib::wrapper! {
11/// The [`Attribute`][crate::Attribute] structure represents the common portions of all
12 /// attributes.
13 ///
14 /// Particular types of attributes include this structure as their initial
15 /// portion. The common portion of the attribute holds the range to which
16 /// the value in the type-specific part of the attribute applies and should
17 /// be initialized using `Pango::Attribute::init()`. By default, an attribute
18 /// will have an all-inclusive range of [0,`G_MAXUINT`].
19#[derive(Debug, PartialOrd, Ord, Hash)]
20pub struct Attribute(Boxed<ffi::PangoAttribute>);
2122match fn {
23 copy => |ptr| ffi::pango_attribute_copy(ptr),
24 free => |ptr| ffi::pango_attribute_destroy(ptr),
25 type_ => || ffi::pango_attribute_get_type(),
26 }
27}
2829#[cfg(not(any(feature = "v1_44")))]
30glib::wrapper! {
31#[derive(Debug, PartialOrd, Ord, Hash)]
32pub struct Attribute(Boxed<ffi::PangoAttribute>);
3334match fn {
35 copy => |ptr| ffi::pango_attribute_copy(ptr),
36 free => |ptr| ffi::pango_attribute_destroy(ptr),
37 }
38}
3940impl Attribute {
41#[doc(alias = "pango_attribute_equal")]
42fn equal(&self, attr2: &Attribute) -> bool {
43unsafe {
44from_glib(ffi::pango_attribute_equal(
45self.to_glib_none().0,
46attr2.to_glib_none().0,
47 ))
48 }
49 }
50}
5152impl PartialEqfor Attribute {
53#[inline]
54fn eq(&self, other: &Self) -> bool {
55self.equal(other)
56 }
57}
5859impl Eqfor Attribute {}
6061unsafe impl Sendfor Attribute {}
62unsafe impl Syncfor Attribute {}