Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Describes condition for an [classbreakpoint
].
Since: 1.4
Synopsis
- newtype BreakpointCondition = BreakpointCondition (ManagedPtr BreakpointCondition)
- breakpointConditionCopy :: (HasCallStack, MonadIO m) => BreakpointCondition -> m BreakpointCondition
- breakpointConditionFree :: (HasCallStack, MonadIO m) => BreakpointCondition -> m ()
- breakpointConditionNewAnd :: (HasCallStack, MonadIO m) => BreakpointCondition -> BreakpointCondition -> m BreakpointCondition
- breakpointConditionNewLength :: (HasCallStack, MonadIO m) => BreakpointConditionLengthType -> Double -> LengthUnit -> m BreakpointCondition
- breakpointConditionNewOr :: (HasCallStack, MonadIO m) => BreakpointCondition -> BreakpointCondition -> m BreakpointCondition
- breakpointConditionNewRatio :: (HasCallStack, MonadIO m) => BreakpointConditionRatioType -> Int32 -> Int32 -> m BreakpointCondition
- breakpointConditionParse :: (HasCallStack, MonadIO m) => Text -> m BreakpointCondition
- breakpointConditionToString :: (HasCallStack, MonadIO m) => BreakpointCondition -> m Text
Exported types
newtype BreakpointCondition Source #
Memory-managed wrapper type.
BreakpointCondition (ManagedPtr BreakpointCondition) |
Instances
Methods
Click to display all available methods, including inherited ones
copy
breakpointConditionCopy Source #
:: (HasCallStack, MonadIO m) | |
=> BreakpointCondition |
|
-> m BreakpointCondition | Returns: a copy of |
Copies self
.
Since: 1.4
free
breakpointConditionFree Source #
:: (HasCallStack, MonadIO m) | |
=> BreakpointCondition |
|
-> m () |
Frees self
.
Since: 1.4
newAnd
breakpointConditionNewAnd Source #
:: (HasCallStack, MonadIO m) | |
=> BreakpointCondition |
|
-> BreakpointCondition |
|
-> m BreakpointCondition | Returns: the newly created condition |
Creates a condition that triggers when condition1
and condition2
are both
true.
Since: 1.4
newLength
breakpointConditionNewLength Source #
:: (HasCallStack, MonadIO m) | |
=> BreakpointConditionLengthType |
|
-> Double |
|
-> LengthUnit |
|
-> m BreakpointCondition | Returns: the newly created condition |
Creates a condition that triggers on length changes.
Since: 1.4
newOr
breakpointConditionNewOr Source #
:: (HasCallStack, MonadIO m) | |
=> BreakpointCondition |
|
-> BreakpointCondition |
|
-> m BreakpointCondition | Returns: the newly created condition |
Creates a condition that triggers when either condition1
or condition2
is
true.
Since: 1.4
newRatio
breakpointConditionNewRatio Source #
:: (HasCallStack, MonadIO m) | |
=> BreakpointConditionRatioType |
|
-> Int32 |
|
-> Int32 |
|
-> m BreakpointCondition | Returns: the newly created condition |
Creates a condition that triggers on ratio changes.
The ratio is represented as width
divided by height
.
Since: 1.4
parse
breakpointConditionParse Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m BreakpointCondition | Returns: the parsed condition |
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 [ctorbreakpointCondition
.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 [ctorbreakpointCondition
.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 using [ctorbreakpointCondition
.new_and]<condition> or <condition>
: the condition is true when either of the<condition>
s is true, same as when using [ctorbreakpointCondition
.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.
Since: 1.4
toString
breakpointConditionToString Source #
:: (HasCallStack, MonadIO m) | |
=> BreakpointCondition |
|
-> m Text | Returns: A newly allocated text string |
Returns a textual representation of self
.
The returned string can be parsed by BreakpointCondition.parse
.
Since: 1.4