efl/src/lib/efl/interfaces/efl_gfx_size_hint.eo

243 lines
9.2 KiB
Plaintext

import efl_gfx_types;
const Efl.Gfx.Size.Hint.Expand: double = 1.0;
[[Use with $Efl.Gfx.Size.Hint.weight.]]
const Efl.Gfx.Size.Hint.Fill: double = -1.0;
[[Special value for $Efl.Gfx.Size.Hint.align.]]
interface Efl.Gfx.Size.Hint
{
[[Efl graphics size hint interface]]
event_prefix: efl_gfx;
methods {
@property hint_base {
[[Base size for objects with sizing restrictions.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
@.hint_base + N x @.hint_step is what is calculated for object
sizing restrictions.
See also @.hint_step.
]]
values {
w: int; [[The base width.]]
h: int; [[The base height.]]
}
}
@property hint_step {
[[Step size for objects with sizing restrictions.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
Set this to for an object to scale up by steps and not continuously.
@.hint_base + N x @.hint_step is what is calculated for object
sizing restrictions.
]]
values {
w: int; [[The stepping width (0 disables).]]
h: int; [[The stepping height (0 disables).]]
}
}
@property hint_aspect {
[[Defines the aspect ratio to respect when scaling this object.
The aspect ratio is defined as the width / height ratio of the
object. Depending on the object and its container, this hint may
or may not be fully respected.
If any of the given aspect ratio terms are 0, the object's container
will ignore the aspect and scale this object to occupy the whole
available area, for any given policy.
]]
/*
@image html any-policy.png
@image html aspect-control-none-neither.png
@image html aspect-control-both.png
@image html aspect-control-horizontal.png
*/
values {
mode: Efl.Gfx.Size.Hint.Aspect; [[Mode of interpretation.]]
w: int; [[Width]]
h: int; [[Height]]
/* FIXME: do we want min/max like Edje instead??
min: double; [[Default: 0.0 (no preference).]]
max: double @optional; [[Default: 0.0, may be ignored.]]
*/
}
}
@property hint_max {
[[Hints on the object's maximum size.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
The object container is in charge of fetching this property and
placing the object accordingly.
Values -1 will be treated as unset hint components, when
queried by managers.
Note: Smart objects (such as elementary) can have their own
size hint policy. So calling this API may or may not affect
the size of smart objects.
]]
values {
sz: Eina.Size2D; [[Maximum size (hint) in pixels, (-1, -1) by
default for canvas objects).]]
}
}
@property hint_min {
[[Hints on the object's minimum size.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate. The object container
is in charge of fetching this property and placing the object
accordingly.
Value 0 will be treated as unset hint components, when queried
by managers.
Note: This property is meant to be set by applications and not by
EFL itself. Use this to request a specific size (treated as minimum
size).
]]
values {
sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
}
}
@property hint_restricted_min {
[[Internal hints for an object's minimum size.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
Values 0 will be treated as unset hint components, when
queried by managers.
Note: This property is internal and meant for widget developers to
define the absolute minimum size of the object. EFL itself sets
this size internally, so any change to it from an application
might be ignored. Use @.hint_min instead.
]]
set @protected {
[[This function is protected as it is meant for widgets to indicate
their "intrinsic" minimum size.
]]
}
get {
[[Get the "intrinsic" minimum size of this object.]]
}
values {
sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
}
}
@property hint_combined_min {
[[Read-only minimum size combining both @.hint_restricted_min and
@.hint_min size hints.
@.hint_restricted_min is intended for mostly internal usage
and widget developers, and @.hint_min is intended to be
set from application side. @.hint_combined_min combines both values
by taking their repective maximum (in both width and height), and
is used internally to get an object's minimum size.
]]
get {}
values {
sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
}
}
@property hint_margin {
[[Hints for an object's margin or padding space.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
The object container is in charge of fetching this property and
placing the object accordingly.
Note: Smart objects (such as elementary) can have their own
size hint policy. So calling this API may or may not affect
the size of smart objects.
]]
/*
@image html padding-hints.png
*/
values {
l: int; [[Integer to specify left padding.]]
r: int; [[Integer to specify right padding.]]
t: int; [[Integer to specify top padding.]]
b: int; [[Integer to specify bottom padding.]]
}
}
@property hint_weight {
[[Hints for an object's weight.
This is a hint on how a container object should resize a given
child within its area. Containers may adhere to the simpler
logic of just expanding the child object's dimensions to fit
its own (see the @Efl.Gfx.Size.Hint.Expand helper weight macro) or
the complete one of taking each child's weight hint as real
weights to how much of its size to allocate for them in each
axis. A container is supposed to, after normalizing the
weights of its children (with weight hints), distribut
the space it has to layout them by those factors -- most
weighted children get larger in this process than the least
ones.
Accepted values are zero or positive values. Some containers might
use this hint as a boolean, but some others might consider it as a
proportion, see documentation of each container.
Note: Default weight hint values are 0.0, for both axis.
]]
values {
x: double; [[Non-negative double value to use as horizontal weight hint.]]
y: double; [[Non-negative double value to use as vertical weight hint.]]
}
}
@property hint_align {
[[Hints for an object's alignment.
These are hints on how to align an object inside the
boundaries of a container/manager. Accepted values are in
the 0.0 to 1.0 range, with the special value @Efl.Gfx.Size.Hint.Fill
used to specify "justify" or "fill" by some users. In this
case, maximum size hints should be enforced with higher
priority, if they are set. Also, any padding hint set on
objects should add up to the alignment space on the final
scene composition.
See documentation of possible users: in Evas, they are the
\@ref Evas_Object_Box "box" and \@ref Evas_Object_Table "table"
smart objects.
For the horizontal component, 0.0 means to the left, 1.0
means to the right. Analogously, for the vertical component,
0.0 to the top, 1.0 means to the bottom.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
Note: Default alignment hint values are 0.5, for both axes.
]]
/*
@image html alignment-hints.png
*/
values {
x: double; [[Double, ranging from 0.0 to 1.0 or with the special value
@Efl.Gfx.Size.Hint.Fill, to use as horizontal alignment hint.]]
y: double; [[Double, ranging from 0.0 to 1.0 or with the special value
@Efl.Gfx.Size.Hint.Fill, to use as vertical alignment hint.]]
}
}
}
events {
change,size,hints; [[Object size hints changed.]]
}
}