Commit Graph

32 Commits

Author SHA1 Message Date
Emmanuele Bassi
d28e04be72 Move all enumerations to a separate file
This should allow sharing types, and we can avoid glib-mkenums thrawling
the whole repository for enumerations.
2011-10-11 17:59:46 +01:00
Adel Gadllah
bed2d9e787 ClutterActor: Add clutter_actor_has_effects
Adds an efficent way to query whether an actor has any
applied effects.

https://bugzilla.gnome.org/show_bug.cgi?id=660471
2011-09-29 19:34:24 +02:00
Emmanuele Bassi
e4756fd764 docs: Fix up the API reference 2011-06-20 14:26:57 +01:00
Emmanuele Bassi
74a9b71060 effect: Rename RunFlags to PaintFlags
Since run() was replaced and both paint() and pick() use the
enumeration.

https://bugzilla.gnome.org/show_bug.cgi?id=651700
2011-06-13 16:00:45 +01:00
Tomeu Vizoso
0ede622f51 Give a chance to effects for running when picking
Some effects can change the actor's shape and position, so they need
to run when picking.

https://bugzilla.gnome.org/show_bug.cgi?id=651700
2011-06-13 15:45:36 +01:00
Tomeu Vizoso
700c543850 Rename ClutterEffect::run to ClutterEffect::paint
In preparation for adding ClutterEffect::pick

https://bugzilla.gnome.org/show_bug.cgi?id=651700
2011-06-13 15:44:58 +01:00
Neil Roberts
00b733a85a clutter-effect: Add clutter_effect_queue_rerun
This adds a new public function to queue a rerun of an effect. If
nothing else queues a redraw then when the effect's actor is painted
the effect will be run without the CLUTTER_EFFECT_RUN_ACTOR_DIRTY
flag. This allows parametrised offscreen effects to report that they
need to redraw the image without having to redraw the underlying
actor. This will be used to implement the 'transparency' effect of
ClutterActor.

If multiple redraws are queued with different effects then redrawing
is started from the one that occurs last in the list of effects.

Internally the function is a wrapper around the new function
_clutter_actor_queue_redraw_full. This is intended to be the sole
point of code for queuing redraws on an actor. It has parameters for
the clip and the effect. The other two existing functions to queue a
redraw (one with a clip and one without) now wrap around this function
by passing a NULL effect.
2011-05-13 01:46:32 +01:00
Neil Roberts
c3aa4d24bf clutter-effect: Add a 'run' virtual
This adds a new virtual to ClutterEffect which is intended to be a
more flexible replacement for the pre and post_paint functions. The
implementation of a run virtual would look something like this:

void
effect_run (ClutterEffect *effect,
            ClutterEffectRunFlags flags)
{
  /* Set up state */
  /* ... */

  /* Chain to the next item in the paint sequence */
  clutter_actor_continue_paint (priv->actor);

  /* Clean up state */
  /* ... */
}

ClutterActor now just calls this virtual instead of the pre_paint and
post_paint functions. It keeps track of the next effect in the list so
that it knows what to do when clutter_actor_continue_paint is
called. clutter_actor_continue_paint is a new function added just for
implementing effects.

The default implementation of the run virtual just calls pre_paint and
post_paint so that existing effects will continue to work.

An effect is allowed to conditionally skip calling
clutter_actor_continue_paint(). This is useful to implement effects
that cache the image of an actor. The flags parameter can be used to
determine if the actor is dirty since the last paint. ClutterActor
sets this flag whenever propagated_one_redraw is TRUE which means that
a redraw for this actor or one of its children was queued.
2011-05-13 01:46:31 +01:00
Emmanuele Bassi
694632ce95 build: Re-arrange headers
Try to minimize the included headers, especially in clutter-actor.h.
2010-11-18 18:23:49 +00:00
Emmanuele Bassi
d3b6dd5ec7 effect: Fix up the class ABI
Landing the paint-box branch accidentally added two slots to the
ClutterEffectClass vtable, plus the get_paint_volume() function
pointer. This is an ABI break from 1.4.
2010-10-04 11:30:32 +01:00
Robert Bragg
3540d222e1 paint volumes: another pass at the design
This is a fairly extensive second pass at exposing paint volumes for
actors.

