400f4cf269af59d0891ded76e7768831327b422f
[profile/tv/apps/native/air_home.git] / edje / view / baritem.edc
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "../../include/defs.h"
18 group {
19         name, GRP_BAR_ITEM;
20         images {
21                 image, "mask_user_nor.png" COMP;
22         }
23         script {
24                 public mask_on;
25         }
26         parts {
27                 part {
28                         name, "bg";
29                         type, RECT;
30                         scale, 1;
31                         description {
32                                 state, "default" 0.0;
33                                 min, 158 158;
34                         }
35                 }
36                 part {
37                         name, "clip";
38                         type, RECT;
39                         description {
40                                 state, "default" 0.0;
41                                 color, 0 0 0 0;
42                         }
43                         description {
44                                 state, "focus" 0.0;
45                                 inherit, "default" 0.0;
46                                 color, 255 255 255 255;
47                         }
48                         description {
49                                 state, "up" 0.0;
50                                 inherit, "default" 0.0;
51                                 rel1.relative, 0.0 -1.0;
52                                 rel2.relative, 1.0 0.0;
53                                 color, 255 255 255 255;
54                         }
55                         description {
56                                 state, "down" 0.0;
57                                 inherit, "default" 0.0;
58                                 rel1.relative, 0.0 1.0;
59                                 rel2.relative, 1.0 2.0;
60                                 color, 255 255 255 255;
61                         }
62                         description {
63                                 state, "right" 0.0;
64                                 inherit, "default" 0.0;
65                                 rel1.relative, 1.0 0.0;
66                                 rel2.relative, 2.0 1.0;
67                                 color, 255 255 255 255;
68                         }
69                         description {
70                                 state, "left" 0.0;
71                                 inherit, "default" 0.0;
72                                 rel1.relative, -1.0 0.0;
73                                 rel2.relative, 0.0 1.0;
74                                 color, 255 255 255 255;
75                         }
76                 }
77                 part {
78                         name, PART_BAR_ITEM_BG;
79                         type, SWALLOW;
80                         scale, 1;
81                         clip_to, "clip";
82                         description {
83                                 state, "default" 0.0;
84                                 min, 158 158;
85                         }
86                 }
87                 part {
88                         name, PART_BAR_ITEM_ICON;
89                         type, SWALLOW;
90                         scale, 1;
91                         description {
92                                 state, "default" 0.0;
93                                 min, 70 70;
94                                 rel1.relative, 0.5 0.5;
95                                 rel2.relative, 0.5 0.5;
96                                 fixed, 1 1;
97                         }
98                 }
99                 part {
100                         name, PART_BAR_ITEM_ICON_FOCUS;
101                         type, SWALLOW;
102                         scale, 1;
103                         clip_to, "clip";
104                         description {
105                                 state, "default" 0.0;
106                                 rel1.to, PART_BAR_ITEM_ICON;
107                                 rel2.to, PART_BAR_ITEM_ICON;
108                         }
109                 }
110                 part {
111                         name, "mask";
112                         type, IMAGE;
113                         scale, 1;
114                         description {
115                                 state, "default" 0.0;
116                                 rel1.to, PART_BAR_ITEM_ICON;
117                                 rel2.to, PART_BAR_ITEM_ICON;
118                                 image.normal, "mask_user_nor.png";
119                                 visible, 0;
120                         }
121                         description {
122                                 state, "show" 0.0;
123                                 inherit, "default" 0.0;
124                                 visible, 1;
125                         }
126                 }
127                 part {
128                         name, "mask_focus";
129                         type, IMAGE;
130                         scale, 1;
131                         clip_to, "clip";
132                         description {
133                                 state, "default" 0.0;
134                                 image.normal, "mask_user_nor.png";
135                                 color, 0 119 245 255;
136                                 rel1.to, PART_BAR_ITEM_ICON;
137                                 rel2.to, PART_BAR_ITEM_ICON;
138                                 visible, 0;
139                         }
140                         description {
141                                 state, "show" 0.0;
142                                 inherit, "default" 0.0;
143                                 visible, 1;
144                         }
145                 }
146         }
147         programs {
148                 program {
149                         name, "sig,initial,focus";
150                         signal, SIG_INITIAL_FOCUS;
151                         source, SRC_PROG;
152                         action, STATE_SET "default" 0.0;
153                         target, "clip";
154                         after, "sig,focus";
155                 }
156                 program {
157                         name, "sig,focus";
158                         signal, SIG_FOCUS;
159                         source, SRC_PROG;
160                         action, STATE_SET "focus" 0.0;
161                         transition, LINEAR 0.5;
162                         target, "clip";
163                 }
164                 program {
165                         name, "sig,unfocus";
166                         signal, SIG_UNFOCUS;
167                         source, SRC_PROG;
168                         action, STATE_SET "default" 0.0;
169                         transition, LINEAR 0.5;
170                         target, "clip";
171                 }
172                 program {
173                         name, "sig,focus,to,up";
174                         signal, SIG_FOCUS_TO_UP;
175                         source, SRC_PROG;
176                         action, STATE_SET "up" 0.0;
177                         transition, LINEAR 0.5;
178                         target, "clip";
179                 }
180                 program {
181                         name, "sig,focus,to,down";
182                         signal, SIG_FOCUS_TO_DOWN;
183                         source, SRC_PROG;
184                         action, STATE_SET "down" 0.0;
185                         transition, LINEAR 0.5;
186                         target, "clip";
187                 }
188                 program {
189                         name, "sig,focus,to,right";
190                         signal, SIG_FOCUS_TO_RIGHT;
191                         source, SRC_PROG;
192                         action, STATE_SET "right" 0.0;
193                         transition, LINEAR 0.5;
194                         target, "clip";
195                 }
196                 program {
197                         name, "sig,unfocus,to,right";
198                         signal, SIG_UNFOCUS_TO_RIGHT;
199                         source, SRC_PROG;
200                         action, STATE_SET "left" 0.0;
201                         target, "clip";
202                         after, "sig,focus";
203                 }
204                 program {
205                         name, "sig,focus,to,left";
206                         signal, SIG_FOCUS_TO_LEFT;
207                         source, SRC_PROG;
208                         action, STATE_SET "left" 0.0;
209                         transition, LINEAR 0.5;
210                         target, "clip";
211                 }
212                 program {
213                         name, "sig,unfocus,to,left";
214                         signal, SIG_UNFOCUS_TO_LEFT;
215                         source, SRC_PROG;
216                         action, STATE_SET "right" 0.0;
217                         target, "clip";
218                         after, "sig,focus";
219                 }
220                 program {
221                         name, "sig,show,mask";
222                         signal, SIG_SHOW_MASK;
223                         source, SRC_PROG;
224                         script {
225                                 set_int(mask_on, 1);
226                         }
227                         after, "sig,show,mask,after";
228                 }
229                 program {
230                         name, "sig,show,mask,after";
231                         source, SRC_PROG;
232                         action, STATE_SET "show" 0.0;
233                         target, "mask";
234                 }
235                 program {
236                         name, "sig,focus,mask";
237                         signal, SIG_FOCUS;
238                         source, SRC_PROG;
239                         script {
240                                 if (get_int(mask_on) == 1)
241                                         set_state(PART:"mask_focus", "show", 0.0);
242                         }
243                 }
244         }
245 }