Commit c9e8bbc9 authored by Stephan Haller's avatar Stephan Haller

Next step to complete API documentation

parent 08a6df64
......@@ -706,7 +706,7 @@ static void _xfdashboard_actor_stylable_invalidate(XfdashboardStylable *inStylab
++i,
styleValue->source,
(gchar*)styleName,
styleValue->string);
styleValue->value);
}
XFDASHBOARD_DEBUG(self, STYLE, "End of styles from theme");
......@@ -742,7 +742,7 @@ static void _xfdashboard_actor_stylable_invalidate(XfdashboardStylable *inStylab
* if conversion was successful. Otherwise do nothing.
*/
g_value_init(&cssValue, G_TYPE_STRING);
g_value_set_string(&cssValue, styleValue->string);
g_value_set_string(&cssValue, styleValue->value);
g_value_init(&propertyValue, G_PARAM_SPEC_VALUE_TYPE(realParamSpec));
......
......@@ -658,10 +658,15 @@ void xfdashboard_animation_init(XfdashboardAnimation *self)
*
* theme=xfdashboard_core_get_theme(NULL);
* theme_animations=xfdashboard_theme_get_animation(theme);
* animation=xfdashboard_theme_animation_create(theme_animations, inSender, inSignal, NULL, NULL);
* animation=xfdashboard_theme_animation_create(theme_animations,
* inSender,
* inSignal,
* NULL,
* NULL);
* ]|
*
* Return value: (transfer full): The instance of #XfdashboardAnimation.
* Return value: (transfer full): The instance of #XfdashboardAnimation or %NULL
* in case of errors or if no matching sender and signal was found.
*/
XfdashboardAnimation* xfdashboard_animation_new(XfdashboardActor *inSender, const gchar *inSignal)
{
......@@ -696,13 +701,21 @@ XfdashboardAnimation* xfdashboard_animation_new(XfdashboardActor *inSender, cons
* A list of default values to set the final values of the properties can be
* provided at @inDefaultFinalValues. If it is set to %NULL then the current
* property's value when the animation is started will be used as final value.
* This list must be %NULL-terminated.
* This list must be %NULL-terminated. For convenience the utility function
* xfdashboard_animation_defaults_new() can be use to create this list for
* initiral and final values.
*
* The theme can provide an initial and final values and have higher precedence
* as the default initial and final values passed to this function.
* <note>
* <para>
* The theme can provide initial and final values and have higher precedence
* as the default initial and final values passed to this function.
* </para>
* </note>
*
* The caller is responsible to free and/or unref the values in the lists
* provided at @inDefaultInitialValues and @inDefaultFinalValues.
* provided at @inDefaultInitialValues and @inDefaultFinalValues. If this list
* was built with xfdashboard_animation_defaults_new() use the function
* xfdashboard_animation_defaults_free() to free this list accordingly.
*
* This function is the logical equivalent of:
*
......@@ -712,10 +725,15 @@ XfdashboardAnimation* xfdashboard_animation_new(XfdashboardActor *inSender, cons
*
* theme=xfdashboard_core_get_theme(NULL);
* theme_animations=xfdashboard_theme_get_animation(theme);
* animation=xfdashboard_theme_animation_create(theme_animations, inSender, inSignal, inDefaultInitialValues, inDefaultFinalValues);
* animation=xfdashboard_theme_animation_create(theme_animations,
* inSender,
* inSignal,
* inDefaultInitialValues,
* inDefaultFinalValues);
* ]|
*
* Return value: (transfer full): The instance of #XfdashboardAnimation.
* Return value: (transfer full): The instance of #XfdashboardAnimation or %NULL
* in case of errors or if no matching sender and signal was found.
*/
XfdashboardAnimation* xfdashboard_animation_new_with_values(XfdashboardActor *inSender,
const gchar *inSignal,
......@@ -742,8 +760,8 @@ XfdashboardAnimation* xfdashboard_animation_new_with_values(XfdashboardActor *in
* @inSender: The #XfdashboardActor requesting the animation
* @inID: A string containing the ID of animation to create for sender
*
* Creates a new animation of type #XfdashboardAnimation for the sending
* actor at @inSender from theme's animation with ID requested at @inID.
* Creates a new animation of type #XfdashboardAnimation for the sending actor
* at @inSender from theme's animation with ID requested at @inID.
*
* This function is the logical equivalent of:
*
......@@ -753,10 +771,15 @@ XfdashboardAnimation* xfdashboard_animation_new_with_values(XfdashboardActor *in
*
* theme=xfdashboard_core_get_theme(NULL);
* theme_animations=xfdashboard_theme_get_animation(theme);
* animation=xfdashboard_theme_animation_create_by_id(theme_animations, inSender, inSignal, NULL, NULL);
* animation=xfdashboard_theme_animation_create_by_id(theme_animations,
* inSender,
* inID,
* NULL,
* NULL);
* ]|
*
* Return value: (transfer full): The instance of #XfdashboardAnimation.
* Return value: (transfer full): The instance of #XfdashboardAnimation or %NULL
* in case of errors or if ID was not found.
*/
XfdashboardAnimation* xfdashboard_animation_new_by_id(XfdashboardActor *inSender, const gchar *inID)
{
......@@ -781,8 +804,8 @@ XfdashboardAnimation* xfdashboard_animation_new_by_id(XfdashboardActor *inSender
* @inDefaultInitialValues: A %NULL-terminated list of default initial values
* @inDefaultFinalValues: A %NULL-terminated list of default final values
*
* Creates a new animation of type #XfdashboardAnimation for the sending
* actor at @inSender from theme's animation with ID requested at @inID.
* Creates a new animation of type #XfdashboardAnimation for the sending actor
* at @inSender from theme's animation with ID requested at @inID.
*
* A list of default values to set the initial values of the properties can be
* provided at @inDefaultInitialValues. If it is set to %NULL then the current
......@@ -791,13 +814,21 @@ XfdashboardAnimation* xfdashboard_animation_new_by_id(XfdashboardActor *inSender
* A list of default values to set the final values of the properties can be
* provided at @inDefaultFinalValues. If it is set to %NULL then the current
* property's value when the animation is started will be used as final value.
* This list must be %NULL-terminated.
* This list must be %NULL-terminated. For convenience the utility function
* xfdashboard_animation_defaults_new() can be use to create this list for
* initiral and final values.
*
* The theme can provide an initial and final values and have higher precedence
* as the default initial and final values passed to this function.
* <note>
* <para>
* The theme can provide initial and final values and have higher precedence
* as the default initial and final values passed to this function.
* </para>
* </note>
*
* The caller is responsible to free and/or unref the values in the lists
* provided at @inDefaultInitialValues and @inDefaultFinalValues.
* provided at @inDefaultInitialValues and @inDefaultFinalValues. If this list
* was built with xfdashboard_animation_defaults_new() use the function
* xfdashboard_animation_defaults_free() to free this list accordingly.
*
* This function is the logical equivalent of:
*
......@@ -807,10 +838,15 @@ XfdashboardAnimation* xfdashboard_animation_new_by_id(XfdashboardActor *inSender
*
* theme=xfdashboard_core_get_theme(NULL);
* theme_animations=xfdashboard_theme_get_animation(theme);
* animation=xfdashboard_theme_animation_create_by_id(theme_animations, inSender, inSignal, inDefaultInitialValues, inDefaultFinalValues);
* animation=xfdashboard_theme_animation_create_by_id(theme_animations,
* inSender,
* inID,
* inDefaultInitialValues,
* inDefaultFinalValues);
* ]|
*
* Return value: (transfer full): The instance of #XfdashboardAnimation.
* Return value: (transfer full): The instance of #XfdashboardAnimation or %NULL
* in case of errors or if ID was not found.
*/
XfdashboardAnimation* xfdashboard_animation_new_by_id_with_values(XfdashboardActor *inSender,
const gchar *inID,
......@@ -836,8 +872,8 @@ XfdashboardAnimation* xfdashboard_animation_new_by_id_with_values(XfdashboardAct
* @inSender: A #XfdashboardActor emitting the animation signal
* @inSignal: A string containing the signal emitted at sending actor
*
* Check if an animation is defined at the current theme matching
* the sending actor at @inSender and the emitted signal at @inSignal.
* Check if an animation is defined at the current theme matching the sending
* actor at @inSender and the emitted signal at @inSignal.
*
* This function is the logical equivalent of:
*
......@@ -852,6 +888,7 @@ XfdashboardAnimation* xfdashboard_animation_new_by_id_with_values(XfdashboardAct
* animation_id=xfdashboard_theme_animation_lookup_id(theme_animations, inSender, inSignal);
* has_animation=(animation_id!=NULL ? TRUE : FALSE);
* ]|
*
* * Return value: %TRUE if an animation exists, otherwise %FALSE
*/
gboolean xfdashboard_animation_has_animation(XfdashboardActor *inSender, const gchar *inSignal)
......@@ -915,9 +952,9 @@ gboolean xfdashboard_animation_is_empty(XfdashboardAnimation *self)
* xfdashboard_animation_run:
* @self: A #XfdashboardAnimation
*
* Starts the animation of @self. It emits the ::done signal
* when the animation is destroyed, either is has reached the
* end of its timeline or was stopped before.
* Starts the animation of @self. It emits the ::done signal when the animation
* is destroyed, either is has reached the end of its timeline or was stopped
* before.
*/
void xfdashboard_animation_run(XfdashboardAnimation *self)
{
......@@ -968,10 +1005,9 @@ void xfdashboard_animation_run(XfdashboardAnimation *self)
* xfdashboard_animation_ensure_complete:
* @self: A #XfdashboardAnimation
*
* Ensures that the animation at @self has reached the end
* of its timeline but will not destroy the animation. Its
* purpose is mainly to ensure the animation has completed
* before it gets destroyed by other parts of the application.
* Ensures that the animation at @self has reached the end of its timeline but
* will not destroy the animation. Its purpose is mainly to ensure the animation
* has completed before it gets destroyed by other parts of the application.
*/
void xfdashboard_animation_ensure_complete(XfdashboardAnimation *self)
{
......@@ -1095,12 +1131,10 @@ static void _xfdashboard_animation_dump_transition(ClutterTransition *inTransiti
* xfdashboard_animation_dump:
* @self: The #XfdashboardAnimation to dump
*
* Dumps a textual representation of animation specified in @self
* to console. The dump contains all transitions recursively displayed
* in a tree.
* Dumps a textual representation of animation specified in @self to console.
* The dump contains all transitions recursively displayed in a tree.
*
* This functions is for debugging purposes and should not be used
* normally.
* This functions is for debugging purposes and should not be used normally.
*/
void xfdashboard_animation_dump(XfdashboardAnimation *self)
{
......@@ -1174,13 +1208,13 @@ void xfdashboard_animation_dump(XfdashboardAnimation *self)
/**
* xfdashboard_animation_defaults_new:
* @inNumberValues: The number of values to follow
* @...: Tuples of property names as string, a parameter type by #GType and the parameter value of any type
* @...: Tuples of property names as string, a parameter type by #GType and the
* parameter value of any type
*
* This is a convenience function to create a %NULL-terminated list
* of #XfdashboardAnimationValue with the definitions of the arguments
* at @...
* This is a convenience function to create a %NULL-terminated list of
* #XfdashboardAnimationValue with the definitions of the arguments at @...
*
* The list can be freed by calling xfdashboard_animation_defaults_free()
* The list can be freed by calling xfdashboard_animation_defaults_free().
*
* Return value: (transfer none): A pointer to start of %NULL-terminated list
* or %NULL in case of errors.
......@@ -1241,8 +1275,8 @@ XfdashboardAnimationValue** xfdashboard_animation_defaults_new(gint inNumberValu
* xfdashboard_animation_defaults_free:
* @inDefaultValues: The list containing #XfdashboardAnimationValue to free
*
* This is a convenience function to free all entries in the
* %NULL-terminated list of #XfdashboardAnimationValue at @inDefaultValues
* This is a convenience function to free all entries in the %NULL-terminated
* list of #XfdashboardAnimationValue at @inDefaultValues.
*/
void xfdashboard_animation_defaults_free(XfdashboardAnimationValue **inDefaultValues)
{
......
......@@ -83,7 +83,8 @@ struct _XfdashboardAnimationClass
/**
* XfdashboardAnimationValue:
* @selector: A #XfdashboardCssSelector to find matchhing actors for the property's value in animation or %NULL to match sender
* @selector: A #XfdashboardCssSelector to find matching actors for the property's
* value in animation or %NULL to match sender
* @property: A string containing the name of the property this value belongs to
* @value: A #GValue containing the value for the property
*
......
......@@ -947,6 +947,13 @@ static void xfdashboard_core_init(XfdashboardCore *self)
/* IMPLEMENTATION: Errors */
/**
* xfdashboard_core_error_quark:
*
* Gets the core error quark.
*
* Returns: The #GQuark for core errors.
*/
GQuark xfdashboard_core_error_quark(void)
{
return(g_quark_from_static_string("xfdashboard-core-error-quark"));
......
......@@ -297,7 +297,7 @@ static void _xfdashboard_stylable_real_invalidate(XfdashboardStylable *self)
* if conversion was successful. Otherwise do nothing.
*/
g_value_init(&cssValue, G_TYPE_STRING);
g_value_set_string(&cssValue, styleValue->string);
g_value_set_string(&cssValue, styleValue->value);
g_value_init(&propertyValue, G_PARAM_SPEC_VALUE_TYPE(propertyValueParamSpec));
......
......@@ -21,6 +21,179 @@
*
*/
/**
* SECTION:theme-animation
* @short_description: A theme animation resource manager
* @include: libxfdashboard/theme-animation.h
*
* #XfdashboardThemeAnimation is used to load animation XML files into a theme,
* to parse the XML file and to set up a definition how to create animations
* for use at actors.
*
* Animation resources are loaded from a list provided by a theme index file
* as describe at <link linkend="XfdashboardTheme.File-location-and-structure">
* File location and structure</link>. But additional resources can be
* loaded with xfdashboard_theme_animation_add_file().
*
* To create an animation call xfdashboard_theme_animation_create() with the
* requesting actor as sender and the emitting signal or
* xfdashboard_theme_animation_create_by_id() with the requesting actor as
* sender and the animation's ID of the animation.
*
* To check if an animation for a sending actor and its emitted signal exists
* call xfdashboard_theme_animation_lookup_id() and use the returned ID to
* create the animation with xfdashboard_theme_animation_create_by_id().
*
* ## Note about resources parser
*
* Because all resources for CSS and XML are texts, the parser does convert texts
* to their needed and native type like booleans, integers etc. The parser can
* convert textual representation for most common property types. Boolean textual
* representations for FALSE are "FALSE, "f", "no", "n", "0" and for TRUE they are
* "TRUE", "t", "yes", "y", "1". Enumeration and flags can be specified either by
* their names, their nicks or integer values. Flags can be combined with "|"
* additionally.
*
* # Animations {#XfdashboardThemeAnimation.Animations}
*
* Animations are described in a XML document.
*
* The location of the XML file is specified in theme's index file at the key
* `Animation` and should be a relative path to theme's path. See
* <link linkend="XfdashboardTheme.File-location-and-structure">File location
* and structure</link> for further documentation of files and folders.
*
* The XML document must begin with the top-level element `<animations>` which
* is a grouping element for all animations defined. The top-level element does
* not expect any attributes set.
*
* Animations are defined by triggers which specify the event when to play a
* animation. Triggers are objects and each object is defined in a `<trigger>`
* element under the top-level element and takes three attributes. The first one
* is `<id>` specifying a unique name which is used as reference and to look up
* an animation directly. The second attribute is `<sender>` attribute defining
* the actor emitting the expected signal which is described in the third
* attribute `<signal>`. All attributes are required. The application will look
* up animations by the actor emitting the signal. Although the application can
* look up animations by the ID directly, it is not used but the ID must be set
* anyway to prevent the same animation to be applied to an actor multiple times.
*
* <warning>
* <para>
* If not otherwise stated, each ID must fulfill the following conditions:
*
* <itemizedlist>
* <listitem>
* <para>
* Each ID must be unique among all files
* </para>
* </listitem>
* <listitem>
* <para>
* Each ID must begin with any number of underscores followed by a
* character or it must begin with a character
* </para>
* </listitem>
* <listitem>
* <para>
* Each ID can contain and mix digits, characters and the symbols:
* _ (underscore), - (minus)
* </para>
* </listitem>
* <listitem>
* <para>
* All characters can be upper or lower case but must be from ASCII
* character set
* </para>
* </listitem>
* <listitem>
* <para>
* The matching regular expression is: (_*[a-zA-Z]+[0-9a-zA-Z_-]*)
* </para>
* </listitem>
* </itemizedlist>
* </para>
* </warning>
*
* Each trigger defines one or more timelines which specify the start of the
* animation after it was applied to an actor as well as the duraction and a
* progress mode of the animation within the timeline. Timelines are objects
* and each object is defined in a `<timeline>` element unter the `<trigger>`
* element and takes up to four attributes. The first attribute `<delay>` is
* optional and defines how long to wait in milliseconds before the animation
* in this timeline is started after it was applied to the actor. It defaults
* to zero (no delay) if not set. The second attribute `<duration>` is required
* and defines how long the animation in this timeline will run in milliseconds.
* The third attribute `<mode>` is optional and defines how the progress will
* happen, e.g. linear or qubic etc. It must be a text value of type
* #ClutterAnimationMode and defaults to `linear` if not set. The fourth
* attribute `<repeat>` is optional and defines how often this timeline is
* repeated with the same delay, duration and mode. If repeat is set to zero
* the timeline will not be repeated at all and it is the default if this
* attribute is not set. If repeat is -1 the timeline will be repeated as long
* as is not stopped explicitly.
*
* Each timeline needs to know to which actor the animation in this timeline
* sholud be applied to. Therefore an `<apply>` element must be defined under
* the `<timeline>` element which takes up to two attributes. The first
* attribute `<to>` is optional and needs a CSS selector to find the matching
* actors by traversing from the specified origin in the second attribute
* `<origin>` which is also optional. The origin can either be `sender` to
* start the traversion from the signal emitting actor (sender) or `stage` to
* start it from top-level element (#XfdashboardStageInterface). The attribute
* `<origin>` defaults to `sender` and the attributes `<to>` defaults to an
* empty string to disable traversion and selected the signal emitting actor
* as target to apply the animation to. Most the time the signal emitting
* actor is also the target for the animation, so it will mostly just a
* `<apply>`.
*
* Last but not least each selected actor in `<apply>` needs to know what
* should be animated. The animation is defined by listing all properties of
* the actors, optionally with a defined start and end value. As the animation
* is applied to all matching actors in `<apply>` they should all share the same
* properties to modify while animation is running. Properties are easy to set.
* For each property to set just add a `<property>` element as a child of the
* `<apply>` element. The `<name>` attribute must be specified and set to the
* name of the property to set. Optionally the start value can be set explicitly
* at attribute `<from>` and the end value at attribute `<to>`. If one or both
* are not set the current value is used as start value and the expected final
* value is used as end value. Most the time it is only neccessary to set up
* the `<property>` element with the property name at `<name>`.
*
* The parser can convert textual representation for most common property types.
* Boolean textual representations for FALSE are "FALSE, "f", "no", "n", "0"
* and for TRUE they are "TRUE", "t", "yes", "y", "1". Enumeration and flags can
* be specified either by their names, their nicks or integer value. Flags can be
* combined with "|" additionally.
*
* The format for the XML file can be described with the following simple but not
* fully accurate DTD:
*
* |[<!-- language="xml" -->
* <!ELEMENT animations (trigger*)>
*
* <!ELEMENT trigger (timeline*)>
* <!ATTLIST trigger id ID #IMPLIED
* sender CDATA #REQUIRED
* signal CDATA #REQUIRED>
*
* <!ELEMENT timeline (apply*)>
* <!ATTLIST timeline delay CDATA
* duration CDATA #REQUIRED
* mode CDATA
* repeat CDATA>
*
* <!ELEMENT apply (property*)>
* <!ATTLIST apply to CDATA
* origin (sender|stage)>
*
* <!ELEMENT property (#CDATA)>
* <!ATTLIST property name CDATA #REQUIRED
* from CDATA
* to CDATA>
* ]|
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
......@@ -625,7 +798,7 @@ static gboolean _xfdashboard_theme_animation_string_to_gint(const gchar *inNumbe
static void _xfdashboard_theme_animation_parse_set_error(XfdashboardThemeAnimationParserData *inParserData,
GMarkupParseContext *inContext,
GError **outError,
XfdashboardThemeAnimationErrorEnum inCode,
XfdashboardThemeAnimationError inCode,
const gchar *inFormat,
...)
{
......@@ -1126,13 +1299,13 @@ static void _xfdashboard_theme_animation_parse_trigger_start(GMarkupParseContext
inAttributeNames,
inAttributeValues,
&error,
G_MARKUP_COLLECT_STRING,
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL,
"delay",
&timelineDelayText,
G_MARKUP_COLLECT_STRING,
"duration",
&timelineDurationText,
G_MARKUP_COLLECT_STRING,
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL,
"mode",
&timelineModeText,
G_MARKUP_COLLECT_STRING | G_MARKUP_COLLECT_OPTIONAL,
......@@ -1145,13 +1318,13 @@ static void _xfdashboard_theme_animation_parse_trigger_start(GMarkupParseContext
}
/* Check tag's attributes */
if(!timelineDelayText || strlen(timelineDelayText)==0)
if(timelineDelayText && strlen(timelineDelayText)==0)
{
_xfdashboard_theme_animation_parse_set_error(data,
inContext,
outError,
XFDASHBOARD_THEME_ANIMATION_ERROR_MALFORMED,
"Missing or empty delay at tag '%s'",
"Empty delay at tag '%s'",
inElementName);
return;
}
......@@ -1167,7 +1340,7 @@ static void _xfdashboard_theme_animation_parse_trigger_start(GMarkupParseContext
return;
}
if(!timelineModeText || strlen(timelineModeText)==0)
if(timelineModeText && strlen(timelineModeText)==0)
{
_xfdashboard_theme_animation_parse_set_error(data,
inContext,
......@@ -1190,7 +1363,9 @@ static void _xfdashboard_theme_animation_parse_trigger_start(GMarkupParseContext
}
/* Convert tag's attributes' value to usable values */
if(!_xfdashboard_theme_animation_string_to_gint(timelineDelayText, &timelineDelay, &error))
timelineDelay=0;
if(timelineDelayText &&
!_xfdashboard_theme_animation_string_to_gint(timelineDelayText, &timelineDelay, &error))
{
g_propagate_error(outError, error);
return;
......@@ -1202,16 +1377,20 @@ static void _xfdashboard_theme_animation_parse_trigger_start(GMarkupParseContext
return;
}
timelineMode=xfdashboard_get_enum_value_from_nickname(CLUTTER_TYPE_ANIMATION_MODE, timelineModeText);
if(timelineMode==G_MININT)
timelineMode=CLUTTER_LINEAR;
if(timelineModeText)
{
/* Set error */
g_set_error(outError,
XFDASHBOARD_THEME_ANIMATION_ERROR,
XFDASHBOARD_THEME_ANIMATION_ERROR_ERROR,
"Invalid mode '%s'",
timelineModeText);
return;
timelineMode=xfdashboard_get_enum_value_from_nickname(CLUTTER_TYPE_ANIMATION_MODE, timelineModeText);
if(timelineMode==G_MININT)
{
/* Set error */
g_set_error(outError,
XFDASHBOARD_THEME_ANIMATION_ERROR,
XFDASHBOARD_THEME_ANIMATION_ERROR_ERROR,
"Invalid mode '%s'",
timelineModeText);
return;
}
}
timelineRepeat=0;
......@@ -2232,22 +2411,44 @@ void xfdashboard_theme_animation_init(XfdashboardThemeAnimation *self)
priv->settings=g_object_ref(xfdashboard_core_get_settings(NULL));
}
/* IMPLEMENTATION: Errors */
GQuark xfdashboard_theme_animation_error_quark(void)
{
return(g_quark_from_static_string("xfdashboard-theme-animation-error-quark"));
}
G_DEFINE_QUARK(xfdashboard-theme-animation-error-quark, xfdashboard_theme_animation_error);
/* IMPLEMENTATION: Public API */
/* Create new instance */
/**
* xfdashboard_theme_animation_new:
*
* Creates a new #XfdashboardThemeAnimation object. It is neccessary to call
* xfdashboard_theme_animation_add_file() for each animation resource to load
* before any animation can be build from animation definition with
* xfdashboard_theme_animation_create() for use at an actor.
*
* Return value: An initialized and empty #XfdashboardThemeAnimation
*/
XfdashboardThemeAnimation* xfdashboard_theme_animation_new(void)
{
return(XFDASHBOARD_THEME_ANIMATION(g_object_new(XFDASHBOARD_TYPE_THEME_ANIMATION, NULL)));
}
/* Load a XML file into theme */
/**
* xfdashboard_theme_animation_add_file:
* @self: A #XfdashboardThemeAnimation
* @inPath: The path to animation XML file to load
* @outError: A return location for a #GError or %NULL
*
* Loads the animation XML resource from @inPath into theme layout object at
* @self.
*
* If loading animation layout resource fails, the error message will be placed
* inside error at @outError (if not %NULL).
*
* Return value: %TRUE if animation XML file could be loaded or %FALSE if not
* and error is stored at @outError.
*/
gboolean xfdashboard_theme_animation_add_file(XfdashboardThemeAnimation *self,
const gchar *inPath,
GError **outError)
......@@ -2286,7 +2487,44 @@ gboolean xfdashboard_theme_animation_add_file(XfdashboardThemeAnimation *self,
return(TRUE);
}
/* Build requested animation for sender and its signal */
/**
* xfdashboard_theme_animation_create:
* @self: A #XfdashboardThemeAnimation
* @inSender: A #XfdashboardActor emitting the animation signal
* @inSignal: A string containing the signal emitted at sending actor
* @inDefaultInitialValues: A %NULL-terminated list of default initial values
* @inDefaultFinalValues: A %NULL-terminated list of default final values
*
* Creates a new animation of type #XfdashboardAnimation matching the sending
* actor at @inSender and the emitted signal at @inSignal as described at
* theme's animation resource manager at @self.
*
* A list of default values to set the initial values of the properties can be
* provided at @inDefaultInitialValues. If it is set to %NULL then the current
* property's value is used as initial value. This list must be %NULL-terminated.
*
* A list of default values to set the final values of the properties can be
* provided at @inDefaultFinalValues. If it is set to %NULL then the current
* property's value when the animation is started will be used as final value.
* This list must be %NULL-terminated. For convenience the utility function
* xfdashboard_animation_defaults_new() can be use to create this list for
* initiral and final values.
*
* <note>
* <para>
* The theme can provide initial and final values and have higher precedence
* as the default initial and final values passed to this function.