profile/ivi/clutter.git
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.

14 years agodocs: Add missing symbols to clutter-sections.txt
Emmanuele Bassi [Tue, 1 Dec 2009 14:59:44 +0000 (14:59 +0000)]
docs: Add missing symbols to clutter-sections.txt

14 years agoMerge branch 'text-direction'
Emmanuele Bassi [Tue, 1 Dec 2009 14:55:19 +0000 (14:55 +0000)]
Merge branch 'text-direction'

* text-direction:
  docs: Add text-direction accessors
  Set the default language on the Pango context
  actor: Set text direction on parenting
  tests: Display the index inside text-box-layout
  box-layout: Honour :text-direction
  text: Dirty layout cache on text direction changes
  actor: Add :text-direction property
  Use the newly added ClutterTextDirection enumeration
  Add ClutterTextDirection enumeration

14 years agodocs: Add text-direction accessors
Emmanuele Bassi [Tue, 1 Dec 2009 14:55:01 +0000 (14:55 +0000)]
docs: Add text-direction accessors

14 years agobuild: Fix the SUBDIRS ordering
Bastian Winkler [Tue, 1 Dec 2009 12:31:07 +0000 (12:31 +0000)]
build: Fix the SUBDIRS ordering

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agodocs: Move documentation under doc/
Emmanuele Bassi [Tue, 1 Dec 2009 10:16:25 +0000 (10:16 +0000)]
docs: Move documentation under doc/

Clean up the root directory of the project and try to keep the
documentation all together.

14 years agocookbook: Clean up the text
Emmanuele Bassi [Tue, 1 Dec 2009 10:11:33 +0000 (10:11 +0000)]
cookbook: Clean up the text

• Remove the empty sections.

• Add the description for the "overriding the paint sequence" recipe.

14 years agodocs: Fix recursion into doc/ directory
Emmanuele Bassi [Mon, 30 Nov 2009 21:51:46 +0000 (21:51 +0000)]
docs: Fix recursion into doc/ directory

We should always recurse into the doc/ directory; whether we should then
recurse into reference/, cookbook/ and manual/ is a matter of specific
configure-time flags.

14 years agodocs: Clean up the additional documentation build
Emmanuele Bassi [Thu, 3 Sep 2009 12:04:59 +0000 (13:04 +0100)]
docs: Clean up the additional documentation build

• Make the manual a DevHelp book

• Make the generation of PDFs of the cookbook and the manual optional

• Consequently, make the hard dependency on jw optional

• Clean up the checks and build for the additional documentation

14 years ago[cookbook] Build the Cookbook as a devhelp document
Emmanuele Bassi [Wed, 2 Sep 2009 17:11:06 +0000 (18:11 +0100)]
[cookbook] Build the Cookbook as a devhelp document

Instead of creating stand-alone HTML files, use XSLT to transform the
DocBook into a DevHelp file, so that we can read the Cookbook inside
DevHelp -- just like the API reference.

14 years ago[cookbook] Fix folds
Emmanuele Bassi [Wed, 2 Sep 2009 12:13:44 +0000 (13:13 +0100)]
[cookbook] Fix folds

14 years agoUpdate the ignore file
Emmanuele Bassi [Thu, 11 Dec 2008 17:03:10 +0000 (17:03 +0000)]
Update the ignore file

Add the temporary and output files of the cookbook.

14 years agoAdd the secon recipe to the Actors chapter
Emmanuele Bassi [Thu, 11 Dec 2008 17:02:05 +0000 (17:02 +0000)]
Add the secon recipe to the Actors chapter

The second recipe shows how to use the ::paint signal to override
the paint sequence of a pre-existing actor.

14 years agoAdd the first recipe to the Actors chapter
Emmanuele Bassi [Thu, 11 Dec 2008 17:00:16 +0000 (17:00 +0000)]
Add the first recipe to the Actors chapter

The first recipe shows how to be notified when the relative position
and size of an actor changes using the notify:: signal on the actor's
dimensional and positional properties.

14 years agoAdd a preface instead of an introduction
Emmanuele Bassi [Thu, 11 Dec 2008 16:58:07 +0000 (16:58 +0000)]
Add a preface instead of an introduction

Make the Cookbook look more like a book than a tutorial.

14 years agoAdd the Clutter Cookbook to the build
Emmanuele Bassi [Thu, 11 Dec 2008 16:57:46 +0000 (16:57 +0000)]
Add the Clutter Cookbook to the build

The "Clutter Cookbook" is a document designed to contain solutions
to common problems applications developers might encounter when using
Clutter. It is meant as a companion to the API reference but it
requires knowledge of the Clutter API and framework.

