1
0
Fork 0
Commit graph

191 commits

Author SHA1 Message Date
Emmanuele Bassi
3d350078a8 Merge branch 'animate-layout-manager' into ebassi-next
* animate-layout-manager:
  layout-manager: Document the animation support
  layout-manager: Rewind the timeline in begin_animation()
  box-layout: Remove the allocations hash table
  docs: Clean up the README file
  layout: Let begin_animation() return the Alpha
  box-layout: Add knobs for controlling animations
  box-layout: Animate layout properties
  layout: Add animation support to LayoutManager
  Add ActorBox animation methods
2009-12-23 10:38:02 +00:00
Emmanuele Bassi
a09ac0b27c Merge branch 'stage-use-alpha' into ebassi-next
* stage-use-alpha:
  tests: Use accessor methods for :use-alpha
  stage: Add accessors for :use-alpha
  tests: Allow setting the stage opacity in test-paint-wrapper
  stage: Premultiply the stage color
  stage: Composite the opacity with the alpha channel
  glx: Always request an ARGB visual
  stage: Add :use-alpha property
  materials: Get the right blend function for alpha
2009-12-20 17:39:12 +00:00
Emmanuele Bassi
b6bd8be6cb Merge branch 'internal-flag' into ebassi-next
* internal-flag:
  conform: Add test unit for the destruction of Containers
  actor: Add internal child flag
  Clean up whitespace, indentation and comments
2009-12-20 17:33:51 +00:00
Emmanuele Bassi
1520ba6190 actor: Add internal child flag
ClutterActor checks, when destroying and reparenting, if the parent
actor implements the Container interface, and automatically calls the
remove() method to perform a clean removal.

