profile/ivi/clutter.git
15 years ago[gitignore] Update ignore file with the new tests
Emmanuele Bassi [Thu, 22 Jan 2009 16:55:51 +0000 (16:55 +0000)]
[gitignore] Update ignore file with the new tests

15 years ago[tests] Use the right value in cogl_texture_new*
Emmanuele Bassi [Thu, 22 Jan 2009 16:54:49 +0000 (16:54 +0000)]
[tests] Use the right value in cogl_texture_new*

The correct symbol for disabling the flags when creating a new
COGL texture is COGL_TEXTURE_NONE.

15 years agoImprove accuracy of clutter_sinx()
Emmanuele Bassi [Thu, 22 Jan 2009 15:59:23 +0000 (15:59 +0000)]
Improve accuracy of clutter_sinx()

Improve clutter_sinx() by replacing the low precision CFX_SIN_STEP
with a multiply/divide pair. This reduces the maximum error from
1.8e-04 to 2.4e-05.

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

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

15 years agoUse the allocation to get the pick area
Emmanuele Bassi [Thu, 22 Jan 2009 15:55:43 +0000 (15:55 +0000)]
Use the allocation to get the pick area

Since a pick is really a paint operation, we can safely get
the allocation box, instead of using get_width() and get_height().

This should help cutting down the function calls. If we were
feeling adventurous, we could even use the allocation directly
from the private data structure.

Based on a patch by Gwenole Beauchesne <gbeauchesne@splitted-desktop.org>

15 years ago[gles] Fix computation of camera distance
Emmanuele Bassi [Thu, 22 Jan 2009 14:52:34 +0000 (14:52 +0000)]
[gles] Fix computation of camera distance

Port the fix in commit f409b58e to the GLES implementation of
COGL.

15 years agoFix computation of camera distance
Owen W. Taylor [Thu, 22 Jan 2009 14:17:16 +0000 (14:17 +0000)]
Fix computation of camera distance

Compute the value of the camera distance as exactly half the xx
component of the projection matrix. The heuristically derived
value for 60 degrees was off by about 0.016%, causing noticeable
blurring, and other field of view angles which didn't have the
heuristic adjustment off by much more.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoAvoid needlessly queue redraws for invisible actors
Emmanuele Bassi [Thu, 22 Jan 2009 13:58:50 +0000 (13:58 +0000)]
Avoid needlessly queue redraws for invisible actors

If an actor is not set as visible, or if it is in a section of
the scenegraph that it's set as not visible (e.g. one of the
parents is not visible) then we should not queue a redraw for
it.

Patch based on code from Michael Boccara <michael@graphtech.co.il>

15 years agoBug 1409 - Use G_SIGNAL_RUN_LAST with ::queue-redraw signal
Jason Tackaberry [Thu, 22 Jan 2009 13:38:32 +0000 (13:38 +0000)]
Bug 1409 - Use G_SIGNAL_RUN_LAST with ::queue-redraw signal

The intention behind ::queue-redraw is to be able to block the
default handler by attaching a callback and calling one of the
g_signal_stop_emission variants.

However this doesn't work, because ::queue-redraw has the
G_SIGNAL_RUN_FIRST flag instead of G_SIGNAL_RUN_LAST.

15 years agoFix typo in the flags update
Emmanuele Bassi [Thu, 22 Jan 2009 13:24:20 +0000 (13:24 +0000)]
Fix typo in the flags update

Epic en_GB keyboard FAIL.

15 years ago[units] Fix Units in GValue and ClutterParamSpecUnit
Emmanuele Bassi [Thu, 22 Jan 2009 12:11:25 +0000 (12:11 +0000)]
[units] Fix Units in GValue and ClutterParamSpecUnit

The GValue and GParamSpec integration of ClutterUnit was still
using the old, fixed-point based logic.

Storing ClutterUnits in a GValue should use floating point values,
and ClutterParamSpecUnit should follow suit.

15 years agoFix the format for a floating point value
Emmanuele Bassi [Thu, 22 Jan 2009 11:46:23 +0000 (11:46 +0000)]
Fix the format for a floating point value

The debug annotation was still expecting an integer after
we switched the angle to float.

15 years agoStore the units-per-em inside the Backend
Emmanuele Bassi [Thu, 22 Jan 2009 11:37:52 +0000 (11:37 +0000)]
Store the units-per-em inside the Backend

Instead of recomputing the number of units needed to fit in
an em each time clutter_units_em() is called, we can store this
value into the default Backend along with the resolution and
font name. The value should also be updated each time the
resolution and font are changed, to keep it up to date.

15 years ago[docs] Specify the coordinate space of ButtonEvent
Emmanuele Bassi [Wed, 21 Jan 2009 22:03:31 +0000 (22:03 +0000)]
[docs] Specify the coordinate space of ButtonEvent

The coordinates of each ButtonEvent are relative to the stage that
received the event, so we should document this in the structure
annotation.

It should also be mentioned that the coordinates can be transformed
into actor-relative coordinates by using transform_stage_point().

15 years agoAdd units-from-em conversion
Emmanuele Bassi [Wed, 21 Jan 2009 17:35:47 +0000 (17:35 +0000)]
Add units-from-em conversion

An em is a unit of measurement in typography, equal to the point
size of the current font.

It should be possible to convert a value expressed in em to
ClutterUnits by using the current font and the current DPI as
stored by the default backend.

15 years agoRemove the single-stage units converters
Emmanuele Bassi [Wed, 21 Jan 2009 17:10:36 +0000 (17:10 +0000)]
Remove the single-stage units converters

The stage-with/height-percentage converters had been broken by
the multiple-stages support of Clutter 0.8. They are also made
useless by the fact that Units are now floating point values.

