Commit Graph

3348 Commits

Author SHA1 Message Date
Emmanuele Bassi
e957e277b8 x11: Do not manage a foreign window
If a Stage has been set to use a foreign Window then Clutter should not
be managing it; calling XWithdrawWindow and XMapWindow should be
reserved to the windows we manage ourselves.
2009-12-08 18:24:30 +00:00
Emmanuele Bassi
28cb2cdab5 Remove clutter_set_default_text_direction()
Setting the default text direction programmatically is wrong: it is a
value dependent on the locale or by the environment.
2009-12-07 19:00:55 +00:00
Emmanuele Bassi
3b9575baf8 Queue a relayout when the default text direction changes
We need a relayout cycle if the default direction for the text changes
while the main loop is running.
2009-12-07 18:41:15 +00:00
Emmanuele Bassi
9ccdf2eb02 box: Add relative packing methods
ClutterBox should provide some convenience functions to pack a new child
at a given position, either an absolute index or relative to a sibling.
2009-12-04 16:54:22 +00:00
Bastian Winkler
18860eb16f flow-layout: Use the natural size
Fix a copy-and-paste thinko where the cell size was computed using the
minimum size instead of the natural size. For actors with a minimum size
of zero, like Textures, this implied always a zero allocation.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-12-03 15:38:05 +00:00
Neil Roberts
7f58c14dcd cogl: Use #ifdef GL around GL_TEXTURE_RECTANGLE_ARB
Commit 558b17ee1e added support for rectangle textures to the
framebuffer code. Under GLES there is no GL_TEXTURE_RECTANGLE_ARB
definition so this was breaking the build. The rest of Cogl uses
ifdef's around that constant so we should do the same here.
2009-12-02 21:59:58 +00:00
Emmanuele Bassi
59d84f7806 build: Fix CPP and LD flags
• The debug flags are pre-processor ones, so they should be listed
  inside AM_CPPFLAGS.

• Clutter's publicly exported symbols match the following regular
  expression:

    ^(clutter|cogl|json)_*

  The old one also listed "pango" as a possible prefix, but the
  Pango API is now under the Cogl namespace.
2009-12-02 16:03:55 +00:00
Emmanuele Bassi
17e3b526d5 docs: Document Clutter's threading model
Be explicit on how to deal with threads and Clutter.
2009-12-02 14:15:43 +00:00
Emmanuele Bassi
fc7bbf1abf docs: Fix docbook syntax
The <variablename> tag is really called <varname> in DocBook.
2009-12-02 14:15:19 +00:00
Emmanuele Bassi
3c08c411d2 docs: Annotate StageManager
The ClutterStageManager instance structure is private, so we need a
"floating" annotation.
2009-12-02 11:38:04 +00:00
Emmanuele Bassi
7a33b706a4 Remove a gtk-doc annotation
The Mesa matrix code still has a comment that looks like a gtk-doc
annotation.
2009-12-02 11:37:13 +00:00
Emmanuele Bassi
0270313121 layout: Add padding to LayoutMeta
Add some padding to the LayoutMeta and LayoutMetaClass structures.
2009-12-02 11:36:25 +00:00
Emmanuele Bassi
02398c0cf1 Remove unused variable 'lang'
Fix a compiler warning.
2009-12-01 18:16:48 +00:00
Rob Bradford
cdba8cc220 flow-layout: Include the first line when calculating number of lines
This ensures that the preferred height / width height takes into consideration
the correct amount of padding
2009-12-01 17:46:12 +00:00
Rob Bradford
c564303601 flow-layout: Respect row-spacing/col-spacine in horizontal/vertical flows
We need to add the row-spacing value when calculating the y position for lines
of actors in horizontal flowing layouts.

Similarly we need to add the col-spacing value when calculating the x posution
for actors in vertical flowing layouts.
2009-12-01 17:46:11 +00:00
Emmanuele Bassi
b43e804c07 actor: Fix a pre-condition check in set_text_direction()
The check is failing because the condition should be:

  text_dir != CLUTTER_TEXT_DIRECTION_DEFAULT
2009-12-01 16:06:57 +00:00
Emmanuele Bassi
3e034cda58 build: More cleanups for the configure summary
Document each section, and add some more items to the summary like what
JSON-GLib are we using, and which version of the GLES API is COGL
wrapping.
2009-12-01 15:17:49 +00:00
Emmanuele Bassi
e3b409529e build: Require a stable JSON-GLib version
The 0.7 version is the development cycle for JSON-GLib 0.8.
2009-12-01 15:17:16 +00:00
Emmanuele Bassi
1c47638db4 docs: Add missing symbols to clutter-sections.txt 2009-12-01 14:59:44 +00:00
Emmanuele Bassi
586750751a Merge branch 'text-direction'
* text-direction:
  docs: Add text-direction accessors
  Set the default language on the Pango context
  actor: Set text direction on parenting
  tests: Display the index inside text-box-layout
  box-layout: Honour :text-direction
  text: Dirty layout cache on text direction changes
  actor: Add :text-direction property
  Use the newly added ClutterTextDirection enumeration
  Add ClutterTextDirection enumeration
