pub struct BreakpointCondition { /* private fields */ }
v1_4
only.Expand description
Describes condition for an Breakpoint
.
GLib type: Boxed type with copy-on-clone semantics.
Implementations§
Source§impl BreakpointCondition
impl BreakpointCondition
Sourcepub fn as_ptr(&self) -> *mut AdwBreakpointCondition
pub fn as_ptr(&self) -> *mut AdwBreakpointCondition
Return the inner pointer to the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut AdwBreakpointCondition) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut AdwBreakpointCondition) -> &Self
Borrows the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow_mut(
ptr: &mut *mut AdwBreakpointCondition,
) -> &mut Self
pub unsafe fn from_glib_ptr_borrow_mut( ptr: &mut *mut AdwBreakpointCondition, ) -> &mut Self
Borrows the underlying C value mutably.
Source§impl BreakpointCondition
impl BreakpointCondition
Sourcepub fn new_and(
condition_1: BreakpointCondition,
condition_2: BreakpointCondition,
) -> BreakpointCondition
pub fn new_and( condition_1: BreakpointCondition, condition_2: BreakpointCondition, ) -> BreakpointCondition
Sourcepub fn new_length(
type_: BreakpointConditionLengthType,
value: f64,
unit: LengthUnit,
) -> BreakpointCondition
pub fn new_length( type_: BreakpointConditionLengthType, value: f64, unit: LengthUnit, ) -> BreakpointCondition
Sourcepub fn new_or(
condition_1: BreakpointCondition,
condition_2: BreakpointCondition,
) -> BreakpointCondition
pub fn new_or( condition_1: BreakpointCondition, condition_2: BreakpointCondition, ) -> BreakpointCondition
Sourcepub fn new_ratio(
type_: BreakpointConditionRatioType,
width: i32,
height: i32,
) -> BreakpointCondition
pub fn new_ratio( type_: BreakpointConditionRatioType, width: i32, height: i32, ) -> BreakpointCondition
Sourcepub fn to_str(&self) -> GString
pub fn to_str(&self) -> GString
Returns a textual representation of @self.
The returned string can be parsed by parse()
.
§Returns
A newly allocated text string
Sourcepub fn parse(str: &str) -> Result<BreakpointCondition, BoolError>
pub fn parse(str: &str) -> Result<BreakpointCondition, BoolError>
Parses a condition from a string.
Length conditions are specified as <type>: <value>[<unit>]
, where:
<type>
can bemin-width
,max-width
,min-height
ormax-height
<value>
is a fractional number<unit>
can bepx
,pt
orsp
If the unit is omitted, px
is assumed.
See BreakpointCondition::new_length()
.
Examples:
min-width: 500px
min-height: 400pt
max-width: 100sp
max-height: 500
Ratio conditions are specified as <type>: <width>[/<height>]
, where:
<type>
can bemin-aspect-ratio
ormax-aspect-ratio
<width>
and<height>
are integer numbers
See BreakpointCondition::new_ratio()
.
The ratio is represented as <width>
divided by <height>
.
If <height>
is omitted, it’s assumed to be 1.
Examples:
min-aspect-ratio: 4/3
max-aspect-ratio: 1
The logical operators and
, or
can be used to compose a complex condition
as follows:
<condition> and <condition>
: the condition is true when both<condition>
s are true, same as when usingBreakpointCondition::new_and()
<condition> or <condition>
: the condition is true when either of the<condition>
s is true, same as when usingBreakpointCondition::new_or()
Examples:
min-width: 400px and max-aspect-ratio: 4/3
max-width: 360sp or max-width: 360px
Conditions can be further nested using parentheses, for example:
min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)
If parentheses are omitted, the first operator takes priority.
§str
the string specifying the condition
§Returns
the parsed condition
Trait Implementations§
Source§impl Clone for BreakpointCondition
impl Clone for BreakpointCondition
Source§impl Debug for BreakpointCondition
impl Debug for BreakpointCondition
Source§impl Display for BreakpointCondition
impl Display for BreakpointCondition
Source§impl From<BreakpointCondition> for Value
impl From<BreakpointCondition> for Value
Source§fn from(o: BreakpointCondition) -> Self
fn from(o: BreakpointCondition) -> Self
Source§impl HasParamSpec for BreakpointCondition
impl HasParamSpec for BreakpointCondition
type ParamSpec = ParamSpecBoxed
Source§type SetValue = BreakpointCondition
type SetValue = BreakpointCondition
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, BreakpointCondition>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for BreakpointCondition
impl Hash for BreakpointCondition
Source§impl Ord for BreakpointCondition
impl Ord for BreakpointCondition
Source§fn cmp(&self, other: &BreakpointCondition) -> Ordering
fn cmp(&self, other: &BreakpointCondition) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BreakpointCondition
impl PartialEq for BreakpointCondition
Source§impl PartialOrd for BreakpointCondition
impl PartialOrd for BreakpointCondition
Source§impl StaticType for BreakpointCondition
impl StaticType for BreakpointCondition
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for BreakpointCondition
impl StructuralPartialEq for BreakpointCondition
Auto Trait Implementations§
impl Freeze for BreakpointCondition
impl RefUnwindSafe for BreakpointCondition
impl !Send for BreakpointCondition
impl !Sync for BreakpointCondition
impl Unpin for BreakpointCondition
impl UnwindSafe for BreakpointCondition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)