mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
74de3cfdf3
Add an effects chapter which gives a broad overview of the abstract classes in the effects API, plus a short example of how to apply one of the stock Clutter effects (ClutterColorizeEffect). The recipe explains how to create a custom ClutterDeformEffect to produce a page fold (code based on ClutterPageTurnEffect). The example code includes the effect class plus a small application to apply it to a texture.
50 lines
2.3 KiB
C
50 lines
2.3 KiB
C
#ifndef __CB_PAGE_FOLD_EFFECT_H__
|
|
#define __CB_PAGE_FOLD_EFFECT_H__
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
GType cb_page_fold_effect_get_type (void);
|
|
|
|
#define CB_TYPE_PAGE_FOLD_EFFECT (cb_page_fold_effect_get_type ())
|
|
#define CB_PAGE_FOLD_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
CB_TYPE_PAGE_FOLD_EFFECT, \
|
|
CbPageFoldEffect))
|
|
#define CB_IS_PAGE_FOLD_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
CB_TYPE_PAGE_FOLD_EFFECT))
|
|
#define CB_PAGE_FOLD_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
CB_TYPE_PAGE_FOLD_EFFECT, \
|
|
CbPageFoldEffectClass))
|
|
#define CB_IS_PAGE_FOLD_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
CB_TYPE_PAGE_FOLD_EFFECT))
|
|
#define CB_PAGE_FOLD_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
CB_TYPE_PAGE_FOLD_EFFECT, \
|
|
CbPageFoldEffectClass))
|
|
|
|
typedef struct _CbPageFoldEffectPrivate CbPageFoldEffectPrivate;
|
|
typedef struct _CbPageFoldEffect CbPageFoldEffect;
|
|
typedef struct _CbPageFoldEffectClass CbPageFoldEffectClass;
|
|
|
|
/* object */
|
|
struct _CbPageFoldEffect
|
|
{
|
|
ClutterDeformEffect parent_instance;
|
|
CbPageFoldEffectPrivate *priv;
|
|
};
|
|
|
|
/* class */
|
|
struct _CbPageFoldEffectClass
|
|
{
|
|
ClutterDeformEffectClass parent_class;
|
|
};
|
|
|
|
ClutterEffect *cb_page_fold_effect_new (gdouble angle,
|
|
gdouble period);
|
|
void cb_page_fold_effect_set_angle (CbPageFoldEffect *effect,
|
|
gdouble angle);
|
|
void cb_page_fold_effect_set_period (CbPageFoldEffect *effect,
|
|
gdouble period);
|
|
gdouble cb_page_fold_effect_get_period (CbPageFoldEffect *effect);
|
|
gdouble cb_page_fold_effect_get_angle (CbPageFoldEffect *effect);
|
|
|
|
#endif /* __CB_PAGE_FOLD_EFFECT_H__ */
|