Mercurial > audlegacy
annotate src/audacious/widgets/skin.c @ 2461:d6315e592e40 trunk
[svn] - remove buggy playlist transparency patch
author | nenolod |
---|---|
date | Thu, 01 Feb 2007 09:22:56 -0800 |
parents | 93686e8815a4 |
children | ddd127429fc6 |
rev | line source |
---|---|
2313 | 1 /* BMP - Cross-platform multimedia player |
2 * Copyright (C) 2003-2004 BMP development team. | |
3 * | |
4 * Based on XMMS: | |
5 * Copyright (C) 1998-2003 XMMS development team. | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
9 * the Free Software Foundation; either version 2 of the License, or | |
10 * (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 * GNU General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License | |
18 * along with this program; if not, write to the Free Software | |
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 */ | |
21 | |
22 #ifdef HAVE_CONFIG_H | |
23 # include "config.h" | |
24 #endif | |
25 | |
26 /* TODO: enforce default sizes! */ | |
27 | |
28 #include <glib.h> | |
29 #include <stdio.h> | |
30 #include <stdlib.h> | |
31 #include <string.h> | |
32 #include <ctype.h> | |
33 | |
34 #include "widgetcore.h" | |
35 | |
36 #include "ui_equalizer.h" | |
37 #include "main.h" | |
38 #include "ui_playlist.h" | |
39 #include "ui_skinselector.h" | |
40 #include "util.h" | |
41 | |
42 #include "debug.h" | |
43 | |
44 #include "platform/smartinclude.h" | |
45 #include "vfs.h" | |
46 | |
47 #define EXTENSION_TARGETS 7 | |
48 | |
49 static gchar *ext_targets[EXTENSION_TARGETS] = { "bmp", "xpm", "png", "svg", | |
50 "gif", "jpg", "jpeg" }; | |
51 | |
52 struct _SkinPixmapIdMapping { | |
53 SkinPixmapId id; | |
54 const gchar *name; | |
55 const gchar *alt_name; | |
56 gint width, height; | |
57 }; | |
58 | |
59 struct _SkinMaskInfo { | |
60 gint width, height; | |
61 gchar *inistr; | |
62 }; | |
63 | |
64 typedef struct _SkinPixmapIdMapping SkinPixmapIdMapping; | |
65 typedef struct _SkinMaskInfo SkinMaskInfo; | |
66 | |
67 | |
68 Skin *bmp_active_skin = NULL; | |
69 | |
70 static gint skin_current_num; | |
71 | |
72 static SkinMaskInfo skin_mask_info[] = { | |
73 {275, 116, "Normal"}, | |
74 {275, 16, "WindowShade"}, | |
75 {275, 116, "Equalizer"}, | |
76 {275, 16, "EqualizerWS"} | |
77 }; | |
78 | |
79 static SkinPixmapIdMapping skin_pixmap_id_map[] = { | |
80 {SKIN_MAIN, "main", NULL, 0, 0}, | |
81 {SKIN_CBUTTONS, "cbuttons", NULL, 0, 0}, | |
82 {SKIN_SHUFREP, "shufrep", NULL, 0, 0}, | |
83 {SKIN_TEXT, "text", NULL, 0, 0}, | |
84 {SKIN_TITLEBAR, "titlebar", NULL, 0, 0}, | |
85 {SKIN_VOLUME, "volume", NULL, 0, 0}, | |
86 {SKIN_BALANCE, "balance", "volume", 0, 0}, | |
87 {SKIN_MONOSTEREO, "monoster", NULL, 0, 0}, | |
88 {SKIN_PLAYPAUSE, "playpaus", NULL, 0, 0}, | |
89 {SKIN_NUMBERS, "nums_ex", "numbers", 0, 0}, | |
90 {SKIN_POSBAR, "posbar", NULL, 0, 0}, | |
91 {SKIN_EQMAIN, "eqmain", NULL, 0, 0}, | |
92 {SKIN_PLEDIT, "pledit", NULL, 0, 0}, | |
93 {SKIN_EQ_EX, "eq_ex", NULL, 0, 0} | |
94 }; | |
95 | |
96 static guint skin_pixmap_id_map_size = G_N_ELEMENTS(skin_pixmap_id_map); | |
97 | |
98 static const guchar skin_default_viscolor[24][3] = { | |
99 {9, 34, 53}, | |
100 {10, 18, 26}, | |
101 {0, 54, 108}, | |
102 {0, 58, 116}, | |
103 {0, 62, 124}, | |
104 {0, 66, 132}, | |
105 {0, 70, 140}, | |
106 {0, 74, 148}, | |
107 {0, 78, 156}, | |
108 {0, 82, 164}, | |
109 {0, 86, 172}, | |
110 {0, 92, 184}, | |
111 {0, 98, 196}, | |
112 {0, 104, 208}, | |
113 {0, 110, 220}, | |
114 {0, 116, 232}, | |
115 {0, 122, 244}, | |
116 {0, 128, 255}, | |
117 {0, 128, 255}, | |
118 {0, 104, 208}, | |
119 {0, 80, 160}, | |
120 {0, 56, 112}, | |
121 {0, 32, 64}, | |
122 {200, 200, 200} | |
123 }; | |
124 | |
125 static GdkBitmap *skin_create_transparent_mask(const gchar *, | |
126 const gchar *, | |
127 const gchar *, | |
128 GdkWindow *, | |
129 gint, gint, gboolean); | |
130 | |
131 static void skin_setup_masks(Skin * skin); | |
132 | |
133 static void skin_set_default_vis_color(Skin * skin); | |
134 | |
135 void | |
136 skin_lock(Skin * skin) | |
137 { | |
138 g_mutex_lock(skin->lock); | |
139 } | |
140 | |
141 void | |
142 skin_unlock(Skin * skin) | |
143 { | |
144 g_mutex_unlock(skin->lock); | |
145 } | |
146 | |
147 gboolean | |
148 bmp_active_skin_reload(void) | |
149 { | |
150 return bmp_active_skin_load(bmp_active_skin->path); | |
151 } | |
152 | |
153 gboolean | |
154 bmp_active_skin_load(const gchar * path) | |
155 { | |
156 g_return_val_if_fail(bmp_active_skin != NULL, FALSE); | |
157 | |
158 memset(&bmp_active_skin->properties, 0, sizeof(SkinProperties)); | |
159 | |
160 if (!skin_load(bmp_active_skin, path)) | |
161 return FALSE; | |
162 | |
163 skin_setup_masks(bmp_active_skin); | |
164 | |
165 draw_main_window(TRUE); | |
166 draw_playlist_window(TRUE); | |
167 draw_equalizer_window(TRUE); | |
168 | |
169 vis_set_window(mainwin_vis, mainwin->window); | |
170 playlistwin_update_list(playlist_get_active()); | |
171 | |
172 return TRUE; | |
173 } | |
174 | |
175 void | |
176 skin_pixmap_free(SkinPixmap * p) | |
177 { | |
178 g_return_if_fail(p != NULL); | |
179 g_return_if_fail(p->pixmap != NULL); | |
180 | |
181 g_object_unref(p->pixmap); | |
182 p->pixmap = NULL; | |
183 } | |
184 | |
185 Skin * | |
186 skin_new(void) | |
187 { | |
188 Skin *skin; | |
189 skin = g_new0(Skin, 1); | |
190 skin->lock = g_mutex_new(); | |
191 return skin; | |
192 } | |
193 | |
194 void | |
195 skin_free(Skin * skin) | |
196 { | |
197 gint i; | |
198 | |
199 g_return_if_fail(skin != NULL); | |
200 | |
201 skin_lock(skin); | |
202 | |
203 for (i = 0; i < SKIN_PIXMAP_COUNT; i++) | |
204 skin_pixmap_free(&skin->pixmaps[i]); | |
205 | |
206 for (i = 0; i < SKIN_PIXMAP_COUNT; i++) { | |
207 if (skin->masks[i]) | |
208 g_object_unref(skin->masks[i]); | |
209 if (skin->ds_masks[i]) | |
210 g_object_unref(skin->ds_masks[i]); | |
211 | |
212 skin->masks[i] = NULL; | |
213 skin->ds_masks[i] = NULL; | |
214 } | |
215 | |
216 skin_set_default_vis_color(skin); | |
217 skin_unlock(skin); | |
218 } | |
219 | |
220 void | |
221 skin_destroy(Skin * skin) | |
222 { | |
223 g_return_if_fail(skin != NULL); | |
224 skin_free(skin); | |
225 g_mutex_free(skin->lock); | |
226 g_free(skin); | |
227 } | |
228 | |
229 const SkinPixmapIdMapping * | |
230 skin_pixmap_id_lookup(guint id) | |
231 { | |
232 guint i; | |
233 | |
234 for (i = 0; i < skin_pixmap_id_map_size; i++) { | |
235 if (id == skin_pixmap_id_map[i].id) { | |
236 return &skin_pixmap_id_map[i]; | |
237 } | |
238 } | |
239 | |
240 return NULL; | |
241 } | |
242 | |
243 const gchar * | |
244 skin_pixmap_id_to_name(SkinPixmapId id) | |
245 { | |
246 guint i; | |
247 | |
248 for (i = 0; i < skin_pixmap_id_map_size; i++) { | |
249 if (id == skin_pixmap_id_map[i].id) | |
250 return skin_pixmap_id_map[i].name; | |
251 } | |
252 return NULL; | |
253 } | |
254 | |
255 static void | |
256 skin_set_default_vis_color(Skin * skin) | |
257 { | |
258 memcpy(skin->vis_color, skin_default_viscolor, | |
259 sizeof(skin_default_viscolor)); | |
260 } | |
261 | |
262 /* | |
263 * I have rewritten this to take an array of possible targets, | |
264 * once we find a matching target we now return, instead of loop | |
265 * recursively. This allows for us to support many possible format | |
266 * targets for our skinning engine than just the original winamp | |
267 * formats. | |
268 * | |
269 * -- nenolod, 16 January 2006 | |
270 */ | |
271 gchar * | |
272 skin_pixmap_locate(const gchar * dirname, gchar ** basenames) | |
273 { | |
274 gchar *filename; | |
275 gint i; | |
276 | |
277 for (i = 0; basenames[i]; i++) | |
278 if (!(filename = find_file_recursively(dirname, basenames[i]))) | |
279 g_free(filename); | |
280 else | |
281 return filename; | |
282 | |
283 /* can't find any targets -- sorry */ | |
284 return NULL; | |
285 } | |
286 | |
287 /* FIXME: this function is temporary. It will be removed when the skinning system | |
288 uses GdkPixbuf in place of GdkPixmap */ | |
289 | |
290 static GdkPixmap * | |
291 pixmap_new_from_file(const gchar * filename) | |
292 { | |
293 GdkPixbuf *pixbuf, *pixbuf2; | |
294 GdkPixmap *pixmap; | |
295 gint width, height; | |
296 | |
297 if (!(pixbuf = gdk_pixbuf_new_from_file(filename, NULL))) | |
298 return NULL; | |
299 | |
300 width = gdk_pixbuf_get_width(pixbuf); | |
301 height = gdk_pixbuf_get_height(pixbuf); | |
302 | |
303 /* create the windows if they haven't been created yet, needed for bootstrapping */ | |
304 if (mainwin == NULL) | |
305 { | |
306 mainwin_create(); | |
307 equalizerwin_create(); | |
308 playlistwin_create(); | |
309 } | |
310 | |
311 if (!(pixmap = gdk_pixmap_new(mainwin->window, width, height, | |
312 gdk_rgb_get_visual()->depth))) { | |
313 g_object_unref(pixbuf); | |
314 return NULL; | |
315 } | |
316 | |
317 pixbuf2 = audacious_create_colorized_pixbuf(pixbuf, cfg.colorize_r, cfg.colorize_g, cfg.colorize_b); | |
318 g_object_unref(pixbuf); | |
319 | |
320 gdk_draw_pixbuf(pixmap, mainwin_gc, pixbuf2, 0, 0, 0, 0, width, height, | |
321 GDK_RGB_DITHER_MAX, 0, 0); | |
322 g_object_unref(pixbuf2); | |
323 | |
324 return pixmap; | |
325 } | |
326 | |
327 static gboolean | |
328 skin_load_pixmap_id(Skin * skin, SkinPixmapId id, const gchar * path_p) | |
329 { | |
330 const gchar *path; | |
331 gchar *filename; | |
332 gint width, height; | |
333 const SkinPixmapIdMapping *pixmap_id_mapping; | |
334 GdkPixmap *gpm; | |
335 SkinPixmap *pm = NULL; | |
336 gchar *basenames[EXTENSION_TARGETS * 2 + 1]; /* alternate basenames */ | |
337 gint i, y; | |
338 | |
339 g_return_val_if_fail(skin != NULL, FALSE); | |
340 g_return_val_if_fail(id < SKIN_PIXMAP_COUNT, FALSE); | |
341 | |
342 pixmap_id_mapping = skin_pixmap_id_lookup(id); | |
343 g_return_val_if_fail(pixmap_id_mapping != NULL, FALSE); | |
344 | |
345 memset(&basenames, 0, sizeof(basenames)); | |
346 | |
347 for (i = 0, y = 0; i < EXTENSION_TARGETS; i++, y++) | |
348 { | |
349 basenames[y] = g_strdup_printf("%s.%s", pixmap_id_mapping->name, | |
350 ext_targets[i]); | |
351 | |
352 if (pixmap_id_mapping->alt_name) | |
353 basenames[++y] = g_strdup_printf("%s.%s", | |
354 pixmap_id_mapping->alt_name, ext_targets[i]); | |
355 } | |
356 | |
357 path = path_p ? path_p : skin->path; | |
358 filename = skin_pixmap_locate(path, basenames); | |
359 | |
360 for (i = 0; basenames[i] != NULL; i++) | |
361 { | |
362 g_free(basenames[i]); | |
363 basenames[i] = NULL; | |
364 } | |
365 | |
366 if (!(gpm = pixmap_new_from_file(filename))) { | |
367 g_warning("loading of %s failed", filename); | |
368 g_free(filename); | |
369 return FALSE; | |
370 } | |
371 | |
372 g_free(filename); | |
373 | |
374 gdk_drawable_get_size(GDK_DRAWABLE(gpm), &width, &height); | |
375 pm = &skin->pixmaps[id]; | |
376 pm->pixmap = gpm; | |
377 pm->width = width; | |
378 pm->height = height; | |
379 pm->current_width = width; | |
380 pm->current_height = height; | |
381 | |
382 return TRUE; | |
383 } | |
384 | |
385 void | |
386 skin_mask_create(Skin * skin, | |
387 const gchar * path, | |
388 gint id, | |
389 GdkWindow * window) | |
390 { | |
391 skin->masks[id] = | |
392 skin_create_transparent_mask(path, "region.txt", | |
393 skin_mask_info[id].inistr, window, | |
394 skin_mask_info[id].width, | |
395 skin_mask_info[id].height, FALSE); | |
396 | |
397 skin->ds_masks[id] = | |
398 skin_create_transparent_mask(path, "region.txt", | |
399 skin_mask_info[id].inistr, window, | |
400 skin_mask_info[id].width * 2, | |
401 skin_mask_info[id].height * 2, TRUE); | |
402 } | |
403 | |
404 static void | |
405 skin_setup_masks(Skin * skin) | |
406 { | |
407 GdkBitmap *mask; | |
408 | |
409 if (cfg.show_wm_decorations) | |
410 return; | |
411 | |
412 if (cfg.player_visible) { | |
413 mask = skin_get_mask(skin, SKIN_MASK_MAIN + cfg.player_shaded); | |
414 gtk_widget_shape_combine_mask(mainwin, mask, 0, 0); | |
415 } | |
416 | |
417 mask = skin_get_mask(skin, SKIN_MASK_EQ + cfg.equalizer_shaded); | |
418 gtk_widget_shape_combine_mask(equalizerwin, mask, 0, 0); | |
419 } | |
420 | |
421 static GdkBitmap * | |
422 create_default_mask(GdkWindow * parent, gint w, gint h) | |
423 { | |
424 GdkBitmap *ret; | |
425 GdkGC *gc; | |
426 GdkColor pattern; | |
427 | |
428 ret = gdk_pixmap_new(parent, w, h, 1); | |
429 gc = gdk_gc_new(ret); | |
430 pattern.pixel = 1; | |
431 gdk_gc_set_foreground(gc, &pattern); | |
432 gdk_draw_rectangle(ret, gc, TRUE, 0, 0, w, h); | |
433 g_object_unref(gc); | |
434 | |
435 return ret; | |
436 } | |
437 | |
438 static void | |
439 skin_query_color(GdkColormap * cm, GdkColor * c) | |
440 { | |
441 #ifdef GDK_WINDOWING_X11 | |
442 XColor xc = { 0,0,0,0,0,0 }; | |
443 | |
444 xc.pixel = c->pixel; | |
445 XQueryColor(GDK_COLORMAP_XDISPLAY(cm), GDK_COLORMAP_XCOLORMAP(cm), &xc); | |
446 c->red = xc.red; | |
447 c->green = xc.green; | |
448 c->blue = xc.blue; | |
449 #else | |
450 /* do nothing. see what breaks? */ | |
451 #endif | |
452 } | |
453 | |
454 static glong | |
455 skin_calc_luminance(GdkColor * c) | |
456 { | |
457 return (0.212671 * c->red + 0.715160 * c->green + 0.072169 * c->blue); | |
458 } | |
459 | |
460 static void | |
461 skin_get_textcolors(GdkPixmap * text, GdkColor * bgc, GdkColor * fgc) | |
462 { | |
463 /* | |
464 * Try to extract reasonable background and foreground colors | |
465 * from the font pixmap | |
466 */ | |
467 | |
468 GdkImage *gi; | |
469 GdkColormap *cm; | |
470 gint i; | |
471 | |
472 g_return_if_fail(text != NULL); | |
473 g_return_if_fail(GDK_IS_WINDOW(playlistwin->window)); | |
474 | |
475 /* Get the first line of text */ | |
476 gi = gdk_drawable_get_image(text, 0, 0, 152, 6); | |
477 cm = gdk_drawable_get_colormap(playlistwin->window); | |
478 | |
479 for (i = 0; i < 6; i++) { | |
480 GdkColor c; | |
481 gint x; | |
482 glong d, max_d; | |
483 | |
484 /* Get a pixel from the middle of the space character */ | |
485 bgc[i].pixel = gdk_image_get_pixel(gi, 151, i); | |
486 skin_query_color(cm, &bgc[i]); | |
487 | |
488 max_d = 0; | |
489 for (x = 1; x < 150; x++) { | |
490 c.pixel = gdk_image_get_pixel(gi, x, i); | |
491 skin_query_color(cm, &c); | |
492 | |
493 d = labs(skin_calc_luminance(&c) - skin_calc_luminance(&bgc[i])); | |
494 if (d > max_d) { | |
495 memcpy(&fgc[i], &c, sizeof(GdkColor)); | |
496 max_d = d; | |
497 } | |
498 } | |
499 } | |
500 g_object_unref(gi); | |
501 } | |
502 | |
503 gboolean | |
504 init_skins(const gchar * path) | |
505 { | |
506 bmp_active_skin = skin_new(); | |
507 | |
508 if (!bmp_active_skin_load(path)) { | |
509 /* FIXME: Oddly, g_message() causes a crash if path is NULL on | |
510 * Solaris (see bug #165) */ | |
511 if (path) | |
512 g_message("Unable to load skin (%s), trying default...", path); | |
513 | |
514 /* can't load configured skin, retry with default */ | |
515 if (!bmp_active_skin_load(BMP_DEFAULT_SKIN_PATH)) { | |
516 g_message("Unable to load default skin (%s)! Giving up.", | |
517 BMP_DEFAULT_SKIN_PATH); | |
518 return FALSE; | |
519 } | |
520 } | |
521 | |
522 if (cfg.random_skin_on_play) | |
523 skinlist_update(); | |
524 | |
525 return TRUE; | |
526 } | |
527 | |
528 /* | |
529 * Opens and parses a skin's hints file. | |
530 * Hints files are somewhat like "scripts" in Winamp3/5. | |
531 * We'll probably add scripts to it next. | |
532 */ | |
533 void | |
534 skin_parse_hints(Skin * skin, gchar *path_p) | |
535 { | |
536 gchar *filename, *tmp; | |
537 | |
538 path_p = path_p ? path_p : skin->path; | |
539 | |
540 filename = find_file_recursively(path_p, "skin.hints"); | |
541 | |
542 skin->properties.mainwin_othertext = FALSE; | |
543 tmp = read_ini_string(filename, "skin", "mainwinOthertext"); | |
544 | |
545 if (tmp != NULL) | |
546 { | |
547 skin->properties.mainwin_othertext = atoi(tmp); | |
548 g_free(tmp); | |
549 } | |
550 | |
551 skin->properties.mainwin_vis_x = 24; | |
552 tmp = read_ini_string(filename, "skin", "mainwinVisX"); | |
553 | |
554 if (tmp != NULL) | |
555 { | |
556 skin->properties.mainwin_vis_x = atoi(tmp); | |
557 g_free(tmp); | |
558 } | |
559 | |
560 skin->properties.mainwin_vis_y = 43; | |
561 tmp = read_ini_string(filename, "skin", "mainwinVisY"); | |
562 | |
563 if (tmp != NULL) | |
564 { | |
565 skin->properties.mainwin_vis_y = atoi(tmp); | |
566 g_free(tmp); | |
567 } | |
568 | |
569 skin->properties.mainwin_vis_width = 76; | |
570 tmp = read_ini_string(filename, "skin", "mainwinVisWidth"); | |
571 | |
572 if (tmp != NULL) | |
573 { | |
574 skin->properties.mainwin_vis_width = atoi(tmp); | |
575 g_free(tmp); | |
576 } | |
577 | |
578 skin->properties.mainwin_text_x = 112; | |
579 tmp = read_ini_string(filename, "skin", "mainwinTextX"); | |
580 | |
581 if (tmp != NULL) | |
582 { | |
583 skin->properties.mainwin_text_x = atoi(tmp); | |
584 g_free(tmp); | |
585 } | |
586 | |
587 skin->properties.mainwin_text_y = 27; | |
588 tmp = read_ini_string(filename, "skin", "mainwinTextY"); | |
589 | |
590 if (tmp != NULL) | |
591 { | |
592 skin->properties.mainwin_text_y = atoi(tmp); | |
593 g_free(tmp); | |
594 } | |
595 | |
596 skin->properties.mainwin_text_width = 153; | |
597 tmp = read_ini_string(filename, "skin", "mainwinTextWidth"); | |
598 | |
599 if (tmp != NULL) | |
600 { | |
601 skin->properties.mainwin_text_width = atoi(tmp); | |
602 g_free(tmp); | |
603 } | |
604 | |
605 skin->properties.mainwin_infobar_x = 112; | |
606 tmp = read_ini_string(filename, "skin", "mainwinInfoBarX"); | |
607 | |
608 if (tmp != NULL) | |
609 { | |
610 skin->properties.mainwin_infobar_x = atoi(tmp); | |
611 g_free(tmp); | |
612 } | |
613 | |
614 skin->properties.mainwin_infobar_y = 43; | |
615 tmp = read_ini_string(filename, "skin", "mainwinInfoBarY"); | |
616 | |
617 if (tmp != NULL) | |
618 { | |
619 skin->properties.mainwin_infobar_y = atoi(tmp); | |
620 g_free(tmp); | |
621 } | |
622 | |
623 skin->properties.mainwin_number_0_x = 36; | |
624 tmp = read_ini_string(filename, "skin", "mainwinNumber0X"); | |
625 | |
626 if (tmp != NULL) | |
627 { | |
628 skin->properties.mainwin_number_0_x = atoi(tmp); | |
629 g_free(tmp); | |
630 } | |
631 | |
632 skin->properties.mainwin_number_0_y = 26; | |
633 tmp = read_ini_string(filename, "skin", "mainwinNumber0Y"); | |
634 | |
635 if (tmp != NULL) | |
636 { | |
637 skin->properties.mainwin_number_0_y = atoi(tmp); | |
638 g_free(tmp); | |
639 } | |
640 | |
641 skin->properties.mainwin_number_1_x = 48; | |
642 tmp = read_ini_string(filename, "skin", "mainwinNumber1X"); | |
643 | |
644 if (tmp != NULL) | |
645 { | |
646 skin->properties.mainwin_number_1_x = atoi(tmp); | |
647 g_free(tmp); | |
648 } | |
649 | |
650 skin->properties.mainwin_number_1_y = 26; | |
651 tmp = read_ini_string(filename, "skin", "mainwinNumber1Y"); | |
652 | |
653 if (tmp != NULL) | |
654 { | |
655 skin->properties.mainwin_number_1_y = atoi(tmp); | |
656 g_free(tmp); | |
657 } | |
658 | |
659 skin->properties.mainwin_number_2_x = 60; | |
660 tmp = read_ini_string(filename, "skin", "mainwinNumber2X"); | |
661 | |
662 if (tmp != NULL) | |
663 { | |
664 skin->properties.mainwin_number_2_x = atoi(tmp); | |
665 g_free(tmp); | |
666 } | |
667 | |
668 skin->properties.mainwin_number_2_y = 26; | |
669 tmp = read_ini_string(filename, "skin", "mainwinNumber2Y"); | |
670 | |
671 if (tmp != NULL) | |
672 { | |
673 skin->properties.mainwin_number_2_y = atoi(tmp); | |
674 g_free(tmp); | |
675 } | |
676 | |
677 skin->properties.mainwin_number_3_x = 78; | |
678 tmp = read_ini_string(filename, "skin", "mainwinNumber3X"); | |
679 | |
680 if (tmp != NULL) | |
681 { | |
682 skin->properties.mainwin_number_3_x = atoi(tmp); | |
683 g_free(tmp); | |
684 } | |
685 | |
686 skin->properties.mainwin_number_3_y = 26; | |
687 tmp = read_ini_string(filename, "skin", "mainwinNumber3Y"); | |
688 | |
689 if (tmp != NULL) | |
690 { | |
691 skin->properties.mainwin_number_3_y = atoi(tmp); | |
692 g_free(tmp); | |
693 } | |
694 | |
695 skin->properties.mainwin_number_4_x = 90; | |
696 tmp = read_ini_string(filename, "skin", "mainwinNumber4X"); | |
697 | |
698 if (tmp != NULL) | |
699 { | |
700 skin->properties.mainwin_number_4_x = atoi(tmp); | |
701 g_free(tmp); | |
702 } | |
703 | |
704 skin->properties.mainwin_number_4_y = 26; | |
705 tmp = read_ini_string(filename, "skin", "mainwinNumber4Y"); | |
706 | |
707 if (tmp != NULL) | |
708 { | |
709 skin->properties.mainwin_number_4_y = atoi(tmp); | |
710 g_free(tmp); | |
711 } | |
712 | |
713 skin->properties.mainwin_playstatus_x = 24; | |
714 tmp = read_ini_string(filename, "skin", "mainwinPlayStatusX"); | |
715 | |
716 if (tmp != NULL) | |
717 { | |
718 skin->properties.mainwin_playstatus_x = atoi(tmp); | |
719 g_free(tmp); | |
720 } | |
721 | |
722 skin->properties.mainwin_playstatus_y = 28; | |
723 tmp = read_ini_string(filename, "skin", "mainwinPlayStatusY"); | |
724 | |
725 if (tmp != NULL) | |
726 { | |
727 skin->properties.mainwin_playstatus_y = atoi(tmp); | |
728 g_free(tmp); | |
729 } | |
730 | |
731 skin->properties.mainwin_menurow_visible = TRUE; | |
732 tmp = read_ini_string(filename, "skin", "mainwinMenurowVisible"); | |
733 | |
734 if (tmp != NULL) | |
735 { | |
736 skin->properties.mainwin_menurow_visible = atoi(tmp); | |
737 g_free(tmp); | |
738 } | |
739 | |
740 skin->properties.mainwin_volume_x = 107; | |
741 tmp = read_ini_string(filename, "skin", "mainwinVolumeX"); | |
742 | |
743 if (tmp != NULL) | |
744 { | |
745 skin->properties.mainwin_volume_x = atoi(tmp); | |
746 g_free(tmp); | |
747 } | |
748 | |
749 skin->properties.mainwin_volume_y = 57; | |
750 tmp = read_ini_string(filename, "skin", "mainwinVolumeY"); | |
751 | |
752 if (tmp != NULL) | |
753 { | |
754 skin->properties.mainwin_volume_y = atoi(tmp); | |
755 g_free(tmp); | |
756 } | |
757 | |
758 skin->properties.mainwin_balance_x = 177; | |
759 tmp = read_ini_string(filename, "skin", "mainwinBalanceX"); | |
760 | |
761 if (tmp != NULL) | |
762 { | |
763 skin->properties.mainwin_balance_x = atoi(tmp); | |
764 g_free(tmp); | |
765 } | |
766 | |
767 skin->properties.mainwin_balance_y = 57; | |
768 tmp = read_ini_string(filename, "skin", "mainwinBalanceY"); | |
769 | |
770 if (tmp != NULL) | |
771 { | |
772 skin->properties.mainwin_balance_y = atoi(tmp); | |
773 g_free(tmp); | |
774 } | |
775 | |
776 skin->properties.mainwin_position_x = 16; | |
777 tmp = read_ini_string(filename, "skin", "mainwinPositionX"); | |
778 | |
779 if (tmp != NULL) | |
780 { | |
781 skin->properties.mainwin_position_x = atoi(tmp); | |
782 g_free(tmp); | |
783 } | |
784 | |
785 skin->properties.mainwin_position_y = 72; | |
786 tmp = read_ini_string(filename, "skin", "mainwinPositionY"); | |
787 | |
788 if (tmp != NULL) | |
789 { | |
790 skin->properties.mainwin_position_y = atoi(tmp); | |
791 g_free(tmp); | |
792 } | |
793 | |
794 skin->properties.mainwin_othertext_is_status = FALSE; | |
795 tmp = read_ini_string(filename, "skin", "mainwinOthertextIsStatus"); | |
796 | |
797 if (tmp != NULL) | |
798 { | |
799 skin->properties.mainwin_othertext_is_status = atoi(tmp); | |
800 g_free(tmp); | |
801 } | |
802 | |
803 skin->properties.mainwin_othertext_visible = skin->properties.mainwin_othertext; | |
804 tmp = read_ini_string(filename, "skin", "mainwinOthertextVisible"); | |
805 | |
806 if (tmp != NULL) | |
807 { | |
808 skin->properties.mainwin_othertext_visible = atoi(tmp); | |
809 g_free(tmp); | |
810 } | |
811 | |
812 skin->properties.mainwin_text_visible = TRUE; | |
813 tmp = read_ini_string(filename, "skin", "mainwinTextVisible"); | |
814 | |
815 if (tmp != NULL) | |
816 { | |
817 skin->properties.mainwin_text_visible = atoi(tmp); | |
818 g_free(tmp); | |
819 } | |
820 | |
821 skin->properties.mainwin_vis_visible = TRUE; | |
822 tmp = read_ini_string(filename, "skin", "mainwinVisVisible"); | |
823 | |
824 if (tmp != NULL) | |
825 { | |
826 skin->properties.mainwin_vis_visible = atoi(tmp); | |
827 g_free(tmp); | |
828 } | |
829 | |
830 skin->properties.mainwin_previous_x = 16; | |
831 tmp = read_ini_string(filename, "skin", "mainwinPreviousX"); | |
832 | |
833 if (tmp != NULL) | |
834 { | |
835 skin->properties.mainwin_previous_x = atoi(tmp); | |
836 g_free(tmp); | |
837 } | |
838 | |
839 skin->properties.mainwin_previous_y = 88; | |
840 tmp = read_ini_string(filename, "skin", "mainwinPreviousY"); | |
841 | |
842 if (tmp != NULL) | |
843 { | |
844 skin->properties.mainwin_previous_y = atoi(tmp); | |
845 g_free(tmp); | |
846 } | |
847 | |
848 skin->properties.mainwin_play_x = 39; | |
849 tmp = read_ini_string(filename, "skin", "mainwinPlayX"); | |
850 | |
851 if (tmp != NULL) | |
852 { | |
853 skin->properties.mainwin_play_x = atoi(tmp); | |
854 g_free(tmp); | |
855 } | |
856 | |
857 skin->properties.mainwin_play_y = 88; | |
858 tmp = read_ini_string(filename, "skin", "mainwinPlayY"); | |
859 | |
860 if (tmp != NULL) | |
861 { | |
862 skin->properties.mainwin_play_y = atoi(tmp); | |
863 g_free(tmp); | |
864 } | |
865 | |
866 skin->properties.mainwin_pause_x = 62; | |
867 tmp = read_ini_string(filename, "skin", "mainwinPauseX"); | |
868 | |
869 if (tmp != NULL) | |
870 { | |
871 skin->properties.mainwin_pause_x = atoi(tmp); | |
872 g_free(tmp); | |
873 } | |
874 | |
875 skin->properties.mainwin_pause_y = 88; | |
876 tmp = read_ini_string(filename, "skin", "mainwinPauseY"); | |
877 | |
878 if (tmp != NULL) | |
879 { | |
880 skin->properties.mainwin_pause_y = atoi(tmp); | |
881 g_free(tmp); | |
882 } | |
883 | |
884 skin->properties.mainwin_stop_x = 85; | |
885 tmp = read_ini_string(filename, "skin", "mainwinStopX"); | |
886 | |
887 if (tmp != NULL) | |
888 { | |
889 skin->properties.mainwin_stop_x = atoi(tmp); | |
890 g_free(tmp); | |
891 } | |
892 | |
893 skin->properties.mainwin_stop_y = 88; | |
894 tmp = read_ini_string(filename, "skin", "mainwinStopY"); | |
895 | |
896 if (tmp != NULL) | |
897 { | |
898 skin->properties.mainwin_stop_y = atoi(tmp); | |
899 g_free(tmp); | |
900 } | |
901 | |
902 skin->properties.mainwin_next_x = 108; | |
903 tmp = read_ini_string(filename, "skin", "mainwinNextX"); | |
904 | |
905 if (tmp != NULL) | |
906 { | |
907 skin->properties.mainwin_next_x = atoi(tmp); | |
908 g_free(tmp); | |
909 } | |
910 | |
911 skin->properties.mainwin_next_y = 88; | |
912 tmp = read_ini_string(filename, "skin", "mainwinNextY"); | |
913 | |
914 if (tmp != NULL) | |
915 { | |
916 skin->properties.mainwin_next_y = atoi(tmp); | |
917 g_free(tmp); | |
918 } | |
919 | |
920 skin->properties.mainwin_eject_x = 136; | |
921 tmp = read_ini_string(filename, "skin", "mainwinEjectX"); | |
922 | |
923 if (tmp != NULL) | |
924 { | |
925 skin->properties.mainwin_eject_x = atoi(tmp); | |
926 g_free(tmp); | |
927 } | |
928 | |
929 skin->properties.mainwin_eject_y = 89; | |
930 tmp = read_ini_string(filename, "skin", "mainwinEjectY"); | |
931 | |
932 if (tmp != NULL) | |
933 { | |
934 skin->properties.mainwin_eject_y = atoi(tmp); | |
935 g_free(tmp); | |
936 } | |
937 | |
938 skin->properties.mainwin_width = 275; | |
939 tmp = read_ini_string(filename, "skin", "mainwinWidth"); | |
940 | |
941 if (tmp != NULL) | |
942 { | |
943 skin->properties.mainwin_width = atoi(tmp); | |
944 g_free(tmp); | |
945 } | |
946 | |
947 /* XXX: use of skin_mask_info here is bad */ | |
948 skin_mask_info[0].width = skin->properties.mainwin_width; | |
949 | |
950 skin->properties.mainwin_height = 116; | |
951 tmp = read_ini_string(filename, "skin", "mainwinHeight"); | |
952 | |
953 if (tmp != NULL) | |
954 { | |
955 skin->properties.mainwin_height = atoi(tmp); | |
956 g_free(tmp); | |
957 } | |
958 | |
959 /* XXX: use of skin_mask_info here is bad */ | |
960 skin_mask_info[0].height = skin->properties.mainwin_height; | |
961 | |
962 skin->properties.mainwin_about_x = 247; | |
963 tmp = read_ini_string(filename, "skin", "mainwinAboutX"); | |
964 | |
965 if (tmp != NULL) | |
966 { | |
967 skin->properties.mainwin_about_x = atoi(tmp); | |
968 g_free(tmp); | |
969 } | |
970 | |
971 skin->properties.mainwin_about_y = 83; | |
972 tmp = read_ini_string(filename, "skin", "mainwinAboutY"); | |
973 | |
974 if (tmp != NULL) | |
975 { | |
976 skin->properties.mainwin_about_y = atoi(tmp); | |
977 g_free(tmp); | |
978 } | |
979 | |
980 skin->properties.mainwin_shuffle_x = 164; | |
981 tmp = read_ini_string(filename, "skin", "mainwinShuffleX"); | |
982 | |
983 if (tmp != NULL) | |
984 { | |
985 skin->properties.mainwin_shuffle_x = atoi(tmp); | |
986 g_free(tmp); | |
987 } | |
988 | |
989 skin->properties.mainwin_shuffle_y = 89; | |
990 tmp = read_ini_string(filename, "skin", "mainwinShuffleY"); | |
991 | |
992 if (tmp != NULL) | |
993 { | |
994 skin->properties.mainwin_shuffle_y = atoi(tmp); | |
995 g_free(tmp); | |
996 } | |
997 | |
998 skin->properties.mainwin_repeat_x = 210; | |
999 tmp = read_ini_string(filename, "skin", "mainwinRepeatX"); | |
1000 | |
1001 if (tmp != NULL) | |
1002 { | |
1003 skin->properties.mainwin_repeat_x = atoi(tmp); | |
1004 g_free(tmp); | |
1005 } | |
1006 | |
1007 skin->properties.mainwin_repeat_y = 89; | |
1008 tmp = read_ini_string(filename, "skin", "mainwinRepeatY"); | |
1009 | |
1010 if (tmp != NULL) | |
1011 { | |
1012 skin->properties.mainwin_repeat_y = atoi(tmp); | |
1013 g_free(tmp); | |
1014 } | |
1015 | |
1016 skin->properties.mainwin_eqbutton_x = 219; | |
1017 tmp = read_ini_string(filename, "skin", "mainwinEQButtonX"); | |
1018 | |
1019 if (tmp != NULL) | |
1020 { | |
1021 skin->properties.mainwin_eqbutton_x = atoi(tmp); | |
1022 g_free(tmp); | |
1023 } | |
1024 | |
1025 skin->properties.mainwin_eqbutton_y = 58; | |
1026 tmp = read_ini_string(filename, "skin", "mainwinEQButtonY"); | |
1027 | |
1028 if (tmp != NULL) | |
1029 { | |
1030 skin->properties.mainwin_eqbutton_y = atoi(tmp); | |
1031 g_free(tmp); | |
1032 } | |
1033 | |
1034 skin->properties.mainwin_plbutton_x = 242; | |
1035 tmp = read_ini_string(filename, "skin", "mainwinPLButtonX"); | |
1036 | |
1037 if (tmp != NULL) | |
1038 { | |
1039 skin->properties.mainwin_plbutton_x = atoi(tmp); | |
1040 g_free(tmp); | |
1041 } | |
1042 | |
1043 skin->properties.mainwin_plbutton_y = 58; | |
1044 tmp = read_ini_string(filename, "skin", "mainwinPLButtonY"); | |
1045 | |
1046 if (tmp != NULL) | |
1047 { | |
1048 skin->properties.mainwin_plbutton_y = atoi(tmp); | |
1049 g_free(tmp); | |
1050 } | |
1051 | |
1052 skin->properties.textbox_bitmap_font_width = 5; | |
1053 tmp = read_ini_string(filename, "skin", "textboxBitmapFontWidth"); | |
1054 | |
1055 if (tmp != NULL) | |
1056 { | |
1057 skin->properties.textbox_bitmap_font_width = atoi(tmp); | |
1058 g_free(tmp); | |
1059 } | |
1060 | |
1061 skin->properties.textbox_bitmap_font_height = 6; | |
1062 tmp = read_ini_string(filename, "skin", "textboxBitmapFontHeight"); | |
1063 | |
1064 if (tmp != NULL) | |
1065 { | |
1066 skin->properties.textbox_bitmap_font_height = atoi(tmp); | |
1067 g_free(tmp); | |
1068 } | |
1069 | |
1070 skin->properties.mainwin_minimize_x = 244; | |
1071 tmp = read_ini_string(filename, "skin", "mainwinMinimizeX"); | |
1072 | |
1073 if (tmp != NULL) | |
1074 { | |
1075 skin->properties.mainwin_minimize_x = atoi(tmp); | |
1076 g_free(tmp); | |
1077 } | |
1078 | |
1079 skin->properties.mainwin_minimize_y = 3; | |
1080 tmp = read_ini_string(filename, "skin", "mainwinMinimizeY"); | |
1081 | |
1082 if (tmp != NULL) | |
1083 { | |
1084 skin->properties.mainwin_minimize_y = atoi(tmp); | |
1085 g_free(tmp); | |
1086 } | |
1087 | |
1088 skin->properties.mainwin_shade_x = 254; | |
1089 tmp = read_ini_string(filename, "skin", "mainwinShadeX"); | |
1090 | |
1091 if (tmp != NULL) | |
1092 { | |
1093 skin->properties.mainwin_shade_x = atoi(tmp); | |
1094 g_free(tmp); | |
1095 } | |
1096 | |
1097 skin->properties.mainwin_shade_y = 3; | |
1098 tmp = read_ini_string(filename, "skin", "mainwinShadeY"); | |
1099 | |
1100 if (tmp != NULL) | |
1101 { | |
1102 skin->properties.mainwin_shade_y = atoi(tmp); | |
1103 g_free(tmp); | |
1104 } | |
1105 | |
1106 skin->properties.mainwin_close_x = 264; | |
1107 tmp = read_ini_string(filename, "skin", "mainwinCloseX"); | |
1108 | |
1109 if (tmp != NULL) | |
1110 { | |
1111 skin->properties.mainwin_close_x = atoi(tmp); | |
1112 g_free(tmp); | |
1113 } | |
1114 | |
1115 skin->properties.mainwin_close_y = 3; | |
1116 tmp = read_ini_string(filename, "skin", "mainwinCloseY"); | |
1117 | |
1118 if (tmp != NULL) | |
1119 { | |
1120 skin->properties.mainwin_close_y = atoi(tmp); | |
1121 g_free(tmp); | |
1122 } | |
1123 | |
1124 if (filename != NULL) | |
1125 g_free(filename); | |
1126 } | |
1127 | |
1128 static guint | |
1129 hex_chars_to_int(gchar hi, gchar lo) | |
1130 { | |
1131 /* | |
1132 * Converts a value in the range 0x00-0xFF | |
1133 * to a integer in the range 0-65535 | |
1134 */ | |
1135 gchar str[3]; | |
1136 | |
1137 str[0] = hi; | |
1138 str[1] = lo; | |
1139 str[2] = 0; | |
1140 | |
1141 return (CLAMP(strtol(str, NULL, 16), 0, 0xFF) << 8); | |
1142 } | |
1143 | |
1144 GdkColor * | |
1145 skin_load_color(const gchar * path, const gchar * file, | |
1146 const gchar * section, const gchar * key, | |
1147 gchar * default_hex) | |
1148 { | |
1149 gchar *filename, *value; | |
1150 GdkColor *color = NULL; | |
1151 | |
1152 filename = find_file_recursively(path, file); | |
1153 if (filename || default_hex) { | |
1154 if (filename) { | |
1155 value = read_ini_string(filename, section, key); | |
1156 if (value == NULL) { | |
1157 value = g_strdup(default_hex); | |
1158 } | |
1159 } else { | |
1160 value = g_strdup(default_hex); | |
1161 } | |
1162 if (value) { | |
1163 gchar *ptr = value; | |
1164 gint len; | |
1165 | |
1166 color = g_new0(GdkColor, 1); | |
1167 g_strstrip(value); | |
1168 | |
1169 if (value[0] == '#') | |
1170 ptr++; | |
1171 len = strlen(ptr); | |
1172 /* | |
1173 * The handling of incomplete values is done this way | |
1174 * to maximize winamp compatibility | |
1175 */ | |
1176 if (len >= 6) { | |
1177 color->red = hex_chars_to_int(*ptr, *(ptr + 1)); | |
1178 ptr += 2; | |
1179 } | |
1180 if (len >= 4) { | |
1181 color->green = hex_chars_to_int(*ptr, *(ptr + 1)); | |
1182 ptr += 2; | |
1183 } | |
1184 if (len >= 2) | |
1185 color->blue = hex_chars_to_int(*ptr, *(ptr + 1)); | |
1186 | |
1187 gdk_colormap_alloc_color(gdk_drawable_get_colormap(playlistwin->window), | |
1188 color, TRUE, TRUE); | |
1189 g_free(value); | |
1190 } | |
1191 if (filename) | |
1192 g_free(filename); | |
1193 } | |
1194 return color; | |
1195 } | |
1196 | |
1197 | |
1198 | |
1199 GdkBitmap * | |
1200 skin_create_transparent_mask(const gchar * path, | |
1201 const gchar * file, | |
1202 const gchar * section, | |
1203 GdkWindow * window, | |
1204 gint width, | |
1205 gint height, gboolean doublesize) | |
1206 { | |
1207 GdkBitmap *mask = NULL; | |
1208 GdkGC *gc = NULL; | |
1209 GdkColor pattern; | |
1210 GdkPoint *gpoints; | |
1211 | |
1212 gchar *filename = NULL; | |
1213 gboolean created_mask = FALSE; | |
1214 GArray *num, *point; | |
1215 guint i, j; | |
1216 gint k; | |
1217 | |
1218 if (path) | |
1219 filename = find_file_recursively(path, file); | |
1220 | |
1221 /* filename will be null if path wasn't set */ | |
1222 if (!filename) { | |
1223 return create_default_mask(window, width, height); | |
1224 } | |
1225 | |
1226 if ((num = read_ini_array(filename, section, "NumPoints")) == NULL) { | |
1227 g_free(filename); | |
1228 return NULL; | |
1229 } | |
1230 | |
1231 if ((point = read_ini_array(filename, section, "PointList")) == NULL) { | |
1232 g_array_free(num, TRUE); | |
1233 g_free(filename); | |
1234 return NULL; | |
1235 } | |
1236 | |
1237 mask = gdk_pixmap_new(window, width, height, 1); | |
1238 gc = gdk_gc_new(mask); | |
1239 | |
1240 pattern.pixel = 0; | |
1241 gdk_gc_set_foreground(gc, &pattern); | |
1242 gdk_draw_rectangle(mask, gc, TRUE, 0, 0, width, height); | |
1243 pattern.pixel = 1; | |
1244 gdk_gc_set_foreground(gc, &pattern); | |
1245 | |
1246 j = 0; | |
1247 for (i = 0; i < num->len; i++) { | |
1248 if ((int)(point->len - j) >= (g_array_index(num, gint, i) * 2)) { | |
1249 created_mask = TRUE; | |
1250 gpoints = g_new(GdkPoint, g_array_index(num, gint, i)); | |
1251 for (k = 0; k < g_array_index(num, gint, i); k++) { | |
1252 gpoints[k].x = | |
1253 g_array_index(point, gint, j + k * 2) * (1 + doublesize); | |
1254 gpoints[k].y = | |
1255 g_array_index(point, gint, | |
1256 j + k * 2 + 1) * (1 + doublesize); | |
1257 } | |
1258 j += k * 2; | |
1259 gdk_draw_polygon(mask, gc, TRUE, gpoints, | |
1260 g_array_index(num, gint, i)); | |
1261 g_free(gpoints); | |
1262 } | |
1263 } | |
1264 g_array_free(num, TRUE); | |
1265 g_array_free(point, TRUE); | |
1266 g_free(filename); | |
1267 | |
1268 if (!created_mask) | |
1269 gdk_draw_rectangle(mask, gc, TRUE, 0, 0, width, height); | |
1270 | |
1271 g_object_unref(gc); | |
1272 | |
1273 return mask; | |
1274 } | |
1275 | |
1276 void | |
1277 skin_load_viscolor(Skin * skin, const gchar * path, const gchar * basename) | |
1278 { | |
1279 VFSFile *file; | |
1280 gint i, c; | |
1281 gchar line[256], *filename; | |
1282 GArray *a; | |
1283 | |
1284 g_return_if_fail(skin != NULL); | |
1285 g_return_if_fail(path != NULL); | |
1286 g_return_if_fail(basename != NULL); | |
1287 | |
1288 skin_set_default_vis_color(skin); | |
1289 | |
1290 filename = find_file_recursively(path, basename); | |
1291 if (!filename) | |
1292 return; | |
1293 | |
1294 if (!(file = vfs_fopen(filename, "r"))) { | |
1295 g_free(filename); | |
1296 return; | |
1297 } | |
1298 | |
1299 g_free(filename); | |
1300 | |
1301 for (i = 0; i < 24; i++) { | |
1302 if (vfs_fgets(line, 255, file)) { | |
1303 a = string_to_garray(line); | |
1304 if (a->len > 2) { | |
1305 for (c = 0; c < 3; c++) | |
1306 skin->vis_color[i][c] = g_array_index(a, gint, c); | |
1307 } | |
1308 g_array_free(a, TRUE); | |
1309 } | |
1310 else | |
1311 break; | |
1312 } | |
1313 | |
1314 vfs_fclose(file); | |
1315 } | |
1316 | |
1317 #if 0 | |
1318 static void | |
1319 skin_numbers_generate_dash(Skin * skin) | |
1320 { | |
1321 GdkGC *gc; | |
1322 GdkPixmap *pixmap; | |
1323 SkinPixmap *numbers; | |
1324 | |
1325 g_return_if_fail(skin != NULL); | |
1326 | |
1327 numbers = &skin->pixmaps[SKIN_NUMBERS]; | |
1328 if (!numbers->pixmap || numbers->current_width < 99) | |
1329 return; | |
1330 | |
1331 gc = gdk_gc_new(numbers->pixmap); | |
1332 pixmap = gdk_pixmap_new(mainwin->window, 108, | |
1333 numbers->current_height, | |
1334 -1); | |
1335 | |
1336 skin_draw_pixmap(skin, pixmap, gc, SKIN_NUMBERS, 0, 0, 0, 0, 99, 13); | |
1337 skin_draw_pixmap(skin, pixmap, gc, SKIN_NUMBERS, 90, 0, 99, 0, 9, 13); | |
1338 skin_draw_pixmap(skin, pixmap, gc, SKIN_NUMBERS, 20, 6, 101, 6, 5, 1); | |
1339 | |
1340 g_object_unref(numbers->pixmap); | |
1341 g_object_unref(gc); | |
1342 | |
1343 numbers->pixmap = pixmap; | |
1344 numbers->current_width = 108; | |
1345 } | |
1346 #endif | |
1347 | |
1348 static void | |
1349 skin_load_cursor(Skin * skin, const gchar * dirname) | |
1350 { | |
1351 const gchar * basename = "normal.cur"; | |
1352 gchar * filename = NULL; | |
1353 GdkPixbuf * cursor_pixbuf = NULL; | |
1354 GdkPixbufAnimation * cursor_animated = NULL; | |
1355 GdkCursor * cursor_gdk = NULL; | |
1356 GError * error = NULL; | |
1357 | |
1358 filename = find_file_recursively(dirname, basename); | |
1359 | |
1360 if (filename && cfg.custom_cursors) { | |
1361 cursor_animated = gdk_pixbuf_animation_new_from_file(filename, &error); | |
1362 cursor_pixbuf = gdk_pixbuf_animation_get_static_image(cursor_animated); | |
1363 cursor_gdk = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), | |
1364 cursor_pixbuf, 0, 0); | |
1365 } else { | |
1366 cursor_gdk = gdk_cursor_new(GDK_LEFT_PTR); | |
1367 } | |
1368 | |
1369 gdk_window_set_cursor(mainwin->window, cursor_gdk); | |
1370 gdk_window_set_cursor(playlistwin->window, cursor_gdk); | |
1371 gdk_window_set_cursor(equalizerwin->window, cursor_gdk); | |
1372 gdk_cursor_unref(cursor_gdk); | |
1373 } | |
1374 | |
1375 static void | |
1376 skin_load_pixmaps(Skin * skin, const gchar * path) | |
1377 { | |
1378 GdkPixmap *text_pm; | |
1379 guint i; | |
1380 | |
1381 for (i = 0; i < SKIN_PIXMAP_COUNT; i++) | |
1382 skin_load_pixmap_id(skin, i, path); | |
1383 | |
1384 text_pm = skin->pixmaps[SKIN_TEXT].pixmap; | |
1385 | |
1386 if (text_pm) | |
1387 skin_get_textcolors(text_pm, skin->textbg, skin->textfg); | |
1388 | |
1389 #if 0 | |
1390 if (skin->pixmaps[SKIN_NUMBERS].pixmap) | |
1391 skin_numbers_generate_dash(skin); | |
1392 #endif | |
1393 | |
1394 skin->colors[SKIN_PLEDIT_NORMAL] = | |
1395 skin_load_color(path, "pledit.txt", "text", "normal", "#2499ff"); | |
1396 skin->colors[SKIN_PLEDIT_CURRENT] = | |
1397 skin_load_color(path, "pledit.txt", "text", "current", "#ffeeff"); | |
1398 skin->colors[SKIN_PLEDIT_NORMALBG] = | |
1399 skin_load_color(path, "pledit.txt", "text", "normalbg", "#0a120a"); | |
1400 skin->colors[SKIN_PLEDIT_SELECTEDBG] = | |
1401 skin_load_color(path, "pledit.txt", "text", "selectedbg", "#0a124a"); | |
1402 | |
1403 skin_mask_create(skin, path, SKIN_MASK_MAIN, mainwin->window); | |
1404 skin_mask_create(skin, path, SKIN_MASK_MAIN_SHADE, mainwin->window); | |
1405 | |
1406 skin_mask_create(skin, path, SKIN_MASK_EQ, equalizerwin->window); | |
1407 skin_mask_create(skin, path, SKIN_MASK_EQ_SHADE, equalizerwin->window); | |
1408 | |
1409 skin_load_viscolor(skin, path, "viscolor.txt"); | |
1410 } | |
1411 | |
1412 static gboolean | |
1413 skin_load_nolock(Skin * skin, const gchar * path, gboolean force) | |
1414 { | |
1415 gchar *cpath; | |
1416 | |
1417 g_return_val_if_fail(skin != NULL, FALSE); | |
1418 g_return_val_if_fail(path != NULL, FALSE); | |
1419 REQUIRE_LOCK(skin->lock); | |
1420 | |
1421 if (!g_file_test(path, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_DIR)) | |
1422 return FALSE; | |
1423 | |
1424 if (!force) { | |
1425 if (skin->path) | |
1426 if (!strcmp(skin->path, path)) | |
1427 return FALSE; | |
1428 } | |
1429 | |
1430 skin_current_num++; | |
1431 | |
1432 skin->path = g_strdup(path); | |
1433 | |
1434 if (!file_is_archive(path)) { | |
1435 /* Parse the hints for this skin. */ | |
1436 skin_parse_hints(skin, NULL); | |
1437 | |
1438 skin_load_pixmaps(skin, path); | |
1439 skin_load_cursor(skin, path); | |
1440 | |
1441 return TRUE; | |
1442 } | |
1443 | |
1444 if (!(cpath = archive_decompress(path))) { | |
1445 g_message("Unable to extract skin archive (%s)", path); | |
1446 return FALSE; | |
1447 } | |
1448 | |
1449 /* Parse the hints for this skin. */ | |
1450 skin_parse_hints(skin, cpath); | |
1451 | |
1452 skin_load_pixmaps(skin, cpath); | |
1453 skin_load_cursor(skin, cpath); | |
1454 | |
1455 del_directory(cpath); | |
1456 g_free(cpath); | |
1457 | |
1458 return TRUE; | |
1459 } | |
1460 | |
1461 void | |
1462 skin_install_skin(const gchar * path) | |
1463 { | |
1464 gchar *command; | |
1465 | |
1466 g_return_if_fail(path != NULL); | |
1467 | |
1468 command = g_strdup_printf("cp %s %s", path, bmp_paths[BMP_PATH_USER_SKIN_DIR]); | |
1469 if (system(command)) { | |
1470 g_message("Unable to install skin (%s) into user directory (%s)", | |
1471 path, bmp_paths[BMP_PATH_USER_SKIN_DIR]); | |
1472 } | |
1473 g_free(command); | |
1474 } | |
1475 | |
1476 | |
1477 gboolean | |
1478 skin_load(Skin * skin, const gchar * path) | |
1479 { | |
1480 gboolean error; | |
1481 | |
1482 g_return_val_if_fail(skin != NULL, FALSE); | |
1483 | |
1484 if (!path) | |
1485 return FALSE; | |
1486 | |
1487 skin_lock(skin); | |
1488 error = skin_load_nolock(skin, path, FALSE); | |
1489 skin_unlock(skin); | |
1490 | |
1491 return error; | |
1492 } | |
1493 | |
1494 gboolean | |
1495 skin_reload_forced(void) | |
1496 { | |
1497 gboolean error; | |
1498 | |
1499 skin_lock(bmp_active_skin); | |
1500 error = skin_load_nolock(bmp_active_skin, bmp_active_skin->path, TRUE); | |
1501 skin_unlock(bmp_active_skin); | |
1502 | |
1503 return error; | |
1504 } | |
1505 | |
1506 void | |
1507 skin_reload(Skin * skin) | |
1508 { | |
1509 g_return_if_fail(skin != NULL); | |
1510 skin_load_nolock(skin, skin->path, TRUE); | |
1511 } | |
1512 | |
1513 | |
1514 static SkinPixmap * | |
1515 skin_get_pixmap(Skin * skin, SkinPixmapId map_id) | |
1516 { | |
1517 g_return_val_if_fail(skin != NULL, NULL); | |
1518 g_return_val_if_fail(map_id < SKIN_PIXMAP_COUNT, NULL); | |
1519 | |
1520 return &skin->pixmaps[map_id]; | |
1521 } | |
1522 | |
1523 GdkBitmap * | |
1524 skin_get_mask(Skin * skin, SkinMaskId mi) | |
1525 { | |
1526 GdkBitmap **masks; | |
1527 | |
1528 g_return_val_if_fail(skin != NULL, NULL); | |
1529 g_return_val_if_fail(mi < SKIN_PIXMAP_COUNT, NULL); | |
1530 | |
1531 masks = cfg.doublesize ? skin->ds_masks : skin->masks; | |
1532 return masks[mi]; | |
1533 } | |
1534 | |
1535 GdkColor * | |
1536 skin_get_color(Skin * skin, SkinColorId color_id) | |
1537 { | |
1538 GdkColor *ret = NULL; | |
1539 | |
1540 g_return_val_if_fail(skin != NULL, NULL); | |
1541 | |
1542 switch (color_id) { | |
1543 case SKIN_TEXTBG: | |
1544 if (skin->pixmaps[SKIN_TEXT].pixmap) | |
1545 ret = skin->textbg; | |
1546 else | |
1547 ret = skin->def_textbg; | |
1548 break; | |
1549 case SKIN_TEXTFG: | |
1550 if (skin->pixmaps[SKIN_TEXT].pixmap) | |
1551 ret = skin->textfg; | |
1552 else | |
1553 ret = skin->def_textfg; | |
1554 break; | |
1555 default: | |
1556 if (color_id < SKIN_COLOR_COUNT) | |
1557 ret = skin->colors[color_id]; | |
1558 break; | |
1559 } | |
1560 return ret; | |
1561 } | |
1562 | |
1563 void | |
1564 skin_get_viscolor(Skin * skin, guchar vis_color[24][3]) | |
1565 { | |
1566 gint i; | |
1567 | |
1568 g_return_if_fail(skin != NULL); | |
1569 | |
1570 for (i = 0; i < 24; i++) { | |
1571 vis_color[i][0] = skin->vis_color[i][0]; | |
1572 vis_color[i][1] = skin->vis_color[i][1]; | |
1573 vis_color[i][2] = skin->vis_color[i][2]; | |
1574 } | |
1575 } | |
1576 | |
1577 gint | |
1578 skin_get_id(void) | |
1579 { | |
1580 return skin_current_num; | |
1581 } | |
1582 | |
1583 void | |
1584 skin_draw_pixmap(Skin * skin, GdkDrawable * drawable, GdkGC * gc, | |
1585 SkinPixmapId pixmap_id, | |
1586 gint xsrc, gint ysrc, gint xdest, gint ydest, | |
1587 gint width, gint height) | |
1588 { | |
1589 SkinPixmap *pixmap; | |
1590 | |
1591 g_return_if_fail(skin != NULL); | |
1592 | |
1593 pixmap = skin_get_pixmap(skin, pixmap_id); | |
1594 g_return_if_fail(pixmap != NULL); | |
1595 g_return_if_fail(pixmap->pixmap != NULL); | |
1596 | |
1597 if (xsrc > pixmap->width || ysrc > pixmap->height) | |
1598 return; | |
1599 | |
1600 width = MIN(width, pixmap->width - xsrc); | |
1601 height = MIN(height, pixmap->height - ysrc); | |
1602 gdk_draw_drawable(drawable, gc, pixmap->pixmap, xsrc, ysrc, | |
1603 xdest, ydest, width, height); | |
1604 } | |
1605 | |
1606 void | |
1607 skin_get_eq_spline_colors(Skin * skin, guint32 colors[19]) | |
1608 { | |
1609 gint i; | |
1610 GdkPixmap *pixmap; | |
1611 GdkImage *img; | |
1612 SkinPixmap *eqmainpm; | |
1613 | |
1614 g_return_if_fail(skin != NULL); | |
1615 | |
1616 eqmainpm = &skin->pixmaps[SKIN_EQMAIN]; | |
1617 if (eqmainpm->pixmap && | |
1618 eqmainpm->current_width >= 116 && eqmainpm->current_height >= 313) | |
1619 pixmap = eqmainpm->pixmap; | |
1620 else | |
1621 return; | |
1622 | |
1623 if (!GDK_IS_DRAWABLE(pixmap)) | |
1624 return; | |
1625 | |
1626 if (!(img = gdk_drawable_get_image(pixmap, 115, 294, 1, 19))) | |
1627 return; | |
1628 | |
1629 for (i = 0; i < 19; i++) | |
1630 colors[i] = gdk_image_get_pixel(img, 0, i); | |
1631 | |
1632 g_object_unref(img); | |
1633 } | |
1634 | |
1635 | |
1636 static void | |
1637 skin_draw_playlistwin_frame_top(Skin * skin, | |
1638 GdkDrawable * drawable, | |
1639 GdkGC * gc, | |
1640 gint width, gint height, gboolean focus) | |
1641 { | |
1642 /* The title bar skin consists of 2 sets of 4 images, 1 set | |
1643 * for focused state and the other for unfocused. The 4 images | |
1644 * are: | |
1645 * | |
1646 * a. right corner (25,20) | |
1647 * b. left corner (25,20) | |
1648 * c. tiler (25,20) | |
1649 * d. title (100,20) | |
1650 * | |
1651 * min allowed width = 100+25+25 = 150 | |
1652 */ | |
1653 | |
1654 gint i, y, c; | |
1655 | |
1656 /* get y offset of the pixmap set to use */ | |
1657 if (focus) | |
1658 y = 0; | |
1659 else | |
1660 y = 21; | |
1661 | |
1662 /* left corner */ | |
1663 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 0, y, 0, 0, 25, 20); | |
1664 | |
1665 /* titlebar title */ | |
1666 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 26, y, | |
1667 (width - 100) / 2, 0, 100, 20); | |
1668 | |
1669 /* titlebar right corner */ | |
1670 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 153, y, | |
1671 width - 25, 0, 25, 20); | |
1672 | |
1673 /* tile draw the remaining frame */ | |
1674 | |
1675 /* compute tile count */ | |
1676 c = (width - (100 + 25 + 25)) / 25; | |
1677 | |
1678 for (i = 0; i < c / 2; i++) { | |
1679 /* left of title */ | |
1680 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 127, y, | |
1681 25 + i * 25, 0, 25, 20); | |
1682 | |
1683 /* right of title */ | |
1684 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 127, y, | |
1685 (width + 100) / 2 + i * 25, 0, 25, 20); | |
1686 } | |
1687 | |
1688 if (c & 1) { | |
1689 /* Odd tile count, so one remaining to draw. Here we split | |
1690 * it into two and draw half on either side of the title */ | |
1691 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 127, y, | |
1692 ((c / 2) * 25) + 25, 0, 12, 20); | |
1693 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 127, y, | |
1694 (width / 2) + ((c / 2) * 25) + 50, 0, 13, 20); | |
1695 } | |
1696 } | |
1697 | |
1698 static void | |
1699 skin_draw_playlistwin_frame_bottom(Skin * skin, | |
1700 GdkDrawable * drawable, | |
1701 GdkGC * gc, | |
1702 gint width, gint height, gboolean focus) | |
1703 { | |
1704 /* The bottom frame skin consists of 1 set of 4 images. The 4 | |
1705 * images are: | |
1706 * | |
1707 * a. left corner with menu buttons (125,38) | |
1708 * b. visualization window (75,38) | |
1709 * c. right corner with play buttons (150,38) | |
1710 * d. frame tile (25,38) | |
1711 * | |
1712 * (min allowed width = 125+150+25=300 | |
1713 */ | |
1714 | |
1715 gint i, c; | |
1716 | |
1717 /* bottom left corner (menu buttons) */ | |
1718 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 0, 72, | |
1719 0, height - 38, 125, 38); | |
1720 | |
1721 c = (width - 275) / 25; | |
1722 | |
1723 /* draw visualization window, if width allows */ | |
1724 if (c >= 3) { | |
1725 c -= 3; | |
1726 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 205, 0, | |
1727 width - (150 + 75), height - 38, 75, 38); | |
1728 } | |
1729 | |
1730 /* Bottom right corner (playbuttons etc) */ | |
1731 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, | |
1732 126, 72, width - 150, height - 38, 150, 38); | |
1733 | |
1734 /* Tile draw the remaining undrawn portions */ | |
1735 for (i = 0; i < c; i++) | |
1736 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 179, 0, | |
1737 125 + i * 25, height - 38, 25, 38); | |
1738 } | |
1739 | |
1740 static void | |
1741 skin_draw_playlistwin_frame_sides(Skin * skin, | |
1742 GdkDrawable * drawable, | |
1743 GdkGC * gc, | |
1744 gint width, gint height, gboolean focus) | |
1745 { | |
1746 /* The side frames consist of 2 tile images. 1 for the left, 1 for | |
1747 * the right. | |
1748 * a. left (12,29) | |
1749 * b. right (19,29) | |
1750 */ | |
1751 | |
1752 gint i; | |
1753 | |
1754 /* frame sides */ | |
1755 for (i = 0; i < (height - (20 + 38)) / 29; i++) { | |
1756 /* left */ | |
1757 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 0, 42, | |
1758 0, 20 + i * 29, 12, 29); | |
1759 | |
1760 /* right */ | |
1761 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 32, 42, | |
1762 width - 19, 20 + i * 29, 19, 29); | |
1763 } | |
1764 } | |
1765 | |
1766 | |
1767 void | |
1768 skin_draw_playlistwin_frame(Skin * skin, | |
1769 GdkDrawable * drawable, GdkGC * gc, | |
1770 gint width, gint height, gboolean focus) | |
1771 { | |
1772 skin_draw_playlistwin_frame_top(skin, drawable, gc, width, height, focus); | |
1773 skin_draw_playlistwin_frame_bottom(skin, drawable, gc, width, height, | |
1774 focus); | |
1775 skin_draw_playlistwin_frame_sides(skin, drawable, gc, width, height, | |
1776 focus); | |
1777 } | |
1778 | |
1779 | |
1780 void | |
1781 skin_draw_playlistwin_shaded(Skin * skin, | |
1782 GdkDrawable * drawable, GdkGC * gc, | |
1783 gint width, gboolean focus) | |
1784 { | |
1785 /* The shade mode titlebar skin consists of 4 images: | |
1786 * a) left corner offset (72,42) size (25,14) | |
1787 * b) right corner, focused offset (99,57) size (50,14) | |
1788 * c) right corner, unfocused offset (99,42) size (50,14) | |
1789 * d) bar tile offset (72,57) size (25,14) | |
1790 */ | |
1791 | |
1792 gint i; | |
1793 | |
1794 /* left corner */ | |
1795 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 72, 42, 0, 0, 25, 14); | |
1796 | |
1797 /* bar tile */ | |
1798 for (i = 0; i < (width - 75) / 25; i++) | |
1799 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 72, 57, | |
1800 (i * 25) + 25, 0, 25, 14); | |
1801 | |
1802 /* right corner */ | |
1803 skin_draw_pixmap(skin, drawable, gc, SKIN_PLEDIT, 99, focus ? 42 : 57, | |
1804 width - 50, 0, 50, 14); | |
1805 } | |
1806 | |
1807 | |
1808 void | |
1809 skin_draw_mainwin_titlebar(Skin * skin, | |
1810 GdkDrawable * drawable, GdkGC * gc, | |
1811 gboolean shaded, gboolean focus) | |
1812 { | |
1813 /* The titlebar skin consists of 2 sets of 2 images, one for for | |
1814 * shaded and the other for unshaded mode, giving a total of 4. | |
1815 * The images are exactly 275x14 pixels, aligned and arranged | |
1816 * vertically on each other in the pixmap in the following order: | |
1817 * | |
1818 * a) unshaded, focused offset (27, 0) | |
1819 * b) unshaded, unfocused offset (27, 15) | |
1820 * c) shaded, focused offset (27, 29) | |
1821 * d) shaded, unfocused offset (27, 42) | |
1822 */ | |
1823 | |
1824 gint y_offset; | |
1825 | |
1826 if (shaded) { | |
1827 if (focus) | |
1828 y_offset = 29; | |
1829 else | |
1830 y_offset = 42; | |
1831 } | |
1832 else { | |
1833 if (focus) | |
1834 y_offset = 0; | |
1835 else | |
1836 y_offset = 15; | |
1837 } | |
1838 | |
1839 skin_draw_pixmap(skin, drawable, gc, SKIN_TITLEBAR, 27, y_offset, | |
1840 0, 0, bmp_active_skin->properties.mainwin_width, MAINWIN_TITLEBAR_HEIGHT); | |
1841 } | |
2443
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1842 |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1843 |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1844 void |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1845 skin_set_random_skin(void) |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1846 { |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1847 SkinNode *node; |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1848 guint32 randval; |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1849 |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1850 /* Get a random value to select the skin to use */ |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1851 randval = g_random_int_range(0, g_list_length(skinlist)); |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1852 node = g_list_nth(skinlist, randval)->data; |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1853 bmp_active_skin_load(node->path); |
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
1854 } |