annotate Gui/skin/skin.c @ 5429:e9e2dc1306b1

BITMAPINFOHEADER fixed to be accepted by win32 decoders (divx,divxds)
author arpi
date Sun, 31 Mar 2002 20:17:27 +0000
parents 3473ca9ef158
children 3e7f39c4110c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
1
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
2 #include <stdio.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3 #include <stdlib.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
4 #include <string.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
5
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
6 #include "cut.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
7 #include "font.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
8 #include "../app.h"
3586
a0009a534428 itt a skin nem van hibauzenet igy.
pontscho
parents: 3479
diff changeset
9
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
10 #include "../../config.h"
3586
a0009a534428 itt a skin nem van hibauzenet igy.
pontscho
parents: 3479
diff changeset
11 #include "../../mp_msg.h"
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
12 #include "../../help_mp.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
13
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
14 listItems * skinAppMPlayer = &appMPlayer;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
15
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16 int linenumber;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18 unsigned char path[512],fn[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
19
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
20 listItems * defList = NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
21 unsigned char winList[32] = "";
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
22
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
23 #include <stdarg.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
24
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
25 void ERRORMESSAGE( const char * format, ... )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
26 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
27 char p[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
28 va_list ap;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
29 va_start( ap,format );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
30 vsnprintf( p,512,format,ap );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
31 va_end( ap );
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
32 // message( False,"[skin] error in skin config file on line %d: %s",linenumber,p );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
33 // message( False,MSGTR_SKIN_ERRORMESSAGE,linenumber,p );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
34 mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_SKIN_ERRORMESSAGE,linenumber,p );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
35 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
36
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
37 #define CHECKDEFLIST( str ) \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
38 { \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
39 if ( defList == NULL ) \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
40 { \
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
41 mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_SKIN_WARNING1,linenumber,str ); \
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
42 return 1; \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
43 } \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
44 }
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
45
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
46 #define CHECKWINLIST( str ) \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
47 { \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
48 if ( !strlen( winList ) ) \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
49 { \
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
50 mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_SKIN_WARNING2,linenumber,str ); \
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
51 return 1; \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
52 } \
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
53 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
54
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
55 char * strlower( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
56 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
57 int i;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
58 for( i=0;i<(int)strlen( in );i++ ) in[i]=( in[i] >= 'A' ? ( in[i] <= 'Z' ? in[i]+='A' : in[i] ) : in[i] );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
59 return in;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
60 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
61
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
62 int skinBPRead( char * fname, txSample * bf )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
63 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
64 int i=bpRead( fname,bf );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
65 switch ( i )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
66 {
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
67 case -1: ERRORMESSAGE( MSGTR_SKIN_BITMAP_16bit,fname ); break;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
68 case -2: ERRORMESSAGE( MSGTR_SKIN_BITMAP_FileNotFound,fname ); break;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
69 case -3: ERRORMESSAGE( MSGTR_SKIN_BITMAP_BMPReadError,fname ); break;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
70 case -4: ERRORMESSAGE( MSGTR_SKIN_BITMAP_TGAReadError,fname ); break;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
71 case -5: ERRORMESSAGE( MSGTR_SKIN_BITMAP_PNGReadError,fname ); break;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
72 case -6: ERRORMESSAGE( MSGTR_SKIN_BITMAP_RLENotSupported,fname ); break;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
73 case -7: ERRORMESSAGE( MSGTR_SKIN_BITMAP_UnknownFileType,fname ); break;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
74 case -8: ERRORMESSAGE( MSGTR_SKIN_BITMAP_ConvertError,fname ); break;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
75 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
76 return i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
77 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
78
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
79 int __section( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
80 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
81 strlower( in );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
82 defList=NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
83 if ( !strcmp( in,"movieplayer" ) ) defList=skinAppMPlayer;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
84 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] sectionname: %s\n",in );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
85 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
86 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
87
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
88 int __end( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
89 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
90 if ( strlen( winList ) ) winList[0]=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
91 else defList=NULL;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
92 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] end section\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
93 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
94 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
95
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
96 int __window( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
97 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
98 CHECKDEFLIST( "window" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
99
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
100 strlower( in );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
101 strcpy( winList,in );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
102 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] window: %s\n",winList );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
103 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
104 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
105
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
106 int __base( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
107 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
108 unsigned char fname[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
109 unsigned char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
110 int x,y;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
111 int sx=0,sy=0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
112
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
113 CHECKDEFLIST( "base" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
114 CHECKWINLIST( "base" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
115
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
116 cutItem( in,fname,',',0 );
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
117 x=cutItemToInt( in,',',1 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
118 y=cutItemToInt( in,',',2 );
3080
182163807172 bug fixs
pontscho
parents: 2781
diff changeset
119 sx=cutItemToInt( in,',',3 );
182163807172 bug fixs
pontscho
parents: 2781
diff changeset
120 sy=cutItemToInt( in,',',4 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
121 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] base: %s x: %d y: %d ( %dx%d )\n",fname,x,y,sx,sy );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
122 if ( !strcmp( winList,"main" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
123 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
124 defList->main.x=x;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
125 defList->main.y=y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
126 defList->main.type=itBase;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
127 strcpy( tmp,path ); strcat( tmp,fname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
128 if ( skinBPRead( tmp,&defList->main.Bitmap ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
129 defList->main.width=defList->main.Bitmap.Width;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
130 defList->main.height=defList->main.Bitmap.Height;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
131 #ifdef HAVE_XSHAPE
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
132 Convert32to1( &defList->main.Bitmap,&defList->main.Mask,0x00ff00ff );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
133 #if 0
2717
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
134 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
135 if ( defList->main.Mask.Image != NULL )
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
136 {
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
137 txSample d;
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
138 Convert1to32( &defList->main.Mask,&d );
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
139 tgaWriteTexture( "debug.tga",&d );
5fa8c079ee3c fix small xshape bug
pontscho
parents: 2025
diff changeset
140 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
141 }
2781
bd851a5afcb3 uuupsz ... 1l cola ;)
pontscho
parents: 2717
diff changeset
142 #endif
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
143 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] mask: %dx%d\n",defList->main.Mask.Width,defList->main.Mask.Height );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
144 #else
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
145 defList->main.Mask.Image=NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
146 #endif
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
147 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] width: %d height: %d\n",defList->main.width,defList->main.height );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
148 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
149 if ( !strcmp( winList,"sub" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
150 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
151 defList->sub.type=itBase;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
152 strcpy( tmp,path ); strcat( tmp,fname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
153 if ( skinBPRead( tmp,&defList->sub.Bitmap ) ) return 1;
2025
0653e90b3118 some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents: 1884
diff changeset
154 defList->sub.x=x;
0653e90b3118 some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents: 1884
diff changeset
155 defList->sub.y=y;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
156 defList->sub.width=defList->sub.Bitmap.Width;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
157 defList->sub.height=defList->sub.Bitmap.Height;
3080
182163807172 bug fixs
pontscho
parents: 2781
diff changeset
158 if ( sx && sy )
182163807172 bug fixs
pontscho
parents: 2781
diff changeset
159 {
182163807172 bug fixs
pontscho
parents: 2781
diff changeset
160 defList->sub.width=sx;
182163807172 bug fixs
pontscho
parents: 2781
diff changeset
161 defList->sub.height=sy;
182163807172 bug fixs
pontscho
parents: 2781
diff changeset
162 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
163 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] %d,%d %dx%d\n",defList->sub.x,defList->sub.y,defList->sub.width,defList->sub.height );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
164 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
165 /*
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
166 if ( !strcmp( winList,"eq" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
167 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
168 defList->eq.x=x;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
169 defList->eq.y=y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
170 defList->eq.type=itBase;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
171 strcpy( tmp,path ); strcat( tmp,fname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
172 if ( skinBPRead( tmp,&defList->eq.Bitmap ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
173 defList->eq.width=defList->eq.Bitmap.Width;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
174 defList->eq.height=defList->eq.Bitmap.Height;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
175 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] width: %d height: %d\n",defList->eq.width,defList->eq.height );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
176 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
177 */
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
178 if ( !strcmp( winList,"menu" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
179 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
180 defList->menuBase.type=itBase;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
181 strcpy( tmp,path ); strcat( tmp,fname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
182 if ( skinBPRead( tmp,&defList->menuBase.Bitmap ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
183 defList->menuBase.width=defList->menuBase.Bitmap.Width;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
184 defList->menuBase.height=defList->menuBase.Bitmap.Height;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
185 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] width: %d height: %d\n",defList->menuBase.width,defList->menuBase.height );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
186 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
187 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
188 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
189
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
190 int __background( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
191 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
192 CHECKDEFLIST( "background" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
193 CHECKWINLIST( "background" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
194
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
195 if ( !strcmp( winList,"sub" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
196 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
197 defList->subR=cutItemToInt( in,',',0 );
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
198 defList->subG=cutItemToInt( in,',',1 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
199 defList->subB=cutItemToInt( in,',',2 );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
200 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] subwindow background color is #%x%x%x.\n",defList->subR,defList->subG,defList->subB );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
201 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
202 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
203 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
204
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
205 int __button( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
206 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
207 unsigned char fname[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
208 unsigned char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
209 int x,y,sx,sy;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
210 char msg[32];
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
211
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
212 CHECKDEFLIST( "button" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
213 CHECKWINLIST( "button" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
214
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
215 cutItem( in,fname,',',0 );
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
216 x=cutItemToInt( in,',',1 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
217 y=cutItemToInt( in,',',2 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
218 sx=cutItemToInt( in,',',3 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
219 sy=cutItemToInt( in,',',4 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
220 cutItem( in,msg,',',5 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
221
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
222 defList->NumberOfItems++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
223 defList->Items[ defList->NumberOfItems ].type=itButton;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
224 defList->Items[ defList->NumberOfItems ].x=x;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
225 defList->Items[ defList->NumberOfItems ].y=y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
226 defList->Items[ defList->NumberOfItems ].width=sx;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
227 defList->Items[ defList->NumberOfItems ].height=sy;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
228 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] button: fname: %s\n",fname );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
229 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] x: %d y: %d sx: %d sy: %d\n",x,y,sx,sy );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
230
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
231 if ( ( defList->Items[ defList->NumberOfItems ].msg=appFindMessage( msg ) ) == -1 )
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
232 { ERRORMESSAGE( MSGTR_SKIN_BITMAP_UnknownMessage,msg ); return 1; }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
233 defList->Items[ defList->NumberOfItems ].pressed=btnReleased;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
234 if ( defList->Items[ defList->NumberOfItems ].msg == evPauseSwitchToPlay ) defList->Items[ defList->NumberOfItems ].pressed=btnDisabled;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
235 defList->Items[ defList->NumberOfItems ].tmp=1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
236
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
237 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] message: %d\n",defList->Items[ defList->NumberOfItems ].msg );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
238
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
239 defList->Items[ defList->NumberOfItems ].Bitmap.Image=NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
240 if ( strcmp( fname,"NULL" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
241 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
242 strcpy( tmp,path ); strcat( tmp,fname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
243 if ( skinBPRead( tmp,&defList->Items[ defList->NumberOfItems ].Bitmap ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
244 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
245 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
246 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
247
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
248 int __selected( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
249 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
250 unsigned char fname[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
251 unsigned char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
252
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
253 CHECKDEFLIST( "selected" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
254 CHECKWINLIST( "selected" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
255
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
256 cutItem( in,fname,',',0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
257 defList->menuSelected.type=itBase;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
258 strcpy( tmp,path ); strcat( tmp,fname );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
259 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] selected: %s\n",fname );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
260 if ( skinBPRead( tmp,&defList->menuSelected.Bitmap ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
261 defList->menuSelected.width=defList->menuSelected.Bitmap.Width;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
262 defList->menuSelected.height=defList->menuSelected.Bitmap.Height;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
263 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] width: %d height: %d\n",defList->menuSelected.width,defList->menuSelected.height );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
264 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
265 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
266
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
267 int __menu( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
268 { // menu = number,x,y,sx,sy,msg
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
269 int x,y,sx,sy,msg;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
270 unsigned char tmp[64];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
271
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
272 CHECKDEFLIST( "menu" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
273 CHECKWINLIST( "menu" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
274
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
275 x=cutItemToInt( in,',',0 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
276 y=cutItemToInt( in,',',1 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
277 sx=cutItemToInt( in,',',2 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
278 sy=cutItemToInt( in,',',3 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
279 cutItem( in,tmp,',',4 ); msg=appFindMessage( tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
280
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
281 defList->NumberOfMenuItems++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
282 defList->MenuItems[ defList->NumberOfMenuItems ].x=x;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
283 defList->MenuItems[ defList->NumberOfMenuItems ].y=y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
284 defList->MenuItems[ defList->NumberOfMenuItems ].width=sx;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
285 defList->MenuItems[ defList->NumberOfMenuItems ].height=sy;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
286
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
287 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] menuitem: %d\n",defList->NumberOfMenuItems );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
288 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] x: %d y: %d sx: %d sy: %d\n",x,y,sx,sy );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
289
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
290 if ( ( defList->MenuItems[ defList->NumberOfMenuItems ].msg=msg ) == -1 )
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
291 ERRORMESSAGE( MSGTR_SKIN_BITMAP_UnknownMessage,tmp );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
292
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
293 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] message: %d\n",defList->Items[ defList->NumberOfItems ].msg );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
294
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
295 defList->MenuItems[ defList->NumberOfMenuItems ].Bitmap.Image=NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
296 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
297 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
298
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
299 int __hpotmeter( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
300 { // hpotmeter=buttonbitmaps,sx,sy,phasebitmaps,phases,default value,x,y,sx,sy,msg
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
301 int x,y,psx,psy,ph,sx,sy,msg,d;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
302 unsigned char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
303 unsigned char pfname[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
304 unsigned char phfname[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
305 wItem * item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
306
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
307 CHECKDEFLIST( "hpotmeter" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
308 CHECKWINLIST( "hpotmeter" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
309
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
310 cutItem( in,pfname,',',0 );
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
311 psx=cutItemToInt( in,',',1 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
312 psy=cutItemToInt( in,',',2 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
313 cutItem( in,phfname,',',3 );
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
314 ph=cutItemToInt( in,',',4 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
315 d=cutItemToInt( in,',',5 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
316 x=cutItemToInt( in,',',6 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
317 y=cutItemToInt( in,',',7 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
318 sx=cutItemToInt( in,',',8 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
319 sy=cutItemToInt( in,',',9 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
320 cutItem( in,tmp,',',10 ); msg=appFindMessage( tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
321
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
322 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] hpotmeter: pointer filename: '%s'\n",pfname );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
323 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] pointer size is %dx%d\n",psx,psy );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
324 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] phasebitmaps filename: '%s'\n",phfname );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
325 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] position: %d,%d %dx%d\n",x,y,sx,sy );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
326 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] default value: %d\n",d );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
327 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] message: %d\n",msg );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
328
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
329 defList->NumberOfItems++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
330 item=&defList->Items[ defList->NumberOfItems ];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
331 item->type=itHPotmeter;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
332 item->x=x; item->y=y; item->width=sx; item->height=sy;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
333 item->phases=ph;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
334 item->psx=psx; item->psy=psy;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
335 item->msg=msg;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
336 item->value=(float)d;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
337 item->pressed=btnReleased;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
338
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
339 item->Bitmap.Image=NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
340 if ( strcmp( phfname,"NULL" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
341 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
342 strcpy( tmp,path ); strcat( tmp,phfname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
343 if ( skinBPRead( tmp,&item->Bitmap ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
344 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
345
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
346 item->Mask.Image=NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
347 if ( strcmp( pfname,"NULL" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
348 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
349 strcpy( tmp,path ); strcat( tmp,pfname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
350 if ( skinBPRead( tmp,&item->Mask ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
351 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
352
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
353 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
354 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
355
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
356 int __potmeter( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
357 { // potmeter=phasebitmaps,phases,default value,x,y,sx,sy,msg
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
358 int x,y,ph,sx,sy,msg,d;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
359 unsigned char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
360 unsigned char phfname[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
361 wItem * item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
362
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
363 CHECKDEFLIST( "potmeter" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
364 CHECKWINLIST( "potmeter" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
365
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
366 cutItem( in,phfname,',',0 );
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
367 ph=cutItemToInt( in,',',1 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
368 d=cutItemToInt( in,',',2 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
369 x=cutItemToInt( in,',',3 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
370 y=cutItemToInt( in,',',4 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
371 sx=cutItemToInt( in,',',5 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
372 sy=cutItemToInt( in,',',6 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
373 cutItem( in,tmp,',',7 ); msg=appFindMessage( tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
374
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
375 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] potmeter: phases filename: '%s'\n",phfname );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
376 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] position: %d,%d %dx%d\n",x,y,sx,sy );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
377 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] phases: %d\n",ph );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
378 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] default value: %d\n",d );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
379 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] message: %d\n",msg );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
380
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
381 defList->NumberOfItems++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
382 item=&defList->Items[ defList->NumberOfItems ];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
383 item->type=itPotmeter;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
384 item->x=x; item->y=y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
385 item->width=sx; item->height=sy;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
386 item->phases=ph;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
387 item->msg=msg;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
388 item->value=(float)d;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
389
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
390 item->Bitmap.Image=NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
391 if ( strcmp( phfname,"NULL" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
392 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
393 strcpy( tmp,path ); strcat( tmp,phfname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
394 if ( skinBPRead( tmp,&item->Bitmap ) ) return 1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
395 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
396 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
397 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
398
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
399 int __font( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
400 { // font=fontname,fontid
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
401 char name[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
402 char id[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
403 wItem * item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
404
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
405 CHECKDEFLIST( "font" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
406 CHECKWINLIST( "font" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
407
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
408 cutItem( in,name,',',0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
409 cutItem( in,id,',',1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
410
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
411 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] font\n" );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
412 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] name: %s\n",name );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
413
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
414 defList->NumberOfItems++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
415 item=&defList->Items[ defList->NumberOfItems ];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
416 item->type=itFont;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
417 item->fontid=fntAddNewFont( name );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
418 switch ( item->fontid )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
419 {
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
420 case -1: ERRORMESSAGE( MSGTR_SKIN_FONT_NotEnoughtMemory ); return 1;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
421 case -2: ERRORMESSAGE( MSGTR_SKIN_FONT_TooManyFontsDeclared ); return 1;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
422 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
423
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
424 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] id: %s ( %d )\n",id,item->fontid );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
425
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
426 switch ( fntRead( path,name,item->fontid ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
427 {
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
428 case -1: ERRORMESSAGE( MSGTR_SKIN_FONT_FontFileNotFound ); return 1;
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
429 case -2: ERRORMESSAGE( MSGTR_SKIN_FONT_FontImageNotFound ); return 1;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
430 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
431
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
432 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
433 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
434
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
435 int __slabel( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
436 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
437 char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
438 char sid[63];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
439 int x,y,id;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
440 wItem * item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
441
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
442 CHECKDEFLIST( "slabel" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
443 CHECKWINLIST( "slabel" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
444
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
445 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] slabel\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
446
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
447 x=cutItemToInt( in,',',0 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
448 y=cutItemToInt( in,',',1 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
449 cutItem( in,sid,',',2 ); id=fntFindID( sid );
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
450 if ( id < 0 ) { ERRORMESSAGE( MSGTR_SKIN_FONT_NonExistentFontID,sid ); return 1; }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
451 cutItem( in,tmp,',',3 ); cutItem( tmp,tmp,'"',1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
452
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
453 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] pos: %d,%d\n",x,y );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
454 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] id: %s ( %d )\n",sid,id );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
455 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] str: '%s'\n",tmp );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
456
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
457 defList->NumberOfItems++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
458 item=&defList->Items[ defList->NumberOfItems ];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
459 item->type=itSLabel;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
460 item->fontid=id;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
461 item->x=x; item->y=y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
462 item->width=-1; item->height=-1;
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
463 if ( ( item->label=malloc( strlen( tmp ) + 1 ) ) == NULL ) { ERRORMESSAGE( MSGTR_SKIN_FONT_NotEnoughtMemory ); return 1; }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
464 strcpy( item->label,tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
465
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
466 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
467 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
468
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
469 int __dlabel( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
470 { // dlabel=x,y,sx,align,fontid,string ...
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
471 char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
472 char sid[63];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
473 int x,y,sx,id,a;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
474 wItem * item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
475
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
476 CHECKDEFLIST( "dlabel" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
477 CHECKWINLIST( "dlabel" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
478
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
479 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] dlabel\n" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
480
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
481 x=cutItemToInt( in,',',0 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
482 y=cutItemToInt( in,',',1 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1729
diff changeset
483 sx=cutItemToInt( in,',',2 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
484 a=cutItemToInt( in,',',3 );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
485 cutItem( in,sid,',',4 ); id=fntFindID( sid );
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
486 if ( id < 0 ) { ERRORMESSAGE( MSGTR_SKIN_FONT_NonExistentFontID,sid ); return 1; }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
487 cutItem( in,tmp,',',5 ); cutItem( tmp,tmp,'"',1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
488
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
489 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] pos: %d,%d width: %d align: %d\n",x,y,sx,a );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
490 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] id: %s ( %d )\n",sid,id );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
491 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] str: '%s'\n",tmp );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
492
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
493 defList->NumberOfItems++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
494 item=&defList->Items[ defList->NumberOfItems ];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
495 item->type=itDLabel;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
496 item->fontid=id; item->align=a;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
497 item->x=x; item->y=y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
498 item->width=sx; item->height=-1;
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
499 if ( ( item->label=malloc( strlen( tmp ) + 1 ) ) == NULL ) { ERRORMESSAGE( MSGTR_SKIN_FONT_NotEnoughtMemory ); return 1; }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
500 strcpy( item->label,tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
501
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
502 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
503 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
504
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
505 int __decoration( char * in )
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
506 {
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
507 char tmp[512];
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
508
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
509 CHECKDEFLIST( "decoration" );
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
510 CHECKWINLIST( "decoration" );
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
511
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
512 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] window decoration is %s\n",in );
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
513 cutItem( in,tmp,',',0 );
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
514 if ( strcmp( tmp,"enable" )&&strcmp( tmp,"disable" ) ) { ERRORMESSAGE( MSGTR_SKIN_UnknownParameter,tmp ); return 1; }
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
515 if ( strcmp( tmp,"enable" ) ) defList->mainDecoration=0;
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
516 else defList->mainDecoration=1;
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
517
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
518 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] window decoration is %s\n",(defList->mainDecoration?"enabled":"disabled") );
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
519 return 0;
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
520 }
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
521
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
522 typedef struct
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
523 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
524 char * name;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
525 int (*func)( char * in );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
526 } _item;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
527
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
528 _item skinItem[] =
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
529 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
530 { "section", __section },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
531 { "end", __end },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
532 { "window", __window },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
533 { "base", __base },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
534 { "button", __button },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
535 { "selected", __selected },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
536 { "background", __background },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
537 { "hpotmeter", __hpotmeter },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
538 { "potmeter", __potmeter },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
539 { "font", __font },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
540 { "slabel", __slabel },
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
541 { "dlabel", __dlabel },
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1852
diff changeset
542 { "decoration", __decoration },
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
543 { "menu", __menu }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
544 };
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
545
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
546 #define ITEMS (int)( sizeof( skinItem )/sizeof( _item ) )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
547
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
548 char * strdelspacesbeforecommand( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
549 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
550 int c = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
551 char * out;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
552 if ( strlen( in ) == 0 ) return NULL;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
553 while ( in[c] == ' ' ) c++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
554 if ( c != 0 )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
555 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
556 out=malloc( strlen( in ) - c + 1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
557 memcpy( out,&in[c],strlen( in ) - c + 1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
558 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
559 else out=in;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
560 return out;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
561 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
562
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
563 char * strswap( char * in,char what,char whereof )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
564 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
565 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
566 if ( strlen( in ) == 0 ) return NULL;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
567 for ( i=0;i<(int)strlen( in );i++ )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
568 if ( in[i] == what ) in[i]=whereof;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
569 return in;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
570 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
571
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
572 char * strdelspaces( char * in )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
573 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
574 int c = 0,i = 0,id = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
575 if ( strlen( in ) == 0 ) return NULL;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
576 while ( c != (int)strlen( in ) )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
577 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
578 if ( in[c] == '"' ) id=!id;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
579 if ( ( in[c] == ' ' )&&( !id ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
580 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
581 for ( i=0;i<(int)strlen( in ) - c; i++ ) in[c+i]=in[c+i+1];
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
582 continue;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
583 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
584 c++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
585 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
586 return in;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
587 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
588
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
589 FILE * skinFile;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
590
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
591 void setname( char * item1, char * item2 )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
592 { strcpy( fn,item1 ); strcat( fn,"/" ); strcat( fn,item2 ); strcpy( path,fn ); strcat( path,"/" ); strcat( fn,"/skin" ); }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
593
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
594 int skinRead( char * dname )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
595 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
596 unsigned char tmp[255];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
597 unsigned char * ptmp;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
598 unsigned char command[32];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
599 unsigned char param[256];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
600 int c,i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
601
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
602 setname( skinMPlayerDir,dname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
603 if ( ( skinFile = fopen( fn,"rt" ) ) == NULL )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
604 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
605 setname( skinDirInHome,dname );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
606 if ( ( skinFile = fopen( fn,"rt" ) ) == NULL )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
607 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
608 mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[skin] file ( %s ) not found.\n",fn );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
609 return -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
610 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
611 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
612
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
613 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] file: %s\n",fn );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
614
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
615 appInitStruct( &appMPlayer );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
616
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
617 linenumber=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
618 while ( !feof( skinFile ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
619 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
620 fgets( tmp,255,skinFile ); linenumber++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
621
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
622 c=tmp[ strlen( tmp ) - 1 ]; if ( c == '\n' || c == '\r' ) tmp[ strlen( tmp ) - 1 ]=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
623 c=tmp[ strlen( tmp ) - 1 ]; if ( c == '\n' || c == '\r' ) tmp[ strlen( tmp ) - 1 ]=0;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 3586
diff changeset
624 for ( c=0;c<(int)strlen( tmp );c++ )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
625 if ( tmp[c] == ';' )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
626 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
627 tmp[c]=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
628 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
629 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
630 if ( strlen( tmp ) == 0 ) continue;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
631 ptmp=strdelspacesbeforecommand( tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
632 if ( strlen( ptmp ) == 0 ) continue;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
633 ptmp=strswap( ptmp,'\t',' ' );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
634 ptmp=strdelspaces( ptmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
635
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
636 cutItem( ptmp,command,'=',0 ); cutItem( ptmp,param,'=',1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
637 strlower( command );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
638 for( i=0;i<ITEMS;i++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
639 if ( !strcmp( command,skinItem[i].name ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
640 if ( skinItem[i].func( param ) ) return -2;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
641 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
642 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
643 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
644
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
645 void btnModify( int event,float state )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
646 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
647 int j;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
648 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
649 if ( appMPlayer.Items[j].msg == event )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
650 {
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1713
diff changeset
651 if ( appMPlayer.Items[j].used ) continue;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
652 switch ( appMPlayer.Items[j].type )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
653 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
654 case itButton:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
655 appMPlayer.Items[j].pressed=(int)state;
3479
2704448de713 fs button bug fix
pontscho
parents: 3080
diff changeset
656 appMPlayer.Items[j].tmp=(int)state;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
657 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
658 case itPotmeter:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
659 case itHPotmeter:
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
660 if ( state < 0.0f ) state=0.0f;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
661 if ( state > 100.f ) state=100.0f;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
662 appMPlayer.Items[j].value=state;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
663 break;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
664 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
665 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
666 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
667
1729
d6c99f70449e fix hprogressbar
pontscho
parents: 1713
diff changeset
668 float btnGetValue( int event )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
669 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
670 int j;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
671 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
672 if ( appMPlayer.Items[j].msg == event ) return appMPlayer.Items[j].value;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
673 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
674 }