summaryrefslogtreecommitdiff
path: root/data/elementary/themes/macros.edc
blob: 720c25debaddaa1ecaea8a765ba124cd3e53fb4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
#define ASPECT_FILL(_ASPECT) \
   aspect: _ASPECT _ASPECT; aspect_preference: NONE;
#define TILED_PATTERN(_WIDTH, _HEIGHT) \
   fill { size { relative: 0.0 0.0; offset: _WIDTH _HEIGHT; } }
#define TILED_HORIZ(_WIDTH) \
   fill { size { relative: 0.0 1.0; offset: _WIDTH 0; } }
#define FIXED_SIZE(_WIDTH, _HEIGHT) \
   min: _WIDTH _HEIGHT; max: _WIDTH _HEIGHT; fixed: 1 1;

#define ICMIN 15

#define SPACER_TEXT "NN";

#define BACKGROUND_COMP LOSSY 99
//#define BACKGROUND_COMP LOSSY_ETC1
//#define BACKGROUND_COMP LOSSY_ETC2
#define BACKGROUND_IMG \
   set { name: "background"; \
     image { image: "p-5120.png" BACKGROUND_COMP; size: 3841 2161 51200 28800; } \
     image { image: "p-3840.png" BACKGROUND_COMP; size: 3201 1801  3840  2160; } \
     image { image: "p-3200.png" BACKGROUND_COMP; size: 2561 1441  3200  1800; } \
     image { image: "p-2560.png" BACKGROUND_COMP; size: 1921 1081  2560  1440; } \
     image { image: "p-1920.png" BACKGROUND_COMP; size: 1601  900  1920  1080; } \
     image { image: "p-1600.png" BACKGROUND_COMP; size: 1281  721  1600   900; } \
     image { image: "p-1280.png" BACKGROUND_COMP; size:    0    0  1280   720; } \
   }

#define DARK_GREY_BG_COLOR 48 48 48 255
#define DARK_GREY_BG_DISABLED_COLOR 64 64 64 255

#define SHAD(_to, _clip, _img, _l, _r, _t, _b, _scale) \
      scale: 1; clip_to: _clip; \
      description { state: "default" 0.0; \
         rel.to: _to; \
         image.normal: _img; \
         image.border: 44 44 44 44; \
         image.border_scale: 1; \
         image.border_scale_by: _scale; \
         rel1.offset: (-_l) (-_t); \
         rel2.offset: (_r-1) (_b-1); \
         fill.smooth: 0; \
         offscale; \
      }
#define SHAD_CLIP(_to, _clip, _l, _r, _t, _b, _scale) \
   part { type: RECT; name: "_shcl1"; \
      scale: 1; clip_to: _clip; \
      description { state: "default" 0.0; \
         rel.to: _to; \
         rel1.offset: (-_l) (-_t); \
         rel2.offset: (_r-1) -1; \
         rel2.relative: 1.0 0.0; \
         offscale; \
      } \
   } \
   part { type: RECT; name: "_shcl2"; \
      scale: 1; clip_to: _clip; \
      description { state: "default" 0.0; \
         rel.to: _to; \
         rel1.offset: (-_l) 0; \
         rel1.relative: 0.0 1.0; \
         rel2.offset: (_r-1) (_b-1); \
         offscale; \
      } \
   } \
   part { type: RECT; name: "_shcl3"; \
      scale: 1; clip_to: _clip; \
      description { state: "default" 0.0; \
         rel.to: _to; \
         rel1.offset: (-_l) 0; \
         rel2.offset: -1 -1; \
         rel2.relative: 0.0 1.0; \
         offscale; \
      } \
   } \
   part { type: RECT; name: "_shcl4"; \
      scale: 1; clip_to: _clip; \
      description { state: "default" 0.0; \
         rel.to: _to; \
         rel1.offset: 0 0; \
         rel1.relative: 1.0 0.0; \
         rel2.offset: (_r-1) -1; \
         offscale; \
      } \
   }

