]> icculus.org git repositories - dana/openbox.git/blob - openbox/config_value.h
Remove complicated stuff from config_value.c that we're not using at the moment.
[dana/openbox.git] / openbox / config_value.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    config_value.h for the Openbox window manager
4    Copyright (c) 2011        Dana Jansens
5
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.
10
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.
15
16    See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #include "geom.h"
20
21 #include <glib.h>
22
23 struct _GravityCoord;
24 struct _ObActionList;
25
26 typedef struct _ObConfigValue ObConfigValue;
27
28 void config_value_ref(ObConfigValue *v);
29 void config_value_unref(ObConfigValue *v);
30
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);
36
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);
43
44 ObConfigValue* config_value_new_action_list(struct _ObActionList *al);
45
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);
49
50 /* These ones are valid on a string value */
51
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);
57
58 /* These ones are valid on a string list value */
59
60 gchar const*const* config_value_string_list(ObConfigValue *v);
61
62 /* These ones are value on a action list value */
63
64 struct _ObActionList* config_value_action_list(ObConfigValue *v);