1
0
Fork 0
Commit graph

123 commits

Author SHA1 Message Date
Emanuele Aina
61f2d751d0 tap-action: Add TapAction, to handle mouse/touch tapping
TapAction is a GestureAction-subclass that handles clicks and
tap gestures. It is meant to provide a replacement for ClickAction
using GestureAction:

• it handles events trasparently without capturing them, so that it
  can coexists with other GestureActions;

• the ::tap signal is not emitted if the drag threshold is exceeded;

• building upon GestureAction the amount of code is greatly reduced.

TapAction provides:

• tap signal, notifying users when a tap has been performed.

The image-content example program has been updated replacing its
ClickAction usage with TapAction.

https://bugzilla.gnome.org/show_bug.cgi?id=683948
2012-10-19 13:41:31 +02:00
Emanuele Aina
9ca06d2895 pan-action: add PanAction, to handle panning in scrollable actors
PanAction is a GestureAction-subclass that implements the panning
concept for scrollable actors, with the ability to emit interpolated
signals to emulate the kinetic inertia of the panning. PanAction provides:

• pan signal, notifying users of the panning gesture status;

• pan-stopped signal, emitted at the end of the interpolated phase
  of the panning gesture, if enabled;

• pan-axis property, to allow constraining the dragging to a specific
  axis;

• interpolated property, to enable or disable the inertial behaviour;

• deceleration property, to customize the rate at which the momentum
  of the panning will be slowed down;

• acceleration-factor property, applied to the inertial momentum when
  starting the interpolated sequence.

An interactive test is also provided.

https://bugzilla.gnome.org/show_bug.cgi?id=681648
2012-08-28 10:11:16 -03:00
Lionel Landwerlin
84325057af Add zoom action
https://bugzilla.gnome.org/show_bug.cgi?id=678427
2012-08-20 18:28:22 +01:00
Lionel Landwerlin
e2264c0484 Add rotate action
Allow rotation of an actor using 2 points (touch or pointers) events.

Also refactor the accumulators from various actions.

https://bugzilla.gnome.org/show_bug.cgi?id=678587
2012-07-17 16:52:41 +01:00
Bastian Winkler
1eb869ec8f Add ClutterGridLayout
ClutterGridLayout is port of GtkGrid to a Clutter layout manager. All
the logic is taken from gtkgrid.c, so all the credits should go to
Matthias Clasen for writing this nice piece of code.

ClutterGridLayout supports adding children with it's own methods
GridLayout.attach() and GridLayout.attach_next_to() as well as
Actor.add_child() and friends. The latter adds children in a similar
fashion to ClutterBoxLayout

https://bugzilla.gnome.org/show_bug.cgi?id=677372
2012-06-05 12:28:25 +02:00
Emmanuele Bassi
bca93c1a75 Deprecate ClutterAlpha
It's time. Now that we have clutter_actor_allocate() respecting the
easing state of an actor, and that the LayoutManager animation virtual
functions have been deprecated, we can put ClutterAlpha on the chopping
block, and be done with it, once and for all.

So long, ClutterAlpha; and thanks for all the fish.
2012-04-27 12:30:50 +01:00
Emmanuele Bassi
999bbe20a5 Add ClutterScrollActor
ClutterScrollActor is an actor that allows showing a portion of its
contents.
2012-04-27 12:30:50 +01:00
Emmanuele Bassi
b4f12cfb83 Deprecate ClutterAnimation, as well as clutter_actor_animate()
ClutterPropertyTransition, and the implicit animation API based on
ClutterTransition and ClutterAnimatable, are enough to replace this
whole API.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
63e909576a Deprecate State and Animator
The PropertyTransition, KeyframeTransition, and TransitionGroup classes
can effectively replace Animator and State in their common usage.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
c500fc1844 Add ClutterTransitionGroup
The TransitionGroup class is a logical container for running multiple
transitions.

TransitionGroup is not a Score: it is a Transition that advances each
Transition it contains using the delta between frames, and ensures that
all transitions are in a consistent state; these transitions are not
advanced by the master clock.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
270894342e Add ClutterKeyframeTransition
A simple transition class that interpolates a property between key
frames.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
e2564dd265 Deprecate ClutterCairoTexture
The ClutterCanvas content implementation should be used instead, to
avoid stringing along the ClutterTexture API and implementation.