The API has changed to allow clutter_actor_get_paint_volume to fail
since there are times - such as when an actor isn't a descendent of the
stage - when the volume can't be determined. Another example is when
something has connected to the "paint" signal of the actor and we simply
have no way of knowing what might be drawn in that handler.

The API has also be changed to return a const ClutterPaintVolume pointer
(transfer none) so we can avoid having to dynamically allocate the
volumes in the most common/performance critical code paths. Profiling was
showing the slice allocation of volumes taking about 1% of an apps time,
for some fairly basic tests. Most volumes can now simply be allocated on
the stack; for clutter_actor_get_paint_volume we return a pointer to
&priv->paint_volume and if we need a more dynamic allocation there is
now a _clutter_stage_paint_volume_stack_allocate() mechanism which lets
us allocate data which expires at the start of the next frame.

The API has been extended to make it easier to implement
get_paint_volume for containers by using
clutter_actor_get_transformed_paint_volume and
clutter_paint_volume_union. The first allows you to query the paint
volume of a child but transformed into parent actor coordinates. The
second lets you combine volumes together so you can union all the
volumes for a container's children and report that as the container's
own volume.

The representation of paint volumes has been updated to consider that
2D actors are the most common.

The effect apis, clutter-texture and clutter-group have been update
accordingly.
2010-09-29 15:12:57 +01:00
Emmanuele Bassi
25abdf09b7 effect: Allow any effect to override the paint volume
An Effect implementation might override the paint volume of the actor to
which it is applied to. The get_paint_volume() virtual function should
be added to the Effect class vtable so that any effect can get the
current paint volume and update it.

The clutter_actor_get_paint_volume() function becomes context aware, and
does the right thing if called from within a ClutterEffect pre_paint()
or post_paint() implementation, by allowing all effects in the chain up
to the caller to modify the paint volume.
2010-09-29 15:12:56 +01:00
Emmanuele Bassi
23084b9768 docs: Effects fixes for the API reference 2010-06-03 14:34:41 +01:00
Emmanuele Bassi
a86f1b45bb Add the ClutterEffect abstract class
ClutterEffect is an abstract class that should be used to apply effects
on generic actors.

The ClutterEffect class just defines what an effect should implement; it
could be defined as an interface, but we might want to add some default
behavior dependent on the internal state at a later point.

The effect API applies to any actor, so we need to provide a way to
assign an effect to an actor, and let ClutterActor call the Effect
methods during the paint sequence.

Once an effect is attached to an actor we will perform the paint in this
order:

  • Effect::pre_paint()
  • Actor::paint signal emission
  • Effect::post_paint()

Since an effect might collide with the Shader class, we either allow a
shader or an effect for the time being.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
41386a5f72 Remove the Effects API
The Effects API and all related symbols have been superceded by
the newly added Animation API and clutter_actor_animate().

