profile/ivi/clutter.git
15 years ago[animation] Add vector variants for ::animate()
Emmanuele Bassi [Mon, 9 Mar 2009 21:11:40 +0000 (21:11 +0000)]
[animation] Add vector variants for ::animate()

Bug 1438 - Implicit Animation API could use animatev variants

The clutter_actor_animate* family of functions use va_lists to
handle the property/value pairs for the final state of the
animation.

Language bindings have problems with variadic arguments functions,
and usually prefer vector-based API which allow a greater level
of control and conversion from native data types.

For each variadic arguments function in the clutter_actor_animate*
family there should be a vector-based version that takes:

  - the number of property/value pairs
  - a constant array of constant strings
  - an array of GValues

Most of the internal implementation can be refactored from the
current one, thus both the var_args and the vector entry points
share a common implementation of the code; then, both versions
of the API are just loops over a list of arguments.

Based on a patch by: Robert Carr <carrr@rpi.edu>

15 years ago[docs] Update API reference
Emmanuele Bassi [Mon, 9 Mar 2009 18:28:15 +0000 (18:28 +0000)]
[docs] Update API reference

The API reference was still listing some symbols that have been
removed.

15 years ago[docs] Remove ClutterFixed from the documentation
Emmanuele Bassi [Mon, 9 Mar 2009 17:56:48 +0000 (17:56 +0000)]
[docs] Remove ClutterFixed from the documentation

Now that ClutterFixed has finally gone the way of the Dodo, we
can safely remove it from the API reference as well.

15 years ago[cogl] Fix hardcoded paths in the pc file
Emmanuele Bassi [Mon, 9 Mar 2009 17:47:21 +0000 (17:47 +0000)]
[cogl] Fix hardcoded paths in the pc file

The commit 24ce193836 fixed the Clutter pkg-config file. Since
COGL now ships its own, we need to fix that as well.

15 years ago[fixed] Remove ClutterFixed API
Emmanuele Bassi [Mon, 9 Mar 2009 17:36:22 +0000 (17:36 +0000)]
[fixed] Remove ClutterFixed API

Since the switch from fixed point to floating point, and the introduction
of CoglFixed, ClutterFixed has been typedef'd into a float. This makes
ClutterFixed the worst fixed point API ever.

Now that Clutter has been migrated to CoglFixed and gfloat whenever needed,
ClutterFixed can be safely removed.

The only thing that Clutter should still provide is ClutterParamSpecFixed,
for installing fixed point properties into GObject classes.

The ClutterFixed symbols have been entirely removed from the API.

15 years ago[units] Add more conversion functions
Emmanuele Bassi [Mon, 9 Mar 2009 17:35:08 +0000 (17:35 +0000)]
[units] Add more conversion functions

A GValue containing a ClutterUnit should be transformable into a
GValue holding an integer, a floating point value or a fixed point
value.

This means adding more transformation functions when registering
the ClutterUnit GType.

15 years ago[tests] Use floats, not ClutterFixed
Emmanuele Bassi [Mon, 9 Mar 2009 17:34:23 +0000 (17:34 +0000)]
[tests] Use floats, not ClutterFixed

The COGL API expects floats, not ClutterFixed, so we need
to use the right type when calling it.

15 years ago[text] Convert units to the right type
Emmanuele Bassi [Mon, 9 Mar 2009 17:32:15 +0000 (17:32 +0000)]
[text] Convert units to the right type

The COGL API expects a floating point value, so Units should be
converted to floats, not to ClutterFixed.

15 years ago[texture] Fix ClutterFixed usage
Emmanuele Bassi [Mon, 9 Mar 2009 17:31:44 +0000 (17:31 +0000)]
[texture] Fix ClutterFixed usage

Do not use ClutterFixed and its macros inside the Texture.

15 years ago[stage] Coalesce fog and perspective API
Emmanuele Bassi [Mon, 9 Mar 2009 17:24:44 +0000 (17:24 +0000)]
[stage] Coalesce fog and perspective API

The fog and perspective API is currently split in two parts:

  - the floating point version, using values

  - the fixed point version, using structures

The relative properties are using the structure types, since they
are meant to set multiple values at the same time. Instead of
using bare values, the whole API should be coalesced into two
simple calls using structures to match the GObject properties.

Thus:

  clutter_stage_set_fog (ClutterStage*, const ClutterFog*)
  clutter_stage_get_fog (ClutterStage*, ClutterFog*)

  clutter_stage_set_perspective (ClutterStage*, const ClutterPerspective*)
  clutter_stage_get_perspective (ClutterStage*, ClutterPerspective*)

Which supercedes the fixed point and floating point variants.

More importantly, both ClutterFog and ClutterPerspective should
using floating point values, since that's what get passed to
COGL anyway.

ClutterFog should also drop the "density" member, since ClutterStage
only allows linear fog; non-linear fog distribution can be achieved
using a signal handler and calling cogl_set_fog() directly; this keeps
the API compact yet extensible.

Finally, there is no ClutterStage:fog so it should be added.

15 years ago[interval] Update fixed-point handling
Emmanuele Bassi [Mon, 9 Mar 2009 17:08:41 +0000 (17:08 +0000)]
[interval] Update fixed-point handling

Do not use ClutterFixed when dealing with fixed point values. Use
CoglFixed instead.

15 years ago[tests] Test CoglFixed, not ClutterFixed
Emmanuele Bassi [Mon, 9 Mar 2009 17:07:47 +0000 (17:07 +0000)]
[tests] Test CoglFixed, not ClutterFixed

We really want to test the CoglFixed implementation, not the
to-be-deprecated ClutterFixed one.