This change requires some minor surgery, as the deprecated section
already contains an header for the previously deprecated methods; plus,
we don't want to deprecate clutter_cairo_set_source_color(). This means
creating a new header to be used for Cairo-related API.
2012-04-27 12:28:49 +01:00
Emmanuele Bassi
2a1dcf4008 Deprecate ClutterMedia
The interface looked like a good idea around the time Clutter 0.2 was
out, but in reality we never had a proper, and supported implementation
outside of clutter-gst - thus, ClutterMedia was acting like a wrapper
around GStreamer, leading to hilarious issues of impedence mismatch
between API and all sorts of indirection issues typical of wrong
abstractions.

In theory, ClutterMedia should have been deprecated and removed before
we hit 1.0, but we kept flip-flopping on the issue.

For 2.0, it's time to take it out.

And shoot it in the face.
2012-04-17 18:10:39 +01:00
Emmanuele Bassi
cadae5b325 Add ClutterImage, and image data content 2012-03-16 12:33:37 +00:00
Emmanuele Bassi
07bb35bbe3 Add ClutterCanvas, a drawing content 2012-03-16 12:33:37 +00:00
Emmanuele Bassi
be4746b15f Add ClutterContent
ClutterContent is an interface for creating delegate objects that handle
what an actor is going to paint.

Since they are a newly added type, they only hook into the new PaintNode
based API.

The position and size of the content is controlled in part by the
content's own preferred size, and by the ClutterContentGravity
enumeration.
2012-03-16 12:33:36 +00:00
Emmanuele Bassi
b83dc6abfa Add PaintNode, an element on the render object tree
Now that we have a proper scene graph API, we should split out the
rendering part from the logical and event handling part.

ClutterPaintNode is a lightweight fundamental type that encodes only the
paint operations: pipeline state and geometry. At its most simple, is a
way to structure setting up the programmable pipeline using a
CoglPipeline, and submitting Cogl primitives. The important take away
from this API is that you are not allowed to call Cogl API like
cogl_set_source() or cogl_primitive_draw() directly.

The interesting approach to this is that, in the future, we should be
able to move to a purely retained mode: we will decide which actors need
to be painted, they will update their own branch of the render graph,
and we'll take the render graph and build all the rendering commands
from that.

For the 1.x API, we will have to maintain invariants and the existing
behaviour, but as soon as we can break API, the old paint signal will
just go away, and Actors will only be allowed to manipulate the render
tree.
2012-03-16 12:33:35 +00:00
Emmanuele Bassi
40bcbf9c0d Add ClutterPropertyTransition
ClutterPropertyTransition is a ClutterTransition that animates a
property of a ClutterAnimatable implementation.
2012-03-15 17:01:12 +00:00
Emmanuele Bassi
0c8443f71a Add ClutterTransition
ClutterTransition is a Timeline sub-class that allows interpolation of a
value between the initial and final states held by a ClutterInterval.
2012-03-15 17:01:12 +00:00
Joseph Scheuhammer
32f57595fe Add brightness/contrast effect
The ClutterBrightnessContrastEffect effect class allows changing the
brightness and contrast levels of an actor.

