comparison Gui/skin/skin.c @ 1852:58dd326fcc4a

fix xshape, mixer, fullscreen, etc
author pontscho
date Tue, 04 Sep 2001 15:21:00 +0000
parents d6c99f70449e
children 32b1bb50a0e8
comparison
equal deleted inserted replaced
1851:2ce062156969 1852:58dd326fcc4a
8 #include "font.h" 8 #include "font.h"
9 #include "../app.h" 9 #include "../app.h"
10 #include "../language.h" 10 #include "../language.h"
11 #include "../../config.h" 11 #include "../../config.h"
12 12
13 char SkinDir[] = "/.mplayer/Skin/"; 13 //char SkinDir[] = "/.mplayer/Skin/";
14 char * Skin; 14 //char * Skin;
15 15
16 listItems * skinAppMPlayer = &appMPlayer; 16 listItems * skinAppMPlayer = &appMPlayer;
17 listItems * skinAppTV = &appTV; 17 //listItems * skinAppTV = &appTV;
18 listItems * skinAppRadio = &appRadio; 18 //listItems * skinAppRadio = &appRadio;
19 19
20 int linenumber; 20 int linenumber;
21 21
22 unsigned char path[512],fn[512]; 22 unsigned char path[512],fn[512];
23 23
116 116
117 CHECKDEFLIST( "base" ); 117 CHECKDEFLIST( "base" );
118 CHECKWINLIST( "base" ); 118 CHECKWINLIST( "base" );
119 119
120 cutItem( in,fname,',',0 ); 120 cutItem( in,fname,',',0 );
121 cutItem( in,tmp,',',1 ); x=atoi( tmp ); 121 x=cutItemToInt( in,',',1 );
122 cutItem( in,tmp,',',2 ); y=atoi( tmp ); 122 y=cutItemToInt( in,',',2 );
123 #ifdef DEBUG 123 #ifdef DEBUG
124 dbprintf( 3,"\n[skin] base: %s x: %d y: %d\n",fname,x,y ); 124 dbprintf( 3,"\n[skin] base: %s x: %d y: %d\n",fname,x,y );
125 #endif 125 #endif
126 if ( !strcmp( winList,"main" ) ) 126 if ( !strcmp( winList,"main" ) )
127 { 127 {
138 defList->main.Mask.BPP=1; 138 defList->main.Mask.BPP=1;
139 defList->main.Mask.ImageSize=defList->main.Mask.Width * defList->main.Mask.Height / 8; 139 defList->main.Mask.ImageSize=defList->main.Mask.Width * defList->main.Mask.Height / 8;
140 defList->main.Mask.Image=(char *)calloc( 1,defList->main.Mask.ImageSize ); 140 defList->main.Mask.Image=(char *)calloc( 1,defList->main.Mask.ImageSize );
141 if ( defList->main.Mask.Image == NULL ) message( True,langNEMFMM ); 141 if ( defList->main.Mask.Image == NULL ) message( True,langNEMFMM );
142 { 142 {
143 int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; 143 int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1;
144 buf=(unsigned long *)defList->main.Bitmap.Image; 144 buf=(unsigned long *)defList->main.Bitmap.Image;
145 for ( b=0,i=0;i < defList->main.Mask.Width * defList->main.Mask.Height;i++ ) 145 for ( b=0,i=0;i < defList->main.Mask.Width * defList->main.Mask.Height;i++ )
146 { 146 {
147 if ( buf[i] != 0x00ff00ff ) tmp=( tmp >> 1 )|128; 147 if ( buf[i] != 0x00ff00ff ) tmp=( tmp >> 1 )|128;
148 else { tmp=tmp >> 1; buf[i]=0; } 148 else { tmp=tmp >> 1; buf[i]=nothaveshape=0; }
149 if ( b++ == 7 ) { defList->main.Mask.Image[c++]=tmp; tmp=0; b=0; } 149 if ( b++ == 7 ) { defList->main.Mask.Image[c++]=tmp; tmp=b=0; }
150 } 150 }
151 if (b) defList->main.Mask.Image[c++]=tmp; 151 if ( b ) defList->main.Mask.Image[c]=tmp;
152 if ( nothaveshape ) { free( defList->main.Mask.Image ); defList->main.Mask.Image=NULL; }
152 } 153 }
153 #ifdef DEBUG 154 #ifdef DEBUG
154 dbprintf( 3,"[skin] mask: %dX%d\n",defList->main.Mask.Width,defList->main.Mask.Height ); 155 dbprintf( 3,"[skin] mask: %dx%d\n",defList->main.Mask.Width,defList->main.Mask.Height );
155 #endif 156 #endif
156 #else 157 #else
157 defList->main.Mask.Image=NULL; 158 defList->main.Mask.Image=NULL;
158 #endif 159 #endif
159 #ifdef DEBUG 160 #ifdef DEBUG
202 return 0; 203 return 0;
203 } 204 }
204 205
205 int __background( char * in ) 206 int __background( char * in )
206 { 207 {
207 unsigned char tmp[512];
208
209 CHECKDEFLIST( "background" ); 208 CHECKDEFLIST( "background" );
210 CHECKWINLIST( "background" ); 209 CHECKWINLIST( "background" );
211 210
212 if ( !strcmp( winList,"sub" ) ) 211 if ( !strcmp( winList,"sub" ) )
213 { 212 {
214 cutItem( in,tmp,',',0 ); defList->subR=atoi( tmp ); 213 defList->subR=cutItemToInt( in,',',0 );
215 cutItem( in,tmp,',',1 ); defList->subG=atoi( tmp ); 214 defList->subG=cutItemToInt( in,',',1 );
216 cutItem( in,tmp,',',2 ); defList->subB=atoi( tmp ); 215 defList->subB=cutItemToInt( in,',',2 );
217 #ifdef DEBUG 216 #ifdef DEBUG
218 dbprintf( 3,"\n[skin] subwindow background color is #%x%x%x.\n",defList->subR,defList->subG,defList->subB ); 217 dbprintf( 3,"\n[skin] subwindow background color is #%x%x%x.\n",defList->subR,defList->subG,defList->subB );
219 #endif 218 #endif
220 } 219 }
221 return 0; 220 return 0;
229 unsigned char msg[32]; 228 unsigned char msg[32];
230 229
231 CHECKDEFLIST( "button" ); 230 CHECKDEFLIST( "button" );
232 CHECKWINLIST( "button" ); 231 CHECKWINLIST( "button" );
233 232
234 // button=prev,17,89,23,18,Up,evPrev
235
236 cutItem( in,fname,',',0 ); 233 cutItem( in,fname,',',0 );
237 cutItem( in,tmp,',',1 ); x=atoi( tmp ); 234 x=cutItemToInt( in,',',1 );
238 cutItem( in,tmp,',',2 ); y=atoi( tmp ); 235 y=cutItemToInt( in,',',2 );
239 cutItem( in,tmp,',',3 ); sx=atoi( tmp ); 236 sx=cutItemToInt( in,',',3 );
240 cutItem( in,tmp,',',4 ); sy=atoi( tmp ); 237 sy=cutItemToInt( in,',',4 );
241 cutItem( in,msg,',',5 ); 238 cutItem( in,msg,',',5 );
242 239
243 defList->NumberOfItems++; 240 defList->NumberOfItems++;
244 defList->Items[ defList->NumberOfItems ].type=itButton; 241 defList->Items[ defList->NumberOfItems ].type=itButton;
245 defList->Items[ defList->NumberOfItems ].x=x; 242 defList->Items[ defList->NumberOfItems ].x=x;
300 unsigned char tmp[64]; 297 unsigned char tmp[64];
301 298
302 CHECKDEFLIST( "menu" ); 299 CHECKDEFLIST( "menu" );
303 CHECKWINLIST( "menu" ); 300 CHECKWINLIST( "menu" );
304 301
305 cutItem( in,tmp,',',0 ); x=atoi( tmp ); 302 x=cutItemToInt( in,',',0 );
306 cutItem( in,tmp,',',1 ); y=atoi( tmp ); 303 y=cutItemToInt( in,',',1 );
307 cutItem( in,tmp,',',2 ); sx=atoi( tmp ); 304 sx=cutItemToInt( in,',',2 );
308 cutItem( in,tmp,',',3 ); sy=atoi( tmp ); 305 sy=cutItemToInt( in,',',3 );
309 cutItem( in,tmp,',',4 ); msg=appFindMessage( tmp ); 306 cutItem( in,tmp,',',4 ); msg=appFindMessage( tmp );
310 307
311 defList->NumberOfMenuItems++; 308 defList->NumberOfMenuItems++;
312 defList->MenuItems[ defList->NumberOfMenuItems ].x=x; 309 defList->MenuItems[ defList->NumberOfMenuItems ].x=x;
313 defList->MenuItems[ defList->NumberOfMenuItems ].y=y; 310 defList->MenuItems[ defList->NumberOfMenuItems ].y=y;
340 337
341 CHECKDEFLIST( "hpotmeter" ); 338 CHECKDEFLIST( "hpotmeter" );
342 CHECKWINLIST( "hpotmeter" ); 339 CHECKWINLIST( "hpotmeter" );
343 340
344 cutItem( in,pfname,',',0 ); 341 cutItem( in,pfname,',',0 );
345 cutItem( in,tmp,',',1 ); psx=atoi( tmp ); 342 psx=cutItemToInt( in,',',1 );
346 cutItem( in,tmp,',',2 ); psy=atoi( tmp ); 343 psy=cutItemToInt( in,',',2 );
347 cutItem( in,phfname,',',3 ); 344 cutItem( in,phfname,',',3 );
348 cutItem( in,tmp,',',4 ); ph=atoi( tmp ); 345 ph=cutItemToInt( in,',',4 );
349 cutItem( in,tmp,',',5 ); d=atoi( tmp ); 346 d=cutItemToInt( in,',',5 );
350 cutItem( in,tmp,',',6 ); x=atoi( tmp ); 347 x=cutItemToInt( in,',',6 );
351 cutItem( in,tmp,',',7 ); y=atoi( tmp ); 348 y=cutItemToInt( in,',',7 );
352 cutItem( in,tmp,',',8 ); sx=atoi( tmp ); 349 sx=cutItemToInt( in,',',8 );
353 cutItem( in,tmp,',',9 ); sy=atoi( tmp ); 350 sy=cutItemToInt( in,',',9 );
354 cutItem( in,tmp,',',10 ); msg=appFindMessage( tmp ); 351 cutItem( in,tmp,',',10 ); msg=appFindMessage( tmp );
355 352
356 #ifdef DEBUG 353 #ifdef DEBUG
357 dbprintf( 3,"\n[skin] hpotmeter: pointer filename: '%s'\n",pfname ); 354 dbprintf( 3,"\n[skin] hpotmeter: pointer filename: '%s'\n",pfname );
358 dbprintf( 3, "[skin] pointer size is %dx%d\n",psx,psy ); 355 dbprintf( 3, "[skin] pointer size is %dx%d\n",psx,psy );
398 395
399 CHECKDEFLIST( "potmeter" ); 396 CHECKDEFLIST( "potmeter" );
400 CHECKWINLIST( "potmeter" ); 397 CHECKWINLIST( "potmeter" );
401 398
402 cutItem( in,phfname,',',0 ); 399 cutItem( in,phfname,',',0 );
403 cutItem( in,tmp,',',1 ); ph=atoi( tmp ); 400 ph=cutItemToInt( in,',',1 );
404 cutItem( in,tmp,',',2 ); d=atoi( tmp ); 401 d=cutItemToInt( in,',',2 );
405 cutItem( in,tmp,',',3 ); x=atoi( tmp ); 402 x=cutItemToInt( in,',',3 );
406 cutItem( in,tmp,',',4 ); y=atoi( tmp ); 403 y=cutItemToInt( in,',',4 );
407 cutItem( in,tmp,',',5 ); sx=atoi( tmp ); 404 sx=cutItemToInt( in,',',5 );
408 cutItem( in,tmp,',',6 ); sy=atoi( tmp ); 405 sy=cutItemToInt( in,',',6 );
409 cutItem( in,tmp,',',7 ); msg=appFindMessage( tmp ); 406 cutItem( in,tmp,',',7 ); msg=appFindMessage( tmp );
410 407
411 #ifdef DEBUG 408 #ifdef DEBUG
412 dbprintf( 3,"\n[skin] potmeter: phases filename: '%s'\n",phfname ); 409 dbprintf( 3,"\n[skin] potmeter: phases filename: '%s'\n",phfname );
413 dbprintf( 3, "[skin] position: %d,%d %dx%d\n",x,y,sx,sy ); 410 dbprintf( 3, "[skin] position: %d,%d %dx%d\n",x,y,sx,sy );
486 483
487 #ifdef DEBUG 484 #ifdef DEBUG
488 dbprintf( 3,"\n[skin] slabel\n" ); 485 dbprintf( 3,"\n[skin] slabel\n" );
489 #endif 486 #endif
490 487
491 cutItem( in,tmp,',',0 ); x=atoi( tmp ); 488 x=cutItemToInt( in,',',0 );
492 cutItem( in,tmp,',',1 ); y=atoi( tmp ); 489 y=cutItemToInt( in,',',1 );
493 cutItem( in,sid,',',2 ); id=fntFindID( sid ); 490 cutItem( in,sid,',',2 ); id=fntFindID( sid );
494 if ( id < 0 ) { ERRORMESSAGE( "nonexistent font id. ( %s )\n",sid ); return 1; } 491 if ( id < 0 ) { ERRORMESSAGE( "nonexistent font id. ( %s )\n",sid ); return 1; }
495 cutItem( in,tmp,',',3 ); cutItem( tmp,tmp,'"',1 ); 492 cutItem( in,tmp,',',3 ); cutItem( tmp,tmp,'"',1 );
496 493
497 #ifdef DEBUG 494 #ifdef DEBUG
524 521
525 #ifdef DEBUG 522 #ifdef DEBUG
526 dbprintf( 3,"\n[skin] dlabel\n" ); 523 dbprintf( 3,"\n[skin] dlabel\n" );
527 #endif 524 #endif
528 525
529 cutItem( in,tmp,',',0 ); x=atoi( tmp ); 526 x=cutItemToInt( in,',',0 );
530 cutItem( in,tmp,',',1 ); y=atoi( tmp ); 527 y=cutItemToInt( in,',',1 );
531 cutItem( in,tmp,',',2 ); sx=atoi( tmp ); 528 sx=cutItemToInt( in,',',2 );
532 cutItem( in,tmp,',',3 ); a=atoi( tmp ); 529 a=cutItemToInt( in,',',3 );
533 cutItem( in,sid,',',4 ); id=fntFindID( sid ); 530 cutItem( in,sid,',',4 ); id=fntFindID( sid );
534 if ( id < 0 ) { ERRORMESSAGE( "nonexistent font id. ( %s )\n",sid ); return 1; } 531 if ( id < 0 ) { ERRORMESSAGE( "nonexistent font id. ( %s )\n",sid ); return 1; }
535 cutItem( in,tmp,',',5 ); cutItem( tmp,tmp,'"',1 ); 532 cutItem( in,tmp,',',5 ); cutItem( tmp,tmp,'"',1 );
536 533
537 #ifdef DEBUG 534 #ifdef DEBUG