The millimeters and typographic points converters also depended
on the default stage, but they can be reworked to use the default
DPI coming from the default Backend instead.

15 years ago[docs] Remove sources of warnings in API references
Emmanuele Bassi [Wed, 21 Jan 2009 16:41:18 +0000 (16:41 +0000)]
[docs] Remove sources of warnings in API references

15 years ago[docs] Add CoglTextureFlags to the API reference
Emmanuele Bassi [Wed, 21 Jan 2009 10:59:19 +0000 (10:59 +0000)]
[docs] Add CoglTextureFlags to the API reference

15 years ago[docs] Build COGL API reference first
Emmanuele Bassi [Wed, 21 Jan 2009 10:58:32 +0000 (10:58 +0000)]
[docs] Build COGL API reference first

Since the Clutter API reference needs some types from COGL's,
we should be building COGL's API reference first.

15 years ago[tests] Update the tests calling cogl_texture_new_*
Emmanuele Bassi [Sun, 18 Jan 2009 15:00:18 +0000 (15:00 +0000)]
[tests] Update the tests calling cogl_texture_new_*

The tests calling any of the cogl_texture_new_* family of functions
must be updated to the new constructor syntax.

15 years agoChange the COGL texture constructor to use flags
Emmanuele Bassi [Sun, 18 Jan 2009 14:51:19 +0000 (14:51 +0000)]
Change the COGL texture constructor to use flags

Boolean arguments for functions are pretty evil and usually
lead to combinatorial explosion of parameters in case multiple
settings are added.

In the case of the COGL texture constructors we have a boolean
argument for enabling the auto-mipmapping; it is conceivable that
we might want to add more settings for a COGL texture without
breaking API or ABI compatibility, so the boolean argument should
become a bitmask.

The internals have not been changed: instead of checking for
a non-zero value, we check for a bitmask being set.

15 years ago[docs] Update ClutterMedia section
Emmanuele Bassi [Fri, 16 Jan 2009 10:58:51 +0000 (10:58 +0000)]
[docs] Update ClutterMedia section

The ClutterMedia API has been changed, so we need to update
the API reference to reflect that.

15 years agoBug 1404 - ClutterMedia issues
Emmanuele Bassi [Fri, 16 Jan 2009 10:38:36 +0000 (10:38 +0000)]
Bug 1404 - ClutterMedia issues

ClutterMedia was a rough cut at a simple media API; it needs some
re-evaluation before 1.0 in order to keep it simple to use, and
simple to implement.

- ClutterMedia:position

  The position property accessors collide with the corresponding
  ClutterActor methods, which make it impossible to bind them in
  high-level languages:

    video_texture.set_position()
    video_texture.get_position()

  In order to resolve the collision, we have to go through the
  GObject properties API:

    video_texture.set('position', value)
    value = video_texture.get('position')

  A :position in seconds is also a GStreamer-ism, and should rather
  be converted to a :progress property, with a normalized value
  between 0 and 1. the current position in seconds would then simply
  be progress*duration. For non-seekable streams, 0.0 would always
  be returned. This makes it easier to use the progress inside
  animations, Timelines or ClutterPath instances.

- ClutterMedia:volume should be renamed to :audio-volume and normalized
  as well, instead of being a floating point value between 0 and 100.

- ClutterMedia:buffer-percent should just be :buffer-fill and normalized
  between 0.0 and 1.0

15 years agoRenames the mesh api to the "vertex buffer api".
Robert Bragg [Tue, 20 Jan 2009 21:12:44 +0000 (21:12 +0000)]
Renames the mesh api to the "vertex buffer api".