Modified-by: Emmanuele Bassi <ebassi@linux.intel.com>
Modified-by: Neil Roberts <neil@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=656156
2012-03-07 14:02:55 +00:00
Emmanuele Bassi
b248fbd010 Make clutter-stage-window.h a private header
It should have never been public in the first place; nothing can
implement the ClutterStageWindow interface and use it, so this is
not a break.
2012-03-01 15:07:44 +00:00
Emmanuele Bassi
0ee7170dbb Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00
Emmanuele Bassi
a6b1972d71 Move macros to their own headers 2012-02-27 14:03:57 +00:00
Emmanuele Bassi
6d268fe5ca Deprecate ClutterRectangle
A ClutterActor with a background color set covers 99% of the use cases
for a Rectangle.
2012-01-16 23:35:17 +00:00
Emmanuele Bassi
b4d269705e Deprecate ClutterBox
ClutterBox functionality has been implemented by ClutterActor, and
proxied by the Box subclass; with the removal of the abstract bit on
ClutterActor, we can safely deprecated ClutterBox.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
2403d4875b Remove CLUTTER_DISABLE_DEPRECATED guard
Except for macros, we now entirely depend on the deprecation warnings
instead of a guard.
2011-11-03 15:32:04 +00:00
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
Emmanuele Bassi
62d72b8690 Move ClutterBehaviour to the deprecated section 2011-10-11 17:58:40 +01:00
Emmanuele Bassi
bcd7845d91 Move ClutterBehaviour subclasses to the deprecated section
Moving ClutterBehaviour itself will require some minor header surgery,
so we'll do that next.
2011-10-11 17:58:40 +01:00
Emmanuele Bassi
e57f8c26f6 Move ClutterShader to the deprecated section 2011-10-11 17:58:40 +01:00
Emmanuele Bassi
4b33a9c5f4 Move ClutterScore to the deprecated section 2011-10-11 17:58:39 +01:00
Emmanuele Bassi
4b748f4334 Move timeout pool to the deprecated section 2011-10-11 17:58:39 +01:00
Emmanuele Bassi
50cda9fed1 build: Move deprecated code into its own prefix
The code that has been deprecated should live into its own directory,
both in the repository and when installed. This should make it clear
which functionality is actually maintained and which is not.

We start with an oldie: the frame source API.
2011-10-11 17:58:35 +01:00
Emmanuele Bassi
1238e0ddf9 Add ClutterDropAction
ClutterDropAction is an Action sub-class that allows writing actors that
react to dragged actors being dropped on them.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 15:25:53 +01:00
Tomeu Vizoso
ba72235b66 Add ClutterSwipeAction and ClutterGestureAction
To allow actors to handle gestures in a more organized way.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
2011-06-10 14:02:17 +01:00
Emmanuele Bassi
94b905b9e1 build: Generate an instealled config header
Clutter has some platform-specific API that is accessible only if the
right backend has been compiled in. Third party applications that wish
to be portable across backends might want to use defines and other
pre-processor tricks to determine header inclusion and API usage.

While Clutter has an internal set of symbols it can use, third party
applications don't have the luxury of being able to access the config.h
generated by Clutter's configure script.

For this reason, Clutter should install a configuration header with a
series of namespaced defines that can be picked up by applications and
other third party code.
2011-01-19 14:33:27 +00:00
Emmanuele Bassi
3c15c0c9bb Add SnapConstraint
A SnapConstraint is a constraint that "snaps" the edges of two actors
together.
2010-11-15 16:00:49 +00:00
Emmanuele Bassi
985518c601 color: Add named, global colors
Since EGA colors are apparently all the rage in other toolkits, Clutter
should not be left out. On top of the usual CGA/EGA palette the static
colors also include the Tango Icon palette, which at least is more
pleasant to the eye.

Static colors are accessed through an enumeration by using
clutter_color_get_static(), or using the short-hand pre-processor
macros.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2066
2010-11-11 13:14:23 +00:00
Emmanuele Bassi
6b2cbb9908 Add ClutterPathConstraint
ClutterPathConstraint is a simple Constraint implementation that
modifies the allocation of the Actor to which is has been applied using
a progress value and a ClutterPath.
2010-10-25 15:46:04 +01:00
José Dapena Paz
d14e294d86 Add ClutterTableLayout, a layout showing children in rows and columns
A TableLayout is a layout manager that allocates its children in rows
and columns. Each child is assigned to a cell (or more if a cell span
is set).

The supported child properties are:

  • x-expand and y-expand: if this cell with try to allocate the
    available extra space for the table.
  • x-fill and y-fill: if the child will get all the space available in
    the cell.
  • x-align and y-align: if the child does not fill the cell, then
    where the child will be aligned inside the cell.
  • row-span and col-span: number of cells the child will allocate for
    itself.

Also, the TableLayout has row-spacing and col-spacing for specifying
the space in pixels between rows and between columns.

