4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
7 * Emmanuele Bassi <ebassi@openedhand.com>
9 * Copyright (C) 2006 OpenedHand
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
25 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
29 #ifndef __CLUTTER_SCRIPTABLE_H__
30 #define __CLUTTER_SCRIPTABLE_H__
32 #include <glib-object.h>
33 #include <json-glib/json-glib.h>
34 #include <clutter/clutter-script.h>
38 #define CLUTTER_TYPE_SCRIPTABLE (clutter_scriptable_get_type ())
39 #define CLUTTER_SCRIPTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SCRIPTABLE, ClutterScriptable))
40 #define CLUTTER_IS_SCRIPTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SCRIPTABLE))
41 #define CLUTTER_SCRIPTABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_SCRIPTABLE, ClutterScriptableIface))
43 typedef struct _ClutterScriptable ClutterScriptable;
44 typedef struct _ClutterScriptableIface ClutterScriptableIface;
49 * #ClutterScriptable is an opaque structure whose members cannot be directly
56 * ClutterScriptableIface:
57 * @set_id: virtual function for setting the id of a scriptable object
58 * @get_id: virtual function for getting the id of a scriptable object
59 * @parse_custom_node: virtual function for parsing complex data containers
60 * into GObject properties
61 * @set_custom_property: virtual function for setting a custom property
63 * Interface for implementing "scriptable" objects. An object implementing
64 * this interface can override the parsing and properties setting sequence
65 * when loading a UI definition data with #ClutterScript
69 struct _ClutterScriptableIface
72 GTypeInterface g_iface;
75 void (* set_id) (ClutterScriptable *scriptable,
77 const gchar *(* get_id) (ClutterScriptable *scriptable);
79 gboolean (* parse_custom_node) (ClutterScriptable *scriptable,
80 ClutterScript *script,
84 void (* set_custom_property) (ClutterScriptable *scriptable,
85 ClutterScript *script,
90 GType clutter_scriptable_get_type (void) G_GNUC_CONST;
92 void clutter_scriptable_set_id (ClutterScriptable *scriptable,
94 const gchar * clutter_scriptable_get_id (ClutterScriptable *scriptable);
95 gboolean clutter_scriptable_parse_custom_node (ClutterScriptable *scriptable,
96 ClutterScript *script,
100 void clutter_scriptable_set_custom_property (ClutterScriptable *scriptable,
101 ClutterScript *script,
103 const GValue *value);
107 #endif /* __CLUTTER_SCRIPTABLE_H__ */