Commit Graph

5580 Commits

Author SHA1 Message Date
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
Emmanuele Bassi
4bd3583dbf actor: Add generic transition support
ClutterActor should be able to hold all transitions, even the ones that
have been explicitly created.

This will allow to add new transitions types in the future, like the
keyframe-based one, or the transition group.
2012-03-15 17:01:14 +00:00
Emmanuele Bassi
3638c1efed transition: Clear the animatable member when removing on complete 2012-03-15 17:01:14 +00:00
Emmanuele Bassi
514466601e transition: Check the repeat count to remove on complete
We can now ask the timeline for the current repeat, and if it's the last
one, then we can safely detach the transition from the animatable
instance.
2012-03-15 17:01:13 +00:00
Emmanuele Bassi
388f818f41 timeline: Add more state accessors
It should be possible to ask a timeline what is its duration, taking
into account eventual repeats, and which repeat is the one currently
in progress.

These two functions allow writing animations that depend on the current
state of another timeline.
2012-03-15 17:01:13 +00:00
Emmanuele Bassi
1511e588df actor: Add delay to the easing state
It should be possible to set up the delay of a transition, but since
we start the Transition instance before returning control to the caller,
we cannot use clutter_actor_get_transition() to do it without something
extra-awkward, like:

  transition = clutter_actor_get_transition (actor, "width");
  clutter_timeline_stop (transition);
  clutter_timeline_set_delay (transition, 1000);
  clutter_timeline_start (transition);

for each property involved. It's much easier to add a delay to the
easing state of an actor.
2012-03-15 17:01:13 +00:00
Emmanuele Bassi
dda4db378c symbols: Update 2012-03-15 17:01:13 +00:00
Emmanuele Bassi
67113ed690 actor: Implement implicit animatable properties
Clutter is meant to be, and I quote from the README, a toolkit:

  for creating fast, compelling, portable, and dynamic graphical
  user interfaces

and yet the default mode of operation for setting an actor's state on
the scene graph (position, size, opacity, rotation, scaling, depth,
etc.) is *not* dynamic. We assume a static UI, and then animate it.

This is the wrong way to design an API for a toolkit meant to be used to
create animated user interfaces. The default mode of operation should be
to implicitly animate every state transition, and only allow skipping
the animation if the user consciously decides to do so — i.e. the design
tenet of the API should be to make The Right Thing™ by default, and make
it really hard (or even impossible) to do The Wrong Thing™.

So we should identify "animatable" properties, i.e. those properties
that should be implicitly animated by ClutterActor, and use the
animation framework we provide to tween the transitions between the
current state and the desired state; the implicit animation should
happen when setting these properties using the public accessors, and not
through some added functionality. For instance, the following:

  clutter_actor_set_position (actor, newX, newY);

should not make the actor jump to the (newX, newY) point; it should
tween the actor's position between the current point and the desired
point.

Since we have to maintain backward compatibility with existing
applications, we still need to mark the transitions explicitly, but we
can be smart about it, and treat transition states as a stack that can
be pushed and popped, e.g.:

  clutter_actor_save_easing_state (actor);

    clutter_actor_set_easing_duration (actor, 500);
    clutter_actor_set_position (actor, newX, newY);
    clutter_actor_set_opacity (actor, newOpacity);

  clutter_actor_restore_easing_state (actor);

And we can even start stacking animations, e.g.:

  clutter_actor_save_easing_state (actor);

    clutter_actor_set_easing_duration (actor, 500);
    clutter_actor_set_position (actor, newX, newY);

    clutter_actor_save_easing_state (actor);

      clutter_actor_set_easing_duration (actor, 500);
      clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
      clutter_actor_set_opacity (actor, newOpacity);
      clutter_actor_set_depth (actor, newDepth);

    clutter_actor_restore_easing_state (actor);

  clutter_actor_restore_easing_state (actor);

And so on, and so forth.

The implementation takes advantage of the newly added Transition API,
which uses only ClutterTimeline sub-classes and ClutterInterval, to cut
down the amount of signal emissions and memory management of object
instances; as well of using the ClutterAnimatable interface for custom
properties and interpolation of values.
2012-03-15 17:01:12 +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
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
708d385866 actor: Annotate signals to enable some optimization
The ::paint, ::queue-redraw, and ::queue-relayout signals should be
marked as no-recurse and no-hooks; these signals are emitted *a lot*
during each frame, and since GLib has a bunch of optimizations for
signals with no closures, we should try and squeeze every single CPU
cycle we can.
2012-03-14 11:35:33 +00:00
Stefano Facchini
5d26aeca34 Install clutter-version.h 2012-03-13 18:22:19 +01:00
Chun-wei Fan
c4de95f275 Dist clutter-version.h
Dist clutter-version.h for use under non-autotools-based build
environments (e.g. MSVC) as this header is now generic under the
systems Clutter supports

Checked with Emmanuele Bassi on IRC.
2012-03-13 23:20:00 +08:00
Chun-wei Fan
53e16b6019 clutter-master-clock.c: Set frame_budget conditionally
The frame_budget member of ClutterMasterClock is only enabled when
CLUTTER_ENABLE_DEBUG is enabled, so fix the build with this.

Checked with Emmanuele Bassi on IRC.
2012-03-13 23:19:52 +08:00
Stefano Facchini
ac6ce79aa3 gdk: add new device types (GDK_SOURCE_TOUCHSCREEN, GDK_SOURCE_TOUCHPAD)
https://bugzilla.gnome.org/show_bug.cgi?id=671779
2012-03-12 13:19:34 +01:00
Tristan Van Berkom
2b22b60e6e Fixed leaking GValue content in clutter_animation_setup_valist().
Normally this leak goes unnoticed because basic fundamental types
are typically used with clutter_actor_animate(), the leak shows up
if boxed or object types are passed (such as ClutterVertex in the
case I stumbled upon).
2012-03-10 02:11:19 +09:00
Emmanuele Bassi
620e57ac13 text: Use CoglFramebuffer API for the path-based clip 2012-03-09 16:26:53 +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
41f06138b4 cally/text: Constify string members 2012-03-07 12:59:25 +00:00
Emmanuele Bassi
2567049ce3 Fix missing/redundant declarations 2012-03-07 12:36:43 +00:00
Emmanuele Bassi
266ea8a3d9 cally: Fix redundant declarations 2012-03-07 12:36:43 +00:00
Emmanuele Bassi
4da1c3efb8 snap-constraint: Fix typo that broke the get_edges() method
We were declaring a get_edges() method, but the definition was called
get_edge().
2012-03-07 12:36:43 +00:00
Emmanuele Bassi
3a86d88b43 x11/device-manager-core: Avoid a signed/unsigned comparison 2012-03-07 12:36:43 +00:00
Emmanuele Bassi
f5065059b7 x11/keymap: Avoid a signed/unsigned comparison 2012-03-07 12:36:43 +00:00
Emmanuele Bassi
f54a4532a4 x11/backend: Ensure that pre/post parse hooks are not exposed
Not even as private methods.
2012-03-07 12:36:43 +00:00
Emmanuele Bassi
e3aea910b1 Try to avoid duplicate declarations for profile macros
We can use the __COUNTER__ macro or, failing that, the __LINE__ macro to
ensure that we don't declare dummy variables more than once with the
same name.
2012-03-07 12:36:42 +00:00
Emmanuele Bassi
9bc8c05db8 gdk: Add missing declaration of clutter_gdk_get_default_display() 2012-03-07 12:36:42 +00:00
Emmanuele Bassi
05813872f9 osx: Call finishLaunching on post-parse
https://bugzilla.gnome.org/show_bug.cgi?id=668801
2012-03-06 15:44:57 +00:00
Emmanuele Bassi
cc25deade0 texture: Fix the async loop ceiling
The comment says that we're going to load textures in a loop until we
still have work to do, or if one iteration took more than 5
milliseconds, to avoid blowing up our frame budget, but the check is for
5 seconds, which is hardly a sensible value.
2012-03-06 15:42:00 +00:00
Emmanuele Bassi
477d399c31 text: Use the background color when painting
If the ClutterActor:background-color-set property is set to TRUE.
2012-03-06 15:10:04 +00:00
Emmanuele Bassi
663d6179ff text: Center the cursor caret
We remove 2 pixels from the height of the cursor, but we should also
remove the same amount from the position on the y axis, so that the
cursor caret appears centered in the allocated height.

https://bugzilla.gnome.org/show_bug.cgi?id=655491
2012-03-06 15:10:04 +00:00
Emmanuele Bassi
7646404196 script: Support translatable strings for properties
ClutterScript should be able to automatically call gettext() and friends
on strings loaded from a UI definition, prior to passing the string to
the object it is constructing.

The basic implementation is trivial:

  - set a translation domain on the ClutterScript instance
  - mark the translatable strings inside the JSON data, like:

      "property" : {
        "translatable" : true,
        "string" : "a translatable string"
      }

The hard part is now getting the tools we use to extract the
translatable strings to understand the JSON format we use inside
ClutterScript.
2012-03-06 14:23:33 +00:00
Emmanuele Bassi
4a9414ff87 Annotate clutter_threads_add_repaint_func_full() 2012-03-06 14:22:43 +00:00
Emmanuele Bassi
1ac655b394 Add missing enumeration type to clutter.symbols 2012-03-06 14:21:04 +00:00
Emmanuele Bassi
c2e7704151 master-clock: Add frame budget diagnostic messages
Let's keep a budget of 16.6 milliseconds per frame, and reduce it by the
amount of time spent in each phase of the frame processing. If any phase
goes over the allocated budget then we use the diagnostic mode
facilities to warn the app developer.
2012-03-06 13:50:10 +00:00
Emmanuele Bassi
bdf9f49588 master-clock: Clean up the frame processing
Split out every phase into its own function, to ensure that the sequence
of operation is clear and easy to follow.
2012-03-06 12:55:27 +00:00
Emmanuele Bassi
229607464b Improve repaint functions
It is sometimes useful to be able to have better control on when a
repaint function is called. Currently, all repaint functions are called
prior to the stages update phase of the frame processing.

We can introduce flags to represent the point in the frame update
process in which we wish Clutter called the repaint function.

