summaryrefslogtreecommitdiff
path: root/src/examples/elementary/efl_ui_list_view_example_2.c
diff options
context:
space:
mode:
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>2018-11-05 14:27:05 +0900
committerHermet Park <hermetpark@gmail.com>2018-11-05 14:27:05 +0900
commite97b6b72bebfc91f44c4ab98f3ff1b7920344c07 (patch)
tree9e1d059c319b9208114b05df5356961d81ff06a0 /src/examples/elementary/efl_ui_list_view_example_2.c
parentc4e0d3f69d8203ad3ff4f3fdeb0a0adfaffdd1cd (diff)
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
Diffstat (limited to 'src/examples/elementary/efl_ui_list_view_example_2.c')
-rw-r--r--src/examples/elementary/efl_ui_list_view_example_2.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/examples/elementary/efl_ui_list_view_example_2.c b/src/examples/elementary/efl_ui_list_view_example_2.c
new file mode 100644
index 0000000000..c624cade19
--- /dev/null
+++ b/src/examples/elementary/efl_ui_list_view_example_2.c
@@ -0,0 +1,62 @@
1// gcc -o efl_ui_list_view_example_2 efl_ui_list_view_example_2.c `pkg-config --cflags --libs elementary`
2
3#ifdef HAVE_CONFIG_H
4# include "config.h"
5#else
6# define EFL_BETA_API_SUPPORT 1
7# define EFL_EO_API_SUPPORT 1
8#endif
9
10#include <Elementary.h>
11#include <Efl.h>
12#include <Eio.h>
13#include <stdio.h>
14
15#define EFL_MODEL_TEST_FILENAME_PATH "/tmp"
16
17EAPI_MAIN int
18elm_main(int argc, char **argv)
19{
20 Efl_Ui_Layout_Factory *factory;
21 Efl_Ui_Image_Factory *imgf;
22 Evas_Object *win;
23 Eo *model, *li;
24 char *dirname;
25
26 win = elm_win_util_standard_add("list_view2", "List_View2");
27 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
28
29 elm_win_autodel_set(win, EINA_TRUE);
30
31 if (argv[1] != NULL) dirname = argv[1];
32 else dirname = EFL_MODEL_TEST_FILENAME_PATH;
33
34 model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
35 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
36 efl_ui_model_connect(factory, "efl.text", "filename");
37 efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
38
39 li = efl_add(EFL_UI_LIST_VIEW_CLASS, win);
40 efl_ui_list_view_layout_factory_set(li, factory);
41 efl_ui_view_model_set(li, model);
42
43 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
44 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
45
46
47 imgf = efl_add(EFL_UI_IMAGE_FACTORY_CLASS, win);
48 efl_ui_model_connect(imgf, "", "path"); //connect to "path" property
49 efl_ui_factory_model_connect(factory, "efl.icon", imgf);
50
51 elm_win_resize_object_add(win, li);
52
53 //showall
54 evas_object_show(li);
55 evas_object_resize(win, 320, 320);
56 evas_object_show(win);
57
58 elm_run();
59
60 return 0;
61}
62ELM_MAIN()