efl

Форк
0
/
dynamic_multiseat.edc 
280 строк · 6.7 Кб
1
collections {
2

3
   color_classes {
4
      color_class {
5
         name: "button_bg,1";
6
         color: 200 200 200 255;
7
      }
8
      color_class {
9
         name: "button_bg,2";
10
         color: 200 200 200 255;
11
      }
12
      color_class {
13
         name: "button_bg,3";
14
         color: 200 200 200 255;
15
      }
16
      color_class {
17
         name: "button_bg,4";
18
         color: 200 200 200 255;
19
      }
20
   }
21

22
   group {
23
      name: "example/main";
24
      min: 400 400;
25

26
      parts {
27
         part {
28
            name: "bg";
29
            type: RECT;
30
            mouse_events: 0;
31
            description {
32
               state: "default" 0.0;
33
            }
34
         }
35

36
         part {
37
            name: "title";
38
            type: TEXT;
39
            mouse_events: 0;
40
            description {
41
               state: "default" 0.0;
42
               color: 0 0 0 255;
43
               rel1 {
44
                  relative: 0.0 0.0;
45
                  offset: 0 0;
46
                  to: "bg";
47
               }
48
               rel2 {
49
                  relative: 1.0 0.2;
50
                  offset: -1 -1;
51
                  to: "bg";
52
               }
53
               text {
54
                  text: "Dynamic Multiseat Example";
55
                  size: 16;
56
                  font: "sans";
57
                  min: 1 1;
58
               }
59
            }
60
         }
61

62
         part {
63
            name: "buttons";
64
            type: RECT;
65
            mouse_events: 0;
66
            description {
67
               state: "default" 0.0;
68
               rel1.relative: 0.2 0.3;
69
               rel2.relative: 0.8 0.9;
70
               color: 255 255 255 0;
71
            }
72
         }
73

74
         part {
75
            name: "button_bg,1";
76
            type: RECT;
77
            mouse_events: 1;
78
            description {
79
               state: "default" 0.0;
80
               rel1 {
81
                  to: "buttons";
82
                  relative: 0.1 0.1;
83
               }
84
               rel2 {
85
                  to: "buttons";
86
                  relative: 0.45 0.45;
87
               }
88
               color_class: "button_bg,1";
89
            }
90
         }
91

92
         part {
93
            name: "button1";
94
            type: RECT;
95
            mouse_events: 0;
96
            description {
97
               state: "default" 0.0;
98
               rel1 {
99
                  to: "button_bg,1";
100
                  offset: 10 10;
101
               }
102
               rel2 {
103
                  to: "button_bg,1";
104
                  offset: -11 -11;
105
               }
106
               color: 200 200 200 255;
107
            }
108
         }
109

110
         part {
111
            name: "button_bg,2";
112
            type: RECT;
113
            mouse_events: 1;
114
            description {
115
               state: "default" 0.0;
116
               rel1 {
117
                  to: "buttons";
118
                  relative: 0.55 0.1;
119
               }
120
               rel2 {
121
                  to: "buttons";
122
                  relative: 0.9 0.45;
123
               }
124
               color_class: "button_bg,2";
125
            }
126
         }
127

128
         part {
129
            name: "button2";
130
            type: RECT;
131
            mouse_events: 0;
132
            description {
133
               state: "default" 0.0;
134
               rel1 {
135
                  to: "button_bg,2";
136
                  offset: 10 10;
137
               }
138
               rel2 {
139
                  to: "button_bg,2";
140
                  offset: -11 -11;
141
               }
142
               color: 200 200 200 255;
143
            }
144
         }
145

146
         part {
147
            name: "button_bg,3";
148
            type: RECT;
149
            mouse_events: 1;
150
            description {
151
               state: "default" 0.0;
152
               rel1 {
153
                  to: "buttons";
154
                  relative: 0.1 0.55;
155
               }
156
               rel2 {
157
                  to: "buttons";
158
                  relative: 0.45 0.9;
159
               }
160
               color_class: "button_bg,3";
161
            }
162
         }
163

164
         part {
165
            name: "button3";
166
            type: RECT;
167
            mouse_events: 0;
168
            description {
169
               state: "default" 0.0;
170
               rel1 {
171
                  to: "button_bg,3";
172
                  offset: 10 10;
173
               }
174
               rel2 {
175
                  to: "button_bg,3";
176
                  offset: -11 -11;
177
               }
178
               color: 200 200 200 255;
179
            }
180
         }
181

182
         part {
183
            name: "button_bg,4";
184
            type: RECT;
185
            mouse_events: 1;
186
            description {
187
               state: "default" 0.0;
188
               rel1 {
189
                  to: "buttons";
190
                  relative: 0.55 0.55;
191
               }
192
               rel2 {
193
                  to: "buttons";
194
                  relative: 0.9 0.9;
195
               }
196
               color_class: "button_bg,4";
197
            }
198
         }
199

200
         part {
201
            name: "button4";
202
            type: RECT;
203
            mouse_events: 0;
204
            description {
205
               state: "default" 0.0;
206
               rel1 {
207
                  to: "button_bg,4";
208
                  offset: 10 10;
209
               }
210
               rel2 {
211
                  to: "button_bg,4";
212
                  offset: -11 -11;
213
               }
214
               color: 200 200 200 255;
215
            }
216
         }
217
      }
218

219
      script {
220
         public red;
221
         public green;
222
         public blue;
223
         public seat_count;
224
      }
225

226
      programs {
227
         program {
228
            name: "seat,added";
229
            signal: "seat,added,*";
230
            source: "";
231
            script {
232
               new seat_name[128];
233
               new buf[256];
234
               new r, g, b;
235

236
               r = rand() * 255 / 65535;
237
               append_int(red, r);
238
               g = rand() * 255 / 65535;
239
               append_int(green, g);
240
               b = rand() * 255 / 65535;
241
               append_int(blue, b);
242

243
               set_int(seat_count, get_int(seat_count) + 1);
244

245
               strncpy(seat_name, sig[strlen("seat,added,")],
246
                       strchr(sig[strlen("seat,added,")], ","));
247
               snprintf(buf, sizeof(buf),
248
                        "seat,color,%s,r=%i,g=%i,b=%i", seat_name,
249
                        r, g, b);
250
               emit(buf, "theme");
251
            }
252
         }
253

254
         program {
255
            name: "button,in";
256
            signal: "seat,*,mouse,in";
257
            source: "button_bg,*";
258
            script {
259
               new idx, r, g, b;
260

261
               idx = atoi(sig[strlen("seat,seat")]) - 1;
262
               r = fetch_int(red, idx);
263
               g = fetch_int(green, idx);
264
               b = fetch_int(blue, idx);
265

266
               set_color_class(src, r, g, b, 255);
267
            }
268
         }
269

270
         program {
271
            name: "button,out";
272
            signal: "seat,*,mouse,out";
273
            source: "button_bg,*";
274
            script {
275
               set_color_class(src, 200, 200, 200, 255);
276
            }
277
         }
278
      }
279
   }
280
}
281

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.