15 years ago[cogl-fixed] Implement the CoglFixed fundamental GType
Emmanuele Bassi [Mon, 9 Mar 2009 17:06:22 +0000 (17:06 +0000)]
[cogl-fixed] Implement the CoglFixed fundamental GType

The type machinery for CoglFixed should be implemented by COGL
itself, now that COGL exports the GType of its types.

This allows moving most of what ClutterFixed did directly to
CoglFixed where it belongs.

15 years agoMove ClutterTimeline to CoglFixed
Emmanuele Bassi [Mon, 9 Mar 2009 17:05:13 +0000 (17:05 +0000)]
Move ClutterTimeline to CoglFixed

The ClutterTimeline::get_progressx() method should return a
CoglFixed, now that ClutterFixed is being deprecated.

15 years agoMove ClutterBehaviourRotate to CoglFixed
Emmanuele Bassi [Mon, 9 Mar 2009 17:03:37 +0000 (17:03 +0000)]
Move ClutterBehaviourRotate to CoglFixed

Remove the wrong usage of ClutterFixed and use CoglFixed instead
in the API and the implementation.

15 years agoMove ClutterBehaviourEllipse to CoglFixed
Emmanuele Bassi [Mon, 9 Mar 2009 17:03:00 +0000 (17:03 +0000)]
Move ClutterBehaviourEllipse to CoglFixed

Remove the wrong usage of ClutterFixed, and use CoglFixed instead
in the API and the implementation.

15 years agoMove BehaviourScale to CoglFixed
Emmanuele Bassi [Thu, 5 Mar 2009 20:17:11 +0000 (20:17 +0000)]
Move BehaviourScale to CoglFixed

ClutterFixed as a type is going away, superceded by CoglFixed. The
fixed point entry points in the API should be ported to the
CoglFixed type so that they are useful again.

15 years ago[cogl-fixed] Add a double-to-fixed conversion macro
Emmanuele Bassi [Thu, 5 Mar 2009 20:15:00 +0000 (20:15 +0000)]
[cogl-fixed] Add a double-to-fixed conversion macro

Since the conversion of a floating point value to a fixed point
value is already done in double precision we can safely expose
a macro that converts a double precision floating point value to
a CoglFixed one.

15 years ago[docs] Note that grabs are evil
Emmanuele Bassi [Tue, 3 Mar 2009 22:51:17 +0000 (22:51 +0000)]
[docs] Note that grabs are evil

Grabs are an entirely evil way to override the whole event delivery
machinery that Clutter has in place.

A pointer grab can be effectively replaced by a much more reliable
::captured-event signal handler, for instance.

Sometimes, grabs are a necessary evil -- and that is why Clutter
exposes them in the API; that should not fool anyone into thinking
that they should be used unless strictly necessary.

15 years ago[docs] Clarify clutter_actor_animate() behaviour
Emmanuele Bassi [Thu, 26 Feb 2009 15:35:20 +0000 (15:35 +0000)]
[docs] Clarify clutter_actor_animate() behaviour

When calling clutter_actor_animate() on an actor that is being
currently animated the default behaviour is to update the duration
of the animation; the easing mode; update all the common properties;
and finally add the new properties.

This:

  clutter_actor_animate (actor, 500, CLUTTER_LINEAR,
                         "width", 100,
                         "height", 100,
                         NULL);

  clutter_actor_animate (actor, 250, CLUTTER_EASE_IN_CUBIC,
                         "x", 100,
                         "y", 100,
                         "height", 200,
                         NULL);

Is logically equivalent to:

  clutter_actor_animate (actor, 250, CLUTTER_EASE_IN_CUBIC,
                         "x", 100,
                         "y", 100,
                         "width", 100,
                         "height", 200,
                         NULL);

The documentation of the function should be slightly more verbose
in describing the default behaviour.

15 years ago[build] Various fixes for distcheck
Emmanuele Bassi [Sat, 28 Feb 2009 19:13:18 +0000 (19:13 +0000)]
[build] Various fixes for distcheck

The generation of the GObject introspection data has broken
the distcheck phase.

The location of the header and source files should always be
depending on the $(top_srcdir) and $(srcdir) variables,
respectively; the special handling of the COGL API inside the
GIR generation should also take those two variables into
account.

15 years agoAdd pkg-config file for COGL
Emmanuele Bassi [Sat, 28 Feb 2009 17:54:27 +0000 (17:54 +0000)]
Add pkg-config file for COGL

COGL should ship its own pkg-config file, obviously still pointing
to Clutter's compiler flags and linking options, for COGL-specific
variables that might be queried at configure time.

For instance, it's easier (and less verbose) to do:

  PKG_CHECK_EXISTS([cogl-gl-1.0],
                   [has_gl_backend=yes],
                   [has_gl_backend=no])

Than doing:

  AC_MSG_CHECKING([for GL support in COGL])
  cogl_backend=`$PKG_CONFIG --variable=cogl clutter-0.9`
  if test x$cogl_backend = xgl; then
    has_gl_backend=yes
    AC_MSG_RESULT([found])
  else
    has_gl_backend=no
    AC_MSG_RESULT([not found])
  fi

15 years ago[shader] Unify code paths
Emmanuele Bassi [Sat, 28 Feb 2009 17:19:05 +0000 (17:19 +0000)]
[shader] Unify code paths

ClutterShader contains a lot of duplication, as the vertex and fragment
shader code paths are mostly the same.

The code should be simplified by adding new internal functions that can
be called with a value from the already present ClutterShaderType
enumeration.

In the future it'll also be possible to deprecate the current split API
and expose the generic accessors instead.