#define WIN_SHAD(_to, _clip, _img, _l, _r, _t, _b, _scale) \
   SHAD_CLIP(_to, _clip, _l, _r, _t, _b, _scale) \
   part { name: "_sh1"; mouse_events: 0; \
      SHAD(_to, "_shcl1", _img, _l, _r, _t, _b, _scale) \
   } \
   part { name: "_sh2"; mouse_events: 0; \
      SHAD(_to, "_shcl2", _img, _l, _r, _t, _b, _scale) \
   } \
   part { name: "_sh3"; mouse_events: 0; \
      SHAD(_to, "_shcl3", _img, _l, _r, _t, _b, _scale) \
   } \
   part { name: "_sh4"; mouse_events: 0; \
      SHAD(_to, "_shcl4", _img, _l, _r, _t, _b, _scale) \
   }

// XXX: below - remove these in favor of WIN_SHAD() above in the edc
#define WIN_SHADOW_SMALL \
   image.normal: "win_shadow.png"; \
   image.border: 32 32 32 32; \
   image.border_scale: 1; \
   image.border_scale_by: 0.5; \
   image.middle: 0; \
   rel1.offset: -10 -7; \
   rel2.offset: 9 10; \
   fill.smooth: 0; \
   offscale

#define WIN_SHADOW \
   image.normal: "win_shadow.png"; \
   image.border: 32 32 32 32; \
   image.border_scale: 1; \
   image.border_scale_by: 1.0; \
   image.middle: 0; \
   rel1.offset: -21 -14; \
   rel2.offset: 20 27; \
   fill.smooth: 0; \
   offscale
#define WIN_SHADOW_SMALL \
   image.normal: "win_shadow.png"; \
   image.border: 32 32 32 32; \
   image.border_scale: 1; \
   image.border_scale_by: 0.5; \
   image.middle: 0; \
   rel1.offset: -10 -7; \
   rel2.offset: 9 10; \
   fill.smooth: 0; \
   offscale
#define WIN_SHADOW_SPACER \
   rel1.offset: 21 14; \
   rel2.offset: -22 -29; \
   offscale
#define WIN_MENU_SHADOW \
   image.normal: "win_menu_shadow.png"; \
   image.border: 32 32 32 32; \
   image.border_scale: 1; \
   image.border_scale_by: 1.0; \
   image.middle: 0; \
   rel1.offset: -21 -14; \
   rel2.offset: 20 27; \
   fill.smooth: 0; \
   offscale
#define WIN_SHADOW_ANGLE_SMALL(_img) \
   image.normal: _img; \
   image.border: 32 32 32 32; \
   image.border_scale: 1; \
   image.border_scale_by: 0.5; \
   image.middle: 0; \
   rel1.offset: -10 -7; \
   rel2.offset: 9 13; \
   fill.smooth: 0; \
   offscale

#define IMAGE_RING(x, sz) \
   set { name: x; \
      image { image: x"1.png" COMP; size:  (sz/2)   (sz/2)  99999   99999;   } \
      image { image: x"2.png" COMP; size:  (sz/4)   (sz/4)  (sz/2)  (sz/2);  } \
      image { image: x"3.png" COMP; size:  (sz/8)   (sz/8)  (sz/4)  (sz/4);  } \
      image { image: x"4.png" COMP; size:  (sz/16)  (sz/16) (sz/8)  (sz/8);  } \
      image { image: x"5.png" COMP; size:       0        0  (sz/16) (sz/16); } \
   }
