Commit Graph

5314 Commits

Author SHA1 Message Date
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