1
0
Fork 0
Commit graph

990 commits

Author SHA1 Message Date
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
Emmanuele Bassi
6ed6b2a54b Move tests to static colors where possible 2010-11-11 13:14:39 +00:00
Robert Bragg
5f30835eae cogl-shader: Prepend boilerplate for portable shaders
We now prepend a set of defines to any given GLSL shader so that we can
define builtin uniforms/attributes within the "cogl" namespace that we
can use to provide compatibility across a range of the earlier versions
of GLSL.

This updates test-cogl-shader-glsl.c and test-shader.c so they no longer
needs to special case GLES vs GL when splicing together its shaders as
well as the blur, colorize and desaturate effects.

To get a feel for the new, portable uniform/attribute names here are the
defines for OpenGL vertex shaders:

 #define cogl_position_in gl_Vertex
 #define cogl_color_in gl_Color
 #define cogl_tex_coord_in  gl_MultiTexCoord0
 #define cogl_tex_coord0_in gl_MultiTexCoord0
 #define cogl_tex_coord1_in gl_MultiTexCoord1
 #define cogl_tex_coord2_in gl_MultiTexCoord2
 #define cogl_tex_coord3_in gl_MultiTexCoord3
 #define cogl_tex_coord4_in gl_MultiTexCoord4
 #define cogl_tex_coord5_in gl_MultiTexCoord5
 #define cogl_tex_coord6_in gl_MultiTexCoord6
 #define cogl_tex_coord7_in gl_MultiTexCoord7
 #define cogl_normal_in gl_Normal

 #define cogl_position_out gl_Position
 #define cogl_point_size_out gl_PointSize
 #define cogl_color_out gl_FrontColor
 #define cogl_tex_coord_out gl_TexCoord

 #define cogl_modelview_matrix gl_ModelViewMatrix
 #define cogl_modelview_projection_matrix gl_ModelViewProjectionMatrix
 #define cogl_projection_matrix gl_ProjectionMatrix
 #define cogl_texture_matrix gl_TextureMatrix

And for fragment shaders we have:

 #define cogl_color_in gl_Color
 #define cogl_tex_coord_in gl_TexCoord

 #define cogl_color_out gl_FragColor
 #define cogl_depth_out gl_FragDepth

 #define cogl_front_facing gl_FrontFacing
2010-11-10 14:24:52 +00:00
Robert Bragg
a4b984186c tests: test-cogl-shader-arbfp wasn't compiling shader
test-cogl-shader-arbfp was never calling cogl_shader_compile so it was a
fluke that it used to run before.
2010-11-10 14:19:34 +00:00
Tomeu Vizoso
373140c830 Discard the current pick buffer...
if we are asked to pick with a different mode.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2385
2010-11-08 16:45:15 +00:00
Emmanuele Bassi
26a70707ab path-constraint: Add a ::node-reached signal
Emit a signal whenever a node in the path has been reached.
2010-11-07 21:35:40 +00:00
Neil Roberts
57633520d4 Make test-cogl-npot-texture a bit more extensive
The size of the texture used for test-cogl-npot-texture was only using
1 pixel of waste and the texture was scaled down so it would be quite
likely that the test would still pass if only the top left slice was
rendered. It also didn't test using non-default texture
coordinates. These problems made it fail to pick up bug 2398. The
texture is now using the maximum amount of waste and rendered in four
parts at 1:1 scale.
2010-11-05 18:45:31 +00:00
Neil Roberts
8112bfc49f Replace the disable-npots tool with a COGL_DEBUG option
Previously in the tests/tools directory we build a disable-npots
library which was used as an LD_PRELOAD to trick Cogl in to thinking
there is no NPOT texture extension. This is a little awkward to use so
it seems much simpler to just define a COGL_DEBUG option to disable
npot textures.
2010-11-05 18:45:31 +00:00
Neil Roberts
a53c9dafb5 Add a conformance test for the CoglPrimitive convenience constructors
This adds a simple conformance test which calls all of the convenience
constructors for CoglPrimitive.
2010-11-04 17:59:33 +00:00
Emmanuele Bassi
ef6b46d826 Merge branch 'wip/path-constraint'
* wip/path-constraint:
  docs: Add PathConstraint
  tests: Add a PathConstraint interactive test
  Add ClutterPathConstraint
  actor-box: Add setters for origin and size
2010-10-25 17:09:46 +01:00
Emmanuele Bassi
6f8e46e0b3 tests: Add a PathConstraint interactive test 2010-10-25 15:47:15 +01:00
Neil Roberts
f1752ff3ba Avoid mixing declarations and code
Mixing declarations and code causes problems for MSVC as it is a C99
feature so we should try to avoid it.
2010-10-25 13:18:25 +01:00
Emmanuele Bassi
ce3311df26 conform: Remove unnecessary destroy() calls
Unparented actors are owned by the Script instance, and if that goes
away then the actors go away with it. The fact that we needed an
explicit destroy() before was a hint of a memory management issue that I
blissfully - and regretfully - ignored for the sake of a passing test
suite.
2010-10-19 12:32:02 +01:00
Emmanuele Bassi
b5bbdd6cec build: Add test wrappers to the main ignore file
They are generated at configure time, so it's a good idea to have them
in the main ignore file instead of adding them to the built ignore files
under tests.
2010-10-19 11:03:13 +01:00
Emmanuele Bassi
0f613ea134 cairo-texture: Allow overriding the surface creation
By using a new signal, ::create-surface (width, height), it should be
possible for third party code and sub-classes to override the default
surface creation code in CairoSurface.

This commit takes a bit of the patch from:

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

which cleans up CairoTexture; the idea, mutuated from that bug, is that
the CairoTexture actor checks whether the surface it has it's an image
one, and in that case it uses a Cogl texture as the backing store. In
case the surface is not an image one we assume that the surface itself
has some way of updating the GL state and flush the surface.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
d032b9b2bf conform: Start cleaning up the conformance test suite
Re-order the units into a sensible list, with basic tests at the
beginning, and per-class tests at the end - with Cogl last.

Also, start renaming the unit functions from test_<foo> to <foo>,
so that the executable wrappers and the reports have sensible names.
2010-10-12 17:42:18 +01:00
Emmanuele Bassi
b5d5b9628e conform: Implement TEST_CONFORM_TODO() correctly
The TODO() macro for adding new tests to the test suite has always meant
to be implemented like the TODO block in Test::More, i.e. a test that is
assumed to fail, and which warns if it unexpectedly succeeds.

Since GTest lacks the expressivity of Test::More, the implementation
just verifies that the tests marked as TODO actually fail, and will fail
if they happen to succeed - at which point the developer will have to
change the macro to SIMPLE or SKIP.
2010-10-12 17:11:52 +01:00
Emmanuele Bassi
2a23bab819 conform: Save the revision and date inside the test report
Even if gtester-report doesn't use that information (yet), we should
store the revision of Clutter that generated the report, and the date in
which the test suite was ran.
2010-10-12 15:44:57 +01:00
Neil Roberts
7fd6273c25 tests: Generate the stub scripts using sed
Instead of trying to run ./test-conformance with the -l option to
generate a list of available tests it now runs sed on the
test-conform-main.c file instead. Running the generated executable is
a pain for cross-compiling so it would be nice to avoid it unless it's
absolutely necessary. Although you could tell people who are cross
compiling to just disable the conformance tests, this seems a shame
because they could still be useful along with the wrappers for example
if the cross compile is built to a shared network folder where the
tests can be run on the actual device.

The sed script is a little more ugly than it could be because it tries
to avoid using the GNU extensions '\+' and '\|'.

The script ends up placing restrictions on the format of the C file
because the tests must all be listed on one line each. There is now a
comment to explain this. Hopefully the trade off is worth it.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2363
2010-10-12 15:24:32 +01:00
Neil Roberts
100d541f47 tests: Re-enable the test-anchors conformance test
This test was disabled in b5d58213. The commit message doesn't mention
this so I'm guessing it was a mistake. In any case the test appears to
work now anyway so it should be re-enabled.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2363
2010-10-12 15:24:32 +01:00
Emmanuele Bassi
2831addcf5 test-flow-layout: Track stage size by default
Instead of requiring a special command line switch.
2010-10-12 14:53:20 +01:00
Robert Bragg
471659ed4b test-pixmap: add timeout to draw arcs on pixmap
As a convenient test that clipped redraws are working correctly in
response to X pixmap damage this updates test-pixmap to have a repeating
1 second timeout that draws arcs on the pixmap.
2010-09-30 11:44:12 +01:00
Neil Roberts
d0cab85673 Add a conformance test for clutter_actor_contains
This adds a conformance test for clutter_actor_contains to assert that
it gets the expected results for the given tree of actors.
2010-09-28 15:21:49 +01:00
Emmanuele Bassi
8fe9f3a37d test-clutter-units: Force a known resolution to avoid fuzzyness
Instead of taking the current resolution, whatever it may be, use a
known DPI. This should alleviate fuzzyness and create consistent
results.
2010-09-24 16:21:06 +01:00
Emmanuele Bassi
4c8867ea07 table-layout: Invert row/column in arguments
*** This is an API change ***