14 years agolayout-manager: Create LayoutMeta on demand
Emmanuele Bassi [Mon, 30 Nov 2009 19:03:11 +0000 (19:03 +0000)]
layout-manager: Create LayoutMeta on demand

The ClutterLayoutMeta instances should be created on demand, whenever
the layout manager needs them - if the layout manager supports layout
properties.

This removes the requirement to call add_child_meta() and
remove_child_meta() on add and remove respectively; it also simplifies
the implementation of LayoutManager sub-classes since we can add
fallback code in the base abstract class.

Eventually, this will also lead to an easier to implement ClutterScript
parser for layout properties.

With the new scheme, the ClutterLayoutMeta instance is created whenever
the layout manager tries to access it; if there isn't an instance
already attached to the container's child, one is created -- assuming
that the LayoutManager sub-class has overridden the
get_child_meta_type() virtual function and it's returning a valid GType.

We can also provide a default implementation for create_child_meta(),
by getting the GType and instantiating a ClutterLayoutMeta with all the
fields already set. If the layout manager requires more work then it can
obviously override the default implementation (and even chain up to it).

The ClutterBox actor has been updated, as well as the ClutterBoxLayout
layout manager, to take advantage of the changes of LayoutManager.

14 years agoconform: Add named object property unit for ClutterScript
Emmanuele Bassi [Mon, 30 Nov 2009 18:22:26 +0000 (18:22 +0000)]
conform: Add named object property unit for ClutterScript

We should exercise the resolution of the object properties containing a
string pointing to an object previously defined using ClutterScript.

14 years agoUse the correct colour when clearing the stage for picking
Neil Roberts [Mon, 30 Nov 2009 19:06:05 +0000 (19:06 +0000)]
Use the correct colour when clearing the stage for picking

The colour test for the stage in _clutter_do_pick checks for white to
determine whether the stage was picked but since 47db7af4d we were
setting the colur to black. This usually worked because the id of the
default stage ends up being 0 which equates to black. However if a
second stage is created then it will always end up picking the first
stage.

14 years agocogl: Enable blending if a lighting colour is semi-transparent
Neil Roberts [Sun, 29 Nov 2009 20:06:36 +0000 (20:06 +0000)]
cogl: Enable blending if a lighting colour is semi-transparent

We currently enable blending if the material colour has
transparency. This patch makes it also enable blending if any of the
lighting colours have transparency. Arguably this isn't neccessary
because we don't expose any API to enable lighting so there is no
bug. However it is currently possible to enable lighting with a direct
call to glEnable and this otherwise works so it is a shame not to have
it.

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

14 years agoSet the default language on the Pango context
Emmanuele Bassi [Mon, 30 Nov 2009 16:15:19 +0000 (16:15 +0000)]
Set the default language on the Pango context

When creating the Pango context we should also set the language
to be the default Pango language.

14 years agoactor: Set text direction on parenting
Emmanuele Bassi [Mon, 30 Nov 2009 16:14:09 +0000 (16:14 +0000)]
actor: Set text direction on parenting

When setting the parent on an actor we should set the text direction to
be the same as the parent's.

14 years agogitignore: update gitignore files to match the latest cogl tests
Damien Lespiau [Mon, 30 Nov 2009 12:26:45 +0000 (13:26 +0100)]
gitignore: update gitignore files to match the latest cogl tests

Some cogl tests were renamed in c1247066 to have 'cogl' in their names.
It's a good excuse to merge .gitigore and tests/.gitignore.

14 years agotests: fix argument parsing of test-texture-quality
Damien Lespiau [Wed, 25 Nov 2009 12:29:26 +0000 (13:29 +0100)]
tests: fix argument parsing of test-texture-quality

This test did not open redhand.png as argc/argv should be handled
normally (argv[0] being the name of the exectutable).

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agotests: give all the arguments to the wrapper
Damien Lespiau [Wed, 25 Nov 2009 12:25:14 +0000 (13:25 +0100)]
tests: give all the arguments to the wrapper