Actors implementing Container, though, might have internal children;
that is, children that are not added through the Container API. It is
already possible to iterate through them using the Container API to
avoid breaking invariants - but calling clutter_actor_destroy() on
these children (even from the Container implementation, and thus outside
of Clutter's control) will either lead to leaks or to segmentation
faults.

Clutter needs a way to distinguish a clutter_actor_set_parent() done on
an internal child from one done on a "public" child; for this reason, a
push/pop pair of functions should be available to Actor implementations
to mark the section where they wish to add internal children:

  ➔ clutter_actor_push_internal ();
    ...
    clutter_actor_set_parent (child1, parent);
    clutter_actor_set_parent (child2, parent);
    ...
  ➔ clutter_actor_pop_internal ();

The set_parent() call will automatically set the newly added
INTERNAL_CHILD private flag on each child, and both
clutter_actor_destroy() and clutter_actor_unparent() will check for the
flag before deciding whether to call the Container's remove method.
2009-12-18 23:33:14 +00:00
Emmanuele Bassi
2e6397c391 box-layout: Add knobs for controlling animations
ClutterLayoutManager does not have any state associated with it, and
defers all the state to its sub-classes.

The BoxLayout is thus in charge of controlling:

  • whether or not animations should be used
  • the duration of the animation
  • the easing mode of the animation

By adding three new properties:

  • ClutterBoxLayout:use-animations
  • ClutterBoxLayout:easing-duration
  • ClutterBoxLayout:easing-mode

And their relative accessors pairs we can make BoxLayout decide whether
or not, and with which parameters, call the begin_animation() method of
ClutterLayoutManager.

The test-box-layout has been modified to reflect this new functionality,
by checking the key-press event for the 'a' key symbol to toggle the use
of animations.
2009-12-13 01:15:02 +00:00
Emmanuele Bassi
f94a903d9e layout: Add animation support to LayoutManager
In order to animate a fluid layout we cannot use the common animation
code paths as they will override the size request and allocation paths
that are handled by the layout manager itself.

One way to introduce animations in the allocation sequence is to use a
Timeline and an Alpha to compute a progress value and then use that
value to interpolate an ActorBox between the initial and final states of
the animation - with the initial state being the last allocation of the
child prior to the animation start, and the final state the allocation
of the child at the end; for every frame of the Timeline we then queue a
relayout on the layout manager's container, which will result in an
animation.

ClutterLayoutManager is the most likely place to add a generic API for
beginning and ending an animation, as well as the place to provide a
default code path to create the ancillary Timeline and Alpha instances
needed to drive the animation.

A LayoutManager sub-class will need to:

  • call clutter_layout_manager_begin_animation() whenever it should
    animate between two states, for instance: whenever a layout property
    changes value;
  • eventually override begin_animation() and end_animation() in case
    further state needs to be set up, and then chain up to the default
    implementation provided by LayoutManager;
  • if a completely different implementation is required, the layout
    manager sub-class should override begin_animation(), end_animation()
    and get_animation_progress().

Inside the allocate() implementation the sub-class should also
interpolate between the last known allocation of a child and the newly
computed allocation.
2009-12-13 01:13:42 +00:00
Emmanuele Bassi
999359d64c Add ActorBox animation methods
ClutterActorBox should have an interpolate() method that allows to
compute the intermediate values between two states, given a progress
value, e.g.:

        clutter_actor_box_interpolate (start, end, alpha, &result);

Another utility method, useful for layout managers, is a modifier
that clamps the members of the actor box to the nearest integer
value.
2009-12-11 23:48:58 +00:00
Colin Walters
1374b5aac9 Add clutter_get_current_event
When getting signals from higher level toolkits, occasionally
one wants access to the underlying event; say for a Button
widget's "clicked" signal, to get the keyboard state.

Rather than having all of the highlevel widgets emit
ClutterEvent just for the more unusual use cases,
add a global function to access the event state.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-12-10 22:20:36 +00:00
Emmanuele Bassi
1208e47198 stage: Add accessors for :use-alpha
Use real accessors for the :use-alpha property.
2009-12-09 02:05:24 +00:00
Emmanuele Bassi
28cb2cdab5 Remove clutter_set_default_text_direction()
Setting the default text direction programmatically is wrong: it is a
value dependent on the locale or by the environment.
2009-12-07 19:00:55 +00:00
Emmanuele Bassi
9ccdf2eb02 box: Add relative packing methods
ClutterBox should provide some convenience functions to pack a new child
at a given position, either an absolute index or relative to a sibling.
2009-12-04 16:54:22 +00:00
Emmanuele Bassi
1c47638db4 docs: Add missing symbols to clutter-sections.txt 2009-12-01 14:59:44 +00:00
Emmanuele Bassi
586750751a Merge branch 'text-direction'
* text-direction:
  docs: Add text-direction accessors
  Set the default language on the Pango context
  actor: Set text direction on parenting
  tests: Display the index inside text-box-layout
  box-layout: Honour :text-direction
  text: Dirty layout cache on text direction changes
  actor: Add :text-direction property
  Use the newly added ClutterTextDirection enumeration
  Add ClutterTextDirection enumeration
2009-12-01 14:55:19 +00:00
Emmanuele Bassi
6e99c1aefe docs: Add text-direction accessors 2009-12-01 14:55:01 +00:00
Emmanuele Bassi
15a04a1dd3 layout-manager: Create LayoutMeta on demand
The ClutterLayoutMeta instances should be created on demand, whenever
the layout manager needs them - if the layout manager supports layout
properties.

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

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

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

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

The ClutterBox actor has been updated, as well as the ClutterBoxLayout
layout manager, to take advantage of the changes of LayoutManager.
2009-11-30 19:11:00 +00:00
Emmanuele Bassi
f551cbfb61 Add run-time version checks
Just like CLUTTER_CHECK_VERSION does version checking at compile
time, we need a way to verify the version of the library that we
are linking against. This is mostly needed for language bindings
and for run-time loadable modules -- when we'll get those.
2009-10-30 11:02:35 +00:00
Emmanuele Bassi
4996b2224a docs: Rename the Shader and StageManager sections 2009-10-21 17:43:34 +01:00
Emmanuele Bassi
23cd0b7925 docs: Documentation fixes
• Fix list_stages() and peek_stages() documentation

 • Fix clutter_text_set_preedit_string() arguments in the header
   to match source and documentation

 • Add clutter_units_cm() to the private section for Units

 • Rename the LayoutManager section

 • Add FlowLayout:homogeneous accessors
2009-10-19 12:01:38 +01:00
Emmanuele Bassi
ba25571c8e Merge branch 'layout-manager'
* layout-manager: (50 commits)
  docs: Reword a link
  layout, docs: Add more documentation to LayoutManager
  layout, docs: Fix description of Bin properties
  layout, bin: Use ceilf() instead of casting to int
  layout, docs: Add long description for FlowLayout
  layout, box: Clean up
  layout, box: Write long description for Box
  layout, docs: Remove unused functions
  layout: Document BoxLayout
  layout: Add BoxLayout, a single line layout manager
  layout: Report the correct size of FlowLayout
  layout: Resizing the stage resizes the FlowLayout box
  layout: Use the get_request_mode() getter in BinLayout
  layout: Change the request-mode along with the orientation
  actor: Add set_request_mode() method
  [layout] Remove FlowLayout:wrap
  [layout] Rename BinLayout and FlowLayout interactive tests
  [layout] Skip invisible children in FlowLayout
  [layout] Clean up and document FlowLayout
  [layout] Snap children of FlowLayout to column/row
  ...
2009-10-19 11:45:15 +01:00
Emmanuele Bassi
2883728387 [text] Add pre-edit string to ClutterText
Input Methods require to be able to set a "pre-edit string", that is
a string that it's just displayed into the Text actor without being
committed to the actor's buffer. The string might require custom Pango
attributes, and an update of the cursor position.
2009-10-16 12:45:29 +01:00
Emmanuele Bassi
9f06f726d4 layout, docs: Remove unused functions
The :wrap property and its accessor functions were removed from
ClutterFlowLayout.
2009-10-14 11:31:48 +01:00
Emmanuele Bassi
cd3dce1d5d layout: Document BoxLayout
Add BoxLayout to the API reference.
2009-10-14 11:31:48 +01: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
Emmanuele Bassi
5737cf869f [layout] Initial implementation of FlowLayout
FlowLayout is a layout manager that arranges its children in a
reflowing line; the orientation controls the major axis for the
layout: horizontal, for reflow on the Y axis, and vertical, for
reflow on the X axis.
2009-10-14 11:31:30 +01:00
Emmanuele Bassi
c98388bb01 [layout, box] Add Box:color
Allow setting the background color of a ClutterBox
2009-10-14 11:31:29 +01:00
Emmanuele Bassi
431a63d04a [layout] Store and use the container inside BinLayout
The BinLayout should store a pointer to the Container that it is
using it as the layout manager.

This allows us to fix the API and drop the additional Container
arguments from set_alignment() and get_alignment().

This also allows us to add a ClutterBinLayout::add() method which
adds an actor and sets the alignment policies without dealing with
variadic arguments functions and GValue (de)marshalling.
2009-10-14 11:31:29 +01:00
Emmanuele Bassi
755896664f [layout] Set a back pointer to Box inside the layout
Use the LayoutManager API to set a back pointer to the Box actor
inside the LayoutManager used by the box.

This also allows us to replace the LayoutManager on a Box, since
the LayoutManager will be able to replace all the metadata if
needed.
2009-10-14 11:31:29 +01:00
Emmanuele Bassi
9117ee2056 [layout] Allow taking a back pointer to the Container
The LayoutManager implementation might opt to take a back pointer
to the Container that is using the layout instance; this allows
direct access to the container itself from within the implementation.
2009-10-14 11:31:29 +01:00
Emmanuele Bassi
f58bdbad15 [layout] Rename Box::add to Box::pack
Since ClutterBox is a ClutterContainer we should avoid naming
collisions between methods.
2009-10-14 11:31:29 +01:00
Emmanuele Bassi
aaae60e178 [layout] Implement ClutterBox::add
The ClutterBox::add method is a simple wrapper around the Container
add_actor() method and the LayoutManager layout properties API. It
allows adding an actor to a Box and setting the layout properties in
one call.

If the LayoutManager used by the Box does not support layout properties
then the add() method short-circuits out.

Along with the varargs version of the method there's also a vector-based
variant, for language bindings to use.
2009-10-14 11:31:29 +01:00
Emmanuele Bassi
a2086f1178 [layout] Add LayoutMeta
Instead of overloading ClutterChildMeta with both container and layout
metadata and delegate to every LayoutManager implementation to keep a
backpointer to the layout manager instance, we can simply subclass
ChildMeta into LayoutMeta and presto! everything works out pretty well
for everyone.
2009-10-14 11:31:26 +01:00
Emmanuele Bassi
899db6f226 [layout, docs] Add layout managers sections
Add LayoutManager and its subclasses, and the Box actor to the
gtk-doc machinery needed to generate the API reference.
2009-10-14 11:30:43 +01:00
Emmanuele Bassi
a99f693c85 docs: Make StageManager a public class
The StageManager API is useful to track the stages of an application.
It will also be useful when we land the modules API.
2009-10-14 09:07:11 +01:00
Damien Lespiau
8605073edb [units] Add support for centimeters
The only tricky part of the patch is to remember that 1cm is 10mm.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-10-07 16:06:26 +01:00
Emmanuele Bassi
899f051cd9 [animation] Add Animation::update()
Currently, to update a property inside an animation you have to
get the interval for that property and then call the set_final_value()
method.

We can provide a simpler, bind()-like method for the convenience of
the developers that just validates everything and then calls the
Interval.set_final_value().
2009-08-25 12:16:41 +01:00
Emmanuele Bassi
a5d6b23308 [units] Add binding-friendly initializers
We should follow the convention for boxed types initializers of:

  <type_name>_from_<another_type> (boxed, value)

For ClutterUnits as well; so:

  clutter_units_pixels -> clutter_units_from_pixels
  clutter_units_em     -> clutter_units_from_em
  ...

We should still keep the short-hand version as a macro, though.
2009-07-28 13:46:11 +01:00
Emmanuele Bassi
b1d98c25f4 [doc] Miscellaneous documentation fixes
Remove private symbols, and add missing public ones.
2009-07-20 12:49:35 +01:00
Emmanuele Bassi
56ef6727b5 Allow disabling motion event throttling
It might be desirable for some applications and/or platforms to get
every motion event that was delivered to Clutter from the windowing
backend. By adding a per-stage flag we can bypass the throttling
done when processing the events.

  http://bugzilla.openedhand.com/show_bug.cgi?id=1665
2009-07-20 11:44:52 +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
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
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
9e84e52034 [docs] Update after the Input API changes 2009-06-25 14:54:16 +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
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
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
7c08f554bc [docs] Update Clutter's API reference 2009-06-10 14:54:19 +01:00
Emmanuele Bassi
e1cac4fece Fix clutter_redraw() to match the redraw cycle
The clutter_redraw() function is used by embedding toolkits to
force a redraw on a stage. Since everything is performed by
toggling a flag inside the Stage itself and then letting the
master clock advance, we need a ClutterStage method to ensure
that we start the master clock and redraw.
2009-06-09 16:29:29 +01:00
Emmanuele Bassi
19c2e66398 [docs] Various gtk-docs fixes 2009-06-09 14:47:36 +01:00
Emmanuele Bassi
33f5fe73b3 [stage] Rename fullscreen methods
The clutter_stage_fullscreen() and clutter_stage_unfullscreen() are
a GDK-ism. The underlying implementation is already using an accessor
with a boolean parameter.

This should take the amount of collisions between properties, methods
and signals to zero.
2009-06-09 14:07:35 +01:00
Emmanuele Bassi
41e85f3073 introspection-friendly ClutterEvent accessors
ClutterEvent is not really gobject-introspection friendly because
of the whole discriminated union thing. In particular, if you get
a ClutterEvent in a signal handler, you probably can't access the
event-type-specific fields, and you probably can't call methods
like clutter_key_event_symbol() either, because you can't cast the
ClutterEvent to a ClutterKeyEvent.

The cleanest solution is to turn every accessor into ClutterEvent
methods, accepting a ClutterEvent* and internally checking the event
type.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1585
2009-06-08 12:05:20 +01:00
Neil Roberts
3ee093e356 Merge branch 'timeline-no-fps' into 1.0-integration 2009-06-05 12:20:41 +01:00
Emmanuele Bassi
0d5e17ecd1 [units] Rework Units into logical distance value
Units as they have been implemented since Clutter 0.4 have always been
misdefined as "logical distance unit", while they were just pixels with
fractionary bits.

Units should be reworked to be opaque structures to hold a value and
its unit type, that can be then converted into pixels when Clutter needs
to paint or compute size requisitions and perform allocations.

The previous API should be completely removed to avoid collisions, and
a new type:

        ClutterUnits

should be added; the ability to install GObject properties using
ClutterUnits should be maintained.
2009-06-04 16:30:31 +01:00
Neil Roberts
9c7afe0c5b [timeline] Remove the concept of frames from timelines
Timelines no longer work in terms of a frame rate and a number of
frames but instead just have a duration in milliseconds. This better
matches the working of the master clock where if any timelines are
running it will redraw as fast as possible rather than limiting to the
lowest rated timeline.

Most applications will just create animations and expect them to
finish in a certain amount of time without caring about how many
frames are drawn. If a frame is going to be drawn it might as well
update all of the animations to some fraction of the total animation
rather than rounding to the nearest whole frame.

The 'frame_num' parameter of the new-frame signal is now 'msecs' which
is a number of milliseconds progressed along the
timeline. Applications should use clutter_timeline_get_progress
instead of the frame number.

Markers can now only be attached at a time value. The position is
stored in milliseconds rather than at a frame number.

test-timeline-smoothness and test-timeline-dup-frames have been
removed because they no longer make sense.
2009-06-04 13:21:57 +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
f8f54989be Merge commit 'origin/master' into 1.0-integration
Conflicts:
	clutter/clutter-texture.c
	clutter/cogl/gl/cogl-fbo.c
2009-05-20 16:49:22 +01:00
Emmanuele Bassi
407ac5075f [texture] Add missing accessors
ClutterTexture has many properties that can only be accessed using
the GObject API. This is fairly inefficient and makes binding the
class overly complicated.

The Texture class should have accessor methods for all its properties,
properly documented.
2009-05-19 13:24:56 +01:00
Emmanuele Bassi
21e3901d62 [text] Expose position_to_coords()
The clutter_text_position_to_coords() is useful for ClutterText
subclasses.

See bug:

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

Based on a patch by: Raymond Liu <raymond.liu@intel.com>
2009-05-14 16:19:15 +01:00
Emmanuele Bassi
ca23838752 [text] Add ClutterText::delete_selection()
Add a method for deleting the current selection inside a Text actor.

This is useful for subclasses.

See bug:

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

Based on a patch by: Raymond Liu <raymond.liu@intel.com>
2009-05-14 16:16:06 +01:00
Emmanuele Bassi
4cb3fa8728 [docs] Update documentation
Remove the units-based API and add the missing symbols.

Also, do not let gtk-doc check the master clock header, since
it's private.
2009-05-06 17:57:34 +01:00
Emmanuele Bassi
d0ad5a8abb [text] Expose position_to_coords()
The clutter_text_position_to_coords() is useful for ClutterText
subclasses.

See bug:

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

Based on a patch by: Raymond Liu <raymond.liu@intel.com>
2009-05-06 17:18:12 +01:00
Emmanuele Bassi
a28b9f31eb [text] Add ClutterText::delete_selection()
Add a method for deleting the current selection inside a Text actor.

This is useful for subclasses.

See bug:

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

Based on a patch by: Raymond Liu <raymond.liu@intel.com>
2009-05-06 17:13:33 +01:00
Emmanuele Bassi
d2cd636fb6 [docs] Add ClutterModel::get_filter_set() 2009-04-29 15:40:13 +01:00
Emmanuele Bassi
08ba42a5ab Allow passing the pick mode to get_actor_at_pos()
Bug 1513 - Allow passing in ClutterPickMode to
           clutter_stage_get_actor_at_pos()

At the moment, clutter_stage_get_actor_at_pos() uses CLUTTER_PICK_ALL
internally to find an actor. It would be useful to allow passing in
ClutterPickMode to clutter_stage_get_actor_at_pos(), so that the caller
can specify CLUTTER_PICK_REACTIVE as a criteria.
2009-04-24 15:25:58 +01:00
Neil Roberts
1edc19d1d3 [clutter-text] Add a separate property for the selection color
Adds a new property so that the selection color can be different from
the cursor color. If no selection color is specified it will use the
cursor color as before. If no cursor color is specified either it will
use the text color.
2009-04-06 15:22:31 +01:00
Emmanuele Bassi
bd8d3f6bd8 [group] Remove long deprecated API
ClutterGroup still ships with API deprecated since 0.4. We did
promise to keep it around for a minor release cycle -- not for 3.

Since we plan on shipping 1.0 without the extra baggage of the
deprecated entry points, here's the chance to remove the accumulated
cruft.

All the removed methods and signals have a ClutterContainer
counterpart.
2009-04-03 12:47:21 +01:00
Emmanuele Bassi
9d0ce68c2f [shader] Remove deprecated set_uniform_1f()
Since we're planning to release 1.0 without any of the deprecated
API baggage, we can simply remove the set_uniform_1f() method from
ClutterShader public API and add it to the deprecated header.
2009-04-03 12:47:21 +01:00
Emmanuele Bassi
6114c6c1db [docs] Pick up backend-specific API
The various backend API outside from clutter-x11.h and clutter-win32.h
is documented but not picked up by gtk-doc.
2009-03-18 17:06:56 +00:00
Emmanuele Bassi
9229fb6114 [docs] Bring down the undocumented symbols to 2%
The usual pre-release documentation blitzing. Most of the remaining
symbols are either COGL or X11 specific, or dummy interface typedefs.
2009-03-16 15:00:55 +00:00
Emmanuele Bassi
216373047b [animation] Enhance consistency of the Animation API
The Animation API should follow this pattern:

  - functions with an Interval as part of the arguments should have
    "interval" inside their name, e.g.:

      clutter_animation_bind_interval
      clutter_animation_update_interval

  - functions dealing with property names should have "property"
    inside their name, e.g.:

      clutter_animation_has_property
      clutter_animation_unbind_property

    - unless -

  - functions dealing with a property and its value should not
    have any modifier, e.g.:

      clutter_animation_bind

The change from update_property() to update_interval() frees up
clutter_animation_update(), to be added at a later date.
2009-03-16 14:16:18 +00:00
Emmanuele Bassi
bb795dec56 [docs] Update after Animation API changes
Rename the bind/unbind_property functions, and add the bind_interval,
completed method.

Also, add clutter_actor_get_animation().
2009-03-16 14:02:09 +00:00
Emmanuele Bassi
89e3e3a4cc [animation] Add vector variants for ::animate()
Bug 1438 - Implicit Animation API could use animatev variants

The clutter_actor_animate* family of functions use va_lists to
handle the property/value pairs for the final state of the
animation.

Language bindings have problems with variadic arguments functions,
and usually prefer vector-based API which allow a greater level
of control and conversion from native data types.

For each variadic arguments function in the clutter_actor_animate*
family there should be a vector-based version that takes:

  - the number of property/value pairs
  - a constant array of constant strings
  - an array of GValues

Most of the internal implementation can be refactored from the
current one, thus both the var_args and the vector entry points
share a common implementation of the code; then, both versions
of the API are just loops over a list of arguments.

Based on a patch by: Robert Carr <carrr@rpi.edu>
2009-03-10 12:38:04 +00:00
Emmanuele Bassi
c46106f6dd [docs] Update API reference
The API reference was still listing some symbols that have been
removed.
2009-03-10 12:38:04 +00:00
Emmanuele Bassi
f1b237b2ec [docs] Remove ClutterFixed from the documentation
Now that ClutterFixed has finally gone the way of the Dodo, we
can safely remove it from the API reference as well.
2009-03-10 12:38:04 +00:00
Emmanuele Bassi
7d674db9d2 Clean up of the ClutterColor API
The ClutterColor API has some inconsistencies:

  - the string deserialization function does not match the rest of
    the conversion function naming policy; the naming should be:

        clutter_color_parse()   ->      clutter_color_from_string()

    and the first parameter should be the ClutterColor that will
    be set from the string, not the string itself (a GDK-ism).

  - the fixed point API should not be exposed, especially in the
    form of ClutterFixed values

  - the non-fixed point HLS conversion functions do not make any
    sense. The values returned should be:

      hue        := range [ 0, 360 ]
      luminance  := range [ 0,   1 ]
      saturation := range [ 0,   1 ]

    like the current fixed point API does. Returning a value in
    the [ 0, 255 ] range is completely useless

  - the clutter_color_equal() should be converted for its use inside
    a GHashTable; a clutter_color_hash() should be added as well

  - the second parameter of the clutter_color_shade() function should
    be the shading factor, not the result (another GDK-ism). this way
    the function call can be translated from this:

      color.shade(out result, factor)

    to the more natural:

      color.shade(factor, out result)

This somewhat large commit fixes all these issues and updates the
internal users of the API.
2009-03-10 12:38:02 +00:00
Emmanuele Bassi
ef7df4b736 [docs] Update the sections file
The newly added symbols should also be added to the section file.

The CairoTexture section was referenced twice.
2009-02-19 15:01:33 +00:00
Emmanuele Bassi
9cf02bfdb9 [text] Rename :alignment to :line-alignment
The :alignment property is prone to generate confusion: developers
will set it thinking that the contents of a ClutterText will
automagically align themselves.

Instead of using the generic term :alignment, and following the
GTK+ convention, we should use a more specific term, conveying the
actual effect of the property: alignment of the lines with respect
to each other, and not to the overall allocated area.

See bug 1428:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1428
2009-02-05 19:54:48 +00:00
Emmanuele Bassi
b053d51321 [docs] Add clutter_text_set_markup()
The clutter_text_set_markup() has been added to the public API, and
should be listed in the ClutterText section of the API reference.
2009-02-02 12:07:29 +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
3e68b23ea8 Merge branch 'scale-center'
Bug 1349 - Using the anchor point to set the scale center is messy

The branch adds an extra center point for scaling which can be used
for example to set a scale about the center without affecting the
position of the actor.

The scale center can be specified as a unit offset from the origin or
as a gravity. If specified as a gravity it will be stored as a
fraction of the actor's size so that the position will track when the
actor changes size.

The anchor point and rotation centers have been modified so they can
be set with a gravity in the same way. However, only the Z rotation
exposes a property to set using a gravity because the other two
require a Z coordinate which doesn't make sense to interpret as a
fraction of the actor's width or height.

Conflicts:

	clutter/clutter-actor.c
2009-01-28 15:39:51 +00:00
Emmanuele Bassi
f9588b2487 [docs] Update Clutter API reference symbols
Add the new symbols from the ClutterClone and COGL material API
to the API reference.
2009-01-27 16:41:51 +00:00
Emmanuele Bassi
3cfc7fb1ca Merge branch 'generic-actor-clone'
* generic-actor-clone:
  Remove CloneTexture from the API
  [tests] Clean up the Clone interactive test
  Rename ActorClone to Clone/2
  Rename ActorClone to Clone/1
  Improves the unit test to verify more awkward scaling and some corresponding fixes
  Implements a generic ClutterActorClone that doesn't need fbos.
2009-01-27 16:14:35 +00:00
Emmanuele Bassi
86e95a779a Remove CloneTexture from the API
ClutterClone supercedes ClutterCloneTexture, since it can clone
every kind of actor -- including composite ones.

This is another "brain surgery with a shotgun" kind of commit: it
removes CloneTexture and updates every test case using CloneTexture
to ClutterClone. The API fallout is minimal, luckily for us.
2009-01-27 15:18:45 +00:00
Neil Roberts
418fb995c8 Replace clutter_set_use_mipmapped_text with clutter_set_font_flags
The hope is that this function makes it easier to extend the font
settings with more flags without having to add a function for every
setting.

A new flag for enabling hinting has been added. If set, this changes
the font options on the global PangoContext and any newly created
PangoContexts. The options are only set if the flag is changed from
the default so it won't override any detailed setting chosen by the
backend.
2009-01-27 14:43:44 +00:00
Neil Roberts
9ea6ab76fb Fix gtk-doc reference since the anchor point changes
The documentation has been updated to reflect the fact that the anchor
point will move when the actor changes size if it was specified using
a gravity value. The new functions for setting the scale center and z
rotation gravity are also documented.
2009-01-23 18:41:41 +00:00
Emmanuele Bassi
134edac82c Bug 1361 - Unused ClutterStage::get_resolution() methods
The clutter_stage_get_resolution() and fixed-point API are just
shorthands for:

        clutter_backend_get_resolution (default_backend);

And as such do not fit at all in the ClutterStage class. The only
reason for their existence was the ClutterUnit conversion macros,
which have now been fixed to use the default backend through a
function call instead.

Thus, we can safely remove the stage entry points.
2009-01-23 15:16:21 +00:00
Emmanuele Bassi
792ffa1538 Merge branch 'float-alpha-value'
* float-alpha-value:
  [script] Parse easing modes by name
  [docs] Update the easing modes documentation
  [animation] Implement new easing functions
  [animation] Move the alpha value to floating point
2009-01-23 12:10:50 +00:00
Emmanuele Bassi
ee883f30d4 Add units-from-em conversion
An em is a unit of measurement in typography, equal to the point
size of the current font.

It should be possible to convert a value expressed in em to
ClutterUnits by using the current font and the current DPI as
stored by the default backend.
2009-01-21 17:35:47 +00:00
Emmanuele Bassi
93a0454c09 Remove the single-stage units converters
The stage-with/height-percentage converters had been broken by
the multiple-stages support of Clutter 0.8. They are also made
useless by the fact that Units are now floating point values.

The millimeters and typographic points converters also depended
on the default stage, but they can be reworked to use the default
DPI coming from the default Backend instead.
2009-01-21 17:10:36 +00:00
Emmanuele Bassi
0be613109e [docs] Remove sources of warnings in API references 2009-01-21 16:41:18 +00:00
Emmanuele Bassi
8736db6aed [docs] Update ClutterMedia section
The ClutterMedia API has been changed, so we need to update
the API reference to reflect that.
2009-01-20 23:40:25 +00:00
Emmanuele Bassi
268abcd786 [docs] Update the easing modes documentation
The ClutterAlpha API reference page should also list the
easing modes Clutter provides by default, by showing the
curves used by each entry in the AnimationMode enumeration.

We can also remove the incomplete graph showing the old
alpha functions.
2009-01-20 18:13:36 +00:00
Emmanuele Bassi
74213e0ee3 [alpha] Allow registering alpha functions
In order to unify alpha functions and animation modes in ClutterAlpha
we should be able to register alpha functions and get a logical id
for them; the logical id will then be available to be used by
clutter_alpha_set_mode().

The registration requires API changes in ClutterAlpha constructors
and methods. It also provides the chance to shift ClutterAlpha
towards the use of animations modes only, and to alpha functions
as a convenience API for language bindings alone.
2009-01-16 14:37:35 +00:00
Emmanuele Bassi
41386a5f72 Remove the Effects API
The Effects API and all related symbols have been superceded by
the newly added Animation API and clutter_actor_animate().

This commit removes the Effects implementation, the documentation
and the interactive test/example code.
2009-01-14 16:56:21 +00:00
Emmanuele Bassi
1cac3d91f9 Add unused symbols
Append the newly added ClutterBindingPool symbols and
clutter_stage_ensure_viewport() to the API reference.
2009-01-14 15:05:03 +00:00
Emmanuele Bassi
a074106ded Merge branch 'animation-improvements'
* animation-improvements:
  [docs] Add ClutterAnimatable to the API reference
  Add license notice to ClutterAnimation files
  [docs] Update the ClutterAnimation section
  [animation] Extend ClutterAnimation support to all objects
  [animation] Use ClutterAnimatable inside Animation
  [animation] Add ClutterAnimatable
  [animation] Allow registering custom progress function
  [animation] Interval::compute_value should return a boolean
  Animate ClutterColor properties
2009-01-14 15:00:44 +00:00
Emmanuele Bassi
2693ea3ddc [docs] Documentation warnings
Fix the various warnings issued by gtk-doc when enabling the API
reference generation for both COGL and Clutter.
2009-01-09 14:26:35 +00:00
Emmanuele Bassi
db3d2e9568 Merge branch 'animatable-iface' into animation-improvements
* animatable-iface:
  [docs] Add ClutterAnimatable to the API reference
  Add license notice to ClutterAnimation files
  [animation] Use ClutterAnimatable inside Animation
  [animation] Add ClutterAnimatable
2009-01-08 13:38:51 +00:00
Emmanuele Bassi
628ccaf4a8 [docs] Add ClutterAnimatable to the API reference 2009-01-08 13:31:27 +00:00