This file is indexed.

/usr/share/gtk-doc/html/clutter/ClutterEffect.html is in libclutter-1.0-doc 1.24.2-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ClutterEffect: Clutter Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Clutter Reference Manual">
<link rel="up" href="ch01.html" title="Abstract classes and interfaces">
<link rel="prev" href="ClutterConstraint.html" title="ClutterConstraint">
<link rel="next" href="ClutterContent.html" title="ClutterContent">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#ClutterEffect.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#ClutterEffect.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ClutterConstraint.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="ClutterContent.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="ClutterEffect"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="ClutterEffect.top_of_page"></a>ClutterEffect</span></h2>
<p>ClutterEffect — Base class for actor effects</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="ClutterEffect.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody><tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="ClutterEffect.html#clutter-effect-queue-repaint" title="clutter_effect_queue_repaint ()">clutter_effect_queue_repaint</a> <span class="c_punctuation">()</span>
</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="ClutterEffect.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="ClutterEffect.html#ClutterEffect-struct" title="ClutterEffect">ClutterEffect</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="ClutterEffect.html#ClutterEffectClass" title="struct ClutterEffectClass">ClutterEffectClass</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="ClutterEffect.html#ClutterEffectPaintFlags" title="enum ClutterEffectPaintFlags">ClutterEffectPaintFlags</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="ClutterEffect.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> GInitiallyUnowned
        <span class="lineart">╰──</span> <a class="link" href="ClutterActorMeta.html" title="ClutterActorMeta">ClutterActorMeta</a>
            <span class="lineart">╰──</span> ClutterEffect
                <span class="lineart">╰──</span> <a class="link" href="ClutterOffscreenEffect.html" title="ClutterOffscreenEffect">ClutterOffscreenEffect</a>
</pre>
</div>
<div class="refsect1">
<a name="ClutterEffect.description"></a><h2>Description</h2>
<p>The <a class="link" href="ClutterEffect.html" title="ClutterEffect"><span class="type">ClutterEffect</span></a> class provides a default type and API for creating
effects for generic actors.</p>
<p>Effects are a <a class="link" href="ClutterActorMeta.html" title="ClutterActorMeta"><span class="type">ClutterActorMeta</span></a> sub-class that modify the way an actor
is painted in a way that is not part of the actor's implementation.</p>
<p>Effects should be the preferred way to affect the paint sequence of an
actor without sub-classing the actor itself and overriding the
<a class="link" href="ClutterActor.html#ClutterActorClass.paint"><code class="function">ClutterActorClass.paint()</code></a>_ virtual function.</p>
<div class="refsect3">
<a name="id-1.5.2.11.6.5"></a><h4>Implementing a ClutterEffect</h4>
<p>Creating a sub-class of <a class="link" href="ClutterEffect.html" title="ClutterEffect"><span class="type">ClutterEffect</span></a> requires overriding the
<a class="link" href="ClutterEffect.html#ClutterEffectClass.paint"><code class="function">ClutterEffectClass.paint()</code></a> method. The implementation of the function should look
something like this:</p>
<div class="informalexample"><pre class="programlisting">
void effect_paint (ClutterEffect *effect, ClutterEffectPaintFlags flags)
{
  // Set up initialisation of the paint such as binding a
  // CoglOffscreen or other operations

  // Chain to the next item in the paint sequence. This will either call
  // ‘paint’ on the next effect or just paint the actor if this is
  // the last effect.
  ClutterActor *actor =
    clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));

  clutter_actor_continue_paint (actor);

  // perform any cleanup of state, such as popping the CoglOffscreen
}
</pre></div>
<p></p>
<p>The effect can optionally avoid calling <a class="link" href="ClutterActor.html#clutter-actor-continue-paint" title="clutter_actor_continue_paint ()"><code class="function">clutter_actor_continue_paint()</code></a> to skip any
further stages of the paint sequence. This is useful for example if the effect
contains a cached image of the actor. In that case it can optimise painting by
avoiding the actor paint and instead painting the cached image.</p>
<p>The <a class="link" href="ClutterEffect.html#CLUTTER-EFFECT-PAINT-ACTOR-DIRTY:CAPS"><code class="literal">CLUTTER_EFFECT_PAINT_ACTOR_DIRTY</code></a> flag is useful in this case. Clutter will set
this flag when a redraw has been queued on the actor since it was last painted. The
effect can use this information to decide if the cached image is still valid.</p>
</div>
<div class="refsect3">
<a name="id-1.5.2.11.6.6"></a><h4>A simple ClutterEffect implementation</h4>
<p>The example below creates two rectangles: one will be painted "behind" the actor,
while another will be painted "on top" of the actor.</p>
<p>The <a class="link" href="ClutterActorMeta.html#ClutterActorMetaClass.set-actor"><code class="function">ClutterActorMetaClass.set_actor()</code></a> implementation will create the two materials
used for the two different rectangles; the <a class="link" href="ClutterEffect.html#ClutterEffectClass.paint"><code class="function">ClutterEffectClass.paint()</code></a> implementation
will paint the first material using <code class="function">cogl_rectangle()</code>, before continuing and then it
will paint paint the second material after.</p>
<div class="informalexample"><pre class="programlisting">
 typedef struct {
   ClutterEffect parent_instance;

   CoglHandle rect_1;
   CoglHandle rect_2;
 } MyEffect;

 typedef struct _ClutterEffectClass MyEffectClass;

 G_DEFINE_TYPE (MyEffect, my_effect, CLUTTER_TYPE_EFFECT);

 static void
 my_effect_set_actor (ClutterActorMeta *meta,
                      ClutterActor     *actor)
 {
   MyEffect *self = MY_EFFECT (meta);

   // Clear the previous state //
   if (self-&gt;rect_1)
     {
       cogl_handle_unref (self-&gt;rect_1);
       self-&gt;rect_1 = NULL;
     }

   if (self-&gt;rect_2)
     {
       cogl_handle_unref (self-&gt;rect_2);
       self-&gt;rect_2 = NULL;
     }

   // Maintain a pointer to the actor
   self-&gt;actor = actor;

   // If we've been detached by the actor then we should just bail out here
   if (self-&gt;actor == NULL)
     return;

   // Create a red material
   self-&gt;rect_1 = cogl_material_new ();
   cogl_material_set_color4f (self-&gt;rect_1, 1.0, 0.0, 0.0, 1.0);

   // Create a green material
   self-&gt;rect_2 = cogl_material_new ();
   cogl_material_set_color4f (self-&gt;rect_2, 0.0, 1.0, 0.0, 1.0);
 }

 static gboolean
 my_effect_paint (ClutterEffect *effect)
 {
   MyEffect *self = MY_EFFECT (effect);
   gfloat width, height;

   clutter_actor_get_size (self-&gt;actor, &amp;width, &amp;height);

   // Paint the first rectangle in the upper left quadrant
   cogl_set_source (self-&gt;rect_1);
   cogl_rectangle (0, 0, width / 2, height / 2);

   // Continue to the rest of the paint sequence
   clutter_actor_continue_paint (self-&gt;actor);

   // Paint the second rectangle in the lower right quadrant
   cogl_set_source (self-&gt;rect_2);
   cogl_rectangle (width / 2, height / 2, width, height);
 }

 static void
 my_effect_class_init (MyEffectClass *klass)
 {
   ClutterActorMetaClas *meta_class = CLUTTER_ACTOR_META_CLASS (klass);

   meta_class-&gt;set_actor = my_effect_set_actor;

   klass-&gt;paint = my_effect_paint;
 }
