annotate src/skins/skins_cfg.c @ 2583:294232665cb0

more work on config
author Tomasz Mon <desowin@gmail.com>
date Tue, 20 May 2008 16:34:06 +0200
parents 9b4dfc007b87
children c9e40418a74c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
6a0755e8c1b3 add ui_skinned_menurow
Tomasz Mon <desowin@gmail.com>
parents: 2573
diff changeset
23 #include "ui_skin.h"
2583
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
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,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
33 .always_on_top = FALSE,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
34 .scale_factor = 2.0,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
35 .always_show_cb = TRUE,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
36 .skin = NULL,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
37 .player_shaded = FALSE,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
38 .equalizer_shaded = FALSE,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
39 .playlist_shaded = FALSE,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
40 .dim_titlebar = TRUE,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
41 .show_wm_decorations = FALSE,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
42 .easy_move = TRUE,
2583
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
43 .timer_mode = 0,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
44 .vis_type = VIS_ANALYZER,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
45 .analyzer_mode = ANALYZER_NORMAL,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
46 .analyzer_type = ANALYZER_BARS,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
47 .scope_mode = SCOPE_DOT,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
48 .voiceprint_mode = VOICEPRINT_NORMAL,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
49 .vu_mode = VU_SMOOTH,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
50 .vis_refresh = REFRESH_FULL,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
51 .analyzer_falloff = FALLOFF_FAST,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
52 .peaks_falloff = FALLOFF_SLOW,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
53 .player_x = MAINWIN_DEFAULT_POS_X,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
54 .player_y = MAINWIN_DEFAULT_POS_Y,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
55 .equalizer_x = EQUALIZER_DEFAULT_POS_X,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
56 .equalizer_y = EQUALIZER_DEFAULT_POS_Y,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
57 .playlist_x = PLAYLISTWIN_DEFAULT_POS_X,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
58 .playlist_y = PLAYLISTWIN_DEFAULT_POS_Y,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
59 .playlist_width = PLAYLISTWIN_DEFAULT_WIDTH,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
60 .playlist_height = PLAYLISTWIN_DEFAULT_HEIGHT,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
61 .playlist_position = 0,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
62 .mouse_change = 8, /* mouse wheel scroll step */
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
63 .scroll_pl_by = 3,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
64 .colorize_r = 255, .colorize_g = 255, .colorize_b = 255,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
65 .snap_distance = 10,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
66 .snap_windows = TRUE,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
67 .save_window_position = TRUE,
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
68 };
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
69
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
70 typedef struct skins_cfg_boolent_t {
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
71 char const *be_vname;
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
72 gboolean *be_vloc;
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
73 gboolean be_wrt;
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
74 } skins_cfg_boolent;
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
75
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
76 static skins_cfg_boolent skins_boolents[] = {
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
77 {"always_show_cb", &config.always_show_cb, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
78 {"always_on_top", &config.always_on_top, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
79 {"always_show_cb", &config.always_show_cb, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
80 {"scaled", &config.scaled, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
81 {"player_shaded", &config.player_shaded, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
82 {"equalizer_shaded", &config.equalizer_shaded, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
83 {"playlist_shaded", &config.playlist_shaded, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
84 {"dim_titlebar", &config.dim_titlebar, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
85 {"show_wm_decorations", &config.show_wm_decorations, TRUE},
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
86 {"easy_move", &config.easy_move, TRUE},
2583
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
87 {"snap_windows", &config.snap_windows, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
88 {"save_window_positions", &config.save_window_position, TRUE},
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
89 };
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
90
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
91 static gint ncfgbent = G_N_ELEMENTS(skins_boolents);
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
92
2583
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
93 typedef struct skins_cfg_nument_t {
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
94 char const *ie_vname;
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
95 gint *ie_vloc;
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
96 gboolean ie_wrt;
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
97 } skins_cfg_nument;
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
98
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
99 static skins_cfg_nument skins_numents[] = {
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
100 {"player_x", &config.player_x, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
101 {"player_y", &config.player_y, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
102 {"timer_mode", &config.timer_mode, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
103 {"vis_type", &config.vis_type, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
104 {"analyzer_mode", &config.analyzer_mode, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
105 {"analyzer_type", &config.analyzer_type, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
106 {"scope_mode", &config.scope_mode, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
107 {"vu_mode", &config.vu_mode, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
108 {"voiceprint_mode", &config.voiceprint_mode, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
109 {"vis_refresh_rate", &config.vis_refresh, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
110 {"analyzer_falloff", &config.analyzer_falloff, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
111 {"peaks_falloff", &config.peaks_falloff, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
112 {"playlist_x", &config.playlist_x, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
113 {"playlist_y", &config.playlist_y, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
114 {"playlist_width", &config.playlist_width, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
115 {"playlist_height", &config.playlist_height, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
116 {"playlist_position", &config.playlist_position, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
117 {"equalizer_x", &config.equalizer_x, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
118 {"equalizer_y", &config.equalizer_y, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
119 {"mouse_wheel_change", &config.mouse_change, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
120 {"scroll_pl_by", &config.scroll_pl_by, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
121 {"colorize_r", &config.colorize_r, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
122 {"colorize_g", &config.colorize_g, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
123 {"colorize_b", &config.colorize_b, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
124 {"snap_distance", &config.snap_distance, TRUE},
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
125 };
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
126
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
127 static gint ncfgient = G_N_ELEMENTS(skins_numents);
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
128
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
129 void skins_cfg_free() {
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
130 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
131 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
132
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
133 void skins_cfg_load() {
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
134 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
135
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
136 /* 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
137 cfg->where = default value
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
138 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
139 cfg->where = g_strdup("defaul");
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
140 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
141 cfg->where = FALSE / TRUE;
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
142 */
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
143
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
144 memcpy(&config, &skins_default_config, sizeof(skins_cfg_t));
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
145 int i;
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
146
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
147 for (i = 0; i < ncfgbent; ++i) {
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
148 aud_cfg_db_get_bool(cfgfile, "skins",
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
149 skins_boolents[i].be_vname,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
150 skins_boolents[i].be_vloc);
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
151 }
2583
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
152
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
153 for (i = 0; i < ncfgient; ++i) {
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
154 aud_cfg_db_get_int(cfgfile, "skins",
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
155 skins_numents[i].ie_vname,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
156 skins_numents[i].ie_vloc);
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
157 }
2581
6a0755e8c1b3 add ui_skinned_menurow
Tomasz Mon <desowin@gmail.com>
parents: 2573
diff changeset
158
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
159 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
160 config.skin = g_strdup(BMP_DEFAULT_SKIN_PATH);
2573
c0b08527b121 allow loading compressed skins
Tomasz Mon <desowin@gmail.com>
parents: 2572
diff changeset
161
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
162 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
163 config.scale_factor = 2.0;
2572
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
164
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
165 aud_cfg_db_close(cfgfile);
2572
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
166 }
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
167
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
168
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
169 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
170 mcs_handle_t *cfgfile = aud_cfg_db_open();
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
171
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
172 /*
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
173 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
174 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
175 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
176 */
2573
c0b08527b121 allow loading compressed skins
Tomasz Mon <desowin@gmail.com>
parents: 2572
diff changeset
177 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
178
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
179 int i;
2572
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
180
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
181 for (i = 0; i < ncfgbent; ++i)
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
182 if (skins_boolents[i].be_wrt)
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
183 aud_cfg_db_set_bool(cfgfile, "skins",
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
184 skins_boolents[i].be_vname,
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
185 *skins_boolents[i].be_vloc);
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
186
2583
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
187 for (i = 0; i < ncfgient; ++i)
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
188 if (skins_numents[i].ie_wrt)
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
189 aud_cfg_db_set_int(cfgfile, "skins",
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
190 skins_numents[i].ie_vname,
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
191 *skins_numents[i].ie_vloc);
294232665cb0 more work on config
Tomasz Mon <desowin@gmail.com>
parents: 2582
diff changeset
192
2582
9b4dfc007b87 use more local configuration options
Tomasz Mon <desowin@gmail.com>
parents: 2581
diff changeset
193 aud_cfg_db_close(cfgfile);
2572
d0daee216c8d stub (really incomplete) for skin engine plugin
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
194 }