script: Move all parser code inside ClutterScriptParser

ClutterScript is currently a mix of parser-related code and
the ClutterScript object. All the parser-related code should
be moved inside a private class, ClutterScriptParser, inheriting
from JsonParser.
This commit is contained in:
Emmanuele Bassi 2009-11-04 13:32:26 +00:00
parent d7cfa15851
commit 31e5dadb68
3 changed files with 1438 additions and 1373 deletions

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,21 @@
G_BEGIN_DECLS
#define CLUTTER_TYPE_SCRIPT_PARSER (clutter_script_parser_get_type ())
#define CLUTTER_SCRIPT_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SCRIPT_PARSER, ClutterScriptParser))
#define CLUTTER_IS_SCRIPT_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SCRIPT_PARSER))
typedef struct _ClutterScriptParser ClutterScriptParser;
typedef struct _JsonParserClass ClutterScriptParserClass;
struct _ClutterScriptParser
{
JsonParser parent_instance;
/* back reference */
ClutterScript *script;
};
typedef GType (* GTypeGetFunc) (void);
typedef struct {
@ -75,6 +90,8 @@ typedef struct {
void property_info_free (gpointer data);
GType clutter_script_parser_get_type (void) G_GNUC_CONST;
gboolean clutter_script_parse_node (ClutterScript *script,
GValue *value,
const gchar *name,
@ -84,7 +101,7 @@ gboolean clutter_script_parse_node (ClutterScript *script,
GType clutter_script_get_type_from_symbol (const gchar *symbol);
GType clutter_script_get_type_from_class (const gchar *name);
GObject *clutter_script_construct_object (ClutterScript *script,
GObject *_clutter_script_construct_object (ClutterScript *script,
ObjectInfo *info);
gulong clutter_script_resolve_animation_mode (const gchar *namer);
@ -108,6 +125,25 @@ gboolean clutter_script_parse_color (ClutterScript *script,
GObject *clutter_script_parse_alpha (ClutterScript *script,
JsonNode *node);
gchar *_clutter_script_generate_fake_id (ClutterScript *script);
void _clutter_script_warn_missing_attribute (ClutterScript *script,
const gchar *id,
const gchar *attribute);
void _clutter_script_warn_invalid_value (ClutterScript *script,
const gchar *attribute,
const gchar *expected,
JsonNode *node);
ObjectInfo *_clutter_script_get_object_info (ClutterScript *script,
const gchar *script_id);
guint _clutter_script_get_last_merge_id (ClutterScript *script);
void _clutter_script_add_object_info (ClutterScript *script,
ObjectInfo *oinfo);
G_END_DECLS
#endif /* __CLUTTER_SCRIPT_PRIVATE_H__ */

File diff suppressed because it is too large Load Diff