This commit removes the Effects implementation, the documentation
and the interactive test/example code.
2009-01-14 16:56:21 +00:00
Emmanuele Bassi
a32eca26b6 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1212 - Allow only a single include file for Clutter

	* clutter/*.h: Only allow including clutter.h in third
	party code.

	* clutter/cogl/cogl-color.h:
	* clutter/cogl/cogl-fixed.h:
	* clutter/cogl/cogl.h.in: Only allow including cogl.h in
	third party code.

	* clutter/cogl/common/Makefile.am:
	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gles/Makefile.am:
	* clutter/eglnative/Makefile.am:
	* clutter/eglx/Makefile.am:
	* clutter/fruity/Makefile.am:
	* clutter/glx/Makefile.am:
	* clutter/glx/clutter-glx.h:
	* clutter/osx/Makefile.am:
	* clutter/pango/Makefile.am:
	* clutter/sdl/Makefile.am:
	* clutter/win32/Makefile.am:
	* clutter/x11/Makefile.am: Fix build environment.

	* clutter/x11/clutter-x11-texture-pixmap.h:
	* clutter/x11/clutter-x11.h: Fix inclusion rules.

	* tests/test-pixmap.c: Fix inclusion of GdkPixbuf header.

	* README: Update release notes.
2008-10-30 17:04:34 +00:00
Tomas Frydrych
4a1e765e19 2007-01-30 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
	Added new clutter_actor_move_anchor_point_ API.

        * clutter/clutter-behaviour-scale.c:
        * clutter/clutter-behaviour-scale.h:
        * clutter/clutter-effect.c:
        * clutter/clutter-effect.h:
        * tests/test-actors.c:
        * tests/test-effects.c:
        * tests/test-scale.c:
	Removed gravity from ClutterBehaviourScale.
2008-01-30 12:13:26 +00:00
Emmanuele Bassi
fe2379a810 2008-01-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Add new ClutterBehaviourScale setters.

	* clutter/clutter-behaviour-scale.[ch]: Split the scaling factors
	on both axis. Add setters for all the behaviour properties.

	* clutter/clutter-effect.h:
	* clutter/clutter-effect.c (clutter_effect_scale): Split the
	final scale factor to match the ClutterBehaviourScale changes. (#709)
	
	* tests/test-actors.c:
	* tests/test-effects.c:
	* tests/test-rotate.c:
	* tests/test-scale.c: Update after API change.
2008-01-17 14:31:14 +00:00
Emmanuele Bassi
04afb1066c 2007-11-28 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-effect.[ch]: Add clutter_effect_template_construct()
	function, for language bindings that need to set the alpha function
	but cannot call the clutter_effect_template_new() ctor themselves.
2007-11-28 10:27:33 +00:00
Emmanuele Bassi
2b447c3b48 2007-11-23 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-effect.[ch]: Update the effects API to remove
	the start value for most of them.

	(clutter_effect_move): Make it a simple "move from current
	position to new coordinates" effect.

	(clutter_effect_path): Rename from clutter_effect_move().

	(clutter_effect_rotate): Sync up with the new actor rotation API.

	* tests/test-effects.c: Regression test for the effects.

	* tests/Makefile.am: Build glue for test-effects

	* tests/test-behave.c: Emulate a full ramp by using a looping
	timeline changing its direction when reaching the last frame.
2007-11-23 11:23:19 +00:00
Emmanuele Bassi
768d85dcea 2007-11-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-effect.h:
	* clutter/clutter-effect.c:
	(clutter_effect_template_new_for_duration): Add a simple constructor
	for implicitly creating a ClutterTimeline with a given duration.
2007-11-15 15:38:04 +00:00
Øyvind Kolås
0dee5eaac3 Renamed all properties of behaviours (and related
functions/variables/parameters)
to match the pattern something-start, something-end. Fixes bug #577.
* clutter/clutter-behaviour-depth.c:
* clutter/clutter-behaviour-depth.h:
* clutter/clutter-behaviour-ellipse.c:
* clutter/clutter-behaviour-ellipse.h:
* clutter/clutter-behaviour-path.c: 
* clutter/clutter-behaviour-rotate.c:
* clutter/clutter-behaviour-rotate.h:
* clutter/clutter-behaviour-scale.c:
* clutter/clutter-behaviour-scale.h:
* clutter/clutter-effect.c: 
* clutter/clutter-effect.h:
* clutter/clutter-script.c:
* tests/test-depth.c: 
* tests/test-script.c:
2007-11-13 13:21:56 +00:00
Matthew Allum
1ceaf04ac7 2007-08-24 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-event.h:
        * clutter/clutter-main.c:
        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        * clutter/glx/clutter-backend-glx.c:
        * clutter/glx/clutter-backend-glx.h:
        * clutter/glx/clutter-event-glx.c:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/glx/clutter-stage-glx.h:
        Add initial support for stage state events.
        Fix fullscreening for an already mapped stage.

        * tests/test-events.c:
        Print out info from the above. Blue button now toggles
        fullscreen.

        * clutter/clutter-effect.c:
        * clutter/clutter-effect.h:
        Add a setting for templates to ref or clone underlying
        timelines. (As to improve sync issues like those in foofone)

        * tests/test-timeline.c:
        Also add completed signals.

        * clutter/cogl/gles/cogl.c: (cogl_texture_image_2d):
        * configure.ac:
        Forward port from stable branch. RGB Image fixes gles
        and check for lower case libgles_cm.
2007-08-24 15:12:52 +00:00
Emmanuele Bassi
294ec333b7 Add clutter_effect_depth(), simple wrapper around the depth behaviour
This patch adds a new effect function, wrapping ClutterBehaviourDepth into
clutter_effect_depth().
2007-08-15 19:50:16 +00:00
Emmanuele Bassi
f57edd70d3 Even more documentation fixes 2007-08-07 14:03:58 +00:00
Matthew Allum
c27b00d7ef 2007-07-25 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-behaviour-rotate.c:
        * clutter/clutter-behaviour-rotate.h:
        Split 'center' prop into 3 seperate props for each axis.
        Use clutter_behaviour_actors_foreach() rather than
        clutter_behaviour_get_actors() to avoid copying list.
        Call fixed point rotation funcs internally.

        * clutter/clutter-effect.c:
        * clutter/clutter-effect.h:
        Add new simple rotation based effect funcs.
2007-07-25 12:17:44 +00:00
Emmanuele Bassi
8725ad7e60 2007-07-24 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-effect.h:
	* clutter/clutter-effect.c: Add a secondary constructor for
	ClutterEffectTemplate, for use of the bindings.
2007-07-24 16:18:52 +00:00
Emmanuele Bassi
d7caae7f6a 2007-07-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/*: Loads of fixes for the API reference.
2007-07-04 14:00:41 +00:00
Emmanuele Bassi
255edd4e26 Clean up ClutterEffect
Make ClutterEffectTemplate use a pointer to the private data to avoid
a type check each time it dereferences the ClutterEffectTemplatePrivate
structure pointer.

Clean up the header file for parsing purposes.

Add a description for the gtk-doc reference.
2007-07-01 10:29:34 +00:00
Neil J. Patel
ac530eed12 Added a function to deal with ClutterKeyEvents. Handles the majority
of entry-related keyboard keys. However modifiers still need to be
        implemented.
2007-06-01 11:34:40 +00:00
Matthew Allum
8310a87bfc 2007-05-31 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-behaviour-ellipse.c:
        Remove uneeded knot signal

        * clutter/clutter-behaviour-path.c:
        Fix so knot signal is emitted only when a knot is reached.

        * clutter/clutter-effect.c:
        * clutter/clutter-effect.h:
        Add a scale effect.

        * configure.ac:
        * doc/manual/Makefile.am:
        * doc/manual/clutter-manual.xml.in:
        * doc/manual/manual.xsl:
        * doc/manual/style.css:
        Add various bits for application developers manual.
2007-05-30 23:16:58 +00:00
Matthew Allum
23ac88ac70 2007-05-14 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-behaviour-path.c:
        Fix bug where last knot position wouldn't get reached.

        * clutter/clutter-group.c:
        Add some docs

        * clutter/clutter-timeline.h:
        * clutter/clutter-timeline.c:
        Add clutter_timeline_copy (needed for ClutterEffect)

        * clutter/clutter-version.h.in:
        Export windowing system / GL backend etc defines.

        * clutter/Makefile.am:
        * clutter/clutter-effect.c:
        * clutter/clutter-effect.h:
        * clutter/clutter.h:

        * clutter/glx/clutter-backend-glx.c:
        Minor clean ups.

        * clutter/clutter-alpha.h:
        Add a fixme.

        * configure.ac:
        Add FPU define.

        * examples/Makefile.am:
        * examples/slider.c:
        Add Robs slider game.
2007-05-14 09:11:23 +00:00