Commit Graph

1119 Commits

Author SHA1 Message Date
Stef Walter
c073764369 text: Implement ClutterTextBuffer
* Abstracts the buffer for text in ClutterText
 * Allows implementation of undo/redo.
 * Allows use of non-pageable memory for text
   in the case of sensitive passwords.
 * Implement a test with two ClutterText using the same
   buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=652653
2012-01-17 14:29:44 +00:00
Emmanuele Bassi
9a66392d49 actor: Add new methods for changing the paint sequence
ClutterActor provides four methods for changing the paint sequence order
of its children:

  raise_top()
  raise()
  lower()
  lower_bottom()

The first and last one being just wrappers around raise() and lower(),
respectively. These methods have various issues: they omit the parent,
preferring to retrieve it from the actor passed as the first argument;
this does not match the new style of API introduced to operate on the
list of children of an actor.

Additionally, the raise() and lower() methods of ClutterActor call into
the Container interface, and are not really aptly named (raise() in
particular collides with the completely unrelated 'raise' keyword in
Python, and usually needs to be wrapped in order to be used at all).

Furthermore, we need public methods that Container can call from its
default implementation, as well as methods to port current Container
implementations.

Finally, since we have insert_child_at_index(), we should also have an
equivalent set_child_at_index() as well.
2012-01-16 23:37:13 +00:00
Emmanuele Bassi
b42f17b2dc tests/interactive: Add a simple test for Actor
It's meant to be xincluded in the API reference.
2012-01-16 23:37:12 +00:00
Emmanuele Bassi
f61916fc5e actor: Add remove_all_children()
A simple method for removing all children of an actor in one fell swoop.
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
4f470b9231 actor: Provide a proper implementation of replace_child()
The correct sequence of actions should be remove(old) → insert(new), not
insert(new) → remove(old). We can implement a simple delegate insertion
functions to insert the new child between the previous and next siblings
of the old child.

While we're at it, let's also add a unit test for replace_child().
2012-01-16 23:37:11 +00:00
Emmanuele Bassi
f2015baeb7 conform/actor-graph: Add lower/raise units
Check that the lower_bottom(), lower(), raise(), and raise_top()
methods work as intended.
2012-01-16 23:37:10 +00:00
Emmanuele Bassi
419a6a38f2 conform: Add a suite for the Actor scene graph API
Verify that insertion and removal maintain a stable graph, with pointers
to the various children. This should help out tracking regressions in
the scene graph API.
2012-01-16 23:37:10 +00:00
Emmanuele Bassi
7fd35edd3f actor: Make Actor instantiatable
ClutterActor now has all the API and capabilities for being a concrete
class:

  - layout management, through delegation
  - container implementation and API
  - background color

This means that a simple scene can be built straight out of actors
without using subclasses except for the Stage.

This is the first step towards the deprecation of most of the Actor
subclasses provided by Clutter.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
7195d0fccf flow-layout: Fix minimum size request
The minimum preferred size of a Flow layout manager is the size of a
column or a row, as the whole point of the layout policy enforced by
the Flow layout manager is to reflow when needed.
2012-01-16 23:35:16 +00:00
Emmanuele Bassi
24a451b388 conform/layout: Remove last Container.add_actor() usage
Use clutter_actor_add_child(), now that Stage falls back to the default
implementation of Container provided by the Actor class.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
ef3dc2d1ba actor: Make Actor.add_child and Container.add_actor idempotent
And make sure that overriding Container and calling
clutter_actor_add_child() will result in the same sequence of operations
as the current set_parent()+queue_relayout()+signal_emit pattern.

Existing containers can continue using:

        clutter_actor_set_parent (child, CLUTTER_ACTOR (container));
        clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
        g_signal_emit_by_name (container, "actor-added", child);

and newly written containers overriding Container.add() can simply call:

        clutter_actor_add_child (CLUTTER_ACTOR (container), child);

