1
0
Fork 0
Commit graph

1747 commits

Author SHA1 Message Date
Robert Bragg
462c45da3c [cogl-material] Some improvements for how we sync CoglMaterial state with OpenGL
This flattens the three functions: cogl_material_flush_gl_material_state,
.._flush_gl_alpha_func and .._flush_gl_blend_func into one:
cogl_flush_material_gl_state which doesn't takes a material handle. (the handle
is instead taken from the context.)

This has allows us to avoid re-submitting some state to OpenGL when the
material has not been replaced.

Note: Avoiding redundant state changes for material layers isn't dealt with
in this patch.
2008-12-24 01:33:23 +00:00
Robert Bragg
4e57972bd6 [cogl-material] Converts clutter-texture/clutter-clone-texture to the material API
This converts clutter-texture to use the new CoglMaterial API instead of
cogl_texture_rectangle.

This change does not add multi-texturing support to Clutter, it's more about
aiming to deprecate cogl_texture_rectangle, and moving everything over to the
cogl_set_source(material); cogl_draw_somthing(); coding pattern.

With this patch, the code can be built with/without CoglMaterial support so we
can do comparisons of the old/new code for a transient period. (look for the
USE_COGL_MATERIAL define)

Note: The FBO paths haven't currently been tested, so they may need some
tweaks.
2008-12-24 01:31:00 +00:00
Robert Bragg
bb938ac4ff Merge branch 'master' into cogl-material
Conflicts:

	clutter/cogl/gl/cogl-context.c
	clutter/cogl/gl/cogl-context.h
2008-12-24 00:59:13 +00:00
Robert Bragg
cb569a5443 White space clean up across a number of files (only removing trailing spaces)
Removed trailing white space from the following files:
- clutter-clone-texture.c
- clutter-texture.c
- clutter-texture.h
- cogl/cogl-texture.h
- cogl/gl/cogl-context.c
- cogl/gl/cogl-texture.c
- cogl/gl/cogl-context.h
2008-12-24 00:48:32 +00:00
Emmanuele Bassi
c9cdf1ef0a Fix an empty block
Remove a stray ';' that prevented the get_bounds() method of the
ClutterBehaviourRotate to correctly return the start angle value.
2008-12-23 20:55:35 +00:00
Emmanuele Bassi
f777bc629a [docs] Document the newly added functions
Document the ClutterBackend font name accessors, and the
clutter_actor_get_pango_context() getter method.
2008-12-23 16:59:14 +00:00
Emmanuele Bassi
9389d9755d Add the ability to set the text direction
The direction of the text depends on the locale, and it is the
basic setting needed to enable internationalization of user
interfaces.

This commit allows setting the direction of the PangoContext instance
used by Clutter by using the CLUTTER_TEXT_DIRECTION environment
variable, or by passing the --clutter-text-direction command line
argument. Valid values are:

        ltr     - for left-to-right locales
        rtl     - for right-to-left locales

The default is LTR.

Ideally, this should be a value set by the localization teams on the
PO file, but this step requires some build system surgery to allow
the translation of the Clutter strings.
2008-12-23 16:40:26 +00:00
Emmanuele Bassi
b4a3944b2b Return the default font name if no font name is set
When calling clutter_backend_get_font_name(), if no default font
name has previously been set, we just set the default and return
a pointer to it - like we do for the font options.
2008-12-23 16:27:54 +00:00
Emmanuele Bassi
e3785f4f45 Use the default font from the Backend
Instead of storing the default font name and size as a pre-processor
macro, use the newly added ClutterBackend API to retrieve the current
default font from the backend.
2008-12-23 15:05:16 +00:00
Emmanuele Bassi
7262542155 Store the default font name inside ClutterBackend
The default backend stores some of the global defaults, like the
font options, text resolution, double click settings. It should also
store the default font name, to allow various text-based actors to
share the same settings.

When the font name changes, the ::font-changed signal is emitted,
to allow actors to pick up the change.
2008-12-23 15:03:11 +00:00
Emmanuele Bassi
977bdcf89b Update the PangoContext on backend changes
When the ClutterBackend notifies of changes in the resolution or
font options, update the PangoContext stored by Clutter's main
context. This allows changing the backend font-related settings at
runtime.
2008-12-23 14:34:16 +00:00
Emmanuele Bassi
213d8f0e4e Store the PangoContext inside the main context
The PangoContext should be stored once, and inside the main
Clutter context. Each actor for which clutter_actor_get_pango_context()
has been called will hold a reference on the Pango context as well.

This makes it possible to update the text rendering for Clutter
by using only public API.
2008-12-23 14:27:41 +00:00
Emmanuele Bassi
61d47ee301 Do not leak the PangoContext
We hold a reference on the PangoContext we use for an actor, so
we should remove the reference inside the dispose implementation.
2008-12-23 14:15:10 +00:00
Emmanuele Bassi
a865a5d4ea Create the PangoContext of the Text actor
Instead of creating a single, private PangoContext for every
Text actor, use the newly added clutter_actor_get_pango_context()
function.
2008-12-23 14:11:27 +00:00
Emmanuele Bassi
78628edf2f Add a per-actor PangoContext
Rendering text inside an actor is pretty much impossible without
using internal API to create the various pieces like the PangoContext
and the font map.

Each actor should have the ability to create a PangoContext, which
is the only object needed to generate layouts and change the various
Pango settings.

This commit adds a clutter_actor_get_pango_context() function that
creates a PangoContext inside the ClutterActor private data and allows
the creation of PangoLayouts when needed. If the actor already
has a PangoContext, the same instance is returned.

The PangoContext is created only on demand.
2008-12-23 14:06:55 +00:00
Emmanuele Bassi
b8b8b155c4 Add signals for Backend options
The ClutterBackend instance at the moment lacks the ability to
notify runtime changes of the font options and the resolution.

For this reason, this commit adds a ::resolution-changed and a
::font-changed signals to the Backend class.

The ::resolution-changed signal is emitted when set_resolution()
is called with a different DPI; ::font-changed is emitted when the
cairo_font_options_t* changes from the default.
2008-12-23 13:55:51 +00:00
Robert Bragg
aee2589cc6 [doc] Hooks up cogl-material reference documentation
Adds some more gtk-doc comments to cogl-material.h, and adds a new section to
cogl-sections.txt
2008-12-22 16:35:52 +00:00
Robert Bragg
eb3b48e9ff Updates previous GLES multi-texturing code to use CoglMaterial
test-cogl-material now runs on GLES 1 using the PVR GLES1 SDK (though since
only 2 texture units are supported the third rotating light map doesn't show)

Note: It currently doesn't build for GLES 2.0
2008-12-22 16:35:52 +00:00
Robert Bragg
40b0bb4e95 Adds a CoglMaterial abstraction, which includes support for multi-texturing
My previous work to provide muti-texturing support has been extended into
a CoglMaterial abstraction that adds control over the texture combine
functions (controlling how multiple texture layers are blended together),
the gl blend function (used for blending the final primitive with the
framebuffer), the alpha function (used to discard fragments based on
their alpha channel), describing attributes such as a diffuse, ambient and
specular color (for use with the standard OpenGL lighting model), and
per layer rotations. (utilizing the new CoglMatrix utility API)

For now the only way this abstraction is exposed is via a new
cogl_material_rectangle function, that is similar to cogl_texture_rectangle
but doesn't take a texture handle (the source material is pulled from
the context), and the array of texture coordinates is extended to be able
to supply coordinates for each layer.

Note: this function doesn't support sliced textures; supporting sliced
textures is a non trivial problem, considering the ability to rotate layers.
Note: cogl_material_rectangle, has quite a few workarounds, for a number of
other limitations within Cogl a.t.m.
Note: The GLES1/2 multi-texturing support has yet to be updated to use
the material abstraction.
2008-12-22 16:35:52 +00:00
Robert Bragg
63047e1907 [doc] Hooks up cogl-matrix reference documentation
Adds a few more gtk-doc notes to cogl-matrix.h, and adds a new section to
cogl-sections.txt
2008-12-22 16:35:52 +00:00
Robert Bragg
fa8d6dc69b Adds CoglMatrix utility code 2008-12-22 16:35:52 +00:00
Robert Bragg
ea643ca0f8 [multi-texturing] This adds a new cogl_multi_texture API for GL,GLES1 + GLES2
Multitexturing allows blending multiple layers of texture data when texturing
some geometry. A common use is for pre-baked light maps which can give nice
lighting effects relativly cheaply. Another is for dot-3 bump mapping, and
another is applying alpha channel masks.

The dot-3 bump mapping would be really nice one day, but currently cogl doesn't
support lighting so that's not dealt with in this patch.

notable limitations:
- It can only texture rectangles a.t.m - and like cogl_texture_rectangle there
is no support for rotated texturing.
- Sliced textures are not supported. I think I've figured out how to handle
layers with different slice sizes at least for rectangular geometry, but I'm
not sure how complex it becomes once rotations are possible and texturing
arbitrary cogl_polygons.
- Except for this new API, cogl still doesn't know about more than one texture
unit, and so has no way of caching any enables related to other units. So that
things don't break it's currently necessary to disable anything to do with
additional units as soon as we are done with them which isn't ideal.
- No clutter API yet.
2008-12-22 16:35:51 +00:00
Emmanuele Bassi
b021f518c1 Use "" as the default value for the :text property
This follows the convention of GtkLabel/GtkEntry in GTK+ and the old
ClutterEntry.

It makes it easier to use strlen/strcmp etc on the output, since we can
assume that it is always a string.

This commit also updates the test unit for ClutterText to verify that
the clutter_text_get_text() function also returns an empty string when
a ClutterText actor has been created.
2008-12-22 13:43:41 +00:00
Emmanuele Bassi
4a934c363c Do not include cogl-pango.h multiple times
The clutter-private.h header already includes cogl-pango.h with
the correct inclusion path, because the main context stores a
pointer to the font map.

There is no need for clutter-text.c to include cogl-pango.h
again since it already includes clutter-private.h.
2008-12-22 13:24:52 +00:00
Owen Taylor
6a980793c6 Return something reasonable from clutter_x11_handle_event()
Instead of returning CLUTTER_X11_FILTER_CONTINUE always from
clutter_x11_handle_event() return CLUTTER_X11_FILTER_REMOVE if
the event was on a stage and translated to a ClutterEvent.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2008-12-22 13:11:59 +00:00
Robert Bragg
3a6ffe3b7d [build] Replaces use of #include <cairo/cairo.h> with #include <cairo.h>
The cairo pkg-config is crafted such that #include <cairo.h> should be used.
If building with a private build of cairo installed to a custom prefix
<cairo/cairo.h> can cause an un-intended cairo header to be picked up during
compilation due to /usr/include being in the header search path.
2008-12-21 21:52:50 +00:00
Emmanuele Bassi
4e493d1937 Avoid masking math.h exported variables
Our beloved math.h exports, from bits/mathcalls.h, a bare "y1" symbol.
Apparently, it's unthinkable for code including <math.h> to also declare
arguments or variable named "y0", "y1" and "yn".

Anyway, the quick fix already used elsewhere in Clutter's codebase is
to rename the colliding variables "y_0", "y_1" and "y_n" - and
obviously everything similar to them as well, using the same pattern.
2008-12-19 18:21:36 +00:00
Emmanuele Bassi
c93cd4a096 [docs] Documentation fixes for CairoTexture
Sync up the arguments name inside the gtk-doc annotations with their
name inside the function declaration in the header file.
2008-12-19 17:48:30 +00:00
Emmanuele Bassi
2f23003425 Whitespace fixes
Let's try to honour the coding style document, now that we have one.
2008-12-19 17:44:24 +00:00
Emmanuele Bassi
81541e6940 [docs] Parameter naming fixes
The name of the parameter in the header and the one in the gtk-doc
annotation on top of a function must match.

Unfortunately, there is an index() function declared inside strings.h
which makes gcc complain for the "index" argument as soon as we
enable the extra compiler flags we use when distchecking.

Hence, we need to rename "index" to "index_" in the header and in
the source files.
2008-12-19 17:41:44 +00:00
Emmanuele Bassi
8d98c28dfa Merge branch 'cairo-texture'
* cairo-texture:
  [cairo-texture] Remove the construct only restriction on surface size
  [cairo-texture] Silently discard 0x0 surfaces
  Re-indent ClutterPath header
  Add a test case for the new cairo path functions
  Add clutter_path_to_cairo_path and clutter_path_add_cairo_path
  Warn instead of returning in the IN_PAINT check
  Small documentation fixes
  Print a warning when creating a cairo_t while painting
  Do not set the IN_PAINT flag inside the Stage paint
  Set the IN_PAINT private flag
  [docs] Add ClutterCairoTexture to the API reference
  Add ClutterCairoTexture
  Require Cairo as a Clutter dependency

Conflicts:

  Fix merge conflict in clutter/clutter-path.h
2008-12-19 16:44:40 +00:00
Neil Roberts
64de0411ea [cairo-texture] Remove the construct only restriction on surface size
It is possible to change the surface size after construction with
clutter_cairo_texture_set_surface_size so it doesn't seem right to
restrict changing the properties.

clutter_cairo_texture_resize_surface_internal is called in a handler
for the notify signal. It is called there rather than directly in the
set_property handler so that changing both properties in a single
g_object_set will only cause one resize. The constructed override is
no longer needed.

resize_surface_internal will now bail out if the size of the surface
is already the right size.
2008-12-19 15:35:14 +00:00
Emmanuele Bassi
cf5d69139d [texture] Do not mix fixed point and units values
Like we did for ClutterActor in commit cdb78ec4, fix ClutterTexture
usage of CoglFixed and ClutterUnit values without conversion between
the two types.
2008-12-19 13:42:17 +00:00
Emmanuele Bassi
cdb78ec4d2 [units] Do not use fixed point and units interchangeably
Clutter units are, at the moment, implemented as a value in fixed point
notation using the same format as CoglFixed. This is, though, an
implementation detail. For this reason, units should not be treated as
CoglFixed values and should be converted to and from fixed point using
the provided macros.

This commit updates the usage of units and fixed point values in
ClutterActor and rationalises some of the transformation code that
heavily relied on the equivalency between them.
2008-12-19 12:53:57 +00:00
Robert Bragg
5e0daa8ecd Improves tfp performance on Nvidia
Some drivers (e.g. Nvidia) get upset if you try to create multiple glx pixmaps
for the same server side pixmap object, even though you might have unique
client side names, we now avoid hitting this problem by destroying the current
glx pixmap early within clutter_glx_texture_pixmap_create_glx_pixmap.
2008-12-18 17:54:35 +00:00
Neil Roberts
4168ed09de Fix calculation in clutter_cubic_bezier
The calculation for cubic bezier curves had an extra multiplication by
3 which was causing the curve to go over 1.0 very quickly. This had
the affect of making test-animation appear to complete much before the
completed signal is emitted.
2008-12-18 12:20:46 +00:00
Neil Roberts
2bf815131a [clutter-interval] Fix calculation of interval for unsigned types
The patch makes it cast to double before subtracting the original
value from the target value. Otherwise if the target value is less
than the original value then the subtraction will overflow and the
factor will be multiplied by a very large number instead of the
desired interval.

The problem is demonstrable using the border-width property of
ClutterRectangle.
2008-12-17 19:26:24 +00:00
Emmanuele Bassi
e130e0c9b3 [cairo-texture] Silently discard 0x0 surfaces
The current CairoTexture can be created with a surface size of 0
by 0 pixels, but a warning will be printed.

Worse, the surface can be resized to be 0 by 0 pixels without a
warning. The :surface-width and :surface-height properties accept
a minimum value of 0, and not check is performed on either the
constructor or set_surface_size() parameters to enforce the "greater
than zero" rule.

The correct and consistent behaviour is to allow a 0 by 0 pixels
surface size everywhere; inside surface_resize_internal(), the
current surface will be destroyed and if either :surface-width or
:surface-height are set to 0, the resizing terminates.

Attempting to create a Cairo context from a CairoTexture with
either :surface-width or :surface-height set to 0 will result in
a warning.

This allows:

  - creating a CairoTexture with :surface-width or :surface-height
    set to zero and delaying the surface resize at a later point;
  - resizing the surface to 0 by 0 pixels to destroy the image
    surface used internally;
  - increase the consistency in the usage of CairoTexture.
2008-12-17 15:58:11 +00:00
Neil Roberts
140e4e1be2 Minor fix to documentation for clutter_actor_get_anchor_point
In both versions of clutter_actor_get_anchor_point the description of
the @anchor_y parameter was slightly wrong in different ways.
2008-12-17 15:05:08 +00:00
Emmanuele Bassi
6b782ce4e7 Fix the selection behaviour around the 0th glyph
After fixing the cursor position issues around the initial
glyph of the layout, the selection position needs fixing as
well.

The fix is similar: check if the position of the selection
is 0 and provide a fast path by setting the offset to 0.
2008-12-16 15:53:57 +00:00
Neil Roberts
ff92cc9766 Convert clutter_path_get_position to take a gdouble instead of an alpha value
The gdouble value represents an interval along the path from 0.0 to
1.0. This makes more sense than using an alpha value because paths are
not directly related to ClutterAlphas and the rest of the Clutter API
tends to expose gdouble arguments.
2008-12-16 15:39:53 +00:00
Emmanuele Bassi
a3fbdb5949 Add ClutterText::set_selection()
The clutter_text_set_selection() function is a convenience
method for setting the cursor position and the selection
boundary to a given position in a single call, with sanity
checks for the positions.
2008-12-16 12:41:20 +00:00
Emmanuele Bassi
2209e17432 Fix ClutterText::get_selection()
The clutter_text_get_selection() function was not checking the
passed argument, and was still accessing the contents of the
Text actor using clutter_text_get_text().

This commit also adds the last few gtk-doc annotations missing
from ClutterText.
2008-12-16 12:25:45 +00:00
Emmanuele Bassi
e28fb9ae10 [docs] Add more gtk-doc annotations
Almost reaching full documentation.
2008-12-16 12:25:15 +00:00
Emmanuele Bassi
4a43b582ac Use clutter_text_activate()
Instead of repeating the same code for the ::activate signal
emission, use the clutter_text_activate() function inside the
'activate' key binding handler.
2008-12-16 12:05:10 +00:00
Emmanuele Bassi
93d96dca52 Add ClutterText::activate()
The clutter_text_activate() function will emit the ::activate
signal if the :activatable property is set.

This function is useful for subclasses or application code, for
example if we are going to use ::captured-event or ::key-press-event
signal handlers to intercept the Return key and emit the ::activate
signal ourselves.
2008-12-16 12:02:58 +00:00
Emmanuele Bassi
87f38475ae [docs] Add more gtk-doc annotations for ClutterText
Document the ClutterText constructors and the :editable, :selectable
and :activatable properties accessors.
2008-12-16 11:52:57 +00:00
Emmanuele Bassi
e3ba2ddf0a [docs] Annotate properties and fix signals docs
Annotate the properties without gtk-doc description, to get the
"Since" attribute.

Also, fix the ::cursor-event and ::activate signals documentation.
2008-12-16 11:30:47 +00:00
Emmanuele Bassi
7ebb9ff6b7 Allow selecting with line-start and line-end bindings
Instead of installing the line-start and line-end key bindings
using the bare ClutterBindingPool API, we can use the internal
clutter_text_add_move_binding(), which automatically installs
the same key binding with the Shift modifier mask.

This allows selecting when pressing Shift+Home or Shift+End.

The selection behaviour is still incorrect around the zeroeth
position, with all the text after the first line being selected.
2008-12-16 10:39:52 +00:00
Emmanuele Bassi
ea5a6abd9d Add :cursor-size property to ClutterText
We can control the width of the cursor when painting by using
a simple property.

The magic -1 number passed to the setter method will reset the
cursor size to the default one of 2px.

The getter method will return an unsigned integer with the
current size.
2008-12-16 10:37:45 +00:00
Emmanuele Bassi
ffb500d3a6 Remove unused page up/down key bindings
Moving the text by a "page" depends on being able to define a
"page size" in terms of lines of text. Since we don't define
something similar to an Adjustment that allows us to handle this
behaviour, we should defer the paging implementation to a higher
level class based on ClutterText.
2008-12-16 10:19:56 +00:00
Emmanuele Bassi
dc49dab350 Fix line start and line end key binding behaviour
Another fix for the key navigation behaviour around the zeroeth
glyph in the layout.

