profile/ivi/clutter.git
14 years agoconform: Add operators tests for ClutterColor
Emmanuele Bassi [Thu, 14 Jan 2010 14:07:04 +0000 (14:07 +0000)]
conform: Add operators tests for ClutterColor

The clutter_color_add() and clutter_color_subtract() functions are
lacking unit testing to catch eventual regressions.

14 years agomaster-clock: Add profiling timers
Emmanuele Bassi [Thu, 14 Jan 2010 12:28:07 +0000 (12:28 +0000)]
master-clock: Add profiling timers

Use the newly-added profiling timers inside the master clock dispatch
function to see how much time we spend:

  • in the whole function
    • in the event processing for each stage
    • in the timeline advancement

14 years agounits: Improve coverage of clutter_units_from_string()
Emmanuele Bassi [Wed, 13 Jan 2010 17:31:13 +0000 (17:31 +0000)]
units: Improve coverage of clutter_units_from_string()

Add a unit for an empty string as well as units for the missing unit
types like cm, mm and px.

14 years agoAdd test-cogl-multitexture to the Git ignore file
Emmanuele Bassi [Wed, 13 Jan 2010 16:57:55 +0000 (16:57 +0000)]
Add test-cogl-multitexture to the Git ignore file

14 years agobuild: Add a script to format gcov report lines
Emmanuele Bassi [Wed, 13 Jan 2010 16:35:53 +0000 (16:35 +0000)]
build: Add a script to format gcov report lines

Instead of using echo let's try Perl and the format() built-in.

14 years agoAdd gcov support to the build
Emmanuele Bassi [Mon, 4 Jan 2010 14:53:03 +0000 (14:53 +0000)]
Add gcov support to the build

Using gcov it's possible to get a coverage report, that is a break down
of how much the exposed API is exercised by the conformance test suite.

14 years agobuild: Clean up COGL build flags
Emmanuele Bassi [Wed, 13 Jan 2010 15:40:36 +0000 (15:40 +0000)]
build: Clean up COGL build flags

14 years agotexture: Remove reading the texture data back in ::unrealize()
Damien Lespiau [Mon, 2 Nov 2009 17:08:55 +0000 (17:08 +0000)]
texture: Remove reading the texture data back in ::unrealize()

Reading back the texture data in unrealize does not seem like a
desirable feature any more, clutter has evolved a lot since it was
implemented.

What's wrong with it now:

  * It takes *a lot* of time to read the data back with glReadPixel(),
  * When several textures share the same CoglTexture, the same data can
    be read back multiple times,
  * If the underlying material uses multiple texture units, only the
    first one was copied back,
  * In ClutterCairoTexture, we end up having two separate copies of the
    data,
  * GL actually manages texture memory accross system/video memory
    for us!

For all the reasons above, let's get rid of the glReadPixel() in
Texture::unrealize()

Fixes: OHB#1842

14 years agocogl-framebuffer: Add some missing GL defines
Neil Roberts [Tue, 12 Jan 2010 14:49:55 +0000 (14:49 +0000)]
cogl-framebuffer: Add some missing GL defines

Since 755cce33a7 the framebuffer code is using the GL enums
GL_DEPTH_ATTACHMENT and GL_DEPTH_COMPONENT16. These aren't available
directly under GLES except with the OES suffix so we need to define
them manually as we do with the other framebuffer constants.

14 years agocogl: Remove the CGL_* defines
Neil Roberts [Tue, 12 Jan 2010 14:43:36 +0000 (14:43 +0000)]
cogl: Remove the CGL_* defines

These macros used to define Cogl wrappers for the GLenum values. There are
now Cogl enums everywhere in the API where these were required so we
shouldn't need them anymore. They were in the public headers but as
they are not neccessary and were not in the API docs for Clutter 1.0
it should be safe to remove them.

14 years agostage: Add the delete-event signal
Emmanuele Bassi [Tue, 12 Jan 2010 15:44:28 +0000 (15:44 +0000)]
stage: Add the delete-event signal

Using the ::event signal to match the CLUTTER_DELETE event type (and
block the stage destruction) can be costly, since it means checking
every single event.

The ::delete-event signal is similar in spirit to any other specialized
signal handler dealing with events, and retains the same semantics.

14 years agojournal: Fixes logging of multiple sets of texture coordinates
Robert Bragg [Tue, 12 Jan 2010 11:02:09 +0000 (11:02 +0000)]
journal: Fixes logging of multiple sets of texture coordinates

If a user supplied multiple groups of texture coordinates with
cogl_rectangle_with_multitexture_coords() then we would repeatedly log only
the first group in the journal.  This fixes that bug and adds a conformance
test to verify the fix.

Thanks to Gord Allott for reporting this bug.

14 years agotext: Zero out the cursor_pos member
Emmanuele Bassi [Mon, 11 Jan 2010 17:08:42 +0000 (17:08 +0000)]
text: Zero out the cursor_pos member

Do not trust the zero-ing done by GObject on the private data structure,
and use memset() instead to zero the ClutterGeometry structure.

14 years agoRemove obsolete code from test-text
Emmanuele Bassi [Mon, 11 Jan 2010 17:06:52 +0000 (17:06 +0000)]
Remove obsolete code from test-text

The test-text "fake scrolling" code stopped working somewhere between
0.8 and 0.9, with the new layout code. Instead of the ::cursor-event
signal it should use an approach similar to the Scrollable interface in
the Moblin User Experience toolkit.