instead.
2012-01-16 23:35:15 +00:00
Emmanuele Bassi
8c2118542c conform: Begin a test suite for layout options
A simple sampling check to validate that we're painting the right thing
at the right place.
2012-01-16 23:35:14 +00:00
Emmanuele Bassi
20b9ec8c6b build: Disable deprecation warnings in tests/accessibility
Like we do in the other tests/ sections.
2011-12-09 16:23:44 +00:00
Emmanuele Bassi
9e3a8a678e build: Disable deprecation warnings in tests/micro-bench 2011-12-09 16:23:35 +00:00
Emmanuele Bassi
bedf1664a7 build: Disable deprecation warnings in tests/performance 2011-12-09 16:23:20 +00:00
Robert Bragg
e5bde0b074 tests: Adds a simple wayland compositor example
This adds an extremely minimal wayland compositor to tests/interactive
to test the ClutterWaylandSurface actor. Currently this minimal
compositor doesn't support any input, it simply paints client surfaces
fixed at the top-left of the stage.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-08 16:13:37 +00:00
Chun-wei Fan
075ab0cbe6 conform/Makefile.am: Update Win32 test .bat name
Rename to test-conformance-clutter.bat to make the file name clearer to
users
2011-12-07 18:14:17 +08:00
Emmanuele Bassi
3f4bd0d9d4 conform: Add markers parsing to the timeline unit
We should check that the newly added custom parser for timeline
markers is working as intended.
2011-11-27 12:19:40 +00:00
Emmanuele Bassi
a13b095dc2 build: Fix distcheck 2011-11-22 13:53:08 +00:00
Emmanuele Bassi
a24ff882b6 conform: Bail out GLSL-based tests
If we don't have GLSL support on the platform.
2011-11-22 01:01:37 +00:00
Emmanuele Bassi
ecdb12ecc3 conform/cogl-pixel-buffer: Remove unused variable 2011-11-18 17:23:56 +00:00
Rico Tzschichholz
225820c4b4 Fix 'make dist' 2011-11-18 18:08:01 +01:00
Rico Tzschichholz
516b5de756 tests: Remove some trailing spaces 2011-11-18 17:38:45 +01:00
Emmanuele Bassi
73e7404652 build: Clean up the VS build rules
Some minor cleanups of the Visual Studio rules in the interactive and
conformance test suites.
2011-11-18 15:12:45 +00:00
Rico Tzschichholz
b62216955f build: Make sure test-unit-names.h is generated 2011-11-18 13:39:06 +01:00
Chun-wei Fan
a69c4fdc59 Merge branch 'master' into msvc-support-master 2011-11-17 22:17:01 +08:00
Emmanuele Bassi
ef02de19e8 interactive: Remove test-model
The model API is already tested in the conformance test suite.
2011-11-16 15:05:18 +00:00
Emmanuele Bassi
15000307fd interactive: Remove test-unproject
The coordinate transformation code is exercised throughout the
conformance and interactive tests, so there's no need to have a specific
interactive test that doesn't do anything more complicated than calling
clutter_actor_transform_stage_point().
2011-11-16 13:59:11 +00:00
Chun-wei Fan
2a54db4557 test-picking.c: Use G_PI rather than M_PI
M_PI is not universally available...
2011-11-15 16:29:35 +08:00
Chun-wei Fan
2a86ecc4b9 Update interactive/conformance .bat names
Add a -clutter suffix to avoid confustion with others, such as COGL.
2011-11-15 16:19:06 +08:00
Chun-wei Fan
96d4e527ea Merge branch 'master' into msvc-support-master 2011-11-14 22:57:50 +08:00
Chun-wei Fan
1b7249a247 Merge branch 'master' into msvc-support-master 2011-11-14 11:40:49 +08:00
Emmanuele Bassi
5903fcc36d performance/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:51 +00:00
Emmanuele Bassi
7c180a0742 interactive/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
6ed879b84c Merge with a11y 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
93eb0bfe32 micro-bench/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
a5522b707e accessibility/*: Do not use clutter_stage_get_default() 2011-11-10 15:37:50 +00:00
Emmanuele Bassi
deba576dd1 conform/*: Do not use clutter_stage_get_default()
Use the correct stage creation/destruction API.
2011-11-10 15:37:50 +00:00
Emmanuele Bassi
e374c2bd89 conform/color: Check invalid strings
We need to make sure to fail consistently for invalid strings.
2011-11-10 14:15:32 +00:00
Emmanuele Bassi
889a1f44f4 conform/color: Test hsla() format 2011-11-10 12:57:34 +00:00
Chun-wei Fan
63dbcc245c Merge branch 'master' into msvc-support-master 2011-11-09 00:30:32 +08:00
Emmanuele Bassi
101f39ea92 Replace usage of [sg]et_geometry()
The set_geometry() and get_geometry() methods are going to be
deprecated.
2011-11-08 14:46:16 +00:00
Chun-wei Fan
bb9e452a36 Merge branch 'master' into msvc-support-master 2011-11-07 11:42:16 +08:00
Emmanuele Bassi
53513f8586 tests: Remove #undef CLUTTER_DISABLE_DEPRECATED
We need to test deprecated API as well, and we don't use a guard any
more in the build.
2011-11-03 15:35:03 +00:00
Emmanuele Bassi
c4e6f74f29 interactive/pixmap: Make sure to work only on the X11 backend
Even if the test has been successfully compiled against the X11 backend,
we need to ensure that it is actually running against it, otherwise bad
things will happen.
2011-11-03 13:45:21 +00:00
Emmanuele Bassi
3b38cee66b interactive/devices: Build unconditionally
The test-devices interactive test does not rely on the X11 API being
present any more, after the introduction of the device manager API.
2011-11-03 13:45:21 +00:00
Emmanuele Bassi
a09bbffd92 Implement multi-backend support
The Clutter backend split is opaque enough that should allow us to just
build all possible backends inside the same shared object, and select
the wanted backend at initialization time.

This requires some work in the build system, as well as the
initialization code, to remove duplicate functions that might cause
conflicts at build and link time. We also need to defer all the checks
of the internal state of the platform-specific API to run-time type
checks.
2011-11-03 13:45:19 +00:00
Giovanni Campagna
610a9c17ba Add a new GDK backend
This commit introduces a new flavour for Clutter, that uses GDK
for handling all window system specific interactions (except for
creating the cogl context, as cogl does not know about GDK), including
in particular events. This is not compatible with the X11 (glx)
flavour, and this is reflected by the different soname (libclutter-gdk-1.0.so),
as all X11 specific functions and classes are not available. If you
wish to be compatible, you should check for CLUTTER_WINDOWING_X11.
Other than that, this backend should be on feature parity with X11,
including XInput 2, XSettings and EMWH (with much, much less code)

https://bugzilla.gnome.org/show_bug.cgi?id=657434
2011-11-03 13:42:13 +00:00
Chun-wei Fan
fedca055e9 Revert "Revert "Deprecate clutter_threads_init()""
This reverts commit 5419c11c99.

This is another part to attempt to investigate on error 0xC0000264
on Windows
2011-10-21 17:44:27 +08:00
Chun-wei Fan
098a83af9e test-[interactive/conformance].bat: Update .exe name 2011-10-20 17:26:55 +08:00
Chun-wei Fan
a36ab5787b Rename conform/interactive tests VS projects
Add a -clutter suffix for their project names to avoid clashes with the
COGL test executables
2011-10-20 16:35:38 +08:00
Chun-wei Fan
d6af2e54c8 Merge branch 'master' into msvc-support-master 2011-10-20 15:41:46 +08:00
Chun-wei Fan
5419c11c99 Revert "Deprecate clutter_threads_init()"
This reverts commit 7e3a75c66b.

Conflicts:

	clutter/clutter-main.c
	clutter/clutter-main.h
2011-10-20 15:17:25 +08:00
Neil Roberts
b240b95a97 tests: Use the portable cogl wrappers for GLSL builtins
Instead of directly using the GLSL names for the builtins in the
shaders for test-shader and test-pick, this makes it use the Cogl
wrapper names instead. That way it will be portable to GLES2 as well.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-10-19 13:50:48 +01:00
Chun-wei Fan
b1780711f7 Merge branch 'master' into msvc-support-master 2011-10-17 15:52:57 +08:00
Emmanuele Bassi
f75dfcfd8b interactive: Use the newly added CLUTTER_ALIGN_BOTH value
We center a lot of stuff using ClutterAlignConstraints.
2011-10-15 18:36:27 +01:00
Emmanuele Bassi
96cb1d7128 Disable deprecation warnings for the test suite
We test deprecated functionality as well as current one, so we need to
enable all symbols and disable the deprecation warnings.
2011-10-13 17:50:25 +01:00
Emmanuele Bassi
c58baf42ca interactive/threads: Clean up
Add some comments explaining why we use idle handlers to update the UI,
and update to the newest API in GLib master.
2011-10-13 10:38:36 +01:00
Emmanuele Bassi
9901a06a1f tests: Fix some compiler warnings 2011-10-12 09:57:53 +01:00
Emmanuele Bassi
9e61cfcf38 tests: Disable deprecation warnings 2011-10-12 09:57:33 +01:00
Chun-wei Fan
bd991e625b Merge branch 'master' into msvc-support-master 2011-10-12 14:37:19 +08:00
Emmanuele Bassi
29a16980fe interactive/threads: Use G_PRIVATE_INIT
Though strictly not necessary, we should be using the proper init macro
for GPrivate.
2011-10-12 00:22:04 +01:00
Emmanuele Bassi
57f54173ec interactive/threads: Fix up after deprecations
The GThread API has undergone a massive restructuring, and the fallout
is still being processed.
2011-10-11 17:52:17 +01:00
Chun-wei Fan
1cf7128540 Merge branch 'master' into msvc-support-master 2011-10-11 17:19:45 +08:00
Emmanuele Bassi
33846dcf4d Deprecate clutter_redraw()
It's just a badly named proxy to clutter_stage_ensure_redraw().
2011-10-10 15:48:43 +01:00
Emmanuele Bassi
7e3a75c66b Deprecate clutter_threads_init()
GLib deprecated g_thread_init(), and threading support is initialized
by GObject, so Clutter already runs with threading support enabled. We
can drop the clutter_threads_init() call requirement, and initialize the
Big Clutter Lock™ on clutter_init(). This reduces the things that have
to be done when dealing with threads with Clutter, and the things that
can possibly go wrong.
2011-10-07 15:57:32 +01:00
Emmanuele Bassi
3690ddc4a0 Drop g_thread_init()
It's not necessary any more, and it has been deprecated.
2011-10-07 15:10:37 +01:00
Chun-wei Fan
a9771b596f Update Visual C++ support
-tests/interactive/Makefile.am, build/win32/Makefile.am: copy the
 generated test-unit-names.h to build/win32 so that it can be
 distributed in "make dist" (maybe we could dist the generated header
 in tests/interactive directly?)
-Update test-interactive Visual C++ projects to include build/win32 in
 the list of folders to look for headers
2011-10-06 13:00:26 +08:00
Chun-wei Fan
b55656b698 Merge branch 'master' into msvc-support-master 2011-10-06 12:04:30 +08:00
Neil Roberts
3372a0233e Add a conformance test for ClutterShaderEffect
This adds a simple conformance test which sets up a few shader effects
using both the old style with clutter_shader_effect_set_source and the
new style by overriding get_static_shader_source. The effects are then
verified to confirm that they drew the right pixel colour.

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

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-30 11:51:38 +01:00
Emmanuele Bassi
e058cd4c5f Pass the remaining args to the executed interactive unit
We only support running one interactive test at a time; everything after
the unit name is to be considered an argument to the actual unit.
2011-09-29 14:01:03 +01:00
Chun-wei Fan
f0dfd8ab07 Merge branch 'master' into msvc-support-master
Conflicts:
	tests/interactive/Makefile.am
2011-09-29 16:33:02 +08:00
Emmanuele Bassi
ac8e174eca tests/interactive: Add some descriptions 2011-09-28 15:18:21 +01:00
Emmanuele Bassi
5fc953cb5e test-textures -> test-texture-slicing
The unit is supposed to be testing the slicing support in CoglTexture.
2011-09-28 15:18:21 +01:00
Emmanuele Bassi
d640c56cef test-interactive: Allow querying the interactive test for a description
It would be nice if the interactive tests had a way to be queried for a
description, instead of "Just Knowing" what they are meant to be doing.
2011-09-28 15:18:21 +01:00
Emmanuele Bassi
4ebdeede9f test-texture-async: Clean up the test code
Force threading on, and stop using the default stage and behaviours:
let's try to use modern API.
2011-09-28 13:52:53 +01:00
Chun-wei Fan
65e498e3f9 Conform-tests: Remove C99ism 2011-09-16 17:34:29 +08:00
Chun-wei Fan
9f12ec534e msvc-support: Recover wrecked branch
Recover the branch! :|
2011-09-16 17:25:47 +08: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
bce27e45b0 test-constraints: Clean up the example
Add some comments to detail what are we doing and why.
2011-09-02 15:39:56 +01:00
Emmanuele Bassi
2fdf73f64a tests: Go back to the hover state on button-release
If we get a button release, going back to the hover state is the most
logical choice.
2011-08-31 12:25:01 +01:00
Robert Bragg
0aacbd47b7 actor: make offscreen_redirect prop take flags + default off
Because we have had several reports about significant performance
regressions since we enabled offscreen redirection by default for
handling correct opacity we are now turning this feature off by default.

We feel that clutter should prioritize performance over correctness in
this case. Correct opacity is still possible if required but the
overhead of the numerous offscreen allocations as well as the cost of
many render target switches per-frame seems too high relative the
improvement in quality for many cases.

On reviewing the offscreen_redirect property so we have a way to
disable redirection by default we realized that it makes more sense for
it to take a set of flags instead of an enum so we can potentially
extend the number of things that might result in offscreen redirection.

We removed the ability to say REDIRECT_ALWAYS_FOR_OPACITY, since it
seems that implies you don't trust the implementation of an actor's
has_overlaps() vfunc which doesn't seem right.

The default value if actor::redirect_offscreen is now 0 which
effectively means don't ever redirect the actor offscreen.
2011-08-30 16:20:16 +01:00
Alejandro Piñeiro
f1a7cd7c0f Merge branch 'atkwindow' 2011-08-30 12:26:35 +02:00
Emmanuele Bassi
059d32b40d build: Add -lm to the tests linker flags
https://bugzilla.gnome.org/show_bug.cgi?id=657529
2011-08-28 00:03:28 +01:00
Alejandro Piñeiro
663bfd0e85 a11y: Using proper way to register to window events 2011-08-23 17:22:17 +02:00
Emmanuele Bassi
abcc7c62ec build: Do not define LDADD twice 2011-08-15 23:52:55 +01:00
Alejandro Piñeiro
efa7a66a70 build: list correct dependencies
Related to bug https://bugzilla.gnome.org/show_bug.cgi?id=656306#c4
2011-08-15 17:33:27 +02:00
Emmanuele Bassi
df107fc5ba interactive/test-actors: Constraint the hands group
Use constraints to align and size the ClutterGroup containing the
spinning hands so that resizing the stage doesn't look like arse.
2011-08-15 15:53:58 +01:00
Emmanuele Bassi
3591be474e conform: Temporarily disable Cally's conformance test
See bug:

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

for the failure.
2011-08-15 14:09:24 +01:00
Neil Roberts
944d9bdd69 test-cogl-blend-strings: Don't disable the TEXTURE_N test
This is now fixed in Cogl so there's no need to disable it.
2011-08-04 19:18:36 +01:00
Emmanuele Bassi
f28c1d2d2a state: Use the Animatable interface
The Animatable interface allows object classes to provide and animate
properties outside of the usual GObject property introspection API.

This change allows ClutterState to defer to the animatable objects the
property introspection and animation, just like ClutterAnimation does.
2011-07-29 11:44:28 +01:00
Emmanuele Bassi
e470fd7d82 model: Make sure to emit ::row-changed
Currently, only clutter_model_iter_set_valist() is in charge of emitting
the ClutterModel::row-changed signal. Both the set() and the
set_valist() functions can be called with multiple columns, so we
coalesce the signal emission at the end of the set_valist(), to have a
single ::row-changed emission per change.

The clutter_model_iter_set_value() function is just a thin wrapper
around the set_value() virtual function, but since it's called
internally we cannot add the signal emission there as well, as we'd
break the signal coalescing.

For this reason, we need some code refactoring inside the various set()
variants of ClutterModelIter:

  - we only use the internal va_arg variant for both the set() and
    set_valist() public functions, to avoid multiple type checks;
  - the internal set_valist() calls an internal set_value() method
    which calls the virtual function from the iterator vtable;
  - a new internal emit_row_changed() method is needed to retrieve
    the ClutterModel from the iterator, and emit the signal;

Now, all three variants of the value setter will call an internal
ClutterModelIter::set_value() wrapper, and emit the ::row-changed
signal.

To check that the intended behaviour has been implemented, and it's not
going to be broken, the test suite has grown a new unit which populates
a model and changes a random row.
2011-07-28 15:00:18 +01:00
Emmanuele Bassi
110dff5823 test/cairo-clock: Remove a double source color set
Do not call cairo_set_source_rgba() right after calling
clutter_cairo_set_source_color().
2011-07-27 11:48:07 +01:00
Emmanuele Bassi
7f8838d7cc cairo-texture: Add the :auto-resize property
Keeping the backing Cairo surface of a CairoTexture canvas in sync with
the actor's allocation is tedious and prone to mistakes. We can
definitely do better by simply exposing a property that does the surface
resize and invalidation automagically on ::allocate.
2011-07-26 14:55:19 +01:00
Philippe Normand
301551aacf tests: initial support for cally-text conform tests 2011-07-26 15:30:09 +02:00
Emmanuele Bassi
278daca61c cairo-texture: Deprecate create()/create_region()
The recommended way of drawing on a ClutterCairoTexture is the ::draw
signal.
2011-07-26 12:53:22 +01:00
Emmanuele Bassi
2f445682b1 cairo-texture: Use signal-based drawing
The current "create context/draw/destroy context" pattern presents
various problems. The first issue is that it defers memory management to
the caller of the create() or create_region() methods, which makes
bookkeeping of the cairo_t* harder for language bindings and third party
libraries. The second issue is that, while it's easier for
draw-and-forget texturs, this API is needlessly complicated for contents
that have to change programmatically - and it introduces constraints
like calling the drawing code explicitly after a surface resize (e.g.
inside an allocate() implementation).

By using a signal-based approach we can make the CairoTexture actor
behave like other actors, and like other libraries using Cairo as their
2D drawing API.

The semantics of the newly-introduced ::draw signal are the same as the
one used by GTK+:

  - the signal is emitted on invalidation;
  - the cairo_t* context is owned by the actor;
  - it is safe to have multiple callbacks attached to the same
    signal, to allow composition;
  - the cairo_t* is already clipped to the invalidated area, so
    that Cairo can discard geometry immediately before we upload
    the texture data.

There are possible future improvements, like coalescing multiple
invalidations inside regions, and performing clipped draws during
the paint cycle; we could even perform clipped redraws if we know the
extent of the invalidated area.
2011-07-26 12:40:52 +01:00
Emmanuele Bassi
dcad27120e conform/cogl-materials: Fix a compiler warning
The function checking for the presence and use of the GLES2 support in
Cogl should be protected by #ifdef guards, to avoid a compiler warning.
2011-07-25 11:09:20 +01:00
Neil Roberts
cbe1e8321b tests: Dynamically resolve GL symbols
Some of the tests are making direct GL calls. Eventually we want
Clutter not to link directly against any GL library so that it can
leave Cogl to load it dynamically. As a step towards getting this to
work this patch changes the tests to resolve the symbols using
cogl_get_proc_address instead of linking directly.
2011-07-19 16:06:06 +01:00
Neil Roberts
fa336ab57f test-cogl-materials: Use glGetString to determine cogl driver
Rather than using the #ifdefs and assuming that only one Cogl driver
is compiled in (which is no longer true), the test now calls
glGetString to check the GL_VERSION. This is kind of a hack but the
test is already calling GL functions directly anyway.
2011-07-11 17:21:52 +01:00
Neil Roberts
2bb4c2c6cb test-cogl-materials: Remove a redundant comment
test-cogl-materials had a weird comment about glReadPixels using
inverted coordinates but the test now uses cogl_read_pixels instead of
glReadPixels so it is irrelevant.
2011-07-11 17:21:52 +01:00
Emmanuele Bassi
73b043630d conform/pick: Print debug spew only if verbosity is toggled 2011-07-08 12:12:43 +01:00
Emmanuele Bassi
96440acffe texture: Deprecate the new_from_actor() function
Now that we have proper offscreen and shader handling using the
ClutterEffect API, we can finally deprecate this hard to bind, easy
to break function.
2011-07-08 12:08:19 +01:00
Emmanuele Bassi
e677ebc3e8 Deprecate ClutterScore
The class is of dubious utility, now that we have a complex animation
API in ClutterAnimator and ClutterState, as opposed to a simple one
in ClutterBehaviour. The Score API also suffers from some naïve design
issues that made it far less useful than intended.
2011-07-08 12:01:08 +01:00
Neil Roberts
7115c54fda test-cogl-materials: Add a simple test for ref-counting copies
This adds a simple test which creates a material and a copy of
it. Both materials are then immediately unref'd. The test checks
whether the materials were actually freed by registering some user
data with a destroy callback. This should catch a bug that Cogl had
where it add an extra reference to the parent when a pipeline is
copied.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2011-07-07 02:08:12 +01:00
Philippe Normand
eb28d16300 a11y: cally-text get_offset_at_point implementation
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 17:05:49 +02:00
Philippe Normand
7565fcaab0 a11y: cally-text get_character_extents implementation
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 16:56:30 +02:00
Philippe Normand
ae0aa9e4cf a11y: get_default_attributes implementation on cally-text
See http://bugzilla.clutter-project.org/show_bug.cgi?id=1733
2011-07-06 16:51:49 +02:00
Philippe Normand
6812ed7d3a a11y: cally-atktext-example cleanups
Added an early return in test_atk_text().
Fixed a unichar conversion
Print the run_attributes too.
2011-07-06 16:45:36 +02:00
Emmanuele Bassi
c1e113c89a build: Clean up the cally test Makefile.am
Use global target variables to avoid copy/pasting the same values in
every single binary target.
2011-07-04 18:13:25 +01:00
Øyvind Kolås
aa05b66a01 tests: Add performance tracking framework
This adds a performance tracking framework that can run a set of tests over
specified git revisions. The ruby script for generating the reports comes from
similar performance tracking in GEGL. The framework permits evaluating new
tests against older version of clutter.

The tests themselves go through a few hoops for disabling framerate limiting in
both mesa and clutter.

When running make check the tests will be run and lines of the form:

@ test-state: 40.51 fps

will be left in the output, a script can scrape these lines out of a build log
on a buildbot to in other ways track performance.
2011-07-04 17:27:48 +01:00
Robert Bragg
8e3805136c build: check COGL_HAS_GLES2 to check for gles2 support
We were checking HAVE_COGL_GLES2 but this is not publicly defined by
Cogl so since splitting Cogl from Clutter test-cogl-materials.c would
not have built against gles2 since it would end up enabling the GL
specific code path which would reference an undefined symbol.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-07-04 15:41:38 +01:00
Emmanuele Bassi
1238e0ddf9 Add ClutterDropAction
ClutterDropAction is an Action sub-class that allows writing actors that
react to dragged actors being dropped on them.

https://bugzilla.gnome.org/show_bug.cgi?id=652842
2011-06-20 15:25:53 +01:00
Emmanuele Bassi
b6eb5728e1 stage: Make per-actor motion event delivery accessors public
Complete the quest of commit bc548dc862
by making the ClutterStage methods for controlling the per-actor motion
and crossing event delivery public, and deprecating the global ones.
2011-06-20 11:41:28 +01:00
Emmanuele Bassi
daaa4c5b96 tests/cally: Remove last uses of clutter_group_add() 2011-06-16 17:11:39 +01:00
Emmanuele Bassi
cb3999744f Remove usage of clutter_group_add()
The macro is there for mallum eyes only.
2011-06-16 17:07:32 +01:00
Emmanuele Bassi
74a9b71060 effect: Rename RunFlags to PaintFlags
Since run() was replaced and both paint() and pick() use the
enumeration.

https://bugzilla.gnome.org/show_bug.cgi?id=651700
2011-06-13 16:00:45 +01:00
Tomeu Vizoso
0ede622f51 Give a chance to effects for running when picking
Some effects can change the actor's shape and position, so they need
to run when picking.

https://bugzilla.gnome.org/show_bug.cgi?id=651700
2011-06-13 15:45:36 +01:00
Emmanuele Bassi
cd2b36ed91 Merge branch 'swipe-action'
* swipe-action:
  test-swipe-action: Clean up the test code
  docs: Add the new actions to the API reference
  gesture-action: Remove the multi-device entry points
  swipe-action: Remove the required devices call
  swipe-action: Clean up
  gesture-action: Clean up
  Add ClutterSwipeAction and ClutterGestureAction
2011-06-13 14:39:03 +01:00
Emmanuele Bassi
b33973f9f8 script: Rename "state" → "states"
Make it clear that the key used when defining a state-based signal is
linked to the states of a ClutterState.
2011-06-13 13:47:08 +01:00
Emmanuele Bassi
e745ce52e7 test-interactive: Add signal-based state transitions
Use the newly added support for binding signal emissions to state
changes on a ClutterState.
2011-06-13 13:47:08 +01:00
Robert Bragg
7b4f7cd3e0 build: include <cairo.h> not <cairo/cairo.h>
cairo.h is intended to be included as <cairo.h> not <cairo/cairo.h> as
is the style for clutter.h. If you have installed cairo to a custom
prefix then using cairo/cairo.h can result in unintentional use of the
system cairo headers, or if they aren't installed then it will result in
a failure to find the header.
2011-06-10 17:57:18 +01:00
Emmanuele Bassi
80dd60ecbb test-swipe-action: Clean up the test code
Remove unused code, and be more strict at discarding swipes on
constrained actors.

Add a note on the behaviour of each rectangle/action pair.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
2011-06-10 15:15:15 +01:00
Tomeu Vizoso
ba72235b66 Add ClutterSwipeAction and ClutterGestureAction
To allow actors to handle gestures in a more organized way.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
2011-06-10 14:02:17 +01:00
Emmanuele Bassi
8b70260528 test-bin-layout: Use the long-press signal on ClickAction 2011-06-09 15:12:41 +01:00
Emmanuele Bassi
835fc2381c Deprecate ClutterShader
With the instantiatable ClutterShaderEffect, the only reason for
ClutterShader to exist is to make the ClutterActor::paint implementation
miserable.

Yes, ClutterShader doesn't use a FBO, so it's "more efficient" on
ClutterTextures. It's also generally wrong unless you know *exactly* how
the actor's pipeline is set up — something we cannot even guarantee
internally unless we start doing lame type checks.
2011-06-07 14:09:53 +01:00
Emmanuele Bassi
941d8d23fa test-constrains: Use a ShaderEffect
Demonstrate how to use a ShaderEffect instance.
2011-06-07 14:09:53 +01:00
Emmanuele Bassi
0b0d4e1239 test-binding-pool: Remove usage of deprecated get_gid()
Use the actor name instead of a random, internal numeric id.
2011-05-31 11:57:18 +01:00
Alejandro Piñeiro
247c8d49ae [cally] Fix a crash on some a11y examples if there isn't accessibility support
Most of the accessibility tests can be executed without the
accessibility support, although it is clear that they will
not work properly (ie using accerciser).

But in some specific cases (right now just the atk event test),
the test will crash if no accessibility support is enabled

Fixes http://bugzilla.clutter-project.org/show_bug.cgi?id=2447
2011-05-20 14:00:35 +02:00
Neil Roberts
c18a83baa3 test-cogl-depth-test: Update to new Cogl API
The Cogl depth state API has changed to have a separate CoglDepthState
struct so this test was no longer building. This patch updates it to
use CoglPipeline and the new depth state API.
2011-05-16 19:01:14 +01:00
Neil Roberts
86dce2fd98 test-cogl-pixel-buffer: Use the new name for CoglPixelArray
Cogl has changed the name of the experimental CoglPixelArray API to
CoglPixelBuffer. This updates the test to reflect that so it will
continue to build.
2011-05-16 16:07:19 +01:00
Neil Roberts
7d233241f1 Fix include location for cogl-pango.h
In Cogl, cogl-pango.h has moved to <cogl-pango/cogl-pango.h>. When
using the experimental 2.0 API (which Clutter does) it is no longer
possible to include it under the old name of <cogl/cogl-pango.h> so we
need to update the include location.
2011-05-16 16:04:27 +01:00
Adam Jackson
5aa8ed93ce test-cogl-sub-texture: Allow single-bit rendering error
Signed-off-by: Adam Jackson <ajax@redhat.com>

http://bugzilla.clutter-project.org/show_bug.cgi?id=2640
2011-05-14 01:12:44 +01:00
Adam Jackson
7beb222d3f test-cogl-blend-strings: Allow single-bit rendering error
Signed-off-by: Adam Jackson <ajax@redhat.com>

http://bugzilla.clutter-project.org/show_bug.cgi?id=2640
2011-05-14 01:12:44 +01:00
Jasper St. Pierre
0a8ec7f7d5 tests: Add test for selected-text-color
http://bugzilla.clutter-project.org/show_bug.cgi?id=2595
2011-05-13 15:44:08 +01:00
Neil Roberts
701440efd8 clutter-actor: Add a 'has_overlaps' virtual
This adds a virtual to ClutterActor so that an actor subclass can
report whether it has overlapping primitives. ClutterActor uses this
to determine whether it needs to use ClutterFlattenEffect to implement
the opacity property. The default implementation of the virtual
returns TRUE which means that most actors will end up being redirected
offscreen when the opacity != 255. ClutterTexture and ClutterRectangle
override this to return FALSE because they should never need to be
redirected. ClutterClone overrides it to divert to the source.

The values for the ClutterOffscreenRedirect enum have changed to:

AUTOMATIC_FOR_OPACITY

 The actor will only be redirected if has_overlaps returns TRUE and
 the opacity is < 255

ALWAYS_FOR_OPACITY

 The actor will always be redirected if the opacity < 255 regardless
 of the return value of has_overlaps

ALWAYS

 The actor will always be redirected offscreen.

This means that the property can't be used to prevent the actor from
being redirected but only to increase the likelihood that it will be
redirected.

ClutterActor now adds and removes the flatten effect depending on
whether flattening is needed directly in clutter_actor_paint(). There
are new internal versions of add/remove_effect that don't queue a
redraw. This means that ClutterFlattenEffect is now just a no-op
subclass of ClutterOffscreen. It is only needed because
ClutterOffscreen is abstract. Removing the effect also makes it so
that the cached image will be freed as soon as an actor is repainted
without being flattened.
2011-05-13 01:46:32 +01:00
Neil Roberts
2a09a04c2a Add a conformance test for the offscreen-redirect property
This adds a conformance test for redirecting offscreen. It verifies
that the redirected actor has the right paint opacity, that it gets
redrawn only when the image cache needs to be invalidated and that it
ends up with the right appearance.
2011-05-13 01:46:32 +01:00
Emmanuele Bassi
043f804452 Make the pick id pool per Stage
The id pool used for the actor's id should be a per-stage field. At some
point, we might have a Stage mapped to multiple framebuffers, or each
Stage mapped to a different framebuffer; also, on backend with low
color precision we don't want to exhaust the size of the available ids
with a global pool. Finally, it's yet another thing we can remove from
the global Clutter context.

Having the id pool allocated per-stage, and the pick id assigned on
Actor:mapped will make the whole pick-id more reliable and future proof.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2633

https://bugzilla.gnome.org/show_bug.cgi?id=647876
2011-05-06 17:47:41 +01:00
Robert Bragg
589c80e41e Remove last dependency on the GdkPixbuf API
In test-pixmap.c instead of using the GdkPixbuf API to load the
redhand.png image we now use the cairo API to load the png into a xlib
surface which wraps our Pixmap.

This test was the last thing that depended on the gdk API and since
it's more concise to use Cairo here which is a hard dependency for
Clutter this change means we avoid depending on GdkPixbuf directly.
2011-05-06 15:44:13 +01:00
Robert Bragg
223e14811c Removes Cogl from the repository
Cogl has now been split out into a standalone project with a separate
repository at git://git.gnome.org/cogl. From now on the Clutter build
will now simply look for a cogl-1.0 pkg-config file to find a suitable
Cogl library to link against at build time.
2011-05-06 15:44:08 +01:00
Robert Bragg
70767f08dc Adds a --with-system-cogl config option for Clutter
This makes it possible to build Clutter against a standalone build of
Cogl instead of having the Clutter build traverse into the clutter/cogl
subdirectory.
2011-04-11 17:54:36 +01:00
Robert Bragg
31da46c799 Adds the ability to build Cogl standalone
This adds an autogen.sh, configure.ac and build/autotool files etc under
clutter/cogl and makes some corresponding Makefile.am changes that make
it possible to build and install Cogl as a standalone library.

Some notable things about this are:
A standalone installation of Cogl installs 3 pkg-config files;
cogl-1.0.pc, cogl-gl-1.0.pc and cogl-2.0.pc. The second is only for
compatibility with what clutter installed though I'm not sure that
anything uses it so maybe we could remove it. cogl-1.0.pc is what
Clutter would use if it were updated to build against a standalone cogl
library. cogl-2.0.pc is what you would use if you were writing a
standalone Cogl application.

A standalone installation results in two libraries currently, libcogl.so
and libcogl-pango.so. Notably we don't include a major number in the
sonames because libcogl supports two major API versions; 1.x as used by
Clutter and the experimental 2.x API for standalone applications.
Parallel installation of later versions e.g. 3.x and beyond will be
supportable either with new sonames or if we can maintain ABI then we'll
continue to share libcogl.so.

The headers are similarly not installed into a directory with a major
version number since the same headers are shared to export the 1.x and
2.x APIs (The only difference is that cogl-2.0.pc ensures that
-DCOGL_ENABLE_EXPERIMENTAL_2_0_API is used). Parallel installation of
later versions is not precluded though since we can either continue
sharing or later add a major version suffix.
2011-04-11 17:54:36 +01:00
Samuel Degrande
4594d1bafe Removes the addition of the .exe extension to unit-test scripts, on win32.
On win32, test scripts are created with a .exe extension.
Under mingw, a .exe script is launched in 16 bit compatibility mode (through
ntvdm), and so it just does not run.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2619
2011-04-01 17:08:25 +01:00
Emmanuele Bassi
d3a7b7502e event: Add setters for ClutterEvent members
Creating a synthetic event requires direct access to the ClutterEvent
union members; this access does not map in bindings to high-level
languages, especially run-time bindings using GObject-Introspection.
It's also midly annoying from C, as it unnecessarily exposes the guts of
ClutterEvent - something we might want to fix in the future.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2575
2011-02-28 14:16:23 +00:00
Neil Roberts
26ec3efbff tests: Check return value of clutter_init_with_args instead of error
Some of the tests were ignoring the return value of
clutter_init_with_args and instead they would recognise an error by
seeing whether the GError parameter was set. This patch changes it to
check the return value so that it won't give a warning now that
G_GNUC_WARN_UNUSED_RESULT is on that function.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2574
2011-02-28 14:10:06 +00:00
nobled
eb906d85ca tests: abort if clutter_init fails
This fixes segfaults when something goes wrong during
init, but the test keeps going anyway.

Except for test-easing and test-picking, these were fixed by
sed magic:

sed -i -s -e "s/clutter_init \?(&argc, &argv)/\
if (clutter_init (\&argc, \&argv) != CLUTTER_INIT_SUCCESS)\n\
    return 1/" tests/*/*.c

