annotate audacious/widgets/skin.h @ 1541:06329cbf186a trunk

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