Right now, it makes sense to ignore this code entirely.

14 years agocogl: Support multiple fallbacks in cogl_offscreen_new_to_texture()
Robert Bragg [Mon, 30 Nov 2009 20:04:41 +0000 (20:04 +0000)]
cogl: Support multiple fallbacks in cogl_offscreen_new_to_texture()

The Intel drivers in Mesa 7.6 (and possibly earlier versions) don't
support creating FBOs with a stencil buffer but without a depth
buffer. This reworks framebuffer allocation so that we try a number
of fallback options before failing.

The options we try in order are:
- the same options that were sucessful last time if available
- combined depth and stencil
- separate depth and stencil
- just stencil, no depth
- just depth, no stencil
- neither depth or stencil

14 years agomedia: Add an API to specify which font should be used for subtitles
Damien Lespiau [Wed, 6 Jan 2010 11:48:46 +0000 (11:48 +0000)]
media: Add an API to specify which font should be used for subtitles

Allow the user of the ClutterMedia interface to specify a Pango font
description to display subtitles. Even if the underlying implementation
of the interface does not natively use Pange, it must be capable of
parsing the grammar that pango_font_description_from_string() accepts.

14 years agobuild: Clean up private header/source files
Emmanuele Bassi [Sun, 10 Jan 2010 11:35:26 +0000 (11:35 +0000)]
build: Clean up private header/source files

Some source files should not be passed through the introspection parser,
as they are fully private and do not expose any valuable API.

Also the clutter-profile.h header is private and should not be
installed.

14 years agoframebuffers: cogl_offscreen_new_to_texture should take a ref on the texture
Robert Bragg [Wed, 25 Nov 2009 14:26:32 +0000 (14:26 +0000)]
framebuffers: cogl_offscreen_new_to_texture should take a ref on the texture

We weren't taking a reference on the texture to be used as the color buffer
for offscreen rendering, so it was possible to free the texture leaving the
framebuffer in an inconsistent state.

14 years agoprofiling: Adds initial UProf accounting to Cogl
Robert Bragg [Fri, 3 Jul 2009 15:22:35 +0000 (16:22 +0100)]
profiling: Adds initial UProf accounting to Cogl

This adds gives Cogl a dedicated UProf context which will be linked together
with Clutter's context during clutter_init_real().

Initial timers cover _cogl_journal_flush and _cogl_journal_log_quad

You can explicitly ask for a report of Cogl statistics by exporting
COGL_PROFILE_OUTPUT_REPORT=1 but since the context is linked with Clutter's
the statisitcs will also be shown in the automatic Clutter reports.

14 years agoprofiling: Allow limiting statisics just to picking
Robert Bragg [Fri, 17 Apr 2009 11:15:56 +0000 (12:15 +0100)]
profiling: Allow limiting statisics just to picking

This suspends and resumes all uprof timers and counters except while dealing
with picking, so as to give more focused statistics.

Be aware that there are still some issues with this profile option since
there are a few special case counters and timers that shouldn't be
suspended; noteably the frame counters are incorrect so the per frame stats
can't be trusted.

14 years agoprofiling: Parse --clutter-profile and CLUTTER_PROFILE= options
Robert Bragg [Wed, 6 Jan 2010 18:15:13 +0000 (18:15 +0000)]
profiling: Parse --clutter-profile and CLUTTER_PROFILE= options

As we have for debugging, this adds the ability to control profiling flags
either via the command line or an environment variable.

The first option added is CLUTTER_PROFILE=disable-report

This also changes the reporting to be opt-out so you don't need to export
CLUTTER_PROFILE_OUTPUT_REPORT=1 to see a report but you can use
CLUTTER_PROFILE=disable-report to disable it if desired.

14 years agoprofiling: Adds initial UProf support across clutter
Robert Bragg [Mon, 30 Mar 2009 15:41:02 +0000 (16:41 +0100)]
profiling: Adds initial UProf support across clutter

UProf is a small library that aims to help applications/libraries provide
domain specific reports about performance.  It currently provides high
precision timer primitives (rdtsc on x86) and simple counters, the ability
to link statistics between optional components at runtime and makes report
generation easy.

This adds initial accounting for:
- Total mainloop time
- Painting
- Picking
- Layouting
- Idle time

The timing done by uprof is of wall clock time. It's not based on stochastic
samples we simply sample a counter at the start and end.  When dealing with
the complexities of GPU drivers and with various kinds of IO this form of
profiling can be quite enlightening as it will be able to represent where
your application is blocking unlike tools such as sysprof.

To enable uprof accounting you must configure Clutter with --enable-profile
and have uprof-0.2 installed from git://git.moblin.org/uprof

If you want to see a report of statistics when Clutter applications exit you
should export CLUTTER_PROFILE_OUTPUT_REPORT=1 before running them.

Just a final word of caution; this stuff is new and the manual nature of
adding uprof instrumentation means it is prone to some errors when modifying
code.  This just means that when you question strange results don't rule out
a mistake in the instrumentation.  Obviously though we hope the benfits out
weigh e.g.  by focusing on very key stats and by having automatic reporting.

14 years agoAdds a --enable-profile option to configure.ac
Robert Bragg [Tue, 17 Mar 2009 13:07:46 +0000 (13:07 +0000)]
Adds a --enable-profile option to configure.ac

There is nothing else hooked up to this option so far

14 years agox11: Switch back to RGB visuals by default
Emmanuele Bassi [Fri, 8 Jan 2010 15:04:56 +0000 (15:04 +0000)]
x11: Switch back to RGB visuals by default

