Commit Graph

640 Commits

Author SHA1 Message Date
Elliot Smith
e45b8be71b cookbook: Fix key press to examine modifers correctly
The simple key press example in the cookbook used a brittle
and incorrect switch statement to test modifier values. Instead,
use logical "&" of the state with the modifiers we're interested
in to check which keys were pressed.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2223
2010-07-19 14:45:37 +01:00
Emmanuele Bassi
5865d2a4b3 cookbook: Use TESTS_DATA_DIR
We need the correct location for redhand.png if we want to load it
in textures-reflection.
2010-07-18 22:53:56 +01:00
Emmanuele Bassi
dc19e26073 cookbook: Add image and example for text-shadow 2010-07-18 11:20:44 +01:00
Emmanuele Bassi
0dac5e0557 cookbook: Include the textures-reflection example code
Add a section at the end of the recipe containing the full code of the
example.
2010-07-18 11:15:25 +01:00
Emmanuele Bassi
90b74458d2 cookbook: Add an empty recipe for shadows under text
Currently, it's just an example and an image, but it should be easy to
flesh it out properly for the "Text" chapter.
2010-07-18 10:56:35 +01:00
Emmanuele Bassi
bb3dc013bf cookbook: Add example code
The cookbook should also include fully functional code examples. We can
even XInclude them into the docbook XML itself.

The examples should be built with the coobook, so that we can always
make sure they are up to date.
2010-07-18 10:53:06 +01:00
Emmanuele Bassi
6f220399ae cookbook: Use the right tag for the screenshot
Screenshots should be using the <screenshot> tag, not the <figure> one.
2010-07-16 17:31:27 +01:00
Emmanuele Bassi
71dfdf92d7 Merge remote branch 'elliot/cookbook-actor-opacity'
Conflicts:
	doc/cookbook/Makefile.am
2010-07-16 17:23:36 +01:00
Emmanuele Bassi
af6f023a80 cookbook: Add a missing image to the list 2010-07-16 17:20:38 +01:00
Emmanuele Bassi
e92c8d72cc Merge remote branch 'elliot/cookbook-include-videos'
* elliot/cookbook-include-videos:
  cookbook: Tweak so that videos sit inside a paragraph for better spacing
  docs: Note the P_() macro in the HACKING file
  cookbook: Added support for inline video

Conflicts:
	doc/cookbook/Makefile.am
2010-07-16 17:13:12 +01:00
Emmanuele Bassi
ad1613a936 Merge remote branch 'elliot/cookbook-animation-fading'
* elliot/cookbook-animation-fading:
  cookbook: Minor modification to wording to improve clarity
  cookbook: Added recipe for fading actors in/out
2010-07-16 17:12:37 +01:00
Emmanuele Bassi
4170eacd94 cookbook: Add a recipe for texture reflection
A common request: how to create a clone of a texture that looks like a
reflection.
2010-07-16 17:04:31 +01:00
Elliot Smith
7be6ed3334 cookbook: Added a recipe about making an actor transparent
Explains how to make an actor transparent so that other actors
are visible through it.

Also explains a bit more generally about opacity and how
it's computed from the actor, container, and color; and how actor
visibility is affected by depth (fog) and depth order.
2010-07-16 15:34:09 +01:00
Elliot Smith
da22150498 cookbook: Minor modification to wording to improve clarity
Text referred to three animation methods, but only provides
examples for two of them; and in future there may be more/fewer
than 3. So I reworded it.
2010-07-16 12:48:56 +01:00
Elliot Smith
962b3c6885 cookbook: Added recipe for fading actors in/out
Added a recipe showing how to fade actors in/out by
animating their opacity property, using both implicit
animations and ClutterState.
2010-07-16 12:44:39 +01:00
Emmanuele Bassi
3aa3893a11 docbook: Add an introduction to the texture section 2010-07-16 12:01:42 +01:00
Elliot Smith
489799bb4d cookbook: Tweak so that videos sit inside a paragraph for better spacing 2010-07-15 17:31:10 +01:00
Emmanuele Bassi
ec7b0b4389 docs: Note the P_() macro in the HACKING file 2010-07-15 17:31:10 +01:00
Elliot Smith
1d9c64ff16 cookbook: Added support for inline video
Amended Makefile to copy content of videos directory into
installation directories. Also copies videos and images
into the html/ directory during the build, so that the
built cookbook can be viewed locally (for testing without
having to install).

Added an XSLT template to transform Docbook <inlinemediaobject>
elements into HTML 5 <video> elements, with a fallback to
link to the video displayed for browsers without HTML 5 support.

Added note to "Contributing" appendix explaining how to put
video into a recipe.
2010-07-15 17:31:10 +01:00
Emmanuele Bassi
fae35f8411 docs: Note the P_() macro in the HACKING file 2010-07-15 14:26:16 +01:00
Emmanuele Bassi
0cbfabcda4 stage: Add the NO_CLEAR_ON_PAINT hint
Some apps or some use cases don't need to clear the stage on immediate
rendering GPUs. A media player playing a fullscreen video or a
tile-based game, for instance.

