Commit Graph

2758 Commits

Author SHA1 Message Date
Robert Bragg
555159776b [vertex-buffer] Remove the COGL_INDICES_TYPE_UNSIGNED_INT indicies type
Since some embedded GPUs may not support 32bit integer indices we wont
include it until there is a particular need.
2009-06-29 23:49:05 +01:00
Damien Lespiau
a66f027c61 [cogl] Add COGL_HAS_GL and COGL_HAS_GLES
Cogl already add similar defines but with the CLUTTER namespace
(CLUTTER_COGL_HAS_GL and CLUTTER_COGL_HAS_GLES). Let's just add two
similar defines with the COGL namespace. Removing the CLUTTER_COGL ones
could break applications silently for no real good reason.
2009-06-29 21:37:02 +02:00
Damien Lespiau
30b5dac7c3 [misc] Update headers #endif comments
While grepping through the public headers looking for invalid use of
private HAVE_* defines, I stumbled upon two out of sync comments. Yes
it's a very minor trivial change.
2009-06-29 21:37:02 +02:00
Emmanuele Bassi
81bc2b4cc7 [actor] Remove unused clutter_actor_pick()
The clutter_actor_pick() function just emits the ::pick signal
on the actor. Nobody should be using it, since the paint() method
is already context sensitive and will result in a ::pick emission
by itself. The clutter_actor_pick() is just confusing things.
2009-06-29 17:01:10 +01:00
Emmanuele Bassi
bd668cf156 Add more debug notes inside the master clock 2009-06-29 17:01:10 +01:00
Emmanuele Bassi
9e84e52034 [docs] Update after the Input API changes 2009-06-25 14:54:16 +01:00
Emmanuele Bassi
537ccc3cd9 [docs] Add an initial porting guide
The Clutter API reference should have a section on how to port
applications from older version of Clutter to the new API.

The first guide deals on how to port animations created with
ClutterEffect to clutter_actor_animate().
2009-06-25 14:54:16 +01:00
Emmanuele Bassi
de745e93c9 [docs] Fix the ActorBox annotations
The ClutterActorBox API is incorrectly annotated and gtk-doc is unable
to pick it up.
2009-06-25 14:54:16 +01:00
Neil Roberts
20f3c173fe [test-shader] Fix some of the shaders to use premultiplied colors
Texture data is now in premultiplied format and the shader should
output a premultiplied color if the default blend mode is being
used. Shaders that directly manipulate the rgb values now
unpremultiply and premultiply again afterwards.
2009-06-24 12:05:19 +01:00
Tim Horton
e9d277609d Add element-type annotations for animate*v functions
Fixes bug:

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-22 12:27:17 +01:00
Ole André Vadla Ravnås
c272a7b2a2 [master clock] Fix MT safety issues
Fix MT issues when enabling threading in Clutter.

Fixes bug:

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-22 12:17:41 +01:00
Emmanuele Bassi
ba6c0c27f9 [texture] Revert to integer parameters in ::size-change
In the int-to-float switch for actor properties, the ::size-change signal
was moved to use floats instead of integers. Sub-pixel precision for image
size is meaningless, though, so we should revert it back to ints.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1659
2009-06-22 12:15:17 +01:00
Emmanuele Bassi
8a1cf0cff4 Post-release bump to 0.9.5 2009-06-19 18:25:25 +01:00
Emmanuele Bassi
fdaaa8b6d7 [release] 0.9.4 2009-06-19 18:07:40 +01:00
Emmanuele Bassi
b833ed3c0d Update the NEWS file 2009-06-19 18:07:34 +01:00
Emmanuele Bassi
3d49edad85 [docs] Add new input-related accessors
Add the ClutterEvent accessors for the device pointer and type, and
the ClutterInputDevice accessors for the id and type.
2009-06-19 18:07:34 +01:00
Emmanuele Bassi
a79d6228aa Remove the last few fixed-point entry points
The last fixed-point entry points are just a few, and trivial. The
end user is expected to do the conversion using the CoglFixed type
and macros.
2009-06-19 16:38:35 +01:00
Emmanuele Bassi
cb4e5c9083 [x11] Simplify the XInput support
Instead of using a specific function to check whether the X
server supports the XInput extension we can use the generic
Xlib function XQueryExtension(). This cuts down the extra
checks inside the configure.ac and simplifies the code inside
clutter_x11_register_xinput().
2009-06-19 15:12:32 +01:00
Emmanuele Bassi
21608fe5f7 [x11] Add a command line switch for enabling XInput
Currently, XInput support requires a function call. In order to
make it easier for people to test it, we can also add a command
line switch that moves the pointer device detection and handling
to XInput. This should ensure that, at least for people building
Clutter with --enable-xinput, applications can be easily migrated
and regressions can be caught.
2009-06-19 14:32:37 +01:00
Emmanuele Bassi
0ec541282a [tests] Remove unneeded g_type_init()
Now that we can safely check for an uninitialized Clutter we
don't have side effects in calling one of the functions like
clutter_x11_enable_xinput(), which require to be called before
any other Clutter function.
2009-06-19 14:20:50 +01:00
Emmanuele Bassi
a6b4697367 [backend] Do not store the stage manager singleton
The StageManager singleton instance is already kept around
by the clutter_stage_manager_get_default() function; there is
no need to have it inside the main Clutter context as well.
2009-06-19 14:19:39 +01:00
Emmanuele Bassi
b6e404a406 [x11] Use _clutter_context_is_initialized()
Instead of using _clutter_context_get_default() and checking the
is_initialized flag, we should use the newly added private function
that does not cause side effects, especially for functions that have
to be called before any other Clutter function.
2009-06-19 14:12:36 +01:00
Emmanuele Bassi
b5f4befeaa Allow checking initialization without side-effects
The _clutter_context_get_default() function will automatically
create the main Clutter context; if we just want to check whether
Clutter has been initialized this will complicate matters, by
requiring a call to g_type_init() inside the client code.