#define BUSY(x, start1, start2, stop1, stop2) \
   program { signal: start1; source: start2; \
      action: STATE_SET "visible" 0.0; \
      transition: SINUSOIDAL 1.0; \
      target: "busy"; } \
   program { signal: start1; source: start2; \
      action: STATE_SET "default" 0.0; \
      target: "busy1"; \
      target: "busy2"; \
      target: "busy3"; \
      after: "busy-p11"; \
      after: "busy-p21"; \
      after: "busy-p31"; } \
   program { signal: stop1; source: stop2; \
      action: STATE_SET "default" 0.0; \
      transition: SINUSOIDAL 1.0; \
      target: "busy"; \
      after: "busy_stop2"; } \
   program { name: "busy_stop2"; \
      action: ACTION_STOP; \
      target: "busy-p11"; \
      target: "busy-p12"; \
      target: "busy-p21"; \
      target: "busy-p22"; \
      target: "busy-p31"; \
      target: "busy-p32"; } \
   part { name: "busy"; type: RECT; \
      description { state: "default" 0.0; \
         rel1.to: x; rel2.to: x; \
         color: 255 255 255 0; visible: 0; } \
      description { state: "visible" 0.0; \
         inherit: "default" 0.0; \
         color: 255 255 255 255; visible: 1; } } \
   part { name: "busy1"; \
      clip_to: "busy"; \
      description { state: "default" 0.0; \
         rel1.to: "busy"; rel2.to: "busy"; \
         aspect: 1.0 1.0; aspect_preference: BOTH; \
         image.normal: "ringa"; \
         color: 255 255 255 255; \
         map.on: 1; \
         map.smooth: 1; \
         map.rotation.center: "busy"; \
         map.rotation.z: 0; } \
      description { state: "default" 1.0; \
         inherit: "default" 0.0; \
         map.rotation.z: 360; } } \
   program { name: "busy-p11"; \
      action: STATE_SET "default" 1.0; \
      transition: LINEAR 1.0; \
      target: "busy1"; \
      after: "busy-p12"; } \
   program { name: "busy-p12"; \
      action: STATE_SET "default" 0.0; \
      target: "busy1"; \
      after: "busy-p11"; } \
   part { name: "busy2"; \
      clip_to: "busy"; \
      description { state: "default" 0.0; \
         rel1.to: "busy"; rel2.to: "busy"; \
         aspect: 1.0 1.0; aspect_preference: BOTH; \
         image.normal: "ringb"; \
         color: 255 255 255 128; \
         map.on: 1; \
         map.smooth: 1; \
         map.rotation.center: "busy"; \
         map.rotation.z: 420; } \
      description { state: "default" 1.0; \
         inherit: "default" 0.0; \
         map.rotation.z: 80; } } \
   program { name: "busy-p21"; \
      action: STATE_SET "default" 1.0; \
      transition: LINEAR 0.7; \
      target: "busy2"; \
      after: "busy-p22"; } \
   program { name: "busy-p22"; \
      action: STATE_SET "default" 0.0; \
      target: "busy2"; \
      after: "busy-p21"; } \
   part { name: "busy3"; \
      clip_to: "busy"; \
      description { state: "default" 0.0; \
         rel1.to: "busy"; rel2.to: "busy"; \
         aspect: 1.0 1.0; aspect_preference: BOTH; \
         image.normal: "ringc"; \
         color: 51 153 255 128; \
         map.on: 1; \
         map.smooth: 1; \
         map.rotation.center: "busy"; \
         map.rotation.z: 170; } \
      description { state: "default" 1.0; \
         inherit: "default" 0.0; \
         map.rotation.z: 530; } } \
   program { name: "busy-p31"; \
      action: STATE_SET "default" 1.0; \
      transition: LINEAR 1.4; \
      target: "busy3"; \
      after: "busy-p32"; } \
   program { name: "busy-p32"; \
      action: STATE_SET "default" 0.0; \
      target: "busy3"; \
      after: "busy-p31"; }

