Mercurial > mplayer.hg
annotate Gui/app.c @ 6356:b54d7fd6471a
This script has no bash specific stuff, it's all standard bourne shell, so execute with sh.
Also see mail from Michaela.
author | atmos4 |
---|---|
date | Sun, 09 Jun 2002 14:48:16 +0000 |
parents | 8cfddba867b4 |
children | 8e9607c5897e |
rev | line source |
---|---|
1693 | 1 |
2 #include <stdlib.h> | |
3 #include <stdio.h> | |
4 #include <string.h> | |
5 | |
3586 | 6 #include "../config.h" |
7 #include "../mp_msg.h" | |
8 #include "../help_mp.h" | |
9 | |
1693 | 10 #include "app.h" |
11 #include "wm/wskeys.h" | |
12 #include "skin/skin.h" | |
13 #include "mplayer/mplayer.h" | |
4979 | 14 #include "interface.h" |
1693 | 15 |
16 listItems appMPlayer; | |
17 | |
18 char * skinDirInHome=NULL; | |
19 char * skinMPlayerDir=NULL; | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
20 char * skinName = NULL; |
1693 | 21 |
22 void appClearItem( wItem * item ) | |
23 { | |
24 item->type=0; | |
25 // --- | |
26 item->x=0; item->y=0; item->width=0; item->height=0; | |
27 // --- | |
28 item->px=0; item->py=0; item->psx=0; item->psy=0; | |
29 // --- | |
30 item->msg=0; item->msg2=0; | |
4979 | 31 item->pressed=btnReleased; |
1693 | 32 item->tmp=0; |
33 item->key=0; item->key2=0; | |
34 item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0; | |
4979 | 35 if ( item->Bitmap.Image ) free( item->Bitmap.Image ); |
36 item->Bitmap.Image=NULL; | |
1693 | 37 // --- |
38 item->fontid=0; | |
39 if ( item->label ) free( item->label ); item->label=NULL; | |
40 item->event=0; | |
41 } | |
42 | |
43 void appCopy( listItems * dest,listItems * source ) | |
44 { | |
45 dest->NumberOfItems=source->NumberOfItems; | |
46 memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) ); | |
47 | |
48 dest->NumberOfMenuItems=source->NumberOfMenuItems; | |
49 memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) ); | |
50 | |
51 memcpy( &dest->main,&source->main,sizeof( wItem ) ); | |
52 memcpy( &dest->sub,&source->sub,sizeof( wItem ) ); | |
53 memcpy( &dest->eq,&source->eq,sizeof( wItem ) ); | |
54 memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) ); | |
55 memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) ); | |
56 } | |
57 | |
58 void appInitStruct( listItems * item ) | |
59 { | |
60 int i; | |
61 for ( i=0;i<item->NumberOfItems;i++ ) | |
62 appClearItem( &item->Items[i] ); | |
63 for ( i=0;i<item->NumberOfMenuItems;i++ ) | |
64 appClearItem( &item->MenuItems[i] ); | |
65 | |
66 item->NumberOfItems=-1; | |
67 memset( item->Items,0,128 * sizeof( wItem ) ); | |
68 item->NumberOfMenuItems=-1; | |
69 memset( item->MenuItems,0,32 * sizeof( wItem ) ); | |
70 | |
71 appClearItem( &item->main ); | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
72 item->mainDecoration=0; |
1693 | 73 appClearItem( &item->sub ); |
1823 | 74 item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384; |
75 item->sub.width=384; item->sub.height=384; | |
76 item->sub.x=-1; item->sub.y=-1; | |
1693 | 77 appClearItem( &item->menuBase ); |
78 appClearItem( &item->menuSelected ); | |
79 item->subR=0; | |
80 item->subG=0; | |
81 item->subB=0; | |
82 } | |
83 | |
84 int appFindKey( unsigned char * name ) | |
85 { | |
86 int i; | |
87 for ( i=0;i<wsKeyNumber;i++ ) | |
88 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code; | |
89 return -1; | |
90 } | |
91 | |
92 int appFindMessage( unsigned char * str ) | |
93 { | |
94 int i; | |
95 for ( i=0;i<evBoxs;i++ ) | |
96 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg; | |
97 return -1; | |
98 } | |
99 | |
6218 | 100 void appInit( void * disp ) |
1693 | 101 { |
1707 | 102 skinDirInHome=get_path("Skin"); |
103 skinMPlayerDir=DATADIR "/Skin"; | |
104 printf("SKIN dir 1: '%s'\n",skinDirInHome); | |
105 printf("SKIN dir 2: '%s'\n",skinMPlayerDir); | |
6218 | 106 if ( !skinName ) skinName=strdup( "default" ); |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
107 switch ( skinRead( skinName ) ) |
1823 | 108 { |
3586 | 109 case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 ); |
110 case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 ); | |
1823 | 111 } |
6218 | 112 mplInit( disp ); // does gtk & ws initialization, create windows |
1693 | 113 } |