efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
// gcc -o efl_ui_list_view_example_2 efl_ui_list_view_example_2.c `pkg-config --cflags --libs elementary`
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#else
|
|
|
|
# define EFL_BETA_API_SUPPORT 1
|
|
|
|
# define EFL_EO_API_SUPPORT 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
#include <Efl.h>
|
|
|
|
#include <Eio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define EFL_MODEL_TEST_FILENAME_PATH "/tmp"
|
|
|
|
|
|
|
|
EAPI_MAIN int
|
|
|
|
elm_main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
Efl_Ui_Layout_Factory *factory;
|
2018-08-01 14:42:13 -07:00
|
|
|
Efl_Ui_Image_Factory *imgf;
|
2017-12-12 16:59:48 -08:00
|
|
|
Evas_Object *win;
|
2018-08-01 14:42:13 -07:00
|
|
|
Eo *model, *li;
|
2017-12-12 16:59:48 -08:00
|
|
|
char *dirname;
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
win = elm_win_util_standard_add("list_view2", "List_View2");
|
2017-12-12 16:59:48 -08:00
|
|
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
|
|
|
|
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
|
|
|
|
|
|
|
if (argv[1] != NULL) dirname = argv[1];
|
|
|
|
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
|
|
|
|
|
2018-06-07 14:50:48 -07:00
|
|
|
model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
|
2017-12-12 16:59:48 -08:00
|
|
|
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
|
2018-04-30 02:54:32 -07:00
|
|
|
efl_ui_model_connect(factory, "efl.text", "filename");
|
2018-04-22 23:13:59 -07:00
|
|
|
efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
li = efl_add(EFL_UI_LIST_VIEW_CLASS, win);
|
|
|
|
efl_ui_list_view_layout_factory_set(li, factory);
|
2017-12-12 16:59:48 -08:00
|
|
|
efl_ui_view_model_set(li, model);
|
|
|
|
|
|
|
|
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
|
2018-08-01 14:42:13 -07:00
|
|
|
imgf = efl_add(EFL_UI_IMAGE_FACTORY_CLASS, win);
|
|
|
|
efl_ui_model_connect(imgf, "", "path"); //connect to "path" property
|
|
|
|
efl_ui_factory_model_connect(factory, "efl.icon", imgf);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
elm_win_resize_object_add(win, li);
|
|
|
|
|
|
|
|
//showall
|
|
|
|
evas_object_show(li);
|
|
|
|
evas_object_resize(win, 320, 320);
|
|
|
|
evas_object_show(win);
|
|
|
|
|
|
|
|
elm_run();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
ELM_MAIN()
|