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