Mercurial > mplayer.hg
annotate Gui/app.c @ 1845:e03117bddf84
key hand fix
author | pontscho |
---|---|
date | Sun, 02 Sep 2001 19:38:37 +0000 |
parents | a6c67352ccac |
children | 32b1bb50a0e8 |
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 "config.h" | |
9 #include "error.h" | |
10 #include "wm/wskeys.h" | |
11 #include "skin/skin.h" | |
12 #include "mplayer/mplayer.h" | |
13 | |
14 listItems appMPlayer; | |
15 listItems appTV; | |
16 listItems appRadio; | |
17 | |
1707 | 18 //char * appMPlayerDirInHome=NULL; |
19 //char * appMPlayerDir=NULL; | |
1693 | 20 char * skinDirInHome=NULL; |
21 char * skinMPlayerDir=NULL; | |
22 | |
23 void appClearItem( wItem * item ) | |
24 { | |
25 item->type=0; | |
26 // --- | |
27 item->x=0; item->y=0; item->width=0; item->height=0; | |
28 // --- | |
29 item->px=0; item->py=0; item->psx=0; item->psy=0; | |
30 // --- | |
31 item->msg=0; item->msg2=0; | |
32 item->pressed=0; | |
33 item->tmp=0; | |
34 item->key=0; item->key2=0; | |
35 item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0; | |
36 if ( item->Bitmap.Image ) | |
37 { free( item->Bitmap.Image ); item->Bitmap.Image=NULL; } | |
38 // --- | |
39 item->fontid=0; | |
40 if ( item->label ) free( item->label ); item->label=NULL; | |
41 item->event=0; | |
1729 | 42 item->used=0; |
1693 | 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 ); | |
74 appClearItem( &item->sub ); | |
1823 | 75 item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384; |
76 item->sub.width=384; item->sub.height=384; | |
77 item->sub.x=-1; item->sub.y=-1; | |
1693 | 78 appClearItem( &item->menuBase ); |
79 appClearItem( &item->menuSelected ); | |
80 item->subR=0; | |
81 item->subG=0; | |
82 item->subB=0; | |
83 } | |
84 | |
85 int appFindKey( unsigned char * name ) | |
86 { | |
87 int i; | |
88 for ( i=0;i<wsKeyNumber;i++ ) | |
89 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code; | |
90 return -1; | |
91 } | |
92 | |
93 int appFindMessage( unsigned char * str ) | |
94 { | |
95 int i; | |
96 for ( i=0;i<evBoxs;i++ ) | |
97 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg; | |
98 return -1; | |
99 } | |
100 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1707
diff
changeset
|
101 void appInit( int argc,char* argv[], char *envp[], void* disp ) |
1693 | 102 { |
1707 | 103 skinDirInHome=get_path("Skin"); |
104 skinMPlayerDir=DATADIR "/Skin"; | |
105 printf("SKIN dir 1: '%s'\n",skinDirInHome); | |
106 printf("SKIN dir 2: '%s'\n",skinMPlayerDir); | |
107 | |
1696 | 108 initDebug(NULL); // write messages to stderr |
1693 | 109 |
1696 | 110 cfgDefaults(); // set skin to "default" |
111 cfgRead(); // empty function - NOP | |
1823 | 112 switch ( skinRead( cfgSkin ) ) |
113 { | |
114 case -1: dbprintf( 0,"[app] skin configfile not found.\n" ); exit( 0 ); | |
115 case -2: dbprintf( 0,"[app] skin configfile read error.\n" ); exit( 0 ); | |
116 } | |
117 mplInit( argc,argv,envp,disp ); // does gtk & ws initialization, create windows | |
1693 | 118 } |