efl_ui_view_list : change the name of Model based list
Summary: model based list need to be under the namespace of 'Efl.Ui.View". thus, I renamed 'Efl.Ui.List' to 'Efl.Ui.View.List' properly. Test Plan: N/A Reviewers: cedric, felipealmeida Differential Revision: https://phab.enlightenment.org/D5855
This commit is contained in:
parent
d76b6b42da
commit
5100297b49
|
@ -1,4 +1,4 @@
|
|||
// gcc -o efl_ui_list_example_1 efl_ui_list_example_1.c `pkg-config --cflags --libs elementary`
|
||||
// gcc -o efl_ui_view_list_example_1 efl_ui_view_list_example_1.c `pkg-config --cflags --libs elementary`
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "elementary_config.h"
|
||||
|
@ -24,7 +24,7 @@ char edj_path[PATH_MAX];
|
|||
static void
|
||||
_realized_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Efl_Ui_List_Item_Event *ie = event->info;
|
||||
Efl_Ui_View_List_Item_Event *ie = event->info;
|
||||
if (!ie->layout) return;
|
||||
|
||||
Efl_Ui_Layout *layout = ie->layout;
|
||||
|
@ -35,7 +35,7 @@ _realized_cb(void *data, const Efl_Event *event)
|
|||
static void
|
||||
_unrealized_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
Efl_Ui_List_Item_Event *ie = event->info;
|
||||
Efl_Ui_View_List_Item_Event *ie = event->info;
|
||||
|
||||
efl_ui_view_model_set(ie->layout, NULL);
|
||||
efl_del(ie->layout);
|
||||
|
@ -87,13 +87,13 @@ elm_main(int argc, char **argv)
|
|||
efl_ui_model_connect(factory, "elm.text", "name");
|
||||
efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
|
||||
|
||||
li = efl_add(EFL_UI_LIST_CLASS, win);
|
||||
efl_ui_list_layout_factory_set(li, factory);
|
||||
li = efl_add(EFL_UI_VIEW_LIST_CLASS, win);
|
||||
efl_ui_view_list_layout_factory_set(li, factory);
|
||||
efl_ui_view_model_set(li, model);
|
||||
elm_box_pack_end(bx, li);
|
||||
|
||||
efl_event_callback_add(li, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_cb, NULL);
|
||||
// efl_event_callback_add(li, EFL_UI_LIST_EVENT_ITEM_UNREALIZED, _unrealized_cb, NULL);
|
||||
efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_cb, NULL);
|
||||
// efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_UNREALIZED, _unrealized_cb, NULL);
|
||||
|
||||
elm_win_resize_object_add(win, li);
|
||||
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
@ -1,4 +1,4 @@
|
|||
// gcc -o efl_ui_list_example_2 efl_ui_list_example_2.c `pkg-config --cflags --libs elementary`
|
||||
// gcc -o efl_ui_view_list_example_2 efl_ui_view_list_example_2.c `pkg-config --cflags --libs elementary`
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
|
@ -17,7 +17,7 @@
|
|||
static void
|
||||
_realized_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Efl_Ui_List_Item_Event *ie = event->info;
|
||||
Efl_Ui_View_List_Item_Event *ie = event->info;
|
||||
Eo *imf = data;
|
||||
printf("realize %d\n", ie->index);
|
||||
|
||||
|
@ -48,8 +48,8 @@ elm_main(int argc, char **argv)
|
|||
efl_ui_model_connect(factory, "elm.text", "filename");
|
||||
efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
|
||||
|
||||
li = efl_add(EFL_UI_LIST_CLASS, win);
|
||||
efl_ui_list_layout_factory_set(li, factory);
|
||||
li = efl_add(EFL_UI_VIEW_LIST_CLASS, win);
|
||||
efl_ui_view_list_layout_factory_set(li, factory);
|
||||
efl_ui_view_model_set(li, model);
|
||||
|
||||
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
@ -58,7 +58,7 @@ elm_main(int argc, char **argv)
|
|||
|
||||
imf = efl_add(EFL_UI_IMAGE_FACTORY_CLASS, win);
|
||||
efl_ui_model_connect(imf, "", "path"); //connect to "path" property
|
||||
efl_event_callback_add(li, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_cb, imf);
|
||||
efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_cb, imf);
|
||||
|
||||
elm_win_resize_object_add(win, li);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// gcc -o efl_ui_list_example_3 efl_ui_list_example_3.c `pkg-config --cflags --libs elementary`
|
||||
// gcc -o efl_ui_view_list_example_3 efl_ui_view_list_example_3.c `pkg-config --cflags --libs elementary`
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
|
@ -113,21 +113,21 @@ static void
|
|||
_bt_none_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *li = data;
|
||||
efl_ui_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_NONE);
|
||||
efl_ui_view_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
_bt_donly_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *li = data;
|
||||
efl_ui_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
|
||||
efl_ui_view_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
|
||||
}
|
||||
|
||||
static void
|
||||
_bt_default_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *li = data;
|
||||
efl_ui_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DEFAULT);
|
||||
efl_ui_view_list_select_mode_set(li, ELM_OBJECT_SELECT_MODE_DEFAULT);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -146,7 +146,7 @@ _bt_unset_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
static void
|
||||
_realized_1_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
Efl_Ui_List_Item_Event *ie = event->info;
|
||||
Efl_Ui_View_List_Item_Event *ie = event->info;
|
||||
|
||||
evas_object_size_hint_weight_set(ie->layout, EVAS_HINT_EXPAND, 0);
|
||||
evas_object_size_hint_align_set(ie->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -157,7 +157,7 @@ _realized_1_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
|||
static void
|
||||
_realized_2_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
Efl_Ui_List_Item_Event *ie = event->info;
|
||||
Efl_Ui_View_List_Item_Event *ie = event->info;
|
||||
printf("relized 2\n");
|
||||
|
||||
elm_object_focus_allow_set(ie->layout, EINA_TRUE);
|
||||
|
@ -225,22 +225,22 @@ elm_main(int argc, char **argv)
|
|||
efl_ui_model_connect(factory, "elm.text", "filename");
|
||||
efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
|
||||
|
||||
priv->list1 = efl_add(EFL_UI_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
|
||||
efl_event_callback_add(priv->list1, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_1_cb, priv);
|
||||
priv->list1 = efl_add(EFL_UI_VIEW_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
|
||||
efl_event_callback_add(priv->list1, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_1_cb, priv);
|
||||
evas_object_size_hint_weight_set(priv->list1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(priv->list1, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_box_pack_end(bx, priv->list1);
|
||||
efl_ui_list_layout_factory_set(priv->list1, factory);
|
||||
efl_ui_view_list_layout_factory_set(priv->list1, factory);
|
||||
|
||||
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
|
||||
efl_ui_model_connect(factory, "elm.text", "filename");
|
||||
efl_ui_model_connect(factory, "signal/elm,state,%v", "selected");
|
||||
efl_ui_layout_factory_theme_config(factory, "list", "item", "default");
|
||||
priv->list2 = efl_add(EFL_UI_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
|
||||
efl_event_callback_add(priv->list2, EFL_UI_LIST_EVENT_ITEM_REALIZED, _realized_2_cb, priv->list2);
|
||||
priv->list2 = efl_add(EFL_UI_VIEW_LIST_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
|
||||
efl_event_callback_add(priv->list2, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_2_cb, priv->list2);
|
||||
evas_object_size_hint_weight_set(priv->list2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(priv->list2, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
efl_ui_list_layout_factory_set(priv->list2, factory);
|
||||
efl_ui_view_list_layout_factory_set(priv->list2, factory);
|
||||
|
||||
vbx = elm_box_add(win);
|
||||
elm_box_pack_end(bx, vbx);
|
Loading…
Reference in New Issue