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.
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
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>
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)
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
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.
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.
* 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
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.
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>
Some tests can be given extra arguments. The test-interactive dispatch
mechanism handles that but the small shell scripts around the wrapper
do not forward the arguments to the wrapper.
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
The build for interactive tests creates symbolic links for the data
under tests/data; it also uses symbolic links for creating "binaries"
for each interactive test. This is less than ideal, though.
Instead, the tests should build a path to the data files by using
a pre-processor define like TESTS_DATADIR; both g_build_filename() and
pre-processor string concatenation can be used to generate a valid
file name with the full path to the files.
The build system should also create wrapper scripts, just like we
do inside the conformance test suite, to be able to launch single
tests.
* layout-manager: (50 commits)
docs: Reword a link
layout, docs: Add more documentation to LayoutManager
layout, docs: Fix description of Bin properties
layout, bin: Use ceilf() instead of casting to int
layout, docs: Add long description for FlowLayout
layout, box: Clean up
layout, box: Write long description for Box
layout, docs: Remove unused functions
layout: Document BoxLayout
layout: Add BoxLayout, a single line layout manager
layout: Report the correct size of FlowLayout
layout: Resizing the stage resizes the FlowLayout box
layout: Use the get_request_mode() getter in BinLayout
layout: Change the request-mode along with the orientation
actor: Add set_request_mode() method
[layout] Remove FlowLayout:wrap
[layout] Rename BinLayout and FlowLayout interactive tests
[layout] Skip invisible children in FlowLayout
[layout] Clean up and document FlowLayout
[layout] Snap children of FlowLayout to column/row
...
As part of an incremental process to have Cogl be a standalone project we
want to re-consider how we organise the Cogl source code.
Currently this is the structure I'm aiming for:
cogl/
cogl/
<put common source here>
winsys/
cogl-glx.c
cogl-wgl.c
driver/
gl/
gles/
os/ ?
utils/
cogl-fixed
cogl-matrix-stack?
cogl-journal?
cogl-primitives?
pango/
The new winsys component is a starting point for migrating window system
code (i.e. x11,glx,wgl,osx,egl etc) from Clutter to Cogl.
The utils/ and pango/ directories aren't added by this commit, but they are
noted because I plan to add them soon.
Overview of the planned structure:
* The winsys/ API is the API that binds OpenGL to a specific window system,
be that X11 or win32 etc. Example are glx, wgl and egl. Much of the logic
under clutter/{glx,osx,win32 etc} should migrate here.
* Note there is also the idea of a winsys-base that may represent a window
system for which there are multiple winsys APIs. An example of this is
x11, since glx and egl may both be used with x11. (currently only Clutter
has the idea of a winsys-base)
* The driver/ represents a specific varient of OpenGL. Currently we have "gl"
representing OpenGL 1.4-2.1 (mostly fixed function) and "gles" representing
GLES 1.1 (fixed funciton) and 2.0 (fully shader based)
* Everything under cogl/ should fundamentally be supporting access to the
GPU. Essentially Cogl's most basic requirement is to provide a nice GPU
Graphics API and drawing a line between this and the utility functionality
we add to support Clutter should help keep this lean and maintainable.
* Code under utils/ as suggested builds on cogl/ adding more convenient
APIs or mechanism to optimize special cases. Broadly speaking you can
compare cogl/ to OpenGL and utils/ to GLU.
* clutter/pango will be moved to clutter/cogl/pango
How some of the internal configure.ac/pkg-config terminology has changed:
backendextra -> CLUTTER_WINSYS_BASE # e.g. "x11"
backendextralib -> CLUTTER_WINSYS_BASE_LIB # e.g. "x11/libclutter-x11.la"
clutterbackend -> {CLUTTER,COGL}_WINSYS # e.g. "glx"
CLUTTER_FLAVOUR -> {CLUTTER,COGL}_WINSYS
clutterbackendlib -> CLUTTER_WINSYS_LIB
CLUTTER_COGL -> COGL_DRIVER # e.g. "gl"
Note: The CLUTTER_FLAVOUR and CLUTTER_COGL defines are kept for apps
As the first thing to take advantage of the new winsys component in Cogl;
cogl_get_proc_address() has been moved from cogl/{gl,gles}/cogl.c into
cogl/common/cogl.c and this common implementation first trys
_cogl_winsys_get_proc_address() but if that fails then it falls back to
gmodule.
FlowLayout is a layout manager that arranges its children in a
reflowing line; the orientation controls the major axis for the
layout: horizontal, for reflow on the Y axis, and vertical, for
reflow on the X axis.
in tests/interactive/Makefile.am add wrapper.sh to EXTRA_DIST otherwise
interactive unit tests wont be runnable when building from distributed
tarballs.
AM_LDFLAGS is ignored by the LDFLAGS target, and it's also not the right
place to put the libraries used by the linker.
Thanks to Vincent Untz for spotting this.
The perspective test was used essentially to determine whether the
perspective set up in COGL worked correctly. The perspective code
has been changed a lot since Clutter 0.3: we rely on client-side
matrices and we use floating point; so, all the conditions the test
was supposed to verify do not exist anymore.
In order to be ready for the next major version of GLib we need to
disable single header inclusion by using the G_DISABLE_SINGLE_INCLUDES
define in the build process.
The test is a sanity check that dynamic updating of vertex data via the cogl
vertex buffer api works and has reasonable performance. (though it can't be
considered a well designed benchmark since it wastes casual amounts of CPU
time simply choosing pretty colors.)
The code also aims to demonstrate one way of creating, updating and efficiently
drawing a quad mesh structure via the vertex buffer api which could be applied
to lots of different use cases.
* generic-actor-clone:
Remove CloneTexture from the API
[tests] Clean up the Clone interactive test
Rename ActorClone to Clone/2
Rename ActorClone to Clone/1
Improves the unit test to verify more awkward scaling and some corresponding fixes
Implements a generic ClutterActorClone that doesn't need fbos.
Conflicts:
clutter/cogl/gl/cogl-texture.c
clutter/cogl/gles/cogl-primitives.c
* cogl-material:
clutter-{clone-,}texture weren't updating their material opacity.
Updates GLES1 support for CoglMaterial
Normalizes gl vs gles code in preperation for synching material changes
Removes cogl_blend_func and cogl_alpha_func
Fully integrates CoglMaterial throughout the rest of Cogl
[cogl-material] Restore the GL_TEXTURE_ENV_MODE after material_rectangle
[cogl-material] Make the user_tex_coords parameter of _rectangle const
[test-cogl-material] Remove return value from material_rectangle_paint
Add cogl-material.h and cogl-matrix.h to libclutterinclude_HEADERS
[cogl-material] improvements for cogl_material_rectangle
[cogl-material] Adds a cogl_material_set_color function
[cogl-material] Some improvements for how we sync CoglMaterial state with OpenGL
[cogl-material] Converts clutter-texture/clutter-clone-texture to the material API
[doc] Hooks up cogl-material reference documentation
Updates previous GLES multi-texturing code to use CoglMaterial
Adds a CoglMaterial abstraction, which includes support for multi-texturing
[doc] Hooks up cogl-matrix reference documentation
Adds CoglMatrix utility code
[tests] Adds an interactive unit test for multi-texturing
[multi-texturing] This adds a new cogl_multi_texture API for GL,GLES1 + GLES2
This glues CoglMaterial in as the fundamental way that Cogl describes how to
fill in geometry.
It adds cogl_set_source (), which is used to set the material which will be
used by all subsequent drawing functions
It adds cogl_set_source_texture as a convenience for setting up a default
material with a single texture layer, and cogl_set_source_color is now also
a convenience for setting up a material with a solid fill.
"drawing functions" include, cogl_rectangle, cogl_texture_rectangle,
cogl_texture_multiple_rectangles, cogl_texture_polygon (though the
cogl_texture_* funcs have been renamed; see below for details),
cogl_path_fill/stroke and cogl_vertex_buffer_draw*.
cogl_texture_rectangle, cogl_texture_multiple_rectangles and
cogl_texture_polygon no longer take a texture handle; instead the current
source material is referenced. The functions have also been renamed to:
cogl_rectangle_with_texture_coords, cogl_rectangles_with_texture_coords
and cogl_polygon respectivly.
Most code that previously did:
cogl_texture_rectangle (tex_handle, x, y,...);
needs to be changed to now do:
cogl_set_source_texture (tex_handle);
cogl_rectangle_with_texture_coords (x, y,....);
In the less likely case where you were blending your source texture with a color
like:
cogl_set_source_color4ub (r,g,b,a); /* where r,g,b,a isn't just white */
cogl_texture_rectangle (tex_handle, x, y,...);
you will need your own material to do that:
mat = cogl_material_new ();
cogl_material_set_color4ub (r,g,b,a);
cogl_material_set_layer (mat, 0, tex_handle));
cogl_set_source_material (mat);
Code that uses the texture coordinates, 0, 0, 1, 1 don't need to use
cog_rectangle_with_texure_coords since these are the coordinates that
cogl_rectangle will use.
For cogl_texture_polygon; as well as dropping the texture handle, the
n_vertices and vertices arguments were transposed for consistency. So
code previously written as:
cogl_texture_polygon (tex_handle, 3, verts, TRUE);
need to be written as:
cogl_set_source_texture (tex_handle);
cogl_polygon (verts, 3, TRUE);
All of the unit tests have been updated to now use the material API and
test-cogl-material has been renamed to test-cogl-multitexture since any
textured quad is now technically a test of CoglMaterial but this test
specifically creates a material with multiple texture layers.
Note: The GLES backend has not been updated yet; that will be done in a
following commit.
The maintainer compiler flags we use trigger warnings and errors
in the autogenerated code that gtk-doc creates to scan the header
and source files. Since we cannot control that, and we must run
a distcheck with both --enable-gtk-doc and --enable-maintainer-flags
turned on, we need to use less-strict compiler flags when inside
the doc/reference subdirectories.
The way to do this is to split the maintainer compiler flags into
their own Makefile variable, called MAINTAINER_CFLAGS. The we
can use $(MAINTAINER_CFLAGS) in the INCLUDES or _CFLAGS sections
of each part of the source directories we wish to check with the
anal retentiveness suited for maintainers.
This simplifies the mucking about with the model-view matrix that was previously
done which improves its efficiency when scaling is necessary.
Notably: There should now be no performance advantage to using
ClutterCloneTexture as a special case clone actor since this method is just as
efficient.
The unit test was renamed to test-actor-clone.
Many use cases for clonning an actor don't require running a shader on the
resulting clone image and so requiring FBOs in these cases is overkill and
in-efficient as it requires kicking and synchronizing a render for each clone.
This approach basically just uses the paint function of another actor to
implement the painting for the clone actor with some fiddling of the model-
view matrix to scale according to the different allocation box sizes of
each of the actors.
A simple unit test called test-actors2 was added for testing.
The Effects API and all related symbols have been superceded by
the newly added Animation API and clutter_actor_animate().
This commit removes the Effects implementation, the documentation
and the interactive test/example code.