15 years agoClean up of the ClutterColor API
Emmanuele Bassi [Sat, 28 Feb 2009 16:16:09 +0000 (16:16 +0000)]
Clean up of the ClutterColor API

The ClutterColor API has some inconsistencies:

  - the string deserialization function does not match the rest of
    the conversion function naming policy; the naming should be:

        clutter_color_parse()   ->      clutter_color_from_string()

    and the first parameter should be the ClutterColor that will
    be set from the string, not the string itself (a GDK-ism).

  - the fixed point API should not be exposed, especially in the
    form of ClutterFixed values

  - the non-fixed point HLS conversion functions do not make any
    sense. The values returned should be:

      hue        := range [ 0, 360 ]
      luminance  := range [ 0,   1 ]
      saturation := range [ 0,   1 ]

    like the current fixed point API does. Returning a value in
    the [ 0, 255 ] range is completely useless

  - the clutter_color_equal() should be converted for its use inside
    a GHashTable; a clutter_color_hash() should be added as well

  - the second parameter of the clutter_color_shade() function should
    be the shading factor, not the result (another GDK-ism). this way
    the function call can be translated from this:

      color.shade(out result, factor)

    to the more natural:

      color.shade(factor, out result)

This somewhat large commit fixes all these issues and updates the
internal users of the API.

15 years ago[cogl] Add a PANGO debug flag for CoglPango use
Emmanuele Bassi [Sat, 28 Feb 2009 16:03:11 +0000 (16:03 +0000)]
[cogl] Add a PANGO debug flag for CoglPango use

The CoglPango code falls under the COGL "jurisdiction"; this means
that it cannot include Clutter headers unless strictly necessary.

The CoglPangoRenderer code was using the CLUTTER_NOTE() macro. Now
that COGL has it's own COGL_NOTE() similar macro, CoglPango should
use that and avoid including clutter-debug.h (which pulls in
clutter-private.h which in turn pulls in clutter-actor.h).

A new flag, COGL_DEBUG_PANGO, has been added to the COGL debug
flags.

15 years agoTypo in clutter-win32.pc.in introduced by commit 24ce19383
Colin Walters [Mon, 9 Mar 2009 18:17:18 +0000 (14:17 -0400)]
Typo in clutter-win32.pc.in introduced by commit 24ce19383

15 years agoSet the mapped flag on the stage in the SDL and eglnative backends
Neil Roberts [Mon, 9 Mar 2009 18:40:58 +0000 (18:40 +0000)]
Set the mapped flag on the stage in the SDL and eglnative backends

Bug 1493 - GL ES does not work since Jan 9 in PowerVR SGX 535, Intel

The mapped flag needs to be set on the stage otherwise
clutter_actor_queue_redraw will never queue a redraw and never draw
anything.

In these two backends there is not really a way to hide the stage so
they both set the mapped flag immediatly when clutter_actor_show is
called.

15 years agoUse COGL to establish GL state for ClutterGLXTexturePixmap
Owen W. Taylor [Fri, 27 Feb 2009 18:39:53 +0000 (13:39 -0500)]
Use COGL to establish GL state for ClutterGLXTexturePixmap

Using glEnable() directly confuses COGL and can result in problems
like subsequent pick operations not working correctly. Get the
material for the ClutterTexture and call cogl_material_flush_gl_state()
instead.

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

15 years ago[eglnative] Add -I flags for the clutter dir in the src and build dirs
Neil Roberts [Mon, 9 Mar 2009 12:28:22 +0000 (12:28 +0000)]
[eglnative] Add -I flags for the clutter dir in the src and build dirs

These are required to include the Cogl header files.

15 years agoFix warning in clutter-backend-sdl
Neil Roberts [Mon, 9 Mar 2009 10:59:52 +0000 (10:59 +0000)]
Fix warning in clutter-backend-sdl

Removed direct use of SDL_GetError as a format string for g_set_error
to fix a compiler warning.

15 years agoBug 1491 - Fix hardcoded lib path in .pc files
Colin Walters [Fri, 6 Mar 2009 05:19:12 +0000 (00:19 -0500)]
Bug 1491 - Fix hardcoded lib path in .pc files

We should instead use @libdir@ from configure to be correct
on multilib systems.

15 years agoAdd a warning for recursive emit_event
Øyvind Kolås [Fri, 27 Feb 2009 17:59:16 +0000 (17:59 +0000)]
Add a warning for recursive emit_event

When event delivery is invoked by synthetic events through
clutter_do_event from inside an event handler clutter was silently
ignoring it, this warning will hopefully help resolving some issues.

15 years ago[cogl-matrix] Documents that CoglMatrix members should be considered read only
Robert Bragg [Wed, 25 Feb 2009 16:23:09 +0000 (16:23 +0000)]
[cogl-matrix] Documents that CoglMatrix members should be considered read only

In the future if we want to annotate matrices with internal flags, and add
caching of the inverse matrix then we need to ensure that all matrix
modifications are done by cogl_matrix API so we'd know when to dirty the
cache or update the flags.

This just adds documentation to that effect, and assuming the most likley
case where someone would try and directly write to matrix members would
probably be to load a constant matrix other than the identity matrix; I
renamed cogl_matrix_init_from_gl_matrix to cogl_matrix_init_from_array to
make it seem more general purpose.

15 years ago[cogl-matrix] Adds padding to CoglMatrix
Robert Bragg [Tue, 24 Feb 2009 11:33:58 +0000 (11:33 +0000)]
[cogl-matrix] Adds padding to CoglMatrix

This adds enough padding to allow us to potentially add a cache of the inverse
matrix in the future and private flags to annotate matrices.

15 years ago[backend] Constify font options
Emmanuele Bassi [Thu, 26 Feb 2009 15:32:48 +0000 (15:32 +0000)]
[backend] Constify font options

