CtkEffect

CtkEffect — The base class for all effects

Synopsis

#define             CTK_EFFECT_MIN_MARGIN
#define             CTK_EFFECT_MAX_MARGIN
#define             CTK_EFFECT_DEFAULT_MARGIN
#define             CTK_EFFECT_MIN_OPACITY
#define             CTK_EFFECT_MAX_OPACITY
#define             CTK_EFFECT_DEFAULT_OPACITY
#define             CTK_EFFECT_MIN_STRENGTH
#define             CTK_EFFECT_MAX_STRENGTH
#define             CTK_EFFECT_DEFAULT_STRENGTH
                    CtkEffect;
                    CtkEffectClass;
                    CtkEffectPrivate;
void                (*CtkEffectPaintFunc)               (ClutterActor *actor);
void                ctk_effect_paint                    (CtkEffect *self,
                                                         CtkEffectPaintFunc func,
                                                         gboolean is_last_effect);
void                ctk_effect_set_actor                (CtkEffect *self,
                                                         ClutterActor *actor);
ClutterActor *      ctk_effect_get_actor                (CtkEffect *self);
ClutterAnimation *  ctk_effect_animate                  (CtkEffect *self,
                                                         gulong mode,
                                                         guint duration,
                                                         const gchar *first_property_name,
                                                         ...);
void                ctk_effect_set_margin               (CtkEffect *self,
                                                         gint m);
gint                ctk_effect_get_margin               (CtkEffect *self);
void                ctk_effect_set_opacity              (CtkEffect *self,
                                                         gfloat m);
gfloat              ctk_effect_get_opacity              (CtkEffect *self);
void                ctk_effect_set_strength             (CtkEffect *self,
                                                         gint strength);
gint                ctk_effect_get_strength             (CtkEffect *self);
void                ctk_effect_set_invalidate_effect_cache
                                                        (CtkEffect *self,
                                                         gboolean dirty);
gboolean            ctk_effect_is_effect_cache_dirty    (CtkEffect *self);
ClutterAnimation *  ctk_effect_get_animation            (CtkEffect *self);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----CtkEffect
               +----CtkEffectBlur
               +----CtkEffectCache
               +----CtkEffectDropShadow
               +----CtkEffectGlow

Properties

  "actor"                    gpointer              : Read / Write
  "margin"                   gint                  : Read / Write
  "opacity"                  gfloat                : Read / Write
  "strength"                 gint                  : Read / Write

Description

CtkEffect is the base class that all effects need to derive from.

Details

CTK_EFFECT_MIN_MARGIN

#define CTK_EFFECT_MIN_MARGIN           0


CTK_EFFECT_MAX_MARGIN

#define CTK_EFFECT_MAX_MARGIN           100


CTK_EFFECT_DEFAULT_MARGIN

#define CTK_EFFECT_DEFAULT_MARGIN       0


CTK_EFFECT_MIN_OPACITY

#define CTK_EFFECT_MIN_OPACITY          0.0f


CTK_EFFECT_MAX_OPACITY

#define CTK_EFFECT_MAX_OPACITY          1.0f


CTK_EFFECT_DEFAULT_OPACITY

#define CTK_EFFECT_DEFAULT_OPACITY      1.0f


CTK_EFFECT_MIN_STRENGTH

#define CTK_EFFECT_MIN_STRENGTH         0


CTK_EFFECT_MAX_STRENGTH

#define CTK_EFFECT_MAX_STRENGTH         100


CTK_EFFECT_DEFAULT_STRENGTH

#define CTK_EFFECT_DEFAULT_STRENGTH     5


CtkEffect

typedef struct _CtkEffect CtkEffect;


CtkEffectClass

typedef struct {
  GObjectClass   parent_class;

  /*< vtable, not signals >*/
  void (*paint) (CtkEffect *effect, CtkEffectPaintFunc func, gboolean is_last_effect);
} CtkEffectClass;


CtkEffectPrivate

typedef struct _CtkEffectPrivate CtkEffectPrivate;


CtkEffectPaintFunc ()

void                (*CtkEffectPaintFunc)               (ClutterActor *actor);

