Mercurial > mplayer.hg
annotate Gui/app.c @ 2597:dfb13228e18b
alpha. currently no options working :)
author | gabucino |
---|---|
date | Wed, 31 Oct 2001 20:15:19 +0000 |
parents | 32b1bb50a0e8 |
children | a0009a534428 |
rev | line source |
---|---|
1693 | 1 |
2 #include <stdlib.h> | |
3 #include <stdio.h> | |
4 #include <string.h> | |
5 | |
6 #include "app.h" | |
7 #include "../config.h" | |
8 #include "error.h" | |
9 #include "wm/wskeys.h" | |
10 #include "skin/skin.h" | |
11 #include "mplayer/mplayer.h" | |
12 | |
13 listItems appMPlayer; | |
14 | |
15 char * skinDirInHome=NULL; | |
16 char * skinMPlayerDir=NULL; | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
17 char * skinName = NULL; |
1693 | 18 |
19 void appClearItem( wItem * item ) | |
20 { | |
21 item->type=0; | |
22 // --- | |
23 item->x=0; item->y=0; item->width=0; item->height=0; | |
24 // --- | |
25 item->px=0; item->py=0; item->psx=0; item->psy=0; | |
26 // --- | |
27 item->msg=0; item->msg2=0; | |
28 item->pressed=0; | |
29 item->tmp=0; | |
30 item->key=0; item->key2=0; | |
31 item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0; | |
32 if ( item->Bitmap.Image ) | |
33 { free( item->Bitmap.Image ); item->Bitmap.Image=NULL; } | |
34 // --- | |
35 item->fontid=0; | |
36 if ( item->label ) free( item->label ); item->label=NULL; | |
37 item->event=0; | |
1729 | 38 item->used=0; |
1693 | 39 } |
40 | |
41 void appCopy( listItems * dest,listItems * source ) | |
42 { | |
43 dest->NumberOfItems=source->NumberOfItems; | |
44 memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) ); | |
45 | |
46 dest->NumberOfMenuItems=source->NumberOfMenuItems; | |
47 memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) ); | |
48 | |
49 memcpy( &dest->main,&source->main,sizeof( wItem ) ); | |
50 memcpy( &dest->sub,&source->sub,sizeof( wItem ) ); | |
51 memcpy( &dest->eq,&source->eq,sizeof( wItem ) ); | |
52 memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) ); | |
53 memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) ); | |
54 } | |
55 | |
56 void appInitStruct( listItems * item ) | |
57 { | |
58 int i; | |
59 for ( i=0;i<item->NumberOfItems;i++ ) | |
60 appClearItem( &item->Items[i] ); | |
61 for ( i=0;i<item->NumberOfMenuItems;i++ ) | |
62 appClearItem( &item->MenuItems[i] ); | |
63 | |
64 item->NumberOfItems=-1; | |
65 memset( item->Items,0,128 * sizeof( wItem ) ); | |
66 item->NumberOfMenuItems=-1; | |
67 memset( item->MenuItems,0,32 * sizeof( wItem ) ); | |
68 | |
69 appClearItem( &item->main ); | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
70 item->mainDecoration=0; |
1693 | 71 appClearItem( &item->sub ); |
1823 | 72 item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384; |
73 item->sub.width=384; item->sub.height=384; | |
74 item->sub.x=-1; item->sub.y=-1; | |
1693 | 75 appClearItem( &item->menuBase ); |
76 appClearItem( &item->menuSelected ); | |
77 item->subR=0; | |
78 item->subG=0; | |
79 item->subB=0; | |
80 } | |
81 | |
82 int appFindKey( unsigned char * name ) | |
83 { | |
84 int i; | |
85 for ( i=0;i<wsKeyNumber;i++ ) | |
86 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code; | |
87 return -1; | |
88 } | |
89 | |
90 int appFindMessage( unsigned char * str ) | |
91 { | |
92 int i; | |
93 for ( i=0;i<evBoxs;i++ ) | |
94 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg; | |
95 return -1; | |
96 } | |
97 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
98 void appInit( int argc,char* argv[], char *envp[], void* disp ) |
1693 | 99 { |
1707 | 100 skinDirInHome=get_path("Skin"); |
101 skinMPlayerDir=DATADIR "/Skin"; | |
102 printf("SKIN dir 1: '%s'\n",skinDirInHome); | |
103 printf("SKIN dir 2: '%s'\n",skinMPlayerDir); | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
104 if ( !skinName ) |
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
105 { |
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
106 if ( ( skinName=(char *)calloc( 1,7 ) ) == NULL ) { dbprintf( 0,"[config] Not enough memory.\n" ); exit( 1 ); } |
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
107 strcpy( skinName,"default" ); |
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
108 } |
1696 | 109 initDebug(NULL); // write messages to stderr |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
110 switch ( skinRead( skinName ) ) |
1823 | 111 { |
112 case -1: dbprintf( 0,"[app] skin configfile not found.\n" ); exit( 0 ); | |
113 case -2: dbprintf( 0,"[app] skin configfile read error.\n" ); exit( 0 ); | |
114 } | |
115 mplInit( argc,argv,envp,disp ); // does gtk & ws initialization, create windows | |
1693 | 116 } |