The font options accessors in ClutterBackend only deal with const
cairo_font_options_t values, since:

  - set_font_options() will copy the font options
  - get_font_options() will return a pointer to the internal
    font options

Not using const in these cases makes the API confusing and might lead
to erroneous calls to cairo_font_options_destroy().

15 years agoIntern the ClutterScriptable type name
Emmanuele Bassi [Fri, 9 Jan 2009 15:02:50 +0000 (15:02 +0000)]
Intern the ClutterScriptable type name

Like we do for other types, use the I_() macro to intern the
type name during the GType registration for ClutterScriptable.

15 years agoRemove redundant declaration in clutter-text.h
Bastian Winkler [Tue, 24 Feb 2009 19:07:31 +0000 (20:07 +0100)]
Remove redundant declaration in clutter-text.h

clutter-text.h declares clutter_text_get_layout twice.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[build] Do not shave typelib generation
Emmanuele Bassi [Thu, 26 Feb 2009 12:46:36 +0000 (12:46 +0000)]
[build] Do not shave typelib generation

Bug 1478 - typelib creation shaved out of existence

Add a 'GEN' output rule for the typelib files created when
introspection is enabled.

15 years ago[build] Put the X11 pc dependencies in another variable
Emmanuele Bassi [Thu, 26 Feb 2009 11:55:53 +0000 (11:55 +0000)]
[build] Put the X11 pc dependencies in another variable

If X11 comes with pkg-config files (like it should) we should not add
those dependencies to the generic BACKEND_PC_FILES variable: that
variable is meant only for backend-specific dependencies handled by
pkg-config -- and Clutter supports non-X11 backends as well.

The X11_PC_FILES variable will only contain X11-related dependencies,
and will be set as part of BACKEND_PC_FILES only inside the GLX and
EGLX backends sections.

15 years agoFix x/y confusion for GL_TEXTURE_RECTANGLE_ARB
Owen W. Taylor [Wed, 25 Feb 2009 20:46:09 +0000 (15:46 -0500)]
Fix x/y confusion for GL_TEXTURE_RECTANGLE_ARB

When "denormalizing" for texture rectangles, multiple X coordinates
by the X size and Y coordinates by the Y size.

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

15 years ago[cogl-pango-glyph-cache] Fix compiler warning on 64-bit
Neil Roberts [Thu, 26 Feb 2009 10:56:42 +0000 (10:56 +0000)]
[cogl-pango-glyph-cache] Fix compiler warning on 64-bit

gcc warns about casting a pointer to a guint because it is a different
size on 64-bit machines. However the pointer is only used as a hash so
it doesn't matter if we lose the most significant bits. The patch
makes it use GPOINTER_TO_UINT instead which first casts it to a gulong
and avoids the warning.

15 years ago[tests/tools] Don't install libdisable-npots.so
Neil Roberts [Tue, 24 Feb 2009 16:44:30 +0000 (16:44 +0000)]
[tests/tools] Don't install libdisable-npots.so

The libdisable-npots library is just used as a helper as part of
make test so it should not be installed.

If noinst_* is used then automake will generate a static library but
this won't work with LD_PRELOAD so we then need an extra custom rule
to link that into a shared library. The custom rule uses the $(LINK)
Makefile var which gets put in the Makefile because of the static
library. We pass libtool a stub -rpath option which causes it to
generate a shared library.

15 years ago[media] Add sub-second resolution for the duration
Emmanuele Bassi [Tue, 24 Feb 2009 16:16:25 +0000 (16:16 +0000)]
[media] Add sub-second resolution for the duration

The duration in ClutterMedia is currently expressed in integer multiples
of a second. This does not offer enough granularity for media playback
that has fractionary durations -- 2.3 seconds; 1 minute, 23.4 seconds;
1 hour, 23 minutes, 4.5 seconds; etc.

The duration value should be expressed in seconds with a sub-second
granularity; for this reason, a double should be used insted of an
unsigned integer.

The semantics haven't changed: the :duration property still exposes
seconds.

15 years ago[media] Fix the interface cast macro
Bastian Winkler [Tue, 24 Feb 2009 15:58:40 +0000 (15:58 +0000)]
[media] Fix the interface cast macro

Bug 1474 - ClutterMedia interface

The GET_INTERFACE() macro is still using the old type name of
the ClutterMedia interface structure in the cast.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoDeclare the EnumValues for PixelFormat static
Jonathan Matthew [Tue, 24 Feb 2009 09:25:53 +0000 (09:25 +0000)]
Declare the EnumValues for PixelFormat static

Bug 1473 - CoglPixelFormat enum data must be declared static

When registering an enumeration GType, the GEnumValue or GFlagsValue
arrays must be declared static; otherwise, you get a segmentation
fault when calling the function again.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoUse a dynamic array for the actors when delivering events
Emmanuele Bassi [Mon, 23 Feb 2009 15:22:08 +0000 (15:22 +0000)]
Use a dynamic array for the actors when delivering events

Instead of using a fixed size array for storing the scenegraph sub-node
during event delivery we should use a GPtrArray. The benefits are:

  - a smaller allocation
  - no undocumented yet binding constraint on the scenegraph size

15 years agoRemove stray fixed point macro usage
Emmanuele Bassi [Mon, 23 Feb 2009 15:19:11 +0000 (15:19 +0000)]
Remove stray fixed point macro usage

The CoglPango renderer is using a CLUTTER_FIXED macro, but the
whole code has been Clutter-free for a while, now.

15 years ago[test-vertex-buffer-contiguous] Improves the texturing test
Robert Bragg [Mon, 23 Feb 2009 16:33:42 +0000 (16:33 +0000)]
[test-vertex-buffer-contiguous] Improves the texturing test

