2018-05-02 05:10:16 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2019-08-29 05:07:47 -07:00
|
|
|
#include <Efl_Ui.h>
|
2018-05-02 05:10:16 -07:00
|
|
|
#include "elm_priv.h"
|
|
|
|
|
|
|
|
#include "efl_ui_tab_pager_private.h"
|
|
|
|
#include "efl_ui_tab_page_private.h"
|
|
|
|
|
|
|
|
#define MY_CLASS EFL_UI_TAB_PAGER_CLASS
|
|
|
|
|
|
|
|
static void
|
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
|
|
|
_select(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Page *page)
|
2018-05-02 05:10:16 -07:00
|
|
|
{
|
2019-08-23 08:51:49 -07:00
|
|
|
efl_ui_selectable_selected_set(efl_ui_tab_page_tab_bar_item_get(page), EINA_TRUE);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_tab_select_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
2019-08-23 08:51:49 -07:00
|
|
|
Efl_Ui_Tab_Bar_Default_Item *selected;
|
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
|
|
|
Efl_Ui_Tab_Page *page;
|
2019-08-23 08:51:49 -07:00
|
|
|
|
|
|
|
selected = efl_ui_single_selectable_last_selected_get(event->object);
|
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
|
|
|
page = efl_parent_get(selected);
|
|
|
|
if (efl_ui_spotlight_active_element_get(data))
|
|
|
|
efl_ui_spotlight_active_element_set(data, page);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Efl_Canvas_Object *
|
|
|
|
_efl_ui_tab_pager_tab_bar_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Pager_Data *sd)
|
|
|
|
{
|
|
|
|
return sd->tab_bar;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
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
|
|
|
_efl_ui_tab_pager_efl_ui_spotlight_container_active_element_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd EINA_UNUSED, Efl_Ui_Widget *element)
|
2018-05-02 05:10:16 -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
|
|
|
efl_ui_spotlight_active_element_set(efl_super(obj, MY_CLASS), element);
|
|
|
|
_select(obj, element);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_tab_pager_efl_object_destructor(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
|
|
|
|
{
|
|
|
|
if (sd->tab_bar != NULL)
|
2019-03-19 13:30:19 -07:00
|
|
|
efl_event_callback_del(sd->tab_bar, EFL_UI_EVENT_ITEM_SELECTED, _tab_select_cb, obj);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
efl_destructor(efl_super(obj, MY_CLASS));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Efl_Object *
|
|
|
|
_efl_ui_tab_pager_efl_object_constructor(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
|
|
|
|
{
|
|
|
|
if (!elm_widget_theme_klass_get(obj))
|
|
|
|
elm_widget_theme_klass_set(obj, "tab_pager");
|
|
|
|
|
|
|
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
|
|
|
|
|
|
|
efl_ui_widget_focus_allow_set(obj, EINA_TRUE);
|
|
|
|
|
2019-08-23 10:16:56 -07:00
|
|
|
sd->tab_bar = efl_add(EFL_UI_TAB_BAR_CLASS, obj);
|
|
|
|
efl_event_callback_add(sd->tab_bar, EFL_UI_EVENT_ITEM_SELECTED, _tab_select_cb, obj);
|
2018-05-02 05:10:16 -07:00
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2019-08-23 10:16:56 -07:00
|
|
|
EOLIAN static Efl_Object*
|
|
|
|
_efl_ui_tab_pager_efl_object_finalize(Eo *obj, Efl_Ui_Tab_Pager_Data *pd)
|
|
|
|
{
|
|
|
|
obj = efl_finalize(efl_super(obj, MY_CLASS));
|
|
|
|
|
|
|
|
efl_content_set(efl_part(obj, "efl.tab_root"), pd->tab_bar);
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2018-05-02 05:10:16 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_pack_clear(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_clear(sd->tab_bar))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_clear(efl_super(obj, MY_CLASS));
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_unpack_all(Eo *obj, Efl_Ui_Tab_Pager_Data *sd)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_unpack_all(sd->tab_bar))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_unpack_all(efl_super(obj, MY_CLASS));
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
2019-08-23 10:34:53 -07:00
|
|
|
#define ITEM(s) efl_ui_tab_page_tab_bar_item_get(s)
|
|
|
|
|
2018-05-02 05:10:16 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_unpack(Eo *obj, Efl_Ui_Tab_Pager_Data *sd, Efl_Gfx_Entity *subobj)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_unpack(sd->tab_bar, ITEM(subobj)))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_unpack(efl_super(obj, MY_CLASS), subobj);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_linear_pack_begin(Eo *obj,
|
|
|
|
Efl_Ui_Tab_Pager_Data *sd,
|
|
|
|
Efl_Gfx_Entity *subobj)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_begin(sd->tab_bar, ITEM(subobj)))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_begin(efl_super(obj, MY_CLASS), subobj);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_linear_pack_end(Eo *obj,
|
|
|
|
Efl_Ui_Tab_Pager_Data *sd,
|
|
|
|
Efl_Gfx_Entity *subobj)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_end(sd->tab_bar, ITEM(subobj)))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_end(efl_super(obj, MY_CLASS), subobj);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_linear_pack_before(Eo *obj,
|
|
|
|
Efl_Ui_Tab_Pager_Data *sd,
|
|
|
|
Efl_Gfx_Entity *subobj,
|
|
|
|
const Efl_Gfx_Entity *existing)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_before(sd->tab_bar, ITEM(subobj), ITEM(existing)))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_before(efl_super(obj, MY_CLASS), subobj, existing);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_linear_pack_after(Eo *obj,
|
|
|
|
Efl_Ui_Tab_Pager_Data *sd,
|
|
|
|
Efl_Gfx_Entity *subobj,
|
|
|
|
const Efl_Gfx_Entity *existing)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_after(sd->tab_bar, ITEM(subobj), ITEM(existing)))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_after(efl_super(obj, MY_CLASS), subobj, existing);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_tab_pager_efl_pack_linear_pack_at(Eo *obj,
|
|
|
|
Efl_Ui_Tab_Pager_Data *sd,
|
|
|
|
Efl_Gfx_Entity *subobj,
|
|
|
|
int index)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_at(sd->tab_bar, ITEM(subobj), index))
|
|
|
|
return EINA_FALSE;
|
|
|
|
return efl_pack_at(efl_super(obj, MY_CLASS), subobj, index);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Efl_Gfx_Entity *
|
|
|
|
_efl_ui_tab_pager_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Tab_Pager_Data *sd, int index)
|
|
|
|
{
|
2019-08-23 10:34:53 -07:00
|
|
|
if (!efl_pack_unpack_at(sd->tab_bar, index))
|
|
|
|
return NULL;
|
|
|
|
return efl_pack_unpack_at(efl_super(obj, MY_CLASS), index);
|
2018-05-02 05:10:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "efl_ui_tab_pager.eo.c"
|