upload codes for TIZEN 2.0
[apps/home/clock.git] / res / edc / button_macro.edc
1 /*
2 *
3 * Copyright 2012  Samsung Electronics Co., Ltd
4 *
5 * Licensed under the Flora License, Version 1.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *    http://www.tizenopensource.org/license
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 */
18 /**********************************************************************
19 ******************button*************************************
20 ***********************************************************************/
21 //
22 #define _btn_edc_part_rect()\
23             part {  \
24                 name: "rect"; \
25                 type: RECT; \
26                 mouse_events: 1;    \
27                 repeat_events: 1;   \
28                 scale: 1;   \
29                 description {   \
30                     state: "default" 0.0;   \
31                     visible: 1; \
32                     color: 255 255 255 0;   \
33                     rel1 { relative: 0.0 0.0;}    \
34                     rel2 { relative: 1.0 1.0;}    \
35                 }   \
36                 description {   \
37                     state: "hide" 0.0;  \
38                     inherit: "default" 0.0; \
39                     visible: 0; \
40                 }   \
41             }   \
42
43 //
44 #define _btn_edc_part_image(img_def, img_down, img_dim ) \
45                     part {  \
46                         name: "image"; \
47                         type: IMAGE;    \
48                         mouse_events: 1;    \
49                         scale:1;    \
50                         description \
51                         {   \
52                             state: "default" 0.0;   \
53                             rel1 { relative: 0.0 0.0; to: "rect";}    \
54                             rel2 { relative: 1.0 1.0; to: "rect";} \
55                             image { normal: img_def; border: 5 5 5 5; border_scale: 1;}   \
56                         }   \
57                         description {   \
58                             state: "down" 0.0;  \
59                             inherit: "default" 0.0; \
60                             image { normal: img_down; border: 5 5 5 5; border_scale: 1;}  \
61                         }   \
62                         description {   \
63                             state: "dim" 0.0;   \
64                             inherit: "default" 0.0; \
65                             image { normal: img_dim; border: 5 5 5 5; border_scale: 1;}   \
66                         }   \
67                     }   \
68
69 //
70 #define _btn_edc_part_txt( str_color_class, int_color2, \
71                     txt_font, txt_size, txt_align_x,txt_align_y, str_txt )\
72                 part {  \
73                     name: "text"; \
74                     type: TEXT; \
75                     mouse_events: 0;    \
76                     repeat_events: 1;   \
77                     scale: 1;   \
78                     description {   \
79                         state: "default" 0.0;   \
80                         rel1 { relative: 0.0 0.0; to: "rect";}    \
81                         rel2 { relative: 1.0 1.0; to: "rect";}    \
82                         text { font: txt_font; size: txt_size; align: txt_align_x txt_align_y; text: str_txt;}    \
83                         color_class: str_color_class;   \
84                         color2: int_color2; \
85                     }   \
86                     description {   \
87                         state: "down" 0.0;  \
88                         inherit: "default" 0.0; \
89                     }   \
90                     description {   \
91                         state: "dim" 0.0;  \
92                         inherit: "default" 0.0; \
93                     }   \
94                 }   \
95
96 //
97 #define _btn_edc_prog_mouse_down( )\
98                 program {   \
99                     name: "internal_mouse_down";    \
100                     signal: "mouse,down,1"; \
101                     source: "rect";  \
102                     action: STATE_SET "down" 0.0;   \
103                     target: "image";   \
104                     target: "text";   \
105                     transition: DECELERATE 0.1; \
106                 }   \
107                 program {   \
108                     name: "emit_mouse_down";    \
109                     signal: "mouse,down,1"; \
110                     source: "rect";  \
111                     action: SIGNAL_EMIT "mouse,down" "rect";   \
112                 }   \
113
114 //
115 #define _btn_edc_prog_mouse_click() \
116                 program {   \
117                     name: "emit_mouse_click";    \
118                     signal: "mouse,clicked,1"; \
119                     source: "rect";  \
120                     action: SIGNAL_EMIT "mouse,clicked" "rect";   \
121                 }   \
122
123 //
124 #define _btn_edc_prog_mouse_up( )\
125                 program {   \
126                     name: "emit_mouse_up";    \
127                     signal: "mouse,up,1"; \
128                     source: "rect";  \
129                     action: SIGNAL_EMIT "mouse,up" "rect";   \
130                 }   \
131                 program {   \
132                     name: "internal_mouse_up";    \
133                     signal: "mouse,up,1"; \
134                     source: "rect";  \
135                     action: STATE_SET "default" 0.0;   \
136                     target: "image";   \
137                     target: "text";   \
138                     transition: DECELERATE 0.1; \
139                 }   \
140
141 //
142 #define _btn_edc_prog_rect_hide() \
143                 program {   \
144                     name: "internel_rect_hide";    \
145                     signal: "hide"; \
146                     source: "rect";  \
147                     action: STATE_SET "hide" 0.0;    \
148                     target: "rect";   \
149                 }   \
150                 program {   \
151                     name: "internel_rect_show";    \
152                     signal: "show"; \
153                     source: "rect";  \
154                     action: STATE_SET "default" 0.0;    \
155                     target: "rect";   \
156                 }   \
157
158 //
159 #define _btn_edc_prog_image_dim() \
160                 program {   \
161                     name: "internel_dim";    \
162                     signal: "dim";  \
163                     source: "image";   \
164                     action: STATE_SET "dim" 0.0;    \
165                     target: "image";   \
166                     target: "text";   \
167                 }   \
168                 program {   \
169                     name: "internel_default";    \
170                     signal: "normal";  \
171                     source: "image";   \
172                     action: STATE_SET "default" 0.0;    \
173                     target: "image";   \
174                     target: "text";   \
175                 }   \
176
177 //
178 #define edc_widget_btn(str_name, \
179                     img_def, img_down, img_dim, \
180                     str_color_class, int_color2,\
181                     txt_font, txt_size, txt_align_x,txt_align_y, str_txt)\
182         group { \
183             name: str_name;\
184             parts { \
185                 _btn_edc_part_image(img_def, img_down, img_dim) \
186                 _btn_edc_part_txt(str_color_class, int_color2, \
187                               txt_font, txt_size, txt_align_x,txt_align_y, str_txt)\
188                 _btn_edc_part_rect()\
189             }   \
190             programs {  \
191                 _btn_edc_prog_mouse_down()  \
192                 _btn_edc_prog_mouse_click() \
193                 _btn_edc_prog_mouse_up()    \
194                 _btn_edc_prog_image_dim() \
195                 _btn_edc_prog_rect_hide()   \
196             }   \
197         }   \
198