The test now explicitly reads back from the framebuffer to sanity check that
texturing is happening as expected, and it now uses a fixed 2x2 texture instead
of redhand.png since redhand.png doesn't have a power of two size which can
cause the vertex buffer code to complain on hardware not supporting npot
textures.

15 years ago[docs] Document envvars and command line switches
Emmanuele Bassi [Mon, 23 Feb 2009 13:44:03 +0000 (13:44 +0000)]
[docs] Document envvars and command line switches

Clutter uses checks on various environment variables and installs
various command line switches. The API reference should list them
and document them both.

15 years agoMake fuzzy picking a command line switch
Emmanuele Bassi [Mon, 23 Feb 2009 13:17:06 +0000 (13:17 +0000)]
Make fuzzy picking a command line switch

The CLUTTER_FUZZY_PICK environment variable is the last one used
by Clutter without a corresponding command line switch.

15 years agoMake disable text mipmapping a command line switch
Emmanuele Bassi [Mon, 23 Feb 2009 13:08:59 +0000 (13:08 +0000)]
Make disable text mipmapping a command line switch

The environment variable to disable mipmapping should also be
a command line switch, and be handled like the rest of Clutter's
environment variables/command line switches.

15 years ago[actor] Remove usage of ClutterFixed
Emmanuele Bassi [Mon, 23 Feb 2009 12:55:01 +0000 (12:55 +0000)]
[actor] Remove usage of ClutterFixed

The ClutterFixed type and symbols are now equivalent to the native
float type. In order to remove ambiguity and clean up the code, any
usage of ClutterFixed and relative macros has been removed.

15 years agoAdd runtime debug messages for COGL
Emmanuele Bassi [Mon, 23 Feb 2009 12:47:02 +0000 (12:47 +0000)]
Add runtime debug messages for COGL

Clutter is able to show debug messages written using the CLUTTER_NOTE()
macro at runtime, either by using an environment variable:

  CLUTTER_DEBUG=...

or by using a command line switch:

  --clutter-debug=...
  --clutter-no-debug=...

Both are parsed during the initialization process by using the
GOption API.

COGL would benefit from having the same support.

In order to do this, we need a cogl_get_option_group() function in
COGL that sets up a GOptionGroup for COGL and adds a pre-parse hook
that will check the COGL_DEBUG environment variable. The OptionGroup
will also install two command line switches:

  --cogl-debug
  --cogl-no-debug

With the same semantics of the Clutter ones.

During Clutter initialization, the COGL option group will be attached
to the GOptionContext used to parse the command line options passed
to a Clutter application.

Every debug message written using:

  COGL_NOTE (SECTION, "message format", arguments);

Will then be printed only if SECTION was enabled at runtime.

This whole machinery, like the equivalent one in Clutter, depends on
a compile time switch, COGL_ENABLE_DEBUG, which is enabled at the same
time as CLUTTER_ENABLE_DEBUG. Having two different symbols allows
greater granularity.

15 years agoAdd an environment variable to disable mipmapped text
Neil Roberts [Mon, 23 Feb 2009 11:36:03 +0000 (11:36 +0000)]
Add an environment variable to disable mipmapped text

Mipmapped text is enabled by default in Clutter but it can cause
problems on some drivers so it is convenient to have an environment
variable to disable it for all apps.

15 years ago[Cogl] Remove a debugging assert that was triggering on false positives
Robert Bragg [Sun, 22 Feb 2009 15:25:00 +0000 (15:25 +0000)]
[Cogl] Remove a debugging assert that was triggering on false positives

An assert to verify there was no error when generating a buffer object
for the vertex buffer API was being hit when running the GLES1 conformance
tests.

15 years ago[cogl-material] Always glBindTexture when flushing material state
Robert Bragg [Thu, 19 Feb 2009 09:20:20 +0000 (09:20 +0000)]
[cogl-material] Always glBindTexture when flushing material state

Bug #1457 - Creating a new texture messes up the cogl material state
            cache; reported by Neil Roberts

We still don't have caching of bound texture state so we always have to
re-bind the texture when flushing the GL state of any material layers.

15 years ago[Cogl] Fixes automatic handling of the GL blend enable state.
Robert Bragg [Thu, 19 Feb 2009 09:01:18 +0000 (09:01 +0000)]
[Cogl] Fixes automatic handling of the GL blend enable state.

Bug #1460 - Handling of flags in cogl_material_set_color

Cogl automatically enables/disables blending based on whether the source color
has an alhpa < 1.0, or if any textures with an alpha component are in use, but
it wasn't doing it quite right.

At the same time I removed some of the dirty flags which on second thought
are nothing more than micro-optimsations that only helped clutter the code.

thanks to Owen Taylor for reporting the bug

15 years ago[Cogl] the cogl_get_*_matrix functions now work with CoglMatrix types
Robert Bragg [Wed, 18 Feb 2009 18:54:54 +0000 (18:54 +0000)]
[Cogl] the cogl_get_*_matrix functions now work with CoglMatrix types

Since the CoglMatrix type was added for supporting texture matrices recently
it made sense to be consistent accross the Cogl API and use the Cogl type
over the GL style GLfloat m[16] arrays.

15 years ago[ignore] Update with the introspection files
Emmanuele Bassi [Sat, 21 Feb 2009 13:47:02 +0000 (13:47 +0000)]
[ignore] Update with the introspection files

15 years ago[build] Move all the compiler flags to AM_CFLAGS
Emmanuele Bassi [Sat, 21 Feb 2009 13:44:14 +0000 (13:44 +0000)]
[build] Move all the compiler flags to AM_CFLAGS

