1
0
Fork 0
Commit graph

212 commits

Author SHA1 Message Date
Emmanuele Bassi
f94f7692a6 actor: Add :text-direction property
Every actor should have a property for retrieving (and setting) the
text direction.

The text direction is used to provide a consisten behaviour in both
left-to-right and right-to-left languages. For instance, ClutterText
should perform key navigation following text direction. Layout
managers should also take into account text direction to derive the
right packing order for their children.
2009-11-10 12:16:55 +00:00
Emmanuele Bassi
b5895335ab actor: Add set_request_mode() method
We should not require the use g_object_set()/_get() for accessing
the :request-mode property. A proper accessors pair should be
preferred.
2009-10-14 11:31:30 +01:00
Owen W. Taylor
93e1d8e7a3 Add ::queue-relayout signal to ClutterActor for ClutterClone
ClutterClone bases its preferred size on the preferred size of
the source actor, so it needs to invalid its cached preferred
size when the preferred size of the source actor changes.

In order for this to work, we need to have notification when
the size of the source actor changes, so add a ::queue-relayout
signal to ClutterActor.

Then connect to this from ClutterClone and queue a relayout
on the clone when a relayout is queued on the source.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-08-20 14:12:54 +01:00
Emmanuele Bassi
42ea471e33 Remove explicit size of the Vertex arrays
The Vertex arrays passed to some ClutterActor methods should not
have the size. Albeit being technically correct, it's not a good
practice.
2009-07-27 16:10:07 +01:00
Emmanuele Bassi
af5e432ba9 [actor] Allow querying whether we are painted by a Clone
It would be useful inside a custom actor's paint function to be able to
tell if this is a primary paint call, or if we are in fact painting on
behalf of a clone.

In Mutter we have an optimization not to paint occluded windows; this is
desirable for the windows per se, to conserve bandwith to the card, but
if something like an application switcher is using clones of these windows,
they will not get painted either; currently we have no way of
differentiating between the two.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1685
2009-07-13 16:18:27 +01:00
Emmanuele Bassi
45c85c4213 [actor] Remove the unused get_allocation_coords()
The clutter_actor_get_allocation_coords() is not used, and since
the switch to floats in the Actor's API, it returns exactly what
the get_allocation_box() returns.
2009-07-01 15:30:21 +01:00
Emmanuele Bassi
37bd35f592 [actor] Allow changing the transformations matrix
Currently, the transformation matrix for an actor is constructed
from scenegraph-related accessors. An actor, though, can call COGL
API to add new transformations inside the paint() implementation,
for instance:

  static void
  my_foo_paint (ClutterActor *a)
  {
    ...
    cogl_translate (-scroll_x, -scroll_y, 0);
    ...
  }

Unfortunately these transformations will be completely ignored by
the scenegraph machinery; for instance, getting the actor-relative
coordinates from event coordinates is going to break badly because
of this.

In order to make the scenegraph aware of the potential of additional
transformations, we need a ::apply_transform() virtual function. This
vfunc will pass a CoglMatrix which can be used to apply additional
operations:

  static void
  my_foo_apply_transform (ClutterActor *a, CoglMatrix *m)
  {
    CLUTTER_ACTOR_CLASS (my_foo_parent_class)->apply_transform (a, m);
    ...
    cogl_matrix_translate (m, -scroll_x, -scroll_y, 0);
    ...
  }

The ::paint() implementation will be called with the actor already
using the newly applied transformation matrix, as expected:

  static void
  my_foo_paint (ClutterActor *a)
  {
    ...
  }

The ::apply_transform() implementations *must* chain up, so that the
various transformations of each class are preserved. The default
implementation inside ClutterActor applies all the transformations
defined by the scenegraph-related accessors.

Actors performing transformations inside the paint() function will
continue to work as previously.
2009-07-01 15:30:21 +01: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
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
Emmanuele Bassi
0187bb3965 [actor] Use flags to control allocations
Instead of passing a boolean value, the ::allocate virtual function
should use a bitmask and flags. This gives us room for expansion
without breaking API/ABI, and allows to encode more information to
the allocation process instead of just changes of absolute origin.
2009-06-04 16:30:31 +01:00
Emmanuele Bassi
4afe1e9a8b [actor] Add allocate_available_size()
The allocate_available_size() method is a convenience method in
the same spirit as allocate_preferred_size(). While the latter
will allocate the preferred size of an actor regardless of the
available size provided by the actor's parent -- and thus it's
suitable for simple fixed layout managers like ClutterGroup -- the
former will take into account the available size provided by the
parent and never allocate more than that; it is, thus, suitable
for simple fluid layout managers.
2009-05-29 17:53:19 +01:00
Emmanuele Bassi
7b75f93db1 [docs] Fixes for the API reference
* Add unused symbols

* Document and sync argument names with their gtk-doc counterpart

* Add missing descriptions
2009-05-28 17:18:13 +01:00
Emmanuele Bassi
515350a77f [actor] Rename focus-in and focus-out signals
For consistency, and since those signals are key-related, the
::focus-in signal is not ::key-focus-in and the ::focus-out
signal is now ::key-focus-out.
2009-05-06 17:56:40 +01:00
Emmanuele Bassi
d6d208da7d Remove Units from the public API
With the recent change to internal floating point values, ClutterUnit
has become a redundant type, defined to be a float. All integer entry
points are being internally converted to floating point values to be
passed to the GL pipeline with the least amount of conversion.

ClutterUnit is thus exposed as just a "pixel with fractionary bits",
and not -- as users might think -- as generic, resolution and device
independent units. not that it was the case, but a definitive amount
of people was convinced it did provide this "feature", and was flummoxed
about the mere existence of this type.

So, having ClutterUnit exposed in the public API doubles the entry
points and has the following disadvantages:

  - we have to maintain twice the amount of entry points in ClutterActor
  - we still do an integer-to-float implicit conversion
  - we introduce a weird impedance between pixels and "pixels with
    fractionary bits"
  - language bindings will have to choose what to bind, and resort
    to manually overriding the API
    + *except* for language bindings based on GObject-Introspection, as
      they cannot do manual overrides, thus will replicate the entire
      set of entry points

For these reason, we should coalesces every Actor entry point for
pixels and for ClutterUnit into a single entry point taking a float,
like:

  void clutter_actor_set_x (ClutterActor *self,
                            gfloat        x);
  void clutter_actor_get_size (ClutterActor *self,
                               gfloat       *width,
                               gfloat       *height);
  gfloat clutter_actor_get_height (ClutterActor *self);

etc.

