Mercurial > geeqie.yaz
annotate src/rcfile.h @ 1309:55ea4962887a
config file format changed to XML
save and restore all layout windows
save and restore sidebar configuration
author | nadvornik |
---|---|
date | Sun, 22 Feb 2009 15:35:37 +0000 |
parents | 8b89e3ff286b |
children | 1ffa5222dc61 |
rev | line source |
---|---|
9 | 1 /* |
196 | 2 * Geeqie |
9 | 3 * (C) 2004 John Ellis |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
14 #ifndef RCFILE_H | |
15 #define RCFILE_H | |
16 | |
1309 | 17 |
18 void write_indent(GString *str, gint indent); | |
19 void write_char_option(GString *str, gint indent, const gchar *label, const gchar *text); | |
20 gboolean read_char_option(const gchar *option, const gchar *label, const gchar *value, gchar **text); | |
21 void write_color_option(GString *str, gint indent, gchar *label, GdkColor *color); | |
22 gboolean read_color_option(const gchar *option, const gchar *label, const gchar *value, GdkColor *color); | |
23 void write_int_option(GString *str, gint indent, const gchar *label, gint n); | |
24 gboolean read_int_option(const gchar *option, const gchar *label, const gchar *value, gint *n); | |
25 void write_uint_option(GString *str, gint indent, const gchar *label, guint n); | |
26 gboolean read_uint_option(const gchar *option, const gchar *label, const gchar *value, guint *n); | |
27 gboolean read_uint_option_clamp(const gchar *option, const gchar *label, const gchar *value, guint *n, guint min, guint max); | |
28 gboolean read_int_option_clamp(const gchar *option, const gchar *label, const gchar *value, gint *n, gint min, gint max); | |
29 void write_int_unit_option(GString *str, gint indent, gchar *label, gint n, gint subunits); | |
30 gboolean read_int_unit_option(const gchar *option, const gchar *label, const gchar *value, gint *n, gint subunits); | |
31 void write_bool_option(GString *str, gint indent, gchar *label, gint n); | |
32 gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *value, gint *n); | |
33 | |
34 #define WRITE_BOOL(source, _name_) write_bool_option(outstr, indent, #_name_, (source)._name_) | |
35 #define WRITE_INT(source, _name_) write_int_option(outstr, indent, #_name_, (source)._name_) | |
36 #define WRITE_UINT(source, _name_) write_uint_option(outstr, indent, #_name_, (source)._name_) | |
37 #define WRITE_INT_UNIT(source, _name_, _unit_) write_int_unit_option(outstr, indent, #_name_, (source)._name_, _unit_) | |
38 #define WRITE_CHAR(source, _name_) write_char_option(outstr, indent, #_name_, (source)._name_) | |
39 #define WRITE_COLOR(source, _name_) write_color_option(outstr, indent, #_name_, &(source)._name_) | |
40 | |
41 #define WRITE_SEPARATOR() g_string_append(outstr, "\n") | |
42 #define WRITE_SUBTITLE(_title_) g_string_append_printf(outstr, "\n\n<!-- "_title_" -->\n\n") | |
43 | |
44 | |
45 #define READ_BOOL(target, _name_) if (read_bool_option(option, #_name_, value, &(target)._name_)) continue; | |
46 #define READ_INT(target, _name_) if (read_int_option(option, #_name_, value, &(target)._name_)) continue; | |
47 #define READ_UINT(target, _name_) if (read_uint_option(option, #_name_, value, &(target)._name_)) continue; | |
48 #define READ_INT_CLAMP(target, _name_, _min_, _max_) if (read_int_option_clamp(option, #_name_, value, &(target)._name_, _min_, _max_)) continue; | |
49 #define READ_UINT_CLAMP(target, _name_, _min_, _max_) if (read_uint_option_clamp(option, #_name_, value, &(target)._name_, _min_, _max_)) continue; | |
50 #define READ_INT_UNIT(target, _name_, _unit_) if (read_int_unit_option(option, #_name_, value, &(target)._name_, _unit_)) continue; | |
51 #define READ_CHAR(target, _name_) if (read_char_option(option, #_name_, value, &(target)._name_)) continue; | |
52 #define READ_COLOR(target, _name_) if (read_color_option(option, #_name_, value, &(target)._name_)) continue; | |
53 | |
54 #define READ_BOOL_FULL(name, target) if (read_bool_option(option, name, value, &(target))) continue; | |
55 #define READ_INT_FULL(name, target) if (read_int_option(option, name, value, &(target))) continue; | |
56 #define READ_UINT_FULL(name, target) if (read_uint_option(option, name, value, &(target))) continue; | |
57 #define READ_INT_CLAMP_FULL(name, target, _min_, _max_) if (read_int_option_clamp(option, name, value, &(target), _min_, _max_)) continue; | |
58 #define READ_INT_UNIT_FULL(name, target, _unit_) if (read_int_unit_option(option, name, value, &(target), _unit_)) continue; | |
59 #define READ_CHAR_FULL(name, target) if (read_char_option(option, name, value, &(target))) continue; | |
60 #define READ_COLOR_FULL(name, target) if (read_color_option(option, name, value, &(target))) continue; | |
61 | |
62 | |
63 | |
64 | |
65 typedef struct _GQParserFuncData GQParserFuncData; | |
66 typedef struct _GQParserData GQParserData; | |
67 typedef void (* GQParserStartFunc)(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error); | |
68 typedef void (* GQParserEndFunc)(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, gpointer data, GError **error); | |
69 | |
70 void options_parse_func_push(GQParserData *parser_data, GQParserStartFunc start_func, GQParserEndFunc end_func, gpointer data); | |
71 void options_parse_func_pop(GQParserData *parser_data); | |
72 void options_parse_func_set_data(GQParserData *parser_data, gpointer data); | |
73 | |
74 | |
1019 | 75 gboolean save_options_to(const gchar *utf8_path, ConfOptions *options); |
76 gboolean load_options_from(const gchar *utf8_path, ConfOptions *options); | |
9 | 77 |
1309 | 78 |
9 | 79 #endif |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1023
diff
changeset
|
80 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |