revert between 56095 -> 55830 in arch
[AROS.git] / workbench / c / Decoration / config.c
blob420b8e49444ad78d8a4da5e8ec26a0819d1b615f
1 /*
2 Copyright 2011-2012, The AROS Development Team.
3 $Id$
4 */
6 #include <proto/dos.h>
7 #include <proto/exec.h>
9 #include <string.h>
10 #include <stdlib.h>
11 #include <stdio.h>
13 #include "newimage.h"
14 #include "config.h"
16 #define DEBUG 0
17 #include <aros/debug.h>
19 static STRPTR SkipChars(STRPTR v)
21 STRPTR c;
22 c = strstr(v, "=");
23 return ++c;
26 static LONG GetInt(STRPTR v)
28 STRPTR c;
29 c = SkipChars(v);
30 return (LONG) atol(c);
33 static void GetIntegers(STRPTR v, LONG *v1, LONG *v2)
35 STRPTR c;
36 TEXT va1[32], va2[32];
37 LONG cnt;
38 D(bug("Decoration/GetIntegers: v='%s', v1=%p, v2=%p\n", v, v1, v2));
39 c = SkipChars(v);
40 D(bug("Decoration/GetIntegers: c='%s'\n", c));
41 if (c)
43 cnt = sscanf(c, "%31s %31s", va1, va2);
44 D(bug("Decoration/GetIntegers: va1='%s', va2='%s'\n", va1, va2));
45 if (cnt == 1)
47 *v1 = -1;
48 *v2 = atol(va1);
50 else if (cnt == 2)
52 *v1 = atol(va1);
53 *v2 = atol(va2);
58 static void GetTripleIntegers(STRPTR v, LONG *v1, LONG *v2, LONG *v3)
60 STRPTR ch;
61 unsigned int a, b;
62 int c;
63 LONG cnt;
64 ch = SkipChars(v);
65 if (ch)
67 cnt = sscanf(ch, "%x %x %d", &a, &b, &c);
68 if (cnt == 3)
70 *v1 = a;
71 *v2 = b;
72 *v3 = c;
77 static void GetColors(STRPTR v, LONG *v1, LONG *v2)
79 STRPTR ch;
80 unsigned int a, b;
81 LONG cnt;
82 ch = SkipChars(v);
83 if (ch)
85 cnt = sscanf(ch, "%x %x", &a, &b);
86 if (cnt == 2)
88 *v1 = a;
89 if (v2 != NULL)
90 *v2 = b;
92 else if (cnt == 1)
93 *v1 = a;
97 static BOOL GetBool(STRPTR v, STRPTR id)
99 if (strstr(v, id)) return TRUE; else return FALSE;
102 static void LoadMenuConfig(STRPTR path, struct DecorConfig * dc)
104 TEXT buffer[256];
105 STRPTR line, v;
106 BPTR file;
107 BPTR lock;
108 BPTR olddir = 0;
110 dc->MenuIsTiled = FALSE;
111 dc->MenuTileLeft = 0;
112 dc->MenuTileTop = 0;
113 dc->MenuTileRight = 0;
114 dc->MenuTileBottom = 0;
115 dc->MenuInnerLeft = 0;
116 dc->MenuInnerTop = 0;
117 dc->MenuInnerRight = 0;
118 dc->MenuInnerBottom = 0;
119 dc->MenuHighlightTint = 0x770044dd;
121 lock = Lock(path, ACCESS_READ);
122 if (lock)
123 olddir = CurrentDir(lock);
124 else
125 return;
127 file = Open("Menu/Config", MODE_OLDFILE);
128 if (file)
132 line = FGets(file, buffer, 256);
133 if (line)
135 if ((v = strstr(line, "TileLeft ")) == line)
137 dc->MenuTileLeft = GetInt(v);
138 dc->MenuIsTiled = TRUE;
140 else if ((v = strstr(line, "TileTop ")) == line)
142 dc->MenuTileTop = GetInt(v);
143 dc->MenuIsTiled = TRUE;
145 else if ((v = strstr(line, "TileRight ")) == line)
147 dc->MenuTileRight = GetInt(v);
148 dc->MenuIsTiled = TRUE;
150 else if ((v = strstr(line, "TileBottom ")) == line)
152 dc->MenuTileBottom = GetInt(v);
153 dc->MenuIsTiled = TRUE;
155 else if ((v = strstr(line, "InnerLeft ")) == line)
157 dc->MenuInnerLeft = GetInt(v);
159 else if ((v = strstr(line, "InnerTop ")) == line)
161 dc->MenuInnerTop = GetInt(v);
163 else if ((v = strstr(line, "InnerRight ")) == line)
165 dc->MenuInnerRight = GetInt(v);
167 else if ((v = strstr(line, "InnerBottom ")) == line)
169 dc->MenuInnerBottom = GetInt(v);
171 else if ((v = strstr(line, "HighlightTint ")) == line)
173 GetColors(v, &dc->MenuHighlightTint, NULL);
177 while(line);
178 Close(file);
181 if (olddir) CurrentDir(olddir);
182 UnLock(lock);
185 static void LoadSystemConfig(STRPTR path, struct DecorConfig * dc)
187 TEXT buffer[256];
188 STRPTR line, v;
189 BPTR file;
190 BPTR lock;
191 BPTR olddir = 0;
193 dc->WinFrameStyle = 1;
194 dc->BarJoinTB_o = 0;
195 dc->BarJoinTB_s = 0;
196 dc->BarPreGadget_o = 0;
197 dc->BarPreGadget_s = 0;
198 dc->BarPre_o = 0;
199 dc->BarPre_s = 0;
200 dc->BarLGadgetFill_o = 0;
201 dc->BarLGadgetFill_s = 0;
202 dc->BarJoinGB_o = 0;
203 dc->BarJoinGB_s = 0;
204 dc->BarLFill_o = 0;
205 dc->BarLFill_s = 0;
206 dc->BarJoinBT_o = 0;
207 dc->BarJoinBT_s = 0;
208 dc->BarTitleFill_o = 0;
209 dc->BarTitleFill_s = 0;
210 dc->BarRFill_o = 0;
211 dc->BarRFill_s = 0;
212 dc->BarJoinBG_o = 0;
213 dc->BarJoinBG_s = 0;
214 dc->BarRGadgetFill_o = 0;
215 dc->BarRGadgetFill_s = 0;
216 dc->BarPostGadget_o = 0;
217 dc->BarPostGadget_s = 0;
218 dc->BarPost_o = 0;
219 dc->BarPost_s = 0;
220 dc->ContainerTop_o = 0;
221 dc->ContainerTop_s = 0;
222 dc->ContainerVertTile_o = 0;
223 dc->ContainerVertTile_s = 0;
224 dc->ContainerBottom_o = 0;
225 dc->ContainerBottom_s = 0;
226 dc->KnobTop_o = 0;
227 dc->KnobTop_s = 0;
228 dc->KnobTileTop_o = 0;
229 dc->KnobTileTop_s = 0;
230 dc->KnobVertGripper_o = 0;
231 dc->KnobVertGripper_s = 0;
232 dc->KnobTileBottom_o = 0;
233 dc->KnobTileBottom_s = 0;
234 dc->KnobBottom_o = 0;
235 dc->KnobBottom_s = 0;
236 dc->ContainerLeft_o = 0;
237 dc->ContainerLeft_s = 0;
238 dc->ContainerHorTile_o = 0;
239 dc->ContainerHorTile_s = 0;
240 dc->ContainerRight_o = 0;
241 dc->ContainerRight_s = 0;
242 dc->KnobLeft_o = 0;
243 dc->KnobLeft_s = 0;
244 dc->KnobTileLeft_o = 0;
245 dc->KnobTileLeft_s = 0;
246 dc->KnobHorGripper_o = 0;
247 dc->KnobHorGripper_s = 0;
248 dc->KnobTileRight_o = 0;
249 dc->KnobTileRight_s = 0;
250 dc->KnobRight_o = 0;
251 dc->KnobRight_s = 0;
252 dc->GadgetsThreeState = FALSE;
253 dc->BarRounded = FALSE;
254 dc->TitleOutline = FALSE;
255 dc->TitleShadow = FALSE;
256 dc->FillTitleBar = FALSE;
257 dc->BarMasking = FALSE;
258 dc->CloseGadgetOnRight = FALSE;
259 dc->UseGradients = FALSE;
260 dc->BarVertical = FALSE;
261 dc->RightBorderGadgets = 0;
262 dc->HorizScrollerHeight = 0;
263 dc->ScrollerInnerSpacing = 0;
264 dc->BottomBorderGadgets = 0;
265 dc->RightBorderNoGadgets = 0;
266 dc->BottomBorderNoGadgets = 0;
267 dc->BarHeight = 0;
268 dc->SizeAddX = 0;
269 dc->SizeAddY = 0;
270 dc->UpDownAddX = 0;
271 dc->UpDownAddY = 0;
272 dc->LeftRightAddX = 0;
273 dc->LeftRightAddY = 0;
274 dc->ActivatedGradientColor_s = 0xAAAAAAAA;
275 dc->ActivatedGradientColor_e = 0xEEEEEEFF;
276 dc->ActivatedGradientColor_a = 0;
277 dc->DeactivatedGradientColor_s = 0x66666666;
278 dc->DeactivatedGradientColor_e = 0xAAAAAABB;
279 dc->DeactivatedGradientColor_a = 0;
280 dc->ShadeValues_l = 320;
281 dc->ShadeValues_m = 240;
282 dc->ShadeValues_d = 128;
283 dc->BaseColors_a = 0;
284 dc->BaseColors_d = 0;
285 dc->TitleColorText = 0x00CCCCCC;
286 dc->TitleColorShadow = 0x00444444;
287 dc->LeftBorder = 4;
288 dc->RightBorder = 4;
289 dc->BottomBorder = 4;
290 dc->SLogoOffset = 0;
291 dc->STitleOffset = 0;
292 dc->SBarHeight = 0;
293 dc->SBarChildPre_o = 0;
294 dc->SBarChildPre_s = 0;
295 dc->SBarChildFill_o = 0;
296 dc->SBarChildFill_s = 0;
297 dc->SBarChildPost_o = 0;
298 dc->SBarChildPost_s = 0;
299 dc->SBarGadPre_o = 0;
300 dc->SBarGadPre_s = 0;
301 dc->SBarGadFill_o = 0;
302 dc->SBarGadFill_s = 0;
303 dc->SBarGadPost_o = 0;
304 dc->SBarGadPost_s = 0;
305 dc->STitleOutline = FALSE;
306 dc->STitleShadow = FALSE;
307 dc->LUTBaseColors_a = 0x00CCCCCC;
308 dc->LUTBaseColors_d = 0x00888888;
309 dc->STitleColorText = 0x00CCCCCC;
310 dc->STitleColorShadow = 0x00444444;
312 D(bug("Decoration/LoadSystemConfig: dc initialized\n"));
314 lock = Lock(path, ACCESS_READ);
315 if (lock)
317 olddir = CurrentDir(lock);
319 else return;
321 D(bug("Decoration/LoadSystemConfig: directory locked\n"));
323 file = Open("System/Config", MODE_OLDFILE);
324 D(bug("Decoration/LoadSystemConfig: file=%p\n", (void *)file));
325 if (file)
329 line = FGets(file, buffer, 256);
330 if (line)
332 D(bug("Decoration/ReadSystemConfig: Parsing line '%s'\n", line));
333 if ((v = strstr(line, "NoInactiveSelected ")) == line) {
334 dc->GadgetsThreeState = GetBool(v, "Yes");
335 } else if ((v = strstr(line, "FrameStyle ")) == line) {
336 dc->WinFrameStyle = GetInt(v);
337 } else if ((v = strstr(line, "BarRounded ")) == line) {
338 dc->BarRounded = GetBool(v, "Yes");
339 } else if ((v = strstr(line, "WindowTitleMode ")) == line) {
340 dc->TitleOutline = GetBool(v, "Outline");
341 dc->TitleShadow = GetBool(v, "Shadow");
342 } else if ((v = strstr(line, "FillTitleBar ")) == line) {
343 dc->FillTitleBar = GetBool(v, "Yes");
344 } else if ((v = strstr(line, "BarMasking ")) == line) {
345 dc->BarMasking = GetBool(v, "Yes");
346 } else if ((v = strstr(line, "CloseRight ")) == line) {
347 dc->CloseGadgetOnRight = GetBool(v, "Yes");
348 } else if ((v = strstr(line, "UseGradients ")) == line) {
349 dc->UseGradients = GetBool(v, "Yes");
350 } else if ((v = strstr(line, "BarLayout ")) == line) {
351 dc->BarVertical = GetBool(v, "Vertical");
352 } else if ((v = strstr(line, "RightBorderGads ")) == line) {
353 dc->RightBorderGadgets = GetInt(v);
354 } else if ((v = strstr(line, "HorScrollerHeight ")) == line) {
355 dc->HorizScrollerHeight = GetInt(v);
356 } else if ((v = strstr(line, "ScrollerInnerSpacing ")) == line) {
357 dc->ScrollerInnerSpacing = GetInt(v);
358 } else if ((v = strstr(line, "BottomBorderGads ")) == line) {
359 dc->BottomBorderGadgets = GetInt(v);
360 } else if ((v = strstr(line, "RightBorderNoGads ")) == line) {
361 dc->RightBorderNoGadgets = GetInt(v);
362 } else if ((v = strstr(line, "BottomBorderNoGads ")) == line) {
363 dc->BottomBorderNoGadgets = GetInt(v);
364 } else if ((v = strstr(line, "BarHeight ")) == line) {
365 dc->BarHeight = GetInt(v); //screen, window
366 } else if ((v = strstr(line, "BarJoinTB ")) == line) {
367 GetIntegers(v, &dc->BarJoinTB_o, &dc->BarJoinTB_s);
368 } else if ((v = strstr(line, "BarPreGadget ")) == line) {
369 GetIntegers(v, &dc->BarPreGadget_o, &dc->BarPreGadget_s);
370 } else if ((v = strstr(line, "BarPre ")) == line) {
371 GetIntegers(v, &dc->BarPre_o, &dc->BarPre_s);
372 } else if ((v = strstr(line, "BarLGadgetFill ")) == line) {
373 GetIntegers(v, &dc->BarLGadgetFill_o, &dc->BarLGadgetFill_s);
374 } else if ((v = strstr(line, "BarJoinGB ")) == line) {
375 GetIntegers(v, &dc->BarJoinGB_o, &dc->BarJoinGB_s);
376 } else if ((v = strstr(line, "BarLFill ")) == line) {
377 GetIntegers(v, &dc->BarLFill_o, &dc->BarLFill_s);
378 } else if ((v = strstr(line, "BarJoinBT ")) == line) {
379 GetIntegers(v, &dc->BarJoinBT_o, &dc->BarJoinBT_s);
380 } else if ((v = strstr(line, "BarTitleFill ")) == line) {
381 GetIntegers(v, &dc->BarTitleFill_o, &dc->BarTitleFill_s);
382 } else if ((v = strstr(line, "BarRFill ")) == line) {
383 GetIntegers(v, &dc->BarRFill_o, &dc->BarRFill_s);
384 } else if ((v = strstr(line, "BarJoinBG ")) == line) {
385 GetIntegers(v, &dc->BarJoinBG_o, &dc->BarJoinBG_s);
386 } else if ((v = strstr(line, "BarRGadgetFill ")) == line) {
387 GetIntegers(v, &dc->BarRGadgetFill_o, &dc->BarRGadgetFill_s);
388 } else if ((v = strstr(line, "BarPostGadget ")) == line) {
389 GetIntegers(v, &dc->BarPostGadget_o, &dc->BarPostGadget_s);
390 } else if ((v = strstr(line, "BarPost ")) == line) {
391 GetIntegers(v, &dc->BarPost_o, &dc->BarPost_s);
392 } else if ((v = strstr(line, "ContainerTop ")) == line) {
393 GetIntegers(v, &dc->ContainerTop_o, &dc->ContainerTop_s);
394 } else if ((v = strstr(line, "ContainerVertTile ")) == line) {
395 GetIntegers(v, &dc->ContainerVertTile_o, &dc->ContainerVertTile_s);
396 } else if ((v = strstr(line, "KnobTop ")) == line) {
397 GetIntegers(v, &dc->KnobTop_o, &dc->KnobTop_s);
398 } else if ((v = strstr(line, "KnobTileTop ")) == line) {
399 GetIntegers(v, &dc->KnobTileTop_o, &dc->KnobTileTop_s);
400 } else if ((v = strstr(line, "KnobVertGripper ")) == line) {
401 GetIntegers(v, &dc->KnobVertGripper_o, &dc->KnobVertGripper_s);
402 } else if ((v = strstr(line, "KnobTileBottom ")) == line) {
403 GetIntegers(v, &dc->KnobTileBottom_o, &dc->KnobTileBottom_s);
404 } else if ((v = strstr(line, "KnobBottom ")) == line) {
405 GetIntegers(v, &dc->KnobBottom_o, &dc->KnobBottom_s);
406 } else if ((v = strstr(line, "ContainerBottom ")) == line) {
407 GetIntegers(v, &dc->ContainerBottom_o, &dc->ContainerBottom_s);
408 } else if ((v = strstr(line, "ContainerLeft ")) == line) {
409 GetIntegers(v, &dc->ContainerLeft_o, &dc->ContainerLeft_s);
410 } else if ((v = strstr(line, "ContainerHorTile ")) == line) {
411 GetIntegers(v, &dc->ContainerHorTile_o, &dc->ContainerHorTile_s);
412 } else if ((v = strstr(line, "KnobLeft ")) == line) {
413 GetIntegers(v, &dc->KnobLeft_o, &dc->KnobLeft_s);
414 } else if ((v = strstr(line, "KnobTileLeft ")) == line) {
415 GetIntegers(v, &dc->KnobTileLeft_o, &dc->KnobTileLeft_s);
416 } else if ((v = strstr(line, "KnobHorGripper ")) == line) {
417 GetIntegers(v, &dc->KnobHorGripper_o, &dc->KnobHorGripper_s);
418 } else if ((v = strstr(line, "KnobTileRight ")) == line) {
419 GetIntegers(v, &dc->KnobTileRight_o, &dc->KnobTileRight_s);
420 } else if ((v = strstr(line, "KnobRight ")) == line) {
421 GetIntegers(v, &dc->KnobRight_o, &dc->KnobRight_s);
422 } else if ((v = strstr(line, "ContainerRight ")) == line) {
423 GetIntegers(v, &dc->ContainerRight_o, &dc->ContainerRight_s);
424 } else if ((v = strstr(line, "AddSize ")) == line) {
425 GetIntegers(v, &dc->SizeAddX, &dc->SizeAddY);
426 } else if ((v = strstr(line, "AddUpDown ")) == line) {
427 GetIntegers(v, &dc->UpDownAddX, &dc->UpDownAddY);
428 } else if ((v = strstr(line, "AddLeftRight ")) == line) {
429 GetIntegers(v, &dc->LeftRightAddX, &dc->LeftRightAddY);
430 } else if ((v = strstr(line, "ActivatedGradient ")) == line) {
431 GetTripleIntegers(v, &dc->ActivatedGradientColor_s, &dc->ActivatedGradientColor_e, &dc->ActivatedGradientColor_a);
432 } else if ((v = strstr(line, "DeactivatedGradient ")) == line) {
433 GetTripleIntegers(v, &dc->DeactivatedGradientColor_s, &dc->DeactivatedGradientColor_e, &dc->DeactivatedGradientColor_a);
434 } else if ((v = strstr(line, "ShadeValues ")) == line) {
435 GetTripleIntegers(v, &dc->ShadeValues_l, &dc->ShadeValues_m, &dc->ShadeValues_d);
436 } else if ((v = strstr(line, "BaseColors ")) == line) {
437 GetColors(v, &dc->BaseColors_a, &dc->BaseColors_d);
438 } else if ((v = strstr(line, "WindowTitleColors ")) == line) {
439 GetColors(v, &dc->TitleColorText, &dc->TitleColorShadow);
440 } else if ((v = strstr(line, "LeftBorder ")) == line) {
441 dc->LeftBorder = GetInt(v);
442 } else if ((v = strstr(line, "RightBorder ")) == line) {
443 dc->RightBorder = GetInt(v);
444 } else if ((v = strstr(line, "BottomBorder ")) == line) {
445 dc->BottomBorder = GetInt(v);
446 } else if ((v = strstr(line, "LogoOffset ")) == line) {
447 dc->SLogoOffset = GetInt(v);
448 } else if ((v = strstr(line, "TitleOffset ")) == line) {
449 dc->STitleOffset = GetInt(v);
450 } else if ((v = strstr(line, "SBarHeight ")) == line) {
451 dc->SBarHeight = GetInt(v);
452 } else if ((v = strstr(line, "SBarChildPre ")) == line) {
453 GetIntegers(v, &dc->SBarChildPre_o, &dc->SBarChildPre_s);
454 } else if ((v = strstr(line, "SBarChildFill ")) == line) {
455 GetIntegers(v, &dc->SBarChildFill_o, &dc->SBarChildFill_s);
456 } else if ((v = strstr(line, "SBarChildPost ")) == line) {
457 GetIntegers(v, &dc->SBarChildPost_o, &dc->SBarChildPost_s);
458 } else if ((v = strstr(line, "SBarGadPre ")) == line) {
459 GetIntegers(v, &dc->SBarGadPre_o, &dc->SBarGadPre_s);
460 } else if ((v = strstr(line, "SBarGadFill ")) == line) {
461 GetIntegers(v, &dc->SBarGadFill_o, &dc->SBarGadFill_s);
462 } else if ((v = strstr(line, "SBarGadPost ")) == line) {
463 GetIntegers(v, &dc->SBarGadPost_o, &dc->SBarGadPost_s);
464 } else if ((v = strstr(line, "LUTBaseColors ")) == line) {
465 GetColors(v, &dc->LUTBaseColors_a, &dc->LUTBaseColors_d);
466 } else if ((v = strstr(line, "ScreenTitleColors ")) == line) {
467 GetColors(v, &dc->STitleColorText, &dc->STitleColorShadow);
468 } else if ((v = strstr(line, "ScreenTitleMode ")) == line) {
469 dc->STitleOutline = GetBool(v, "Outline");
470 dc->STitleShadow = GetBool(v, "Shadow");
474 while(line);
475 D(bug("Decoration/LoadSystemConfig: file has been read\n"));
476 Close(file);
479 if (olddir) CurrentDir(olddir);
480 UnLock(lock);
482 D(bug("Decoration/LoadSystemConfig: directory unlocked\n"));
485 struct DecorConfig * LoadConfig(STRPTR path)
487 struct DecorConfig * dc = AllocVec(sizeof(struct DecorConfig), MEMF_ANY | MEMF_CLEAR);
489 D(bug("LoadConfig: dc=%p\n", dc));
491 dc->ThemePath = AllocVec(strlen(path) + 1, MEMF_ANY | MEMF_CLEAR);
492 strcpy(dc->ThemePath, path);
494 D(bug("Decoration/LoadConfig: dc->ThemePath=%p('%s')\n", dc->ThemePath, dc->ThemePath));
496 LoadMenuConfig(path, dc);
498 D(bug("Decoration/LoadConfig: menu config loaded\n"));
500 LoadSystemConfig(path, dc);
502 D(bug("Decoration/LoadConfig: system config loaded\n"));
504 return dc;
507 void FreeConfig(struct DecorConfig * dc)
509 if (dc->ThemePath)
510 FreeVec(dc->ThemePath);
512 FreeVec(dc);
515 struct DecorImages * NewImages()
517 return AllocVec(sizeof(struct DecorImages), MEMF_ANY | MEMF_CLEAR);
520 struct DecorImages * LoadImages(struct DecorConfig * dc)
522 ULONG wgsubimagecols = 4; /* Default value of subimage cols in window gadget */
523 STRPTR path = dc->ThemePath;
525 struct DecorImages * di = NewImages();
527 if (!di)
528 return NULL;
530 if (dc->GadgetsThreeState) wgsubimagecols = 3;
532 di->img_sdepth = GetImageFromFile(path, "System/SDepth/Default", 2, 1);
533 di->img_stitlebar = GetImageFromFile(path, "System/STitlebar/Default", 1, 1);
534 di->img_sbarlogo = GetImageFromFile(path, "System/SBarLogo/Default", 1, 1);
536 di->img_size = GetImageFromFile(path, "System/Size/Default", wgsubimagecols, 1);
537 di->img_close = GetImageFromFile(path, "System/Close/Default", wgsubimagecols, 1);
538 di->img_depth = GetImageFromFile(path, "System/Depth/Default", wgsubimagecols, 1);
539 di->img_zoom = GetImageFromFile(path, "System/Zoom/Default", wgsubimagecols, 1);
540 di->img_mui = GetImageFromFile(path, "System/MUI/Default", wgsubimagecols, 1);
541 di->img_popup = GetImageFromFile(path, "System/PopUp/Default", wgsubimagecols, 1);
542 di->img_snapshot = GetImageFromFile(path, "System/Snapshot/Default", wgsubimagecols, 1);
543 di->img_iconify = GetImageFromFile(path, "System/Iconify/Default", wgsubimagecols, 1);
544 di->img_lock = GetImageFromFile(path, "System/Lock/Default", wgsubimagecols, 1);
545 di->img_up = GetImageFromFile(path, "System/ArrowUp/Default", wgsubimagecols, 1);
546 di->img_down = GetImageFromFile(path, "System/ArrowDown/Default", wgsubimagecols, 1);
547 di->img_left = GetImageFromFile(path, "System/ArrowLeft/Default", wgsubimagecols, 1);
548 di->img_right = GetImageFromFile(path, "System/ArrowRight/Default", wgsubimagecols, 1);
549 di->img_winbar_normal = GetImageFromFile(path, "System/Titlebar/Default", 1, 2);
550 di->img_border_normal = GetImageFromFile(path, "System/Borders/Default", 1, 1);
551 di->img_border_deactivated = GetImageFromFile(path, "System/Borders/Default_Deactivated", 1, 1);
552 di->img_verticalcontainer = GetImageFromFile(path, "System/Container/Vertical", 2, 1);
553 di->img_verticalknob = GetImageFromFile(path, "System/Knob/Vertical", 3, 1);
554 di->img_horizontalcontainer = GetImageFromFile(path, "System/Container/Horizontal", 1, 2);
555 di->img_horizontalknob = GetImageFromFile(path, "System/Knob/Horizontal", 1, 3);
557 di->img_menu = GetImageFromFile(path, "Menu/Background/Default", 1, 1);
558 di->img_amigakey = GetImageFromFile(path, "Menu/AmigaKey/Default", 1, 1);
559 di->img_menucheck = GetImageFromFile(path, "Menu/Checkmark/Default", 1, 1);
560 di->img_submenu = GetImageFromFile(path, "Menu/SubMenu/Default", 1, 1);
562 return di;
565 void FreeImages(struct DecorImages * di)
567 DisposeImageContainer(di->img_sdepth);
568 DisposeImageContainer(di->img_sbarlogo);
569 DisposeImageContainer(di->img_stitlebar);
571 DisposeImageContainer(di->img_size);
572 DisposeImageContainer(di->img_close);
573 DisposeImageContainer(di->img_depth);
574 DisposeImageContainer(di->img_zoom);
575 DisposeImageContainer(di->img_up);
576 DisposeImageContainer(di->img_down);
577 DisposeImageContainer(di->img_left);
578 DisposeImageContainer(di->img_right);
579 DisposeImageContainer(di->img_mui);
580 DisposeImageContainer(di->img_popup);
581 DisposeImageContainer(di->img_snapshot);
582 DisposeImageContainer(di->img_iconify);
583 DisposeImageContainer(di->img_lock);
584 DisposeImageContainer(di->img_winbar_normal);
585 DisposeImageContainer(di->img_border_normal);
586 DisposeImageContainer(di->img_border_deactivated);
587 DisposeImageContainer(di->img_verticalcontainer);
588 DisposeImageContainer(di->img_verticalknob);
589 DisposeImageContainer(di->img_horizontalcontainer);
590 DisposeImageContainer(di->img_horizontalknob);
592 DisposeImageContainer(di->img_menu);
593 DisposeImageContainer(di->img_amigakey);
594 DisposeImageContainer(di->img_menucheck);
595 DisposeImageContainer(di->img_submenu);
597 FreeVec(di);