
@c %start of fragment

@deffn Function clutter-script-new  @result{}@tie{} (ret@tie{}@code{<clutter-script>})
Creates a new @code{<clutter-script>} instance. @code{<clutter-script>}
can be used to load objects definitions for scenegraph elements, like
actors, or behavioural elements, like behaviours and timelines. The
definitions must be encoded using the JavaScript Object Notation (JSON)
language.

@table @var
@item ret
the newly created @code{<clutter-script>} instance. Use
@code{g-object-unref} when done.

@end table

Since 0.6

@end deffn

@deffn Function clutter-script-load-from-data  (self@tie{}@code{<clutter-script>}) (data@tie{}@code{mchars}) (length@tie{}@code{ssize_t}) @result{}@tie{} (ret@tie{}@code{unsigned-int})
@deffnx Method load-from-data
Loads the definitions from @var{data} into @var{script} and merges with
the currently loaded ones, if any.

@table @var
@item script
a @code{<clutter-script>}

@item data
a buffer containing the definitions

@item length
the length of the buffer, or -1 if @var{data} is a NUL-terminated buffer

@item error
return location for a @code{<g-error>}, or @samp{@code{#f}}

@item ret
on error, zero is returned and @var{error} is set accordingly. On
success, the merge id for the UI definitions is returned. You can use
the merge id with @code{clutter-script-unmerge-objects}.

@end table

Since 0.6

@end deffn

@deffn Function clutter-script-load-from-file  (self@tie{}@code{<clutter-script>}) (filename@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{unsigned-int})
@deffnx Method load-from-file
Loads the definitions from @var{filename} into @var{script} and merges
with the currently loaded ones, if any.

@table @var
@item script
a @code{<clutter-script>}

@item filename
the full path to the definition file

@item error
return location for a @code{<g-error>}, or @samp{@code{#f}}

@item ret
on error, zero is returned and @var{error} is set accordingly. On
success, the merge id for the UI definitions is returned. You can use
the merge id with @code{clutter-script-unmerge-objects}.

@end table

Since 0.6

@end deffn

@deffn Function clutter-script-load-from-resource  (self@tie{}@code{<clutter-script>}) (resource_path@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{unsigned-int})
@deffnx Method load-from-resource
Loads the definitions from a resource file into @var{script} and merges
with the currently loaded ones, if any.

@table @var
@item script
a @code{<clutter-script>}

@item resource-path
the resource path of the file to parse

@item error
return location for a @code{<g-error>}, or @samp{@code{#f}}

@item ret
on error, zero is returned and @var{error} is set accordingly. On
success, the merge id for the UI definitions is returned. You can use
the merge id with @code{clutter-script-unmerge-objects}.

@end table

Since 1.10

@end deffn

@deffn Function clutter-script-lookup-filename  (self@tie{}@code{<clutter-script>}) (filename@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{mchars})
@deffnx Method lookup-filename
Looks up @var{filename} inside the search paths of @var{script}. If
@var{filename} is found, its full path will be returned .

@table @var
@item script
a @code{<clutter-script>}

@item filename
the name of the file to lookup

@item ret
the full path of @var{filename} or @samp{@code{#f}} if no path was
found.

@end table

Since 0.8

@end deffn

@deffn Function clutter-script-get-object  (self@tie{}@code{<clutter-script>}) (name@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{<gobject>})
@deffnx Method get-object
Retrieves the object bound to @var{name}. This function does not
increment the reference count of the returned object.

@table @var
@item script
a @code{<clutter-script>}

@item name
the name of the object to retrieve

@item ret
the named object, or @samp{@code{#f}} if no object with the given name
was available.

@end table

Since 0.6

@end deffn

@deffn Function clutter-script-unmerge-objects  (self@tie{}@code{<clutter-script>}) (merge_id@tie{}@code{unsigned-int})
@deffnx Method unmerge-objects
Unmerges the objects identified by @var{merge-id}.

@table @var
@item script
a @code{<clutter-script>}

@item merge-id
merge id returned when loading a UI definition

@end table

Since 0.6

@end deffn

@deffn Function clutter-script-ensure-objects  (self@tie{}@code{<clutter-script>})
@deffnx Method ensure-objects
Ensure that every object defined inside @var{script} is correctly
constructed. You should rarely need to use this function.

@table @var
@item script
a @code{<clutter-script>}

@end table

Since 0.6

@end deffn

@deffn Function clutter-script-list-objects  (self@tie{}@code{<clutter-script>}) @result{}@tie{} (ret@tie{}@code{glist-of})
@deffnx Method list-objects
Retrieves all the objects created by @var{script}.

Note: this function does not increment the reference count of the
objects it returns.

@table @var
@item script
a @code{<clutter-script>}

@item ret
a list of @code{<gobject>}s, or @samp{@code{#f}}. The objects are owned
by the @code{<clutter-script>} instance. Use @code{g-list-free} on the
returned list when done.

@end table

Since 0.8.2

@end deffn

@deffn Function clutter-script-add-states  (self@tie{}@code{<clutter-script>}) (name@tie{}@code{mchars}) (state@tie{}@code{<clutter-state>})
@deffnx Method add-states
Associates a @code{<clutter-state>} to the @code{<clutter-script>}
instance using the given name.

The @code{<clutter-script>} instance will use @var{state} to resolve
target states when connecting signal handlers.

The @code{<clutter-script>} instance will take a reference on the
@code{<clutter-state>} passed to this function.

@table @var
@item script
a @code{<clutter-script>}

@item name
a name for the @var{state}, or @samp{@code{#f}} to set the default
@code{<clutter-state>}.

@item state
a @code{<clutter-state>}

@end table

Since 1.8

@end deffn

@deffn Function clutter-script-get-states  (self@tie{}@code{<clutter-script>}) (name@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{<clutter-state>})
@deffnx Method get-states
Retrieves the @code{<clutter-state>} for the given @var{state-name}.

If @var{name} is @samp{@code{#f}}, this function will return the default
@code{<clutter-state>} instance.

@table @var
@item script
a @code{<clutter-script>}

@item name
the name of the @code{<clutter-state>}, or @samp{@code{#f}}.

@item ret
a pointer to the @code{<clutter-state>} for the given name. The
@code{<clutter-state>} is owned by the @code{<clutter-script>} instance
and it should not be unreferenced.

@end table

Since 1.8

@end deffn

@deffn Function clutter-script-get-type-from-name  (self@tie{}@code{<clutter-script>}) (type_name@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{<gtype>})
@deffnx Method get-type-from-name
Looks up a type by name, using the virtual function that
@code{<clutter-script>} has for that purpose. This function should
rarely be used.

@table @var
@item script
a @code{<clutter-script>}

@item type-name
name of the type to look up

@item ret
the type for the requested type name, or @samp{G_TYPE_INVALID} if not
corresponding type was found.

@end table

Since 0.6

@end deffn

@deffn Function clutter-get-script-id  (gobject@tie{}@code{<gobject>}) @result{}@tie{} (ret@tie{}@code{mchars})
Retrieves the Clutter script id, if any.

@table @var
@item gobject
a @code{<gobject>}

@item ret
the script id, or @samp{@code{#f}} if @var{object} was not defined
inside a UI definition file. The returned string is owned by the object
and should never be modified or freed.

@end table

Since 0.6

@end deffn


@c %end of fragment