http://bugzilla.clutter-project.org/show_bug.cgi?id=2574
2011-02-28 14:10:04 +00:00
Neil Roberts
daa6d67cc0 Add a conformance test for atlas migration
This adds a conformance test which creates a lot of textures with
increasing size and destroys them again a number of times in order to
cause a few atlas migrations. The last time the textures are created
they are all read back and the data is verified to confirm that the
atlas migration successfully preserved the data.
2011-02-24 20:45:30 +00:00
Emmanuele Bassi
3c25fcfe49 tests: Remove unused variables 2011-02-19 16:47:20 +00:00
Emmanuele Bassi
b505c022c4 test-timeline: Ignore the default stage
We need to create the default stage to have the master clock spin, but
we can tell the compiler that the returned value is meaningless.
2011-02-19 16:47:20 +00:00
Emmanuele Bassi
92ddaa9c13 stage: Move stage redraw logic into clutter-stage.c
The _clutter_do_redraw() function should really be moved inside
ClutterStage, since all it does is calling private stage and
backend functions. This also allows us to change a long-standing
issue with a global fps counter for all stages, instead of a\
per-stage one.
2011-02-18 12:56:17 +00:00
Emmanuele Bassi
fc89513295 actor: Move the ShaderData out of the private data
Let's try and start reducing the size of ClutterActorPrivate by moving
some optional, out-of-band data from it to GObject data.

