aboutsummaryrefslogtreecommitdiffhomepage
path: root/gui/app.h
blob: fd924ffcbc3b73f09d74ca7948abd29a171816bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*
 * This file is part of MPlayer.
 *
 * MPlayer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MPlayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef MPLAYER_GUI_APP_H
#define MPLAYER_GUI_APP_H

#include "bitmap.h"
#include "wm/ws.h"
#include "wm/wskeys.h"

// --- User events ------

#define evNone              0
#define evPlay              1
#define evStop              2
#define evPause             3
#define evPrev              6
#define evNext              7
#define evLoad              8
#define evEqualizer         9
#define evPlayList          10
#define evIconify           11
#define evAbout             12
#define evLoadPlay          13
#define evPreferences       14
#define evSkinBrowser       15
#define evPlaySwitchToPause 16
#define evPauseSwitchToPlay 17

#define evBackward10sec     18
#define evForward10sec      19
#define evBackward1min      20
#define evForward1min       21
#define evBackward10min     22
#define evForward10min      23

#define evHalfSize          301
#define evNormalSize        24
#define evDoubleSize        25
#define evFullScreen        26

#define evSetMoviePosition  27
#define evSetVolume         28
#define evSetBalance        29
#define evMute              30

#define evIncVolume         31
#define evDecVolume         32
#define evIncAudioBufDelay  33
#define evDecAudioBufDelay  34
#define evIncBalance        35
#define evDecBalance        36

#define evHelp              37

#define evLoadSubtitle      38
#define evDropSubtitle      43
#define evPlayDVD           39
#define evPlayVCD	    40
#define evPlayNetwork       41
#define evLoadAudioFile	    42
#define evSetAspect         44
#define evSetAudio	    45
#define evSetVideo	    46
#define evSetSubtitle       47
// 48 ...

#define evExit              1000

// --- General events ---

#define evFileLoaded      5000
#define evHideMouseCursor 5001
#define evMessageBox      5002
#define evGeneralTimer    5003
#define evGtkIsOk         5004
#define evShowPopUpMenu   5005
#define evHidePopUpMenu   5006
#define evSetDVDAudio     5007
#define evSetDVDSubtitle  5008
#define evSetDVDTitle     5009
#define evSetDVDChapter   5010
#define evSubtitleLoaded  5011
#define evSetVCDTrack     5012
#define evSetURL          5013

#define evFName           7000
#define evMovieTime       7001
#define evRedraw          7002
#define evHideWindow      7003
#define evShowWindow      7004
#define evFirstLoad       7005

// ----------------------

typedef struct
{
 int    msg;
 const char * name;
} evName;

#define itNULL      0
#define itButton    101 // button
#define itHPotmeter 102 // horizontal potmeter
#define itVPotmeter 103 // vertical potmeter
#define itSLabel    104 // static label
#define itDLabel    105 // dynamic label
#define itBase      106
#define itPotmeter  107
#define itFont      108
// ---
#define btnPressed  0
#define btnReleased 1
#define btnDisabled 2
// ---
typedef struct
{
 int        type;
// ---
 int        x,y;
 int        width,height;
// ---
 int        px,py,psx,psy;
// ---
 int        msg,msg2;
 int        pressed,tmp;
 int        key,key2;
 int        phases;
 float      value;
 txSample   Bitmap;
 txSample   Mask;
// ---
 int        fontid;
 int        align;
 char     * label;
// ---
 int        event;
// ---
 int        R,G,B;
} wItem;

typedef struct
{
 wItem           main;
 wsTWindow       mainWindow;
 int             mainDecoration;

 wItem           sub;
 wsTWindow       subWindow;

 wItem           bar;
 wsTWindow       barWindow;
 int             barIsPresent;

 wItem           menuBase;
 wItem           menuSelected;
 wsTWindow       menuWindow;
 int		 menuIsPresent;

// ---
 int             NumberOfItems;
 wItem           Items[256];
// ---
 int             NumberOfMenuItems;
 wItem           MenuItems[64];
// ---
 int		 NumberOfBarItems;
 wItem		 barItems[256];
} listItems;

extern listItems   appMPlayer;

extern char      * skinDirInHome;
extern char      * skinDirInHome_obsolete;
extern char      * skinMPlayerDir;
extern char      * skinMPlayerDir_obsolete;
extern char      * skinName;

void appInitStruct( listItems * item );
void appClearItem( wItem * item );
void appCopy( listItems * item1, listItems * item2 );
int appFindMessage( unsigned char * str );
int appFindKey( unsigned char * name );

void btnModify( int event, float state );
float btnGetValue( int event );
void btnSet( int event, int set );

#endif /* MPLAYER_GUI_APP_H */