profile/ivi/clutter.git
14 years ago[layout] Initial implementation of FlowLayout
Emmanuele Bassi [Fri, 18 Sep 2009 16:28:02 +0000 (17:28 +0100)]
[layout] Initial implementation of FlowLayout

FlowLayout is a layout manager that arranges its children in a
reflowing line; the orientation controls the major axis for the
layout: horizontal, for reflow on the Y axis, and vertical, for
reflow on the X axis.

14 years ago[layout] Use FixedLayout inside Group
Emmanuele Bassi [Mon, 5 Oct 2009 16:21:41 +0000 (17:21 +0100)]
[layout] Use FixedLayout inside Group

The Group actor should use the FixedLayout layout manager object
to avoid duplicating code.

14 years ago[layout] Update FixedLayout
Emmanuele Bassi [Mon, 5 Oct 2009 16:09:04 +0000 (17:09 +0100)]
[layout] Update FixedLayout

The behaviour of ClutterGroup has been fixed with regards to the
preferred size request; the fixed layout manager should use the
same behaviour.

14 years ago[layout] Typo and whitespace fixes
Emmanuele Bassi [Fri, 18 Sep 2009 14:29:09 +0000 (15:29 +0100)]
[layout] Typo and whitespace fixes

14 years ago[layout, box] Add Box:color
Emmanuele Bassi [Thu, 17 Sep 2009 17:21:51 +0000 (18:21 +0100)]
[layout, box] Add Box:color

Allow setting the background color of a ClutterBox

14 years ago[layout, docs] Clean up BinLayout documentation
Emmanuele Bassi [Thu, 17 Sep 2009 10:38:43 +0000 (11:38 +0100)]
[layout, docs] Clean up BinLayout documentation

Documentation and code style fixes for BinLayout.

14 years ago[layout, tests] Use variants for child packing in Box
Emmanuele Bassi [Wed, 16 Sep 2009 14:55:30 +0000 (15:55 +0100)]
[layout, tests] Use variants for child packing in Box

There are three potential variants to add a child inside a Box
with a BinLayout:

  - clutter_box_pack(), a variadic argument function which
    allows passing arbitrary LayoutMeta properties and values;

  - clutter_bin_layout_add(), which uses the backpointer to
    the container from the LayoutManager and sets the layout
    properties directly without GValue (de)marshalling

  - clutter_container_add_actor() and
    clutter_bin_layout_set_alignment(), similar to the
    clutter_bin_layout_add() function above, but split in two

The test-box interactive test should exercise all three variants.

14 years ago[layout] Store and use the container inside BinLayout
Emmanuele Bassi [Wed, 16 Sep 2009 14:51:13 +0000 (15:51 +0100)]
[layout] Store and use the container inside BinLayout

The BinLayout should store a pointer to the Container that it is
using it as the layout manager.

This allows us to fix the API and drop the additional Container
arguments from set_alignment() and get_alignment().

This also allows us to add a ClutterBinLayout::add() method which
adds an actor and sets the alignment policies without dealing with
variadic arguments functions and GValue (de)marshalling.

14 years ago[layout] Set a back pointer to Box inside the layout
Emmanuele Bassi [Wed, 16 Sep 2009 14:48:28 +0000 (15:48 +0100)]
[layout] Set a back pointer to Box inside the layout

Use the LayoutManager API to set a back pointer to the Box actor
inside the LayoutManager used by the box.

This also allows us to replace the LayoutManager on a Box, since
the LayoutManager will be able to replace all the metadata if
needed.

14 years ago[layout] Replace stale LayoutMeta
Emmanuele Bassi [Wed, 16 Sep 2009 14:47:26 +0000 (15:47 +0100)]
[layout] Replace stale LayoutMeta

If a LayoutMeta references a different container and/or layout manager
then we should simply replace it and discard the previous one.

14 years ago[layout] Allow taking a back pointer to the Container
Emmanuele Bassi [Wed, 16 Sep 2009 13:58:30 +0000 (14:58 +0100)]
[layout] Allow taking a back pointer to the Container

The LayoutManager implementation might opt to take a back pointer
to the Container that is using the layout instance; this allows
direct access to the container itself from within the implementation.

14 years ago[layout] Rename Box::add to Box::pack
Emmanuele Bassi [Wed, 16 Sep 2009 10:10:45 +0000 (11:10 +0100)]
[layout] Rename Box::add to Box::pack

Since ClutterBox is a ClutterContainer we should avoid naming
collisions between methods.

14 years ago[layout, docs] Document FixedLayout
Emmanuele Bassi [Wed, 16 Sep 2009 10:10:38 +0000 (11:10 +0100)]
[layout, docs] Document FixedLayout

14 years ago[layout] Implement ClutterBox::add
Emmanuele Bassi [Tue, 15 Sep 2009 22:20:51 +0000 (23:20 +0100)]
[layout] Implement ClutterBox::add

The ClutterBox::add method is a simple wrapper around the Container
add_actor() method and the LayoutManager layout properties API. It
allows adding an actor to a Box and setting the layout properties in
one call.