The ShaderData structure is a prime candidate for this migration: it
does not need to be inspected by the actor, and its relationship with an
actor is transient and optional.

By attaching it to the actor's instance through g_object_set_data() we
neatly tie its lifetime to the instance, and we don't have to care
cleaning it up in the finalize()/dispose() implementation of
ClutterActor itself.
2011-02-18 11:43:27 +00:00
Emmanuele Bassi
24c311466c tests/multi-stage: Clean up child stages
Do not leave them around: force a destroy() on any child stage left when
the main loop quits.
2011-02-13 19:27:51 +00:00
Neil Roberts
98a33e03d3 Add a conformance test for cogl_pipeline_set_layer_matrix
This adds a conformance test which paints using a pipeline that has
two layers containing textures. Each layer has a different user
matrix. When the two layers are combined with the right matrices then
all of the colors end up white. The test then verifies this by reading
back the pixels.
2011-02-09 16:14:12 +00:00
Emmanuele Bassi
03358aca6c test-actors: Clear the state on destroy
The venerable test-actors used the default stage, which meant that
closing the window just stopped the main loop but left the scene intact.
This does not happen with a normal stage created through
clutter_stage_new().

The change happened in 6ed6b2a54b, in an
unhelpfully named commit that was just supposed to switch to static
colors. My bad.