The general pattern for axis-aligned arguments is:

        x argument
        y argument

If we consider columns an x-aligned argument, and row a y-aligned
argument, then we need to update the TableLayout functions to be:

        column
        row

and not:

        row
        column
2010-09-23 15:17:58 +01:00
Neil Roberts
bcd4385a0e test-conform: Delay initializing Clutter until a test is run
Instead of calling clutter_init immediately, test-conformance now only
calls it as part of test_conform_simple_fixture_setup. The conformance
tests assert that only one test is run per instance of
test-conformance so it should never end up calling clutter_init
twice. Delaying clutter_init has the advantage that calling
"test-conformance -l" will still work even on systems with no X
server. This could be useful for automated build systems.
2010-09-21 14:10:19 +01:00
Emmanuele Bassi
bdcac5617b test-bind: Fix colors and set the name of the boxes 2010-09-17 12:17:50 +01:00
Emmanuele Bassi
8ca47e3b20 build: Use the power of abs_builddir
When calling test-conformance to get the list of conformance tests.
2010-09-17 12:17:50 +01:00
Emmanuele Bassi
40af71fad7 build: List the units inside a file
This avoids trying to run test-conformance -l multiple times.
2010-09-13 02:10:35 +01:00
Emmanuele Bassi
4ee05f8e21 keysyms: Update the macros to CLUTTER_KEY_*
The keysyms defines in clutter-keysyms.h are generated from the X11 key
symbols headers by doing the equivalent of a pass of sed from XK_* to
CLUTTER_*. This might lead to namespace collisions, down the road.
Instead, we should use the CLUTTER_KEY_* namespace.

This commit includes the script, taken from GDK, that parses the X11
key symbols and generates two headers:

  - clutter-keysyms.h: the default included header, with CLUTTER_KEY_*
  - clutter-keysyms-compat.h: the compatibility header, with CLUTTER_*

The compat.h header file is included if CLUTTER_DISABLE_DEPRECATED is
not defined - essentially deprecating all the old key symbols.

This does not change any ABI and, assuming that an application or
library is not compiling with CLUTTER_DISABLE_DEPRECATED, the source
compatibility is still guaranteed.
2010-09-10 17:54:52 +01:00
Emmanuele Bassi
32ea9702e6 build: Add XML files to the ignore blacklist 2010-09-08 17:50:38 +01:00
Henrik Hedberg
1eae9fcd7e drag-action: Added x-drag-threshold and y-drag-threshold properties
*** This is an API change ***

Replaced the original drag-threshold property with two separate
horizontal (x-drag-threshold) and vertical (y-drag-threshold)
thresholds.

It is some times necessary to have different drag thresholds for the
horizontal and vertical axes. For example, when a draggable actor is
inside a horizontal scrolling area, only vertical movement must begin
dragging. That can be achieved by setting the x-drag-threshold to
G_MAXUINT while y-drag-threshold is something usual, say, 20 pixels.

This is different than drag axis, because after the threshold
has been cleared by the pointer, the draggable actor can be dragged
along both axes (if allowed by the drag-axis property).

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-07 10:40:49 +01:00
Emmanuele Bassi
7e56a98413 texture: Use a base material for all instances
Creating new materials for every Texture instance results in a lot of
ARBfp programs being generated/compiled. Since most textures will just
be similar we should create a template material for all of them, and
then copy it in every instance. Cogl will try to optimize the generation
of the program and, hopefully, will reuse the same program most of the
time.

With this change, a simple test shows that loading 48 textures will
result in just two programs being compiled - with and without batching
enabled.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2295
2010-09-06 18:09:19 +01:00
Emmanuele Bassi
abef73bb58 Replace cogl_color_set_from_* with cogl_color_init_from_*
The former is not yet "officially" deprecated by the latter, but it's
confusing to have them both in the code base.
2010-09-03 16:58:47 +01:00
Emmanuele Bassi
88b026fa72 test-actors: Name all the actors
Makes it easier to debug events.
2010-08-26 17:31:32 +01:00
Bastian Winkler
870e7ddfad test-script-parser: Add a second child to the container
The script parser won't apply child and layout properties correctly with
more than one children.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-08-25 16:18:25 +01:00
Emmanuele Bassi
fd6d6a93f1 build: Fix distcheck errors 2010-08-16 13:23:10 +01:00
Emmanuele Bassi
3142b15a9f build: Use maintainer-clean for the ignore files removal
Instead of distclean.
2010-08-15 18:42:54 +01:00
Emmanuele Bassi
c4913bfce9 Revert "build: Distclean generated ignore files"
Git ignore files are not dist'ed, so it's pointless to remove them on
distclean.

This reverts commit f14587aadc.
2010-08-15 18:33:10 +01:00
Emmanuele Bassi
94c8635d0f build: Autogenerate more ignore files
The tests/accessibility, tests/micro-bench and the examples directory
in the coobook create a lot of non-installed binaries. Since we know who
they are, and we ignore them, we can auto-generate the ignore files as
well.

The rest of Clutter is covered by the main ignore file.
2010-08-14 08:43:16 +01:00
Emmanuele Bassi
f14587aadc build: Distclean generated ignore files 2010-08-13 18:35:35 +01:00
Emmanuele Bassi
a3bc2ebfa7 build: Make test-conform depend on Makefile changes 2010-08-13 18:32:10 +01:00
Emmanuele Bassi
1e0a83b881 build: Autogenerate interactive/.gitignore
Exactly like we did for conform/.gitignore
2010-08-13 18:31:44 +01:00
Emmanuele Bassi
7c412464c2 build: Generate the conformance/.gitignore file
Since we are generating a lot of files that we should ignore, we should
generate the Git ignore file as well.
2010-08-13 18:25:22 +01:00
Emmanuele Bassi
e888da2180 build: Split up the test-conformance SOURCES
Having different sections should make it easier to add new test units to
the build.
2010-08-13 18:15:01 +01:00
Emmanuele Bassi
a25cf14e97 Revert "clutter.modules: Remove deps on gir-repository"
This reverts commit 0ce9cf730b.

The commit contained unrelated changes
2010-08-13 18:12:43 +01:00
Emmanuele Bassi
0ce9cf730b clutter.modules: Remove deps on gir-repository
Keep it in the moduleset, but don't let Clutter depend on it.
2010-08-13 18:09:28 +01:00
Emmanuele Bassi
50c5ecfe87 state: Plug some memory leakage
Thanks to Valgrind, test-state-base now reports 0 bytes definitely lost.
2010-08-13 12:12:59 +01:00
Robert Bragg
a26119b551 tests: Remove use of cogl_program_use
The removes the use of cogl_program_use which has been deprecated and
instead of using the cogl_program_uniform functions we now use the
cogl_program_set_uniform methods.
2010-08-12 16:50:46 +01:00
Neil Roberts
c129c563f5 Remove test-random-text from the interactive .gitignore 2010-08-12 14:37:38 +01:00
Emmanuele Bassi
1a8df6788b Update the micro-bench Git ignore file 2010-08-12 13:48:35 +01:00
Neil Roberts
1e45428483 test-random-text: Convert to a micro-benchmark
test-random-text is moved to the micro-bench directory. It now prints
out the time taken to draw every 10 frames.
2010-08-12 11:54:42 +01:00
Neil Roberts
65f449bdb0 test-text-perf: Add a wider range of characters
Instead of just using the latin alphabet, this adds digits and some
other alphabets to increase the range of glyphs used.
2010-08-12 11:54:41 +01:00
Neil Roberts
c26d2c5ef9 test-text-perf: Scale the text if the settings will not fit
If the font size or the number of characters causes the label not to
fit on the stage, instead of aborting it will now scale the labels so
that it fits within one of the dimensions. This makes it easier to
test with large glyph sizes.
2010-08-12 11:54:41 +01:00
Emmanuele Bassi
304e7dd077 test-drag: Fix the page curl angle 2010-08-11 14:21:22 +01:00
José Dapena Paz
d14e294d86 Add ClutterTableLayout, a layout showing children in rows and columns
A TableLayout is a layout manager that allocates its children in rows
and columns. Each child is assigned to a cell (or more if a cell span
is set).

The supported child properties are:

  • x-expand and y-expand: if this cell with try to allocate the
    available extra space for the table.
  • x-fill and y-fill: if the child will get all the space available in
    the cell.
  • x-align and y-align: if the child does not fill the cell, then
    where the child will be aligned inside the cell.
  • row-span and col-span: number of cells the child will allocate for
    itself.

Also, the TableLayout has row-spacing and col-spacing for specifying
the space in pixels between rows and between columns.

We also include a simple test of the layout manager, and the
documentation updates.

