summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsongwon0.lee <songwon0.lee@samsung.com>2013-10-04 16:15:34 +0900
committersongwon0.lee <songwon0.lee@samsung.com>2013-10-04 16:15:34 +0900
commit3f01e2d064d90a4436f7e24a3f36ae5b58e881b7 (patch)
tree227cb9489de899f4e0c3ff3c94b15582d8f2592c
parentafe1c28aca6db99943465542ce0c00edb168fe81 (diff)
added the extend theme
-rw-r--r--data/edc/cell_button.edc210
-rw-r--r--data/edc/layout.edc87
-rw-r--r--data/image/flower1.pngbin0 -> 21098 bytes
-rw-r--r--data/image/flower2.pngbin0 -> 215411 bytes
-rw-r--r--data/image/flower3.pngbin0 -> 151269 bytes
-rw-r--r--data/image/flower4.pngbin0 -> 18799 bytes
-rw-r--r--data/image/flower5.pngbin0 -> 17122 bytes
-rw-r--r--data/image/flower6.pngbin0 -> 42673 bytes
-rw-r--r--data/image/flower7.pngbin0 -> 23532 bytes
-rw-r--r--data/image/flower8.pngbin0 -> 25384 bytes
-rw-r--r--data/image/ice1.pngbin0 -> 8902 bytes
-rw-r--r--data/image/ice2.pngbin0 -> 10658 bytes
-rw-r--r--data/image/ice3.pngbin0 -> 11002 bytes
-rw-r--r--data/image/ice4.pngbin0 -> 10068 bytes
-rw-r--r--data/image/ice5.pngbin0 -> 11230 bytes
-rw-r--r--data/image/ice6.pngbin0 -> 11675 bytes
-rw-r--r--data/image/ice7.pngbin0 -> 9813 bytes
-rw-r--r--data/image/ice8.pngbin0 -> 9108 bytes
-rw-r--r--src/cell.c10
-rw-r--r--src/cell.h1
-rw-r--r--src/cell_manager.c1
-rw-r--r--src/main.c45
22 files changed, 244 insertions, 110 deletions
diff --git a/data/edc/cell_button.edc b/data/edc/cell_button.edc
index ad043bb..7a589c4 100644
--- a/data/edc/cell_button.edc
+++ b/data/edc/cell_button.edc
@@ -1,99 +1,145 @@
1#define STATE_PROGRAM(type_idx) \ 1#define STATE_PROGRAM(type_idx) \
2program {\ 2program {\
3 name: "set_type_"type_idx;\ 3 name: "set_type_"type_idx;\
4 signal: "cell_type,"type_idx;\ 4 signal: "cell_type,"type_idx;\
5 action: STATE_SET type_idx 0.0;\ 5 action: STATE_SET type_idx 0.0;\
6 target: "cell_image";\ 6 target: "cell_image";\
7}\ 7}\
8 8
9collections { 9collections{
10group { name: "elm/button/base/simple_button"; 10group { name: "elm/button/base/simple_button";
11 images { 11 images {
12 image: "default.png" COMP; 12 image: "default.png" COMP;
13 } 13 }
14 parts { 14 parts {
15 part { name: "click_rect"; 15 part { name: "click_rect";
16 type: RECT; 16 type: RECT;
17 description { state: "default" 0.0; 17 description { state: "default" 0.0;
18 color: 255 255 255 0; 18 color: 255 255 255 0;
19 } 19 }
20 } 20 }
21 part { name: "cell_image"; 21 part { name: "cell_image"; type: IMAGE;
22 type: IMAGE; 22 description { state: "default" 0.0;
23 description { state: "default" 0.0; 23 align: 0.5 0.5;
24 align: 0.5 0.5; 24 image.normal: "default.png";
25 image.normal: "default.png"; 25 }
26 } 26 description { state: "0" 0.0; inherit: "default"; }
27 description { state: "0" 0.0; inherit: "default"; } 27 description { state: "1" 0.0; inherit: "default"; }
28 description { state: "1" 0.0; inherit: "default"; } 28 description { state: "2" 0.0; inherit: "default"; }
29 description { state: "2" 0.0; inherit: "default"; } 29 description { state: "3" 0.0; inherit: "default"; }
30 description { state: "3" 0.0; inherit: "default"; } 30 description { state: "4" 0.0; inherit: "default"; }
31 description { state: "4" 0.0; inherit: "default"; } 31 description { state: "5" 0.0; inherit: "default"; }
32 description { state: "5" 0.0; inherit: "default"; } 32 description { state: "6" 0.0; inherit: "default"; }
33 description { state: "6" 0.0; inherit: "default"; } 33 description { state: "7" 0.0; inherit: "default"; }
34 description { state: "7" 0.0; inherit: "default"; } 34 }
35 }
36 } 35 }
37 programs { 36 programs {
38 program { name: "button_click"; 37 program { name: "button_click";
39 signal: "mouse,down,1"; 38 signal: "mouse,down,1"; source: "click_rect";
40 source: "click_rect"; 39 action: SIGNAL_EMIT "elm,action,press" "";
41 action: SIGNAL_EMIT "elm,action,press" ""; 40 }
42 } 41 program { name: "focus_on";
43 program { name: "focus_on"; 42 signal: "elm,action,focus"; source: "elm";
44 signal: "elm,action,focus"; 43 action: SIGNAL_EMIT "elm,action,press" "";
45 source: "elm"; 44 }
46 action: SIGNAL_EMIT "elm,action,press" ""; 45 program { name: "button_unclick";
47 } 46 signal: "mouse,up,1"; source: "click_rect";
48 program { name: "button_unclick"; 47 action: SIGNAL_EMIT "elm,action,unpress" "";
49 signal: "mouse,up,1"; 48 }
50 source: "click_rect"; 49 program { name: "focus_out";
51 action: SIGNAL_EMIT "elm,action,unpress" ""; 50 signal: "elm,action,unfocus"; source: "elm";
52 } 51 action: SIGNAL_EMIT "elm,action,unpress" "";
53 program { name: "focus_out"; 52 }
54 signal: "elm,action,unfocus"; 53 program { name: "button_unclick3";
55 source: "elm"; 54 signal: "mouse,clicked,1"; source: "click_rect";
56 action: SIGNAL_EMIT "elm,action,unpress" ""; 55 action: SIGNAL_EMIT "elm,action,click" "";
56 }
57 STATE_PROGRAM(0);
58 STATE_PROGRAM(1);
59 STATE_PROGRAM(2);
60 STATE_PROGRAM(3);
61 STATE_PROGRAM(4);
62 STATE_PROGRAM(5);
63 STATE_PROGRAM(6);
64 STATE_PROGRAM(7);
65 }
66}
67
68group { name: "elm/button/base/animal_button";
69 inherit: "elm/button/base/simple_button";
70 images {
71 image: "rabbit.png" COMP;
72 image: "bear.png" COMP;
73 image: "fish.png" COMP;
74 image: "frog.png" COMP;
75 image: "kitty.png" COMP;
76 image: "lion.png" COMP;
77 image: "monkey.png" COMP;
78 image: "pig.png" COMP;
79 }
80 parts {
81 part { name: "cell_image"; type: IMAGE;
82 description { state: "0" 0.0; image.normal: "rabbit.png"; }
83 description { state: "1" 0.0; image.normal: "bear.png"; }
84 description { state: "2" 0.0; image.normal: "fish.png"; }
85 description { state: "3" 0.0; image.normal: "frog.png"; }
86 description { state: "4" 0.0; image.normal: "kitty.png"; }
87 description { state: "5" 0.0; image.normal: "lion.png"; }
88 description { state: "6" 0.0; image.normal: "monkey.png"; }
89 description { state: "7" 0.0; image.normal: "pig.png"; }
57 } 90 }
58 program { name: "button_unclick3"; 91 }
59 signal: "mouse,clicked,1"; 92}
60 source: "click_rect"; 93
61 action: SIGNAL_EMIT "elm,action,click" ""; 94group { name: "elm/button/base/flower_button";
95 inherit: "elm/button/base/simple_button";
96 images {
97 image: "flower1.png" COMP;
98 image: "flower2.png" COMP;
99 image: "flower3.png" COMP;
100 image: "flower4.png" COMP;
101 image: "flower5.png" COMP;
102 image: "flower6.png" COMP;
103 image: "flower7.png" COMP;
104 image: "flower8.png" COMP;
105 }
106 parts {
107 part { name: "cell_image"; type: IMAGE;
108 description { state: "0" 0.0; image.normal: "flower1.png"; }
109 description { state: "1" 0.0; image.normal: "flower2.png"; }
110 description { state: "2" 0.0; image.normal: "flower3.png"; }
111 description { state: "3" 0.0; image.normal: "flower4.png"; }
112 description { state: "4" 0.0; image.normal: "flower5.png"; }
113 description { state: "5" 0.0; image.normal: "flower6.png"; }
114 description { state: "6" 0.0; image.normal: "flower7.png"; }
115 description { state: "7" 0.0; image.normal: "flower8.png"; }
62 } 116 }
63 STATE_PROGRAM(0);
64 STATE_PROGRAM(1);
65 STATE_PROGRAM(2);
66 STATE_PROGRAM(3);
67 STATE_PROGRAM(4);
68 STATE_PROGRAM(5);
69 STATE_PROGRAM(6);
70 STATE_PROGRAM(7);
71 } 117 }
72} 118}
73 119
74group { name: "elm/button/base/animal_button"; 120group { name: "elm/button/base/ice_cream_button";
75 inherit: "elm/button/base/simple_button"; 121 inherit: "elm/button/base/simple_button";
76 images { 122 images {
77 image: "rabbit.png" COMP; 123 image: "ice1.png" COMP;
78 image: "bear.png" COMP; 124 image: "ice2.png" COMP;
79 image: "fish.png" COMP; 125 image: "ice3.png" COMP;
80 image: "frog.png" COMP; 126 image: "ice4.png" COMP;
81 image: "kitty.png" COMP; 127 image: "ice5.png" COMP;
82 image: "lion.png" COMP; 128 image: "ice6.png" COMP;
83 image: "monkey.png" COMP; 129 image: "ice7.png" COMP;
84 image: "pig.png" COMP; 130 image: "ice8.png" COMP;
85 } 131 }
86 parts { 132 parts {
87 part { name: "cell_image"; type: IMAGE; 133 part { name: "cell_image"; type: IMAGE;
88 description { state: "0" 0.0; image.normal: "rabbit.png"; } 134 description { state: "0" 0.0; image.normal: "ice1.png"; }
89 description { state: "1" 0.0; image.normal: "bear.png"; } 135 description { state: "1" 0.0; image.normal: "ice2.png"; }
90 description { state: "2" 0.0; image.normal: "fish.png"; } 136 description { state: "2" 0.0; image.normal: "ice3.png"; }
91 description { state: "3" 0.0; image.normal: "frog.png"; } 137 description { state: "3" 0.0; image.normal: "ice4.png"; }
92 description { state: "4" 0.0; image.normal: "kitty.png"; } 138 description { state: "4" 0.0; image.normal: "ice5.png"; }
93 description { state: "5" 0.0; image.normal: "lion.png"; } 139 description { state: "5" 0.0; image.normal: "ice6.png"; }
94 description { state: "6" 0.0; image.normal: "monkey.png"; } 140 description { state: "6" 0.0; image.normal: "ice7.png"; }
95 description { state: "7" 0.0; image.normal: "pig.png"; } 141 description { state: "7" 0.0; image.normal: "ice8.png"; }
96 } 142 }
97 } 143 }
98} 144}
99} 145}
diff --git a/data/edc/layout.edc b/data/edc/layout.edc
index d5450f6..f8bfe05 100644
--- a/data/edc/layout.edc
+++ b/data/edc/layout.edc
@@ -1,24 +1,69 @@
1collections { 1collections {
2group { name: "layout"; 2group { name: "layout";
3 min: 400 500; 3 min: 400 500;
4 parts{ 4 parts {
5 part{ name : "top_menu_bar"; type: SWALLOW; 5 part { name: "top_menu_bar"; type: SWALLOW;
6 description { state : "default" 0.0; 6 description { state: "default" 0.0;
7 rel1.relative : 0.0 0.0; 7 rel1.relative: 0.0 0.0;
8 rel2.relative : 1.0 0.2; 8 rel2.relative: 1.0 0.2;
9 } 9 visible: 0;
10 } 10 }
11 part{ name : "content_swallow"; type:SWALLOW; 11 description { state: "ingame" 0.0;
12 description {state : "default" 0.0; 12 inherit: "default";
13 rel1.relative : 0.0 0.2; 13 visible: 1;
14 rel2.relative: 1.0 0.8; 14 }
15 } 15 }
16 } 16 part { name: "content_swallow"; type: SWALLOW;
17 part { name : "bottom_menu_bar"; type: SWALLOW; 17 description { state: "default" 0.0;
18 description{state : "default" 0.0; 18 rel1.relative: 0.0 0.2;
19 rel1.relative : 0.0 0.8; 19 rel2.relative: 1.0 0.8;
20 rel2.relative : 1.0 1.0; 20 visible: 0;
21 } 21 }
22 } 22 description { state: "ingame" 0.0;
23 } 23 inherit: "default";
24} } 24 visible: 1;
25 }
26 }
27 part { name: "bottom_menu_bar"; type: SWALLOW;
28 description { state: "default" 0.0;
29 rel1.relative: 0.0 0.8;
30 rel2.relative: 1.0 1.0;
31 visible: 0;
32 }
33 description { state: "ingame" 0.0;
34 inherit: "default";
35 visible: 1;
36 }
37 }
38 part { name: "ready_menu"; type: SWALLOW;
39 description { state: "default" 0.0;
40 rel1.relative: 0 0;
41 rel2.relative: 1 1;
42 visible: 1;
43 }
44 description { state: "ingame" 0.0;
45 inherit: "default";
46 visible: 0;
47 }
48 }
49 }
50 programs {
51 program { name: "ingame";
52 signal: "set ingame";
53 action: STATE_SET "ingame" 0.0;
54 target: "ready_menu";
55 target: "top_menu_bar";
56 target: "bottom_menu_bar";
57 target: "content_swallow";
58 }
59 program { name: "ready";
60 signal: "set ready";
61 action: STATE_SET "default" 0.0;
62 target: "ready_menu";
63 target: "top_menu_bar";
64 target: "bottom_menu_bar";
65 target: "content_swallow";
66 }
67 }
68}
69}
diff --git a/data/image/flower1.png b/data/image/flower1.png
new file mode 100644
index 0000000..00a5e73
--- /dev/null
+++ b/data/image/flower1.png
Binary files differ
diff --git a/data/image/flower2.png b/data/image/flower2.png
new file mode 100644
index 0000000..7874410
--- /dev/null
+++ b/data/image/flower2.png
Binary files differ
diff --git a/data/image/flower3.png b/data/image/flower3.png
new file mode 100644
index 0000000..3482690
--- /dev/null
+++ b/data/image/flower3.png
Binary files differ
diff --git a/data/image/flower4.png b/data/image/flower4.png
new file mode 100644
index 0000000..8b5e3c5
--- /dev/null
+++ b/data/image/flower4.png
Binary files differ
diff --git a/data/image/flower5.png b/data/image/flower5.png
new file mode 100644
index 0000000..ad2d8c8
--- /dev/null
+++ b/data/image/flower5.png
Binary files differ
diff --git a/data/image/flower6.png b/data/image/flower6.png
new file mode 100644
index 0000000..a7a2838
--- /dev/null
+++ b/data/image/flower6.png
Binary files differ
diff --git a/data/image/flower7.png b/data/image/flower7.png
new file mode 100644
index 0000000..c80ae2e
--- /dev/null
+++ b/data/image/flower7.png
Binary files differ
diff --git a/data/image/flower8.png b/data/image/flower8.png
new file mode 100644
index 0000000..1a9c36f
--- /dev/null
+++ b/data/image/flower8.png
Binary files differ
diff --git a/data/image/ice1.png b/data/image/ice1.png
new file mode 100644
index 0000000..ccc1063
--- /dev/null
+++ b/data/image/ice1.png
Binary files differ
diff --git a/data/image/ice2.png b/data/image/ice2.png
new file mode 100644
index 0000000..13b7418
--- /dev/null
+++ b/data/image/ice2.png
Binary files differ
diff --git a/data/image/ice3.png b/data/image/ice3.png
new file mode 100644
index 0000000..587f877
--- /dev/null
+++ b/data/image/ice3.png
Binary files differ
diff --git a/data/image/ice4.png b/data/image/ice4.png
new file mode 100644
index 0000000..c609c43
--- /dev/null
+++ b/data/image/ice4.png
Binary files differ
diff --git a/data/image/ice5.png b/data/image/ice5.png
new file mode 100644
index 0000000..3b8acdb
--- /dev/null
+++ b/data/image/ice5.png
Binary files differ
diff --git a/data/image/ice6.png b/data/image/ice6.png
new file mode 100644
index 0000000..bc99118
--- /dev/null
+++ b/data/image/ice6.png
Binary files differ
diff --git a/data/image/ice7.png b/data/image/ice7.png
new file mode 100644
index 0000000..d123e5e
--- /dev/null
+++ b/data/image/ice7.png
Binary files differ
diff --git a/data/image/ice8.png b/data/image/ice8.png
new file mode 100644
index 0000000..3418847
--- /dev/null
+++ b/data/image/ice8.png
Binary files differ
diff --git a/src/cell.c b/src/cell.c
index 72f5ee3..6ef61b9 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -2,6 +2,8 @@
2 2
3#define TYPE_MAX 8 3#define TYPE_MAX 8
4 4
5static char* style_name ="animal_button";
6
5static void 7static void
6transit_del_cb(void *data, Elm_Transit *transit) 8transit_del_cb(void *data, Elm_Transit *transit)
7{ 9{
@@ -106,12 +108,18 @@ cell_explosion(Cell_Info *info)
106 evas_object_hide(info->obj); 108 evas_object_hide(info->obj);
107} 109}
108 110
111void
112cell_style_set(char *name)
113{
114 style_name = name;
115}
116
109Cell_Info * 117Cell_Info *
110cell_add(Evas_Object *parent, int r, int c) 118cell_add(Evas_Object *parent, int r, int c)
111{ 119{
112 Cell_Info *info = (Cell_Info *)malloc(sizeof(Cell_Info)); 120 Cell_Info *info = (Cell_Info *)malloc(sizeof(Cell_Info));
113 info->obj = elm_button_add(parent); 121 info->obj = elm_button_add(parent);
114 elm_object_style_set(info->obj, "animal_button"); 122 elm_object_style_set(info->obj, style_name);
115 evas_object_resize(info->obj, SIZE, SIZE); 123 evas_object_resize(info->obj, SIZE, SIZE);
116 evas_object_show(info->obj); 124 evas_object_show(info->obj);
117 125
diff --git a/src/cell.h b/src/cell.h
index 5515f3a..6c8221f 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -14,6 +14,7 @@ typedef struct _Cell_Info{
14 Eina_Bool triple_match; 14 Eina_Bool triple_match;
15}Cell_Info; 15}Cell_Info;
16 16
17void cell_style_set(char* name);
17void cell_down_move(Cell_Info* info, Elm_Transit_Del_Cb move_end_cb); 18void cell_down_move(Cell_Info* info, Elm_Transit_Del_Cb move_end_cb);
18void cell_target_back_move(Cell_Info *info); 19void cell_target_back_move(Cell_Info *info);
19void cell_target_match_move(Cell_Info *info, Elm_Transit_Del_Cb match_cb, void* data); 20void cell_target_match_move(Cell_Info *info, Elm_Transit_Del_Cb match_cb, void* data);
diff --git a/src/cell_manager.c b/src/cell_manager.c
index 1383733..0c2696a 100644
--- a/src/cell_manager.c
+++ b/src/cell_manager.c
@@ -253,7 +253,6 @@ _cell_line_down(int x, Eina_List* list)
253 } 253 }
254 } 254 }
255 } 255 }
256
257} 256}
258 257
259static void 258static void
diff --git a/src/main.c b/src/main.c
index ff0f5d5..2fb7232 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2,12 +2,29 @@
2 2
3#include "cell.h" 3#include "cell.h"
4 4
5//static Timer *game_timer;
6
5static void 7static void
6_on_shake(void *data, Evas_Object *obj, void *ev) 8_on_shake(void *data, Evas_Object *obj, void *ev)
7{ 9{
8 cell_table_shake(); 10 cell_table_shake();
9} 11}
10 12
13static void
14_on_start(void *layout, Evas_Object *obj, void *ev)
15{
16 elm_object_signal_emit(layout, "set ingame", "");
17 cell_table_init(layout);
18}
19
20static void
21_on_style_selected(void *data, Evas_Object *obj, void *ev)
22{
23 Elm_Object_Item *item = elm_flipselector_selected_item_get(obj);
24 char *name = elm_object_item_text_get(item);
25 cell_style_set(name);
26}
27
11EAPI_MAIN int 28EAPI_MAIN int
12elm_main(int argc, char **argv) 29elm_main(int argc, char **argv)
13{ 30{
@@ -25,12 +42,33 @@ elm_main(int argc, char **argv)
25 elm_win_resize_object_add(win, layout); 42 elm_win_resize_object_add(win, layout);
26 evas_object_show(layout); 43 evas_object_show(layout);
27 44
28 Evas_Object* box = elm_box_add(win); 45 Evas_Object *box = elm_box_add(win);
46 elm_object_part_content_set(layout, "ready_menu", box);
47 evas_object_show(box);
48
49 Evas_Object *fs = elm_flipselector_add(win);
50 elm_flipselector_item_append(fs, "animal_button", NULL, NULL);
51 elm_flipselector_item_append(fs, "flower_button", NULL, NULL);
52 elm_flipselector_item_append(fs, "ice_cream_button", NULL, NULL);
53 evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
54 evas_object_smart_callback_add(fs, "selected", _on_style_selected, NULL);
55 evas_object_show(fs);
56 elm_box_pack_end(box, fs);
57
58 Evas_Object *btn = elm_button_add(win);
59 elm_object_text_set(btn, "GAME START!!!");
60 evas_object_show(btn);
61 evas_object_size_hint_align_set(btn, 0.5, 0.0);
62 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 evas_object_smart_callback_add(btn, "clicked", _on_start, layout);
64 elm_box_pack_end(box, btn);
65
66 box = elm_box_add(win);
29 elm_box_horizontal_set(box, EINA_TRUE); 67 elm_box_horizontal_set(box, EINA_TRUE);
30 elm_object_part_content_set(layout, "top_menu_bar", box); 68 elm_object_part_content_set(layout, "top_menu_bar", box);
31 evas_object_show(box); 69 evas_object_show(box);
32 70
33 Evas_Object* btn = elm_button_add(win); 71 btn = elm_button_add(win);
34 elm_object_text_set(btn, "SCORE"); 72 elm_object_text_set(btn, "SCORE");
35 evas_object_show(btn); 73 evas_object_show(btn);
36 elm_box_pack_end(box, btn); 74 elm_box_pack_end(box, btn);
@@ -41,7 +79,6 @@ elm_main(int argc, char **argv)
41 evas_object_show(btn); 79 evas_object_show(btn);
42 elm_box_pack_end(box, btn); 80 elm_box_pack_end(box, btn);
43 81
44
45 box = elm_box_add(win); 82 box = elm_box_add(win);
46 elm_object_part_content_set(layout, "bottom_menu_bar", box); 83 elm_object_part_content_set(layout, "bottom_menu_bar", box);
47 evas_object_show(box); 84 evas_object_show(box);
@@ -50,8 +87,6 @@ elm_main(int argc, char **argv)
50 elm_box_pack_end(box, pb); 87 elm_box_pack_end(box, pb);
51 evas_object_show(pb); 88 evas_object_show(pb);
52 89
53 cell_table_init(win);
54
55 elm_run(); 90 elm_run();
56 elm_shutdown(); 91 elm_shutdown();
57 92