0
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
20 */
|
|
21
|
|
22 #ifndef SKIN_H
|
|
23 #define SKIN_H
|
|
24
|
|
25
|
|
26 #include <glib.h>
|
|
27 #include <gdk/gdk.h>
|
|
28
|
|
29
|
|
30 #define BMP_DEFAULT_SKIN_PATH \
|
|
31 DATA_DIR G_DIR_SEPARATOR_S "Skins" G_DIR_SEPARATOR_S "Default"
|
|
32
|
|
33
|
|
34 typedef enum {
|
|
35 SKIN_MAIN = 0,
|
|
36 SKIN_CBUTTONS,
|
|
37 SKIN_TITLEBAR,
|
|
38 SKIN_SHUFREP,
|
|
39 SKIN_TEXT,
|
|
40 SKIN_VOLUME,
|
|
41 SKIN_BALANCE,
|
|
42 SKIN_MONOSTEREO,
|
|
43 SKIN_PLAYPAUSE,
|
|
44 SKIN_NUMBERS,
|
|
45 SKIN_POSBAR,
|
|
46 SKIN_PLEDIT,
|
|
47 SKIN_EQMAIN,
|
|
48 SKIN_EQ_EX,
|
|
49 SKIN_PIXMAP_COUNT
|
|
50 } SkinPixmapId;
|
|
51
|
|
52 typedef enum {
|
|
53 SKIN_MASK_MAIN = 0,
|
|
54 SKIN_MASK_MAIN_SHADE,
|
|
55 SKIN_MASK_EQ,
|
|
56 SKIN_MASK_EQ_SHADE,
|
|
57 SKIN_MASK_COUNT
|
|
58 } SkinMaskId;
|
|
59
|
|
60 typedef enum {
|
|
61 SKIN_PLEDIT_NORMAL = 0,
|
|
62 SKIN_PLEDIT_CURRENT,
|
|
63 SKIN_PLEDIT_NORMALBG,
|
|
64 SKIN_PLEDIT_SELECTEDBG,
|
|
65 SKIN_TEXTBG,
|
|
66 SKIN_TEXTFG,
|
|
67 SKIN_COLOR_COUNT
|
|
68 } SkinColorId;
|
|
69
|
|
70
|
|
71 #define SKIN_PIXMAP(x) ((SkinPixmap *)(x))
|
|
72 typedef struct _SkinPixmap {
|
|
73 GdkPixmap *pixmap;
|
|
74 /* GdkPixmap *def_pixmap; */
|
|
75
|
|
76 /* The real size of the pixmap */
|
|
77 gint width, height;
|
|
78
|
|
79 /* The size of the pixmap from the current skin,
|
|
80 which might be smaller */
|
|
81 gint current_width, current_height;
|
|
82 } SkinPixmap;
|
|
83
|
|
84
|
|
85 #define SKIN(x) ((Skin *)(x))
|
|
86 typedef struct _Skin {
|
|
87 GMutex *lock;
|
|
88 gchar *path;
|
|
89 gchar *def_path;
|
|
90 SkinPixmap pixmaps[SKIN_PIXMAP_COUNT];
|
|
91 GdkColor textbg[6], def_textbg[6];
|
|
92 GdkColor textfg[6], def_textfg[6];
|
|
93 GdkColor *colors[SKIN_COLOR_COUNT];
|
|
94 guchar vis_color[24][3];
|
|
95 GdkBitmap *masks[SKIN_MASK_COUNT];
|
|
96 } Skin;
|
|
97
|
|
98
|
|
99 extern Skin *bmp_active_skin;
|
|
100
|
|
101 gboolean init_skins(const gchar * path);
|
|
102 void cleanup_skins(void);
|
|
103
|
|
104 gboolean bmp_active_skin_load(const gchar * path);
|
|
105 gboolean bmp_active_skin_reload(void);
|
|
106
|
|
107 Skin *skin_new(void);
|
|
108 gboolean skin_load(Skin * skin, const gchar * path);
|
|
109 void skin_reload(Skin * skin);
|
|
110 void skin_free(Skin * skin);
|
|
111
|
|
112 GdkBitmap *skin_get_mask(Skin * skin, SkinMaskId mi);
|
|
113 GdkColor *skin_get_color(Skin * skin, SkinColorId color_id);
|
|
114
|
|
115 void skin_get_viscolor(Skin * skin, guchar vis_color[24][3]);
|
|
116 gint skin_get_id(void);
|
|
117 void skin_draw_pixmap(Skin * skin, GdkDrawable * drawable, GdkGC * gc,
|
|
118 SkinPixmapId pixmap_id,
|
|
119 gint xsrc, gint ysrc, gint xdest, gint ydest,
|
|
120 gint width, gint height);
|
|
121 void skin_get_eq_spline_colors(Skin * skin, guint32 colors[19]);
|
|
122 void skin_install_skin(const gchar * path);
|
|
123
|
|
124 void skin_draw_playlistwin_shaded(Skin * skin,
|
|
125 GdkDrawable * drawable, GdkGC * gc,
|
|
126 gint width, gboolean focus);
|
|
127 void skin_draw_playlistwin_frame(Skin * skin,
|
|
128 GdkDrawable * drawable, GdkGC * gc,
|
|
129 gint width, gint height, gboolean focus);
|
|
130
|
|
131 void skin_draw_mainwin_titlebar(Skin * skin,
|
|
132 GdkDrawable * drawable, GdkGC * gc,
|
|
133 gboolean shaded, gboolean focus);
|
|
134
|
|
135
|
|
136
|
|
137 gboolean
|
|
138 skin_reload_forced(void);
|
|
139
|
|
140 #endif
|