Commit Graph

4685 Commits

Author SHA1 Message Date
Zan Dobersek
25b7b30ccc Add clutter_unicode_to_keyval function
This commit introduces a unicode-to-keyval conversion function that
performs identical action as the gdk version of that function. Also
added is the necessary table holding all the conversion values.

https://bugzilla.gnome.org/show_bug.cgi?id=661015
2011-10-07 12:11:20 +01:00
Sunjin Yang
5dbc00e625 box-layout: Plug memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=660985
2011-10-07 11:53:02 +01:00
Emmanuele Bassi
938fcc60f0 Deprecate the GParamSpec for CoglFixed
The fixed-point API is not used anywhere, and it's pretty much useless
to have a fixed-point type for properties.
2011-10-04 10:32:27 +01:00
Håkon Løvdal
839b939d36 spelling fix: timeour -> timeout 2011-10-03 15:58:42 +01:00
Adel Gadllah
d331e92742 clutter-actor-meta: Fix _clutter_meta_group_has_metas_no_internal
This function is backwards i.e it is supposed to check for metas that
are *not* internal, hence the name.

https://bugzilla.gnome.org/show_bug.cgi?id=660623
2011-10-01 12:40:11 +02:00
Emmanuele Bassi
6377d3646b paint-volume: Don't try to complete a completed volume
If we do project() → get_bounding_box(), we'll try to complete the
volume twice, which whacks out all the lazily computed vertices.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-30 17:05:15 +01:00
Neil Roberts
8b995a9457 clutter-shader-effect: Add a get_static_shader_source virtual
This is used as an alternative to calling
clutter_shader_effect_set_shader_source. A ClutterShaderEffect
subclass is now expected to implement this method to return the source
for the effect that will be used for all instances of this
subclass. It is only called once regardless of the number of instances
created. That way Clutter can avoid recompiling the shader source for
every new instance of the effect.

https://bugzilla.gnome.org/show_bug.cgi?id=660512

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-30 11:51:37 +01:00
Adel Gadllah
e8ec7ebed0 ClutterActor: Add clutter_actor_has_actions
Adds an efficent way to query whether an actor has any
applied actions.

https://bugzilla.gnome.org/show_bug.cgi?id=660471
2011-09-29 19:34:32 +02:00
Adel Gadllah
e81800607c ClutterActor: Add clutter_actor_has_contraints
Adds an efficent way to query whether an actor has any
applied constraints.

https://bugzilla.gnome.org/show_bug.cgi?id=660471
2011-09-29 19:34:31 +02:00
Adel Gadllah
bed2d9e787 ClutterActor: Add clutter_actor_has_effects
Adds an efficent way to query whether an actor has any
applied effects.

https://bugzilla.gnome.org/show_bug.cgi?id=660471
2011-09-29 19:34:24 +02:00
Emmanuele Bassi
b1fbbe23b4 Revert "Add lightness, brightness, and contrast effects"
Discussed a bit with Neil, and I might have jumped the gun a little.
We might want a different API for 1.10. See comment 12 on:

https://bugzilla.gnome.org/show_bug.cgi?id=656156

This reverts commit 4829ae1c79.
2011-09-28 15:54:32 +01:00
Joseph Scheuhammer
4829ae1c79 Add lightness, brightness, and contrast effects
Added three classes for new clutter effects:  inverse lightness,
modify brightness, and modify contrast.

https://bugzilla.gnome.org/show_bug.cgi?id=656156
2011-09-28 10:32:15 -04:00
Emmanuele Bassi
56c7d9b0b3 texture: Simplify asynchronous loading code
The asynchronous loading code could do with some modernization.

First of all, we should drop the internal GMutex held when manipulating
the boolean flags: it's far too expensive for its role, and modern GLib
provides us with bitlocks that are quite a lot faster.

Then we should consolidate most of the implementation into something
smaller and more manageable.
2011-09-28 13:52:53 +01:00
Emmanuele Bassi
11c585c420 texture: Remove GStaticMutex
It's now possible to statically initialize a GMutex.
2011-09-28 13:52:53 +01:00
Tomeu Vizoso
39db46123e Add paint-deform-tiles option to CLUTTER_DEBUG
To make easier to visualize the triangles in a ClutterDeformEffect

https://bugzilla.gnome.org/show_bug.cgi?id=660354
2011-09-28 14:28:04 +02:00
Emmanuele Bassi
1776ac8ed5 Remove internal usage of ClutterGeometry in StageWindow
The ClutterGeometry type is a poor substitute of cairo_rectangle_int_t,
with unsigned integers for width and height to complicate matters.

Let's remove the internal usage of ClutterGeometry and switch to the
rectangle type from Cairo.

https://bugzilla.gnome.org/show_bug.cgi?id=656663
2011-09-26 12:05:55 +01:00
Colin Walters
d3bafc4b09 clutter-main: Reword translator comment for default:LTR
This makes it much clearer, and fixes some typos in the original.