If the LayoutManager used by the Box does not support layout properties
then the add() method short-circuits out.

Along with the varargs version of the method there's also a vector-based
variant, for language bindings to use.

14 years ago[layout] Add LayoutMeta
Emmanuele Bassi [Tue, 15 Sep 2009 16:37:11 +0000 (17:37 +0100)]
[layout] Add LayoutMeta

Instead of overloading ClutterChildMeta with both container and layout
metadata and delegate to every LayoutManager implementation to keep a
backpointer to the layout manager instance, we can simply subclass
ChildMeta into LayoutMeta and presto! everything works out pretty well
for everyone.

14 years ago[layout, docs] Add layout managers sections
Emmanuele Bassi [Tue, 15 Sep 2009 15:24:47 +0000 (16:24 +0100)]
[layout, docs] Add layout managers sections

Add LayoutManager and its subclasses, and the Box actor to the
gtk-doc machinery needed to generate the API reference.

14 years ago[layout] Add layers to BinLayout
Emmanuele Bassi [Mon, 14 Sep 2009 20:51:49 +0000 (21:51 +0100)]
[layout] Add layers to BinLayout

Each actor managed by a BinLayout policy should reside inside its
own "layer", with horizontal and vertical alignment. The :x-align
and :y-align properties of the BinLayout are the default alignment
policies, which are copied to each new "layer" when it is created.

The set_alignment() and get_alignment() methods of BinLayout can
be changed to operate on a specific "layer".

The whole machinery uses the new ChildMeta support inside the
LayoutManager base abstract class.

14 years ago[layout] Bind the layout ChildMeta inside Box
Emmanuele Bassi [Mon, 14 Sep 2009 20:50:20 +0000 (21:50 +0100)]
[layout] Bind the layout ChildMeta inside Box

The ClutterBox container actor should add and remove ChildMeta to
each actor that has been added and removed to the list of children,
respectively.

14 years ago[layout] Bind ChildMeta to LayoutManager
Emmanuele Bassi [Mon, 14 Sep 2009 20:48:06 +0000 (21:48 +0100)]
[layout] Bind ChildMeta to LayoutManager

The ChildMeta object is a storage for child-container properties,
that is properties that exist only when an actor is inside a specific
container. The LayoutManager delegate class should also have
layout-specific properties -- so, for this job, we can "recycle"
ChildMeta as the storage.

14 years ago[layout] Document BinLayout
Emmanuele Bassi [Mon, 14 Sep 2009 11:04:42 +0000 (12:04 +0100)]
[layout] Document BinLayout

14 years ago[layout] Notify of alignment changes in BinLayout
Emmanuele Bassi [Mon, 14 Sep 2009 11:03:38 +0000 (12:03 +0100)]
[layout] Notify of alignment changes in BinLayout

Emit the ::layout-changed when the BinLayout alignment policies change.

This will result in a queue_relayout() on the containers using the
BinLayout layout manager.

14 years ago[layout] Update Box
Emmanuele Bassi [Mon, 14 Sep 2009 10:28:34 +0000 (11:28 +0100)]
[layout] Update Box

* Use ::layout-changed to queue a relayout when the layout changes

* Destroy the Box children when destroying the Box

* Allow getting the layout manager from the Box

14 years ago[layout] Add LayoutManager::layout-changed signal
Emmanuele Bassi [Mon, 14 Sep 2009 10:04:11 +0000 (11:04 +0100)]
[layout] Add LayoutManager::layout-changed signal

If a sub-class of LayoutManager wishes to implement a parametrized
layout policy it also needs a way to notify the container using the
layout manager that the layout has changed. We cannot do it directly
and automatically from the LayoutManager because a) it has no back
link to the actor that it is using it and b) it can be attached to
multiple actors.

This is a job for <cue raising dramatic music> signals!

By adding ClutterLayoutManager::layout-changed (and its relative
emitted function) we can notify actors using the layout manager that
the layout parameters have been changed, and thus they should queue
a relayout.

14 years ago[tests] Add a Box interactive test
Emmanuele Bassi [Fri, 11 Sep 2009 14:34:13 +0000 (15:34 +0100)]
[tests] Add a Box interactive test

14 years ago[layout] Add BinLayout
Emmanuele Bassi [Fri, 11 Sep 2009 12:51:23 +0000 (13:51 +0100)]
[layout] Add BinLayout

A BinLayout is a simple layout manager that allocates a single cell,
providing alignment on both the horizontal and vertical axis.

If the container associated to the BinLayout has more than one child,
the preferred size returned by the layout manager will be as big as
the maximum of the children preferred sizes; the allocation will be
applied to all children - but it will still depend on each child
preferred size and the BinLayout horizontal and vertical alignment
properties.

The supported alignment properties are:

  * center: align the child by centering it
  * start: align the child at the top or left border of the layout
  * end: align the child at the bottom or right border of the layout
  * fill: expand the child to fill the size of the layout
  * fixed: let the child position itself

14 years ago[layout] Add Fixed layout manager
Emmanuele Bassi [Wed, 2 Sep 2009 11:37:16 +0000 (12:37 +0100)]
[layout] Add Fixed layout manager

