Mercurial > mplayer.hg
annotate Gui/app.c @ 8014:3d6904cee13e
The first language ripped is set as the default language
by writing the langidx tag with the index of this language.
patch by Arne Driescher <driescher@mpi-magdeburg.mpg.de>
(accepted by Kim Minh Kaplan)
author | arpi |
---|---|
date | Fri, 01 Nov 2002 00:01:53 +0000 |
parents | 8e9607c5897e |
children | e5dda05f9aab |
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 |
7092
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
6218
diff
changeset
|
16 extern char *get_path(char *); |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
6218
diff
changeset
|
17 |
1693 | 18 listItems appMPlayer; |
19 | |
20 char * skinDirInHome=NULL; | |
21 char * skinMPlayerDir=NULL; | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
22 char * skinName = NULL; |
1693 | 23 |
24 void appClearItem( wItem * item ) | |
25 { | |
26 item->type=0; | |
27 // --- | |
28 item->x=0; item->y=0; item->width=0; item->height=0; | |
29 // --- | |
30 item->px=0; item->py=0; item->psx=0; item->psy=0; | |
31 // --- | |
32 item->msg=0; item->msg2=0; | |
4979 | 33 item->pressed=btnReleased; |
1693 | 34 item->tmp=0; |
35 item->key=0; item->key2=0; | |
36 item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0; | |
4979 | 37 if ( item->Bitmap.Image ) free( item->Bitmap.Image ); |
38 item->Bitmap.Image=NULL; | |
1693 | 39 // --- |
40 item->fontid=0; | |
41 if ( item->label ) free( item->label ); item->label=NULL; | |
42 item->event=0; | |
43 } | |
44 | |
45 void appCopy( listItems * dest,listItems * source ) | |
46 { | |
47 dest->NumberOfItems=source->NumberOfItems; | |
48 memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) ); | |
49 | |
50 dest->NumberOfMenuItems=source->NumberOfMenuItems; | |
51 memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) ); | |
52 | |
53 memcpy( &dest->main,&source->main,sizeof( wItem ) ); | |
54 memcpy( &dest->sub,&source->sub,sizeof( wItem ) ); | |
55 memcpy( &dest->eq,&source->eq,sizeof( wItem ) ); | |
56 memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) ); | |
57 memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) ); | |
58 } | |
59 | |
60 void appInitStruct( listItems * item ) | |
61 { | |
62 int i; | |
63 for ( i=0;i<item->NumberOfItems;i++ ) | |
64 appClearItem( &item->Items[i] ); | |
65 for ( i=0;i<item->NumberOfMenuItems;i++ ) | |
66 appClearItem( &item->MenuItems[i] ); | |
67 | |
68 item->NumberOfItems=-1; | |
69 memset( item->Items,0,128 * sizeof( wItem ) ); | |
70 item->NumberOfMenuItems=-1; | |
71 memset( item->MenuItems,0,32 * sizeof( wItem ) ); | |
72 | |
73 appClearItem( &item->main ); | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
74 item->mainDecoration=0; |
1693 | 75 appClearItem( &item->sub ); |
1823 | 76 item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384; |
77 item->sub.width=384; item->sub.height=384; | |
78 item->sub.x=-1; item->sub.y=-1; | |
1693 | 79 appClearItem( &item->menuBase ); |
80 appClearItem( &item->menuSelected ); | |
81 item->subR=0; | |
82 item->subG=0; | |
83 item->subB=0; | |
84 } | |
85 | |
86 int appFindKey( unsigned char * name ) | |
87 { | |
88 int i; | |
89 for ( i=0;i<wsKeyNumber;i++ ) | |
90 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code; | |
91 return -1; | |
92 } | |
93 | |
94 int appFindMessage( unsigned char * str ) | |
95 { | |
96 int i; | |
97 for ( i=0;i<evBoxs;i++ ) | |
98 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg; | |
99 return -1; | |
100 } | |
101 | |
6218 | 102 void appInit( void * disp ) |
1693 | 103 { |
1707 | 104 skinDirInHome=get_path("Skin"); |
105 skinMPlayerDir=DATADIR "/Skin"; | |
106 printf("SKIN dir 1: '%s'\n",skinDirInHome); | |
107 printf("SKIN dir 2: '%s'\n",skinMPlayerDir); | |
6218 | 108 if ( !skinName ) skinName=strdup( "default" ); |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
109 switch ( skinRead( skinName ) ) |
1823 | 110 { |
3586 | 111 case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 ); |
112 case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 ); | |
1823 | 113 } |
6218 | 114 mplInit( disp ); // does gtk & ws initialization, create windows |
1693 | 115 } |