summaryrefslogtreecommitdiff
path: root/src/bin/efl_wl/efl_wl_test_stack.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-30 14:59:21 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-30 14:59:55 -0400
commitc2fde93c9ef1108c0809a538cf2ec482ed8369a9 (patch)
treed9879e4ebea4d25cda1a6cc1268461ad0d669c3b /src/bin/efl_wl/efl_wl_test_stack.c
parent3775a9645da7e92599babccfe8454304cec367b7 (diff)
efl_wl: a multiseat wayland compositor in an evas smart object
build when wayland support is enabled and provide two test/demo cases beta api @feature Reviewed-By: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin/efl_wl/efl_wl_test_stack.c')
-rw-r--r--src/bin/efl_wl/efl_wl_test_stack.c87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/bin/efl_wl/efl_wl_test_stack.c b/src/bin/efl_wl/efl_wl_test_stack.c
new file mode 100644
index 0000000000..51cd598984
--- /dev/null
+++ b/src/bin/efl_wl/efl_wl_test_stack.c
@@ -0,0 +1,87 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4#include "Efl_Wl.h"
5#include "Elementary.h"
6
7static Evas_Object *win;
8
9static const char *cmds[] =
10{
11 "weston-terminal",
12 "terminology",
13};
14
15static unsigned int num_cmds = EINA_C_ARRAY_LENGTH(cmds);
16static unsigned int n;
17
18static Eina_Bool
19dostuff(void *data)
20{
21 efl_wl_run(data, cmds[n++]);
22 evas_object_focus_set(data, 1);
23 return n != num_cmds;
24}
25
26static void
27prev_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
28{
29 efl_wl_prev(data);
30}
31
32static void
33next_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
34{
35 efl_wl_next(data);
36}
37
38int
39main(int argc, char *argv[])
40{
41 Evas_Object *o, *comp, *prev, *next;
42 elm_init(argc, (char**)argv);
43
44 win = elm_win_util_standard_add("comp", "comp");
45 elm_win_autodel_set(win, 1);
46 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
47 o = evas_object_rectangle_add(evas_object_evas_get(win));
48 evas_object_color_set(o, 0, 125, 0, 125);
49 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
50 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
51 elm_win_resize_object_add(win, o);
52 evas_object_show(o);
53
54 o = elm_table_add(win);
55 elm_win_resize_object_add(win, o);
56 evas_object_show(o);
57
58 prev = elm_button_add(win);
59 elm_object_text_set(prev, "prev");
60 evas_object_size_hint_align_set(prev, EVAS_HINT_FILL, EVAS_HINT_FILL);
61 evas_object_size_hint_weight_set(prev, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
62 evas_object_show(prev);
63 elm_table_pack(o, prev, 0, 0, 1, 1);
64
65 next = elm_button_add(win);
66 elm_object_text_set(next, "next");
67 evas_object_size_hint_align_set(next, EVAS_HINT_FILL, EVAS_HINT_FILL);
68 evas_object_size_hint_weight_set(next, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
69 evas_object_show(next);
70 elm_table_pack(o, next, 1, 0, 1, 1);
71
72 comp = efl_wl_add(evas_object_evas_get(win));
73 evas_object_size_hint_min_set(comp, 640, 480);
74 elm_table_pack(o, comp, 0, 1, 2, 1);
75 evas_object_size_hint_align_set(comp, EVAS_HINT_FILL, EVAS_HINT_FILL);
76 evas_object_size_hint_weight_set(comp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
77 evas_object_show(comp);
78 evas_object_show(win);
79 ecore_timer_add(1, dostuff, comp);
80
81 evas_object_smart_callback_add(prev, "clicked", prev_clicked, comp);
82 evas_object_smart_callback_add(next, "clicked", next_clicked, comp);
83
84 elm_run();
85 elm_shutdown();
86 return 0;
87}