gi-repository 0.1.0

High level bindings of libgirepository
Documentation
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT

use bitflags::bitflags;
use glib::translate::*;
use std::fmt;

bitflags! {
    /// Flags for a `GIFieldInfo`.
    #[doc(alias = "GIFieldInfoFlags")]
    pub struct FieldInfoFlags: u32 {
        /// field is readable.
        #[doc(alias = "GI_FIELD_IS_READABLE")]
        const READABLE = ffi::GI_FIELD_IS_READABLE as _;
        /// field is writable.
        #[doc(alias = "GI_FIELD_IS_WRITABLE")]
        const WRITABLE = ffi::GI_FIELD_IS_WRITABLE as _;
    }
}

impl fmt::Display for FieldInfoFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for FieldInfoFlags {
    type GlibType = ffi::GIFieldInfoFlags;

    fn into_glib(self) -> ffi::GIFieldInfoFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GIFieldInfoFlags> for FieldInfoFlags {
    unsafe fn from_glib(value: ffi::GIFieldInfoFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

bitflags! {
    /// Flags for a `GIFunctionInfo` struct.
    #[doc(alias = "GIFunctionInfoFlags")]
    pub struct FunctionInfoFlags: u32 {
        /// is a method.
        #[doc(alias = "GI_FUNCTION_IS_METHOD")]
        const IS_METHOD = ffi::GI_FUNCTION_IS_METHOD as _;
        /// is a constructor.
        #[doc(alias = "GI_FUNCTION_IS_CONSTRUCTOR")]
        const IS_CONSTRUCTOR = ffi::GI_FUNCTION_IS_CONSTRUCTOR as _;
        /// is a getter of a `GIPropertyInfo`.
        #[doc(alias = "GI_FUNCTION_IS_GETTER")]
        const IS_GETTER = ffi::GI_FUNCTION_IS_GETTER as _;
        /// is a setter of a `GIPropertyInfo`.
        #[doc(alias = "GI_FUNCTION_IS_SETTER")]
        const IS_SETTER = ffi::GI_FUNCTION_IS_SETTER as _;
        /// represents a virtual function.
        #[doc(alias = "GI_FUNCTION_WRAPS_VFUNC")]
        const WRAPS_VFUNC = ffi::GI_FUNCTION_WRAPS_VFUNC as _;
        /// the function may throw an error.
        #[doc(alias = "GI_FUNCTION_THROWS")]
        const THROWS = ffi::GI_FUNCTION_THROWS as _;
    }
}

impl fmt::Display for FunctionInfoFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for FunctionInfoFlags {
    type GlibType = ffi::GIFunctionInfoFlags;

    fn into_glib(self) -> ffi::GIFunctionInfoFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GIFunctionInfoFlags> for FunctionInfoFlags {
    unsafe fn from_glib(value: ffi::GIFunctionInfoFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

bitflags! {
    /// Flags that control how a typelib is loaded.
    #[doc(alias = "GIRepositoryLoadFlags")]
    pub struct RepositoryLoadFlags: u32 {
        /// Lazily load the typelib.
        #[doc(alias = "G_IREPOSITORY_LOAD_FLAG_LAZY")]
        const IREPOSITORY_LOAD_FLAG_LAZY = ffi::G_IREPOSITORY_LOAD_FLAG_LAZY as _;
    }
}

impl fmt::Display for RepositoryLoadFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for RepositoryLoadFlags {
    type GlibType = ffi::GIRepositoryLoadFlags;

    fn into_glib(self) -> ffi::GIRepositoryLoadFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GIRepositoryLoadFlags> for RepositoryLoadFlags {
    unsafe fn from_glib(value: ffi::GIRepositoryLoadFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

bitflags! {
    /// Flags of a `GIVFuncInfo` struct.
    #[doc(alias = "GIVFuncInfoFlags")]
    pub struct VFuncInfoFlags: u32 {
        /// chains up to the parent type
        #[doc(alias = "GI_VFUNC_MUST_CHAIN_UP")]
        const MUST_CHAIN_UP = ffi::GI_VFUNC_MUST_CHAIN_UP as _;
        /// overrides
        #[doc(alias = "GI_VFUNC_MUST_OVERRIDE")]
        const MUST_OVERRIDE = ffi::GI_VFUNC_MUST_OVERRIDE as _;
        /// does not override
        #[doc(alias = "GI_VFUNC_MUST_NOT_OVERRIDE")]
        const MUST_NOT_OVERRIDE = ffi::GI_VFUNC_MUST_NOT_OVERRIDE as _;
        /// Includes a [`glib::Error`][crate::glib::Error]
        #[doc(alias = "GI_VFUNC_THROWS")]
        const THROWS = ffi::GI_VFUNC_THROWS as _;
    }
}

impl fmt::Display for VFuncInfoFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <Self as fmt::Debug>::fmt(self, f)
    }
}

#[doc(hidden)]
impl IntoGlib for VFuncInfoFlags {
    type GlibType = ffi::GIVFuncInfoFlags;

    fn into_glib(self) -> ffi::GIVFuncInfoFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GIVFuncInfoFlags> for VFuncInfoFlags {
    unsafe fn from_glib(value: ffi::GIVFuncInfoFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}