The TableLayout was implemented starting from MxTable and
ClutterBoxLayout.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-08-10 23:20:06 +01:00
Emmanuele Bassi
02b7bf3635 test-flow-layout: Use BindConstraints
If we want to fit the FlowLayout to the Stage size we should use the
BindConstraint API instead of a watcher on ::allocation-changed.
2010-08-10 18:47:45 +01:00
Damien Lespiau
985a4db947 gitignore: Ignore test-cogl-shader-{arbfp,glsl}
Fear the out of tree builds!
2010-08-09 17:27:09 +01:00
Robert Bragg
a4339842f9 tests-interactive: Adds a test-cogl-shader-glsl.c
This is based on test-shader.c but is solely implemented with the
cogl_program/shader APIs instead of the clutter shader APIs.
2010-08-09 17:27:02 +01:00
Robert Bragg
f6a1f56031 tests/interactive: Adds a test-cogl-shader-arbfp.c
This tests the ARBfp support for cogl_program and cogl_shader using the
shaders Chris Lord adapted from test-shader when he was experimenting
with adding ARBfp support to clutter back in 2008 (See:
http://bugzilla.clutter-project.org/show_bug.cgi?id=1049)
2010-08-09 17:27:02 +01:00
Emmanuele Bassi
e7381c47fd bin-layout: Add a text to the test
We have a rectangle, a cairo texture and a texture. Let's go add a text
actor as well.
2010-08-05 17:22:50 +01:00
Roman Kudiyarov
5218da748f test: fixed uninitialized variable in test-cogl-point-sprites 2010-08-04 15:13:11 +01:00
Roman Kudiyarov
904f619419 osx: Implemented hide cursor backend implementation
Add implementation for hide cursor in stage. Also added using this
feature in test-animator.
2010-08-04 15:13:11 +01:00
Emmanuele Bassi
00eb71b89a conform: Move the Score test to the conformance suite
The interactive test for ClutterScore is really meant to be run as part
of the conformance test suite, so we should move it there.
2010-07-30 19:39:35 +01:00
Neil Roberts
616eccdad6 test-shader: Unref the ClutterShader after setting it on an actor
Otherwise the test leaks the shader object and the underlying GLSL
program.
2010-07-22 21:51:47 +01:00
Neil Roberts
a1c7420979 test-shader: The tex_coord varying is now an array under GLES2
Since the GLES2 wrapper grew support for multi-texturing, the
tex_coord varying variable defined in the vertex shader is actually an
array of texture coordinates so it ought to match in the fragment
shader in test-shader. This seemed to work anyway under Mesa/Intel but
under NVidia it does not so I don't think it's safe to assume that
linking a non-array varying with an array will work.
2010-07-22 21:48:16 +01:00
Neil Roberts
cefc0e381b Add a conformance test for 3D textures
This creates a 3D texture with different colors on all of the images
and renders it using a VBO to verify that the texture coordinates can
select all of the images.
2010-07-13 14:29:02 +01:00
Emmanuele Bassi
fdc79427a6 Add new tests to the ignore files 2010-07-09 11:40:00 +01:00
Neil Roberts
972c0c24f0 Add a conformance test for cogl_texture_{get_data,set_region}
This verifies that calling cogl_texture_get_data returns the same data
uploaded to the texture. The bottom quarter of the texture is replaced
using cogl_texture_set_region. It tries creating the texture with
different sizes and flags in the hope that it will hit different
texture backends.
2010-07-09 11:14:10 +01:00
Robert Bragg
4ca1e491da tests: don't delay/skip frames due to glReadPixel concerns
This greatly speeds up running all the conformance tests by no longer
delaying many of the tests for a number of dummy frames to be painted.

We used to skip frames because we thought there was a problem with the
driver's glReadPixels implementation. Although we have seen driver
issues at times the real reason the delay was needed was because
resizing the stage usually happens asynchronously (because a non
synchronous X request is used by clutter_stage_set_size()). We now force
all X requests to be synchronized for the conformance tests so this is
no longer a problem and we can avoid these hacks.
2010-07-08 22:40:35 +01:00
Neil Roberts
ad6d597445 Add an interactive test for cogl point sprites
The test draws some fireworks with trailing sparks that fade out.

http://bugzilla.openedhand.com/show_bug.cgi?id=2047
2010-07-08 16:34:31 +01:00
Neil Roberts
c76d53a9c4 tests/accessibility: Fix the soname for libclutter
The required .so file was named using @CLUTTER_WINSYS@ but since
bf9d5f3949 the .so should be named with @CLUTTER_SONAME_INFIX@. This
was breaking the build on eglx.
2010-07-08 15:32:48 +01:00
Øyvind Kolås
9e730727ca state: add clutter_state_set_state and clutter_state_warp_to_state
Replaced clutter_state_change with a boolean argument for animating the
transition or not with two separate argument-less methods.
2010-07-07 18:17:09 +01:00
Emmanuele Bassi
f87e4037a8 build: Distcheck fixes after the Cally merge 2010-07-07 16:30:31 +01:00
Emmanuele Bassi
e3a8ece54d Merge branch 'cally-merge'
* cally-merge:
  cally: Add introspection generation
  cally: Improving cally doc
  cally: Cleaning CallyText
  cally: Refactoring "window:create" and "window:destroy" emission code
  cally: Use proper backend information on CallyActor
  cally: Check HAVE_CONFIG_H on cally-util.c
  docs: Fix Cally documentation
  cally: Clean up the headers
  Add binaries of the Cally examples to the ignore file
  docs: Add Cally API reference
  Avoid to load cally module on a11y examples
  Add accessibility tests
  Initialize accessibility support on clutter_init
  Rename some methods and includes to avoid -Wshadow warnings
  Cally initialization code
  Add Cally
2010-07-07 16:06:30 +01:00
Robert Bragg
175317a754 test-timeline: instantiate a stage so the master clock runs
This makes test-timeline get the default stage so there is at least one
stage instantiated. Without any stages the master clock will never run
which was causing this test to fail.
2010-07-07 16:00:46 +01:00
Emmanuele Bassi
7d1445afca Restore the report on the conformance test suite
The report generation was broken by the split of the various test units;
also, we were using GTest in a way that's not really sanctioned by
upstream.

This commit tries to re-use the targets from GLib's Makefile rules while
compensating for our own set up.
2010-07-07 14:52:19 +01:00
Robert Bragg
551945ce6c tests: Force X synchronization so the stage size is reliable
Normally the asynchronous nature of X means that setting the clutter
stage size may really happen an indefinite amount of time later but
since the tests are so short lived and may only render a single frame
this is not an acceptable semantic.

This way we should be able to remove all the hacky sleeps and frame
count delays from our tests.
2010-07-07 14:07:22 +01:00
Robert Bragg
b24c96189d tests: no longer clean up state between tests
Since we now run every test in a separate process there is no need to
try and avoid state leakage between tests. This removes the code to
cleanup all children of the stage and disconnect handlers from the
stage paint signal. We now explicitly print a warning if the users tries
to run multiple tests in one process.
2010-07-07 14:07:17 +01:00
Øyvind Kolås
5cb4e0c5d0 test-state: fix test for state count after state removal
In the .json file used for the test, there is no null -> "base"
transition defined only a "clicked" -> "base", when the "clicked" state
is removed the "base" state will also disappear.
2010-07-06 14:28:14 +01:00
Øyvind Kolås
6d1f697bc4 state: automatically remove unused states
When there is no further keys with a state as the target state, remove
the state (and all transitions that used this state as a target)
2010-07-06 14:14:34 +01:00
Damien Lespiau
1860d45087 build: Allow to run the tests from any directory
I was fed up to cd into the tests/conform or tests/interactive directories
to launch a specific test. Now, with the power the abs_ variants of
builddir and srcdir we can run specific test from any directory.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2159
2010-07-06 12:39:15 +01:00
Robert Bragg
82ba7220af pixel-array: Allow passing of hints to cogl_buffer_map
This allows you to tell Cogl that you are planning to replace all the
buffer's data once it is mapped with cogl_buffer_map. This means if the
buffer is currently being accessed by the GPU then the driver doesn't
have to stall and wait for it to finish before it can access it from the
CPU and can instead potentially allocate a new buffer with undefined
data and map that.
2010-07-06 12:07:28 +01:00
Robert Bragg
0273b13d75 test-cogl-pixel-array: fix how data is initialized
There was a missing '* 4' and '* i' in the for() loops that initialized
the first test buffer, so it was containing uninitialized data causing
the test to fail.
2010-07-06 12:07:28 +01:00
Emmanuele Bassi
da4dbbb926 Add binaries of the Cally examples to the ignore file 2010-07-05 16:45:43 +01:00
Alejandro Piñeiro
e110b35694 Avoid to load cally module on a11y examples
As cally is being integrated on clutter is not required to load
cally module anymore. Anyway, it is still required to load
the atk bridge by hand. The current way to load it could change
in the future, more information here:

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

Part [4/4] of CB#2099
2010-07-05 16:45:43 +01:00
Alejandro Piñeiro
790d2165f3 Add accessibility tests
http://bugzilla.clutter-project.org/show_bug.cgi?id=2099

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-07-05 16:45:43 +01:00
Emmanuele Bassi
b9c65510cb Update conformance Git ignore file 2010-07-05 16:45:19 +01:00
Robert Bragg
ae43fe9968 conform: don't reference old test_cogl_pixel_buffer symbol
Since CoglPixelBuffer was renamed to CoglPixelArray the test entry point
was also renamed to test_cogl_pixel_array, but mistakenly the
corresponding test-conform-main.c change wasn't pushed at the same time.
2010-07-05 16:19:35 +01:00
Robert Bragg
8a5aed36fe pixel-array: Only allow allocation of arrays with a 2D size
This removes cogl_pixel_array_new which just took a size in bytes.

Without the image size and pixel format then the driver often doesn't
have enough information to allocate optimal GPU memory that can be
textured from directly. This is because GPUs often have ways to
spatially alter the layout of a texture to improve cache access patterns
which may require special alignment and padding dependant in the images
width, height and bpp.

Although currently we are limited by OpenGL because it doesn't let us
pass on the width and height when allocating a PBO, the hope is that we
can define a better extension at some point.
2010-07-05 15:20:04 +01:00
Robert Bragg
54f4a3a752 rename CoglPixelBuffer to CoglPixelArray
This renames CoglPixelBuffer to CoglPixelArray to be consistent with the
new CoglVertexArray API.
2010-07-05 15:20:04 +01:00
Robert Bragg
57341dbb60 cogl-buffer: make the COGL_BUFFER_USAGE_HINT private
The usage hint should be implied by the CoglBuffer subclass type so the
public getter and setter APIs for manually changing the usage hint of a
CoglBuffer have now been removed.
2010-07-05 15:20:04 +01:00
Øyvind Kolås
38941372bf state: rename property "target-state" to "state"
This reduces the amount of typing, and should provide for more readable
code for most uses of ClutterState.
2010-07-02 17:41:33 +01:00
Neil Roberts
6341ba98f9 test-cogl-path: Add tests for changing the fill rule
This creates a path with an outer clockwise and two internal sub
paths, one clockwise and one counter-clockwise. The path is then
painted twice, once with each fill rule.
2010-06-29 20:37:14 +01:00
Emmanuele Bassi
32ad63efef bind-constraint: Add width and height binding
Allow using the BindConstraint to bind width and height of a source
actor.

Also, add a test for the BindConstraint showing all types of usages
for this constraint class.
2010-06-28 18:06:23 +01:00
Emmanuele Bassi
98613382a4 test-text-field: Use the system font instead of using Sans 2010-06-25 11:44:53 +01:00
Neil Roberts
fbeab37828 test-conformance: Use -export-dynamic instead of -rdynamic
The -rdynamic linker option is specific to ELF so it was breaking
builds on systems with other object formats such as Windows and
Solaris. This patch replaces that option with -export-dynamic which is
a portable libtool option which should do the right thing on each
platform.

http://bugzilla.clutter-project.org/show_bug.cgi?id=1930
2010-06-24 17:46:29 +01:00
Øyvind Kolås
2a29cd2aee state: removed special handling of state named "default"
The "default" state used for unspecified source transitions is NULL.
Small update and some other fixes to documentation.
2010-06-24 15:49:01 +01:00
Emmanuele Bassi
e9fa68fbdd Add test-cogl-texture-pixmap-x11 to the ignore file 2010-06-22 14:05:39 +01:00
Emmanuele Bassi
c2b8a0272b conform: Do not use deprecated API in test-clutter-units
Setting the DPI is done through the ClutterSettings:font-dpi property.
2010-06-22 13:32:11 +01:00
Neil Roberts
05b6c283eb Add a test case for CoglTexturePixmapX11 2010-06-22 12:22:48 +01:00
Neil Roberts
d42c3069d1 test-pixmap: Use the 'm' key to toggle texture quality
When the 'm' key is pressed it will now recursively look for all
ClutterTexture subclasses on the stage and toggle the texture quality
between high and low. This is useful to test the mipmap fallback.
2010-06-22 12:22:48 +01:00
Neil Roberts
c5b5a88d6d test-pixmap: Draw something more interesting when the mouse is clicked
When the mouse button is pressed it would previously draw a small
1-pixel wide fully transparent line to the pixmap. This is a useful
feature to help test the automatic updates but the line is quite hard
to see so it's to easy miss. This patch changes it to draw a thick
black circle. The circle is drawn at a different position every time
the button is clicked.
2010-06-22 12:22:48 +01:00
Neil Roberts
02de8b9ad5 test-pixmap: Add a --disable-animation option
Sometimes the animation makes debugging awkward so this patch adds a
--disable-animation option to simplify the test.
2010-06-22 12:22:48 +01:00
Neil Roberts
75f48ad0ec test-pixmap: Enable automatic updates for the hand
The hand actor has a feature that if you click on the stage it will
draw a line to the actor. However it's not possible to see the results
of this because automatic updates were disabled so the texture would
never be updated.
2010-06-22 12:22:48 +01:00
Neil Roberts
f7dfc8caa4 test-pixmap: Implement the --disable-x11 option
test-pixmap has long had a --disable-x11 option that didn't do
anything. This patch adds the neccessary if (disable_x11) to disable
adding the ClutterX11TexturePixmap actor when the option is given.
2010-06-22 12:22:48 +01:00
Robert Bragg
a871ac669f test-shader: guard GLES2 specific changes with COGL_HAS_GLES2
Previously we were using an internal only HAVE_COGL_GLES2 define to
guard GLES 2 specific changes so for instance the precision modifiers
weren't being emitted in the shader source.

http://bugzilla.o-hand.com/show_bug.cgi?id=2178
2010-06-22 11:35:29 +01:00
Robert Bragg
bf9d5f3949 build: distinguish CLUTTER_WINSYS and CLUTTER_SONAME_INFIX
This adds a separate variable name "CLUTTER_SONAME_INFIX" to define the
infix for the clutter library that gets linked. Currently the WINSYS
corresponds to the directory we enter when building to compile the
window system and input support, but it is desirable to be able to
define multiple flavours that use the same WINSYS but should result in
different library names.

For example we are planning to combine the eglx and eglnative window
systems into one "egl" winsys but we will need to preserve the current
library names for the eglx and eglnative flavours.
2010-06-18 17:38:40 +01:00
Emmanuele Bassi
0411ba7d32 actor: Parse actions, constraints and effects members
ClutterActor should allow attaching actions, constraints and effects
just like it allows behaviours, e.g.:

  {
    ...
    "constraints" : [
      {
        "type" : "ClutterAlignConstraint",
        "source" : "stage",
        "align-axis" : "x-axis",
        "factor" : 0.5
      },
      {
        "type" : "ClutterAlignConstraint",
        "source" : "stage",
        "align-axis" : "y-axis",
        "factor" : 0.5
      }
    ],
    ...
  }

or:

  {
    ...
    "actions" : [
      {
        "type" : "ClutterDragAction",
        "signals" : [
          { "name" : "drag-end", "handler" : "on_drag_end" }
        ]
      }
    ],
    ...
  }

In order to do so, we use the Scriptable interface implementation and
add three new custom properties accepting an array; then we parse each
member of the array as a new object.
2010-06-17 17:35:00 +01:00
Emmanuele Bassi
2d99f77e3b cairo-texture: Disable :sync-size
The :sync-size property of ClutterTexture should be set to FALSE by
default by ClutterCairoTexture. The preferred size of the
ClutterCairoTexture is already the size of the internal Cairo surface,
and we override the preferred width/height getters to that effect.

The :sync-size property is also responsible of changing the size of
the Texture actor when changing the texture handle - but since we
encourage that to happen during the CairoTexture allocation, we get a
queue_relayout() invocation (and a warning) when we change the size
of the Cairo image surface.

Since GObject doesn't make it easy to override the default value of the
:sync-size property in sub-classes, we should simply call the setter
function during the ClutterCairoTexture instance initialization.

We should also change one of the interactive tests using a CairoTexture
to rebuild the contents of the actor in response to an allocation.
2010-06-16 13:58:41 +01:00
Emmanuele Bassi
5382e8722b Split out the ignored test files 2010-06-15 16:53:41 +01:00
Robert Bragg
c434f1fc48 material: Make CoglMaterial responsible for depth state
This redirects the legacy depth testing APIs through CoglMaterial and
adds a new experimental cogl_material_ API for handling the depth
testing state.

This adds the following new functions:
cogl_material_set_depth_test_enabled
cogl_material_get_depth_test_enabled
cogl_material_set_depth_writing_enabled
cogl_material_get_depth_writing_enabled
cogl_material_set_depth_test_function
cogl_material_get_depth_test_function
cogl_material_set_depth_range
cogl_material_get_depth_range

As with other experimental Cogl API you need to define
COGL_ENABLE_EXPERIMENTAL_API to access them and their stability isn't
yet guaranteed.
2010-06-15 15:26:28 +01:00
Øyvind Kolås
66de8656e9 test-state: move press/release callbacks to stage avoiding grab 2010-06-14 15:49:20 +01:00
Emmanuele Bassi
f97d16cd2d drag-action: Remove the press event button
Both ::drag-begin and ::drag-end have a "button" argument - even though
we assume internally, and externally, that dragging can only be the
result of a primary button operation.
2010-06-12 17:45:54 +01:00
Emmanuele Bassi
44f300b3a2 effect: Add PageTurnEffect
A simple deformation effect that simulates a page curl.

Ported from MxDeformPageTurn inside the Mx toolkit, written by
Chris Lord.
2010-06-10 18:40:29 +01:00
Robert Bragg
4f0a4b8521 test-cogl-tex-foreign: save and restore GL state correctly
This test breaks out into raw OpenGL to create a foreign texture so it
needs to be careful not to trample on any state that may be cached by
Cogl internally.
2010-06-09 15:19:31 +01:00
Robert Bragg
3907825d05 test-cogl-texture-rectangle: save restore GL state correctly
This test breaks out into raw OpenGL to create a RECTANGLE texture so it
needs to be careful not to trample on any state that may be cached by
Cogl internally.
2010-06-09 15:19:31 +01:00
Neil Roberts
037f7a29d1 test-cogl-texture-rectangle: Fix the size allocated for reading data
The test was only allocating enough space for 256 rows of pixels but
it was then reading 384 so it would randomly fail.
2010-06-09 12:19:55 +01:00
Emmanuele Bassi
00675f42aa texture-async: Fix path fallback code
And error out in case of load failure.
2010-06-08 11:19:28 +01:00
Emmanuele Bassi
4c22f122e1 script: Support layout manager properties
Layout properties work similarly to child properties, with the added
headache that they require the 3-tuple:

  ( layout manager, container, actor )

to be valid in order to be inspected, parsed and applied. This means
using the newly added back-pointer from the container to the layout
manager and then rejigging a bit how the ScriptParser handles the
unresolved properties.

Similarly to the child properties, which use the "child::" prefix, the
layout manager properties use the "layout::" prefix and are defined with
the child of a container holding a layout manager.
2010-06-07 22:45:34 +01:00
Emmanuele Bassi
8583986e16 blur-effect: Fix loop unrolling
The box blur shader was not sampling all the points for producing the
desired effect.
2010-06-07 15:45:24 +01:00
Robert Bragg
457faaffb7 conform: Adds a test-cogl-object conformance test
This tests the new cogl_object_get/set_user_data API
2010-06-04 14:44:15 +01:00
Robert Bragg
eca2634050 cogl-path: Renames cogl_path_get/set cogl_get/set_path
These aren't path methods so aren't consistent with the
cogl_object_method naming style we are aiming for.
2010-06-04 14:44:15 +01:00
Emmanuele Bassi
781a413362 test-drag: Add desaturation effect
Use a desaturation effect on the drag handle.
2010-06-04 10:16:51 +01:00
Emmanuele Bassi
aef2f805a6 effects: Fix stacking of offscreen-based effects
Stacking multiple effects sub-classing ClutterOffscreenEffect requires
a small fix in the code that computes the screen coordinates of the
actor to position the FBO correctly with regards to the stage.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
8ef4d9fe21 actor: Add "effects" to the animatable metas
Since ClutterEffect is an ActorMeta it should be possible to animate the
properties of named effects using the @effects syntax, just like it
happens for actions and constraints.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
73a773d37a effect: Add DesaturateEffect
A simple shader-based effect that desaturates an actor and its contents
based on a controllable factor.
2010-06-03 14:10:55 +01:00
Emmanuele Bassi
a86f1b45bb Add the ClutterEffect abstract class
ClutterEffect is an abstract class that should be used to apply effects
on generic actors.

The ClutterEffect class just defines what an effect should implement; it
could be defined as an interface, but we might want to add some default
behavior dependent on the internal state at a later point.

The effect API applies to any actor, so we need to provide a way to
assign an effect to an actor, and let ClutterActor call the Effect
methods during the paint sequence.

Once an effect is attached to an actor we will perform the paint in this
order:

  • Effect::pre_paint()
  • Actor::paint signal emission
  • Effect::post_paint()

Since an effect might collide with the Shader class, we either allow a
shader or an effect for the time being.
2010-06-03 14:10:55 +01:00
Damien Lespiau
3161e92818 analysis: Make all function declarations be protoypes
It's valid C to declare a function omitting it prototype, but it seems
to be a good practise to always declare a function with its
corresponding prototype.
2010-06-01 12:08:18 +01:00
Damien Lespiau
83b7801e49 analysis: Fix the "key-press-event" callback signature
We were returning FALSE in a function declared as returning a gpointer.
Turns out that the function should return a gboolea instead.
2010-06-01 12:08:18 +01:00
Damien Lespiau
ec59af290c analysis: None used in pointer context
While this is totally fine (None is 0L and, in the pointer context, will
be converted in the right internal NULL representation, which could be a
value with some bits to 1), I believe it's clearer to use NULL instead
of None when we talk about pointers.
2010-06-01 12:08:18 +01:00
Robert Bragg
589c8d9579 [texture] Support picking textures according to their alpha channel
This adds a boolean "pick-with-alpha" property to ClutterTexture and when
true, it will use the textures alpha channel to define the actors shape when
picking.

Users should be aware that it's a bit more expensive to pick textures like
this (so probably best not to blindly enable it on *all* your textures)
since it implies rasterizing the texture during picking whereas we would
otherwise just send a solid filled quad to the GPU.  It will also interrupt
the internal batching of geometry for pick renders which can otherwise often
be done in a single draw call.
2010-05-28 16:07:17 +01:00
Emmanuele Bassi
dfe6eb1e51 test-scrolling: Use a better looking bounce easing 2010-05-27 16:33:01 +01:00
Emmanuele Bassi
aab411bde4 test-scrolling: Animate intermediate positions
Animating intermediate positions in the viewport panning is a neat
effect.
2010-05-27 12:32:45 +01:00
Emmanuele Bassi
346ebce573 actor: Add accessors pair for :clip-to-allocation
We should have an accessors pair for the :clip-to-allocation property,
to avoid going through the generic GObject accessors.
2010-05-26 16:09:47 +01:00
Emmanuele Bassi
6ea56f1160 Add a scrolling interactive example
We can use a container with :clip-to-allocation set to TRUE and a
DragAction to create a panning viewport.
2010-05-26 15:58:15 +01:00
Emmanuele Bassi
823251c159 Use ClickAction in test-animation
Instead of using ::button-press-event.
2010-05-26 14:18:19 +01:00
Emmanuele Bassi
728e2d8071 drag: Add a default drag-motion behaviour
The DragAction should, by default, drag the actor to which it has been
applied, instead of delegating what to do to the developer. If custom
code need to override it, g_signal_stop_emission_by_name() can be called
to stop the default handler to ever running.
2010-05-25 11:01:46 +01:00
Øyvind Kolås
8f0b70a9ee state: replaced test with a more complex one 2010-05-24 16:29:04 +01:00
Neil Roberts
70abe3dd8a test-cogl-materials: Test invalid layers with a constant color
This adds a test using a layer with no texture but that replaces the
fragment color with the layer constant. This currently causes the test
to fail.

http://bugzilla.openedhand.com/show_bug.cgi?id=2132
2010-05-24 16:10:56 +01:00
Neil Roberts
ff7ce2c5b2 test-cogl-materials: Run the 'all layers' test with different prims
The drawing code from test_invalid_texture_layers which draws a
rectangle, a polygon and a vertex buffer has been split out to
separate function. test_using_all_layers now also uses this so that it
will also test the other two primitives. This causes the test to fail
when all of the layers are drawn using a vertex buffer.

http://bugzilla.openedhand.com/show_bug.cgi?id=2132
2010-05-24 16:10:56 +01:00
Emmanuele Bassi
382bd394b9 Merge branch 'wip/state-machine'
* wip/state-machine:
  Do not use wildcards in test-state
  script: Implement State deserialization
  state: added a "target-state" property
  state: documented data structures
  Add State interactive tests to the ignore file
  state: Documentation and introspection annotation fixes
  state: Minor coding style fixes
  state: Clean up the header's documentation
  state: Constify StateKey accessors
  Do not include clutter.h from a Clutter header file
  state-machine: made clutter_state_change take a boolean animate argument
  state-machine: use clutter_timeline_get_progress
  state-machine: add completed signal
  state machine: added state machine

Conflicts:
	.gitignore
2010-05-24 10:42:03 +01:00
Emmanuele Bassi
9fcbb274e0 Do not use wildcards in test-state
Use named states, like in a real case.
2010-05-21 14:22:56 +01:00
Emmanuele Bassi
6ca425679e script: Implement State deserialization
It should be possible to describe ClutterState transitions using
ClutterScript in a similar way as ClutterAnimator.
2010-05-21 14:13:14 +01:00
Emmanuele Bassi
5e3dc55666 Merge branch 'wip/constraints'
* wip/constraints: (24 commits)
  Add the Cogl API reference to the fixxref extra directories
  Document the internal MetaGroup class
  Remove the construct-only flag from ActorMeta:name
  doc: Remove gtk-doc annotations from the json-glib copy
  doc: Fix parameter documentation
  Add named modifiers for Action and Constraint
  Remove a redundant animation
  Set the stage resizable in test-constraints
  Use a 9 grid for the constraints test
  Miscellaneous documentation fixes
  docs: Document animating action and constraint properties
  docs: Document BindConstraint and AlignConstraint
  constraint: Rename BindConstraint:bind-axis
  constraints: Add AlignConstraint
  tests: Add a constraints interactive test
  constraint: Add BindConstraint
  actor: Implement Animatable
  animation: Use the new Animatable API for custom properties
  animatable: Add custom properties to Animatable
  constraint: Add ClutterConstraint base class
  ...

Conflicts:
	configure.ac
2010-05-21 10:55:09 +01:00
Øyvind Kolås
1dc8c0ff05 state-machine: made clutter_state_change take a boolean animate argument
Most of the time this will be TRUE, pass FALSE to change to the target
state immediately.
2010-05-20 16:24:29 +01:00
Øyvind Kolås
8761b279a7 state-machine: add completed signal
Added a completed signal to the animator
2010-05-20 16:24:29 +01:00
Øyvind Kolås
fcdc3a8989 state machine: added state machine 2010-05-20 16:24:29 +01:00
Emmanuele Bassi
7ce2693944 Add named modifiers for Action and Constraint
The ClutterActor API should have modifier methods for adding, removing
and retrieving Actions and Constraints using the ClutterActorMeta:name
property - mostly, for convenience.
2010-05-20 11:19:51 +01:00
Emmanuele Bassi
4dc91339c3 Remove a redundant animation 2010-05-19 18:23:29 +01:00
Emmanuele Bassi
86a773536f Set the stage resizable in test-constraints
To demonstrate that constraints can be used to reposition actors in a
resizable stage, set the :user-resizable property to TRUE, and spend the
next 15 minutes playing with the stage size.
2010-05-19 18:20:27 +01:00
Emmanuele Bassi
5d1b18669b Use a 9 grid for the constraints test
Let's complicate the interactive constraints test a little bit by adding
more actors and animating two constraints at a time.
2010-05-19 18:17:49 +01:00
Emmanuele Bassi
e9b93d5676 constraint: Rename BindConstraint:bind-axis
We're not binding an axis: we're really binding a coordinate of an actor
to the coordinate of another one.
2010-05-19 14:34:18 +01:00
Emmanuele Bassi
f857457b9d constraints: Add AlignConstraint
AlignConstraint is a simple constraint that keeps an actor's position
aligned to the width or height of another actor, multiplied by an
alignment factor.
2010-05-19 13:02:43 +01:00
Emmanuele Bassi
56e8e7d62f tests: Add a constraints interactive test
Show how to use constraints and how to animate them.
2010-05-19 12:28:35 +01:00
Neil Roberts
871683abd3 test-cogl-materials: Fix compilation under GLES 2
GLES 2 doesn't have GL_MAX_TEXTURE_UNITS. Instead the cogl backend
uses GL_MAX_TEXTURE_IMAGE_UNITS with a maximum limit of 16. The same
restriction is now used in the test.
2010-05-18 16:11:58 +01:00
Emmanuele Bassi
4fd74e71e6 action: Add DragAction, an action implementing drag capabilities
DragAction is an Action sub-class that provides dragging capabilities to
any actor. DragAction has:

  • drag-begin, drag-motion and drag-end signals, relaying the event
    information like coordinates, button and modifiers to user code;

  • drag-threshold property, for delaying the drag start by a given
    amount of pixels;

  • drag-handle property, to allow using other actors as the drag
    handle.

  • drag-axis property, to allow constraining the dragging to a specific
    axis.

An interactive test demonstrating the various features is also provided.
2010-05-17 16:42:11 +01:00
Neil Roberts
a12a2e591b Add a conformance test for ClutterCairoTexture
This adds a simple test for ClutterCairoTexture that draws two
rectangles to the cairo surface in an idle callback and then verifies
that they appeared at the right colours in the paint callback. If that
succeeds then the second time the idle callback is invoked it will
replace one of the rectangles with a sub region update and the
following paint callback will again verify the rectangles.
2010-05-11 15:57:12 +01:00
Robert Bragg
6228082e14 conform: Make gtester run a list of wrappers
Instead of asking gtester to run ./test-conformance directly we now tell
it to run a list of wrapper scripts. This results in each test being
spawned in a separate process avoiding leakage of state between tests
which has been a big problem with the conformance tests for quite a
while now.
2010-05-07 17:17:59 +01:00
Neil Roberts
0120abe5b0 test-cogl-multitexture: Set linear filters on the two textures
Otherwise it seems that rounding errors will cause the fragments at
the edge of the quad to blend with neighbouring quarters of the
texture which cause the test to fail.
2010-05-07 17:06:01 +01:00
Neil Roberts
21117bb7a9 test-conform-common: Disconnect all paint handlers on the stage
A few of the tests connected to the paint signal but never
disconnected it. Most of these handlers had a call to g_main_quit in
them which meant that it could sometimes cause subsequent tests to
exit after the first frame is painted. Most of the tests don't
validate any of the results until after a couple of frames have been
rendered so this ended up skipping out the test entirely.

To workaround this the test setup function now disconnects all
handlers for the paint signal on the default stage before the test is
run.
2010-05-06 14:21:53 +01:00
Neil Roberts
61ae7c6df7 test-cogl-readpixels: Reset the viewport and matrices
The on_paint function for test-cogl-readpixels tries to temporarily
set the projection, modelview and viewport to its own values. However
it was never restoring the saved values so it could affect the results
of subsequent tests.
2010-05-06 14:18:32 +01:00
Neil Roberts
b9c7051484 test-cogl-path: Initialise state.frame
state.frame was left unitialized so it would be left to happenstance
which of the first three frames would be used for validating the test.
2010-05-06 14:16:33 +01:00
Neil Roberts
a3bc4a6009 test-cogl-materials: Add a test using the maximum number of layers
This adds a test which creates a material using the maximum number of
layers. All of the layers are assigned a white texture except the last
which is set to red. The default combine mode is used for all of the
layers so the final fragment should end up red.

Currently Cogl doesn't provide a way to query the maximum number of
layers so it just uses glGetIntegerv instead. This might cause
problems on GLES 2 because that adds additional restrictions on the
number of layers.

http://bugzilla.openedhand.com/show_bug.cgi?id=2064
2010-04-29 12:15:06 +01:00
Neil Roberts
fddd316986 test-cogl-path: Test sub paths and intersections
This changes the original tests so that it splits the original path
into two sub paths. When adding a new block to the copied path it also
adds another sub path. This further stresses the path copying
mechanism and exposes a bug.

It also tests intersections by drawing a self-intersecting path and a
path with two sub-paths that overlap. Where the path overlaps it
should be inverted.
2010-04-21 18:58:18 +01:00
Neil Roberts
08a4995383 tests: Add a conformance test for the wrap modes of a cogl material
This renders a texture using different combinations of wrap modes for
the s and t coordinates and then verifies that the expected wrapping
is acheived. The texture is drawn using rectangles, polygons and
vbos. There is also code to test a rectangle using an atlased texture
(which should test the manual repeating) however the validation for
this is currently disabled because it doesn't work.

http://bugzilla.openedhand.com/show_bug.cgi?id=2063
2010-04-12 15:44:23 +01:00
Emmanuele Bassi
6583f8bb49 tests: Fix test-script.json
A trailing comma is breaking the validity of test-script.json
2010-04-09 18:28:37 +01:00
Neil Roberts
10b16b4b7e Add a test case for cogl_path
This tests various paths drawing rectangles and verifies that the
expected pixels are filled in. Some of the paths are drawn by copying
an existing path and modifying it which should test the copy-on-write
code.
2010-04-08 19:54:20 +01:00
Robert Bragg
d2d890a33e test-cogl-offscreen: Setup a clutter style modelview/projection
This updates test-cogl-offscreen to give an example of setting up a
CoglFramebuffer with a Clutter style 2D coordinate system with (0,0) top
left and (framebuffer_width, framebuffer_height) bottom right.
2010-04-06 09:26:10 +01:00
Neil Roberts
fdf608af4c test-cogl-tex-polygon: Actually use the material it creates
test-cogl-tex-polygon creates a separate material so that it can set
the texture filters. However in the paint functions that use
cogl_polygon it was calling cogl_set_source_texture which replaces the
material and ends up always using GL_LINEAR. This patch makes the
paint functions assume the correct source is set up instead of trying
to select a new source.
2010-03-31 19:03:24 +01:00
José Dapena Paz
7b63da69cf Add "homogeneous" mode to ClutterBoxLayout.
Added new "homogeneous" mode to ClutterBoxLayout, that makes layout children
get all the same size.

This is heavily inspired in the "homogeneous" attribute available in GtkBox,
but simplified as we don't have padding nor borders in box layout, only
spacing.

Also added to test-box-layout a key to set/unset homogeneous mode.

* Coding style fixes.
* Added proper test for homogeneous mode in box layout.
* Fix in homogeneous mode.

http://bugzilla.openedhand.com/show_bug.cgi?id=2034

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-03-25 09:41:54 +00:00
Emmanuele Bassi
382b38c0f7 test-paint-wrapper: Request ARGB visuals on GLX
If we are on GLX we have to request ARGB visuals, otherwise Clutter will
not do it by itself.
2010-03-10 00:25:26 +00:00
Neil Roberts
c3a942abde Add a conformance test for rectangle textures
The test creates a GL_TEXTURE_RECTANGLE_ARB texture using
cogl_texture_new_from_foreign and confirms that rendering it works
correctly. If the rectangle texture extension isn't available then
this test always succeeds.

http://bugzilla.openedhand.com/show_bug.cgi?id=2015
2010-03-04 14:52:12 +00:00
Emmanuele Bassi
9e4c008117 build: Include test-script-model.json
The Model conformance test for ClutterScript parsing requires the file
to be inside the dist.
2010-03-02 19:29:42 +00:00
Emmanuele Bassi
2d51432e52 build: Add test-animator-3.json to EXTRA_DIST 2010-03-02 19:29:42 +00:00
Emmanuele Bassi
2f68949962 conformance: Use g_assert_no_error() if available
GLib 2.20 has a nice g_assert() wrapper which will print out the GError
if it's not NULL.
2010-03-02 19:10:07 +00:00
Emmanuele Bassi
e550755f3d text-field: Cast GString->len to integer before printing
The compiler will warn on 64bit architectures when using %d for
printing a gsize field.

http://bugzilla.openedhand.com/show_bug.cgi?id=2019
2010-03-02 17:50:07 +00:00
Øyvind Kolås
09d8460a5c animator: s/clutter_animator_run/clutter_animator_start/
This is consistent with choice of words in clutter_timeline_start and
makes the API less surprising.
2010-03-02 17:03:03 +00:00
Emmanuele Bassi
aba6c5acc7 flow-layout: Provide a preferred size
The FlowLayout fails to provide a preferred size in case no sizing is
specified on one axis. It should, instead, have the preferred size of
the sum of its children, depending on the orientation property.

http://bugzilla.openedhand.com/show_bug.cgi?id=2013
2010-03-02 15:11:27 +00:00
Neil Roberts
c0a553163b cogl: Support any format in cogl_read_pixels
cogl_read_pixels() no longer asserts that the format passed in is
RGBA_8888 but instead accepts any format. The appropriate GL enums for
the format are passed to glReadPixels so OpenGL should be perform a
conversion if neccessary.

It currently assumes glReadPixels will always give us premultiplied
data. This will usually be correct because the result of the default
blending operations for Cogl ends up with premultiplied data in the
framebuffer. However it is possible for the framebuffer to be in
whatever format depending on what CoglMaterial is used to render to
it. Eventually we may want to add a way for an application to inform
Cogl that the framebuffer is not premultiplied in case it is being
used for some special purpose.

If the requested format is not premultiplied then Cogl will convert
it. The tests have been changed to read the data as premultiplied so
that they won't be affected by the conversion. Picking in Clutter has
been changed to use COGL_PIXEL_FORMAT_RGB_888 because it doesn't need
the alpha component. clutter_stage_read_pixels is left unchanged
because the application can't specify a format for that so it seems to
make most sense to store unpremultiplied values.

http://bugzilla.openedhand.com/show_bug.cgi?id=1959
2010-03-02 11:01:35 +00:00
Emmanuele Bassi
70d7bad98b conformance: Use g_test_verbose() for logging
Protect g_print() calls behind the g_test_verbose() check, to avoid
unwanted output during the conformance test run.
2010-02-25 23:15:59 +00:00
Bastian Winkler
96c31bbf0e model: Implement ClutterScriptable interface
Allow a ClutterModel to be constructed through the ClutterScript API.
Currently this allows a model to be generated like like this:

{
  "id" : "test-model",
  "type" : "ClutterListModel",
  "columns" : [
    [ "text-column", "gchararray" ],
    [ "int-column", "gint" ],
    [ "actor-column", "ClutterRectangle" ]
  ]
}

where 'columns' is an array containing arrays of column-name,
column-type pairs.

http://bugzilla.openedhand.com/show_bug.cgi?id=2007
2010-02-25 23:09:11 +00:00
Neil Roberts
31b5856d69 test-cogl-blend-strings: Add some more tests
The adds tests for the remaining layer combine functions, the 1 minus
value operator and the TEXTURE_N source. Note however that Cogl
currently fails when parsing a TEXTURE_N source so the test is
commented out.
2010-02-25 12:50:52 +00:00
Emmanuele Bassi
bd303d6efb conform: Verify parsing of multiple properties
The ClutterAnimator support for parsing multiple properties should be
verified in the conformance test suite.

http://bugzilla.openedhand.com/show_bug.cgi?id=2003
2010-02-24 16:43:17 +00:00
Emmanuele Bassi
3a9d842164 conformance: Show the Stage to test invariants
We need to make the Stage set the MAPPED flag on itself if we want to
verify the MAPPED state. That was always the case - it just worked
before because the Stage was shown at least once.
2010-02-24 12:25:48 +00:00
Neil Roberts
a726ef32aa test-cogl-vertex-buffer: Fix the maximum index number
It was passing the number of vertices to
cogl_vertex_buffer_draw_elements but instead it should take the
maximum index which would be the number of vertices minus one. This
was causing errors to be reported with the checks filterset of Bugle.
2010-02-17 14:38:45 +00:00
Emmanuele Bassi
fbcaf1e0b3 Improve LEAVE events for border actors
If an actor is lying on the border of the Stage it might miss the LEAVE
event when the pointer of a device leaves the Stage window. Since the
backend is unsetting the Stage back pointer on the InputDevice we can
queue the emission of a LEAVE event on the pointer actor as well.

http://bugzilla.moblin.org/show_bug.cgi?id=9677
2010-02-17 10:48:18 +00:00
Chris Lord
d42f928c43 [test-interactive] Add a stage sizing test
Add an interactive stage sizing test to test the interaction of
fullscreening/resizing/expanding/shrinking a visible stage.
2010-02-16 15:39:08 +00:00
Emmanuele Bassi
7a3eb452b8 conform: Do not resize the stage
Since all conformance tests share the same state we should not touch
stuff like the stage size; sharing is already fairly complex and adds a
lot of caveats on the implementation of a conformance test unit, and if
we make tests influence later ones then we might slip in bugs or false
negatives - thus defeating the whole point of a conformance test suite.
2010-02-16 12:19:15 +00:00
Emmanuele Bassi
4cadc73005 conform: Use a 640x480 stage in test-pick
Do not resize the stage to a smaller size: the default size is perfectly
fine.
2010-02-16 12:19:15 +00:00
Emmanuele Bassi
e65bb38720 conform: Use g_assert_cmpint() in cogl-readpixels test
The g_assert_cmpint() macro prints out not just the assertion condition
but also the assertion contents; this is useful to catch wrong values
without incrementing the verbosity of the test itself.
2010-02-16 12:01:13 +00:00
Emmanuele Bassi
0d428655e2 actor: Turn push/pop_internal into Actor methods
Since the "internal" state is global, it will leak onto actors that you
didn't intend for it to, because it applies not just to the actors you
create, but also to any actors *they* create. Eg, if you have a dialog
box class, you might push/pop_internal around creating its buttons, so
that those buttons get marked as internal to the dialog box. But
ctx->internal_child will still be set during the *button*'s constructor
as well, and so, eg, the label and icon inside the button actor will
*also* be marked as internal children, even if that isn't what the
button class wanted.

The least intrusive change at this point is to make push_internal() and
pop_internal() two methods of the Actor class, and take a ClutterActor
pointer as the argument - thus moving the locality of the internal_child
counter to the Actor itself.

http://bugzilla.openedhand.com/show_bug.cgi?id=1990
2010-02-15 16:09:26 +00:00
Emmanuele Bassi
fef82fae5c build: Enable experimental COGL API in tests/conform
Enable the experimental API when building the conformance test suite.
2010-02-15 11:58:55 +00:00
Emmanuele Bassi
032121ce17 build: Disable deprecated API in tests/conform
We should not be using deprecated API in the conformance test suite.
2010-02-15 11:57:48 +00:00
Emmanuele Bassi
c3354cb2c0 conform: Do not use deprecated API
There is no more type-specific ref/unref pairs: it is all under
CoglHandle now.
2010-02-15 11:56:34 +00:00
Neil Roberts
4be4f56bdf cogl-sub-texture: Optimise taking a sub texture of a sub texture
When creating a Cogl sub-texture, if the full texture is also a sub
texture it will now just offset the x and y and reference the full
texture instead. This avoids one level of indirection when rendering
the texture which reduces the chances of getting rounding errors in
the calculations.
2010-02-12 16:57:17 +00:00
Emmanuele Bassi
00c4bfc3c6 analysis: Interactive tests
Abort if test-behave was passed the wrong type of behaviour to test.
2010-02-12 14:57:56 +00:00
Emmanuele Bassi
46182233c0 analysis: Conformance tests
Initialize ClutterPathNote members to 0 using "{ 0, }".
2010-02-12 14:57:56 +00:00
Emmanuele Bassi
f54b29a0c0 test-text-field: Tone down the border
Use a low opacity for the text field border.
2010-02-10 15:45:54 +00:00
Emmanuele Bassi
2670fc5871 test-text-field: Use ActorBox methods for the border
Clamp to pixel and use get_size() when painting the border of the text
field.
2010-02-10 15:45:54 +00:00
Emmanuele Bassi
cccf23caa4 build: Always build conformance tests with debug symbols
Having the conformance test suite build without debug symbols doesn't
make any sense.
2010-02-09 13:24:13 +00:00
Robert Bragg
e46db37c03 conform: fix stack corruption in test-behaviours.c
The test was calling g_object_get to fetch the "opacity-start" property
(unsigned int) into a guint8 local variable. It's a bit of a mean trap
given that the getter function returns guint8 values so this also adds a
comment explaining what's going on.
2010-02-09 13:09:24 +00:00
Emmanuele Bassi
a139bf9c40 test-animator: Do not use mid-function blocks
The test_animator_properties unit is so small that declaring a
mid-function block for two variables is not that clever.
2010-02-08 17:56:35 +00:00
Damien Lespiau
c02dded0f6 cogl-buffer: Use TEXTURE as the only value for CoglBufferUsageHint
We should try to use more explicit defines than GL for our hints. For
now we only support using a CoglBuffer to generate textures.
2010-02-08 17:14:49 +00:00
Damien Lespiau
b5d5821304 tests: Add a test for CoglPixelBuffers
Exercise the whole public CoglBuffer / CoglPixelBuffer and
cogl_texture_new_from_buffer API.
2010-02-08 17:14:49 +00:00
Emmanuele Bassi
069ba6daf9 Merge branch 'animator-parser'
* animator-parser:
  docs: Describe the Animation definition syntax
  animator: Provide a ClutterScript parser
  animator: Allow retrieving type property type from a key
  script: Use a node when resolving an animation mode
2010-02-08 16:53:11 +00:00
Emmanuele Bassi
4dd11d6915 animator: Provide a ClutterScript parser
The whole point of having the Animator class is that the developer can
describe a complex animation using ClutterScript. Hence, ClutterAnimator
should hook into the Script machinery and parse a specific description
format for its keys.
2010-02-08 15:52:18 +00:00
Emmanuele Bassi
8ac27e6070 test-flow-layout: Remove unneeded Stage sizing
The bug with resizable stages getting a 1, 1 window on X11 has been
fixed by Chris.
2010-02-08 10:40:39 +00:00
Øyvind Kolås
4cc269a468 Add ClutterAnimator
ClutterAnimator is a class for managing the animation of multiple
properties of multiple actors over time with keyframing of values.

The Animator class is meant to be used to effectively describe
animations using the ClutterScript definition format, and to construct
complex implicit animations from the ground up.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-02-07 18:25:19 +00:00
Emmanuele Bassi
e55966d675 Deprecate clutter_util_next_p2()
The next_p2() function should have never been publicly exposed by
Clutter.
2010-02-06 10:49:33 +00:00
Emmanuele Bassi
dcdb97006b build: Add suppressions file to EXTRA_DIST 2010-02-06 10:49:33 +00:00
Neil Roberts
830f2402d4 Merge branch 'more-texture-backends'
This adds three new texture backends.

- CoglTexture2D: This is a trimmed down version of CoglTexture2DSliced
  which only supports a single texture and only works with the
  GL_TEXTURE_2D target. The code is a lot simpler so it has a less
  overheads than dealing with slices. Cogl will use this wherever
  possible.

- CoglSubTexture: This is used to get a CoglHandle to represent a
  subregion of another texture. The texture can be used as if it was a
  standalone texture but it does not need to copy the resources.

- CoglAtlasTexture: This collects RGB and RGBA textures into a single
  GL texture with the aim of reducing texture state changes and
  increasing batching. The backend will try to manage the atlas and
  may move the textures around to close gaps in the texture. By
  default all textures will be placed in the atlas.
2010-02-06 00:20:32 +00:00
Emmanuele Bassi
15c6fef7e3 tests: Add a Valgrind suppression file
When running tests under Valgrind it would be useful to pass a
suppression file for the known one-off allocations done by Clutter
and by its dependencies. This trims the output of Valgrind and
improves the ability to actually spot leaks.
2010-02-04 16:49:06 +00:00
Emmanuele Bassi
16a5911cff tests: Clean up the cairo-flowers interactive test 2010-02-03 15:05:37 +00:00
Kristian Høgsberg
5bec49aea9 Use ClutterTimeline in test-clutter-cairo-flowers.c
http://bugzilla.openedhand.com/show_bug.cgi?id=1969
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-02-02 19:19:06 +00:00
Emmanuele Bassi
12b004b0e7 tests: Add an initial Behaviour conformance suite
The coverage of the Behaviour sub-classes is currently abysmal. An
initial test suite for Behaviours should at least verify that the
accessors and the constructors are doing the right thing.

This initial test suite just verifies the BehaviourOpacity sub-class,
but it already bumps up the overall coverage by 2%.
2010-02-02 12:58:27 +00:00
Neil Roberts
145cc9d3df Merge remote branch 'master' into texture-debugging
Conflicts:
	clutter/cogl/cogl/cogl-context.h
2010-02-01 13:37:19 +00:00
Emmanuele Bassi
5f1c8a17e4 Merge branch 'device-manager'
* device-manager: (37 commits)
  x11: Re-enable XI1 extension keyboards
  x11: Always handle core device events before XI events
  docs: Documentation fixes for DeviceManager
  device-manager: Fix the signals definition
  docs: Add sections for InputDevice and DeviceManager
  docs: Add clutter_input_device_get_device_name()
  tests: Print out the device details on motion
  Always register core devices
  device: Remove unused is_default member
  win32: Experimental implementation of device support
  tests: Print the device name, as well as its Id
  x11: Fill out the :name property of the InputDevices
  device: Add the :name property to InputDevice
  x11: Store core devices on the X11 Backend singleton
  device: Unset the cursor actor when leaving the stage
  device: Add pointer actor getter
  x11: Discard the LeaveNotify for off-stage ButtonRelease
  device: Do not overwrite the stage for an InputDevice
  event: Off-stage button releases have a click count of 1
  event: Scroll events do not have click count
  ...
2010-02-01 11:26:56 +00:00
Emmanuele Bassi
5f5f6d825f build: Allow disabling the conformance test suite
When building Clutter for packaging on headless boxes it's pointless to
allow building the conformance test to be built (and run on 'make
check').
2010-02-01 10:40:34 +00:00
Damien Lespiau
afb30f4013 tests: blend-string: use g_assert_cmpint
It's very useful to see the actual number the reference value is
compared too when the test fails. GTest has g_assert_cmp$type()
functions for that, so make good use of them.
2010-01-26 17:25:10 +00:00
Damien Lespiau
de31cbf4f7 test-cogl-multitexture: use several materials with texture matrices
A small doubt has risen about the use of CoglTextureUnit in materials:
will texture matrices still work if we have several materials, each of
them having at texture on the same texture unit? The answer is yes!

test-cogl-multitexture has been extended to use 2 materials with about
the same setup except a little difference: the texture matrices for the
lightmaps rotate in opposite directions.

While at it, changed the rotation behaviour by an implicit animation
with a small additional bonus bling.
2010-01-26 16:59:50 +00:00
Emmanuele Bassi
d0f7debfba test-easing: Do not reconnect signals multiple times
The test should keep track of the last animation and avoid reconnecting
signals to the same instance in case the -r argument has been passed.
2010-01-22 21:44:28 +00:00
Emmanuele Bassi
8a4b647154 x11: Re-enable XI1 extension keyboards
The extension keyboard support in XInput 1.x is hopelessly broken.

Nevertheless, it's possible to use some bits of it, as we prefer the
core keyboard events to the XInput events, thus at least having proper
handling for X11 key events on the Stage window.
2010-01-20 19:40:58 +00:00
Emmanuele Bassi
1f5a7b61b7 tests: Print out the device details on motion
The test-device interactive test should print out the device name and id
when it detects a motion event.
2010-01-20 00:38:53 +00:00
Emmanuele Bassi
850dd5a38f tests: Print the device name, as well as its Id
The test-devices interactive test should display the device name along
with the id.
2010-01-20 00:38:09 +00:00
Emmanuele Bassi
68b47e3ed4 tests: Fix test-events output
• The enter/leave event line should take into account the case where
  the related field is set to NULL (meaning entering from off-stage
  and leaving the stage).

• The ButtonRelease line shows the click count but uses the button; the
  button *and* the click count should be displayed for both ButtonPress
  and ButtonRelease, to verify they match.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
75f05646fa tests: Clean up test-events
The output of test-events is a bit of a mess; this patch should clean
it up a little bit - at least enough for it to be useful again during
visual inspection.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
d5331bfb57 tests: Update the devices test
Use the DeviceManager API instead of the X11 specific API.
2010-01-20 00:38:08 +00:00
Neil Roberts
1ef40b8823 test-cogl-npot-texture: Use the COGL_TEXTURE_NO_ATLAS flag
If the texture is put in the atlas it won't be sliced whatever size it
is so it negates the test. We can avoid this with the NO_ATLAS flag.
2010-01-19 17:15:51 +00:00
Neil Roberts
ff1d9cf090 test-texture-fbo: Disconnect the paint handler for the stage
Otherwise the paint handler will still be run for the subsequent
tests. This ends up writing to the ‘state’ variable which used to be
on the stack so it will end up corrupting some stack variable. This
was causing test-cogl-premult to fail.
2010-01-18 12:42:46 +00:00