Mercurial > audlegacy
annotate audacious/widgets/skin.h @ 1780:be1de1dd7262 trunk
[svn] - implement [skin.hints:mainwinVisWidth] property.
author | nenolod |
---|---|
date | Wed, 04 Oct 2006 03:39:41 -0700 |
parents | 87d4da9b31ea |
children | 641ee4092aea |
rev | line source |
---|---|
1653 | 1 /* BMP - Cross-platform multimedia player |
2 * Copyright (C) 2003-2004 BMP development team. | |
3 * | |
4 * Based on XMMS: | |
5 * Copyright (C) 1998-2003 XMMS development team. | |
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 Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 */ | |
21 | |
22 #ifndef _WIDGETCORE_H_ | |
23 #error Please do not include me directly! Use widgetcore.h instead! | |
24 #endif | |
25 | |
26 #ifndef SKIN_H | |
27 #define SKIN_H | |
28 | |
29 | |
30 #include <glib.h> | |
31 #include <gdk/gdk.h> | |
32 | |
33 | |
34 #define BMP_DEFAULT_SKIN_PATH \ | |
35 DATA_DIR G_DIR_SEPARATOR_S "Skins" G_DIR_SEPARATOR_S "Default" | |
36 | |
37 | |
38 typedef enum { | |
39 SKIN_MAIN = 0, | |
40 SKIN_CBUTTONS, | |
41 SKIN_TITLEBAR, | |
42 SKIN_SHUFREP, | |
43 SKIN_TEXT, | |
44 SKIN_VOLUME, | |
45 SKIN_BALANCE, | |
46 SKIN_MONOSTEREO, | |
47 SKIN_PLAYPAUSE, | |
48 SKIN_NUMBERS, | |
49 SKIN_POSBAR, | |
50 SKIN_PLEDIT, | |
51 SKIN_EQMAIN, | |
52 SKIN_EQ_EX, | |
53 SKIN_PIXMAP_COUNT | |
54 } SkinPixmapId; | |
55 | |
56 typedef enum { | |
57 SKIN_MASK_MAIN = 0, | |
58 SKIN_MASK_MAIN_SHADE, | |
59 SKIN_MASK_EQ, | |
60 SKIN_MASK_EQ_SHADE, | |
61 SKIN_MASK_COUNT | |
62 } SkinMaskId; | |
63 | |
64 typedef enum { | |
65 SKIN_PLEDIT_NORMAL = 0, | |
66 SKIN_PLEDIT_CURRENT, | |
67 SKIN_PLEDIT_NORMALBG, | |
68 SKIN_PLEDIT_SELECTEDBG, | |
69 SKIN_TEXTBG, | |
70 SKIN_TEXTFG, | |
71 SKIN_COLOR_COUNT | |
72 } SkinColorId; | |
73 | |
74 typedef struct _SkinProperties { | |
75 gboolean mainwin_othertext; | |
1772
cb216af25b55
[svn] - framework for repositioning the vis element on the skin.
nenolod
parents:
1653
diff
changeset
|
76 gint mainwin_vis_x; |
cb216af25b55
[svn] - framework for repositioning the vis element on the skin.
nenolod
parents:
1653
diff
changeset
|
77 gint mainwin_vis_y; |
1780
be1de1dd7262
[svn] - implement [skin.hints:mainwinVisWidth] property.
nenolod
parents:
1779
diff
changeset
|
78 gint mainwin_vis_width; |
1773 | 79 gint mainwin_text_x; |
80 gint mainwin_text_y; | |
1777
17e38b5c8e2f
[svn] - support for the [skin.hints:mainwinTextWidth] property.
nenolod
parents:
1773
diff
changeset
|
81 gint mainwin_text_width; |
1773 | 82 gint mainwin_infobar_x; |
83 gint mainwin_infobar_y; | |
1778
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
84 |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
85 gint mainwin_number_0_x; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
86 gint mainwin_number_0_y; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
87 |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
88 gint mainwin_number_1_x; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
89 gint mainwin_number_1_y; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
90 |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
91 gint mainwin_number_2_x; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
92 gint mainwin_number_2_y; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
93 |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
94 gint mainwin_number_3_x; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
95 gint mainwin_number_3_y; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
96 |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
97 gint mainwin_number_4_x; |
1d3d05c541d3
[svn] - support for: [skin.hints:mainwinNumber(0-4)(X,Y)] properties.
nenolod
parents:
1777
diff
changeset
|
98 gint mainwin_number_4_y; |
1779
87d4da9b31ea
[svn] - implement [skin.hints:mainwinPlayStatus(X,Y)] properties.
nenolod
parents:
1778
diff
changeset
|
99 |
87d4da9b31ea
[svn] - implement [skin.hints:mainwinPlayStatus(X,Y)] properties.
nenolod
parents:
1778
diff
changeset
|
100 gint mainwin_playstatus_x; |
87d4da9b31ea
[svn] - implement [skin.hints:mainwinPlayStatus(X,Y)] properties.
nenolod
parents:
1778
diff
changeset
|
101 gint mainwin_playstatus_y; |
1653 | 102 } SkinProperties; |
103 | |
104 #define SKIN_PIXMAP(x) ((SkinPixmap *)(x)) | |
105 typedef struct _SkinPixmap { | |
106 GdkPixmap *pixmap; | |
107 /* GdkPixmap *def_pixmap; */ | |
108 | |
109 /* The real size of the pixmap */ | |
110 gint width, height; | |
111 | |
112 /* The size of the pixmap from the current skin, | |
113 which might be smaller */ | |
114 gint current_width, current_height; | |
115 } SkinPixmap; | |
116 | |
117 | |
118 #define SKIN(x) ((Skin *)(x)) | |
119 typedef struct _Skin { | |
120 GMutex *lock; | |
121 gchar *path; | |
122 gchar *def_path; | |
123 SkinPixmap pixmaps[SKIN_PIXMAP_COUNT]; | |
124 GdkColor textbg[6], def_textbg[6]; | |
125 GdkColor textfg[6], def_textfg[6]; | |
126 GdkColor *colors[SKIN_COLOR_COUNT]; | |
127 guchar vis_color[24][3]; | |
128 GdkBitmap *masks[SKIN_MASK_COUNT]; | |
129 SkinProperties properties; | |
130 } Skin; | |
131 | |
132 extern Skin *bmp_active_skin; | |
133 | |
134 gboolean init_skins(const gchar * path); | |
135 void cleanup_skins(void); | |
136 | |
137 gboolean bmp_active_skin_load(const gchar * path); | |
138 gboolean bmp_active_skin_reload(void); | |
139 | |
140 Skin *skin_new(void); | |
141 gboolean skin_load(Skin * skin, const gchar * path); | |
142 void skin_reload(Skin * skin); | |
143 void skin_free(Skin * skin); | |
144 | |
145 GdkBitmap *skin_get_mask(Skin * skin, SkinMaskId mi); | |
146 GdkColor *skin_get_color(Skin * skin, SkinColorId color_id); | |
147 | |
148 void skin_get_viscolor(Skin * skin, guchar vis_color[24][3]); | |
149 gint skin_get_id(void); | |
150 void skin_draw_pixmap(Skin * skin, GdkDrawable * drawable, GdkGC * gc, | |
151 SkinPixmapId pixmap_id, | |
152 gint xsrc, gint ysrc, gint xdest, gint ydest, | |
153 gint width, gint height); | |
154 void skin_get_eq_spline_colors(Skin * skin, guint32 colors[19]); | |
155 void skin_install_skin(const gchar * path); | |
156 | |
157 void skin_draw_playlistwin_shaded(Skin * skin, | |
158 GdkDrawable * drawable, GdkGC * gc, | |
159 gint width, gboolean focus); | |
160 void skin_draw_playlistwin_frame(Skin * skin, | |
161 GdkDrawable * drawable, GdkGC * gc, | |
162 gint width, gint height, gboolean focus); | |
163 | |
164 void skin_draw_mainwin_titlebar(Skin * skin, | |
165 GdkDrawable * drawable, GdkGC * gc, | |
166 gboolean shaded, gboolean focus); | |
167 | |
168 | |
169 void skin_parse_hints(Skin * skin, gchar *path_p); | |
170 | |
171 | |
172 gboolean | |
173 skin_reload_forced(void); | |
174 | |
175 #endif |