mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
2008-02-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Add last-minute API additions. * subclassing-ClutterActor.sgml: Fix some of the notes; the Container implementation will need its own section.
This commit is contained in:
parent
78341d2e28
commit
a4c0b1e939
@ -1,3 +1,10 @@
|
|||||||
|
2008-02-15 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
|
* clutter-sections.txt: Add last-minute API additions.
|
||||||
|
|
||||||
|
* subclassing-ClutterActor.sgml: Fix some of the notes; the
|
||||||
|
Container implementation will need its own section.
|
||||||
|
|
||||||
2008-02-14 Matthew Allum <mallum@openedhand.com>
|
2008-02-14 Matthew Allum <mallum@openedhand.com>
|
||||||
|
|
||||||
* clutter-animation.sgml:
|
* clutter-animation.sgml:
|
||||||
|
@ -321,6 +321,7 @@ clutter_actor_get_y
|
|||||||
clutter_actor_move_by
|
clutter_actor_move_by
|
||||||
clutter_actor_set_rotation
|
clutter_actor_set_rotation
|
||||||
clutter_actor_get_rotation
|
clutter_actor_get_rotation
|
||||||
|
clutter_actor_is_rotated
|
||||||
clutter_actor_set_opacity
|
clutter_actor_set_opacity
|
||||||
clutter_actor_get_opacity
|
clutter_actor_get_opacity
|
||||||
clutter_actor_set_name
|
clutter_actor_set_name
|
||||||
@ -348,13 +349,17 @@ clutter_actor_set_depth
|
|||||||
clutter_actor_get_depth
|
clutter_actor_get_depth
|
||||||
clutter_actor_set_scale
|
clutter_actor_set_scale
|
||||||
clutter_actor_get_scale
|
clutter_actor_get_scale
|
||||||
|
clutter_actor_is_scaled
|
||||||
clutter_actor_get_abs_size
|
clutter_actor_get_abs_size
|
||||||
clutter_actor_apply_transform_to_point
|
clutter_actor_apply_transform_to_point
|
||||||
clutter_actor_transform_stage_point
|
clutter_actor_transform_stage_point
|
||||||
|
clutter_actor_apply_relative_transform_to_point
|
||||||
|
|
||||||
<SUBSECTION>
|
<SUBSECTION>
|
||||||
ClutterVertex
|
ClutterVertex
|
||||||
clutter_actor_get_vertices
|
clutter_actor_get_vertices
|
||||||
|
clutter_actor_get_relative_vertices
|
||||||
|
clutter_actor_box_get_from_vertices
|
||||||
|
|
||||||
<SUBSECTION>
|
<SUBSECTION>
|
||||||
clutter_actor_set_anchor_point
|
clutter_actor_set_anchor_point
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
A few FIXMES:
|
A few FIXMES:
|
||||||
- note use of units in sizing
|
|
||||||
- more on composite/container actors, when/why to use...
|
- more on composite/container actors, when/why to use...
|
||||||
+ implementaing a composite actor - set_parent() etc
|
+ implementaing a composite actor - set_parent() etc
|
||||||
+ implementing a container - interface etc
|
+ implementing a container - interface etc
|
||||||
- Painting
|
- Painting
|
||||||
+ note transform already applied. (including position, scale etc)
|
|
||||||
+ note on cogl_enable if painting texture or blended item
|
+ note on cogl_enable if painting texture or blended item
|
||||||
(should at least call cogl_enable(0) - to reset state cache)
|
(should at least call cogl_enable(0) - to reset state cache)
|
||||||
+ fine to use regular GL but then wont be portable
|
+ fine to use regular GL but then wont be portable
|
||||||
@ -44,6 +42,11 @@
|
|||||||
each visible child. Remember: the returned coordinates must be relative
|
each visible child. Remember: the returned coordinates must be relative
|
||||||
to the parent actor.</para>
|
to the parent actor.</para>
|
||||||
|
|
||||||
|
<note>All the coordinates are expressed using #ClutterUnit<!-- -->s,
|
||||||
|
the internal high-precision unit type, which guarantee sub-pixel
|
||||||
|
precision. #ClutterUnit has the same limitation that #ClutterFixed
|
||||||
|
has, see the <link linkend="clutter-Fixed-Point-Support">fixed point page</link>.</note>
|
||||||
|
|
||||||
<example id="clutter-actor-query-coords-example">
|
<example id="clutter-actor-query-coords-example">
|
||||||
<para>This example shows how an actor class should override the
|
<para>This example shows how an actor class should override the
|
||||||
query_coords() virtual function of #ClutterActor. In this case,
|
query_coords() virtual function of #ClutterActor. In this case,
|
||||||
@ -57,6 +60,10 @@ foo_actor_query_coords (ClutterActor *actor,
|
|||||||
{
|
{
|
||||||
FooActor *foo_actor = FOO_ACTOR (actor);
|
FooActor *foo_actor = FOO_ACTOR (actor);
|
||||||
GList *child;
|
GList *child;
|
||||||
|
|
||||||
|
/* Clutter uses high-precision units which can be converted from
|
||||||
|
* and into pixels, typographic points, percentages, etc.
|
||||||
|
*/
|
||||||
ClutterUnit width, height;
|
ClutterUnit width, height;
|
||||||
|
|
||||||
/* initialize our size */
|
/* initialize our size */
|
||||||
@ -66,7 +73,7 @@ foo_actor_query_coords (ClutterActor *actor,
|
|||||||
{
|
{
|
||||||
ClutterActor *child_actor = child->data;
|
ClutterActor *child_actor = child->data;
|
||||||
|
|
||||||
/* we return only visible actors */
|
/* we consider only visible actors */
|
||||||
if (CLUTTER_ACTOR_IS_VISIBLE (child_actor))
|
if (CLUTTER_ACTOR_IS_VISIBLE (child_actor))
|
||||||
{
|
{
|
||||||
ClutterActorBox child_box = { 0, };
|
ClutterActorBox child_box = { 0, };
|
||||||
@ -100,6 +107,10 @@ foo_actor_query_coords (ClutterActor *actor,
|
|||||||
or composite actors with internal children should do the same, and call
|
or composite actors with internal children should do the same, and call
|
||||||
clutter_actor_paint() on every visible child:</para>
|
clutter_actor_paint() on every visible child:</para>
|
||||||
|
|
||||||
|
<para>When inside the ClutterActor::paint() method the actor is already
|
||||||
|
positioned at the coordinates specified by its bounding box; all the
|
||||||
|
paint operations should then take place from the (0, 0) coordinates.</para>
|
||||||
|
|
||||||
<example id="clutter-actor-paint-example">
|
<example id="clutter-actor-paint-example">
|
||||||
<programlisting>
|
<programlisting>
|
||||||
static void
|
static void
|
||||||
@ -142,6 +153,12 @@ foo_actor_pick (ClutterActor *actor,
|
|||||||
FooActor *foo_actor = FOO_ACTOR (actor);
|
FooActor *foo_actor = FOO_ACTOR (actor);
|
||||||
guint width, height;
|
guint width, height;
|
||||||
|
|
||||||
|
/* it is possible to avoid a costly paint by checking whether the
|
||||||
|
* actor should really be painted in pick mode
|
||||||
|
*/
|
||||||
|
if (!clutter_actor_should_pick_paint (actor))
|
||||||
|
return;
|
||||||
|
|
||||||
/* by including <clutter/cogl.h> it's possible to use the internal
|
/* by including <clutter/cogl.h> it's possible to use the internal
|
||||||
* COGL abstraction API, which is also used by Clutter itself and avoids
|
* COGL abstraction API, which is also used by Clutter itself and avoids
|
||||||
* changing the GL calls depending on the target platform (GL or GL/ES).
|
* changing the GL calls depending on the target platform (GL or GL/ES).
|
||||||
@ -150,6 +167,9 @@ foo_actor_pick (ClutterActor *actor,
|
|||||||
|
|
||||||
clutter_actor_get_size (actor, &width, &height);
|
clutter_actor_get_size (actor, &width, &height);
|
||||||
|
|
||||||
|
/* it is also possible to use raw GL calls, at the cost of losing
|
||||||
|
* portability
|
||||||
|
*/
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
|
|
||||||
/* draw a triangular shape */
|
/* draw a triangular shape */
|
||||||
@ -164,4 +184,6 @@ foo_actor_pick (ClutterActor *actor,
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
|
<para></para>
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
||||||
|
Loading…
Reference in New Issue
Block a user