annotate audacious/skin.h @ 983:6cc5538851d6 trunk

[svn] - Fun fileinfo fixes
author nhjm449
date Fri, 28 Apr 2006 22:44:06 -0700
parents 7d998597254e
children f12d7e208b43
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /* BMP - Cross-platform multimedia player
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * Copyright (C) 2003-2004 BMP development team.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 * Based on XMMS:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * Copyright (C) 1998-2003 XMMS development team.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 #ifndef SKIN_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 #define SKIN_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 #include <gdk/gdk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 #define BMP_DEFAULT_SKIN_PATH \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 DATA_DIR G_DIR_SEPARATOR_S "Skins" G_DIR_SEPARATOR_S "Default"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 typedef enum {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 SKIN_MAIN = 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 SKIN_CBUTTONS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 SKIN_TITLEBAR,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 SKIN_SHUFREP,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 SKIN_TEXT,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 SKIN_VOLUME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 SKIN_BALANCE,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 SKIN_MONOSTEREO,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 SKIN_PLAYPAUSE,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 SKIN_NUMBERS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 SKIN_POSBAR,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 SKIN_PLEDIT,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 SKIN_EQMAIN,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 SKIN_EQ_EX,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 SKIN_PIXMAP_COUNT
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 } SkinPixmapId;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 typedef enum {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 SKIN_MASK_MAIN = 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 SKIN_MASK_MAIN_SHADE,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 SKIN_MASK_EQ,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 SKIN_MASK_EQ_SHADE,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 SKIN_MASK_COUNT
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 } SkinMaskId;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 typedef enum {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 SKIN_PLEDIT_NORMAL = 0,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 SKIN_PLEDIT_CURRENT,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 SKIN_PLEDIT_NORMALBG,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 SKIN_PLEDIT_SELECTEDBG,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 SKIN_TEXTBG,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66 SKIN_TEXTFG,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 SKIN_COLOR_COUNT
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 } SkinColorId;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69
837
7d998597254e [svn] - initial work on skin.hints support (the first step to modernizing our
nenolod
parents: 0
diff changeset
70 typedef struct _SkinProperties {
7d998597254e [svn] - initial work on skin.hints support (the first step to modernizing our
nenolod
parents: 0
diff changeset
71 gboolean mainwin_othertext;
7d998597254e [svn] - initial work on skin.hints support (the first step to modernizing our
nenolod
parents: 0
diff changeset
72 } SkinProperties;
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 #define SKIN_PIXMAP(x) ((SkinPixmap *)(x))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 typedef struct _SkinPixmap {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 GdkPixmap *pixmap;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 /* GdkPixmap *def_pixmap; */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 /* The real size of the pixmap */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 gint width, height;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 /* The size of the pixmap from the current skin,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 which might be smaller */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 gint current_width, current_height;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 } SkinPixmap;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 #define SKIN(x) ((Skin *)(x))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 typedef struct _Skin {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 GMutex *lock;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 gchar *path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 gchar *def_path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 SkinPixmap pixmaps[SKIN_PIXMAP_COUNT];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 GdkColor textbg[6], def_textbg[6];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 GdkColor textfg[6], def_textfg[6];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 GdkColor *colors[SKIN_COLOR_COUNT];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 guchar vis_color[24][3];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 GdkBitmap *masks[SKIN_MASK_COUNT];
837
7d998597254e [svn] - initial work on skin.hints support (the first step to modernizing our
nenolod
parents: 0
diff changeset
99 SkinProperties properties;
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 } Skin;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 extern Skin *bmp_active_skin;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 gboolean init_skins(const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 void cleanup_skins(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 gboolean bmp_active_skin_load(const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 gboolean bmp_active_skin_reload(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 Skin *skin_new(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 gboolean skin_load(Skin * skin, const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 void skin_reload(Skin * skin);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113 void skin_free(Skin * skin);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 GdkBitmap *skin_get_mask(Skin * skin, SkinMaskId mi);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 GdkColor *skin_get_color(Skin * skin, SkinColorId color_id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 void skin_get_viscolor(Skin * skin, guchar vis_color[24][3]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 gint skin_get_id(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 void skin_draw_pixmap(Skin * skin, GdkDrawable * drawable, GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 SkinPixmapId pixmap_id,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 gint xsrc, gint ysrc, gint xdest, gint ydest,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 gint width, gint height);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 void skin_get_eq_spline_colors(Skin * skin, guint32 colors[19]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 void skin_install_skin(const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127 void skin_draw_playlistwin_shaded(Skin * skin,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 GdkDrawable * drawable, GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 gint width, gboolean focus);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130 void skin_draw_playlistwin_frame(Skin * skin,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 GdkDrawable * drawable, GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 gint width, gint height, gboolean focus);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 void skin_draw_mainwin_titlebar(Skin * skin,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135 GdkDrawable * drawable, GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 gboolean shaded, gboolean focus);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138
837
7d998597254e [svn] - initial work on skin.hints support (the first step to modernizing our
nenolod
parents: 0
diff changeset
139 void skin_parse_hints(Skin * skin, gchar *path_p);
7d998597254e [svn] - initial work on skin.hints support (the first step to modernizing our
nenolod
parents: 0
diff changeset
140
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 gboolean
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 skin_reload_forced(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 #endif