1
0
Fork 0
Commit graph

5303 commits

Author SHA1 Message Date
Emmanuele Bassi
d5738b6bd4 script: Add 'context' to the translatable definitions
This should cover all the possible options.
2012-03-17 22:55:33 +00:00
Emmanuele Bassi
05f78306d1 actor: Avoid popping the easing state stack once too many
If restore_easing_state() is called on the last easing state on the
stack, clean up the stack, so that we don't leave stale pointers
around to later segfault on.
2012-03-17 16:49:35 +00:00
Emmanuele Bassi
229241b875 actor: Remove the implicit easing state save
When setting the easing mode, duration, or delay without having ever
called clutter_actor_save_easing_state(). It's confusing, and not
really nice.

In the future, we'll have a default easing state implicitly created by
the actor itself, but for the time being explicitly opting in is
preferrable.
2012-03-17 16:46:38 +00:00
Emmanuele Bassi
b3b1994c13 Use G_VALUE_INIT instead of { 0, }
The macro avoids warnings from anal-retentive compilers.
2012-03-17 16:40:55 +00: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
63f3eaab62 actor: Fix set_scale_with_gravity()
Add a scale-gravity internal setter, and make set_scale_with_gravity()
call it, along with the scale factor.
2012-03-17 16:17:39 +00:00
Emmanuele Bassi
5e9d6f7257 Add some utility initializers to ClutterActorBox 2012-03-17 15:27:26 +00:00
Emmanuele Bassi
b6f5609b2f osx/stage: Synthesize an enter event on show
If the pointer is inside the window frame when it's shown then we need
to synthesize and emit a NSMouseEnterEvent ourselves, as Quartz won't
do it for us.

This is a bit of a blind commit - but it's taken from an equivalent
patch that has been verified to work in GDK.
2012-03-16 23:12:33 +00:00
Emmanuele Bassi
f7735ff1ad docs: Change the short description of ClutterActor
The Actor class is not abstract any more.
2012-03-16 18:10:34 +00:00
Emmanuele Bassi
e5e10b6a04 Annotate functionality added in 1.10 2012-03-16 17:30:26 +00:00
Emmanuele Bassi
1df14c1bac Debugging cleanups
Add some more debugging notes to the layout and paint node output.
2012-03-16 16:16:40 +00:00
Emmanuele Bassi
a7714e294e actor: Remove an has_allocation() check
The get_content_box() method should always succeed; if the actor does
not have an allocation, we are just going to return a 0-box.
2012-03-16 16:13:11 +00:00
Emmanuele Bassi
800b5b6ef7 actor: Restore a lost queue_relayout()
It got lost during a rebase conflict resolution.
2012-03-16 14:47:02 +00:00
Emmanuele Bassi
ae554a5061 Rename 'bilinear' scaling filter to 'trilinear'
Yes, it's not really the proper GL name for a linear-on-every-axis of a
texture plus linear-between-mipmap-levels minification filter, but it
has three redeeming qualities as a name:

  - LINEAR_MIPMAP_LINEAR sucks, as it introduces GL concepts like
    mipmaps in the API naming, while we're trying to avoid that;
  - people using GL already know what 'trilinear' means in this context
    without going all Khronos on their asses;
  - we're using 2D textures anyway, so 'linear on two axes and linear
    between mipmap levels' can be effectively approximated to
    'trilinear'.

I mean, if even the OpenGL official wiki says:

  Unfortunately, what most people think of as "trilinear" is not linear
  filtering of a 3D texture, but what in OpenGL terms is GL_LINEAR mag
  filter and GL_LINEAR_MIPMAP_LINEAR in the min filter in a 2D texture.
  That is, it is bilinear filtering of each appropriate mipmap level,
  and doing a third linear filter between the adjacent mipmap levels.
  Hence the term "trilinear".
                -- http://www.opengl.org/wiki/Texture

then the horse has already been flogged to death, and I don't intend to
be accused of necrophilia and sadism by flogging it some more.

Prior art: every single GL tutorial in the history of ever;
CoreAnimation's scaling filter enumerations.

If people want to start using 1D or 3D textures they they are probably
going to be using Cogl API directly, and that has the GL naming scheme
for minification and magnification filters anyway.
2012-03-16 12:33:40 +00:00
Emmanuele Bassi
b44290c436 docs: Add ClutterActorClass.paint_node() description 2012-03-16 12:33:40 +00:00
Emmanuele Bassi
8904f7cbe4 paint-nodes: Make part of the API internal
At least for the time being, we only expose the parts of the API that we
want to use internally and for new, out-of-tree Content implementations.

The full PaintNode tree API will be made public in 1.12 once we branch
master.
2012-03-16 12:33:40 +00:00
Emmanuele Bassi
74f5bbe5aa docs: Fixes for ClutterImage's API reference 2012-03-16 12:33:39 +00:00
Emmanuele Bassi
0a2ee1709b docs: Fixes for the API reference 2012-03-16 12:33:39 +00:00
Emmanuele Bassi
10e2f551f5 actor: Unconditionally emit ::paint
It's a bit late in the game for changing the emission of the paint
signal with actors that use paint nodes - mostly because we have both
implicit paint nodes (background color, content) and explicit paint
nodes (the paint_node virtual).