</pre></div>
<p></p>
<p><a class="link" href="ClutterEffect.html" title="ClutterEffect"><span class="type">ClutterEffect</span></a> is available since Clutter 1.4</p>
</div>
</div>
<div class="refsect1">
<a name="ClutterEffect.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="clutter-effect-queue-repaint"></a><h3>clutter_effect_queue_repaint ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
clutter_effect_queue_repaint (<em class="parameter"><code><a class="link" href="ClutterEffect.html" title="ClutterEffect"><span class="type">ClutterEffect</span></a> *effect</code></em>);</pre>
<p>Queues a repaint of the effect. The effect can detect when the ‘paint’
method is called as a result of this function because it will not
have the <a class="link" href="ClutterEffect.html#CLUTTER-EFFECT-PAINT-ACTOR-DIRTY:CAPS"><code class="literal">CLUTTER_EFFECT_PAINT_ACTOR_DIRTY</code></a> flag set. In that case the
effect is free to assume that the actor has not changed its
appearance since the last time it was painted so it doesn't need to
call <a class="link" href="ClutterActor.html#clutter-actor-continue-paint" title="clutter_actor_continue_paint ()"><code class="function">clutter_actor_continue_paint()</code></a> if it can draw a cached
image. This is mostly intended for effects that are using a
<code class="literal">CoglOffscreen</code> to redirect the actor (such as
<a class="link" href="ClutterOffscreenEffect.html" title="ClutterOffscreenEffect"><code class="literal">ClutterOffscreenEffect</code></a>). In that case the effect can save a bit of
rendering time by painting the cached texture without causing the
entire actor to be painted.</p>
<p>This function can be used by effects that have their own animatable
parameters. For example, an effect which adds a varying degree of a
red tint to an actor by redirecting it through a CoglOffscreen
might have a property to specify the level of tint. When this value
changes, the underlying actor doesn't need to be redrawn so the
effect can call <a class="link" href="ClutterEffect.html#clutter-effect-queue-repaint" title="clutter_effect_queue_repaint ()"><code class="function">clutter_effect_queue_repaint()</code></a> to make sure the
effect is repainted.</p>
<p>Note however that modifying the position of the parent of an actor
may change the appearance of the actor because its transformation
matrix would change. In this case a redraw wouldn't be queued on
the actor itself so the <a class="link" href="ClutterEffect.html#CLUTTER-EFFECT-PAINT-ACTOR-DIRTY:CAPS"><code class="literal">CLUTTER_EFFECT_PAINT_ACTOR_DIRTY</code></a> would still
not be set. The effect can detect this case by keeping track of the
last modelview matrix that was used to render the actor and
veryifying that it remains the same in the next paint.</p>
<p>Any other effects that are layered on top of the passed in effect
will still be passed the <a class="link" href="ClutterEffect.html#CLUTTER-EFFECT-PAINT-ACTOR-DIRTY:CAPS"><code class="literal">CLUTTER_EFFECT_PAINT_ACTOR_DIRTY</code></a> flag. If
anything queues a redraw on the actor without specifying an effect
or with an effect that is lower in the chain of effects than this
one then that will override this call. In that case this effect
will instead be called with the <a class="link" href="ClutterEffect.html#CLUTTER-EFFECT-PAINT-ACTOR-DIRTY:CAPS"><code class="literal">CLUTTER_EFFECT_PAINT_ACTOR_DIRTY</code></a>
flag set.</p>
<div class="refsect3">
<a name="id-1.5.2.11.7.2.8"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>effect</p></td>
<td class="parameter_description"><p>A <a class="link" href="ClutterEffect.html" title="ClutterEffect"><span class="type">ClutterEffect</span></a> which needs redrawing</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix11.html#api-index-1.8">1.8</a></p>
</div>
</div>
<div class="refsect1">
<a name="ClutterEffect.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="ClutterEffect-struct"></a><h3>ClutterEffect</h3>
<pre class="programlisting">typedef struct _ClutterEffect ClutterEffect;</pre>
<p>The <a class="link" href="ClutterEffect.html" title="ClutterEffect"><span class="type">ClutterEffect</span></a> structure contains only private data and should
be accessed using the provided API</p>
<p class="since">Since: <a class="link" href="ix09.html#api-index-1.4">1.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="ClutterEffectClass"></a><h3>struct ClutterEffectClass</h3>
<pre class="programlisting">struct ClutterEffectClass {
  gboolean (* pre_paint)        (ClutterEffect           *effect);
  void     (* post_paint)       (ClutterEffect           *effect);

  gboolean (* get_paint_volume) (ClutterEffect           *effect,
                                 ClutterPaintVolume      *volume);

  void     (* paint)            (ClutterEffect           *effect,
                                 ClutterEffectPaintFlags  flags);
  void     (* pick)             (ClutterEffect           *effect,
                                 ClutterEffectPaintFlags  flags);
};
</pre>
<p>The <a class="link" href="ClutterEffect.html#ClutterEffectClass" title="struct ClutterEffectClass"><span class="type">ClutterEffectClass</span></a> structure contains only private data</p>
<div class="refsect3">
<a name="id-1.5.2.11.8.3.5"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="ClutterEffectClass.pre-paint"></a>pre_paint</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual function</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="ClutterEffectClass.post-paint"></a>post_paint</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual function</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="ClutterEffectClass.get-paint-volume"></a>get_paint_volume</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual function</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="ClutterEffectClass.paint"></a>paint</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual function</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="ClutterEffectClass.pick"></a>pick</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual function</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-1.4">1.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="ClutterEffectPaintFlags"></a><h3>enum ClutterEffectPaintFlags</h3>
<p>Flags passed to the ‘paint’ or ‘pick’ method of <a class="link" href="ClutterEffect.html" title="ClutterEffect"><span class="type">ClutterEffect</span></a>.</p>
<div class="refsect3">
<a name="id-1.5.2.11.8.4.4"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody><tr>
<td class="enum_member_name"><p><a name="CLUTTER-EFFECT-PAINT-ACTOR-DIRTY:CAPS"></a>CLUTTER_EFFECT_PAINT_ACTOR_DIRTY</p></td>
<td class="enum_member_description">
<p>The actor or one of its children
  has queued a redraw before this paint. This implies that the effect
  should call <a class="link" href="ClutterActor.html#clutter-actor-continue-paint" title="clutter_actor_continue_paint ()"><code class="function">clutter_actor_continue_paint()</code></a> to chain to the next
  effect and can not cache any results from a previous paint.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>