Mercurial > mplayer.hg
annotate gui/win32/skinload.c @ 36895:5616bd62fa26
Fix bug with hpotmeter/vpotmeter in the Win32 GUI.
Allow a hpotmeter/vpotmeter without button.
(The rendering should be fixed, actually, because
it only renders the button but not the phases image.)
author | ib |
---|---|
date | Tue, 11 Mar 2014 12:48:59 +0000 |
parents | 87e6a09a07a7 |
children | 737e2a3b9a5d |
rev | line source |
---|---|
23077 | 1 /* |
23079 | 2 * MPlayer GUI for Win32 |
3 * Copyright (C) 2003 Sascha Sommer <saschasommer@freenet.de> | |
4 * Copyright (C) 2006 Erik Augustson <erik_27can@yahoo.com> | |
5 * Copyright (C) 2006 Gianluigi Tiesi <sherpya@netfarm.it> | |
6 * | |
7 * This file is part of MPlayer. | |
8 * | |
9 * MPlayer is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * MPlayer is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
26457 | 19 * You should have received a copy of the GNU General Public License along |
20 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
23079 | 22 */ |
23077 | 23 |
33761 | 24 #include <string.h> |
23077 | 25 #include <stdlib.h> |
23796 | 26 #include <stdio.h> |
23077 | 27 #include <inttypes.h> |
28 #include <windows.h> | |
29 | |
23091
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
30 #include "mp_msg.h" |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
31 #include "help_mp.h" |
23091
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
32 #include "cpudetect.h" |
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
33 #include "libswscale/swscale.h" |
32833
c4891d10ddbb
Adjust #include paths after the merge of libavcore into libavutil in FFmpeg.
diego
parents:
32537
diff
changeset
|
34 #include "libavutil/imgutils.h" |
23077 | 35 #include "gui.h" |
33770 | 36 #include "gui/util/mem.h" |
33046 | 37 #include "gui/util/bitmap.h" |
23077 | 38 |
39 #define MAX_LINESIZE 256 | |
40 | |
41 typedef struct | |
42 { | |
43 int msg; | |
44 char *name; | |
45 } evName; | |
46 | |
47 static const evName evNames[] = | |
48 { | |
49 { evNone, "evNone" }, | |
50 { evPlay, "evPlay" }, | |
51 { evStop, "evStop" }, | |
52 { evPause, "evPause" }, | |
53 { evPrev, "evPrev" }, | |
54 { evNext, "evNext" }, | |
55 { evLoad, "evLoad" }, | |
34317 | 56 { evLoadPlay, "evLoadPlay" }, |
57 { evLoadAudioFile, "evLoadAudioFile" }, | |
58 { evLoadSubtitle, "evLoadSubtitle" }, | |
59 { evDropSubtitle, "evDropSubtitle" }, | |
34321
daebf766dea6
Cosmetic: Synchronize evPlaylist event and message names.
ib
parents:
34320
diff
changeset
|
60 { evPlaylist, "evPlaylist" }, |
34387 | 61 { evPlayCD, "evPlayCD" }, |
34317 | 62 { evPlayVCD, "evPlayVCD" }, |
63 { evPlayDVD, "evPlayDVD" }, | |
34324 | 64 { evLoadURL, "evSetURL" }, // legacy |
65 { evLoadURL, "evLoadURL" }, | |
36429 | 66 { evPlayTV, "evPlayTV" }, |
34317 | 67 { evPlaySwitchToPause, "evPlaySwitchToPause" }, |
68 { evPauseSwitchToPlay, "evPauseSwitchToPlay" }, | |
23077 | 69 { evBackward10sec, "evBackward10sec" }, |
70 { evForward10sec, "evForward10sec" }, | |
71 { evBackward1min, "evBackward1min" }, | |
72 { evForward1min, "evForward1min" }, | |
73 { evBackward10min, "evBackward10min" }, | |
74 { evForward10min, "evForward10min" }, | |
34317 | 75 { evSetMoviePosition, "evSetMoviePosition" }, |
34320 | 76 { evHalfSize, "evHalfSize" }, |
34317 | 77 { evDoubleSize, "evDoubleSize" }, |
78 { evFullScreen, "evFullScreen" }, | |
79 { evNormalSize, "evNormalSize" }, | |
34322 | 80 { evSetAspect, "evSetAspect" }, |
23077 | 81 { evIncVolume, "evIncVolume" }, |
82 { evDecVolume, "evDecVolume" }, | |
34317 | 83 { evSetVolume, "evSetVolume" }, |
23077 | 84 { evMute, "evMute" }, |
34317 | 85 { evSetBalance, "evSetBalance" }, |
86 { evEqualizer, "evEqualizer" }, | |
87 { evAbout, "evAbout" }, | |
88 { evPreferences, "evPreferences" }, | |
89 { evSkinBrowser, "evSkinBrowser" }, | |
34458 | 90 { evMenu, "evMenu" }, |
34317 | 91 { evIconify, "evIconify" }, |
34326 | 92 { evExit, "evExit" } |
23077 | 93 }; |
94 | |
95 static const int evBoxs = sizeof(evNames) / sizeof(evName); | |
96 | |
36890 | 97 static int linenumber; |
98 | |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
99 /** |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
100 * @brief Print a legacy information on an entry. |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
101 * |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
102 * @param old identifier (and deprecated entry) |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
103 * @param data pointer to additional data necessary for checking and |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
104 * to print the information on @a old |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
105 */ |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
106 static void skin_legacy (const char *old, const char *data) |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
107 { |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
108 const char *p; |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
109 |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
110 if (strcmp(old, "fontid") == 0) |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
111 { |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
112 p = strchr(data, ','); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
113 |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
114 if (p) mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_SkinLegacy, linenumber, p, "font = fontfile"); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
115 } |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
116 else if (strcmp(old, "$l") == 0) |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
117 { |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
118 p = strstr(old, data); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
119 |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
120 if (p && (p == data || p[-1] != '$')) mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_SkinLegacy, linenumber, old, "$p"); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
121 } |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
122 else if (strcmp(old, "evSetURL") == 0 && strcmp(data, old) == 0) |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
123 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_SkinLegacy, linenumber, old, "evLoadURL"); |
36892 | 124 else if (strcmp(old, "sub") == 0 || strcmp(old, "potmeter") == 0) |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
125 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_SkinLegacy, linenumber, old, data); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
126 } |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
127 |
23077 | 128 static char *geteventname(int event) |
129 { | |
130 int i; | |
131 for(i=0; i<evBoxs; i++) | |
132 if(evNames[i].msg == event) | |
133 return evNames[i].name; | |
134 return NULL; | |
135 } | |
136 | |
137 /* reads a complete image as is into image buffer */ | |
33784 | 138 static image *pngRead(skin_t *skin, const char *fname) |
23077 | 139 { |
34996
ebcc17a3c165
Fix compiler warnings (comparison between signed and unsigned).
ib
parents:
34697
diff
changeset
|
140 unsigned int i; |
33555 | 141 guiImage bmp; |
23077 | 142 image *bf; |
23266
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
143 char *filename = NULL; |
23077 | 144 FILE *fp; |
145 | |
146 if(!stricmp(fname, "NULL")) return 0; | |
147 | |
148 /* find filename in order file file.png */ | |
149 if(!(fp = fopen(fname, "rb"))) | |
150 { | |
151 filename = calloc(1, strlen(skin->skindir) + strlen(fname) + 6); | |
34092
dbf5042ab255
Don't use the Windows style path separator character in Win32 GUI.
ib
parents:
33784
diff
changeset
|
152 sprintf(filename, "%s/%s.png", skin->skindir, fname); |
23077 | 153 if(!(fp = fopen(filename, "rb"))) |
154 { | |
155 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[png] cannot find image %s\n", filename); | |
156 free(filename); | |
157 return 0; | |
158 } | |
159 } | |
23266
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
160 fclose(fp); |
23077 | 161 |
162 for (i=0; i < skin->imagecount; i++) | |
163 if(!strcmp(fname, skin->images[i]->name)) | |
164 { | |
34450 | 165 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[png] skinfile %s already exists\n", fname); |
23266
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
166 free(filename); |
23077 | 167 return skin->images[i]; |
168 } | |
169 (skin->imagecount)++; | |
170 skin->images = realloc(skin->images, sizeof(image *) * skin->imagecount); | |
171 bf = skin->images[(skin->imagecount) - 1] = calloc(1, sizeof(image)); | |
172 bf->name = strdup(fname); | |
23266
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
173 bpRead(filename ? filename : fname, &bmp); |
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
174 free(filename); |
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
175 bf->width = bmp.Width; bf->height = bmp.Height; |
23077 | 176 |
177 bf->size = bf->width * bf->height * skin->desktopbpp / 8; | |
23266
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
178 if (skin->desktopbpp == 32) |
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
179 bf->data = bmp.Image; |
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
180 else { |
32028
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
181 const uint8_t *src[4] = { bmp.Image, NULL, NULL, NULL}; |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
182 int src_stride[4] = { 4 * bmp.Width, 0, 0, 0 }; |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
183 uint8_t *dst[4] = { NULL, NULL, NULL, NULL }; |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
184 int dst_stride[4]; |
35707
4ba6b8d3197e
Replace PixelFormat and PIX_FMT_FOO by their AV_-prefixed counterparts.
diego
parents:
35501
diff
changeset
|
185 enum AVPixelFormat out_pix_fmt = PIX_FMT_NONE; |
32028
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
186 struct SwsContext *sws; |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
187 if (skin->desktopbpp == 16) out_pix_fmt = PIX_FMT_RGB555; |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
188 else if (skin->desktopbpp == 24) out_pix_fmt = PIX_FMT_RGB24; |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
189 av_image_fill_linesizes(dst_stride, out_pix_fmt, bmp.Width); |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
190 sws = sws_getContext(bmp.Width, bmp.Height, PIX_FMT_RGB32, |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
191 bmp.Width, bmp.Height, out_pix_fmt, |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
192 SWS_POINT, NULL, NULL, NULL); |
23266
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
193 bf->data = malloc(bf->size); |
32028
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
194 dst[0] = bf->data; |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
195 sws_scale(sws, src, src_stride, 0, bmp.Height, dst, dst_stride); |
9e6fdede8ece
gui: remove direct usage of rgb2rgb interface, use swscale instead
ramiro
parents:
26457
diff
changeset
|
196 sws_freeContext(sws); |
23266
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
197 free(bmp.Image); |
6cd7f1c23d90
Reuse linux code for reading png images for windows Gui,
reimar
parents:
23091
diff
changeset
|
198 } |
23077 | 199 return bf; |
200 } | |
201 | |
202 /* frees all skin images */ | |
203 static void freeimages(skin_t *skin) | |
204 { | |
205 unsigned int i; | |
206 for (i=0; i<skin->imagecount; i++) | |
207 { | |
208 if(skin->images && skin->images[i]) | |
209 { | |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32028
diff
changeset
|
210 free(skin->images[i]->data); |
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32028
diff
changeset
|
211 free(skin->images[i]->name); |
23077 | 212 free(skin->images[i]); |
213 } | |
214 } | |
215 free(skin->images); | |
216 } | |
217 | |
33621
18b47d32b0d0
win32 gui: Mark debug function only used within the file as static.
diego
parents:
33620
diff
changeset
|
218 static void dumpwidgets(skin_t *skin) |
23077 | 219 { |
220 unsigned int i; | |
221 for (i=0; i<skin->widgetcount; i++) | |
34450 | 222 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "widget %p id %i\n", skin->widgets[i], skin->widgets[i]->id); |
23077 | 223 } |
224 | |
225 static int counttonextchar(const char *s1, char c) | |
226 { | |
227 unsigned int i; | |
228 for (i=0; i<strlen(s1); i++) | |
229 if(s1[i] == c) return i; | |
230 return 0; | |
231 } | |
232 | |
233 static char *findnextstring(char *temp, const char *desc, int *base) | |
234 { | |
235 int len = counttonextchar(*base + desc, ','); | |
236 memset(temp, 0, strlen(desc) + 1); | |
237 if(!len) len = strlen(desc); | |
238 memcpy(temp, *base + desc, len); | |
239 *base += (len+1); | |
240 return temp; | |
241 } | |
242 | |
243 static void freeskin(skin_t *skin) | |
244 { | |
245 unsigned int i; | |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32028
diff
changeset
|
246 |
33770 | 247 nfree(skin->skindir); |
23077 | 248 |
249 for (i=1; i<=skin->lastusedid; i++) | |
250 skin->removewidget(skin, i); | |
251 | |
33770 | 252 nfree(skin->widgets); |
23077 | 253 |
254 freeimages(skin); | |
255 for(i=0; i<skin->windowcount; i++) | |
256 { | |
33770 | 257 nfree(skin->windows[i]->name); |
23077 | 258 free(skin->windows[i]); |
259 } | |
260 | |
33770 | 261 nfree(skin->windows); |
23077 | 262 |
263 for (i=0; i<skin->fontcount; i++) | |
264 { | |
265 unsigned int x; | |
266 | |
33770 | 267 nfree(skin->fonts[i]->name); |
23077 | 268 |
269 for (x=0; x<skin->fonts[i]->charcount; x++) | |
33770 | 270 nfree(skin->fonts[i]->chars[x]); |
271 | |
272 nfree(skin->fonts[i]->chars); | |
23077 | 273 |
33770 | 274 nfree(skin->fonts[i]); |
23077 | 275 } |
33770 | 276 nfree(skin->fonts); |
34450 | 277 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN FREE] skin freed\n"); |
33770 | 278 nfree(skin); |
23077 | 279 } |
280 | |
281 static void removewidget(skin_t *skin, int id) | |
282 { | |
283 unsigned int i; | |
284 unsigned int pos=0; | |
285 widget **temp = calloc(skin->widgetcount - 1, sizeof(widget *)); | |
286 | |
287 for (i=0; i<skin->widgetcount; i++) | |
288 { | |
289 if(skin->widgets[i]->id == id) | |
290 { | |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32028
diff
changeset
|
291 free(skin->widgets[i]->label); |
33770 | 292 nfree(skin->widgets[i]); |
23077 | 293 } |
294 else | |
295 { | |
296 temp[pos] = skin->widgets[i]; | |
297 pos++; | |
298 } | |
299 } | |
300 if (pos != i) | |
301 { | |
302 (skin->widgetcount)--; | |
303 free(skin->widgets); | |
304 skin->widgets = temp; | |
34450 | 305 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "removed widget %i\n", id); |
23077 | 306 return; |
307 } | |
308 free(temp); | |
309 mp_msg(MSGT_GPLAYER, MSGL_ERR, "widget %i not found\n", id); | |
310 } | |
311 | |
312 static void addwidget(skin_t *skin, window *win, const char *desc) | |
313 { | |
314 widget *mywidget; | |
315 char *temp = calloc(1, strlen(desc) + 1); | |
316 (skin->widgetcount)++; | |
317 (skin->lastusedid)++; | |
318 skin->widgets = realloc(skin->widgets, sizeof(widget *) * skin->widgetcount); | |
319 mywidget = skin->widgets[(skin->widgetcount) - 1] = calloc(1, sizeof(widget)); | |
320 mywidget->id = skin->lastusedid; | |
321 mywidget->window = win->type; | |
322 /* parse and fill widget specific info */ | |
323 if(!strncmp(desc, "base", 4)) | |
324 { | |
325 int base = counttonextchar(desc, '=') + 1; | |
326 mywidget->type = tyBase; | |
327 mywidget->bitmap[0] = pngRead(skin, findnextstring(temp, desc, &base)); | |
328 mywidget->wx = mywidget->x = atoi(findnextstring(temp, desc, &base)); | |
329 mywidget->wy = mywidget->y = atoi(findnextstring(temp, desc, &base)); | |
330 mywidget->wwidth = mywidget->width = atoi(findnextstring(temp, desc, &base)); | |
331 mywidget->wheight = mywidget->height = atoi(findnextstring(temp, desc, &base)); | |
332 win->base = mywidget; | |
34450 | 333 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] [BASE] %s %i %i %i %i\n", |
23077 | 334 (mywidget->bitmap[0]) ? mywidget->bitmap[0]->name : NULL, |
335 mywidget->x, mywidget->y, mywidget->width, mywidget->height); | |
336 } | |
337 else if(!strncmp(desc, "button", 6)) | |
338 { | |
339 int base = counttonextchar(desc, '=') + 1; | |
340 int i; | |
341 mywidget->type = tyButton; | |
342 mywidget->bitmap[0] = pngRead(skin, findnextstring(temp, desc, &base)); | |
343 mywidget->wx = mywidget->x = atoi(findnextstring(temp, desc, &base)); | |
344 mywidget->wy = mywidget->y = atoi(findnextstring(temp, desc, &base)); | |
345 mywidget->wwidth = mywidget->width = atoi(findnextstring(temp, desc, &base)); | |
346 mywidget->wheight = mywidget->height = atoi(findnextstring(temp, desc, &base)); | |
347 findnextstring(temp, desc, &base); | |
348 | |
349 /* Assign corresponding event to the widget */ | |
350 mywidget->msg = evNone; | |
351 for (i=0; i<evBoxs; i++) | |
352 { | |
353 if(!strcmp(temp, evNames[i].name)) | |
354 { | |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
355 // legacy |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
356 skin_legacy("evSetURL", temp); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
357 |
23077 | 358 mywidget->msg = evNames[i].msg; |
359 break; | |
360 } | |
361 } | |
362 | |
34450 | 363 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] [BUTTON] %s %i %i %i %i msg %i\n", |
23077 | 364 (mywidget->bitmap[0]) ? mywidget->bitmap[0]->name : NULL, |
365 mywidget->x, mywidget->y, mywidget->width, mywidget->height, mywidget->msg); | |
366 } | |
36892 | 367 else if(!strncmp(desc, "hpotmeter", 9) || !strncmp(desc, "vpotmeter", 9) || /* legacy */ !strncmp(desc, "potmeter", 8)) |
23077 | 368 { |
369 int base = counttonextchar(desc, '=') + 1; | |
36892 | 370 int i = 0; |
23077 | 371 /* hpotmeter = button, bwidth, bheight, phases, numphases, default, X, Y, width, height, message */ |
36892 | 372 if(!strncmp(desc, "vpotmeter", 9)) mywidget->type = tyVpotmeter; |
373 else mywidget->type = tyHpotmeter; | |
374 if (*desc != 'p') | |
375 { | |
36893 | 376 mywidget->bitmap[i++] = pngRead(skin, findnextstring(temp, desc, &base)); |
377 mywidget->width = atoi(findnextstring(temp, desc, &base)); | |
378 mywidget->height = atoi(findnextstring(temp, desc, &base)); | |
36892 | 379 } |
380 mywidget->bitmap[i] = pngRead(skin, findnextstring(temp, desc, &base)); | |
23077 | 381 mywidget->phases = atoi(findnextstring(temp, desc, &base)); |
382 mywidget->value = atof(findnextstring(temp, desc, &base)); | |
383 mywidget->x = mywidget->wx = atoi(findnextstring(temp, desc, &base)); | |
384 mywidget->y = mywidget->wy = atoi(findnextstring(temp, desc, &base)); | |
385 mywidget->wwidth = atoi(findnextstring(temp, desc, &base)); | |
386 mywidget->wheight = atoi(findnextstring(temp, desc, &base)); | |
36892 | 387 if (*desc == 'p') |
388 { | |
389 // legacy | |
390 skin_legacy("potmeter", "hpotmeter"); | |
391 | |
392 mywidget->width = mywidget->wwidth; | |
393 mywidget->height = mywidget->wheight; | |
394 } | |
36895 | 395 if (mywidget->bitmap[0] == NULL || mywidget->width == 0 || mywidget->height == 0) |
396 { | |
397 mywidget->bitmap[0] = mywidget->bitmap[1]; | |
398 mywidget->width = mywidget->wwidth; | |
399 mywidget->height = mywidget->wheight; | |
400 } | |
23077 | 401 findnextstring(temp, desc, &base); |
402 mywidget->msg = evNone; | |
403 for (i=0; i<evBoxs; i++) | |
404 { | |
405 if(!strcmp(temp, evNames[i].name)) | |
406 { | |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
407 // legacy |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
408 skin_legacy("evSetURL", temp); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
409 |
23077 | 410 mywidget->msg = evNames[i].msg; |
411 break; | |
412 } | |
413 } | |
34450 | 414 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] %s %s %i %i %s %i %f %i %i %i %i msg %i\n", |
23077 | 415 (mywidget->type == tyHpotmeter) ? "[HPOTMETER]" : "[VPOTMETER]", |
416 (mywidget->bitmap[0]) ? mywidget->bitmap[0]->name : NULL, | |
417 mywidget->width, mywidget->height, | |
418 (mywidget->bitmap[1]) ? mywidget->bitmap[1]->name : NULL, | |
419 mywidget->phases, mywidget->value, | |
420 mywidget->wx, mywidget->wy, mywidget->wwidth, mywidget->wwidth, | |
421 mywidget->msg); | |
422 } | |
423 else if(!strncmp(desc, "potmeter", 8)) | |
424 { | |
425 int base = counttonextchar(desc, '=') + 1; | |
426 int i; | |
427 /* potmeter = phases, numphases, default, X, Y, width, height, message */ | |
428 mywidget->type = tyPotmeter; | |
429 mywidget->bitmap[0] = pngRead(skin, findnextstring(temp, desc, &base)); | |
430 mywidget->phases = atoi(findnextstring(temp, desc, &base)); | |
431 mywidget->value = atof(findnextstring(temp, desc, &base)); | |
432 mywidget->wx = mywidget->x = atoi(findnextstring(temp, desc, &base)); | |
433 mywidget->wy = mywidget->y = atoi(findnextstring(temp, desc, &base)); | |
434 mywidget->wwidth = mywidget->width = atoi(findnextstring(temp, desc, &base)); | |
435 mywidget->wheight = mywidget->height = atoi(findnextstring(temp, desc, &base)); | |
436 findnextstring(temp, desc, &base); | |
437 mywidget->msg = evNone; | |
438 for (i=0; i<evBoxs; i++) | |
439 { | |
440 if(!strcmp(temp, evNames[i].name)) | |
441 { | |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
442 // legacy |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
443 skin_legacy("evSetURL", temp); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
444 |
23077 | 445 mywidget->msg=evNames[i].msg; |
446 break; | |
447 } | |
448 } | |
34450 | 449 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] [POTMETER] %s %i %i %i %f %i %i msg %i\n", |
23077 | 450 (mywidget->bitmap[0]) ? mywidget->bitmap[0]->name : NULL, |
451 mywidget->width, mywidget->height, | |
452 mywidget->phases, mywidget->value, | |
453 mywidget->x, mywidget->y, | |
454 mywidget->msg); | |
455 } | |
456 else if(!strncmp(desc, "menu", 4)) | |
457 { | |
458 int base = counttonextchar(desc, '=') + 1; | |
459 int i; | |
460 mywidget->type = tyMenu; | |
461 mywidget->wx=atoi(findnextstring(temp, desc, &base)); | |
462 mywidget->x=0; | |
463 mywidget->wy=mywidget->y=atoi(findnextstring(temp, desc, &base)); | |
464 mywidget->wwidth=mywidget->width=atoi(findnextstring(temp, desc, &base)); | |
465 mywidget->wheight=mywidget->height=atoi(findnextstring(temp, desc, &base)); | |
466 findnextstring(temp, desc, &base); | |
467 mywidget->msg = evNone; | |
468 for (i=0; i<evBoxs; i++) | |
469 { | |
470 if(!strcmp(temp, evNames[i].name)) | |
471 { | |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
472 // legacy |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
473 skin_legacy("evSetURL", temp); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
474 |
23077 | 475 mywidget->msg = evNames[i].msg; |
476 break; | |
477 } | |
478 } | |
34450 | 479 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] [MENU] %i %i %i %i msg %i\n", |
23077 | 480 mywidget->x, mywidget->y, mywidget->width, mywidget->height, mywidget->msg); |
481 } | |
482 else if(!strncmp(desc, "selected", 8)) | |
483 { | |
36840 | 484 win->base->bitmap[1] = pngRead(skin, desc + 9); |
34450 | 485 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] [BASE] added image %s\n", win->base->bitmap[1]->name); |
23077 | 486 } |
487 else if(!strncmp(desc, "slabel",6)) | |
488 { | |
489 int base = counttonextchar(desc, '=') + 1; | |
490 unsigned int i; | |
491 mywidget->type = tySlabel; | |
492 mywidget->wx = mywidget->x = atoi(findnextstring(temp, desc, &base)); | |
493 mywidget->wy = mywidget->y = atoi(findnextstring(temp, desc, &base)); | |
494 findnextstring(temp, desc, &base); | |
495 mywidget->font = NULL; | |
496 for (i=0; i<skin->fontcount; i++) | |
497 { | |
498 if(!strcmp(temp, skin->fonts[i]->name)) | |
499 { | |
500 mywidget->font = skin->fonts[i]; | |
501 break; | |
502 } | |
503 } | |
504 mywidget->label = strdup(findnextstring(temp, desc, &base)); | |
34450 | 505 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] [SLABEL] %i %i %s %s\n", |
23077 | 506 mywidget->x, mywidget->y, mywidget->font->name, mywidget->label); |
507 } | |
508 else if(!strncmp(desc, "dlabel", 6)) | |
509 { | |
510 int base = counttonextchar(desc, '=') + 1; | |
511 unsigned int i; | |
512 mywidget->type = tyDlabel; | |
513 mywidget->wx = mywidget->x = atoi(findnextstring(temp, desc, &base)); | |
514 mywidget->wy = mywidget->y = atoi(findnextstring(temp, desc, &base)); | |
515 mywidget->length = atoi(findnextstring(temp, desc, &base)); | |
516 mywidget->align = atoi(findnextstring(temp, desc, &base)); | |
517 findnextstring(temp, desc, &base); | |
518 mywidget->font = NULL; | |
519 for (i=0; i<skin->fontcount; i++) | |
520 { | |
521 if(!strcmp(temp, skin->fonts[i]->name)) | |
522 { | |
523 mywidget->font=skin->fonts[i]; | |
524 break; | |
525 } | |
526 } | |
527 mywidget->label=strdup(findnextstring(temp, desc, &base)); | |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
528 |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
529 // legacy |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
530 skin_legacy("$l", mywidget->label); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
531 |
34450 | 532 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [ITEM] [DLABEL] %i %i %i %i %s \"%s\"\n", |
23077 | 533 mywidget->x, mywidget->y, mywidget->length, mywidget->align, mywidget->font->name, mywidget->label); |
534 } | |
535 free(temp); | |
536 } | |
537 | |
538 static void loadfonts(skin_t* skin) | |
539 { | |
540 unsigned int x; | |
541 for (x=0; x<skin->fontcount; x++) | |
542 { | |
543 FILE *fp; | |
544 char *filename; | |
545 char *tmp = calloc(1, MAX_LINESIZE); | |
546 char *desc = calloc(1, MAX_LINESIZE); | |
547 filename = calloc(1, strlen(skin->skindir) + strlen(skin->fonts[x]->name) + 6); | |
34092
dbf5042ab255
Don't use the Windows style path separator character in Win32 GUI.
ib
parents:
33784
diff
changeset
|
548 sprintf(filename, "%s/%s.fnt", skin->skindir, skin->fonts[x]->name); |
23077 | 549 if(!(fp = fopen(filename,"rb"))) |
550 { | |
551 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[FONT LOAD] Font not found \"%s\"\n", skin->fonts[x]->name); | |
33783 | 552 free(tmp); |
553 free(desc); | |
554 free(filename); | |
23077 | 555 return; |
556 } | |
557 while(!feof(fp)) | |
558 { | |
559 int pos = 0; | |
560 unsigned int i; | |
561 fgets(tmp, MAX_LINESIZE, fp); | |
562 memset(desc, 0, MAX_LINESIZE); | |
563 for (i=0; i<strlen(tmp); i++) | |
564 { | |
565 /* remove spaces and linebreaks */ | |
566 if((tmp[i] == ' ') || (tmp[i] == '\n') || (tmp[i] == '\r')) continue; | |
567 /* remove comments */ | |
568 if((tmp[i] == ';') && ((i < 1) || (tmp[i-1] != '\"'))) | |
569 { | |
34450 | 570 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[FONT LOAD] Comment: %s", tmp + i + 1); |
23077 | 571 break; |
572 } | |
573 desc[pos] = tmp[i]; | |
574 pos++; | |
575 } | |
576 if(!strlen(desc)) continue; | |
577 /* now we have "readable" output -> parse it */ | |
578 if(!strncmp(desc, "image", 5)) | |
579 { | |
580 skin->fonts[x]->image = pngRead(skin, desc + 6); | |
34450 | 581 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[FONT] [IMAGE] \"%s\"\n", desc + 6); |
23077 | 582 } |
583 else | |
584 { | |
585 int base = 4; | |
586 if(*desc != '"') break; | |
587 if(*(desc + 1) == 0) break; | |
588 (skin->fonts[x]->charcount)++; | |
589 skin->fonts[x]->chars = realloc(skin->fonts[x]->chars, sizeof(char_t *) *skin->fonts[x]->charcount); | |
590 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]=calloc(1, sizeof(char_t)); | |
591 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->c = ((*(desc + 1) == '"') && (*(desc + 2) != '"')) ? ' ': *(desc + 1); | |
592 if((*(desc + 1) == '"') && (*(desc + 2) != '"')) base = 3; | |
593 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->x = atoi(findnextstring(tmp, desc, &base)); | |
594 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->y = atoi(findnextstring(tmp, desc, &base)); | |
595 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->width = atoi(findnextstring(tmp, desc, &base)); | |
596 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->height = atoi(findnextstring(tmp, desc, &base)); | |
34450 | 597 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[FONT] [CHAR] %c %i %i %i %i\n", |
23077 | 598 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->c, |
599 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->x, | |
600 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->y, | |
601 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->width, | |
602 skin->fonts[x]->chars[skin->fonts[x]->charcount - 1]->height); | |
603 } | |
604 } | |
605 free(desc); | |
606 free(filename); | |
607 free(tmp); | |
608 fclose(fp); | |
609 } | |
610 } | |
611 | |
612 skin_t* loadskin(char* skindir, int desktopbpp) | |
613 { | |
614 FILE *fp; | |
35501 | 615 int reachedendofwindow = FALSE; |
23077 | 616 skin_t *skin = calloc(1, sizeof(skin_t)); |
617 char *filename; | |
618 char *tmp = calloc(1, MAX_LINESIZE); | |
619 char *desc = calloc(1, MAX_LINESIZE); | |
620 window* mywindow = NULL; | |
621 | |
36890 | 622 linenumber = 0; |
623 | |
23077 | 624 /* setup funcs */ |
625 skin->freeskin = freeskin; | |
626 skin->pngRead = pngRead; | |
627 skin->addwidget = addwidget; | |
628 skin->removewidget = removewidget; | |
629 skin->geteventname = geteventname; | |
630 skin->desktopbpp = desktopbpp; | |
631 skin->skindir = strdup(skindir); | |
632 | |
633 filename = calloc(1, strlen(skin->skindir) + strlen("skin") + 2); | |
34092
dbf5042ab255
Don't use the Windows style path separator character in Win32 GUI.
ib
parents:
33784
diff
changeset
|
634 sprintf(filename, "%s/skin", skin->skindir); |
23077 | 635 if(!(fp = fopen(filename, "rb"))) |
636 { | |
637 mp_msg(MSGT_GPLAYER, MSGL_FATAL, "[SKIN LOAD] Skin \"%s\" not found\n", skindir); | |
638 skin->freeskin(skin); | |
33783 | 639 free(tmp); |
640 free(desc); | |
641 free(filename); | |
23077 | 642 return NULL; |
643 } | |
644 | |
645 while(!feof(fp)) | |
646 { | |
647 int pos = 0; | |
648 unsigned int i; | |
35501 | 649 int insidequote = FALSE; |
23077 | 650 fgets(tmp, MAX_LINESIZE, fp); |
651 linenumber++; | |
652 memset(desc, 0, MAX_LINESIZE); | |
653 for (i=0; i<strlen(tmp); i++) | |
654 { | |
35501 | 655 if((tmp[i] == '"') && !insidequote) { insidequote=TRUE; continue; } |
656 else if((tmp[i] == '"') && insidequote) { insidequote=FALSE ; continue; } | |
23077 | 657 /* remove spaces and linebreaks */ |
658 if((!insidequote && (tmp[i] == ' ')) || (tmp[i] == '\n') || (tmp[i] == '\r')) continue; | |
659 /* remove comments */ | |
660 else if(tmp[i] == ';') | |
661 { | |
34450 | 662 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN LOAD] Comment: %s", tmp + i + 1); |
23077 | 663 break; |
664 } | |
665 desc[pos] = tmp[i]; | |
666 pos++; | |
667 } | |
668 | |
669 if(!strlen(desc)) continue; | |
670 /* now we have "readable" output -> parse it */ | |
671 /* parse window specific info */ | |
672 if(!strncmp(desc, "section", 7)) | |
673 { | |
34450 | 674 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [SECTION] \"%s\"\n", desc + 8); |
23077 | 675 } |
676 else if(!strncmp(desc, "window", 6)) | |
677 { | |
34450 | 678 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [WINDOW] \"%s\"\n", desc + 7); |
35501 | 679 reachedendofwindow = FALSE; |
23077 | 680 (skin->windowcount)++; |
681 skin->windows = realloc(skin->windows, sizeof(window *) * skin->windowcount); | |
682 mywindow = skin->windows[(skin->windowcount) - 1] = calloc(1, sizeof(window)); | |
683 mywindow->name = strdup(desc + 7); | |
684 if(!strncmp(desc + 7, "main", 4)) mywindow->type = wiMain; | |
36885 | 685 else if(!strncmp(desc+7, "video", 5) || /* legacy */ !strncmp(desc+7, "sub", 3)) |
23077 | 686 { |
34697 | 687 mywindow->type = wiVideo; |
35501 | 688 mywindow->decoration = TRUE; |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
689 // legacy |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
690 if (desc[7] == 's') skin_legacy("sub", "video"); |
23077 | 691 } |
692 else if(!strncmp(desc + 7, "menu", 4)) mywindow->type = wiMenu; | |
693 else if(!strncmp(desc + 7, "playbar", 7)) mywindow->type = wiPlaybar; | |
694 else mp_msg(MSGT_GPLAYER, MSGL_V, "[SKIN] warning found unknown windowtype"); | |
695 } | |
696 else if(!strncmp(desc, "decoration", 10) && !strncmp(desc + 11, "enable", 6)) | |
697 { | |
35501 | 698 mywindow->decoration = TRUE; |
34450 | 699 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [DECORATION] enabled decoration for window \"%s\"\n", mywindow->name); |
23077 | 700 } |
701 else if(!strncmp(desc, "background", 10)) | |
702 { | |
703 int base = counttonextchar(desc, '=') + 1; | |
704 char temp[MAX_LINESIZE]; | |
705 mywindow->backgroundcolor[0] = atoi(findnextstring(temp, desc, &base)); | |
706 mywindow->backgroundcolor[1] = atoi(findnextstring(temp, desc, &base)); | |
707 mywindow->backgroundcolor[2] = atoi(findnextstring(temp, desc, &base)); | |
34450 | 708 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [BACKGROUND] window \"%s\" has backgroundcolor (%i,%i,%i)\n", mywindow->name, |
23077 | 709 mywindow->backgroundcolor[0], |
710 mywindow->backgroundcolor[1], | |
711 mywindow->backgroundcolor[2]); | |
712 } | |
713 else if(!strncmp(desc, "end", 3)) | |
714 { | |
715 if(reachedendofwindow) | |
716 { | |
34450 | 717 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [END] of section\n"); |
23077 | 718 } |
719 else | |
720 { | |
35501 | 721 reachedendofwindow = TRUE; |
34450 | 722 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [END] of window \"%s\"\n", mywindow->name); |
23077 | 723 } |
724 } | |
725 else if(!strncmp(desc, "font", 4)) | |
726 { | |
727 int id = 0; | |
728 char temp[MAX_LINESIZE]; | |
36888 | 729 int base = counttonextchar(desc, '=') + 1; |
730 findnextstring(temp, desc, &base); | |
731 id = skin->fontcount; | |
732 (skin->fontcount)++; | |
733 skin->fonts = realloc(skin->fonts, sizeof(font_t *) * skin->fontcount); | |
734 skin->fonts[id]=calloc(1, sizeof(font_t)); | |
735 skin->fonts[id]->name = strdup(temp); | |
36891
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
736 |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
737 // legacy |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
738 skin_legacy("fontid", desc); |
c5ee0fc2ec75
Print an information on deprecated skin config file entries.
ib
parents:
36890
diff
changeset
|
739 |
36887 | 740 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[SKIN] [FONT] name \"%s\"\n", skin->fonts[id]->name); |
23077 | 741 } |
742 else | |
743 skin->addwidget(skin, mywindow, desc); | |
744 } | |
745 | |
746 free(desc); | |
747 free(filename); | |
748 free(tmp); | |
749 fclose(fp); | |
750 loadfonts(skin); | |
751 mp_msg(MSGT_GPLAYER, MSGL_V, "[SKIN LOAD] loaded skin \"%s\"\n", skin->skindir); | |
34450 | 752 dumpwidgets(skin); |
23077 | 753 return skin; |
754 } |