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