annotate gui/skin/skin.c @ 33061:469a2b80a57a

playlist option can't be used in a config file.
author reimar
date Tue, 29 Mar 2011 19:42:05 +0000
parents 492520edebad
children be0848508395
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
5 * it under the terms of the GNU General Public License as published by
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
14 * You should have received a copy of the GNU General Public License along
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
17 */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
18
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
19 #include <stdio.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
20 #include <string.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
22 #include "skin.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23 #include "font.h"
32893
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32880
diff changeset
24 #include "gui/app.h"
33023
ba432e34dc7e Add message showing function.
ib
parents: 33022
diff changeset
25 #include "gui/interface.h"
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
26 #include "gui/mplayer/widgets.h"
33046
9684ad0e1291 Move files with auxiliary functions to own directory.
ib
parents: 33023
diff changeset
27 #include "gui/util/cut.h"
33048
c6d0adf896ea Move auxiliary string functions into separate file.
ib
parents: 33046
diff changeset
28 #include "gui/util/string.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
30 #include "config.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
31 #include "help_mp.h"
23703
9fb716ab06a3 Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpy
reimar
parents: 23077
diff changeset
32 #include "libavutil/avstring.h"
32944
27a98940e3aa Use FF_ARRAY_ELEMS() rather than a separate constant.
ib
parents: 32937
diff changeset
33 #include "libavutil/common.h"
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
34 #include "mp_msg.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
35
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
36 typedef struct {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
37 const char *name;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
38 int (*func)(char *in);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
39 } _item;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
41 static guiItems *skin;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
43 static int linenumber;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
44 static unsigned char path[512];
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
46 static unsigned char currWinName[32];
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
47 static wItem *currWin;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
48 static int *currWinItemIdx;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
49 static wItem *currWinItems;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
51 static void skin_error(const char *format, ...)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 {
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
53 char p[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
54 va_list ap;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
55
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
56 va_start(ap, format);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
57 vsnprintf(p, sizeof(p), format, ap);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
58 va_end(ap);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
59
33023
ba432e34dc7e Add message showing function.
ib
parents: 33022
diff changeset
60 gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_ERRORMESSAGE, linenumber, p);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
63 static int section_cmd(char *cmd)
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
64 {
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
65 if (!skin) {
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
66 skin_error(MSGTR_SKIN_ERROR_SECTION, cmd);
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
67 return 0;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
68 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
69
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
70 return 1;
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
71 }
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
72
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
73 static int window_cmd(char *cmd)
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
74 {
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
75 if (!currWinName[0]) {
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
76 skin_error(MSGTR_SKIN_ERROR_WINDOW, cmd);
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
77 return 0;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
78 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
80 return 1;
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
81 }
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
82
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
83 static int in_window(char *name)
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
84 {
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
85 if (strcmp(currWinName, name) == 0) {
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
86 skin_error(MSGTR_SKIN_ERROR_IN_WINDOW, name);
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
87 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
88 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
89
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
90 return 0;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
91 }
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
92
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
93 int skinBPRead(char *fname, txSample *bf)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
94 {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
95 int i = bpRead(fname, bf);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
96
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
97 switch (i) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
98 case -1:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
99 skin_error(MSGTR_SKIN_BITMAP_16bit, fname);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
100 break;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
101
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
102 case -2:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
103 skin_error(MSGTR_SKIN_BITMAP_FileNotFound, fname);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
104 break;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
105
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
106 case -5:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
107 skin_error(MSGTR_SKIN_BITMAP_PNGReadError, fname);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
108 break;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
109
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
110 case -8:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
111 skin_error(MSGTR_SKIN_BITMAP_ConversionError, fname);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
112 break;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
113 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
114
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
115 return i;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
116 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
117
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
118 // section=movieplayer
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
119 static int cmd_section(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
120 {
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
121 skin = NULL;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
122
33055
2be86f1db767 Make use of return value of strlower().
ib
parents: 33054
diff changeset
123 if (!strcmp(strlower(in), "movieplayer"))
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
124 skin = &appMPlayer;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
125
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
126 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] section: %s\n", in);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
127
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
128 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
129 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
130
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
131 // end
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
132 static int cmd_end(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
133 {
32958
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
134 #ifdef MP_DEBUG
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
135 char *space, *name;
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
136
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
137 if (currWinName[0]) {
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
138 space = " ";
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
139 name = currWinName;
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
140 } else {
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
141 space = "";
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
142 name = "section";
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
143 }
32958
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
144 #endif
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
145
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
146 (void)in;
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
147
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
148 if (!section_cmd("end"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
149 return 1;
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
150
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
151 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] %send (%s)\n", space, name);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
152
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
153 if (currWinName[0]) {
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
154 currWinName[0] = 0;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
155 currWin = NULL;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
156 currWinItemIdx = NULL;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
157 currWinItems = NULL;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
158 } else
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
159 skin = NULL;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
160
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
161 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
162 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
163
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
164 // window=main|sub|playbar|menu
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
165 static int cmd_window(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
166 {
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
167 if (!section_cmd("window"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
168 return 1;
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
169
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
170 if (currWinName[0]) {
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
171 skin_error(MSGTR_SKIN_ERROR_IN_WINDOW, "window");
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
172 return 1;
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
173 }
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
174
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
175 av_strlcpy(currWinName, strlower(in), sizeof(currWinName));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
176
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
177 if (!strncmp(in, "main", 4)) {
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
178 currWin = &appMPlayer.main;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
179 currWinItemIdx = &appMPlayer.IndexOfMainItems;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
180 currWinItems = appMPlayer.mainItems;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
181 } else if (!strncmp(in, "sub", 3))
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
182 currWin = &appMPlayer.sub;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
183 else if (!strncmp(in, "playbar", 7)) {
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
184 currWin = &appMPlayer.bar;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
185 currWinItemIdx = &appMPlayer.IndexOfBarItems;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
186 currWinItems = appMPlayer.barItems;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
187 } else if (!strncmp(in, "menu", 4)) {
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
188 currWin = &appMPlayer.menuBase;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
189 currWinItemIdx = &appMPlayer.IndexOfMenuItems;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
190 currWinItems = appMPlayer.menuItems;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
191 } else
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
192 skin_error(MSGTR_UNKNOWNWINDOWTYPE);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
193
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
194 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] window: %s\n", currWinName);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
195
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
196 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
197 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
198
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
199 // base=image,x,y[,width,height]
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
200 static int cmd_base(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
201 {
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
202 unsigned char fname[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
203 unsigned char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
204 int x, y;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
205 int sx = 0, sy = 0;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
206
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
207 if (!window_cmd("base"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
208 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
209
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
210 cutItem(in, fname, ',', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
211 x = cutItemToInt(in, ',', 1);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
212 y = cutItemToInt(in, ',', 2);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
213 sx = cutItemToInt(in, ',', 3);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
214 sy = cutItemToInt(in, ',', 4);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
215
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
216 if (!strcmp(currWinName, "main")) {
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
217 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] image: %s %d,%d\n", fname, x, y);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
218
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
219 skin->main.x = x;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
220 skin->main.y = y;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
221 skin->main.type = itBase;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
222
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
223 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
224 av_strlcat(tmp, fname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
225
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
226 if (skinBPRead(tmp, &skin->main.Bitmap) != 0)
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
227 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
228
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
229 skin->main.width = skin->main.Bitmap.Width;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
230 skin->main.height = skin->main.Bitmap.Height;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
231
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
232 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] bitmap: %dx%d\n", skin->main.width, skin->main.height);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
233
27377
d58d06eafe83 Change a bunch of X11-specific preprocessor directives.
diego
parents: 26458
diff changeset
234 #ifdef CONFIG_XSHAPE
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
235 Convert32to1(&skin->main.Bitmap, &skin->main.Mask, 0x00ff00ff);
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
236 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] mask: %lux%lu\n", skin->main.Mask.Width, skin->main.Mask.Height);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
237 #else
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
238 skin->main.Mask.Image = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
239 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
240 }
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
241
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
242 if (!strcmp(currWinName, "sub")) {
32958
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
243 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] image: %s %d,%d\n", fname, x, y);
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
244
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
245 skin->sub.type = itBase;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
246
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
247 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
248 av_strlcat(tmp, fname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
249
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
250 if (skinBPRead(tmp, &skin->sub.Bitmap) != 0)
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
251 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
252
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
253 skin->sub.x = x;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
254 skin->sub.y = y;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
255 skin->sub.width = skin->sub.Bitmap.Width;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
256 skin->sub.height = skin->sub.Bitmap.Height;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
257
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
258 if (sx && sy) {
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
259 skin->sub.width = sx;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
260 skin->sub.height = sy;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
261 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
262
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
263 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] bitmap: %dx%d\n", skin->sub.width, skin->sub.height);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
264 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
265
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
266 if (!strcmp(currWinName, "menu")) {
32958
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
267 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] image: %s\n", fname);
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
268
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
269 skin->menuIsPresent = 1;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
270 skin->menuBase.type = itBase;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
271
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
272 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
273 av_strlcat(tmp, fname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
274
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
275 if (skinBPRead(tmp, &skin->menuBase.Bitmap) != 0)
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
276 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
277
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
278 skin->menuBase.width = skin->menuBase.Bitmap.Width;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
279 skin->menuBase.height = skin->menuBase.Bitmap.Height;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
280
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
281 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] bitmap: %dx%d\n", skin->menuBase.width, skin->menuBase.height);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
282
27377
d58d06eafe83 Change a bunch of X11-specific preprocessor directives.
diego
parents: 26458
diff changeset
283 #ifdef CONFIG_XSHAPE
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
284 Convert32to1(&skin->menuBase.Bitmap, &skin->menuBase.Mask, 0x00ff00ff);
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
285 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] mask: %lux%lu\n", skin->menuBase.Mask.Width, skin->menuBase.Mask.Height);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
286 #else
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
287 skin->menuBase.Mask.Image = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
288 #endif
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
289 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
290
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
291 if (!strcmp(currWinName, "playbar")) {
32958
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
292 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] image: %s %d,%d\n", fname, x, y);
80087dd00035 Fix some debug messages.
ib
parents: 32951
diff changeset
293
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
294 skin->barIsPresent = 1;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
295 skin->bar.x = x;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
296 skin->bar.y = y;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
297 skin->bar.type = itBase;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
298
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
299 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
300 av_strlcat(tmp, fname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
301
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
302 if (skinBPRead(tmp, &skin->bar.Bitmap) != 0)
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
303 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
304
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
305 skin->bar.width = skin->bar.Bitmap.Width;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
306 skin->bar.height = skin->bar.Bitmap.Height;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
307
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
308 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] bitmap: %dx%d\n", skin->bar.width, skin->bar.height);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
309
27377
d58d06eafe83 Change a bunch of X11-specific preprocessor directives.
diego
parents: 26458
diff changeset
310 #ifdef CONFIG_XSHAPE
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
311 Convert32to1(&skin->bar.Bitmap, &skin->bar.Mask, 0x00ff00ff);
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
312 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] mask: %lux%lu\n", skin->bar.Mask.Width, skin->bar.Mask.Height);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
313 #else
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
314 skin->bar.Mask.Image = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
315 #endif
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
316 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27377
diff changeset
317
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
318 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
319 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
320
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
321 // background=R,G,B
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
322 static int cmd_background(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
323 {
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
324 if (!window_cmd("background"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
325 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
326
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
327 if (in_window("main"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
328 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
329 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
330 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
331
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
332 currWin->R = cutItemToInt(in, ',', 0);
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
333 currWin->G = cutItemToInt(in, ',', 1);
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
334 currWin->B = cutItemToInt(in, ',', 2);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
335
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
336 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] background color: #%02x%02x%02x\n", currWin->R, currWin->G, currWin->B);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
337
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
338 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
339 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
340
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
341 // button=image,x,y,width,height,message
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
342 static int cmd_button(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
343 {
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
344 unsigned char fname[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
345 unsigned char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
346 int x, y, sx, sy;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
347 char msg[32];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
348
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
349 if (!window_cmd("button"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
350 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
351
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
352 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
353 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
354 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
355 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
356
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
357 cutItem(in, fname, ',', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
358 x = cutItemToInt(in, ',', 1);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
359 y = cutItemToInt(in, ',', 2);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
360 sx = cutItemToInt(in, ',', 3);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
361 sy = cutItemToInt(in, ',', 4);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
362 cutItem(in, msg, ',', 5);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
363
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
364 (*currWinItemIdx)++;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
365 currWinItems[*currWinItemIdx].type = itButton;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
366 currWinItems[*currWinItemIdx].x = x;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
367 currWinItems[*currWinItemIdx].y = y;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
368 currWinItems[*currWinItemIdx].width = sx;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
369 currWinItems[*currWinItemIdx].height = sy;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
370
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
371 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] button image: %s %d,%d\n", fname, x, y);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
372
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
373 if ((currWinItems[*currWinItemIdx].message = appFindMessage(msg)) == -1) {
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
374 skin_error(MSGTR_SKIN_BITMAP_UnknownMessage, msg);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
375 return 0;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
376 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
377
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
378 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] message: %s (#%d)\n", msg, currWinItems[*currWinItemIdx].message);
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
379 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] size: %dx%d\n", sx, sy);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
380
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
381 currWinItems[*currWinItemIdx].pressed = btnReleased;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
382
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
383 if (currWinItems[*currWinItemIdx].message == evPauseSwitchToPlay)
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
384 currWinItems[*currWinItemIdx].pressed = btnDisabled;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
385
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
386 currWinItems[*currWinItemIdx].tmp = 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
387
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
388 currWinItems[*currWinItemIdx].Bitmap.Image = NULL;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
389
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
390 if (strcmp(fname, "NULL") != 0) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
391 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
392 av_strlcat(tmp, fname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
393
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
394 if (skinBPRead(tmp, &currWinItems[*currWinItemIdx].Bitmap) != 0)
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
395 return 1;
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
396
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
397 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (bitmap: %lux%lu)\n", currWinItems[*currWinItemIdx].Bitmap.Width, currWinItems[*currWinItemIdx].Bitmap.Height);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
398 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
399
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
400 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
401 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
402
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
403 // selected=image
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
404 static int cmd_selected(char *in)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
405 {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
406 unsigned char fname[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
407 unsigned char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
408
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
409 if (!window_cmd("selected"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
410 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
411
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
412 if (in_window("main"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
413 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
414 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
415 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
416 if (in_window("playbar"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
417 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
418
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
419 cutItem(in, fname, ',', 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
420
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
421 skin->menuSelected.type = itBase;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
422
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
423 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
424 av_strlcat(tmp, fname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
425
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
426 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] image selected: %s\n", fname);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
427
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
428 if (skinBPRead(tmp, &skin->menuSelected.Bitmap) != 0)
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
429 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
430
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
431 skin->menuSelected.width = skin->menuSelected.Bitmap.Width;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
432 skin->menuSelected.height = skin->menuSelected.Bitmap.Height;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
433
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
434 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] bitmap: %dx%d\n", skin->menuSelected.width, skin->menuSelected.height);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
435
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
436 return 0;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
437 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27377
diff changeset
438
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
439 // menu=x,y,width,height,message
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
440 static int cmd_menu(char *in)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
441 {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
442 int x, y, sx, sy, message;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
443 unsigned char tmp[64];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
444
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
445 if (!window_cmd("menu"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
446 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
447
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
448 if (in_window("main"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
449 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
450 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
451 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
452 if (in_window("playbar"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
453 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
454
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
455 x = cutItemToInt(in, ',', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
456 y = cutItemToInt(in, ',', 1);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
457 sx = cutItemToInt(in, ',', 2);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
458 sy = cutItemToInt(in, ',', 3);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
459 cutItem(in, tmp, ',', 4);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
460
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
461 message = appFindMessage(tmp);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
462
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
463 skin->IndexOfMenuItems++;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
464 skin->menuItems[skin->IndexOfMenuItems].x = x;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
465 skin->menuItems[skin->IndexOfMenuItems].y = y;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
466 skin->menuItems[skin->IndexOfMenuItems].width = sx;
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
467 skin->menuItems[skin->IndexOfMenuItems].height = sy;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
468
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
469 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] item #%d: %d,%d %dx%d\n", skin->IndexOfMenuItems, x, y, sx, sy);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
470
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
471 if ((skin->menuItems[skin->IndexOfMenuItems].message = message) == -1)
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
472 skin_error(MSGTR_SKIN_BITMAP_UnknownMessage, tmp);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
473
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
474 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] message: %s (#%d)\n", tmp, skin->menuItems[skin->IndexOfMenuItems].message);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
475
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
476 skin->menuItems[skin->IndexOfMenuItems].Bitmap.Image = NULL;
33053
f64d41dac10b Cosmetic: Separate return statement with newline.
ib
parents: 33052
diff changeset
477
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
478 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
479 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
480
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
481 // hpotmeter=button,bwidth,bheight,phases,numphases,default,x,y,width,height,message
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
482 static int cmd_hpotmeter(char *in)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
483 {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
484 int x, y, pwidth, pheight, ph, sx, sy, message, d;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
485 unsigned char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
486 unsigned char pfname[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
487 unsigned char phfname[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
488 wItem *item;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
489
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
490 if (!window_cmd("h/v potmeter"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
491 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
492
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
493 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
494 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
495 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
496 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
497
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
498 cutItem(in, pfname, ',', 0);
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
499 pwidth = cutItemToInt(in, ',', 1);
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
500 pheight = cutItemToInt(in, ',', 2);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
501 cutItem(in, phfname, ',', 3);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
502 ph = cutItemToInt(in, ',', 4);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
503 d = cutItemToInt(in, ',', 5);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
504 x = cutItemToInt(in, ',', 6);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
505 y = cutItemToInt(in, ',', 7);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
506 sx = cutItemToInt(in, ',', 8);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
507 sy = cutItemToInt(in, ',', 9);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
508 cutItem(in, tmp, ',', 10);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
509
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
510 message = appFindMessage(tmp);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
511
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
512 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] h/v potmeter image: %s %d,%d %dx%d\n", phfname, x, y, sx, sy);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
513 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] button image: %s %dx%d\n", pfname, pwidth, pheight);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
514 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] numphases: %d, default: %d%%\n", ph, d);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
515 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] message: %s (#%d)\n", tmp, message);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
516
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
517 (*currWinItemIdx)++;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
518 item = &currWinItems[*currWinItemIdx];
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
519 item->type = itHPotmeter;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
520 item->x = x;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
521 item->y = y;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
522 item->width = sx;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
523 item->height = sy;
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
524 item->numphases = ph;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
525 item->pwidth = pwidth;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
526 item->pheight = pheight;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
527 item->message = message;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
528 item->value = (float)d;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
529 item->pressed = btnReleased;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
530 item->Bitmap.Image = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
531
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
532 if (strcmp(phfname, "NULL") != 0) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
533 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
534 av_strlcat(tmp, phfname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
535
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
536 if (skinBPRead(tmp, &item->Bitmap) != 0)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
537 return 1;
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
538
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
539 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (potmeter bitmap: %lux%lu)\n", item->Bitmap.Width, item->Bitmap.Height);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
540 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
541
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
542 item->Mask.Image = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
543
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
544 if (strcmp(pfname, "NULL") != 0) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
545 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
546 av_strlcat(tmp, pfname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
547
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
548 if (skinBPRead(tmp, &item->Mask) != 0)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
549 return 1;
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
550
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
551 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (button bitmap: %lux%lu)\n", item->Mask.Width, item->Mask.Height);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
552 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
553
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
554 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
555 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
556
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
557 // vpotmeter=button,bwidth,bheight,phases,numphases,default,x,y,width,height,message
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
558 static int cmd_vpotmeter(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
559 {
33056
1c2070f0abca Prevent a segmentation fault.
ib
parents: 33055
diff changeset
560 int r;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
561 wItem *item;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
562
33056
1c2070f0abca Prevent a segmentation fault.
ib
parents: 33055
diff changeset
563 r = cmd_hpotmeter(in);
1c2070f0abca Prevent a segmentation fault.
ib
parents: 33055
diff changeset
564
1c2070f0abca Prevent a segmentation fault.
ib
parents: 33055
diff changeset
565 if (r == 0) {
33057
0d6b33bc311e Cosmetic: Adjust indent.
ib
parents: 33056
diff changeset
566 item = &currWinItems[*currWinItemIdx];
0d6b33bc311e Cosmetic: Adjust indent.
ib
parents: 33056
diff changeset
567 item->type = itVPotmeter;
33056
1c2070f0abca Prevent a segmentation fault.
ib
parents: 33055
diff changeset
568 }
33053
f64d41dac10b Cosmetic: Separate return statement with newline.
ib
parents: 33052
diff changeset
569
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
570 return r;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
571 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
572
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
573 // potmeter=phases,numphases,default,x,y,width,height,message
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
574 static int cmd_potmeter(char *in)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
575 {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
576 int x, y, ph, sx, sy, message, d;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
577 unsigned char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
578 unsigned char phfname[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
579 wItem *item;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
580
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
581 if (!window_cmd("potmeter"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
582 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
583
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
584 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
585 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
586 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
587 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
588
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
589 cutItem(in, phfname, ',', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
590 ph = cutItemToInt(in, ',', 1);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
591 d = cutItemToInt(in, ',', 2);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
592 x = cutItemToInt(in, ',', 3);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
593 y = cutItemToInt(in, ',', 4);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
594 sx = cutItemToInt(in, ',', 5);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
595 sy = cutItemToInt(in, ',', 6);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
596 cutItem(in, tmp, ',', 7);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
597
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
598 message = appFindMessage(tmp);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
599
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
600 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] potmeter image: %s %d,%d %dx%d\n", phfname, x, y, sx, sy);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
601 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] numphases: %d, default: %d%%\n", ph, d);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
602 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] message: %s (#%d)\n", tmp, message);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
603
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
604 (*currWinItemIdx)++;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
605 item = &currWinItems[*currWinItemIdx];
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
606 item->type = itPotmeter;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
607 item->x = x;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
608 item->y = y;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
609 item->width = sx;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
610 item->height = sy;
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
611 item->numphases = ph;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32910
diff changeset
612 item->message = message;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
613 item->value = (float)d;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
614 item->Bitmap.Image = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
615
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
616 if (strcmp(phfname, "NULL") != 0) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
617 av_strlcpy(tmp, path, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
618 av_strlcat(tmp, phfname, sizeof(tmp));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
619
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
620 if (skinBPRead(tmp, &item->Bitmap) != 0)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
621 return 1;
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
622
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
623 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (bitmap: %lux%lu)\n", item->Bitmap.Width, item->Bitmap.Height);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
624 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
625
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
626 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
627 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
628
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
629 // font=fontfile
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
630 static int cmd_font(char *in)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
631 {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
632 char name[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
633 wItem *item;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
634
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
635 if (!window_cmd("font"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
636 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
637
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
638 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
639 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
640 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
641 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
642
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
643 cutItem(in, name, ',', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
644
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
645 (*currWinItemIdx)++;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
646 item = &currWinItems[*currWinItemIdx];
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
647 item->type = itFont;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
648 item->fontid = fntRead(path, name);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
649
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
650 switch (item->fontid) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
651 case -1:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
652 skin_error(MSGTR_SKIN_FONT_NotEnoughtMemory);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
653 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
654
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
655 case -2:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
656 skin_error(MSGTR_SKIN_FONT_TooManyFontsDeclared);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
657 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
658
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
659 case -3:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
660 skin_error(MSGTR_SKIN_FONT_FontFileNotFound);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
661 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
662
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
663 case -4:
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
664 skin_error(MSGTR_SKIN_FONT_FontImageNotFound);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
665 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
666 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
667
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
668 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] font: %s (#%d)\n", name, fntFindID(name));
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
669
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
670 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
671 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
672
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
673 // slabel=x,y,fontfile,"text"
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
674 static int cmd_slabel(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
675 {
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
676 char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
677 char sid[64];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
678 int x, y, id;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
679 wItem *item;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
680
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
681 if (!window_cmd("slabel"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
682 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
683
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
684 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
685 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
686 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
687 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
688
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
689 x = cutItemToInt(in, ',', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
690 y = cutItemToInt(in, ',', 1);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
691 cutItem(in, sid, ',', 2);
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
692 cutItem(in, tmp, ',', 3);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
693 cutItem(tmp, tmp, '"', 1);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
694
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
695 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] slabel: \"%s\"\n", tmp);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
696 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] pos: %d,%d\n", x, y);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
697
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
698 id = fntFindID(sid);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
699
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
700 if (id < 0) {
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
701 skin_error(MSGTR_SKIN_FONT_NonExistentFontID, sid);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
702 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
703 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
704
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
705 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] font: %s (#%d)\n", sid, id);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
706
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
707 (*currWinItemIdx)++;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
708 item = &currWinItems[*currWinItemIdx];
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
709 item->type = itSLabel;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
710 item->fontid = id;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
711 item->x = x;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
712 item->y = y;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
713 item->width = -1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
714 item->height = -1;
32979
4905f5a87357 Replace some awkward and unnecessary usages of strlen().
ib
parents: 32958
diff changeset
715 item->label = strdup(tmp);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
716
32979
4905f5a87357 Replace some awkward and unnecessary usages of strlen().
ib
parents: 32958
diff changeset
717 if (!item->label) {
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
718 skin_error(MSGTR_SKIN_FONT_NotEnoughtMemory);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
719 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
720 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
721
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
722 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
723 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
724
32910
f34e21c5dc2f Improve documentation on dlabel.
ib
parents: 32893
diff changeset
725 // dlabel=x,y,width,align,fontfile,"text"
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
726 static int cmd_dlabel(char *in)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
727 {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
728 char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
729 char sid[64];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
730 int x, y, sx, id, a;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
731 wItem *item;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
732
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
733 if (!window_cmd("dlabel"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
734 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
735
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
736 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
737 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
738 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
739 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
740
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
741 x = cutItemToInt(in, ',', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
742 y = cutItemToInt(in, ',', 1);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
743 sx = cutItemToInt(in, ',', 2);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
744 a = cutItemToInt(in, ',', 3);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
745 cutItem(in, sid, ',', 4);
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
746 cutItem(in, tmp, ',', 5);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
747 cutItem(tmp, tmp, '"', 1);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
748
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
749 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] dlabel: \"%s\"\n", tmp);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
750 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] pos: %d,%d\n", x, y);
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
751 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] width: %d, align: %d\n", sx, a);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
752
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
753 id = fntFindID(sid);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
754
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
755 if (id < 0) {
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
756 skin_error(MSGTR_SKIN_FONT_NonExistentFontID, sid);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
757 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
758 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
759
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
760 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] font: %s (#%d)\n", sid, id);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
761
32980
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
762 (*currWinItemIdx)++;
2bfd000bb789 Cosmetic: Rename pointers handling current window and items.
ib
parents: 32979
diff changeset
763 item = &currWinItems[*currWinItemIdx];
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
764 item->type = itDLabel;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
765 item->fontid = id;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
766 item->align = a;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
767 item->x = x;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
768 item->y = y;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
769 item->width = sx;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
770 item->height = -1;
32979
4905f5a87357 Replace some awkward and unnecessary usages of strlen().
ib
parents: 32958
diff changeset
771 item->label = strdup(tmp);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
772
32979
4905f5a87357 Replace some awkward and unnecessary usages of strlen().
ib
parents: 32958
diff changeset
773 if (!item->label) {
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
774 skin_error(MSGTR_SKIN_FONT_NotEnoughtMemory);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
775 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
776 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
777
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
778 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
779 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
780
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
781 // decoration=enable|disable
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
782 static int cmd_decoration(char *in)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
783 {
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
784 char tmp[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
785
33054
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
786 if (!window_cmd("decoration"))
ed66afc0b06c Replace macros to check whether a command is allowed by functions.
ib
parents: 33053
diff changeset
787 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
788
33058
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
789 if (in_window("sub"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
790 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
791 if (in_window("playbar"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
792 return 1;
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
793 if (in_window("menu"))
b8374f9dc87b Replace macro by function.
ib
parents: 33057
diff changeset
794 return 1;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
795
33055
2be86f1db767 Make use of return value of strlower().
ib
parents: 33054
diff changeset
796 cutItem(strlower(in), tmp, ',', 0);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
797
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
798 if (strcmp(tmp, "enable") != 0 && strcmp(tmp, "disable") != 0) {
33022
9abc0dbd6314 Cosmetic: Rename ERRORMESSAGE() skin_error().
ib
parents: 32980
diff changeset
799 skin_error(MSGTR_SKIN_UnknownParameter, tmp);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
800 return 1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
801 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
802
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
803 if (strcmp(tmp, "enable") != 0)
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
804 skin->mainDecoration = 0;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
805 else
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
806 skin->mainDecoration = 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
807
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
808 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] decoration: %s\n", tmp);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
809
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
810 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
811 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
812
32878
afa6f80b0867 Limit scope of internally used skinItem array.
ib
parents: 32877
diff changeset
813 static _item skinItem[] = {
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
814 { "section", cmd_section },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
815 { "end", cmd_end },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
816 { "window", cmd_window },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
817 { "base", cmd_base },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
818 { "button", cmd_button },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
819 { "selected", cmd_selected },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
820 { "background", cmd_background },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
821 { "vpotmeter", cmd_vpotmeter },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
822 { "hpotmeter", cmd_hpotmeter },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
823 { "potmeter", cmd_potmeter },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
824 { "font", cmd_font },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
825 { "slabel", cmd_slabel },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
826 { "dlabel", cmd_dlabel },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
827 { "decoration", cmd_decoration },
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
828 { "menu", cmd_menu }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
829 };
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
830
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
831 static char *setname(char *item1, char *item2)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
832 {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
833 static char fn[512];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
834
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
835 av_strlcpy(fn, item1, sizeof(fn));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
836 av_strlcat(fn, "/", sizeof(fn));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
837 av_strlcat(fn, item2, sizeof(fn));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
838 av_strlcpy(path, fn, sizeof(path));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
839 av_strlcat(path, "/", sizeof(path));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
840 av_strlcat(fn, "/skin", sizeof(fn));
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
841
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
842 return fn;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
843 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
844
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
845 int skinRead(char *dname)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
846 {
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
847 char *fn;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
848 FILE *skinFile;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
849 unsigned char tmp[256];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
850 unsigned char *ptmp;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
851 unsigned char command[32];
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
852 unsigned char param[256];
32944
27a98940e3aa Use FF_ARRAY_ELEMS() rather than a separate constant.
ib
parents: 32937
diff changeset
853 unsigned int i;
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
854
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
855 fn = setname(skinDirInHome, dname);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
856
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
857 if ((skinFile = fopen(fn, "rt")) == NULL) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
858 fn = setname(skinMPlayerDir, dname);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
859
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
860 if ((skinFile = fopen(fn, "rt")) == NULL) {
32877
a095a4ed8ad3 Change message levels to 'error'.
ib
parents: 32876
diff changeset
861 mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SkinFileNotFound, fn);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
862 return -1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
863 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
864 }
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
865
32951
c11e65fcb818 Clean up debug messages.
ib
parents: 32950
diff changeset
866 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin] configuration file: %s\n", fn);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
867
32932
e95ec1b2feea Cosmetic: Rename appInitStruct() to appFreeStruct().
ib
parents: 32931
diff changeset
868 appFreeStruct();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
869
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
870 linenumber = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
871
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
872 while (fgets(tmp, sizeof(tmp), skinFile)) {
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
873 linenumber++;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
874
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
875 tmp[strcspn(tmp, "\n\r")] = 0; // remove any kind of newline, if any
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
876 strswap(tmp, '\t', ' ');
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
877 trim(tmp);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
878 ptmp = strchr(tmp, ';');
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
879
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
880 if (ptmp)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
881 *ptmp = 0;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
882
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
883 if (!*tmp)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
884 continue;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
885
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
886 cutItem(tmp, command, '=', 0);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
887 cutItem(tmp, param, '=', 1);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
888 strlower(command);
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
889
32944
27a98940e3aa Use FF_ARRAY_ELEMS() rather than a separate constant.
ib
parents: 32937
diff changeset
890 for (i = 0; i < FF_ARRAY_ELEMS(skinItem); i++)
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
891 if (!strcmp(command, skinItem[i].name))
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
892 if (skinItem[i].func(param) != 0)
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
893 return -2;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
894 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
895
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
896 if (linenumber == 0) {
32877
a095a4ed8ad3 Change message levels to 'error'.
ib
parents: 32876
diff changeset
897 mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SkinFileNotReadable, fn);
32873
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
898 return -1;
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
899 }
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
900
cf385b1901cb Cosmetic: Format to MPlayer coding style.
ib
parents: 32856
diff changeset
901 return 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
902 }