annotate gui/app.h @ 35114:bec9e755fb9b

Fix handling of out-of-order slice rendered frames.
author reimar
date Fri, 21 Sep 2012 20:20:11 +0000
parents ac6b38cd0d45
children ac6c531dc9d1
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
33046
9684ad0e1291 Move files with auxiliary functions to own directory.
ib
parents: 32948
diff changeset
22 #include "util/bitmap.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23 #include "wm/ws.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
24
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34458
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
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
28
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29 #define evPlay 1
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30 #define evStop 2
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
31 #define evPause 3
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32 #define evPrev 6
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
33 #define evNext 7
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34 #define evLoad 8
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
35 #define evLoadPlay 13
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
36 #define evLoadAudioFile 42
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
37 #define evLoadSubtitle 38
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
38 #define evDropSubtitle 43
34321
daebf766dea6 Cosmetic: Synchronize evPlaylist event and message names.
ib
parents: 34317
diff changeset
39 #define evPlaylist 10
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34339
diff changeset
40 #define evPlayCD 48
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
41 #define evPlayVCD 40
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
42 #define evPlayDVD 39
34324
58aaa0d8cc82 Replace evSetURL by evLoadURL for consistency.
ib
parents: 34322
diff changeset
43 #define evLoadURL 5013
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44 #define evPlaySwitchToPause 16
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45 #define evPauseSwitchToPlay 17
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47 #define evBackward10sec 18
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48 #define evForward10sec 19
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 #define evBackward1min 20
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50 #define evForward1min 21
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 #define evBackward10min 22
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 #define evForward10min 23
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
53 #define evSetMoviePosition 27
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
55 #define evHalfSize 301
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56 #define evDoubleSize 25
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 #define evFullScreen 26
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
58 #define evNormalSize 24
34322
6075b19ad3ad Cosmetic: Add evSetAspect event to video events.
ib
parents: 34321
diff changeset
59 #define evSetAspect 44
23077
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
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
63 #define evSetVolume 28
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
64 #define evMute 30
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
65 #define evSetBalance 29
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
66 #define evEqualizer 9
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
67
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
68 #define evAbout 12
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
69 #define evPreferences 14
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
70 #define evSkinBrowser 15
34458
1e84148527ab Add user event evMenu.
ib
parents: 34455
diff changeset
71 #define evMenu 33
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
72
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
73 #define evIconify 11
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
74 #define evExit 1000
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
75
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34458
diff changeset
76 /* Internal events */
34317
e905a896243d Cosmetic: Rearrange and group GUI user events.
ib
parents: 33555
diff changeset
77
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
78 #define ivSetAudio 45
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
79 #define ivSetVideo 46
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
80 #define ivSetSubtitle 47
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
82 #define ivShowPopUpMenu 5005
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
83 #define ivHidePopUpMenu 5006
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
84 #define ivSetDVDAudio 5007
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
85 #define ivSetDVDSubtitle 5008
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
86 #define ivSetDVDTitle 5009
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
87 #define ivSetDVDChapter 5010
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
88 #define ivSetVCDTrack 5012
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34339
diff changeset
89 #define ivSetCDTrack 5014
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34331
diff changeset
91 #define ivRedraw 7002
34455
00cf27b14c15 Replace goto label by an internal event case expression.
ib
parents: 34387
diff changeset
92 #define ivPlayDVD 7003
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
94 typedef struct {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
95 int message;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
96 const char *name;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
97 } evName;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34458
diff changeset
99 /* Skin items */
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
100
32919
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
101 #define itNone 0
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
102 #define itButton 101
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
103 #define itHPotmeter 102
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
104 #define itVPotmeter 103
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
105 #define itSLabel 104
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
106 #define itDLabel 105
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
107 #define itBase 106
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
108 #define itPotmeter 107
33100
35efac3ece2c Add an itMenu item type.
ib
parents: 33099
diff changeset
109 #define itMenu 108
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
110
32919
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
111 #define itPLMButton (itNone - 1)
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
112 #define itPRMButton (itNone - 2)
933e784fb598 Cosmetic: Adjust item definitions.
ib
parents: 32912
diff changeset
113
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34458
diff changeset
114 /* Button states */
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
115
32920
8661ae44ef39 Redefine button states.
ib
parents: 32919
diff changeset
116 #define btnDisabled 0
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
117 #define btnReleased 1
32920
8661ae44ef39 Redefine button states.
ib
parents: 32919
diff changeset
118 #define btnPressed 2
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
119
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34458
diff changeset
120 /* Item definition */
32938
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
121
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
122 #define MAX_ITEMS 64
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
123
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
124 typedef struct {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
125 int type;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
126
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
127 int x, y;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
128 int width, height;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
129
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
130 guiImage Bitmap;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
131 guiImage Mask;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
132
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
133 int fontid;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
134 int align;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
135 char *label;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
136
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
137 int pwidth, pheight;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
138 int numphases;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
139 float value;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
140
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
141 int message;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
142
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
143 int R, G, B;
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
144
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
145 char *text;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
146 int textwidth;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
147 unsigned int starttime;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
148 int last_x;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
149
33103
eabc2472e7eb Remove unused wItem member tmp.
ib
parents: 33100
diff changeset
150 int pressed;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151 } wItem;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
152
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
153 typedef struct {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
154 wItem main;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
155 wsTWindow mainWindow;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
156 int mainDecoration;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
157
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34684
diff changeset
158 wItem video;
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34684
diff changeset
159 wsTWindow videoWindow;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
160
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
161 wItem playbar;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
162 wsTWindow playbarWindow;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
163 int playbarIsPresent;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28051
diff changeset
164
33084
b8779b19730e Cosmetic: Rename menuBase menu.
ib
parents: 33046
diff changeset
165 wItem menu;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
166 wItem menuSelected;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
167 wsTWindow menuWindow;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
168 int menuIsPresent;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
169
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32927
diff changeset
170 int IndexOfMainItems;
32938
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
171 wItem mainItems[MAX_ITEMS];
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
172
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
173 int IndexOfPlaybarItems;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
174 wItem playbarItems[MAX_ITEMS];
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
175
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32927
diff changeset
176 int IndexOfMenuItems;
32938
29ce708287dd Reduce item arrays to reasonable size.
ib
parents: 32937
diff changeset
177 wItem menuItems[MAX_ITEMS];
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32932
diff changeset
178 } guiItems;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
179
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33266
diff changeset
180 extern guiItems guiApp;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181
34339
f05c75392897 Enable gui slave commands.
ib
parents: 34333
diff changeset
182 wItem *appFindItem(int event);
34328
6cfca461669c Change parameter name and its declaration to const.
ib
parents: 34326
diff changeset
183 int appFindMessage(const char *name);
32932
e95ec1b2feea Cosmetic: Rename appInitStruct() to appFreeStruct().
ib
parents: 32931
diff changeset
184 void appFreeStruct(void);
32948
dc026d74dfce Add variable names to prototype declarations.
ib
parents: 32945
diff changeset
185 void btnModify(int event, float state);
dc026d74dfce Add variable names to prototype declarations.
ib
parents: 32945
diff changeset
186 void btnSet(int event, int set);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
187
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
188 #endif /* MPLAYER_GUI_APP_H */