Mercurial > audlegacy-plugins
annotate src/skins/skins_cfg.c @ 2602:7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Wed, 21 May 2008 12:37:40 +0200 |
parents | 8f5999909416 |
children | b53841a1b5d3 |
rev | line source |
---|---|
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
1 /* |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
2 * Audacious - a cross-platform multimedia player |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
3 * Copyright (c) 2008 Tomasz Moń |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
4 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
7 * the Free Software Foundation; under version 3 of the License. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
8 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
13 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses>. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
16 * |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
17 * The Audacious team does not consider modular code linking to |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
18 * Audacious or using our public API to be a derived work. |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
19 */ |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
20 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
21 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
22 #include "skins_cfg.h" |
2581 | 23 #include "ui_skin.h" |
2583 | 24 #include "ui_vis.h" |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
25 #include <glib.h> |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
26 #include <stdlib.h> |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
27 #include <audacious/plugin.h> |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
28 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
29 skins_cfg_t config; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
30 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
31 skins_cfg_t skins_default_config = { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
32 .scaled = FALSE, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
33 .autoscroll = TRUE, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
34 .always_on_top = FALSE, |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
2592
diff
changeset
|
35 .sticky = FALSE, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
36 .scale_factor = 2.0, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
37 .always_show_cb = TRUE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
38 .skin = NULL, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
39 .playlist_visible = FALSE, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
40 .equalizer_visible = FALSE, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
41 .player_visible = TRUE, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
42 .player_shaded = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
43 .equalizer_shaded = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
44 .playlist_shaded = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
45 .dim_titlebar = TRUE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
46 .show_wm_decorations = FALSE, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
47 .easy_move = TRUE, |
2584 | 48 .allow_broken_skins = FALSE, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
49 .warn_about_broken_gtk_engines = TRUE, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
50 .warn_about_win_visibility = TRUE, |
2584 | 51 .disable_inline_gtk = FALSE, |
2583 | 52 .timer_mode = 0, |
53 .vis_type = VIS_ANALYZER, | |
54 .analyzer_mode = ANALYZER_NORMAL, | |
55 .analyzer_type = ANALYZER_BARS, | |
56 .scope_mode = SCOPE_DOT, | |
57 .voiceprint_mode = VOICEPRINT_NORMAL, | |
58 .vu_mode = VU_SMOOTH, | |
59 .vis_refresh = REFRESH_FULL, | |
60 .analyzer_falloff = FALLOFF_FAST, | |
61 .peaks_falloff = FALLOFF_SLOW, | |
62 .player_x = MAINWIN_DEFAULT_POS_X, | |
63 .player_y = MAINWIN_DEFAULT_POS_Y, | |
64 .equalizer_x = EQUALIZER_DEFAULT_POS_X, | |
65 .equalizer_y = EQUALIZER_DEFAULT_POS_Y, | |
66 .playlist_x = PLAYLISTWIN_DEFAULT_POS_X, | |
67 .playlist_y = PLAYLISTWIN_DEFAULT_POS_Y, | |
68 .playlist_width = PLAYLISTWIN_DEFAULT_WIDTH, | |
69 .playlist_height = PLAYLISTWIN_DEFAULT_HEIGHT, | |
70 .playlist_position = 0, | |
71 .mouse_change = 8, /* mouse wheel scroll step */ | |
72 .scroll_pl_by = 3, | |
73 .colorize_r = 255, .colorize_g = 255, .colorize_b = 255, | |
74 .snap_distance = 10, | |
75 .snap_windows = TRUE, | |
76 .save_window_position = TRUE, | |
2584 | 77 .analyzer_peaks = TRUE, |
2586 | 78 .twoway_scroll = TRUE, /* use back and forth scroll */ |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
79 .mainwin_use_bitmapfont = TRUE, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
80 }; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
81 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
82 typedef struct skins_cfg_boolent_t { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
83 char const *be_vname; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
84 gboolean *be_vloc; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
85 gboolean be_wrt; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
86 } skins_cfg_boolent; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
87 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
88 static skins_cfg_boolent skins_boolents[] = { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
89 {"always_show_cb", &config.always_show_cb, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
90 {"always_on_top", &config.always_on_top, TRUE}, |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
2592
diff
changeset
|
91 {"sticky", &config.sticky, TRUE}, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
92 {"always_show_cb", &config.always_show_cb, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
93 {"scaled", &config.scaled, TRUE}, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
94 {"autoscroll_songname", &config.autoscroll, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
95 {"equalizer_visible", &config.equalizer_visible, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
96 {"playlist_visible", &config.playlist_visible, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
97 {"player_visible", &config.player_visible, TRUE}, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
98 {"player_shaded", &config.player_shaded, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
99 {"equalizer_shaded", &config.equalizer_shaded, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
100 {"playlist_shaded", &config.playlist_shaded, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
101 {"dim_titlebar", &config.dim_titlebar, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
102 {"show_wm_decorations", &config.show_wm_decorations, TRUE}, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
103 {"easy_move", &config.easy_move, TRUE}, |
2584 | 104 {"allow_broken_skins", &config.allow_broken_skins, TRUE}, |
105 {"disable_inline_gtk", &config.disable_inline_gtk, TRUE}, | |
2583 | 106 {"snap_windows", &config.snap_windows, TRUE}, |
107 {"save_window_positions", &config.save_window_position, TRUE}, | |
2584 | 108 {"analyzer_peaks", &config.analyzer_peaks, TRUE}, |
2586 | 109 {"twoway_scroll", &config.twoway_scroll, TRUE}, |
2592
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
110 {"warn_about_win_visibility", &config.warn_about_win_visibility, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
111 {"warn_about_broken_gtk_engines", &config.warn_about_broken_gtk_engines, TRUE}, |
8f5999909416
add ui_main - with huge amount of #if 0 to sort out later
Tomasz Mon <desowin@gmail.com>
parents:
2586
diff
changeset
|
112 {"mainwin_use_bitmapfont", &config.mainwin_use_bitmapfont, TRUE}, |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
113 }; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
114 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
115 static gint ncfgbent = G_N_ELEMENTS(skins_boolents); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
116 |
2583 | 117 typedef struct skins_cfg_nument_t { |
118 char const *ie_vname; | |
119 gint *ie_vloc; | |
120 gboolean ie_wrt; | |
121 } skins_cfg_nument; | |
122 | |
123 static skins_cfg_nument skins_numents[] = { | |
124 {"player_x", &config.player_x, TRUE}, | |
125 {"player_y", &config.player_y, TRUE}, | |
126 {"timer_mode", &config.timer_mode, TRUE}, | |
127 {"vis_type", &config.vis_type, TRUE}, | |
128 {"analyzer_mode", &config.analyzer_mode, TRUE}, | |
129 {"analyzer_type", &config.analyzer_type, TRUE}, | |
130 {"scope_mode", &config.scope_mode, TRUE}, | |
131 {"vu_mode", &config.vu_mode, TRUE}, | |
132 {"voiceprint_mode", &config.voiceprint_mode, TRUE}, | |
133 {"vis_refresh_rate", &config.vis_refresh, TRUE}, | |
134 {"analyzer_falloff", &config.analyzer_falloff, TRUE}, | |
135 {"peaks_falloff", &config.peaks_falloff, TRUE}, | |
136 {"playlist_x", &config.playlist_x, TRUE}, | |
137 {"playlist_y", &config.playlist_y, TRUE}, | |
138 {"playlist_width", &config.playlist_width, TRUE}, | |
139 {"playlist_height", &config.playlist_height, TRUE}, | |
140 {"playlist_position", &config.playlist_position, TRUE}, | |
141 {"equalizer_x", &config.equalizer_x, TRUE}, | |
142 {"equalizer_y", &config.equalizer_y, TRUE}, | |
143 {"mouse_wheel_change", &config.mouse_change, TRUE}, | |
144 {"scroll_pl_by", &config.scroll_pl_by, TRUE}, | |
145 {"colorize_r", &config.colorize_r, TRUE}, | |
146 {"colorize_g", &config.colorize_g, TRUE}, | |
147 {"colorize_b", &config.colorize_b, TRUE}, | |
148 {"snap_distance", &config.snap_distance, TRUE}, | |
149 }; | |
150 | |
151 static gint ncfgient = G_N_ELEMENTS(skins_numents); | |
152 | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
153 void skins_cfg_free() { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
154 if (config.skin) { g_free(config.skin); config.skin = NULL; } |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
155 } |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
156 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
157 void skins_cfg_load() { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
158 mcs_handle_t *cfgfile = aud_cfg_db_open(); |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
159 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
160 /* if (!aud_cfg_db_get_int(cfgfile, "skins", "field_name", &(cfg->where))) |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
161 cfg->where = default value |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
162 if (!aud_cfg_db_get_string(cfgfile, "skins", "field_name", &(cfg->where))) |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
163 cfg->where = g_strdup("defaul"); |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
164 if (!aud_cfg_db_get_bool(cfgfile, "skins", "field_name", &(cfg->where))) |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
165 cfg->where = FALSE / TRUE; |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
166 */ |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
167 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
168 memcpy(&config, &skins_default_config, sizeof(skins_cfg_t)); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
169 int i; |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
170 |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
171 for (i = 0; i < ncfgbent; ++i) { |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
172 aud_cfg_db_get_bool(cfgfile, "skins", |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
173 skins_boolents[i].be_vname, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
174 skins_boolents[i].be_vloc); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
175 } |
2583 | 176 |
177 for (i = 0; i < ncfgient; ++i) { | |
178 aud_cfg_db_get_int(cfgfile, "skins", | |
179 skins_numents[i].ie_vname, | |
180 skins_numents[i].ie_vloc); | |
181 } | |
2581 | 182 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
183 if (!aud_cfg_db_get_string(cfgfile, "skins", "skin", &(config.skin))) |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
184 config.skin = g_strdup(BMP_DEFAULT_SKIN_PATH); |
2573
c0b08527b121
allow loading compressed skins
Tomasz Mon <desowin@gmail.com>
parents:
2572
diff
changeset
|
185 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
186 if (!aud_cfg_db_get_float(cfgfile, "skins", "scale_factor", &(config.scale_factor))) |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
187 config.scale_factor = 2.0; |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
188 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
189 aud_cfg_db_close(cfgfile); |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
190 } |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
191 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
192 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
193 void skins_cfg_save(skins_cfg_t * cfg) { |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
194 mcs_handle_t *cfgfile = aud_cfg_db_open(); |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
195 |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
196 /* |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
197 aud_cfg_db_set_int(cfgfile, "skins", "field_name", cfg->where); |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
198 aud_cfg_db_set_string(cfgfile, "skins", "field_name", cfg->where); |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
199 aud_cfg_db_set_bool(cfgfile, "skins", "field_name", cfg->where); |
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
200 */ |
2573
c0b08527b121
allow loading compressed skins
Tomasz Mon <desowin@gmail.com>
parents:
2572
diff
changeset
|
201 aud_cfg_db_set_string(cfgfile, "skins", "skin", cfg->skin); |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
202 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
203 int i; |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
204 |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
205 for (i = 0; i < ncfgbent; ++i) |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
206 if (skins_boolents[i].be_wrt) |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
207 aud_cfg_db_set_bool(cfgfile, "skins", |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
208 skins_boolents[i].be_vname, |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
209 *skins_boolents[i].be_vloc); |
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
210 |
2583 | 211 for (i = 0; i < ncfgient; ++i) |
212 if (skins_numents[i].ie_wrt) | |
213 aud_cfg_db_set_int(cfgfile, "skins", | |
214 skins_numents[i].ie_vname, | |
215 *skins_numents[i].ie_vloc); | |
216 | |
2582
9b4dfc007b87
use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents:
2581
diff
changeset
|
217 aud_cfg_db_close(cfgfile); |
2572
d0daee216c8d
stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
218 } |