profile/ivi/clutter.git
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[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[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 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[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 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 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 ago[test-clip] Use gint for hand_{width,height} when calulating -hand_* /2
Robert Bragg [Wed, 7 Jan 2009 12:33:40 +0000 (12:33 +0000)]
[test-clip] Use gint for hand_{width,height} when calulating -hand_* /2

It was a fluke that this worked out due to how the incorrect integer
result gets converted by CLUTTER_INT_TO_FIXED.

15 years ago[animation] Allow registering custom progress function
Emmanuele Bassi [Thu, 8 Jan 2009 11:15:09 +0000 (11:15 +0000)]
[animation] Allow registering custom progress function

A ClutterInterval can change the way the progress is computed
by subclassing and overriding the ::compute_value() virtual function.

It should also be possible to register a custom progress function
in the same way it is possible to register a custom transformation
function between two GValues.

This commit adds an internal, global hash table that maintains a
GType <-> progress function association; each ClutterInterval
will check if there is a progress function registered for the
GType of the initial and final values of the interval and, if
it has been found, it will call it to compute the value of the
interval depending on the progress factor.

15 years ago[test-depth] Use a gint for width, not guint, when calculating -width/2
Robert Bragg [Wed, 7 Jan 2009 12:08:43 +0000 (12:08 +0000)]
[test-depth] Use a gint for width, not guint, 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[animation] Interval::compute_value should return a boolean
Emmanuele Bassi [Wed, 7 Jan 2009 18:18:59 +0000 (18:18 +0000)]
[animation] Interval::compute_value should return a boolean

If the computation of the interval value depending on the progress
was not successful, ClutterInterval::compute_value() should return
this information to the caller.

15 years agoUpdate/clean and apply the async-texture patch from bug #1144
Chris Lord [Wed, 7 Jan 2009 17:02:43 +0000 (17:02 +0000)]
Update/clean and apply the async-texture patch from bug #1144

15 years agoRename a variable masking index()
Emmanuele Bassi [Wed, 7 Jan 2009 16:26:03 +0000 (16:26 +0000)]
Rename a variable masking index()

The maintainer CFLAGS found another masking of the index() function
by an helpless variable.

15 years agoMerge branch multiple-texture-rectangle into master
Neil Roberts [Wed, 7 Jan 2009 16:10:25 +0000 (16:10 +0000)]
Merge branch multiple-texture-rectangle into master

Bug 1289 - Draw multiple glyphs at once

The multiple-texture-rectangle branch adds a new Cogl texture function
called cogl_texture_multiple_rectangles which is used to draw multiple
rectangles out of a texture using a single GL call. This is
significantly faster than drawing the rectangles with individual calls
on some platforms. The Pango renderer now uses this to speed up
rendering.

The conflicts are just due to the whitespace fixes in cb569a5.

Conflicts:

clutter/cogl/gl/cogl-context.c
clutter/cogl/gl/cogl-context.h
clutter/cogl/gl/cogl-texture.c

15 years ago[tests] Update the ClutterText interactive test
Emmanuele Bassi [Wed, 7 Jan 2009 15:54:08 +0000 (15:54 +0000)]
[tests] Update the ClutterText interactive test

Remove the unused functions and if the test fails to load the
text from a file, show the error inside the text actor itself.

15 years ago[docs] Documentation fixes
Emmanuele Bassi [Wed, 7 Jan 2009 14:53:54 +0000 (14:53 +0000)]
[docs] Documentation fixes

Remove the causes of warnings from the Clutter gtk-doc API reference
generation process.

15 years ago[text] Do not use markup on an editable Text
Emmanuele Bassi [Wed, 7 Jan 2009 13:48:45 +0000 (13:48 +0000)]
[text] Do not use markup on an editable Text

An editable ClutterText should not use pango_layout_set_markup(),
as the contents of the text actor will not match the text.

Only read-only text actors should parse the contents for Pango
markup.

15 years ago[text] Do not ensure the cursor if not needed
Emmanuele Bassi [Wed, 7 Jan 2009 13:14:13 +0000 (13:14 +0000)]
[text] Do not ensure the cursor if not needed

If the Text actor is neither editable nor has its cursor set
to visible, then we should not be ensuring the cursor position.

This fixes a failure in the conformance test unit for the
layout cache.

15 years ago[tests] Make test-scale use ClutterText
Emmanuele Bassi [Wed, 7 Jan 2009 12:17:09 +0000 (12:17 +0000)]
[tests] Make test-scale use ClutterText

The ClutterLabel actor has been superceded by ClutterText.

This is merge fall-out from the text-actor branch.

15 years ago[tests] Remove test-opacity interactive test
Emmanuele Bassi [Wed, 7 Jan 2009 12:16:08 +0000 (12:16 +0000)]
[tests] Remove test-opacity interactive test

Merge fall-out from the text-actor branch. The test-opacity test
was moved to the conformance test suite.

15 years agoMerge the ClutterText actor
Emmanuele Bassi [Wed, 7 Jan 2009 12:06:33 +0000 (12:06 +0000)]
Merge the ClutterText actor

Merge branch 'text-actor'

* text-actor: (108 commits)
  Re-align ClutterText header file
  [text] Fix cursor sizing
  Comments and whitespace fixes to ClutterText
  [docs] Add newly added :single-line-mode accessors
  Update the ignore file
  [tests] Add text field interactive test
  [text] Add single-line-mode to ClutterText
  [text] Fix the deletion actions
  [text] Use cached length when possible
  [tests] Add unit for the ClutterText:password-char property
  [docs] Update the Text section
  [text] Coalesce text visibility and password character
  Allow localizations to change the text direction
  Clean up the update_pango_context() function
  Pass the PangoContext, not the MainContext
  Revert the logic of the PangoContext check
  Remove the binding pool entry from the list
  Remove BindingPool::list_actions()
  Add ClutterActor::create_pango_context()
  Rename the PangoContext creation functions
  ...

15 years agoRe-align ClutterText header file
Emmanuele Bassi [Wed, 7 Jan 2009 11:46:22 +0000 (11:46 +0000)]
Re-align ClutterText header file

The addition of the single line mode accessor methods caused the
re-alignment of the entire file.

15 years ago[text] Fix cursor sizing
Emmanuele Bassi [Wed, 7 Jan 2009 11:44:54 +0000 (11:44 +0000)]
[text] Fix cursor sizing

The cursor should be slightly smaller than the height of the actor, to
allow for painting a border. Let's pad it by 1 pixel on the top and 1
on the bottom.

Also, we should use the cursor size everywhere and not use hardcoded
magic numbers.

15 years agoComments and whitespace fixes to ClutterText
Emmanuele Bassi [Wed, 7 Jan 2009 00:43:24 +0000 (00:43 +0000)]
Comments and whitespace fixes to ClutterText

15 years ago[docs] Add newly added :single-line-mode accessors
Emmanuele Bassi [Wed, 7 Jan 2009 00:30:59 +0000 (00:30 +0000)]
[docs] Add newly added :single-line-mode accessors

Add the ClutterText:single-line-mode property accessor methods
to the API reference.

15 years agoUpdate the ignore file
Emmanuele Bassi [Wed, 7 Jan 2009 00:29:41 +0000 (00:29 +0000)]
Update the ignore file

15 years ago[tests] Add text field interactive test
Emmanuele Bassi [Wed, 7 Jan 2009 00:27:50 +0000 (00:27 +0000)]
[tests] Add text field interactive test

The test-text-field is a test/example that shows how to use the
ClutterText as a text input field in single line mode.

15 years ago[text] Add single-line-mode to ClutterText
Emmanuele Bassi [Wed, 7 Jan 2009 00:25:24 +0000 (00:25 +0000)]
[text] Add single-line-mode to ClutterText

Allow using ClutterText as a single line text field. This is useful for
text fields that accept just a single line of contents by default, and
respond to the Enter key press to execute some action.

The :single-line-mode property enables this behaviour inside ClutterText
by clipping and scrolling the contents of the PangoLayout if they do
not fit the allocated width of the Text actor.

15 years ago[text] Fix the deletion actions
Emmanuele Bassi [Tue, 6 Jan 2009 20:54:20 +0000 (20:54 +0000)]
[text] Fix the deletion actions

When using the delete-prev action from the end of the text we end
up either missing the first glyph we have to delete or falling
through the last one in the text.

This commit fixes both issues.

15 years ago[text] Use cached length when possible
Emmanuele Bassi [Tue, 6 Jan 2009 20:52:03 +0000 (20:52 +0000)]
[text] Use cached length when possible

Since clutter_text_set_text() measures the length of the text
each time, we should use the cached length instead of recomputing
the text length each time. This should save us some time when
dealing with long, multi-byte texts.

15 years ago[tests] Add unit for the ClutterText:password-char property
Emmanuele Bassi [Tue, 6 Jan 2009 15:30:31 +0000 (15:30 +0000)]
[tests] Add unit for the ClutterText:password-char property

Check that the contents of the Text actor are unaffected by the
:password-char property; that the accessors are correct; and finally
that the initial value for a newly constructed Text actor is valid.

15 years ago[docs] Update the Text section
Emmanuele Bassi [Tue, 6 Jan 2009 15:29:44 +0000 (15:29 +0000)]
[docs] Update the Text section

After the 979b6794 commit, the section for ClutterText needs
updating on the renamed and removed accessors.

15 years ago[text] Coalesce text visibility and password character
Emmanuele Bassi [Tue, 6 Jan 2009 15:22:31 +0000 (15:22 +0000)]
[text] Coalesce text visibility and password character

Using two properties to set a password entry can be construed as
both cumbersome and a gtk-ism. And rightly so on both counts.

The :text-visible property has also conflicting semantics with the
:cursor-visible one: while the latter hides the cursor, the former
changes the display of the contents of the Text actor. It is, thus,
not a matter of "visibility" but of "rendering".

Instead of setting the :text-visible and :invisible-char properties
to have a password text field, the Text actor should just have a
single :password-char property holding a Unicode character. If the
value of the :password-char is non-zero, the Text actor will use the
Unicode character to render the contents of the text entry.

This commit removes the following methods:

  clutter_text_set_text_visible()
  clutter_text_get_text_visible()
  clutter_text_set_invisible_char()
  clutter_text_get_invisible_char()

And the following properties:

  ClutterText:text-visible
  ClutterText:invisible-char

In favour of:

  clutter_text_set_password_char()
  clutter_text_get_password_char()

And:

  ClutterText:password-char

Thus making obvious what use the property and accessor methods are
for and simplifying the process of creating a simple password text
field to:

  text = clutter_text_new ();
  clutter_text_set_password_char (CLUTTER_TEXT (text), '*');

15 years agoAnimate ClutterColor properties
Emmanuele Bassi [Tue, 6 Jan 2009 12:53:30 +0000 (12:53 +0000)]
Animate ClutterColor properties

We can animate a ClutterColor-based property between an interval
of two colors by simply applying the factor to each color component.

15 years agoAllow localizations to change the text direction
Emmanuele Bassi [Tue, 6 Jan 2009 12:35:19 +0000 (12:35 +0000)]
Allow localizations to change the text direction

The locale translators of Clutter are also the ones that should set
the default direction of the text in a Clutter user interface.

This commit adds a translatable string that defines the direction
of the text; the translation authors will change it to the correct
value and that will determine the default direction.

The default text direction can be overridden by using the
CLUTTER_TEXT_DIRECTION environment variable, or by using the
--clutter-text-direction command line switch. In any other case,
the locale will determine the text direction, as it should.

15 years agoFix off-by-one error in clutter_stage_read_pixels
Neil Roberts [Tue, 6 Jan 2009 11:39:14 +0000 (11:39 +0000)]
Fix off-by-one error in clutter_stage_read_pixels

It was always reading one pixel lower than requested. If y was 0 then
it would try to read below the lowest line.

Thanks to Geoff Gustafson for spotting.

15 years agoBug 1397 - Allow localizing the command line help
Takao Fujiwara [Tue, 6 Jan 2009 12:11:07 +0000 (12:11 +0000)]
Bug 1397 - Allow localizing the command line help

Clutter has a set of command line options that are added to every
application by means of clutter_init() or by obtaining the Clutter
GOptionGroup and using g_option_context_parse(). Thus, every Clutter
application will automatically have an --help command line switch
showing the list of options and their description.

At the moment, Clutter does not enable localization of the help,
thus making it less than useful on non-English locales.

This patch enables the machinery to create a localization file and
load it when initializing Clutter, by means of the GLib macros and
locale.h API we already use.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
15 years agoMake libdisable-npots a bit more portable
Neil Roberts [Mon, 5 Jan 2009 17:05:30 +0000 (17:05 +0000)]
Make libdisable-npots a bit more portable

Instead of including GL/gl.h directly it now includes cogl/cogl.h
instead which should include the right GL header.

Instead of using dlopen to specifically open libGL it now tries to use
dlsym with RTLD_NEXT. This requires defining _GNU_SOURCE on GNU
systems. If RTLD_NEXT is not available it will try passing NULL which
is unlikely to work but it will at least catch the case where it
returns the wrapper version of glGetString to prevent infinite
recursion.

This should hopefully make it work on OS X where the name of the
header and library are different (although this is currently
untested).

15 years agoClean up the update_pango_context() function
Emmanuele Bassi [Mon, 5 Jan 2009 16:48:46 +0000 (16:48 +0000)]
Clean up the update_pango_context() function

Logically split the various operations with whitespace so that
it's clear what does what.

15 years agoPass the PangoContext, not the MainContext
Emmanuele Bassi [Mon, 5 Jan 2009 16:45:59 +0000 (16:45 +0000)]
Pass the PangoContext, not the MainContext

When updating the PangoContext with the current options (font name,
options, resolution) pass the PangoContext instead of the Clutter
MainContext structure pointer.

15 years agoRevert the logic of the PangoContext check
Emmanuele Bassi [Mon, 5 Jan 2009 16:44:52 +0000 (16:44 +0000)]
Revert the logic of the PangoContext check

The branch that creates the global PangoContext should only run
if there is no global PangoContext already.

15 years agoRemove the binding pool entry from the list
Emmanuele Bassi [Mon, 5 Jan 2009 16:29:49 +0000 (16:29 +0000)]
Remove the binding pool entry from the list

When removing a binding entry from the binding pool we should not
only remove it from the hash table, but also from the linked list
we use to iterate over inside the block/unblock_action() pair.

15 years agoRemove BindingPool::list_actions()
Emmanuele Bassi [Mon, 5 Jan 2009 16:25:50 +0000 (16:25 +0000)]
Remove BindingPool::list_actions()

The clutter_binding_pool_list_actions() was not implemented. The
utility of a call listing all the action names is also debatable:
all the functions related to the key bindings take the key symbol
and modifiers -- except the block_action() and unblock_action()
pair.

15 years agoAdd ClutterActor::create_pango_context()
Emmanuele Bassi [Mon, 5 Jan 2009 15:29:10 +0000 (15:29 +0000)]
Add ClutterActor::create_pango_context()

Sometimes an actor needs to set specific font rendering options on
the PangoContext without changing settings for every other text-rendering
actor.

In order to do this, we need a new public method to create a Pango
context object -- preset with all the default settings -- owned by the
developer and not shared with the rest of Clutter.

This new method is called clutter_actor_create_pango_context(); while
it does not strictly depend on a ClutterActor, it is a good idea to
have it inside the ClutterActor API to map the current get_pango_context()
method and in case we start storing screen-specific data to the Actor
itself during the 1.x API cycle.

15 years agoRename the PangoContext creation functions
Emmanuele Bassi [Mon, 5 Jan 2009 15:27:33 +0000 (15:27 +0000)]
Rename the PangoContext creation functions

The _clutter_context_create_pango_context() should create a new
context; the function returning the PangoContext stored inside the
MainContext structure should be named _get_pango_context() instead.

15 years agoWhitespace fixes
Emmanuele Bassi [Mon, 5 Jan 2009 15:26:57 +0000 (15:26 +0000)]
Whitespace fixes

15 years agoFix some animation_set_* functions so they cope if the value is the same
Neil Roberts [Mon, 5 Jan 2009 13:14:12 +0000 (13:14 +0000)]
Fix some animation_set_* functions so they cope if the value is the same

The following functions are fixed:

clutter_animation_set_actor
clutter_animation_set_timeline
clutter_animation_set_alpha

This is related to bug 1392 which discusses the problem for
behaviour_set_alpha.

15 years agoFix some *_set functions so they work if the object is the same value
Neil Roberts [Mon, 5 Jan 2009 12:05:51 +0000 (12:05 +0000)]
Fix some *_set functions so they work if the object is the same value

Bug 1392 - behaviour_set_alpha set same alpha twice lead to warning
and destroy the input alpha

The following functions are fixed:

clutter_actor_set_shader
clutter_alpha_set_timeline
clutter_behaviour_set_alpha
clutter_clone_texture_set_parent_texture

They either now reference the new value before destroying the old
value, or just return immediately if the values are the same.

15 years agoFix setting the mode on a ClutterAlpha created with animation_set_alpha(NULL)
Neil Roberts [Mon, 5 Jan 2009 12:52:46 +0000 (12:52 +0000)]
Fix setting the mode on a ClutterAlpha created with animation_set_alpha(NULL)

It previously attempted to set the mode on the alpha using
clutter_animation_set_mode_internal, but this was setting the mode on
priv->alpha. At that point in the code priv->alpha is always NULL.

clutter_animation_set_mode_internal now takes a parameter to specify
which alpha to modify.

15 years ago[docs] Add the new API to the BindingPool section
Emmanuele Bassi [Mon, 5 Jan 2009 12:52:29 +0000 (12:52 +0000)]
[docs] Add the new API to the BindingPool section

Add the clutter_binding_pool_override_* family of functions to
the BindingPool section of the Clutter API reference.

15 years agoAllow overriding actions inside a BindingPool
Emmanuele Bassi [Mon, 5 Jan 2009 12:49:01 +0000 (12:49 +0000)]
Allow overriding actions inside a BindingPool

As of now, a key binding installed into a BindingPool is always there
and cannot be changed.

This is problematic for sub-classes trying to override the callback
or the action for a given key binding.

This commit adds the ability to override the closure for an existing
key binding inside a binding pool -- assumed the caller knows the
key symbol and modifiers used to install the key binding in the first
place.

15 years agoIn clutter_alpha_set_mode, set priv->mode after setting the func
Neil Roberts [Mon, 5 Jan 2009 12:47:10 +0000 (12:47 +0000)]
In clutter_alpha_set_mode, set priv->mode after setting the func

Otherwise the call to clutter_alpha_set_func sets the mode back to
CLUTTER_CUSTOM_MODE so clutter_alpha_get_mode won't get back the same
value that was set.

15 years ago[text] Add select-all binding
Emmanuele Bassi [Mon, 5 Jan 2009 12:27:45 +0000 (12:27 +0000)]
[text] Add select-all binding

Bind Ctrl+A to the "select all" action.

15 years ago[docs] Add clutter_text_activate()
Emmanuele Bassi [Tue, 16 Dec 2008 17:44:13 +0000 (17:44 +0000)]
[docs] Add clutter_text_activate()

Add the last unused symbol to the ClutterText section.

15 years ago[docs] Remove ClutterLabel and ClutterEntry sections
Emmanuele Bassi [Tue, 16 Dec 2008 17:40:41 +0000 (17:40 +0000)]
[docs] Remove ClutterLabel and ClutterEntry sections

Remove the sections for the Label and the Entry actors, which
have been replaced by ClutterText.

15 years agoMerge branch 'units-rework'
Emmanuele Bassi [Mon, 5 Jan 2009 11:11:10 +0000 (11:11 +0000)]
Merge branch 'units-rework'

* units-rework:
  [texture] Do not mix fixed point and units values
  [tests] Fix the actor detection
  [units] Do not use fixed point and units interchangeably

15 years agoWhite space clean up across a number of files (only removing trailing spaces)
Robert Bragg [Tue, 23 Dec 2008 16:29:29 +0000 (16:29 +0000)]
White space clean up across a number of files (only removing trailing spaces)

Removed trailing white space from the following files:
- clutter-clone-texture.c
- clutter-texture.c
- clutter-texture.h
- cogl/cogl-texture.h
- cogl/gl/cogl-context.c
- cogl/gl/cogl-texture.c
- cogl/gl/cogl-context.h

15 years agoRemove a masking with index()
Emmanuele Bassi [Tue, 23 Dec 2008 21:06:05 +0000 (21:06 +0000)]
Remove a masking with index()

The binding-pool test unit had a variable masking the index() function
declared inside string.h.

15 years agoFix an empty block
Emmanuele Bassi [Tue, 23 Dec 2008 20:55:35 +0000 (20:55 +0000)]
Fix an empty block

Remove a stray ';' that prevented the get_bounds() method of the
ClutterBehaviourRotate to correctly return the start angle value.