Florian Müllner [Thu, 9 Feb 2012 01:13:50 +0000 (02:13 +0100)]
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
Мирослав Николић [Wed, 8 Feb 2012 20:40:54 +0000 (21:40 +0100)]
Updated Serbian translation
Emmanuele Bassi [Tue, 7 Feb 2012 11:36:27 +0000 (11:36 +0000)]
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.
Emmanuele Bassi [Tue, 7 Feb 2012 11:33:12 +0000 (11:33 +0000)]
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.
Emmanuele Bassi [Tue, 7 Feb 2012 11:31:28 +0000 (11:31 +0000)]
text: Style cleanups
Inline wrapper functions, and remove deep nested if's.
Emmanuele Bassi [Tue, 7 Feb 2012 11:30:43 +0000 (11:30 +0000)]
interactive/text-field: Modernize
Emmanuele Bassi [Mon, 6 Feb 2012 18:23:21 +0000 (18:23 +0000)]
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.
Emmanuele Bassi [Mon, 6 Feb 2012 17:34:26 +0000 (17:34 +0000)]
docs: Fix up Since annotation
We only use stable releases for "since" tags.
Emmanuele Bassi [Mon, 6 Feb 2012 16:45:15 +0000 (16:45 +0000)]
Post-release version bump to 1.9.11
Emmanuele Bassi [Mon, 6 Feb 2012 16:40:00 +0000 (16:40 +0000)]
Release 1.9.10 (snapshot)
Emmanuele Bassi [Mon, 6 Feb 2012 16:34:18 +0000 (16:34 +0000)]
docs: Update release notes
Tristan Van Berkom [Sun, 29 Jan 2012 12:29:38 +0000 (21:29 +0900)]
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
Tristan Van Berkom [Sat, 4 Feb 2012 13:43:51 +0000 (22:43 +0900)]
Fix Makefile to properly include clutter-backend-eglnative.h in the disted tarball
https://bugzilla.gnome.org/show_bug.cgi?id=669360
Emmanuele Bassi [Mon, 6 Feb 2012 15:34:13 +0000 (15:34 +0000)]
model: Drop GValueArray usage
We can use a plain C array of GValues when deserializing a ClutterModel
implementation from a ClutterScript description.
Emmanuele Bassi [Mon, 6 Feb 2012 14:37:49 +0000 (14:37 +0000)]
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.
Emmanuele Bassi [Sun, 5 Feb 2012 08:47:17 +0000 (08:47 +0000)]
Clean up clutter-actor.h
It's time, we delayed far too long.
Emmanuele Bassi [Thu, 2 Feb 2012 14:07:38 +0000 (14:07 +0000)]
interactive/actor: Show event and animation API
Emmanuele Bassi [Thu, 2 Feb 2012 11:18:00 +0000 (11:18 +0000)]
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.
Emmanuele Bassi [Thu, 2 Feb 2012 11:07:14 +0000 (11:07 +0000)]
docs: Update the actor invariants
• Clear up what's deprecated.
• Remove mentions of set_parent/unparent, and use add_child/remove_child
instead.
• Clarify that reparent may not touch the MAPPED state.
Evan Nemerson [Fri, 13 Jan 2012 02:15:55 +0000 (18:15 -0800)]
introspection: add some missing annotations
https://bugzilla.gnome.org/show_bug.cgi?id=667840
Emmanuele Bassi [Tue, 31 Jan 2012 17:03:14 +0000 (17:03 +0000)]
Clean up the clutter API reference Makefile.am
Emmanuele Bassi [Tue, 31 Jan 2012 16:44:43 +0000 (16:44 +0000)]
docs: Add an image for the XIncluded code
Emmanuele Bassi [Tue, 31 Jan 2012 16:44:07 +0000 (16:44 +0000)]
docs: Add private macro CLUTTER_PRIVATE_FIELD
Emmanuele Bassi [Tue, 31 Jan 2012 16:32:48 +0000 (16:32 +0000)]
docs: XInclude test-actor inside the Actor's description
Emmanuele Bassi [Tue, 31 Jan 2012 16:30:05 +0000 (16:30 +0000)]
docs: Add an example to the Actor description
Emmanuele Bassi [Tue, 31 Jan 2012 12:45:08 +0000 (12:45 +0000)]
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.
Emmanuele Bassi [Tue, 31 Jan 2012 12:35:17 +0000 (12:35 +0000)]
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.
Emmanuele Bassi [Sun, 18 Dec 2011 22:52:49 +0000 (22:52 +0000)]
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.
Emmanuele Bassi [Tue, 31 Jan 2012 10:34:45 +0000 (10:34 +0000)]
x11: Remove CLUTTER_DISABLE_DEPRECATED usage
Switch to CLUTTER_DEPRECATED and CLUTTER_DEPRECATED_FOR.
Emmanuele Bassi [Tue, 31 Jan 2012 10:28:04 +0000 (10:28 +0000)]
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.
Emmanuele Bassi [Tue, 31 Jan 2012 10:23:48 +0000 (10:23 +0000)]
texture: It's bytes per pixel, not bits
Clarify the error message when checking the bpp argument.
Emmanuele Bassi [Mon, 30 Jan 2012 10:55:30 +0000 (10:55 +0000)]
Use ClutterActorIter inside layout managers
Whenever it is possible, or convenient.
Chao-Hsiung Liao [Sun, 29 Jan 2012 14:52:55 +0000 (22:52 +0800)]
Updated Traditional Chinese translation(Hong Kong and Taiwan)
Matej Urbančič [Sat, 28 Jan 2012 19:59:17 +0000 (20:59 +0100)]
Updated Slovenian translation
Emmanuele Bassi [Fri, 27 Jan 2012 17:07:33 +0000 (17:07 +0000)]
docs: Mention the DELEGATE_LAYOUT flag in set_allocation()
With code examples.
Emmanuele Bassi [Fri, 27 Jan 2012 15:48:46 +0000 (15:48 +0000)]
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.
Emmanuele Bassi [Fri, 27 Jan 2012 15:45:11 +0000 (15:45 +0000)]
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.
Kerrick Staley [Thu, 29 Dec 2011 09:15:05 +0000 (03:15 -0600)]
Fix spelling in Clutter Cookbook: ouest -> west
Emmanuele Bassi [Thu, 26 Jan 2012 17:10:18 +0000 (17:10 +0000)]
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
Emmanuele Bassi [Wed, 25 Jan 2012 15:31:51 +0000 (15:31 +0000)]
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
Emmanuele Bassi [Wed, 25 Jan 2012 15:27:57 +0000 (15:27 +0000)]
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
Emmanuele Bassi [Fri, 27 Jan 2012 11:48:14 +0000 (11:48 +0000)]
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.
Emmanuele Bassi [Fri, 27 Jan 2012 11:42:33 +0000 (11:42 +0000)]
conform: Avoid a deadlock
Something is causing a deadlock when using clutter_threads_* API inside
the offscreen redirect conformance test. The conformance tests are
pretty insane anyway, so for the time being, let's put g_timeout_add()
back in while we figure out the issue.
Emmanuele Bassi [Fri, 27 Jan 2012 09:47:25 +0000 (09:47 +0000)]
tests: Update to use the symbolic button names
https://bugzilla.gnome.org/show_bug.cgi?id=668692
Emmanuele Bassi [Fri, 27 Jan 2012 09:46:51 +0000 (09:46 +0000)]
docs: Update to show the symbolic button names
https://bugzilla.gnome.org/show_bug.cgi?id=668692
Emmanuele Bassi [Fri, 27 Jan 2012 09:46:10 +0000 (09:46 +0000)]
drag-action: Use the symbolic constants for the button
https://bugzilla.gnome.org/show_bug.cgi?id=668692
Emmanuele Bassi [Fri, 27 Jan 2012 09:43:06 +0000 (09:43 +0000)]
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
Emmanuele Bassi [Fri, 27 Jan 2012 07:30:02 +0000 (07:30 +0000)]
doc/cookbook: Remove dead link
Emmanuele Bassi [Thu, 26 Jan 2012 17:11:27 +0000 (17:11 +0000)]
Remove unused variable
Rob Bradford [Thu, 26 Jan 2012 15:39:16 +0000 (15:39 +0000)]
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.
Rob Bradford [Thu, 26 Jan 2012 14:23:57 +0000 (14:23 +0000)]
wayland: Force a redraw of the stage to get the new sized buffer attached
Rob Bradford [Thu, 26 Jan 2012 14:23:16 +0000 (14:23 +0000)]
wayland: Use new stage state manipulation functions
Rob Bradford [Mon, 23 Jan 2012 13:07:13 +0000 (13:07 +0000)]
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.
Rob Bradford [Fri, 20 Jan 2012 15:49:16 +0000 (15:49 +0000)]
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.
Rob Bradford [Thu, 12 Jan 2012 15:25:02 +0000 (15:25 +0000)]
wayland: Support setting fullscreen before the stage is realized
Rob Bradford [Fri, 9 Dec 2011 16:54:52 +0000 (16:54 +0000)]
wayland: Implement set_fullscreen vfunc in ClutterStageWayland
Rob Bradford [Fri, 9 Dec 2011 16:52:29 +0000 (16:52 +0000)]
wayland: Include the Wayland surface and shell surface in ClutterStageWayland
Rob Bradford [Fri, 20 Jan 2012 18:22:50 +0000 (18:22 +0000)]
wayland: Save the output mode so that it can be used to fullscreen windows
Emmanuele Bassi [Thu, 26 Jan 2012 10:29:50 +0000 (10:29 +0000)]
x11: Unbreak the build
The stage wrapper is on the ClutterStageCogl instance.
Emmanuele Bassi [Thu, 26 Jan 2012 08:42:00 +0000 (08:42 +0000)]
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
Emmanuele Bassi [Thu, 26 Jan 2012 08:33:45 +0000 (08:33 +0000)]
docs: Update ClutterStageState flags
Emmanuele Bassi [Thu, 26 Jan 2012 08:27:39 +0000 (08:27 +0000)]
wayland: Use the Stage state tracking
Emmanuele Bassi [Thu, 26 Jan 2012 08:27:25 +0000 (08:27 +0000)]
gdk: Use the Stage state tracking
Emmanuele Bassi [Thu, 26 Jan 2012 08:27:08 +0000 (08:27 +0000)]
win32: Use the Stage state tracking
Emmanuele Bassi [Wed, 25 Jan 2012 21:36:55 +0000 (21:36 +0000)]
x11: Use the Stage state tracking
Emmanuele Bassi [Wed, 25 Jan 2012 21:25:59 +0000 (21:25 +0000)]
osx: Use the Stage state tracking
Emmanuele Bassi [Wed, 25 Jan 2012 21:24:47 +0000 (21:24 +0000)]
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.
Emmanuele Bassi [Wed, 25 Jan 2012 23:09:38 +0000 (23:09 +0000)]
tests/*: Use symbolic constants for sources and events
And make sure to use clutter_threads_add_* instead of the bare
g_*_add().
Emmanuele Bassi [Wed, 25 Jan 2012 23:09:03 +0000 (23:09 +0000)]
docs: Use symbolic constants for sources and events
Emmanuele Bassi [Wed, 25 Jan 2012 23:17:42 +0000 (23:17 +0000)]
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.
Emmanuele Bassi [Tue, 24 Jan 2012 15:42:20 +0000 (15:42 +0000)]
Post-release version bump to 1.9.9
Emmanuele Bassi [Tue, 24 Jan 2012 15:20:35 +0000 (15:20 +0000)]
Release Clutter 1.9.8 (snapshot)
Emmanuele Bassi [Tue, 24 Jan 2012 15:12:41 +0000 (15:12 +0000)]
cookbook: Start migrating to the new API
Drop mentions of deprecated classes and API, and update the inline
example code.
Still some way to go, and the cookbook would probably benefit from
having a recipe on how to use ClutterActor to build a scene.
Emmanuele Bassi [Tue, 24 Jan 2012 15:01:00 +0000 (15:01 +0000)]
cookbook: Begin porting examples to the new API
Start dropping the usage of deprecated classes and API.
Emmanuele Bassi [Tue, 24 Jan 2012 14:52:33 +0000 (14:52 +0000)]
actor: use paint opacity to paint the background color
Emmanuele Bassi [Tue, 24 Jan 2012 14:20:07 +0000 (14:20 +0000)]
docs: Add missing function
Emmanuele Bassi [Tue, 24 Jan 2012 14:13:53 +0000 (14:13 +0000)]
docs: Inlined examples break enums gtk-doc
Emmanuele Bassi [Mon, 16 Jan 2012 11:27:08 +0000 (11:27 +0000)]
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.
Emmanuele Bassi [Tue, 24 Jan 2012 09:36:31 +0000 (09:36 +0000)]
actor: Remove unused function
Emmanuele Bassi [Mon, 23 Jan 2012 18:00:01 +0000 (18:00 +0000)]
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.
Emmanuele Bassi [Sat, 21 Jan 2012 23:06:49 +0000 (23:06 +0000)]
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.
Emmanuele Bassi [Fri, 20 Jan 2012 18:05:53 +0000 (18:05 +0000)]
interactive/actors: Update the venerable test-actors
Fran Diéguez [Sun, 22 Jan 2012 23:34:20 +0000 (00:34 +0100)]
Updated Galician translations
Emmanuele Bassi [Fri, 20 Jan 2012 17:15:20 +0000 (17:15 +0000)]
actor: NULL-ify sibling fields when removing
Let's try and avoid leaving around stale pointers.
Rob Bradford [Mon, 16 Jan 2012 11:55:32 +0000 (11:55 +0000)]
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.
Emmanuele Bassi [Fri, 20 Jan 2012 16:00:19 +0000 (16:00 +0000)]
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.
Emmanuele Bassi [Fri, 20 Jan 2012 14:55:57 +0000 (14:55 +0000)]
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.
Emmanuele Bassi [Fri, 20 Jan 2012 14:55:13 +0000 (14:55 +0000)]
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.
Emmanuele Bassi [Fri, 20 Jan 2012 14:53:41 +0000 (14:53 +0000)]
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.
Emmanuele Bassi [Fri, 20 Jan 2012 12:04:48 +0000 (12:04 +0000)]
actor: Move underallocation warning to diagnostic mode
This should keep down the warning messages — at least for the time
being.
Emmanuele Bassi [Fri, 20 Jan 2012 12:02:49 +0000 (12:02 +0000)]
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.
Emmanuele Bassi [Thu, 19 Jan 2012 14:01:20 +0000 (14:01 +0000)]
Post-release version bump to 1.9.7
Emmanuele Bassi [Thu, 19 Jan 2012 13:42:37 +0000 (13:42 +0000)]
Release Clutter 1.9.6 (snapshot)
Emmanuele Bassi [Thu, 19 Jan 2012 13:41:45 +0000 (13:41 +0000)]
build: Bump up the Cogl requirement
Clutter requires a new version of Cogl's API, but we never bumped the
requirement inside configure.ac.
Emmanuele Bassi [Thu, 19 Jan 2012 13:40:02 +0000 (13:40 +0000)]
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.
Emmanuele Bassi [Thu, 19 Jan 2012 13:39:14 +0000 (13:39 +0000)]
actor: Fix the has_overridden_allocate check
Emmanuele Bassi [Thu, 19 Jan 2012 13:14:47 +0000 (13:14 +0000)]
docs: Add clutter_actor_set_allocation()
Emmanuele Bassi [Thu, 19 Jan 2012 13:14:33 +0000 (13:14 +0000)]
symbols: Add clutter_actor_set_allocation()
Emmanuele Bassi [Thu, 19 Jan 2012 12:40:32 +0000 (12:40 +0000)]
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.
Emmanuele Bassi [Wed, 18 Jan 2012 16:05:12 +0000 (16:05 +0000)]
actor: Be more conservative with the default paint volume
Check the allocation, when one is being used to initialize the paint
volume.