https://bugzilla.gnome.org/show_bug.cgi?id=659893
2011-09-23 17:48:34 +01:00
Alexandre Franke
a23e59bd66 Mark forgotten string as translatable
https://bugzilla.gnome.org/show_bug.cgi?id=659928
2011-09-23 17:48:34 +01:00
Neil Roberts
f8d808f140 Add a CLUTTER_PAINT debug option to enable continous redrawing
When testing the performance of an application, it's often useful to
force it to continuously redraw instead of going idle to help measure
the frame rate. This just adds a CLUTTER_PAINT=continuous-redraw which
causes the master clock to queue a redraw on all of the stages
just before it prepares its source.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-23 15:31:50 +01:00
Neil Roberts
c67d3e5b52 clutter-offscreen-effect: Apply matrix expansion to proj not mv
When the viewport gets expanded because the actor extends off the edge
of the screen, instead of applying the transformation to the root of
the modelview transformation it is now applied to the end of the
projection transformation. This should end up with the same
transformation. This fixes a problem when the offscreen effects are
nested and the inner effect would try to pick up the current modelview
transformation to rescale it to fit the new viewport size. In this
case the modelview would have already been scaled for the size of the
outer viewport so it would end up wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=659601

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-22 12:28:59 +01:00
Emmanuele Bassi
8051c47664 Fix typo in ClutterSettings:password-hint-time blurb 2011-09-19 23:14:04 +01:00
Emmanuele Bassi
93ece6dd7b text: Implement password hint
A ClutterText in password mode should have the ability to show the last
input character. This feature allows easier password entry on platforms
with unreliable keyboards, such as touchscreens or small devices.

https://bugzilla.gnome.org/show_bug.cgi?id=652588
2011-09-19 20:26:37 +01:00
Emmanuele Bassi
07912a147d settings: Add password-hint-time property
Add a setting that controls whether ClutterText actors in password mode
should display the last input character for a defined time. This helps
on touch-based interfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=652588
2011-09-19 20:26:37 +01:00
Tomeu Vizoso
4396bec330 Queue a redraw when removing an effect by name
https://bugzilla.gnome.org/show_bug.cgi?id=659501
2011-09-19 20:01:32 +01:00
Craig R. Hughes
fcc2ab7be5 Fix calculation of duration for ClutterState default transitions
https://bugzilla.gnome.org/show_bug.cgi?id=659200
2011-09-19 18:29:39 +01:00
Robert Bragg
96866804f0 actor: consider empty pv ok in set_default_paint_volume
In _clutter_actor_set_default_paint_volume we were returning FALSE if an
actor has an empty allocation because we were claiming it doesn't have a
paint-volume. Actually an empty/degenerate pv is valid and has different
semantics to returning FALSE because FALSE means the pv is unknown and
so Clutter will have to assume the worst - that the pv is basically
un-bounded.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-19 14:52:46 +01:00
Robert Bragg
239fc43c5f stage: implicitly clip to stage window bounds
This implicitly intersects any clip for redrawing with the stage window
bounds. Without this we were sometimes trying to set huge off screen
scissors leading to undefined clipping results.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-19 14:48:31 +01:00
Robert Bragg
662d12aeff actor: add oob-transform opt to catch out-of-band transforms
Out-of-band transforms are considered to be all actor transforms done
directly with the Cogl API instead of via ClutterActor::apply_transform.

By running with CLUTTER_DEBUG=oob-transform then Clutter will explicitly
try to detect when un-expected transforms have been applied to the
modelview matrix stack.

Out-of-band transforms can lead to awkward bugs in Clutter applications
because Clutter itself doesn't know about them and this can disrupt
Clutter's input handling and calculations of actor paint-volumes
which can lead to visual artifacts.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-19 14:48:06 +01:00
Rui Matos
41bd15226f text: We still have to paint the actor if the cursor is visible
https://bugzilla.gnome.org/show_bug.cgi?id=659116
2011-09-15 10:43:04 +01:00
Jasper St. Pierre
1883ee13f9 text: Take out a nonsense fallback
Invisible text is the best surprise for an update!

https://bugzilla.gnome.org/show_bug.cgi?id=659069
2011-09-14 21:49:45 -04:00
Emmanuele Bassi
a9a104e109 docs: Fixes for cross-references 2011-09-12 13:12:14 +01:00
Emmanuele Bassi
7ace3c2fdd docs: Fix clutter_box_packv() link 2011-09-12 12:36:31 +01:00
Emmanuele Bassi
27502af591 actor: Pack bitfields in ClutterActorPrivate
Bitfields should go at the end, to avoid holes in the middle of the
struct.
2011-09-12 11:33:18 +01:00
Matthias Clasen
5781beb22d cally: Fix up event listener registration minimally
For god-knows-what reason, at-spi is trying various formats
of strings when registering listeners, triggering an ugly

(gnome-shell:4411): Clutter-WARNING **: invalid object type create

warning in .xsession-errors. Stop doing that.