The issues I have identified are:

  - we'll have a two cases of compiler warnings:
    - printf() format of the return values from %d to %f
    - clutter_actor_get_size() taking floats instead of unsigned ints
  - we'll have a problem with varargs when passing an integer instead
    of a floating point value, except on 64bit platforms where the
    size of a float is the same as the size of an int

To be clear: the *intent* of the API should not change -- we still use
pixels everywhere -- but:

  - we remove ambiguity in the API with regard to pixels and units
  - we remove entry points we get to maintain for the whole 1.0
    version of the API
  - we make things simpler to bind for both manual language bindings
    and automatic (gobject-introspection based) ones
  - we have the simplest API possible while still exposing the
    capabilities of the underlying GL implementation
2009-05-06 16:44:47 +01:00
Emmanuele Bassi
72562cda58 [actor] Add ActorFlags accessor methods
The flags field of ClutterActor should have accessor methods for,
language bindings.

Also, the set_flags() and unset_flags() methods should actively
emit notifications for the changed properties.
2009-05-05 18:08:53 +01:00
Havoc Pennington
125bded814 Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state

* Add a VISIBLE flag tracking application programmer's
  expected showing-state for the actor, allowing us to
  always ensure we keep what the app wants while tracking
  internal implementation state separately.

* Make MAPPED reflect whether the actor will be painted;
  add notification on a ClutterActor::mapped property.
  Keep MAPPED state updated as the actor is shown,
  ancestors are shown, actor is reparented, etc.

* Require a stage and realized parents to realize; this means
  at realization time the correct window system and GL resources
  are known. But unparented actors can no longer be realized.

* Allow children to be unrealized even if parent is realized.
  Otherwise in effect either all actors or no actors are realized,
  i.e. it becomes a stage-global flag.

* Allow clutter_actor_realize() to "fail" if not inside a toplevel

* Rework clutter_actor_unrealize() so internally we have
  a flavor that does not mess with visibility flag

* Add _clutter_actor_rerealize() to encapsulate a somewhat
  tricky operation we were doing in a couple of places

* Do not realize/unrealize children in ClutterGroup,
  ClutterActor already does it

* Do not realize impl by hand in clutter_stage_show(),
  since showing impl already does that

* Do not unrealize in various dispose() methods, since
  ClutterActor dispose implementation already does it
  and chaining up is mandatory

* ClutterTexture uses COGL while unrealizable (before it's
  added to a stage). Previously this breakage was affecting
  ClutterActor because we had to allow realize outside
  a stage. Move the breakage to ClutterTexture, by making
  ClutterTexture just use COGL while not realized.

* Unrealize before we set parent to NULL in clutter_actor_unparent().
  This means unrealize() implementations can get to the stage.
  Because actors need the stage in order to detach from stage.

* Update clutter-actor-invariants.txt to reflect latest changes

* Remove explicit hide/unrealize from ClutterActor::dispose since
  unparent already forces those
  Instead just assert that unparent() occurred and did the right thing.

* Check whether parent implements unrealize before chaining up
  Needed because ClutterGroup no longer has to implement unrealize.

* Perform unrealize in the default handler for the signal.
  This allows non-containers that have children to work properly,
  and allows containers to override how it's done.

* Add map/unmap virtual methods and set MAPPED flag on self and
  children in there. This allows subclasses to hook map/unmap.
  These are not signals, because notify::mapped is better for
  anything it's legitimate for a non-subclass to do.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-24 15:27:19 +01:00
Emmanuele Bassi
0942fac573 [docs] Add description of queue_redraw 2009-03-16 14:01:43 +00:00
Havoc Pennington
961aac3fb3 [actor] Add ::queue-redraw signal
Bug 1454 - move queue_redraw virtualization to ClutterActor

The ClutterActor::queue-redraw signal allows parent containers to
track whether their children need a redraw.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-03-16 12:13:55 +00:00
Emmanuele Bassi
801e535e94 Add Actor::create_pango_layout()
Final bit of integration between ClutterActor and Pango: a simple
method for creating a PangoLayout, pre-filled with text and ready
to be rendered using cogl_pango_render_layout().

This should make writing new Actors rendering custom text in their
paint() implementation easy and reliable.
2009-02-02 12:07:28 +00:00
Neil Roberts
d5e5d35316 Convert the rotation centers to be AnchorCoords
Currently only the Z axis rotation center can be set using a gravity
but the other rotations also store their center as an AnchorCoord for
consistency. Specifying the center as a gravity makes less sense for
the other axes because the actors have no size along the Z axis.

The rotation angles are now stored as gdoubles and the fixed point *x
entry points have been removed.

The Z rotation can now be set with a gravity center using the
following new function:

void clutter_actor_set_z_rotation_from_gravity (ClutterActor   *self,
                                                gdouble         angle,
                                                ClutterGravity  gravity);
2009-01-23 18:41:41 +00:00
Neil Roberts
e10d255b83 Add a scale center property to ClutterActor
This sets the center point from which the scaling will occur. This can
be used insetad of the anchor point to avoid moving the actor. Like
the anchor point, it can be specified as either a coordinate in units
or a gravity enum.

To set the center you can use two new variants of set_scale:

clutter_actor_set_scale_full (ClutterActor *self,
                              gdouble       scale_x,
                              gdouble       scale_y,
                              int           center_x,
                              int           center_y);

or

clutter_actor_set_scale_with_gravity (ClutterActor   *self,
                                      gdouble         scale_x,
                                      gdouble         scale_y,
                                      ClutterGravity  gravity);

The ClutterFixed variants of the set_scale functions have been removed
and the scale value is now always stored as a double.
2009-01-23 18:41:40 +00:00
Neil Roberts
a24b9a32e5 Store when the anchor point is set from a gravity
This makes it so when the anchor point is set using a gravity enum
then the anchor point moves when the actor changes size. A new
property is added for the anchor point gravity. If the anchor point is
set from gravity then the position in units can also be retreived with
the regular API.

A new union type is used to store the anchor point with helper
accessor functions. The hope is these can be reused for the scale and
rotation center points.
2009-01-23 18:41:40 +00:00
Emmanuele Bassi
22183c7a8f Bug 1380 - Return booleans from CLUTTER_ACTOR_IS_* macros
If you try to use the CLUTTER_ACTOR_IS_* macros defined in ClutterActor
like this:

  typedef struct { unsigned int reactive : 1; } foo_t;

  foo_t f; f.reactive = CLUTTER_ACTOR_IS_REACTIVE (actor);