The INCLUDES directive should only contain pre-processor flags, since
we're passing it also to the introspection scanner.

Using AM_CFLAGS for compiler flags, like debug flags and maintainer
flags, is more indicated.

15 years ago[backend] Update the viewport when updating the GL context
Emmanuele Bassi [Fri, 20 Feb 2009 15:39:32 +0000 (15:39 +0000)]
[backend] Update the viewport when updating the GL context

Bug 1442 - multistage, same-window resize events invalidate stage

When ensuring that the GL context is attached to the correct
ClutterStage we need to set the SYNC_MATRICES flag on the stage
itself. This is needed in case the size of the new stage does
not match the size of the old -- thus requiring a call to
glViewport() when the paint cycle starts.

15 years ago[cogl-gles2-wrapper] Actually call glActiveTexture
Neil Roberts [Fri, 20 Feb 2009 16:37:20 +0000 (16:37 +0000)]
[cogl-gles2-wrapper] Actually call glActiveTexture

cogl_wrap_glActiveTexture needs to call the GL version of
glActiveTexture otherwise the subsequent calls to glBindTexture will
all be using texture unit 0. This fixes test-cogl-multitexture.

15 years ago[cogl-gles2-wrapper] Convert texture unit settings to be a static sized array
Neil Roberts [Fri, 20 Feb 2009 15:56:57 +0000 (15:56 +0000)]
[cogl-gles2-wrapper] Convert texture unit settings to be a static sized array

Previously the texture unit settings were stored in growable GArrays
and every time a new texture unit was encountered it would expand the
arrays. However the array wasn't copied when stored in a
CoglGles2WrapperSettings struct so all settings had the same
array. This meant that it wouldn't detect that a different program is
needed if a texture unit is disabled or enabled.

The texture unit settings arrays are all now a fixed size and the
enabledness of each unit is stored in a bit mask. Therefore the
settings can just be copied around by assignment as before.

This puts a limit on the number of texture units accessible by Cogl
but I think it is worth it to make the code simpler and more
efficient. The material API already poses a limit on the number of
texture units it can use.

15 years agoAdd build machinery for gobject-introspection data
Emmanuele Bassi [Fri, 20 Feb 2009 14:39:51 +0000 (14:39 +0000)]
Add build machinery for gobject-introspection data

configure.ac: Check for gobject-introspection

build/introspection.m4: Include the file that defines the
GOBJECT_CHECK_INTROSPECTION m4 macro in case we want to disable
the introspection data generation.

clutter/json/Makefile.am: Build the .gir for "ClutterJson"
  (json-glib as part of the Clutter library)

clutter/Makefile.am: Build the .gir for clutter, compile the
  Clutter and ClutterJson girs into typelibs, and install them.
  Also move GCC_FLAGS from $(INCLUDES) to $(AM_CFLAGS) since it includes
  non-preprocessor flag like -Wall.

See also:

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

Based on a patch by: Owen W. Taylor <otaylor@fishsoup.net>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoAdd gobject-introspection annotations
Owen W. Taylor [Tue, 17 Feb 2009 00:25:20 +0000 (19:25 -0500)]
Add gobject-introspection annotations

Add annotations such as (transfer-none) (out) (element-type ClutterActor),
and so forth to the doc comments as appropriate.

The annotations added here are a combination of the annotations previously
in gir-repository for Clutter and annotations found in a review of all
return values with that were being parsed with a transfer of "full".

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[docs] Rename cogl-docs from sgml to xml
Emmanuele Bassi [Fri, 20 Feb 2009 12:01:32 +0000 (12:01 +0000)]
[docs] Rename cogl-docs from sgml to xml

The cogl-docs.sgml file has always been XML, so it's only fitting that
we actually call it cogl-docs.xml.

15 years ago[docs] Add the 1.0 symbols index
Emmanuele Bassi [Fri, 20 Feb 2009 12:00:41 +0000 (12:00 +0000)]
[docs] Add the 1.0 symbols index

Add the index of symbols available since 1.0 to the Clutter
API reference.

15 years ago[docs] Use the --name-space option
Emmanuele Bassi [Fri, 20 Feb 2009 11:58:04 +0000 (11:58 +0000)]
[docs] Use the --name-space option

Now that we depend on gtk-doc 1.11 we can use the --name-space
command line option for the mkdb utility.

15 years ago[docs] Require gtk-doc 1.11
Emmanuele Bassi [Fri, 20 Feb 2009 11:55:54 +0000 (11:55 +0000)]
[docs] Require gtk-doc 1.11

The new stable release of gtk-doc provides the --name-space
option for the mkdb utility. This option allows to specify a
namespace for the symbols that will get stripped, so that we
don't get a symbols index containing only "C".

15 years agoDo not use GL types in Clutter headers
Emmanuele Bassi [Fri, 20 Feb 2009 11:39:47 +0000 (11:39 +0000)]
Do not use GL types in Clutter headers

Bug 1451 - clutter_value_get_shader_matrix() return value

The return value of the get_shader_matrix() function should be
gfloat, not GLfloat.

15 years ago[timeline] Set the n_markers out paramater
Emmanuele Bassi [Fri, 20 Feb 2009 11:36:54 +0000 (11:36 +0000)]
[timeline] Set the n_markers out paramater

Bug 1464 - clutter_timeline_list_markers should set n_markers=0 when
           there are no markers

If no markers are registered and we bail out we should also set the
n_markers out parameter to 0 so that code checking the number of
markers will still work.

15 years ago[path] Do not accept NULL descriptions
Emmanuele Bassi [Fri, 20 Feb 2009 11:17:52 +0000 (11:17 +0000)]
[path] Do not accept NULL descriptions