Anyway, the change led to some assertion failures when closing the stage
in the middle of an animation.

The correct thing to do when using an actor from another object (a
Timeline ::new-frame callback in this case) without owning the instance
is to connect to the ::destroy signal and clean up the pointer to avoid
calling an invalid actor.
2011-02-09 13:36:54 +00:00
Neil Roberts
1d7e223313 test-path: Fix the test when running against latest Cairo versions
Cairo has recently changed so that it no longer adds a final move-to
command when the path ends with a close. This patch makes the test
check the run-time version number of Cairo to avoid duplicating this
behaviour when testing the conversion to and from a Cairo path.
2011-01-28 18:11:38 +00:00
Emmanuele Bassi
5329c98694 bind-constraint: Add BIND_POSITION and BIND_SIZE
CLUTTER_BIND_POSITION and CLUTTER_BIND_SIZE are two convenience
enumeration values for binding x and y, and width and height
respectively, using a single ClutterBindConstraint.
2011-01-25 11:14:37 +00:00
Neil Roberts
6102f80244 test-clip: Replace the ellipse with a rotated rectangle
With test-clip it's possible to draw three different shapes depending
on what mouse button is used: a rectangle, an ellipse or a path
containing multiple shapes. However the ellipse is also a path so it
doesn't really test anything extra from the third option. This
replaces the ellipse with a rectangle that is first rotated by the
modelview matrix. The rotated matrix won't be able to use the scissor
so it can be used to test stencil and clip plane clipping.
2011-01-24 17:40:07 +00:00
Neil Roberts
e8d5be0ba7 ClutterTimeline: Fix the 'msecs' parameter for the new-frame signal
Between Clutter 0.8 and 1.0, the new-frame signal of ClutterTimeline
changed the second parameter to be an elapsed time in milliseconds
rather than the frame number. However a few places in clutter were
still calling the parameter 'frame_num' which is a bit
misleading. Notably the signature for the signal class closure in the
header was using the wrong name. This changes them to use 'msecs'.
2011-01-24 11:52:47 +00:00
Bastian Winkler
6bffd407fd model: Add support to define rows in ClutterScript
This adds a custom "rows" property, that allows to define the rows of a
ClutterModel. A single row can either an array of all columns or an
object with column-name : column-value pairs.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2528
2011-01-21 20:44:17 +00:00
Emmanuele Bassi
86c786aaad Merge branch 'xi2'
* xi2: (41 commits)
  test-devices: Actually print the axis data
  device-manager/xi2: Sync the stage of source devices
  event: Clean up clutter_event_copy()
  device: unset the axes array pointer when resetting
  device-manager/xi2: Fix device hotplugging
  glx: Clean up GLX implementation
  device/x11: Store min/max keycode in the XI device class
  x11: Hide all private symbols
  docs: More documentation fixes for InputDevice
  */event: Never manipulate the event queue directly
  win32: Update DeviceManager device creation
  device: Allow enabling/disabling non-master devices
  backend/eglx: Add newly created stages to the translators
  device: Add more doc annotations
  device: Use a double for translate_axis() argument
  test-devices: Clean up and show axes data
  event: Fix up clutter_event_copy()
  device/xi2: Translate the axis data after setting devices
  device: Add more accessors for properties
  docs: Update API reference
  ...