When we branch for 1.12 we can revert this change.
2012-03-16 12:33:39 +00:00
Emmanuele Bassi
5432775eff paint-node: Make texture template pipeline clamp to edge
It's safer, and consistent with the rest of Clutter, to make sure that
the template pipeline we use for ClutterTextureNode has its wrap mode
set to clamp-to-edge.
2012-03-16 12:33:39 +00:00
Emmanuele Bassi
75e6560160 image: Add set_area() method
This method allows replacing an area inside the texture data used by a
ClutterImage.
2012-03-16 12:33:39 +00:00
Emmanuele Bassi
2be850f441 image: Add get_texture()
Allow retrieving the Cogl texture used by the ClutterImage.
2012-03-16 12:33:39 +00:00
Emmanuele Bassi
9845ce9d89 actor: Fix RESIZE_ASPECT mode for the content box 2012-03-16 12:33:38 +00:00
Emmanuele Bassi
b6403b01a1 Documentation fixes 2012-03-16 12:33:38 +00:00
Emmanuele Bassi
f90330867e Update clutter.symbols 2012-03-16 12:33:38 +00:00
Emmanuele Bassi
fb106ece05 Use the content scaling filters
Both ClutterCanvas and ClutterImage should use the minification and
magnification filters set on the actor, just like the use the content
box and the paint opacity.
2012-03-16 12:33:38 +00:00
Emmanuele Bassi
77729c7362 actor: Add minification/magnification filters
These settings are informative, and will only be used by the eventual
content of an actor.
2012-03-16 12:33:38 +00:00
Emmanuele Bassi
cadae5b325 Add ClutterImage, and image data content 2012-03-16 12:33:37 +00:00
Emmanuele Bassi
f2b9c17a78 canvas: Fix single header inclusion guard 2012-03-16 12:33:37 +00:00
Emmanuele Bassi
0eeb61f3a8 canvas: Add canvas size to the ::draw signal
Instead of requiring a call to clutter_content_get_preferred_size(), we
can simply pass the canvas size to the Canvas::draw signal.
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
e2f1153c46 paint-node: Remove redundant declarations 2012-03-16 12:33:37 +00:00
Emmanuele Bassi
546a14ec3b content: Make get_preferred_size() public 2012-03-16 12:33:37 +00:00
Emmanuele Bassi
e54ee64380 actor: Make paint_node() and ::paint mutually exclusive
The ::paint signal is the old way to paint an actor; the paint_node()
virtual function is the new way. It's still not possible to traverse the
whole scene graph and build a render tree of PaintNode instances, but
with this change we simultaneously cut out the ::paint signal emission
from the critical path for actors that are using the new PaintNode-based
API, and we retain backward compatibility in the interim period between
1.10 and 2.0.
2012-03-16 12:33:37 +00:00
Emmanuele Bassi
a58be8aad1 paint-nodes: Fix compiler warning 2012-03-16 12:33:36 +00:00
Emmanuele Bassi
51cca132e0 paint-nodes: Use logical extents for the TextNode::draw
When we decide if we ought to clip, we should use the logical extents of
the PangoLayout, just like we do for ClutterText.
2012-03-16 12:33:36 +00:00
Emmanuele Bassi
fa77274e80 content: Turn attached and detached into signals
The attached and detached virtual functions are now informative, and not
normative - which means it's a good idea to provide them as signals.
2012-03-16 12:33:36 +00:00
Emmanuele Bassi
2f0d29ad75 content: Make vfuncs optional
The virtual functions on the ClutterContent interface should provide
hooks for application code, not be the actual implementation.
2012-03-16 12:33:36 +00:00
Emmanuele Bassi
f4d8fb054a paint-node: Use JSON-GLib for debug serialization
Instead of our homegrown string building; this at least ensures that
we're generating proper data, instead of random strings. Plus, using
JsonNode and JsonBuilder, we can ask the PaintNode subclasses to
serialize themselves in a sensible way.
2012-03-16 12:33:36 +00:00
Emmanuele Bassi
2ee5851970 docs: Update the API reference
Add all the new symbols.
2012-03-16 12:33:36 +00:00
Emmanuele Bassi
6cddd69747 docs: Update documentation on the paint sequence 2012-03-16 12:33:36 +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
6f0782e0a4 actor: Add paint_node virtual function
The ::paint-node virtual inside ClutterActor is what we want people to
use when painting their actors.

Right now, it's a new code path, that gets called while painting; the
paint_node() implementation should only paint the actor itself, and not
its children — they will get their own paint_node() called when needed.

Internally, ClutterActor will automatically create a dummy PaintNode and
paint the background color; then control will be handed out to the
implementation on the class. This is required to maintain compatibility
with the old ::paint signal emission.

Once we are able to get rid of the paint (and pick) sequences, we'll
switch to a fully retained render tree.
2012-03-16 12:33:35 +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
cbcc84022e animator: Fix NULL check 2012-03-15 17:51:22 +00:00
Emmanuele Bassi
7f1f9a50c1 actor: Remove G_SIGNAL_NO_RECURSE
As it turns out, we do end up recursing inside the ::paint signal
emission - especially inside the conformance test suite.

This thoroughly sucks - and we'll only be able to fix it properly
when we bump API for 2.0.
2012-03-15 17:41:28 +00:00
Emmanuele Bassi
6a8d67a8ad I should compile the changes I make 2012-03-15 17:32:53 +00:00
Emmanuele Bassi
5e652b91d6 actor: Fix get_transition() method
We now store a closure, not directly a ClutterTransition instance.
2012-03-15 17:31:36 +00:00
Emmanuele Bassi
9e1ec82838 doc: Reference fixes 2012-03-15 17:01:14 +00:00
Emmanuele Bassi
0cf9ad82c4 symbols: Update 2012-03-15 17:01:14 +00:00