2009-12-01 14:55:19 +00:00
Emmanuele Bassi
6e99c1aefe docs: Add text-direction accessors 2009-12-01 14:55:01 +00:00
Bastian Winkler
c2332a5d26 build: Fix the SUBDIRS ordering
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-12-01 12:31:56 +00:00
Emmanuele Bassi
220a8fbfda docs: Move documentation under doc/
Clean up the root directory of the project and try to keep the
documentation all together.
2009-12-01 10:16:25 +00:00
Emmanuele Bassi
348f5bfec8 cookbook: Clean up the text
• Remove the empty sections.

• Add the description for the "overriding the paint sequence" recipe.
2009-12-01 10:11:33 +00:00
Emmanuele Bassi
52db14b78d docs: Fix recursion into doc/ directory
We should always recurse into the doc/ directory; whether we should then
recurse into reference/, cookbook/ and manual/ is a matter of specific
configure-time flags.
2009-11-30 21:51:46 +00:00
Emmanuele Bassi
5e1ccaeb60 docs: Clean up the additional documentation build
• Make the manual a DevHelp book

• Make the generation of PDFs of the cookbook and the manual optional

• Consequently, make the hard dependency on jw optional

• Clean up the checks and build for the additional documentation
2009-11-30 21:33:22 +00:00
Emmanuele Bassi
ee9d358c45 [cookbook] Build the Cookbook as a devhelp document
Instead of creating stand-alone HTML files, use XSLT to transform the
DocBook into a DevHelp file, so that we can read the Cookbook inside
DevHelp -- just like the API reference.
2009-11-30 21:31:19 +00:00
Emmanuele Bassi
9485ef81a6 [cookbook] Fix folds 2009-11-30 21:31:19 +00:00
Emmanuele Bassi
2675b82999 Update the ignore file
Add the temporary and output files of the cookbook.
2009-11-30 21:31:19 +00:00
Emmanuele Bassi
a7f7bfbc87 Add the secon recipe to the Actors chapter
The second recipe shows how to use the ::paint signal to override
the paint sequence of a pre-existing actor.
2009-11-30 21:31:19 +00:00
Emmanuele Bassi
26b35e657f Add the first recipe to the Actors chapter
The first recipe shows how to be notified when the relative position
and size of an actor changes using the notify:: signal on the actor's
dimensional and positional properties.
2009-11-30 21:31:19 +00:00
Emmanuele Bassi
135cb5c6e2 Add a preface instead of an introduction
Make the Cookbook look more like a book than a tutorial.
2009-11-30 21:31:19 +00:00
Emmanuele Bassi
35627f240f Add the Clutter Cookbook to the build
The "Clutter Cookbook" is a document designed to contain solutions
to common problems applications developers might encounter when using
Clutter. It is meant as a companion to the API reference but it
requires knowledge of the Clutter API and framework.
2009-11-30 21:31:19 +00:00
Emmanuele Bassi
15a04a1dd3 layout-manager: Create LayoutMeta on demand
The ClutterLayoutMeta instances should be created on demand, whenever
the layout manager needs them - if the layout manager supports layout
properties.

This removes the requirement to call add_child_meta() and
remove_child_meta() on add and remove respectively; it also simplifies
the implementation of LayoutManager sub-classes since we can add
fallback code in the base abstract class.

Eventually, this will also lead to an easier to implement ClutterScript
parser for layout properties.

With the new scheme, the ClutterLayoutMeta instance is created whenever
the layout manager tries to access it; if there isn't an instance
already attached to the container's child, one is created -- assuming
that the LayoutManager sub-class has overridden the
get_child_meta_type() virtual function and it's returning a valid GType.

We can also provide a default implementation for create_child_meta(),
by getting the GType and instantiating a ClutterLayoutMeta with all the
fields already set. If the layout manager requires more work then it can
obviously override the default implementation (and even chain up to it).

The ClutterBox actor has been updated, as well as the ClutterBoxLayout
layout manager, to take advantage of the changes of LayoutManager.
2009-11-30 19:11:00 +00:00
Emmanuele Bassi
7d842079ca conform: Add named object property unit for ClutterScript
We should exercise the resolution of the object properties containing a
string pointing to an object previously defined using ClutterScript.
2009-11-30 19:11:00 +00:00
Neil Roberts
c3e640e6e3 Use the correct colour when clearing the stage for picking
The colour test for the stage in _clutter_do_pick checks for white to
determine whether the stage was picked but since 47db7af4d we were
setting the colur to black. This usually worked because the id of the
default stage ends up being 0 which equates to black. However if a
second stage is created then it will always end up picking the first
stage.
2009-11-30 19:09:05 +00:00
Neil Roberts
1bb034fbd7 cogl: Enable blending if a lighting colour is semi-transparent
We currently enable blending if the material colour has
transparency. This patch makes it also enable blending if any of the
lighting colours have transparency. Arguably this isn't neccessary
because we don't expose any API to enable lighting so there is no
bug. However it is currently possible to enable lighting with a direct
call to glEnable and this otherwise works so it is a shame not to have
it.