2011-01-21 20:22:32 +00:00
Robert Bragg
b3775a7564 cogl: s/Cogl*Vertex/CoglVertex*/
We have a bunch of experimental convenience functions like
cogl_primitive_p2/p2t2 that have corresponding vertex structures but it
seemed a bit odd to have the vertex annotation e.g. "P2T2" be an infix
of the type like CoglP2T2Vertex instead of be a postfix like
CoglVertexP2T2. This switches them all to follow the postfix naming
style.
2011-01-21 16:22:40 +00:00
Robert Bragg
3f9e859167 test-picking: Don't manually paint the stage
Instead of using an idle handler that synchonously paints the stage
by manually calling clutter_actor_paint (stage) the test now uses an
idle handler that repeatedly queues a redraw on the stage.

do_events is now called from a "paint" signal handler for the stage, and
instead of manually determining the fps the test now uses
CLUTTER_SHOW_FPS=1 instead.
2011-01-21 16:18:11 +00:00
Emmanuele Bassi
b7d26b2d02 test-devices: Actually print the axis data
Returning in an if() block whose condition we assume to be true doesn't
play nicely with having statements after the block. Let's fix that.
2011-01-21 15:27:56 +00:00
Emmanuele Bassi
0e99346915 device-manager/xi2: Fix device hotplugging
Hierarchy and Device changed events come through with the X window set
to be the root window, not the stage window. We need to whitelist them
so that we can actually support hotplugging and device changes.
2011-01-21 11:41:36 +00:00
Emmanuele Bassi
73cf6bd52c device: Allow enabling/disabling non-master devices
Slave and floating devices should always be disabled, and not deliver
events to the scene. It is up to the user to enable non-master devices
and handle events coming from them.