As a bonus, we can also add a flag that causes adding a repaint function
to spin the master clock.
2012-03-06 12:09:00 +00:00
Emmanuele Bassi
a8d8005800 docs: Updates to the API reference 2012-03-05 23:45:40 +00:00
Emmanuele Bassi
155f7741fe actor: Ensure static scope to allocation-changed arguments
In theory, handlers connected to the ::allocation-changed signal may be
able to modify the actor's real allocation and allocation flags,
especially now that we use STATIC_SCOPE; let's avoid this, so that we
don't regret it later.
2012-03-05 23:45:36 +00:00
Emmanuele Bassi
720fbd3bec stage: Fix up a copy-and-paste train wreck
The show and hide implementation inside ClutterStage ended up being
recursive, and the hide implementation would actually show the children
of the stage unconditionally.

Whoopsie.
2012-03-05 17:38:27 +00:00
Emmanuele Bassi
2aaa39e008 actor: Annotate the allocation-changed signal
The ActorBox passed to the ::allocation-changed signal should be
annotated as STATIC_SCOPE, given that it's a pointer to a structure
inside ClutterActorPrivate - hence there's no risk of it actually being
freed from a signal handler. This allows the GSignal machinery to avoid
a costly copy/free for each signal emission.
2012-03-05 10:36:03 +00:00
Giovanni Campagna
018ede2b24 ClutterActor: clear redraw entry before emitting signals
If the redraw entry is not cleared, queueing a redraw from a signal
handler could reinsert the same object in the stage redraw list,
causing the segfault later (as the object is immediately freed)

https://bugzilla.gnome.org/show_bug.cgi?id=671173
2012-03-01 23:03:42 +01:00
Emmanuele Bassi
251d3b545e input: Add a check on the argument 2012-03-01 15:11:59 +00:00
Emmanuele Bassi
23e8e43d66 symbols: Add missing InputDevice symbol 2012-03-01 15:11:36 +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
a1ec559d14 Fix compilation
Hide a symbol if we're not compiling with Wayland compositor support.
2012-03-01 15:07:44 +00:00
Neil Roberts
cfbb7a0fa0 clutter-wayland-surface: Add padding to the class struct
This just adds some padding pointers so that we can later add more
virtual functions without breaking ABI.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:52 +00:00
Neil Roberts
5f654069fe clutter-input-device-wayland: Include clutter-stage-private.h
This was giving a warning about using _clutter_stage_update_state
without declaring it.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
b5c90f6caa wayland-surface: don't queue redraw on buffer attach
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
3c6a0cdc61 evdev: Adds api to release/reclaim the evdev devices
Clutter applications using evdev are typically fullscreen applications
associated with a single virtual termainal. When switching away from
the applications associated tty then Clutter should stop managing all
evdev devices and re-probe for devices when the application regains
focus by switching back to the tty. To facilitate this, this patch
adds clutter_evdev_release_devices() and clutter_evdev_reclaim_devices()
functions.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
1f7968e5f9 wayland/x11: Set constraints on the CoglRenderer
When using the Wayland backend this sets a constraint that the
CoglRenderer selects the Wayland EGL winsys.

When a Wayland compositor display is set it now also sets a constraint
that the render should use EGL because only EGL renderers will set up
the required wl_drm global object.