The FixedLayout layout manager object implements the same layout
policy of ClutterGroup.

14 years ago[layout] Make LayoutManager a floating object
Emmanuele Bassi [Wed, 2 Sep 2009 10:55:22 +0000 (11:55 +0100)]
[layout] Make LayoutManager a floating object

A layout manager instance makes only sense if it's owned by a
container. For this reason, it should have a floating reference
instead of a full reference on construction; this allows constructing
Boxes like:

  box = clutter_box_new (clutter_fixed_layout_new ());

without leaking the layout manager instance.

14 years ago[box] Add ClutterBox
Emmanuele Bassi [Tue, 1 Sep 2009 16:42:50 +0000 (17:42 +0100)]
[box] Add ClutterBox

ClutterBox is an actor with no layout management. It relies on
a ClutterLayoutManager to perform size requisition and allocation
of its children.

14 years ago[layout] Add initial implementation of LayoutManager
Emmanuele Bassi [Tue, 1 Sep 2009 15:34:28 +0000 (16:34 +0100)]
[layout] Add initial implementation of LayoutManager

The LayoutManager class is an abstract proxy for the size requesition
and size allocation process in ClutterActor.

A ClutterLayoutManager sub-class must implement get_preferred_width(),
get_preferred_height() and allocate(); a ClutterContainer using the
LayoutManager API will then proxy the corresponding Actor virtual
functions to the LayoutManager instance. This allows having a generic
"blank" ClutterActor sub-class, implementing the ClutterContainer
interface, which leaves only the layout management implementation to
the application developers.

14 years agobuild: Clean up main Makefile.am
Emmanuele Bassi [Tue, 13 Oct 2009 18:27:03 +0000 (19:27 +0100)]
build: Clean up main Makefile.am

14 years agobuild: Move marshallers and enum types rules out
Emmanuele Bassi [Tue, 13 Oct 2009 16:27:19 +0000 (17:27 +0100)]
build: Move marshallers and enum types rules out

The rules to create signal marshallers and enumeration GTypes are
usually copied and pasted all over different projects, though they
are pretty generic and, given a little bit of parametrization, can
be put in separate Makefile.am files and included whenever needed.

14 years agodocs: Allow XInclude fallback for the annotation glossary
Emmanuele Bassi [Tue, 13 Oct 2009 16:00:15 +0000 (17:00 +0100)]
docs: Allow XInclude fallback for the annotation glossary

14 years agodocs: Make StageManager a public class
Emmanuele Bassi [Sat, 10 Oct 2009 12:52:46 +0000 (13:52 +0100)]
docs: Make StageManager a public class

The StageManager API is useful to track the stages of an application.
It will also be useful when we land the modules API.

14 years agostage/manager: Set :default-stage as read-only
Emmanuele Bassi [Sat, 10 Oct 2009 12:51:47 +0000 (13:51 +0100)]
stage/manager: Set :default-stage as read-only

The StageManager:default-stage property should be read-only, since
the default stage is owned by Clutter itself.

14 years agostage/manager: Deprecate set_default_stage()
Emmanuele Bassi [Sat, 10 Oct 2009 12:50:25 +0000 (13:50 +0100)]
stage/manager: Deprecate set_default_stage()

The set_default_stage() method of StageManager should not be used
by application code; technically, nothing in Clutter uses it, and
StageManager's API is not considered public anyway.

14 years ago[actor] Unset the IN_DESTRUCTION flag when leaving ::destroy()
Damien Lespiau [Fri, 9 Oct 2009 16:18:34 +0000 (17:18 +0100)]
[actor] Unset the IN_DESTRUCTION flag when leaving ::destroy()

The IN_DESTRUCTION flag is set around the unrealization and disposal of
the actor in clutter_actor_destroy() but is never unset (it's set twice
instead).

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agotext: Make the :text property not set the :use-markup one
Emmanuele Bassi [Wed, 7 Oct 2009 20:44:17 +0000 (21:44 +0100)]
text: Make the :text property not set the :use-markup one

Currently, setting the :text property has the side-effect of
setting the :use-markup property to FALSE. This prevents
constructing a Text actor, or setting its properties, like:

  g_object_set (text,
                "use-markup", TRUE,
                "text", some_string,
                NULL);

as the ordering becomes important. Unfortunately, the ordering
of the properties cannot be enforced with ClutterScript or
with language bindings.

The documentation of the clutter_text_set_text() method should
be expanded to properly specify that the set_text() method will
change the :use-markup property to FALSE as a side effect.

14 years agodocs: Add the "clipping" section to the COGL API reference
Emmanuele Bassi [Wed, 7 Oct 2009 16:35:11 +0000 (17:35 +0100)]
docs: Add the "clipping" section to the COGL API reference

All the clip-related API in COGL is missing from the API reference
because the cogl-clipping section is not included inside the main
index file.

14 years ago[units] Ensure we don't have ponies
Damien Lespiau [Wed, 7 Oct 2009 16:09:41 +0000 (17:09 +0100)]
[units] Ensure we don't have ponies

