4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
8 * Copyright (C) 2006 OpenedHand
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
28 #ifndef __CLUTTER_SCRIPT_H__
29 #define __CLUTTER_SCRIPT_H__
31 #include <clutter/clutter-types.h>
35 #define CLUTTER_TYPE_SCRIPT (clutter_script_get_type ())
36 #define CLUTTER_SCRIPT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SCRIPT, ClutterScript))
37 #define CLUTTER_IS_SCRIPT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SCRIPT))
38 #define CLUTTER_SCRIPT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_SCRIPT, ClutterScriptClass))
39 #define CLUTTER_IS_SCRIPT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SCRIPT))
40 #define CLUTTER_SCRIPT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SCRIPT, ClutterScriptClass))
42 typedef struct _ClutterScript ClutterScript;
43 typedef struct _ClutterScriptPrivate ClutterScriptPrivate;
44 typedef struct _ClutterScriptClass ClutterScriptClass;
47 * ClutterScriptConnectFunc:
48 * @script: a #ClutterScript
49 * @object: the object to connect
50 * @signal_name: the name of the signal
51 * @handler_name: the name of the signal handler
52 * @connect_object: the object to connect the signal to, or %NULL
53 * @flags: signal connection flags
54 * @user_data: user data to pass to the signal handler
56 * This is the signature of a function used to connect signals. It is used
57 * by the clutter_script_connect_signals_full() function. It is mainly
58 * intended for interpreted language bindings, but could be useful where the
59 * programmer wants more control over the signal connection process.
63 typedef void (* ClutterScriptConnectFunc) (ClutterScript *script,
65 const gchar *signal_name,
66 const gchar *handler_name,
67 GObject *connect_object,
73 * @CLUTTER_SCRIPT_ERROR_INVALID_TYPE_FUNCTION: Type function not found
75 * @CLUTTER_SCRIPT_ERROR_INVALID_PROPERTY: Property not found or invalid
76 * @CLUTTER_SCRIPT_ERROR_INVALID_VALUE: Invalid value
78 * #ClutterScript error enumeration.
83 CLUTTER_SCRIPT_ERROR_INVALID_TYPE_FUNCTION,
84 CLUTTER_SCRIPT_ERROR_INVALID_PROPERTY,
85 CLUTTER_SCRIPT_ERROR_INVALID_VALUE
89 * CLUTTER_SCRIPT_ERROR:
91 * Error domain for the #ClutterScript errors
95 #define CLUTTER_SCRIPT_ERROR (clutter_script_error_quark ())
96 GQuark clutter_script_error_quark (void);
101 * The #ClutterScript structure contains only private data
102 * and should be accessed using the provided API
106 struct _ClutterScript
109 GObject parent_instance;
111 ClutterScriptPrivate *priv;
115 * ClutterScriptClass:
116 * @get_type_from_name: virtual function used to map a type name
117 * to a #GType. This function should only be overridden by
118 * language bindings in order to map native types to #GType.
119 * The default implementation is equivalent to g_type_from_name()
121 * The #ClutterScriptClass structure contains only private data
125 struct _ClutterScriptClass
128 GObjectClass parent_class;
131 GType (* get_type_from_name) (ClutterScript *script,
132 const gchar *type_name);
135 /* padding, for future expansion */
136 void (*_clutter_reserved1) (void);
137 void (*_clutter_reserved2) (void);
138 void (*_clutter_reserved3) (void);
139 void (*_clutter_reserved4) (void);
140 void (*_clutter_reserved5) (void);
141 void (*_clutter_reserved6) (void);
142 void (*_clutter_reserved7) (void);
143 void (*_clutter_reserved8) (void);
146 GType clutter_script_get_type (void) G_GNUC_CONST;
148 ClutterScript * clutter_script_new (void);
149 guint clutter_script_load_from_file (ClutterScript *script,
150 const gchar *filename,
152 guint clutter_script_load_from_data (ClutterScript *script,
156 CLUTTER_AVAILABLE_IN_1_10
157 guint clutter_script_load_from_resource (ClutterScript *script,
158 const gchar *resource_path,
161 GObject * clutter_script_get_object (ClutterScript *script,
163 gint clutter_script_get_objects (ClutterScript *script,
164 const gchar *first_name,
165 ...) G_GNUC_NULL_TERMINATED;
166 GList * clutter_script_list_objects (ClutterScript *script);
167 void clutter_script_unmerge_objects (ClutterScript *script,
169 void clutter_script_ensure_objects (ClutterScript *script);
171 CLUTTER_DEPRECATED_IN_1_12
172 void clutter_script_add_states (ClutterScript *script,
174 ClutterState *state);
176 CLUTTER_DEPRECATED_IN_1_12
177 ClutterState * clutter_script_get_states (ClutterScript *script,
180 void clutter_script_connect_signals (ClutterScript *script,
182 void clutter_script_connect_signals_full (ClutterScript *script,
183 ClutterScriptConnectFunc func,
186 void clutter_script_add_search_paths (ClutterScript *script,
187 const gchar * const paths[],
189 gchar * clutter_script_lookup_filename (ClutterScript *script,
190 const gchar *filename) G_GNUC_MALLOC;
191 GType clutter_script_get_type_from_name (ClutterScript *script,
192 const gchar *type_name);
194 CLUTTER_AVAILABLE_IN_1_10
195 void clutter_script_set_translation_domain (ClutterScript *script,
196 const gchar *domain);
197 CLUTTER_AVAILABLE_IN_1_10
198 const gchar * clutter_script_get_translation_domain (ClutterScript *script);
200 const gchar * clutter_get_script_id (GObject *gobject);
204 #endif /* __CLUTTER_SCRIPT_H__ */