summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <juyung.seo@samsung.com>2015-02-06 10:25:32 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2015-02-06 10:25:32 +0900
commite098f575b896a097102ffd0fe19f1495c09bbac6 (patch)
tree8662207039ec628d7ad370234a67ad9312d23da9
parente78e36e06e22334d402c2af6daf3a0517a13f0d9 (diff)
edje: Add restricted_calc example.
-rw-r--r--.gitignore1
-rw-r--r--edje/Makefile8
-rw-r--r--edje/restricted_calc.c40
-rw-r--r--edje/restricted_calc.edc13
4 files changed, 61 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 1db6aa1..d365a30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,6 +39,7 @@ edje/propagate-event
39edje/onhold 39edje/onhold
40edje/toolbar_min_calc 40edje/toolbar_min_calc
41edje/part_swallow_geometry 41edje/part_swallow_geometry
42edje/restricted_calc
42evas/premultiplied-color 43evas/premultiplied-color
43evas/preload 44evas/preload
44evas/smart-member 45evas/smart-member
diff --git a/edje/Makefile b/edje/Makefile
index 823372d..b7136e4 100644
--- a/edje/Makefile
+++ b/edje/Makefile
@@ -1,4 +1,4 @@
1all: propagate-event propagate-event.edj onhold onhold.edj border.edj toolbar-min-calc center-align.edj part_swallow_geometry part_swallow_geometry.edj 1all: propagate-event propagate-event.edj onhold onhold.edj border.edj toolbar-min-calc center-align.edj part_swallow_geometry part_swallow_geometry.edj restricted_calc restricted_calc.edj
2 2
3propagate-event: propagate-event.c 3propagate-event: propagate-event.c
4 gcc propagate-event.c -o propagate-event `pkg-config --cflags --libs elementary` -g 4 gcc propagate-event.c -o propagate-event `pkg-config --cflags --libs elementary` -g
@@ -25,3 +25,9 @@ part_swallow_geometry: part_swallow_geometry.c
25 gcc part_swallow_geometry.c -o part_swallow_geometry `pkg-config --cflags --libs elementary` -g 25 gcc part_swallow_geometry.c -o part_swallow_geometry `pkg-config --cflags --libs elementary` -g
26 26
27part_swallow_geometry.edj: part_swallow_geometry.edc 27part_swallow_geometry.edj: part_swallow_geometry.edc
28
29restricted_calc: restricted_calc.c
30 gcc restricted_calc.c -o restricted_calc `pkg-config --cflags --libs elementary` -g
31
32restricted_calc.edj: restricted_calc.edc
33 edje_cc restricted_calc.edc
diff --git a/edje/restricted_calc.c b/edje/restricted_calc.c
new file mode 100644
index 0000000..52ce29b
--- /dev/null
+++ b/edje/restricted_calc.c
@@ -0,0 +1,40 @@
1/*
2 * gcc restricted_calc.c -o restricted_calc `pkg-config --cflags --libs elementary` -g
3 */
4#include <Elementary.h>
5
6EAPI_MAIN int
7elm_main(int argc, char **argv)
8{
9 Evas_Object *win = NULL, *edje = NULL;
10 Evas_Coord w = -1, h = -1;
11
12 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
13
14 // set finger size explicitly
15 elm_config_finger_size_set(50);
16
17 win = elm_win_util_standard_add("main", "Main");
18 elm_win_autodel_set(win, EINA_TRUE);
19 evas_object_resize(win, 300, 400);
20
21 // create edje file
22 edje = edje_object_add(evas_object_evas_get(win));
23 edje_object_file_set(edje, "restricted_calc.edj", "main");
24 evas_object_resize(edje, 100, 100);
25 evas_object_show(edje);
26
27 // adjust finger size
28 elm_coords_finger_size_adjust(1, &w, 1, &h);
29
30 // min restricted calc
31 edje_object_size_min_restricted_calc(edje, &w, &h, w, h);
32 printf("w: %d, h: %d\n", w, h);
33
34 evas_object_show(win);
35
36 elm_run();
37
38 return 0;
39}
40ELM_MAIN()
diff --git a/edje/restricted_calc.edc b/edje/restricted_calc.edc
new file mode 100644
index 0000000..8f43b73
--- /dev/null
+++ b/edje/restricted_calc.edc
@@ -0,0 +1,13 @@
1collections {
2 group { name: "main";
3 parts {
4 part { name: "rect1";
5 type: RECT;
6 description { state: "default" 0.0;
7 color: 0 136 170 255;
8 fixed: 1 1;
9 }
10 }
11 }
12 }
13} \ No newline at end of file