The documentation states we should not parse ponies. Even with those
with exclamation marks.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years ago[path] Add GValue transform functions from and to G_TYPE_STRING
Damien Lespiau [Mon, 5 Oct 2009 23:49:40 +0000 (00:49 +0100)]
[path] Add GValue transform functions from and to G_TYPE_STRING

Transform functions allow the use of g_value_transform() to cast
GValues. It's very handy to have casts to and from G_TYPE_STRING as it
allows generic serialization and parsing of GTypes.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years ago[units] Add support for centimeters
Damien Lespiau [Tue, 6 Oct 2009 16:47:34 +0000 (17:47 +0100)]
[units] Add support for centimeters

The only tricky part of the patch is to remember that 1cm is 10mm.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years ago[units] Be more strict in the grammar we are parsing
Damien Lespiau [Tue, 6 Oct 2009 11:02:15 +0000 (12:02 +0100)]
[units] Be more strict in the grammar we are parsing

Current parsing of units has a number of shortcomings:
  * a number followed by trailing space (without any unit specified) was
    not recognized,
  * "5 emeralds" was parsed as 5em,
  * the way we parse the digits after the separator makes us lose
    precision for no good reason (5.0 is parsed as 5.00010014...f which
    makes g_assert_cmpfloat() fail)

Let's define a stricter grammar we can recognize and try to do so. The
description is in EBNF form, removing the optional <> which is a pain
when having to write DocBook, and using '' for the terminal symbols.

Last step, add more ClutterUnits unit test to get a better coverage of
the grammar we want to parse.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years agocolor: Measure the string just once when parsing
Emmanuele Bassi [Wed, 7 Oct 2009 12:00:57 +0000 (13:00 +0100)]
color: Measure the string just once when parsing

Instead of measuring the color hexadecimal string for each case, just
measure it once and then use a switch() to go to the right case.

14 years ago[color] allow alpha to be omitted when converting to color from string
Thomas Wood [Wed, 7 Oct 2009 11:27:38 +0000 (12:27 +0100)]
[color] allow alpha to be omitted when converting to color from string

Parse #rgb and #rrggbb in addition to forms with the alpha channel
specified. This allows conversion of colour strings from documents such as
CSS where the alpha channel is not specified when using '#' notation.

This patch also adds the relevant conformance test.

14 years ago[clutter-id-pool] Also warn if the ID refers to a deleted actor
Neil Roberts [Wed, 7 Oct 2009 10:31:44 +0000 (11:31 +0100)]
[clutter-id-pool] Also warn if the ID refers to a deleted actor

We should also warn if the glReadPixels happens to generate an ID that
is within the range of the ID array but no longer points to an
existing actor.

14 years ago[clutter-id-pool] Fix the check for out-of-range IDs
Neil Roberts [Wed, 7 Oct 2009 11:46:43 +0000 (12:46 +0100)]
[clutter-id-pool] Fix the check for out-of-range IDs

If id == the length of the array then it is also invalid and could
cause a crash.

14 years agoRevert "[color] allow alpha to omitted when converting from strings"
Thomas Wood [Wed, 7 Oct 2009 11:15:26 +0000 (12:15 +0100)]
Revert "[color] allow alpha to omitted when converting from strings"

This reverts commit eb8daac4b0726c1d9925bbbaeed7a8f39007da21.

The original commit was incorrect and pushed accidentally.

14 years ago[color] add a note to the documentation to specify the values of the alpha
Thomas Wood [Wed, 7 Oct 2009 10:40:41 +0000 (11:40 +0100)]
[color] add a note to the documentation to specify the values of the alpha

The alpha channel is fully opaque at 255 and fully transparent at 0.

14 years ago[color] allow alpha to omitted when converting from strings
Thomas Wood [Wed, 7 Oct 2009 10:38:08 +0000 (11:38 +0100)]
[color] allow alpha to omitted when converting from strings

Parse #rgb and #rrggbb in addition to forms with the alpha channel
specified. This allows conversion of colour strings from documents such as
CSS where the alpha channel is not specified when using '#' notation.

14 years ago[path] MOVE_TO and LINE_TO only use a pair of coordinates
Damien Lespiau [Tue, 6 Oct 2009 00:04:50 +0000 (01:04 +0100)]
[path] MOVE_TO and LINE_TO only use a pair of coordinates

The documentation of ClutterPathNode had a small typo and stated that
they use 2 pairs of coordinates.

14 years ago[debug] Guard the use of gdk_pixbuf for pick debugging by #ifdef USE_GDKPIXBUF
Robert Bragg [Mon, 5 Oct 2009 15:46:24 +0000 (16:46 +0100)]
[debug] Guard the use of gdk_pixbuf for pick debugging by #ifdef USE_GDKPIXBUF

