annotate Gui/win32/skinload.h @ 21404:896a8210ed9f

Make sure we do not hang if no streams are available
author reimar
date Fri, 01 Dec 2006 18:51:44 +0000
parents d450ec82ae57
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18914
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
1 /*
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
2 MPlayer Gui for win32
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
3 Copyright (c) 2003 Sascha Sommer <saschasommer@freenet.de>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
4 Copyright (c) 2006 Erik Augustson <erik_27can@yahoo.com>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
5 Copyright (c) 2006 Gianluigi Tiesi <sherpya@netfarm.it>
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
6
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
7 This program is free software; you can redistribute it and/or modify
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
9 the Free Software Foundation; either version 2 of the License, or
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
10 (at your option) any later version.
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
11
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
12 This program is distributed in the hope that it will be useful,
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
15 GNU General Public License for more details.
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
16
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
18 along with this program; if not, write to the Free Software
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
20 */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
21
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
22 #ifndef _SKINLOAD_H
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
23 #define _SKINLOAD_H
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
24
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
25 typedef struct
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
26 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
27 char *name; /* image name */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
28 int size; /* image data size in bytes */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
29 int width; /* image width */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
30 int height; /* image height */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
31 char *data; /* pointer to image data */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
32 } image;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
33
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
34 typedef struct
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
35 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
36 char c;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
37 int x;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
38 int y;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
39 int width;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
40 int height;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
41 } char_t;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
42
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
43 typedef struct
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
44 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
45 char *name;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
46 char *id;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
47 image *image;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
48 unsigned int charcount;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
49 char_t **chars;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
50 } font_t;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
51
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
52 typedef struct
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
53 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
54 int id; /* widget id */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
55 int type; /* widget type */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
56 int window; /* the window it belongs to */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
57 // ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
58 int x, y; /* x and y position the button */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
59 int wx, wy; /* x and y postion of the widget */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
60 int width, height; /* width and height of the button */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
61 int wwidth, wheight; /* width and height of the widget */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
62 // ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
63 // ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
64 int msg, msg2;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
65 int pressed, tmp;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
66 int key, key2;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
67 int phases;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
68 float value;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
69 image *bitmap[2]; /* Associated image(s) in imagepool */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
70 // ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
71 font_t *font;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
72 int length;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
73 int align;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
74 char *label;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
75 // ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
76 int event;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
77 } widget;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
78
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
79 typedef struct
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
80 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
81 char *name;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
82 int decoration;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
83 int type;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
84 widget *base;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
85 int backgroundcolor[3];
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
86 void *priv;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
87 } window;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
88
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
89 typedef struct skin_t skin_t;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
90 struct skin_t
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
91 {
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
92 char *skindir;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
93 unsigned int widgetcount; /* number of widgets */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
94 unsigned int lastusedid; /* which widget id was used last */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
95 widget **widgets; /* widget handle */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
96 unsigned int imagecount; /* number of images */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
97 image **images; /* image handle */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
98 int desktopbpp; /* image format of those images */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
99 unsigned int fontcount;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
100 font_t **fonts;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
101
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
102 unsigned int windowcount; /* number of windows */
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
103 window **windows;
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
104 void (*freeskin)(skin_t* skin);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
105 void (*addwidget)(skin_t *skin, window *win, const char *desc);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
106 void (*removewidget)(skin_t *skin, int id);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
107 char *(*geteventname)(int event);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
108 image *(*pngRead)(skin_t *skin, unsigned char *fname);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
109 };
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
110
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
111 extern skin_t *loadskin(char *skindir, int desktopbpp);
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
112
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
113 // --- Widget types ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
114
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
115 #define tyBase 1
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
116 #define tyButton 2
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
117 #define tyHpotmeter 3
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
118 #define tyVpotmeter 4
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
119 #define tyPotmeter 5
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
120 #define tyMenu 6
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
121 #define tySlabel 7
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
122 #define tyDlabel 8
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
123
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
124 // --- Window types ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
125
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
126 #define wiMain 1
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
127 #define wiSub 2
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
128 #define wiMenu 3
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
129 #define wiPlaybar 4
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
130
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
131 // --- User events ------
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
132
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
133 #define evNone 0
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
134 #define evPlay 1
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
135 #define evStop 2
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
136 #define evPause 3
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
137 #define evPrev 6
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
138 #define evNext 7
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
139 #define evLoad 8
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
140 #define evEqualizer 9
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
141 #define evPlayList 10
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
142 #define evIconify 11
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
143 #define evAbout 12
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
144 #define evLoadPlay 13
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
145 #define evPreferences 14
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
146 #define evSkinBrowser 15
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
147 #define evPlaySwitchToPause 16
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
148 #define evPauseSwitchToPlay 17
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
149
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
150 #define evBackward10sec 18
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
151 #define evForward10sec 19
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
152 #define evBackward1min 20
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
153 #define evForward1min 21
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
154 #define evBackward10min 22
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
155 #define evForward10min 23
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
156
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
157 #define evNormalSize 24
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
158 #define evDoubleSize 25
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
159 #define evFullScreen 26
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
160
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
161 #define evSetMoviePosition 27
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
162 #define evSetVolume 28
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
163 #define evSetBalance 29
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
164 #define evMute 30
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
165
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
166 #define evIncVolume 31
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
167 #define evDecVolume 32
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
168 #define evIncAudioBufDelay 33
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
169 #define evDecAudioBufDelay 34
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
170 #define evIncBalance 35
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
171 #define evDecBalance 36
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
172
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
173 #define evHelp 37
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
174
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
175 #define evLoadSubtitle 38
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
176 #define evDropSubtitle 43
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
177 #define evPlayDVD 39
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
178 #define evPlayVCD 40
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
179 #define evPlayNetwork 41
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
180 #define evLoadAudioFile 42
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
181 #define evSetAspect 44
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
182 #define evSetAudio 45
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
183 #define evSetVideo 46
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
184 #define evDropFile 47
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
185 #define evPlayCD 48
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
186
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
187 #define evExit 1000
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
188
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
189 // --- General events ---
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
190
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
191 #define evFileLoaded 5000
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
192 #define evHideMouseCursor 5001
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
193 #define evMessageBox 5002
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
194 #define evGeneralTimer 5003
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
195 #define evGtkIsOk 5004
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
196 #define evShowPopUpMenu 5005
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
197 #define evHidePopUpMenu 5006
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
198 #define evSetDVDAudio 5007
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
199 #define evSetDVDSubtitle 5008
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
200 #define evSetDVDTitle 5009
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
201 #define evSetDVDChapter 5010
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
202 #define evSubtitleLoaded 5011
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
203 #define evSetVCDTrack 5012
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
204 #define evSetURL 5013
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
205
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
206 #define evFName 7000
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
207 #define evMovieTime 7001
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
208 #define evRedraw 7002
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
209 #define evHideWindow 7003
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
210 #define evShowWindow 7004
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
211 #define evFirstLoad 7005
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
212
d450ec82ae57 Initial win32 gui release.
vayne
parents:
diff changeset
213 #endif