Bug 1465 - clutter_path_parse_description should check p==NULL

When accepting a stringified path description, ClutterPath methods
and the parser should not accept NULL or empty strings.

15 years ago[behaviour] Do not notify empty behaviours
Emmanuele Bassi [Tue, 10 Feb 2009 18:05:21 +0000 (18:05 +0000)]
[behaviour] Do not notify empty behaviours

If a behaviour does not have actors associated to it then it should
not invoke the ::alpha_notify() implementation.

15 years agoReplaced ClutterFixed constants in color_{darken,lighten} with float
Neil Roberts [Fri, 20 Feb 2009 11:07:23 +0000 (11:07 +0000)]
Replaced ClutterFixed constants in color_{darken,lighten} with float

Bug 1463 - clutter_color_lighten(darken) unexpected because of
           ClutterFixed=>float

These two functions contained ClutterFixed constants represented as
integers which are no longer valid since the cogl-float branch
merge. They are now converted to ClutterFixed from float constants
using CLUTTER_FLOAT_TO_FIXED (which is now a no-op).

Thanks to Zhang Wei for reporting.

15 years ago[build] Do not overwrite BUILT_SOURCES
Emmanuele Bassi [Thu, 19 Feb 2009 17:24:06 +0000 (17:24 +0000)]
[build] Do not overwrite BUILT_SOURCES

The conformance test suite Makefile template already defines the
BUILT_SOURCES variable, so we need to append redhand.png to it.

15 years ago[build] Fix the ChangeLog generation rule
Emmanuele Bassi [Thu, 19 Feb 2009 17:15:04 +0000 (17:15 +0000)]
[build] Fix the ChangeLog generation rule

The ChangeLog should only be generated by dist-hook and as a temporary
file to avoid overwriting the stub we use to direct people to the
commit log when cloning the repository.

When generated, the ChangeLog should be copied inside the distdir so
that the autotools will not freak out.

15 years ago[build] Update the EXTRA_DIST list
Emmanuele Bassi [Thu, 19 Feb 2009 17:07:09 +0000 (17:07 +0000)]
[build] Update the EXTRA_DIST list

Remove the files we don't ship or have, to avoid distcheck failing.

15 years ago[docs] Update build for COGL API reference
Emmanuele Bassi [Thu, 19 Feb 2009 17:06:25 +0000 (17:06 +0000)]
[docs] Update build for COGL API reference

We need to initialize the type system for gtk-doc-scan, now that
COGL exposes GTypes.

15 years ago[build] Reference the headers with their full path
Emmanuele Bassi [Thu, 19 Feb 2009 17:02:12 +0000 (17:02 +0000)]
[build] Reference the headers with their full path

Do not assume locality of the files, but use their whole path.

15 years ago[build] Show pkg-config file being generated
Emmanuele Bassi [Thu, 19 Feb 2009 17:00:22 +0000 (17:00 +0000)]
[build] Show pkg-config file being generated

The current Makefile hides the console messages for the pkg-config
files generated from the clutter.pc file. We should show them,
instead.

15 years ago[tests] Add TEST_CONFORM_TODO macro
Emmanuele Bassi [Thu, 19 Feb 2009 16:51:37 +0000 (16:51 +0000)]
[tests] Add TEST_CONFORM_TODO macro

The TEST_CONFORM_TODO macro is a simple placeholder macro that
adds the test function to the "/todo" namespace and skips the
test.

It can be used for tests that are known to fail because of bugs
that haven't been fixed yet, or because of features not yet
implemented.

15 years ago[tests/conform] Copy in redhand.png
Neil Roberts [Thu, 19 Feb 2009 17:14:00 +0000 (17:14 +0000)]
[tests/conform] Copy in redhand.png

test-vertex-buffer-configuous now needs redhand.png so it should be
copied in to the build directory. This is copied from similar code in
the tests/interactive Makefile.

15 years agoBail early in clutter_texture_paint if opacity == 0
Øyvind Kolås [Thu, 19 Feb 2009 15:44:16 +0000 (15:44 +0000)]
Bail early in clutter_texture_paint if opacity == 0

This causes clutter to skip all the GL work of state changes and
texturing if the opacity was 0. This is done in ClutterTexture and not
ClutterActor to ensure that pre and post paint signals work correctly.
Other expensive actors should be doing the same thing.

15 years ago[docs] Update the sections file
Emmanuele Bassi [Thu, 19 Feb 2009 15:01:33 +0000 (15:01 +0000)]
[docs] Update the sections file

The newly added symbols should also be added to the section file.

The CairoTexture section was referenced twice.

15 years agoRemove type functions for removed types
Emmanuele Bassi [Thu, 19 Feb 2009 15:00:23 +0000 (15:00 +0000)]
Remove type functions for removed types

The CoglHandle wrapper GTypes have been removed in commit a0800b44
so we can safely remove the declarations.

15 years ago[build] Pass the -s switch to cmp
Emmanuele Bassi [Thu, 19 Feb 2009 14:57:43 +0000 (14:57 +0000)]
[build] Pass the -s switch to cmp

The call to "cmp" to compare a built file with its current version
should use the -s (silent) command line switch. This avoids a ugly
message on the console when building Clutter the first time.

15 years ago[docs] Add a missing "return" annotation
Emmanuele Bassi [Thu, 19 Feb 2009 14:56:07 +0000 (14:56 +0000)]
[docs] Add a missing "return" annotation

The documentation for the get_anchor_point_gravity() method is
missing the "Return value:" section.

15 years agoMerge branch 'build-enhancements'
Emmanuele Bassi [Thu, 19 Feb 2009 14:42:40 +0000 (14:42 +0000)]
Merge branch 'build-enhancements'

