Mercurial > mplayer.hg
annotate gui/win32/skinload.h @ 36569:6ff73f13785c
demux_roq: Simplify code by using calloc.
This also fixes the issue that total_audio_sample_count was never
initialized.
author | reimar |
---|---|
date | Mon, 20 Jan 2014 22:08:34 +0000 |
parents | 28ea255e40ce |
children | 2b3ede5f8424 |
rev | line source |
---|---|
23077 | 1 /* |
23079 | 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 file is part of MPlayer. | |
8 * | |
9 * MPlayer is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * MPlayer is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
26457 | 19 * You should have received a copy of the GNU General Public License along |
20 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
23079 | 22 */ |
23077 | 23 |
26029 | 24 #ifndef MPLAYER_GUI_SKINLOAD_H |
25 #define MPLAYER_GUI_SKINLOAD_H | |
23077 | 26 |
27 typedef struct | |
28 { | |
29 char *name; /* image name */ | |
30 int size; /* image data size in bytes */ | |
31 int width; /* image width */ | |
32 int height; /* image height */ | |
33 char *data; /* pointer to image data */ | |
34 } image; | |
35 | |
36 typedef struct | |
37 { | |
38 char c; | |
39 int x; | |
40 int y; | |
41 int width; | |
42 int height; | |
43 } char_t; | |
44 | |
45 typedef struct | |
46 { | |
47 char *name; | |
48 char *id; | |
49 image *image; | |
50 unsigned int charcount; | |
51 char_t **chars; | |
52 } font_t; | |
53 | |
54 typedef struct | |
55 { | |
56 int id; /* widget id */ | |
57 int type; /* widget type */ | |
58 int window; /* the window it belongs to */ | |
59 // --- | |
60 int x, y; /* x and y position the button */ | |
61 int wx, wy; /* x and y postion of the widget */ | |
62 int width, height; /* width and height of the button */ | |
63 int wwidth, wheight; /* width and height of the widget */ | |
64 // --- | |
65 // --- | |
66 int msg, msg2; | |
67 int pressed, tmp; | |
68 int key, key2; | |
69 int phases; | |
70 float value; | |
71 image *bitmap[2]; /* Associated image(s) in imagepool */ | |
72 // --- | |
73 font_t *font; | |
74 int length; | |
75 int align; | |
76 char *label; | |
77 // --- | |
78 int event; | |
79 } widget; | |
80 | |
81 typedef struct | |
82 { | |
83 char *name; | |
84 int decoration; | |
85 int type; | |
86 widget *base; | |
87 int backgroundcolor[3]; | |
88 void *priv; | |
89 } window; | |
90 | |
91 typedef struct skin_t skin_t; | |
92 struct skin_t | |
93 { | |
94 char *skindir; | |
95 unsigned int widgetcount; /* number of widgets */ | |
96 unsigned int lastusedid; /* which widget id was used last */ | |
97 widget **widgets; /* widget handle */ | |
98 unsigned int imagecount; /* number of images */ | |
99 image **images; /* image handle */ | |
100 int desktopbpp; /* image format of those images */ | |
101 unsigned int fontcount; | |
102 font_t **fonts; | |
103 | |
104 unsigned int windowcount; /* number of windows */ | |
105 window **windows; | |
106 void (*freeskin)(skin_t* skin); | |
107 void (*addwidget)(skin_t *skin, window *win, const char *desc); | |
108 void (*removewidget)(skin_t *skin, int id); | |
109 char *(*geteventname)(int event); | |
33784 | 110 image *(*pngRead)(skin_t *skin, const char *fname); |
23077 | 111 }; |
112 | |
28051 | 113 skin_t *loadskin(char *skindir, int desktopbpp); |
23077 | 114 |
34684 | 115 /* --- Widget types --- */ |
23077 | 116 |
117 #define tyBase 1 | |
118 #define tyButton 2 | |
119 #define tyHpotmeter 3 | |
120 #define tyVpotmeter 4 | |
121 #define tyPotmeter 5 | |
122 #define tyMenu 6 | |
123 #define tySlabel 7 | |
124 #define tyDlabel 8 | |
125 | |
34684 | 126 /* --- Window types --- */ |
23077 | 127 |
128 #define wiMain 1 | |
34697 | 129 #define wiVideo 2 |
23077 | 130 #define wiMenu 3 |
131 #define wiPlaybar 4 | |
132 | |
34684 | 133 /* --- User events --- */ |
23077 | 134 |
35503
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
135 enum |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
136 { |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
137 evNone, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
138 evPlay, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
139 evStop, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
140 evPause, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
141 evPrev, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
142 evNext, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
143 evLoad, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
144 evLoadPlay, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
145 evLoadAudioFile, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
146 evLoadSubtitle, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
147 evDropSubtitle, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
148 evPlaylist, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
149 evPlayCD, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
150 evPlayVCD, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
151 evPlayDVD, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
152 evLoadURL, |
36429 | 153 evPlayTV, |
35503
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
154 evPlaySwitchToPause, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
155 evPauseSwitchToPlay, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
156 evBackward10sec, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
157 evForward10sec, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
158 evBackward1min, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
159 evForward1min, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
160 evBackward10min, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
161 evForward10min, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
162 evSetMoviePosition, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
163 evHalfSize, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
164 evDoubleSize, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
165 evFullScreen, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
166 evNormalSize, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
167 evSetAspect, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
168 evIncVolume, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
169 evDecVolume, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
170 evSetVolume, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
171 evMute, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
172 evSetBalance, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
173 evEqualizer, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
174 evAbout, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
175 evPreferences, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
176 evSkinBrowser, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
177 evMenu, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
178 evIconify, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
179 evExit = 100 |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
180 }; |
34317 | 181 |
34684 | 182 /* --- Internal events --- */ |
34317 | 183 |
35503
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
184 enum |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
185 { |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
186 ivSetVideo = 1000, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
187 ivSetAudio, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
188 ivSetSubtitle, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
189 ivSetCDTrack, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
190 ivSetVCDTrack, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
191 ivSetDVDTitle, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
192 ivSetDVDChapter, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
193 ivSetDVDAudio, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
194 ivSetDVDSubtitle, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
195 ivPlayDVD, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
196 ivShowPopUpMenu, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
197 ivHidePopUpMenu, |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
198 ivRedraw |
ac6c531dc9d1
Replace symbolic GUI message (event) constants by enums.
ib
parents:
34697
diff
changeset
|
199 }; |
23077 | 200 |
26029 | 201 #endif /* MPLAYER_GUI_SKINLOAD_H */ |