#define ICON         1
#define LABEL        2
#define MASK         3
#define DISABLE      4
#define PRESSED      8
#define BACKGROUND  16
#define BUTTONMODE_SCRIPT \
      public btmode; \
      public eval_mode(m) { \
         new m1 = m & MASK; \
         new d  = m & DISABLE; \
         new p  = m & PRESSED; \
         new bg = m & BACKGROUND; \
         if (bg) { \
            set_state(PART:"base", "hidden", 0.0); \
            set_state(PART:"elm.swallow.background", "visible", 0.0); \
         } else { \
            set_state(PART:"elm.swallow.background", "default", 0.0); \
            if (!d) { \
               if (!p) { \
                  set_state(PART:"base", "default", 0.0); \
                  set_state(PART:"shadow", "default", 0.0); \
               } else { \
                  set_state(PART:"base", "pressed", 0.0); \
                  set_state(PART:"shadow", "pressed", 0.0); \
               } \
            } else { \
               set_state(PART:"base", "disabled", 0.0); \
               set_state(PART:"shadow", "disabled", 0.0); \
            } \
         } \
         if (m1 == (ICON | LABEL)) { \
            if (!d) { \
               set_state(PART:"elm.swallow.content", "visible", 0.0); \
               set_state(PART:"sizer_content", "visible", 0.0); \
               set_state(PART:"event", "default", 0.0); \
               if (!p) { \
                  set_state(PART:"elm.text", "visible", 0.0); \
                  set_state(PART:"icon_clip", "default", 0.0); \
               } else { \
                  set_state(PART:"elm.text", "pressed_visible", 0.0); \
                  set_state(PART:"icon_clip", "pressed", 0.0); \
               } \
            } else { \
               set_state(PART:"elm.swallow.content", "visible", 0.0); \
               set_state(PART:"sizer_content", "visible", 0.0); \
               set_state(PART:"elm.text", "disabled_visible", 0.0); \
               set_state(PART:"icon_clip", "disabled", 0.0); \
               set_state(PART:"event", "disabled", 0.0); \
            } \
         } else if (m1 == (ICON)) { \
            if (!d) { \
               set_state(PART:"elm.swallow.content", "icononly", 0.0); \
               set_state(PART:"sizer_content", "icononly", 0.0); \
               set_state(PART:"event", "default", 0.0); \
               set_state(PART:"elm.text", "default", 0.0); \
               if (!p) \
                  set_state(PART:"icon_clip", "default", 0.0); \
               else \
                  set_state(PART:"icon_clip", "pressed", 0.0); \
            } else { \
               set_state(PART:"elm.swallow.content", "icononly", 0.0); \
               set_state(PART:"sizer_content", "icononly", 0.0); \
               set_state(PART:"elm.text", "default", 0.0); \
               set_state(PART:"icon_clip", "disabled", 0.0); \
               set_state(PART:"event", "disabled", 0.0); \
            } \
         } else if (m1 == (LABEL)) { \
            if (!d) { \
               set_state(PART:"elm.swallow.content", "default", 0.0); \
               set_state(PART:"sizer_content", "default", 0.0); \
               set_state(PART:"icon_clip", "default", 0.0); \
               set_state(PART:"event", "default", 0.0); \
               if (!p) \
                  set_state(PART:"elm.text", "textonly", 0.0); \
               else \
                  set_state(PART:"elm.text", "pressed_textonly", 0.0); \
            } else { \
               set_state(PART:"elm.swallow.content", "default", 0.0); \
               set_state(PART:"sizer_content", "default", 0.0); \
               set_state(PART:"elm.text", "disabled_textonly", 0.0); \
               set_state(PART:"icon_clip", "disabled", 0.0); \
               set_state(PART:"event", "disabled", 0.0); \
            } \
         } else { \
            if (!d) { \
               set_state(PART:"elm.swallow.content", "default", 0.0); \
               set_state(PART:"sizer_content", "default", 0.0); \
               set_state(PART:"icon_clip", "default", 0.0); \
               set_state(PART:"event", "default", 0.0); \
            } else { \
               set_state(PART:"elm.swallow.content", "default", 0.0); \
               set_state(PART:"sizer_content", "default", 0.0); \
               set_state(PART:"icon_clip", "disabled", 0.0); \
               set_state(PART:"event", "disabled", 0.0); \
            } \
         } \
      } \
      flag_set(flag) { \
         new m = get_int(btmode) | flag; \
         set_int(btmode, m); eval_mode(m); \
      } \
      flag_unset(flag) { \
         new m = get_int(btmode) & ~flag; \
         set_int(btmode, m); eval_mode(m); \
      }