Commit Graph

95 Commits

Author SHA1 Message Date
Emmanuele Bassi
02b69e4d76 Move header inclusion guard at the top
GCC has some optimization for the inclusion guard, but they only work if
the check is the outermost one.

We're fairly inconsistent because of historical reasons, so we should
ensure that we follow the same pattern in every public header.
2015-07-07 16:03:32 +01:00
Emmanuele Bassi
4f5dd5ad43 docs: Remove last stray DocBook tags 2014-03-18 14:15:01 +00:00
Emmanuele Bassi
12370bd4f8 docs: Move to markdown
We're removing docbook tags in favour of the markdown syntax.
2014-03-17 23:07:58 +00:00
Emmanuele Bassi
c69bb976b3 Annotate all public symbols
We are going to switch to compiler annotations to determine the
visibility of the symbols.
2014-03-17 18:53:27 +00:00
Emmanuele Bassi
8c32637eea Deprecate ClutterGeometry
It's a bad rectangle type, with caveats and gotchas. We have better
types, courtesy of Cairo, as well as our own (ClutterRect).

https://bugzilla.gnome.org/show_bug.cgi?id=682789
2013-04-04 11:53:39 +01:00
Emmanuele Bassi
22ce4409b3 Add interpolation for matrices
Interpolating between two transformations expressed using a 3D matrix
can be achieved by decomposing the matrices into their transformations
and do a simple numeric interpolation between the initial and final
states, like we do for other data types.

Luckily for us, the CSS Transforms specification from the W3C provides
the decomposition algorithm, using the "unmatrix" code taken from the
book "Graphics Gems II, edited by Jim Arvo".

Once the matrices have been decomposed, we can simply interpolate the
transformations, and re-apply them onto the result matrix, using the
facilities that Clutter provides for interpolating between two known
GTypes.
2012-09-03 20:54:43 +01:00
Emmanuele Bassi
f7dd2d3746 matrix: Fix the init_with_matrix() implementation
As usual, I swapped the memcpy() arguments around.
2012-08-19 17:23:26 +01:00
Emmanuele Bassi
f576084277 docs: Warn users of ClutterGeometry
The Geometry type is an *awful* representation of a integer rectangle,
as it uses unsigned integers for its size, leading to overflow issues
when unioning and intersecting. We have better rectangle types in
Cairo and Clutter, these days.
2012-08-09 16:56:19 +01:00
Emmanuele Bassi
46211a65db types: Add INIT_ZERO macro for ActorBox
Last type that was missing this macro.
2012-08-09 16:55:41 +01:00
Emmanuele Bassi
25ba5374fe types: Add ClutterMatrix
A simple typedef to CoglMatrix, that we can use for GObject properties
and signal marshallers, without requiring Cogl to change.
2012-07-26 14:01:00 +01:00
Emmanuele Bassi
a101600c7d types: Add CLUTTER_VERTEX_INIT_ZERO
Similar to the macros for ClutterPoint, ClutterSize, and ClutterRect.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
8fe8b9c89e Move PathNode definitions into clutter-types.h
Near ClutterKnot, so that we can easily remove both when we branch off
for 2.0.
2012-06-23 08:23:11 +01:00
Lionel Landwerlin
927624d92c input-device: add APIs to grab sequences of touch events
https://bugzilla.gnome.org/show_bug.cgi?id=678279
2012-06-22 21:48:58 +01:00
Emmanuele Bassi
286e7e28e8 Remove duplicate typedefs
Redefining typedefs is allowed by C11 and by a GCC extension, but Clang
doesn't really like it.
2012-06-20 09:13:11 +01:00
Emmanuele Bassi
17539bca95 base-types: Add zero point and rect
A constant ClutterPoint for (0, 0) and a constant degenerate ClutterRect
can be useful as guards for pointers, freeing the NULL value to mean
"unset".
2012-06-10 17:54:22 +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
0b76ba332d Fixes for the API reference
Typos, missing symbols, and missing documentation.
2012-04-27 12:30:48 +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
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
764068a723 Add version annotation for newly added functions 2012-04-27 12:30:47 +01:00
Emmanuele Bassi
b2feb463bd Add a rect-contains-rect function
Similar to the contains-point one.
2012-04-27 12:30:47 +01:00
Emmanuele Bassi
d021cc7c02 Add a function to compute the distance between points 2012-04-27 12:30:47 +01:00
Emmanuele Bassi
bc914bb8a2 Move towards an alloc/init pair for base types
Instead of a single new() constructor that both allocates and
initializes, split the allocation and initialization into two separate
functions for types that are typically used on the stack, and rarely
allocated on the heap, like ClutterPoint and friends.

This is also applied retroactively to ClutterActorBox and ClutterVertex,
given that the same considerations on usage apply to them as well; we
can add a return value to clutter_actor_box_init() and
clutter_vertex_init() in an ABI-compatible way, so that
clutter_actor_box_new() and clutter_vertex_new() can be effectively
reimplemented as "init (alloc ())".
2012-04-27 12:30:47 +01:00
Emmanuele Bassi
61f17e345a Add base geometric types
Clutter should provide some more basic geometric types - Point, Size,
Rect - so that we can use them in properties and accessors.
2012-04-27 12:30:46 +01:00
Emmanuele Bassi
d77ca7f7b8 Move the progress function registration to clutter-types.h
Near the definition of ClutterProgressFunc.
2012-04-27 12:28:49 +01:00
Emmanuele Bassi
82bc728584 Add initializer utilities for ClutterVertex
Similar to what we did for ClutterActorBox.
2012-03-17 16:29:09 +00:00
Emmanuele Bassi
5e9d6f7257 Add some utility initializers to ClutterActorBox 2012-03-17 15:27:26 +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
e546d28771 types: Declare new Transition classes 2012-03-15 17:01:12 +00:00
Emmanuele Bassi
beb91d7676 interval: Add variadic arguments for initial/final setters
As a convenience for the C API.