Instead, we should simply provide an internal API that checks
whether the main Clutter context exists and if it has been
initialized, without any side effect.
2009-06-19 14:09:42 +01:00
Emmanuele Bassi
184df2a5fa [input] Rework input device API
The input device API is split halfway thorugh the backends in a very
weird way. The data structures are private, as they should, but most
of the information should be available in the main API since it's
generic enough.

The device type enumeration, for instance, should be common across
every backend; the accessors for device type and id should live in the
core API. The internal API should always use ClutterInputDevice and
not the private X11 implementation when dealing with public structures
like ClutterEvent.

By adding accessors for the device type and id, and by moving the
device type enumeration into the core API we can cut down the amount
of symbols private and/or visible only to the X11 backends; this way
when other backends start implementing multi-pointer support we can
share the same API across the code.
2009-06-19 13:12:05 +01:00
Damien Lespiau
3653a9a64d Public headers should not have #ifdefs relying on private defines
HAVE_COGL_GLES2 is defined in config.h through the configure script and
should not be used in public headers.

The patch makes configure generate the right define that can be used
later in the header.
2009-06-19 06:43:34 +01:00
Emmanuele Bassi
c6fba47a52 Hide clutter_context_get_default()
The clutter_context_get_default() function is private, but shared
across Clutter. For this reason, it should be prefixed by '_' so
that the symbol is hidden from the shared object.
2009-06-18 14:20:28 +01:00
Emmanuele Bassi
8c676ebd87 Remove an unusued member from MainContext
The MainContext structure has a field for the master clock, but
clutter_master_clock_get_default() will return the same instance
from everywhere.
2009-06-17 15:43:53 +01:00
Matthew Allum
1aa8c89f2c [XInput] Get XInput working again.
Check for distros shipping out of sync header vs libXi,
call in g_type_init() in test-devices, fix ifdef so
XInput events get correctly selected.
2009-06-17 15:09:16 +01:00
Emmanuele Bassi
3035092edb Do not use the --pkd switch for g-ir-scanner
Revert commit 8aacff0e0f
2009-06-16 18:08:52 +01:00
Emmanuele Bassi
c4716d78d0 [docs] Update the backends hacking reference 2009-06-16 16:43:00 +01:00
Emmanuele Bassi
29ab269116 [docs] Update the release notes 2009-06-16 16:43:00 +01:00
Emmanuele Bassi
5e098c3886 [docs] Update the HACKING file 2009-06-16 16:43:00 +01:00
Emmanuele Bassi
8aacff0e0f [introspection] Add --pkg switch pointing at Clutter
Add a <package/> element pointing to Clutter's pkg-config
file name.
2009-06-16 16:43:00 +01:00
Emmanuele Bassi
9f83e7dc2e [stage] Remove an assertion
We might get a size request on destruction, so it should be safe
to avoid an assertion failure because we don't have the stage
implementation anymore.
2009-06-16 16:43:00 +01:00
Emmanuele Bassi
4bed539b21 Add more ActorBox utility methods
ActorBox should have methods for easily extracting the X and Y
coordinates of the origin, and the width and height separately.