This commit adds a fast path for for the zero index when the
cursor position is set as zero, in case we are using the line-start
or line-end key bindings, similarly to what we did in commit
be64cbcdc2 for the move-up and
move-down bindings.
2008-12-16 10:15:57 +00:00
Emmanuele Bassi
be64cbcdc2 Fix up/down key navigation
The behaviour of ClutterText around the initial position is still
a little bit erratic.

This commit fixes the key navigation with Up and Down arrows around
the first line of text.
2008-12-15 18:46:08 +00:00
Emmanuele Bassi
e615b8cc6b Use units in position_to_coords()
We loose precision with a direct conversion for PangoUnits to
pixels, so we should do the conversion as needed, inside the
callers of clutter_text_position_to_coords().
2008-12-15 18:24:42 +00:00
Emmanuele Bassi
2714397fd5 Constify the cursor geometry in ::cursor-event
We don't allow changing the cursor geometry inside the ::cursor-event
signal handlers; for starters, it would make binding the signal a
huge mess, and it would also potentially break the whole actor.
2008-12-15 18:23:25 +00:00
Emmanuele Bassi
2d166b250c [docs] Add annotations for ClutterText structures
ClutterText and ClutterTextClass were missing annotations for
gtk-doc to pick up.
2008-12-15 15:10:55 +00:00
Emmanuele Bassi
39b575e6b4 Remove ClutterLabel and ClutterEntry
Both ClutterLabel and ClutterEntry have been deprecated by
ClutterText.
2008-12-15 15:08:12 +00:00
Emmanuele Bassi
ca310d49ca Re-indent ClutterPath header
Match the indentation and style of the other Clutter headers.
2008-12-15 15:00:37 +00:00
Emmanuele Bassi
f6feed4386 Fix a typo in the ClutterParamSpecFixed declaration
The ClutterParamSpecFixed constructor is declared in the header
as taking ClutterFixed values, but the implementation takes
ClutterUnit values instead. This obviously works because fixed
and units are exactly the same type.

This commit fixes the wrong parameters.
2008-12-15 14:29:59 +00:00
Emmanuele Bassi
b2f4363d95 Remove a double semi-colon typo
Fixes bug 1351 - Extra ; in clutter-behaviour-ellipse.c

Thanks to Haakon Sporsheim.
2008-12-13 11:53:03 +00:00
Neil Roberts
4e0073cd50 Fix the gtk-doc for some properties in ClutterActor
Some of the properties were specified as ClutterActor::property (with
two colons) but gtk-doc expects one colon so the documentation is not
parsed.
2008-12-12 22:47:46 +00:00
Neil Roberts
cd1992181c Fix the definition of clutter_actor_set_scale to match the declaration
Trivial change to declare the parameter as gdouble instead of double
so that it matches the header.
2008-12-12 17:38:53 +00:00
Neil Roberts
a462d19e14 Add clutter_path_to_cairo_path and clutter_path_add_cairo_path
See bug #1325.

Added doc for new cairo path functions to clutter-sections.txt
2008-12-12 14:31:43 +00:00
Emmanuele Bassi
0e1a3c2124 Warn instead of returning in the IN_PAINT check
It's conceivable that a warning should be deemed enough, instead
of just returning a NULL cairo_t when creating a context for the
CairoTexture actor.
2008-12-12 11:42:16 +00:00
Emmanuele Bassi
4d34872dea Small documentation fixes
Fix the CairoTexture description, and some of the comments inside
the code, especially with regards to the alpha channel unpremultiplication
that we have to perform each time we upload the image surface to
GL.
2008-12-11 15:51:24 +00:00
Emmanuele Bassi
cf9dea7cf6 Print a warning when creating a cairo_t while painting
If you create a Cairo context in the middle of a paint run and then
you destroy it, the CairoTexture will have to upload the contents of
the image surface to the GL pipeline. This usually leads to slow
downs and general performance degradation.

ClutterCairoTexture will warn to the console if Clutter has been
compiled with the debug messages and if create() or create_region()
are called while an actor is in the middle of a paint.
2008-12-11 15:48:43 +00:00
Emmanuele Bassi
1b88122873 Do not set the IN_PAINT flag inside the Stage paint
Since the CLUTTER_ACTOR_IN_PAINT private flag is set as part
of the paint process by clutter_actor_paint(), there is no
need to set it inside the ClutterStage paint function.
2008-12-11 15:41:25 +00:00
Emmanuele Bassi
3f2c9fe6b3 Set the IN_PAINT private flag
When calling clutter_actor_paint() we should be setting the
CLUTTER_ACTOR_IN_PAINT private flag. This allows signalling
to each Actor subclass that we are effectively in the middle
of a paint sequence. Actor subclasses can check for this
private flag and act based on its presence - for instance to
avoid recursion, or to detect performance degradation cases.
2008-12-11 15:39:28 +00:00
Emmanuele Bassi
e934ad03ca Add ClutterCairoTexture
Move the ClutterCairo actor from a separate library to an in-tree
actor.

ClutterCairoTexture is a simple texture subclass that allows you
to retrieve a Cairo context for a private image surface. When the
Cairo context is destroyed it will cause the image surface
contents to be uploaded to a GL texture.

The image surface used is not hardware accelerated.
2008-12-11 15:34:47 +00:00
Emmanuele Bassi
a50dfefbc3 Fix documentation issues
Provide a description for the ClutterText section, and fix some
misnamed arguments inside the header file.
2008-12-11 15:00:22 +00:00
Emmanuele Bassi
0ac1590378 Lazily create the PangoContext on Text::init
If we create the PangoContext for ClutterText inside the class
initialization we might not have a Clutter main context yet.

Ideally, we should store the Pango context inside the main context
and create it on clutter_init(), but for now we can lazily create
the PangoContext when we initialize a ClutterText instance for the
first time.
2008-12-11 14:57:46 +00:00
Emmanuele Bassi
5a1837bc9e Remove ClutterEntry and ClutterLabel from the build
For the time being, just don't include them or compile them; the
files will be removed from the repository as soon as all the
documentation annotations have been ported over to ClutterText.
2008-12-11 13:49:39 +00:00
Emmanuele Bassi
786bc4d4d5 Allow only synthetic events with keyval 0
We allow KeyEvents with a key symbol of '0' to fall through only
if they are marked as synthetic. Otherwise we discard them without
mercy.

Synthetic events are useful to test ClutterText behaviour; in fact,
we do use them inside the test suite exactly for that reason.
2008-12-11 12:24:45 +00:00
Emmanuele Bassi
77b3b9d5f4 Do not use contractions when not needed
I understand we are not Pascal developers, and we don't have to
use cute and cuddly names like "i_am_an_integer_counter", but
a ClutterButtonEvent should be stored inside an "event" variable.
Using "bev" instead? Mmmh, not so much.
2008-12-11 12:21:57 +00:00
Emmanuele Bassi
2ca7cb46f9 Use the paint opacity when painting a ClutterText
ClutterText should use the paint opacity for both text and
cursor.

ClutterLabel had the wrong behaviour, as it set the actor's
opacity using the text color's alpha channel, and ClutterEntry
completely disregarded the actor's opacity when painting the
cursor.

This commit harmonizes the ClutterText behaviour to always
use a composition of the actor's paint opacity and the text
and cursor alpha channel values, thus behaving more
consistently with the rest of Clutter.
2008-12-11 12:18:26 +00:00
Emmanuele Bassi
e9c369f86d Add documentation annotations
ClutterText is heavily under-documented. This commit ports most of
the API documentation from ClutterLabel and ClutterEntry to
ClutterText.
2008-12-11 12:17:11 +00:00
Emmanuele Bassi
cfb6022831 Code style fixes
Fix the arguments alignment whenever not consistent with the
coding style rules.
2008-12-11 12:15:49 +00:00
Emmanuele Bassi
7a93bcb64e Remove unused types
Since ClutterText now uses ClutterBindingPool there is no more
need for the internal key mapping types.
2008-12-11 12:14:53 +00:00
Emmanuele Bassi
f13e00b411 Truncate selections on text insertion
When inserting text on a key press event we should also truncate
the selection.

We should not truncate the selection when inserting any Unicode
character, since changing the selection also changes the cursor
position - and one of the invariants we inherited from ClutterEntry
is that inserting characters programmatically does not change the
cursor position.
2008-12-11 12:10:46 +00:00
Emmanuele Bassi
35172a7615 Change the binding propagation when truncating a selection
If a selection has been truncated inside a key binding handler,
we should just return and let the usual key event handler continue.

This fixes the case where we deleted a selection using the Delete
or the Backspace keys.
2008-12-11 12:08:20 +00:00
Emmanuele Bassi
eae98800d2 Use ClutterBindPool inside ClutterText
ClutterText should use the newly added ClutterBindingPool API to
handle key events, instead of its homegrown code.

This commit removes the action/mapping code and defers the entire
key binding matching to a ClutterBindingPool created inside the
Text class initialization function.
2008-12-11 12:03:17 +00:00
Emmanuele Bassi
b1c366a143 Add Text::get_chars() implementation and tests
The clutter_text_get_chars() function returns a section of the
contents of the Text actor, delimited by a start and an end position.

This commit adds the implementation for that function and a test
unit that guarantees the offset-to-bytes computations are correct.
2008-12-11 11:59:50 +00:00
Emmanuele Bassi
2fedd3263c Do not namespace internal data structures
Since the internal data structures are not exported (duh!), we
can eschew the namespacing and save us some characters.
2008-12-11 11:57:46 +00:00
Emmanuele Bassi
4a1f4d6f9a Move internal data structures on top
Try to keep the declarations section of the source files clean and
possibly consistent.
2008-12-11 11:55:39 +00:00
Emmanuele Bassi
d84a88ac3b Coding style consistency
Channel mitch's spirit.

This is also how I get to have the highest commit count on Clutter's
repository.
2008-12-11 11:54:32 +00:00
Emmanuele Bassi
d10f7127a2 Implement Text:max-length
The :max-length property establishes the maximum available
length for the Text actor's contents, in characters.
2008-12-11 11:54:07 +00:00
Emmanuele Bassi
1ff02f570e Use the stored contents length in ::delete_chars()
Instead of recomputing it, we can reuse the contents length we
compute and store inside clutter_text_set_text().
2008-12-11 11:50:02 +00:00
Emmanuele Bassi
4cc57bdc41 Improve the safety checks inside the text setters
We should check that the contents of the Text actor are
not NULL when computing the offsets in bytes.
2008-12-11 11:49:45 +00:00
Emmanuele Bassi
c72722df8c Add :cursor-color-set property declaration
The :cursor-color-set property is a read-only property that
reflects whether the ClutterText actor is going to use the
color set inside the :cursor-color property when painting
the cursor.
2008-12-11 11:49:14 +00:00
Emmanuele Bassi
bdb0cc462d General whitespace fixes in ClutterText
Let's keep whitespace fixes to their own commit to avoid
polluting git-blame.
2008-12-11 11:48:17 +00:00
Emmanuele Bassi
7fa93ebe9e Replace offset_to_bytes() implementation
We should re-use the offset_to_bytes() implementation from ClutterEntry
as it guaranteed some behaviour and sanity checks that we want to keep
inside ClutterText.
2008-12-11 11:47:06 +00:00
Emmanuele Bassi
9169dff794 Add text editing methods
Port the text editing methods from ClutterEntry, so that
ClutterText exposes the same API.
2008-12-11 11:43:56 +00:00
Emmanuele Bassi
74257dfa27 Add missing basic constructor
ClutterText should have an empty constructor, mostly for
bindings to use, that just proxies call to g_object_new()
without setting any property.
2008-12-11 11:43:37 +00:00
Emmanuele Bassi
7af992974e Initialize the cursor position
By default, the cursor position is initialized to -1, meaning
"place the cursor always at the end of the text".
2008-12-11 11:42:33 +00:00
Emmanuele Bassi
d5df1bebcf Add text-visibility accessors for ClutterText
A ClutterText can be put in "password mode" by setting the
text as "invisible": every character inside the Text actor's
contents will be replaced when building the Pango layout with
a specific Unicode character.

The Unicode character is set to '*' by default, but the user
can be changed using the provided API.
2008-12-11 11:40:55 +00:00
Emmanuele Bassi
97cf7e6819 Correctly initialize the initial state of ClutterText
Some of the values in ClutterText have an initial state that
does not match a zero-ed out ClutterTextPrivate structure.
2008-12-11 11:35:52 +00:00
Emmanuele Bassi
fc168a3482 Merge the ClutterLabel properties into ClutterText
ClutterText should have the same properties as ClutterLabel.

While at it, we can finally fix the disconnect between the wrap
and wrap-mode properties and its accessors, that we perpetuated
from GtkLabel.

The ClutterText:line-wrap property and ClutterText:line-wrap-mode
are mapped to the set_line_wrap(), get_line_wrap() and
set_line_wrap_mode(), get_line_wrap_mode() accessor functions
respectively. This should simplify bindings the Vala ones that
map a property into a method.
2008-12-11 11:33:10 +00:00
Emmanuele Bassi
c5f51f7027 Add Text::get_chars() method declaration
Add the declaration for a clutter_text_get_chars() function that
returns a portion of the contents of a Text actor.
2008-12-11 11:31:48 +00:00
Emmanuele Bassi
430d1cf347 Add Actor::grab_key_focus() method
Bug 1003 - Add clutter_actor_take_key_focus()

The grab_key_focus() method is just a simple wrapper around
clutter_stage_take_key_focus() that removes the need to get
the ClutterStage of an actor in order to set the key focus.

Based on a patch by Xan López.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
Signed-off-by: Øyvind Kolås <pippin@linux.intel.com>
2008-12-11 11:22:46 +00:00
Emmanuele Bassi
40fb75052b Merge Label and Entry API into ClutterText
ClutterText should expose both ClutterLabel and ClutterEntry
functionality using an API that matches the one provided by
those two classes.
2008-12-11 11:21:39 +00:00
Emmanuele Bassi
437f96982e Expose the Text accessors as public API
Fix up the header to expose ClutterText accessors for the main
properties, matching ClutterLabel.
2008-12-11 11:20:14 +00:00
Emmanuele Bassi
4d62da80ad Coalesce ClutterLabel API usage
ClutterText replaces ClutterLabel, so it should expose the same
kind of API - ideally with the minimal amount of changes, so that
the porting is trivial.
2008-12-11 11:17:26 +00:00
Emmanuele Bassi
a91bb5450f Group all the integer private fields
Integer fields using the ": <bits>" notation should be packed
together so that the compiler can optimize the structure size
correctly.
2008-12-11 11:15:56 +00:00
Emmanuele Bassi
f9bf187e5d Use internal headers
Since ClutterText is part of Clutter, it can use the internal
and private headers instead of the catch-all clutter.h.
2008-12-11 11:15:11 +00:00
Emmanuele Bassi
a98720ae19 Initial import of the Text actor from Tidy
The TidyText actor is meant as a replacement for both ClutterLabel
and ClutterText.

Any text-displaying and editing actor should derive from ClutterText
and implement the various visual cues to differentiate the editable
from the non-editable state. Those visual cues usually belong to
a high-level toolkit, especially if themeing is involved.
2008-12-11 11:12:48 +00:00
Emmanuele Bassi
4973b684a6 Resort the main Clutter include file
Just for overall sanity we keep the include file sorted.
2008-12-11 11:11:11 +00:00
Emmanuele Bassi
bc6a107ff6 Do not modify parameters in place
When the apply_transform_to_point() and its relative variant
landed in Clutter 0.3, the initial approach was to modify the
passed vertex as an in-out parameter. This was later dropped
in favour of a more consistent out parameter.

Unfortunately, the implementation never changed: both methods
where modifying the passed vertex with the partial results of
the computations.

This commit copies the contents of the "point" ClutterVertex
argument inside a stack variable and, for good measure, constifies
the argument.

Thanks to Thomas Steinacher for catching this in Python.
2008-12-10 23:00:48 +00:00
Neil Roberts
e21fee39b4 Merge commit 'git-svn' into multiple-texture-rectangle 2008-12-10 12:25:25 +00:00
Neil Roberts
dc6545ccd1 * clutter/cogl/gl/cogl.c:
* clutter/cogl/gl/cogl-defines.h.in:
	* clutter/cogl/gl/cogl-context.h:
	* clutter/cogl/common/cogl-mesh.c: Rename the glBufferDataSub
	function to glBufferSubData. When calling glXGetProcAddress with
	the former Mesa returns a stub dispatch function which will
	segfault if you try to use it. With NVIDIA it returns NULL so
	_cogl_features_init decides the card doesn't have VBO support.
2008-12-10 12:13:20 +00:00
Neil Roberts
c81a0b3281 Bug 1323 - ClutterBehaviorDepth conflicts with other behaviors
* clutter/clutter-behaviour-ellipse.c (actor_apply_knot_foreach):
	Don't set the depth if there is no x or y tilt. That way it can
	still be used in conjunction with ClutterBehaviourDepth. Thanks to
	Tonny Tzeng.
2008-12-10 11:27:14 +00:00
Neil Roberts
9537f8e4ae Use a single index array
There's no point in clearing the index array because it is always the
same sequence of indices regardless of the vertices. Instead it is
just added to when there are more vertices than ever before.
2008-12-09 18:03:29 +00:00
Neil Roberts
2c9a79651a Merge commit 'git-svn' into multiple-texture-rectangle 2008-12-09 15:10:56 +00:00
Neil Roberts
0bedd891fb Support cogl_texture_multiple_rectangles in GL ES backend 2008-12-09 15:10:33 +00:00
Neil Roberts
8fc949bfaf Minor fix to indentation in gl/cogl-texture.c 2008-12-09 15:01:10 +00:00
Neil Roberts
73974de482 Add gtk-doc for cogl_texture_multiple_rectangles 2008-12-09 13:20:32 +00:00
Neil Roberts
bf72b8cdc3 Use glDrawRangeElements to share vertices
When drawing a quad from cogl_texture_multiple_rectangles share two of
the vertices in each triangle by using indices.
2008-12-09 13:02:28 +00:00
Emmanuele Bassi
e3dd18dc0c 2008-12-08 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-binding-pool.h: Fix the ActivateFunc
	documentation by adding a "return value" annotation.
2008-12-08 14:22:52 +00:00
Emmanuele Bassi
8a537b6299 2008-12-08 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/Makefile.am:
	* clutter/clutter.h: Add ClutterBindingPool to the build.

	* clutter/clutter-binding-pool.c:
	* clutter/clutter-binding-pool.h: Add ClutterBindingPool, a data
	structure meant to hold (key symbol, modifiers) pairs and associate
	them to a closure. The ClutterBindingPool can be used to install
	key bindings for actors and then execute closures inside the
	key-press-event signal handlers, removing the need for big
	switch() or if() blocks for each key.

	* clutter/clutter-event.c: Consistently use "key symbol" instead
	of "key value".

	* clutter/clutter-event.h: Add more modifier masks.

	* clutter/clutter-marshal.list:

	* tests/conform/Makefile.am:
	* tests/conform/test-binding-pool.c:
	* tests/conform/test-conform-main.c: Add ClutterBindingPool
	conformance test.

	* tests/interactive/Makefile.am:
	* tests/interactive/test-binding-pool.c: Add interactive test (and
	example code) for the ClutterBindingPool usage.
2008-12-08 13:57:10 +00:00
Neil Roberts
008693d8b2 * clutter/clutter-main.c (_clutter_do_pick): Restore the GL_DITHER
state after reading the pixel value instead of before. Suggested
	in bug 1328 thanks to Guy Zadickario.
2008-12-08 12:02:36 +00:00
Emmanuele Bassi
2410f74e29 2008-12-05 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1309 - clutter_timeline_new and clutter_timeline_set_speed
	have two standard of the fps limitation

	* clutter/clutter-timeline.c:
	(clutter_timeline_class_init): Set the maximum value of the
	:fps property to be G_MAXUINT. (Zhang Wei)
2008-12-05 17:44:12 +00:00
Neil Roberts
b105efae7b * clutter/clutter-entry.c: Fix the 'Since' annotation in the
gtk-doc.
2008-12-05 14:29:57 +00:00
Neil Roberts
74ba6fd8c4 * clutter/clutter-timeline.c:
* clutter/clutter-texture.c:
	* clutter/clutter-stage.c:
	* clutter/clutter-label.c:
	* clutter/clutter-behaviour-path.c:
	* clutter/clutter-actor.c: Fix the 'Since' annotation in the
	gtk-doc.
