annotate gui/win32/skinload.h @ 36888:47c6c14f386b

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