annotate audacious/skin.h @ 627:287a588f2852 trunk

[svn] use the default rule for building library objectives here
author nenolod
date Tue, 07 Feb 2006 11:54:28 -0800
parents cb178e5ad177
children 7d998597254e
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
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 #define SKIN_PIXMAP(x) ((SkinPixmap *)(x))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 typedef struct _SkinPixmap {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 GdkPixmap *pixmap;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 /* GdkPixmap *def_pixmap; */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 /* The real size of the pixmap */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 gint width, height;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 /* The size of the pixmap from the current skin,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 which might be smaller */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 gint current_width, current_height;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 } SkinPixmap;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 #define SKIN(x) ((Skin *)(x))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 typedef struct _Skin {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 GMutex *lock;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 gchar *path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 gchar *def_path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 SkinPixmap pixmaps[SKIN_PIXMAP_COUNT];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 GdkColor textbg[6], def_textbg[6];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 GdkColor textfg[6], def_textfg[6];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 GdkColor *colors[SKIN_COLOR_COUNT];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 guchar vis_color[24][3];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 GdkBitmap *masks[SKIN_MASK_COUNT];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 } Skin;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 extern Skin *bmp_active_skin;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 gboolean init_skins(const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 void cleanup_skins(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 gboolean bmp_active_skin_load(const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 gboolean bmp_active_skin_reload(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 Skin *skin_new(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 gboolean skin_load(Skin * skin, const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 void skin_reload(Skin * skin);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 void skin_free(Skin * skin);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 GdkBitmap *skin_get_mask(Skin * skin, SkinMaskId mi);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113 GdkColor *skin_get_color(Skin * skin, SkinColorId color_id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 void skin_get_viscolor(Skin * skin, guchar vis_color[24][3]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 gint skin_get_id(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117 void skin_draw_pixmap(Skin * skin, GdkDrawable * drawable, GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 SkinPixmapId pixmap_id,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 gint xsrc, gint ysrc, gint xdest, gint ydest,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 gint width, gint height);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 void skin_get_eq_spline_colors(Skin * skin, guint32 colors[19]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 void skin_install_skin(const gchar * path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 void skin_draw_playlistwin_shaded(Skin * skin,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 GdkDrawable * drawable, GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 gint width, gboolean focus);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127 void skin_draw_playlistwin_frame(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, gint height, gboolean focus);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 void skin_draw_mainwin_titlebar(Skin * skin,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 GdkDrawable * drawable, GdkGC * gc,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 gboolean shaded, gboolean focus);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 gboolean
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 skin_reload_forced(void);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 #endif