Since asking for ARGB by default is still somewhat experimental on X11
and not every toolkit or complex widgets (like WebKit) still do not like
dealing with ARGB visuals, we should switch back to RGB by default - now
that at least we know it works.

For applications (and toolkit integration libraries) that want to enable
the ClutterStage:use-alpha property there is a new function:

  void clutter_x11_set_use_argb_visual (gboolean use_argb);

which needs to be called before clutter_init().

The CLUTTER_DISABLE_ARGB_VISUAL environment variable can still be used
to force this value off at run-time.

14 years agodoc: Fix media::{get,set}_subtitle_uri() symbol names
Damien Lespiau [Wed, 6 Jan 2010 00:44:24 +0000 (00:44 +0000)]
doc: Fix media::{get,set}_subtitle_uri() symbol names

At first, those symbols were called {get,set}_subtitles_uri() but were
renamed to {get,set}_subtitle_uri() without updating the
clutter-section.txt file.

This fix makes gtk-doc document those symbols again.

14 years agoactor: Just emit a relayout cycle warning
Emmanuele Bassi [Thu, 7 Jan 2010 11:08:52 +0000 (11:08 +0000)]
actor: Just emit a relayout cycle warning

Currently, ClutterActor detects a relayout cycle (an actor causing a
relayout to be queued from within an allocate() function) and aborts
after printing out a warning. This might be a little bit too anal
retentive, and it currently breaks GTK+ embedding inside clutter-gtk
so we should probably relax the behaviour a bit. Now we just emit the
warning but we still go ahead with the relayout.

14 years agoDon't set the GLX_TRANSPARENT_TYPE attribute to choose an FBConfig
Neil Roberts [Thu, 7 Jan 2010 15:58:53 +0000 (15:58 +0000)]
Don't set the GLX_TRANSPARENT_TYPE attribute to choose an FBConfig

When Clutter tries to pick an ARGB visual it tried to set the
GLX_TRANSPARENT_TYPE attribute of the FBConfig to
GLX_TRANSPARENT_RGB. However the code to do this was broken so that it
was actually trying to set the non-existant attribute number 0x8008
instead. Mesa silently ignored this so it appeared as if it was
working but the Nvidia drivers do not like it.

It appears that the TRANSPARENT_TYPE attribute is not neccessary for
getting an ARGB visual anyway and instead it is intended to support
color-key transparency. Therefore we can just remove it and get all of
the FBConfigs. Then if we need an ARGB visual we can just walk the
list to look for one with depth == 32.

The fbconfig is now stored in a single variable instead of having a
separate variable for the rgb and rgba configs because the old code
only ever retrieved one of them anyway.

14 years agoCovert stb_image.c to Unix format
Emmanuele Bassi [Tue, 5 Jan 2010 18:02:29 +0000 (18:02 +0000)]
Covert stb_image.c to Unix format

The file is still in DOS format (CRLF instead of LF) and this confuses
the hell out of some versions of Git.

14 years agoInclude cogl-defines.h before using GL types
Emmanuele Bassi [Tue, 5 Jan 2010 17:54:45 +0000 (17:54 +0000)]
Include cogl-defines.h before using GL types

If we are using GL* types we should also be including cogl-defines.h, as
that will include the right GL header.

14 years agocogl: Fix array annotations
Emmanuele Bassi [Tue, 5 Jan 2010 16:11:45 +0000 (16:11 +0000)]
cogl: Fix array annotations

The arrays in the cogl_program_set_uniform_* API should be marked as
such, and have their length arguments specified.

14 years agotext: Store the markup attributes separately
Neil Roberts [Tue, 5 Jan 2010 11:58:12 +0000 (11:58 +0000)]
text: Store the markup attributes separately

Previously when the markup property is set it would generate an
attribute list from the markup and then merge it with the attributes
from the attribute property and store it as the effective
attributes. The markup attributes and the marked up text would then be
forgotten. This breaks if the application then later changes the
attributes property because it would try to regenerate the effective
attributes from the markup text but the stored text no longer contains
any markup. If the original markup text happened to contain entities
like '<' they would end up causing parse errors because they would
be converted to the actual symbols.

To fix this the attributes from the markup are now stored
independently from the effective attributes. The effective attributes
are now regenerated if either set of attributes changes right before a
layout is created.

http://bugzilla.openedhand.com/show_bug.cgi?id=1940

14 years agotext: Free the Pango attribute list resources
Neil Roberts [Tue, 5 Jan 2010 11:44:17 +0000 (11:44 +0000)]
text: Free the Pango attribute list resources

The ClutterText owns three PangoAttrList resources which were not
being unref'd. This adds the unref calls to the finalize method.

14 years agox11 tfp: Plug a leak
Emmanuele Bassi [Tue, 5 Jan 2010 14:10:19 +0000 (14:10 +0000)]
x11 tfp: Plug a leak

Destroy the dummy XImage we create even on success.

http://bugzilla.openedhand.com/show_bug.cgi?id=1918

Based on a patch by: Carlos Martín Nieto <carlos@cmartin.tk>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoMerge branch 'matrix-mode'
Emmanuele Bassi [Tue, 5 Jan 2010 11:04:50 +0000 (11:04 +0000)]
Merge branch 'matrix-mode'

* matrix-mode:
  build: Move CoglMatrixMode to cogl-matrix-stack.h