We also include a simple test of the layout manager, and the
documentation updates.

The TableLayout was implemented starting from MxTable and
ClutterBoxLayout.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2038

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-08-10 23:20:06 +01:00
Emmanuele Bassi
437dcad86a settings: Migrate Backend settings to a new object
Instead of storing settings inside the Backend instance we should use a
separate public object.
2010-06-21 15:55:36 +01:00
Emmanuele Bassi
44f300b3a2 effect: Add PageTurnEffect
A simple deformation effect that simulates a page curl.

Ported from MxDeformPageTurn inside the Mx toolkit, written by
Chris Lord.
2010-06-10 18:40:29 +01:00
Emmanuele Bassi
c2081a076c effect: Add DeformEffect
DeformEffect is an abstract class that should be used to write effects
that change the geometry of an actor before submitting it to the GPU.

Just like the ShaderEffect class, DeformEffect renders the actor to
which it has been applied into an FBO; then it creates a mesh and stores
it inside a VBO. Sub-classes can control vertex attributes like
position, texel coordinates and the color.
2010-06-10 18:40:29 +01:00
Emmanuele Bassi
b4f8ba0f73 effect: Add ColorizeEffect
A copy of DesaturateEffect that converts to grayscale and applies a
user-defined tint to the render target.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
73a773d37a effect: Add DesaturateEffect
A simple shader-based effect that desaturates an actor and its contents
based on a controllable factor.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
5a5b21446c effect: Add BlurEffect
A simple, GLSL shader-based blur effect.

The blur shader is taken straight from the test-shader.c interactive
test case. It's a fairly clunky, inefficient and visually incorrect
implementation of a box blur, but it's all we have right now until I
figure out a way to do multi-pass shading with the current API.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
c260da79e3 effect: Add ShaderEffect
The ShaderEffect class is an abstract base type for shader-based
effects. GLSL-based effects should be implemented by sub-classing
ShaderEffect and overriding ActorMeta::set_actor() to set the source
code of the shader, and Effect::pre_paint() to update the uniform
values, if any.

The ShaderEffect has a generic API for sub-classes to set the values
of the uniforms defined by their shaders, and it uses the shader
types we defined for ClutterShader, to avoid re-inventing the wheel
every time.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
c3ab32ae68 effect: Add OffscreenEffect
The OffscreenEffect class is meant to be used to implement Effect
sub-classes that create an offscreen framebuffer and redirect the
actor's paint sequence there. The OffscreenEffect is useful for
effects using fragment shaders.

Any shader-based effect being applied to an actor through an offscreen
buffer should be used before painting the resulting target material and
not for every actor. This means that doing:

       pre_paint: cogl_program_use(program)
                  set up offscreen buffer
           paint: [ actors ] → offscreen buffer → target material
      post_paint: paint target material
                  cogl_program_use(null)

Is not correct. Unfortunately, we cannot really do:

      post_paint: cogl_program_use(program)
                  paint target material
                  cogl_program_use(null)

Because the OffscreenEffect::post_paint() implementation also pops the
offscreen buffer and re-instates the previous framebuffer:

      post_paint: cogl_program_use(program)
                  change frame buffer ← ouch!
                  paint target material
                  cogl_program_use(null)

One way to fix it is to allow using the shader right before painting
the target material - which means adding a new virtual inside the
OffscreenEffect class vtable in additions to the ones defined by the
parent Effect class.

The newly-added paint_target() virtual allows the correct sequence of
actions by adding an entry point for sub-classes to wrap the "paint
target material" operation with custom code, in order to implement the
case above correctly as:

      post_paint: change frame buffer
                  cogl_program_use(program)
                  paint target material
                  cogl_program_use(null)

The added upside is that sub-classes of OffscreenEffect involving
shaders really just need to override the prepare() and paint_target()
virtuals, since the pre_paint() and post_paint() do all that's needed.
2010-06-03 14:10:55 +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
f6fce05ee9 action: Add ClickAction
ClickAction adds "clickable" semantics to an actor. It provides all
the business logic to emit a high-level "clicked" signal from the
various low-level signals inside ClutterActor.
2010-05-25 11:13:03 +01:00