These apps are redrawing the whole screen, so we can avoid clearing the
color buffer when preparing to paint the stage, since there is no
blending with the stage color being performed.

We can add an private set of hints to ClutterStage, and expose accessors
for each potential hint; the first hint is the 'no-clear' one.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2058
2010-07-13 14:57:48 +01:00
Neil Roberts
984e04cae8 Make the material functions for setting the p wrap mode public
Now that we have 3D texture support it makes sense to expose the wrap
mode for the p coordinate.
2010-07-13 14:29:07 +01:00
Neil Roberts
dfea57b45a Add a Cogl texture 3D backend
This adds a publicly exposed experimental API for a 3D texture
backend. There is a feature flag which can be checked for whether 3D
textures are supported. Although we require OpenGL 1.2 which has 3D
textures in core, GLES only provides them through an extension so the
feature can be used to detect that.

The textures can be created with one of two new API functions :-

cogl_texture_3d_new_with_size

 and

cogl_texture_3d_new_from_data

There is also internally a new_from_bitmap function. new_from_data is
implemented in terms of this function.

The two constructors are effectively the only way to upload data to a
3D texture. It does not work to call glTexImage2D with the
GL_TEXTURE_3D target so the virtual for cogl_texture_set_region does
nothing. It would be possible to make cogl_texture_get_data do
something sensible like returning all of the images as a single long
image but this is not currently implemented and instead the virtual
just always fails. We may want to add API specific to the 3D texture
backend to get and set a sub region of the texture.

All of those three functions can throw a GError. This will happen if
the GPU does not support 3D textures or it does not support NPOTs and
an NPOT size is requested. It will also fail if the FBO extension is
not supported and the COGL_TEXTURE_NO_AUTO_MIPMAP flag is not
given. This could be avoided by copying the code for the
GL_GENERATE_MIPMAP TexParameter fallback, but in the interests of
keeping the code simple this is not yet done.

This adds a couple of functions to cogl-texture-driver for uploading
3D data and querying the 3D proxy
texture. prep_gl_for_pixels_upload_full now also takes sets the
GL_UNPACK_IMAGE_HEIGHT parameter so that 3D textures can have padding
between the images. Whenever 3D texture is uploading, both the height
of the images and the height of all of the data is specified (either
explicitly or implicilty from the CoglBitmap) so that the image height
can be deduced by dividing by the depth.
2010-07-13 14:28:52 +01:00
Neil Roberts
8940c30681 Make a public CoglBitmapError enum
There are many places in the texture backend that need to do
conversion using the CoglBitmap code. Currently none of these
functions can throw an error but they do return a value to indicate
failure. In future it would make sense if new texture functions could
throw an error and in that case they would want to use a CoglBitmap
error if the failure was due to the conversion. This moves the
internal CoglBitmap error from the quartz backend to be public in
cogl-bitmap.h so that it can be used in this way.
2010-07-13 14:28:45 +01:00
Emmanuele Bassi
1eec056bfd Merge remote branch 'elliot/cookbook-animation-inversion'
* elliot/cookbook-animation-inversion:
  cookbook: Fixed invalid XML tag
  cookbook: Added "inverting an animation" recipe
  docs: Enabled animation section
2010-07-12 21:25:25 +01:00
Emmanuele Bassi
e2a553da86 Merge remote branch 'elliot/cookbook-animation-intro'
* elliot/cookbook-animation-intro:
  cookbook: Added introduction for animations section
  docs: Enabled animation section
2010-07-12 21:25:22 +01:00
Emmanuele Bassi
2de61da296 Merge remote branch 'elliot/cookbook-consistency'
* elliot/cookbook-consistency:
  cookbook: Fixed typo
  cookbook: Fix build so CSS files get installed
  cookbook: Moved paragraph where it logically belongs
  cookbook: Added some judicious note elements
  cookbook: Added more information for contributors
  cookbook: Link out to docbook site
  cookbook: Made docbook element usage consistent
  cookbook: Additional selectors in CSS stylesheet
  cookbook: Copy the CSS file into the HTML build directory
2010-07-12 21:20:30 +01:00
Elliot Smith
97ac28ee48 cookbook: Added introduction for animations section
Introduces basic concepts (timelines, alphas, frames)
common to different parts of the Clutter animation API.

Gives a high level overview of the three different
approaches to animation (implicit, ClutterAnimator,
ClutterState).
2010-07-12 17:15:16 +01:00
Elliot Smith
295a043194 docs: Enabled animation section 2010-07-12 17:09:03 +01:00
Elliot Smith
9d96c21de6 cookbook: Fixed invalid XML tag 2010-07-12 16:59:38 +01:00
Elliot Smith
6a443a0cd3 cookbook: Added "inverting an animation" recipe
Added a new recipe (based on the skeleton in the
animations section of the cookbook) about inverting
an animation by reversing the direction of its timeline.