14 years agoRemove trailing comma from test UI definition
Emmanuele Bassi [Tue, 5 Jan 2010 11:02:39 +0000 (11:02 +0000)]
Remove trailing comma from test UI definition

The animation definition test has a trailing comma at the end of an
array item.

14 years agoscript: Copy the JSON node in PropertyInfo
Emmanuele Bassi [Tue, 5 Jan 2010 10:55:28 +0000 (10:55 +0000)]
script: Copy the JSON node in PropertyInfo

PropertyInfo should store a copy of the JsonNodes it references, so
that property_info_free() can safely dispose them, and we can reference
values across different UI definition data.

The implicit timeline parsing code is not copying the JsonNode; this
leads to a double free in some cases, which is masked by the GSlice
allocator and produces a heap corruption later on.

14 years ago[media] Add an API to play a subtitle file along with the media
Damien Lespiau [Mon, 28 Dec 2009 16:52:43 +0000 (17:52 +0100)]
[media] Add an API to play a subtitle file along with the media

Allow the user of the ClutterMedia interface to specify an external (as
in not multiplexed with the audio/video streams) location of a subtitle
stream.

14 years agotext: Use G_SIGNAL_ACTION for ::insert-text and ::delete-text
Emmanuele Bassi [Mon, 4 Jan 2010 12:03:47 +0000 (12:03 +0000)]
text: Use G_SIGNAL_ACTION for ::insert-text and ::delete-text

Both the ::insert-text and ::delete-text are "action" signals, that is
signals that are safe to (and should) be emitted using g_signal_emit()
directly.

14 years agoAdded ClutterText::insert-text and ClutterText::delete-text signals
Alejandro Piñeiro [Fri, 20 Nov 2009 14:17:41 +0000 (15:17 +0100)]
Added ClutterText::insert-text and ClutterText::delete-text signals

* clutter/clutter-marshal.list: added new marshaller
* clutter/clutter-text.c
(clutter_text_class_init): added insert-text and delete-text signals
(clutter_text_insert_unichar): emits insert-text signal
(clutter_text_insert_text): emits insert-text signal
(clutter_text_delete_text): emits delete-text signal
(clutter_text_delete_chars): emits delete-text signal
(clutter_text_set_markup_internal): emits delete-text and insert-text signals
(clutter_text_set_text): emits delete-text and insert-text signals

http://bugzilla.openedhand.com/show_bug.cgi?id=1894

14 years agobuild: Move CoglMatrixMode to cogl-matrix-stack.h
Emmanuele Bassi [Mon, 4 Jan 2010 11:58:32 +0000 (11:58 +0000)]
build: Move CoglMatrixMode to cogl-matrix-stack.h

This avoids a redeclaration of _cogl_matrix_stack_flush_to_gl() from
using GLenum to CoglMatrixMode.

http://bugzilla.openedhand.com/show_bug.cgi?id=1928

14 years agocogl-texture: Remove return in void functions
Halton Huo [Mon, 4 Jan 2010 11:49:50 +0000 (11:49 +0000)]
cogl-texture: Remove return in void functions

http://bugzilla.o-hand.com/show_bug.cgi?id=1929

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agobuild: Maintainer cflags go in the _CFLAGS target
Emmanuele Bassi [Mon, 4 Jan 2010 11:49:13 +0000 (11:49 +0000)]
build: Maintainer cflags go in the _CFLAGS target

The maintainer compiler flags are not pre-processor flags.

14 years agocogl: Const-ify vertices in cogl_polygon()
Emmanuele Bassi [Mon, 4 Jan 2010 11:43:00 +0000 (11:43 +0000)]
cogl: Const-ify vertices in cogl_polygon()

The CoglTextureVertex array passed to cogl_polygon() is a pure
in-argument and should be const-ified.

http://bugzilla.openedhand.com/show_bug.cgi?id=1917

14 years agomaster-clock: Take a reference before advancing timelines
Emmanuele Bassi [Wed, 11 Nov 2009 11:00:29 +0000 (11:00 +0000)]
master-clock: Take a reference before advancing timelines

A timeline advancement might cause another timeline to be
destroyed, which will likely lead to a segmentation fault.

Before advancing the timelines we should take a reference
on them - just like we do for the stages before doing
event processing. This will prevent dispose() from running
until the end of the advancement.

http://bugzilla.openedhand.com/show_bug.cgi?id=1854

14 years agoPost-release version bump to 1.1.5
Emmanuele Bassi [Sun, 3 Jan 2010 20:41:17 +0000 (20:41 +0000)]
Post-release version bump to 1.1.5

14 years agoRelease Clutter 1.1.4
Emmanuele Bassi [Sun, 3 Jan 2010 20:11:43 +0000 (20:11 +0000)]
Release Clutter 1.1.4

14 years agobuild: Remove dist rule for non-existing image files
Emmanuele Bassi [Sun, 3 Jan 2010 20:24:39 +0000 (20:24 +0000)]
build: Remove dist rule for non-existing image files

14 years agoDisable g_set_prgname()
Emmanuele Bassi [Sun, 3 Jan 2010 20:12:49 +0000 (20:12 +0000)]
Disable g_set_prgname()

Apparently, calling g_set_prgname() multiple times is not allowed
anymore, and hence clutter_init_* calls should not do that. Though this
is really GLib's fault - and a massive nuisance for us - we should
prolly comply to avoid the test suite dying on us.

