Mercurial > audlegacy
annotate audacious/widgets/skin.h @ 1777:17e38b5c8e2f trunk
[svn] - support for the [skin.hints:mainwinTextWidth] property.
author | nenolod |
---|---|
date | Wed, 04 Oct 2006 02:22:04 -0700 |
parents | 7913bae43086 |
children | 1d3d05c541d3 |
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; |
1773 | 78 gint mainwin_text_x; |
79 gint mainwin_text_y; | |
1777
17e38b5c8e2f
[svn] - support for the [skin.hints:mainwinTextWidth] property.
nenolod
parents:
1773
diff
changeset
|
80 gint mainwin_text_width; |
1773 | 81 gint mainwin_infobar_x; |
82 gint mainwin_infobar_y; | |
1653 | 83 } SkinProperties; |
84 | |
85 #define SKIN_PIXMAP(x) ((SkinPixmap *)(x)) | |
86 typedef struct _SkinPixmap { | |
87 GdkPixmap *pixmap; | |
88 /* GdkPixmap *def_pixmap; */ | |
89 | |
90 /* The real size of the pixmap */ | |
91 gint width, height; | |
92 | |
93 /* The size of the pixmap from the current skin, | |
94 which might be smaller */ | |
95 gint current_width, current_height; | |
96 } SkinPixmap; | |
97 | |
98 | |
99 #define SKIN(x) ((Skin *)(x)) | |
100 typedef struct _Skin { | |
101 GMutex *lock; | |
102 gchar *path; | |
103 gchar *def_path; | |
104 SkinPixmap pixmaps[SKIN_PIXMAP_COUNT]; | |
105 GdkColor textbg[6], def_textbg[6]; | |
106 GdkColor textfg[6], def_textfg[6]; | |
107 GdkColor *colors[SKIN_COLOR_COUNT]; | |
108 guchar vis_color[24][3]; | |
109 GdkBitmap *masks[SKIN_MASK_COUNT]; | |
110 SkinProperties properties; | |
111 } Skin; | |
112 | |
113 extern Skin *bmp_active_skin; | |
114 | |
115 gboolean init_skins(const gchar * path); | |
116 void cleanup_skins(void); | |
117 | |
118 gboolean bmp_active_skin_load(const gchar * path); | |
119 gboolean bmp_active_skin_reload(void); | |
120 | |
121 Skin *skin_new(void); | |
122 gboolean skin_load(Skin * skin, const gchar * path); | |
123 void skin_reload(Skin * skin); | |
124 void skin_free(Skin * skin); | |
125 | |
126 GdkBitmap *skin_get_mask(Skin * skin, SkinMaskId mi); | |
127 GdkColor *skin_get_color(Skin * skin, SkinColorId color_id); | |
128 | |
129 void skin_get_viscolor(Skin * skin, guchar vis_color[24][3]); | |
130 gint skin_get_id(void); | |
131 void skin_draw_pixmap(Skin * skin, GdkDrawable * drawable, GdkGC * gc, | |
132 SkinPixmapId pixmap_id, | |
133 gint xsrc, gint ysrc, gint xdest, gint ydest, | |
134 gint width, gint height); | |
135 void skin_get_eq_spline_colors(Skin * skin, guint32 colors[19]); | |
136 void skin_install_skin(const gchar * path); | |
137 | |
138 void skin_draw_playlistwin_shaded(Skin * skin, | |
139 GdkDrawable * drawable, GdkGC * gc, | |
140 gint width, gboolean focus); | |
141 void skin_draw_playlistwin_frame(Skin * skin, | |
142 GdkDrawable * drawable, GdkGC * gc, | |
143 gint width, gint height, gboolean focus); | |
144 | |
145 void skin_draw_mainwin_titlebar(Skin * skin, | |
146 GdkDrawable * drawable, GdkGC * gc, | |
147 gboolean shaded, gboolean focus); | |
148 | |
149 | |
150 void skin_parse_hints(Skin * skin, gchar *path_p); | |
151 | |
152 | |
153 gboolean | |
154 skin_reload_forced(void); | |
155 | |
156 #endif |