gdk_pixbuf/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, translate::*};
7
8bitflags! {
9    /// Flags which allow a module to specify further details about the supported
10    /// operations.
11    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12    #[doc(alias = "GdkPixbufFormatFlags")]
13    pub struct PixbufFormatFlags: u32 {
14        /// the module can write out images in the format.
15        #[doc(alias = "GDK_PIXBUF_FORMAT_WRITABLE")]
16        const WRITABLE = ffi::GDK_PIXBUF_FORMAT_WRITABLE as _;
17        /// the image format is scalable
18        #[doc(alias = "GDK_PIXBUF_FORMAT_SCALABLE")]
19        const SCALABLE = ffi::GDK_PIXBUF_FORMAT_SCALABLE as _;
20        /// the module is threadsafe. gdk-pixbuf
21        ///     ignores modules that are not marked as threadsafe. (Since 2.28).
22        #[doc(alias = "GDK_PIXBUF_FORMAT_THREADSAFE")]
23        const THREADSAFE = ffi::GDK_PIXBUF_FORMAT_THREADSAFE as _;
24    }
25}
26
27#[doc(hidden)]
28impl IntoGlib for PixbufFormatFlags {
29    type GlibType = ffi::GdkPixbufFormatFlags;
30
31    #[inline]
32    fn into_glib(self) -> ffi::GdkPixbufFormatFlags {
33        self.bits()
34    }
35}
36
37#[doc(hidden)]
38impl FromGlib<ffi::GdkPixbufFormatFlags> for PixbufFormatFlags {
39    #[inline]
40    unsafe fn from_glib(value: ffi::GdkPixbufFormatFlags) -> Self {
41        Self::from_bits_truncate(value)
42    }
43}