gdk is an optional clutter dependency, so the pick buffer debugging option
needs some guards so we don't break, for example, the OSX builds.  This also
adds a comment for the bit fiddling done on the pick colors used to ensure
the pick colors are more distinguished while debugging.  (we swap the
nibbles of each color component so that pick buffers don't just look black.)

14 years ago[sdl] Update the SDL backend to the new StageWindow API
Emmanuele Bassi [Mon, 5 Oct 2009 14:51:28 +0000 (15:51 +0100)]
[sdl] Update the SDL backend to the new StageWindow API

The SDL backend remains experimental and not meant for public
consumption, but at least it compiles and runs successfully.

14 years ago[eglx] Create a StageWindow, not an Actor
Emmanuele Bassi [Mon, 5 Oct 2009 14:53:06 +0000 (15:53 +0100)]
[eglx] Create a StageWindow, not an Actor

The Backend should create a StageWindow instance, not an Actor.

14 years ago[ClutterGroup] Don't take into account the left edges when calculating the size
Neil Roberts [Tue, 29 Sep 2009 11:11:55 +0000 (12:11 +0100)]
[ClutterGroup] Don't take into account the left edges when calculating the size

ClutterGroup previously calculated the size as the distance from the
left edge of the leftmost child to the right edge of the rightmost
child except if there were any chidren left of the origin then the
left edge would be zero.

However the group is always allocated its size relative to its
origin so if all of the children are to the right of the origin then
the preferred size would not be large enough to reach the rightmost
child.

    origin
    ┼──────────┐
    │Group     │
    │ ┌────────┼─┐
    │ │Child   │ │
    │ │        │ │
    └─┼────────┘ │
      │          │
      └──────────┘
       group size
      ╟──────────╢

This patch makes it so the size is always just the rightmost edge.

    origin
    ┼────────────┐
    │Group       │
    │ ┌──────────┤
    │ │Child     │
    │ │          │
    │ │          │
    │ │          │
    └─┴──────────┘
      group size
    ╟────────────╢

Fixes bug:

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

14 years ago[eglx] Update the EGLX Stage to the new StageWindow API
Emmanuele Bassi [Mon, 5 Oct 2009 13:58:08 +0000 (14:58 +0100)]
[eglx] Update the EGLX Stage to the new StageWindow API

Move the ::realize and ::unrealize implementations over to the
StageWindow instead of using Actor.

14 years agoFix string parsing when no unit is given
Damien Lespiau [Sat, 3 Oct 2009 13:08:33 +0000 (14:08 +0100)]
Fix string parsing when no unit is given

The check should really be on the character pointed by str. Added the
corresponding test case.

14 years agoclutter_value_get_unit() has not be renamed
Damien Lespiau [Sat, 3 Oct 2009 11:15:13 +0000 (12:15 +0100)]
clutter_value_get_unit() has not be renamed

Since the Great Rework of ClutterUnits, functions have been using
'units' not 'unit' in their name. clutter_value_get_unit() is a left
over from a dark age, its declaration and documentation have been
updated but not the symbol itself.

14 years agoMerge branch 'stage-window-object'
Emmanuele Bassi [Mon, 5 Oct 2009 11:37:08 +0000 (12:37 +0100)]
Merge branch 'stage-window-object'

* stage-window-object:
  [x11] Fix Stage user-initiated resize
  [x11] Remove a useless forced paint
  [stage] Rework the Stage implementation class

14 years agoClarify the IdPool warning
Emmanuele Bassi [Mon, 5 Oct 2009 11:34:48 +0000 (12:34 +0100)]
Clarify the IdPool warning

Instead of having an assertion failure with a message of dubious
usefulness, we should probably use a more verbose warning explaining
what is the problem and what might be the cause.

14 years ago[x11] Fix Stage user-initiated resize
Emmanuele Bassi [Mon, 5 Oct 2009 11:24:19 +0000 (12:24 +0100)]
[x11] Fix Stage user-initiated resize

The user-initiated resize is conflicting with the allocated size. This
happens because we change the size of the stage's X Window behind the
back of the size allocation machinery.

Instead, we should change the size of the actor whenever we receive a
ConfigureNotify event to reflect the new size of the actor.

14 years ago[x11] Remove a useless forced paint
Emmanuele Bassi [Mon, 5 Oct 2009 11:21:02 +0000 (12:21 +0100)]
[x11] Remove a useless forced paint

We force the redraw before mapping, in the hope that when a composited
window manager maps the window it will have its contents ready; that is
not going to work: the solution for this problem requires the implementation
of a protocol for compositors, and not a hack.

Moreover, painting before mapping will cause a paint with the wrong
GL viewport size, which is the wrong thing to do on GLX.

14 years ago[docs] Update the "Subclassing Actor" chapter
Emmanuele Bassi [Sun, 27 Sep 2009 10:38:01 +0000 (11:38 +0100)]
[docs] Update the "Subclassing Actor" chapter

The chapter on how to subclass ClutterActor inside the API reference for
Clutter is still using ClutterUnit and referencing to concepts that have
been changed since the document was written.

14 years ago[cogl-debug] avoid warnings when using COGL_NOTE with unbraced else clauses
Robert Bragg [Mon, 27 Jul 2009 23:40:29 +0000 (00:40 +0100)]
[cogl-debug] avoid warnings when using COGL_NOTE with unbraced else clauses

When not building a debug build the compiler was warning about empty
else clauses with no braces due to code like:
  if (blah)
do_foo();
  else
COGL_NOTE (DRAW, "a-wibble");

This simply ensures that even for non debug builds COGL_NOTE will expand to
a single statement.

14 years ago[cogl-vertex-buffer] fix n_components validation for GL's builtin attributes
Robert Bragg [Thu, 24 Sep 2009 16:34:26 +0000 (17:34 +0100)]
[cogl-vertex-buffer] fix n_components validation for GL's builtin attributes

glVertexPointer expects positions with 2, 3 or 4 components, glColorPointer
expects colors with 3 or 4 components and glNormalPointer expects normals
with three components so when adding vertex buffer atributes with the names
"gl_Vertex", "gl_Color" or "gl_Normal" we assert these constraints and print
an explanation to the developer if not met.

This also fixes the previosly incorrect constraint that gl_Normal attributes
must have n_components == 1; thanks to Cat Sidhe for reporting this:

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

14 years ago[debug] Adds a dump-pick-buffers CLUTTER_DEBUG option
Robert Bragg [Thu, 24 Sep 2009 11:49:17 +0000 (12:49 +0100)]
[debug] Adds a dump-pick-buffers CLUTTER_DEBUG option

Now if you export CLUTTER_DEBUG=dump-pick-buffers clutter will write out a
png, e.g.  pick-buffer-00000.png, each time _clutter_to_pick() is called.
It's a rather crude way to debug the picking (realtime visualization in a
second stage would probably be nicer) but it we've used this approach
successfully numerous times when debugging Clutter picking issues so it
makes sense to have a debug option for it.