Also don't leak temporary string arrays that are a side-effect
of passing parameters around as formatted strings.

https://bugzilla.gnome.org/show_bug.cgi?id=658721
2011-09-11 10:57:25 -04:00
Emmanuele Bassi
c5ba998d64 stage: Protect call to unrealize() in dispose
Do not call ClutterStageWindow::unrealize() if the Stage has already
been unrealized.
2011-09-09 13:53:33 +01:00
Emmanuele Bassi
598e7a4a7e cogl/stage: Protect against multiple invocation of unrealize() 2011-09-09 13:52:55 +01:00
Emmanuele Bassi
bcd37e2e3d script: Hide private symbols
A bunch of private functions we use when parsing got exposed accidentaly
to the list of public symbols by virtue of not having the leading '_'
that we use to filter them out of the shared object — all the while the
header that declares them is a private, non installed one.

Let's rectify this situation with a bit of minor surgery on the code.
2011-09-07 16:14:10 +01:00
Emmanuele Bassi
9f70ea8dee text: Pack all bitfields at the end of the private structure
Don't leave them in the middle, to avoid holes.
2011-09-07 15:37:09 +01:00
Emmanuele Bassi
0c22246bea text: Clear up priv->text checks
The priv->text field cannot ever be NULL, so we don't need to check for
that in a series of places. We also need to assert() that pre-condition
in the couple of places where we set the contents of the ClutterText
actor, namely in set_text_internal() and set_markup_internal().

Based on a patch by: Dan Winship <danw@gnome.org>

http://bugzilla.clutter-project.org/show_bug.cgi?id=2629
2011-09-07 15:37:09 +01:00
Emmanuele Bassi
320bdeac03 text: Consistently protect against NULL strings
When calling clutter_text_set_text_internal() or
clutter_text_set_markup_internal() we need to make sure to pass a
non-NULL string.
2011-09-07 15:37:09 +01:00
Emmanuele Bassi
2af7ac4c13 actor: Fix annotations for out Vertex parameters 2011-09-07 13:00:35 +01:00
Emmanuele Bassi
0bd1e47b22 text: Make :use-markup set idempotent
Setting :use-markup and :text is currently not idempotent, and it
depends on the ordering, e.g.:

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

does not yield the same results as:

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

This is particularly jarring when using ClutterText from ClutterScript,
but in general GObject properties should not rely on the order when used
from g_object_set().

The fix is to store the contents of the ClutterText as a separate string
from the displayed text, and use the contents, instead of the displayed
text, when toggling the :use-markup property.

Let's also add a unit test for good measure, to try and catch
regressions.

https://bugzilla.gnome.org/show_bug.cgi?id=651940
2011-09-07 13:00:35 +01:00
Emmanuele Bassi
967bd3ac58 docs: Update test-easing and xinclude it into ClutterAnimation
The easing test is a nice example of what ClutterAnimation and
clutter_actor_animate() can do. The "tween ball to the pointer
event coordinates" is a bit of a staple in animation libraries
and their documentation.
2011-09-05 17:22:15 +01:00
Emmanuele Bassi
7024f1cd02 static-colors: Simplify the defines
Use a "private" macro to simplify the defined static colors.
2011-09-05 17:22:14 +01:00
Emmanuele Bassi
359ed2b29f text: Make :line-wrap actually work
When we paint a ClutterText we ask the actor for a PangoLayout that fits
inside the actor's allocation - both width and height.

Sadly, whenever a height is set on a PangoLayout, Pango will wrap its
contents - regardless of whether the layout should actually wrap or not.

This means that in certain easy to exploit cases, Clutter will paint a
Text actor with its contents wrapping even if the :wrap property is set
to FALSE.

In order to fix this we need to encode some more cases inside the
::paint implementation of ClutterText, and ask the cache for a layout
that is sized as the allocation's width, but not as its height; we also
need to perform a clip if we detect that the PangoLayout's logical size
is going to overflow the allocated size. This clip might cause some
performance issue, given that clipping breaks batching in the Cogl
journal; hopefully all clips for text are going to be screen-aligned, so
at the end of the batch it'll just scissor them out.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2339
2011-09-05 17:22:14 +01:00
Dan Winship
73d3026dd1 clutter-flow-layout: fix non-0,0 offset allocation
https://bugzilla.gnome.org/show_bug.cgi?id=649631
2011-09-05 12:21:18 -04:00
Emmanuele Bassi
a676ae67f7 docs: Fix up deprecation notice for BehaviourScale 2011-09-02 15:51:56 +01:00
Emmanuele Bassi
4255a75940 docs: Fix the ClutterTimeline:auto-reverse link 2011-09-02 15:49:05 +01:00
Emmanuele Bassi
79e152b7a0 docs: Inline test-constraints.c inside BindConstraint's description 2011-09-02 15:48:27 +01:00
Emmanuele Bassi
0d6208f36e docs: Inline test-drop.c into DropAction's description
Also, mention that DropAction only works with DragAction.
2011-09-02 15:22:08 +01:00