14 years agoMerge branch 'animate-layout-manager' into ebassi-next
Emmanuele Bassi [Wed, 23 Dec 2009 10:38:02 +0000 (10:38 +0000)]
Merge branch 'animate-layout-manager' into ebassi-next

* animate-layout-manager:
  layout-manager: Document the animation support
  layout-manager: Rewind the timeline in begin_animation()
  box-layout: Remove the allocations hash table
  docs: Clean up the README file
  layout: Let begin_animation() return the Alpha
  box-layout: Add knobs for controlling animations
  box-layout: Animate layout properties
  layout: Add animation support to LayoutManager
  Add ActorBox animation methods

14 years agolayout-manager: Document the animation support
Emmanuele Bassi [Wed, 23 Dec 2009 10:35:16 +0000 (10:35 +0000)]
layout-manager: Document the animation support

Add a section inside the LayoutManager class API reference documenting,
with examples, how to implement animation support inside a layout
manager sub-class.

14 years agolayout-manager: Rewind the timeline in begin_animation()
Emmanuele Bassi [Wed, 23 Dec 2009 08:39:16 +0000 (08:39 +0000)]
layout-manager: Rewind the timeline in begin_animation()

If the default implementation begin_animation() is called twice then we
should rewind the timeline, as well as updating its duration and the
easing mode of the alpha.

14 years agobox-layout: Remove the allocations hash table
Emmanuele Bassi [Wed, 23 Dec 2009 08:34:08 +0000 (08:34 +0000)]
box-layout: Remove the allocations hash table

The BoxLayout uses a HashTable to map the latest stable allocation of
each child, in order to use that as the initial value during an
animation; this in spite of already having a perfectly valid per-child
storage as part of the layout manager: ClutterBoxChild.

The last stable allocation should be stored inside the ClutterBoxChild
instead of having it in the private data for ClutterBoxLayout. The
access remains O(1), since there is a 1:1 mapping between child and
BoxChild instances, but we save a little bit of memory and we avoid
keeping aroud allocations for old children.

14 years agodocs: Clean up the README file
Emmanuele Bassi [Tue, 22 Dec 2009 18:10:39 +0000 (18:10 +0000)]
docs: Clean up the README file

14 years agoMerge branch 'stage-use-alpha' into ebassi-next
Emmanuele Bassi [Sun, 20 Dec 2009 17:39:12 +0000 (17:39 +0000)]
Merge branch 'stage-use-alpha' into ebassi-next

* stage-use-alpha:
  tests: Use accessor methods for :use-alpha
  stage: Add accessors for :use-alpha
  tests: Allow setting the stage opacity in test-paint-wrapper
  stage: Premultiply the stage color
  stage: Composite the opacity with the alpha channel
  glx: Always request an ARGB visual
  stage: Add :use-alpha property
  materials: Get the right blend function for alpha

14 years agoMerge branch 'internal-flag' into ebassi-next
Emmanuele Bassi [Sun, 20 Dec 2009 17:33:51 +0000 (17:33 +0000)]
Merge branch 'internal-flag' into ebassi-next

* internal-flag:
  conform: Add test unit for the destruction of Containers
  actor: Add internal child flag
  Clean up whitespace, indentation and comments

14 years agoconform: Add test unit for the destruction of Containers
Emmanuele Bassi [Fri, 18 Dec 2009 23:29:11 +0000 (23:29 +0000)]
conform: Add test unit for the destruction of Containers

Verify that internal children do not go through the remove()
implementation, and that non-internal children do.

14 years agoactor: Add internal child flag
Emmanuele Bassi [Fri, 18 Dec 2009 23:20:04 +0000 (23:20 +0000)]
actor: Add internal child flag

ClutterActor checks, when destroying and reparenting, if the parent
actor implements the Container interface, and automatically calls the
remove() method to perform a clean removal.