This better reflects the fact that the api manages sets of vertex attributes,
and the attributes really have no implied form. It is only when you use the
attributes to draw that they become mesh like; when you specify how they should
be interpreted, e.g. as triangle lists or fans etc. This rename frees up the
term "mesh", which can later be applied to a concept slightly more fitting.
E.g. at some point it would be nice to have a higher level abstraction that
sits on top of cogl vertex buffers that adds the concept of faces. (Somthing
like Blender's mesh objects.) There have also been some discussions over
particle engines, and these can be defined in terms of emitter faces; so some
other kind of mesh abstraction might be usefull here.

15 years agoRemoves the fixed-to-float scripts and patches
Robert Bragg [Tue, 20 Jan 2009 18:52:15 +0000 (18:52 +0000)]
Removes the fixed-to-float scripts and patches

Now that the conversion has been applied the scripts aren't needed any more

15 years agoMerge branch 'cogl-float'
Robert Bragg [Tue, 20 Jan 2009 17:22:21 +0000 (17:22 +0000)]
Merge branch 'cogl-float'

Okey; to summarise the changes...

We have converted Clutter and Cogl over to using floating point internally
instead of 16.16 fixed, but we have maintained the cogl-fixed API as a
utility to applications in case they want to implement their own optimizations.

The Clutter API has not changed (though ClutterFixed and ClutterUnit are now
internally floats) but all Cogl entry points have been changed to accept floats
now instead of CoglFixed.

To summarise the rationale...

There have been a number of issues with using fixed point though out Clutter
and Cogl including: lack of precision, lack of range, excessive format
conversion (GPUs tend to work nativly with IEEE floats) and maintainability.
One of the main arguments for fixed point - performance - hasn't shown
itself to be serious in practice so far since we seem to be more limited
by GPU performance and making improvements regarding how we submit data to
OpenGL[ES]/the GPU has had a more significant impact.

Ref: The recent multiple rectangle queuing changes + the
cogl-texture-agressive-batching branch which show significant performance
gains, and that recent tests on the ipodtouch (ARM + MBX) also showed no
loss of performance running with floats.

So finally; please forgive the inevitable fallout, this is a far reaching
change. There are still a few known issues with the fixed to float
conversion but enough works for all our conformance tests to pass, and the
remaining issues hopefully wont be too tricky to solve. For reference two
tags will be available either side of this change: "cogl-fixed-end" and
"cogl-float-start"

15 years ago[Automatic fixed-to-float.sh change] Hand coded changes for clutter-{fixed,units}
Robert Bragg [Tue, 20 Jan 2009 16:20:55 +0000 (16:20 +0000)]
[Automatic fixed-to-float.sh change] Hand coded changes for clutter-{fixed,units}

To avoid clashing with all the scripted changes, clutter-fixed.h and
clutter-units.h were manually converted to internally use floats instead of
16.16 fixed numbers.

Note: again no API changes were made in Clutter.

15 years ago[Automatic fixed-to-float.sh change] Applies a number fixed to float patches
Robert Bragg [Tue, 20 Jan 2009 16:20:54 +0000 (16:20 +0000)]
[Automatic fixed-to-float.sh change] Applies a number fixed to float patches

To deal with all the corner cases that couldn't be scripted a number of patches
were written for the remaining 10% of the effort.

Note: again no API changes were made in Clutter, only in Cogl.

15 years ago[Automatic fixed-to-float.sh change] Applies all scripted changes
Robert Bragg [Tue, 20 Jan 2009 16:20:54 +0000 (16:20 +0000)]
[Automatic fixed-to-float.sh change] Applies all scripted changes

This is the result of running a number of sed and perl scripts over the code to
do 90% of the work in converting from 16.16 fixed to single precision floating
point.

Note: A pristine cogl-fixed.c has been maintained as a standalone utility API
      so that applications may still take advantage of fixed point if they
      desire for certain optimisations where lower precision may be acceptable.

Note: no API changes were made in Clutter, only in Cogl.

Overview of changes:
- Within clutter/* all usage of the COGL_FIXED_ macros have been changed to use
the CLUTTER_FIXED_ macros.

- Within cogl/* all usage of the COGL_FIXED_ macros have been completly stripped
and expanded into code that works with single precision floats instead.

- Uses of cogl_fixed_* have been replaced with single precision math.h
alternatives.

- Uses of COGL_ANGLE_* and cogl_angle_* have been replaced so we use a float for
angles and math.h replacements.

15 years agoImproves the git commit messages used by fixed-to-float.sh
Robert Bragg [Tue, 20 Jan 2009 14:52:47 +0000 (14:52 +0000)]
Improves the git commit messages used by fixed-to-float.sh

In preperation for commiting a final conversion into master

15 years agoChange default tile-waste from 64 to 63
Owen W. Taylor [Sun, 11 Jan 2009 00:25:27 +0000 (19:25 -0500)]
Change default tile-waste from 64 to 63

It's more sensible to use 2^n-1 for a max tile-waste value rather
than 2^n, so change the value default from 64 to 63. Example:
191 and 192 will both be sliced to 128+64 rather than having
191=>128+64, 192=>256.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoFix properties that have X11 types to be 'long'
Owen W. Taylor [Fri, 16 Jan 2009 23:01:04 +0000 (18:01 -0500)]
Fix properties that have X11 types to be 'long'

While X11 Pixmap and Window types only have 32-bits of data, they
are actually 'unsigned long'. Change the "window" and "pixmap"
property of ClutterX11TexturePixmaps to be ulong.

This fixes 64-bit bugs where ClutterGLXTexturePixmap passed a
reference to Pixmap to g_object_get("pixmap", &pixmap, ...);

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years ago[eglnative] Set the SYNC_MATRICES on stage realization
Emmanuele Bassi [Fri, 16 Jan 2009 22:13:44 +0000 (22:13 +0000)]
[eglnative] Set the SYNC_MATRICES on stage realization

Since the stage in the EGL native backend only has one size, and it
is determined at realization, we can simply set the SYNC_MATRICES
private flag and let _clutter_stage_maybe_setup_viewport() set up
the GL viewport at the first redraw.

15 years ago[fixed-to-float.sh] Apply the automatic changes to the tests as well
Neil Roberts [Fri, 16 Jan 2009 18:29:29 +0000 (18:29 +0000)]
[fixed-to-float.sh] Apply the automatic changes to the tests as well

Some of the tests are using the Cogl API so they should be updated to
float as well.

The patches have been updated to apply cleanly.

15 years ago[fixed-to-float.sh] Group some of the sed expressions into one command
Neil Roberts [Fri, 16 Jan 2009 17:52:26 +0000 (17:52 +0000)]
[fixed-to-float.sh] Group some of the sed expressions into one command

This has no effect other than to make the script run faster.

15 years ago[fixed-to-float-patches] Replace the cogl_color_*x functions with *f
Neil Roberts [Fri, 16 Jan 2009 14:55:48 +0000 (14:55 +0000)]
[fixed-to-float-patches] Replace the cogl_color_*x functions with *f

cogl_set_source_color4x and cogl_color_set_from_4x actually take float
values now so they are renamed to *4f.

15 years ago[docs] Clarify what API registers a global alpha function
Emmanuele Bassi [Fri, 16 Jan 2009 14:53:42 +0000 (14:53 +0000)]
[docs] Clarify what API registers a global alpha function

Both clutter_alpha_new_with_func() and clutter_alpha_set_func()
will not register a global alpha function, so we need to update
the documentation to explicitly say so.

15 years ago[fixed-to-float-patches] Merge the two patches to remove cogl fixed params
Neil Roberts [Fri, 16 Jan 2009 13:56:42 +0000 (13:56 +0000)]
[fixed-to-float-patches] Merge the two patches to remove cogl fixed params

The two patches for removing cogl apis taking fixed params have been
merged into one patch.

15 years ago[doc] Clarify the animation mode meaning
Emmanuele Bassi [Fri, 16 Jan 2009 14:16:02 +0000 (14:16 +0000)]
[doc] Clarify the animation mode meaning

The animation mode parameters and properties are now slightly
anonymous unsigned longs, so we need to clarify in the documentation
that the user should either pass a ClutterAnimationMode value or
the result of registering an alpha function.

15 years agoRemove AnimationMode from the Animation API
Emmanuele Bassi [Fri, 16 Jan 2009 14:01:46 +0000 (14:01 +0000)]
Remove AnimationMode from the Animation API

The animation mode symbolic id might come from the AnimationMode
enumeration or from the clutter_alpha_register_*() family of
functions. For this reason, we should use a gulong instead of
ClutterAnimationMode whenever we have an "animation mode" parameter
or property.

15 years ago[alpha] Allow registering alpha functions
Emmanuele Bassi [Fri, 16 Jan 2009 13:42:06 +0000 (13:42 +0000)]
[alpha] Allow registering alpha functions

In order to unify alpha functions and animation modes in ClutterAlpha
we should be able to register alpha functions and get a logical id
for them; the logical id will then be available to be used by
clutter_alpha_set_mode().

The registration requires API changes in ClutterAlpha constructors
and methods. It also provides the chance to shift ClutterAlpha
towards the use of animations modes only, and to alpha functions
as a convenience API for language bindings alone.

15 years ago[fixed-to-float.sh] Use float names for the GLES2 wrappers
Neil Roberts [Fri, 16 Jan 2009 12:16:28 +0000 (12:16 +0000)]
[fixed-to-float.sh] Use float names for the GLES2 wrappers

For example cogl_wrap_glFrustumx -> cogl_wrap_glFrustumf.

The wrappers get #defined to the float versions anyway but it helps
avoid some confusion.

The conversion is done using a regular expression in the upgrade
script. Some of the patches had to be updated to apply cleanly.

15 years ago[fixed-to-float-patches] Move the changes to gles2-wrapper.h into the patch
Neil Roberts [Fri, 16 Jan 2009 10:50:53 +0000 (10:50 +0000)]
[fixed-to-float-patches] Move the changes to gles2-wrapper.h into the patch

It looks like the changes to cogl-gles2-wrapper.h were accidentally
committed to the actual file instead of the patch in commit
de27da0e. This commit moves the changes back into the patch so
cogl-gles2-wrapper.h is reverted back to master.

15 years ago[fixed-to-float-patches] Fix use of glClearColor and glColor under GLES 2
Neil Roberts [Thu, 15 Jan 2009 18:53:52 +0000 (18:53 +0000)]
[fixed-to-float-patches] Fix use of glClearColor and glColor under GLES 2

The wrapper for glClearColor was taking fixed arguments but was given
floating point values so it ended up always setting the clear color to
black. Now that GLES 1.1 is using the floating point version, there is
no need for the wrapper so both versions now just use glClearColor
directly.

A similar problem was happening for glColor but this does still need a
wrapper because it needs to set the vertex attribute.

15 years agoMerge branch 'master' into cogl-float
Neil Roberts [Thu, 15 Jan 2009 16:38:49 +0000 (16:38 +0000)]
Merge branch 'master' into cogl-float

The patches have been updated to apply cleanly.

The patches for the g_warnings in clutter-actor.c have been removed
because master now uses CLUTTER_UNITS_FORMAT so they aren't
necessary. The clutter-units.h patch now sets CLUTTER_UNITS_FORMAT to
'f'.

15 years agoFix GLES backends after merging the async-textures branch
Neil Roberts [Thu, 15 Jan 2009 18:09:54 +0000 (18:09 +0000)]
Fix GLES backends after merging the async-textures branch

The changes from the GL version of cogl-texture.c have been mirrored
in the GLES version. This adds the cogl_texture_new_from_bitmap
function and fixes the build errors.

15 years ago[fixed-to-float.sh] Remove the mtx_transform patch from the script
Neil Roberts [Thu, 15 Jan 2009 16:35:46 +0000 (16:35 +0000)]
[fixed-to-float.sh] Remove the mtx_transform patch from the script

The patch got deleted and merged into the clutter-actor.c patch in
commit 012b16 so it was just causing unnecessary errors.

15 years ago[fixed-to-float-patches] Fix some of the matrix getters and setters
Neil Roberts [Thu, 15 Jan 2009 15:24:05 +0000 (15:24 +0000)]
[fixed-to-float-patches] Fix some of the matrix getters and setters

The GL versions of get_modelview_matrix, get_projection_matrix and
get_viewport were using glGetDoublev and then converting them to
floats, but it might as well just call glGetFloatv directly.

The GL ES versions were using glGetFixedv but this was being replaced
with glGetFloatv by the #define in the GLES 2 wrappers.

The patch also replaces the glGetFixedv wrapper with
glGetFloatv. Previously this was calling
cogl_gles2_float_array_to_fixed which actually converted to
float. That function has been removed and memcpy is used instead.

15 years ago[test-text] queue redraws instead of calling clutter_actor_paint directly
Robert Bragg [Thu, 15 Jan 2009 13:58:31 +0000 (13:58 +0000)]
[test-text] queue redraws instead of calling clutter_actor_paint directly

Directly calling clutter_actor_paint skips out quite a bit code such as the
backend swap buffer call.

Since we are interested in the highest fps possible, and it now goes through
to the backend swap buffer call we now do a setenv (CLUTTER_VBLANK, none, 0)
before calling clutter_init.

15 years agoBug 1380 - Return booleans from CLUTTER_ACTOR_IS_* macros
Emmanuele Bassi [Wed, 14 Jan 2009 18:14:46 +0000 (18:14 +0000)]
Bug 1380 - Return booleans from CLUTTER_ACTOR_IS_* macros

If you try to use the CLUTTER_ACTOR_IS_* macros defined in ClutterActor
like this:

  typedef struct { unsigned int reactive : 1; } foo_t;

  foo_t f; f.reactive = CLUTTER_ACTOR_IS_REACTIVE (actor);

It will blow up because while the macros evaluate to 0 they can also
evaluate to non-zero values. Since most of the boolean flags in
Clutter and Clutter-based code are going to be stored like in the
example above, we should change the macros and let them evaluate
stricly either to 0 or to 1.

15 years agoRemove the Effects API
Emmanuele Bassi [Wed, 7 Jan 2009 18:30:46 +0000 (18:30 +0000)]
Remove the Effects API

The Effects API and all related symbols have been superceded by
the newly added Animation API and clutter_actor_animate().

This commit removes the Effects implementation, the documentation
and the interactive test/example code.

15 years agoEmit ::load-finished for every texture load
Emmanuele Bassi [Wed, 14 Jan 2009 15:30:10 +0000 (15:30 +0000)]
Emit ::load-finished for every texture load

The ::load-finished signal is emitted only when loading a texture
using clutter_texture_set_from_file(). Since this breaks user
expectations and consistency, we should also emit ::load-finished
when loading a texture from image data.

15 years ago[test-depth] cast width to gint when calculating -width/2
Robert Bragg [Wed, 14 Jan 2009 15:18:05 +0000 (15:18 +0000)]
[test-depth] cast width to gint when calculating -width/2

It was a fluke that this worked out due to how clutter_actor_set_depth
internally converts the incorrect integer result to fixed point.

15 years ago[tests] Adds a flowery clutter_cairo_texture unit test
Robert Bragg [Thu, 8 Jan 2009 18:54:48 +0000 (18:54 +0000)]
[tests] Adds a flowery clutter_cairo_texture unit test

This is simply a copy of flowers.c from the old clutter-cairo repo

15 years agoMerge branch 'async-textures'
Emmanuele Bassi [Wed, 14 Jan 2009 15:16:41 +0000 (15:16 +0000)]
Merge branch 'async-textures'

* async-textures:
  Whitespace fixes in ClutterTexture
  [async-loading] Do not force the texture size on async load
  [async-loading] Update asynchronous image loading
  Add API for extracting image size from a file
  Update/clean and apply the async-texture patch from bug #1144

15 years ago[ClutterStageX11] Remove the handling_configure flag
Neil Roberts [Wed, 14 Jan 2009 13:37:31 +0000 (13:37 +0000)]
[ClutterStageX11] Remove the handling_configure flag

Since Clutter changed to using a layout scheme the handling_configure
flag no longer works because the allocate method is not invoked
immediately during the call to set_size from the ConfigureNotify
handler. However it is also no longer neccessary because the resizes
are effectively batched up until a relayout is run so it won't cause
an infinite loop of resize and notify events anyway.

15 years agoAdd unused symbols
Emmanuele Bassi [Wed, 14 Jan 2009 15:05:03 +0000 (15:05 +0000)]
Add unused symbols

Append the newly added ClutterBindingPool symbols and
clutter_stage_ensure_viewport() to the API reference.

15 years agoFix compile warning for a possible uninitialized variable
Emmanuele Bassi [Wed, 14 Jan 2009 15:04:28 +0000 (15:04 +0000)]
Fix compile warning for a possible uninitialized variable

15 years agoAdd declaration of clutter_binding_pool_get_type()
Emmanuele Bassi [Wed, 14 Jan 2009 15:03:30 +0000 (15:03 +0000)]
Add declaration of clutter_binding_pool_get_type()

The function is automagically created by G_DEFINE_TYPE(), but
it should also be declared in the header.

15 years agoMerge branch 'animation-improvements'
Emmanuele Bassi [Wed, 14 Jan 2009 15:00:44 +0000 (15:00 +0000)]
Merge branch 'animation-improvements'

* animation-improvements:
  [docs] Add ClutterAnimatable to the API reference
  Add license notice to ClutterAnimation files
  [docs] Update the ClutterAnimation section
  [animation] Extend ClutterAnimation support to all objects
  [animation] Use ClutterAnimatable inside Animation
  [animation] Add ClutterAnimatable
  [animation] Allow registering custom progress function
  [animation] Interval::compute_value should return a boolean
  Animate ClutterColor properties

15 years agoFix compilation warning
Emmanuele Bassi [Wed, 14 Jan 2009 14:34:35 +0000 (14:34 +0000)]
Fix compilation warning

Declare the width and height variables as unsigned ints, in order
to match the required arguments for clutter_actor_get_size().

15 years ago[clutter-text] Fix x-position of cursor when moving up or down
Neil Roberts [Wed, 14 Jan 2009 11:12:02 +0000 (11:12 +0000)]
[clutter-text] Fix x-position of cursor when moving up or down

ClutterText already has code to try to preserve the x position when
moving up or down. A target x-position is stored and the cursor is
positioned at the nearest point to that in the appropriate line when
up or down is pressed. However the target position was never cleared
so it would always target the x-position of the cursor from the first
time you pressed up or down.

To fix this the patch clears the target position in set_position and
then sets it after the call in real_move_up/down. That way pressing
up or down sets the target position and any other movement will clear
it.

To get an index for the pixel position in the line
pango_layout_line_x_to_index is used. However when x is greater than
the length of the line then the index before the last grapheme is
returned which was causing it to jump to the penultimate
character. The patch makes it add on the trailing value so that it
will jump to the last character.

15 years ago[clutter-text] Fix offset_to_bytes to work when pos == 0
Neil Roberts [Tue, 13 Jan 2009 18:42:50 +0000 (18:42 +0000)]
[clutter-text] Fix offset_to_bytes to work when pos == 0

The old function ended up returning the length of the string when pos
was zero. This caused it to insert characters at the end when the
cursor was at the beginning of the string.

15 years ago[clutter-text] Don't allow control characters to be inserted
Neil Roberts [Tue, 13 Jan 2009 17:52:38 +0000 (17:52 +0000)]
[clutter-text] Don't allow control characters to be inserted

If an unbound control key is pressed (such as Ctrl+R) it would insert
a rectangle into the text.

Also zero is considered a valid unicode character by
g_unichar_validate so pressing a key such as shift would cause the
current selection to be deleted. The character isn't actually inserted
because insert_unichar disallows zeroes.

15 years agoFix GLES 2 after the multiple-texture-rectangle branch merge
Neil Roberts [Thu, 27 Nov 2008 16:44:39 +0000 (16:44 +0000)]
Fix GLES 2 after the multiple-texture-rectangle branch merge

The GLES 2 wrapper needs to set up some state before each
draw. Previously this was acheived by wrapping glDrawArrays. Since the
multiple-texture-rectangle branch merge, glDrawElements is used
instead so we also need a wrapper for that.

It was also directly calling glBindTexture. GLES 2 uses a wrapper for
this function so that it can cope with GL_ALPHA format textures. The
format of the current texture needs to be stored as well as the target
and object number for this to work.

15 years agoUpdate gtk-doc 'Since' field for cogl_texture_multiple_rectangles
Neil Roberts [Mon, 12 Jan 2009 18:32:49 +0000 (18:32 +0000)]
Update gtk-doc 'Since' field for cogl_texture_multiple_rectangles

The function has been backported to the 0.8 branch so it will also be
available in Clutter 0.8.6

15 years ago[gitignore] Update the ignore file
Emmanuele Bassi [Tue, 13 Jan 2009 14:05:35 +0000 (14:05 +0000)]
[gitignore] Update the ignore file

15 years agoAdd ClutterBindingPool:name
Emmanuele Bassi [Tue, 13 Jan 2009 12:51:03 +0000 (12:51 +0000)]
Add ClutterBindingPool:name

The BindingPool constructor should only check for duplicate pools
and then set the :name constructor-only property. If a BindingPool
is created without a name we also make a fuss about it.

It is also possible to simply dispose of a binding pool using
g_object_unref(), as long as it has been created by using
clutter_binding_pool_new() or directly with g_object_new(). Only
BindingPools attached to a class are not owned by the user.

15 years agoRemove cogl_blahx Cogl interfaces that used to take CoglFixed parameters.
Robert Bragg [Tue, 13 Jan 2009 11:38:55 +0000 (11:38 +0000)]
Remove cogl_blahx Cogl interfaces that used to take CoglFixed parameters.

Since they are no longer actually taking fixed point parameters the 'x' suffix is
no longer appropriate. To maintain support for sub-pixel precision the
corresponding interfaces that were taking integer parameters now get patched
to take float parameters instead.

15 years agoTurn ClutterBindingPool a GObject
Emmanuele Bassi [Tue, 13 Jan 2009 12:34:59 +0000 (12:34 +0000)]
Turn ClutterBindingPool a GObject

ClutterBindingPool is already "problematic" in terms of memory
management for language bindings and gobject-introspection. It
also lacks a GType.

Turning ClutterBindingPool into a GBoxed would not make much
sense, since it does not adhere to the copy/free semantics. It
could be referenced/unreferenced, but in that case we can just
as well use GObject as a base class instead of reimplemeting
a ref-counted object and then boxing it.

ClutterBindingPool is obviously a terminal class, so we just
hide the instance and class structures.

15 years ago[gl/cogl.c] Updates the cogl_rotatex prototype to take float x,y,z params
Robert Bragg [Mon, 12 Jan 2009 18:15:40 +0000 (18:15 +0000)]
[gl/cogl.c] Updates the cogl_rotatex prototype to take float x,y,z params

I missed this in my last commit; it just updates the prototype in gl/cogl.c
in line with the change made in cogl.h.in

15 years ago[cogl.h.in.0.patch] Fixes the cogl_rotatex prototype to take float x,y,z params
Robert Bragg [Mon, 12 Jan 2009 17:07:55 +0000 (17:07 +0000)]
[cogl.h.in.0.patch] Fixes the cogl_rotatex prototype to take float x,y,z params

The cogl_rotatex was incorrectly defined to take gint x,y,z params as opposed
to CoglFixed. This patch changes them directly to floats.

15 years ago[cogl/gles] Fixes for building for GLES 1 using floats
Robert Bragg [Thu, 8 Jan 2009 22:56:17 +0000 (22:56 +0000)]
[cogl/gles] Fixes for building for GLES 1 using floats

* This adds GLfixed -> GLfloat conversion
* redefines cogl_wrap_glBlahx macros as glBlahf
* Other misc fixes (mostly corresponding to cogl/gl equivalents)

15 years ago[fixed-to-float.sh] Replace uses of COGL_FIXED_FROM_INT not followed by a space
Robert Bragg [Thu, 8 Jan 2009 22:38:33 +0000 (22:38 +0000)]
[fixed-to-float.sh] Replace uses of COGL_FIXED_FROM_INT not followed by a space

Previously the script assumed a space before the open bracket, so it missed
a few cases in clutter/cogl/gles/cogl.c

15 years agoconverts clutter_{sin,cos,tan,atan}x angles to radians before calling math.h func
Robert Bragg [Thu, 8 Jan 2009 22:00:56 +0000 (22:00 +0000)]
converts clutter_{sin,cos,tan,atan}x angles to radians before calling math.h func

These functions are defined to take an angle in degrees, so the angle needs
converting before calling the corresponding {sin,cos,tan,atan}f()

This fixes test-cogl-tex-tile.

15 years ago[fixed-to-float-patches] Updates the patches in line with the last merge
Robert Bragg [Thu, 8 Jan 2009 13:10:32 +0000 (13:10 +0000)]
[fixed-to-float-patches] Updates the patches in line with the last merge

Most of the patches updated weren't failing but there were a number of
hunk offsets when applying so it tidies that up. The change in
mtx_transform.0.patch has been moved to clutter-actor.c.0.patch.

15 years agoWhitespace fixes in ClutterTexture
Emmanuele Bassi [Mon, 12 Jan 2009 17:12:24 +0000 (17:12 +0000)]
Whitespace fixes in ClutterTexture

Small whitespace fixes patch; ClutterTexture requires much more
love than I can provide at the moment.

15 years ago[async-loading] Do not force the texture size on async load
Emmanuele Bassi [Mon, 12 Jan 2009 17:09:47 +0000 (17:09 +0000)]
[async-loading] Do not force the texture size on async load

The size of the texture as retrieved by the filename should
be set as the image size, not as the actor size, in order to
respect the :sync-size property.

When the asynchronous loading process terminates, we queue
a relayout so that the scene is updated.

15 years ago[async-loading] Update asynchronous image loading
Emmanuele Bassi [Mon, 12 Jan 2009 16:54:30 +0000 (16:54 +0000)]
[async-loading] Update asynchronous image loading

Provide a main loop-based fallback to the asynchronous loading in
case the GLib threading support hasn't been enabled. This also
allows us to clean up the asynchronous loading machinery and have
it behave consistently across different scenarios.

Emit the ::load-finished even if the asynchronous loading from
disk was not enabled.

Finally, block clutter_texture_set_from_file() until we have an
image width and height, so that querying the texture actor size
after set_from_file() will still yield the correct result even
when asynchronous loading is set.

15 years agoAdd API for extracting image size from a file
Emmanuele Bassi [Mon, 12 Jan 2009 16:52:20 +0000 (16:52 +0000)]
Add API for extracting image size from a file

For the asynchronous loading we need a function call that parses
a file, given its path, and retrieves the image width and height.

This commit adds cogl_bitmap_get_size_from_file() to the CoglBitmap
API.

15 years agoMerge branch 'master' into async-textures
Emmanuele Bassi [Mon, 12 Jan 2009 14:43:53 +0000 (14:43 +0000)]
Merge branch 'master' into async-textures

15 years agoBug 1087 - virtualize stage_queue_redraw
Havoc Pennington [Mon, 12 Jan 2009 14:19:48 +0000 (14:19 +0000)]
Bug 1087 - virtualize stage_queue_redraw

Add a ClutterStage::queue-redraw signal.

The purpose of this signal is to allow combining the Clutter redraw
idle with another redraw idle such as gtk's (or any other one really;
this is desirable anytime Clutter is not the only thing drawing to
a toplevel window).

To override the default, you would connect to ::queue-redraw and then
stop the signal emission.

15 years ago[ClutterGLXTexturePixmap] Use an RGB texture (not ARGB) for 24bpp pixmaps
Robert Bragg [Mon, 12 Jan 2009 13:02:19 +0000 (13:02 +0000)]
[ClutterGLXTexturePixmap] Use an RGB texture (not ARGB) for 24bpp pixmaps

By creating an ARGB texture for 24bpp pixmaps we were exposing an undefined
alpha channel to the blending and texture combine stages which resulted in
nasty artefacts. (This issue was seen on i945 + DRI2)

15 years agoDeclare G_LOG_DOMAIN for COGL
Emmanuele Bassi [Mon, 12 Jan 2009 11:21:06 +0000 (11:21 +0000)]
Declare G_LOG_DOMAIN for COGL

In order to get properly namespaced debug and warning messages
inside COGL code we need to define the G_LOG_DOMAIN macro.

15 years agoAllow ensuring that a stage viewport is updated
Emmanuele Bassi [Mon, 12 Jan 2009 11:18:11 +0000 (11:18 +0000)]
Allow ensuring that a stage viewport is updated

Since we only update the GL viewport when we receive a ConfigureNotify
event on X11, we also need a function to allow other toolkits to tell
a stage that the viewport should be updated.

This commit adds clutter_stage_ensure_viewport(), a function that simply
sets the private SYNC_MATRICES flag on the stage and then queues a
redraw.

This function should be called by libraries integrating Clutter with
other toolkits, like clutter-gtk or clutter-qt.

15 years ago[x11] Proper fix for the ClutterStage resize race
Emmanuele Bassi [Mon, 12 Jan 2009 11:15:41 +0000 (11:15 +0000)]
[x11] Proper fix for the ClutterStage resize race

Continuation of the fix in commit 00a3c698686f25e193d0311ad25c903f0ad71e8b.

Instead of using a separate flag for the resize process, just
delay the setting of the CLUTTER_ACTOR_SYNC_MATRICES flag on the
stage to the point when we receive a ConfigureNotify event from
X11.

This commit will break the stage embedding into other toolkits.

15 years ago[docs] Documentation warnings
Emmanuele Bassi [Fri, 9 Jan 2009 14:26:35 +0000 (14:26 +0000)]
[docs] Documentation warnings

Fix the various warnings issued by gtk-doc when enabling the API
reference generation for both COGL and Clutter.

15 years ago[x11] Fix a race condition when resizing a stage
Emmanuele Bassi [Fri, 9 Jan 2009 12:06:46 +0000 (12:06 +0000)]
[x11] Fix a race condition when resizing a stage

There is a race condition when we resize a stage before showing
it on X11.

The race goes like this:

  - clutter_init() creates the default stage and realize it, which
    will cause a 640x480 Window to be created
  - call set_size(800, 600) on the stage will cause the Window to be
    resized to 800x600
  - call show() on the stage for the first time will cause COGL
    to set up an 800 by 600 GL viewport
  - the Window will be mapped, which will cause X to notify the
    window manager that the Window should be resized to 800x600
  - the window manager will approve the resize
  - X resizes the drawable to 800x600

To fix the race, we need to defer COGL from setting up the viewport
until we receive a ConfigureNotify event and the X server has resized
the Drawable.

In order to defer the call to cogl_setup_viewport() we add a new
private flag, CLUTTER_STAGE_IN_RESIZE; the flag is checked whenever
we need to change the viewport size along with the SYNC_MATRICES
private flag. Thus, cogl_setup_viewport() will be called only if
SYNC_MATRICES is set and IN_RESIZE is not set.

15 years ago[text] Fix GObject properties in ClutterText
Emmanuele Bassi [Thu, 8 Jan 2009 17:06:04 +0000 (17:06 +0000)]
[text] Fix GObject properties in ClutterText

Some of the read-write properties of ClutterText were missing
an implementation in clutter_text_get_property(), as well as
the :position and :selection-bound properties being wrongly
converted from fixed point to integer, passing through floating
point values.

15 years agoFix last improper usage of ClutterUnits
Emmanuele Bassi [Thu, 8 Jan 2009 15:45:22 +0000 (15:45 +0000)]
Fix last improper usage of ClutterUnits

ClutterUnits should not be used interchangeably as, or with
ClutterFixed values. ClutterUnits should also not be assumed
to be integers.

This commit fixes the last few improper usages of ClutterUnit
values, and adds a CLUTTER_UNITS_FORMAT macro for safely printing
ClutterUnit values with printf().

15 years agoMerge branch 'animatable-iface' into animation-improvements
Emmanuele Bassi [Thu, 8 Jan 2009 13:38:51 +0000 (13:38 +0000)]
Merge branch 'animatable-iface' into animation-improvements

* animatable-iface:
  [docs] Add ClutterAnimatable to the API reference
  Add license notice to ClutterAnimation files
  [animation] Use ClutterAnimatable inside Animation
  [animation] Add ClutterAnimatable

15 years ago[docs] Add ClutterAnimatable to the API reference
Emmanuele Bassi [Thu, 8 Jan 2009 13:31:27 +0000 (13:31 +0000)]
[docs] Add ClutterAnimatable to the API reference

15 years agoAdd license notice to ClutterAnimation files
Emmanuele Bassi [Thu, 8 Jan 2009 13:18:00 +0000 (13:18 +0000)]
Add license notice to ClutterAnimation files

15 years ago[docs] Update the ClutterAnimation section
Emmanuele Bassi [Thu, 8 Jan 2009 13:16:20 +0000 (13:16 +0000)]
[docs] Update the ClutterAnimation section

15 years ago[animation] Extend ClutterAnimation support to all objects
Emmanuele Bassi [Thu, 8 Jan 2009 13:13:39 +0000 (13:13 +0000)]
[animation] Extend ClutterAnimation support to all objects

Instead of limiting the use of ClutterAnimation to ClutterActor
instances, relax the constraint to include all GObject classes.

ClutterAnimation is not using actor-specific API, since it is
only using properties.

The only actor-based API is the clutter_actor_animate() family
of functions.

15 years ago[animation] Use ClutterAnimatable inside Animation
Emmanuele Bassi [Thu, 8 Jan 2009 12:59:16 +0000 (12:59 +0000)]
[animation] Use ClutterAnimatable inside Animation

ClutterAnimation should check if the object is implementing the
Animatable interface, and if so delegate to it the computation
of the value along the interval initial and final value, depending
on the progress.

15 years ago[animation] Add ClutterAnimatable
Emmanuele Bassi [Thu, 8 Jan 2009 12:56:46 +0000 (12:56 +0000)]
[animation] Add ClutterAnimatable

The ClutterAnimatable interface is meant to be used by GObject
classes to override the value computation for an animatable
property within the boundaries of an interval.

It is composed of a single virtual function, animate_property();
its implementation will receive the ClutterAnimation used to
animate the object; the property name; the initial and final
interval values; and the progress factor as retrieved by the
Alpha object bound to the Animation instance.

15 years agoMerge branch 'master' into cogl-float
Robert Bragg [Thu, 8 Jan 2009 11:48:00 +0000 (11:48 +0000)]
Merge branch 'master' into cogl-float

15 years agofixes for clutter-behaviour-ellipse.c.0.patch
Robert Bragg [Wed, 7 Jan 2009 19:39:31 +0000 (19:39 +0000)]
fixes for clutter-behaviour-ellipse.c.0.patch

15 years ago[clutter-alpha.c.0.patch] replace ClutterAngle with float
Robert Bragg [Wed, 7 Jan 2009 16:22:45 +0000 (16:22 +0000)]
[clutter-alpha.c.0.patch] replace ClutterAngle with float

This is just an update of the patch to reflect that fixed-to-float.sh now
replaces ClutterAngle usage with float.

15 years agoReplaces uses of CoglAngle with floats (Though the CoglAngle type remains)
Robert Bragg [Wed, 7 Jan 2009 15:33:24 +0000 (15:33 +0000)]
Replaces uses of CoglAngle with floats (Though the CoglAngle type remains)

The CoglAngle type can still be used for focused optimisations since the type
and macros remain. Uses of CoglAngle within Cogl have been replaced with floats;
COGL_ANGLE_FROM_DEG is no longer used anywhere and the replacements for
cogl_angle_cos -> cosf (same for sin) have been fixed to convert float values
in degrees to radians. This fixes the cogl-primitives API.