ClutterInputDevice gets a new :enabled property, defaulting to FALSE;
when a device manager creates a new device it has to set it to TRUE if
the :device-mode property is set to CLUTTER_INPUT_MODE_MASTER.

The main event queue entry point, _clutter_event_push(), will
automatically discard events coming from disabled devices.
2011-01-21 10:25:45 +00:00
Emmanuele Bassi
f54044f7e4 test-devices: Clean up and show axes data 2011-01-21 10:25:45 +00:00
Emmanuele Bassi
1b1e77b469 event/x11: Rework the way we translate X11 events
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.

The new design for handling X11 event translation works this way:

  - ClutterBackend::translate_event() has been added as the central
    point used by a ClutterBackend implementation to translate a
    native event into a ClutterEvent;

  - ClutterEventTranslator is a private interface that should be
    implemented by backend-specific objects, like stage
    implementations and ClutterDeviceManager sub-classes, and
    allows dealing with class-specific event translation;

  - ClutterStageX11 implements EventTranslator, and deals with the
    stage-relative X11 events coming from the X11 event source;

  - ClutterStageGLX overrides EventTranslator, in order to
    deal with the INTEL_GLX_swap_event extension, and it chains up
    to the X11 default implementation;

  - ClutterDeviceManagerX11 has been split into two separate classes,
    one that deals with core and (optionally) XI1 events, and the
    other that deals with XI2 events; the selection is done at run-time,
    since the core+XI1 and XI2 mechanisms are mutually exclusive.

