2018-03-27 04:27:32 -07:00
|
|
|
import eina_types;
|
2016-06-07 22:56:51 -07:00
|
|
|
import efl_gfx_types;
|
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
const Efl.Gfx.Hint_Expand: double = 1.0;
|
|
|
|
[[Use with @Efl.Gfx.Hint.hint_weight.]]
|
2016-11-09 03:06:14 -08:00
|
|
|
|
2019-07-26 00:02:01 -07:00
|
|
|
const Efl.Gfx.Hint_Align_Left: double = 0.0;
|
|
|
|
[[Use with @Efl.Gfx.Hint.hint_align.]]
|
|
|
|
const Efl.Gfx.Hint_Align_Right: double = 1.0;
|
|
|
|
[[Use with @Efl.Gfx.Hint.hint_align.]]
|
|
|
|
const Efl.Gfx.Hint_Align_Top: double = 0.0;
|
|
|
|
[[Use with @Efl.Gfx.Hint.hint_align.]]
|
|
|
|
const Efl.Gfx.Hint_Align_Bottom: double = 1.0;
|
|
|
|
[[Use with @Efl.Gfx.Hint.hint_align.]]
|
|
|
|
const Efl.Gfx.Hint_Align_Center: double = 0.5;
|
|
|
|
[[Use with @Efl.Gfx.Hint.hint_align.]]
|
|
|
|
|
efl: apply the stabilzed column of the efl api board
Summary:
The project https://phab.enlightenment.org/tag/efl_api/ has been used in
the last few weeks to figure out which classes can be stablized and
which cannot. This commit moves those dedicated classes outside beta.
And makes them stable.
ref T7601
ref T7600
ref T7599
ref T7598
ref T7597
ref T7596
ref T7594
ref T7593
ref T7591
ref T7590
ref T7589
ref T7588
ref T7583
ref T7582
ref T7581
ref T7576
ref T7570
ref T7567
ref T7564
ref T7563
ref T7560
ref T7559
ref T7672
ref T7584
ref T7577
ref T7571
ref T7558
ref T7555
ref T7554
ref T7553
ref T7512
ref T7511
Depends on D8272
Reviewers: cedric, stefan_schmidt, zmike, segfaultxavi
Reviewed By: segfaultxavi
Subscribers: #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7672, T7601, T7600, T7599, T7598, T7597, T7596, T7594, T7593, T7591, T7590, T7589, T7588, T7584, T7583, T7582, T7581, T7577, T7576, T7571, T7570, T7567, T7564, T7563, T7560, T7559, T7558, T7555, T7554, T7553, T7512, T7511
Differential Revision: https://phab.enlightenment.org/D8273
2019-03-09 04:44:17 -08:00
|
|
|
interface Efl.Gfx.Hint
|
2016-06-07 22:56:51 -07:00
|
|
|
{
|
2019-03-22 08:25:22 -07:00
|
|
|
[[Efl graphics hint interface
|
|
|
|
|
|
|
|
@since 1.22
|
|
|
|
]]
|
2018-04-05 01:47:26 -07:00
|
|
|
event_prefix: efl_gfx_entity;
|
2016-06-02 01:18:17 -07:00
|
|
|
methods {
|
2016-06-08 01:19:17 -07:00
|
|
|
@property hint_aspect {
|
2016-06-07 22:56:51 -07:00
|
|
|
[[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 {
|
2019-02-21 09:19:45 -08:00
|
|
|
mode: Efl.Gfx.Hint_Aspect; [[Mode of interpretation.]]
|
2017-09-18 00:44:42 -07:00
|
|
|
sz: Eina.Size2D; [[Base size to use for aspecting.]]
|
2016-06-07 22:56:51 -07:00
|
|
|
|
|
|
|
/* 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.]]
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
2019-02-21 09:19:45 -08:00
|
|
|
@property hint_size_max {
|
2016-06-08 00:09:38 -07:00
|
|
|
[[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
|
2019-02-21 09:19:45 -08:00
|
|
|
hint policy. So calling this API may or may not affect
|
2016-06-08 00:09:38 -07:00
|
|
|
the size of smart objects.
|
|
|
|
]]
|
|
|
|
values {
|
2017-09-17 22:07:56 -07:00
|
|
|
sz: Eina.Size2D; [[Maximum size (hint) in pixels, (-1, -1) by
|
|
|
|
default for canvas objects).]]
|
2016-06-08 00:09:38 -07:00
|
|
|
}
|
|
|
|
}
|
2019-02-21 09:19:45 -08:00
|
|
|
@property hint_size_min {
|
2016-06-09 00:24:13 -07:00
|
|
|
[[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 {
|
2017-09-17 22:35:22 -07:00
|
|
|
sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
|
2016-06-09 00:24:13 -07:00
|
|
|
}
|
|
|
|
}
|
2019-02-21 09:19:45 -08:00
|
|
|
@property hint_size_restricted_min {
|
2016-06-08 00:09:38 -07:00
|
|
|
[[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
|
2019-02-21 09:19:45 -08:00
|
|
|
might be ignored. Use @.hint_size_min instead.
|
2016-06-08 00:09:38 -07:00
|
|
|
]]
|
2017-09-17 22:49:08 -07:00
|
|
|
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.]]
|
|
|
|
}
|
2016-06-08 00:09:38 -07:00
|
|
|
values {
|
2017-09-17 22:49:08 -07:00
|
|
|
sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
|
2016-06-08 00:09:38 -07:00
|
|
|
}
|
|
|
|
}
|
2019-02-21 09:19:45 -08:00
|
|
|
@property hint_size_combined_min {
|
|
|
|
[[Read-only minimum size combining both @.hint_size_restricted_min and
|
|
|
|
@.hint_size_min hints.
|
2016-06-08 04:24:59 -07:00
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
@.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
|
2016-06-08 04:24:59 -07:00
|
|
|
by taking their repective maximum (in both width and height), and
|
|
|
|
is used internally to get an object's minimum size.
|
|
|
|
]]
|
|
|
|
get {}
|
|
|
|
values {
|
2017-09-18 00:22:01 -07:00
|
|
|
sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
|
2016-06-08 04:24:59 -07:00
|
|
|
}
|
|
|
|
}
|
2016-06-08 00:09:38 -07:00
|
|
|
@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
|
2019-02-21 09:19:45 -08:00
|
|
|
hint policy. So calling this API may or may not affect
|
2016-06-08 00:09:38 -07:00
|
|
|
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
|
2019-02-21 09:19:45 -08:00
|
|
|
its own (see the @Efl.Gfx.Hint_Expand helper weight macro) or
|
2016-06-08 00:09:38 -07:00
|
|
|
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
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
the 0.0 to 1.0 range.
|
2016-06-08 00:09:38 -07:00
|
|
|
|
|
|
|
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 {
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
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.
|
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
Maximum hints should be enforced with higher
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
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.]]
|
2016-06-08 00:09:38 -07:00
|
|
|
}
|
|
|
|
}
|
2016-06-02 01:18:17 -07:00
|
|
|
}
|
2016-06-13 22:24:43 -07:00
|
|
|
events {
|
2019-02-21 09:46:36 -08:00
|
|
|
hints,changed: void; [[Object hints changed.]]
|
2016-06-13 22:24:43 -07:00
|
|
|
}
|
2016-06-02 01:18:17 -07:00
|
|
|
}
|