summaryrefslogtreecommitdiff
path: root/src/bin/efl_wl
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-12 12:16:14 -0400
committerMike Blumenkrantz <zmike@samsung.com>2020-03-12 12:17:07 -0400
commit42480c5ebf32be52c3d5c5e484d5e8d5eac92fcb (patch)
tree542827db310ea02cbfcc1224c090d0e4dc2caf99 /src/bin/efl_wl
parentd284d19429d482dd0636b1f1aab8b5502c572975 (diff)
efl-wl: rename to efl.canvas.wl
Summary: this is a canvas object so it needs to be in the canvas namespace Depends on D11475 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11476
Diffstat (limited to 'src/bin/efl_wl')
-rw-r--r--src/bin/efl_wl/efl_wl_test.c81
-rw-r--r--src/bin/efl_wl/efl_wl_test_stack.c87
-rw-r--r--src/bin/efl_wl/meson.build13
3 files changed, 0 insertions, 181 deletions
diff --git a/src/bin/efl_wl/efl_wl_test.c b/src/bin/efl_wl/efl_wl_test.c
deleted file mode 100644
index b9f9f6b450..0000000000
--- a/src/bin/efl_wl/efl_wl_test.c
+++ /dev/null
@@ -1,81 +0,0 @@
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;
8static Eina_Strbuf *buf;
9static Eo *exe;
10
11static void
12del_handler(void *d EINA_UNUSED, const Efl_Event *ev)
13{
14 if (ev->object == exe) ecore_main_loop_quit();
15}
16
17static void
18focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
19{
20 evas_object_focus_set(data, 1);
21}
22
23static Eina_Bool
24dostuff(void *data)
25{
26 exe = efl_wl_run(data, eina_strbuf_string_get(buf));
27 efl_event_callback_add(exe, EFL_TASK_EVENT_EXIT, del_handler, NULL);
28 evas_object_focus_set(data, 1);
29 return EINA_FALSE;
30}
31
32static void
33hints_changed(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
34{
35 int w, h;
36 Evas_Aspect_Control aspect;
37
38 evas_object_size_hint_aspect_get(obj, &aspect, &w, &h);
39 evas_object_size_hint_aspect_set(data, aspect, w, h);
40 evas_object_size_hint_min_get(obj, &w, &h);
41 evas_object_size_hint_min_set(data, w, h);
42 evas_object_size_hint_max_get(obj, &w, &h);
43 evas_object_size_hint_max_set(data, w, h);
44}
45
46int
47main(int argc, char *argv[])
48{
49 Evas_Object *o;
50 int i;
51
52 if (argc < 2) return 0;
53 elm_init(argc, (char**)argv);
54 buf = eina_strbuf_new();
55 for (i = 1; i < argc; i++)
56 {
57 eina_strbuf_append_escaped(buf, argv[i]);
58 if (i + 1 < argc) eina_strbuf_append_char(buf, ' ');
59 }
60
61 win = elm_win_util_standard_add("comp", "comp");
62 elm_win_autodel_set(win, 1);
63 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
64
65 o = efl_add(EFL_WL_CLASS, win);
66 efl_wl_aspect_set(o, 1);
67 efl_wl_minmax_set(o, 1);
68 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
69 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
70 evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, hints_changed, win);
71 elm_win_resize_object_add(win, o);
72 evas_object_show(o);
73 evas_object_show(win);
74 evas_object_resize(win, 640, 480);
75 evas_object_event_callback_add(win, EVAS_CALLBACK_FOCUS_IN, focus_in, o);
76 ecore_timer_add(1, dostuff, o);
77
78 elm_run();
79 elm_shutdown();
80 return 0;
81}
diff --git a/src/bin/efl_wl/efl_wl_test_stack.c b/src/bin/efl_wl/efl_wl_test_stack.c
deleted file mode 100644
index e6eaa34760..0000000000
--- a/src/bin/efl_wl/efl_wl_test_stack.c
+++ /dev/null
@@ -1,87 +0,0 @@
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_surface_prev(data);
30}
31
32static void
33next_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
34{
35 efl_wl_surface_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_add(EFL_WL_CLASS, 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}
diff --git a/src/bin/efl_wl/meson.build b/src/bin/efl_wl/meson.build
deleted file mode 100644
index dc0f0d248c..0000000000
--- a/src/bin/efl_wl/meson.build
+++ /dev/null
@@ -1,13 +0,0 @@
1executable('efl_wl_test',
2 'efl_wl_test.c',
3 include_directories : config_dir,
4 dependencies: [efl_wl, efl_wl_deps, efl_wl_pub_deps, elementary],
5 install: true,
6)
7
8executable('efl_wl_test_stack',
9 'efl_wl_test_stack.c',
10 include_directories : config_dir,
11 dependencies: [efl_wl, efl_wl_deps, efl_wl_pub_deps, elementary],
12 install: true,
13)