All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
2011-01-21 10:25:43 +00:00
Emmanuele Bassi
770bcd5b40 test-pixmap: Remove the GLX code
The ClutterGLXTexturePixmap actor is just a wrapper around
ClutterX11TexturePixmap, since the relevant texture-from-pixmap code has
been moved down to Cogl.
2011-01-20 12:59:56 +00:00
Emmanuele Bassi
a2d6edd422 test-pixmap: Fix up compilation on EGLX
We need to check for the GLX windowing system if we are to include
clutter-glx.h.
2011-01-19 18:51:01 +00:00
Emmanuele Bassi
a43c5f10bb tests: Try to drop including config.h
The config.h header should be considered a Clutter internal header, and
the test cases (especially the interactive test cases) should strive to
never rely on internal headers.
2011-01-19 14:36:30 +00:00
Neil Roberts
5fc3122dad test-cogl-shader-glsl: Disable the atlas for the hand texture
Atlasing needs to be disabled for the hand texture so that it can work
out the step value needed to fetch a neighbouring pixel in the blur
shader. If the texture ends up in the atlas then the test can't know
the actual size of the texture so it looks wrong.
2011-01-13 11:50:09 +00:00
Damien Lespiau
b922ac6059 test-shader: Fix the edge-detect shader
cogl_text_coord_in in a array to access the texture units. In this case
we want to sample texture unit 0, where the texture is.
2011-01-11 14:21:21 +00:00
Emmanuele Bassi
bf0dd2cbcc test-text-field: Grab key focus on the first entry
So that you can start typing right away.
2010-12-30 12:49:41 +00:00
Emmanuele Bassi
91cc8edba1 test-text-field: Do not expand the labels 2010-12-21 10:51:39 +00:00
Emmanuele Bassi
ec5e910cd3 test-text-field: Clean up
Use a Table layout manager, and clean up a bit this test case.
2010-12-20 17:59:35 +00:00
Emmanuele Bassi
21a12b966d interactive: Remove test-bind
The BindConstraint is already exercised in the test-constraints and in
other interactive tests.
2010-12-20 12:41:07 +00:00
Emmanuele Bassi
c444447cd3 timeline: Rename the reverse property to auto-reverse
Other frameworks expose the same functionality as "auto-reverse",
probably to match the cassette tape player. It actually makes sense
for Clutter to follow suit.
2010-12-17 12:07:52 +00:00
Emmanuele Bassi
397e0ddb16 interactive: Rename test-rotate
The rotation test is now really testing the shader-based effects we ship
with Clutter. The name should be changed to reflect that.
2010-12-16 15:35:38 +00:00
Emmanuele Bassi
c2365c63cf interactive: Remove test-viewport
The test-viewport interactive test is exercising the clip code - a job
better done by the conformance test suite and by the test-clip
interactive test.
2010-12-16 15:25:29 +00:00
Emmanuele Bassi
1515a9f989 interactive: Remove test-project
The test-project test case was an old test that was barely working after
landing the size allocation API in Clutter 0.8. It has never been fixed,
and it's been of relative use ever since.
2010-12-16 15:10:27 +00:00
Emmanuele Bassi
8ae47eb79c interactive: Remove test-offscreen
The test-offscreen interactive test was a dummy test for the
ClutterStage:offscreen property, which has been deprecated and
not implemented since Clutter 1.0, and never really worked except
briefly in Clutter 0.2 or something.
2010-12-16 15:08:11 +00:00
Neil Roberts
d03c3a646a test-cogl-just-vertex-shader: Update to use the portable cogl_* names
The vertex shader in this test now uses the cogl_* names for the GL
builtin so that it will work on GLES2 as well.
2010-12-13 17:29:15 +00:00
Neil Roberts
e0a02b2b5b test-cogl-multitexture: Don't test the alpha component
On EGL we don't request a context with any alpha bits so testing alpha
component of cogl_read_pixels isn't reliable.
2010-12-13 17:29:14 +00:00
Neil Roberts
afe3929618 test-cogl-materials: Use GL_MAX_VERTEX_ATTRIBS on GLES2
When determining the maximum number of layers we also need to take
into account GL_MAX_VERTEX_ATTRIBS on GLES2. Cogl needs one vertex
attrib for each texture unit plus two for the position and color.
2010-12-13 17:29:14 +00:00
Jussi Kukkonen
ca42ec1a7a tests: Add test for clutter_model_get_iter_at_row()
http://bugzilla.clutter-project.org/show_bug.cgi?id=2460
2010-12-09 13:38:35 +00:00
Damien Lespiau
c20beabf93 evdev: Add mouse support
We know support EV_REL events comming from evdev devices. This addition
is pretty straigthforward, it adds a x,y per GSource listening to a
evdev device, updates from EL_REL (relative) events and craft new
ClutterMotionEvents. As for buttons, BTN_LEFT..BTN_TASK are translated
to ClutterButtonEvents with 1..8 as button number.
2010-11-30 14:40:38 +00:00
Robert Bragg
b424bd7512 tests: Adds test-cogl-perf micro benchmark
This is mostly a stub, starting point for a one-stop Cogl
micro-benchmarking tool. The first test it adds is one that tries to
hammer the Cogl journal, but no doubt there are lots of other things we
should be regularly testing. Currently the aim is that the tool will be
able to also generate reports which we can collect to keep track of
performance changes over time.
2010-11-26 14:33:50 +00:00
Neil Roberts
9c32d07453 Add a conformance test that uses a vertex shader with no frag shader
This creates a material which users a layer to override the color of
the rectangle. A simple vertex shader is then created which just
emulates the fixed function pipeline. No fragment shader is
added. This demonstrates a bug where the layer state is getting
ignored when a vertex shader is in use.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2221
2010-11-24 18:06:44 +00:00
Neil Roberts
1fdd82fcf1 test-cogl-texture-get-set-data: Test the alpha component
Previously the alpha component of the test texture data was always set
to 255 and the data was read back as RGB so that the alpha component
is ignored. Now the alpha component is set to a generated value and
the data is read back a second time as RGBA to verify that Cogl is not
doing any premult conversions when the internal texture and target
data is the same.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2414
2010-11-24 15:56:35 +00:00
Owen W. Taylor
d52bd995a6 Test slicing when getting data in both directions
http://bugzilla.clutter-project.org/show_bug.cgi?id=2414
2010-11-24 15:56:34 +00:00
Emmanuele Bassi
e86db85cd2 color: Support the CSS hsl() notation
Since we support the rgb() and rgba() notations we might as well also
support the hsl() one.
2010-11-22 15:02:47 +00:00
Emmanuele Bassi
ab6da347f6 color: Support CSS color definitions
The CSS Color Module 3, available at:

  http://www.w3.org/TR/css3-color/

allows defining colors as:

  rgb ( r, g, b )
  rgba ( r, g, b, a)

along with the usual hexadecimal and named notations.

The r, g, and b channels can be:

  • integers between 0 and 255
  • percentages, between 0% and 100%

The alpha channel, if included using the rgba() modifier, can be a
floating point value between 0.0 and 1.0.

The ClutterColor parser should support this notation.
2010-11-22 14:38:44 +00:00
Emmanuele Bassi
b0f5350379 test-layout: Port away from Behaviour
Use a simple animation with a looping+reversing timeline.
2010-11-18 15:21:16 +00:00
Emmanuele Bassi
eade1ab19e test-rotate: Remove the behaviour code
Use a looping animation with a shared timeline instead.
2010-11-18 15:21:16 +00:00
Emmanuele Bassi
a35708eb74 Deprecate ClutterBehaviour and sub-classes
The Behaviour class and its implementations have been replaced by the
new animation framework API and by the constraints for layout-related
animations.

Currently, we need to make tests build, so we undef DISABLE_DEPRECATED
in specific test cases while they get ported.
2010-11-18 15:21:16 +00:00
Emmanuele Bassi
71a838815f timeline: Add :reverse property
The :reverse property removes the pattern of connecting to the
::completed signal of a Timeline to change the direction.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2408
2010-11-18 15:18:19 +00:00
Emmanuele Bassi
3c15c0c9bb Add SnapConstraint
A SnapConstraint is a constraint that "snaps" the edges of two actors
together.
2010-11-15 16:00:49 +00:00
Emmanuele Bassi
dfdd591414 Merge branch 'wip/static-colors'
* wip/static-colors:
  Move tests to static colors where possible
  color: Add named, global colors
2010-11-11 17:53:42 +00:00
Robert Bragg
fb9d3a8350 path 2.0: update path API for experimental 2.0 API
When COGL_ENABLE_EXPERIMENTAL_2_0_API is defined cogl.h will now include
cogl2-path.h which changes cogl_path_new() so it can directly return a
CoglPath pointer; it no longer exposes a prototype for
cogl_{get,set}_path and all the remaining cogl_path_ functions now take
an explicit path as their first argument.

The idea is that we want to encourage developers to retain path objects
for as long as possible so they can take advantage of us uploading the
path geometry to the GPU. Currently although it is possible to start a
new path and query the current path, it is not convenient.

The other thing is that we want to get Cogl to the point where nothing
depends on a global, current context variable. This will allow us to one
day define a sensible threading model if/when that is ever desired.
2010-11-11 13:17:26 +00:00