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.]]
|
|
|
|
}
|
|
|
|
|
|
|
|
class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl.Pack_Linear
|
|
|
|
{
|
|
|
|
[[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.
|
2019-07-04 16:02:43 -07:00
|
|
|
]]
|
|
|
|
c_prefix: efl_ui_spotlight;
|
|
|
|
methods {
|
|
|
|
@property spotlight_manager {
|
|
|
|
[[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).
|
|
|
|
]]
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
@property indicator {
|
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.
|
|
|
|
]]
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
push @beta {
|
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
|
|
|
[[Packs a new sub-widget before @.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.
|
|
|
|
|
|
|
|
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-09-02 07:24:26 -07:00
|
|
|
The sub-widgets behind it naturally flow down so the next one gets the spotlight.
|
|
|
|
This is the same behavior as a pop operation on a stack.
|
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
|
|
|
When combined with @.push you don't have to worry about @.active_element since only the first sub-widget is
|
2019-09-02 07:24:26 -07:00
|
|
|
manipulated.
|
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 {
|
|
|
|
transition,start : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has started.]]
|
|
|
|
transition,end : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has ended.]]
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|