2008-12-05 14:08:06 +00:00
Neil Roberts
1a63414966 Bug 1252 - Merge ClutterBehaviourPath and ClutterBehaviourBspline
* clutter/clutter-path.h:
	* clutter/clutter-path.c: Implementation of new ClutterPath object
	to represent a path combining straight line and bezier curve
	elements.

	* clutter/clutter.h: Include clutter-path.h and remove
	clutter-behaviour-bspline.h

	* tests/interactive/test-threads.c (test_threads_main):
	* tests/interactive/test-script.c:
	* tests/interactive/test-behave.c (test_behave_main): Use new path
	API

	* clutter/clutter-effect.c: Use the new ClutterBehaviourPath API.

	* clutter/clutter-bezier.h:
	* clutter/clutter-bezier.c: Moved bezier curve handling code out
	from clutter-behaviour-bspline.c to a separate file.

	* clutter/clutter-behaviour-path.h:
	* clutter/clutter-behaviour-path.c: Reimplemented to work with a
	ClutterPath

	* clutter/clutter-behaviour-bspline.h:
	* clutter/clutter-behaviour-bspline.c: Removed

	* clutter/Makefile.am: Add clutter-path and clutter-bezier, remove
	clutter-behaviour-bspline.

	* tests/conform/test-path.c: New automatic test for ClutterPath
	consistency

	* tests/conform/test-conform-main.c (main): Add test_path

	* tests/conform/Makefile.am (test_conformance_SOURCES): Add
	test-path.c

	* clutter/clutter-sections.txt: Add ClutterPath docs

	* clutter/clutter.types:
	* clutter/clutter-docs.xml:
	* doc/reference/clutter/clutter-animation-tutorial.xml: Remove
	mention of ClutterBehaviourBspline

	* clutter/clutter-marshal.list: Add VOID:UINT
2008-12-05 13:13:37 +00:00
Neil Roberts
bafcfca797 Merge commit 'git-svn' into multiple-texture-rectangle
Conflicts:

	clutter/cogl/gl/cogl-texture.c
2008-12-04 18:20:57 +00:00
Neil Roberts
e3f077d55f Use the correct length in _cogl_texture_flush_vertices
The check for whether there are any rectangles to flush was using the
wrong value so it would always flush.

Thanks to Johan Bilien for spotting.
2008-12-04 17:50:03 +00:00
Neil Roberts
98035e4d8a Bug 1297 - Bring back support for GL_ARB_texture_rectangle
* clutter/cogl/gl/cogl-texture.c (cogl_texture_new_from_foreign,
	(_cogl_texture_quad_hw, cogl_texture_polygon),
	(_cogl_texture_quad_sw): Support GL_ARB_texture_rectangle textures

	* clutter/glx/clutter-glx-texture-pixmap.c: Use rectangle textures
	when NPOTs are not available or it is forced by the
	CLUTTER_PIXMAP_TEXTURE_RECTANGLE environment variable.

	* clutter/cogl/gl/cogl.c (cogl_enable): Allow enabling
	GL_TEXTURE_RECTANGLE_ARB.
2008-12-04 17:24:33 +00:00
Neil Roberts
89e7552ca3 Bug 1172 - Disjoint paths and clip to path
* clutter/cogl/cogl-path.h:
	* clutter/cogl/common/cogl-primitives.c:
	* clutter/cogl/common/cogl-primitives.h:
	* clutter/cogl/gl/cogl-primitives.c:
	* clutter/cogl/gles/cogl-primitives.c: Changed the semantics of
	cogl_path_move_to. Previously this always started a new path but
	now it instead starts a new disjoint sub path. The path isn't
	cleared until you call either cogl_path_stroke, cogl_path_fill or
	cogl_path_new. There are also cogl_path_stroke_preserve and
	cogl_path_fill_preserve functions.

	* clutter/cogl/gl/cogl-context.c:
	* clutter/cogl/gl/cogl-context.h:
	* clutter/cogl/gles/cogl-context.c:
	* clutter/cogl/gles/cogl-context.h: Convert the path nodes array
	to a GArray.

	* clutter/cogl/gl/cogl-texture.c:
	* clutter/cogl/gles/cogl-texture.c: Call cogl_clip_ensure

	* clutter/cogl/common/cogl-clip-stack.c:
	* clutter/cogl/common/cogl-clip-stack.h: Simplified the clip
	stack code quite a bit to make it more maintainable.  Previously
	whenever you added a new clip it would go through a separate route
	to immediately intersect with the current clip and when you
	removed it again it would immediately rebuild the entire clip. Now
	when you add or remove a clip it doesn't do anything immediately
	but just sets a dirty flag instead.

	* clutter/cogl/gl/cogl.c:
	* clutter/cogl/gles/cogl.c: Taken away the code to intersect
	stencil clips when there is exactly one stencil bit. It won't work
	with path clips and I don't know of any platform that doesn't have
	eight or zero stencil bits. It needs at least three bits to
	intersect a path with an existing clip. cogl_features_init now
	just decides you don't have a stencil buffer at all if you have
	less than three bits.

	* clutter/cogl/cogl.h.in: New functions and documentation.

	* tests/interactive/test-clip.c: Replaced with a different test
	that lets you add and remove clips. The three different mouse
	buttons add clips in different shapes. This makes it easier to
	test multiple levels of clipping.

	* tests/interactive/test-cogl-primitives.c: Use
	cogl_path_stroke_preserve when using the same path again.

	* doc/reference/cogl/cogl-sections.txt: Document the new
	functions.
2008-12-04 13:45:09 +00:00
Robert Bragg
bb2272992b Bug 1303 - clutter_glx_texture_pixmap_using_extension doesn't check if
fallbacks are being used

	* glx/clutter-glx-texture-pixmap.c:
	clutter_glx_texture_pixmap_using_extension now checks to see if
	priv->use_fallback is TRUE not just that the tfp extension is
	available.
2008-12-03 18:00:05 +00:00
Neil Roberts
55cec1f651 Bug 1305 - NPOT textures unaligned to a pixel sometimes have
border artifacts

	* clutter/cogl/gl/cogl-texture.c: Set the wrap mode of a texture
	on demand

	Instead of setting the wrap mode once per texture at creation, it
	is now changed whenever the texture is drawn. The previous value
	is cached so that it isn't changed if the value is the same.

	This is used in _cogl_texture_quad_hw to only enable GL_REPEAT
	mode when the coordinates are not in the range [0,1]. Otherwise it
	can pull in pixels from the other edge when the texture is
	rendered off-pixel.
2008-12-01 16:27:54 +00:00
Neil Roberts
29505dd0ba Use GL_TRIANGLES for the texture vertex array
Most cards don't actually support GL_QUADS and they are deprecated in
GL 3.0 so there is a chance it will perform faster with GL_TRIANGLES
even though it has to submit two extra vertices.
2008-11-28 14:20:07 +00:00
Neil Roberts
ab347481ae Use cogl_texture_multiple_rectangles in CoglPangoRenderer
The glyphs are queued into an array of rectangles instead of being
drawn directly. Whenever a different texture is used or the sequence
is complete the array is flushed.

This is based on a patch from Owen Taylor.
2008-11-28 13:14:10 +00:00
Neil Roberts
b312cd2d55 Add cogl_texture_multiple_rectangles
This takes an array of sets of 8 floats to describe the rectangles. It
tries to send the geometry with a single glDrawArrays as far as
possible. cogl_texture_rectangle is now just a wrapper around
cogl_texture_multiple_rectangles.
2008-11-28 13:09:04 +00:00
Neil Roberts
10942e8e04 Make cogl_texture_rectangle use the vertex array
cogl_texture_quad_hw and _sw now just add vertices to the vertex
array. The last texture used is stored and if a different texture is
encountered then flushes the vertices. cogl_texture_rectangle always
flushes the vertices after calling either of the functions.
2008-11-28 12:33:19 +00:00
Neil Roberts
93ea1681bb Use a GArray for the texture vertices in cogl_texture_polygon
Previously it was a dynamic array that was manually reallocated.
2008-11-27 16:44:39 +00:00
Emmanuele Bassi
dfa730909c 2008-11-26 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-group.c:
	(clutter_group_real_raise), (clutter_group_real_lower): Repaint
	the Group on raise and lower.
2008-11-26 16:46:48 +00:00
Neil Roberts
ce189e7d77 * clutter/cogl/gl/cogl-texture.c (cogl_texture_rectangle): Fixed
the test for whether to use hardware tiling. Previously it assumed
	that texture coordinates are in increasing order but this is not
	the case since bug 1057 was fixed. The texture coordinates are now
	sorted later. It also allowed negative coordinates which doesn't
	make sense if the texture has waste.
2008-11-26 16:35:25 +00:00
Neil Roberts
50868579a0 Bug 1299 - clutter_score_remove will segmentation fault if
timelines are more than 52 and continue to remove them

	* clutter/clutter-score.c (traverse_children): Don't destroy the
	entry in the handler for REMOVE_BY_ID. It will be removed again
	anyway in the call to g_node_traverse. This was causing a
	crash. Thanks to zhangwei for spotting.
2008-11-25 13:19:48 +00:00
Neil Roberts
8ff85615b3 * clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon): Fix the
equation for calculating texture coordinates when using sliced
	textures. This became broken in revision 3520.