Actors implementing Container, though, might have internal children;
that is, children that are not added through the Container API. It is
already possible to iterate through them using the Container API to
avoid breaking invariants - but calling clutter_actor_destroy() on
these children (even from the Container implementation, and thus outside
of Clutter's control) will either lead to leaks or to segmentation
faults.

Clutter needs a way to distinguish a clutter_actor_set_parent() done on
an internal child from one done on a "public" child; for this reason, a
push/pop pair of functions should be available to Actor implementations
to mark the section where they wish to add internal children:

  ➔ clutter_actor_push_internal ();
    ...
    clutter_actor_set_parent (child1, parent);
    clutter_actor_set_parent (child2, parent);
    ...
  ➔ clutter_actor_pop_internal ();

The set_parent() call will automatically set the newly added
INTERNAL_CHILD private flag on each child, and both
clutter_actor_destroy() and clutter_actor_unparent() will check for the
flag before deciding whether to call the Container's remove method.

14 years agolayout: Let begin_animation() return the Alpha
Emmanuele Bassi [Sun, 13 Dec 2009 01:23:54 +0000 (01:23 +0000)]
layout: Let begin_animation() return the Alpha

When beginning a new animation for a LayoutManager, the implementation
should return the ClutterAlpha used. This allows controlling the
timeline and/or modifying the animation parameters on the fly.

14 years agobox-layout: Add knobs for controlling animations
Emmanuele Bassi [Sun, 13 Dec 2009 01:07:44 +0000 (01:07 +0000)]
box-layout: Add knobs for controlling animations

ClutterLayoutManager does not have any state associated with it, and
defers all the state to its sub-classes.

The BoxLayout is thus in charge of controlling:

  • whether or not animations should be used
  • the duration of the animation
  • the easing mode of the animation

By adding three new properties:

  • ClutterBoxLayout:use-animations
  • ClutterBoxLayout:easing-duration
  • ClutterBoxLayout:easing-mode

And their relative accessors pairs we can make BoxLayout decide whether
or not, and with which parameters, call the begin_animation() method of
ClutterLayoutManager.

The test-box-layout has been modified to reflect this new functionality,
by checking the key-press event for the 'a' key symbol to toggle the use
of animations.

14 years agobox-layout: Animate layout properties
Emmanuele Bassi [Sat, 12 Dec 2009 00:13:05 +0000 (00:13 +0000)]
box-layout: Animate layout properties

Use the newly added animation support inside LayoutManager to animate
between state changes of the BoxLayout properties.

The implementation is based on equivalent code from Mx, written by:

  Thomas Wood <thomas.wood@intel.com>

14 years agolayout: Add animation support to LayoutManager
Emmanuele Bassi [Sat, 12 Dec 2009 00:02:43 +0000 (00:02 +0000)]
layout: Add animation support to LayoutManager

In order to animate a fluid layout we cannot use the common animation
code paths as they will override the size request and allocation paths
that are handled by the layout manager itself.

One way to introduce animations in the allocation sequence is to use a
Timeline and an Alpha to compute a progress value and then use that
value to interpolate an ActorBox between the initial and final states of
the animation - with the initial state being the last allocation of the
child prior to the animation start, and the final state the allocation
of the child at the end; for every frame of the Timeline we then queue a
relayout on the layout manager's container, which will result in an
animation.

ClutterLayoutManager is the most likely place to add a generic API for
beginning and ending an animation, as well as the place to provide a
default code path to create the ancillary Timeline and Alpha instances
needed to drive the animation.

A LayoutManager sub-class will need to:

  • call clutter_layout_manager_begin_animation() whenever it should
    animate between two states, for instance: whenever a layout property
    changes value;
  • eventually override begin_animation() and end_animation() in case
    further state needs to be set up, and then chain up to the default
    implementation provided by LayoutManager;
  • if a completely different implementation is required, the layout
    manager sub-class should override begin_animation(), end_animation()
    and get_animation_progress().

Inside the allocate() implementation the sub-class should also
interpolate between the last known allocation of a child and the newly
computed allocation.

14 years agoAdd ActorBox animation methods
Emmanuele Bassi [Fri, 11 Dec 2009 23:48:58 +0000 (23:48 +0000)]
Add ActorBox animation methods

ClutterActorBox should have an interpolate() method that allows to
compute the intermediate values between two states, given a progress
value, e.g.:

        clutter_actor_box_interpolate (start, end, alpha, &result);

Another utility method, useful for layout managers, is a modifier
that clamps the members of the actor box to the nearest integer
value.

14 years agoClean up whitespace, indentation and comments
Emmanuele Bassi [Fri, 11 Dec 2009 20:17:58 +0000 (20:17 +0000)]
Clean up whitespace, indentation and comments

14 years agoMerge branch 'get-current-event' into ebassi-next
Emmanuele Bassi [Thu, 10 Dec 2009 23:36:04 +0000 (23:36 +0000)]
Merge branch 'get-current-event' into ebassi-next

* get-current-event:
  Add clutter_get_current_event

14 years agoAdd clutter_get_current_event
Colin Walters [Thu, 12 Nov 2009 22:33:15 +0000 (17:33 -0500)]
Add clutter_get_current_event

When getting signals from higher level toolkits, occasionally
one wants access to the underlying event; say for a Button
widget's "clicked" signal, to get the keyboard state.

Rather than having all of the highlevel widgets emit
ClutterEvent just for the more unusual use cases,
add a global function to access the event state.

http://bugzilla.openedhand.com/show_bug.cgi?id=1888

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoMerge branch 'no-layout-flag' into ebassi-next
Emmanuele Bassi [Wed, 9 Dec 2009 23:32:41 +0000 (23:32 +0000)]
Merge branch 'no-layout-flag' into ebassi-next

* no-layout-flag:
  actor: Add a NO_LAYOUT flag for actors

14 years agoMerge branch 'size-cache' into ebassi-next
Emmanuele Bassi [Wed, 9 Dec 2009 23:32:18 +0000 (23:32 +0000)]
Merge branch 'size-cache' into ebassi-next

* size-cache:
  tests: Clean up the BoxLayout interactive test
  actor: Add debugging notes for size cache
  Add a cache of size requests

14 years agox11: Emulate XKB's detectable key auto-repeat
Emmanuele Bassi [Wed, 9 Dec 2009 18:46:25 +0000 (18:46 +0000)]
x11: Emulate XKB's detectable key auto-repeat

Old-style X11 terminals require that even modern X11 send KeyPress
and KeyRelease pairs when auto-repeating. For this reason modern(-ish)
API like XKB has a way to detect auto-repeat and do a single KeyRelease
at the end of a KeyPress sequence.

The newly added check emulates XKB's detectable auto-repeat by peeking
the next event after a KeyRelease and checking if it's a KeyPress for
the same key and timestamp - and then ignoring the KeyRelease if it
matches.

14 years agodocs: Move RELEASING under docs/
Emmanuele Bassi [Wed, 9 Dec 2009 18:10:52 +0000 (18:10 +0000)]
docs: Move RELEASING under docs/

14 years agostage: Deprecate default stage size macros
Emmanuele Bassi [Wed, 9 Dec 2009 01:52:09 +0000 (01:52 +0000)]
stage: Deprecate default stage size macros

The macros for getting the size of the default stage are a relic of the
past and they should be deprecated.

14 years agotests: Use accessor methods for :use-alpha
Emmanuele Bassi [Wed, 9 Dec 2009 17:17:33 +0000 (17:17 +0000)]
tests: Use accessor methods for :use-alpha

Instead of using g_object_set().

14 years agostage: Add accessors for :use-alpha
Emmanuele Bassi [Wed, 9 Dec 2009 02:04:56 +0000 (02:04 +0000)]
stage: Add accessors for :use-alpha

Use real accessors for the :use-alpha property.

14 years agotests: Allow setting the stage opacity in test-paint-wrapper
Emmanuele Bassi [Wed, 9 Dec 2009 01:46:52 +0000 (01:46 +0000)]
tests: Allow setting the stage opacity in test-paint-wrapper

This allows testing the Stage:use-alpha property and the blending done
by a compositor.

14 years agostage: Premultiply the stage color
Emmanuele Bassi [Wed, 9 Dec 2009 01:46:09 +0000 (01:46 +0000)]
stage: Premultiply the stage color

In case we are using Stage:use-alpha then we need to premultiply the
stage color to get the correct blending from the compositor.

14 years agox11: Do not manage a foreign window
Emmanuele Bassi [Tue, 8 Dec 2009 18:24:30 +0000 (18:24 +0000)]
x11: Do not manage a foreign window

If a Stage has been set to use a foreign Window then Clutter should not
be managing it; calling XWithdrawWindow and XMapWindow should be
reserved to the windows we manage ourselves.

14 years agoRemove clutter_set_default_text_direction()
Emmanuele Bassi [Mon, 7 Dec 2009 19:00:55 +0000 (19:00 +0000)]
Remove clutter_set_default_text_direction()

Setting the default text direction programmatically is wrong: it is a
value dependent on the locale or by the environment.

14 years agoQueue a relayout when the default text direction changes
Emmanuele Bassi [Mon, 7 Dec 2009 18:41:15 +0000 (18:41 +0000)]
Queue a relayout when the default text direction changes

We need a relayout cycle if the default direction for the text changes
while the main loop is running.

14 years agostage: Composite the opacity with the alpha channel
Emmanuele Bassi [Mon, 7 Dec 2009 17:35:17 +0000 (17:35 +0000)]
stage: Composite the opacity with the alpha channel

The Stage's opacity should be composited with the alpha component of the
Stage's background color.

14 years agoactor: Add a NO_LAYOUT flag for actors
Emmanuele Bassi [Wed, 7 Oct 2009 15:41:25 +0000 (16:41 +0100)]
actor: Add a NO_LAYOUT flag for actors

Some actor implementation might avoid imposing any layout on their
children. The Actor base class usually assumes some sort of layout
management is in place, so it will queue relayouts when, for instance,
an actor is shown or is hidden. If the parent of the actor does not
impose any layout, though, showing or hiding one of its children will
not affect the layout of the others.

An example of this kind of container is ClutterGroup.

By adding a new Actor flag, CLUTTER_ACTOR_NO_LAYOUT, and by making
the Group actor set it on itself, the Actor base class can now decide
whether or not to queue a relayout. The flag is not meant to be used
by application code, and should only be set when implementing a new
container.

http://bugzilla.openedhand.com/show_bug.cgi?id=1838

14 years agotests: Clean up the BoxLayout interactive test
Emmanuele Bassi [Fri, 4 Dec 2009 17:39:04 +0000 (17:39 +0000)]
tests: Clean up the BoxLayout interactive test

14 years agoactor: Add debugging notes for size cache
Emmanuele Bassi [Fri, 4 Dec 2009 17:38:26 +0000 (17:38 +0000)]
actor: Add debugging notes for size cache

Add a note for cache hits, and another one for cache misses.

14 years agobox: Add relative packing methods
Emmanuele Bassi [Fri, 4 Dec 2009 16:54:22 +0000 (16:54 +0000)]
box: Add relative packing methods

ClutterBox should provide some convenience functions to pack a new child
at a given position, either an absolute index or relative to a sibling.

14 years agoAdd a cache of size requests
Johan Bilien [Thu, 12 Nov 2009 01:40:57 +0000 (20:40 -0500)]
Add a cache of size requests

clutter_actor_get_preferred_width/height currently caches only one size
requests, for a given height / width.

It's common for a layout manager to call get_preferred_width with 2
different heights during the same allocation cycle. Typically once in
the size request, once in the allocation. If
clutter_actor_get_preferred_width is called
alternatively with 2 different for_height, the cache is totally
inefficient, and we end up always querying the actor size even
when the actor does not need a re-allocation.

http://bugzilla.openedhand.com/show_bug.cgi?id=1876

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoflow-layout: Use the natural size
Bastian Winkler [Thu, 3 Dec 2009 15:38:05 +0000 (15:38 +0000)]
flow-layout: Use the natural size

Fix a copy-and-paste thinko where the cell size was computed using the
minimum size instead of the natural size. For actors with a minimum size
of zero, like Textures, this implied always a zero allocation.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agocogl: Use #ifdef GL around GL_TEXTURE_RECTANGLE_ARB
Neil Roberts [Wed, 2 Dec 2009 21:54:22 +0000 (21:54 +0000)]
cogl: Use #ifdef GL around GL_TEXTURE_RECTANGLE_ARB

Commit 558b17ee1e added support for rectangle textures to the
framebuffer code. Under GLES there is no GL_TEXTURE_RECTANGLE_ARB
definition so this was breaking the build. The rest of Cogl uses
ifdef's around that constant so we should do the same here.

14 years agobuild: Fix CPP and LD flags
Emmanuele Bassi [Wed, 2 Dec 2009 16:03:55 +0000 (16:03 +0000)]
build: Fix CPP and LD flags

• The debug flags are pre-processor ones, so they should be listed
  inside AM_CPPFLAGS.

• Clutter's publicly exported symbols match the following regular
  expression:

    ^(clutter|cogl|json)_*

  The old one also listed "pango" as a possible prefix, but the
  Pango API is now under the Cogl namespace.

14 years agodocs: Document Clutter's threading model
Emmanuele Bassi [Wed, 2 Dec 2009 14:15:43 +0000 (14:15 +0000)]
docs: Document Clutter's threading model

Be explicit on how to deal with threads and Clutter.

14 years agodocs: Fix docbook syntax
Emmanuele Bassi [Wed, 2 Dec 2009 14:15:19 +0000 (14:15 +0000)]
docs: Fix docbook syntax

The <variablename> tag is really called <varname> in DocBook.

14 years agodocs: Annotate StageManager
Emmanuele Bassi [Wed, 2 Dec 2009 11:38:04 +0000 (11:38 +0000)]
docs: Annotate StageManager

The ClutterStageManager instance structure is private, so we need a
"floating" annotation.

14 years agoRemove a gtk-doc annotation
Emmanuele Bassi [Wed, 2 Dec 2009 11:37:13 +0000 (11:37 +0000)]
Remove a gtk-doc annotation

The Mesa matrix code still has a comment that looks like a gtk-doc
annotation.

14 years agolayout: Add padding to LayoutMeta
Emmanuele Bassi [Wed, 2 Dec 2009 11:36:25 +0000 (11:36 +0000)]
layout: Add padding to LayoutMeta

Add some padding to the LayoutMeta and LayoutMetaClass structures.

14 years agoRemove unused variable 'lang'
Emmanuele Bassi [Tue, 1 Dec 2009 18:16:48 +0000 (18:16 +0000)]
Remove unused variable 'lang'

Fix a compiler warning.

14 years agoflow-layout: Include the first line when calculating number of lines
Rob Bradford [Tue, 1 Dec 2009 17:44:42 +0000 (17:44 +0000)]
flow-layout: Include the first line when calculating number of lines

This ensures that the preferred height / width height takes into consideration
the correct amount of padding

14 years agoflow-layout: Respect row-spacing/col-spacine in horizontal/vertical flows
Rob Bradford [Tue, 1 Dec 2009 17:11:08 +0000 (17:11 +0000)]
flow-layout: Respect row-spacing/col-spacine in horizontal/vertical flows

We need to add the row-spacing value when calculating the y position for lines
of actors in horizontal flowing layouts.

Similarly we need to add the col-spacing value when calculating the x posution
for actors in vertical flowing layouts.

14 years agoglx: Always request an ARGB visual
Emmanuele Bassi [Tue, 1 Dec 2009 16:18:39 +0000 (16:18 +0000)]
glx: Always request an ARGB visual

When requesting the GLXFBConfig for creating the GLX context, we should
always request one that links to an ARGB visual instead of a plain RGB
one.

By using an ARGB visual we allow the ClutterStage:use-alpha property to
work as intended when running Clutter under a compositing manager.

The default behaviour of requesting an ARGB visual can be disabled by
using the:

  CLUTTER_DISABLE_ARGB_VISUAL

Environment variable.

14 years agostage: Add :use-alpha property
Emmanuele Bassi [Tue, 1 Dec 2009 16:16:18 +0000 (16:16 +0000)]
stage: Add :use-alpha property

The ClutterStage:use-alpha property is used to let a stage know that it
should honour the alpha component of the ClutterStage:color property.

If :use-alpha is set to FALSE the stage always uses the full opacity
when clearing itself before a paint(); otherwise, the alpha value is
used.

14 years agomaterials: Get the right blend function for alpha
Emmanuele Bassi [Tue, 1 Dec 2009 16:22:45 +0000 (16:22 +0000)]
materials: Get the right blend function for alpha

The correct blend function for the alpha channel is:

  GL_ONE, GL_ONE_MINUS_SRC_ALPHA

As per bug 1406. This fix was dropped when the switch to premultiplied
alpha was merged.

14 years agoactor: Fix a pre-condition check in set_text_direction()
Emmanuele Bassi [Tue, 1 Dec 2009 16:06:57 +0000 (16:06 +0000)]
actor: Fix a pre-condition check in set_text_direction()

The check is failing because the condition should be:

  text_dir != CLUTTER_TEXT_DIRECTION_DEFAULT

14 years agobuild: More cleanups for the configure summary
Emmanuele Bassi [Tue, 1 Dec 2009 15:17:49 +0000 (15:17 +0000)]
build: More cleanups for the configure summary

Document each section, and add some more items to the summary like what
JSON-GLib are we using, and which version of the GLES API is COGL
wrapping.

14 years agobuild: Require a stable JSON-GLib version
Emmanuele Bassi [Tue, 1 Dec 2009 15:17:16 +0000 (15:17 +0000)]
build: Require a stable JSON-GLib version

The 0.7 version is the development cycle for JSON-GLib 0.8.