1
0
Fork 0
Commit graph

1067 commits

Author SHA1 Message Date
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