summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <juyung.seo@samsung.com>2014-05-10 14:33:52 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2014-05-10 14:36:26 +0900
commit682d9a8fc1500ece1fbf1efe4ff54c719750cc0c (patch)
treea82336d259d230088dc997c730a1aa943217c67a
parent9f3e20a6a42319b19f1c639cb38f5d42fc0cf843 (diff)
elm: added profile change example.
-rw-r--r--.gitignore1
-rw-r--r--elm/Makefile5
-rw-r--r--elm/profile.c48
3 files changed, 53 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index febd8e8..db31b6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@ elm/image_gif
18elm/slider 18elm/slider
19elm/utf 19elm/utf
20elm/elm_event 20elm/elm_event
21elm/profile
21ecore/idler-null 22ecore/idler-null
22ecore/shutdown-timer 23ecore/shutdown-timer
23ecore/loop-iterate 24ecore/loop-iterate
diff --git a/elm/Makefile b/elm/Makefile
index 2990eee..96019f1 100644
--- a/elm/Makefile
+++ b/elm/Makefile
@@ -1,4 +1,4 @@
1all: entry-crash toolbar entry-scrollable weight-align box event scale focus no_win entry_del size image_gif slider utf elm_event 1all: entry-crash toolbar entry-scrollable weight-align box event scale focus no_win entry_del size image_gif slider utf elm_event profile
2 2
3entry-scrollable: entry-scrollable.c 3entry-scrollable: entry-scrollable.c
4 gcc entry-scrollable.c -o entry-scrollable `pkg-config --cflags --libs elementary` -g 4 gcc entry-scrollable.c -o entry-scrollable `pkg-config --cflags --libs elementary` -g
@@ -44,3 +44,6 @@ utf: utf.c
44 44
45elm_event: elm_event.c 45elm_event: elm_event.c
46 gcc elm_event.c -o elm_event `pkg-config --cflags --libs elementary` -g 46 gcc elm_event.c -o elm_event `pkg-config --cflags --libs elementary` -g
47
48profile: profile.c
49 gcc profile.c -o profile `pkg-config --cflags --libs elementary` -g
diff --git a/elm/profile.c b/elm/profile.c
new file mode 100644
index 0000000..830c41f
--- /dev/null
+++ b/elm/profile.c
@@ -0,0 +1,48 @@
1/*
2 * gcc profile.c -o profile `pkg-config --cflags --libs elementary` -g
3 *
4 * lesson: profile can be changed after app launch by window manager.
5 */
6#include <Elementary.h>
7
8static Eina_Bool
9_timer_cb(void *data)
10{
11 printf("finger %d profile %s\n", elm_config_finger_size_get(), elm_config_profile_get());
12 return ECORE_CALLBACK_CANCEL;
13}
14
15static void
16_prop_changed_cb(void *data, Evas_Object *obj, void *event_info)
17{
18 printf("profile changed %s\n", elm_config_profile_get());
19}
20
21EAPI_MAIN int
22elm_main(int argc, char **argv)
23{
24 Evas_Object *win, *btn;
25 win = elm_win_util_standard_add("adsf", "adsf");
26 elm_win_autodel_set(win, EINA_TRUE);
27 evas_object_smart_callback_add(win, "profile,changed", _prop_changed_cb, NULL);
28
29 elm_config_profile_set("mobile");
30 elm_config_finger_size_set(100);
31
32 btn = elm_button_add(win);
33 elm_object_text_set(btn, "TEST");
34 evas_object_resize(btn, 200, 100);
35 evas_object_show(btn);
36
37 evas_object_resize(win, 1024, 768);
38 evas_object_show(win);
39
40 printf("finger %d profile %s\n", elm_config_finger_size_get(), elm_config_profile_get());
41
42 ecore_timer_add(3.0, _timer_cb, NULL);
43
44 elm_run();
45
46 return 0;
47}
48ELM_MAIN()