Uses clutter_actor_animate() as the basic approach,
but mentions ClutterState and ClutterAnimator as well.
2010-07-12 15:45:49 +01:00
Elliot Smith
bfb51adf97 docs: Enabled animation section 2010-07-12 15:45:46 +01:00
Neil Roberts
0e839c3769 Add cogl_vertex_buffer_is_indices to the public headers
This function has always been defined in the shared library but it was
missed from the public headers.
2010-07-09 18:57:54 +01:00
Neil Roberts
ab05f6bfb1 cogl-material: Add support for point sprites
This adds a new API call to enable point sprite coordinate generation
for a material layer:

void
cogl_material_set_layer_point_sprite_coords_enabled (CoglHandle material,
                                                     int layer_index,
                                                     gboolean enable);

There is also a corresponding get function.

Enabling point sprite coords simply sets the GL_COORD_REPLACE of the
GL_POINT_SPRITE glTexEnv when flusing the material. There is no
separate application control for glEnable(GL_POINT_SPRITE). Instead it
is left permanently enabled under the assumption that it has no affect
unless GL_COORD_REPLACE is enabled for a texture unit.

http://bugzilla.openedhand.com/show_bug.cgi?id=2047
2010-07-08 16:34:30 +01:00
Neil Roberts
73642ac9c4 cogl-material: Add a property for setting the point size
This adds cogl_material_{get,set}_point_size. If the point size is not
1.0f then glPointSize will be called when the material is flushed.

http://bugzilla.openedhand.com/show_bug.cgi?id=2047
2010-07-08 16:34:30 +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
Alejandro Piñeiro
a2f8ce175f cally: Improving cally doc
* Add documentation for all undocumented symbols
  * Add an overview section
2010-07-07 15:48:08 +02:00
Elliot Smith
9e5a18fea4 cookbook: Fixed typo
Removed stray 'd' character.
2010-07-06 17:20:43 +01:00
Elliot Smith
7c67903a44 cookbook: Fix build so CSS files get installed
I had changed the build so CSS files get put into
the HTML build directory; but done it in such
a way that they were then being ignored during
install. Fixed this.
2010-07-06 17:20:39 +01:00
Elliot Smith
e566c56bd1 cookbook: Moved paragraph where it logically belongs
There was a note about constants for keys and
where they are defined in Clutter header files; but
the sentence about where key modifiers are defined
was outside the note. Logically, they belong
together.
2010-07-06 17:20:34 +01:00
Elliot Smith
03b19af38e cookbook: Added some judicious note elements
In some cases, there were blocks of text which
were really asides/interrupts to the flow, but
which weren't explicitly marked as such. I fixed
them by turning them into <note> blocks.
2010-07-06 17:20:25 +01:00
Elliot Smith
9a609cf629 cookbook: Added more information for contributors
Suggested use of <note> element for adding detail
or asides which would otherwise interrupt the
flow of the recipe.
2010-07-06 17:20:21 +01:00
Elliot Smith
15331d3a01 cookbook: Link out to docbook site
Corrected the link on the word Docbook, as it
was an internal <link> rather than an external
<ulink>.
2010-07-06 17:20:16 +01:00
Elliot Smith
c108a32c30 cookbook: Made docbook element usage consistent
Made usage of docbook elements consistent across
recipes; to ensure the conventions are kept by others,
added a section about how to write and style recipes.
2010-07-06 17:20:09 +01:00
Elliot Smith
fe7385cb7d cookbook: Additional selectors in CSS stylesheet
Added some selectors for docbook element types
[properties and types], so those elements can be used in recipes
2010-07-06 17:20:02 +01:00
Elliot Smith
dfe7c554fd cookbook: Copy the CSS file into the HTML build directory
This makes local testing easier, as you can see what the
cookbook will look like when installed.
2010-07-06 17:19:56 +01:00
Øyvind Kolås
ec05230b97 state: added clutter_state_key_get_property_type
A function to retrieve the type of the value stored in a key, the
equivalent already exists for ClutterAnimator.
2010-07-06 14:14:34 +01:00
Emmanuele Bassi
09c6553f0d cally: Clean up the headers
Make Cally follow the single-include header file policy of Clutter and
Cogl; this means making cally.h the single include header, and requires
a new cally-main.h file for the functions defined by cally.h.

Also:

  • clean up the licensing notice and remove the FSF address;

  • document the object structures (instance and class);

  • G_GNUC_CONST-ify the get_type() functions;

  • reduce the padding for CallyActor sub-classes;

  • reduce the amount of headers included.
2010-07-05 16:45:43 +01:00