14 years ago[container] Remove the unused 'object' variable in destroy_child_meta
Neil Roberts [Tue, 22 Sep 2009 16:55:04 +0000 (17:55 +0100)]
[container] Remove the unused 'object' variable in destroy_child_meta

Since commit b2f958a61 this variable is no longer used so it was
causing compiler warnings.

14 years ago[tests] Remove test-entry.c since we don't have a ClutterEntry any more
Robert Bragg [Tue, 22 Sep 2009 10:27:47 +0000 (11:27 +0100)]
[tests] Remove test-entry.c since we don't have a ClutterEntry any more

Removes an unused interactive unit test for the old ClutterEntry actor we
used to have.

14 years ago[backend-egl] fix clutter_backend_egl_get_visual_info to not use Xalloc
Robert Bragg [Thu, 20 Aug 2009 10:53:37 +0000 (11:53 +0100)]
[backend-egl] fix clutter_backend_egl_get_visual_info to not use Xalloc

It looks like the intention was to duplicate an XVisualInfo in such a way
that the pointer could be returned and then later freed using XFree.  But
Xalloc isn't an Xlib counterpart to XFree; Xlib doesn't provide a general
purpose malloc wrapper afik.  By shuffling things about a bit, it was
possible to avoid the need for this hack.

14 years agoAdd a few annotations on Cogl primitives functions
Damien Lespiau [Mon, 21 Sep 2009 14:21:21 +0000 (15:21 +0100)]
Add a few annotations on Cogl primitives functions

By default, float * is considered as an out argument by gobject
introspection which is wrong for quite a few Cogl symbols. Start adding
annotations to fix that for the ones in the "Primitives" gtk-doc
section.

14 years ago[container] cast actor to gobject before calling g_object_set_qdata
Robert Bragg [Mon, 21 Sep 2009 17:12:02 +0000 (18:12 +0100)]
[container] cast actor to gobject before calling g_object_set_qdata

A minor compiler warning fix: in destroy_child_meta we weren't casting the
first argument to g_object_set_qdata to a gobject.

14 years ago[container] unset the child meta qdata on the child, not the container
Øyvind Kolås [Mon, 21 Sep 2009 14:55:58 +0000 (15:55 +0100)]
[container] unset the child meta qdata on the child, not the container

In the default implementation of container::destroy_child_meta Set child
meta qdata to NULL on the child and not the container, since the child
is the object that owns the data.

14 years ago[container] set the child meta qdata on the child, not the container
Thomas Wood [Mon, 21 Sep 2009 14:40:53 +0000 (15:40 +0100)]
[container] set the child meta qdata on the child, not the container

Set child meta qdata on the child and not the container, since the child is
the object that owns the data.

14 years ago[cogl] Remove CoglContext->journal_vbo{,_len}
Neil Roberts [Thu, 17 Sep 2009 17:29:03 +0000 (18:29 +0100)]
[cogl] Remove CoglContext->journal_vbo{,_len}

The lifetime of the journal VBO is entirely within the scope of the
cogl_journal_flush function so there is no need to store it globally
in the Cogl context. Instead, upload_vertices_to_vbo just returns the
new VBO. cogl_journal_flush stores this in a local variable and
destroys it before returning.

This also fixes an assertion when using the GLES backend which was
caused by nothing initialising the journal_vbo variable.

14 years ago[build] Split out the custom silent rules
Emmanuele Bassi [Wed, 16 Sep 2009 16:43:58 +0000 (17:43 +0100)]
[build] Split out the custom silent rules

