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.
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.
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.
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.
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.
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.
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.
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'.
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.
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.
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.
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.
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.
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.
* 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
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.
* 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
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.