2 * Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef GPLATE_VARIABLE_H
18 #define GPLATE_VARIABLE_H
21 #include <glib-object.h>
23 #define GPLATE_TYPE_VARIABLE (gplate_variable_get_gtype())
24 #define GPLATE_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLATE_TYPE_VARIABLE, GPlateVariable))
25 #define GPLATE_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GPLATE_TYPE_VARIABLE, GPlateVariableClass))
26 #define GPLATE_IS_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLATE_TYPE_VARIABLE))
27 #define GPLATE_IS_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GPLATE_TYPE_VARIABLE))
28 #define GPLATE_VARIABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLATE_TYPE_VARIABLE, GPlateVariableClass))
30 typedef struct _GPlateVariable GPlateVariable;
31 typedef struct _GPlateVariableClass GPlateVariableClass;
33 struct _GPlateVariable {
36 void (*_gplate_reserved1)(void);
37 void (*_gplate_reserved2)(void);
38 void (*_gplate_reserved3)(void);
39 void (*_gplate_reserved4)(void);
42 struct _GPlateVariableClass {
45 const gchar *(*get_name)(const GPlateVariable *variable);
47 const gchar *(*get_value)(const GPlateVariable *variable);
48 void (*set_value)(GPlateVariable *variable, const gchar *value);
50 void (*_gplate_reserved1)(void);
51 void (*_gplate_reserved2)(void);
52 void (*_gplate_reserved3)(void);
53 void (*_gplate_reserved4)(void);
58 GType gplate_variable_get_gtype(void);
60 GPlateVariable *gplate_variable_new_from_string(const gchar *name, const gchar *value);
61 GPlateVariable *gplate_variable_new_from_boolean(const gchar *name, gboolean value);
62 GPlateVariable *gplate_variable_new_from_integer(const gchar *name, gint value);
63 GPlateVariable *gplate_variable_new_from_float(const gchar *name, gfloat value);
64 GPlateVariable *gplate_variable_new_from_double(const gchar *name, gdouble value);
66 const gchar *gplate_variable_get_name(const GPlateVariable *variable);
68 const gchar *gplate_variable_get_value(const GPlateVariable *variable);
69 void gplate_variable_set_value(GPlateVariable *variable, const gchar *value);
73 #endif /* GPLATE_VARIABLE_H */