Mercurial > mplayer.hg
annotate Gui/app.c @ 8256:cde8aaad8198
This file gets created during the wine/svq3 build process.
author | diego |
---|---|
date | Sat, 23 Nov 2002 11:45:44 +0000 |
parents | e5dda05f9aab |
children | 72700fefd3dc |
rev | line source |
---|---|
8043 | 1 |
1693 | 2 |
3 #include <stdlib.h> | |
4 #include <stdio.h> | |
5 #include <string.h> | |
6 | |
3586 | 7 #include "../config.h" |
8 #include "../mp_msg.h" | |
9 #include "../help_mp.h" | |
10 | |
1693 | 11 #include "app.h" |
12 #include "wm/wskeys.h" | |
13 #include "skin/skin.h" | |
14 #include "mplayer/mplayer.h" | |
4979 | 15 #include "interface.h" |
1693 | 16 |
8043 | 17 evName evNames[] = |
18 { | |
19 { evNone, "evNone" }, | |
20 { evPlay, "evPlay" }, | |
21 { evStop, "evStop" }, | |
22 { evPause, "evPause" }, | |
23 { evPrev, "evPrev" }, | |
24 { evNext, "evNext" }, | |
25 { evLoad, "evLoad" }, | |
26 { evEqualizer, "evEqualizer" }, | |
27 { evEqualizer, "evEqualeaser" }, | |
28 { evPlayList, "evPlaylist" }, | |
29 { evExit, "evExit" }, | |
30 { evIconify, "evIconify" }, | |
31 { evIncBalance, "evIncBalance" }, | |
32 { evDecBalance, "evDecBalance" }, | |
33 { evFullScreen, "evFullScreen" }, | |
34 { evFName, "evFName" }, | |
35 { evMovieTime, "evMovieTime" }, | |
36 { evAbout, "evAbout" }, | |
37 { evLoadPlay, "evLoadPlay" }, | |
38 { evPreferences, "evPreferences" }, | |
39 { evSkinBrowser, "evSkinBrowser" }, | |
40 { evBackward10sec, "evBackward10sec" }, | |
41 { evForward10sec, "evForward10sec" }, | |
42 { evBackward1min, "evBackward1min" }, | |
43 { evForward1min, "evForward1min" }, | |
44 { evBackward10min, "evBackward10min" }, | |
45 { evForward10min, "evForward10min" }, | |
46 { evIncVolume, "evIncVolume" }, | |
47 { evDecVolume, "evDecVolume" }, | |
48 { evMute, "evMute" }, | |
49 { evIncAudioBufDelay, "evIncAudioBufDelay" }, | |
50 { evDecAudioBufDelay, "evDecAudioBufDelay" }, | |
51 { evPlaySwitchToPause, "evPlaySwitchToPause" }, | |
52 { evPauseSwitchToPlay, "evPauseSwitchToPlay" }, | |
53 { evNormalSize, "evNormalSize" }, | |
54 { evDoubleSize, "evDoubleSize" }, | |
55 { evSetMoviePosition, "evSetMoviePosition" }, | |
56 { evSetVolume, "evSetVolume" }, | |
57 { evSetBalance, "evSetBalance" }, | |
58 { evHelp, "evHelp" }, | |
59 { evLoadSubtitle, "evLoadSubtitle" }, | |
60 { evPlayDVD, "evPlayDVD" }, | |
61 { evPlayVCD, "evPlayVCD" }, | |
62 { evSetURL, "evSetURL" }, | |
63 { evLoadAudioFile, "evLoadAudioFile" }, | |
64 { evDropSubtitle, "evDropSubtitle" }, | |
65 { evSetAspect, "evSetAspect" } | |
66 }; | |
67 | |
68 int evBoxs = sizeof( evNames ) / sizeof( evName ); | |
69 | |
70 // --- | |
71 | |
7092
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
6218
diff
changeset
|
72 extern char *get_path(char *); |
8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents:
6218
diff
changeset
|
73 |
1693 | 74 listItems appMPlayer; |
75 | |
76 char * skinDirInHome=NULL; | |
77 char * skinMPlayerDir=NULL; | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
78 char * skinName = NULL; |
1693 | 79 |
80 void appClearItem( wItem * item ) | |
81 { | |
82 item->type=0; | |
83 // --- | |
84 item->x=0; item->y=0; item->width=0; item->height=0; | |
85 // --- | |
86 item->px=0; item->py=0; item->psx=0; item->psy=0; | |
87 // --- | |
88 item->msg=0; item->msg2=0; | |
4979 | 89 item->pressed=btnReleased; |
1693 | 90 item->tmp=0; |
91 item->key=0; item->key2=0; | |
92 item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0; | |
4979 | 93 if ( item->Bitmap.Image ) free( item->Bitmap.Image ); |
94 item->Bitmap.Image=NULL; | |
1693 | 95 // --- |
96 item->fontid=0; | |
97 if ( item->label ) free( item->label ); item->label=NULL; | |
98 item->event=0; | |
99 } | |
100 | |
101 void appCopy( listItems * dest,listItems * source ) | |
102 { | |
103 dest->NumberOfItems=source->NumberOfItems; | |
104 memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) ); | |
105 | |
106 dest->NumberOfMenuItems=source->NumberOfMenuItems; | |
107 memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) ); | |
108 | |
109 memcpy( &dest->main,&source->main,sizeof( wItem ) ); | |
110 memcpy( &dest->sub,&source->sub,sizeof( wItem ) ); | |
111 memcpy( &dest->eq,&source->eq,sizeof( wItem ) ); | |
112 memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) ); | |
113 memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) ); | |
114 } | |
115 | |
116 void appInitStruct( listItems * item ) | |
117 { | |
118 int i; | |
119 for ( i=0;i<item->NumberOfItems;i++ ) | |
120 appClearItem( &item->Items[i] ); | |
121 for ( i=0;i<item->NumberOfMenuItems;i++ ) | |
122 appClearItem( &item->MenuItems[i] ); | |
123 | |
124 item->NumberOfItems=-1; | |
125 memset( item->Items,0,128 * sizeof( wItem ) ); | |
126 item->NumberOfMenuItems=-1; | |
127 memset( item->MenuItems,0,32 * sizeof( wItem ) ); | |
128 | |
129 appClearItem( &item->main ); | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1823
diff
changeset
|
130 item->mainDecoration=0; |
1693 | 131 appClearItem( &item->sub ); |
1823 | 132 item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384; |
133 item->sub.width=384; item->sub.height=384; | |
134 item->sub.x=-1; item->sub.y=-1; | |
1693 | 135 appClearItem( &item->menuBase ); |
136 appClearItem( &item->menuSelected ); | |
137 item->subR=0; | |
138 item->subG=0; | |
139 item->subB=0; | |
140 } | |
141 | |
142 int appFindKey( unsigned char * name ) | |
143 { | |
144 int i; | |
145 for ( i=0;i<wsKeyNumber;i++ ) | |
146 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code; | |
147 return -1; | |
148 } | |
149 | |
150 int appFindMessage( unsigned char * str ) | |
151 { | |
152 int i; | |
153 for ( i=0;i<evBoxs;i++ ) | |
154 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg; | |
155 return -1; | |
156 } |