1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 config_value.h for the Openbox window manager
4 Copyright (c) 2011 Dana Jansens
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 See the COPYING file for a copy of the GNU General Public License.
26 typedef struct _ObConfigValue ObConfigValue;
28 void config_value_ref(ObConfigValue *v);
29 void config_value_unref(ObConfigValue *v);
31 /*! Creates a new value by making a copy of the given string. */
32 ObConfigValue* config_value_new_string(const gchar *s);
33 /*! Creates a new value from a string, and steals ownership of the string. It
34 will be freed when then value is destroyed. */
35 ObConfigValue* config_value_new_string_steal(gchar *s);
37 /*! Creates a config value which holds a list of other values
38 This function copies the list and adds a refcount to the values within. */
39 ObConfigValue* config_value_new_string_list(gchar **list);
40 /*! Creates a config value which holds a list of other values.
41 This function steals ownership the list and the values within. */
42 ObConfigValue* config_value_new_string_list_steal(gchar **list);
44 ObConfigValue* config_value_new_action_list(struct _ObActionList *al);
46 gboolean config_value_is_string(const ObConfigValue *v);
47 gboolean config_value_is_string_list(const ObConfigValue *v);
48 gboolean config_value_is_action_list(const ObConfigValue *v);
50 /* These ones are valid on a string value */
52 const gchar* config_value_string(ObConfigValue *v);
53 gboolean config_value_bool(ObConfigValue *v);
54 guint config_value_int(ObConfigValue *v);
55 void config_value_fraction(ObConfigValue *v, gint *numer, gint *denom);
56 void config_value_gravity_coord(ObConfigValue *v, struct _GravityCoord *c);
58 /* These ones are valid on a string list value */
60 gchar const*const* config_value_string_list(ObConfigValue *v);
62 /* These ones are value on a action list value */
64 struct _ObActionList* config_value_action_list(ObConfigValue *v);