The silent rules we use for custom targets should be moved into a
separate Makefile.am that gets included from all the others.

14 years ago[test-cogl-multitexture] Print an error if textures can't be loaded
Robert Bragg [Wed, 16 Sep 2009 16:12:30 +0000 (17:12 +0100)]
[test-cogl-multitexture] Print an error if textures can't be loaded

I just wasted a silly amount time trying to bisect an apparently broken
cogl-test-multitexture until I realized it was just silently failing to load
any textures.

14 years ago[docs] Fix the comment on version bumps
Emmanuele Bassi [Wed, 16 Sep 2009 11:47:46 +0000 (12:47 +0100)]
[docs] Fix the comment on version bumps

14 years ago[gitignore] Add test-preferred-size
Emmanuele Bassi [Wed, 16 Sep 2009 10:57:45 +0000 (11:57 +0100)]
[gitignore] Add test-preferred-size

14 years ago[timeline] Account for clock roll backs between frames
Emmanuele Bassi [Wed, 16 Sep 2009 10:55:04 +0000 (11:55 +0100)]
[timeline] Account for clock roll backs between frames

If the system clock rolls back between two frames then we need
to account for the change, to avoid stopping the timeline.

The best option, since a roll back can be any arbitrary amount
of milliseconds, is to skip a frame.

Fixes bug:

  http://bugzilla.moblin.org/show_bug.cgi?id=3839

14 years ago[cogl-fbo] Disable mipmap filters before calling glCheckFramebufferStatusEXT
Robert Bragg [Tue, 15 Sep 2009 15:27:45 +0000 (16:27 +0100)]
[cogl-fbo] Disable mipmap filters before calling glCheckFramebufferStatusEXT

The framebuffer_object spec isn't clear in defining whether attaching a
texture as a renderbuffer with mipmap filtering enabled while the mipmaps
have not been uploaded should result in an incomplete framebuffer object.
(different drivers make different decisions)

To avoid an error with drivers that do consider this a problem we explicitly
set non mipmapped filters before calling glCheckFramebufferStatusEXT.  The
filters will later be reset when the texture is actually used for rendering
according to the filters set on the corresponding CoglMaterial.

14 years ago[tests] Add preferred size conformance test unit
Emmanuele Bassi [Tue, 15 Sep 2009 10:09:49 +0000 (11:09 +0100)]
[tests] Add preferred size conformance test unit

This unit verifies that an Actor class will invoke the get_preferred_*
virtual functions unless the caching is in effect; it also verifies
that the cached values are correctly evicted.

14 years ago[tests] Add initial sizing conformance test suite
Emmanuele Bassi [Mon, 14 Sep 2009 20:45:51 +0000 (21:45 +0100)]
[tests] Add initial sizing conformance test suite

The size requisition and allocation mechanisms should be thoroughly
tested to avoid unwanted regressions.

For starters, we can test the explicit size setting and the side
effects of calling clutter_actor_set_size().

14 years ago[container] Use a 1:1 mapping between child and ChildMeta
Emmanuele Bassi [Mon, 14 Sep 2009 14:57:31 +0000 (15:57 +0100)]
[container] Use a 1:1 mapping between child and ChildMeta

Since an actor can only be parented to one container we don't need
the extra complications of maintaining a list of ChildMeta objects
attached to an actor in the default implementation of the Container
interface.

14 years ago[docs] Clutter's model implementation is called ClutterListModel
Damien Lespiau [Thu, 10 Sep 2009 12:27:02 +0000 (13:27 +0100)]
[docs] Clutter's model implementation is called ClutterListModel

It was renamed from ClutterModelDefault to ClutterListModel a while
back. Update the reference to this class in ClutterModel documentation.

14 years ago[docs] Add fixxref for Cairo symbols
Emmanuele Bassi [Wed, 9 Sep 2009 15:15:54 +0000 (16:15 +0100)]
[docs] Add fixxref for Cairo symbols

Let gtk-doc resolve the Cairo types and symbols to the installed
Cairo documentation.

14 years ago[docs] Add a Path migration guide
Emmanuele Bassi [Wed, 9 Sep 2009 15:01:07 +0000 (16:01 +0100)]
[docs] Add a Path migration guide

ClutterBehaviourPath has been changed and ClutterBehaviourBspline has
been removed; now we use ClutterPath everywhere we need to describe a
path. This warrants a chapter in the migration guide.

14 years ago[text] implement get_property for "use-markup"
Øyvind Kolås [Tue, 8 Sep 2009 12:06:51 +0000 (13:06 +0100)]
[text] implement get_property for "use-markup"

14 years ago[stage] Rework the Stage implementation class
Emmanuele Bassi [Thu, 13 Aug 2009 11:34:07 +0000 (12:34 +0100)]
[stage] Rework the Stage implementation class

Instead of using ClutterActor for the base class of the Stage
implementation we should extend the StageWindow interface with
the required bits (geometry, realization) and use a simple object
class.

This require a wee bit of changes across Backend, Stage and
StageWindow, even though it's mostly re-shuffling.

