mirror of
https://github.com/brl/mutter.git
synced 2024-12-28 13:52:15 +00:00
62844d5f04
Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
91 lines
3.3 KiB
C
91 lines
3.3 KiB
C
#ifndef __CLUTTER_DEBUG_H__
|
|
#define __CLUTTER_DEBUG_H__
|
|
|
|
#include <glib.h>
|
|
#include "clutter-main.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef enum {
|
|
CLUTTER_DEBUG_MISC = 1 << 0,
|
|
CLUTTER_DEBUG_ACTOR = 1 << 1,
|
|
CLUTTER_DEBUG_TEXTURE = 1 << 2,
|
|
CLUTTER_DEBUG_EVENT = 1 << 3,
|
|
CLUTTER_DEBUG_PAINT = 1 << 4,
|
|
CLUTTER_DEBUG_GL = 1 << 5,
|
|
CLUTTER_DEBUG_ALPHA = 1 << 6,
|
|
CLUTTER_DEBUG_BEHAVIOUR = 1 << 7,
|
|
CLUTTER_DEBUG_PANGO = 1 << 8,
|
|
CLUTTER_DEBUG_BACKEND = 1 << 9,
|
|
CLUTTER_DEBUG_SCHEDULER = 1 << 10,
|
|
CLUTTER_DEBUG_SCRIPT = 1 << 11,
|
|
CLUTTER_DEBUG_SHADER = 1 << 12,
|
|
CLUTTER_DEBUG_MULTISTAGE = 1 << 13,
|
|
CLUTTER_DEBUG_ANIMATION = 1 << 14
|
|
} ClutterDebugFlag;
|
|
|
|
#ifdef CLUTTER_ENABLE_DEBUG
|
|
|
|
#ifdef __GNUC_
|
|
#define CLUTTER_NOTE(type,x,a...) G_STMT_START { \
|
|
if (clutter_debug_flags & CLUTTER_DEBUG_##type) \
|
|
{ g_message ("[" #type "] " G_STRLOC ": " x, ##a); } \
|
|
} G_STMT_END
|
|
|
|
#define CLUTTER_TIMESTAMP(type,x,a...) G_STMT_START { \
|
|
if (clutter_debug_flags & CLUTTER_DEBUG_##type) \
|
|
{ g_message ("[" #type "]" " %li:" G_STRLOC ": " \
|
|
x, clutter_get_timestamp(), ##a); } \
|
|
} G_STMT_END
|
|
#else
|
|
/* Try the C99 version; unfortunately, this does not allow us to pass
|
|
* empty arguments to the macro, which means we have to
|
|
* do an intemediate printf.
|
|
*/
|
|
#define CLUTTER_NOTE(type,...) G_STMT_START { \
|
|
if (clutter_debug_flags & CLUTTER_DEBUG_##type) \
|
|
{ \
|
|
gchar * _fmt = g_strdup_printf (__VA_ARGS__); \
|
|
g_message ("[" #type "] " G_STRLOC ": %s",_fmt); \
|
|
g_free (_fmt); \
|
|
} \
|
|
} G_STMT_END
|
|
|
|
#define CLUTTER_TIMESTAMP(type,...) G_STMT_START { \
|
|
if (clutter_debug_flags & CLUTTER_DEBUG_##type) \
|
|
{ \
|
|
gchar * _fmt = g_strdup_printf (__VA_ARGS__); \
|
|
g_message ("[" #type "]" " %li:" G_STRLOC ": %s", \
|
|
clutter_get_timestamp(), _fmt); \
|
|
g_free (_fmt); \
|
|
} \
|
|
} G_STMT_END
|
|
#endif
|
|
|
|
#define CLUTTER_MARK() CLUTTER_NOTE(MISC, "== mark ==")
|
|
#define CLUTTER_DBG(x) { a }
|
|
|
|
#define CLUTTER_GLERR() G_STMT_START { \
|
|
if (clutter_debug_flags & CLUTTER_DEBUG_GL) \
|
|
{ GLenum _err = glGetError (); /* roundtrip */ \
|
|
if (_err != GL_NO_ERROR) \
|
|
g_warning (G_STRLOC ": GL Error %x", _err); \
|
|
} } G_STMT_END
|
|
|
|
|
|
#else /* !CLUTTER_ENABLE_DEBUG */
|
|
|
|
#define CLUTTER_NOTE(type,...)
|
|
#define CLUTTER_MARK()
|
|
#define CLUTTER_DBG(x)
|
|
#define CLUTTER_GLERR()
|
|
#define CLUTTER_TIMESTAMP(type,...)
|
|
|
|
#endif /* CLUTTER_ENABLE_DEBUG */
|
|
|
|
extern guint clutter_debug_flags;
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __CLUTTER_DEBUG_H__ */
|