It will blow up because while the macros evaluate to 0 they can also
evaluate to non-zero values. Since most of the boolean flags in
Clutter and Clutter-based code are going to be stored like in the
example above, we should change the macros and let them evaluate
stricly either to 0 or to 1.
2009-01-14 18:18:20 +00:00
Emmanuele Bassi
982a678053 Add ClutterActor::create_pango_context()
Sometimes an actor needs to set specific font rendering options on
the PangoContext without changing settings for every other text-rendering
actor.

In order to do this, we need a new public method to create a Pango
context object -- preset with all the default settings -- owned by the
developer and not shared with the rest of Clutter.

This new method is called clutter_actor_create_pango_context(); while
it does not strictly depend on a ClutterActor, it is a good idea to
have it inside the ClutterActor API to map the current get_pango_context()
method and in case we start storing screen-specific data to the Actor
itself during the 1.x API cycle.
2009-01-05 15:29:10 +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
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
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
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
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
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
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
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
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
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
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
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
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
b450363370 2008-04-23 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Add units based variant of the
	rotation accessors.
2008-04-23 12:53:25 +00:00
Matthew Allum
8847bcd195 2008-03-28 Matthew Allum <mallum@openedhand.com>
* clutter/Makefile.am:
        * clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-backend.c:
        * clutter/clutter-backend.h:
        * clutter/clutter-debug.h:
        * clutter/clutter-event.c:
        * clutter/clutter-event.h:
        * clutter/clutter-feature.h:
        * clutter/clutter-group.h:
        * clutter/clutter-main.c:
        * clutter/clutter-main.h:
        * clutter/clutter-private.h:
        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        * clutter/clutter-stage-manager.c
        * clutter/clutter-stage-manager.h
        * clutter/clutter-types.h:
        * clutter/glx/clutter-backend-glx.c:
        * clutter/glx/clutter-backend-glx.h:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/glx/clutter-stage-glx.h:
        * clutter/x11/clutter-backend-x11.c:
        * clutter/x11/clutter-backend-x11.h:
        * clutter/x11/clutter-event-x11.c:
        * clutter/x11/clutter-stage-x11.c:
        * clutter/x11/clutter-x11.h:
        * tests/Makefile.am:
        * tests/test-multistage.c:
        Initial commit of multi stage support (mostly a merge from the
        clutter-multistage branch).
        Note, this commit will break all backends except glx.
2008-03-28 22:50:55 +00:00
Emmanuele Bassi
8c451b8a67 2008-02-20 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	(clutter_actor_get_abs_opacity): Add function that does what
	get_opacity() does now...

	(clutter_actor_get_opacity): ... and make get_opacity() do what
	it's supposed to be doing. The original get_opacity() returned
	a composited value, and there's no way to actually extract the
	real opacity value set with set_opacity().

	* clutter/clutter-clone-texture.c:
	* clutter/clutter-rectangle.c:
	* clutter/clutter-texture.c: Update to use get_abs_opacity().

	* clutter/clutter-entry.c:
	* clutter/clutter-label.c: Ditto. Also, never change the stored
	alpha value. (#804)

	* tests/Makefile.am:
	* tests/test-opacity.c: Test suite for the get_opacity() and
	get_abs_opacity() API, and correct opacity handling.

	* README: Add note about the change in get_opacity().
2008-02-20 10:59:47 +00:00
Emmanuele Bassi
66f244b1cc 2008-02-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]:
	* clutter/clutter-types.h:
	* doc/reference/clutter-docs.sgml: Fix a lot of documentation.

2008-02-15  Matthew Allum  <mallum@openedhand.com>
2008-02-15 14:39:25 +00:00
Emmanuele Bassi
d76f7e42ea 2008-02-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Rename
	clutter_actor_get_box_from_vertices() to
	clutter_actor_box_get_from_vertices().

	* clutter/clutter-group.c (clutter_group_query_coords): Fix the
	query_coords() implementation.
2008-02-15 10:46:38 +00:00
Tomas Frydrych
78341d2e28 2008-02-15 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
	* clutter/clutter-actor.h:
	(clutter_group_query_coords):
	Added function to translate vertex array to a bounding box.

	(clutter_actor_is_scaled):
	(clutter_actor_is_rotated):
	Fixed documentation.
2008-02-15 09:40:41 +00:00
Tomas Frydrych
ea9b7b6550 2008-02-14 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
	* clutter/clutter-actor.h:
	(clutter_actor_is_scaled):
	(clutter_actor_is_rotated):
	Convenience functions to test whether actor is scaled or rotated.

	(clutter_actor_apply_relative_transform_to_point):
	Removed unused variable.

	* clutter/clutter-group.c:
	(clutter_group_query_coords):
	Use clutter_actor_get_relative_vertices() to calculate bounding
	boxes of children that are scaled or rotated.
2008-02-15 09:13:50 +00:00
Tomas Frydrych
02ae0fcd9e 2008-02-14 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
	* clutter/clutter-actor.h:
	(clutter_actor_get_relative_vertices):
	(clutter_actor_apply_relative_transform_to_point):
	Functions to calculate actor vertices in the plane of a given
	ancestor.
2008-02-14 15:59:38 +00:00
Øyvind Kolås
1fe08217b7 * clutter/clutter-actor.[ch]: added clutter_actor_get_shader and
renamed clutter_actor_apply_shader to be clutter_actor_set_shader.
Reindented/aligned header.
* clutter/clutter-texture.c: (clutter_texture_paint): temporarily
disable the shader on top of the clutter context's shader stack while
rendering into the FBO.
* tests/test-fbo.c: (main): s/apply_shader/set_shader/
* tests/test-shader.c: (button_release_cb), (main):
s/apply_shader/set_shader/
2008-02-04 11:45:12 +00:00
Emmanuele Bassi
f0145e7f83 2008-02-01 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h: Clean up a bit the flag-related macros.
2008-02-01 11:53:10 +00:00
Tomas Frydrych
4a1e765e19 2007-01-30 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
	Added new clutter_actor_move_anchor_point_ API.

        * clutter/clutter-behaviour-scale.c:
        * clutter/clutter-behaviour-scale.h:
        * clutter/clutter-effect.c:
        * clutter/clutter-effect.h:
        * tests/test-actors.c:
        * tests/test-effects.c:
        * tests/test-scale.c:
	Removed gravity from ClutterBehaviourScale.
2008-01-30 12:13:26 +00:00
Emmanuele Bassi
cbddf6aa1a 2008-01-18 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h:
	* clutter/clutter-script.h:
	* clutter/clutter-stage.h:
	* clutter/clutter-units.h: Documentation fixes and additions.