Language bindings should already be using the GValue variants.

This commit also moves the custom progress functions out of the
clutter-interval.c, as they are meant to be generic interpolation
functions and not ClutterInterval-specific.
2012-03-15 17:01:12 +00:00
Emmanuele Bassi
fb9df4bef2 Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
Emmanuele Bassi
3c12b3575d Add deprecated header for ClutterAnimation 2012-02-27 15:38:11 +00:00
Emmanuele Bassi
a6b1972d71 Move macros to their own headers 2012-02-27 14:03:57 +00:00
Emmanuele Bassi
6a09bf5b52 paint-volume: Add a union method for boxes
Creating PaintVolume instances is not possible, and it's not recommended
anyway. It is, though, necessary to union paint volumes, especially with
2D boxes, in some cases.

Clutter should provide a simple convenience function that allows
unioning volumes to boxes in a moderately efficient way.

https://bugzilla.gnome.org/show_bug.cgi?id=670021
2012-02-27 11:24:08 +00:00
Emmanuele Bassi
bbb7da03ac Add a note on the paint volume origin
This should avoid trying to fix the origin of a paint volume set from
the allocation's origin, and thus breaking everything.

A PaintVolume for an actor is defined to be relative to the actor's
modelview unless specifically modified by internal functions; the origin
of an actor's allocation is, on the other hand, parent-relative.
2012-02-13 18:21:11 +00:00
Emmanuele Bassi
58ffcfb10e actor: Add ClutterActorIter
Iterating over children and ancestors of an actor is a relatively common
operation. Currently, you only have one option: start a for() loop, get
the first child of the actor, and advance to the next sibling for the
list of children; or start a for() loop and advance to the parent of the
actor.

These operations can be easily done through the ClutterActor API, but
they all require going through the public API, and performing multiple
type checks on the arguments.

Along with the DOM API, it would be nice to have an ancillary, utility
API that uses an iterator structure to hold the state, and can be
advanced in a loop.

https://bugzilla.gnome.org/show_bug.cgi?id=668669
2012-01-27 11:55:39 +00:00
Emmanuele Bassi
37d46649ce actor: Adjust the preferred size too
Don't adjust just the allocation: we need to adjust the preferred size
of the actor to account for the margin.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
bf27575187 actor: Maintain invariants in add_child/remove_child
We need to queue a relayout when removing a visible child from a visible
parent.

We also need to insert the child at the right position (depending on the
depth) so that newly added actors will be painted on top.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
a2a38ee797 actor: Add margin properties
The actor class should be able to hold the margin offsets like it does
for expand and alignment flags.

Instead of filling the private data structure with data, we should be
able to use an ancillary data structure, given that all this data is
optional and might never be set in the first place.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
11e876c86b actor: Add :layout-manager
Now that ClutterActor implements the Container contract we can actually
defer the size negotiation to a ClutterLayoutManager directly from the
default implementation of the Actor's virtual functions.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
f5fffb355b Move Perspective and Fog definitions to clutter-types.h
Since we reference the types from multiple files.
2012-01-03 13:50:06 +00:00
Emmanuele Bassi
f0a246cdc6 actor: Add queue_redraw_with_clip()
Add a public version of the clipped queue redraw, using a 2D clip. This
allows implementing actors with trackable 2D clipped regions, like the
ClutterX11TexturePixmap, outside of Clutter itself.

https://bugzilla.gnome.org/show_bug.cgi?id=660997
2011-12-12 17:29:58 +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
af7afc29a7 Add a Clutter-specific deprecation macro for symbols
Just like GLIB_DEPRECATED and GLIB_DEPRECATED_FOR, Clutter should have
its own wrappers for G_DEPRECATED and G_DEPRECATED_FOR, to allow opting
out of deprecation warnings.

Deprecation warnings are enabled by default, now, even when building
Clutter.
2011-10-11 23:03:09 +01:00
Emmanuele Bassi
809298b5a2 Move more typedefs into clutter-types.h 2011-10-11 17:59:50 +01: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
e268201221 Minor header surgery to ClutterBehaviour
This moves a couple of definitions to the common types header, and makes
sure that ClutterBehaviour subclasses include clutter-behaviour.h first,
so that their types can be fully expanded without necessarily have the
ClutterBehaviour header header included by their public headers. This is
the necessary prelude to have clutter-behaviour.[ch] moved to the
deprecated section.
2011-10-11 17:58:40 +01:00
Emmanuele Bassi
01080dc5f3 Deprecate clutter_[sg]et_font_flags()
We already have two mechanisms for controlling the font rendering
quality on a per-application basis:

  • ClutterSettings properties
  • clutter_backend_set_font_options()

The font flags were always a stop-gap solution, and one that tried to
simplify a fairly complex issue beyond the point of actually being
useful.

https://bugzilla.gnome.org/show_bug.cgi?id=660786
2011-10-11 17:19:42 +01:00