2019-07-04 16:02:43 -07:00
struct @beta Efl.Ui.Spotlight.Transition_Event {
[[Information regarding transition events.]]
from : int; [[The index from where the transition started, -1 if not known.]]
to : int; [[The index to where the transition is headed, -1 if not known.]]
}
2020-01-20 04:22:59 -08:00
class Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack_Linear
2019-07-04 16:02:43 -07:00
{
[[The Spotlight widget is a container for other sub-widgets, where only one sub-widget is active at any given time.
2019-09-02 07:24:26 -07:00
Sub-widgets are added using the @Efl.Pack_Linear interface and the active one (the one in the "spotlight") is
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
selected using @.active_element.
2019-07-04 16:02:43 -07:00
2019-09-02 07:24:26 -07:00
The way the different sub-widgets are rendered can be customized through the @.spotlight_manager object.
For example, only the active sub-widget might be shown, or it might be shown in a central position whereas the
other sub-widgets are displayed on the sides, or grayed-out.
2019-07-04 16:02:43 -07:00
All sub-widgets are displayed with the same size, selected with @.spotlight_size.
2019-09-02 07:24:26 -07:00
Additionally, the transition from one sub-widget to another can be animated.
This animation is also controlled by the @.spotlight_manager object.
2019-07-04 16:02:43 -07:00
2019-09-02 07:24:26 -07:00
Also, an indicator widget can be used to show a visual cue of how many sub-widgets are there and which one is the
active one.
2019-07-04 16:02:43 -07:00
2019-09-02 07:24:26 -07:00
This class can be used to create other widgets like Pagers, Tabbed pagers or Stacks, where each sub-widget
represents a "page" full of other widgets. All these cases can be implemented with a different
@.spotlight_manager and use the same @Efl.Ui.Spotlight.Container.
2020-01-31 07:11:57 -08:00
@since 1.24
2019-07-04 16:02:43 -07:00
]]
c_prefix: efl_ui_spotlight;
methods {
2020-01-20 04:22:59 -08:00
@property spotlight_manager @beta {
2019-07-04 16:02:43 -07:00
[[This object defines how sub-widgets are rendered and animated.
If it is not set, only the active sub-widget is shown and transitions are instantaneous (not animated).
]]
2019-12-06 06:57:52 -08:00
get {
values {
spotlight_manager : Efl.Ui.Spotlight.Manager; [[The Spotlight Manager object or $NULL.]]
}
}
set { }
2019-07-04 16:02:43 -07:00
values {
2019-09-06 08:01:05 -07:00
spotlight_manager : Efl.Ui.Spotlight.Manager @move; [[The Spotlight Manager object or $NULL.]]
2019-07-04 16:02:43 -07:00
}
}
2020-01-20 04:22:59 -08:00
@property indicator @beta {
2019-09-02 07:24:26 -07:00
[[An indicator object to use, which will display the current state of the spotlight (number of sub-widgets
and active one).
2019-07-04 16:02:43 -07:00
When this object is set, it is immediately updated to reflect the current state of the widget.
Its location inside the container is controlled by the @.spotlight_manager.
]]
2019-12-06 06:57:52 -08:00
get {
values {
indicator : Efl.Ui.Spotlight.Indicator; [[The Indicator object or $NULL.]]
}
}
set { }
2019-07-04 16:02:43 -07:00
values {
2019-09-06 08:01:05 -07:00
indicator : Efl.Ui.Spotlight.Indicator @move; [[The Indicator object or $NULL.]]
2019-07-04 16:02:43 -07:00
}
}
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
@property active_element {
2019-07-04 16:02:43 -07:00
[[Currently active sub-widget (the one with the spotlight) among all the sub-widgets added to this widget
Changing this value might trigger an animation.
]]
values {
efl_ui_spotlight: migrate from active_index to active_element
after playing arround with the widget, we found out that it feels quite
weird to have a index, where most of the time you work with widgets.
We might want to add syntax suger in the future to make it easier to
just jump to the next element, or to the previous, but that still is to
be decided.
The event and the communication to the spotlight manager are still left
to be used with the index, reason for this is, that we might need to
fill there an invalid pointer, if a deletion is triggering an animation,
which seems quite weird. That needs further discussing.
Docx have been updated, the sitemarks about the shifting of the
active_index can be removed, as the element is not subject of change
during content adds/deletes.
ref T7991
Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9813
2019-09-02 01:26:40 -07:00
element : Efl.Ui.Widget; [[Sub-widget that has the spotlight.
The element has to be added prior to this call via the @Efl.Pack_Linear interface.]]
2019-07-04 16:02:43 -07:00
}
}
@property spotlight_size {
2019-09-02 07:24:26 -07:00
[[The size to use when displaying the Sub-Widget which has the spotlight.
This is used by the @.spotlight_manager to perform the rendering.
2019-07-04 16:02:43 -07:00
Sub-Widgets other than the Active one may or may not use this size.]]
values {
2019-09-02 07:24:26 -07:00
size: Eina.Size2D; [[Render size for the spotlight.
(-1, -1) means that all available space inside the container can be used.]]
2019-07-04 16:02:43 -07:00
}
}
2019-11-20 07:16:22 -08:00
@property animated_transition {
[[When this flag is $true the transitions caused by @.push, @.pop or @.active_element are animated (if the @.spotlight_manager supports that). $false means immidiate displaying at the final position.]]
values {
enable : bool; [[$true to enable animated transitions. If $false, then any transition is displayed at the final position immidiatly]]
}
}
2019-07-04 16:02:43 -07:00
push @beta {
2019-12-03 04:51:52 -08:00
[[Packs a new sub-widget after @.active_element, and move the spotlight there.
2019-07-04 16:02:43 -07:00
This is the same behavior as a push operation on a stack.
2019-12-03 04:51:52 -08:00
When sub-widgets are added using only @.push and @.pop you don't have to worry about @.active_element
since only the last sub-widget is manipulated, and this container behaves like a traditional stack.
2019-07-04 16:02:43 -07:00
An animation might be triggered to give the new sub-widget the spotlight and come into position.
]]
params {
widget : Efl.Gfx.Entity; [[Sub-Widget to add and set to be the spotlight sub-widget.]]
}
}
pop @beta {
[[Removes the sub-widget that has the spotlight from the widget.
2019-12-03 04:51:52 -08:00
The spotlight is moved to the previous sub-widget.
2019-09-02 07:24:26 -07:00
This is the same behavior as a pop operation on a stack.
2019-12-03 04:51:52 -08:00
When sub-widgets are added using only @.push and @.pop you don't have to worry about @.active_element
since only the last sub-widget is manipulated, and this container behaves like a traditional stack.
2019-07-04 16:02:43 -07:00
2019-09-02 07:24:26 -07:00
An animation might be triggered to give the new sub-widget the spotlight, come into position and the old
one disappear.
2019-07-04 16:02:43 -07:00
The removed sub-widget can be returned to the caller or deleted (depending on $delete_on_transition_end).
]]
params {
2019-09-02 07:24:26 -07:00
deletion_on_transition_end : bool; [[If $true, then the object will be deleted before resolving the future,
2019-09-10 07:05:44 -07:00
and a $NULL pointer is the value of the future.
2019-09-02 07:24:26 -07:00
$false if no operation should be applied to it.]]
2019-07-04 16:02:43 -07:00
}
2019-09-02 07:24:26 -07:00
return : future<Efl.Gfx.Entity>; [[This Future gets resolved when any transition animation finishes and the
popped sub-widget is ready for collection.
If there is no animation, the Future resolves immediately.
If $deletion_on_transition_end is $true then this widget will destroy the
popped sub-widget and the Future will contain no Value.
Otherwise, the caller becomes the owner of the sub-widget contained in the
Future and must dispose of it appropriately. ]]
2019-07-04 16:02:43 -07:00
}
}
events {
2020-01-20 04:22:59 -08:00
transition,start @beta : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has started.]]
transition,end @beta : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has ended.]]
2019-07-04 16:02:43 -07:00
}
implements {
Efl.Object.constructor;
Efl.Object.finalize;
Efl.Object.invalidate;
Efl.Container.content_count;
Efl.Container.content_iterate;
Efl.Pack.pack_clear;
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
Efl.Pack_Linear.pack_begin;
Efl.Pack_Linear.pack_end;
Efl.Pack_Linear.pack_before;
Efl.Pack_Linear.pack_after;
Efl.Pack_Linear.pack_at;
Efl.Pack_Linear.pack_content_get;
Efl.Pack_Linear.pack_index_get;
Efl.Pack_Linear.pack_unpack_at;
2019-11-28 08:13:07 -08:00
Efl.Canvas.Group.group_calculate;
2019-07-04 16:02:43 -07:00
}
}