Mercurial > audlegacy
annotate src/audacious/widgets/skin.h @ 3238:ceaaadccfa00
Add a system path for default presets.
Patch by: Massimo Cavalleri
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Sat, 04 Aug 2007 03:02:38 -0500 |
parents | f1c756f39e6c |
children |
rev | line source |
---|---|
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3056
diff
changeset
|
1 /* Audacious |
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3056
diff
changeset
|
2 * Copyright (C) 2005-2007 Audacious development team. |
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3056
diff
changeset
|
3 * |
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3056
diff
changeset
|
4 * BMP - Cross-platform multimedia player |
2313 | 5 * Copyright (C) 2003-2004 BMP development team. |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3056
diff
changeset
|
12 * the Free Software Foundation; under version 3 of the License. |
2313 | 13 * |
14 * This program 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 * | |
19 * You should have received a copy of the GNU General Public License | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3056
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
21 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
22 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
23 * Audacious or using our public API to be a derived work. |
2313 | 24 */ |
25 | |
26 #ifndef _WIDGETCORE_H_ | |
27 #error Please do not include me directly! Use widgetcore.h instead! | |
28 #endif | |
29 | |
30 #ifndef SKIN_H | |
31 #define SKIN_H | |
32 | |
33 | |
34 #include <glib.h> | |
35 #include <gdk/gdk.h> | |
36 | |
37 | |
38 #define BMP_DEFAULT_SKIN_PATH \ | |
39 DATA_DIR G_DIR_SEPARATOR_S "Skins" G_DIR_SEPARATOR_S "Default" | |
40 | |
41 | |
42 typedef enum { | |
43 SKIN_MAIN = 0, | |
44 SKIN_CBUTTONS, | |
45 SKIN_TITLEBAR, | |
46 SKIN_SHUFREP, | |
47 SKIN_TEXT, | |
48 SKIN_VOLUME, | |
49 SKIN_BALANCE, | |
50 SKIN_MONOSTEREO, | |
51 SKIN_PLAYPAUSE, | |
52 SKIN_NUMBERS, | |
53 SKIN_POSBAR, | |
54 SKIN_PLEDIT, | |
55 SKIN_EQMAIN, | |
56 SKIN_EQ_EX, | |
57 SKIN_PIXMAP_COUNT | |
58 } SkinPixmapId; | |
59 | |
60 typedef enum { | |
61 SKIN_MASK_MAIN = 0, | |
62 SKIN_MASK_MAIN_SHADE, | |
63 SKIN_MASK_EQ, | |
64 SKIN_MASK_EQ_SHADE, | |
65 SKIN_MASK_COUNT | |
66 } SkinMaskId; | |
67 | |
68 typedef enum { | |
69 SKIN_PLEDIT_NORMAL = 0, | |
70 SKIN_PLEDIT_CURRENT, | |
71 SKIN_PLEDIT_NORMALBG, | |
72 SKIN_PLEDIT_SELECTEDBG, | |
73 SKIN_TEXTBG, | |
74 SKIN_TEXTFG, | |
75 SKIN_COLOR_COUNT | |
76 } SkinColorId; | |
77 | |
78 typedef struct _SkinProperties { | |
79 /* this enables the othertext engine, not it's visibility -nenolod */ | |
80 gboolean mainwin_othertext; | |
81 | |
82 /* Vis properties */ | |
83 gint mainwin_vis_x; | |
84 gint mainwin_vis_y; | |
85 gint mainwin_vis_width; | |
86 gboolean mainwin_vis_visible; | |
87 | |
88 /* Text properties */ | |
89 gint mainwin_text_x; | |
90 gint mainwin_text_y; | |
91 gint mainwin_text_width; | |
92 gboolean mainwin_text_visible; | |
93 | |
94 /* Infobar properties */ | |
95 gint mainwin_infobar_x; | |
96 gint mainwin_infobar_y; | |
97 gboolean mainwin_othertext_visible; | |
98 | |
99 gint mainwin_number_0_x; | |
100 gint mainwin_number_0_y; | |
101 | |
102 gint mainwin_number_1_x; | |
103 gint mainwin_number_1_y; | |
104 | |
105 gint mainwin_number_2_x; | |
106 gint mainwin_number_2_y; | |
107 | |
108 gint mainwin_number_3_x; | |
109 gint mainwin_number_3_y; | |
110 | |
111 gint mainwin_number_4_x; | |
112 gint mainwin_number_4_y; | |
113 | |
114 gint mainwin_playstatus_x; | |
115 gint mainwin_playstatus_y; | |
116 | |
117 gint mainwin_volume_x; | |
118 gint mainwin_volume_y; | |
119 | |
120 gint mainwin_balance_x; | |
121 gint mainwin_balance_y; | |
122 | |
123 gint mainwin_position_x; | |
124 gint mainwin_position_y; | |
125 | |
126 gint mainwin_previous_x; | |
127 gint mainwin_previous_y; | |
128 | |
129 gint mainwin_play_x; | |
130 gint mainwin_play_y; | |
131 | |
132 gint mainwin_pause_x; | |
133 gint mainwin_pause_y; | |
134 | |
135 gint mainwin_stop_x; | |
136 gint mainwin_stop_y; | |
137 | |
138 gint mainwin_next_x; | |
139 gint mainwin_next_y; | |
140 | |
141 gint mainwin_eject_x; | |
142 gint mainwin_eject_y; | |
143 | |
144 gint mainwin_eqbutton_x; | |
145 gint mainwin_eqbutton_y; | |
146 | |
147 gint mainwin_plbutton_x; | |
148 gint mainwin_plbutton_y; | |
149 | |
150 gint mainwin_shuffle_x; | |
151 gint mainwin_shuffle_y; | |
152 | |
153 gint mainwin_repeat_x; | |
154 gint mainwin_repeat_y; | |
155 | |
156 gint mainwin_about_x; | |
157 gint mainwin_about_y; | |
158 | |
159 gint mainwin_minimize_x; | |
160 gint mainwin_minimize_y; | |
161 | |
162 gint mainwin_shade_x; | |
163 gint mainwin_shade_y; | |
164 | |
165 gint mainwin_close_x; | |
166 gint mainwin_close_y; | |
167 | |
168 gint mainwin_width; | |
169 gint mainwin_height; | |
170 | |
171 gboolean mainwin_menurow_visible; | |
172 gboolean mainwin_othertext_is_status; | |
173 | |
174 gint textbox_bitmap_font_width; | |
175 gint textbox_bitmap_font_height; | |
176 } SkinProperties; | |
177 | |
178 #define SKIN_PIXMAP(x) ((SkinPixmap *)(x)) | |
179 typedef struct _SkinPixmap { | |
180 GdkPixmap *pixmap; | |
181 /* GdkPixmap *def_pixmap; */ | |
182 | |
183 /* The real size of the pixmap */ | |
184 gint width, height; | |
185 | |
186 /* The size of the pixmap from the current skin, | |
187 which might be smaller */ | |
188 gint current_width, current_height; | |
189 } SkinPixmap; | |
190 | |
191 | |
192 #define SKIN(x) ((Skin *)(x)) | |
193 typedef struct _Skin { | |
194 GMutex *lock; | |
195 gchar *path; | |
196 gchar *def_path; | |
197 SkinPixmap pixmaps[SKIN_PIXMAP_COUNT]; | |
198 GdkColor textbg[6], def_textbg[6]; | |
199 GdkColor textfg[6], def_textfg[6]; | |
200 GdkColor *colors[SKIN_COLOR_COUNT]; | |
201 guchar vis_color[24][3]; | |
202 GdkBitmap *masks[SKIN_MASK_COUNT]; | |
203 GdkBitmap *ds_masks[SKIN_MASK_COUNT]; | |
204 SkinProperties properties; | |
205 } Skin; | |
206 | |
207 extern Skin *bmp_active_skin; | |
208 | |
209 gboolean init_skins(const gchar * path); | |
210 void cleanup_skins(void); | |
211 | |
212 gboolean bmp_active_skin_load(const gchar * path); | |
213 gboolean bmp_active_skin_reload(void); | |
214 | |
215 Skin *skin_new(void); | |
216 gboolean skin_load(Skin * skin, const gchar * path); | |
2443
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
217 gboolean skin_reload_forced(void); |
2313 | 218 void skin_reload(Skin * skin); |
219 void skin_free(Skin * skin); | |
220 | |
221 GdkBitmap *skin_get_mask(Skin * skin, SkinMaskId mi); | |
222 GdkColor *skin_get_color(Skin * skin, SkinColorId color_id); | |
223 | |
224 void skin_get_viscolor(Skin * skin, guchar vis_color[24][3]); | |
225 gint skin_get_id(void); | |
226 void skin_draw_pixmap(Skin * skin, GdkDrawable * drawable, GdkGC * gc, | |
227 SkinPixmapId pixmap_id, | |
228 gint xsrc, gint ysrc, gint xdest, gint ydest, | |
229 gint width, gint height); | |
230 void skin_get_eq_spline_colors(Skin * skin, guint32 colors[19]); | |
231 void skin_install_skin(const gchar * path); | |
232 | |
233 void skin_draw_playlistwin_shaded(Skin * skin, | |
234 GdkDrawable * drawable, GdkGC * gc, | |
235 gint width, gboolean focus); | |
236 void skin_draw_playlistwin_frame(Skin * skin, | |
237 GdkDrawable * drawable, GdkGC * gc, | |
238 gint width, gint height, gboolean focus); | |
239 | |
240 void skin_draw_mainwin_titlebar(Skin * skin, | |
241 GdkDrawable * drawable, GdkGC * gc, | |
242 gboolean shaded, gboolean focus); | |
243 | |
244 | |
245 void skin_parse_hints(Skin * skin, gchar *path_p); | |
246 | |
247 | |
2443
93686e8815a4
[svn] - Changed playback_set_random_skin() to skin_set_random_skin()
mf0102
parents:
2313
diff
changeset
|
248 void skin_set_random_skin(void); |
2313 | 249 |
250 #endif |