Some tests can be given extra arguments. The test-interactive dispatch
mechanism handles that but the small shell scripts around the wrapper
do not forward the arguments to the wrapper.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agoprimitives: Don't use dynamic arrays since VS2008 can't cope with them :-(
Robert Bragg [Fri, 27 Nov 2009 15:24:09 +0000 (15:24 +0000)]
primitives: Don't use dynamic arrays since VS2008 can't cope with them :-(

This changes _cogl_path_fill_nodes_scanlines to use g_alloca instead of
using a variable to declare an array length.

14 years agopicking: avoid redundant picking geometry for the stage.
Robert Bragg [Wed, 25 Nov 2009 20:37:01 +0000 (20:37 +0000)]
picking: avoid redundant picking geometry for the stage.

The stage's pick id can be written to the framebuffer when we call
cogl_clear so there's no need for the stage to also chain up in it's pick
function resulting in clutter-actor.c also emitting a rectangle for the
stage.

14 years agotests: rename cogl conformance tests so they can be clearly identified
Robert Bragg [Fri, 27 Nov 2009 00:28:39 +0000 (00:28 +0000)]
tests: rename cogl conformance tests so they can be clearly identified

All Cogl conformance tests are now prefixed 'test-cogl-'

14 years agocogl: deprecate cogl_draw_buffer API and replace with a cogl_framebuffer API
Robert Bragg [Thu, 26 Nov 2009 19:06:35 +0000 (19:06 +0000)]
cogl: deprecate cogl_draw_buffer API and replace with a cogl_framebuffer API

cogl_push_draw_buffer, cogl_set_draw_buffer and cogl_pop_draw_buffer are now
deprecated and new code should use the new cogl_framebuffer_* API instead.

Code that previously did:
    cogl_push_draw_buffer ();
    cogl_set_draw_buffer (COGL_OFFSCREEN_BUFFER, buffer);
    /* draw */
    cogl_pop_draw_buffer ();
should now be re-written as:
    cogl_push_framebuffer (buffer);
    /* draw */
    cogl_pop_framebuffer ();

As can be seen from the example above the rename has been used as an
opportunity to remove the redundant target argument from
cogl_set_draw_buffer; it now only takes one call to redirect to an offscreen
buffer, and finally the term framebuffer may be a bit more familiar to
anyone coming from an OpenGL background.

14 years agocogl_offscreen: deprecate cogl_offscreen_ref/unref.
Robert Bragg [Thu, 26 Nov 2009 17:47:17 +0000 (17:47 +0000)]
cogl_offscreen: deprecate cogl_offscreen_ref/unref.

New code should use cogl_handle_ref/unref

14 years agocogl: Use a vtable for the texture backends instead of a type and switch
Neil Roberts [Wed, 25 Nov 2009 13:39:45 +0000 (13:39 +0000)]
cogl: Use a vtable for the texture backends instead of a type and switch

Instead of storing an enum with the backend type for each texture and
then using a switch statement to decide which function to call, we
should store pointers to all of the functions in a struct and have
each texture point to that struct. This is potentially slightly faster
when there are more backends and it makes implementing new backends
easier because it's more obvious which functions have to be
implemented.

14 years agooffscreen: cogl_offscreen_new_to_texture now supports GL_TEXTURE_RECTANGLE_ARB
Robert Bragg [Wed, 25 Nov 2009 02:47:52 +0000 (02:47 +0000)]
offscreen: cogl_offscreen_new_to_texture now supports GL_TEXTURE_RECTANGLE_ARB

cogl_offscreen_new_to_texture previously bailed out if the given texture's
GL target was anything but GL_TEXTURE_2D, but it now also allows
foreign GL_TEXTURE_RECTANGLE_ARB textures.

Thanks to Owen for reporting this issue, ref:
https://bugzilla.gnome.org/show_bug.cgi?id=601032

14 years agodebug: remove the COGL_DEBUG=client-side-matrices option
Robert Bragg [Tue, 24 Nov 2009 18:24:07 +0000 (18:24 +0000)]
debug: remove the COGL_DEBUG=client-side-matrices option

Cogl only supports client side matrices so this debug option is no longer
useful.

14 years ago[cogl-material] Adds cogl_material_copy() API
Robert Bragg [Wed, 11 Nov 2009 12:50:48 +0000 (12:50 +0000)]
[cogl-material] Adds cogl_material_copy() API

cogl_material_copy can be used to create a new CoglHandle referencing a copy
of some given material.

From now on we will advise that developers always aim to use this function
instead of cogl_material_new() when creating a material that is in any way
derived from another.

By using cogl_material_copy, Cogl can maintain an ancestry for each material
and keep track of "similar" materials.  The plan is that Cogl will use this
information to minimize the cost of GPU state transitions.

14 years ago[cogl] remove unused gles/cogl-utils.[c,h]
Robert Bragg [Wed, 11 Nov 2009 12:52:08 +0000 (12:52 +0000)]
[cogl] remove unused gles/cogl-utils.[c,h]

The only function in gles/cogl-utils.c was cogl_util_next_p2() and it's
redundant since we also have a cogl/cogl-utils.[c,h]

14 years agodocs: Don't document cogl_flush_gl_state as public API
Robert Bragg [Mon, 23 Nov 2009 11:30:32 +0000 (11:30 +0000)]
docs: Don't document cogl_flush_gl_state as public API

This function was #if 0'd before we released Clutter 1.0 so there's no
implementation of it.  At some point we thought it might assist with
developers breaking out into raw OpenGL.  Breaking out to raw GL is a
difficult problem though so we decided instead we will wait for a specific
use case to arrise before trying to support it.

14 years agoanimation: Keep a weak reference on actors
Emmanuele Bassi [Tue, 24 Nov 2009 16:59:24 +0000 (16:59 +0000)]
animation: Keep a weak reference on actors

Actors, unlike objects, can effectively go away whilst being
animated - usually because of an explicit destoy().

The Animation created by clutter_actor_animate() and friends
should keep a weak reference on the actor and eventually
get rid of the animation itself in case the actor goes away
whilst being animated.

14 years agoMinor fix to cogl material
Neil Roberts [Thu, 19 Nov 2009 16:07:38 +0000 (16:07 +0000)]
Minor fix to cogl material

_cogl_material_get_layer expects a CoglMaterial* pointer but it was
being called with a CoglHandle. This doesn't matter because the
CoglHandle is actually just the CoglMaterial* pointer anyway but it
breaks the ability to change the _cogl_material_pointer_from_handle
macro.

14 years agodocs: Add indices to the Cogl API reference
Emmanuele Bassi [Thu, 19 Nov 2009 14:30:01 +0000 (14:30 +0000)]
docs: Add indices to the Cogl API reference

The Clutter API reference has an index of the symbols for each minor
version, and a list of deprecated symbols. The Cogl API reference
should have the same layout.

14 years agodocs: Increase consistency in Cogl documentation
Emmanuele Bassi [Thu, 19 Nov 2009 13:55:10 +0000 (13:55 +0000)]
docs: Increase consistency in Cogl documentation

14 years agodocs: Documentation fixes for CoglMatrix
Emmanuele Bassi [Thu, 19 Nov 2009 13:33:26 +0000 (13:33 +0000)]
docs: Documentation fixes for CoglMatrix

Clean up the references, the docbook tags, and the style to fit in
with the rest of the API references for Cogl and Clutter.

14 years agoWhitespace fix for cogl-color.h
Emmanuele Bassi [Thu, 19 Nov 2009 13:33:08 +0000 (13:33 +0000)]
Whitespace fix for cogl-color.h

14 years agodocs: Documentation fixes for CoglMaterial
Emmanuele Bassi [Thu, 19 Nov 2009 13:31:38 +0000 (13:31 +0000)]
docs: Documentation fixes for CoglMaterial

Clean up the references, the docbook tags, and the style to fit in
with the rest of the API references for Cogl and Clutter.

14 years agodocs: Documentation fixes for CoglBitmap
Emmanuele Bassi [Thu, 19 Nov 2009 13:29:02 +0000 (13:29 +0000)]
docs: Documentation fixes for CoglBitmap

• Use the same style for the Cogl API reference as the one used for
  the Clutter API reference.

• Fix the introspection annotations for cogl_bitmap_get_size_from_file()

14 years agodocs: Fix Cogl API reference build
Emmanuele Bassi [Thu, 19 Nov 2009 12:34:06 +0000 (12:34 +0000)]
docs: Fix Cogl API reference build

• Ignore all the private header files

• Add all missing/unused symbols

• Remove deprecated symbols from 0.*

14 years agodocs: Remove non-gtk-doc annotations
Emmanuele Bassi [Thu, 19 Nov 2009 12:32:59 +0000 (12:32 +0000)]
docs: Remove non-gtk-doc annotations

The imported Mesa matrix code has some documentation annotations
that make gtk-doc very angry. Since it's all private anyway we
can safely make gtk-doc ignore the offending stuff.

14 years agodocs: Fix the 'Since' annotation for some functions
Neil Roberts [Thu, 19 Nov 2009 11:51:21 +0000 (11:51 +0000)]
docs: Fix the 'Since' annotation for some functions

The 'Since' annotation needs to have a colon after it or gtk-doc won't
pick it up.

14 years agocogl: Use APIENTRY for GL function pointer declarations
Neil Roberts [Wed, 18 Nov 2009 19:09:10 +0000 (19:09 +0000)]
cogl: Use APIENTRY for GL function pointer declarations

This matters for platforms such as Windows that use a different
calling covention from the default for GL functions.

14 years agobuild: Fix out-of-tree builds for cogl-defines.h
Neil Roberts [Wed, 18 Nov 2009 19:23:57 +0000 (19:23 +0000)]
build: Fix out-of-tree builds for cogl-defines.h

$(COGL_DRIVER)/cogl-defines.h is generated in the configure script so
it ends up in the build directory. Therefore the build rule for
cogl/cogl-defines.h should depend on the file in $(builddir) not
$(srcdir).