2008-01-18 11:25:47 +00:00
Emmanuele Bassi
28ef76edfa 2008-01-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Add clutter_actor_move_byu()
	
	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	(clutter_actor_move_by),
	(clutter_actor_move_byu): Add a units-based variant of the
	clutter_actor_move_by() function
2008-01-04 18:30:25 +00:00
Emmanuele Bassi
53aee5ffb4 2007-12-24 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Add clutter_actor_set_clipu() and
	clutter_actor_get_clipu()

	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	(clutter_actor_set_clipu), (clutter_actor_get_clipu): Add the
	new units-based versions of the clip accessors

	(clutter_actor_set_clip), (clutter_actor_get_clip): Reimplement
	the pixels-based clip accessors as proxies for the units-based
	ones
2007-12-24 14:21:19 +00:00
Emmanuele Bassi
24b24f0d53 2007-12-21 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h: Remove the unused ::set_depth() and
	::get_depth() virtual functions. (#674, Murray Cumming)
2007-12-21 17:18:49 +00:00
Øyvind Kolås
5220f68e17 Refined the ClutterShader API based on a patch from Emmanuele Bassi.
* clutter/clutter-actor.c: (clutter_actor_paint),
(clutter_actor_apply_shader): queue a redraw of actor when shader is
set.
* clutter/clutter-actor.h: indentation.
* clutter/clutter-shader.[ch]: made the fragment and vertex shader
sources properties. Report error through GError when binding shaders.
* tests/test-shader.c: modified to use newer API.
2007-12-11 14:49:41 +00:00
Emmanuele Bassi
f476cfbd4c 2007-12-07 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	(clutter_actor_get_sizeu),
	(clutter_actor_get_positionu): Add unit-based accessors to
	the size and position.
2007-12-07 15:49:54 +00:00
Tomas Frydrych
e9d9715dcf 2007-12-05 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
	* clutter/clutter-actor.h:
	* tests/Makefile.am:
	* tests/test-unproject:
	(clutter_actor_transform_stage_point):
	Added new function for translating stage coordinates into local
	actor coordinates.
2007-12-05 14:54:15 +00:00
Øyvind Kolås
e92b864dff Support for shaders in clutter. At the moment limited to drivers
providing GLSL support.
* clutter/cogl/cogl.h: added rather direct binding of needed for glsl
shaders.
* clutter/cogl/gl/cogl-defines.h.in:
* clutter/cogl/gl/cogl.c:
* clutter/cogl/gles/cogl-defines.h: added stubs.
* clutter/cogl/gles/cogl.c: added stubs.
* clutter/glx/clutter-stage-glx.c:
(clutter_stage_glx_realize): unrelated memory management sanity fix.
(clutter_stage_glx_unrealize): unbind all shaders on stage unrealize.
* clutter/Makefile.am: added clutter-shader.[ch]
* clutter/clutter-actor.[ch]: adding shader capability to 
actors.
* clutter/clutter-feature.h: added CLUTTER_FEATURE_SHADERS_GLSL
* clutter/clutter-private.h: added stack of shaders to context.
* clutter/clutter-shader.[ch]: new.
* tests/Makefile.am: added shader test.
* tests/test-shader.c: (frame_cb), (main): simple shader test,
cycle through the inline shader with right/left mouse buttons.
2007-12-03 16:29:18 +00:00
Tomas Frydrych
9c77b0ab13 2007-11-29 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.h:
        * clutter/clutter-actor.c:
	Converted depth and rotation offsets to ClutterUnit.

	(clutter_actor_set_depthu):
	(clutter_actor_get_depthu):
	Additional ClutterUnit API.

	(_clutter_actor_apply_modelview_transform):
	Use cogl_translatex() in place of cogl_translate().
2007-11-29 13:47:37 +00:00
Tomas Frydrych
132296dcc3 2007-11-28 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
	(clutter_actor_set_positionu):
	(clutter_actor_set_sizeu):
	(clutter_actor_get_widthu):
	(clutter_actor_get_heightu):
	(clutter_actor_set_widthu):
	(clutter_actor_set_heightu):
	(clutter_actor_get_xu):
	(clutter_actor_get_yu):
	(clutter_actor_set_xu):
	(clutter_actor_set_yu):
	Expanded ClutterActor API with new ClutterUnit-base functions.

        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
	(clutter_stage_get_resolution):
	(clutter_stage_get_resolutionx):
	New function to query stage resolution (floating and fixed point
	versions).

        * clutter/clutter-units.h:
	(CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE):
	(CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE):
	(CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE):
	(CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE):
	(CLUTTER_UNITS_FROM_MM):
	(CLUTTER_UNITS_FROM_MMX):
	(CLUTTER_UNITS_FROM_POINTS):
	(CLUTTER_UNITS_FROM_POINTSX):
	New macros for conversions to ClutterUnits.

	* clutter.symbols:
	Added:
	        ClutterActor anchor_point functions,
                clutter_stage_get_resolution functions.

	Removed:
                clutter_actor_scale_with_gravity functions.
2007-11-28 15:31:41 +00:00
Emmanuele Bassi
f4817f279a 2007-11-28 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Documentation fixes.
2007-11-28 14:16:37 +00:00
Tomas Frydrych
20a9bf142c 2007-11-28 Tomas Frydrych <tf@openedhand.com>
* clutter/NEWS:
	Started 0.6.0 section with comment on actor anchor point.

        * clutter/clutter/clutter-actor.c:
        * clutter/clutter/clutter-actor.h:
        * clutter/clutter/clutter-behaviour-scale.c:
        * clutter/clutter/clutter-deprecated.h:
	(clutter_actor_set_anchor_point):
	(clutter_actor_set_anchor_pointu):
	(clutter_actor_get_anchor_point):
	(clutter_actor_get_anchor_pointu):
	(clutter_actor_set_anchor_point_from_gravity):
	New anchor point API deprecating old gravity scaling, added
	comments on modelview matrix construction to ClutterActor
	documentation.

	(clutter_actor_set_scale_with_gravity):
	(clutter_actor_set_scale_with_gravityx):
	Deprecated; use clutter_actor_set_anchor_point_from_gravity() instead.
2007-11-28 12:23:31 +00:00
Emmanuele Bassi
b676210545 2007-11-19 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Update

	* clutter/clutter-actor.h: Rename the angle argument for
	set_rotationx() to avoid gtk-doc complaining

	* clutter/clutter-main.h:
	* clutter/clutter-main.c:
	(clutter_set_motion_events_enabled): Rename for consistency

	(clutter_get_motion_events_frequency),
	(clutter_set_motion_events_frequency): Add accessors for the default
	motion events deliver frequency.
	
	(clutter_do_event): Throttle down motion events delivery using the
	motion events frequency setting, to avoid excessive redraws. (#608)

	(clutter_context_get_default): Enable per-actor motion events, at
	least for now.

	* tests/test-events.c (red_button_cb):
	* tests/test-grab.c (green_press_cb): Update.
2007-11-19 16:30:56 +00:00
Øyvind Kolås
990d0e90a5 * clutter/clutter-actor.[ch]: (clutter_actor_set_rotationx),
(clutter_actor_set_rotation): swapped axis and angle around,
the new argument order is: (axis, angle, x, y, z). Also removed
deprecated rotation functions from header.
Updated use of clutter_actor_set_rotation? in the following files:
* clutter/clutter-behaviour-rotate.c: 
* clutter/clutter-effect.c: 
* tests/test-actors.c: 
* tests/test-project.c:
2007-11-19 11:43:20 +00:00
Matthew Allum
382852f921 2007-11-18 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-group.c:
        * clutter/clutter-main.c:
        * clutter/clutter-stage.c:
        * tests/test-events.c:
        Parent Actors no longer need to be set reactive for reactive
        children to get events. Also makes groups now pickable.
        (#597, #423)

        * clutter/clutter-texture.c:
        Handle case when 1x1 tiled texture is created,
        falling 'back' to being non tiled. (#596)

        * clutter/eglx/clutter-backend-egl.c:
        Call EglTerminate on backend shutdown.
2007-11-18 23:24:55 +00:00
Emmanuele Bassi
7495848f14 2007-11-18 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Update exported symbols.

	* clutter/clutter-actor.[ch]: Remove clutter_actor_rotate_*
	and clutter_actor_get_rx* and provide a simpler rotation API:
	clutter_actor_set_rotation() and clutter_actor_get_rotation().

	* clutter/clutter-deprecated.h: Deprecate the old rotation API.

	* clutter/clutter-behaviour-bspline.c:
	* clutter/clutter-behaviour-rotate.c:
	* clutter/clutter-effect.c: Update internal usage of the
	rotation API.

	* tests/test-project.c: Ditto as above.
2007-11-18 15:36:04 +00:00
Emmanuele Bassi
75d186c3f9 2007-11-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Massive API clean-ups. Initial
	fixes for bugs #614 and #628.

	* clutter/clutter-main.c:
	* clutter/clutter-stage.c: Update internal usage of the actor
	API.

	* tests/test-events.c: Update test suite.
2007-11-15 17:35:47 +00:00
Emmanuele Bassi
4de1adb04a 2007-11-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Rename clutter_actor_get_id() to
	clutter_actor_get_gid().

	(clutter_actor_set_parent): Use GUINT_TO_POINTER().

	* clutter/clutter-deprecated.h: Add a replacement warning for
	clutter_actor_get_id().

	* clutter/clutter-texture.c (texture_upload_data): Use
	clutter_actor_get_gid(), and don't leak the filename string.
2007-11-14 11:43:18 +00:00
Emmanuele Bassi
72ce4487f8 2007-11-07 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Fix the declaration of the
	class handlers for the ::captured-event, ::enter-event and
	::leave-event signals; the function signatures were missing
	the return value the signals marshallers were expecting, and
	their names weren't respecting the convention for event-related
	signals.
2007-11-07 16:40:30 +00:00
Emmanuele Bassi
f0f043cb19 2007-10-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: Implement part of the ClutterScriptable
	interface, using the ClutterActor API to set and get the name
	of an actor.

	(clutter_geometry_copy), (clutter_geometry_free): Use
	the slice allocator to avoid fragmentation when setting
	properties and emitting signals (that is: when packing
	boxed types into GValues).

	(clutter_actor_box_copy), (clutter_actor_box_free),
	(clutter_vertex_copy), (clutter_vertex_free): Ditto.

	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	(clutter_actor_push_transform_child),
	(clutter_actor_pop_transfomr_child): Simple wrappers around
	COGL API, which avoid including clutter/cogl.h when writing
	container actors outside Clutter.
2007-10-25 14:36:37 +00:00
Emmanuele Bassi
52065e88bc 2007-10-10 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/glx/clutter-backend-glx.c: Fix documentation of the
	filter function API.

	* clutter/clutter-score.c:
	* clutter/clutter-effect.c:
	* clutter/clutter-actor.c: Documentation fixes.

	* clutter/clutter-actor.h: Automatically typecast to ClutterActor
	when setting/checking flags.
2007-10-10 16:02:54 +00:00
Matthew Allum
6216ce659c 2007-10-10 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-event.c:
        * clutter/clutter-main.c:
        * tests/test-events.c:
        Add basic W3 DOM  event 'capture' like functionality.
2007-10-10 13:04:34 +00:00
Matthew Allum
8faf9b9964 2007-10-10 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        Add missing enter/leave event signals

        * clutter/clutter-main.c: (clutter_do_event):
        Set time in crossing events.
        Protect against do_pick() failing.
2007-10-09 23:45:49 +00:00
Matthew Allum
34a40de3c5 2007-10-08 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-private.h:
        * clutter/clutter-main.c:
        Add a hash to global clutter context mapping all parented actor
        id's to actors.
        Add clutter_get_actor_by_id() call.
        Convert picking machinery to use above.
        (performance/simpler composite actor creation)

        * clutter/clutter-stage.c: (clutter_stage_fullscreen),
        (clutter_stage_unfullscreen), (clutter_stage_event):
        Only set the fullscreen property on stage state fullscreen event(#545)
        Experimental as could be painful to implement on non X backends.
2007-10-08 16:18:33 +00:00
Emmanuele Bassi
090c1d11b4 2007-10-01 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Remove the ::event-after signal
	class handler, as it's not meant to be overridden by sub-classes.

	(clutter_actor_class_init):
	Make every event-related signal return a boolean: return TRUE
	in a signal handler to block the emission. The value is accumulated
	automatically by the signal API.

	(clutter_actor_event): If ::event returns TRUE, skip to emitting
	::event-after. Return the value accumulated by the signal emission
	chain.

	* clutter/clutter-private.h: Rename _clutter_boolean_accumlator().

	* clutter/clutter-main.c (clutter_do_event): If clutter_actor_event()
	returns TRUE then stop the event emission chain from child to parent.

	* clutter/clutter-stage.c (clutter_stage_event): Behave like
	clutter_actor_event().

	(clutter_stage_get_key_focus),
	(clutter_stage_set_key_focus): Avoid a nasty circular reference
	issue: if the actor passed to set_key_focus is NULL then the stage
	has the key focus.

	* tests/test-events.c: Update the events test with the API
	changes.
2007-10-02 14:03:36 +00:00
Matthew Allum
8ad4dde16b 2007-08-13 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/clutter-stage.c:
        * clutter/clutter-stage.h:
        * clutter/clutter-types.h:
        Initial implementation of actors emmitting event signals (423);
        - Actors set_reactive() to receive mouse events.
          (call clutter_enable_motion_events() for per action motion events)
        - clutter_stage_set_key_focus () to direct key events.
        - Events bubble up to parents (ending at stage)
          (original source identified by clutter_event_get_source())
        TODO:
        - enter/leave notifys for actors.
        - stage specific events - fullscreen
        - grabs

        * tests/test-events.c:
        Extend a little to use new API

        * clutter/cogl/gl/cogl.c:
        * clutter/glx/clutter-backend-glx.c:
        Move get_proc_address into cogl and out of backend.
        (shaders will need it)

        * clutter/clutter-group.c: (clutter_group_real_lower):
        Fix a minor compile warning.

        * TODO:
        Sync up.
2007-08-13 20:48:01 +00:00
Emmanuele Bassi
9686266fd3 Documentation fixes 2007-08-07 14:03:08 +00:00
Emmanuele Bassi
fbadfa1a6b 2007-08-01 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Add floating-point variant of the
	clutter_actor_get_r[xyz]angx() functions.
2007-08-01 13:11:43 +00:00
Emmanuele Bassi
ad64200aa7 2007-07-28 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Use GInitiallyUnowned
	as the parent structure in the ClutterActor structure
	definition; somehow, this has escaped everyone attention
	in one year and a half. Luckily, GInitiallyUnowned is
	as big as GObject.
	 
	 (clutter_actor_get_abs_position_units),
	 (clutter_actor_get_abs_position): Check parameters.

	 * clutter/clutter-texture.h: Unmangle the flags enum
	 type declaration, so that dumb parsers like h2defs.py
	 are not fooled.

	 * clutter/clutter-behaviour-ellipse.[ch]:
	 * clutter/clutter-effect.c: Fix some documentation
	 issues and make gtk-doc happy.
2007-07-28 17:11:39 +00:00
Emmanuele Bassi
b7e063c3ce Add a header for common types to avoid inclusion hell
This patch adds clutter-types.h, a header file containing some common
structures and enums, shared by different objects.
2007-07-26 13:13:23 +00:00
Emmanuele Bassi
454e493197 Fix various compiler warnings
Most of these fixes are simple symbol shadowing issues, like index and the
braindead y0 and y1 extern symbols exported by math.h on GNU libc systems.

There is a masking issue in ClutterTexture which should be checked; I ran
the tests and everything looked fine.

The rest are just unused variables.
2007-07-26 11:04:04 +00:00
Emmanuele Bassi
d7caae7f6a 2007-07-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/*: Loads of fixes for the API reference.
2007-07-04 14:00:41 +00:00
Emmanuele Bassi
11775a16f0 2007-07-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Use the right get_type() function
	name for ClutterVertex, and add the CLUTTER_TYPE_VERTEX macro.
2007-07-04 09:17:10 +00:00
Tomas Frydrych
b9e486f587 use ClutterVertex to pass parameters into clutter_actor_apply_transform_to_point() 2007-07-02 09:21:58 +00:00
Emmanuele Bassi
500d7482b6 Documentation fixes
Various fixes in the API reference build and text.
2007-07-01 16:44:24 +00:00
Tomas Frydrych
4bb51a4787 renamed clutter_actor_project_* functions 2007-06-27 15:10:52 +00:00
Tomas Frydrych
e10a0ad025 clutter_actor_project_point(): separated input from output parameters 2007-06-27 15:10:42 +00:00
Tomas Frydrych
f4029ab77c added fixed version of clutter_actor_rotate_*() functions and accessors for rotation angles 2007-06-26 11:35:33 +00:00
Emmanuele Bassi
339b22ded9 2007-06-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h:
	* clutter/clutter-stage.h: Add 32 padding slots; when we
	reach 1.0 it'll be a long road until the following ABI
	break.

	* tests/test-behave.c: Don't forget to include headers.
2007-06-16 21:15:31 +00:00
Emmanuele Bassi
a1958da910 2007-06-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-box.[ch]: Base class for layout containers.

	* clutter/clutter-hbox.[ch]: Horizontal box actor.
	
	* clutter/clutter-vbox.[ch]: Vertical box actor.

	* clutter/clutter.h:
	* clutter/Makefile.am: Build glue

	* tests/Makefile.am:
	* tests/test-boxes.c: Test suite for ClutterBox API and
	implementations.
2007-06-14 15:29:52 +00:00
Matthew Allum
61e3252ff1 2007-06-14 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-group.c:
        * clutter/clutter-label.c:
        * clutter/egl/clutter-stage-egl.c:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/sdl/clutter-stage-sdl.c:
        Rename clutter_actor_allocate_coords -> clutter_actor_query_coords

        Change repaints to G_PRIORITY_DEFAULT + 10.
        (timelines are G_PRIORITY_DEFAULT + 30, events G_PRIORITY_DEFAULT)

        * clutter/glx/clutter-event-glx.c:
        Handle shift modifier in keycode -> keysym translation.

        * tests/test-actors.c:
        Remove (broken) screen saver code.
        Add scaling behaviour, clean code a little
2007-06-13 23:24:59 +00:00
Tomas Frydrych
70a3c9fbe6 clutter_actor_project_point/vertices 2007-06-12 11:42:29 +00:00
Matthew Allum
fb6d22f95d 2007-05-31 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        Add clutter_actor_get_transformed_point()

        * clutter/clutter-main.c:
        Plug in perspective setup to redraw

        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        Remove audience code for now.
2007-05-31 17:11:09 +00:00
Tomas Frydrych
8697bfa53d added missing clutter_actor_get_transformed_vertices prototype; removed related debug code 2007-05-31 09:38:57 +00:00
Tomas Frydrych
733de46f3b Fixed ellipse behaviour for negative angles; fixed double to int conversion for negative numbers; fixed CLUTTER_ANGLE_FROM_DEGX; added ClutterVertices and clutter_actor_get_transformed_vertices() 2007-05-31 09:29:12 +00:00
Matthew Allum
a2bd6de736 2007-05-28 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-backend.c:
        * clutter/clutter-backend.h:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/glx/clutter-backend-glx.c:
        Fix up rendering pipeline removing clutter_backend_XXX_stage_paint
        and adding clutter_backend_XXX_redraw instead. Duplicates less
        code in backends, avoids clutter_actor_paint() getting called
        before stage is set up (viewport wise) and unbreaks things like
        picking.

        * clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-main.c:
        * clutter/clutter-private.h:
        * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos):
        Redo picking functionality a different way (via color indexing)
        as to provide more flexibility, possibly speed and more likely
        work with GL/ES (doesn't currently however - not sure why).

        * clutter/clutter-group.c:
        Add groups own 'pick' method.

        * clutter/cogl/cogl.h:
        * clutter/cogl/gl/cogl.c:
        * clutter/cogl/gles/cogl.c:
        Move clipping funtionality into cogl.

        * clutter/cogl/gles/cogl-defines.h:
        Hack around missing BGR format in GL/ES.

        * clutter/egl/clutter-backend-egl.c:
        * clutter/egl/clutter-backend-egl.h:
        * clutter/egl/clutter-stage-egl.c:
        * clutter/sdl/clutter-backend-sdl.c:
        * clutter/sdl/clutter-backend-sdl.h:
        * clutter/sdl/clutter-event-sdl.c:
        * clutter/sdl/clutter-stage-sdl.c:
        Update backends to newer API.
        Add basic mouse event translation to SDL.
2007-05-28 18:49:34 +00:00
Tomas Frydrych
bf8996215e ClutterBehaviourEllipse api changes; z_camera calculation 2007-05-25 12:07:24 +00:00
Tomas Frydrych
361cc36aaa removed clutter_actor_get_abs_position_units() and clutter_actor_get_abs_size_units() from public api 2007-05-23 10:47:35 +00:00
Tomas Frydrych
a338a95796 removed ClutterReal; added clutter-units 2007-05-22 09:31:40 +00:00
Tomas Frydrych
47b3d6db56 ClutterReal type 2007-05-18 07:30:06 +00:00
Matthew Allum
83700e97c7 2007-01-04 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        Add new set_width/height API calls.
        Tweak scaling by reseting matrix.
        Make set_opactiy() take parent opacity into account.
        Fix clipping.

        * clutter/clutter-alpha.c:
        Add more sine functionality.

        * clutter/clutter-behaviour-opacity.c:
        Dont make a copy of all applied actors but use a foreach()

        * clutter/clutter-behaviour-scale.c:
        Give correct limits to propertys.
        Tweak gravity a little more.
        Update docs.
:
        * clutter/clutter-behaviour.c: (clutter_behaviour_remove):
        Minor warning text change.

        * clutter/clutter-feature.c: (clutter_feature_wait_for_vblank):
        Minor dri ioctl tweak.

        * clutter/clutter-label.c:
        * clutter/clutter-label.h:
        Add new label_full api call.
2007-01-04 19:56:01 +00:00
Emmanuele Bassi
10fbfb1659 2006-12-12 Emmanuele Bassi <ebassi@openedhand.com>
Rework part of the show/hide machinery.  Allow groups sub-classes
	and composite actors to override show_all/hide_all in order to
	decide which children they wish to show/hide.  This means that
	if an actor overrides the default show/hide virtual methods, it'll
	have to chain up to the parent class show/hide.  While we're at it,
	provide the fully recursive clutter_actor_show_all() and
	clutter_actor_hide_all() methods.

	* clutter/clutter-behaviour-path.c: Add apidoc for the ClutterKnot
	functions; add pathological equality case for clutter_knot_equal().

	* clutter/clutter-event.h:
	* clutter/clutter-feature.h:
	* clutter/clutter-behaviour.c:
	* clutter/clutter-behaviour-scale.c:Fix parameters name so that
	gtk-doc doesn't complain.

	* clutter/clutter-actor.c:
	* clutter/clutter-event.c: Add apidoc

	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c: Add a clutter_actor_show_all() and a
	clutter_actor_hide_all() functions; provide a mechanism for
	groups and composited actors to programmatically select what to
	show/hide when clutter_actor_show_all() and clutter_actor_hide_all()
	are called.  If you are overriding the ClutterActor::show or
	the ClutterActor::hide virtual methods you should chain up with
	the parent class.

	* clutter/clutter-group.c: Override show_all and hide_all and
	recursively show/hide every child inside the group;
	clutter_group_show_all() and clutter_group_hide_all() remain as non
	recursive versions of clutter_actor_show_all() and
	clutter_actor_hide_all() (maybe we should rename them in order
	to avoid name clashes with the bindings).

	* clutter/clutter-stage.c:
	* clutter/clutter-texture.c: Chain up with parent class show
	and hide vfuncs.

	* clutter/clutter-clone-texture.h:
	* clutter/clutter-clone-texture.c: Provide API for changing the
	parent texture of a clone texture actor.

	* examples/behave.c:
	* examples/super-oh.c:
	* examples/test.c: Use clutter_actor_show_all() instead of
	clutter_group_show_all().
2006-12-12 20:20:04 +00:00
Emmanuele Bassi
5cc29888af 2006-11-20 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/Makefile.am:
	* clutter/clutter.h:
	* clutter/clutter-version.h.in: Auto-generated versioning macros.

	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c: Add a ClutterActor::parent-set signal,
	for notificating changes of an actor's parent; add api-doc for
	the actor's properties; add the ClutterActor "name" property; clean
	up a bit some functions; emit the "parent-set" signal when setting
	te parent and when unparenting; better warnings when lowering
	and raising an actor.

	* configure.ac:
	* clutter/Makefile.am: Add a --enable-debug configure option,
	with three levels of debugging: no, minimum and yes; default
	for development releases (odd minor version) is "yes"; update
	the version m4 defines; update the libtool macros: now just
	changed the clutter_interface_age when releasing will update
	everything else.
2006-11-20 12:02:24 +00:00
Emmanuele Bassi
237496fa75 2006-11-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-behaviour-path.h:
	* clutter/clutter-behaviour-path.c: Add a "knot-reached" signal,
	which is emitted when the path reaches a node in the nodes list;
	flesh out the documentation a bit; sync the parameters names
	so that gtk-doc doesn't complain about missing stuff.

	* clutter/clutter-behaviour.h:
	* clutter/clutter-behaviour.c: Add the alpha value to the
	ClutterBehaviour::alpha_notify vfunc, so you don't have to
	get the value from the alpha inside the behaviour implementations;
	add more documentation.

	* clutter/clutter-alpha.c: Flesh out the description.

	* clutter/clutter-actor.h: Update the header.

	* clutter/clutter-behaviour-opacity.c:
	* clutter/clutter-behaviour-scale.c: Update docs.
2006-11-17 18:45:31 +00:00
Matthew Allum
5ca4d3718d 2006-11-15 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.h:
        * clutter/clutter-actor.c:
        Add new API clutter_actor_move_by(), clutter_actor_get_size()

        * clutter/clutter-alpha.c:
        * clutter/clutter-alpha.h:
        Add clutter alpha sine func

        * clutter/clutter-behaviours.h:
        * clutter/clutter-behaviours.c:
        Add a basic scale behaviour (needs work)

        * examples/behave.c: (main):
        More playing with new behaviour functionality

        * clutter/clutter-feature.c:
        * clutter/clutter-feature.h:
        * clutter/clutter-main.c:
        Add new experimental sync to vblank code
        Set env CLUTTER_VBLANK=none to disable.
2006-11-15 21:19:01 +00:00
Matthew Allum
3afb377c3e 2006-08-29 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-fixed.h:
        Add basic fixed point utility defines and type.

        * clutter/Makefile.am:
        * clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-group.c:
        * clutter/clutter-stage.c:
        * examples/super-oh.c: (main):
        Add scale API and functionality.
        Rework group sizing. Now group size requests have no effect
        but can be scaled.
2006-08-29 19:09:43 +00:00
Emmanuele Bassi
5fa9fc161b 2006-07-06 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.h:
	* clutter/clutter-actor.c:
	
	(clutter_actor_class_init), (clutter_actor_set_property),
	(clutter_actor_get_property): Add the "clip" and "has-clip"
	properties.

	(clutter_actor_set_clip), (clutter_actor_remove_clip): Emit
	the notification for the changed properties.

	(clutter_actor_has_clip): Simple accessor to the "has-clip"
	property.
2006-07-06 18:12:19 +00:00
Emmanuele Bassi
212c4a0ee8 2006-07-06 Emmanuele Bassi <ebassi@openedhand.com>
Big rework of the actor management semantics: now ClutterActor
	objects behave like GtkObjects - that is they have an initial
	"floating" reference that gets "sunk" when they are added to
	a ClutterGroup.  This makes a group responsible of de-allocating
	each actor inside it, so you just have to destroy the group to
	get every child actor destroyed.  Also, now you can do:

	  clutter_group_add (group, clutter_video_texture_new ());
	
	without having to care about reference counting and explicit
	unreffing.

	* clutter/clutter-private.h: Add private flags setter and
	getter macros.

	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c: Clean up; inherit from GInitiallyUnowned;
	add a "visible" property; add the "destroy", "show" and "hide"
	signals to ClutterActorClass.

	(clutter_actor_show), (clutter_actor_hide): Refactor a bit; emit
	the "show" and "hide" signals.

	(clutter_actor_set_property), (clutter_actor_get_property),
	(clutter_actor_class_init): Implement the "visible" property; add
	signals.

	(clutter_actor_finalize): Do not leak the actor's name, if it is
	set.
	
	(clutter_actor_dispose): Emit the "destroy" signal here.

	(clutter_actor_init): Sink the initial floating flag if needed.

	(clutter_actor_destroy): Add a function to explicitely destroy
	a ClutterActor.

	(clutter_actor_set_parent), (clutter_actor_get_parent),
	(clutter_actor_unparent): Make set_parent require a valid parent;
	add unparent; check on get_parent; ref_sink the actor when
	setting its parent and unref it when unsetting it.  Probably we'll
	need a function that does reparenting as unparent+set_parent in
	a single shot.

	* clutter/clutter-group.h:
	* clutter/clutter-group.c (clutter_group_dispose),
	(clutter_group_finalize), (clutter_group_add),
	(clutter_group_remove): Make the group destroy its children when
	disposing it; clean up, and use the newly-available
	clutter_actor_unparent().

	* clutter/clutter-stage.h:
	* clutter/clutter-stage.c (clutter_stage_init): ClutterStage is
	a top-level actor; clean up.

	* clutter/clutter-video-texture.h:
	* clutter/clutter-video-texture.c: Clean up.

	* examples/super-oh.c:
	* examples/test.c:
	* examples/video-player.c:
	* examples/test-text.c:
	* examples/video-cube.c: Remove the g_object_unref() call, as the
	ClutterStage object is destroyed on clutter_main_quit().
2006-07-06 17:52:57 +00:00
Emmanuele Bassi
33d0c989ca 2006-06-22 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-timeline.h:
	* clutter/clutter-timeline.c: Add a "started" and a "paused"
	signals; add more sanity checks on the public functions.
	
	(clutter_timeline_get_loop): Add a getter function for the
	loop property.

	* clutter/clutter-marshal.list: Add marshallers.

	* clutter/clutter-timeline.h:
	* clutter/clutter-actor.h: Add padding for future expansion
	without breaking ABI.
2006-06-22 12:05:51 +00:00
Matthew Allum
38980ad67f 2006-06-22 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        Remove mirroring related calls ( unimplemented )
        * gtk/gtk-clutter-test.c: 0 -> NULL
2006-06-21 23:06:55 +00:00
Matthew Allum
13ce0e3709 2006-06-15 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        Add clutter_stage_set_xwindow_foreign() call
        * clutter/clutter-util.c:
        * clutter/clutter-util.h:
        Add some X error traps
        * examples/super-oh.c:
        Toy with us of new clutter_stage_set_xwindow_foreign() for
        optional screensaver functionality.
2006-06-15 22:04:19 +00:00
Matthew Allum
df92202c5f 2006-06-13 Matthew Allum <mallum@openedhand.com>
* clutter/Makefile.am:
        * clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-clone-texture.c:
        * clutter/clutter-clone-texture.h:
        * clutter/clutter-element.c:
        * clutter/clutter-element.h:
        * clutter/clutter-group.c:
        * clutter/clutter-group.h:
        * clutter/clutter-label.c:
        * clutter/clutter-label.h:
        * clutter/clutter-main.c:
        * clutter/clutter-main.h:
        * clutter/clutter-rectangle.c:
        * clutter/clutter-rectangle.h:
        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        * clutter/clutter-texture.c:
        * clutter/clutter-texture.h:
        * clutter/clutter-video-texture.c:
        * clutter/clutter-video-texture.h:
        * clutter/clutter.h:
        * examples/super-oh.c:
        * examples/test-text.c:
        * examples/test-video.c:
        * examples/test.c:
        * examples/video-cube.c:
        * gtk/gtk-clutter-test.c:
        * gtk/gtk-clutter.c:
        * gtk/gtk-clutter.h:
        Element to Actor Renaming.
2006-06-13 13:17:45 +00:00