The X11 backend now sets the X11 constraint.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
a0d3b01aa9 device-manager-core-x11: Create core input devices as x11
The core input devices when XInput doesn't work were being created as
generic ClutterInputDevices instead of ClutterInputDeviceX11s. This
meant the keycode_to_evdev virtual wouldn't work.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
13e3f9e5f1 Add an input device function to convert keycodes to evdev codes
This adds a virtual function to ClutterInputDevice to translate a
keycode from the hardware_keycode member of ClutterKeyEvent to an
evdev keycode. The function can fail so that input backends that don't
have a sensible way to translate to evdev keycodes can return FALSE.
There are implementations for evdev, wayland and X. The X
implementation assumes that the X server is using an evdev driver in
which case the hardware keycodes are the evdev codes plus 8.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
a3bbcff946 evdev: Associate devices with the first created stage
Because evdev isn't associated with the display system, it doesn't
have any easy way to associate an input device with a stage.
Previously Clutter would never set a stage for an input device and
leave it up to the application to set it. To make it easier for
applications which just have a single fullscreen stage (which is
probably the most common use case for evdev) the device manager now
associates all input devices with the first stage that is created
unless something has already set a stage.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
1bfd1d85eb Updates in line with latest wayland protocol
The shm buffer format enum values were renamed and the explicitly
premultiplied format was dropped since it's now assumed if the buffer
has an alpha component then it's premultiplied.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
6cc58f7d7d clutter-wayland-surface: Remove the pick method
The pick method doesn't do anything special over the default pick
method provided by ClutterActor so there's no need to implement it.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
560f92b698 wayland-surface: removes unused origin variable
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
c1aac36d35 wayland-surface: Adds queue-damage-redraw signal
This adds a signal that's emitted whenever a wayland surface is damaged
that allows sub-classes to override the default handler to change
how clipped redraws are queued if the sub-class doesn't simply draw
a rectangle. The signal can also be used just to track damage.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
b89af8efa3 wayland-surface: Add cogl-texture property
This adds a "cogl-texture" gobject property so that a compositor may
listen for notifications of changes to the texture used to paint.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Neil Roberts
8ac2200aac clutter-wayland-surface: Rename the width/height properties
This patch renames the width/height properties to
surface-width/surface-height so that they won't override the
width/height properties of ClutterActor which have different
semantics.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
1b77565e63 configure: Adds xkb-utils automake conditional
This adds a NEEDS_XKB_UTILS automake conditional that's set to true if
either the wayland backend is enabled or the evdev input backend is
enabled since they both depend on clutter-xkb-utils.c and we need
to avoid listing the file twice since that leads to duplicate symbols
and the build fails.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
612bde3c4a wayland-surface: Set actor size on buffer attach
When a new buffer is attached and we update the width and height
properties for the surface we now also call clutter_actor_set_size()

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
0ba6127edc wayland-surface: Adds _get_surface function
This adds a clutter_wayland_surface_get_surface() function for querying
the struct wl_surface * associated with a ClutterWaylandSurface.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
83b94ec27d wayland-surface: Make _set_surface api public
This exposes a clutter_wayland_surface_set_surface() function. The
implementation ignores requests to re-set the same surface and since now
has code to cleanup old surface state before setting the new surface.
(previously the surface was construct only so this wasn't necessary)

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
862eebceb6 wayland-surface: Cleanup properly in _dispose
When disposing a ClutterWaylandSurface we now make sure to unref any
pipeline we created and unref any surface buffer textures we created.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:51 +00:00
Robert Bragg
c7e10024d8 wayland-surface: remove unused damage array
There was a GArray member named damage that wasn't being used which this
patch removes.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:50 +00:00
Robert Bragg
2c9ec271e2 wayland: install wayland compositor headers + pkgconfig file
If wayland compositor support has been enabled then we make sure to
install the corresponding public headers and a
clutter-wayland-compositor.pc pkgconfig file.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-01 11:41:50 +00:00
Emmanuele Bassi
c465881726 docs: Refresh the layout managers example image
Drop the window decoration and pointer; drop the double image for the
FlowLayout class; add an image for the TableLayout class.
2012-02-29 15:20:58 +00:00
Emmanuele Bassi
7713d3bbdc docs: Update the actor example image 2012-02-29 15:20:58 +00:00
Emmanuele Bassi
fde094dce2 build: Remove clutter-version.h.win32.in
The clutter-version.h header file is now completely generic, and does
not need to be masked by a Windows-specific header when building under
MSVC.
2012-02-29 15:20:58 +00:00
Emmanuele Bassi
38bcd86c51 Annotate the exported version variables
When using MSVC we need to annotate the variables that are going to be
exported.
2012-02-29 15:20:57 +00:00
Emmanuele Bassi
80626e7584 actor: Do not check for child destruction in add_child_internal()
We currently check for the IN_DESTRUCTION flag inside the
add_child_internal() function.

This check disallows calling methods that change the stacking order
within the destruction sequence, by triggering a critical warning first,
and leaving the actor in an undefined state, which then ends up being
caught by an assertion.

The reproducible sequence is:

  - actor gets destroyed;
  - another actor, linked to the first, will try to change the
    stacking order of the first actor;
  - changing the stacking order is a composite operation composed
    by the following steps:
    1. ref() the child;
    2. remove_child_internal(), which removes the reference;
    3. add_child_internal(), which adds a reference;
  - the state of the actor is not changed between (2) and (3), as
    it could be an expensive recomputation;
  - if (3) bails out, then the actor is in an undefined state, but
    still alive;
  - the destruction sequence terminates, but the actor is unparented
    while its state indicates being parented instead.
  - assertion failure.

The obvious fix would be to decompose each set_child_*_sibling() method
into proper remove_child()/add_child(), with state validation; this may
cause excessive work, though, and trigger a cascade of other bugs in
code that assumes that a change in the stacking order is an atomic
operation.

Another potential fix is to just remove this check here, and let code
doing stacking order changes inside the destruction sequence of an actor
continue doing the work.

The third fix is to silently bail out early from every
set_child_*_sibling() and set_child_at_index() method, and avoid doing
work.

I have a preference for the second solution, since it involves the least
amount of work, and the least amount of code duplication.

See bug: https://bugzilla.gnome.org/show_bug.cgi?id=670647
2012-02-29 15:20:57 +00:00
Alejandro Piñeiro
6e78ebca95 a11y: Not compute extents for actors without an stage
This solves a crash on GNOME Shell, as compute the extents
for some StWidgets could lead to call st_widget_get_theme_node,
and it is a fatal error to call this on a widget that it not
beed added to a stage.
2012-02-29 15:52:49 +01:00
Alejandro Piñeiro
dde5da1dd8 a11y: Stop to use ClutterActor::name as default accessible-name
ClutterActor::name is mostly used for debugging purposes
2012-02-29 15:52:49 +01:00
Chun-wei Fan
b689737a43 Update clutter-version.h.win32(.in)
Make it like the clutter-version.h.in template.  Since we aren't having
Windows-specific items in here (such as CLUTTER_FLAVOUR), perhaps we
could get the dllexport stuff in clutter-version.h.in, where it can be
used when necessary, and this file would be gone.
2012-02-29 18:10:03 +08:00
Emmanuele Bassi
b9553083e0 docs: Document the versioning macros 2012-02-27 16:47:53 +00:00
Emmanuele Bassi
fb9df4bef2 Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
Emmanuele Bassi
0ee7170dbb Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00
Emmanuele Bassi
2daf2e8e6b Add a deprecated header for ClutterCairoTexture 2012-02-27 15:49:58 +00:00
Emmanuele Bassi
45d61d795b Add a deprecated header for ClutterTexture 2012-02-27 15:44:38 +00:00
Emmanuele Bassi
3c12b3575d Add deprecated header for ClutterAnimation 2012-02-27 15:38:11 +00:00
Emmanuele Bassi
4ae36f1e5f Add a deprecated header for ClutterAnimatable 2012-02-27 15:21:32 +00:00
Emmanuele Bassi
9613374c73 Add deprecated header for ClutterStageManager 2012-02-27 15:21:32 +00:00
Emmanuele Bassi
d5b565f7b9 Update the deprecation macros
Use the new versioned macros instead of the generic ones.
2012-02-27 15:21:31 +00:00
Emmanuele Bassi
780a11b926 Add flexible versioning scheme
GLib introduced macros that allows defining the lower and upper bounds
of the API to be used by application code.

The lower bound allows to define the minimum version that will trigger
deprecation warnings; the upper bound defines the maximum version that
will trigger compiler warnings for unavailable symbols.

This scheme allows gradually porting application code to a new version
of the API, especially in case of resynchronization after multiple
development cycles.
2012-02-27 15:21:31 +00:00
Emmanuele Bassi
a6b1972d71 Move macros to their own headers 2012-02-27 14:03:57 +00:00
Emmanuele Bassi
e4c948b150 actor: Add a method for computing the default paint volume
Now that ClutterActor has a default paint volume, subclasses may wish
to retrieve it without chaining up to the parent's implementation of
the get_paint_volume() function.

The get_default_paint_volume() returns a ClutterPaintVolume pointer
to the paint volume as computed by the default implementation of the
get_paint_volume() virtual function; it can only be used immediately,
as it's not guaranteed to survive across multiple frames.
2012-02-27 11:59: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
f27e575ad4 build: Make abicheck.sh backend-aware
It should be possible to adapt the abicheck.sh script so that it
actually tests the ABI of libclutter-1.0.so taking into account
the backends that were compiled into Clutter, and avoid expected
failures if Clutter was not built with a specific backend.

https://bugzilla.gnome.org/show_bug.cgi?id=670680
2012-02-23 17:32:32 +00:00
Emmanuele Bassi
78b237b535 Clean up the included headers
Especially inside ClutterStage.
2012-02-23 17:21:57 +00:00
Emmanuele Bassi
630282ac77 build: Fix the header order
The "keep the list sorted" comment on the list of headers is there not
for fun, or because I'm anal-retentive like that.
2012-02-23 17:01:40 +00:00
Emmanuele Bassi
39a75436bf docs: Documentation fixes 2012-02-23 12:01:11 +00:00
Emmanuele Bassi
2b35b2a081 docs: Document ClutterTextBuffer structures 2012-02-23 11:54:41 +00:00
Emmanuele Bassi
cf435f9512 Fix compiler warning 2012-02-23 11:31:26 +00:00
Emmanuele Bassi
6575f25e32 docs: "Soft" deprecation of ClutterAlpha
We cannot deprecate ClutterAlpha yet. We cannot also implement
ClutterAlpha in terms of ClutterTimeline, because multiple Alpha
instances can be attached to the same Timeline. So we can start
with a "soft" deprecation: just a warning in the documentation
stating that ClutterAlpha will be deprecated, and removed, in the
future, and that newly-written code should use ClutterTimeline
instead.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
e5f410d4df Fix the progress function scope annotation 2012-02-23 11:23:15 +00:00
Emmanuele Bassi
f98bb30633 animation: Deprecate Alpha usage
We can use ClutterTimeline and its progress mode inside
ClutterAnimation; obviously, we have to maintain the invariants because
of the ClutterAnimation:alpha property, but if all you set is the :mode
property using one of the Clutter animation modes then we can skip the
ClutterAlpha entirely.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
7ec975ed3d timeline: Add progress functions
The whole progress computation should not be done using a separate
class: it should be part of the Timeline class.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
59bd20a94b Move the easing functions to their own file
Instead of having the easing functions be dependent of ClutterAlpha, and
static to the clutter-alpha.c source file, we should make them generic
and move them to their own internal header and source files. This will
allow to re-use them in the near future.
2012-02-23 11:23:15 +00:00
Emmanuele Bassi
1e3debbd9e drag-action: Use the motion event when passing the drag threshold
This avoids a critical warning, but it also makes the dragging more
fluid in case of threshold crossing.

https://bugzilla.gnome.org/show_bug.cgi?id=670402
2012-02-23 10:51:08 +00:00
Robert Bragg
a8e631543e Reduce our internal dependence on the Cogl 1.x api
Since Cogl has started restricting what cogl 1.x api is exposed when
COGL_ENABLE_EXPERIMENTAL_2_0_API is defined and since we build all
Clutter internals with COGL_ENABLE_EXPERIMENTAL_2_0_API defined this
patch makes a first pass at reducing our internal use of the Cogl 1.x
api.

The most notable api that's no longer exposed to us internally is
the cogl_material_ api so this switches all Clutter internals to use the
cogl_pipeline_ api instead. This patch also makes quite a bit of
progress removing internal uses of CoglHandle although there is still
more to go.
2012-02-21 17:46:11 +00:00
Robert Bragg
eff95eba4a Pass context to cogl_texture_pixmap_x11_new() api
The experimental cogl_texture_pixmap_x11_new() api was recently changed
to take an explicit context argument and return a GError on failures.
This updates Clutter's use of the api accordingly.
2012-02-21 17:46:11 +00:00
Robert Bragg
66cc330c0b Loosen the guard around clutter_backend_get_cogl_context
We were only exposing clutter_backend_get_cogl_context() if
COGL_ENABLE_EXPERIMENTAL_2_0_API had been defined but the CoglContext
api is also available if COGL_ENABLE_EXPERIMENTAL_API has been defined.

As it was it meant that code opting into the experimental Cogl api
but not limiting to the 2.0 only api would have to #define
COGL_ENABLE_EXPERIMENTAL_2_0_API before including clutter.h but make
sure it wasn't defined when including cogl.h which was particularly
awkward.
2012-02-21 17:46:11 +00:00
Robert Bragg
671ead6681 Rename cogl_framebuffer_swap_* apis to cogl_onscreen_swap_*
Recently the cogl_framebuffer_swap_* apis were moved into the
cogl_onscreen_* namespace since only CoglOnscreen framebuffers can be
double buffered. This renames all uses of the cogl_framebuffer_swap_*
apis in Clutter.
2012-02-21 17:46:11 +00:00
Robert Bragg
fbf94310fc Pass a CoglContext when calling cogl_pipeline_new
The experimental cogl_pipeline_new() api was recently changed so it
explicitly takes a CoglContext. This updates all calls to
cogl_pipeline_new() in clutter accordingly.
2012-02-21 17:46:11 +00:00
Stefano Facchini
4e345f6edc clutter-drop-action: annotation fixes for some signals
https://bugzilla.gnome.org/show_bug.cgi?id=670433
2012-02-20 13:26:15 +01:00
Alejandro Piñeiro
493461e798 a11y: remove Container explanation
That explanation is outdated after the last changes on clutter
2012-02-15 19:10:24 +01:00
Alejandro Piñeiro
c1d43b70c5 a11y: proper ATK role for ClutterStage
ATK_ROLE_CANVAS is not a suitable role, as the user (in general) can't
draw on the Stage. CallyStage implements AtkWindow, so the proper role
is ATK_ROLE_WINDOW
2012-02-15 19:10:24 +01:00
Alejandro Piñeiro
cc126f55eb a11y: redoing focus stuff
Removing atkcomponent, focus_tracker, etc. Emitting focus state change
from the stage. Now things are more simple, and stop to use some
of the soon-to-be-deprecated signals on ATK.
2012-02-15 19:09:44 +01:00
Emmanuele Bassi
5b4d29bc4a docs: Note when new ClutterBindCoordinate values were added
The shorthands for position and size were added in 1.6.
2012-02-15 17:43:31 +00:00
Adel Gadllah
851d2a42c4 ClutterBindConstraint: Add CLUTTER_BIND_ALL coordinate
Add a CLUTTER_BIND_ALL that binds both size and position.
2012-02-15 17:57:18 +01:00
Emmanuele Bassi
b8e5603a85 x11/stage: Allow setting fullscreen hint before realize
It should be possible to do:

  clutter_stage_set_fullscreen (stage, TRUE);
  clutter_actor_show (stage);

and have the stage be full screen as soon as it is shown.

Currently, we need to call clutter_actor_realize() prior to calling
set_fullscreen(), otherwise the backing X window will not be set,
and ClutterStageX11 will silently discard the change.

If set_fullscreen() was called prior to realization, ClutterStageX11
should delay setting the fullscreen hint until the realize() chain
has been successfully executed.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2515
2012-02-15 14:20:59 +00:00
Lionel Landwerlin
d31bd6fe92 x11: adjust size to minimal size when realizing
If you execute the following sequence :

stage = clutter_stage_new ();
clutter_actor_set_size (stage, 1280, 800);
clutter_actor_realize (stage);

Then you end up creating an onscreen buffer of size 1280x800 but
ClutterStageX11 storing the stage size at 640x480.

This patch resync the 2 implementation by using the ClutterStage's
size in both classes when realizing.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=667540
2012-02-15 11:32:41 +00:00
Emmanuele Bassi
b1ff53d980 effects: Delay the creation of the base pipeline
Unconditionally creating CoglPipeline and CoglSnippets inside the class
initialization functions does not seem to be enough when dealing with
headless builds.

Our last resort is to lazily create the base pipeline the first time we
try to copy it, during the instance initialization.
2012-02-15 09:34:27 +00:00
Jasper St. Pierre
84632d9c1d actor: Correct get_paint_volume for an actor with no children and no clip
We do not need to repaint the entire stage if an actor has no children
and no clip.
2012-02-14 16:20:24 -05:00
Jasper St. Pierre
114250e329 clutter.symbols: Fix up symbols 2012-02-14 16:19:33 -05:00
Emmanuele Bassi
c1a57e537b Do not check for features inside class initialization
The class initialization function may be called when Clutter hasn't been
fully initialized — for instance, when scanning the source with gtk-doc
or with the introspection scanner.
2012-02-14 17:14:25 +00:00
Emmanuele Bassi
f854619bc9 box-layout: Fix allocation brain farts
The allocation code for BoxLayout contains a sequence of brain farts
that make it barely working since the synchronization of the layout
algorithm to the one in GtkBox.

The origin of the layout is inverted, and it doesn't take into
consideration a modified allocation origin (for actors the provide
padding or margin).

The pack-start property is broken, and it only works because we walk the
children list backwards; this horribly breaks when a child changes
visibility. Plus, we count invisible children, which leads to
allocations getting insane origins (either close to -MAX_FLOAT or
MAX_FLOAT).

Finally, the allocation is applied twice even for non-animated cases.

https://bugzilla.gnome.org/show_bug.cgi?id=669291
2012-02-14 16:01:21 +00:00
Alejandro Piñeiro
dbd603c504 ClutterStage: notify "key-focus" change on clutter_stage_emit_key_focus_event 2012-02-14 16:53:54 +01:00
Jasper St. Pierre
0f5ddb6d6c actor: Add freeze/thaw when changing the first/last child
This should improve performance when adding/removing lots
of children.
2012-02-14 10:40:36 -05:00
Rob Bradford
cf735b54df wayland: Add accessor API to permit access to underlying Wayland structures
* clutter_wayland_input_device_get_wl_input_device for the input device
* clutter_wayland_stage_get_wl_surface for the Wayland surface
* clutter_wayland_stage_get_wl_shell_surface for the shell surface
2012-02-14 13:54:15 +00:00
Rob Bradford
84362a8257 build: Install a clutter-wayland pkg-config file 2012-02-14 13:54:15 +00:00
Neil Roberts
3218cd6865 Convert all of the internal shader-based effects to use snippets
This converts the blur, colorize and desaturate effects to use
snippets instead of CoglPrograms. Cogl can handle the snippets much
more efficiently than programs so this should be a performance win. It
also fixes the problem that Cogl would end up recompiling the program
for every instance of the effects because Clutter was not reusing the
same program.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:32 +00:00
Neil Roberts
b4887c3699 blur-effect: Use the texture size to work out the x/y step
The blur effect needs to pass a uniform to the GLSL shader so that it
can know the texture coordinate offset from one texel to another. To
calculate this the blur effect was previously using the allocation
size of the actor rounded up to the next power of two. Presumably the
assumption was that Cogl would round up the size of the texture to the
next power of two when allocating the texture. However this is not be
true if the driver supports NPOT textures. Also it doesn't take into
account the paint volume of the actor which may cause the texture to
be a completely different size. This patch just changes to directly
use the size of the texture.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:31 +00:00
Neil Roberts
041ac40056 offscreen-effect: Add clutter_offscreen_effect_get_texture
Sometimes a subclass of ClutterOffscreenEffect wants to paint with a
completely custom material. In that case it is awkward to modify the
material returned owned by ClutterOffscreenEffect so it makes more
sense to just get the texture and manage its own material.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:18 +00:00
Neil Roberts
0e542aa306 clutter-texture: Don't create a dummy texture
All of the pipelines used for ClutterTexture actors share a common
pipeline ancestor created with cogl_pipeline_copy. Previously this
ancestor had a dummy 1x1 texture attached to it so that it would end
up with the same state as the child pipelines that will render with a
texture. Cogl now has a mechanism to specify that a texture will be
used with a pipeline layer without having to create an actual texture.
This patch makes it use that to avoid having an unused texture.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-14 12:09:18 +00:00
Jasper St. Pierre
e315122895 actor: Allow insert_child_at_index to add a child at the end with an index
If we have N children and the user passes N (or a number beyond N) to
clutter_actor_insert_child_at_index, we should respond by adding the
child at the end, not silently doing nothing.
2012-02-13 17:54:38 -05: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
Jasper St. Pierre
8512dd2336 actor: Only care about a child's paint volume when clip_to_allocation isn't set
If we're clipping to the allocation, then the child can paint wherever it
wants, and we don't care. The paint volume is the allocation here.
2012-02-13 18:04:12 +00:00
Emmanuele Bassi
b5aa666dcd actor: Remove stray cogl_object_unref()
The outline primitive is static, so unref'ing it makes Clutter crash.
2012-02-13 17:56:12 +00:00
Emmanuele Bassi
3996ae4348 actor: Add destroy_all_children()
There are times when we don't want to remove all children and count of
the reference count to drop to 0 to ensure destruction; there are cases,
such as managed environments, where it's preferable to ensure that the
children of an actor get actually destroyed.
2012-02-13 17:42:07 +00:00
Emmanuele Bassi
bc7959069b Deprecate ClutterStage:color
ClutterActor has a background-color property, now; we should use it for
the Stage, re-implement the color property in terms of background-color.
and deprecate the Stage property.
2012-02-13 17:30:22 +00:00
Emmanuele Bassi
cf9c4e651d timeline: Move deprecated methods into a separate header 2012-02-13 17:30:22 +00:00
Emmanuele Bassi
cf1abda709 animation: Do not use deprecated timeline methods 2012-02-13 17:30:22 +00:00
Emmanuele Bassi
97feb06a6f timeline: Add repeat-count
Being able to easily set the number of repeats has been a request for
the animation framework for some time now. The usual way to implement
this is: connect to the ::completed signal, use a static counter, and
stop the timeline when the counter hits a specific spot.

In the same light as the :auto-reverse property, we can make it easier
to implement this common functionality by adding a :repeat-count
property that, when set, limits the amount of loops that a Timeline can
perform before stopping itself.

In fact, we can implement the :loop property in terms of the
:repeat-count property just by using a sentinel value mapping to
"infinity", and map loop=FALSE to repeat-count=0, and loop=TRUE to
repeat-count=-1.
2012-02-13 17:30:22 +00:00
Emmanuele Bassi
4277468928 timeline: Deprecate the clone() method
The clutter_timeline_clone() method was a pretty dumb idea when it was
introduced, back when we still had the ClutterEffectTemplate and the
clutter_effect_* animation API. It has since become an API wart: we
cannot change or add new properties to be cloned without the risk of
breaking existing code. All in all, cloning a GObject is just a matter
of calling g_object_new() with the wanted properties.

Let's deprecate this throwback of the Olden Days™, so that we can remove
it for good once we break for 2.0.
2012-02-13 17:29:45 +00:00
Emmanuele Bassi
bc2e4ac6c2 Clean up clutter-timeline.h
Re-align everything to allow expansion, and move the only "protected"
function to the clutter-master-clock.h private header.
2012-02-13 13:39:47 +00:00
Jasper St. Pierre
aec65c9198 actor-meta: Correct annotations for vfuncs
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-13 12:00:44 +00:00
Jasper St. Pierre
96031a4f6f actor: Fix some broken annotations
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-02-13 12:00:38 +00:00
Emmanuele Bassi
d8a51726e1 actor: Implement remove_all_children using ActorIter
The remove_all_children() method is an ideal candidate for using the
ActorIter API; the end result is more compact and easy to follow.
2012-02-13 08:59:09 +00:00
Emmanuele Bassi
8f6da170bc input-device: Do not use weak references with actors
Use the ClutterActor::destroy signal.
2012-02-13 08:52:08 +00:00
Emmanuele Bassi
f024b852f9 stage: Do not use weak refs with actors
ClutterActor provides a signal for notifying destruction: using weak
references is neither indicated nor recommended.
2012-02-13 08:45:22 +00:00
Emmanuele Bassi
519da376f0 stage: Clean up
Remove some ifdeffed out dead code, and some duplication.
2012-02-13 08:44:40 +00:00
Emmanuele Bassi
cd118f0dc0 text: Fix regression
When the ClutterTextBuffer support inside ClutterText was merged, it
introduced a regression that was identified and fixed in bug 659116.

The optimization to not paint empty ClutterText actors is only valid
is the actor is not editable, or if the cursor is not visible.
2012-02-11 16:02:31 +00:00
Emmanuele Bassi
001e839401 Add abicheck.sh
Courtesy of GLib and GTK+. The abicheck.sh is a simple, Linux-only,
script to check that we're not leaking private symbols, or that the
clutter.symbols file hasn't been updated.

In theory, it should go inside the distcheck phase.
2012-02-09 18:42:27 +00:00
Emmanuele Bassi
de9efd98a7 symbols: Update
Add a bunch of missing public symbols, and remove some cruft.
2012-02-09 18:41:55 +00:00
Emmanuele Bassi
910b09d70a Mark internal symbol as private
A bunch of private symbols have escaped into the SO; let's rectify this
situation by using the '_' private prefix, or making them static as they
should have been.
2012-02-09 18:40:03 +00:00
Neil Roberts
fee53a2993 clutter-backend: Use the Cogl main loop mechanism
Cogl now requires that all applications integrate their main loop with
Cogl so that it can listen for events from winsys. This patch just
adds Cogl's GSource to the main loop.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-09 16:34:25 +00:00
Robert Bragg
bace07c0a0 Updates use of Cogl in line with api changes
Some of Cogl's experimental apis have changed so that the buffer apis
now need to be passed a context argument and some drawing apis have been
replaced with cogl_framebuffer_ drawing apis that take explicit
framebuffer and pipeline arguments.

These changes were made as part of Cogl moving towards a more stateless
api that doesn't rely on a global context.

This patch updates Clutter to work with the latest Cogl api and bumps
the required Cogl version to 1.9.5.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-09 16:34:25 +00:00
Emmanuele Bassi
d0e945fb70 actor: Add ClutterActorIter.destroy()
Similar to the clutter_actor_iter_remove(), but it'll call destroy()
instead of remove_child().

We can also reimplement the ::destroy default handler using it, and make
it more compact.
2012-02-09 15:49:30 +00:00
Emmanuele Bassi
59bb19a449 actor: Add a default handler for ::destroy
Now that ClutterActor can be instantiated, we need to do the right
thing, and destroy its children when it is destroyed.
2012-02-09 15:43:25 +00:00
Emmanuele Bassi
630e602eac docs: Update the Container interface documentation
The API reference should be more explicit about which parts of the
interface should be overridden, and which are deprecated.
2012-02-09 15:38:11 +00:00
Florian Müllner
a023bb3412 actor: Fix add_child_at_index() for negative index
There is a typo in the check for a negative index: the index variable
should be index_, not index - unfortunately, the latter can still be
resolved to index(3), so compiler and linker are perfectly happy.

https://bugzilla.gnome.org/show_bug.cgi?id=669730
2012-02-09 09:29:13 +01:00
Emmanuele Bassi
e7511dd469 text: Avoid changing the contents when possible
An editable ClutterText will reset the selection and cursor whenever the
contents are changed — even if those contents are the same. As this may
confuse the user, we should check if we're setting the exact same string,
and bail out if necessary.
2012-02-07 11:36:27 +00:00
Emmanuele Bassi
d509455de0 text: Fix annotations
Both set_text() and set_markup() have relaxed their preconditions on a
non-NULL string as their argument, so we need to update the annotations.
2012-02-07 11:33:12 +00:00
Emmanuele Bassi
15441bb280 text: Style cleanups
Inline wrapper functions, and remove deep nested if's.
2012-02-07 11:31:28 +00:00
Emmanuele Bassi
7ba9774572 text: Add the coords_to_position() method
The reverse of position_to_coords().

While providing documentation on how to implement it using the
PangoLayout API, I realized that the verbosity of it all, plus the usage
of the Pango API, was not worth it, and decided to expose the method we
are using internally.
2012-02-06 18:27:58 +00:00
Emmanuele Bassi
3305105a8c docs: Fix up Since annotation
We only use stable releases for "since" tags.
2012-02-06 17:34:26 +00:00
Tristan Van Berkom
ad276865d2 Fixed clutter_state_remove_key_internal() to propagate the is_inert state
This was causing warnings when calling g_object_weak_unref on an
already finalized object.

https://bugzilla.gnome.org/show_bug.cgi?id=668951
2012-02-06 15:42:23 +00:00
Tristan Van Berkom
047f60b138 Fix Makefile to properly include clutter-backend-eglnative.h in the disted tarball
https://bugzilla.gnome.org/show_bug.cgi?id=669360
2012-02-06 15:40:15 +00:00
Emmanuele Bassi
ce9564e558 model: Drop GValueArray usage
We can use a plain C array of GValues when deserializing a ClutterModel
implementation from a ClutterScript description.
2012-02-06 15:34:13 +00:00
Emmanuele Bassi
d699328f7f list-model: Migrate from GValueArray
GValueArray is on its way to deprecation in GLib; as far as the
ListModel class is concerned, a plain C array of GValue is a perfectly
suitable replacement for the GValueArray usage. It actually is an
improvement, given that it's going to take less memory.
2012-02-06 15:32:27 +00:00
Emmanuele Bassi
bfe7129375 Clean up clutter-actor.h
It's time, we delayed far too long.
2012-02-05 08:47:17 +00:00
Emmanuele Bassi
9872d7eb1b docs: Clarify actor map and unmap methods
ClutterActor stopped requiring to override the map and unmap virtual
functions some time ago.

Now that ClutterActor implements the Container interface, overriding map
and unmap to control the MAPPED state of the children is pretty much
going to be a source of bugs and misunderstandings.

Plus, the ordering of the unmap, destroy, dispose, and finalize calls
should be be documented properly.

The documentation should clarify all that.
2012-02-02 11:18:00 +00:00
Evan Nemerson
4b6156a57a introspection: add some missing annotations
https://bugzilla.gnome.org/show_bug.cgi?id=667840
2012-01-31 16:25:05 -08:00
Emmanuele Bassi
bb2d807d2a docs: Add an image for the XIncluded code 2012-01-31 16:46:03 +00:00
Emmanuele Bassi
76c8b17144 docs: XInclude test-actor inside the Actor's description 2012-01-31 16:32:48 +00:00
Emmanuele Bassi
5974cfc97b docs: Add an example to the Actor description 2012-01-31 16:30:05 +00:00
Emmanuele Bassi
341faaa089 actor: Add diagnostic message for "behaviours" in ClutterScript
Behaviours have long since been deprecated; we should notify the user
that still uses behaviours in ClutterScript definitions.
2012-01-31 12:45:08 +00:00
Emmanuele Bassi
11239d8da6 actor: Do not unmap/unrealize twice on destruction
When calling clutter_actor_destroy(), ClutterActor calls
update_map_state() on itself to unset the REALIZED and MAPPED states,
prior to running the dispose() implementation.

The default dispose() will call remove_child() (either directly or
through the Container implementation), which will check for the MAPPED
state and then run update_map_state() again. We use the previously set
MAPPED state to decide whether or not the parent should queue for a
relayout/redraw when removing a visible children.

If the MAPPED flag was cleared prior to remove_child(), though, it'll
always be unset by the time we get to remove_child(), and this will
cause missing redraws/relayouts; we were ignoring this prior the
post-First Apocalypse changes because we were doing:

  if (was_mapped)
    clutter_actor_queue_relayout (parent);

  clutter_actor_queue_redraw (parent);

which is obviously wrong. Once I removed that glaring brain damage from
the remove_child() implementation, bugs started appearing — bugs that
were probably the reason why we introduced that brain damage in the
first place, instead of checking the source of those bugs.

The obvious fix is to avoid clearing up the actor's state on destroy()
until we remove the actor from its parent. This also reduces the amount
of work we do, and the code paths that can potentially go wrong.
2012-01-31 12:35:17 +00:00
Emmanuele Bassi
8ee6d10681 actor: Move ClutterShader-related code out of clutter-actor.c
Since the code dealing with ClutterShader is pretty self-contained, now,
we can safely move it outside of the main ClutterActor source file and
into its own. This will allow us to just drop a bunch of files when
branching for 2.0.
2012-01-31 11:56:59 +00:00
Emmanuele Bassi
2ed9e0d557 x11: Remove CLUTTER_DISABLE_DEPRECATED usage
Switch to CLUTTER_DEPRECATED and CLUTTER_DEPRECATED_FOR.
2012-01-31 10:34:45 +00:00
Emmanuele Bassi
1d84bf2b04 texture: Deprecate YUV setter
The YUV support depends on the driver support, and not only not many
drivers support YUV natively: the supported colorspaces are pretty much
useless.

The proper way to do YUV to RGB colorspace conversion on the GPU is to
use a fragment shader; for that, ClutterTexture and Cogl provide enough
API to achieve a good result - see the Clutter-GStreamer implementation,
for instance.
2012-01-31 10:28:04 +00:00
Emmanuele Bassi
c95b126571 texture: It's bytes per pixel, not bits
Clarify the error message when checking the bpp argument.
2012-01-31 10:23:48 +00:00
Emmanuele Bassi
986307f5e4 Use ClutterActorIter inside layout managers
Whenever it is possible, or convenient.
2012-01-30 11:09:59 +00:00
Emmanuele Bassi
842ff82d77 docs: Mention the DELEGATE_LAYOUT flag in set_allocation()
With code examples.
2012-01-27 17:07:33 +00:00
Emmanuele Bassi
534ec4ac7a group: Set the NO_LAYOUT flag
Since FixedLayout won't do that for us any more, and we have Group users
and Group subclasses that may be relying on it.
2012-01-27 15:48:46 +00:00
Emmanuele Bassi
31341986b1 fixed-layout: Remove the NO_LAYOUT flag set
ClutterFixedLayout is the default layout manager for ClutterActor.

Existing subclasses of ClutterActor will get a fixed layout manager
regardless of whether they are going to use it, but since it sets the
CLUTTER_ACTOR_NO_LAYOUT flag, it will introduce regressions on actors
that perform their own layout management.

The CLUTTER_ACTOR_NO_LAYOUT flag was a bit of a mistake in the first
place, as it was introduced as a last minute workaround in the 1.0
process to deal with broken stuff in Moblin. It's going to be a target
for deprecation towards a removal when we start the 2.0 process.
2012-01-27 15:45:11 +00:00
Emmanuele Bassi
5c9c5d24b2 box: Use the ActorIter API
And remove a useless override of the pick() virtual function while we're
at it.

https://bugzilla.gnome.org/show_bug.cgi?id=668669
2012-01-27 11:55:39 +00:00
Emmanuele Bassi
c6e1491474 stage: Use the iterator API instead of the DOM one
Whenever we're iterating over the children of the Stage we can now use
the ClutterActorIter API.

https://bugzilla.gnome.org/show_bug.cgi?id=668669
2012-01-27 11:55:39 +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
fa856e3f5e box: Restore the ::destroy handler
During the gutting of ClutterBox, the destroy and dispose implementation
were removed. The former, especially, destroyed all children - which
usually meant that the redraw queues for the childre was cleared as
well. The removal introduced crashes when a Box was destroyed while its
children were still queueing redraws.
2012-01-27 11:48:14 +00:00
Emmanuele Bassi
12a79a66d8 drag-action: Use the symbolic constants for the button
https://bugzilla.gnome.org/show_bug.cgi?id=668692
2012-01-27 09:46:10 +00:00
Emmanuele Bassi
60cddbd28e event: Add symbolic names for left, middle, and right buttons
Symbolic names are better than magic numbers, even if they are
well-established and won't likely change.

This maps to a commit in GTK+ that introduced the same names; it
was decided to go for PRIMARY, MIDDLE, and SECONDARY because of
the confusion that may arise when the button order gets flipped
in left-handed configurations - the "left" button (i.e. 1) becomes
the right-most button, and the "right" button (i.e. 3) becomes
the left-most button.

https://bugzilla.gnome.org/show_bug.cgi?id=668692
2012-01-27 09:43:06 +00:00
Emmanuele Bassi
bacd4dd6a0 Remove unused variable 2012-01-26 18:11:49 +00:00
Rob Bradford
78533cfd1a wayland: Correctly support fullscreening before the stage is realized
Rather than just call into wl_shell_surface_set_fullscreen we must repeat all
the steps to correctly fullscreen the surface.
2012-01-26 15:39:16 +00:00
Rob Bradford
797336762e wayland: Force a redraw of the stage to get the new sized buffer attached 2012-01-26 14:41:27 +00:00
Rob Bradford
65e27a830b wayland: Use new stage state manipulation functions 2012-01-26 14:40:29 +00:00
Rob Bradford
0094350467 wayland: Refine fullscreen/unfullscreen to emit the state change events
Also update the code to set the size of the stage to set it to the size of the
output. In future versions of the Wayland protocol we'll get a configure
message advising of us of the size we can be to achieve fullscreen.
2012-01-26 14:14:13 +00:00
Rob Bradford
dd64ad1e42 wayland: Support programmatically resizing the stage
This will call into Cogl and ask it to resize the framebuffer which will then
update the underlying EGL surface.
2012-01-26 14:14:13 +00:00
Rob Bradford
838fc6276f wayland: Support setting fullscreen before the stage is realized 2012-01-26 14:14:13 +00:00
Rob Bradford
da19c3dfca wayland: Implement set_fullscreen vfunc in ClutterStageWayland 2012-01-26 14:14:13 +00:00
Rob Bradford
cb4b9d758f wayland: Include the Wayland surface and shell surface in ClutterStageWayland 2012-01-26 14:14:13 +00:00
Rob Bradford
737c5e1045 wayland: Save the output mode so that it can be used to fullscreen windows 2012-01-26 14:13:23 +00:00
Emmanuele Bassi
3780e3e4f0 x11: Unbreak the build
The stage wrapper is on the ClutterStageCogl instance.
2012-01-26 10:29:50 +00:00
Emmanuele Bassi
fdf89a9e06 Merge branch 'stage-state'
* stage-state:
  docs: Update ClutterStageState flags
  wayland: Use the Stage state tracking
  gdk: Use the Stage state tracking
  win32: Use the Stage state tracking
  x11: Use the Stage state tracking
  osx: Use the Stage state tracking
  stage: Add state tracking
2012-01-26 08:42:00 +00:00
Emmanuele Bassi
9dab33401f docs: Update ClutterStageState flags 2012-01-26 08:33:45 +00:00
Emmanuele Bassi
2b547442a3 wayland: Use the Stage state tracking 2012-01-26 08:31:11 +00:00
Emmanuele Bassi
8c184f53cb gdk: Use the Stage state tracking 2012-01-26 08:31:11 +00:00
Emmanuele Bassi
e73c2bf4ea win32: Use the Stage state tracking 2012-01-26 08:31:10 +00:00
Emmanuele Bassi
12e4f300a7 x11: Use the Stage state tracking 2012-01-26 08:31:10 +00:00
Emmanuele Bassi
2c9a693c14 osx: Use the Stage state tracking 2012-01-26 08:30:58 +00:00
Emmanuele Bassi
19ff11ac93 stage: Add state tracking
State changes on the Stage are currently deferred to the windowing
system backends, but the code is generally the same, and it should
be abstracted neatly inside the Stage class itself.

There's also the extra caveat for backends that state changes on a
Stage must also emit a ClutterEvent of type CLUTTER_STAGE_STATE, a
requirement that needlessly complicates the backend code.
2012-01-26 08:30:47 +00:00
Emmanuele Bassi
71323b8bfc x11/stage: Use symbolic constants for source function
And make sure to use the clutter_threads_add_timeout(), so that the
function is called under the Clutter lock.
2012-01-25 23:20:24 +00:00
Emmanuele Bassi
75549456fd actor: use paint opacity to paint the background color 2012-01-24 14:52:33 +00:00
Emmanuele Bassi
825e1e6242 docs: Inlined examples break enums gtk-doc 2012-01-24 14:13:53 +00:00
Emmanuele Bassi
8d8d4ae7e5 script: Add loading from a resource
GLib has gained support for compiling ancillary data files into the same
binary blob as a library or as an executable.

We should add this feature to ClutterScript, so that it's possible to
bundle UI definitions with an application.
2012-01-24 12:04:56 +00:00
Emmanuele Bassi
254ebd8765 actor: Remove unused function 2012-01-24 09:36:31 +00:00
Emmanuele Bassi
4330f45d05 Override Container inside ClutterStage
The only actor that results in a mix of the old Container API and the
new Actor API is ClutterStage. By inheritance, a Stage is a Group, but
we don't want it to behave like a Group - as it already overrides most
of the Actor API, and the reason why it was made as a Group in the
first place was convenience for adding/removing children.

Given that touching Group to make it aware of the new Actor API has
rapidly devolved into a struggle between a Demiurge that tries to
avoid breakage and a Chaos that finds new and interesting ways to
break ClutterGroup, let's declare API bankruptcy here and now.

ClutterStage should override ClutterContainer methods, and use the
layout management of ClutterFixedLayout as the proper class that it
was meant to be ages ago. Let ClutterGroup rot in pieces.
2012-01-23 20:54:07 +00:00
Emmanuele Bassi
cfac97ffe1 Allow mixing old and new API without falling apart
Now that we reinstated Group to its "former glory", we need to ensure
that applications using the deprecated containers with the new DOM API
in ClutterActor can actually work - or, at least, not break horribly.

This actually means making sure that ClutterStage and ClutterGroup can
cope with the DOM, while retaining their old implementations, as well as
their bizarre idiosyncrasies and their utter, utter brokenness.
2012-01-23 20:54:06 +00:00
Emmanuele Bassi
29384c114f actor: NULL-ify sibling fields when removing
Let's try and avoid leaving around stale pointers.
2012-01-20 17:19:42 +00:00
Rob Bradford
27784de941 wayland: Update to changes in the SHM api
The enum value for the SHM formats has changed to be more explicit about the
format of the data.
2012-01-20 16:15:08 +00:00
Emmanuele Bassi
7d7d753a49 group: Restore previous implementation
Making Group just a proxy to Actor broke some behaviour that application
and toolkit code was relying on. Let's keep Group around to fight
another day.

This commit fixes gnome-shell as far as I can test it.
2012-01-20 16:01:13 +00:00
Emmanuele Bassi
3ff502fbb2 stage: Restore the chain up inside allocate()
Group does not have a custom allocate() any more, so it would end up
calling the default allocate() implementation provided by ClutterActor
anyway.
2012-01-20 14:55:57 +00:00
Emmanuele Bassi
8ebf46d74c actor: Remove default layout-manager
It's creating more issues than what it's trying to solve. At least for
the time being, let's not set one.
2012-01-20 14:55:13 +00:00
Emmanuele Bassi
bd348625c7 group: Gut the implementation
A Group is a just a ClutterActor with the layout-manager property set at
instance initialization time. It doesn't need anything else from
ClutterActor's vtable, except the slightly custom show_all/hide_all
implementation, and a simplified get_paint_volume.
2012-01-20 14:53:41 +00:00
Emmanuele Bassi
1afd3827c7 actor: Move underallocation warning to diagnostic mode
This should keep down the warning messages — at least for the time
being.
2012-01-20 12:04:48 +00:00
Emmanuele Bassi
c760657903 actor: Use internal add/remove child in reparent()
Do not use the public API; reparent() used to use unparent() and
set_parent(), so we need to maintain the old behaviour.
2012-01-20 12:02:49 +00:00
Emmanuele Bassi
480514b721 stage: Use clutter_actor_set_allocation()
Instead of chaining up, given that we want to bypass chaining up and
just set the allocation. This also allows us to bail out of the
overridden allocate vfunc check, given that we want the default Actor
behaviour to apply - including eventual layout manager delegates.
2012-01-19 13:44:38 +00:00
Emmanuele Bassi
f7bae2a064 actor: Fix the has_overridden_allocate check 2012-01-19 13:39:14 +00:00
Emmanuele Bassi
b206a3d025 symbols: Add clutter_actor_set_allocation() 2012-01-19 13:14:33 +00:00
Emmanuele Bassi
67eeea6b62 actor: Maintain behaviour of old allocate() implementations
The usual way to implement a container actor is to override the
allocate() virtual function, chain up, and then allocate the actor's
children.

Clutter now has the ability to delegate layout management to
ClutterLayoutManager directly; in the allocation, this is done by
checking whether the actor has children, and then call
clutter_layout_manager_allocate() from within the default implementation
of the ClutterActor::allocate() vfunc. The same vfunc that everyone, has
been chaining up to.

Whoopsie.

Well, we can check if there's a layout manager, and if it's NULL, we
bail out. Except that there's a default layout manager, and it's the
fixed layout manager, so that classes like Group and Stage work by
default.

Double whoopsie.

The fix for this scenario is a bit nasty; we have to check if the actor
class has overridden the allocate() vfunc or not, before actually
looking at the layout manager. This means that classes that override the
allocate() vfunc are expected to do everything that ClutterActor's
default implementation does - which I think it's a fair requirement to
have.

For newly written code, though, it would probably be best if we just
provided a function that does the right thing by default, and that
you're supposed to be calling from within the allocate() vfunc
implementation, if you ever chose to override it. This new function,
clutter_actor_set_allocation(), should come with a warning the size of
Texas, to avoid people thinking it's a way to override the whole "call
allocate() on each child" mechanism. Plus, it should check if we're
inside an allocation sequence, and bail out if not.
2012-01-19 12:40:32 +00:00
Emmanuele Bassi
70679dc68c actor: Be more conservative with the default paint volume
Check the allocation, when one is being used to initialize the paint
volume.
2012-01-18 16:05:12 +00:00
Emmanuele Bassi
f7d9eab36d actor: Add :first-child and :last-child properties
Toolkits tracking first and last children of a ClutterActor can use
these properties to get notification of hierarchy changes.
2012-01-17 18:46:41 +00:00
Emmanuele Bassi
bb8abe832e actor: Do not use ::constructed
If we want to set a default layout manager, we need to do so inside
init(), as it's not guaranteed that people subclassing Actor and
overriding ::constructed will actually chain up as they should.
2012-01-17 18:13:42 +00:00
Emmanuele Bassi
629ded568e actor: Provide a better default pick() behaviour
The default pick() behaviour does not take into consideration the
children of a ClutterActor because the existing containter actors
usually override pick(), chain up, and then paint their children.

With ClutterActor now a concrete class, though, we need a way to pick
its children without requiring a sub-class; we could simply iterate over
the children inside the default pick() implementation, but this would
lead to double painting, which is not acceptable.

A moderately gross hack is to check if the Actor instance did override
the pick() implementation, and if it is not the case, paint the children
in pick mode.
2012-01-17 16:21:54 +00:00
Emmanuele Bassi
0f39f20db6 actor: Deprecate show_all()/hide_all()
The hide_all() method is pretty much pointless, as hiding an actor will
automatically prevent its children from being painted. The show_all()
method would only be marginally useful, if actors weren't set to be
visible by default when added to another actor - which was the case when
we introduced show_all() and hide_all().
2012-01-17 16:21:54 +00:00
Emmanuele Bassi
696f9e84c9 text: Fix the buffer length check on paint 2012-01-17 14:29:45 +00:00
Emmanuele Bassi
9f0ba2da0f script: Fix a segfault
Accessing a variable before it is being set is not a great plan.
2012-01-17 14:29:45 +00:00
Emmanuele Bassi
37d94c6b87 text-buffer: Fix the Since annotations 2012-01-17 14:29:45 +00:00
Emmanuele Bassi
5085c11bde Add ClutterTextBuffer to the API reference 2012-01-17 14:29:45 +00:00
Emmanuele Bassi
57f5813058 Update clutter.symbols for TextBuffer 2012-01-17 14:29:45 +00:00
Stef Walter
c073764369 text: Implement ClutterTextBuffer
* Abstracts the buffer for text in ClutterText
 * Allows implementation of undo/redo.
 * Allows use of non-pageable memory for text
   in the case of sensitive passwords.
 * Implement a test with two ClutterText using the same
   buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=652653
2012-01-17 14:29:44 +00:00
Emmanuele Bassi
6b5b291029 Update clutter.symbols 2012-01-17 11:49:05 +00:00
Emmanuele Bassi
1dfc503df1 Fix compiler warnings
When dereferencing GArray.data to a C structure you need a double cast
from guint8* to void*, and then from void* to the actual type. This
avoids compiler warnings, especially when using clang on OSX.
2012-01-16 23:49:49 +00:00
Emmanuele Bassi
f41061b8df actor: Deprecated push/pop internal methods
The concept of "internal child" only meant anything when we had a
separate API for containers and actors. Now that we plugged that
particular hole, we can drop all the hacks we used to have in place
to work around its design limitations.
2012-01-16 23:37:14 +00:00
Emmanuele Bassi
ad2cfc0150 docs: Fixes for the API reference 2012-01-16 23:37:14 +00:00
Emmanuele Bassi
ea6ddd1534 actor: Add boxed margin accessors
It can be convenient to be able to set, or get, all the components of an
actor's margin at the same time; since we already have a boxed type for
storing a margin, an accessors pair based on it is not a complicated
addition to the API.
2012-01-16 23:37:14 +00:00
Emmanuele Bassi
25ca2f135c build: Add inclusion guards and license notices 2012-01-16 23:37:14 +00:00
Emmanuele Bassi
6f4578838c actor: Use proper internal API
Inside the set_child_[above|below]_sibling() and set_child_at_index() we
should be using the internal API for mutating the children list, instead
of the delegate functions. This ensures that we go through a single,
well-defined code path for all operations on the list of children of
an actor.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
b835e1f8c4 Deprecate the old raise/lower API
We have a replacement in ClutterActor, now.

The old ClutterContainer API needs to be deprecated, and the raise() and
lower() virtual functions need a default implementation, so we can check
for implementations overriding them, by using the diagnostic mode like
we do for add(), remove(), and foreach().

The sort_depth_order() virtual function just doesn't do anything, as it
should have been made ages ago.

The Actor wrappers for the Container methods also need to be deprecated.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
9a66392d49 actor: Add new methods for changing the paint sequence
ClutterActor provides four methods for changing the paint sequence order
of its children:

  raise_top()
  raise()
  lower()
  lower_bottom()

The first and last one being just wrappers around raise() and lower(),
respectively. These methods have various issues: they omit the parent,
preferring to retrieve it from the actor passed as the first argument;
this does not match the new style of API introduced to operate on the
list of children of an actor.

Additionally, the raise() and lower() methods of ClutterActor call into
the Container interface, and are not really aptly named (raise() in
particular collides with the completely unrelated 'raise' keyword in
Python, and usually needs to be wrapped in order to be used at all).

Furthermore, we need public methods that Container can call from its
default implementation, as well as methods to port current Container
implementations.

Finally, since we have insert_child_at_index(), we should also have an
equivalent set_child_at_index() as well.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
fa1792c394 actor: Use flags to control add/remove child
The internal versions of add_child() and remove_child() currently use
boolean arguments to control things like the ChildMeta instances and
the emissions of signals; using more than one boolean argument is an
indication that you need flags to avoid readability issues, as well as
providing a way to add new behaviours without a combinatorial explosion
of arguments, later on.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
72fa75c034 actor: Remove automagic "expand" flag
I don't feel comfortable with this feature, and its implementation
still has too many rough edges. We can safely punt it for now, and
introduce it at a later point, as it doesn't block existing features
or API.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
72b523c9e9 table-layout: Override compute_expand()
The TableLayout has two expansion flags that need to be taken into
consideration when computing the Actor expansion flags.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
5f79f6ee37 box-layout: Override compute_expand()
ClutterBoxLayout has an expansion flag, and we need to take that into
consideration when computing the Actor expansion flags.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
508f09f0a0 actor: Ask the LayoutManager to compute the expansion flags
If an actor has a layout manager, we want to involve the delegate object
into the lazy computation of the expansion flags state.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
2956116561 layout-manager: Add compute_expand() vfunc
This virtual function will let layout managers with legacy expansion
flags be able to influence the lazy computation of the expansion flags
on ClutterActor.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
fd5e422b9f actor: Paint the background color in the paint class handler
We need to paint the background color in the default class handler for
two reasons: it's logically appropriate, and we don't want actor
subclasses overriding the ::paint class handler to change behaviour only
because somebody decided to set the background color.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
e6082fe42f docs: Clean up ClutterContainer's description
The API to add/remove/iterate over children is in ClutterActor, now.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
7f092af15b container: Add diagnostic warnings for deprecated vfuncs
The old add(), remove(), and foreach() virtual functions are deprecated;
ClutterContainer should warn if the public API detects that the vfuncs
have been overridden.

Strictly speaking, it's still legal to override those vfuncs: you can
chain up to the default vtable, or you could just provide an equivalent
implementation. The goal is to avoid having to override the Container
interface, until we can safely deprecate it and remove it in Clutter
2.0.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
477c60c185 container: Provide default implementation of vfuncs
Instead of making ClutterActor implement the basic add/remove/foreach
virtual functions of ClutterContainer, we can simply do that from
within the ClutterContainer implementation.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
959f875cbc container: Deprecate more methods
The get_children(), foreach(), and foreach_with_internals() methods and
virtual functions are superceded by the Actor API, and should not be
used in newly written code.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
4eaa899871 group: Use Actor.remove_all_children()
To implement the remove_all() method.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
1979faee00 cally: Use Actor.get_children()
Instead of the Container method, given that the new get_children() gives
us more actors by default.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
425ead5bd7 actor: Add some debug spew 2012-01-16 23:37:12 +00:00
Emmanuele Bassi
86152f478d docs: Update the Actor API reference
Given the size and scope of the changes in ClutterActor, we ought to
rewrite the overall description of what an actor is, what it does, and
how are you supposed to use it and subclass it.
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
5959099473 Deprecate Container add() and remove() methods
This will make things interesting.

We have better replacements in ClutterActor, that do The Right Thing™
instead of deferring control and requiring reimplementation in every
single container actor.
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
f61916fc5e actor: Add remove_all_children()
A simple method for removing all children of an actor in one fell swoop.
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
673961f40c docs: Clarify the Actor's iterator API behaviour
It should be noted in the documentation that it is not safe to operate
on the list of children of an Actor while iterating over it.
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
4f470b9231 actor: Provide a proper implementation of replace_child()
The correct sequence of actions should be remove(old) → insert(new), not
insert(new) → remove(old). We can implement a simple delegate insertion
functions to insert the new child between the previous and next siblings
of the old child.

While we're at it, let's also add a unit test for replace_child().
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
5cba801207 actor: Fix get_paint_volume() default implementation
Providing a default get_paint_volume() that takes into account the
children of an actor was a goal of the whole First Apocalypse; if we
make all the containers rely on it, and yet we return a FALSE value
(meaning: we don't have a valid paint volume) even when we do have it,
then we are going to break the whole machinery, though.
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
3ad77b417c stage: Use the Actor iteration API 2012-01-16 23:37:11 +00:00
Emmanuele Bassi
aa9e2a382c Remove usage of Actor/Container.get_children()
ClutterBox and ClutterGroup are still using the get_children() method
instead of the child iteration API.
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
62535bdc73 actor: Simplify first/last child updates 2012-01-16 23:37:11 +00:00
Emmanuele Bassi
ab429f4f45 Drop some more ClutterContainer.get_children() uses 2012-01-16 23:37:10 +00:00
Emmanuele Bassi
ec6873958b fixed-layout: Use the Actor iteration API
Forgot to migrate the FixedLayout layout manager like we did for the
other layout managers provided by Clutter.
2012-01-16 23:37:10 +00:00
Emmanuele Bassi
4d75e7a0f4 cally: Use the Actor API instead of ClutterContainer
Cally is doing a bunch of list traversals through the list returned by
ClutterContainer.get_children(); this means a traversal already, plus
a bunch of allocations. We can do better than that, now that we have
a proper graph iteration API inside ClutterActor.
2012-01-16 23:37:10 +00:00
Emmanuele Bassi
bd58694678 actor: Add replace_child() method
A simple method that atomically replaces a child actor with another one.
2012-01-16 23:37:10 +00:00
Emmanuele Bassi
238a6eb03d actor: Deprecate the old parent modifiers
The old API should not be used in newly written code; we have better
methods for setting up and modifying the scene graph, now.
2012-01-16 23:37:10 +00:00
Emmanuele Bassi
813eef4325 actor: Fix child insertion issues
The insert_child_at_index, insert_below and insert_above messed up the
first and last child pointers in various cases. This commit fixes all
the instances of first and last child pointers being stale or set to
NULL.
2012-01-16 23:37:10 +00:00
Emmanuele Bassi
7e377b5aee Port remaining layout managers to the new child iteration API
TableLayout and FlowLayout now use the ClutterActor API for iterating
over the children of an actor.
2012-01-16 23:37:09 +00:00
Emmanuele Bassi
9c9ab42060 Begin porting layout managers to the new child iteration API
Instead of getting the list of children to iterate over it, let's use
the newly added child iteration API; this should save us a bunch of
allocations, as well as indirections.

Ported: ClutterBinLayout and ClutterBoxLayout.
2012-01-16 23:37:09 +00:00
Emmanuele Bassi
8b430507b5 actor: Add children iteration methods
Instead of requiring every consumer of the ClutterActor API that wishes
to iterate over the children of an actor to use the get_children()
method, we should provide an iteration API directly inside ClutterActor
itself.
2012-01-16 23:37:09 +00:00
Emmanuele Bassi
22259e0965 actor: Define the scene structure inside Actor
Instead of storing the list of children, let's turn Actor inside a
proper node of a tree.

This change adds the following members to the Actor private data
structure:

  first_child
  last_child
  prev_sibling
  next_sibling

and removes the "children" GList from it; iteration is performed through
the direct pointers to the siblings and children.

This change makes removal, insertion before a sibling, and insertion
after a sibling constant time operations, but it still retains the
feature of ClutterActor.add_child() to build the list of children while
taking into account the depth set on the newly added child, to allow the
default painter's algorithm we employ inside the paint() implementation
to at least try and cope with the :depth property (albeit in a fairly
naïve way). Changes in the :depth property will not change the paint
sequence any more: this functionality will be restored later.
2012-01-16 23:37:09 +00:00
Emmanuele Bassi
71545ae56f actor: Use a cairo_rectangle_t instead of a ridiculous array
Make the code maintainable and readable.
2012-01-16 23:35:17 +00:00
Emmanuele Bassi
ea7111333b actor: Document fields of ClutterActorPrivate
The private data structure members could do with more comments
documenting what they do.
2012-01-16 23:35:17 +00:00
Emmanuele Bassi
9eed2f58a6 actor: Add TransformInfo
ClutterTransformInfo is a (private) ancillary data structure that
contains all the decomposed transformation data, i.e. rotation angles
and centers, scale factors and centers, and anchor point. This data
structure is stored in the GData of the actor instance instead of the
actor's private data. This change gives us:

  • a smaller, cleaner private data structure;
  • no size penalty for untransformed actors;
  • static constant storage for the defaults, shared across all
    instances;
  • cache locality for all the decomposed transformation data,
    given that the structure size is smaller.

At the end of the day, the only authoritative piece of information for
actor transformation is the CoglMatrix that we initialize in
apply_transform() from all the decomposed parameters, and that can stay
inside the private data structure of ClutterActor.
2012-01-16 23:35:17 +00:00
Emmanuele Bassi
376bf4a990 actor: Tweak the underallocation warning
There are only two kinds of actors that allow underallocations,
according to the API contract:

  • ClutterStage, as it is a viewport and it doesn't have an implicit
    minimum size;

  • Actors using the CLUTTER_ACTOR_NO_LAYOUT escape hatch, which allows
    them to bail out from our layout management policies.

The warning about underallocations should take these two exceptions
under consideration.
2012-01-16 23:35:17 +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
6237eb7892 Deprecate ClutterGroup
The Group functionality is now provided by ClutterActor.

Sadly, we need to keep the ClutterGroup structure definition in the
non-deprecated header because ClutterStage inherits from Group - an API
wart that was never fixed during the 0.x cycles, and that we'll have to
keep around until we can break API.
2012-01-16 23:35:16 +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
a6df0b6a53 cally: Do not use Group API
Avoids a deprecation warning.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
7fd35edd3f actor: Make Actor instantiatable
ClutterActor now has all the API and capabilities for being a concrete
class:

  - layout management, through delegation
  - container implementation and API
  - background color

This means that a simple scene can be built straight out of actors
without using subclasses except for the Stage.

This is the first step towards the deprecation of most of the Actor
subclasses provided by Clutter.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
8caee3e97e group: Proxy last few methods to Actor
At this point, ClutterGroup is basically just a shim layer on top of
ClutterActor.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
4acf8de8b4 actor: Provide more children methods
Add a getter for the number of children, as well as a method to retrieve
the child at a given index.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
b86cf3e2f3 group: Use the default get_paint_volume()
ClutterActor does everything we did, and more.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
e62536fad6 actor: Provide a better get_paint_volume() implementation
ClutterActor can do better by default than just giving up immediately.

An actor can check for the clip region, and for its children's paint
volume, for instance.

Just these two should give us a better default implementation for newly
written code.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
7195d0fccf flow-layout: Fix minimum size request
The minimum preferred size of a Flow layout manager is the size of a
column or a row, as the whole point of the layout policy enforced by
the Flow layout manager is to reflow when needed.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
ba093ed5e7 box: Proxy the Actor's background color properties
ClutterBox's color and color-set properties can be implemented as
proxies for the ClutterActor's newly added background-color and
background-color-set properties, respectively.

This also allows us to get rid of the paint() implementation inside
ClutterBox altogether.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
98a8feae64 actor: Background color
Each actor should have a background color property, disabled by default.

This property allows us to cover 99% of the use cases for
ClutterRectangle, and brings us one step closer to being able to
instantiate ClutterActor directly.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
7d88a70b78 actor: Cosmetic fixes to internal add/remove child
Avoid code duplication all over the place.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
3f877a3d71 group: Use the default paint() implementation
ClutterActor's paint implementation is perfectly fine for ClutterGroup:
it paints the actor's children, which is exactly what ClutteGroup does.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
798a2e5297 actor: Minor cosmetic fixes to the header 2012-01-16 23:35:15 +00:00
Emmanuele Bassi
b869019eb2 group: Do not override Container
Let ClutterActor do all the work.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
ef3dc2d1ba actor: Make Actor.add_child and Container.add_actor idempotent
And make sure that overriding Container and calling
clutter_actor_add_child() will result in the same sequence of operations
as the current set_parent()+queue_relayout()+signal_emit pattern.

Existing containers can continue using:

        clutter_actor_set_parent (child, CLUTTER_ACTOR (container));
        clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
        g_signal_emit_by_name (container, "actor-added", child);

and newly written containers overriding Container.add() can simply call:

        clutter_actor_add_child (CLUTTER_ACTOR (container), child);

instead.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
2894587b22 actor: Do not leak the layout manager 2012-01-16 23:35:15 +00:00
Emmanuele Bassi
038aadfa72 box: Drop Container interface overrides
And defer as much as possible to ClutterActor's default implementation
for basically everything.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
b773785533 actor: Implement Container::sort_depth_order
There's no reason this vfunc should be left out.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
86ec629776 actor: Add child insertion methods
We should allow inserting children at given indices, and at given
stacking positions (relative or not to other children).
2012-01-16 23:35:14 +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
9d9e98968f actor: More cleanups to the Private data structure
Try to document it properly. We can also remove some things that are
properly encapsulated through functions, like the redraw clip volume.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
9132769767 actor: Store the fixed sizes into LayoutInfo
Remove four more floats from ClutterActorPrivate.

The fixed minimum and natural sizes should be stored inside the
ClutterLayoutInfo structure, along with the fixed position.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
b4d3b52b62 actor: Update the underallocations check
Add a failsafe against a NULL parent, to avoid a segfault when calling
clutter_actor_allocate() on the Stage.

We also need to deal with floating point values: straight comparison is
not going to cut it.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
409c3ed8ff actor: Adjust the allocation prior to call allocate()
ClutterActor has various properties controlling the allocation:

  - x-align, y-align
  - margin-top, margin-bottom, margin-left, margin-right

These properties should adjust the ClutterActorBox passed from the
parent actor to its children when calling clutter_actor_allocate(),
so that the child can just allocate its children at the right origin
with the right available size.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
a85c53ea0b actor: Clean up property installation 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
c8659b6ca5 actor: Add [xy]-align
Allow an actor to define how it should occupy the extra space given to
by its parent during the allocation.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
4453ee7266 actor: Provide Container::raise/lower implementations 2012-01-16 23:35:13 +00:00
Emmanuele Bassi
752151bc97 actor: Remove is-a(Container) checks
All actors are now Container implementations, so there's no need to add
a type check.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
f2609dcca4 actor: Add [xy]-expand properties 2012-01-16 23:35:13 +00:00
Emmanuele Bassi
d5086da3fd box: Defer to ClutterActor
Use the default implementation inside ClutterActor instead of our own,
wherever possible.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
1c40151d0e actor: Default to a fixed layout manager
In case no layout manager was set during construction, we fall back to a
FixedLayout. The FixedLayout has the property of making the fixed
positioning and sizing API, as well as the various Constraints, work
out of the box.
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
b45d78e6a1 actor: Provide a default Container implementation
We can provide most of the ClutterContainer implementation directly
within ClutterActor — basically removing the need of having the
Container interface in the first place. For backward compatibility
reasons we can keep the interface, but let Actor implement it directly.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
8462b5ba45 Do not use set_parent()/unparent() internally
Use add_child()/remove_child() instead.
2012-01-16 23:35:13 +00:00
Emmanuele Bassi
53aa64aeb9 actor: Provide add/remove child and get children methods
Let's try and move away from the reverse implicit scene graph build API,
which we mutuated from GTK+, towards a more traditional node/child API.

The set_parent()/unparent() API is confusing, unless you know the
history; having a add_child()/remove_child() methods pair makes it more
explicit.

We can easily implement the old set_parent()/unparent() pair in terms of
the newly add_child()/remove_child() one.
2012-01-16 23:35:13 +00:00
Neil Roberts
0396d3e7e6 Remove use of CoglVector3
Cogl has removed the CoglVector3 type in favour of directly using an
array of 3 floats.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-16 21:06:19 +00:00
Emmanuele Bassi
7c14ba7d37 actor: Clean up the debug node for out-of-band transforms
Enclose the check inside a #ifdef CLUTTER_ENABLE_DEBUG ... #endif, so
that we can compile it out; also, use g_string_append() instead of the
g_string_append_printf() function, given that we're just concatenating
strings.
2012-01-16 11:04:44 +00:00
Emmanuele Bassi
646cf236a5 backend: Remove ClutterBackend::redraw
The ::redraw virtual function was a throwback from olden times, and has
been thoroughly replaced by the equivalent vfunc on the StageWindow
interface. We can safely remove it, now, and simplify the flow of the
redraw code inside ClutterStage.
2012-01-12 13:35:09 +00:00
Emmanuele Bassi
0c365f9f4c gesture-action: Protect against NULL pointers 2012-01-12 10:49:16 +00:00