First of all, StageWindow should get new virtual functions:

  * geometry:
    - resize()
    - get_geometry()

  * realization
    - realize()
    - unrealize()

This covers all the bits that we use from ClutterActor currently
inside the stage implementations.

The ClutterBackend::create_stage() virtual function should create
a StageWindow, and not an Actor (it should always have been; the
fact that it returned an Actor was a leak of the black magic going
on underneath). Since we never guaranteed ABI compatibility for
the Backend class, this is not a problem.

Internally to ClutterStage we can finally drop the shenanigans of
setting/unsetting actor flags on the implementation: if the realization
succeeds, for instance, we set the REALIZED flag on the Stage and
we're done.

As an initial proof of concept, the X11 and GLX stage implementations
have been ported to the New World Order(tm) and show no regressions.

14 years ago[docs] Small annotation fixes
Emmanuele Bassi [Mon, 7 Sep 2009 10:44:44 +0000 (11:44 +0100)]
[docs] Small annotation fixes

14 years ago[animation] Move the check for the 'signal::' prefix into a separate function
Neil Roberts [Mon, 7 Sep 2009 10:36:05 +0000 (11:36 +0100)]
[animation] Move the check for the 'signal::' prefix into a separate function

The old code checked whether the property began with 'signal-' and
then checked for 'signal-swapped' and 'signal-after'. This prevented
you from animating a property called for example 'signal-strength'.

The check for the prefix is now in a separate function which also adds
a 'signal-swapped-after' prefix for completeness.

Fixes bug:

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

14 years ago[docs] Add more collateral documentation
Emmanuele Bassi [Thu, 3 Sep 2009 15:51:14 +0000 (16:51 +0100)]
[docs] Add more collateral documentation

* Add the main Glossary for Clutter terms

* Add the annotation glossary, as generated by gtk-doc

* Add the objects index and tree

14 years agoDOT3_RGB[A] cannot be used in a Blend String
Samuel Degrande [Wed, 2 Sep 2009 15:27:22 +0000 (16:27 +0100)]
DOT3_RGB[A] cannot be used in a Blend String

The blend string compiler checks that the syntax of a function name is
[A-Za-z_]*, preventing the use of DOT3_RGB[A].

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
14 years ago[model] Do not attempt to free empty column names
Emmanuele Bassi [Wed, 2 Sep 2009 14:26:33 +0000 (15:26 +0100)]
[model] Do not attempt to free empty column names

The column names are optional - ClutterModel will use the GType name
if there is no user-specified column name. Hence, the ::finalize vfunc
should not try to free an empty column names vector.

Fixes bug:

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

14 years ago[docs] Make sure to document the point-release process
Emmanuele Bassi [Mon, 31 Aug 2009 14:49:39 +0000 (15:49 +0100)]
[docs] Make sure to document the point-release process

Put the documentation right inside configure.ac, lest I forget.

14 years agoTake a reference to the material in clutter_texture_set_cogl_material
Neil Roberts [Wed, 26 Aug 2009 17:28:35 +0000 (18:28 +0100)]
Take a reference to the material in clutter_texture_set_cogl_material

The material is unref'd in clutter_texture_finalize and the
documentation explicitly states that the function will take a ref so
it really should.

14 years agoFix the documentation for clutter_texture_set_cogl_material
Neil Roberts [Wed, 26 Aug 2009 17:24:48 +0000 (18:24 +0100)]
Fix the documentation for clutter_texture_set_cogl_material

The documentation was a copy of the docs for set_cogl_texture so it
was somewhat broken.

14 years ago[tests] Update the script test JSON
Emmanuele Bassi [Wed, 26 Aug 2009 15:50:37 +0000 (16:50 +0100)]
[tests] Update the script test JSON

The test-script.json UI definition still used old types, like
ClutterLabel and ClutterCloneTexture. It should move to the classes
that have replaced them.

14 years ago[script] Clean up the ad hoc parsing code in Actor
Emmanuele Bassi [Wed, 26 Aug 2009 15:49:45 +0000 (16:49 +0100)]
[script] Clean up the ad hoc parsing code in Actor

The old parsing code still assumed we had integers for pixels
and floating point values for percentages; this is not the case
anymore.

14 years ago[script] Convert double to float when parsing
Emmanuele Bassi [Wed, 26 Aug 2009 15:48:32 +0000 (16:48 +0100)]
[script] Convert double to float when parsing

The default floating point type for JSON is double precision; this means
that we need to conver to single precision when setting a property with
type G_TYPE_FLOAT.

14 years ago[tests] Add a Group actor unit
Emmanuele Bassi [Tue, 25 Aug 2009 16:55:51 +0000 (17:55 +0100)]
[tests] Add a Group actor unit

We need to test that the depth sorting of ClutterGroup works correctly
in case we wish to change the data structure that stores the children,
and do so without changing the default behaviour.

14 years ago[group] Use floating point in sort_z_order
Øyvind Kolås [Tue, 25 Aug 2009 16:32:42 +0000 (17:32 +0100)]
[group] Use floating point in sort_z_order