actor :


ctk_effect_paint ()

void                ctk_effect_paint                    (CtkEffect *self,
                                                         CtkEffectPaintFunc func,
                                                         gboolean is_last_effect);

Will cause the self to paint itself. Should only be called during a paint cycle. func will be used to paint the actor that the effect is attached to directly, without going through clutter_actor_paint, which does some additional work which conflicts with the effects.

self :

a CtkEffect

func :

a CtkEffectPaintFunc

is_last_effect :


ctk_effect_set_actor ()

void                ctk_effect_set_actor                (CtkEffect *self,
                                                         ClutterActor *actor);

This is a conveniece function for CtkActor. If you want to bind an effect to an actor, you should call ctk_actor_add_effect instead.

self :

a CtkEffect

actor :

a CtkActor, or NULL. [allow-none]

ctk_effect_get_actor ()

ClutterActor *      ctk_effect_get_actor                (CtkEffect *self);

self :

a CtkEffect

Returns :

the ClutterActor that this effect is bound to, or NULL

ctk_effect_animate ()

ClutterAnimation *  ctk_effect_animate                  (CtkEffect *self,
                                                         gulong mode,
                                                         guint duration,
                                                         const gchar *first_property_name,
                                                         ...);

Animates the give list of properties of self between the current value for each property and a new final value. The animation has a definite duration and a speed given by the mode. See clutter_actor_animate for more details on signal connection.

self :

a CtkEffect

mode :

an animation mode logical id

duration :

duration of the animation, in milliseconds

first_property_name :

the name of a property

... :

a NULL terminated list of property name and property values

Returns :

a ClutterAnimation object. The object is owned by the CtkEffect and should not be unrefferenced with g_object_unref(). [transfer none]

ctk_effect_set_margin ()

void                ctk_effect_set_margin               (CtkEffect *self,
                                                         gint m);

self :

m :


ctk_effect_get_margin ()

gint                ctk_effect_get_margin               (CtkEffect *self);

self :

Returns :


ctk_effect_set_opacity ()

void                ctk_effect_set_opacity              (CtkEffect *self,
                                                         gfloat m);

The opacity of the effect.

self :

a CtkEffect

m :


ctk_effect_get_opacity ()

gfloat              ctk_effect_get_opacity              (CtkEffect *self);

self :

a CtkEffect

Returns :

The opacity.

ctk_effect_set_strength ()

void                ctk_effect_set_strength             (CtkEffect *self,
                                                         gint strength);

The strength of the effect. This value is used as an indicator for some effects, in order to increase the strength of the effect.

self :

a CtkEffect

strength :


ctk_effect_get_strength ()

gint                ctk_effect_get_strength             (CtkEffect *self);

self :

a CtkEffect

Returns :

The strength of the effect.

ctk_effect_set_invalidate_effect_cache ()

void                ctk_effect_set_invalidate_effect_cache
                                                        (CtkEffect *self,
                                                         gboolean dirty);

Invalidate an effect cache. Cause the effect to be recached next time it is being rendered.

self :

a CtkEffect

dirty :


ctk_effect_is_effect_cache_dirty ()

gboolean            ctk_effect_is_effect_cache_dirty    (CtkEffect *self);

self :

a CtkEffect

Returns :

True if the effect cache is dirty. This function is called in the paint cycle of the actor.

ctk_effect_get_animation ()

ClutterAnimation *  ctk_effect_get_animation            (CtkEffect *self);

self :

a CtkEffect

Returns :

a ClutterAnimation for the effect, if ctk_effect_animate has been called on self.

Property Details

The "actor" property

  "actor"                    gpointer              : Read / Write

The ClutterActor this effect is bound to.


The "margin" property

  "margin"                   gint                  : Read / Write

Effect Margin Area.

Allowed values: [0,100]

Default value: 0


The "opacity" property

  "opacity"                  gfloat                : Read / Write

Effect Opacity.

Allowed values: [0,1]

Default value: 1


The "strength" property

  "strength"                 gint                  : Read / Write

Strength of the blur in the effect.

Allowed values: [0,100]

Default value: 5