1 
2 /*
3  * The Real SoundTracker - Preferences handling (header)
4  *
5  * Copyright (C) 1998-2019 Michael Krause
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef _ST_PREFERENCES_H
23 #define _ST_PREFERENCES_H
24 
25 #include <gdk/gdkcolor.h>
26 #include <glib.h>
27 
28 void prefs_init(void);
29 void prefs_save(void);
30 void prefs_close(void);
31 
32 // Returns the file location of a configuration node
33 gchar* prefs_get_prefsdir(void);
34 gchar* prefs_get_filename(const gchar* name);
35 
36 gboolean
37 prefs_remove_key(const gchar* section,
38     const gchar* key);
39 
40 void prefs_put_int(const gchar* section,
41     const gchar* key,
42     const gint value);
43 void prefs_put_double(const gchar* section,
44     const gchar* key,
45     const gdouble value);
46 void prefs_put_bool(const gchar* section,
47     const gchar* key,
48     const gboolean value);
49 void prefs_put_color(const gchar* section,
50     const gchar* key,
51     const GdkColor value);
52 void prefs_put_string(const gchar* section,
53     const gchar* key,
54     const gchar* value);
55 /* Currently is not needed
56 void           prefs_put_str_array            (const gchar *section,
57 					       const gchar *key,
58 					       const gchar * const *value,
59 					       gsize length);
60 */
61 void prefs_put_int_array(const gchar* section,
62     const gchar* key,
63     gint* value,
64     gsize length);
65 void prefs_put_bool_array(const gchar* section,
66     const gchar* key,
67     gboolean* value,
68     gsize length);
69 gint prefs_get_int(const gchar* section,
70     const gchar* key,
71     const gint deflt);
72 gdouble prefs_get_double(const gchar* section,
73     const gchar* key,
74     const gdouble deflt);
75 gboolean prefs_get_bool(const gchar* section,
76     const gchar* key,
77     const gboolean deflt);
78 GdkColor prefs_get_color(const gchar* section,
79     const gchar* key,
80     const GdkColor deflt);
81 gchar* prefs_get_string(const gchar* section,
82     const gchar* key,
83     const gchar* deflt);
84 
85 /* No default value, return NULL on failure */
86 gchar** prefs_get_str_array(const gchar* section,
87     const gchar* key,
88     gsize* length);
89 gint* prefs_get_int_array(const gchar* section,
90     const gchar* key,
91     gsize* length);
92 gboolean* prefs_get_bool_array(const gchar* section,
93     const gchar* key,
94     gsize* length);
95 /* No default value, return 0 on failure */
96 gsize prefs_get_pairs(const gchar* section,
97     gchar*** keys,
98     gchar*** values);
99 
100 #endif /* _ST_PREFERENCES_H */
101