~oem-solutions-group/unity-2d/clutter-1.0

« back to all changes in this revision

Viewing changes to doc/reference/clutter/html/clutter-subclassing-ClutterActor.html

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
Import upstream version 1.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
<link rel="up" href="additionaldocs.html" title="Part VIII. Additional Documentation">
9
9
<link rel="prev" href="additionaldocs.html" title="Part VIII. Additional Documentation">
10
10
<link rel="next" href="clutter-animations.html" title="Creating Animations with Clutter">
11
 
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="part" href="clutter-overview.html" title="Part I. Overview">
14
14
<link rel="part" href="building-clutter.html" title="Part II. Building Clutter">
17
17
<link rel="chapter" href="ch01.html" title="Abstract classes and interfaces">
18
18
<link rel="chapter" href="ch02.html" title="Base actors">
19
19
<link rel="chapter" href="ch03.html" title="Container actors">
 
20
<link rel="chapter" href="ch04.html" title="Layout managers">
20
21
<link rel="part" href="clutteranimation.html" title="Part V. Clutter Animation Framework">
21
 
<link rel="chapter" href="ch04.html" title="Base classes">
22
 
<link rel="chapter" href="ch05.html" title="Behaviours">
23
 
<link rel="chapter" href="ch06.html" title="High Level API">
 
22
<link rel="chapter" href="ch05.html" title="Base classes">
 
23
<link rel="chapter" href="ch06.html" title="Behaviours">
 
24
<link rel="chapter" href="ch07.html" title="High Level API">
24
25
<link rel="part" href="cluttertools.html" title="Part VI. Clutter Tools">
25
 
<link rel="chapter" href="ch07.html" title="General purpose API">
26
 
<link rel="chapter" href="ch08.html" title="User interface definition">
27
 
<link rel="chapter" href="ch09.html" title="Generic list model">
 
26
<link rel="chapter" href="ch08.html" title="General purpose API">
 
27
<link rel="chapter" href="ch09.html" title="User interface definition">
 
28
<link rel="chapter" href="ch10.html" title="Generic list model">
28
29
<link rel="part" href="clutterbackends.html" title="Part VII. Clutter Backends">
29
30
<link rel="part" href="additionaldocs.html" title="Part VIII. Additional Documentation">
30
31
<link rel="chapter" href="clutter-subclassing-ClutterActor.html" title="Implementing a new actor">
47
48
<link rel="index" href="ix05.html" title="Index of new symbols in 0.6">
48
49
<link rel="index" href="ix06.html" title="Index of new symbols in 0.8">
49
50
<link rel="index" href="ix07.html" title="Index of new symbols in 1.0">
 
51
<link rel="index" href="ix08.html" title="Index of new symbols in 1.2">
50
52
<link rel="appendix" href="license.html" title="Appendix A. License">
51
53
</head>
52
54
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
71
73
</div></div>
72
74
</div></div>
73
75
<p>In order to implement a new <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> subclass the usual
74
 
  machinery for subclassing a <a
75
 
href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"
76
 
><span class="type">GObject</span></a> should be used:</p>
 
76
  machinery for subclassing a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> should be used:</p>
77
77
<div class="informalexample"><pre class="programlisting">
78
78
#define FOO_TYPE_ACTOR            (foo_actor_get_type ())
79
79
#define FOO_ACTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_ACTOR, FooActor))
220
220
    truncate the precision of the computed values.</p>
221
221
</div>
222
222
<div class="example">
223
 
<a name="clutter-actor-get-width-request-example"></a><p class="title"><b>Example 1. Width requisition implementation of a container</b></p>
 
223
<a name="clutter-actor-get-width-request-example"></a><p class="title"><b>Example 8. Width requisition implementation of a container</b></p>
224
224
<div class="example-contents">
225
225
<p>This example shows how an actor class should override the
226
226
      <code class="function">get_preferred_width()</code> virtual function of <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>. In this case,
326
326
<h3 class="title">Note</h3>
327
327
<p>The <code class="function">allocate()</code> virtual function implementation will be
328
328
    notified whether the actor has been moved, while <a class="link" href="ClutterActor.html#clutter-actor-allocate" title="clutter_actor_allocate ()"><code class="function">clutter_actor_allocate()</code></a>
329
 
    will usually be invoked with the <a class="link" href="ClutterActor.html#CLUTTER-ABSOLUTE-ORIGIN-CHANGED--CAPS"><code class="literal">CLUTTER_ABSOLUTE_ORIGIN_CHANGED</code></a> flag,
 
