use bitflags::bitflags;
use glib::translate::*;
use std::fmt;
bitflags! {
#[doc(alias = "GIFieldInfoFlags")]
pub struct FieldInfoFlags: u32 {
#[doc(alias = "GI_FIELD_IS_READABLE")]
const READABLE = ffi::GI_FIELD_IS_READABLE as _;
#[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! {
#[doc(alias = "GIFunctionInfoFlags")]
pub struct FunctionInfoFlags: u32 {
#[doc(alias = "GI_FUNCTION_IS_METHOD")]
const IS_METHOD = ffi::GI_FUNCTION_IS_METHOD as _;
#[doc(alias = "GI_FUNCTION_IS_CONSTRUCTOR")]
const IS_CONSTRUCTOR = ffi::GI_FUNCTION_IS_CONSTRUCTOR as _;
#[doc(alias = "GI_FUNCTION_IS_GETTER")]
const IS_GETTER = ffi::GI_FUNCTION_IS_GETTER as _;
#[doc(alias = "GI_FUNCTION_IS_SETTER")]
const IS_SETTER = ffi::GI_FUNCTION_IS_SETTER as _;
#[doc(alias = "GI_FUNCTION_WRAPS_VFUNC")]
const WRAPS_VFUNC = ffi::GI_FUNCTION_WRAPS_VFUNC as _;
#[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! {
#[doc(alias = "GIRepositoryLoadFlags")]
pub struct RepositoryLoadFlags: u32 {
#[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! {
#[doc(alias = "GIVFuncInfoFlags")]
pub struct VFuncInfoFlags: u32 {
#[doc(alias = "GI_VFUNC_MUST_CHAIN_UP")]
const MUST_CHAIN_UP = ffi::GI_VFUNC_MUST_CHAIN_UP as _;
#[doc(alias = "GI_VFUNC_MUST_OVERRIDE")]
const MUST_OVERRIDE = ffi::GI_VFUNC_MUST_OVERRIDE as _;
#[doc(alias = "GI_VFUNC_MUST_NOT_OVERRIDE")]
const MUST_NOT_OVERRIDE = ffi::GI_VFUNC_MUST_NOT_OVERRIDE as _;
#[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)
}
}