These methods will make it easier for high-level language bindings
to manipulate ActorBox instances and avoid the Geometry type.
2009-06-16 16:43:00 +01:00
Emmanuele Bassi
9ed2a47db1 [doap] Add branches for past releases 2009-06-16 16:42:59 +01:00
Emmanuele Bassi
275f292ab9 Add accessors for the boxed types
The Vertex and ActorBox boxed types are meant to be used across
the API, but are fairly difficult to bind. Their memory management
is also unclear, and has to go through the indirection of
g_boxed_copy() and g_boxed_free().
2009-06-16 16:42:59 +01:00
Colin Walters
63c84c46f8 Plug minor memory leak in cogl_vertex_buffer_submit_real
Free a temporary list.
2009-06-16 15:46:51 +01:00
Emmanuele Bassi
f8e9565482 [tests] Beautify the bouncing actor
The test-easing interactive demo for the high-level animation API
is a bit "flat". Instead of using a Rectangle actor we should
probably be using something more "interesting" -- like a CairoTexture
with a gradient.
2009-06-15 15:08:59 +01:00
Neil Roberts
f95f4ba3cb [ClutterCairoTexture] Use the right component ordering when uploading data
Cairo stores the image data in ARGB native byte order so we need to
upload this as BGRA on little endian architectures and ARGB on big
endian. ClutterTexture doesn't currently expose any flags to describe
ARGB format so until we can fix the Clutter API it now uses the Cogl
API directly.
2009-06-15 12:41:13 +01:00
Emmanuele Bassi
c6b4ea8b44 [cairo-texture] Clean up and whitespace fixes
Simple clean up of the CairoTexture to remove unneeded checks,
redundant variables and white space.
2009-06-15 11:50:23 +01:00
Emmanuele Bassi
9799750c03 [animation] Rework animation chaining
In order to chain up animations using clutter_actor_animate() and
friends you have to use an idle handler that guarantees that the
main loop spins at least once after the animation pointer has been
detached from the actor.

This has several drawbacks, first and foremost the fact that the
slice of the main loop for the idle handler might be starved by
other operations, like redrawing. This inevitably leads to tricks
with priorities and the like, contributing to the overall complexity.

Instead, we should guarantee that the animation instance created by
clutter_actor_animate() is valid for the ::completed signal until
it reaches its default handler; after that, the animation is detached
from the actor and destroyed. This means that it's possible to
create a new animation after the first is complete by simply using
g_signal_connect_after().

This unfortunately makes it impossible to keep a reference to the
animation pointer attached to the actor by using g_object_ref(); a
way to "fix" this would be to have a clutter_animation_attach()
and a clutter_animation_detach() pair of methods that allow attaching
any animation to an actor. This might overcomplicate what it is
the simple animation API, though, so it's currently not implemented
and left for future versions.

The test-easing interactive demo has been modified to show how
the animation queuing works by adding a command line switch that
recenters the animated actor once the first animation has ended.
2009-06-15 11:49:33 +01:00
Emmanuele Bassi
612d1cded7 [animation] Allow swapped/after signal variants
Continuing in the tradition on making clutter_actor_animate() the
next g_object_connect(), here's the addition of the signal-after::
and signal-swapped:: modifiers for the automagic signal connection
arguments.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1646
2009-06-15 11:48:42 +01:00
Emmanuele Bassi
0415d62d40 Disable single header inclusion for GLib
In order to be ready for the next major version of GLib we need to
disable single header inclusion by using the G_DISABLE_SINGLE_INCLUDES
define in the build process.
2009-06-15 11:29:37 +01:00
Owen W. Taylor
e6a987d670 Fix redraw queueing in the presence of cloning
We can't short-circuit the emission of ::queue-redraw for not-visible
actors, since ClutterClone uses that signal to know when things need
to be redrawn.

Calling clutter_actor_queue_redraw() out of clutter_actor_real_map() /
clutter_actor_real_unmap() was causing the flag state to get set
incorrectly from _clutter_actor_set_enable_paint_unmapped(), because
a paint queueing a redraw was not expected.

Moving queuing the redraw to clutter_actor_hide()/show() fixes this, and
also fixes a problem where showing a child of a cloned actor wouldn't
cause the clone to be repainted.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-15 11:29:37 +01:00
Emmanuele Bassi
abac520f0c [tests] Add unit for Clone behaviour
A clone actor should not modify the state of its source, so we need
to check that it's not breaking any invariant.
2009-06-15 11:29:37 +01:00
Owen W. Taylor
795e005566 Fix handling of not-visible texture pixmaps
If we have an not-visible texture pixmap, we need to:

 - Still update it if it is realized, since it won't be
   updated when shown. And it might be also be cloned.

 - Queue a redraw if even if not visible, since it
   it might be cloned.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-06-15 11:29:37 +01:00
Damien Lespiau
b9a53d379d [gitignore] ignore TAGS and new test
* ignore files generated by make tags
* ignore the newly introduced premult test
2009-06-14 01:17:53 +01:00
Neil Roberts
0dfc1dd284 [test-cogl-tex-tile] Fix breakages from ClutterFixed removal and timelines
The test has been broken since the change to use floats instead of
fixed point because it was passing degrees to sin and cos but they
expect radians.

It was further broken since the timeline changes because it was
directly using the parameter of the new-frame signal as a frame number
but it now represents the elapsed time.
2009-06-12 11:05:26 +01:00
Robert Bragg
9d82995773 [_cogl_texture_bitmap_prepare] use bitmap format for FORMAT_ANY + no alpha
My patch to choose a premultiplied format when the user gives
COGL_PIXEL_FORMAT_ANY for the internal_format broke the case where the data
in question doesn't have and alpha channel.

This was accidentally missed when merging the premultiplication branch
since I merged a local version of the branch that missed this commit.
2009-06-11 18:49:30 +01:00