Class BreakpointCondition
-
Constructor Summary
ConstructorDescriptionBreakpointCondition
(MemorySegment address) Create a BreakpointCondition proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic BreakpointCondition
and
(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers whencondition1
andcondition2
are both true.copy()
Copies this BreakpointCondition.void
free()
Frees this BreakpointCondition.static Type
getType()
Get the GType of the BreakpointCondition classstatic BreakpointCondition
length
(BreakpointConditionLengthType type, double value, LengthUnit unit) Creates a condition that triggers on length changes.static BreakpointCondition
or
(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers when eithercondition1
orcondition2
is true.static BreakpointCondition
Parses a condition from a string.static BreakpointCondition
ratio
(BreakpointConditionRatioType type, int width, int height) Creates a condition that triggers on ratio changes.toString()
Returns a textual representation of this BreakpointCondition.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
BreakpointCondition
Create a BreakpointCondition proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
and
public static BreakpointCondition and(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers whencondition1
andcondition2
are both true.- Parameters:
condition1
- first conditioncondition2
- second condition- Returns:
- the newly created condition
-
length
public static BreakpointCondition length(BreakpointConditionLengthType type, double value, LengthUnit unit) Creates a condition that triggers on length changes.- Parameters:
type
- the length typevalue
- the length valueunit
- the length unit- Returns:
- the newly created condition
-
or
public static BreakpointCondition or(BreakpointCondition condition1, BreakpointCondition condition2) Creates a condition that triggers when eithercondition1
orcondition2
is true.- Parameters:
condition1
- first conditioncondition2
- second condition- Returns:
- the newly created condition
-
ratio
Creates a condition that triggers on ratio changes.The ratio is represented as
width
divided byheight
.- Parameters:
type
- the ratio typewidth
- ratio widthheight
- ratio height- Returns:
- the newly created condition
-
parse
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
length(org.gnome.adw.BreakpointConditionLengthType, double, org.gnome.adw.LengthUnit)
.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
ratio(org.gnome.adw.BreakpointConditionRatioType, int, int)
.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 usingand(org.gnome.adw.BreakpointCondition, org.gnome.adw.BreakpointCondition)
<condition> or <condition>
: the condition is true when either of the<condition>
s is true, same as when usingor(org.gnome.adw.BreakpointCondition, org.gnome.adw.BreakpointCondition)
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.
- Parameters:
str
- the string specifying the condition- Returns:
- the parsed condition
-
copy
Copies this BreakpointCondition.- Returns:
- a copy of this BreakpointCondition
-
free
public void free()Frees this BreakpointCondition. -
toString
Returns a textual representation of this BreakpointCondition.The returned string can be parsed by
parse(java.lang.String)
.
-