docs: Add PathConstraint

This commit is contained in:
Emmanuele Bassi 2010-10-25 16:09:40 +01:00
parent 6f8e46e0b3
commit f6ab7eccd9
3 changed files with 85 additions and 1 deletions

View File

@ -22,6 +22,20 @@
* Emmanuele Bassi <ebassi@linux.intel.com> * Emmanuele Bassi <ebassi@linux.intel.com>
*/ */
/**
* SECTION:clutter-path-constraint
* @Title: ClutterPathConstraint
* @Short_Description: A constraint that follows a path
*
* #ClutterPathConstraint is a simple constraint that modifies the allocation
* of the #ClutterActor to which it has been applied using a #ClutterPath.
*
* By setting the #ClutterPathConstraint:offset property it is possible to
* control how far along the path the #ClutterActor should be.
*
* ClutterPathConstraint is available since Clutter 1.6.
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -216,6 +230,17 @@ clutter_path_constraint_init (ClutterPathConstraint *self)
self->offset = 0.0f; self->offset = 0.0f;
} }
/**
* clutter_path_constraint_new:
* @path: (allow-none): a #ClutterPath, or %NULL
* @offset: the offset along the #ClutterPath
*
* Creates a new #ClutterPathConstraint with the given @path and @offset
*
* Return value: (transfer full): the newly created #ClutterPathConstraint
*
* Since: 1.6
*/
ClutterConstraint * ClutterConstraint *
clutter_path_constraint_new (ClutterPath *path, clutter_path_constraint_new (ClutterPath *path,
gfloat offset) gfloat offset)
@ -228,6 +253,18 @@ clutter_path_constraint_new (ClutterPath *path,
NULL); NULL);
} }
/**
* clutter_path_constraint_set_path:
* @constraint: a #ClutterPathConstraint
* @path: (allow-none): a #ClutterPath
*
* Sets the @path to be followed by the #ClutterPathConstraint.
*
* The @constraint will take ownership of the #ClutterPath passed to this
* function.
*
* Since: 1.6
*/
void void
clutter_path_constraint_set_path (ClutterPathConstraint *constraint, clutter_path_constraint_set_path (ClutterPathConstraint *constraint,
ClutterPath *path) ClutterPath *path)
@ -253,6 +290,18 @@ clutter_path_constraint_set_path (ClutterPathConstraint *constraint,
_clutter_notify_by_pspec (G_OBJECT (constraint), path_properties[PROP_PATH]); _clutter_notify_by_pspec (G_OBJECT (constraint), path_properties[PROP_PATH]);
} }
/**
* clutter_path_constraint_get_path:
* @constraint: a #ClutterPathConstraint
*
* Retrieves a pointer to the #ClutterPath used by @constraint.
*
* Return value: (transfer none): the #ClutterPath used by the
* #ClutterPathConstraint, or %NULL. The returned #ClutterPath is owned
* by the constraint and it should not be unreferenced
*
* Since: 1.6
*/
ClutterPath * ClutterPath *
clutter_path_constraint_get_path (ClutterPathConstraint *constraint) clutter_path_constraint_get_path (ClutterPathConstraint *constraint)
{ {
@ -261,6 +310,15 @@ clutter_path_constraint_get_path (ClutterPathConstraint *constraint)
return constraint->path; return constraint->path;
} }
/**
* clutter_path_constraint_set_offset:
* @constraint: a #ClutterPathConstraint
* @offset: the offset along the path
*
* Sets the offset along the #ClutterPath used by @constraint.
*
* Since: 1.6
*/
void void
clutter_path_constraint_set_offset (ClutterPathConstraint *constraint, clutter_path_constraint_set_offset (ClutterPathConstraint *constraint,
gfloat offset) gfloat offset)
@ -278,6 +336,16 @@ clutter_path_constraint_set_offset (ClutterPathConstraint *constraint,
_clutter_notify_by_pspec (G_OBJECT (constraint), path_properties[PROP_OFFSET]); _clutter_notify_by_pspec (G_OBJECT (constraint), path_properties[PROP_OFFSET]);
} }
/**
* clutter_path_constraint_get_offset:
* @constraint: a #ClutterPathConstraint
*
* Retrieves the offset along the #ClutterPath used by @constraint.
*
* Return value: the offset
*
* Since: 1.6
*/
gfloat gfloat
clutter_path_constraint_get_offset (ClutterPathConstraint *constraint) clutter_path_constraint_get_offset (ClutterPathConstraint *constraint)
{ {

View File

@ -44,7 +44,7 @@ G_BEGIN_DECLS
* <structname>ClutterPathConstraint</structname> is an opaque structure * <structname>ClutterPathConstraint</structname> is an opaque structure
* whose members cannot be directly accessed * whose members cannot be directly accessed
* *
* Since: 1.4 * Since: 1.6
*/ */
typedef struct _ClutterPathConstraint ClutterPathConstraint; typedef struct _ClutterPathConstraint ClutterPathConstraint;

View File

@ -2556,3 +2556,19 @@ CLUTTER_IS_SETTINGS
<SUBSECTION Private> <SUBSECTION Private>
clutter_settings_get_type clutter_settings_get_type
</SECTION> </SECTION>
<SECTION>
<FILE>clutter-path-constraint</FILE>
ClutterPathConstraint
clutter_path_constraint_new
clutter_path_constraint_set_path
clutter_path_constraint_get_path
clutter_path_constraint_set_offset
clutter_path_constraint_get_offset
<SUBSECTION Standard>
CLUTTER_PATH_CONSTRAINT
CLUTTER_IS_PATH_CONSTRAINT
CLUTTER_TYPE_PATH_CONSTRAINT
<SUBSECTION Private>
clutter_path_constraint_get_type
</SECTION>