use glib::{
error::ErrorDomain, translate::*, value::FromValue, value::ToValue, Quark, StaticType, Type,
};
use std::fmt;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleAutocomplete")]
pub enum AccessibleAutocomplete {
#[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_NONE")]
None,
#[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE")]
Inline,
#[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_LIST")]
List,
#[doc(alias = "GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH")]
Both,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for AccessibleAutocomplete {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleAutocomplete::{}",
match *self {
Self::None => "None",
Self::Inline => "Inline",
Self::List => "List",
Self::Both => "Both",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleAutocomplete {
type GlibType = ffi::GtkAccessibleAutocomplete;
#[inline]
fn into_glib(self) -> ffi::GtkAccessibleAutocomplete {
match self {
Self::None => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_NONE,
Self::Inline => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE,
Self::List => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_LIST,
Self::Both => ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleAutocomplete> for AccessibleAutocomplete {
#[inline]
unsafe fn from_glib(value: ffi::GtkAccessibleAutocomplete) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_NONE => Self::None,
ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_INLINE => Self::Inline,
ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_LIST => Self::List,
ffi::GTK_ACCESSIBLE_AUTOCOMPLETE_BOTH => Self::Both,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleAutocomplete {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_autocomplete_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleAutocomplete {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleAutocomplete {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleAutocomplete {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleAutocomplete {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleAutocomplete> for glib::Value {
#[inline]
fn from(v: AccessibleAutocomplete) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleInvalidState")]
pub enum AccessibleInvalidState {
#[doc(alias = "GTK_ACCESSIBLE_INVALID_FALSE")]
False,
#[doc(alias = "GTK_ACCESSIBLE_INVALID_TRUE")]
True,
#[doc(alias = "GTK_ACCESSIBLE_INVALID_GRAMMAR")]
Grammar,
#[doc(alias = "GTK_ACCESSIBLE_INVALID_SPELLING")]
Spelling,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for AccessibleInvalidState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleInvalidState::{}",
match *self {
Self::False => "False",
Self::True => "True",
Self::Grammar => "Grammar",
Self::Spelling => "Spelling",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleInvalidState {
type GlibType = ffi::GtkAccessibleInvalidState;
#[inline]
fn into_glib(self) -> ffi::GtkAccessibleInvalidState {
match self {
Self::False => ffi::GTK_ACCESSIBLE_INVALID_FALSE,
Self::True => ffi::GTK_ACCESSIBLE_INVALID_TRUE,
Self::Grammar => ffi::GTK_ACCESSIBLE_INVALID_GRAMMAR,
Self::Spelling => ffi::GTK_ACCESSIBLE_INVALID_SPELLING,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleInvalidState> for AccessibleInvalidState {
#[inline]
unsafe fn from_glib(value: ffi::GtkAccessibleInvalidState) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_INVALID_FALSE => Self::False,
ffi::GTK_ACCESSIBLE_INVALID_TRUE => Self::True,
ffi::GTK_ACCESSIBLE_INVALID_GRAMMAR => Self::Grammar,
ffi::GTK_ACCESSIBLE_INVALID_SPELLING => Self::Spelling,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleInvalidState {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_invalid_state_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleInvalidState {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleInvalidState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleInvalidState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleInvalidState {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleInvalidState> for glib::Value {
#[inline]
fn from(v: AccessibleInvalidState) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessiblePlatformState")]
pub enum AccessiblePlatformState {
#[doc(alias = "GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE")]
Focusable,
#[doc(alias = "GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED")]
Focused,
#[doc(alias = "GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE")]
Active,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl fmt::Display for AccessiblePlatformState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessiblePlatformState::{}",
match *self {
Self::Focusable => "Focusable",
Self::Focused => "Focused",
Self::Active => "Active",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl IntoGlib for AccessiblePlatformState {
type GlibType = ffi::GtkAccessiblePlatformState;
#[inline]
fn into_glib(self) -> ffi::GtkAccessiblePlatformState {
match self {
Self::Focusable => ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE,
Self::Focused => ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED,
Self::Active => ffi::GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessiblePlatformState> for AccessiblePlatformState {
#[inline]
unsafe fn from_glib(value: ffi::GtkAccessiblePlatformState) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE => Self::Focusable,
ffi::GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED => Self::Focused,
ffi::GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE => Self::Active,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl StaticType for AccessiblePlatformState {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_platform_state_get_type()) }
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::HasParamSpec for AccessiblePlatformState {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::value::ValueType for AccessiblePlatformState {
type Type = Self;
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
unsafe impl<'a> FromValue<'a> for AccessiblePlatformState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl ToValue for AccessiblePlatformState {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl From<AccessiblePlatformState> for glib::Value {
#[inline]
fn from(v: AccessiblePlatformState) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleProperty")]
pub enum AccessibleProperty {
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE")]
Autocomplete,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_DESCRIPTION")]
Description,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_HAS_POPUP")]
HasPopup,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS")]
KeyShortcuts,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_LABEL")]
Label,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_LEVEL")]
Level,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_MODAL")]
Modal,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_MULTI_LINE")]
MultiLine,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE")]
MultiSelectable,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_ORIENTATION")]
Orientation,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER")]
Placeholder,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_READ_ONLY")]
ReadOnly,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_REQUIRED")]
Required,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION")]
RoleDescription,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_SORT")]
Sort,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_MAX")]
ValueMax,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_MIN")]
ValueMin,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_NOW")]
ValueNow,
#[doc(alias = "GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT")]
ValueText,
#[doc(hidden)]
__Unknown(i32),
}
impl AccessibleProperty {
#[doc(alias = "gtk_accessible_property_init_value")]
pub fn init_value(self, value: &mut glib::Value) {
assert_initialized_main_thread!();
unsafe {
ffi::gtk_accessible_property_init_value(self.into_glib(), value.to_glib_none_mut().0);
}
}
}
impl fmt::Display for AccessibleProperty {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleProperty::{}",
match *self {
Self::Autocomplete => "Autocomplete",
Self::Description => "Description",
Self::HasPopup => "HasPopup",
Self::KeyShortcuts => "KeyShortcuts",
Self::Label => "Label",
Self::Level => "Level",
Self::Modal => "Modal",
Self::MultiLine => "MultiLine",
Self::MultiSelectable => "MultiSelectable",
Self::Orientation => "Orientation",
Self::Placeholder => "Placeholder",
Self::ReadOnly => "ReadOnly",
Self::Required => "Required",
Self::RoleDescription => "RoleDescription",
Self::Sort => "Sort",
Self::ValueMax => "ValueMax",
Self::ValueMin => "ValueMin",
Self::ValueNow => "ValueNow",
Self::ValueText => "ValueText",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleProperty {
type GlibType = ffi::GtkAccessibleProperty;
fn into_glib(self) -> ffi::GtkAccessibleProperty {
match self {
Self::Autocomplete => ffi::GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE,
Self::Description => ffi::GTK_ACCESSIBLE_PROPERTY_DESCRIPTION,
Self::HasPopup => ffi::GTK_ACCESSIBLE_PROPERTY_HAS_POPUP,
Self::KeyShortcuts => ffi::GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS,
Self::Label => ffi::GTK_ACCESSIBLE_PROPERTY_LABEL,
Self::Level => ffi::GTK_ACCESSIBLE_PROPERTY_LEVEL,
Self::Modal => ffi::GTK_ACCESSIBLE_PROPERTY_MODAL,
Self::MultiLine => ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_LINE,
Self::MultiSelectable => ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE,
Self::Orientation => ffi::GTK_ACCESSIBLE_PROPERTY_ORIENTATION,
Self::Placeholder => ffi::GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER,
Self::ReadOnly => ffi::GTK_ACCESSIBLE_PROPERTY_READ_ONLY,
Self::Required => ffi::GTK_ACCESSIBLE_PROPERTY_REQUIRED,
Self::RoleDescription => ffi::GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION,
Self::Sort => ffi::GTK_ACCESSIBLE_PROPERTY_SORT,
Self::ValueMax => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MAX,
Self::ValueMin => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MIN,
Self::ValueNow => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_NOW,
Self::ValueText => ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleProperty> for AccessibleProperty {
unsafe fn from_glib(value: ffi::GtkAccessibleProperty) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE => Self::Autocomplete,
ffi::GTK_ACCESSIBLE_PROPERTY_DESCRIPTION => Self::Description,
ffi::GTK_ACCESSIBLE_PROPERTY_HAS_POPUP => Self::HasPopup,
ffi::GTK_ACCESSIBLE_PROPERTY_KEY_SHORTCUTS => Self::KeyShortcuts,
ffi::GTK_ACCESSIBLE_PROPERTY_LABEL => Self::Label,
ffi::GTK_ACCESSIBLE_PROPERTY_LEVEL => Self::Level,
ffi::GTK_ACCESSIBLE_PROPERTY_MODAL => Self::Modal,
ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_LINE => Self::MultiLine,
ffi::GTK_ACCESSIBLE_PROPERTY_MULTI_SELECTABLE => Self::MultiSelectable,
ffi::GTK_ACCESSIBLE_PROPERTY_ORIENTATION => Self::Orientation,
ffi::GTK_ACCESSIBLE_PROPERTY_PLACEHOLDER => Self::Placeholder,
ffi::GTK_ACCESSIBLE_PROPERTY_READ_ONLY => Self::ReadOnly,
ffi::GTK_ACCESSIBLE_PROPERTY_REQUIRED => Self::Required,
ffi::GTK_ACCESSIBLE_PROPERTY_ROLE_DESCRIPTION => Self::RoleDescription,
ffi::GTK_ACCESSIBLE_PROPERTY_SORT => Self::Sort,
ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MAX => Self::ValueMax,
ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_MIN => Self::ValueMin,
ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_NOW => Self::ValueNow,
ffi::GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT => Self::ValueText,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleProperty {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_property_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleProperty {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleProperty {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleProperty {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleProperty {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleProperty> for glib::Value {
#[inline]
fn from(v: AccessibleProperty) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleRelation")]
pub enum AccessibleRelation {
#[doc(alias = "GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT")]
ActiveDescendant,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_COUNT")]
ColCount,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_INDEX")]
ColIndex,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT")]
ColIndexText,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_COL_SPAN")]
ColSpan,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_CONTROLS")]
Controls,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_DESCRIBED_BY")]
DescribedBy,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_DETAILS")]
Details,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE")]
ErrorMessage,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_FLOW_TO")]
FlowTo,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_LABELLED_BY")]
LabelledBy,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_OWNS")]
Owns,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_POS_IN_SET")]
PosInSet,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_COUNT")]
RowCount,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_INDEX")]
RowIndex,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT")]
RowIndexText,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_ROW_SPAN")]
RowSpan,
#[doc(alias = "GTK_ACCESSIBLE_RELATION_SET_SIZE")]
SetSize,
#[doc(hidden)]
__Unknown(i32),
}
impl AccessibleRelation {
#[doc(alias = "gtk_accessible_relation_init_value")]
pub fn init_value(self, value: &mut glib::Value) {
assert_initialized_main_thread!();
unsafe {
ffi::gtk_accessible_relation_init_value(self.into_glib(), value.to_glib_none_mut().0);
}
}
}
impl fmt::Display for AccessibleRelation {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleRelation::{}",
match *self {
Self::ActiveDescendant => "ActiveDescendant",
Self::ColCount => "ColCount",
Self::ColIndex => "ColIndex",
Self::ColIndexText => "ColIndexText",
Self::ColSpan => "ColSpan",
Self::Controls => "Controls",
Self::DescribedBy => "DescribedBy",
Self::Details => "Details",
Self::ErrorMessage => "ErrorMessage",
Self::FlowTo => "FlowTo",
Self::LabelledBy => "LabelledBy",
Self::Owns => "Owns",
Self::PosInSet => "PosInSet",
Self::RowCount => "RowCount",
Self::RowIndex => "RowIndex",
Self::RowIndexText => "RowIndexText",
Self::RowSpan => "RowSpan",
Self::SetSize => "SetSize",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleRelation {
type GlibType = ffi::GtkAccessibleRelation;
fn into_glib(self) -> ffi::GtkAccessibleRelation {
match self {
Self::ActiveDescendant => ffi::GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT,
Self::ColCount => ffi::GTK_ACCESSIBLE_RELATION_COL_COUNT,
Self::ColIndex => ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX,
Self::ColIndexText => ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT,
Self::ColSpan => ffi::GTK_ACCESSIBLE_RELATION_COL_SPAN,
Self::Controls => ffi::GTK_ACCESSIBLE_RELATION_CONTROLS,
Self::DescribedBy => ffi::GTK_ACCESSIBLE_RELATION_DESCRIBED_BY,
Self::Details => ffi::GTK_ACCESSIBLE_RELATION_DETAILS,
Self::ErrorMessage => ffi::GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE,
Self::FlowTo => ffi::GTK_ACCESSIBLE_RELATION_FLOW_TO,
Self::LabelledBy => ffi::GTK_ACCESSIBLE_RELATION_LABELLED_BY,
Self::Owns => ffi::GTK_ACCESSIBLE_RELATION_OWNS,
Self::PosInSet => ffi::GTK_ACCESSIBLE_RELATION_POS_IN_SET,
Self::RowCount => ffi::GTK_ACCESSIBLE_RELATION_ROW_COUNT,
Self::RowIndex => ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX,
Self::RowIndexText => ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT,
Self::RowSpan => ffi::GTK_ACCESSIBLE_RELATION_ROW_SPAN,
Self::SetSize => ffi::GTK_ACCESSIBLE_RELATION_SET_SIZE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleRelation> for AccessibleRelation {
unsafe fn from_glib(value: ffi::GtkAccessibleRelation) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_RELATION_ACTIVE_DESCENDANT => Self::ActiveDescendant,
ffi::GTK_ACCESSIBLE_RELATION_COL_COUNT => Self::ColCount,
ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX => Self::ColIndex,
ffi::GTK_ACCESSIBLE_RELATION_COL_INDEX_TEXT => Self::ColIndexText,
ffi::GTK_ACCESSIBLE_RELATION_COL_SPAN => Self::ColSpan,
ffi::GTK_ACCESSIBLE_RELATION_CONTROLS => Self::Controls,
ffi::GTK_ACCESSIBLE_RELATION_DESCRIBED_BY => Self::DescribedBy,
ffi::GTK_ACCESSIBLE_RELATION_DETAILS => Self::Details,
ffi::GTK_ACCESSIBLE_RELATION_ERROR_MESSAGE => Self::ErrorMessage,
ffi::GTK_ACCESSIBLE_RELATION_FLOW_TO => Self::FlowTo,
ffi::GTK_ACCESSIBLE_RELATION_LABELLED_BY => Self::LabelledBy,
ffi::GTK_ACCESSIBLE_RELATION_OWNS => Self::Owns,
ffi::GTK_ACCESSIBLE_RELATION_POS_IN_SET => Self::PosInSet,
ffi::GTK_ACCESSIBLE_RELATION_ROW_COUNT => Self::RowCount,
ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX => Self::RowIndex,
ffi::GTK_ACCESSIBLE_RELATION_ROW_INDEX_TEXT => Self::RowIndexText,
ffi::GTK_ACCESSIBLE_RELATION_ROW_SPAN => Self::RowSpan,
ffi::GTK_ACCESSIBLE_RELATION_SET_SIZE => Self::SetSize,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleRelation {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_relation_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleRelation {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleRelation {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleRelation {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleRelation {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleRelation> for glib::Value {
#[inline]
fn from(v: AccessibleRelation) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleRole")]
pub enum AccessibleRole {
#[doc(alias = "GTK_ACCESSIBLE_ROLE_ALERT")]
Alert,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_ALERT_DIALOG")]
AlertDialog,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_BANNER")]
Banner,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_BUTTON")]
Button,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_CAPTION")]
Caption,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_CELL")]
Cell,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_CHECKBOX")]
Checkbox,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_COLUMN_HEADER")]
ColumnHeader,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_COMBO_BOX")]
ComboBox,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_COMMAND")]
Command,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_COMPOSITE")]
Composite,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_DIALOG")]
Dialog,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_DOCUMENT")]
Document,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_FEED")]
Feed,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_FORM")]
Form,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_GENERIC")]
Generic,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_GRID")]
Grid,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_GRID_CELL")]
GridCell,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_GROUP")]
Group,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_HEADING")]
Heading,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_IMG")]
Img,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_INPUT")]
Input,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LABEL")]
Label,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LANDMARK")]
Landmark,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LEGEND")]
Legend,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LINK")]
Link,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LIST")]
List,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LIST_BOX")]
ListBox,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LIST_ITEM")]
ListItem,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_LOG")]
Log,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MAIN")]
Main,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MARQUEE")]
Marquee,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MATH")]
Math,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_METER")]
Meter,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU")]
Menu,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_BAR")]
MenuBar,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_ITEM")]
MenuItem,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX")]
MenuItemCheckbox,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO")]
MenuItemRadio,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_NAVIGATION")]
Navigation,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_NONE")]
None,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_NOTE")]
Note,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_OPTION")]
Option,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_PRESENTATION")]
Presentation,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_PROGRESS_BAR")]
ProgressBar,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_RADIO")]
Radio,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_RADIO_GROUP")]
RadioGroup,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_RANGE")]
Range,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_REGION")]
Region,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_ROW")]
Row,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_ROW_GROUP")]
RowGroup,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_ROW_HEADER")]
RowHeader,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SCROLLBAR")]
Scrollbar,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SEARCH")]
Search,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SEARCH_BOX")]
SearchBox,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SECTION")]
Section,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SECTION_HEAD")]
SectionHead,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SELECT")]
Select,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SEPARATOR")]
Separator,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SLIDER")]
Slider,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SPIN_BUTTON")]
SpinButton,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_STATUS")]
Status,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_STRUCTURE")]
Structure,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_SWITCH")]
Switch,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TAB")]
Tab,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TABLE")]
Table,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TAB_LIST")]
TabList,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TAB_PANEL")]
TabPanel,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TEXT_BOX")]
TextBox,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TIME")]
Time,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TIMER")]
Timer,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TOOLBAR")]
Toolbar,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TOOLTIP")]
Tooltip,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TREE")]
Tree,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TREE_GRID")]
TreeGrid,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TREE_ITEM")]
TreeItem,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_WIDGET")]
Widget,
#[doc(alias = "GTK_ACCESSIBLE_ROLE_WINDOW")]
Window,
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(alias = "GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON")]
ToggleButton,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for AccessibleRole {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleRole::{}",
match *self {
Self::Alert => "Alert",
Self::AlertDialog => "AlertDialog",
Self::Banner => "Banner",
Self::Button => "Button",
Self::Caption => "Caption",
Self::Cell => "Cell",
Self::Checkbox => "Checkbox",
Self::ColumnHeader => "ColumnHeader",
Self::ComboBox => "ComboBox",
Self::Command => "Command",
Self::Composite => "Composite",
Self::Dialog => "Dialog",
Self::Document => "Document",
Self::Feed => "Feed",
Self::Form => "Form",
Self::Generic => "Generic",
Self::Grid => "Grid",
Self::GridCell => "GridCell",
Self::Group => "Group",
Self::Heading => "Heading",
Self::Img => "Img",
Self::Input => "Input",
Self::Label => "Label",
Self::Landmark => "Landmark",
Self::Legend => "Legend",
Self::Link => "Link",
Self::List => "List",
Self::ListBox => "ListBox",
Self::ListItem => "ListItem",
Self::Log => "Log",
Self::Main => "Main",
Self::Marquee => "Marquee",
Self::Math => "Math",
Self::Meter => "Meter",
Self::Menu => "Menu",
Self::MenuBar => "MenuBar",
Self::MenuItem => "MenuItem",
Self::MenuItemCheckbox => "MenuItemCheckbox",
Self::MenuItemRadio => "MenuItemRadio",
Self::Navigation => "Navigation",
Self::None => "None",
Self::Note => "Note",
Self::Option => "Option",
Self::Presentation => "Presentation",
Self::ProgressBar => "ProgressBar",
Self::Radio => "Radio",
Self::RadioGroup => "RadioGroup",
Self::Range => "Range",
Self::Region => "Region",
Self::Row => "Row",
Self::RowGroup => "RowGroup",
Self::RowHeader => "RowHeader",
Self::Scrollbar => "Scrollbar",
Self::Search => "Search",
Self::SearchBox => "SearchBox",
Self::Section => "Section",
Self::SectionHead => "SectionHead",
Self::Select => "Select",
Self::Separator => "Separator",
Self::Slider => "Slider",
Self::SpinButton => "SpinButton",
Self::Status => "Status",
Self::Structure => "Structure",
Self::Switch => "Switch",
Self::Tab => "Tab",
Self::Table => "Table",
Self::TabList => "TabList",
Self::TabPanel => "TabPanel",
Self::TextBox => "TextBox",
Self::Time => "Time",
Self::Timer => "Timer",
Self::Toolbar => "Toolbar",
Self::Tooltip => "Tooltip",
Self::Tree => "Tree",
Self::TreeGrid => "TreeGrid",
Self::TreeItem => "TreeItem",
Self::Widget => "Widget",
Self::Window => "Window",
#[cfg(any(feature = "v4_10", feature = "dox"))]
Self::ToggleButton => "ToggleButton",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleRole {
type GlibType = ffi::GtkAccessibleRole;
fn into_glib(self) -> ffi::GtkAccessibleRole {
match self {
Self::Alert => ffi::GTK_ACCESSIBLE_ROLE_ALERT,
Self::AlertDialog => ffi::GTK_ACCESSIBLE_ROLE_ALERT_DIALOG,
Self::Banner => ffi::GTK_ACCESSIBLE_ROLE_BANNER,
Self::Button => ffi::GTK_ACCESSIBLE_ROLE_BUTTON,
Self::Caption => ffi::GTK_ACCESSIBLE_ROLE_CAPTION,
Self::Cell => ffi::GTK_ACCESSIBLE_ROLE_CELL,
Self::Checkbox => ffi::GTK_ACCESSIBLE_ROLE_CHECKBOX,
Self::ColumnHeader => ffi::GTK_ACCESSIBLE_ROLE_COLUMN_HEADER,
Self::ComboBox => ffi::GTK_ACCESSIBLE_ROLE_COMBO_BOX,
Self::Command => ffi::GTK_ACCESSIBLE_ROLE_COMMAND,
Self::Composite => ffi::GTK_ACCESSIBLE_ROLE_COMPOSITE,
Self::Dialog => ffi::GTK_ACCESSIBLE_ROLE_DIALOG,
Self::Document => ffi::GTK_ACCESSIBLE_ROLE_DOCUMENT,
Self::Feed => ffi::GTK_ACCESSIBLE_ROLE_FEED,
Self::Form => ffi::GTK_ACCESSIBLE_ROLE_FORM,
Self::Generic => ffi::GTK_ACCESSIBLE_ROLE_GENERIC,
Self::Grid => ffi::GTK_ACCESSIBLE_ROLE_GRID,
Self::GridCell => ffi::GTK_ACCESSIBLE_ROLE_GRID_CELL,
Self::Group => ffi::GTK_ACCESSIBLE_ROLE_GROUP,
Self::Heading => ffi::GTK_ACCESSIBLE_ROLE_HEADING,
Self::Img => ffi::GTK_ACCESSIBLE_ROLE_IMG,
Self::Input => ffi::GTK_ACCESSIBLE_ROLE_INPUT,
Self::Label => ffi::GTK_ACCESSIBLE_ROLE_LABEL,
Self::Landmark => ffi::GTK_ACCESSIBLE_ROLE_LANDMARK,
Self::Legend => ffi::GTK_ACCESSIBLE_ROLE_LEGEND,
Self::Link => ffi::GTK_ACCESSIBLE_ROLE_LINK,
Self::List => ffi::GTK_ACCESSIBLE_ROLE_LIST,
Self::ListBox => ffi::GTK_ACCESSIBLE_ROLE_LIST_BOX,
Self::ListItem => ffi::GTK_ACCESSIBLE_ROLE_LIST_ITEM,
Self::Log => ffi::GTK_ACCESSIBLE_ROLE_LOG,
Self::Main => ffi::GTK_ACCESSIBLE_ROLE_MAIN,
Self::Marquee => ffi::GTK_ACCESSIBLE_ROLE_MARQUEE,
Self::Math => ffi::GTK_ACCESSIBLE_ROLE_MATH,
Self::Meter => ffi::GTK_ACCESSIBLE_ROLE_METER,
Self::Menu => ffi::GTK_ACCESSIBLE_ROLE_MENU,
Self::MenuBar => ffi::GTK_ACCESSIBLE_ROLE_MENU_BAR,
Self::MenuItem => ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM,
Self::MenuItemCheckbox => ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX,
Self::MenuItemRadio => ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO,
Self::Navigation => ffi::GTK_ACCESSIBLE_ROLE_NAVIGATION,
Self::None => ffi::GTK_ACCESSIBLE_ROLE_NONE,
Self::Note => ffi::GTK_ACCESSIBLE_ROLE_NOTE,
Self::Option => ffi::GTK_ACCESSIBLE_ROLE_OPTION,
Self::Presentation => ffi::GTK_ACCESSIBLE_ROLE_PRESENTATION,
Self::ProgressBar => ffi::GTK_ACCESSIBLE_ROLE_PROGRESS_BAR,
Self::Radio => ffi::GTK_ACCESSIBLE_ROLE_RADIO,
Self::RadioGroup => ffi::GTK_ACCESSIBLE_ROLE_RADIO_GROUP,
Self::Range => ffi::GTK_ACCESSIBLE_ROLE_RANGE,
Self::Region => ffi::GTK_ACCESSIBLE_ROLE_REGION,
Self::Row => ffi::GTK_ACCESSIBLE_ROLE_ROW,
Self::RowGroup => ffi::GTK_ACCESSIBLE_ROLE_ROW_GROUP,
Self::RowHeader => ffi::GTK_ACCESSIBLE_ROLE_ROW_HEADER,
Self::Scrollbar => ffi::GTK_ACCESSIBLE_ROLE_SCROLLBAR,
Self::Search => ffi::GTK_ACCESSIBLE_ROLE_SEARCH,
Self::SearchBox => ffi::GTK_ACCESSIBLE_ROLE_SEARCH_BOX,
Self::Section => ffi::GTK_ACCESSIBLE_ROLE_SECTION,
Self::SectionHead => ffi::GTK_ACCESSIBLE_ROLE_SECTION_HEAD,
Self::Select => ffi::GTK_ACCESSIBLE_ROLE_SELECT,
Self::Separator => ffi::GTK_ACCESSIBLE_ROLE_SEPARATOR,
Self::Slider => ffi::GTK_ACCESSIBLE_ROLE_SLIDER,
Self::SpinButton => ffi::GTK_ACCESSIBLE_ROLE_SPIN_BUTTON,
Self::Status => ffi::GTK_ACCESSIBLE_ROLE_STATUS,
Self::Structure => ffi::GTK_ACCESSIBLE_ROLE_STRUCTURE,
Self::Switch => ffi::GTK_ACCESSIBLE_ROLE_SWITCH,
Self::Tab => ffi::GTK_ACCESSIBLE_ROLE_TAB,
Self::Table => ffi::GTK_ACCESSIBLE_ROLE_TABLE,
Self::TabList => ffi::GTK_ACCESSIBLE_ROLE_TAB_LIST,
Self::TabPanel => ffi::GTK_ACCESSIBLE_ROLE_TAB_PANEL,
Self::TextBox => ffi::GTK_ACCESSIBLE_ROLE_TEXT_BOX,
Self::Time => ffi::GTK_ACCESSIBLE_ROLE_TIME,
Self::Timer => ffi::GTK_ACCESSIBLE_ROLE_TIMER,
Self::Toolbar => ffi::GTK_ACCESSIBLE_ROLE_TOOLBAR,
Self::Tooltip => ffi::GTK_ACCESSIBLE_ROLE_TOOLTIP,
Self::Tree => ffi::GTK_ACCESSIBLE_ROLE_TREE,
Self::TreeGrid => ffi::GTK_ACCESSIBLE_ROLE_TREE_GRID,
Self::TreeItem => ffi::GTK_ACCESSIBLE_ROLE_TREE_ITEM,
Self::Widget => ffi::GTK_ACCESSIBLE_ROLE_WIDGET,
Self::Window => ffi::GTK_ACCESSIBLE_ROLE_WINDOW,
#[cfg(any(feature = "v4_10", feature = "dox"))]
Self::ToggleButton => ffi::GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleRole> for AccessibleRole {
unsafe fn from_glib(value: ffi::GtkAccessibleRole) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_ROLE_ALERT => Self::Alert,
ffi::GTK_ACCESSIBLE_ROLE_ALERT_DIALOG => Self::AlertDialog,
ffi::GTK_ACCESSIBLE_ROLE_BANNER => Self::Banner,
ffi::GTK_ACCESSIBLE_ROLE_BUTTON => Self::Button,
ffi::GTK_ACCESSIBLE_ROLE_CAPTION => Self::Caption,
ffi::GTK_ACCESSIBLE_ROLE_CELL => Self::Cell,
ffi::GTK_ACCESSIBLE_ROLE_CHECKBOX => Self::Checkbox,
ffi::GTK_ACCESSIBLE_ROLE_COLUMN_HEADER => Self::ColumnHeader,
ffi::GTK_ACCESSIBLE_ROLE_COMBO_BOX => Self::ComboBox,
ffi::GTK_ACCESSIBLE_ROLE_COMMAND => Self::Command,
ffi::GTK_ACCESSIBLE_ROLE_COMPOSITE => Self::Composite,
ffi::GTK_ACCESSIBLE_ROLE_DIALOG => Self::Dialog,
ffi::GTK_ACCESSIBLE_ROLE_DOCUMENT => Self::Document,
ffi::GTK_ACCESSIBLE_ROLE_FEED => Self::Feed,
ffi::GTK_ACCESSIBLE_ROLE_FORM => Self::Form,
ffi::GTK_ACCESSIBLE_ROLE_GENERIC => Self::Generic,
ffi::GTK_ACCESSIBLE_ROLE_GRID => Self::Grid,
ffi::GTK_ACCESSIBLE_ROLE_GRID_CELL => Self::GridCell,
ffi::GTK_ACCESSIBLE_ROLE_GROUP => Self::Group,
ffi::GTK_ACCESSIBLE_ROLE_HEADING => Self::Heading,
ffi::GTK_ACCESSIBLE_ROLE_IMG => Self::Img,
ffi::GTK_ACCESSIBLE_ROLE_INPUT => Self::Input,
ffi::GTK_ACCESSIBLE_ROLE_LABEL => Self::Label,
ffi::GTK_ACCESSIBLE_ROLE_LANDMARK => Self::Landmark,
ffi::GTK_ACCESSIBLE_ROLE_LEGEND => Self::Legend,
ffi::GTK_ACCESSIBLE_ROLE_LINK => Self::Link,
ffi::GTK_ACCESSIBLE_ROLE_LIST => Self::List,
ffi::GTK_ACCESSIBLE_ROLE_LIST_BOX => Self::ListBox,
ffi::GTK_ACCESSIBLE_ROLE_LIST_ITEM => Self::ListItem,
ffi::GTK_ACCESSIBLE_ROLE_LOG => Self::Log,
ffi::GTK_ACCESSIBLE_ROLE_MAIN => Self::Main,
ffi::GTK_ACCESSIBLE_ROLE_MARQUEE => Self::Marquee,
ffi::GTK_ACCESSIBLE_ROLE_MATH => Self::Math,
ffi::GTK_ACCESSIBLE_ROLE_METER => Self::Meter,
ffi::GTK_ACCESSIBLE_ROLE_MENU => Self::Menu,
ffi::GTK_ACCESSIBLE_ROLE_MENU_BAR => Self::MenuBar,
ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM => Self::MenuItem,
ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_CHECKBOX => Self::MenuItemCheckbox,
ffi::GTK_ACCESSIBLE_ROLE_MENU_ITEM_RADIO => Self::MenuItemRadio,
ffi::GTK_ACCESSIBLE_ROLE_NAVIGATION => Self::Navigation,
ffi::GTK_ACCESSIBLE_ROLE_NONE => Self::None,
ffi::GTK_ACCESSIBLE_ROLE_NOTE => Self::Note,
ffi::GTK_ACCESSIBLE_ROLE_OPTION => Self::Option,
ffi::GTK_ACCESSIBLE_ROLE_PRESENTATION => Self::Presentation,
ffi::GTK_ACCESSIBLE_ROLE_PROGRESS_BAR => Self::ProgressBar,
ffi::GTK_ACCESSIBLE_ROLE_RADIO => Self::Radio,
ffi::GTK_ACCESSIBLE_ROLE_RADIO_GROUP => Self::RadioGroup,
ffi::GTK_ACCESSIBLE_ROLE_RANGE => Self::Range,
ffi::GTK_ACCESSIBLE_ROLE_REGION => Self::Region,
ffi::GTK_ACCESSIBLE_ROLE_ROW => Self::Row,
ffi::GTK_ACCESSIBLE_ROLE_ROW_GROUP => Self::RowGroup,
ffi::GTK_ACCESSIBLE_ROLE_ROW_HEADER => Self::RowHeader,
ffi::GTK_ACCESSIBLE_ROLE_SCROLLBAR => Self::Scrollbar,
ffi::GTK_ACCESSIBLE_ROLE_SEARCH => Self::Search,
ffi::GTK_ACCESSIBLE_ROLE_SEARCH_BOX => Self::SearchBox,
ffi::GTK_ACCESSIBLE_ROLE_SECTION => Self::Section,
ffi::GTK_ACCESSIBLE_ROLE_SECTION_HEAD => Self::SectionHead,
ffi::GTK_ACCESSIBLE_ROLE_SELECT => Self::Select,
ffi::GTK_ACCESSIBLE_ROLE_SEPARATOR => Self::Separator,
ffi::GTK_ACCESSIBLE_ROLE_SLIDER => Self::Slider,
ffi::GTK_ACCESSIBLE_ROLE_SPIN_BUTTON => Self::SpinButton,
ffi::GTK_ACCESSIBLE_ROLE_STATUS => Self::Status,
ffi::GTK_ACCESSIBLE_ROLE_STRUCTURE => Self::Structure,
ffi::GTK_ACCESSIBLE_ROLE_SWITCH => Self::Switch,
ffi::GTK_ACCESSIBLE_ROLE_TAB => Self::Tab,
ffi::GTK_ACCESSIBLE_ROLE_TABLE => Self::Table,
ffi::GTK_ACCESSIBLE_ROLE_TAB_LIST => Self::TabList,
ffi::GTK_ACCESSIBLE_ROLE_TAB_PANEL => Self::TabPanel,
ffi::GTK_ACCESSIBLE_ROLE_TEXT_BOX => Self::TextBox,
ffi::GTK_ACCESSIBLE_ROLE_TIME => Self::Time,
ffi::GTK_ACCESSIBLE_ROLE_TIMER => Self::Timer,
ffi::GTK_ACCESSIBLE_ROLE_TOOLBAR => Self::Toolbar,
ffi::GTK_ACCESSIBLE_ROLE_TOOLTIP => Self::Tooltip,
ffi::GTK_ACCESSIBLE_ROLE_TREE => Self::Tree,
ffi::GTK_ACCESSIBLE_ROLE_TREE_GRID => Self::TreeGrid,
ffi::GTK_ACCESSIBLE_ROLE_TREE_ITEM => Self::TreeItem,
ffi::GTK_ACCESSIBLE_ROLE_WIDGET => Self::Widget,
ffi::GTK_ACCESSIBLE_ROLE_WINDOW => Self::Window,
#[cfg(any(feature = "v4_10", feature = "dox"))]
ffi::GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON => Self::ToggleButton,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleRole {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_role_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleRole {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleRole {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleRole {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleRole {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleRole> for glib::Value {
#[inline]
fn from(v: AccessibleRole) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleSort")]
pub enum AccessibleSort {
#[doc(alias = "GTK_ACCESSIBLE_SORT_NONE")]
None,
#[doc(alias = "GTK_ACCESSIBLE_SORT_ASCENDING")]
Ascending,
#[doc(alias = "GTK_ACCESSIBLE_SORT_DESCENDING")]
Descending,
#[doc(alias = "GTK_ACCESSIBLE_SORT_OTHER")]
Other,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for AccessibleSort {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleSort::{}",
match *self {
Self::None => "None",
Self::Ascending => "Ascending",
Self::Descending => "Descending",
Self::Other => "Other",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleSort {
type GlibType = ffi::GtkAccessibleSort;
#[inline]
fn into_glib(self) -> ffi::GtkAccessibleSort {
match self {
Self::None => ffi::GTK_ACCESSIBLE_SORT_NONE,
Self::Ascending => ffi::GTK_ACCESSIBLE_SORT_ASCENDING,
Self::Descending => ffi::GTK_ACCESSIBLE_SORT_DESCENDING,
Self::Other => ffi::GTK_ACCESSIBLE_SORT_OTHER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleSort> for AccessibleSort {
#[inline]
unsafe fn from_glib(value: ffi::GtkAccessibleSort) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_SORT_NONE => Self::None,
ffi::GTK_ACCESSIBLE_SORT_ASCENDING => Self::Ascending,
ffi::GTK_ACCESSIBLE_SORT_DESCENDING => Self::Descending,
ffi::GTK_ACCESSIBLE_SORT_OTHER => Self::Other,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleSort {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_sort_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleSort {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleSort {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleSort {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleSort {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleSort> for glib::Value {
#[inline]
fn from(v: AccessibleSort) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleState")]
pub enum AccessibleState {
#[doc(alias = "GTK_ACCESSIBLE_STATE_BUSY")]
Busy,
#[doc(alias = "GTK_ACCESSIBLE_STATE_CHECKED")]
Checked,
#[doc(alias = "GTK_ACCESSIBLE_STATE_DISABLED")]
Disabled,
#[doc(alias = "GTK_ACCESSIBLE_STATE_EXPANDED")]
Expanded,
#[doc(alias = "GTK_ACCESSIBLE_STATE_HIDDEN")]
Hidden,
#[doc(alias = "GTK_ACCESSIBLE_STATE_INVALID")]
Invalid,
#[doc(alias = "GTK_ACCESSIBLE_STATE_PRESSED")]
Pressed,
#[doc(alias = "GTK_ACCESSIBLE_STATE_SELECTED")]
Selected,
#[doc(hidden)]
__Unknown(i32),
}
impl AccessibleState {
#[doc(alias = "gtk_accessible_state_init_value")]
pub fn init_value(self, value: &mut glib::Value) {
assert_initialized_main_thread!();
unsafe {
ffi::gtk_accessible_state_init_value(self.into_glib(), value.to_glib_none_mut().0);
}
}
}
impl fmt::Display for AccessibleState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleState::{}",
match *self {
Self::Busy => "Busy",
Self::Checked => "Checked",
Self::Disabled => "Disabled",
Self::Expanded => "Expanded",
Self::Hidden => "Hidden",
Self::Invalid => "Invalid",
Self::Pressed => "Pressed",
Self::Selected => "Selected",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleState {
type GlibType = ffi::GtkAccessibleState;
#[inline]
fn into_glib(self) -> ffi::GtkAccessibleState {
match self {
Self::Busy => ffi::GTK_ACCESSIBLE_STATE_BUSY,
Self::Checked => ffi::GTK_ACCESSIBLE_STATE_CHECKED,
Self::Disabled => ffi::GTK_ACCESSIBLE_STATE_DISABLED,
Self::Expanded => ffi::GTK_ACCESSIBLE_STATE_EXPANDED,
Self::Hidden => ffi::GTK_ACCESSIBLE_STATE_HIDDEN,
Self::Invalid => ffi::GTK_ACCESSIBLE_STATE_INVALID,
Self::Pressed => ffi::GTK_ACCESSIBLE_STATE_PRESSED,
Self::Selected => ffi::GTK_ACCESSIBLE_STATE_SELECTED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleState> for AccessibleState {
#[inline]
unsafe fn from_glib(value: ffi::GtkAccessibleState) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_STATE_BUSY => Self::Busy,
ffi::GTK_ACCESSIBLE_STATE_CHECKED => Self::Checked,
ffi::GTK_ACCESSIBLE_STATE_DISABLED => Self::Disabled,
ffi::GTK_ACCESSIBLE_STATE_EXPANDED => Self::Expanded,
ffi::GTK_ACCESSIBLE_STATE_HIDDEN => Self::Hidden,
ffi::GTK_ACCESSIBLE_STATE_INVALID => Self::Invalid,
ffi::GTK_ACCESSIBLE_STATE_PRESSED => Self::Pressed,
ffi::GTK_ACCESSIBLE_STATE_SELECTED => Self::Selected,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleState {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_state_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleState {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleState {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleState> for glib::Value {
#[inline]
fn from(v: AccessibleState) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAccessibleTristate")]
pub enum AccessibleTristate {
#[doc(alias = "GTK_ACCESSIBLE_TRISTATE_FALSE")]
False,
#[doc(alias = "GTK_ACCESSIBLE_TRISTATE_TRUE")]
True,
#[doc(alias = "GTK_ACCESSIBLE_TRISTATE_MIXED")]
Mixed,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for AccessibleTristate {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AccessibleTristate::{}",
match *self {
Self::False => "False",
Self::True => "True",
Self::Mixed => "Mixed",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AccessibleTristate {
type GlibType = ffi::GtkAccessibleTristate;
#[inline]
fn into_glib(self) -> ffi::GtkAccessibleTristate {
match self {
Self::False => ffi::GTK_ACCESSIBLE_TRISTATE_FALSE,
Self::True => ffi::GTK_ACCESSIBLE_TRISTATE_TRUE,
Self::Mixed => ffi::GTK_ACCESSIBLE_TRISTATE_MIXED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAccessibleTristate> for AccessibleTristate {
#[inline]
unsafe fn from_glib(value: ffi::GtkAccessibleTristate) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ACCESSIBLE_TRISTATE_FALSE => Self::False,
ffi::GTK_ACCESSIBLE_TRISTATE_TRUE => Self::True,
ffi::GTK_ACCESSIBLE_TRISTATE_MIXED => Self::Mixed,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AccessibleTristate {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_accessible_tristate_get_type()) }
}
}
impl glib::HasParamSpec for AccessibleTristate {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AccessibleTristate {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AccessibleTristate {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AccessibleTristate {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AccessibleTristate> for glib::Value {
#[inline]
fn from(v: AccessibleTristate) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAlign")]
pub enum Align {
#[doc(alias = "GTK_ALIGN_FILL")]
Fill,
#[doc(alias = "GTK_ALIGN_START")]
Start,
#[doc(alias = "GTK_ALIGN_END")]
End,
#[doc(alias = "GTK_ALIGN_CENTER")]
Center,
#[doc(alias = "GTK_ALIGN_BASELINE")]
Baseline,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for Align {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Align::{}",
match *self {
Self::Fill => "Fill",
Self::Start => "Start",
Self::End => "End",
Self::Center => "Center",
Self::Baseline => "Baseline",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for Align {
type GlibType = ffi::GtkAlign;
#[inline]
fn into_glib(self) -> ffi::GtkAlign {
match self {
Self::Fill => ffi::GTK_ALIGN_FILL,
Self::Start => ffi::GTK_ALIGN_START,
Self::End => ffi::GTK_ALIGN_END,
Self::Center => ffi::GTK_ALIGN_CENTER,
Self::Baseline => ffi::GTK_ALIGN_BASELINE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAlign> for Align {
#[inline]
unsafe fn from_glib(value: ffi::GtkAlign) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ALIGN_FILL => Self::Fill,
ffi::GTK_ALIGN_START => Self::Start,
ffi::GTK_ALIGN_END => Self::End,
ffi::GTK_ALIGN_CENTER => Self::Center,
ffi::GTK_ALIGN_BASELINE => Self::Baseline,
value => Self::__Unknown(value),
}
}
}
impl StaticType for Align {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_align_get_type()) }
}
}
impl glib::HasParamSpec for Align {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for Align {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for Align {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for Align {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<Align> for glib::Value {
#[inline]
fn from(v: Align) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkArrowType")]
pub enum ArrowType {
#[doc(alias = "GTK_ARROW_UP")]
Up,
#[doc(alias = "GTK_ARROW_DOWN")]
Down,
#[doc(alias = "GTK_ARROW_LEFT")]
Left,
#[doc(alias = "GTK_ARROW_RIGHT")]
Right,
#[doc(alias = "GTK_ARROW_NONE")]
None,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ArrowType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ArrowType::{}",
match *self {
Self::Up => "Up",
Self::Down => "Down",
Self::Left => "Left",
Self::Right => "Right",
Self::None => "None",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ArrowType {
type GlibType = ffi::GtkArrowType;
#[inline]
fn into_glib(self) -> ffi::GtkArrowType {
match self {
Self::Up => ffi::GTK_ARROW_UP,
Self::Down => ffi::GTK_ARROW_DOWN,
Self::Left => ffi::GTK_ARROW_LEFT,
Self::Right => ffi::GTK_ARROW_RIGHT,
Self::None => ffi::GTK_ARROW_NONE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkArrowType> for ArrowType {
#[inline]
unsafe fn from_glib(value: ffi::GtkArrowType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ARROW_UP => Self::Up,
ffi::GTK_ARROW_DOWN => Self::Down,
ffi::GTK_ARROW_LEFT => Self::Left,
ffi::GTK_ARROW_RIGHT => Self::Right,
ffi::GTK_ARROW_NONE => Self::None,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ArrowType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_arrow_type_get_type()) }
}
}
impl glib::HasParamSpec for ArrowType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ArrowType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ArrowType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ArrowType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ArrowType> for glib::Value {
#[inline]
fn from(v: ArrowType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkAssistantPageType")]
pub enum AssistantPageType {
#[doc(alias = "GTK_ASSISTANT_PAGE_CONTENT")]
Content,
#[doc(alias = "GTK_ASSISTANT_PAGE_INTRO")]
Intro,
#[doc(alias = "GTK_ASSISTANT_PAGE_CONFIRM")]
Confirm,
#[doc(alias = "GTK_ASSISTANT_PAGE_SUMMARY")]
Summary,
#[doc(alias = "GTK_ASSISTANT_PAGE_PROGRESS")]
Progress,
#[doc(alias = "GTK_ASSISTANT_PAGE_CUSTOM")]
Custom,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for AssistantPageType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"AssistantPageType::{}",
match *self {
Self::Content => "Content",
Self::Intro => "Intro",
Self::Confirm => "Confirm",
Self::Summary => "Summary",
Self::Progress => "Progress",
Self::Custom => "Custom",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for AssistantPageType {
type GlibType = ffi::GtkAssistantPageType;
#[inline]
fn into_glib(self) -> ffi::GtkAssistantPageType {
match self {
Self::Content => ffi::GTK_ASSISTANT_PAGE_CONTENT,
Self::Intro => ffi::GTK_ASSISTANT_PAGE_INTRO,
Self::Confirm => ffi::GTK_ASSISTANT_PAGE_CONFIRM,
Self::Summary => ffi::GTK_ASSISTANT_PAGE_SUMMARY,
Self::Progress => ffi::GTK_ASSISTANT_PAGE_PROGRESS,
Self::Custom => ffi::GTK_ASSISTANT_PAGE_CUSTOM,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkAssistantPageType> for AssistantPageType {
#[inline]
unsafe fn from_glib(value: ffi::GtkAssistantPageType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ASSISTANT_PAGE_CONTENT => Self::Content,
ffi::GTK_ASSISTANT_PAGE_INTRO => Self::Intro,
ffi::GTK_ASSISTANT_PAGE_CONFIRM => Self::Confirm,
ffi::GTK_ASSISTANT_PAGE_SUMMARY => Self::Summary,
ffi::GTK_ASSISTANT_PAGE_PROGRESS => Self::Progress,
ffi::GTK_ASSISTANT_PAGE_CUSTOM => Self::Custom,
value => Self::__Unknown(value),
}
}
}
impl StaticType for AssistantPageType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_assistant_page_type_get_type()) }
}
}
impl glib::HasParamSpec for AssistantPageType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for AssistantPageType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for AssistantPageType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for AssistantPageType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<AssistantPageType> for glib::Value {
#[inline]
fn from(v: AssistantPageType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkBaselinePosition")]
pub enum BaselinePosition {
#[doc(alias = "GTK_BASELINE_POSITION_TOP")]
Top,
#[doc(alias = "GTK_BASELINE_POSITION_CENTER")]
Center,
#[doc(alias = "GTK_BASELINE_POSITION_BOTTOM")]
Bottom,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for BaselinePosition {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"BaselinePosition::{}",
match *self {
Self::Top => "Top",
Self::Center => "Center",
Self::Bottom => "Bottom",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for BaselinePosition {
type GlibType = ffi::GtkBaselinePosition;
#[inline]
fn into_glib(self) -> ffi::GtkBaselinePosition {
match self {
Self::Top => ffi::GTK_BASELINE_POSITION_TOP,
Self::Center => ffi::GTK_BASELINE_POSITION_CENTER,
Self::Bottom => ffi::GTK_BASELINE_POSITION_BOTTOM,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkBaselinePosition> for BaselinePosition {
#[inline]
unsafe fn from_glib(value: ffi::GtkBaselinePosition) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_BASELINE_POSITION_TOP => Self::Top,
ffi::GTK_BASELINE_POSITION_CENTER => Self::Center,
ffi::GTK_BASELINE_POSITION_BOTTOM => Self::Bottom,
value => Self::__Unknown(value),
}
}
}
impl StaticType for BaselinePosition {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_baseline_position_get_type()) }
}
}
impl glib::HasParamSpec for BaselinePosition {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for BaselinePosition {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for BaselinePosition {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for BaselinePosition {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<BaselinePosition> for glib::Value {
#[inline]
fn from(v: BaselinePosition) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkBorderStyle")]
pub enum BorderStyle {
#[doc(alias = "GTK_BORDER_STYLE_NONE")]
None,
#[doc(alias = "GTK_BORDER_STYLE_HIDDEN")]
Hidden,
#[doc(alias = "GTK_BORDER_STYLE_SOLID")]
Solid,
#[doc(alias = "GTK_BORDER_STYLE_INSET")]
Inset,
#[doc(alias = "GTK_BORDER_STYLE_OUTSET")]
Outset,
#[doc(alias = "GTK_BORDER_STYLE_DOTTED")]
Dotted,
#[doc(alias = "GTK_BORDER_STYLE_DASHED")]
Dashed,
#[doc(alias = "GTK_BORDER_STYLE_DOUBLE")]
Double,
#[doc(alias = "GTK_BORDER_STYLE_GROOVE")]
Groove,
#[doc(alias = "GTK_BORDER_STYLE_RIDGE")]
Ridge,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for BorderStyle {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"BorderStyle::{}",
match *self {
Self::None => "None",
Self::Hidden => "Hidden",
Self::Solid => "Solid",
Self::Inset => "Inset",
Self::Outset => "Outset",
Self::Dotted => "Dotted",
Self::Dashed => "Dashed",
Self::Double => "Double",
Self::Groove => "Groove",
Self::Ridge => "Ridge",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for BorderStyle {
type GlibType = ffi::GtkBorderStyle;
#[inline]
fn into_glib(self) -> ffi::GtkBorderStyle {
match self {
Self::None => ffi::GTK_BORDER_STYLE_NONE,
Self::Hidden => ffi::GTK_BORDER_STYLE_HIDDEN,
Self::Solid => ffi::GTK_BORDER_STYLE_SOLID,
Self::Inset => ffi::GTK_BORDER_STYLE_INSET,
Self::Outset => ffi::GTK_BORDER_STYLE_OUTSET,
Self::Dotted => ffi::GTK_BORDER_STYLE_DOTTED,
Self::Dashed => ffi::GTK_BORDER_STYLE_DASHED,
Self::Double => ffi::GTK_BORDER_STYLE_DOUBLE,
Self::Groove => ffi::GTK_BORDER_STYLE_GROOVE,
Self::Ridge => ffi::GTK_BORDER_STYLE_RIDGE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkBorderStyle> for BorderStyle {
#[inline]
unsafe fn from_glib(value: ffi::GtkBorderStyle) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_BORDER_STYLE_NONE => Self::None,
ffi::GTK_BORDER_STYLE_HIDDEN => Self::Hidden,
ffi::GTK_BORDER_STYLE_SOLID => Self::Solid,
ffi::GTK_BORDER_STYLE_INSET => Self::Inset,
ffi::GTK_BORDER_STYLE_OUTSET => Self::Outset,
ffi::GTK_BORDER_STYLE_DOTTED => Self::Dotted,
ffi::GTK_BORDER_STYLE_DASHED => Self::Dashed,
ffi::GTK_BORDER_STYLE_DOUBLE => Self::Double,
ffi::GTK_BORDER_STYLE_GROOVE => Self::Groove,
ffi::GTK_BORDER_STYLE_RIDGE => Self::Ridge,
value => Self::__Unknown(value),
}
}
}
impl StaticType for BorderStyle {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_border_style_get_type()) }
}
}
impl glib::HasParamSpec for BorderStyle {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for BorderStyle {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for BorderStyle {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for BorderStyle {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<BorderStyle> for glib::Value {
#[inline]
fn from(v: BorderStyle) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkBuilderError")]
pub enum BuilderError {
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION")]
InvalidTypeFunction,
#[doc(alias = "GTK_BUILDER_ERROR_UNHANDLED_TAG")]
UnhandledTag,
#[doc(alias = "GTK_BUILDER_ERROR_MISSING_ATTRIBUTE")]
MissingAttribute,
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_ATTRIBUTE")]
InvalidAttribute,
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_TAG")]
InvalidTag,
#[doc(alias = "GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE")]
MissingPropertyValue,
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_VALUE")]
InvalidValue,
#[doc(alias = "GTK_BUILDER_ERROR_VERSION_MISMATCH")]
VersionMismatch,
#[doc(alias = "GTK_BUILDER_ERROR_DUPLICATE_ID")]
DuplicateId,
#[doc(alias = "GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED")]
ObjectTypeRefused,
#[doc(alias = "GTK_BUILDER_ERROR_TEMPLATE_MISMATCH")]
TemplateMismatch,
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_PROPERTY")]
InvalidProperty,
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_SIGNAL")]
InvalidSignal,
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_ID")]
InvalidId,
#[doc(alias = "GTK_BUILDER_ERROR_INVALID_FUNCTION")]
InvalidFunction,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for BuilderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"BuilderError::{}",
match *self {
Self::InvalidTypeFunction => "InvalidTypeFunction",
Self::UnhandledTag => "UnhandledTag",
Self::MissingAttribute => "MissingAttribute",
Self::InvalidAttribute => "InvalidAttribute",
Self::InvalidTag => "InvalidTag",
Self::MissingPropertyValue => "MissingPropertyValue",
Self::InvalidValue => "InvalidValue",
Self::VersionMismatch => "VersionMismatch",
Self::DuplicateId => "DuplicateId",
Self::ObjectTypeRefused => "ObjectTypeRefused",
Self::TemplateMismatch => "TemplateMismatch",
Self::InvalidProperty => "InvalidProperty",
Self::InvalidSignal => "InvalidSignal",
Self::InvalidId => "InvalidId",
Self::InvalidFunction => "InvalidFunction",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for BuilderError {
type GlibType = ffi::GtkBuilderError;
fn into_glib(self) -> ffi::GtkBuilderError {
match self {
Self::InvalidTypeFunction => ffi::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
Self::UnhandledTag => ffi::GTK_BUILDER_ERROR_UNHANDLED_TAG,
Self::MissingAttribute => ffi::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
Self::InvalidAttribute => ffi::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
Self::InvalidTag => ffi::GTK_BUILDER_ERROR_INVALID_TAG,
Self::MissingPropertyValue => ffi::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
Self::InvalidValue => ffi::GTK_BUILDER_ERROR_INVALID_VALUE,
Self::VersionMismatch => ffi::GTK_BUILDER_ERROR_VERSION_MISMATCH,
Self::DuplicateId => ffi::GTK_BUILDER_ERROR_DUPLICATE_ID,
Self::ObjectTypeRefused => ffi::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED,
Self::TemplateMismatch => ffi::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH,
Self::InvalidProperty => ffi::GTK_BUILDER_ERROR_INVALID_PROPERTY,
Self::InvalidSignal => ffi::GTK_BUILDER_ERROR_INVALID_SIGNAL,
Self::InvalidId => ffi::GTK_BUILDER_ERROR_INVALID_ID,
Self::InvalidFunction => ffi::GTK_BUILDER_ERROR_INVALID_FUNCTION,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkBuilderError> for BuilderError {
unsafe fn from_glib(value: ffi::GtkBuilderError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION => Self::InvalidTypeFunction,
ffi::GTK_BUILDER_ERROR_UNHANDLED_TAG => Self::UnhandledTag,
ffi::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE => Self::MissingAttribute,
ffi::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE => Self::InvalidAttribute,
ffi::GTK_BUILDER_ERROR_INVALID_TAG => Self::InvalidTag,
ffi::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE => Self::MissingPropertyValue,
ffi::GTK_BUILDER_ERROR_INVALID_VALUE => Self::InvalidValue,
ffi::GTK_BUILDER_ERROR_VERSION_MISMATCH => Self::VersionMismatch,
ffi::GTK_BUILDER_ERROR_DUPLICATE_ID => Self::DuplicateId,
ffi::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED => Self::ObjectTypeRefused,
ffi::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH => Self::TemplateMismatch,
ffi::GTK_BUILDER_ERROR_INVALID_PROPERTY => Self::InvalidProperty,
ffi::GTK_BUILDER_ERROR_INVALID_SIGNAL => Self::InvalidSignal,
ffi::GTK_BUILDER_ERROR_INVALID_ID => Self::InvalidId,
ffi::GTK_BUILDER_ERROR_INVALID_FUNCTION => Self::InvalidFunction,
value => Self::__Unknown(value),
}
}
}
impl ErrorDomain for BuilderError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_builder_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
value => Some(value),
}
}
}
impl StaticType for BuilderError {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_builder_error_get_type()) }
}
}
impl glib::HasParamSpec for BuilderError {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for BuilderError {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for BuilderError {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for BuilderError {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<BuilderError> for glib::Value {
#[inline]
fn from(v: BuilderError) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkButtonsType")]
pub enum ButtonsType {
#[doc(alias = "GTK_BUTTONS_NONE")]
None,
#[doc(alias = "GTK_BUTTONS_OK")]
Ok,
#[doc(alias = "GTK_BUTTONS_CLOSE")]
Close,
#[doc(alias = "GTK_BUTTONS_CANCEL")]
Cancel,
#[doc(alias = "GTK_BUTTONS_YES_NO")]
YesNo,
#[doc(alias = "GTK_BUTTONS_OK_CANCEL")]
OkCancel,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ButtonsType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ButtonsType::{}",
match *self {
Self::None => "None",
Self::Ok => "Ok",
Self::Close => "Close",
Self::Cancel => "Cancel",
Self::YesNo => "YesNo",
Self::OkCancel => "OkCancel",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ButtonsType {
type GlibType = ffi::GtkButtonsType;
#[inline]
fn into_glib(self) -> ffi::GtkButtonsType {
match self {
Self::None => ffi::GTK_BUTTONS_NONE,
Self::Ok => ffi::GTK_BUTTONS_OK,
Self::Close => ffi::GTK_BUTTONS_CLOSE,
Self::Cancel => ffi::GTK_BUTTONS_CANCEL,
Self::YesNo => ffi::GTK_BUTTONS_YES_NO,
Self::OkCancel => ffi::GTK_BUTTONS_OK_CANCEL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkButtonsType> for ButtonsType {
#[inline]
unsafe fn from_glib(value: ffi::GtkButtonsType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_BUTTONS_NONE => Self::None,
ffi::GTK_BUTTONS_OK => Self::Ok,
ffi::GTK_BUTTONS_CLOSE => Self::Close,
ffi::GTK_BUTTONS_CANCEL => Self::Cancel,
ffi::GTK_BUTTONS_YES_NO => Self::YesNo,
ffi::GTK_BUTTONS_OK_CANCEL => Self::OkCancel,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ButtonsType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_buttons_type_get_type()) }
}
}
impl glib::HasParamSpec for ButtonsType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ButtonsType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ButtonsType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ButtonsType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ButtonsType> for glib::Value {
#[inline]
fn from(v: ButtonsType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkCellRendererAccelMode")]
pub enum CellRendererAccelMode {
#[doc(alias = "GTK_CELL_RENDERER_ACCEL_MODE_GTK")]
Gtk,
#[doc(alias = "GTK_CELL_RENDERER_ACCEL_MODE_OTHER")]
Other,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for CellRendererAccelMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CellRendererAccelMode::{}",
match *self {
Self::Gtk => "Gtk",
Self::Other => "Other",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for CellRendererAccelMode {
type GlibType = ffi::GtkCellRendererAccelMode;
#[inline]
fn into_glib(self) -> ffi::GtkCellRendererAccelMode {
match self {
Self::Gtk => ffi::GTK_CELL_RENDERER_ACCEL_MODE_GTK,
Self::Other => ffi::GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkCellRendererAccelMode> for CellRendererAccelMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkCellRendererAccelMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CELL_RENDERER_ACCEL_MODE_GTK => Self::Gtk,
ffi::GTK_CELL_RENDERER_ACCEL_MODE_OTHER => Self::Other,
value => Self::__Unknown(value),
}
}
}
impl StaticType for CellRendererAccelMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_cell_renderer_accel_mode_get_type()) }
}
}
impl glib::HasParamSpec for CellRendererAccelMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for CellRendererAccelMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for CellRendererAccelMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for CellRendererAccelMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<CellRendererAccelMode> for glib::Value {
#[inline]
fn from(v: CellRendererAccelMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkCellRendererMode")]
pub enum CellRendererMode {
#[doc(alias = "GTK_CELL_RENDERER_MODE_INERT")]
Inert,
#[doc(alias = "GTK_CELL_RENDERER_MODE_ACTIVATABLE")]
Activatable,
#[doc(alias = "GTK_CELL_RENDERER_MODE_EDITABLE")]
Editable,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for CellRendererMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CellRendererMode::{}",
match *self {
Self::Inert => "Inert",
Self::Activatable => "Activatable",
Self::Editable => "Editable",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for CellRendererMode {
type GlibType = ffi::GtkCellRendererMode;
#[inline]
fn into_glib(self) -> ffi::GtkCellRendererMode {
match self {
Self::Inert => ffi::GTK_CELL_RENDERER_MODE_INERT,
Self::Activatable => ffi::GTK_CELL_RENDERER_MODE_ACTIVATABLE,
Self::Editable => ffi::GTK_CELL_RENDERER_MODE_EDITABLE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkCellRendererMode> for CellRendererMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkCellRendererMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CELL_RENDERER_MODE_INERT => Self::Inert,
ffi::GTK_CELL_RENDERER_MODE_ACTIVATABLE => Self::Activatable,
ffi::GTK_CELL_RENDERER_MODE_EDITABLE => Self::Editable,
value => Self::__Unknown(value),
}
}
}
impl StaticType for CellRendererMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_cell_renderer_mode_get_type()) }
}
}
impl glib::HasParamSpec for CellRendererMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for CellRendererMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for CellRendererMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for CellRendererMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<CellRendererMode> for glib::Value {
#[inline]
fn from(v: CellRendererMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkCollation")]
pub enum Collation {
#[doc(alias = "GTK_COLLATION_NONE")]
None,
#[doc(alias = "GTK_COLLATION_UNICODE")]
Unicode,
#[doc(alias = "GTK_COLLATION_FILENAME")]
Filename,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl fmt::Display for Collation {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Collation::{}",
match *self {
Self::None => "None",
Self::Unicode => "Unicode",
Self::Filename => "Filename",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl IntoGlib for Collation {
type GlibType = ffi::GtkCollation;
#[inline]
fn into_glib(self) -> ffi::GtkCollation {
match self {
Self::None => ffi::GTK_COLLATION_NONE,
Self::Unicode => ffi::GTK_COLLATION_UNICODE,
Self::Filename => ffi::GTK_COLLATION_FILENAME,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkCollation> for Collation {
#[inline]
unsafe fn from_glib(value: ffi::GtkCollation) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_COLLATION_NONE => Self::None,
ffi::GTK_COLLATION_UNICODE => Self::Unicode,
ffi::GTK_COLLATION_FILENAME => Self::Filename,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl StaticType for Collation {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_collation_get_type()) }
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::HasParamSpec for Collation {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::value::ValueType for Collation {
type Type = Self;
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
unsafe impl<'a> FromValue<'a> for Collation {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl ToValue for Collation {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl From<Collation> for glib::Value {
#[inline]
fn from(v: Collation) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkConstraintAttribute")]
pub enum ConstraintAttribute {
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_NONE")]
None,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_LEFT")]
Left,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_RIGHT")]
Right,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_TOP")]
Top,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_BOTTOM")]
Bottom,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_START")]
Start,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_END")]
End,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_WIDTH")]
Width,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_HEIGHT")]
Height,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_CENTER_X")]
CenterX,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y")]
CenterY,
#[doc(alias = "GTK_CONSTRAINT_ATTRIBUTE_BASELINE")]
Baseline,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ConstraintAttribute {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ConstraintAttribute::{}",
match *self {
Self::None => "None",
Self::Left => "Left",
Self::Right => "Right",
Self::Top => "Top",
Self::Bottom => "Bottom",
Self::Start => "Start",
Self::End => "End",
Self::Width => "Width",
Self::Height => "Height",
Self::CenterX => "CenterX",
Self::CenterY => "CenterY",
Self::Baseline => "Baseline",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ConstraintAttribute {
type GlibType = ffi::GtkConstraintAttribute;
#[inline]
fn into_glib(self) -> ffi::GtkConstraintAttribute {
match self {
Self::None => ffi::GTK_CONSTRAINT_ATTRIBUTE_NONE,
Self::Left => ffi::GTK_CONSTRAINT_ATTRIBUTE_LEFT,
Self::Right => ffi::GTK_CONSTRAINT_ATTRIBUTE_RIGHT,
Self::Top => ffi::GTK_CONSTRAINT_ATTRIBUTE_TOP,
Self::Bottom => ffi::GTK_CONSTRAINT_ATTRIBUTE_BOTTOM,
Self::Start => ffi::GTK_CONSTRAINT_ATTRIBUTE_START,
Self::End => ffi::GTK_CONSTRAINT_ATTRIBUTE_END,
Self::Width => ffi::GTK_CONSTRAINT_ATTRIBUTE_WIDTH,
Self::Height => ffi::GTK_CONSTRAINT_ATTRIBUTE_HEIGHT,
Self::CenterX => ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_X,
Self::CenterY => ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y,
Self::Baseline => ffi::GTK_CONSTRAINT_ATTRIBUTE_BASELINE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkConstraintAttribute> for ConstraintAttribute {
#[inline]
unsafe fn from_glib(value: ffi::GtkConstraintAttribute) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CONSTRAINT_ATTRIBUTE_NONE => Self::None,
ffi::GTK_CONSTRAINT_ATTRIBUTE_LEFT => Self::Left,
ffi::GTK_CONSTRAINT_ATTRIBUTE_RIGHT => Self::Right,
ffi::GTK_CONSTRAINT_ATTRIBUTE_TOP => Self::Top,
ffi::GTK_CONSTRAINT_ATTRIBUTE_BOTTOM => Self::Bottom,
ffi::GTK_CONSTRAINT_ATTRIBUTE_START => Self::Start,
ffi::GTK_CONSTRAINT_ATTRIBUTE_END => Self::End,
ffi::GTK_CONSTRAINT_ATTRIBUTE_WIDTH => Self::Width,
ffi::GTK_CONSTRAINT_ATTRIBUTE_HEIGHT => Self::Height,
ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_X => Self::CenterX,
ffi::GTK_CONSTRAINT_ATTRIBUTE_CENTER_Y => Self::CenterY,
ffi::GTK_CONSTRAINT_ATTRIBUTE_BASELINE => Self::Baseline,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ConstraintAttribute {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_constraint_attribute_get_type()) }
}
}
impl glib::HasParamSpec for ConstraintAttribute {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ConstraintAttribute {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ConstraintAttribute {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ConstraintAttribute {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ConstraintAttribute> for glib::Value {
#[inline]
fn from(v: ConstraintAttribute) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkConstraintRelation")]
pub enum ConstraintRelation {
#[doc(alias = "GTK_CONSTRAINT_RELATION_LE")]
Le,
#[doc(alias = "GTK_CONSTRAINT_RELATION_EQ")]
Eq,
#[doc(alias = "GTK_CONSTRAINT_RELATION_GE")]
Ge,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ConstraintRelation {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ConstraintRelation::{}",
match *self {
Self::Le => "Le",
Self::Eq => "Eq",
Self::Ge => "Ge",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ConstraintRelation {
type GlibType = ffi::GtkConstraintRelation;
#[inline]
fn into_glib(self) -> ffi::GtkConstraintRelation {
match self {
Self::Le => ffi::GTK_CONSTRAINT_RELATION_LE,
Self::Eq => ffi::GTK_CONSTRAINT_RELATION_EQ,
Self::Ge => ffi::GTK_CONSTRAINT_RELATION_GE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkConstraintRelation> for ConstraintRelation {
#[inline]
unsafe fn from_glib(value: ffi::GtkConstraintRelation) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CONSTRAINT_RELATION_LE => Self::Le,
ffi::GTK_CONSTRAINT_RELATION_EQ => Self::Eq,
ffi::GTK_CONSTRAINT_RELATION_GE => Self::Ge,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ConstraintRelation {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_constraint_relation_get_type()) }
}
}
impl glib::HasParamSpec for ConstraintRelation {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ConstraintRelation {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ConstraintRelation {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ConstraintRelation {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ConstraintRelation> for glib::Value {
#[inline]
fn from(v: ConstraintRelation) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkConstraintStrength")]
pub enum ConstraintStrength {
#[doc(alias = "GTK_CONSTRAINT_STRENGTH_REQUIRED")]
Required,
#[doc(alias = "GTK_CONSTRAINT_STRENGTH_STRONG")]
Strong,
#[doc(alias = "GTK_CONSTRAINT_STRENGTH_MEDIUM")]
Medium,
#[doc(alias = "GTK_CONSTRAINT_STRENGTH_WEAK")]
Weak,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ConstraintStrength {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ConstraintStrength::{}",
match *self {
Self::Required => "Required",
Self::Strong => "Strong",
Self::Medium => "Medium",
Self::Weak => "Weak",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ConstraintStrength {
type GlibType = ffi::GtkConstraintStrength;
#[inline]
fn into_glib(self) -> ffi::GtkConstraintStrength {
match self {
Self::Required => ffi::GTK_CONSTRAINT_STRENGTH_REQUIRED,
Self::Strong => ffi::GTK_CONSTRAINT_STRENGTH_STRONG,
Self::Medium => ffi::GTK_CONSTRAINT_STRENGTH_MEDIUM,
Self::Weak => ffi::GTK_CONSTRAINT_STRENGTH_WEAK,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkConstraintStrength> for ConstraintStrength {
#[inline]
unsafe fn from_glib(value: ffi::GtkConstraintStrength) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CONSTRAINT_STRENGTH_REQUIRED => Self::Required,
ffi::GTK_CONSTRAINT_STRENGTH_STRONG => Self::Strong,
ffi::GTK_CONSTRAINT_STRENGTH_MEDIUM => Self::Medium,
ffi::GTK_CONSTRAINT_STRENGTH_WEAK => Self::Weak,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ConstraintStrength {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_constraint_strength_get_type()) }
}
}
impl glib::HasParamSpec for ConstraintStrength {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ConstraintStrength {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ConstraintStrength {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ConstraintStrength {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ConstraintStrength> for glib::Value {
#[inline]
fn from(v: ConstraintStrength) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkConstraintVflParserError")]
pub enum ConstraintVflParserError {
#[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL")]
Symbol,
#[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE")]
Attribute,
#[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW")]
View,
#[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC")]
Metric,
#[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY")]
Priority,
#[doc(alias = "GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION")]
Relation,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ConstraintVflParserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ConstraintVflParserError::{}",
match *self {
Self::Symbol => "Symbol",
Self::Attribute => "Attribute",
Self::View => "View",
Self::Metric => "Metric",
Self::Priority => "Priority",
Self::Relation => "Relation",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ConstraintVflParserError {
type GlibType = ffi::GtkConstraintVflParserError;
#[inline]
fn into_glib(self) -> ffi::GtkConstraintVflParserError {
match self {
Self::Symbol => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL,
Self::Attribute => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE,
Self::View => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW,
Self::Metric => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC,
Self::Priority => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY,
Self::Relation => ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkConstraintVflParserError> for ConstraintVflParserError {
#[inline]
unsafe fn from_glib(value: ffi::GtkConstraintVflParserError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_SYMBOL => Self::Symbol,
ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_ATTRIBUTE => Self::Attribute,
ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_VIEW => Self::View,
ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_METRIC => Self::Metric,
ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_PRIORITY => Self::Priority,
ffi::GTK_CONSTRAINT_VFL_PARSER_ERROR_INVALID_RELATION => Self::Relation,
value => Self::__Unknown(value),
}
}
}
impl ErrorDomain for ConstraintVflParserError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_constraint_vfl_parser_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
value => Some(value),
}
}
}
impl StaticType for ConstraintVflParserError {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_constraint_vfl_parser_error_get_type()) }
}
}
impl glib::HasParamSpec for ConstraintVflParserError {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ConstraintVflParserError {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ConstraintVflParserError {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ConstraintVflParserError {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ConstraintVflParserError> for glib::Value {
#[inline]
fn from(v: ConstraintVflParserError) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkContentFit")]
pub enum ContentFit {
#[doc(alias = "GTK_CONTENT_FIT_FILL")]
Fill,
#[doc(alias = "GTK_CONTENT_FIT_CONTAIN")]
Contain,
#[doc(alias = "GTK_CONTENT_FIT_COVER")]
Cover,
#[doc(alias = "GTK_CONTENT_FIT_SCALE_DOWN")]
ScaleDown,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl fmt::Display for ContentFit {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ContentFit::{}",
match *self {
Self::Fill => "Fill",
Self::Contain => "Contain",
Self::Cover => "Cover",
Self::ScaleDown => "ScaleDown",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
#[doc(hidden)]
impl IntoGlib for ContentFit {
type GlibType = ffi::GtkContentFit;
#[inline]
fn into_glib(self) -> ffi::GtkContentFit {
match self {
Self::Fill => ffi::GTK_CONTENT_FIT_FILL,
Self::Contain => ffi::GTK_CONTENT_FIT_CONTAIN,
Self::Cover => ffi::GTK_CONTENT_FIT_COVER,
Self::ScaleDown => ffi::GTK_CONTENT_FIT_SCALE_DOWN,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkContentFit> for ContentFit {
#[inline]
unsafe fn from_glib(value: ffi::GtkContentFit) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CONTENT_FIT_FILL => Self::Fill,
ffi::GTK_CONTENT_FIT_CONTAIN => Self::Contain,
ffi::GTK_CONTENT_FIT_COVER => Self::Cover,
ffi::GTK_CONTENT_FIT_SCALE_DOWN => Self::ScaleDown,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl StaticType for ContentFit {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_content_fit_get_type()) }
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl glib::HasParamSpec for ContentFit {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl glib::value::ValueType for ContentFit {
type Type = Self;
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
unsafe impl<'a> FromValue<'a> for ContentFit {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl ToValue for ContentFit {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl From<ContentFit> for glib::Value {
#[inline]
fn from(v: ContentFit) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkCornerType")]
pub enum CornerType {
#[doc(alias = "GTK_CORNER_TOP_LEFT")]
TopLeft,
#[doc(alias = "GTK_CORNER_BOTTOM_LEFT")]
BottomLeft,
#[doc(alias = "GTK_CORNER_TOP_RIGHT")]
TopRight,
#[doc(alias = "GTK_CORNER_BOTTOM_RIGHT")]
BottomRight,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for CornerType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CornerType::{}",
match *self {
Self::TopLeft => "TopLeft",
Self::BottomLeft => "BottomLeft",
Self::TopRight => "TopRight",
Self::BottomRight => "BottomRight",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for CornerType {
type GlibType = ffi::GtkCornerType;
#[inline]
fn into_glib(self) -> ffi::GtkCornerType {
match self {
Self::TopLeft => ffi::GTK_CORNER_TOP_LEFT,
Self::BottomLeft => ffi::GTK_CORNER_BOTTOM_LEFT,
Self::TopRight => ffi::GTK_CORNER_TOP_RIGHT,
Self::BottomRight => ffi::GTK_CORNER_BOTTOM_RIGHT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkCornerType> for CornerType {
#[inline]
unsafe fn from_glib(value: ffi::GtkCornerType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CORNER_TOP_LEFT => Self::TopLeft,
ffi::GTK_CORNER_BOTTOM_LEFT => Self::BottomLeft,
ffi::GTK_CORNER_TOP_RIGHT => Self::TopRight,
ffi::GTK_CORNER_BOTTOM_RIGHT => Self::BottomRight,
value => Self::__Unknown(value),
}
}
}
impl StaticType for CornerType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_corner_type_get_type()) }
}
}
impl glib::HasParamSpec for CornerType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for CornerType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for CornerType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for CornerType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<CornerType> for glib::Value {
#[inline]
fn from(v: CornerType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkCssParserError")]
pub enum CssParserError {
#[doc(alias = "GTK_CSS_PARSER_ERROR_FAILED")]
Failed,
#[doc(alias = "GTK_CSS_PARSER_ERROR_SYNTAX")]
Syntax,
#[doc(alias = "GTK_CSS_PARSER_ERROR_IMPORT")]
Import,
#[doc(alias = "GTK_CSS_PARSER_ERROR_NAME")]
Name,
#[doc(alias = "GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE")]
UnknownValue,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for CssParserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CssParserError::{}",
match *self {
Self::Failed => "Failed",
Self::Syntax => "Syntax",
Self::Import => "Import",
Self::Name => "Name",
Self::UnknownValue => "UnknownValue",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for CssParserError {
type GlibType = ffi::GtkCssParserError;
#[inline]
fn into_glib(self) -> ffi::GtkCssParserError {
match self {
Self::Failed => ffi::GTK_CSS_PARSER_ERROR_FAILED,
Self::Syntax => ffi::GTK_CSS_PARSER_ERROR_SYNTAX,
Self::Import => ffi::GTK_CSS_PARSER_ERROR_IMPORT,
Self::Name => ffi::GTK_CSS_PARSER_ERROR_NAME,
Self::UnknownValue => ffi::GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkCssParserError> for CssParserError {
#[inline]
unsafe fn from_glib(value: ffi::GtkCssParserError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CSS_PARSER_ERROR_FAILED => Self::Failed,
ffi::GTK_CSS_PARSER_ERROR_SYNTAX => Self::Syntax,
ffi::GTK_CSS_PARSER_ERROR_IMPORT => Self::Import,
ffi::GTK_CSS_PARSER_ERROR_NAME => Self::Name,
ffi::GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE => Self::UnknownValue,
value => Self::__Unknown(value),
}
}
}
impl ErrorDomain for CssParserError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_css_parser_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
Self::__Unknown(_) => Some(Self::Failed),
value => Some(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkCssParserWarning")]
pub enum CssParserWarning {
#[doc(alias = "GTK_CSS_PARSER_WARNING_DEPRECATED")]
Deprecated,
#[doc(alias = "GTK_CSS_PARSER_WARNING_SYNTAX")]
Syntax,
#[doc(alias = "GTK_CSS_PARSER_WARNING_UNIMPLEMENTED")]
Unimplemented,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for CssParserWarning {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CssParserWarning::{}",
match *self {
Self::Deprecated => "Deprecated",
Self::Syntax => "Syntax",
Self::Unimplemented => "Unimplemented",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for CssParserWarning {
type GlibType = ffi::GtkCssParserWarning;
#[inline]
fn into_glib(self) -> ffi::GtkCssParserWarning {
match self {
Self::Deprecated => ffi::GTK_CSS_PARSER_WARNING_DEPRECATED,
Self::Syntax => ffi::GTK_CSS_PARSER_WARNING_SYNTAX,
Self::Unimplemented => ffi::GTK_CSS_PARSER_WARNING_UNIMPLEMENTED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkCssParserWarning> for CssParserWarning {
#[inline]
unsafe fn from_glib(value: ffi::GtkCssParserWarning) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_CSS_PARSER_WARNING_DEPRECATED => Self::Deprecated,
ffi::GTK_CSS_PARSER_WARNING_SYNTAX => Self::Syntax,
ffi::GTK_CSS_PARSER_WARNING_UNIMPLEMENTED => Self::Unimplemented,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkDeleteType")]
pub enum DeleteType {
#[doc(alias = "GTK_DELETE_CHARS")]
Chars,
#[doc(alias = "GTK_DELETE_WORD_ENDS")]
WordEnds,
#[doc(alias = "GTK_DELETE_WORDS")]
Words,
#[doc(alias = "GTK_DELETE_DISPLAY_LINES")]
DisplayLines,
#[doc(alias = "GTK_DELETE_DISPLAY_LINE_ENDS")]
DisplayLineEnds,
#[doc(alias = "GTK_DELETE_PARAGRAPH_ENDS")]
ParagraphEnds,
#[doc(alias = "GTK_DELETE_PARAGRAPHS")]
Paragraphs,
#[doc(alias = "GTK_DELETE_WHITESPACE")]
Whitespace,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for DeleteType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"DeleteType::{}",
match *self {
Self::Chars => "Chars",
Self::WordEnds => "WordEnds",
Self::Words => "Words",
Self::DisplayLines => "DisplayLines",
Self::DisplayLineEnds => "DisplayLineEnds",
Self::ParagraphEnds => "ParagraphEnds",
Self::Paragraphs => "Paragraphs",
Self::Whitespace => "Whitespace",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for DeleteType {
type GlibType = ffi::GtkDeleteType;
#[inline]
fn into_glib(self) -> ffi::GtkDeleteType {
match self {
Self::Chars => ffi::GTK_DELETE_CHARS,
Self::WordEnds => ffi::GTK_DELETE_WORD_ENDS,
Self::Words => ffi::GTK_DELETE_WORDS,
Self::DisplayLines => ffi::GTK_DELETE_DISPLAY_LINES,
Self::DisplayLineEnds => ffi::GTK_DELETE_DISPLAY_LINE_ENDS,
Self::ParagraphEnds => ffi::GTK_DELETE_PARAGRAPH_ENDS,
Self::Paragraphs => ffi::GTK_DELETE_PARAGRAPHS,
Self::Whitespace => ffi::GTK_DELETE_WHITESPACE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkDeleteType> for DeleteType {
#[inline]
unsafe fn from_glib(value: ffi::GtkDeleteType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_DELETE_CHARS => Self::Chars,
ffi::GTK_DELETE_WORD_ENDS => Self::WordEnds,
ffi::GTK_DELETE_WORDS => Self::Words,
ffi::GTK_DELETE_DISPLAY_LINES => Self::DisplayLines,
ffi::GTK_DELETE_DISPLAY_LINE_ENDS => Self::DisplayLineEnds,
ffi::GTK_DELETE_PARAGRAPH_ENDS => Self::ParagraphEnds,
ffi::GTK_DELETE_PARAGRAPHS => Self::Paragraphs,
ffi::GTK_DELETE_WHITESPACE => Self::Whitespace,
value => Self::__Unknown(value),
}
}
}
impl StaticType for DeleteType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_delete_type_get_type()) }
}
}
impl glib::HasParamSpec for DeleteType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for DeleteType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for DeleteType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for DeleteType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<DeleteType> for glib::Value {
#[inline]
fn from(v: DeleteType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkDialogError")]
pub enum DialogError {
#[doc(alias = "GTK_DIALOG_ERROR_FAILED")]
Failed,
#[doc(alias = "GTK_DIALOG_ERROR_CANCELLED")]
Cancelled,
#[doc(alias = "GTK_DIALOG_ERROR_DISMISSED")]
Dismissed,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl fmt::Display for DialogError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"DialogError::{}",
match *self {
Self::Failed => "Failed",
Self::Cancelled => "Cancelled",
Self::Dismissed => "Dismissed",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl IntoGlib for DialogError {
type GlibType = ffi::GtkDialogError;
#[inline]
fn into_glib(self) -> ffi::GtkDialogError {
match self {
Self::Failed => ffi::GTK_DIALOG_ERROR_FAILED,
Self::Cancelled => ffi::GTK_DIALOG_ERROR_CANCELLED,
Self::Dismissed => ffi::GTK_DIALOG_ERROR_DISMISSED,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkDialogError> for DialogError {
#[inline]
unsafe fn from_glib(value: ffi::GtkDialogError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_DIALOG_ERROR_FAILED => Self::Failed,
ffi::GTK_DIALOG_ERROR_CANCELLED => Self::Cancelled,
ffi::GTK_DIALOG_ERROR_DISMISSED => Self::Dismissed,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl ErrorDomain for DialogError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_dialog_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
Self::__Unknown(_) => Some(Self::Failed),
value => Some(value),
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl StaticType for DialogError {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_dialog_error_get_type()) }
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::HasParamSpec for DialogError {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::value::ValueType for DialogError {
type Type = Self;
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
unsafe impl<'a> FromValue<'a> for DialogError {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl ToValue for DialogError {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl From<DialogError> for glib::Value {
#[inline]
fn from(v: DialogError) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkDirectionType")]
pub enum DirectionType {
#[doc(alias = "GTK_DIR_TAB_FORWARD")]
TabForward,
#[doc(alias = "GTK_DIR_TAB_BACKWARD")]
TabBackward,
#[doc(alias = "GTK_DIR_UP")]
Up,
#[doc(alias = "GTK_DIR_DOWN")]
Down,
#[doc(alias = "GTK_DIR_LEFT")]
Left,
#[doc(alias = "GTK_DIR_RIGHT")]
Right,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for DirectionType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"DirectionType::{}",
match *self {
Self::TabForward => "TabForward",
Self::TabBackward => "TabBackward",
Self::Up => "Up",
Self::Down => "Down",
Self::Left => "Left",
Self::Right => "Right",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for DirectionType {
type GlibType = ffi::GtkDirectionType;
#[inline]
fn into_glib(self) -> ffi::GtkDirectionType {
match self {
Self::TabForward => ffi::GTK_DIR_TAB_FORWARD,
Self::TabBackward => ffi::GTK_DIR_TAB_BACKWARD,
Self::Up => ffi::GTK_DIR_UP,
Self::Down => ffi::GTK_DIR_DOWN,
Self::Left => ffi::GTK_DIR_LEFT,
Self::Right => ffi::GTK_DIR_RIGHT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkDirectionType> for DirectionType {
#[inline]
unsafe fn from_glib(value: ffi::GtkDirectionType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_DIR_TAB_FORWARD => Self::TabForward,
ffi::GTK_DIR_TAB_BACKWARD => Self::TabBackward,
ffi::GTK_DIR_UP => Self::Up,
ffi::GTK_DIR_DOWN => Self::Down,
ffi::GTK_DIR_LEFT => Self::Left,
ffi::GTK_DIR_RIGHT => Self::Right,
value => Self::__Unknown(value),
}
}
}
impl StaticType for DirectionType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_direction_type_get_type()) }
}
}
impl glib::HasParamSpec for DirectionType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for DirectionType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for DirectionType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for DirectionType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<DirectionType> for glib::Value {
#[inline]
fn from(v: DirectionType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkEditableProperties")]
pub enum EditableProperties {
#[doc(alias = "GTK_EDITABLE_PROP_TEXT")]
PropText,
#[doc(alias = "GTK_EDITABLE_PROP_CURSOR_POSITION")]
PropCursorPosition,
#[doc(alias = "GTK_EDITABLE_PROP_SELECTION_BOUND")]
PropSelectionBound,
#[doc(alias = "GTK_EDITABLE_PROP_EDITABLE")]
PropEditable,
#[doc(alias = "GTK_EDITABLE_PROP_WIDTH_CHARS")]
PropWidthChars,
#[doc(alias = "GTK_EDITABLE_PROP_MAX_WIDTH_CHARS")]
PropMaxWidthChars,
#[doc(alias = "GTK_EDITABLE_PROP_XALIGN")]
PropXalign,
#[doc(alias = "GTK_EDITABLE_PROP_ENABLE_UNDO")]
PropEnableUndo,
#[doc(alias = "GTK_EDITABLE_NUM_PROPERTIES")]
NumProperties,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for EditableProperties {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"EditableProperties::{}",
match *self {
Self::PropText => "PropText",
Self::PropCursorPosition => "PropCursorPosition",
Self::PropSelectionBound => "PropSelectionBound",
Self::PropEditable => "PropEditable",
Self::PropWidthChars => "PropWidthChars",
Self::PropMaxWidthChars => "PropMaxWidthChars",
Self::PropXalign => "PropXalign",
Self::PropEnableUndo => "PropEnableUndo",
Self::NumProperties => "NumProperties",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for EditableProperties {
type GlibType = ffi::GtkEditableProperties;
#[inline]
fn into_glib(self) -> ffi::GtkEditableProperties {
match self {
Self::PropText => ffi::GTK_EDITABLE_PROP_TEXT,
Self::PropCursorPosition => ffi::GTK_EDITABLE_PROP_CURSOR_POSITION,
Self::PropSelectionBound => ffi::GTK_EDITABLE_PROP_SELECTION_BOUND,
Self::PropEditable => ffi::GTK_EDITABLE_PROP_EDITABLE,
Self::PropWidthChars => ffi::GTK_EDITABLE_PROP_WIDTH_CHARS,
Self::PropMaxWidthChars => ffi::GTK_EDITABLE_PROP_MAX_WIDTH_CHARS,
Self::PropXalign => ffi::GTK_EDITABLE_PROP_XALIGN,
Self::PropEnableUndo => ffi::GTK_EDITABLE_PROP_ENABLE_UNDO,
Self::NumProperties => ffi::GTK_EDITABLE_NUM_PROPERTIES,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkEditableProperties> for EditableProperties {
#[inline]
unsafe fn from_glib(value: ffi::GtkEditableProperties) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_EDITABLE_PROP_TEXT => Self::PropText,
ffi::GTK_EDITABLE_PROP_CURSOR_POSITION => Self::PropCursorPosition,
ffi::GTK_EDITABLE_PROP_SELECTION_BOUND => Self::PropSelectionBound,
ffi::GTK_EDITABLE_PROP_EDITABLE => Self::PropEditable,
ffi::GTK_EDITABLE_PROP_WIDTH_CHARS => Self::PropWidthChars,
ffi::GTK_EDITABLE_PROP_MAX_WIDTH_CHARS => Self::PropMaxWidthChars,
ffi::GTK_EDITABLE_PROP_XALIGN => Self::PropXalign,
ffi::GTK_EDITABLE_PROP_ENABLE_UNDO => Self::PropEnableUndo,
ffi::GTK_EDITABLE_NUM_PROPERTIES => Self::NumProperties,
value => Self::__Unknown(value),
}
}
}
impl StaticType for EditableProperties {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_editable_properties_get_type()) }
}
}
impl glib::HasParamSpec for EditableProperties {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for EditableProperties {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for EditableProperties {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for EditableProperties {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<EditableProperties> for glib::Value {
#[inline]
fn from(v: EditableProperties) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkEntryIconPosition")]
pub enum EntryIconPosition {
#[doc(alias = "GTK_ENTRY_ICON_PRIMARY")]
Primary,
#[doc(alias = "GTK_ENTRY_ICON_SECONDARY")]
Secondary,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for EntryIconPosition {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"EntryIconPosition::{}",
match *self {
Self::Primary => "Primary",
Self::Secondary => "Secondary",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for EntryIconPosition {
type GlibType = ffi::GtkEntryIconPosition;
#[inline]
fn into_glib(self) -> ffi::GtkEntryIconPosition {
match self {
Self::Primary => ffi::GTK_ENTRY_ICON_PRIMARY,
Self::Secondary => ffi::GTK_ENTRY_ICON_SECONDARY,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkEntryIconPosition> for EntryIconPosition {
#[inline]
unsafe fn from_glib(value: ffi::GtkEntryIconPosition) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ENTRY_ICON_PRIMARY => Self::Primary,
ffi::GTK_ENTRY_ICON_SECONDARY => Self::Secondary,
value => Self::__Unknown(value),
}
}
}
impl StaticType for EntryIconPosition {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_entry_icon_position_get_type()) }
}
}
impl glib::HasParamSpec for EntryIconPosition {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for EntryIconPosition {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for EntryIconPosition {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for EntryIconPosition {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<EntryIconPosition> for glib::Value {
#[inline]
fn from(v: EntryIconPosition) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkEventSequenceState")]
pub enum EventSequenceState {
#[doc(alias = "GTK_EVENT_SEQUENCE_NONE")]
None,
#[doc(alias = "GTK_EVENT_SEQUENCE_CLAIMED")]
Claimed,
#[doc(alias = "GTK_EVENT_SEQUENCE_DENIED")]
Denied,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for EventSequenceState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"EventSequenceState::{}",
match *self {
Self::None => "None",
Self::Claimed => "Claimed",
Self::Denied => "Denied",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for EventSequenceState {
type GlibType = ffi::GtkEventSequenceState;
#[inline]
fn into_glib(self) -> ffi::GtkEventSequenceState {
match self {
Self::None => ffi::GTK_EVENT_SEQUENCE_NONE,
Self::Claimed => ffi::GTK_EVENT_SEQUENCE_CLAIMED,
Self::Denied => ffi::GTK_EVENT_SEQUENCE_DENIED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkEventSequenceState> for EventSequenceState {
#[inline]
unsafe fn from_glib(value: ffi::GtkEventSequenceState) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_EVENT_SEQUENCE_NONE => Self::None,
ffi::GTK_EVENT_SEQUENCE_CLAIMED => Self::Claimed,
ffi::GTK_EVENT_SEQUENCE_DENIED => Self::Denied,
value => Self::__Unknown(value),
}
}
}
impl StaticType for EventSequenceState {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_event_sequence_state_get_type()) }
}
}
impl glib::HasParamSpec for EventSequenceState {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for EventSequenceState {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for EventSequenceState {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for EventSequenceState {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<EventSequenceState> for glib::Value {
#[inline]
fn from(v: EventSequenceState) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkFileChooserAction")]
pub enum FileChooserAction {
#[doc(alias = "GTK_FILE_CHOOSER_ACTION_OPEN")]
Open,
#[doc(alias = "GTK_FILE_CHOOSER_ACTION_SAVE")]
Save,
#[doc(alias = "GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER")]
SelectFolder,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for FileChooserAction {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FileChooserAction::{}",
match *self {
Self::Open => "Open",
Self::Save => "Save",
Self::SelectFolder => "SelectFolder",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for FileChooserAction {
type GlibType = ffi::GtkFileChooserAction;
#[inline]
fn into_glib(self) -> ffi::GtkFileChooserAction {
match self {
Self::Open => ffi::GTK_FILE_CHOOSER_ACTION_OPEN,
Self::Save => ffi::GTK_FILE_CHOOSER_ACTION_SAVE,
Self::SelectFolder => ffi::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkFileChooserAction> for FileChooserAction {
#[inline]
unsafe fn from_glib(value: ffi::GtkFileChooserAction) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_FILE_CHOOSER_ACTION_OPEN => Self::Open,
ffi::GTK_FILE_CHOOSER_ACTION_SAVE => Self::Save,
ffi::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER => Self::SelectFolder,
value => Self::__Unknown(value),
}
}
}
impl StaticType for FileChooserAction {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_file_chooser_action_get_type()) }
}
}
impl glib::HasParamSpec for FileChooserAction {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for FileChooserAction {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for FileChooserAction {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for FileChooserAction {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<FileChooserAction> for glib::Value {
#[inline]
fn from(v: FileChooserAction) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkFileChooserError")]
pub enum FileChooserError {
#[doc(alias = "GTK_FILE_CHOOSER_ERROR_NONEXISTENT")]
Nonexistent,
#[doc(alias = "GTK_FILE_CHOOSER_ERROR_BAD_FILENAME")]
BadFilename,
#[doc(alias = "GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS")]
AlreadyExists,
#[doc(alias = "GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME")]
IncompleteHostname,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for FileChooserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FileChooserError::{}",
match *self {
Self::Nonexistent => "Nonexistent",
Self::BadFilename => "BadFilename",
Self::AlreadyExists => "AlreadyExists",
Self::IncompleteHostname => "IncompleteHostname",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for FileChooserError {
type GlibType = ffi::GtkFileChooserError;
#[inline]
fn into_glib(self) -> ffi::GtkFileChooserError {
match self {
Self::Nonexistent => ffi::GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
Self::BadFilename => ffi::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
Self::AlreadyExists => ffi::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS,
Self::IncompleteHostname => ffi::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkFileChooserError> for FileChooserError {
#[inline]
unsafe fn from_glib(value: ffi::GtkFileChooserError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_FILE_CHOOSER_ERROR_NONEXISTENT => Self::Nonexistent,
ffi::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME => Self::BadFilename,
ffi::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS => Self::AlreadyExists,
ffi::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME => Self::IncompleteHostname,
value => Self::__Unknown(value),
}
}
}
impl ErrorDomain for FileChooserError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_file_chooser_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
value => Some(value),
}
}
}
impl StaticType for FileChooserError {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_file_chooser_error_get_type()) }
}
}
impl glib::HasParamSpec for FileChooserError {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for FileChooserError {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for FileChooserError {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for FileChooserError {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<FileChooserError> for glib::Value {
#[inline]
fn from(v: FileChooserError) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkFilterChange")]
pub enum FilterChange {
#[doc(alias = "GTK_FILTER_CHANGE_DIFFERENT")]
Different,
#[doc(alias = "GTK_FILTER_CHANGE_LESS_STRICT")]
LessStrict,
#[doc(alias = "GTK_FILTER_CHANGE_MORE_STRICT")]
MoreStrict,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for FilterChange {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FilterChange::{}",
match *self {
Self::Different => "Different",
Self::LessStrict => "LessStrict",
Self::MoreStrict => "MoreStrict",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for FilterChange {
type GlibType = ffi::GtkFilterChange;
#[inline]
fn into_glib(self) -> ffi::GtkFilterChange {
match self {
Self::Different => ffi::GTK_FILTER_CHANGE_DIFFERENT,
Self::LessStrict => ffi::GTK_FILTER_CHANGE_LESS_STRICT,
Self::MoreStrict => ffi::GTK_FILTER_CHANGE_MORE_STRICT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkFilterChange> for FilterChange {
#[inline]
unsafe fn from_glib(value: ffi::GtkFilterChange) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_FILTER_CHANGE_DIFFERENT => Self::Different,
ffi::GTK_FILTER_CHANGE_LESS_STRICT => Self::LessStrict,
ffi::GTK_FILTER_CHANGE_MORE_STRICT => Self::MoreStrict,
value => Self::__Unknown(value),
}
}
}
impl StaticType for FilterChange {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_filter_change_get_type()) }
}
}
impl glib::HasParamSpec for FilterChange {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for FilterChange {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for FilterChange {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for FilterChange {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<FilterChange> for glib::Value {
#[inline]
fn from(v: FilterChange) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkFilterMatch")]
pub enum FilterMatch {
#[doc(alias = "GTK_FILTER_MATCH_SOME")]
Some,
#[doc(alias = "GTK_FILTER_MATCH_NONE")]
None,
#[doc(alias = "GTK_FILTER_MATCH_ALL")]
All,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for FilterMatch {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FilterMatch::{}",
match *self {
Self::Some => "Some",
Self::None => "None",
Self::All => "All",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for FilterMatch {
type GlibType = ffi::GtkFilterMatch;
#[inline]
fn into_glib(self) -> ffi::GtkFilterMatch {
match self {
Self::Some => ffi::GTK_FILTER_MATCH_SOME,
Self::None => ffi::GTK_FILTER_MATCH_NONE,
Self::All => ffi::GTK_FILTER_MATCH_ALL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkFilterMatch> for FilterMatch {
#[inline]
unsafe fn from_glib(value: ffi::GtkFilterMatch) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_FILTER_MATCH_SOME => Self::Some,
ffi::GTK_FILTER_MATCH_NONE => Self::None,
ffi::GTK_FILTER_MATCH_ALL => Self::All,
value => Self::__Unknown(value),
}
}
}
impl StaticType for FilterMatch {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_filter_match_get_type()) }
}
}
impl glib::HasParamSpec for FilterMatch {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for FilterMatch {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for FilterMatch {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for FilterMatch {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<FilterMatch> for glib::Value {
#[inline]
fn from(v: FilterMatch) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkFontLevel")]
pub enum FontLevel {
#[doc(alias = "GTK_FONT_LEVEL_FAMILY")]
Family,
#[doc(alias = "GTK_FONT_LEVEL_FACE")]
Face,
#[doc(alias = "GTK_FONT_LEVEL_FONT")]
Font,
#[doc(alias = "GTK_FONT_LEVEL_FEATURES")]
Features,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl fmt::Display for FontLevel {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"FontLevel::{}",
match *self {
Self::Family => "Family",
Self::Face => "Face",
Self::Font => "Font",
Self::Features => "Features",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl IntoGlib for FontLevel {
type GlibType = ffi::GtkFontLevel;
#[inline]
fn into_glib(self) -> ffi::GtkFontLevel {
match self {
Self::Family => ffi::GTK_FONT_LEVEL_FAMILY,
Self::Face => ffi::GTK_FONT_LEVEL_FACE,
Self::Font => ffi::GTK_FONT_LEVEL_FONT,
Self::Features => ffi::GTK_FONT_LEVEL_FEATURES,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkFontLevel> for FontLevel {
#[inline]
unsafe fn from_glib(value: ffi::GtkFontLevel) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_FONT_LEVEL_FAMILY => Self::Family,
ffi::GTK_FONT_LEVEL_FACE => Self::Face,
ffi::GTK_FONT_LEVEL_FONT => Self::Font,
ffi::GTK_FONT_LEVEL_FEATURES => Self::Features,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl StaticType for FontLevel {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_font_level_get_type()) }
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::HasParamSpec for FontLevel {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl glib::value::ValueType for FontLevel {
type Type = Self;
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
unsafe impl<'a> FromValue<'a> for FontLevel {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl ToValue for FontLevel {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_10")))]
impl From<FontLevel> for glib::Value {
#[inline]
fn from(v: FontLevel) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkIconSize")]
pub enum IconSize {
#[doc(alias = "GTK_ICON_SIZE_INHERIT")]
Inherit,
#[doc(alias = "GTK_ICON_SIZE_NORMAL")]
Normal,
#[doc(alias = "GTK_ICON_SIZE_LARGE")]
Large,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for IconSize {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"IconSize::{}",
match *self {
Self::Inherit => "Inherit",
Self::Normal => "Normal",
Self::Large => "Large",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for IconSize {
type GlibType = ffi::GtkIconSize;
#[inline]
fn into_glib(self) -> ffi::GtkIconSize {
match self {
Self::Inherit => ffi::GTK_ICON_SIZE_INHERIT,
Self::Normal => ffi::GTK_ICON_SIZE_NORMAL,
Self::Large => ffi::GTK_ICON_SIZE_LARGE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkIconSize> for IconSize {
#[inline]
unsafe fn from_glib(value: ffi::GtkIconSize) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ICON_SIZE_INHERIT => Self::Inherit,
ffi::GTK_ICON_SIZE_NORMAL => Self::Normal,
ffi::GTK_ICON_SIZE_LARGE => Self::Large,
value => Self::__Unknown(value),
}
}
}
impl StaticType for IconSize {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_icon_size_get_type()) }
}
}
impl glib::HasParamSpec for IconSize {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for IconSize {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for IconSize {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for IconSize {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<IconSize> for glib::Value {
#[inline]
fn from(v: IconSize) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkIconThemeError")]
pub enum IconThemeError {
#[doc(alias = "GTK_ICON_THEME_NOT_FOUND")]
NotFound,
#[doc(alias = "GTK_ICON_THEME_FAILED")]
Failed,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for IconThemeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"IconThemeError::{}",
match *self {
Self::NotFound => "NotFound",
Self::Failed => "Failed",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for IconThemeError {
type GlibType = ffi::GtkIconThemeError;
#[inline]
fn into_glib(self) -> ffi::GtkIconThemeError {
match self {
Self::NotFound => ffi::GTK_ICON_THEME_NOT_FOUND,
Self::Failed => ffi::GTK_ICON_THEME_FAILED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkIconThemeError> for IconThemeError {
#[inline]
unsafe fn from_glib(value: ffi::GtkIconThemeError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ICON_THEME_NOT_FOUND => Self::NotFound,
ffi::GTK_ICON_THEME_FAILED => Self::Failed,
value => Self::__Unknown(value),
}
}
}
impl ErrorDomain for IconThemeError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_icon_theme_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
Self::__Unknown(_) => Some(Self::Failed),
value => Some(value),
}
}
}
impl StaticType for IconThemeError {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_icon_theme_error_get_type()) }
}
}
impl glib::HasParamSpec for IconThemeError {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for IconThemeError {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for IconThemeError {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for IconThemeError {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<IconThemeError> for glib::Value {
#[inline]
fn from(v: IconThemeError) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkIconViewDropPosition")]
pub enum IconViewDropPosition {
#[doc(alias = "GTK_ICON_VIEW_NO_DROP")]
NoDrop,
#[doc(alias = "GTK_ICON_VIEW_DROP_INTO")]
DropInto,
#[doc(alias = "GTK_ICON_VIEW_DROP_LEFT")]
DropLeft,
#[doc(alias = "GTK_ICON_VIEW_DROP_RIGHT")]
DropRight,
#[doc(alias = "GTK_ICON_VIEW_DROP_ABOVE")]
DropAbove,
#[doc(alias = "GTK_ICON_VIEW_DROP_BELOW")]
DropBelow,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for IconViewDropPosition {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"IconViewDropPosition::{}",
match *self {
Self::NoDrop => "NoDrop",
Self::DropInto => "DropInto",
Self::DropLeft => "DropLeft",
Self::DropRight => "DropRight",
Self::DropAbove => "DropAbove",
Self::DropBelow => "DropBelow",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for IconViewDropPosition {
type GlibType = ffi::GtkIconViewDropPosition;
#[inline]
fn into_glib(self) -> ffi::GtkIconViewDropPosition {
match self {
Self::NoDrop => ffi::GTK_ICON_VIEW_NO_DROP,
Self::DropInto => ffi::GTK_ICON_VIEW_DROP_INTO,
Self::DropLeft => ffi::GTK_ICON_VIEW_DROP_LEFT,
Self::DropRight => ffi::GTK_ICON_VIEW_DROP_RIGHT,
Self::DropAbove => ffi::GTK_ICON_VIEW_DROP_ABOVE,
Self::DropBelow => ffi::GTK_ICON_VIEW_DROP_BELOW,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkIconViewDropPosition> for IconViewDropPosition {
#[inline]
unsafe fn from_glib(value: ffi::GtkIconViewDropPosition) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ICON_VIEW_NO_DROP => Self::NoDrop,
ffi::GTK_ICON_VIEW_DROP_INTO => Self::DropInto,
ffi::GTK_ICON_VIEW_DROP_LEFT => Self::DropLeft,
ffi::GTK_ICON_VIEW_DROP_RIGHT => Self::DropRight,
ffi::GTK_ICON_VIEW_DROP_ABOVE => Self::DropAbove,
ffi::GTK_ICON_VIEW_DROP_BELOW => Self::DropBelow,
value => Self::__Unknown(value),
}
}
}
impl StaticType for IconViewDropPosition {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_icon_view_drop_position_get_type()) }
}
}
impl glib::HasParamSpec for IconViewDropPosition {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for IconViewDropPosition {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for IconViewDropPosition {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for IconViewDropPosition {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<IconViewDropPosition> for glib::Value {
#[inline]
fn from(v: IconViewDropPosition) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkImageType")]
pub enum ImageType {
#[doc(alias = "GTK_IMAGE_EMPTY")]
Empty,
#[doc(alias = "GTK_IMAGE_ICON_NAME")]
IconName,
#[doc(alias = "GTK_IMAGE_GICON")]
Gicon,
#[doc(alias = "GTK_IMAGE_PAINTABLE")]
Paintable,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ImageType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ImageType::{}",
match *self {
Self::Empty => "Empty",
Self::IconName => "IconName",
Self::Gicon => "Gicon",
Self::Paintable => "Paintable",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ImageType {
type GlibType = ffi::GtkImageType;
#[inline]
fn into_glib(self) -> ffi::GtkImageType {
match self {
Self::Empty => ffi::GTK_IMAGE_EMPTY,
Self::IconName => ffi::GTK_IMAGE_ICON_NAME,
Self::Gicon => ffi::GTK_IMAGE_GICON,
Self::Paintable => ffi::GTK_IMAGE_PAINTABLE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkImageType> for ImageType {
#[inline]
unsafe fn from_glib(value: ffi::GtkImageType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_IMAGE_EMPTY => Self::Empty,
ffi::GTK_IMAGE_ICON_NAME => Self::IconName,
ffi::GTK_IMAGE_GICON => Self::Gicon,
ffi::GTK_IMAGE_PAINTABLE => Self::Paintable,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ImageType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_image_type_get_type()) }
}
}
impl glib::HasParamSpec for ImageType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ImageType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ImageType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ImageType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ImageType> for glib::Value {
#[inline]
fn from(v: ImageType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkInputPurpose")]
pub enum InputPurpose {
#[doc(alias = "GTK_INPUT_PURPOSE_FREE_FORM")]
FreeForm,
#[doc(alias = "GTK_INPUT_PURPOSE_ALPHA")]
Alpha,
#[doc(alias = "GTK_INPUT_PURPOSE_DIGITS")]
Digits,
#[doc(alias = "GTK_INPUT_PURPOSE_NUMBER")]
Number,
#[doc(alias = "GTK_INPUT_PURPOSE_PHONE")]
Phone,
#[doc(alias = "GTK_INPUT_PURPOSE_URL")]
Url,
#[doc(alias = "GTK_INPUT_PURPOSE_EMAIL")]
Email,
#[doc(alias = "GTK_INPUT_PURPOSE_NAME")]
Name,
#[doc(alias = "GTK_INPUT_PURPOSE_PASSWORD")]
Password,
#[doc(alias = "GTK_INPUT_PURPOSE_PIN")]
Pin,
#[doc(alias = "GTK_INPUT_PURPOSE_TERMINAL")]
Terminal,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for InputPurpose {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"InputPurpose::{}",
match *self {
Self::FreeForm => "FreeForm",
Self::Alpha => "Alpha",
Self::Digits => "Digits",
Self::Number => "Number",
Self::Phone => "Phone",
Self::Url => "Url",
Self::Email => "Email",
Self::Name => "Name",
Self::Password => "Password",
Self::Pin => "Pin",
Self::Terminal => "Terminal",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for InputPurpose {
type GlibType = ffi::GtkInputPurpose;
#[inline]
fn into_glib(self) -> ffi::GtkInputPurpose {
match self {
Self::FreeForm => ffi::GTK_INPUT_PURPOSE_FREE_FORM,
Self::Alpha => ffi::GTK_INPUT_PURPOSE_ALPHA,
Self::Digits => ffi::GTK_INPUT_PURPOSE_DIGITS,
Self::Number => ffi::GTK_INPUT_PURPOSE_NUMBER,
Self::Phone => ffi::GTK_INPUT_PURPOSE_PHONE,
Self::Url => ffi::GTK_INPUT_PURPOSE_URL,
Self::Email => ffi::GTK_INPUT_PURPOSE_EMAIL,
Self::Name => ffi::GTK_INPUT_PURPOSE_NAME,
Self::Password => ffi::GTK_INPUT_PURPOSE_PASSWORD,
Self::Pin => ffi::GTK_INPUT_PURPOSE_PIN,
Self::Terminal => ffi::GTK_INPUT_PURPOSE_TERMINAL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkInputPurpose> for InputPurpose {
#[inline]
unsafe fn from_glib(value: ffi::GtkInputPurpose) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_INPUT_PURPOSE_FREE_FORM => Self::FreeForm,
ffi::GTK_INPUT_PURPOSE_ALPHA => Self::Alpha,
ffi::GTK_INPUT_PURPOSE_DIGITS => Self::Digits,
ffi::GTK_INPUT_PURPOSE_NUMBER => Self::Number,
ffi::GTK_INPUT_PURPOSE_PHONE => Self::Phone,
ffi::GTK_INPUT_PURPOSE_URL => Self::Url,
ffi::GTK_INPUT_PURPOSE_EMAIL => Self::Email,
ffi::GTK_INPUT_PURPOSE_NAME => Self::Name,
ffi::GTK_INPUT_PURPOSE_PASSWORD => Self::Password,
ffi::GTK_INPUT_PURPOSE_PIN => Self::Pin,
ffi::GTK_INPUT_PURPOSE_TERMINAL => Self::Terminal,
value => Self::__Unknown(value),
}
}
}
impl StaticType for InputPurpose {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_input_purpose_get_type()) }
}
}
impl glib::HasParamSpec for InputPurpose {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for InputPurpose {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for InputPurpose {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for InputPurpose {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<InputPurpose> for glib::Value {
#[inline]
fn from(v: InputPurpose) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkInscriptionOverflow")]
pub enum InscriptionOverflow {
#[doc(alias = "GTK_INSCRIPTION_OVERFLOW_CLIP")]
Clip,
#[doc(alias = "GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START")]
EllipsizeStart,
#[doc(alias = "GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE")]
EllipsizeMiddle,
#[doc(alias = "GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END")]
EllipsizeEnd,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl fmt::Display for InscriptionOverflow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"InscriptionOverflow::{}",
match *self {
Self::Clip => "Clip",
Self::EllipsizeStart => "EllipsizeStart",
Self::EllipsizeMiddle => "EllipsizeMiddle",
Self::EllipsizeEnd => "EllipsizeEnd",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
#[doc(hidden)]
impl IntoGlib for InscriptionOverflow {
type GlibType = ffi::GtkInscriptionOverflow;
#[inline]
fn into_glib(self) -> ffi::GtkInscriptionOverflow {
match self {
Self::Clip => ffi::GTK_INSCRIPTION_OVERFLOW_CLIP,
Self::EllipsizeStart => ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START,
Self::EllipsizeMiddle => ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE,
Self::EllipsizeEnd => ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkInscriptionOverflow> for InscriptionOverflow {
#[inline]
unsafe fn from_glib(value: ffi::GtkInscriptionOverflow) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_INSCRIPTION_OVERFLOW_CLIP => Self::Clip,
ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START => Self::EllipsizeStart,
ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE => Self::EllipsizeMiddle,
ffi::GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END => Self::EllipsizeEnd,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl StaticType for InscriptionOverflow {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_inscription_overflow_get_type()) }
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl glib::HasParamSpec for InscriptionOverflow {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl glib::value::ValueType for InscriptionOverflow {
type Type = Self;
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
unsafe impl<'a> FromValue<'a> for InscriptionOverflow {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl ToValue for InscriptionOverflow {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_8", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_8")))]
impl From<InscriptionOverflow> for glib::Value {
#[inline]
fn from(v: InscriptionOverflow) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkJustification")]
pub enum Justification {
#[doc(alias = "GTK_JUSTIFY_LEFT")]
Left,
#[doc(alias = "GTK_JUSTIFY_RIGHT")]
Right,
#[doc(alias = "GTK_JUSTIFY_CENTER")]
Center,
#[doc(alias = "GTK_JUSTIFY_FILL")]
Fill,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for Justification {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Justification::{}",
match *self {
Self::Left => "Left",
Self::Right => "Right",
Self::Center => "Center",
Self::Fill => "Fill",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for Justification {
type GlibType = ffi::GtkJustification;
#[inline]
fn into_glib(self) -> ffi::GtkJustification {
match self {
Self::Left => ffi::GTK_JUSTIFY_LEFT,
Self::Right => ffi::GTK_JUSTIFY_RIGHT,
Self::Center => ffi::GTK_JUSTIFY_CENTER,
Self::Fill => ffi::GTK_JUSTIFY_FILL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkJustification> for Justification {
#[inline]
unsafe fn from_glib(value: ffi::GtkJustification) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_JUSTIFY_LEFT => Self::Left,
ffi::GTK_JUSTIFY_RIGHT => Self::Right,
ffi::GTK_JUSTIFY_CENTER => Self::Center,
ffi::GTK_JUSTIFY_FILL => Self::Fill,
value => Self::__Unknown(value),
}
}
}
impl StaticType for Justification {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_justification_get_type()) }
}
}
impl glib::HasParamSpec for Justification {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for Justification {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for Justification {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for Justification {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<Justification> for glib::Value {
#[inline]
fn from(v: Justification) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkLevelBarMode")]
pub enum LevelBarMode {
#[doc(alias = "GTK_LEVEL_BAR_MODE_CONTINUOUS")]
Continuous,
#[doc(alias = "GTK_LEVEL_BAR_MODE_DISCRETE")]
Discrete,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for LevelBarMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"LevelBarMode::{}",
match *self {
Self::Continuous => "Continuous",
Self::Discrete => "Discrete",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for LevelBarMode {
type GlibType = ffi::GtkLevelBarMode;
#[inline]
fn into_glib(self) -> ffi::GtkLevelBarMode {
match self {
Self::Continuous => ffi::GTK_LEVEL_BAR_MODE_CONTINUOUS,
Self::Discrete => ffi::GTK_LEVEL_BAR_MODE_DISCRETE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkLevelBarMode> for LevelBarMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkLevelBarMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_LEVEL_BAR_MODE_CONTINUOUS => Self::Continuous,
ffi::GTK_LEVEL_BAR_MODE_DISCRETE => Self::Discrete,
value => Self::__Unknown(value),
}
}
}
impl StaticType for LevelBarMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_level_bar_mode_get_type()) }
}
}
impl glib::HasParamSpec for LevelBarMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for LevelBarMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for LevelBarMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for LevelBarMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<LevelBarMode> for glib::Value {
#[inline]
fn from(v: LevelBarMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkLicense")]
pub enum License {
#[doc(alias = "GTK_LICENSE_UNKNOWN")]
Unknown,
#[doc(alias = "GTK_LICENSE_CUSTOM")]
Custom,
#[doc(alias = "GTK_LICENSE_GPL_2_0")]
Gpl20,
#[doc(alias = "GTK_LICENSE_GPL_3_0")]
Gpl30,
#[doc(alias = "GTK_LICENSE_LGPL_2_1")]
Lgpl21,
#[doc(alias = "GTK_LICENSE_LGPL_3_0")]
Lgpl30,
#[doc(alias = "GTK_LICENSE_BSD")]
Bsd,
#[doc(alias = "GTK_LICENSE_MIT_X11")]
MitX11,
#[doc(alias = "GTK_LICENSE_ARTISTIC")]
Artistic,
#[doc(alias = "GTK_LICENSE_GPL_2_0_ONLY")]
Gpl20Only,
#[doc(alias = "GTK_LICENSE_GPL_3_0_ONLY")]
Gpl30Only,
#[doc(alias = "GTK_LICENSE_LGPL_2_1_ONLY")]
Lgpl21Only,
#[doc(alias = "GTK_LICENSE_LGPL_3_0_ONLY")]
Lgpl30Only,
#[doc(alias = "GTK_LICENSE_AGPL_3_0")]
Agpl30,
#[doc(alias = "GTK_LICENSE_AGPL_3_0_ONLY")]
Agpl30Only,
#[doc(alias = "GTK_LICENSE_BSD_3")]
Bsd3,
#[doc(alias = "GTK_LICENSE_APACHE_2_0")]
Apache20,
#[doc(alias = "GTK_LICENSE_MPL_2_0")]
Mpl20,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for License {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"License::{}",
match *self {
Self::Unknown => "Unknown",
Self::Custom => "Custom",
Self::Gpl20 => "Gpl20",
Self::Gpl30 => "Gpl30",
Self::Lgpl21 => "Lgpl21",
Self::Lgpl30 => "Lgpl30",
Self::Bsd => "Bsd",
Self::MitX11 => "MitX11",
Self::Artistic => "Artistic",
Self::Gpl20Only => "Gpl20Only",
Self::Gpl30Only => "Gpl30Only",
Self::Lgpl21Only => "Lgpl21Only",
Self::Lgpl30Only => "Lgpl30Only",
Self::Agpl30 => "Agpl30",
Self::Agpl30Only => "Agpl30Only",
Self::Bsd3 => "Bsd3",
Self::Apache20 => "Apache20",
Self::Mpl20 => "Mpl20",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for License {
type GlibType = ffi::GtkLicense;
fn into_glib(self) -> ffi::GtkLicense {
match self {
Self::Unknown => ffi::GTK_LICENSE_UNKNOWN,
Self::Custom => ffi::GTK_LICENSE_CUSTOM,
Self::Gpl20 => ffi::GTK_LICENSE_GPL_2_0,
Self::Gpl30 => ffi::GTK_LICENSE_GPL_3_0,
Self::Lgpl21 => ffi::GTK_LICENSE_LGPL_2_1,
Self::Lgpl30 => ffi::GTK_LICENSE_LGPL_3_0,
Self::Bsd => ffi::GTK_LICENSE_BSD,
Self::MitX11 => ffi::GTK_LICENSE_MIT_X11,
Self::Artistic => ffi::GTK_LICENSE_ARTISTIC,
Self::Gpl20Only => ffi::GTK_LICENSE_GPL_2_0_ONLY,
Self::Gpl30Only => ffi::GTK_LICENSE_GPL_3_0_ONLY,
Self::Lgpl21Only => ffi::GTK_LICENSE_LGPL_2_1_ONLY,
Self::Lgpl30Only => ffi::GTK_LICENSE_LGPL_3_0_ONLY,
Self::Agpl30 => ffi::GTK_LICENSE_AGPL_3_0,
Self::Agpl30Only => ffi::GTK_LICENSE_AGPL_3_0_ONLY,
Self::Bsd3 => ffi::GTK_LICENSE_BSD_3,
Self::Apache20 => ffi::GTK_LICENSE_APACHE_2_0,
Self::Mpl20 => ffi::GTK_LICENSE_MPL_2_0,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkLicense> for License {
unsafe fn from_glib(value: ffi::GtkLicense) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_LICENSE_UNKNOWN => Self::Unknown,
ffi::GTK_LICENSE_CUSTOM => Self::Custom,
ffi::GTK_LICENSE_GPL_2_0 => Self::Gpl20,
ffi::GTK_LICENSE_GPL_3_0 => Self::Gpl30,
ffi::GTK_LICENSE_LGPL_2_1 => Self::Lgpl21,
ffi::GTK_LICENSE_LGPL_3_0 => Self::Lgpl30,
ffi::GTK_LICENSE_BSD => Self::Bsd,
ffi::GTK_LICENSE_MIT_X11 => Self::MitX11,
ffi::GTK_LICENSE_ARTISTIC => Self::Artistic,
ffi::GTK_LICENSE_GPL_2_0_ONLY => Self::Gpl20Only,
ffi::GTK_LICENSE_GPL_3_0_ONLY => Self::Gpl30Only,
ffi::GTK_LICENSE_LGPL_2_1_ONLY => Self::Lgpl21Only,
ffi::GTK_LICENSE_LGPL_3_0_ONLY => Self::Lgpl30Only,
ffi::GTK_LICENSE_AGPL_3_0 => Self::Agpl30,
ffi::GTK_LICENSE_AGPL_3_0_ONLY => Self::Agpl30Only,
ffi::GTK_LICENSE_BSD_3 => Self::Bsd3,
ffi::GTK_LICENSE_APACHE_2_0 => Self::Apache20,
ffi::GTK_LICENSE_MPL_2_0 => Self::Mpl20,
value => Self::__Unknown(value),
}
}
}
impl StaticType for License {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_license_get_type()) }
}
}
impl glib::HasParamSpec for License {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for License {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for License {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for License {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<License> for glib::Value {
#[inline]
fn from(v: License) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkMessageType")]
pub enum MessageType {
#[doc(alias = "GTK_MESSAGE_INFO")]
Info,
#[doc(alias = "GTK_MESSAGE_WARNING")]
Warning,
#[doc(alias = "GTK_MESSAGE_QUESTION")]
Question,
#[doc(alias = "GTK_MESSAGE_ERROR")]
Error,
#[doc(alias = "GTK_MESSAGE_OTHER")]
Other,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for MessageType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"MessageType::{}",
match *self {
Self::Info => "Info",
Self::Warning => "Warning",
Self::Question => "Question",
Self::Error => "Error",
Self::Other => "Other",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for MessageType {
type GlibType = ffi::GtkMessageType;
#[inline]
fn into_glib(self) -> ffi::GtkMessageType {
match self {
Self::Info => ffi::GTK_MESSAGE_INFO,
Self::Warning => ffi::GTK_MESSAGE_WARNING,
Self::Question => ffi::GTK_MESSAGE_QUESTION,
Self::Error => ffi::GTK_MESSAGE_ERROR,
Self::Other => ffi::GTK_MESSAGE_OTHER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkMessageType> for MessageType {
#[inline]
unsafe fn from_glib(value: ffi::GtkMessageType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_MESSAGE_INFO => Self::Info,
ffi::GTK_MESSAGE_WARNING => Self::Warning,
ffi::GTK_MESSAGE_QUESTION => Self::Question,
ffi::GTK_MESSAGE_ERROR => Self::Error,
ffi::GTK_MESSAGE_OTHER => Self::Other,
value => Self::__Unknown(value),
}
}
}
impl StaticType for MessageType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_message_type_get_type()) }
}
}
impl glib::HasParamSpec for MessageType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for MessageType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for MessageType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for MessageType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<MessageType> for glib::Value {
#[inline]
fn from(v: MessageType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkMovementStep")]
pub enum MovementStep {
#[doc(alias = "GTK_MOVEMENT_LOGICAL_POSITIONS")]
LogicalPositions,
#[doc(alias = "GTK_MOVEMENT_VISUAL_POSITIONS")]
VisualPositions,
#[doc(alias = "GTK_MOVEMENT_WORDS")]
Words,
#[doc(alias = "GTK_MOVEMENT_DISPLAY_LINES")]
DisplayLines,
#[doc(alias = "GTK_MOVEMENT_DISPLAY_LINE_ENDS")]
DisplayLineEnds,
#[doc(alias = "GTK_MOVEMENT_PARAGRAPHS")]
Paragraphs,
#[doc(alias = "GTK_MOVEMENT_PARAGRAPH_ENDS")]
ParagraphEnds,
#[doc(alias = "GTK_MOVEMENT_PAGES")]
Pages,
#[doc(alias = "GTK_MOVEMENT_BUFFER_ENDS")]
BufferEnds,
#[doc(alias = "GTK_MOVEMENT_HORIZONTAL_PAGES")]
HorizontalPages,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for MovementStep {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"MovementStep::{}",
match *self {
Self::LogicalPositions => "LogicalPositions",
Self::VisualPositions => "VisualPositions",
Self::Words => "Words",
Self::DisplayLines => "DisplayLines",
Self::DisplayLineEnds => "DisplayLineEnds",
Self::Paragraphs => "Paragraphs",
Self::ParagraphEnds => "ParagraphEnds",
Self::Pages => "Pages",
Self::BufferEnds => "BufferEnds",
Self::HorizontalPages => "HorizontalPages",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for MovementStep {
type GlibType = ffi::GtkMovementStep;
#[inline]
fn into_glib(self) -> ffi::GtkMovementStep {
match self {
Self::LogicalPositions => ffi::GTK_MOVEMENT_LOGICAL_POSITIONS,
Self::VisualPositions => ffi::GTK_MOVEMENT_VISUAL_POSITIONS,
Self::Words => ffi::GTK_MOVEMENT_WORDS,
Self::DisplayLines => ffi::GTK_MOVEMENT_DISPLAY_LINES,
Self::DisplayLineEnds => ffi::GTK_MOVEMENT_DISPLAY_LINE_ENDS,
Self::Paragraphs => ffi::GTK_MOVEMENT_PARAGRAPHS,
Self::ParagraphEnds => ffi::GTK_MOVEMENT_PARAGRAPH_ENDS,
Self::Pages => ffi::GTK_MOVEMENT_PAGES,
Self::BufferEnds => ffi::GTK_MOVEMENT_BUFFER_ENDS,
Self::HorizontalPages => ffi::GTK_MOVEMENT_HORIZONTAL_PAGES,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkMovementStep> for MovementStep {
#[inline]
unsafe fn from_glib(value: ffi::GtkMovementStep) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_MOVEMENT_LOGICAL_POSITIONS => Self::LogicalPositions,
ffi::GTK_MOVEMENT_VISUAL_POSITIONS => Self::VisualPositions,
ffi::GTK_MOVEMENT_WORDS => Self::Words,
ffi::GTK_MOVEMENT_DISPLAY_LINES => Self::DisplayLines,
ffi::GTK_MOVEMENT_DISPLAY_LINE_ENDS => Self::DisplayLineEnds,
ffi::GTK_MOVEMENT_PARAGRAPHS => Self::Paragraphs,
ffi::GTK_MOVEMENT_PARAGRAPH_ENDS => Self::ParagraphEnds,
ffi::GTK_MOVEMENT_PAGES => Self::Pages,
ffi::GTK_MOVEMENT_BUFFER_ENDS => Self::BufferEnds,
ffi::GTK_MOVEMENT_HORIZONTAL_PAGES => Self::HorizontalPages,
value => Self::__Unknown(value),
}
}
}
impl StaticType for MovementStep {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_movement_step_get_type()) }
}
}
impl glib::HasParamSpec for MovementStep {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for MovementStep {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for MovementStep {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for MovementStep {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<MovementStep> for glib::Value {
#[inline]
fn from(v: MovementStep) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkNaturalWrapMode")]
pub enum NaturalWrapMode {
#[doc(alias = "GTK_NATURAL_WRAP_INHERIT")]
Inherit,
#[doc(alias = "GTK_NATURAL_WRAP_NONE")]
None,
#[doc(alias = "GTK_NATURAL_WRAP_WORD")]
Word,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl fmt::Display for NaturalWrapMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"NaturalWrapMode::{}",
match *self {
Self::Inherit => "Inherit",
Self::None => "None",
Self::Word => "Word",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
#[doc(hidden)]
impl IntoGlib for NaturalWrapMode {
type GlibType = ffi::GtkNaturalWrapMode;
#[inline]
fn into_glib(self) -> ffi::GtkNaturalWrapMode {
match self {
Self::Inherit => ffi::GTK_NATURAL_WRAP_INHERIT,
Self::None => ffi::GTK_NATURAL_WRAP_NONE,
Self::Word => ffi::GTK_NATURAL_WRAP_WORD,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkNaturalWrapMode> for NaturalWrapMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkNaturalWrapMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_NATURAL_WRAP_INHERIT => Self::Inherit,
ffi::GTK_NATURAL_WRAP_NONE => Self::None,
ffi::GTK_NATURAL_WRAP_WORD => Self::Word,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl StaticType for NaturalWrapMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_natural_wrap_mode_get_type()) }
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl glib::HasParamSpec for NaturalWrapMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl glib::value::ValueType for NaturalWrapMode {
type Type = Self;
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
unsafe impl<'a> FromValue<'a> for NaturalWrapMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl ToValue for NaturalWrapMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl From<NaturalWrapMode> for glib::Value {
#[inline]
fn from(v: NaturalWrapMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkNotebookTab")]
pub enum NotebookTab {
#[doc(alias = "GTK_NOTEBOOK_TAB_FIRST")]
First,
#[doc(alias = "GTK_NOTEBOOK_TAB_LAST")]
Last,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for NotebookTab {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"NotebookTab::{}",
match *self {
Self::First => "First",
Self::Last => "Last",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for NotebookTab {
type GlibType = ffi::GtkNotebookTab;
#[inline]
fn into_glib(self) -> ffi::GtkNotebookTab {
match self {
Self::First => ffi::GTK_NOTEBOOK_TAB_FIRST,
Self::Last => ffi::GTK_NOTEBOOK_TAB_LAST,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkNotebookTab> for NotebookTab {
#[inline]
unsafe fn from_glib(value: ffi::GtkNotebookTab) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_NOTEBOOK_TAB_FIRST => Self::First,
ffi::GTK_NOTEBOOK_TAB_LAST => Self::Last,
value => Self::__Unknown(value),
}
}
}
impl StaticType for NotebookTab {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_notebook_tab_get_type()) }
}
}
impl glib::HasParamSpec for NotebookTab {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for NotebookTab {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for NotebookTab {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for NotebookTab {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<NotebookTab> for glib::Value {
#[inline]
fn from(v: NotebookTab) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkNumberUpLayout")]
pub enum NumberUpLayout {
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM")]
Lrtb,
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP")]
Lrbt,
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM")]
Rltb,
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP")]
Rlbt,
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT")]
Tblr,
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT")]
Tbrl,
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT")]
Btlr,
#[doc(alias = "GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT")]
Btrl,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for NumberUpLayout {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"NumberUpLayout::{}",
match *self {
Self::Lrtb => "Lrtb",
Self::Lrbt => "Lrbt",
Self::Rltb => "Rltb",
Self::Rlbt => "Rlbt",
Self::Tblr => "Tblr",
Self::Tbrl => "Tbrl",
Self::Btlr => "Btlr",
Self::Btrl => "Btrl",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for NumberUpLayout {
type GlibType = ffi::GtkNumberUpLayout;
#[inline]
fn into_glib(self) -> ffi::GtkNumberUpLayout {
match self {
Self::Lrtb => ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM,
Self::Lrbt => ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP,
Self::Rltb => ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM,
Self::Rlbt => ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP,
Self::Tblr => ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT,
Self::Tbrl => ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT,
Self::Btlr => ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT,
Self::Btrl => ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkNumberUpLayout> for NumberUpLayout {
#[inline]
unsafe fn from_glib(value: ffi::GtkNumberUpLayout) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM => Self::Lrtb,
ffi::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP => Self::Lrbt,
ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM => Self::Rltb,
ffi::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP => Self::Rlbt,
ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT => Self::Tblr,
ffi::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT => Self::Tbrl,
ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT => Self::Btlr,
ffi::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT => Self::Btrl,
value => Self::__Unknown(value),
}
}
}
impl StaticType for NumberUpLayout {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_number_up_layout_get_type()) }
}
}
impl glib::HasParamSpec for NumberUpLayout {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for NumberUpLayout {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for NumberUpLayout {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for NumberUpLayout {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<NumberUpLayout> for glib::Value {
#[inline]
fn from(v: NumberUpLayout) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkOrdering")]
pub enum Ordering {
#[doc(alias = "GTK_ORDERING_SMALLER")]
Smaller,
#[doc(alias = "GTK_ORDERING_EQUAL")]
Equal,
#[doc(alias = "GTK_ORDERING_LARGER")]
Larger,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for Ordering {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Ordering::{}",
match *self {
Self::Smaller => "Smaller",
Self::Equal => "Equal",
Self::Larger => "Larger",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for Ordering {
type GlibType = ffi::GtkOrdering;
#[inline]
fn into_glib(self) -> ffi::GtkOrdering {
match self {
Self::Smaller => ffi::GTK_ORDERING_SMALLER,
Self::Equal => ffi::GTK_ORDERING_EQUAL,
Self::Larger => ffi::GTK_ORDERING_LARGER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkOrdering> for Ordering {
#[inline]
unsafe fn from_glib(value: ffi::GtkOrdering) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ORDERING_SMALLER => Self::Smaller,
ffi::GTK_ORDERING_EQUAL => Self::Equal,
ffi::GTK_ORDERING_LARGER => Self::Larger,
value => Self::__Unknown(value),
}
}
}
impl StaticType for Ordering {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_ordering_get_type()) }
}
}
impl glib::HasParamSpec for Ordering {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for Ordering {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for Ordering {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for Ordering {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<Ordering> for glib::Value {
#[inline]
fn from(v: Ordering) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkOrientation")]
pub enum Orientation {
#[doc(alias = "GTK_ORIENTATION_HORIZONTAL")]
Horizontal,
#[doc(alias = "GTK_ORIENTATION_VERTICAL")]
Vertical,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for Orientation {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Orientation::{}",
match *self {
Self::Horizontal => "Horizontal",
Self::Vertical => "Vertical",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for Orientation {
type GlibType = ffi::GtkOrientation;
#[inline]
fn into_glib(self) -> ffi::GtkOrientation {
match self {
Self::Horizontal => ffi::GTK_ORIENTATION_HORIZONTAL,
Self::Vertical => ffi::GTK_ORIENTATION_VERTICAL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkOrientation> for Orientation {
#[inline]
unsafe fn from_glib(value: ffi::GtkOrientation) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_ORIENTATION_HORIZONTAL => Self::Horizontal,
ffi::GTK_ORIENTATION_VERTICAL => Self::Vertical,
value => Self::__Unknown(value),
}
}
}
impl StaticType for Orientation {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_orientation_get_type()) }
}
}
impl glib::HasParamSpec for Orientation {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for Orientation {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for Orientation {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for Orientation {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<Orientation> for glib::Value {
#[inline]
fn from(v: Orientation) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkOverflow")]
pub enum Overflow {
#[doc(alias = "GTK_OVERFLOW_VISIBLE")]
Visible,
#[doc(alias = "GTK_OVERFLOW_HIDDEN")]
Hidden,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for Overflow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Overflow::{}",
match *self {
Self::Visible => "Visible",
Self::Hidden => "Hidden",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for Overflow {
type GlibType = ffi::GtkOverflow;
#[inline]
fn into_glib(self) -> ffi::GtkOverflow {
match self {
Self::Visible => ffi::GTK_OVERFLOW_VISIBLE,
Self::Hidden => ffi::GTK_OVERFLOW_HIDDEN,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkOverflow> for Overflow {
#[inline]
unsafe fn from_glib(value: ffi::GtkOverflow) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_OVERFLOW_VISIBLE => Self::Visible,
ffi::GTK_OVERFLOW_HIDDEN => Self::Hidden,
value => Self::__Unknown(value),
}
}
}
impl StaticType for Overflow {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_overflow_get_type()) }
}
}
impl glib::HasParamSpec for Overflow {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for Overflow {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for Overflow {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for Overflow {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<Overflow> for glib::Value {
#[inline]
fn from(v: Overflow) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPackType")]
pub enum PackType {
#[doc(alias = "GTK_PACK_START")]
Start,
#[doc(alias = "GTK_PACK_END")]
End,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PackType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PackType::{}",
match *self {
Self::Start => "Start",
Self::End => "End",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PackType {
type GlibType = ffi::GtkPackType;
#[inline]
fn into_glib(self) -> ffi::GtkPackType {
match self {
Self::Start => ffi::GTK_PACK_START,
Self::End => ffi::GTK_PACK_END,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPackType> for PackType {
#[inline]
unsafe fn from_glib(value: ffi::GtkPackType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PACK_START => Self::Start,
ffi::GTK_PACK_END => Self::End,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PackType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_pack_type_get_type()) }
}
}
impl glib::HasParamSpec for PackType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PackType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PackType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PackType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PackType> for glib::Value {
#[inline]
fn from(v: PackType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPadActionType")]
pub enum PadActionType {
#[doc(alias = "GTK_PAD_ACTION_BUTTON")]
Button,
#[doc(alias = "GTK_PAD_ACTION_RING")]
Ring,
#[doc(alias = "GTK_PAD_ACTION_STRIP")]
Strip,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PadActionType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PadActionType::{}",
match *self {
Self::Button => "Button",
Self::Ring => "Ring",
Self::Strip => "Strip",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PadActionType {
type GlibType = ffi::GtkPadActionType;
#[inline]
fn into_glib(self) -> ffi::GtkPadActionType {
match self {
Self::Button => ffi::GTK_PAD_ACTION_BUTTON,
Self::Ring => ffi::GTK_PAD_ACTION_RING,
Self::Strip => ffi::GTK_PAD_ACTION_STRIP,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPadActionType> for PadActionType {
#[inline]
unsafe fn from_glib(value: ffi::GtkPadActionType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PAD_ACTION_BUTTON => Self::Button,
ffi::GTK_PAD_ACTION_RING => Self::Ring,
ffi::GTK_PAD_ACTION_STRIP => Self::Strip,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PadActionType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_pad_action_type_get_type()) }
}
}
impl glib::HasParamSpec for PadActionType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PadActionType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PadActionType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PadActionType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PadActionType> for glib::Value {
#[inline]
fn from(v: PadActionType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPageOrientation")]
pub enum PageOrientation {
#[doc(alias = "GTK_PAGE_ORIENTATION_PORTRAIT")]
Portrait,
#[doc(alias = "GTK_PAGE_ORIENTATION_LANDSCAPE")]
Landscape,
#[doc(alias = "GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT")]
ReversePortrait,
#[doc(alias = "GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE")]
ReverseLandscape,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PageOrientation {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PageOrientation::{}",
match *self {
Self::Portrait => "Portrait",
Self::Landscape => "Landscape",
Self::ReversePortrait => "ReversePortrait",
Self::ReverseLandscape => "ReverseLandscape",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PageOrientation {
type GlibType = ffi::GtkPageOrientation;
#[inline]
fn into_glib(self) -> ffi::GtkPageOrientation {
match self {
Self::Portrait => ffi::GTK_PAGE_ORIENTATION_PORTRAIT,
Self::Landscape => ffi::GTK_PAGE_ORIENTATION_LANDSCAPE,
Self::ReversePortrait => ffi::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT,
Self::ReverseLandscape => ffi::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPageOrientation> for PageOrientation {
#[inline]
unsafe fn from_glib(value: ffi::GtkPageOrientation) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PAGE_ORIENTATION_PORTRAIT => Self::Portrait,
ffi::GTK_PAGE_ORIENTATION_LANDSCAPE => Self::Landscape,
ffi::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT => Self::ReversePortrait,
ffi::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE => Self::ReverseLandscape,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PageOrientation {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_page_orientation_get_type()) }
}
}
impl glib::HasParamSpec for PageOrientation {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PageOrientation {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PageOrientation {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PageOrientation {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PageOrientation> for glib::Value {
#[inline]
fn from(v: PageOrientation) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPageSet")]
pub enum PageSet {
#[doc(alias = "GTK_PAGE_SET_ALL")]
All,
#[doc(alias = "GTK_PAGE_SET_EVEN")]
Even,
#[doc(alias = "GTK_PAGE_SET_ODD")]
Odd,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PageSet {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PageSet::{}",
match *self {
Self::All => "All",
Self::Even => "Even",
Self::Odd => "Odd",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PageSet {
type GlibType = ffi::GtkPageSet;
#[inline]
fn into_glib(self) -> ffi::GtkPageSet {
match self {
Self::All => ffi::GTK_PAGE_SET_ALL,
Self::Even => ffi::GTK_PAGE_SET_EVEN,
Self::Odd => ffi::GTK_PAGE_SET_ODD,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPageSet> for PageSet {
#[inline]
unsafe fn from_glib(value: ffi::GtkPageSet) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PAGE_SET_ALL => Self::All,
ffi::GTK_PAGE_SET_EVEN => Self::Even,
ffi::GTK_PAGE_SET_ODD => Self::Odd,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PageSet {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_page_set_get_type()) }
}
}
impl glib::HasParamSpec for PageSet {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PageSet {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PageSet {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PageSet {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PageSet> for glib::Value {
#[inline]
fn from(v: PageSet) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPanDirection")]
pub enum PanDirection {
#[doc(alias = "GTK_PAN_DIRECTION_LEFT")]
Left,
#[doc(alias = "GTK_PAN_DIRECTION_RIGHT")]
Right,
#[doc(alias = "GTK_PAN_DIRECTION_UP")]
Up,
#[doc(alias = "GTK_PAN_DIRECTION_DOWN")]
Down,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PanDirection {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PanDirection::{}",
match *self {
Self::Left => "Left",
Self::Right => "Right",
Self::Up => "Up",
Self::Down => "Down",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PanDirection {
type GlibType = ffi::GtkPanDirection;
#[inline]
fn into_glib(self) -> ffi::GtkPanDirection {
match self {
Self::Left => ffi::GTK_PAN_DIRECTION_LEFT,
Self::Right => ffi::GTK_PAN_DIRECTION_RIGHT,
Self::Up => ffi::GTK_PAN_DIRECTION_UP,
Self::Down => ffi::GTK_PAN_DIRECTION_DOWN,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPanDirection> for PanDirection {
#[inline]
unsafe fn from_glib(value: ffi::GtkPanDirection) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PAN_DIRECTION_LEFT => Self::Left,
ffi::GTK_PAN_DIRECTION_RIGHT => Self::Right,
ffi::GTK_PAN_DIRECTION_UP => Self::Up,
ffi::GTK_PAN_DIRECTION_DOWN => Self::Down,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PanDirection {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_pan_direction_get_type()) }
}
}
impl glib::HasParamSpec for PanDirection {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PanDirection {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PanDirection {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PanDirection {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PanDirection> for glib::Value {
#[inline]
fn from(v: PanDirection) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPolicyType")]
pub enum PolicyType {
#[doc(alias = "GTK_POLICY_ALWAYS")]
Always,
#[doc(alias = "GTK_POLICY_AUTOMATIC")]
Automatic,
#[doc(alias = "GTK_POLICY_NEVER")]
Never,
#[doc(alias = "GTK_POLICY_EXTERNAL")]
External,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PolicyType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PolicyType::{}",
match *self {
Self::Always => "Always",
Self::Automatic => "Automatic",
Self::Never => "Never",
Self::External => "External",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PolicyType {
type GlibType = ffi::GtkPolicyType;
#[inline]
fn into_glib(self) -> ffi::GtkPolicyType {
match self {
Self::Always => ffi::GTK_POLICY_ALWAYS,
Self::Automatic => ffi::GTK_POLICY_AUTOMATIC,
Self::Never => ffi::GTK_POLICY_NEVER,
Self::External => ffi::GTK_POLICY_EXTERNAL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPolicyType> for PolicyType {
#[inline]
unsafe fn from_glib(value: ffi::GtkPolicyType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_POLICY_ALWAYS => Self::Always,
ffi::GTK_POLICY_AUTOMATIC => Self::Automatic,
ffi::GTK_POLICY_NEVER => Self::Never,
ffi::GTK_POLICY_EXTERNAL => Self::External,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PolicyType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_policy_type_get_type()) }
}
}
impl glib::HasParamSpec for PolicyType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PolicyType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PolicyType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PolicyType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PolicyType> for glib::Value {
#[inline]
fn from(v: PolicyType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPositionType")]
pub enum PositionType {
#[doc(alias = "GTK_POS_LEFT")]
Left,
#[doc(alias = "GTK_POS_RIGHT")]
Right,
#[doc(alias = "GTK_POS_TOP")]
Top,
#[doc(alias = "GTK_POS_BOTTOM")]
Bottom,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PositionType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PositionType::{}",
match *self {
Self::Left => "Left",
Self::Right => "Right",
Self::Top => "Top",
Self::Bottom => "Bottom",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PositionType {
type GlibType = ffi::GtkPositionType;
#[inline]
fn into_glib(self) -> ffi::GtkPositionType {
match self {
Self::Left => ffi::GTK_POS_LEFT,
Self::Right => ffi::GTK_POS_RIGHT,
Self::Top => ffi::GTK_POS_TOP,
Self::Bottom => ffi::GTK_POS_BOTTOM,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPositionType> for PositionType {
#[inline]
unsafe fn from_glib(value: ffi::GtkPositionType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_POS_LEFT => Self::Left,
ffi::GTK_POS_RIGHT => Self::Right,
ffi::GTK_POS_TOP => Self::Top,
ffi::GTK_POS_BOTTOM => Self::Bottom,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PositionType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_position_type_get_type()) }
}
}
impl glib::HasParamSpec for PositionType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PositionType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PositionType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PositionType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PositionType> for glib::Value {
#[inline]
fn from(v: PositionType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPrintDuplex")]
pub enum PrintDuplex {
#[doc(alias = "GTK_PRINT_DUPLEX_SIMPLEX")]
Simplex,
#[doc(alias = "GTK_PRINT_DUPLEX_HORIZONTAL")]
Horizontal,
#[doc(alias = "GTK_PRINT_DUPLEX_VERTICAL")]
Vertical,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PrintDuplex {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PrintDuplex::{}",
match *self {
Self::Simplex => "Simplex",
Self::Horizontal => "Horizontal",
Self::Vertical => "Vertical",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PrintDuplex {
type GlibType = ffi::GtkPrintDuplex;
#[inline]
fn into_glib(self) -> ffi::GtkPrintDuplex {
match self {
Self::Simplex => ffi::GTK_PRINT_DUPLEX_SIMPLEX,
Self::Horizontal => ffi::GTK_PRINT_DUPLEX_HORIZONTAL,
Self::Vertical => ffi::GTK_PRINT_DUPLEX_VERTICAL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPrintDuplex> for PrintDuplex {
#[inline]
unsafe fn from_glib(value: ffi::GtkPrintDuplex) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PRINT_DUPLEX_SIMPLEX => Self::Simplex,
ffi::GTK_PRINT_DUPLEX_HORIZONTAL => Self::Horizontal,
ffi::GTK_PRINT_DUPLEX_VERTICAL => Self::Vertical,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PrintDuplex {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_print_duplex_get_type()) }
}
}
impl glib::HasParamSpec for PrintDuplex {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PrintDuplex {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PrintDuplex {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PrintDuplex {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PrintDuplex> for glib::Value {
#[inline]
fn from(v: PrintDuplex) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPrintError")]
pub enum PrintError {
#[doc(alias = "GTK_PRINT_ERROR_GENERAL")]
General,
#[doc(alias = "GTK_PRINT_ERROR_INTERNAL_ERROR")]
InternalError,
#[doc(alias = "GTK_PRINT_ERROR_NOMEM")]
Nomem,
#[doc(alias = "GTK_PRINT_ERROR_INVALID_FILE")]
InvalidFile,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PrintError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PrintError::{}",
match *self {
Self::General => "General",
Self::InternalError => "InternalError",
Self::Nomem => "Nomem",
Self::InvalidFile => "InvalidFile",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PrintError {
type GlibType = ffi::GtkPrintError;
#[inline]
fn into_glib(self) -> ffi::GtkPrintError {
match self {
Self::General => ffi::GTK_PRINT_ERROR_GENERAL,
Self::InternalError => ffi::GTK_PRINT_ERROR_INTERNAL_ERROR,
Self::Nomem => ffi::GTK_PRINT_ERROR_NOMEM,
Self::InvalidFile => ffi::GTK_PRINT_ERROR_INVALID_FILE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPrintError> for PrintError {
#[inline]
unsafe fn from_glib(value: ffi::GtkPrintError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PRINT_ERROR_GENERAL => Self::General,
ffi::GTK_PRINT_ERROR_INTERNAL_ERROR => Self::InternalError,
ffi::GTK_PRINT_ERROR_NOMEM => Self::Nomem,
ffi::GTK_PRINT_ERROR_INVALID_FILE => Self::InvalidFile,
value => Self::__Unknown(value),
}
}
}
impl ErrorDomain for PrintError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_print_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
value => Some(value),
}
}
}
impl StaticType for PrintError {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_print_error_get_type()) }
}
}
impl glib::HasParamSpec for PrintError {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PrintError {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PrintError {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PrintError {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PrintError> for glib::Value {
#[inline]
fn from(v: PrintError) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPrintOperationAction")]
pub enum PrintOperationAction {
#[doc(alias = "GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG")]
PrintDialog,
#[doc(alias = "GTK_PRINT_OPERATION_ACTION_PRINT")]
Print,
#[doc(alias = "GTK_PRINT_OPERATION_ACTION_PREVIEW")]
Preview,
#[doc(alias = "GTK_PRINT_OPERATION_ACTION_EXPORT")]
Export,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PrintOperationAction {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PrintOperationAction::{}",
match *self {
Self::PrintDialog => "PrintDialog",
Self::Print => "Print",
Self::Preview => "Preview",
Self::Export => "Export",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PrintOperationAction {
type GlibType = ffi::GtkPrintOperationAction;
#[inline]
fn into_glib(self) -> ffi::GtkPrintOperationAction {
match self {
Self::PrintDialog => ffi::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
Self::Print => ffi::GTK_PRINT_OPERATION_ACTION_PRINT,
Self::Preview => ffi::GTK_PRINT_OPERATION_ACTION_PREVIEW,
Self::Export => ffi::GTK_PRINT_OPERATION_ACTION_EXPORT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPrintOperationAction> for PrintOperationAction {
#[inline]
unsafe fn from_glib(value: ffi::GtkPrintOperationAction) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG => Self::PrintDialog,
ffi::GTK_PRINT_OPERATION_ACTION_PRINT => Self::Print,
ffi::GTK_PRINT_OPERATION_ACTION_PREVIEW => Self::Preview,
ffi::GTK_PRINT_OPERATION_ACTION_EXPORT => Self::Export,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PrintOperationAction {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_print_operation_action_get_type()) }
}
}
impl glib::HasParamSpec for PrintOperationAction {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PrintOperationAction {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PrintOperationAction {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PrintOperationAction {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PrintOperationAction> for glib::Value {
#[inline]
fn from(v: PrintOperationAction) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPrintOperationResult")]
pub enum PrintOperationResult {
#[doc(alias = "GTK_PRINT_OPERATION_RESULT_ERROR")]
Error,
#[doc(alias = "GTK_PRINT_OPERATION_RESULT_APPLY")]
Apply,
#[doc(alias = "GTK_PRINT_OPERATION_RESULT_CANCEL")]
Cancel,
#[doc(alias = "GTK_PRINT_OPERATION_RESULT_IN_PROGRESS")]
InProgress,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PrintOperationResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PrintOperationResult::{}",
match *self {
Self::Error => "Error",
Self::Apply => "Apply",
Self::Cancel => "Cancel",
Self::InProgress => "InProgress",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PrintOperationResult {
type GlibType = ffi::GtkPrintOperationResult;
#[inline]
fn into_glib(self) -> ffi::GtkPrintOperationResult {
match self {
Self::Error => ffi::GTK_PRINT_OPERATION_RESULT_ERROR,
Self::Apply => ffi::GTK_PRINT_OPERATION_RESULT_APPLY,
Self::Cancel => ffi::GTK_PRINT_OPERATION_RESULT_CANCEL,
Self::InProgress => ffi::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPrintOperationResult> for PrintOperationResult {
#[inline]
unsafe fn from_glib(value: ffi::GtkPrintOperationResult) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PRINT_OPERATION_RESULT_ERROR => Self::Error,
ffi::GTK_PRINT_OPERATION_RESULT_APPLY => Self::Apply,
ffi::GTK_PRINT_OPERATION_RESULT_CANCEL => Self::Cancel,
ffi::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS => Self::InProgress,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PrintOperationResult {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_print_operation_result_get_type()) }
}
}
impl glib::HasParamSpec for PrintOperationResult {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PrintOperationResult {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PrintOperationResult {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PrintOperationResult {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PrintOperationResult> for glib::Value {
#[inline]
fn from(v: PrintOperationResult) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPrintPages")]
pub enum PrintPages {
#[doc(alias = "GTK_PRINT_PAGES_ALL")]
All,
#[doc(alias = "GTK_PRINT_PAGES_CURRENT")]
Current,
#[doc(alias = "GTK_PRINT_PAGES_RANGES")]
Ranges,
#[doc(alias = "GTK_PRINT_PAGES_SELECTION")]
Selection,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PrintPages {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PrintPages::{}",
match *self {
Self::All => "All",
Self::Current => "Current",
Self::Ranges => "Ranges",
Self::Selection => "Selection",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PrintPages {
type GlibType = ffi::GtkPrintPages;
#[inline]
fn into_glib(self) -> ffi::GtkPrintPages {
match self {
Self::All => ffi::GTK_PRINT_PAGES_ALL,
Self::Current => ffi::GTK_PRINT_PAGES_CURRENT,
Self::Ranges => ffi::GTK_PRINT_PAGES_RANGES,
Self::Selection => ffi::GTK_PRINT_PAGES_SELECTION,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPrintPages> for PrintPages {
#[inline]
unsafe fn from_glib(value: ffi::GtkPrintPages) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PRINT_PAGES_ALL => Self::All,
ffi::GTK_PRINT_PAGES_CURRENT => Self::Current,
ffi::GTK_PRINT_PAGES_RANGES => Self::Ranges,
ffi::GTK_PRINT_PAGES_SELECTION => Self::Selection,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PrintPages {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_print_pages_get_type()) }
}
}
impl glib::HasParamSpec for PrintPages {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PrintPages {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PrintPages {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PrintPages {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PrintPages> for glib::Value {
#[inline]
fn from(v: PrintPages) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPrintQuality")]
pub enum PrintQuality {
#[doc(alias = "GTK_PRINT_QUALITY_LOW")]
Low,
#[doc(alias = "GTK_PRINT_QUALITY_NORMAL")]
Normal,
#[doc(alias = "GTK_PRINT_QUALITY_HIGH")]
High,
#[doc(alias = "GTK_PRINT_QUALITY_DRAFT")]
Draft,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PrintQuality {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PrintQuality::{}",
match *self {
Self::Low => "Low",
Self::Normal => "Normal",
Self::High => "High",
Self::Draft => "Draft",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PrintQuality {
type GlibType = ffi::GtkPrintQuality;
#[inline]
fn into_glib(self) -> ffi::GtkPrintQuality {
match self {
Self::Low => ffi::GTK_PRINT_QUALITY_LOW,
Self::Normal => ffi::GTK_PRINT_QUALITY_NORMAL,
Self::High => ffi::GTK_PRINT_QUALITY_HIGH,
Self::Draft => ffi::GTK_PRINT_QUALITY_DRAFT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPrintQuality> for PrintQuality {
#[inline]
unsafe fn from_glib(value: ffi::GtkPrintQuality) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PRINT_QUALITY_LOW => Self::Low,
ffi::GTK_PRINT_QUALITY_NORMAL => Self::Normal,
ffi::GTK_PRINT_QUALITY_HIGH => Self::High,
ffi::GTK_PRINT_QUALITY_DRAFT => Self::Draft,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PrintQuality {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_print_quality_get_type()) }
}
}
impl glib::HasParamSpec for PrintQuality {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PrintQuality {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PrintQuality {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PrintQuality {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PrintQuality> for glib::Value {
#[inline]
fn from(v: PrintQuality) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPrintStatus")]
pub enum PrintStatus {
#[doc(alias = "GTK_PRINT_STATUS_INITIAL")]
Initial,
#[doc(alias = "GTK_PRINT_STATUS_PREPARING")]
Preparing,
#[doc(alias = "GTK_PRINT_STATUS_GENERATING_DATA")]
GeneratingData,
#[doc(alias = "GTK_PRINT_STATUS_SENDING_DATA")]
SendingData,
#[doc(alias = "GTK_PRINT_STATUS_PENDING")]
Pending,
#[doc(alias = "GTK_PRINT_STATUS_PENDING_ISSUE")]
PendingIssue,
#[doc(alias = "GTK_PRINT_STATUS_PRINTING")]
Printing,
#[doc(alias = "GTK_PRINT_STATUS_FINISHED")]
Finished,
#[doc(alias = "GTK_PRINT_STATUS_FINISHED_ABORTED")]
FinishedAborted,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PrintStatus {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PrintStatus::{}",
match *self {
Self::Initial => "Initial",
Self::Preparing => "Preparing",
Self::GeneratingData => "GeneratingData",
Self::SendingData => "SendingData",
Self::Pending => "Pending",
Self::PendingIssue => "PendingIssue",
Self::Printing => "Printing",
Self::Finished => "Finished",
Self::FinishedAborted => "FinishedAborted",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PrintStatus {
type GlibType = ffi::GtkPrintStatus;
#[inline]
fn into_glib(self) -> ffi::GtkPrintStatus {
match self {
Self::Initial => ffi::GTK_PRINT_STATUS_INITIAL,
Self::Preparing => ffi::GTK_PRINT_STATUS_PREPARING,
Self::GeneratingData => ffi::GTK_PRINT_STATUS_GENERATING_DATA,
Self::SendingData => ffi::GTK_PRINT_STATUS_SENDING_DATA,
Self::Pending => ffi::GTK_PRINT_STATUS_PENDING,
Self::PendingIssue => ffi::GTK_PRINT_STATUS_PENDING_ISSUE,
Self::Printing => ffi::GTK_PRINT_STATUS_PRINTING,
Self::Finished => ffi::GTK_PRINT_STATUS_FINISHED,
Self::FinishedAborted => ffi::GTK_PRINT_STATUS_FINISHED_ABORTED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPrintStatus> for PrintStatus {
#[inline]
unsafe fn from_glib(value: ffi::GtkPrintStatus) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PRINT_STATUS_INITIAL => Self::Initial,
ffi::GTK_PRINT_STATUS_PREPARING => Self::Preparing,
ffi::GTK_PRINT_STATUS_GENERATING_DATA => Self::GeneratingData,
ffi::GTK_PRINT_STATUS_SENDING_DATA => Self::SendingData,
ffi::GTK_PRINT_STATUS_PENDING => Self::Pending,
ffi::GTK_PRINT_STATUS_PENDING_ISSUE => Self::PendingIssue,
ffi::GTK_PRINT_STATUS_PRINTING => Self::Printing,
ffi::GTK_PRINT_STATUS_FINISHED => Self::Finished,
ffi::GTK_PRINT_STATUS_FINISHED_ABORTED => Self::FinishedAborted,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PrintStatus {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_print_status_get_type()) }
}
}
impl glib::HasParamSpec for PrintStatus {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PrintStatus {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PrintStatus {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PrintStatus {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PrintStatus> for glib::Value {
#[inline]
fn from(v: PrintStatus) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPropagationLimit")]
pub enum PropagationLimit {
#[doc(alias = "GTK_LIMIT_NONE")]
None,
#[doc(alias = "GTK_LIMIT_SAME_NATIVE")]
SameNative,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PropagationLimit {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PropagationLimit::{}",
match *self {
Self::None => "None",
Self::SameNative => "SameNative",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PropagationLimit {
type GlibType = ffi::GtkPropagationLimit;
#[inline]
fn into_glib(self) -> ffi::GtkPropagationLimit {
match self {
Self::None => ffi::GTK_LIMIT_NONE,
Self::SameNative => ffi::GTK_LIMIT_SAME_NATIVE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPropagationLimit> for PropagationLimit {
#[inline]
unsafe fn from_glib(value: ffi::GtkPropagationLimit) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_LIMIT_NONE => Self::None,
ffi::GTK_LIMIT_SAME_NATIVE => Self::SameNative,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PropagationLimit {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_propagation_limit_get_type()) }
}
}
impl glib::HasParamSpec for PropagationLimit {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PropagationLimit {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PropagationLimit {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PropagationLimit {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PropagationLimit> for glib::Value {
#[inline]
fn from(v: PropagationLimit) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkPropagationPhase")]
pub enum PropagationPhase {
#[doc(alias = "GTK_PHASE_NONE")]
None,
#[doc(alias = "GTK_PHASE_CAPTURE")]
Capture,
#[doc(alias = "GTK_PHASE_BUBBLE")]
Bubble,
#[doc(alias = "GTK_PHASE_TARGET")]
Target,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for PropagationPhase {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PropagationPhase::{}",
match *self {
Self::None => "None",
Self::Capture => "Capture",
Self::Bubble => "Bubble",
Self::Target => "Target",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for PropagationPhase {
type GlibType = ffi::GtkPropagationPhase;
#[inline]
fn into_glib(self) -> ffi::GtkPropagationPhase {
match self {
Self::None => ffi::GTK_PHASE_NONE,
Self::Capture => ffi::GTK_PHASE_CAPTURE,
Self::Bubble => ffi::GTK_PHASE_BUBBLE,
Self::Target => ffi::GTK_PHASE_TARGET,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkPropagationPhase> for PropagationPhase {
#[inline]
unsafe fn from_glib(value: ffi::GtkPropagationPhase) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_PHASE_NONE => Self::None,
ffi::GTK_PHASE_CAPTURE => Self::Capture,
ffi::GTK_PHASE_BUBBLE => Self::Bubble,
ffi::GTK_PHASE_TARGET => Self::Target,
value => Self::__Unknown(value),
}
}
}
impl StaticType for PropagationPhase {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_propagation_phase_get_type()) }
}
}
impl glib::HasParamSpec for PropagationPhase {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for PropagationPhase {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for PropagationPhase {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for PropagationPhase {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<PropagationPhase> for glib::Value {
#[inline]
fn from(v: PropagationPhase) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkRecentManagerError")]
pub enum RecentManagerError {
#[doc(alias = "GTK_RECENT_MANAGER_ERROR_NOT_FOUND")]
NotFound,
#[doc(alias = "GTK_RECENT_MANAGER_ERROR_INVALID_URI")]
InvalidUri,
#[doc(alias = "GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING")]
InvalidEncoding,
#[doc(alias = "GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED")]
NotRegistered,
#[doc(alias = "GTK_RECENT_MANAGER_ERROR_READ")]
Read,
#[doc(alias = "GTK_RECENT_MANAGER_ERROR_WRITE")]
Write,
#[doc(alias = "GTK_RECENT_MANAGER_ERROR_UNKNOWN")]
Unknown,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for RecentManagerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"RecentManagerError::{}",
match *self {
Self::NotFound => "NotFound",
Self::InvalidUri => "InvalidUri",
Self::InvalidEncoding => "InvalidEncoding",
Self::NotRegistered => "NotRegistered",
Self::Read => "Read",
Self::Write => "Write",
Self::Unknown => "Unknown",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for RecentManagerError {
type GlibType = ffi::GtkRecentManagerError;
#[inline]
fn into_glib(self) -> ffi::GtkRecentManagerError {
match self {
Self::NotFound => ffi::GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
Self::InvalidUri => ffi::GTK_RECENT_MANAGER_ERROR_INVALID_URI,
Self::InvalidEncoding => ffi::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
Self::NotRegistered => ffi::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
Self::Read => ffi::GTK_RECENT_MANAGER_ERROR_READ,
Self::Write => ffi::GTK_RECENT_MANAGER_ERROR_WRITE,
Self::Unknown => ffi::GTK_RECENT_MANAGER_ERROR_UNKNOWN,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkRecentManagerError> for RecentManagerError {
#[inline]
unsafe fn from_glib(value: ffi::GtkRecentManagerError) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_RECENT_MANAGER_ERROR_NOT_FOUND => Self::NotFound,
ffi::GTK_RECENT_MANAGER_ERROR_INVALID_URI => Self::InvalidUri,
ffi::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING => Self::InvalidEncoding,
ffi::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED => Self::NotRegistered,
ffi::GTK_RECENT_MANAGER_ERROR_READ => Self::Read,
ffi::GTK_RECENT_MANAGER_ERROR_WRITE => Self::Write,
ffi::GTK_RECENT_MANAGER_ERROR_UNKNOWN => Self::Unknown,
value => Self::__Unknown(value),
}
}
}
impl ErrorDomain for RecentManagerError {
#[inline]
fn domain() -> Quark {
skip_assert_initialized!();
unsafe { from_glib(ffi::gtk_recent_manager_error_quark()) }
}
#[inline]
fn code(self) -> i32 {
self.into_glib()
}
#[inline]
#[allow(clippy::match_single_binding)]
fn from(code: i32) -> Option<Self> {
skip_assert_initialized!();
match unsafe { from_glib(code) } {
value => Some(value),
}
}
}
impl StaticType for RecentManagerError {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_recent_manager_error_get_type()) }
}
}
impl glib::HasParamSpec for RecentManagerError {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for RecentManagerError {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for RecentManagerError {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for RecentManagerError {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<RecentManagerError> for glib::Value {
#[inline]
fn from(v: RecentManagerError) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkRevealerTransitionType")]
pub enum RevealerTransitionType {
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_NONE")]
None,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_CROSSFADE")]
Crossfade,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT")]
SlideRight,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT")]
SlideLeft,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP")]
SlideUp,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN")]
SlideDown,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT")]
SwingRight,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT")]
SwingLeft,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_UP")]
SwingUp,
#[doc(alias = "GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN")]
SwingDown,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for RevealerTransitionType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"RevealerTransitionType::{}",
match *self {
Self::None => "None",
Self::Crossfade => "Crossfade",
Self::SlideRight => "SlideRight",
Self::SlideLeft => "SlideLeft",
Self::SlideUp => "SlideUp",
Self::SlideDown => "SlideDown",
Self::SwingRight => "SwingRight",
Self::SwingLeft => "SwingLeft",
Self::SwingUp => "SwingUp",
Self::SwingDown => "SwingDown",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for RevealerTransitionType {
type GlibType = ffi::GtkRevealerTransitionType;
#[inline]
fn into_glib(self) -> ffi::GtkRevealerTransitionType {
match self {
Self::None => ffi::GTK_REVEALER_TRANSITION_TYPE_NONE,
Self::Crossfade => ffi::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE,
Self::SlideRight => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT,
Self::SlideLeft => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT,
Self::SlideUp => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP,
Self::SlideDown => ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN,
Self::SwingRight => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT,
Self::SwingLeft => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT,
Self::SwingUp => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_UP,
Self::SwingDown => ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkRevealerTransitionType> for RevealerTransitionType {
#[inline]
unsafe fn from_glib(value: ffi::GtkRevealerTransitionType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_REVEALER_TRANSITION_TYPE_NONE => Self::None,
ffi::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT => Self::SlideRight,
ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT => Self::SlideLeft,
ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP => Self::SlideUp,
ffi::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN => Self::SlideDown,
ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT => Self::SwingRight,
ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT => Self::SwingLeft,
ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_UP => Self::SwingUp,
ffi::GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN => Self::SwingDown,
value => Self::__Unknown(value),
}
}
}
impl StaticType for RevealerTransitionType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_revealer_transition_type_get_type()) }
}
}
impl glib::HasParamSpec for RevealerTransitionType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for RevealerTransitionType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for RevealerTransitionType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for RevealerTransitionType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<RevealerTransitionType> for glib::Value {
#[inline]
fn from(v: RevealerTransitionType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkScrollStep")]
pub enum ScrollStep {
#[doc(alias = "GTK_SCROLL_STEPS")]
Steps,
#[doc(alias = "GTK_SCROLL_PAGES")]
Pages,
#[doc(alias = "GTK_SCROLL_ENDS")]
Ends,
#[doc(alias = "GTK_SCROLL_HORIZONTAL_STEPS")]
HorizontalSteps,
#[doc(alias = "GTK_SCROLL_HORIZONTAL_PAGES")]
HorizontalPages,
#[doc(alias = "GTK_SCROLL_HORIZONTAL_ENDS")]
HorizontalEnds,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ScrollStep {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ScrollStep::{}",
match *self {
Self::Steps => "Steps",
Self::Pages => "Pages",
Self::Ends => "Ends",
Self::HorizontalSteps => "HorizontalSteps",
Self::HorizontalPages => "HorizontalPages",
Self::HorizontalEnds => "HorizontalEnds",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ScrollStep {
type GlibType = ffi::GtkScrollStep;
#[inline]
fn into_glib(self) -> ffi::GtkScrollStep {
match self {
Self::Steps => ffi::GTK_SCROLL_STEPS,
Self::Pages => ffi::GTK_SCROLL_PAGES,
Self::Ends => ffi::GTK_SCROLL_ENDS,
Self::HorizontalSteps => ffi::GTK_SCROLL_HORIZONTAL_STEPS,
Self::HorizontalPages => ffi::GTK_SCROLL_HORIZONTAL_PAGES,
Self::HorizontalEnds => ffi::GTK_SCROLL_HORIZONTAL_ENDS,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkScrollStep> for ScrollStep {
#[inline]
unsafe fn from_glib(value: ffi::GtkScrollStep) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SCROLL_STEPS => Self::Steps,
ffi::GTK_SCROLL_PAGES => Self::Pages,
ffi::GTK_SCROLL_ENDS => Self::Ends,
ffi::GTK_SCROLL_HORIZONTAL_STEPS => Self::HorizontalSteps,
ffi::GTK_SCROLL_HORIZONTAL_PAGES => Self::HorizontalPages,
ffi::GTK_SCROLL_HORIZONTAL_ENDS => Self::HorizontalEnds,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ScrollStep {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_scroll_step_get_type()) }
}
}
impl glib::HasParamSpec for ScrollStep {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ScrollStep {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ScrollStep {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ScrollStep {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ScrollStep> for glib::Value {
#[inline]
fn from(v: ScrollStep) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkScrollType")]
pub enum ScrollType {
#[doc(alias = "GTK_SCROLL_NONE")]
None,
#[doc(alias = "GTK_SCROLL_JUMP")]
Jump,
#[doc(alias = "GTK_SCROLL_STEP_BACKWARD")]
StepBackward,
#[doc(alias = "GTK_SCROLL_STEP_FORWARD")]
StepForward,
#[doc(alias = "GTK_SCROLL_PAGE_BACKWARD")]
PageBackward,
#[doc(alias = "GTK_SCROLL_PAGE_FORWARD")]
PageForward,
#[doc(alias = "GTK_SCROLL_STEP_UP")]
StepUp,
#[doc(alias = "GTK_SCROLL_STEP_DOWN")]
StepDown,
#[doc(alias = "GTK_SCROLL_PAGE_UP")]
PageUp,
#[doc(alias = "GTK_SCROLL_PAGE_DOWN")]
PageDown,
#[doc(alias = "GTK_SCROLL_STEP_LEFT")]
StepLeft,
#[doc(alias = "GTK_SCROLL_STEP_RIGHT")]
StepRight,
#[doc(alias = "GTK_SCROLL_PAGE_LEFT")]
PageLeft,
#[doc(alias = "GTK_SCROLL_PAGE_RIGHT")]
PageRight,
#[doc(alias = "GTK_SCROLL_START")]
Start,
#[doc(alias = "GTK_SCROLL_END")]
End,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ScrollType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ScrollType::{}",
match *self {
Self::None => "None",
Self::Jump => "Jump",
Self::StepBackward => "StepBackward",
Self::StepForward => "StepForward",
Self::PageBackward => "PageBackward",
Self::PageForward => "PageForward",
Self::StepUp => "StepUp",
Self::StepDown => "StepDown",
Self::PageUp => "PageUp",
Self::PageDown => "PageDown",
Self::StepLeft => "StepLeft",
Self::StepRight => "StepRight",
Self::PageLeft => "PageLeft",
Self::PageRight => "PageRight",
Self::Start => "Start",
Self::End => "End",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ScrollType {
type GlibType = ffi::GtkScrollType;
fn into_glib(self) -> ffi::GtkScrollType {
match self {
Self::None => ffi::GTK_SCROLL_NONE,
Self::Jump => ffi::GTK_SCROLL_JUMP,
Self::StepBackward => ffi::GTK_SCROLL_STEP_BACKWARD,
Self::StepForward => ffi::GTK_SCROLL_STEP_FORWARD,
Self::PageBackward => ffi::GTK_SCROLL_PAGE_BACKWARD,
Self::PageForward => ffi::GTK_SCROLL_PAGE_FORWARD,
Self::StepUp => ffi::GTK_SCROLL_STEP_UP,
Self::StepDown => ffi::GTK_SCROLL_STEP_DOWN,
Self::PageUp => ffi::GTK_SCROLL_PAGE_UP,
Self::PageDown => ffi::GTK_SCROLL_PAGE_DOWN,
Self::StepLeft => ffi::GTK_SCROLL_STEP_LEFT,
Self::StepRight => ffi::GTK_SCROLL_STEP_RIGHT,
Self::PageLeft => ffi::GTK_SCROLL_PAGE_LEFT,
Self::PageRight => ffi::GTK_SCROLL_PAGE_RIGHT,
Self::Start => ffi::GTK_SCROLL_START,
Self::End => ffi::GTK_SCROLL_END,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkScrollType> for ScrollType {
unsafe fn from_glib(value: ffi::GtkScrollType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SCROLL_NONE => Self::None,
ffi::GTK_SCROLL_JUMP => Self::Jump,
ffi::GTK_SCROLL_STEP_BACKWARD => Self::StepBackward,
ffi::GTK_SCROLL_STEP_FORWARD => Self::StepForward,
ffi::GTK_SCROLL_PAGE_BACKWARD => Self::PageBackward,
ffi::GTK_SCROLL_PAGE_FORWARD => Self::PageForward,
ffi::GTK_SCROLL_STEP_UP => Self::StepUp,
ffi::GTK_SCROLL_STEP_DOWN => Self::StepDown,
ffi::GTK_SCROLL_PAGE_UP => Self::PageUp,
ffi::GTK_SCROLL_PAGE_DOWN => Self::PageDown,
ffi::GTK_SCROLL_STEP_LEFT => Self::StepLeft,
ffi::GTK_SCROLL_STEP_RIGHT => Self::StepRight,
ffi::GTK_SCROLL_PAGE_LEFT => Self::PageLeft,
ffi::GTK_SCROLL_PAGE_RIGHT => Self::PageRight,
ffi::GTK_SCROLL_START => Self::Start,
ffi::GTK_SCROLL_END => Self::End,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ScrollType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_scroll_type_get_type()) }
}
}
impl glib::HasParamSpec for ScrollType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ScrollType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ScrollType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ScrollType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ScrollType> for glib::Value {
#[inline]
fn from(v: ScrollType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkScrollablePolicy")]
pub enum ScrollablePolicy {
#[doc(alias = "GTK_SCROLL_MINIMUM")]
Minimum,
#[doc(alias = "GTK_SCROLL_NATURAL")]
Natural,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ScrollablePolicy {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ScrollablePolicy::{}",
match *self {
Self::Minimum => "Minimum",
Self::Natural => "Natural",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ScrollablePolicy {
type GlibType = ffi::GtkScrollablePolicy;
#[inline]
fn into_glib(self) -> ffi::GtkScrollablePolicy {
match self {
Self::Minimum => ffi::GTK_SCROLL_MINIMUM,
Self::Natural => ffi::GTK_SCROLL_NATURAL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkScrollablePolicy> for ScrollablePolicy {
#[inline]
unsafe fn from_glib(value: ffi::GtkScrollablePolicy) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SCROLL_MINIMUM => Self::Minimum,
ffi::GTK_SCROLL_NATURAL => Self::Natural,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ScrollablePolicy {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_scrollable_policy_get_type()) }
}
}
impl glib::HasParamSpec for ScrollablePolicy {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ScrollablePolicy {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ScrollablePolicy {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ScrollablePolicy {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ScrollablePolicy> for glib::Value {
#[inline]
fn from(v: ScrollablePolicy) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSelectionMode")]
pub enum SelectionMode {
#[doc(alias = "GTK_SELECTION_NONE")]
None,
#[doc(alias = "GTK_SELECTION_SINGLE")]
Single,
#[doc(alias = "GTK_SELECTION_BROWSE")]
Browse,
#[doc(alias = "GTK_SELECTION_MULTIPLE")]
Multiple,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SelectionMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SelectionMode::{}",
match *self {
Self::None => "None",
Self::Single => "Single",
Self::Browse => "Browse",
Self::Multiple => "Multiple",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SelectionMode {
type GlibType = ffi::GtkSelectionMode;
#[inline]
fn into_glib(self) -> ffi::GtkSelectionMode {
match self {
Self::None => ffi::GTK_SELECTION_NONE,
Self::Single => ffi::GTK_SELECTION_SINGLE,
Self::Browse => ffi::GTK_SELECTION_BROWSE,
Self::Multiple => ffi::GTK_SELECTION_MULTIPLE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSelectionMode> for SelectionMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkSelectionMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SELECTION_NONE => Self::None,
ffi::GTK_SELECTION_SINGLE => Self::Single,
ffi::GTK_SELECTION_BROWSE => Self::Browse,
ffi::GTK_SELECTION_MULTIPLE => Self::Multiple,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SelectionMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_selection_mode_get_type()) }
}
}
impl glib::HasParamSpec for SelectionMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SelectionMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SelectionMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SelectionMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SelectionMode> for glib::Value {
#[inline]
fn from(v: SelectionMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSensitivityType")]
pub enum SensitivityType {
#[doc(alias = "GTK_SENSITIVITY_AUTO")]
Auto,
#[doc(alias = "GTK_SENSITIVITY_ON")]
On,
#[doc(alias = "GTK_SENSITIVITY_OFF")]
Off,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SensitivityType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SensitivityType::{}",
match *self {
Self::Auto => "Auto",
Self::On => "On",
Self::Off => "Off",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SensitivityType {
type GlibType = ffi::GtkSensitivityType;
#[inline]
fn into_glib(self) -> ffi::GtkSensitivityType {
match self {
Self::Auto => ffi::GTK_SENSITIVITY_AUTO,
Self::On => ffi::GTK_SENSITIVITY_ON,
Self::Off => ffi::GTK_SENSITIVITY_OFF,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSensitivityType> for SensitivityType {
#[inline]
unsafe fn from_glib(value: ffi::GtkSensitivityType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SENSITIVITY_AUTO => Self::Auto,
ffi::GTK_SENSITIVITY_ON => Self::On,
ffi::GTK_SENSITIVITY_OFF => Self::Off,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SensitivityType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_sensitivity_type_get_type()) }
}
}
impl glib::HasParamSpec for SensitivityType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SensitivityType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SensitivityType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SensitivityType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SensitivityType> for glib::Value {
#[inline]
fn from(v: SensitivityType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkShortcutScope")]
pub enum ShortcutScope {
#[doc(alias = "GTK_SHORTCUT_SCOPE_LOCAL")]
Local,
#[doc(alias = "GTK_SHORTCUT_SCOPE_MANAGED")]
Managed,
#[doc(alias = "GTK_SHORTCUT_SCOPE_GLOBAL")]
Global,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ShortcutScope {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ShortcutScope::{}",
match *self {
Self::Local => "Local",
Self::Managed => "Managed",
Self::Global => "Global",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ShortcutScope {
type GlibType = ffi::GtkShortcutScope;
#[inline]
fn into_glib(self) -> ffi::GtkShortcutScope {
match self {
Self::Local => ffi::GTK_SHORTCUT_SCOPE_LOCAL,
Self::Managed => ffi::GTK_SHORTCUT_SCOPE_MANAGED,
Self::Global => ffi::GTK_SHORTCUT_SCOPE_GLOBAL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkShortcutScope> for ShortcutScope {
#[inline]
unsafe fn from_glib(value: ffi::GtkShortcutScope) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SHORTCUT_SCOPE_LOCAL => Self::Local,
ffi::GTK_SHORTCUT_SCOPE_MANAGED => Self::Managed,
ffi::GTK_SHORTCUT_SCOPE_GLOBAL => Self::Global,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ShortcutScope {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_shortcut_scope_get_type()) }
}
}
impl glib::HasParamSpec for ShortcutScope {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ShortcutScope {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ShortcutScope {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ShortcutScope {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ShortcutScope> for glib::Value {
#[inline]
fn from(v: ShortcutScope) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkShortcutType")]
pub enum ShortcutType {
#[doc(alias = "GTK_SHORTCUT_ACCELERATOR")]
Accelerator,
#[doc(alias = "GTK_SHORTCUT_GESTURE_PINCH")]
GesturePinch,
#[doc(alias = "GTK_SHORTCUT_GESTURE_STRETCH")]
GestureStretch,
#[doc(alias = "GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE")]
GestureRotateClockwise,
#[doc(alias = "GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE")]
GestureRotateCounterclockwise,
#[doc(alias = "GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT")]
GestureTwoFingerSwipeLeft,
#[doc(alias = "GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT")]
GestureTwoFingerSwipeRight,
#[doc(alias = "GTK_SHORTCUT_GESTURE")]
Gesture,
#[doc(alias = "GTK_SHORTCUT_GESTURE_SWIPE_LEFT")]
GestureSwipeLeft,
#[doc(alias = "GTK_SHORTCUT_GESTURE_SWIPE_RIGHT")]
GestureSwipeRight,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for ShortcutType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ShortcutType::{}",
match *self {
Self::Accelerator => "Accelerator",
Self::GesturePinch => "GesturePinch",
Self::GestureStretch => "GestureStretch",
Self::GestureRotateClockwise => "GestureRotateClockwise",
Self::GestureRotateCounterclockwise => "GestureRotateCounterclockwise",
Self::GestureTwoFingerSwipeLeft => "GestureTwoFingerSwipeLeft",
Self::GestureTwoFingerSwipeRight => "GestureTwoFingerSwipeRight",
Self::Gesture => "Gesture",
Self::GestureSwipeLeft => "GestureSwipeLeft",
Self::GestureSwipeRight => "GestureSwipeRight",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for ShortcutType {
type GlibType = ffi::GtkShortcutType;
#[inline]
fn into_glib(self) -> ffi::GtkShortcutType {
match self {
Self::Accelerator => ffi::GTK_SHORTCUT_ACCELERATOR,
Self::GesturePinch => ffi::GTK_SHORTCUT_GESTURE_PINCH,
Self::GestureStretch => ffi::GTK_SHORTCUT_GESTURE_STRETCH,
Self::GestureRotateClockwise => ffi::GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE,
Self::GestureRotateCounterclockwise => {
ffi::GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE
}
Self::GestureTwoFingerSwipeLeft => ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT,
Self::GestureTwoFingerSwipeRight => ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT,
Self::Gesture => ffi::GTK_SHORTCUT_GESTURE,
Self::GestureSwipeLeft => ffi::GTK_SHORTCUT_GESTURE_SWIPE_LEFT,
Self::GestureSwipeRight => ffi::GTK_SHORTCUT_GESTURE_SWIPE_RIGHT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkShortcutType> for ShortcutType {
#[inline]
unsafe fn from_glib(value: ffi::GtkShortcutType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SHORTCUT_ACCELERATOR => Self::Accelerator,
ffi::GTK_SHORTCUT_GESTURE_PINCH => Self::GesturePinch,
ffi::GTK_SHORTCUT_GESTURE_STRETCH => Self::GestureStretch,
ffi::GTK_SHORTCUT_GESTURE_ROTATE_CLOCKWISE => Self::GestureRotateClockwise,
ffi::GTK_SHORTCUT_GESTURE_ROTATE_COUNTERCLOCKWISE => {
Self::GestureRotateCounterclockwise
}
ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_LEFT => Self::GestureTwoFingerSwipeLeft,
ffi::GTK_SHORTCUT_GESTURE_TWO_FINGER_SWIPE_RIGHT => Self::GestureTwoFingerSwipeRight,
ffi::GTK_SHORTCUT_GESTURE => Self::Gesture,
ffi::GTK_SHORTCUT_GESTURE_SWIPE_LEFT => Self::GestureSwipeLeft,
ffi::GTK_SHORTCUT_GESTURE_SWIPE_RIGHT => Self::GestureSwipeRight,
value => Self::__Unknown(value),
}
}
}
impl StaticType for ShortcutType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_shortcut_type_get_type()) }
}
}
impl glib::HasParamSpec for ShortcutType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for ShortcutType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for ShortcutType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for ShortcutType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<ShortcutType> for glib::Value {
#[inline]
fn from(v: ShortcutType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSizeGroupMode")]
pub enum SizeGroupMode {
#[doc(alias = "GTK_SIZE_GROUP_NONE")]
None,
#[doc(alias = "GTK_SIZE_GROUP_HORIZONTAL")]
Horizontal,
#[doc(alias = "GTK_SIZE_GROUP_VERTICAL")]
Vertical,
#[doc(alias = "GTK_SIZE_GROUP_BOTH")]
Both,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SizeGroupMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SizeGroupMode::{}",
match *self {
Self::None => "None",
Self::Horizontal => "Horizontal",
Self::Vertical => "Vertical",
Self::Both => "Both",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SizeGroupMode {
type GlibType = ffi::GtkSizeGroupMode;
#[inline]
fn into_glib(self) -> ffi::GtkSizeGroupMode {
match self {
Self::None => ffi::GTK_SIZE_GROUP_NONE,
Self::Horizontal => ffi::GTK_SIZE_GROUP_HORIZONTAL,
Self::Vertical => ffi::GTK_SIZE_GROUP_VERTICAL,
Self::Both => ffi::GTK_SIZE_GROUP_BOTH,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSizeGroupMode> for SizeGroupMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkSizeGroupMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SIZE_GROUP_NONE => Self::None,
ffi::GTK_SIZE_GROUP_HORIZONTAL => Self::Horizontal,
ffi::GTK_SIZE_GROUP_VERTICAL => Self::Vertical,
ffi::GTK_SIZE_GROUP_BOTH => Self::Both,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SizeGroupMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_size_group_mode_get_type()) }
}
}
impl glib::HasParamSpec for SizeGroupMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SizeGroupMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SizeGroupMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SizeGroupMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SizeGroupMode> for glib::Value {
#[inline]
fn from(v: SizeGroupMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSizeRequestMode")]
pub enum SizeRequestMode {
#[doc(alias = "GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH")]
HeightForWidth,
#[doc(alias = "GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT")]
WidthForHeight,
#[doc(alias = "GTK_SIZE_REQUEST_CONSTANT_SIZE")]
ConstantSize,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SizeRequestMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SizeRequestMode::{}",
match *self {
Self::HeightForWidth => "HeightForWidth",
Self::WidthForHeight => "WidthForHeight",
Self::ConstantSize => "ConstantSize",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SizeRequestMode {
type GlibType = ffi::GtkSizeRequestMode;
#[inline]
fn into_glib(self) -> ffi::GtkSizeRequestMode {
match self {
Self::HeightForWidth => ffi::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH,
Self::WidthForHeight => ffi::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,
Self::ConstantSize => ffi::GTK_SIZE_REQUEST_CONSTANT_SIZE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSizeRequestMode> for SizeRequestMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkSizeRequestMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH => Self::HeightForWidth,
ffi::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT => Self::WidthForHeight,
ffi::GTK_SIZE_REQUEST_CONSTANT_SIZE => Self::ConstantSize,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SizeRequestMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_size_request_mode_get_type()) }
}
}
impl glib::HasParamSpec for SizeRequestMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SizeRequestMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SizeRequestMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SizeRequestMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SizeRequestMode> for glib::Value {
#[inline]
fn from(v: SizeRequestMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSortType")]
pub enum SortType {
#[doc(alias = "GTK_SORT_ASCENDING")]
Ascending,
#[doc(alias = "GTK_SORT_DESCENDING")]
Descending,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SortType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SortType::{}",
match *self {
Self::Ascending => "Ascending",
Self::Descending => "Descending",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SortType {
type GlibType = ffi::GtkSortType;
#[inline]
fn into_glib(self) -> ffi::GtkSortType {
match self {
Self::Ascending => ffi::GTK_SORT_ASCENDING,
Self::Descending => ffi::GTK_SORT_DESCENDING,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSortType> for SortType {
#[inline]
unsafe fn from_glib(value: ffi::GtkSortType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SORT_ASCENDING => Self::Ascending,
ffi::GTK_SORT_DESCENDING => Self::Descending,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SortType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_sort_type_get_type()) }
}
}
impl glib::HasParamSpec for SortType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SortType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SortType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SortType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SortType> for glib::Value {
#[inline]
fn from(v: SortType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSorterChange")]
pub enum SorterChange {
#[doc(alias = "GTK_SORTER_CHANGE_DIFFERENT")]
Different,
#[doc(alias = "GTK_SORTER_CHANGE_INVERTED")]
Inverted,
#[doc(alias = "GTK_SORTER_CHANGE_LESS_STRICT")]
LessStrict,
#[doc(alias = "GTK_SORTER_CHANGE_MORE_STRICT")]
MoreStrict,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SorterChange {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SorterChange::{}",
match *self {
Self::Different => "Different",
Self::Inverted => "Inverted",
Self::LessStrict => "LessStrict",
Self::MoreStrict => "MoreStrict",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SorterChange {
type GlibType = ffi::GtkSorterChange;
#[inline]
fn into_glib(self) -> ffi::GtkSorterChange {
match self {
Self::Different => ffi::GTK_SORTER_CHANGE_DIFFERENT,
Self::Inverted => ffi::GTK_SORTER_CHANGE_INVERTED,
Self::LessStrict => ffi::GTK_SORTER_CHANGE_LESS_STRICT,
Self::MoreStrict => ffi::GTK_SORTER_CHANGE_MORE_STRICT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSorterChange> for SorterChange {
#[inline]
unsafe fn from_glib(value: ffi::GtkSorterChange) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SORTER_CHANGE_DIFFERENT => Self::Different,
ffi::GTK_SORTER_CHANGE_INVERTED => Self::Inverted,
ffi::GTK_SORTER_CHANGE_LESS_STRICT => Self::LessStrict,
ffi::GTK_SORTER_CHANGE_MORE_STRICT => Self::MoreStrict,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SorterChange {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_sorter_change_get_type()) }
}
}
impl glib::HasParamSpec for SorterChange {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SorterChange {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SorterChange {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SorterChange {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SorterChange> for glib::Value {
#[inline]
fn from(v: SorterChange) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSorterOrder")]
pub enum SorterOrder {
#[doc(alias = "GTK_SORTER_ORDER_PARTIAL")]
Partial,
#[doc(alias = "GTK_SORTER_ORDER_NONE")]
None,
#[doc(alias = "GTK_SORTER_ORDER_TOTAL")]
Total,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SorterOrder {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SorterOrder::{}",
match *self {
Self::Partial => "Partial",
Self::None => "None",
Self::Total => "Total",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SorterOrder {
type GlibType = ffi::GtkSorterOrder;
#[inline]
fn into_glib(self) -> ffi::GtkSorterOrder {
match self {
Self::Partial => ffi::GTK_SORTER_ORDER_PARTIAL,
Self::None => ffi::GTK_SORTER_ORDER_NONE,
Self::Total => ffi::GTK_SORTER_ORDER_TOTAL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSorterOrder> for SorterOrder {
#[inline]
unsafe fn from_glib(value: ffi::GtkSorterOrder) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SORTER_ORDER_PARTIAL => Self::Partial,
ffi::GTK_SORTER_ORDER_NONE => Self::None,
ffi::GTK_SORTER_ORDER_TOTAL => Self::Total,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SorterOrder {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_sorter_order_get_type()) }
}
}
impl glib::HasParamSpec for SorterOrder {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SorterOrder {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SorterOrder {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SorterOrder {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SorterOrder> for glib::Value {
#[inline]
fn from(v: SorterOrder) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSpinButtonUpdatePolicy")]
pub enum SpinButtonUpdatePolicy {
#[doc(alias = "GTK_UPDATE_ALWAYS")]
Always,
#[doc(alias = "GTK_UPDATE_IF_VALID")]
IfValid,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SpinButtonUpdatePolicy {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SpinButtonUpdatePolicy::{}",
match *self {
Self::Always => "Always",
Self::IfValid => "IfValid",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SpinButtonUpdatePolicy {
type GlibType = ffi::GtkSpinButtonUpdatePolicy;
#[inline]
fn into_glib(self) -> ffi::GtkSpinButtonUpdatePolicy {
match self {
Self::Always => ffi::GTK_UPDATE_ALWAYS,
Self::IfValid => ffi::GTK_UPDATE_IF_VALID,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSpinButtonUpdatePolicy> for SpinButtonUpdatePolicy {
#[inline]
unsafe fn from_glib(value: ffi::GtkSpinButtonUpdatePolicy) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_UPDATE_ALWAYS => Self::Always,
ffi::GTK_UPDATE_IF_VALID => Self::IfValid,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SpinButtonUpdatePolicy {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_spin_button_update_policy_get_type()) }
}
}
impl glib::HasParamSpec for SpinButtonUpdatePolicy {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SpinButtonUpdatePolicy {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SpinButtonUpdatePolicy {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SpinButtonUpdatePolicy {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SpinButtonUpdatePolicy> for glib::Value {
#[inline]
fn from(v: SpinButtonUpdatePolicy) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSpinType")]
pub enum SpinType {
#[doc(alias = "GTK_SPIN_STEP_FORWARD")]
StepForward,
#[doc(alias = "GTK_SPIN_STEP_BACKWARD")]
StepBackward,
#[doc(alias = "GTK_SPIN_PAGE_FORWARD")]
PageForward,
#[doc(alias = "GTK_SPIN_PAGE_BACKWARD")]
PageBackward,
#[doc(alias = "GTK_SPIN_HOME")]
Home,
#[doc(alias = "GTK_SPIN_END")]
End,
#[doc(alias = "GTK_SPIN_USER_DEFINED")]
UserDefined,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SpinType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SpinType::{}",
match *self {
Self::StepForward => "StepForward",
Self::StepBackward => "StepBackward",
Self::PageForward => "PageForward",
Self::PageBackward => "PageBackward",
Self::Home => "Home",
Self::End => "End",
Self::UserDefined => "UserDefined",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SpinType {
type GlibType = ffi::GtkSpinType;
#[inline]
fn into_glib(self) -> ffi::GtkSpinType {
match self {
Self::StepForward => ffi::GTK_SPIN_STEP_FORWARD,
Self::StepBackward => ffi::GTK_SPIN_STEP_BACKWARD,
Self::PageForward => ffi::GTK_SPIN_PAGE_FORWARD,
Self::PageBackward => ffi::GTK_SPIN_PAGE_BACKWARD,
Self::Home => ffi::GTK_SPIN_HOME,
Self::End => ffi::GTK_SPIN_END,
Self::UserDefined => ffi::GTK_SPIN_USER_DEFINED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSpinType> for SpinType {
#[inline]
unsafe fn from_glib(value: ffi::GtkSpinType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SPIN_STEP_FORWARD => Self::StepForward,
ffi::GTK_SPIN_STEP_BACKWARD => Self::StepBackward,
ffi::GTK_SPIN_PAGE_FORWARD => Self::PageForward,
ffi::GTK_SPIN_PAGE_BACKWARD => Self::PageBackward,
ffi::GTK_SPIN_HOME => Self::Home,
ffi::GTK_SPIN_END => Self::End,
ffi::GTK_SPIN_USER_DEFINED => Self::UserDefined,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SpinType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_spin_type_get_type()) }
}
}
impl glib::HasParamSpec for SpinType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SpinType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SpinType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SpinType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SpinType> for glib::Value {
#[inline]
fn from(v: SpinType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkStackTransitionType")]
pub enum StackTransitionType {
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_NONE")]
None,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_CROSSFADE")]
Crossfade,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT")]
SlideRight,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT")]
SlideLeft,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_UP")]
SlideUp,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN")]
SlideDown,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT")]
SlideLeftRight,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN")]
SlideUpDown,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_UP")]
OverUp,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_DOWN")]
OverDown,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_LEFT")]
OverLeft,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_RIGHT")]
OverRight,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_UP")]
UnderUp,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_DOWN")]
UnderDown,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_LEFT")]
UnderLeft,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT")]
UnderRight,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN")]
OverUpDown,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP")]
OverDownUp,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT")]
OverLeftRight,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT")]
OverRightLeft,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT")]
RotateLeft,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT")]
RotateRight,
#[doc(alias = "GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT")]
RotateLeftRight,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for StackTransitionType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"StackTransitionType::{}",
match *self {
Self::None => "None",
Self::Crossfade => "Crossfade",
Self::SlideRight => "SlideRight",
Self::SlideLeft => "SlideLeft",
Self::SlideUp => "SlideUp",
Self::SlideDown => "SlideDown",
Self::SlideLeftRight => "SlideLeftRight",
Self::SlideUpDown => "SlideUpDown",
Self::OverUp => "OverUp",
Self::OverDown => "OverDown",
Self::OverLeft => "OverLeft",
Self::OverRight => "OverRight",
Self::UnderUp => "UnderUp",
Self::UnderDown => "UnderDown",
Self::UnderLeft => "UnderLeft",
Self::UnderRight => "UnderRight",
Self::OverUpDown => "OverUpDown",
Self::OverDownUp => "OverDownUp",
Self::OverLeftRight => "OverLeftRight",
Self::OverRightLeft => "OverRightLeft",
Self::RotateLeft => "RotateLeft",
Self::RotateRight => "RotateRight",
Self::RotateLeftRight => "RotateLeftRight",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for StackTransitionType {
type GlibType = ffi::GtkStackTransitionType;
fn into_glib(self) -> ffi::GtkStackTransitionType {
match self {
Self::None => ffi::GTK_STACK_TRANSITION_TYPE_NONE,
Self::Crossfade => ffi::GTK_STACK_TRANSITION_TYPE_CROSSFADE,
Self::SlideRight => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
Self::SlideLeft => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT,
Self::SlideUp => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP,
Self::SlideDown => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN,
Self::SlideLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT,
Self::SlideUpDown => ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN,
Self::OverUp => ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP,
Self::OverDown => ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN,
Self::OverLeft => ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT,
Self::OverRight => ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT,
Self::UnderUp => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_UP,
Self::UnderDown => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN,
Self::UnderLeft => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT,
Self::UnderRight => ffi::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT,
Self::OverUpDown => ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN,
Self::OverDownUp => ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP,
Self::OverLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT,
Self::OverRightLeft => ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT,
Self::RotateLeft => ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT,
Self::RotateRight => ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT,
Self::RotateLeftRight => ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkStackTransitionType> for StackTransitionType {
unsafe fn from_glib(value: ffi::GtkStackTransitionType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_STACK_TRANSITION_TYPE_NONE => Self::None,
ffi::GTK_STACK_TRANSITION_TYPE_CROSSFADE => Self::Crossfade,
ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT => Self::SlideRight,
ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT => Self::SlideLeft,
ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP => Self::SlideUp,
ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN => Self::SlideDown,
ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT => Self::SlideLeftRight,
ffi::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN => Self::SlideUpDown,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP => Self::OverUp,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN => Self::OverDown,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT => Self::OverLeft,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT => Self::OverRight,
ffi::GTK_STACK_TRANSITION_TYPE_UNDER_UP => Self::UnderUp,
ffi::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN => Self::UnderDown,
ffi::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT => Self::UnderLeft,
ffi::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT => Self::UnderRight,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN => Self::OverUpDown,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP => Self::OverDownUp,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT => Self::OverLeftRight,
ffi::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT => Self::OverRightLeft,
ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT => Self::RotateLeft,
ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_RIGHT => Self::RotateRight,
ffi::GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT => Self::RotateLeftRight,
value => Self::__Unknown(value),
}
}
}
impl StaticType for StackTransitionType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_stack_transition_type_get_type()) }
}
}
impl glib::HasParamSpec for StackTransitionType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for StackTransitionType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for StackTransitionType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for StackTransitionType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<StackTransitionType> for glib::Value {
#[inline]
fn from(v: StackTransitionType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkStringFilterMatchMode")]
pub enum StringFilterMatchMode {
#[doc(alias = "GTK_STRING_FILTER_MATCH_MODE_EXACT")]
Exact,
#[doc(alias = "GTK_STRING_FILTER_MATCH_MODE_SUBSTRING")]
Substring,
#[doc(alias = "GTK_STRING_FILTER_MATCH_MODE_PREFIX")]
Prefix,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for StringFilterMatchMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"StringFilterMatchMode::{}",
match *self {
Self::Exact => "Exact",
Self::Substring => "Substring",
Self::Prefix => "Prefix",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for StringFilterMatchMode {
type GlibType = ffi::GtkStringFilterMatchMode;
#[inline]
fn into_glib(self) -> ffi::GtkStringFilterMatchMode {
match self {
Self::Exact => ffi::GTK_STRING_FILTER_MATCH_MODE_EXACT,
Self::Substring => ffi::GTK_STRING_FILTER_MATCH_MODE_SUBSTRING,
Self::Prefix => ffi::GTK_STRING_FILTER_MATCH_MODE_PREFIX,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkStringFilterMatchMode> for StringFilterMatchMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkStringFilterMatchMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_STRING_FILTER_MATCH_MODE_EXACT => Self::Exact,
ffi::GTK_STRING_FILTER_MATCH_MODE_SUBSTRING => Self::Substring,
ffi::GTK_STRING_FILTER_MATCH_MODE_PREFIX => Self::Prefix,
value => Self::__Unknown(value),
}
}
}
impl StaticType for StringFilterMatchMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_string_filter_match_mode_get_type()) }
}
}
impl glib::HasParamSpec for StringFilterMatchMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for StringFilterMatchMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for StringFilterMatchMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for StringFilterMatchMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<StringFilterMatchMode> for glib::Value {
#[inline]
fn from(v: StringFilterMatchMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSymbolicColor")]
pub enum SymbolicColor {
#[doc(alias = "GTK_SYMBOLIC_COLOR_FOREGROUND")]
Foreground,
#[doc(alias = "GTK_SYMBOLIC_COLOR_ERROR")]
Error,
#[doc(alias = "GTK_SYMBOLIC_COLOR_WARNING")]
Warning,
#[doc(alias = "GTK_SYMBOLIC_COLOR_SUCCESS")]
Success,
#[doc(hidden)]
__Unknown(i32),
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl fmt::Display for SymbolicColor {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SymbolicColor::{}",
match *self {
Self::Foreground => "Foreground",
Self::Error => "Error",
Self::Warning => "Warning",
Self::Success => "Success",
_ => "Unknown",
}
)
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
#[doc(hidden)]
impl IntoGlib for SymbolicColor {
type GlibType = ffi::GtkSymbolicColor;
#[inline]
fn into_glib(self) -> ffi::GtkSymbolicColor {
match self {
Self::Foreground => ffi::GTK_SYMBOLIC_COLOR_FOREGROUND,
Self::Error => ffi::GTK_SYMBOLIC_COLOR_ERROR,
Self::Warning => ffi::GTK_SYMBOLIC_COLOR_WARNING,
Self::Success => ffi::GTK_SYMBOLIC_COLOR_SUCCESS,
Self::__Unknown(value) => value,
}
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
#[doc(hidden)]
impl FromGlib<ffi::GtkSymbolicColor> for SymbolicColor {
#[inline]
unsafe fn from_glib(value: ffi::GtkSymbolicColor) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SYMBOLIC_COLOR_FOREGROUND => Self::Foreground,
ffi::GTK_SYMBOLIC_COLOR_ERROR => Self::Error,
ffi::GTK_SYMBOLIC_COLOR_WARNING => Self::Warning,
ffi::GTK_SYMBOLIC_COLOR_SUCCESS => Self::Success,
value => Self::__Unknown(value),
}
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl StaticType for SymbolicColor {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_symbolic_color_get_type()) }
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl glib::HasParamSpec for SymbolicColor {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl glib::value::ValueType for SymbolicColor {
type Type = Self;
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
unsafe impl<'a> FromValue<'a> for SymbolicColor {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl ToValue for SymbolicColor {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
#[cfg(any(feature = "v4_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v4_6")))]
impl From<SymbolicColor> for glib::Value {
#[inline]
fn from(v: SymbolicColor) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkSystemSetting")]
pub enum SystemSetting {
#[doc(alias = "GTK_SYSTEM_SETTING_DPI")]
Dpi,
#[doc(alias = "GTK_SYSTEM_SETTING_FONT_NAME")]
FontName,
#[doc(alias = "GTK_SYSTEM_SETTING_FONT_CONFIG")]
FontConfig,
#[doc(alias = "GTK_SYSTEM_SETTING_DISPLAY")]
Display,
#[doc(alias = "GTK_SYSTEM_SETTING_ICON_THEME")]
IconTheme,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for SystemSetting {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"SystemSetting::{}",
match *self {
Self::Dpi => "Dpi",
Self::FontName => "FontName",
Self::FontConfig => "FontConfig",
Self::Display => "Display",
Self::IconTheme => "IconTheme",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for SystemSetting {
type GlibType = ffi::GtkSystemSetting;
#[inline]
fn into_glib(self) -> ffi::GtkSystemSetting {
match self {
Self::Dpi => ffi::GTK_SYSTEM_SETTING_DPI,
Self::FontName => ffi::GTK_SYSTEM_SETTING_FONT_NAME,
Self::FontConfig => ffi::GTK_SYSTEM_SETTING_FONT_CONFIG,
Self::Display => ffi::GTK_SYSTEM_SETTING_DISPLAY,
Self::IconTheme => ffi::GTK_SYSTEM_SETTING_ICON_THEME,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkSystemSetting> for SystemSetting {
#[inline]
unsafe fn from_glib(value: ffi::GtkSystemSetting) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_SYSTEM_SETTING_DPI => Self::Dpi,
ffi::GTK_SYSTEM_SETTING_FONT_NAME => Self::FontName,
ffi::GTK_SYSTEM_SETTING_FONT_CONFIG => Self::FontConfig,
ffi::GTK_SYSTEM_SETTING_DISPLAY => Self::Display,
ffi::GTK_SYSTEM_SETTING_ICON_THEME => Self::IconTheme,
value => Self::__Unknown(value),
}
}
}
impl StaticType for SystemSetting {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_system_setting_get_type()) }
}
}
impl glib::HasParamSpec for SystemSetting {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for SystemSetting {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for SystemSetting {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for SystemSetting {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<SystemSetting> for glib::Value {
#[inline]
fn from(v: SystemSetting) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkTextDirection")]
pub enum TextDirection {
#[doc(alias = "GTK_TEXT_DIR_NONE")]
None,
#[doc(alias = "GTK_TEXT_DIR_LTR")]
Ltr,
#[doc(alias = "GTK_TEXT_DIR_RTL")]
Rtl,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for TextDirection {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TextDirection::{}",
match *self {
Self::None => "None",
Self::Ltr => "Ltr",
Self::Rtl => "Rtl",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for TextDirection {
type GlibType = ffi::GtkTextDirection;
#[inline]
fn into_glib(self) -> ffi::GtkTextDirection {
match self {
Self::None => ffi::GTK_TEXT_DIR_NONE,
Self::Ltr => ffi::GTK_TEXT_DIR_LTR,
Self::Rtl => ffi::GTK_TEXT_DIR_RTL,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkTextDirection> for TextDirection {
#[inline]
unsafe fn from_glib(value: ffi::GtkTextDirection) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_TEXT_DIR_NONE => Self::None,
ffi::GTK_TEXT_DIR_LTR => Self::Ltr,
ffi::GTK_TEXT_DIR_RTL => Self::Rtl,
value => Self::__Unknown(value),
}
}
}
impl StaticType for TextDirection {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_text_direction_get_type()) }
}
}
impl glib::HasParamSpec for TextDirection {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for TextDirection {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for TextDirection {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for TextDirection {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<TextDirection> for glib::Value {
#[inline]
fn from(v: TextDirection) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkTextExtendSelection")]
pub enum TextExtendSelection {
#[doc(alias = "GTK_TEXT_EXTEND_SELECTION_WORD")]
Word,
#[doc(alias = "GTK_TEXT_EXTEND_SELECTION_LINE")]
Line,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for TextExtendSelection {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TextExtendSelection::{}",
match *self {
Self::Word => "Word",
Self::Line => "Line",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for TextExtendSelection {
type GlibType = ffi::GtkTextExtendSelection;
#[inline]
fn into_glib(self) -> ffi::GtkTextExtendSelection {
match self {
Self::Word => ffi::GTK_TEXT_EXTEND_SELECTION_WORD,
Self::Line => ffi::GTK_TEXT_EXTEND_SELECTION_LINE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkTextExtendSelection> for TextExtendSelection {
#[inline]
unsafe fn from_glib(value: ffi::GtkTextExtendSelection) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_TEXT_EXTEND_SELECTION_WORD => Self::Word,
ffi::GTK_TEXT_EXTEND_SELECTION_LINE => Self::Line,
value => Self::__Unknown(value),
}
}
}
impl StaticType for TextExtendSelection {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_text_extend_selection_get_type()) }
}
}
impl glib::HasParamSpec for TextExtendSelection {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for TextExtendSelection {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for TextExtendSelection {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for TextExtendSelection {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<TextExtendSelection> for glib::Value {
#[inline]
fn from(v: TextExtendSelection) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkTextViewLayer")]
pub enum TextViewLayer {
#[doc(alias = "GTK_TEXT_VIEW_LAYER_BELOW_TEXT")]
BelowText,
#[doc(alias = "GTK_TEXT_VIEW_LAYER_ABOVE_TEXT")]
AboveText,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for TextViewLayer {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TextViewLayer::{}",
match *self {
Self::BelowText => "BelowText",
Self::AboveText => "AboveText",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for TextViewLayer {
type GlibType = ffi::GtkTextViewLayer;
#[inline]
fn into_glib(self) -> ffi::GtkTextViewLayer {
match self {
Self::BelowText => ffi::GTK_TEXT_VIEW_LAYER_BELOW_TEXT,
Self::AboveText => ffi::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkTextViewLayer> for TextViewLayer {
#[inline]
unsafe fn from_glib(value: ffi::GtkTextViewLayer) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_TEXT_VIEW_LAYER_BELOW_TEXT => Self::BelowText,
ffi::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT => Self::AboveText,
value => Self::__Unknown(value),
}
}
}
impl StaticType for TextViewLayer {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_text_view_layer_get_type()) }
}
}
impl glib::HasParamSpec for TextViewLayer {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for TextViewLayer {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for TextViewLayer {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for TextViewLayer {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<TextViewLayer> for glib::Value {
#[inline]
fn from(v: TextViewLayer) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkTextWindowType")]
pub enum TextWindowType {
#[doc(alias = "GTK_TEXT_WINDOW_WIDGET")]
Widget,
#[doc(alias = "GTK_TEXT_WINDOW_TEXT")]
Text,
#[doc(alias = "GTK_TEXT_WINDOW_LEFT")]
Left,
#[doc(alias = "GTK_TEXT_WINDOW_RIGHT")]
Right,
#[doc(alias = "GTK_TEXT_WINDOW_TOP")]
Top,
#[doc(alias = "GTK_TEXT_WINDOW_BOTTOM")]
Bottom,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for TextWindowType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TextWindowType::{}",
match *self {
Self::Widget => "Widget",
Self::Text => "Text",
Self::Left => "Left",
Self::Right => "Right",
Self::Top => "Top",
Self::Bottom => "Bottom",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for TextWindowType {
type GlibType = ffi::GtkTextWindowType;
#[inline]
fn into_glib(self) -> ffi::GtkTextWindowType {
match self {
Self::Widget => ffi::GTK_TEXT_WINDOW_WIDGET,
Self::Text => ffi::GTK_TEXT_WINDOW_TEXT,
Self::Left => ffi::GTK_TEXT_WINDOW_LEFT,
Self::Right => ffi::GTK_TEXT_WINDOW_RIGHT,
Self::Top => ffi::GTK_TEXT_WINDOW_TOP,
Self::Bottom => ffi::GTK_TEXT_WINDOW_BOTTOM,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkTextWindowType> for TextWindowType {
#[inline]
unsafe fn from_glib(value: ffi::GtkTextWindowType) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_TEXT_WINDOW_WIDGET => Self::Widget,
ffi::GTK_TEXT_WINDOW_TEXT => Self::Text,
ffi::GTK_TEXT_WINDOW_LEFT => Self::Left,
ffi::GTK_TEXT_WINDOW_RIGHT => Self::Right,
ffi::GTK_TEXT_WINDOW_TOP => Self::Top,
ffi::GTK_TEXT_WINDOW_BOTTOM => Self::Bottom,
value => Self::__Unknown(value),
}
}
}
impl StaticType for TextWindowType {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_text_window_type_get_type()) }
}
}
impl glib::HasParamSpec for TextWindowType {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for TextWindowType {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for TextWindowType {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for TextWindowType {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<TextWindowType> for glib::Value {
#[inline]
fn from(v: TextWindowType) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkTreeViewColumnSizing")]
pub enum TreeViewColumnSizing {
#[doc(alias = "GTK_TREE_VIEW_COLUMN_GROW_ONLY")]
GrowOnly,
#[doc(alias = "GTK_TREE_VIEW_COLUMN_AUTOSIZE")]
Autosize,
#[doc(alias = "GTK_TREE_VIEW_COLUMN_FIXED")]
Fixed,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for TreeViewColumnSizing {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TreeViewColumnSizing::{}",
match *self {
Self::GrowOnly => "GrowOnly",
Self::Autosize => "Autosize",
Self::Fixed => "Fixed",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for TreeViewColumnSizing {
type GlibType = ffi::GtkTreeViewColumnSizing;
#[inline]
fn into_glib(self) -> ffi::GtkTreeViewColumnSizing {
match self {
Self::GrowOnly => ffi::GTK_TREE_VIEW_COLUMN_GROW_ONLY,
Self::Autosize => ffi::GTK_TREE_VIEW_COLUMN_AUTOSIZE,
Self::Fixed => ffi::GTK_TREE_VIEW_COLUMN_FIXED,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkTreeViewColumnSizing> for TreeViewColumnSizing {
#[inline]
unsafe fn from_glib(value: ffi::GtkTreeViewColumnSizing) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_TREE_VIEW_COLUMN_GROW_ONLY => Self::GrowOnly,
ffi::GTK_TREE_VIEW_COLUMN_AUTOSIZE => Self::Autosize,
ffi::GTK_TREE_VIEW_COLUMN_FIXED => Self::Fixed,
value => Self::__Unknown(value),
}
}
}
impl StaticType for TreeViewColumnSizing {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_tree_view_column_sizing_get_type()) }
}
}
impl glib::HasParamSpec for TreeViewColumnSizing {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for TreeViewColumnSizing {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for TreeViewColumnSizing {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for TreeViewColumnSizing {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<TreeViewColumnSizing> for glib::Value {
#[inline]
fn from(v: TreeViewColumnSizing) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkTreeViewDropPosition")]
pub enum TreeViewDropPosition {
#[doc(alias = "GTK_TREE_VIEW_DROP_BEFORE")]
Before,
#[doc(alias = "GTK_TREE_VIEW_DROP_AFTER")]
After,
#[doc(alias = "GTK_TREE_VIEW_DROP_INTO_OR_BEFORE")]
IntoOrBefore,
#[doc(alias = "GTK_TREE_VIEW_DROP_INTO_OR_AFTER")]
IntoOrAfter,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for TreeViewDropPosition {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TreeViewDropPosition::{}",
match *self {
Self::Before => "Before",
Self::After => "After",
Self::IntoOrBefore => "IntoOrBefore",
Self::IntoOrAfter => "IntoOrAfter",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for TreeViewDropPosition {
type GlibType = ffi::GtkTreeViewDropPosition;
#[inline]
fn into_glib(self) -> ffi::GtkTreeViewDropPosition {
match self {
Self::Before => ffi::GTK_TREE_VIEW_DROP_BEFORE,
Self::After => ffi::GTK_TREE_VIEW_DROP_AFTER,
Self::IntoOrBefore => ffi::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE,
Self::IntoOrAfter => ffi::GTK_TREE_VIEW_DROP_INTO_OR_AFTER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkTreeViewDropPosition> for TreeViewDropPosition {
#[inline]
unsafe fn from_glib(value: ffi::GtkTreeViewDropPosition) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_TREE_VIEW_DROP_BEFORE => Self::Before,
ffi::GTK_TREE_VIEW_DROP_AFTER => Self::After,
ffi::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE => Self::IntoOrBefore,
ffi::GTK_TREE_VIEW_DROP_INTO_OR_AFTER => Self::IntoOrAfter,
value => Self::__Unknown(value),
}
}
}
impl StaticType for TreeViewDropPosition {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_tree_view_drop_position_get_type()) }
}
}
impl glib::HasParamSpec for TreeViewDropPosition {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for TreeViewDropPosition {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for TreeViewDropPosition {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for TreeViewDropPosition {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<TreeViewDropPosition> for glib::Value {
#[inline]
fn from(v: TreeViewDropPosition) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkTreeViewGridLines")]
pub enum TreeViewGridLines {
#[doc(alias = "GTK_TREE_VIEW_GRID_LINES_NONE")]
None,
#[doc(alias = "GTK_TREE_VIEW_GRID_LINES_HORIZONTAL")]
Horizontal,
#[doc(alias = "GTK_TREE_VIEW_GRID_LINES_VERTICAL")]
Vertical,
#[doc(alias = "GTK_TREE_VIEW_GRID_LINES_BOTH")]
Both,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for TreeViewGridLines {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"TreeViewGridLines::{}",
match *self {
Self::None => "None",
Self::Horizontal => "Horizontal",
Self::Vertical => "Vertical",
Self::Both => "Both",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for TreeViewGridLines {
type GlibType = ffi::GtkTreeViewGridLines;
#[inline]
fn into_glib(self) -> ffi::GtkTreeViewGridLines {
match self {
Self::None => ffi::GTK_TREE_VIEW_GRID_LINES_NONE,
Self::Horizontal => ffi::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL,
Self::Vertical => ffi::GTK_TREE_VIEW_GRID_LINES_VERTICAL,
Self::Both => ffi::GTK_TREE_VIEW_GRID_LINES_BOTH,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkTreeViewGridLines> for TreeViewGridLines {
#[inline]
unsafe fn from_glib(value: ffi::GtkTreeViewGridLines) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_TREE_VIEW_GRID_LINES_NONE => Self::None,
ffi::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL => Self::Horizontal,
ffi::GTK_TREE_VIEW_GRID_LINES_VERTICAL => Self::Vertical,
ffi::GTK_TREE_VIEW_GRID_LINES_BOTH => Self::Both,
value => Self::__Unknown(value),
}
}
}
impl StaticType for TreeViewGridLines {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_tree_view_grid_lines_get_type()) }
}
}
impl glib::HasParamSpec for TreeViewGridLines {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for TreeViewGridLines {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for TreeViewGridLines {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for TreeViewGridLines {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<TreeViewGridLines> for glib::Value {
#[inline]
fn from(v: TreeViewGridLines) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkUnit")]
pub enum Unit {
#[doc(alias = "GTK_UNIT_NONE")]
None,
#[doc(alias = "GTK_UNIT_POINTS")]
Points,
#[doc(alias = "GTK_UNIT_INCH")]
Inch,
#[doc(alias = "GTK_UNIT_MM")]
Mm,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for Unit {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"Unit::{}",
match *self {
Self::None => "None",
Self::Points => "Points",
Self::Inch => "Inch",
Self::Mm => "Mm",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for Unit {
type GlibType = ffi::GtkUnit;
#[inline]
fn into_glib(self) -> ffi::GtkUnit {
match self {
Self::None => ffi::GTK_UNIT_NONE,
Self::Points => ffi::GTK_UNIT_POINTS,
Self::Inch => ffi::GTK_UNIT_INCH,
Self::Mm => ffi::GTK_UNIT_MM,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkUnit> for Unit {
#[inline]
unsafe fn from_glib(value: ffi::GtkUnit) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_UNIT_NONE => Self::None,
ffi::GTK_UNIT_POINTS => Self::Points,
ffi::GTK_UNIT_INCH => Self::Inch,
ffi::GTK_UNIT_MM => Self::Mm,
value => Self::__Unknown(value),
}
}
}
impl StaticType for Unit {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_unit_get_type()) }
}
}
impl glib::HasParamSpec for Unit {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for Unit {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for Unit {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for Unit {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<Unit> for glib::Value {
#[inline]
fn from(v: Unit) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GtkWrapMode")]
pub enum WrapMode {
#[doc(alias = "GTK_WRAP_NONE")]
None,
#[doc(alias = "GTK_WRAP_CHAR")]
Char,
#[doc(alias = "GTK_WRAP_WORD")]
Word,
#[doc(alias = "GTK_WRAP_WORD_CHAR")]
WordChar,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for WrapMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"WrapMode::{}",
match *self {
Self::None => "None",
Self::Char => "Char",
Self::Word => "Word",
Self::WordChar => "WordChar",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for WrapMode {
type GlibType = ffi::GtkWrapMode;
#[inline]
fn into_glib(self) -> ffi::GtkWrapMode {
match self {
Self::None => ffi::GTK_WRAP_NONE,
Self::Char => ffi::GTK_WRAP_CHAR,
Self::Word => ffi::GTK_WRAP_WORD,
Self::WordChar => ffi::GTK_WRAP_WORD_CHAR,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GtkWrapMode> for WrapMode {
#[inline]
unsafe fn from_glib(value: ffi::GtkWrapMode) -> Self {
skip_assert_initialized!();
match value {
ffi::GTK_WRAP_NONE => Self::None,
ffi::GTK_WRAP_CHAR => Self::Char,
ffi::GTK_WRAP_WORD => Self::Word,
ffi::GTK_WRAP_WORD_CHAR => Self::WordChar,
value => Self::__Unknown(value),
}
}
}
impl StaticType for WrapMode {
#[inline]
fn static_type() -> Type {
unsafe { from_glib(ffi::gtk_wrap_mode_get_type()) }
}
}
impl glib::HasParamSpec for WrapMode {
type ParamSpec = glib::ParamSpecEnum;
type SetValue = Self;
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name, default_value| Self::ParamSpec::builder_with_default(name, default_value)
}
}
impl glib::value::ValueType for WrapMode {
type Type = Self;
}
unsafe impl<'a> FromValue<'a> for WrapMode {
type Checker = glib::value::GenericValueTypeChecker<Self>;
#[inline]
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WrapMode {
#[inline]
fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Self>();
unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
}
value
}
#[inline]
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
impl From<WrapMode> for glib::Value {
#[inline]
fn from(v: WrapMode) -> Self {
skip_assert_initialized!();
ToValue::to_value(&v)
}
}