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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 9
diff changeset
2 * Geeqie
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1055
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #ifndef RCFILE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #define RCFILE_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16
1309
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
17
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
18 void write_indent(GString *str, gint indent);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
19 void write_char_option(GString *str, gint indent, const gchar *label, const gchar *text);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
20 gboolean read_char_option(const gchar *option, const gchar *label, const gchar *value, gchar **text);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
21 void write_color_option(GString *str, gint indent, gchar *label, GdkColor *color);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
22 gboolean read_color_option(const gchar *option, const gchar *label, const gchar *value, GdkColor *color);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
23 void write_int_option(GString *str, gint indent, const gchar *label, gint n);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
24 gboolean read_int_option(const gchar *option, const gchar *label, const gchar *value, gint *n);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
25 void write_uint_option(GString *str, gint indent, const gchar *label, guint n);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
26 gboolean read_uint_option(const gchar *option, const gchar *label, const gchar *value, guint *n);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
27 gboolean read_uint_option_clamp(const gchar *option, const gchar *label, const gchar *value, guint *n, guint min, guint max);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
28 gboolean read_int_option_clamp(const gchar *option, const gchar *label, const gchar *value, gint *n, gint min, gint max);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
29 void write_int_unit_option(GString *str, gint indent, gchar *label, gint n, gint subunits);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
30 gboolean read_int_unit_option(const gchar *option, const gchar *label, const gchar *value, gint *n, gint subunits);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
31 void write_bool_option(GString *str, gint indent, gchar *label, gint n);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
32 gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *value, gint *n);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
33
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
34 #define WRITE_BOOL(source, _name_) write_bool_option(outstr, indent, #_name_, (source)._name_)
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
35 #define WRITE_INT(source, _name_) write_int_option(outstr, indent, #_name_, (source)._name_)
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
36 #define WRITE_UINT(source, _name_) write_uint_option(outstr, indent, #_name_, (source)._name_)
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
37 #define WRITE_INT_UNIT(source, _name_, _unit_) write_int_unit_option(outstr, indent, #_name_, (source)._name_, _unit_)
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
38 #define WRITE_CHAR(source, _name_) write_char_option(outstr, indent, #_name_, (source)._name_)
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
39 #define WRITE_COLOR(source, _name_) write_color_option(outstr, indent, #_name_, &(source)._name_)
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
40
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
41 #define WRITE_SEPARATOR() g_string_append(outstr, "\n")
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
42 #define WRITE_SUBTITLE(_title_) g_string_append_printf(outstr, "\n\n<!-- "_title_" -->\n\n")
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
43
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
44
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
45 #define READ_BOOL(target, _name_) if (read_bool_option(option, #_name_, value, &(target)._name_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
46 #define READ_INT(target, _name_) if (read_int_option(option, #_name_, value, &(target)._name_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
47 #define READ_UINT(target, _name_) if (read_uint_option(option, #_name_, value, &(target)._name_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
48 #define READ_INT_CLAMP(target, _name_, _min_, _max_) if (read_int_option_clamp(option, #_name_, value, &(target)._name_, _min_, _max_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
49 #define READ_UINT_CLAMP(target, _name_, _min_, _max_) if (read_uint_option_clamp(option, #_name_, value, &(target)._name_, _min_, _max_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
50 #define READ_INT_UNIT(target, _name_, _unit_) if (read_int_unit_option(option, #_name_, value, &(target)._name_, _unit_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
51 #define READ_CHAR(target, _name_) if (read_char_option(option, #_name_, value, &(target)._name_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
52 #define READ_COLOR(target, _name_) if (read_color_option(option, #_name_, value, &(target)._name_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
53
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
54 #define READ_BOOL_FULL(name, target) if (read_bool_option(option, name, value, &(target))) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
55 #define READ_INT_FULL(name, target) if (read_int_option(option, name, value, &(target))) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
56 #define READ_UINT_FULL(name, target) if (read_uint_option(option, name, value, &(target))) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
57 #define READ_INT_CLAMP_FULL(name, target, _min_, _max_) if (read_int_option_clamp(option, name, value, &(target), _min_, _max_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
58 #define READ_INT_UNIT_FULL(name, target, _unit_) if (read_int_unit_option(option, name, value, &(target), _unit_)) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
59 #define READ_CHAR_FULL(name, target) if (read_char_option(option, name, value, &(target))) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
60 #define READ_COLOR_FULL(name, target) if (read_color_option(option, name, value, &(target))) continue;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
61
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
62
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
63
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
64
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
65 typedef struct _GQParserFuncData GQParserFuncData;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
66 typedef struct _GQParserData GQParserData;
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
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);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
68 typedef void (* GQParserEndFunc)(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, gpointer data, GError **error);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
69
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
70 void options_parse_func_push(GQParserData *parser_data, GQParserStartFunc start_func, GQParserEndFunc end_func, gpointer data);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
71 void options_parse_func_pop(GQParserData *parser_data);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
72 void options_parse_func_set_data(GQParserData *parser_data, gpointer data);
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
73
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
74
1019
4aa1a6235458 Move save/load_options() to options.[ch].
zas_
parents: 742
diff changeset
75 gboolean save_options_to(const gchar *utf8_path, ConfOptions *options);
4aa1a6235458 Move save/load_options() to options.[ch].
zas_
parents: 742
diff changeset
76 gboolean load_options_from(const gchar *utf8_path, ConfOptions *options);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77
1309
55ea4962887a config file format changed to XML
nadvornik
parents: 1284
diff changeset
78
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
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: */