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