annotate gui/app.h @ 32956:cde5d1cbb4bc

Move global variables to top of file. Additionally: remove needless explicit initialization.
author ib
date Mon, 07 Mar 2011 20:36:06 +0000
parents dc026d74dfce
children 9684ad0e1291
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
5 * it under the terms of the GNU General Public License as published by
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
14 * You should have received a copy of the GNU General Public License along
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
17 */
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26029
diff changeset
18
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
19 #ifndef MPLAYER_GUI_APP_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
20 #define MPLAYER_GUI_APP_H
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22 #include "bitmap.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23 #include "wm/ws.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
24
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
25 // User events
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
26
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
27 #define evNone 0
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
28 #define evPlay 1
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29 #define evStop 2
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30 #define evPause 3
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
31 #define evPrev 6
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32 #define evNext 7
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
33 #define evLoad 8
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34 #define evEqualizer 9
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
35 #define evPlayList 10
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
36 #define evIconify 11
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
37 #define evAbout 12
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
38 #define evLoadPlay 13
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
39 #define evPreferences 14
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40 #define evSkinBrowser 15
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
41 #define evPlaySwitchToPause 16
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42 #define evPauseSwitchToPlay 17
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
43
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44 #define evBackward10sec 18
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45 #define evForward10sec 19
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46 #define evBackward1min 20
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47 #define evForward1min 21
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48 #define evBackward10min 22
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 #define evForward10min 23
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 #define evHalfSize 301
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 #define evNormalSize 24
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 #define evDoubleSize 25
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54 #define evFullScreen 26
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
55
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56 #define evSetMoviePosition 27
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 #define evSetVolume 28
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58 #define evSetBalance 29
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
59 #define evMute 30
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
60
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 #define evIncVolume 31
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 #define evDecVolume 32
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
63 #define evIncAudioBufDelay 33 // NOTE TO MYSELF: not all of these events
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
64 #define evDecAudioBufDelay 34 // are actually implemented, and update doc
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
65 #define evIncBalance 35
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66 #define evDecBalance 36
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
67
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
68 #define evHelp 37
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
69
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
70 #define evLoadSubtitle 38
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 #define evDropSubtitle 43
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 #define evPlayDVD 39
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
73 #define evPlayVCD 40
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74 #define evPlayNetwork 41
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
75 #define evLoadAudioFile 42
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 #define evSetAspect 44
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
77 #define evSetAudio 45
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
78 #define evSetVideo 46
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 #define evSetSubtitle 47
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81 #define evExit 1000
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
83 // General events
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
84
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
85 #define evFileLoaded 5000
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
86 #define evHideMouseCursor 5001
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
87 #define evMessageBox 5002
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
88 #define evGeneralTimer 5003
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89 #define evGtkIsOk 5004
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90 #define evShowPopUpMenu 5005
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
91 #define evHidePopUpMenu 5006
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 #define evSetDVDAudio 5007
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 #define evSetDVDSubtitle 5008
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
94 #define evSetDVDTitle 5009
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
95 #define evSetDVDChapter 5010
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
96 #define evSubtitleLoaded 5011
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
97 #define evSetVCDTrack 5012
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98 #define evSetURL 5013
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
99
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
100 #define evFName 7000
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
101 #define evMovieTime 7001
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
102 #define evRedraw 7002
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
103 #define evHideWindow 7003
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
104 #define evShowWindow 7004
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
105 #define evFirstLoad 7005
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
106
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
107 typedef struct {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
108 int message;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
109 const char *name;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
110 } evName;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
111
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
112 // Skin items
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
113
32919
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
114 #define itNone 0
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
115 #define itButton 101
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
116 #define itHPotmeter 102
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
117 #define itVPotmeter 103
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
118 #define itSLabel 104
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
119 #define itDLabel 105
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
120 #define itBase 106
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
121 #define itPotmeter 107
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
122 #define itFont 108
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
123
32919
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
124 #define itPLMButton (itNone - 1)
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
125 #define itPRMButton (itNone - 2)
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
126
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
127 // Button states
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
128
32920
8661ae44ef39 Redefine button states.
ib
parents: 32919
diff changeset
129 #define btnDisabled 0
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
130 #define btnReleased 1
32920
8661ae44ef39 Redefine button states.
ib
parents: 32919
diff changeset
131 #define btnPressed 2
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
132
32938
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
133 // Item definition
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
134
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
135 #define MAX_ITEMS 64
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
136
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
137 typedef struct {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
138 int type;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
139
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
140 int x, y;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
141 int width, height;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
142
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
143 txSample Bitmap;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
144 txSample Mask;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
145
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
146 int fontid;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
147 int align;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
148 char *label;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
149
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
150 int pwidth, pheight;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
151 int numphases;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
152 float value;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
153
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
154 int message;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
155
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
156 int R, G, B;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
157
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
158 char *text;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
159 int textwidth;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
160 unsigned int starttime;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
161 int last_x;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
162
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
163 int pressed, tmp;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
164 } wItem;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
165
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
166 typedef struct {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
167 wItem main;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
168 wsTWindow mainWindow;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
169 int mainDecoration;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
170
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
171 wItem sub;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
172 wsTWindow subWindow;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
173
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
174 wItem bar;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
175 wsTWindow barWindow;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
176 int barIsPresent;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
177
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
178 wItem menuBase;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
179 wItem menuSelected;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
180 wsTWindow menuWindow;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
181 int menuIsPresent;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
182
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32927
diff changeset
183 int IndexOfMainItems;
32938
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
184 wItem mainItems[MAX_ITEMS];
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
185
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32927
diff changeset
186 int IndexOfBarItems;
32938
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
187 wItem barItems[MAX_ITEMS];
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
188
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32927
diff changeset
189 int IndexOfMenuItems;
32938
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
190 wItem menuItems[MAX_ITEMS];
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32932
diff changeset
191 } guiItems;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
192
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32932
diff changeset
193 extern guiItems appMPlayer;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
194
32948
dc026d74dfce Add variable names to prototype declarations.
ib
parents: 32945
diff changeset
195 int appFindMessage(unsigned char *str);
32932
e95ec1b2feea Cosmetic: Rename appInitStruct() to appFreeStruct().
ib
parents: 32931
diff changeset
196 void appFreeStruct(void);
32945
15aecb36f23e Cosmetic: Rename appResetStruct() appInitStruct().
ib
parents: 32938
diff changeset
197 void appInitStruct(void);
32948
dc026d74dfce Add variable names to prototype declarations.
ib
parents: 32945
diff changeset
198 void btnModify(int event, float state);
dc026d74dfce Add variable names to prototype declarations.
ib
parents: 32945
diff changeset
199 void btnSet(int event, int set);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
200
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
201 #endif /* MPLAYER_GUI_APP_H */