* build-enhancements:
  [build] Fix dist for the newly introduced m4 macro directory
  [build] Fix interaction between shave, gtk-doc and libtool 1.x
  [build] Add dolt
  [build] Beautify autotools' output
  [gitignore] update gitignore files for tests/

15 years ago[docs] Clarify the set_cogl_texture() documentation
Emmanuele Bassi [Thu, 19 Feb 2009 13:44:29 +0000 (13:44 +0000)]
[docs] Clarify the set_cogl_texture() documentation

When setting the COGL texture handle for a ClutterTexture the
texture will be set as the first layer of the material used
by the ClutterTexture. The documentation should clarify this
point.

15 years ago[texture] Use COGL_TYPE_HANDLE for the handle properties
Emmanuele Bassi [Thu, 19 Feb 2009 12:05:20 +0000 (12:05 +0000)]
[texture] Use COGL_TYPE_HANDLE for the handle properties

The :texture and :material properties of ClutterTexture use a
Clutter-provided GType shielding from CoglHandle. Since CoglHandle
now has a GType we can use COGL_TYPE_HANDLE instead.

This commit also removes the conditional compilation of the
:material property, as it makes little sense now that the
Materials API has landed.

15 years ago[cogl] Provide GTypes for COGL types
Emmanuele Bassi [Thu, 19 Feb 2009 12:02:42 +0000 (12:02 +0000)]
[cogl] Provide GTypes for COGL types

COGL types should be registered inside the GType system, for
bindings and type checking inside properties and signals.

CoglHandle is a boxed type with a ref+unref semantics; slightly evil
from a bindings perspective (we cannot associate custom data to it),
but better than nothing.

The rest of the exposed types are enumerations or bitmasks.

15 years ago[cogl] Add cogl_is_material to cogl-material.h
Emmanuele Bassi [Thu, 19 Feb 2009 11:55:54 +0000 (11:55 +0000)]
[cogl] Add cogl_is_material to cogl-material.h

The COGL_DEFINE_HANDLE macro generates a cogl_is_<type> function
as well, to check whether a CoglHandle opaque pointer is of type
<type>.

The handle for CoglMaterial does not export cogl_is_material() in
its installed header.

15 years ago[build] Fix dist for the newly introduced m4 macro directory
Damien Lespiau [Thu, 19 Feb 2009 10:59:50 +0000 (10:59 +0000)]
[build] Fix dist for the newly introduced m4 macro directory

15 years ago[build] Fix interaction between shave, gtk-doc and libtool 1.x
Damien Lespiau [Thu, 19 Feb 2009 10:47:38 +0000 (10:47 +0000)]
[build] Fix interaction between shave, gtk-doc and libtool 1.x

gtk-doc.make does not specify --tag=CC when invoking libtool, letting
it decide which tag to use.  Something that fails with libtool 1.x and
when having CC set to funny things.

15 years agoInitialize a variable to avoid warnings
Emmanuele Bassi [Wed, 18 Feb 2009 18:45:58 +0000 (18:45 +0000)]
Initialize a variable to avoid warnings

The gl_mode variable was not initialized, and the compiler complained
when using the anal-retentive compiler flags.

15 years ago[ClutterBehaviourRotate] Fix up some breakage from the cogl-float branch merge
Neil Roberts [Wed, 18 Feb 2009 17:57:17 +0000 (17:57 +0000)]
[ClutterBehaviourRotate] Fix up some breakage from the cogl-float branch merge

The rotation angle calculated in clutter_behaviour_rotate_alpha_notify
gets applied to each actor using clutter_behaviour_actors_foreach. The
angle is a ClutterFixed value. Before the cogl float branch merge it
was stuffed into a gpointer using GPOINTER_TO_UINT. The pointer was
then converted back to a uint and cast to a ClutterFixed which worked
out fine even for negative numbers.

After the cogl-float merge the angle is effectively a gfloat. This
gets cast to a uint and stored in a pointer and converted back to a
float via a uint at the other end. However this fails for negative
numbers because a uint -> float conversion can't take advantage of
overflow to preserve the sign so you end up with a large number.

It also had the side effect that it only rotated in whole degrees.

This commit fixes the problem by just passing the ClutterFixed value
inside a closure struct instead of trying to stuff it into a pointer.

15 years ago[build] Add dolt
Damien Lespiau [Tue, 17 Feb 2009 15:05:03 +0000 (15:05 +0000)]
[build] Add dolt

From the homepage (http://dolt.freedesktop.org): Dolt provides a drop-in
replacement for libtool that significantly decreases compile times on
the platforms it supports.

15 years ago[build] Beautify autotools' output
Damien Lespiau [Tue, 17 Feb 2009 14:56:35 +0000 (14:56 +0000)]
[build] Beautify autotools' output

Use shave (http://git.lespiau.name/cgit/shave) to make compilation more
human friendly.

15 years ago[gitignore] update gitignore files for tests/
Damien Lespiau [Tue, 17 Feb 2009 14:02:55 +0000 (14:02 +0000)]
[gitignore] update gitignore files for tests/

15 years agoAllow rotation angle properties to be negative
Neil Roberts [Wed, 18 Feb 2009 17:26:10 +0000 (17:26 +0000)]
Allow rotation angle properties to be negative

Bug 1167 - clutter_effect_rotate improperly clamps negative angles

The rotation angle properties had a minimum value of 0.0 but the
rotation works fine with a negative value so the limitation is
unnecessary. This makes rotation using the ClutterAnimation API more
flexible because it was previously not possible to rotate
counter-clockwise from the 0.0 position.