329
    will usually be invoked with the <a class="link" href="ClutterActor.html#CLUTTER-ABSOLUTE-ORIGIN-CHANGED:CAPS"><code class="literal">CLUTTER_ABSOLUTE_ORIGIN_CHANGED</code></a> flag,
330
330
    meaning that the parent has been moved.</p>
331
331
</div>
332
332
<div class="example">
333
 
<a name="container-allocate-example"></a><p class="title"><b>Example 2. Allocation of a container</b></p>
 
333
<a name="container-allocate-example"></a><p class="title"><b>Example 9. Allocation of a container</b></p>
334
334
<div class="example-contents">
335
335
<p>In this example, <code class="classname">FooActor</code> acts like a
336
336
      horizontal box with overflowing, like a toolbar which will display
440
440
    using the Clutter GL and GLES abstraction library (COGL) or by directly
441
441
    using the GL or GLES API.</p>
442
442
<div class="example">
443
 
<a name="simple-actor-paint-example"></a><p class="title"><b>Example 3. Paint implementation of a simple actor</b></p>
 
443
<a name="simple-actor-paint-example"></a><p class="title"><b>Example 10. Paint implementation of a simple actor</b></p>
444
444
<div class="example-contents">
445
445
<p>In this example, the <code class="classname">FooActor</code>
446
446
      implementation of the <code class="function">paint()</code> virtual function is drawing a rectangle
493
493
    also override the paint method, and call <a class="link" href="ClutterActor.html#clutter-actor-paint" title="clutter_actor_paint ()"><code class="function">clutter_actor_paint()</code></a> on every
494
494
    visible child:</p>
495
495
<div class="example">
496
 
<a name="container-actor-paint-example"></a><p class="title"><b>Example 4. Paint implementation of a container</b></p>
 
496
<a name="container-actor-paint-example"></a><p class="title"><b>Example 11. Paint implementation of a container</b></p>
497
497
<div class="example-contents">
498
498
<p>In this example, <code class="classname">FooActor</code> is a simple
499
499
      container invoking <a class="link" href="ClutterActor.html#clutter-actor-paint" title="clutter_actor_paint ()"><code class="function">clutter_actor_paint()</code></a> on every visible child.</p>
522
522
    overridden. The <code class="function">pick()</code> method works exactly like the <code class="function">paint()</code> method, but
523
523
    the actor should paint just its shape with the passed colour:</p>
524
524
<div class="example">
525
 
<a name="simple-actor-pick-example"></a><p class="title"><b>Example 5. Pick implementation of a simple actor</b></p>
 
525
<a name="simple-actor-pick-example"></a><p class="title"><b>Example 12. Pick implementation of a simple actor</b></p>
526
526
<div class="example-contents">
527
527
<p>In this example, <code class="classname">FooActor</code> overrides the
528
528
      <code class="function">pick()</code> virtual function default implementation to paint itself with a
565
565
    <code class="function">pick()</code> implementation to get their silhouette painted and then
566
566
    paint their children:</p>
567
567
<div class="example">
568
 
<a name="container-actor-pick-example"></a><p class="title"><b>Example 6. Pick implementation of a container</b></p>
 
568
<a name="container-actor-pick-example"></a><p class="title"><b>Example 13. Pick implementation of a container</b></p>
569
569
<div class="example-contents">
570
570
<p>In this example, <code class="classname">FooActor</code> allows the
571
571
      picking of each child it contains, as well as itself.</p>
603
603
    <a class="link" href="ClutterActor.html#clutter-actor-set-parent" title="clutter_actor_set_parent ()"><code class="function">clutter_actor_set_parent()</code></a>:
604
604
    </p>
605
605
<div class="example">
606
 
<a name="clutter-actor-set-parent-example"></a><p class="title"><b>Example 7. Parenting an actor</b></p>
 
606
<a name="clutter-actor-set-parent-example"></a><p class="title"><b>Example 14. Parenting an actor</b></p>
607
607
<div class="example-contents">
608
608
<p>In this example, <code class="classname">FooActor</code> has an internal
609
609
      child of type <code class="classname">BazActor</code> which is assigned using a
715
715
</div>
716
716
<div class="footer">
717
717
<hr>
718
 
          Generated by GTK-Doc V1.11</div>
 
718
          Generated by GTK-Doc V1.13</div>
719
719
</body>
720
 
</html>
 
720
</html>
 
 
b'\\ No newline at end of file'