efl/src/lib/efl/interfaces/efl_gfx_hint.eo

226 lines
8.5 KiB
Plaintext

import eina_types;
import efl_gfx_types;
const Efl.Gfx.Hint_Expand: double = 1.0;
[[Use with @Efl.Gfx.Hint.hint_weight.]]
interface Efl.Gfx.Hint
{
[[Efl graphics hint interface
@since 1.22
]]
event_prefix: efl_gfx_entity;
methods {
@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.Hint_Aspect; [[Mode of interpretation.]]
sz: Eina.Size2D; [[Base size to use for aspecting.]]
/* 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_size_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
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_size_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_size_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_size_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_size_combined_min {
[[Read-only minimum size combining both @.hint_size_restricted_min and
@.hint_size_min hints.
@.hint_size_restricted_min is intended for mostly internal usage
and widget developers, and @.hint_size_min is intended to be
set from application side. @.hint_size_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
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.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.
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.]]
y: double; [[Double, ranging from 0.0 to 1.0.]]
}
}
@property hint_fill {
[[Hints for an object's fill property that used to specify "justify"
or "fill" by some users. @.hint_fill specify whether to fill
the space inside the boundaries of a container/manager.
Maximum hints should be enforced with higher
priority, if they are set. Also, any @.hint_margin set on
objects should add up to the object space on the final
scene composition.
See documentation of possible users: in Evas, they are the
@Efl.Ui.Box "box" and @Efl.Ui.Table "table" smart objects.
This is not a size enforcement in any way, it's just a hint
that should be used whenever appropriate.
Note: Default fill hint values are true, for both axes.
]]
values {
x: bool; [[$true if to fill the object space, $false otherwise,
to use as horizontal fill hint.]]
y: bool; [[$true if to fill the object space, $false otherwise,
to use as vertical fill hint.]]
}
}
}
events {
hints,changed: void; [[Object hints changed.]]
}
}