2008-11-24 12:27:48 +00:00
Neil Roberts
21617cc0f1 Bug 1271 - mingw compiling failed: undefined reference to
`_glDrawRangeElements@24'

	Resolve glDrawRangeElements with cogl_get_proc_address instead of
	calling it directly because functions defined in GL > 1.1 are not
	directly exported under Windows.

	* clutter/cogl/common/cogl-mesh.c: Use the function pointer from
	the context

	* clutter/cogl/gl/cogl-context.c (cogl_create_context): Initialise
	function pointer.

	* clutter/cogl/gl/cogl-context.h (CoglContext): Add a function
	pointer

	* clutter/cogl/gl/cogl-defines.h.in: Add a typedef for the
	function pointer.

	* clutter/cogl/gl/cogl.c (_cogl_features_init): Resolve
	glDrawRangeElements
2008-11-21 16:18:58 +00:00
Neil Roberts
1c4bd93b11 Bug 1269 - mingw32 building failed at clutter-media.c
* clutter/clutter-media.c: Rename the 'ERROR' signal enum to
	'ERROR_SIGNAL' otherwise it clashes with windgi.h. Thanks to David
	Kedves
2008-11-21 16:18:38 +00:00
Neil Roberts
8ca07482dd * clutter/pango/cogl-pango.h: Include pango/pango.h to get
pango-renderer.h. In versions prior to 1.18.4 pangocairo.h does
	not include pango-renderer.h
2008-11-21 16:18:31 +00:00
Neil Roberts
1ce98c97cf Bug 1280 - clutter_score_append_at_marker lead to segmentation
fault in trunk and incorrect appearance in clutter-0.8

	* clutter/clutter-score.c (start_children_entries): Check whether
	the child timeline is actually attached at a marker before
	comparing whether the marker's name matches the marker
	reached. This fixes a crash that happens when a marker is reached
	on a timeline that also has child timelines attached at the
	end. Thanks to zhangwei for spotting.
2008-11-21 12:01:41 +00:00
Emmanuele Bassi
47150304cd 2008-11-20 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-actor.c:
	(clutter_actor_set_property): Add sanity checks for NULL
	boxed values when setting the rotation center.

	* tests/interactive/test-animation.c:
	(on_button_press): Add an example on how to use the rotation
	properties to animate an actor.
2008-11-20 10:52:09 +00:00
Neil Roberts
eeab42b765 Fixed some trivial compiler warnings
* tests/interactive/test-pixmap.c (create_pixmap): Use a format
	string instead of passing the error message directly to g_error.

	* tests/interactive/test-easing.c (test_easing_main)
	(on_button_press):
	* tests/interactive/test-animation.c (on_button_press): Use
	unsigned variables for the results from clutter_actor_get_size
	otherwise it complains about the pointer signedness being
	different.

	* clutter/clutter-script.c (clutter_script_add_search_paths): Use
	G_GSIZE_FORMAT instead of %d for a gsize parameter otherwise it
	gets upset on 64-bit.
2008-11-18 18:53:10 +00:00
Robert Bragg
2705547469 * clutter/cogl/common/cogl-mesh.c:
Re-works validate_custom_attribute_name() so it doesn't access an
	un-initialised variable.
2008-11-18 16:24:31 +00:00
Robert Bragg
39aa5c27b5 A comparison of gl/cogl-texture.c and gles/cogl-texture.c, to reduce
differences and improve maintainability.

	* clutter/cogl/gl/cogl-context.h:
	Adds a CoglTextureGLVertex typedef + texture_vertices and
	texture_vertices_size members to CoglContext for using vertex arrays
	like GLES does

	* clutter/cogl/gl/cogl-context.c:
	Initializes texture_vertices + texture_vertices_size members

	* clutter/cogl/gl/cogl-internal.h:
	Adds COGL_ENABLE_COLOR_ARRAY

	* clutter/cogl/gl/cogl.c:
	Add COGL_ENABLE_COLOR_ARRAY support to cogl_enable

	* clutter/cogl/gles/cogl-context.h:
	Change the CoglTextureGLVertex to use GLfloat for the position
	and texture coord attributes and GLubyte for the color.

	* clutter/cogl/gles/cogl-texture-private.h:
	Adds a wrap_mode member like GL has.

	* clutter/cogl/gl/cogl-texture.c
	* clutter/cogl/gles/cogl-texture.c:
	Improves the comparability of the files, such that the remaining
	differences, better reflect the fundamental differences needed
	between GL and GLES. Notably GL no longer uses glBegin/glEnd for
	submitting vertices, it uses vertex arrays like GLES and this gives
	a small but measurable fps improvement for test-text.
2008-11-18 16:24:09 +00:00
Robert Bragg
41ec02c8b5 * clutter/cogl/gl/cogl-internal.h
* clutter/cogl/gles/cogl-internal.h:
	Removes semicolon after the GE() macro since that breaks using it as a
	single statement.
2008-11-18 16:23:40 +00:00
Emmanuele Bassi
5e9282bd79 2008-11-18 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter.h: Add clutter-shader.h and
	clutter-shader-types.h to the global include.
2008-11-18 15:35:20 +00:00
Emmanuele Bassi
837d17aefc 2008-11-18 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/cogl/cogl-shader.h: Add a function for setting an
	integer uniform, similar to cogl_program_uniform_1f().

	* clutter/cogl/gl/cogl-program.c: Implement the GL version
	of cogl_program_uniform_1i().

	* clutter/cogl/gles/cogl-program.c: Implement the GLES version
	of cogl_program_uniform_1i().
2008-11-18 15:21:02 +00:00
Emmanuele Bassi
af0cb47570 2008-11-18 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1049 - Clutter doesn't support most GLSL uniforms (patch
	by Chris Lord and Neil Roberts)

	* README: Update release notes.

	* clutter/Makefile.am:
	* clutter/clutter-shader-types.[ch]: Add GValue types for
	shader values.

	* clutter/clutter-actor.[ch]: Update the shader API to use
	the newly added GValue support for GLSL shader uniform
	setters.

	* clutter/clutter-shader.[ch]: Add float and integer convenience
	API for single value GLSL uniform setters.

	* clutter/cogl/cogl-shader.h: Add new uniform setters.

	* clutter/cogl/gl/cogl-context.c:
	* clutter/cogl/gl/cogl-context.h:
	* clutter/cogl/gl/cogl-defines.h.in:
	* clutter/cogl/gl/cogl-program.c:
	* clutter/cogl/gl/cogl.c: Update the GL implementation of COGL
	to handle the GLSL uniform setters.

	* clutter/cogl/gles/cogl-gles2-wrapper.c:
	* clutter/cogl/gles/cogl-gles2-wrapper.h:
	* clutter/cogl/gles/cogl-internal.h:
	* clutter/cogl/gles/cogl-program.c: Update the GLES 2.0 implementation
	of COGL to handle the GLSL uniform setters.

	* doc/reference/clutter/clutter-sections.txt:
	* doc/reference/cogl/cogl-sections.txt: Update the documentation.

	* tests/interactive/test-fbo.c:
	* tests/interactive/test-shader.c: Update the shader tests.
2008-11-18 15:08:40 +00:00
Emmanuele Bassi
25d9773e15 2008-11-18 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-texture.c:
	(clutter_texture_get_preferred_width): Fix the usage of the
	fixed point division macro.
2008-11-18 13:52:22 +00:00
Emmanuele Bassi
34cc7fe21c 2008-11-18 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-alpha.h:
	* clutter/clutter-alpha.c:
	(clutter_alpha_set_mode): Use a lookup table to find the alpha
	function given the animation mode.

	(clutter_exp_in_func),
	(clutter_exp_out_func),
	(clutter_exp_in_out_func): Add new exponential functions.

	* clutter/clutter-script.c: Update the lookup table with the
	new animation modes; match "linear" to the ramp-inc alpha
	function.

	* clutter/clutter-types.h: Add new AnimationMode values.

	* tests/interactive/test-easing.c: Update the easing functions
	test.
2008-11-18 12:42:05 +00:00
Emmanuele Bassi
62844d5f04 2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1014 - Clutter Animation API Improvements

	* clutter/Makefile.am:
	* clutter/clutter.h: Update the build

	* clutter/clutter-types.h: Add AnimationMode, an enumeration
	for easing functions.

	* clutter/clutter-alpha.[ch]: Add the :mode property to
	control the function bound to an Alpha instance using an
	enumeration value. Also add six new alpha functions:

		- ease-in, ease-out, ease-in-out
		- sine-in, sine-out, sine-in-out

	* clutter/clutter-deprecated.h: Deprecate the #defines for
	the alpha functions. They will be replaced by entries in the
	ClutterAnimationMode.

	* clutter/clutter-interval.[ch]: Add ClutterInterval, an
	object for defining, validating and computing an interval
	between two values.

	* clutter/clutter-animation.[ch]: Add ClutterAnimation, an
	object responsible for animation the properties of a single
	actor along an interval of values. ClutterAnimation memory
	management is automatic. A simple wrapper method for
	ClutterActor is provided:

		clutter_actor_animate()

	which will create, or update, an animation for the passed
	actor.

	* clutter/clutter-debug.h:
	* clutter/clutter-main.c: Add a new 'animation' debug note.

	* clutter/clutter-script.c: Clean up the alpha functions
	whitelist, and add the new functions.

	* doc/reference/clutter/Makefile.am:
	* doc/reference/clutter/clutter-sections.txt: Update the
	API reference.

	* doc/reference/clutter/clutter-animation.xml: Renamed to
	doc/reference/clutter/clutter-animation-tutorial.xml to
	avoid clashes with the ClutterAnimation section.

	* doc/reference/clutter/clutter-docs.sgml: Renamed to
	doc/reference/clutter/clutter-docs.xml, as it was an XML
	file and not a SGML file.

	* tests/Makefile.am:
	* tests/interactive/Makefile.am:
	* tests/interactive/test-animation.c:
	* tests/interactive/test-easing.c: Add two tests for the
	new simple animation API and the easing functions.

	* tests/interactive/test-actors.c:
	* tests/interactive/test-behave.c:
	* tests/interactive/test-depth.c:
	* tests/interactive/test-effects.c:
	* tests/interactive/test-layout.c:
	* tests/interactive/test-multistage.c:
	* tests/interactive/test-paint-wrapper.c:
	* tests/interactive/test-rotate.c:
	* tests/interactive/test-scale.c:
	* tests/interactive/test-texture-quality.c:
	* tests/interactive/test-threads.c:
	* tests/interactive/test-viewport.c: Update interactive tests
	to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
Emmanuele Bassi
87a43f3375 2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-entry.c:
	* clutter/clutter-label.c:
	* clutter/clutter-rectangle.c:
	* clutter/clutter-script.c:
	* clutter/clutter-stage.c: Use the ParamSpecColor and GValue
	API for ClutterColor-based properties.
2008-11-17 14:21:49 +00:00
Emmanuele Bassi
99b173eee7 2008-11-14 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1265 - ClutterScore doesn't emit 'started' signal (Bastian
	Winkler)

	* clutter/clutter-score.c: Emit the ::started signal.

	* tests/interactive/test-score.c: Check the emission of the
	Score signals.
2008-11-14 14:52:35 +00:00
Neil Roberts
0ae150e462 * clutter/cogl/gles/cogl-gles2-wrapper.h:
* clutter/cogl/gles/cogl-gles2-wrapper.c:
	Initialise the 'tex' sampler uniform to 0. The GLSL spec
	specifically says that you must initialize sampler uniforms. This
	fixes texturing for GLES 2 when using the PowerVR simulator via
	software Mesa.
2008-11-13 14:44:27 +00:00
Robert Bragg
3d2a1e2d81 Gets the mesh API working with GLES2
* clutter/cogl/common/cogl-mesh.c:
	Make sure we use the appropriate cogl_wrap_gl* funcs as appropriate

	* clutter/cogl/gles/cogl-gles2-wrapper.c
	* clutter/cogl/gles/cogl-gles2-wrapper.h:
	In our glColorPointer wrapper we needed to mark our color attribute
	as normalized.

	* tests/conform/Makefile.am:
	When creating unit test symlinks we use the -l gtester option to
	list tests, but when using the PVR SDK the test binary also spews
	out some extra info that caused lots of random symlinks to be
	created. We now grep for lines starting with a '/'

	* tests/conform/test-mesh-contiguous.c
	* tests/conform/test-mesh-mutability.c:
	Use cogl_set_source_color instead of directly calling glColor4ub
2008-11-13 14:28:16 +00:00
Neil Roberts
d510a4b0cd * clutter/clutter-actor.c (clutter_actor_get_paint_visibility):
Fix logic so that it won't return TRUE for a hidden stage.
2008-11-13 11:37:35 +00:00
Emmanuele Bassi
bb6751b84b 2008-11-13 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-behaviour-ellipse.c:
	(clutter_behaviour_ellipse_applied): Do not reset the depth
	of the actors to which the Ellipse behaviour has been applied
	to, unless the behaviour is going to update it because it has
	a tilt on the X or Y axis.
2008-11-13 10:54:06 +00:00
Neil Roberts
eb9799098b * clutter/clutter-actor.c (clutter_actor_get_reactive)
(clutter_actor_get_paint_visibility): Be sure to return exactly
	TRUE or FALSE instead of zero or some non-zero value in these
	functions that return a gboolean. Thanks to Kai Wei for spotting.
2008-11-13 10:33:56 +00:00
Emmanuele Bassi
c823bf9c83 2008-11-12 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/cogl/cogl-color.h:
	* clutter/cogl/cogl-path.h:
	* clutter/cogl/cogl-types.h:
	* clutter/cogl/common/cogl-color.c: Deprecated cogl_color()
	in favour of cogl_set_source_color() and friends; store the
	CoglColor components as unsigned bytes instead of fixed point
	normalized values; add functions for allocating, copying and
	freeing CoglColor, for use of language bindings.

	* clutter/cogl/cogl.h.in:
	* clutter/cogl/cogl-deprecated.h: Added cogl-deprecated.h,
	an header file containing the deprecation symbols similar
	to clutter-deprecated.h.

	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gl/cogl-texture.c:
	* clutter/cogl/gl/cogl.c:
	* clutter/cogl/gles/Makefile.am:
	* clutter/cogl/gles/cogl-texture.c:
	* clutter/cogl/gles/cogl.c: Update the GL and GLES implementations
	of COGL after the CoglColor changes.

	* clutter/clutter-actor.c:
	* clutter/clutter-clone-texture.c:
	* clutter/clutter-entry.c:
	* clutter/clutter-label.c:
	* clutter/clutter-rectangle.c:
	* clutter/clutter-texture.c: Do not use CoglColor whenever it
	is possible, and use cogl_set_source_color4ub() instead.

	* clutter/pango/cogl-pango-render.c: Ditto as above.

	* doc/reference/clutter/subclassing-ClutterActor.xml:
	* doc/reference/cogl/cogl-sections.txt: Update the documentation.

	* tests/interactive/test-cogl-offscreen.c:
	* tests/interactive/test-cogl-primitives.c:
	* tests/interactive/test-cogl-tex-convert.c:
	* tests/interactive/test-cogl-tex-foreign.c:
	* tests/interactive/test-cogl-tex-getset.c:
	* tests/interactive/test-cogl-tex-polygon.c:
	* tests/interactive/test-cogl-tex-tile.c:
	* tests/interactive/test-paint-wrapper.c: Drop the usage of
	CoglColor whenever it is possible.
2008-11-12 13:57:58 +00:00
Neil Roberts
0ff710d37b Bug 1057 - cogl_texture_rectangle doesn't support backward
coordinates

	* clutter/cogl/gl/cogl-texture.c: Instead of sorting the vertex
	and texture coordinates passed to cogl_texture_rectangle, just
	swap both sets whenever the texture coordinates are backward.
2008-11-12 13:03:09 +00:00
Neil Roberts
3fdb6e5ca7 * clutter/clutter-rectangle.c (clutter_rectangle_paint): Fixed so
that it doesn't use the alpha value from the border colour to draw
	the rectangle
2008-11-12 12:39:55 +00:00
Neil Roberts
f59da4d7a4 * clutter/cogl/gles/Makefile.am (libclutterinclude_HEADERS):
* clutter/cogl/gl/Makefile.am (libclutterinclude_HEADERS):
	* clutter/cogl/common/Makefile.am
	(libclutter_cogl_common_la_SOURCES): Move cogl-mesh.h into the
	headers for libclutter so that it will get installed.
2008-11-12 12:08:44 +00:00
Neil Roberts
1fd2156a99 Fix warnings in mesh tests
* tests/conform/test-mesh-mutability.c (on_paint):
	* tests/conform/test-mesh-interleved.c (on_paint):
	* tests/conform/test-mesh-contiguous.c (on_paint): Use g_usleep
	instead of sleep

	* tests/conform/test-mesh-mutability.c (queue_redraw):
	* tests/conform/test-mesh-interleved.c (queue_redraw):
	* tests/conform/test-mesh-contiguous.c (queue_redraw): Added
	missing return statement

	* clutter/cogl/cogl-mesh.h: Add a declaration for
	cogl_mesh_submit

	* clutter/cogl/common/cogl-mesh.c (cogl_mesh_submit): Move the
	documentation to cogl-mesh.h to match the rest of the functions
2008-11-12 10:55:06 +00:00
Robert Bragg
16897e0729 Bug 1164 - Implements the proposed Mesh API
* clutter/cogl/cogl-mesh.h
	* clutter/cogl/cogl-types.h
	* clutter/cogl/cogl.h.in
	* clutter/cogl/common/Makefile.am
	* clutter/cogl/common/cogl-mesh-private.h
	* clutter/cogl/common/cogl-mesh.c
	* clutter/cogl/gl/cogl-context.c
	* clutter/cogl/gl/cogl-context.h
	* clutter/cogl/gl/cogl-defines.h.in
	* clutter/cogl/gl/cogl.c
	* clutter/cogl/gles/cogl-context.c
	* clutter/cogl/gles/cogl-context.h
	* doc/reference/cogl/cogl-docs.sgml
	* doc/reference/cogl/cogl-sections.txt:
	The Mesh API provides a means for submitting an extensible number of
	per vertex attributes to OpenGL in a way that doesn't require format
	conversions and so that the data can be mapped into the GPU (in vertex
	buffer objects) for - hopefully - fast re-use.

	There are a number of things we can potentially use this API for, but
	right now this just provides a foundation to build on. Please read
	the extensive list of TODO items in cogl-mesh.c for examples.

	Please refer to the cogl-mesh section in the reference manual for
	documentation of the API.

	* tests/conform/Makefile.am
	* tests/conform/test-conform-main.c
	* tests/conform/test-mesh-contiguous.c
	* tests/conform/test-mesh-interleved.c
	* tests/conform/test-mesh-mutability.c:
	Privides basic coverage testing for the mesh API.
2008-11-10 18:53:14 +00:00
Emmanuele Bassi
12051380f7 2008-11-10 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-texture.c: Remove an unused function.
2008-11-10 12:29:10 +00:00
Emmanuele Bassi
7c6ae80bfe 2008-11-07 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-media.c: Improve documentation of the
	ClutterMedia interface.
2008-11-07 18:00:59 +00:00
Matthew Allum
1453d8b44f 2008-11-07 Matthew Allum <mallum@linux.intel.com>
Bug 1238 - [PATCH] Pack bitfields in ClutterTexturePrivate

* clutter/clutter-texture.c:

        Using 'guint my_field : 1' for booleans to save space only
        makes sense if you group all such fields together. Fix
        grouping for ClutterTexturePrivate. Thanks to Owen Taylor for
patch.
2008-11-07 17:00:54 +00:00
Matthew Allum
0d7545a541 2008-11-07 Matthew Allum <mallum@linux.intel.com>
Bug 1237 - clutter_texture_set_filter_quality calls
                  clutter_texture_[un]realize

* clutter/clutter-texture.c: (clutter_texture_set_filter_quality):
        Call clutter_actor_[un]realize and keep visibility state
2008-11-07 16:50:23 +00:00
Matthew Allum
c7c5cf9bd4 2008-11-07 Matthew Allum <mallum@linux.intel.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-clone-texture.c:
        * clutter/clutter-private.h:
        * clutter/clutter-texture.c:
        * clutter/x11/clutter-x11-texture-pixmap.c:

        Attempt to lower overhead of updating TFP's (particularly mipmaped).
        Compresses mipmap updates only for visible TFPs.
        Avoiding updates for non visible TFP's whilst keeping visible
        clones working ok.
2008-11-07 16:31:56 +00:00
Neil Roberts
b6cc701930 Bug 1230 - Pick fails on low precision color buffers
* clutter/clutter-main.c (_clutter_id_to_color): When using fuzzy
	picking to pick a color for an actor, it would previously set the
	fuzzy bit and then all but the most significant of the remaining
	unused bits. This meant that for 16-bit displays it would end up
	with a strange pattern for the unused bits like 1011 which could
	cause it to round up. Now it just sets all but the most
	significant of all of the unused bits giving a pattern like
	0111. Thanks to Guy Zadickario for the patch.
2008-11-06 12:03:05 +00:00
Neil Roberts
f7d447cfde * clutter/cogl/gles/cogl.c (cogl_perspective):
* clutter/cogl/common/cogl-fixed.c (cogl_fixed_sin)
	(cogl_angle_sin, cogl_angle_tan, cogl_fixed_sqrt): Replaced uses
	of 1 + ~x with just -x which is equivalent and easier to
	understand.
2008-11-06 11:42:11 +00:00
Emmanuele Bassi
ae6d930bba 2008-11-06 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1233 - CLUTTER_ALPHA_SINE_INC is broken in trunk

	* clutter/clutter-alpha.c: Fix a rollover in the sine functions.
2008-11-06 10:54:31 +00:00
Neil Roberts
e6570be339 * clutter/clutter-color.c (clutter_color_new): Remove CLAMP macros
around the component parameters because they are guint8 anyway so
	the CLAMP is redundant and it causes a warning.
2008-11-05 12:16:15 +00:00
Thomas Wood
33c03448e5 2008-11-04 Thomas Wood <thomas@linux.intel.com>
* clutter/clutter-color.c: Update ClutterColor documentation as
	changes have been backported to 0.8.4.
2008-11-04 17:52:29 +00:00
Emmanuele Bassi
e4cb59c1e6 2008-11-04 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-script.c: Document the "is-default" member of
	a ClutterStage definition.
2008-11-04 16:37:04 +00:00
Neil Roberts
a15ae21bd2 * clutter/cogl/gl/cogl.c (cogl_perspective): Use the accurate
64-bit multiplication macro instead of COGL_FIXED_FAST_DIV for
	calculating xmax as was done previously. This fixes
	test-perspective and other tests that had a gone a bit skewiff.
2008-11-04 12:43:06 +00:00
Neil Roberts
146967702f Bug 1181 - In Score, timelines, appended at markers, are also
called on complete

	* clutter/clutter-score.c (start_children_entries): Use the name
	of the marker to start as the data parameter and only start child
	timelines that have the same marker name. Previously the
	ClutterScore would just start all child entries when a marker was
	reached or the timeline completed regardless of whether they were
	added with a marker or not. Thanks to Mihail Naydenov for
	reporting the bug.
2008-11-04 10:40:53 +00:00
Emmanuele Bassi
e3788338e4 2008-11-03 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/cogl/gl/Makefile.am: Whitespace fixes.

	* clutter/cogl/gles/Makefile.am: Put back a missing backslash
	that broke the GLES build.
2008-11-03 23:58:13 +00:00
Emmanuele Bassi
7393c6a463 2008-11-03 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1231 - Build fails in gles flavour in revision 3442

	* clutter/cogl/gles/cogl-context.h: Fix remaining use of
	ClutterFixed over CoglFixed. (Michael Boccara)
2008-11-03 23:54:38 +00:00
Neil Roberts
fc8c2c5d9b Bug 1207 - Timelines sometime miss markers
* clutter/clutter-timeline.c (timeline_timeout_func): Move the
	code for firing the new-frame and marker-reached signals into a
	separate static function so that it can also be called when the
	last frame is reached. Also fix an issue where the frame numbers
	were changed in the wrong direction when detecting missed markers
	in a reversed timeline. Based on a patch by Michael Boccara.

	* tests/test-timeline.c: Now tries to automatically verify whether
	the test worked by keeping track of all the signal emissions. The
	timelines are run a second time with an extra timeout that causes
	delays to simulate skipped frames.
2008-11-03 12:42:17 +00:00
Emmanuele Bassi
745d7bed2a 2008-10-31 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/pango/cogl-pango-fontmap.c:
	* clutter/pango/cogl-pango-render.c: Whitespace fixes and code
	duplication removal. Plus, start documenting the CoglPango API.
2008-10-31 17:48:24 +00:00
Matthew Allum
52c6f0ab98 2008-10-31 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-texture.c: (clutter_texture_set_filter_quality),
        (clutter_texture_get_filter_quality):
        Fix up some logic, typos.

        * clutter/glx/clutter-glx-texture-pixmap.c:
        Improve support for mipmaped TFP textures.
2008-10-31 16:59:51 +00:00
Emmanuele Bassi
91f2653b71 2008-10-31 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1200 - Crash with invalid DISPLAY

	* clutter/clutter-main.c: Use the ClutterBackend wrapper API
	instead of directly checking the class structure.

	* clutter/glx/clutter-backend-glx.c: Return the correct value
	in case of failure.

	* clutter/x11/clutter-backend-x11.c: Bail out if XOpenDisplay()
	failed.
2008-10-31 12:48:26 +00:00
Emmanuele Bassi
850e6318e3 Fix a typo 2008-10-31 12:07:01 +00:00
Emmanuele Bassi
d30c52ffd4 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/cogl/cogl-color.h:
	* clutter/cogl/cogl-fixed.h:
	* clutter/cogl/cogl-offscreen.h:
	* clutter/cogl/cogl-path.h:
	* clutter/cogl/cogl-shader.h:
	* clutter/cogl/cogl-texture.h:
	* clutter/cogl/cogl-types.h: Add copyright and licensing
	notice to the newly added files.
2008-10-30 17:57:41 +00:00
Emmanuele Bassi
90f4b1d492 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1219 - Clean up cogl.h

	* clutter/cogl/cogl.h.in:
	* clutter/cogl/cogl-offscreen.h:
	* clutter/cogl/cogl-path.h:
	* clutter/cogl/cogl-shader.h:
	* clutter/cogl/cogl-texture.h:
	* clutter/cogl/cogl-types.h: Split up the massive cogl.h file
	into sub-header for each section of the API.

	* clutter/cogl/gl/*:
	* clutter/cogl/gles/*: Update the GL and GLES implementations
	of COGL to cope with the new header structure.

	* doc/reference/cogl/Makefile.am: Fix symbol retrieval.
2008-10-30 17:25:00 +00:00
Emmanuele Bassi
b5cc7a4044 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1215 - Move the Pango renderer to the public API

	* clutter/pango/*: Rename PangoClutter -> CoglPango.

	* clutter/Makefile.am:
	* clutter/clutter-backend.c:
	* clutter/clutter-entry.c:
	* clutter/clutter-label.c:
	* clutter/clutter-main.[ch]:
	* clutter/clutter-private.h: Update the users of the Pango
	renderer API.

	* README: Update release notes.
2008-10-30 17:11:29 +00:00
Emmanuele Bassi
a32eca26b6 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1212 - Allow only a single include file for Clutter

	* clutter/*.h: Only allow including clutter.h in third
	party code.

	* clutter/cogl/cogl-color.h:
	* clutter/cogl/cogl-fixed.h:
	* clutter/cogl/cogl.h.in: Only allow including cogl.h in
	third party code.

	* clutter/cogl/common/Makefile.am:
	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gles/Makefile.am:
	* clutter/eglnative/Makefile.am:
	* clutter/eglx/Makefile.am:
	* clutter/fruity/Makefile.am:
	* clutter/glx/Makefile.am:
	* clutter/glx/clutter-glx.h:
	* clutter/osx/Makefile.am:
	* clutter/pango/Makefile.am:
	* clutter/sdl/Makefile.am:
	* clutter/win32/Makefile.am:
	* clutter/x11/Makefile.am: Fix build environment.

	* clutter/x11/clutter-x11-texture-pixmap.h:
	* clutter/x11/clutter-x11.h: Fix inclusion rules.

	* tests/test-pixmap.c: Fix inclusion of GdkPixbuf header.

	* README: Update release notes.
2008-10-30 17:04:34 +00:00
Emmanuele Bassi
36e30239af 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1211 - Drop ClutterFeatureFlags usage from COGL

	* clutter/cogl/cogl.h.in:
	* clutter/cogl/gl/cogl.c:
	* clutter/cogl/gles/cogl.c: Do not use ClutterFeatureFlags
	when CoglFeatureFlags will do. This removes the last usage
	of Clutter API inside COGL.
2008-10-30 16:52:56 +00:00
Emmanuele Bassi
a547cdbc4d 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1210 - Add CoglColor API

	* clutter/cogl/cogl-color.h:
	* clutter/cogl/cogl.h.in:
	* clutter/cogl/common/Makefile.am:
	* clutter/cogl/common/cogl-color.c:
	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gl/cogl.c:
	* clutter/cogl/gles/Makefile.am:
	* clutter/cogl/gles/cogl-texture.c:
	* clutter/cogl/gles/cogl.c: Add a new color-type, to be used by
	COGL. CoglColor is optimized to allow the minimum amount of
	conversions possible for both GL and GLES implementations.

	* clutter/clutter-actor.c:
	* clutter/clutter-clone-texture.c:
	* clutter/clutter-entry.c:
	* clutter/clutter-main.c:
	* clutter/clutter-rectangle.c:
	* clutter/clutter-stage.c:
	* clutter/clutter-texture.c: Use CoglColor when needed.

	* clutter/pango/pangoclutter-render.c: Use CoglColor when needed.

	* doc/reference/cogl/cogl-docs.sgml:
	* doc/reference/cogl/cogl-sections.txt: Update the documentation.

	* tests/test-cogl-offscreen.c:
	* tests/test-cogl-primitives.c:
	* tests/test-cogl-tex-convert.c:
	* tests/test-cogl-tex-foreign.c:
	* tests/test-cogl-tex-getset.c:
	* tests/test-cogl-tex-polygon.c:
	* tests/test-cogl-tex-tile.c:
	* tests/test-paint-wrapper.c: Update the tests.

	* README: Update release notes.
2008-10-30 16:50:07 +00:00
Emmanuele Bassi
911b395c8a 2008-10-30 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1209 - Move fixed point API in COGL

	* clutter/cogl/cogl-fixed.h:
	* clutter/cogl/cogl.h.in:
	* clutter/cogl/common/Makefile.am:
	* clutter/cogl/common/cogl-fixed.c: Add fixed point API, modelled
	after the ClutterFixed. The CoglFixed API supercedes the ClutterFixed
	one and avoids the dependency of COGL on Clutter's own API.

	* clutter/cogl/common/cogl-clip-stack.c:
	* clutter/cogl/common/cogl-primitives.c:
	* clutter/cogl/common/cogl-primitives.h: Update internal usage of
	ClutterFixed to CoglFixed.

	* clutter/cogl/gl/Makefile.am:
	* clutter/cogl/gl/cogl-primitives.c:
	* clutter/cogl/gl/cogl-texture.c:
	* clutter/cogl/gl/cogl.c: Ditto, in the GL implementation of the
	COGL API.

	* clutter/cogl/gles/Makefile.am:
	* clutter/cogl/gles/cogl-fbo.c:
	* clutter/cogl/gles/cogl-gles2-wrapper.c:
	* clutter/cogl/gles/cogl-primitives.c:
	* clutter/cogl/gles/cogl-texture.c:
	* clutter/cogl/gles/cogl.c: Ditto, in the GLES implementation of
	the COGL API.

	* clutter/pango/pangoclutter-glyph-cache.c:
	* clutter/pango/pangoclutter-glyph-cache.h: Ditto, in the Pango
	renderer glyphs cache.

	* clutter/clutter-fixed.c:
	* clutter/clutter-fixed.h: ClutterFixed and related API becomes
	a simple transition API for bindings and public Clutter API.

	* clutter/clutter-actor.c:
	* clutter/clutter-alpha.c:
	* clutter/clutter-backend.c:
	* clutter/clutter-behaviour-depth.c:
	* clutter/clutter-behaviour-ellipse.c:
	* clutter/clutter-behaviour-path.c:
	* clutter/clutter-behaviour-rotate.c:
	* clutter/clutter-behaviour-scale.c:
	* clutter/clutter-clone-texture.c:
	* clutter/clutter-color.c:
	* clutter/clutter-entry.c:
	* clutter/clutter-stage.c:
	* clutter/clutter-texture.c:
	* clutter/clutter-timeline.c:
	* clutter/clutter-units.h: Move from the internal usage of
	ClutterFixed to CoglFixed.

	* doc/reference/clutter/clutter-sections.txt:
	* doc/reference/cogl/cogl-docs.sgml:
	* doc/reference/cogl/cogl-sections.txt: Update the documentation.

	* tests/test-cogl-tex-tile.c:
	* tests/test-project.c: Fix tests after the API change

	* README: Add release notes.
2008-10-30 16:37:55 +00:00
Neil Roberts
04ce490c0a Bug 1074 - FBOs on GLES
* clutter/cogl/gles/cogl-fbo.c: Copy the code from gl/cogl-fbo but
	use the API calls directly instead of loading an extension because
	it is part of the core in GLES 2.

	* clutter/cogl/gles/cogl.c (_cogl_features_init): Report
	COGL_FEATURE_OFFSCREEN.

	* clutter/cogl/gles/cogl-fbo.h (CoglFbo): Add gl_stencil_handle.

	* clutter/cogl/gles/cogl-context.h (CoglContext): Add
	viewport_store

	* tests/test-fbo.c (make_shader): Conditionally use the GLES 2
	names of the shader variables
2008-10-29 14:52:48 +00:00
Neil Roberts
f2c19971e5 Bug 1206 - Picking disabled dithering
* clutter/clutter-main.c (_clutter_do_pick): After picking is
	finished, restore the state of glEnable (GL_DITHER). Otherwise it
	will cause the scene to look different after the first pick on low
	depth displays. (Thanks to Michael Boccara for the patch)
2008-10-29 12:19:27 +00:00
Robert Bragg
1f2813ceda 2008-10-28 Robert Bragg <robert@linux.intel.com>
* pangoclutter-render.c: Replace #include <cairo/cairo.h> with
	#include <cairo.h> (Thanks to Carl Worth for spotting that)
2008-10-28 22:56:02 +00:00
Thomas Wood
15af9b9b48 * clutter/clutter-color.c (param_color_set_default): Set the no copy
flag when setting the default param spec value to prevent invalid
	frees.
2008-10-28 11:45:04 +00:00
Neil Roberts
82d43ffe64 Bug 1189 - Backface culling
* clutter/cogl/gl/cogl-texture.c (cogl_texture_polygon)
	(_cogl_texture_quad_sw, _cogl_texture_quad_hw):
	* clutter/cogl/gles/cogl-texture.c (cogl_texture_polygon)
	(_cogl_texture_quad_sw, _cogl_texture_quad_hw): Enable backface
	culling in GL if it is requested.

	* clutter/cogl/gles/cogl-texture.c (_cogl_texture_quad_sw)
	(_cogl_texture_quad_hw):
	* clutter/cogl/gl/cogl-texture.c (_cogl_texture_quad_sw)
	(_cogl_texture_quad_hw): Reorder the
	vertices so that they are counter-clockwise.

	* clutter/cogl/gles/cogl-context.h (CoglContext): 
	* clutter/cogl/gl/cogl-context.h (CoglContext): Added a flag to
	store whether backface culling is currently enabled.

	* clutter/cogl/gles/cogl.c (cogl_enable_backface_culling): 
	* clutter/cogl/gl/cogl.c (cogl_enable_backface_culling): New
	function

	* doc/reference/cogl/cogl-sections.txt: Add
	cogl_enable_backface_culling
2008-10-27 14:36:52 +00:00
Neil Roberts
e43b7ddd3d Bug 1196 - Texture border drawing problems
* clutter/cogl/gl/cogl-texture.c (_cogl_texture_upload_subregion_to_gl)
	(_cogl_texture_upload_to_gl):

	* clutter/cogl/gles/cogl-texture.c (_cogl_texture_upload_to_gl)
	(_cogl_texture_upload_subregion_to_gl):
	
	When uploading data to a sliced texture, fill the waste pixels
	with copies of the edge of the real texture data. Otherwise the
	value of the waste pixels are undefined so it will show artifacts
	when the texture is scaled with GL_LINEAR and the pixels are
	blended in.
2008-10-27 12:39:22 +00:00
Emmanuele Bassi
3ced5a9086 2008-10-21 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-color.[ch] (clutter_value_set_color): Constify
	colors and values where needed.
2008-10-21 18:50:44 +00:00
Emmanuele Bassi
3abaf6841f 2008-10-21 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1197 - Missing const for clutter_init_with_args *

	* clutter/clutter-main.[ch] (clutter_init_with_args): Constify
	the string parameters. (Owen Taylor)
2008-10-21 18:48:13 +00:00
Neil Roberts
96c1a8543d Bug 1043 - COGL calls glTexSubImage2D() with out-of-bounds
values (SIGSEGV)

	* clutter/cogl/gl/cogl-texture.c
	(_cogl_texture_upload_subregion_to_gl): When iterating over the
	slices, discard ones that don't intersect immediatly otherwise it
	will call glTexSubImage2D with a negative width/height and then
	move the source position incorrectly. Thanks to Gwenole
	Beauchesne.
2008-10-20 15:54:17 +00:00
Emmanuele Bassi
0cd9345864 Declare clutter_color_new() 2008-10-20 10:36:41 +00:00
Neil Roberts
49192f60b6 Bug 1195 - ClutterBehaviourBspline only works for very short paths
* clutter/clutter-behaviour-bspline.c: Changed the CBZ_T_POW3 and
        CBZ_T_MUL functions so that they preserve more of the least
        significant bits. This fixes some of the jaggy behaviour with
        longer paths.
2008-10-20 09:43:12 +00:00
Emmanuele Bassi
8f1819cd52 2008-10-17 Thomas Wood <thomas@linux.intel.com>
reviewed by: Emmanuele Bassi <ebassi@linux.intel.com>

	* clutter/clutter-color.[ch]: Add GParamSpec and GValue integration
	for ClutterColor. With ClutterParamSpecColor it is possible to define
	color properties; with the GValue integration it's possible to
	automatically transform strings into colors and vice versa.

	(clutter_color_free): Allow NULL parameter to match other boxed
	types destructors.

	(clutter_color_new): Add a constructor for the ClutterColor boxed
	type, mostly for bindings.
2008-10-17 16:23:46 +00:00
Emmanuele Bassi
9cf5386bb1 2008-10-17 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-color.c (clutter_color_parse): Add checks
	for the arguments, to avoid trying to parse NULL strings.
2008-10-17 08:04:03 +00:00
Emmanuele Bassi
6d4667cb61 2008-10-16 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-container.[ch]: Add checks to the Container
	interface invocation methods, to avoid crashing or corrupting
	the stack when an actor does not implement every virtual
	function of the Container interface vtable. GObject allows this
	to happen so we must handle the case gracefully. This also means
	that we can classify some virtual function as mandatory (as is
	the case for ::add, ::remove and ::foreach) and some other
	optional.
2008-10-16 10:28:17 +00:00
Øyvind Kolås
c606547dcb Bug 1108 - Enter/Leave events logics wrt. skipped motion events
Handle dropped motion events when computing crossing events,
based on a patch from Gwenole Beauchesne.
* clutter/clutter-main.c: (clutter_event_get_device): internal static
utility function.
(clutter_do_event): generate enter/leave events for all pointer
events.
(generate_enter_leave_events): modified enter/leave events generator
to work for all pointer event types. Enter/leave events are now
delivered before the motion/button event that caused the crossing to
happen.
* clutter/clutter-event.c: (clutter_event_copy), (clutter_event_free):
removed reference counting logic that is not needed when the crossing
events are directly delivered.
2008-10-01 13:46:33 +00:00
Emmanuele Bassi
e3b80d147c 2008-09-25 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-event.h: Fix missing documentation.
2008-09-25 11:08:06 +00:00
Emmanuele Bassi
a87f34c177 2008-09-24 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1130 - CLUTTER_MOTION is not emitted when time goes backwards.

	* clutter/clutter-main.c (clutter_do_event): Check for time
	rollbacks inside the motion event throttling. (Pierce Liu)
2008-09-24 10:12:23 +00:00
Emmanuele Bassi
d3d29b194e 2008-09-23 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-timeout-pool.c: Reword previous commit.
2008-09-23 13:25:31 +00:00
Emmanuele Bassi
b3726e4d66 2008-09-23 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-timeout-pool.c:
	(clutter_timeout_pool_new): Fix previous commit: g_source_unref()
	is not needed. (Thanks to Neil Roberts)
2008-09-23 12:58:31 +00:00
Emmanuele Bassi
9ddfe73b39 2008-09-23 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1154 - clutter_timeout_pool_new() documentation doesn't say
	how to free

	* clutter/clutter-timeout-pool.c: Update the documentation to
	note that you must use g_source_unref() to free the timeout
	pool. (Murray Cumming)
2008-09-23 12:23:05 +00:00
Emmanuele Bassi
a4b0ffe1de 2008-09-23 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1124 - Clutter causes an additional size request in each
	allocation

	* clutter/clutter-actor.c:
	(clutter_actor_store_old_geometry): Store the allocation instead
	of causing a new size-request cycle. (Johan Bilien)
2008-09-23 11:15:38 +00:00
Emmanuele Bassi
9f0842bacb 2008-09-23 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1125 - Save an extra pango_layout_get_size in many cases

	* clutter/clutter-label.c:
	(clutter_label_create_layout_no_cache): Add a simple check
	before calling pango_layout_get_size(). (Johan Bilien)
2008-09-23 11:11:14 +00:00
Emmanuele Bassi
73adac987d 2008-09-23 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-alpha.c:
	(clutter_alpha_get_alpha): Do not return the cached value but
	just compute the current alpha value. The use case is pretty
	much straightforward: stop a timeline, advance it, and retrieve
	the alpha value before starting the timeline to adjust an
	animation dependent on the alpha. Caching the alpha value is
	not needed because the behaviours will always pass the alpha
	value inside the ::alpha-notify virtual function anyway, so
	there is no need for them to call clutter_alpha_get_alpha().

	This change makes it also possible to reliably unit-test
	ClutterAlpha.

	(timeline_new_frame_cb): Call clutter_alpha_get_alpha().
2008-09-23 09:41:08 +00:00
Tomas Frydrych
6b51ac4b77 2008-09-23 Tomas Frydrych <tf@linux.intel.com>
* clutter/clutter-main.c:
	    * clutter/clutter-main.h:
	    * clutter/clutter-private.h:
	    * clutter/x11/clutter-backend-x11.c:
	    (clutter_get_option_group_without_init):
	    Function to obtain clutter option group without opening display
	    (for use with foreign display and gtk_clutter_init). Bug 1033.

	    Stripped trailing whitespace.
2008-09-23 07:03:35 +00:00
Neil Roberts
72c9f88019 Bug 856 - Teardown sequence is borked
* clutter/clutter-main.c: Don't free the ClutterMainContext so
	that the main loop can be restarted.

	* clutter/eglx/clutter-backend-egl.c: 
	* clutter/eglnative/clutter-backend-egl.c: Register an atexit
	handler which disposes the backend object so that we are still
	guaranteed to call eglTerminate on GLES.
2008-09-22 16:36:27 +00:00
Emmanuele Bassi
77b1388d1c 2008-09-19 Emmanuele Bassi <ebassi@linux.intel.com>
Bug 1033 - Manually parsing command line options prevents
	initializing clutter

	* clutter/clutter-main.c:
	(post_parse_hook), (clutter_init_with_args),
	(clutter_parse_args), (clutter_init): Move the initialization
	of Clutter at the end of the post-parse hook of Clutter's
	GOptionGroup. Clutter must be initialized at the end of the
	argument parsing.
2008-09-19 13:22:12 +00:00
Emmanuele Bassi
6d17aa1a66 2008-09-19 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-main.c: Properly document the
	clutter_get_option_group() function and the invariant that
	after parsing Clutter's option group the library will be
	initialized. (Thanks to Tomas Frydrych for pointing this
	out)
2008-09-19 11:38:48 +00:00
Emmanuele Bassi
57bc2313d0 2008-09-19 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/x11/clutter-backend-x11.c: Properly document the
	usage of clutter_x11_set_display().

	* clutter/x11/clutter-x11.h: clutter_x11_set_display() is
	public API and should be declared in the header we install.
2008-09-19 10:28:51 +00:00
Neil Roberts
50a248764c Bug 1048 - SIGFPE in cogl_texture_set_region() with nvidia
* clutter/cogl/gl/cogl-texture.c (cogl_texture_set_region):
	* clutter/cogl/gles/cogl-texture.c (cogl_texture_set_region):
	Don't attempt to upload any data if the width or height of the
	subregion is zero. Thanks to Gwenole Beauchesne.
2008-09-18 13:16:15 +00:00
Neil Roberts
76faa8c7a6 Bug 1044 - cogl_get_viewport error
* clutter/cogl/gles/cogl.c (cogl_get_viewport): Use glGetIntegerv
	instead of glGetFixedv to read the viewport because the latter
	converts incorrectly on some hardware.
2008-09-18 11:24:27 +00:00
Neil Roberts
8681cb249c Bug 1080 - clutter_stage_read_pixels has upside-down y coordinate
* clutter/clutter-stage.c (clutter_stage_read_pixels): Use
	OpenGL's coordinate system for the arguments to glReadPixels (so
	that y zero is the bottom of the window). Use clutter_redraw
	instead of clutter_stage_paint to ensure the right GL context is
	selected. Set some of the glPixelStore parameters that might have
	been changed by Cogl.

	* tests/test-stage-read-pixels.c: Replace with a different test
	that gets a sub-region of the stage around the cursor.
2008-09-18 10:24:37 +00:00
Neil Roberts
6dac43ddeb Bug 1145 - Flicker on resize the window
* clutter/glx/clutter-stage-glx.c (clutter_stage_glx_realize):
	Don't set a backing pixel on the X window. Otherwise when the
	window resizes it will flicker when X paints the background
	immediatly before Clutter repaints the whole stage.
2008-09-17 13:25:50 +00:00
Neil Roberts
147880b148 * clutter/clutter-types.h: Swap left and right in the
documentation for ClutterGravity.
2008-09-17 10:40:40 +00:00
Neil Roberts
ae8bab0bc8 Bug 1121 - Setting anchor point doesn't work if set too early
* clutter/clutter-actor.c
	(clutter_actor_set_anchor_point_from_gravity)
	(clutter_actor_move_anchor_point_from_gravity): Add documentation
	to make it clear that the anchor point won't move when the actor
	is resized.
2008-09-17 10:40:32 +00:00
Neil Roberts
3fb00f9cdd Bug 1100 - WM_SIZE not handled correctly, user_resize and
window_style correction.

	* clutter/win32/clutter-stage-win32.c (get_window_style): Remove
	the WS_MAXIMIZEBOX style if the stage isn't resizable.
	(clutter_stage_win32_set_user_resize): Queue a redraw of the
	window frame when the user_resize property is changed.

	* clutter/win32/clutter-event-win32.c (message_translate): Don't
	update the size of the stage when handling WM_SIZE messages that
	result from the stage being minimized. Thanks to Roman Yazmin.
2008-09-16 16:00:31 +00:00
Tomas Frydrych
8be7e29a6b 2008-09-16 Tomas Frydrych <tf@linux.intel.com>
* clutter/glx/clutter-glx-texture-pixmap.c:
	    * clutter/x11/clutter-x11-texture-pixmap.c:
	    TFP resyncing on MapNotify/ConfigureNotify (bug  1020; patch by
	    Andy Wingo <wingo@pobox.com>).
2008-09-16 11:50:38 +00:00
Øyvind Kolås
7294239d64 * clutter/clutter-main.c: amended typo in gtk-doc. 2008-09-15 14:47:25 +00:00
Neil Roberts
8d429e8abc Bug 1034 - Picking doesn't work on Eee PC
* clutter/clutter-main.c (_clutter_id_to_color): When choosing a
	pick color, set all but the most significant of the unused
	bits. This should make make it more likely that the GL
	implementation will round down to the right value.

	* tests/test-pick.c: Test case for picking. It creates 192 actors
	at known positions and stores their gids. It then calls
	clutter_stage_get_actor_at_pos with each position to check that
	the right gid is returned.

	* tests/Makefile.am (noinst_PROGRAMS): Add test-pick
2008-09-12 12:43:25 +00:00
Neil Roberts
b16e75db2c Bug 1010 - ClutterLabel does not update the layout (again)
* clutter/clutter-label.c: Bring back layout caching. This time it
	will cache up to three different layouts. The width for which each
	layout was generated is stored so that if the same width is
	requested again it can use the cached version. If no cached
	version is available it will try to replace the oldest
	layout. 'Age' is determined by a counter which is incremented
	every time a layout is created. The cache is cleared after any
	property changes that might affect the layout.
	(struct _ClutterLabelPrivate): Removed extents_width,
	extents_height and context because they weren't used anywhere.

	* tests/test-label-cache.c: Add a test which checks whether the
	label is using a different layout when properties are
	changed. Also compares the extents of the label's layout with an
	independent layout and fails if they aren't the same.

	* tests/Makefile.am (noinst_PROGRAMS): Add test-label-cache
2008-09-12 10:31:44 +00:00
Neil Roberts
b83470366c Bug 1137 - Setting the anchor point does not trigger a re-paint
* clutter/clutter-actor.c (clutter_actor_set_property): When
	changing the anchor point properties, use set_anchor_pointu
	instead of changing the value directly so that a redraw will be
	queued.
	(clutter_actor_set_anchor_pointu): Queue a redraw when the anchor
	point is changed. Thanks to Johan Bilien.
2008-09-10 11:20:22 +00:00
Emmanuele Bassi
0515ee22c2 2008-08-27 Emmanuele Bassi <ebassi@openedhand.com>
Bug 1082 - Texture bitmap is destroyed in wrong way

	* clutter/cogl/common/cogl-bitmap-pixbuf.c:
	(_cogl_bitmap_from_file): Make a copy of the pixbuf data in
	the internal image loader so that we can keep working under
	the assumption that we are using the GLib memory allocation
	and deallocation functions.
2008-08-27 12:56:54 +00:00
Emmanuele Bassi
c34e17163d 2008-08-27 Emmanuele Bassi <ebassi@openedhand.com>
Bug 1099 - No ClutterScript API to get a list of IDs in a given file

	* clutter/clutter-script.[ch]: Add clutter_script_list_objects(),
	a function for retrieving all the objects built by a ClutterScript
	instance. (Based on a patch by Noah Gibbs)
2008-08-27 12:16:56 +00:00
Emmanuele Bassi
d03ad3dd41 2008-08-26 Emmanuele Bassi <ebassi@openedhand.com>
Bug 1090 - Label somtimes returns natural_width < min_width

	* clutter/clutter-label.c:
	(clutter_label_get_preferred_width): Check that the width of the
	layout is always greater than 0. (Johan Bilien)
2008-08-26 12:57:04 +00:00
Neil Roberts
607503ca43 Bug 1103 - Two typos in clutter documentation
* doc/reference/clutter/subclassing-ClutterActor.xml: Update the
	custom actor example since the Cogl API was changed to namespace
	all of the path related functions in cogl_path_*. Thanks to Nati
	Berkover.
	
	* clutter/clutter-score.c: Add missing parameter in example of
	calling clutter_score_start().
2008-08-19 10:55:49 +00:00
Neil Roberts
6b4a033efe Bug 1085 - Cursor is in wrong position on ClutterEntry if set
x-align property

	* clutter/clutter-entry.c (clutter_entry_paint): When calculating
	the position to draw the cursor at, take into account the
	alignment of the text. Queue a redraw when the x-align property is
	changed.
2008-08-18 15:33:38 +00:00
Neil Roberts
cd7b7c9c72 Bug 1091 - WM_MOUSEWHEEL (scroll-event) not handled correctlly
* clutter/win32/clutter-event-win32.c (message_translate): The
	coordinates in a WM_MOUSEWEEL message are given relative to the
	screen so they need to be converted to client coordinates before
	use. Thanks to Roman Yazmin.
2008-08-07 20:34:37 +00:00
Emmanuele Bassi
3e31f02211 2008-08-06 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-child-meta.c:
	(clutter_child_meta_set_property),
	(clutter_child_meta_class_init): Make the :container and
	:actor properties of ChildMeta construct-only, to allow
	bindings to actually use ChildMeta without abusing the API.

	* clutter/clutter-container.c (create_child_meta): Instead of
	setting the members of the ChildMeta structure, use the
	constructor properties.
2008-08-06 10:20:57 +00:00
Emmanuele Bassi
265f72ff2b 2008-08-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-keysyms.h: Resync with keysymdef.h inside Xorg.
2008-08-05 10:54:40 +00:00
Emmanuele Bassi
bd30ac8e28 2008-08-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-script.c:
	(clutter_script_default_connect): Improve wording and debug
	messages in the default autoconnection for signal handlers.
2008-08-04 16:33:43 +00:00
Emmanuele Bassi
fbe225d179 2008-08-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-script-parser.c:
	* clutter/clutter-script-private.h: Clean up the code; add a
	conversion function for reading a ClutterColor out of a
	JSON object or array definition.

	* clutter/clutter-script.c: Clean up the code; document properly
	how we translate from type name to type function.
2008-08-04 16:21:27 +00:00
Emmanuele Bassi
2e67125cc9 2008-08-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c: Rework and improve the documentation
	of the thread-safe timeout and idle source installer functions.
2008-08-04 10:36:37 +00:00
Neil Roberts
db4c5e2829 Bug 945 - Clipping+fbo cloning bugs
* clutter/cogl/gl/cogl.c: 
	* clutter/cogl/gles/cogl.c: 
	* clutter/cogl/cogl.h.in: Add cogl_clip_stack_save,
	cogl_clip_stack_restore, cogl_viewport and cogl_frustum.

	* clutter/cogl/gl/cogl-fbo.h: 
	* clutter/cogl/gl/cogl-fbo.c: Try to attach a stencil buffer when
	creating an FBO.

	* clutter/cogl/common/cogl-clip-stack.c: Add functions to save and
	restore the whole state of the stack.

	* clutter/clutter-texture.c (clutter_texture_paint): When
	rendering the FBO source, setup a temporary asymmetric perspective
	projection matrix to render it as it would appear on screen.

	* clutter/clutter-private.h: 
	* clutter/clutter-actor.c
	(_clutter_actor_apply_modelview_transform_recursive): No longer
	static and exported in clutter-private.h
2008-08-01 12:23:57 +00:00
Neil Roberts
fc73b84002 Bug 1071 - clutter_timeline_get_duration doesn't always work
* clutter/clutter-timeline.c: Calculate the 'duration' property
	on-demand instead of storing it as a member variable. Notify
	duration property changes whenever the fps or num_frames changes.
2008-08-01 11:09:43 +00:00
Neil Roberts
420dcf7437 Bug 1069 - Warnings with ClutterScore
* clutter/clutter-score.c (clutter_score_is_playing): Check
	whether priv->running_timelines is NULL before checking its
	length.
	(foreach_running_timeline): Remove the completed signal handler
	when stopping the score. Otherwise the completed callback will get
	called multiple times if the timeline is started later.
2008-08-01 11:09:31 +00:00
Neil Roberts
1e84798546 Bug 1075 - Difficult to bind clutter_stage_new
* clutter/clutter-stage.c (clutter_stage_dispose): Unrealize the
	stage before removing the update idle handler. Otherwise
	unrealizing causes another redraw to be queued and if the stage
	object remains alive it will cause an assert and abort.
2008-07-31 08:54:43 +00:00
Neil Roberts
6974c31ad5 * clutter/clutter-stage.c (clutter_stage_class_init): Added the
'perspective' property. All of the machinery was there to
	implement the property but somehow the call that actually installs
	it was missing.
2008-07-30 21:09:58 +00:00
Emmanuele Bassi
ba257b0196 2008-07-30 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-fixed.h:
	* clutter/clutter-units.h: Fix the upper and lower boundaries of
	ClutterFixed and ClutterUnit types; G_MAXINT16 and G_MININT16
	were not enough to describe those values.
2008-07-30 15:47:43 +00:00
Ross Burton
56be7fb7ea 2008-07-30 Ross Burton <ross@openedhand.com>
* clutter/clutter-main.c:
	Destroy the debugging timer when the context is freed.

	* clutter/clutter-stage.c:
	Free the stage title when the stage is finalized.
2008-07-30 15:01:37 +00:00
Neil Roberts
d6496254d6 * clutter/clutter-model.c (clutter_model_set_sorting_column): This
function is supposed to accept -1 to disable sorting. However it
	checks for whether the column is >= the number of columns, but
	clutter_model_get_n_columns() returns an unsigned int so the
	column number also gets promoted to unsigned for the
	comparison. Therefore -1 is always greater than the number of
	columns so it wouldn't let you set it.
2008-07-30 10:32:25 +00:00
Neil Roberts
7df15542e4 * clutter/clutter-timeline.c (clutter_timeline_list_markers): When
requesting the list of markers it was returning the marker data as
	a string instead of the name so it was copying garbage.
2008-07-26 14:00:32 +00:00
Neil Roberts
0d700d7abb * clutter/clutter-actor.c (clutter_actor_remove_clip)
(clutter_actor_set_clipu): Queue a redraw when the clip is
	changed.
2008-07-25 11:29:12 +00:00
Neil Roberts
7c8fdee369 * clutter/clutter-script.c: The example in the documentation
showed a color being specified as '0xff0000ff' but it should be
	'#ff0000ff'
2008-07-24 09:11:54 +00:00
Emmanuele Bassi
931c9edde3 2008-07-23 Emmanuele Bassi <ebassi@openedhand.com>
Bug 1062 - clutter_actor_query_coords() replacement in 0.8

	* clutter/clutter-deprecated.h: Fix the deprecation warning
	for clutter_actor_query_coords(). (Gwenole Beauchesne)
2008-07-23 12:20:35 +00:00
Emmanuele Bassi
d3d4f7be5a Fix the dependencies in the Makefile template 2008-07-17 11:17:32 +00:00
Neil Roberts
e33cce309a * clutter/clutter-texture.c:
* clutter/clutter-rectangle.c: 
	* clutter/clutter-group.c: 
	* clutter/clutter-entry.c: 
	* clutter/clutter-clone-texture.c: Remove unnecessary calls to
	cogl_{push,pop}_matrix. The matrix is preserved in
	clutter_actor_paint whenever the actor's transformation is applied
	so there should be no need to push the matrix in actor paint
	implementations unless it does some additional transformations
	itself.
2008-07-17 10:08:52 +00:00
Neil Roberts
9fbdee463d * clutter/cogl/common/cogl-primitives.c (cogl_path_rel_curve_to):
Fixed a typo in the second parameter which meant the curve was
	drawn incorrectly.
2008-07-14 19:22:17 +00:00
Emmanuele Bassi
d3e2b27cff 2008-07-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter.h: Include missing installed files.
2008-07-14 13:46:31 +00:00
Tomas Frydrych
7a33510e0c 2008-07-14 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-stage.c:
	    (clutter_stage_hide_cursor):
	    Fixed C&P bug that made it impossible to show cursor once hidden.

	    Stripped trailing whitespace.
2008-07-14 08:49:22 +00:00
Matthew Allum
d5369aa9bf 2008-07-13 Matthew Allum <mallum@openedhand.com>
* clutter/x11/clutter-x11-texture-pixmap.c:
        Call XSync in unredirect X error trap (Thanks to Andy Wingo)
2008-07-13 22:54:19 +00:00
Tomas Frydrych
5f8dc01de3 2008-07-11 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.c:
	    Move G_IMPLEMENT_INLINES before all other #include statements (bug
	    #1038).
2008-07-11 10:36:07 +00:00
Tomas Frydrych
9b4daec78b 2008-07-11 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.c:
	    Changed #define G_IMPLEMENTS_INLINES to G_IMPLEMENT_INLINES (bug
	    #1038).
2008-07-11 10:12:05 +00:00
Matthew Allum
34329a1ffb 008-07-10 Matthew Allum <mallum@openedhand.com>
* clutter/cogl/gles/cogl-fbo.c:
        * clutter/cogl/gles/cogl-texture.c:
        Fix warnings with eglnative build
2008-07-10 16:19:09 +00:00
Matthew Allum
18e1dfb232 2008-07-10 Matthew Allum <mallum@openedhand.com>
* clutter/glx/clutter-glx-texture-pixmap.c:
        Assume TFP npots sized textures are always supported if TFP ext is!
        (Based on patch from James Ketrenos)
2008-07-10 00:12:23 +00:00
Matthew Allum
34f6defca9 2008-07-08 Matthew Allum <mallum@openedhand.com>
Bug 1011 - Fix TFP fallback mechanism (take 2)

        * clutter/glx/clutter-glx-texture-pixmap.c:
        * tests/test-pixmap.c:
        Slightly modified patch from Gwenole Beauchesne applied
       to better handle both falling back to non accelerated tfp
       and improvements to the test case.
2008-07-08 11:58:08 +00:00
Matthew Allum
0a1ad0342e 2008-07-07 Matthew Allum <mallum@openedhand.com>
Bug 1016 - Changing window-redirect-automatic property after
                   creating ClutterX11TexturePixmap doesn't work.

        * clutter/x11/clutter-x11-texture-pixmap.c:
        (clutter_x11_texture_pixmap_set_window):
        Sync up redirection prop correctly (Jason Tackaberry)
2008-07-07 22:28:13 +00:00
Matthew Allum
cc43d7a30d 2008-07-07 Matthew Allum <mallum@openedhand.com>
Bug 1019 - clutter-frame-source.h not included by clutter.h

        * clutter/clutter.h:
        Add missing header include.
2008-07-07 22:18:27 +00:00
Neil Roberts
34a7433c6f * clutter/clutter-actor.h: Remove redundant duplicate declaration
of clutter_actor_allocate_preferred_size
2008-07-05 15:56:03 +00:00
Emmanuele Bassi
8e4ed73af8 2008-07-05 Emmanuele Bassi <ebassi@openedhand.com>
Bug 1033 - Manually parsing command line options prevents
	           initializing clutter (Armin Burgmeier)

	* clutter/clutter-main.c:
	(post_parse_hook), (clutter_init_real): Set the is_initialized
	flag inside the real initialization function.
2008-07-05 12:39:37 +00:00
Emmanuele Bassi
4d51f3e7ea 2008-07-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-label.c: Properly document the behaviour
	of the :alignment property.
2008-07-04 12:27:03 +00:00
Neil Roberts
167475e422 Bug 1015 - Cloning unparented actors with FBOs doesn't work with
new layout code

	* clutter/clutter-texture.c (clutter_texture_new_from_actor): Now
	parents the source actor if it doesn't already have a parent so
	that it will get an allocation during layout.

	* tests/test-fbo.c: One of the tests tries to ensure that the
	ClutterTexture clone keeps the source actor alive by derefing
	it. However as actors have a floating reference then test-fbo
	doesn't have its own reference once the source is parented so
	unrefing just steals the parent's reference and causes
	badness. The test now claims the floating reference before cloning
	the source so that it can safely be unref'd later.
2008-07-04 10:44:18 +00:00
Emmanuele Bassi
00e327fbec 2008-07-03 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/x11/Makefile.am: Fix distchecking by adding the
	generated enum types files to DISTCLEANFILES.
2008-07-03 17:07:51 +00:00
Tomas Frydrych
f3d5d9d757 2008-07-03 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-fixed.h:
	    * clutter/clutter-fixed.c
	    Fixed inlining of clutter_qmulx() and clutter_qdivx() (bug 1022).
2008-07-03 12:30:36 +00:00
Neil Roberts
0ee57b37cd * clutter/clutter-shader.c (bind_glsl_shader): Fix a cut-and-paste
error which broke vertex shaders
2008-07-03 12:29:03 +00:00
Øyvind Kolås
60341ad959 * clutter/cogl/common/cogl-bitmap-pixbuf.c:
(_cogl_bitmap_from_file): removed debug g_printf that announces each
successful image load done by the internal image backend.
2008-07-03 09:49:06 +00:00
Neil Roberts
919efb5a6f * clutter/clutter-actor.c
(clutter_actor_get_abs_allocation_vertices): The initialization of
	the local stage pointer got moved away in revision 3081 so it was
	crashing if the function is called before the layout is run.
2008-07-02 16:15:30 +00:00
Emmanuele Bassi
9056e3ac4c 2008-07-02 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-label.c:
	(clutter_label_create_layout_no_cache),
	(clutter_label_create_layout): Split the layout creation in two
	functions: one creating the layout, the other creating the layout
	and hitting the glyphs cache. The first one is for the offscren
	operations - like requesting the preferred size; the second one
	is for paint and allocation.
	
	(clutter_label_allocate): Try to aggressively cache the PangoLayout
	between allocations - to avoid recreating it even when the label
	just moved because of an animation. See bug #1010.
2008-07-02 14:36:35 +00:00
Øyvind Kolås
5829aa8210 * clutter/fruity/clutter-fruity.c: made the multi touch code more
robust. There are situations though where the device seems to stop
generating any touch events until all fingers have been lifted and
a new interaction session is started.
2008-07-02 13:44:53 +00:00
Neil Roberts
1001d1ffa1 * clutter/eglx/clutter-stage-egl.c (clutter_stage_egl_realize):
Use clutter_x11_has_event_retrieval() instead of
	!backend_x11->no_xevent_retrieval to reflect the changes to the
	GLX backend in revision 3078
2008-07-02 09:48:06 +00:00
Emmanuele Bassi
12fd095006 2008-07-02 Emmanuele Bassi <ebassi@openedhand.com>
Bug 1010 - ClutterLabel does not update the layout (Lee Jusung)

	* clutter/clutter-actor.c:
	(clutter_actor_queue_relayout): Remove some pointer dereferencing.
	
	* clutter/clutter-label.c:
	(clutter_label_allocate): Revert the change of r2883 and remove the
	layout width cache and force a recreation of the layout every time
	we receive an allocation.
2008-07-02 09:24:25 +00:00
Neil Roberts
cfd91cd0ef * clutter/clutter-actor.c (clutter_actor_get_transformed_sizeu):
This is now do-what-I-mean like clutter_actor_get_size so that if
	the allocation box is available it will use that, otherwise it
	will use the preferred size. clutter_actor_transform_vertices has
	been converted to clutter_actor_transform_and_project_box so that
	it can be used by both functions. Based on a patch by Emmanuele
	Bassi.
	(clutter_actor_get_abs_allocation_vertices)
	(clutter_actor_get_allocation_vertices): These two functions now
	force a relayout if the allocation box is not available.

	* tests/test-fbo.c: Fixed the shader to use texture2D instead of
	texture2DRect now that GL_EXT_texture_rectangle is no longer used.
2008-07-01 21:52:19 +00:00
Chris Lord
9ed5d2577d * clutter/clutter-stage.c:
Add a note to the clutter_stage_read_pixels doc that the alpha channel
        isn't guaranteed to contain sensible data

        * tests/test-stage-read-pixels.c: (update_snapshot):
        Overwrite the alpha data when using clutter_stage_read_pixels; fixes
        this test on non-nvidia drivers
2008-07-01 14:08:24 +00:00
Matthew Allum
be160d971a 2008-07-01 Matthew Allum <mallum@openedhand.com>
* clutter/glx/clutter-stage-glx.c:
        * clutter/x11/clutter-backend-x11.c:
        * clutter/x11/clutter-backend-x11.h:
        * clutter/x11/clutter-event-x11.c:
        * clutter/x11/clutter-x11.h:
        * tests/test-devices.c:
        Disable use of XInput and add an explicit clutter_x11_enable_xinput
        to enable it.
        Also fix up the x11 pre-init calls to not need g_type_init.
2008-07-01 13:41:23 +00:00
Øyvind Kolås
6f68ae35b7 Bug 1013 - Per device grabs are not obeyed in pointer device propagation.
* clutter/clutter-event.c: (clutter_event_get_device_id): swap
arguments of g_return_val_if_fail around.
* clutter/clutter-event.h: added *device field to crossing events as
well.
* clutter/clutter-main.c: (emit_pointer_event): added a device
argument and check for per device grabs if this device is passed.
(clutter_do_event): pass the device if present for all pointer event
emissions.
(generate_enter_leave_events): copy the device from the motion events
when generating enter/leave events.
2008-07-01 11:51:20 +00:00
Chris Lord
00f77ed840 * clutter/clutter-texture.c:
Correct documentation about accepted pixel formats

        * tests/test-stage-read-pixels.c: (main):
        Don't try to free a ClutterTexture after main, fixes segfault on quit
2008-07-01 10:11:39 +00:00
Emmanuele Bassi
07f68e61f8 2008-07-01 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-behaviour-bspline.h:
	* clutter/clutter-behaviour.h:
	* clutter/clutter-event.h:
	* clutter/clutter-texture.h: Add missing documentation and
	change the copyright and licensing notice to use the FSF
	website instead of its address. (#512)
2008-07-01 10:08:28 +00:00
Matthew Allum
5beb8b7779 2008-06-30 Matthew Allum <mallum@openedhand.com>
Bug 1008 - tfp still a bit borked

        * clutter/x11/clutter-x11-texture-pixmap.c:
        Fix from Andy Wingo for sync_window borkage
2008-06-30 22:00:49 +00:00
Neil Roberts
604990a53b Bug 985 - MSC math.h / M_PI issue
* clutter/cogl/gl/cogl.c (set_clip_plane): 
	* clutter/clutter-alpha.c (sinc_func): Use G_PI instead of M_PI
	because M_PI isn't defined in MSVC without a special
	#define. Thanks to Haakon Sporsheim
2008-06-30 16:15:53 +00:00
Neil Roberts
abbcf0ee4b * clutter/win32/clutter-backend-win32.c (check_vblank_env): Use
g_ascii_strcasecmp instead of strcasecmp because strcasecmp isn't
	available in MSVC.
2008-06-30 16:08:45 +00:00
Matthew Allum
7d59aa3da0 2008-06-30 Matthew Allum <mallum@openedhand.com>
Bug 1007 - Fix TFP fallback mechanism

        * clutter/glx/clutter-glx-texture-pixmap.c:
        * clutter/x11/clutter-x11-texture-pixmap.c:
        Add some extra safety to glx pixmap creations and tidy up some notes.
        Patch from Gwenole Beauchesne.
2008-06-30 16:06:36 +00:00
Neil Roberts
06d0696874 * clutter/x11/clutter-event-x11.c:
* clutter/win32/clutter-event-win32.c: Use the HAVE_CONFIG_H guard
	around #include "config.h"
2008-06-30 16:01:56 +00:00
Emmanuele Bassi
b510d2827c 2008-06-30 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/Makefile.am:
	* clutter/eglx/Makefile.am:
	* clutter/glx/Makefile.am: Build the X11 base backend before
	the backends that depend on it.
2008-06-30 15:58:25 +00:00
Emmanuele Bassi
ad221bfe4e 2008-06-30 Emmanuele Bassi <ebassi@openedhand.com>
Bug 1000 - clutter-x11 should define gtypes for its enumerations

	* clutter/x11/Makefile.am:
	* clutter/x11/clutter-event-x11.c:
	* clutter/x11/clutter-x11-enum-types.c.in:
	* clutter/x11/clutter-x11-enum-types.h.in:
	* clutter/x11/clutter-x11.h: Add the GTypes for the X11-specific
	enumerations, so that they can be used by the bindings. (Andy
	Wingo)
2008-06-30 15:03:42 +00:00
Matthew Allum
ac02680447 2008-06-30 Matthew Allum <mallum@openedhand.com>
Bug 997 - automatic updates not working for named TFP pixmaps,
                  at least in x11

        * clutter/glx/clutter-glx-texture-pixmap.c:
        * clutter/glx/clutter-glx-texture-pixmap.h:
        * clutter/x11/clutter-backend-x11.c:
        * clutter/x11/clutter-x11-texture-pixmap.c:
        * clutter/x11/clutter-x11-texture-pixmap.h:
        * clutter/x11/clutter-x11.h:
        * configure.ac:
        * tests/test-pixmap.c:
        Rework Andy Wingos patch a little adding more safety for now also
        handling redirect Windows (as well as pixmaps)
2008-06-30 14:36:49 +00:00
Emmanuele Bassi
edca282ad0 2008-06-30 Emmanuele Bassi <ebassi@openedhand.com>
Bug 980 - cogl-bitmap-fallback.c compiler error/warning due to
	          cast issue (Haakon Sporsheim)

	* clutter/cogl/common/cogl-bitmap-fallback.c:
	(_cogl_unpremult_alpha_last),
	(_cogl_unpremult_alpha_first): Cast to avoid a compiler warning
	with MSC.
2008-06-30 14:20:46 +00:00
Øyvind Kolås
5525d0cad7 Disable XInput handling for keyboard events, re-enabling key press and
release events when pointer is outside window as well as re-enabling
keyrepeat.
* clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_realize): select
for KeyPressMask and KeyReleaseMask even with XInput enabled.
* clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput): 
Disabled the XInput keyboard code paths (comments and #if 0's)
* clutter/x11/clutter-event-x11.c: (event_translate): always handle
keyboard events without regard to XInput.
2008-06-30 14:01:03 +00:00
Matthew Allum
9fa47035ac 2008-06-29 Matthew Allum <mallum@openedhand.com>
* clutter/x11/clutter-event-x11.c:
        ifdef convert_xdevicekey_to_xkey () with XINPUT check.
        (fix via Andy Wingo)
2008-06-29 22:19:20 +00:00
Tommi Komulainen
4471e886f5 OSX: don't depend on ClutterGLWindow
* clutter/osx/clutter-osx.h (_clutter_event_osx_put)
	* clutter/osx/clutter-event-osx.c (clutter_event_osx_translate,
	NSEvent:clutterStage:)
	* clutter/osx/clutter-stage-osx.c (EVENT_HANDLER): Since events are
	delivered to ClutterGLView, pass the associated ClutterStage directly
	to event translation. Avoids relying on being embedded in
	ClutterGLWindow, which makes it easier to implement clutter-gtk.
2008-06-29 10:31:31 +00:00
Tommi Komulainen
079747e8cb OSX: document Shift modifier speciality
* clutter/osx/clutter-event.osx.c (NSEvent:clutterKeyVal:): Add
	comment, on OSX backend the Shift modifier is included in 'keyval'
	making it identical to 'unicode_value'  Instead of <Shift>a or
	<Shift>3 you'd get <Shift>A and <Shift>#
2008-06-29 10:31:05 +00:00
Matthew Allum
03d7fdacd6 2008-06-27 Matthew Allum <mallum@openedhand.com>
* clutter/cogl/gl/cogl.c:
        Temp workaround for 10.4 ATI card OSX folks, see #929
        (Tommi Komulainen)

        Bug 998 - clutter always captures X input events

* clutter/eglx/clutter-stage-egl.c:
        * clutter/glx/clutter-stage-glx.c:
When we disable X event retrival, dont still select for window
events.
2008-06-27 23:02:30 +00:00
Emmanuele Bassi
17f46e57f3 2008-06-27 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-event.h:
	* clutter/clutter-main.c:
	* clutter/x11/clutter-backend-x11.c: Add further documentation,
	and increase the coverage to 94%.
2008-06-27 21:13:19 +00:00
Neil Roberts
114148bab5 Bug 993 - Underline colors are sometimes wrong
* clutter/pango/pangoclutter-render.c: Fixed so that instead
	of trying to set the color in prepare_run it uses draw_glyphs
	to draw groups of glyphs and requests the color for each part
	from Pango.
2008-06-27 14:36:59 +00:00
Emmanuele Bassi
d88d2a6061 Fix the previous commit 2008-06-26 22:36:25 +00:00
Emmanuele Bassi
a07d57572c 2008-06-26 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
	(clutter_actor_set_min_width),
	(clutter_actor_set_min_height),
	(clutter_actor_set_natural_width),
	(clutter_actor_set_natural_height): Ignore any override of the
	minimum and natural size of the stage on backends that only
	support static stages.

	* clutter/clutter-stage.c (clutter_stage_allocate): Use the
	preferred size of the ClutterStage implementation instead of
	the display size.

	* clutter/clutter-backend.[ch]: Remove get_display_size() and
	clutter_backend_get_display_size().

	* clutter/eglnative/clutter-backend-egl.c:
	* clutter/fruity/clutter-backend-fruity.c:
	* clutter/osx/clutter-backend-osx.c:
	* clutter/sdl/clutter-backend-sdl.c:
	* clutter/win32/clutter-backend-win32.c:
	* clutter/x11/clutter-backend-x11.c: Remove get_display_size()
	implementations.
2008-06-26 21:42:44 +00:00
Emmanuele Bassi
b6aa1ca9ec 2008-06-26 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-shader.c (bind_glsl_shader): Verify that the
	vertex shader has been successfully compiled, like we do with
	the fragment shader.
2008-06-26 13:54:13 +00:00
Emmanuele Bassi
561e95eedf 2008-06-26 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/osx/clutter-backend-osx.c:
	(clutter_backend_osx_get_display_size): Fix the allocation pool
	macro name.
2008-06-26 13:52:35 +00:00
Matthew Allum
244995a834 2008-06-26 Matthew Allum <mallum@openedhand.com>
* clutter/glx/clutter-glx-texture-pixmap.c:
        Move the gl extension probe into the regular object init() rather than
        class_init. Should be a little safer.
2008-06-26 09:47:58 +00:00
Neil Roberts
5f3db8e0a0 * clutter/win32/clutter-backend-win32.c
(clutter_backend_win32_get_display_size): Implement
	get_display_size on the Win32 backend.
2008-06-25 16:51:43 +00:00
Emmanuele Bassi
dd185940c0 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.h: Make the priority constants public.

	* clutter/clutter-stage.c: Use CLUTTER_PRIORITY_REDRAW.

	* clutter/clutter-timeline.c: Use CLUTTER_PRIORITY_TIMELINE.
2008-06-25 16:46:42 +00:00
Emmanuele Bassi
ce348f805c 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/osx/clutter-backend-osx.c:
	(clutter_backend_osx_get_display_size),
	(clutter_backend_osx_class_init): Implement the get_display_size
	function.
2008-06-25 15:59:54 +00:00
Emmanuele Bassi
eb6fba284d 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
	(clutter_actor_set_min_width),
	(clutter_actor_set_min_height),
	(clutter_actor_set_natural_width),
	(clutter_actor_set_natural_height): Add a comment explaining
	the override in place for backends providing a fixed size
	on a stage.
2008-06-25 15:02:13 +00:00
Emmanuele Bassi
79b214e1f1 2008-06-25 Emmanuele Bassi <set EMAIL_ADDRESS environment variable>
* clutter/clutter-actor.c:
	(clutter_actor_set_min_width),
	(clutter_actor_set_min_height),
	(clutter_actor_set_natural_width),
	(clutter_actor_set_natural_height): If setting the minimum
	and natural width and height on a top-level actor, and on
	a backend that provides only static stages, then override
	the value and use the size of the display as returned by
	the backend.

	* clutter/eglnative/clutter-stage-egl.c:
	(clutter_stage_egl_realize): Remove the setting of the
	minimum and natural width and height.
2008-06-25 14:47:00 +00:00
Emmanuele Bassi
8a51236858 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-stage.c:
	(clutter_stage_allocate): Minor optimization.

	(clutter_stage_init): Do not set the minimum size of the
	stage wrapper, and require that the backends set the size
	themselves.
2008-06-25 14:20:27 +00:00
Emmanuele Bassi
72bdcccf26 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/eglnative/clutter-stage-egl.c:
	(clutter_stage_egl_realize): Try to force the minimum and
	natural size on realization.
2008-06-25 13:52:17 +00:00
Emmanuele Bassi
d651cc4337 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-backend.c:
	(clutter_backend_get_display_size): Provide a fallback for
	backends not implementing get_display_size().

	* clutter/clutter-stage.c:
	(clutter_stage_allocate): Add debug messages.

	* clutter/sdl/clutter-backend-sdl.c:
	(clutter_backend_sdl_get_display_size),
	(clutter_backend_sdl_class_init): Implement get_display_size()
	on the SDL backend.
2008-06-25 13:32:03 +00:00
Chris Lord
631277be44 * clutter/clutter-fixed.c: (clutter_sinx):
Fix clutter_sinx for angles > CFX_2PI - CFX_ONE. Also add note to
        documentation about being able to use modulus with ClutterFixed
2008-06-25 13:21:25 +00:00
Emmanuele Bassi
49c5c97dd8 Fix another typo 2008-06-25 13:18:21 +00:00
Emmanuele Bassi
09956cba74 Fix typo 2008-06-25 13:16:07 +00:00
Emmanuele Bassi
8008bfea25 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-backend.h:
	* clutter/clutter-backend.c:
	(clutter_backend_get_display_size): Add a function for getting the
	display size out of the backend.

	* clutter/clutter-stage.c:
	(clutter_stage_allocate): When allocating on a backend with a
	static stage, we simply ignore the passed box and override it with
	the size of the display.

	* clutter/eglnative/clutter-backend-egl.c:
	(clutter_backend_egl_get_display_size),
	(clutter_backend_egl_class_init): Implement get_display_size() by
	returning the size of the EGL surface.

	* clutter/fruity/clutter-backend-fruity.c:
	(clutter_backend_egl_get_display_size),
	(clutter_backend_egl_class_init): Ditto as above.

	* clutter/x11/clutter-backend-x11.c:
	(clutter_backend_x11_get_display_size),
	(clutter_backend_x11_class_init): Implement get_display_size() by
	returning the DisplayWidth and DisplayHeight of the current
	screen.
2008-06-25 13:05:59 +00:00
Neil Roberts
1049959d34 * clutter/win32/clutter-stage-win32.c
(clutter_stage_win32_realize): Use a more direct method to choose
	the best pixel format instead of ChoosePixelFormat because
	otherwise if the display's depth is 16 then it will prefer the
	non-accelerated software implementation when the requested depth
	is 24.
2008-06-25 12:25:43 +00:00
Emmanuele Bassi
09097fc810 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-stage.c (clutter_stage_allocate): Fix condition;
	should always test before committing.
2008-06-25 12:08:49 +00:00
Matthew Allum
6371f0c621 2008-06-25 Matthew Allum <mallum@openedhand.com>
* clutter/x11/clutter-backend-x11.c: (_clutter_x11_register_xinput)
        Add extra safety and fallback if no useable pointing devices are
        found.
2008-06-25 12:02:11 +00:00
Emmanuele Bassi
8b1385ed23 2008-06-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-stage.c:
	(clutter_stage_allocate): Check if the stage provided by the
	backend is static (i.e. a framebuffer that cannot be resized)
	and interrupt the allocation chain there.

	* clutter/eglnative/clutter-stage-egl.c:
	(clutter_stage_egl_class_init): Remove the ::allocate empty
	stub.
2008-06-25 11:49:43 +00:00
Matthew Allum
b84c5311ee 2008-06-25 Matthew Allum <mallum@openedhand.com>
* clutter/eglnative/clutter-stage-egl.c:
        * clutter/eglx/clutter-stage-egl.c:
        Disable passing of attribs to eglCreateContext() on GLES 1.1 h/w
2008-06-25 11:17:43 +00:00
Neil Roberts
ed44a845a5 * clutter/clutter-actor.c (clutter_actor_paint): Guard against the
actor clip being enabled or disabled in an actor paint
	method. Otherwise the clip stack can be become unbalanced. This
	was happening in ClutterEntry until it was fixed in revision 2983.
2008-06-25 08:40:25 +00:00
Neil Roberts
feb16bcf95 Bug 979 - Wrong call convension for SwapIntervalProc in win32 backend
* clutter/win32/clutter-backend-win32.c: Use the correct calling
	convention for SwapInterval. Thanks to Haakon Sporsheim.
2008-06-24 22:07:15 +00:00
Emmanuele Bassi
5521867989 2008-06-24 Emmanuele Bassi <ebassi@openedhand.com>
Bug 989 - Add a search path for clutter script assets

	* clutter/clutter-script.h:
	* clutter/clutter-script.c:
	(clutter_script_finalize),
	(clutter_script_add_search_paths),
	(clutter_script_lookup_filename): Add the ability to define multiple
	search paths inside ClutterScript and to look up a specific filename
	inside those search paths. This is useful to define a set of
	directories where the assets for a UI definition are and still
	reference those assets by their name instead of the full path. (989,
	based on a patch by Matthew Allum)

	* clutter/clutter-texture.c:
	(clutter_texture_set_custom_property): Use the newly added
	clutter_script_lookup_filename() function.
2008-06-24 16:47:43 +00:00
Neil Roberts
d4da3a3e2a * clutter/cogl/gles/cogl-gles2-wrapper.h:
* clutter/cogl/gles/cogl-gles2-wrapper.c: All of the settings and
	uniforms are now proxied into COGL variables instead of setting
	the GL uniforms directly. Just before glDrawArrays is executed a
	shader is generated using the given settings to avoid using 'if'
	statements. The shaders are cached.

	* clutter/cogl/gles/cogl-fixed-vertex-shader.glsl: 
	* clutter/cogl/gles/cogl-fixed-fragment-shader.glsl: The shaders
	are now split into parts using comments instead of 'if' statements
	so that the simplest shader can be generated on the fly.

	* clutter/cogl/gles/stringify.sh: Now splits up the shader sources
	into separate C strings where deliminated by special comments.

	* clutter/cogl/gles/cogl-program.h: 
	* clutter/cogl/gles/cogl-program.c: A custom shader can no longer
	be directly linked with the fixed-functionality replacement
	because the replacement changes depending on the settings. Instead
	the bound shader is linked with the appropriate replacement shader
	just before glDrawArrays is executed. The custom uniform variables
	must also be proxied through COGL variables because their location
	can change when relinked.
2008-06-24 16:21:40 +00:00
Øyvind Kolås
eac5e21f1c * clutter/fruity/clutter-fruity.c: removed dead code and unused
variables.
2008-06-24 11:34:22 +00:00
Emmanuele Bassi
9bc15bb467 2008-06-24 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-entry.c:
	(clutter_entry_ensure_layout): Convert the invisible char
	to UTF-8 to avoid Pango barfing on us.
2008-06-24 10:40:58 +00:00
Matthew Allum
a692421945 2008-06-24 Matthew Allum <mallum@openedhand.com>
* clutter/eglnative/clutter-stage-egl.c:
        Add an extra debug note.
        * configure.ac:
        Generate version.xml for COGL API docs
2008-06-24 10:39:12 +00:00
Chris Lord
bc55368304 Bug 988 - cursor position wrong with multibyte invisible char
* clutter/clutter-entry.c: (clutter_entry_ensure_cursor_position):
        Fix cursor position calculation when using invisible text
2008-06-24 10:22:53 +00:00
Emmanuele Bassi
00efebe00a 2008-06-23 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/x11/clutter-event-x11.c (event_translate): Set the
	event type explicitly in the union members as well for the
	key events, like we do for all the other events.
2008-06-23 22:00:37 +00:00
Neil Roberts
e11d08807d * clutter/clutter-entry.c (clutter_entry_paint): Set the clip
using COGL directly instead of setting the actor clip. Otherwise
	the clip stack will be unbalanced after the first draw. This also
	frees up the actor clip to be set by an application.
2008-06-23 20:55:24 +00:00
Matthew Allum
20c384cab8 2008-06-23 Matthew Allum <mallum@openedhand.com>
Bug 987 - clutter-event.c c99 variable declaration

        * clutter/clutter-event.c:
        Remove c99ism.
2008-06-23 18:58:33 +00:00
Emmanuele Bassi
300d1ef025 Fixes for distcheck 2008-06-23 16:43:49 +00:00
Emmanuele Bassi
9006de848b 2008-06-23 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.c:
	(clutter_texture_get_preferred_width),
	(clutter_texture_get_preferred_height),
	(clutter_texture_set_property),
	(clutter_texture_get_property),
	(clutter_texture_class_init),
	(clutter_texture_init): Add the new :keep-aspect-ratio property
	to ClutterTexture; when set to TRUE the texture will return a
	preferred width maintaining the aspect ratio with the given height
	and a preferred height maintaining the aspect ratio with the
	given width. This allows to set the width or the height and have
	the texture automatically request the height or the width respectively
	while maintaining the aspect ratio of the original image.

	* tests/test-script.json: Update to test the new :keep-aspect-ratio
	property.
2008-06-23 15:31:12 +00:00
Neil Roberts
dff84094ff Bug 918 - Group doesn't clip if it's children are clipped
* clutter/cogl/common/cogl-clip-stack.h: 
	* clutter/cogl/common/cogl-clip-stack.c: Added functions to
	maintain a stack of clipping rectangles.

	* clutter/cogl/gles/cogl.c: 
	* clutter/cogl/gl/cogl.c: The cogl_clip_set and unset functions
	have moved into cogl-clip-stack.c which calls back to cogl.c to
	set the actual rectangles. Multiple clip rectangles are combined
	by merging the stencil buffers.

	* clutter/cogl/gles/cogl-primitives.c (_cogl_path_fill_nodes): 
	* clutter/cogl/gl/cogl-primitives.c (_cogl_path_fill_nodes): Merge
	the stencil buffer with the contents of the clipping stack after
	drawing the path.

	* clutter/cogl/gles/cogl-context.h (CoglContext): 
	* clutter/cogl/gl/cogl-context.h (CoglContext): Store the number
	of available stencil bits.

	* clutter/cogl/common/Makefile.am
	(libclutter_cogl_common_la_SOURCES): Added cogl-clip-stack.c
2008-06-23 14:57:36 +00:00
Robert Bragg
030ac047d1 2008-06-23 Robert Bragg <bob@o-hand.com>
* clutter/eglx/clutter-stage-egl.c: Makes sure the eglx backend
	passes the EGL_OPENGL_ES2_BIT surface attrib when using
	GLES2.0 under cogl
2008-06-23 13:09:08 +00:00
Chris Lord
6ba7710224 * clutter/x11/clutter-event-x11.c: (convert_xdevicekey_to_xkey),
(translate_key_event), (event_translate):
        Change the xinput event handling to use translate_key (fixes modifier
        handling with xinput key events)
2008-06-23 12:45:20 +00:00
Emmanuele Bassi
d9b657bdfc 2008-06-23 Emmanuele Bassi <ebassi@openedhand.com>
Bug 982 - __COGL_GET_CONTEXT MS compiler issue (Haakon Sporsheim)

	* clutter/cogl/common/cogl-handle.h:
	* clutter/cogl/common/cogl-primitives.c: Remove C99-isms.

	* clutter/cogl/gl/cogl-fbo.c:
	* clutter/cogl/gl/cogl-primitives.c:
	* clutter/cogl/gl/cogl-texture.c:
	* clutter/cogl/gl/cogl.c: Ditto as above.

	* clutter/cogl/gles/cogl-fbo.c:
	* clutter/cogl/gles/cogl-primitives.c:
	* clutter/cogl/gles/cogl-texture.c: Ditto as above.
2008-06-23 11:01:30 +00:00
Emmanuele Bassi
04e5b4a710 2008-06-23 Emmanuele Bassi <ebassi@openedhand.com>
Bug 984 - pango_clutter_render_layout() declared void, but
	          returns (Haakon Sporsheim)

	* clutter/pango/pangoclutter-render.c:
	(pango_clutter_render_layout): Do not use a return statement.
2008-06-23 10:37:43 +00:00
Emmanuele Bassi
a843a5f90e 2008-06-23 Emmanuele Bassi <ebassi@openedhand.com>
Bug 905 - Paint cursor directly (Xan López)

	* clutter/clutter-entry.c:
	(clutter_entry_paint_cursor),
	(clutter_entry_init),
	(clutter_entry_set_color): Directly paint the cursor on the
	entry instead of using an actor.
2008-06-23 10:32:43 +00:00
Emmanuele Bassi
87d68544d0 2008-06-23 Emmanuele Bassi <ebassi@openedhand.com>
Bug 981 - clutter_stage_read_pixels temprow fix (Haakon Sporsheim)

	* clutter/clutter-stage.c (clutter_stage_read_pixels): Allocate
	the temporary row data used to flip the buffer from glReadPixels()
	in order to fix compilation under MSVC. Also validate the input
	parameters to avoid random segfaults.
2008-06-23 10:06:02 +00:00
Matthew Allum
b241481586 2008-06-23 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-event.c:
        * clutter/clutter-event.h:
        * clutter/clutter-main.c:
        * clutter/clutter-main.h:
        * clutter/clutter-private.h:
        * clutter/eglx/clutter-stage-egl.c:
        * clutter/fruity/clutter-backend-fruity.c:
        * clutter/fruity/clutter-backend-fruity.h:
        * clutter/fruity/clutter-fruity.c:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/x11/clutter-backend-x11.c:
        * clutter/x11/clutter-backend-x11.h:
        * clutter/x11/clutter-event-x11.c:
        * clutter/x11/clutter-stage-x11.h:
        * clutter/x11/clutter-x11.h:
        * configure.ac:
        * tests/Makefile.am:
        * tests/test-devices.c:
        Merge of 'xinput' branch giving initial basic support of
        multiple input devices.
2008-06-23 09:55:42 +00:00
Matthew Allum
920687a470 2008-06-23 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-group.c:
        Remove uneeded (at least for now) paint_area method (#970)
2008-06-23 09:08:27 +00:00
Emmanuele Bassi
62cc9ec3c9 2008-06-19 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-script.c: Be more explicit about the fact that
	the script id is not the name of an actor, and that it is retrieved
	by using clutter_get_script_id().
2008-06-19 20:45:28 +00:00
Emmanuele Bassi
e29ae614b5 2008-06-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	(clutter_actor_allocate_preferred_size): Add more documentation
	and notes on where it's appropriate to call this function.
2008-06-17 15:59:08 +00:00
Chris Lord
b592efcf99 * clutter/clutter-texture.c: (clutter_texture_get_preferred_width),
(clutter_texture_get_preferred_height):
        Maintain aspect ratio with natural width/height when for_width/height
        are specified
2008-06-17 14:45:33 +00:00
Matthew Allum
2dbbee28d5 2008-06-17 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        Clean up of parenting code (see #972)
        Doc updates to section intro.
        Add clutter_actor_allocate_preferred_size () utility call

        * clutter/clutter-group.c: (clutter_fixed_layout_allocate):
        Use clutter_actor_allocate_preferred_size ()

        * doc/clutter-actor-invariants.txt:
        Add some more notes
2008-06-17 13:49:40 +00:00
Emmanuele Bassi
988cac1dfb 2008-06-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
	(clutter_actor_set_parent): Do not emit ::parent-set when
	reparenting.

	(clutter_actor_unparent): Ditto, as above.
	
	(clutter_actor_reparent): Emit ::parent-set with the old
	parent and set the IN_REPARENT flag unconditionally.
2008-06-17 12:39:37 +00:00
Emmanuele Bassi
ec91b3d253 2008-06-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
	(clutter_actor_set_parent): Document and maintain the invariant
	that after setting a realized parent on an actor, the actor is
	also going to be realized.

	(clutter_actor_unparent): Change the invariant that an unparented
	actor is also unrealized: the paint is fast enough to avoid
	unrealizing, since it also causes more problems that what it's
	worth.

	* tests/test-invariants.c (test_show_on_set_parent): Update the
	invariants test because we changed the invariants.
2008-06-17 09:33:18 +00:00
Jussi Kukkonen
d03314cb84 * clutter/clutter-score.c (clutter_score_append):
initialize "marker" string and "complete_id" signal id when creating a
	ClutterScoreEntry.
2008-06-17 08:55:54 +00:00
Tomas Frydrych
2ccfd3c08f 2008-06-16 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
	    (clutter_actor_move_anchor_point_from_gravity):
	    Fixed incorrect sign of position adjustment (revert of earlier
	    change).
2008-06-16 14:14:19 +00:00
Emmanuele Bassi
6ec5cc538c 2008-06-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c (clutter_actor_unparent): Reset the
	:show-on-set-parent property to TRUE when unparenting.

	* tests/Makefile.am: Add test-invariant to the build.

	* tests/test-invariants.c: Test the invariants that we are going
	to honour (and document, at some point).
2008-06-16 13:40:39 +00:00
Emmanuele Bassi
aef6fc5f61 2008-06-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/eglnative/clutter-stage-egl.c: Ignore any size allocation
	we receive from the user.

	* clutter/fruity/clutter-stage-fruity.c: Ditto as above.
2008-06-16 13:38:46 +00:00
Tomas Frydrych
1c4b1ce90e 2008-06-16 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
	    (clutter_actor_move_anchor_point):
	    (clutter_actor_move_anchor_pointu):
	    (clutter_actor_move_anchor_point_from_gravity):
	    Fixed incorrect sign of position adjustment.
	    Fixed replace call to _move_by with move_byu in
	    _move_anchor_pointu.

	    Stripped trailing whitespace.
2008-06-16 09:27:44 +00:00
Emmanuele Bassi
8996406189 2008-06-15 Emmanuele Bassi <ebassi@openedhand.com>
Bug #967 - Mismatch of Timeline::marker-reached signal signature

	* clutter/clutter-marshal.list:
	* clutter/clutter-timeline.c:
	(clutter_timeline_class_init): Fix the type of the frame_num
	argument in the ::marker-reached signal creation to match the
	signal class handler. (Armin Burgmeier)
2008-06-15 12:50:05 +00:00
Matthew Allum
6fe23fefe9 Revert miscommit of unfinished cogl changes in r2920 2008-06-14 22:07:23 +00:00
Matthew Allum
04bf04db4d 2008-06-14 Matthew Allum <mallum@openedhand.com>
* README:
        Make needed GL version 1.4, note GLES2 support, add some notes
        for COGL.
2008-06-13 23:03:45 +00:00
Emmanuele Bassi
a840375b81 Remove the "hiding" in the texture description 2008-06-13 15:37:58 +00:00
Emmanuele Bassi
4b97a02410 2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
	* clutter/clutter-actor.h:
	* tests/test-cogl-primitives.c:
	* tests/test-events.c:
	* tests/test-multistage.c:
	* tests/test-textures.c:
	* tests/test-timeline.c: Miscellaneous fixes for distcheck to
	pass.
2008-06-13 15:01:34 +00:00
Emmanuele Bassi
76b71f8cc4 2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.c:
	(clutter_texture_unrealize), (clutter_texture_dispose): Add a
	guard against reading back memory during the unrealization on
	dispose.
2008-06-13 14:58:18 +00:00
Emmanuele Bassi
e3de3f196b 2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>
Bug #953 - Actors are not hidden before unrealized or
	           disposed (Tommi Komulainen)

	* clutter/clutter-actor.c:
	(clutter_actor_unrealize): Hide a visible actor when unrealizing
	it.

	(clutter_actor_dispose): Make sure to unrealize an actor when
	disposing it.
2008-06-13 14:16:22 +00:00
Emmanuele Bassi
23c160886b 2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c:
	(clutter_actor_dispose), (clutter_actor_destroy),
	(clutter_actor_unparent): Clean up the actor's destruction
	sequence, making sure that every operation is performed
	under the CLUTTER_ACTOR_IN_DESTRUCTION internal flag.
2008-06-13 13:59:07 +00:00
Emmanuele Bassi
be0711b88b 2008-06-13 Emmanuele Bassi <ebassi@openedhand.com>
Bug #960 - PangoContext creation code should not be duplicated

	* clutter/clutter-private.h:
	* clutter/clutter-main.c:
	(_clutter_context_create_pango_context): Abstract the creation
	of the PangoContext inside its own function, to avoid code and
	bugs duplication. (Tommi Komulainen)

	* clutter/clutter-entry.c (clutter_entry_init): Use the newly
	added PangoContext creation function.

	* clutter/clutter-label.c (clutter_label_init): Ditto as above.
2008-06-13 09:10:39 +00:00
Emmanuele Bassi
d1006ca506 2008-06-12 Emmanuele Bassi <ebassi@openedhand.com>
Bug #964 - "unrealized" signal of ClutterActor wrongly named

	* clutter/clutter-actor.c (clutter_actor_class_init): Fix typo
	in the ::unrealize signal name. (Armin Burgmeier)
2008-06-12 17:24:07 +00:00
Emmanuele Bassi
a4c4e3464d 2008-06-12 Emmanuele Bassi <ebassi@openedhand.com>
* doc/reference/cogl/Makefile.am: Ignore cogl/gl and cogl/gles
	when building the documentation.

	* clutter/cogl/cogl.h.in: Add sections in the header file.
2008-06-12 17:21:16 +00:00
Emmanuele Bassi
13df7d579d 2008-06-12 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: Add more clarifications on the
	size and position accessors and the distinction between
	transformed and untransformed actor box inside the actor's
	description.
2008-06-12 16:34:50 +00:00
Emmanuele Bassi
da8eea1842 2008-06-12 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: Clarify the documentation of the
	accessors of the width and height.
2008-06-12 16:20:08 +00:00
Neil Roberts
e4304e2d0a * clutter/win32/clutter-stage-win32.c: Updated to the new layout
API. All code to do with positioning the stage has been removed so
	the window is left where Windows wants to put it and it can not be
	moved with clutter_actor_set_position.

	* clutter/win32/clutter-stage-win32.h (ClutterStageWin32): Remove
	win_xpos and win_ypos.

	* clutter/win32/clutter-event-win32.c (message_translate): Remove
	the handler for WM_MOVE because the stage no longer cares where it
	is positioned.
2008-06-12 12:12:25 +00:00
Emmanuele Bassi
8ff6cec829 2008-06-12 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Documentation fixes.

	* clutter/clutter-backend.c: Documentation fixes.

	* clutter/clutter-container.h: Documentation fixes.

	* clutter/clutter-fixed.c (clutter_qdivx): Fix the return
	value to be after the description.

	* clutter/clutter-texture.[ch]: Documentation fixes.

	* clutter/clutter-timeline.c: Documentation fixes.
2008-06-12 11:43:25 +00:00
Emmanuele Bassi
00a1e0c3ee 2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/eglnative/clutter-stage-egl.c: Remove a duplicate
	get_preferred_width() implementation. (thanks to Iain Holmes)
2008-06-11 17:32:22 +00:00
Neil Roberts
3d1d677902 * clutter/clutter-actor.c (clutter_actor_allocate): Fixed the
logic when detecting whether the actor has moved.
2008-06-11 17:12:29 +00:00
Iain Holmes
04df29dbd4 2008-06-11 Iain Holmes <iain@openedhand.com>
* configure.ac: Detect the GL headers in flavour=fruity

        * clutter/fruity/clutter-stage-fruity.c: Update the Fruity 
backend to 
        use the new size negotiation API.
2008-06-11 16:29:20 +00:00
Emmanuele Bassi
583ea401c3 2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-label.c (clutter_label_allocate): Keep the
	layout if the size of the allocation is the same as the last
	allocation received by the label.
2008-06-11 16:12:52 +00:00
Emmanuele Bassi
c859a2f7fd 2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: Notify :x, :y, :width and :height
	properties using ClutterUnits, not pixels.
2008-06-11 15:08:03 +00:00
Emmanuele Bassi
d642636fd1 2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/eglnative/clutter-stage-egl.c: Update the EGL native
	backend to use the new size negotiation API.
2008-06-11 10:19:02 +00:00
Emmanuele Bassi
bae4bd0796 2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/sdl/clutter-stage-sdl.c: Update the SDL backend to
	use the new size negotiation API.
2008-06-11 10:12:44 +00:00
Emmanuele Bassi
df86cb1ae3 2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
Bug #961 - Fails to build on OSX

	* clutter/osx/clutter-stage-osx.c: Update the OSX backend to
	use the new size negotiation API.
2008-06-11 09:45:22 +00:00
Neil Roberts
1aa77985f4 * clutter/clutter-main.c: Include <locale.h> for setlocale() 2008-06-10 21:25:23 +00:00
Emmanuele Bassi
4a788a6df7 2008-06-10 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-child-meta.c: Fix section name

	* clutter/clutter-container.c:
	(clutter_container_child_set_property),
	(clutter_container_child_get_property): Fix gtk-doc parameter
	name.

	* clutter/clutter-container.h: Fix documentation of the
	interface vfuncs.

	* clutter/clutter-event.h: Fix documentation.

	* clutter/clutter-feature.h: Fix documentation.

	* clutter/clutter-types.h: Add ClutterRequestMode.

	* clutter/x11/clutter-event-x11.c: Fix documentation.

	* tests/test-fullscreen.c: Verify that the stage size has been
	changed by clutter_stage_fullscreen().
2008-06-10 17:11:14 +00:00
Emmanuele Bassi
473d0e9fc3 2008-06-10 Emmanuele Bassi <ebassi@openedhand.com>
Bug #815 - Split up request, allocation, and paint box

	* clutter/clutter-actor.[ch]: Rework the size allocation,
	request and paint area. Now ::request_coords() is called
	::allocate(), and ::query_coords() has been split into
	::get_preferred_width() and ::get_preferred_height(). See
	the documentation and the layout test on how to implement
	a container and layout manager with the new API. (#915,
	based on a patch by Havoc Pennington, Lucas Rocha and Johan
	Bilien)

	* clutter/clutter-clone-texture.c: Port CloneTexture to
	the new size negotiation API; it just means forwarding
	the requests to the parent texture.

	* clutter/clutter-deprecated.h: Add deprecated and replaced
	API.

	* clutter/clutter-entry.c: Port Entry to the new size
	negotiation API.

	* clutter/clutter-group.c: Port Group to the new size
	negotiation API; the semantics of the Group actor do not
	change.

	* clutter/clutter-label.c: Port Label to the new size
	negotiation API, and vastly simplify the code.

	* clutter/clutter-main.[ch]: Add API for executing a
	relayout when needed.

	* clutter/clutter-private.h: Add new Stage private API.

	* clutter/clutter-rectangle.c: Update the get_abs_opacity()
	call to get_paint_opacity().

	* clutter/clutter-stage.c:
	(clutter_stage_get_preferred_width),
	(clutter_stage_get_preferred_height),
	(clutter_stage_allocate),
	(clutter_stage_class_init): Port Stage to the new size
	negotiation API.

	* clutter/clutter-texture.c: Port Texture to the new size
	negotiation API.

	* clutter/clutter-types.h: Add ClutterRequestMode enumeration.

	* clutter/x11/clutter-stage-x11.c: Port the X11 stage
	implementation to the new size negotiation API.

	* tests/Makefile.am: Add the layout manager test case.

	* tests/test-opacity.c: Update.

	* tests/test-project.c: Update.

	* tests/test-layout.c: Test case for a layout manager implemented
	using the new size negotiation API; the layout manager handles
	both transformed and untransformed children.
2008-06-10 17:07:52 +00:00
Emmanuele Bassi
8f013e1b22 Update svn:ignore property 2008-06-10 16:49:39 +00:00
Emmanuele Bassi
a930370b81 2008-06-10 Emmanuele Bassi <ebassi@openedhand.com>
* autogen.sh: Check for, and run glib-gettextize.

	* configure.ac: Set up the localization support.

	* clutter/clutter-main.c: Do not define the GETTEXT_PACKAGE,
	but use the one from the configure script.

	* po/POTFILES.in: Template for the translatable files.
2008-06-10 16:47:38 +00:00
Chris Lord
878b353568 * clutter/clutter-main.c: (pre_parse_hook):
Call setlocale on init
        
        * clutter/x11/clutter-event-x11.c: (translate_key_event):
        Fix typo and use the same buffer size as xev
2008-06-10 14:01:43 +00:00
Øyvind Kolås
8fcfd8ff21 * clutter/clutter-texture.c: improved documentation for
clutter_texture_set_filter_quality.
2008-06-10 11:18:19 +00:00
Chris Lord
67fbfebd6d Bug #916 - ClutterKeyEvent:unicode_value is ignored
Bug #950 - AltGr not handled 

        * clutter/osx/clutter-event-osx.c: (clutter_event_osx_translate):
        * clutter/x11/clutter-event-x11.c: (translate_key_event):
        * tests/test-events.c: (fill_keybuf), (input_cb):
        Apply patch from Tommi Komulainen, fill the unicode_value attribute of
        the ClutterKeyEvent struct. Also use XKeycodeToKeysym, as suggested in
        bug #950, comment #2
2008-06-10 10:57:50 +00:00
Matthew Allum
5d9e1bbbb0 2008-06-10 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-texture.c:
        Minor reformatting cleanups. Emit filter-quality prop on change.
        * clutter/glx/clutter-glx-texture-pixmap.c:
        Support mipmaps via filter quality prop.
2008-06-10 10:49:21 +00:00
Chris Lord
db518c8736 * clutter/cogl/common/cogl-primitives.c: (_cogl_path_arc):
Draw as expected when end angle is lower than start angle (i.e. do not
        swap the angles). This aligns with cairo behaviour.
2008-06-10 10:05:12 +00:00
Tommi Komulainen
863837baec 7 small miscellaneous fixes
Bug#959 - Multiple minor improvements

	* configure.ac: pick up GDKPIXBUF_PREFIX from gdk-pixbuf-2.0
	module, not pango

	* clutter/clutter-keysyms-table.h: cosmetic fix for ifdef guard
	name in the comment (leftover from earlier commit)

	* tests/test-textures.c: don't depend on GdkPixbuf as we're not
	using any actual features from it, just plain pixel buffer
	manipulation

	* clutter/clutter-timeline.c
	* clutter/clutter-timeline.h (clutter_timeline_list_markers): Use
	gsize* to return number of items, not guint*
	* tests/test-paint-wrapper.c: use correct type (guint*) in call
	to clutter_actor_get_size()

	* tests/test-depth.c (janus_group): properly take height2 into
	account when calculating needed height for the rectangle

	* tests/test-cogl-tex-getset.c: use rowstride, not width*4, when
	calculating pixel offsets

	* tests/test-cogl-tex-getset.c: Don't assume/force RGBA format,
	also support ARGB format (needed with quartz imageloader.)
2008-06-10 06:37:46 +00:00
Tommi Komulainen
45ff3cb00c OSX: print GL_VENDOR, GL_RENDERER, GL_VERSION and GL_EXTENSIONS
* clutter/osx/clutter-backend-osx.c (clutter_backend_osx_post_parse):
	Print GL_VENDOR, GL_RENDERER, GL_VERSION and GL_EXTENSIONS to aid
	debugging.
2008-06-09 23:00:31 +00:00
Tommi Komulainen
78e1f63fcd cogl: add support for quartz imagebackend
Bug #930 - add support for quartz imagebackend

	* clutter/cogl/common/cogl-bitmap-pixbuf.c
	(_cogl_bitmap_from_file): When USE_QUARTZ is defined implement
	using Core Graphics.
	* configure.ac: support --with-imagebackend=quartz and print
	which imagebackend is selected. Make quartz default on OSX
2008-06-09 21:15:12 +00:00
Øyvind Kolås
a28e51d752 * clutter/cogl/common/cogl-primitives.c: (cogl_path_rel_curve_to):
fixed naming of implementation of cogl_path_rel_curve_to (it was
called just cogl_rel_curve_to).
2008-06-09 16:14:06 +00:00
Emmanuele Bassi
40b62c7b67 2008-06-09 Emmanuele Bassi <ebassi@openedhand.com>
* configure.ac: Clean up a bit the X11 and X extensions
	checks with PKG_CHECK_EXISTS(). Since we are filling up the
	X11_CFLAGS and X11_LIBS variables ourselves there is no
	point in polluting the Makefiles with unused variables.

	* clutter/Makefile.am: Remove the pkg-config variable
	evaluation and use the values retrieved from the configure
	script.
2008-06-09 13:29:17 +00:00
Chris Lord
db232dd5e7 Bug #914 - ClutterEntry is confused about characters vs. bytes
* clutter/clutter-entry.c: (clutter_entry_ensure_layout),
        (clutter_entry_handle_key_event_internal),
        (clutter_entry_set_text):
        Fix mix-up of character and byte counts, handle unicode correctly.
        Use clutter_key_event_unicode() instead of
        clutter_keysym_to_unicode().

        * clutter/clutter-event.c: (clutter_key_event_unicode):
        Don't ignore ClutterKeyEvent.unicode_value

        * clutter/clutter-keysyms-table.h:
        Rename header define so as not to conflict with clutter-keysyms.h

        Patch originally by Emmanuele Bassi, with input from Tommi Komulainen.
2008-06-09 10:13:20 +00:00
Øyvind Kolås
4582ab12b8 * clutter/clutter-texture.c: made the filter-quality proeprty also
control the use of mipmapping.
* clutter/clutter-texture.h: added ClutterTextureQuality enum.
* tests/test-texture-quality.c: new test.
* tests/Makefile.am: added test-texture-quality
2008-06-07 15:08:05 +00:00
Emmanuele Bassi
eb990a853a 2008-06-06 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.c:
	(clutter_texture_class_init): Do not unrealize on hide(), and
	do not realize() on show. By default, clutter_actor_show() will
	realize ourselves, and we don't want to unrealize when hidden
	to avoid paying the penalty of reading back the texture data
	from the video memory.

	* tests/test-actors.c: Show all textures again when pressing
	the 'r' key.
2008-06-06 16:22:55 +00:00