http://bugzilla.openedhand.com/show_bug.cgi?id=1907
2009-11-30 19:08:38 +00:00
Emmanuele Bassi
3cb974ee8b Set the default language on the Pango context
When creating the Pango context we should also set the language
to be the default Pango language.
2009-11-30 16:15:19 +00:00
Emmanuele Bassi
daeb3b2fec actor: Set text direction on parenting
When setting the parent on an actor we should set the text direction to
be the same as the parent's.
2009-11-30 16:14:09 +00:00
Damien Lespiau
0ce5c7d350 gitignore: update gitignore files to match the latest cogl tests
Some cogl tests were renamed in c1247066 to have 'cogl' in their names.
It's a good excuse to merge .gitigore and tests/.gitignore.
2009-11-30 13:29:39 +01:00
Damien Lespiau
4f06d035a2 tests: fix argument parsing of test-texture-quality
This test did not open redhand.png as argc/argv should be handled
normally (argv[0] being the name of the exectutable).

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-11-30 12:53:54 +01:00
Damien Lespiau
e4180b2838 tests: give all the arguments to the wrapper
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>
2009-11-30 12:53:26 +01:00
Robert Bragg
934eb5d251 primitives: Don't use dynamic arrays since VS2008 can't cope with them :-(
This changes _cogl_path_fill_nodes_scanlines to use g_alloca instead of
using a variable to declare an array length.
2009-11-27 15:24:09 +00:00
Robert Bragg
47db7af4d3 picking: avoid redundant picking geometry for the stage.
The stage's pick id can be written to the framebuffer when we call
cogl_clear so there's no need for the stage to also chain up in it's pick
function resulting in clutter-actor.c also emitting a rectangle for the
stage.
2009-11-27 00:43:57 +00:00
Robert Bragg
c12470666e tests: rename cogl conformance tests so they can be clearly identified
All Cogl conformance tests are now prefixed 'test-cogl-'
2009-11-27 00:28:39 +00:00
Robert Bragg
439f8c62b0 cogl: deprecate cogl_draw_buffer API and replace with a cogl_framebuffer API
cogl_push_draw_buffer, cogl_set_draw_buffer and cogl_pop_draw_buffer are now
deprecated and new code should use the new cogl_framebuffer_* API instead.

Code that previously did:
    cogl_push_draw_buffer ();
    cogl_set_draw_buffer (COGL_OFFSCREEN_BUFFER, buffer);
    /* draw */
    cogl_pop_draw_buffer ();
should now be re-written as:
    cogl_push_framebuffer (buffer);
    /* draw */
    cogl_pop_framebuffer ();

As can be seen from the example above the rename has been used as an
opportunity to remove the redundant target argument from
cogl_set_draw_buffer; it now only takes one call to redirect to an offscreen
buffer, and finally the term framebuffer may be a bit more familiar to
anyone coming from an OpenGL background.
2009-11-26 19:33:14 +00:00
Robert Bragg
b598210e01 cogl_offscreen: deprecate cogl_offscreen_ref/unref.
New code should use cogl_handle_ref/unref
2009-11-26 19:33:13 +00:00
Neil Roberts
e12a691187 cogl: Use a vtable for the texture backends instead of a type and switch
Instead of storing an enum with the backend type for each texture and
then using a switch statement to decide which function to call, we
should store pointers to all of the functions in a struct and have
each texture point to that struct. This is potentially slightly faster
when there are more backends and it makes implementing new backends
easier because it's more obvious which functions have to be
implemented.
2009-11-25 13:47:28 +00:00
Robert Bragg
558b17ee1e offscreen: cogl_offscreen_new_to_texture now supports GL_TEXTURE_RECTANGLE_ARB
cogl_offscreen_new_to_texture previously bailed out if the given texture's
GL target was anything but GL_TEXTURE_2D, but it now also allows
foreign GL_TEXTURE_RECTANGLE_ARB textures.

Thanks to Owen for reporting this issue, ref:
https://bugzilla.gnome.org/show_bug.cgi?id=601032
2009-11-25 02:56:25 +00:00
Robert Bragg
d3a01e0c96 debug: remove the COGL_DEBUG=client-side-matrices option
Cogl only supports client side matrices so this debug option is no longer
useful.
2009-11-25 02:55:56 +00:00