1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>ClutterImage</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Clutter Reference Manual">
8 <link rel="up" href="ch07.html" title="Content">
9 <link rel="prev" href="ClutterCanvas.html" title="ClutterCanvas">
10 <link rel="next" href="ch08.html" title="Paint Objects">
11 <meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="ClutterCanvas.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch07.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Clutter Reference Manual</th>
21 <td><a accesskey="n" href="ch08.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#clutter-ClutterImage.synopsis" class="shortcut">Top</a>
26 <a href="#clutter-ClutterImage.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="clutter-ClutterImage"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="clutter-ClutterImage.top_of_page"></a>ClutterImage</span></h2>
34 <p>ClutterImage — Image data content</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="clutter-ClutterImage.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">struct <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage">ClutterImage</a>;
41 struct <a class="link" href="clutter-ClutterImage.html#ClutterImageClass" title="struct ClutterImageClass">ClutterImageClass</a>;
42 #define <a class="link" href="clutter-ClutterImage.html#CLUTTER-IMAGE-ERROR:CAPS" title="CLUTTER_IMAGE_ERROR">CLUTTER_IMAGE_ERROR</a>
43 enum <a class="link" href="clutter-ClutterImage.html#ClutterImageError" title="enum ClutterImageError">ClutterImageError</a>;
44 <a class="link" href="ClutterContent.html" title="ClutterContent"><span class="returnvalue">ClutterContent</span></a> * <a class="link" href="clutter-ClutterImage.html#clutter-image-new" title="clutter_image_new ()">clutter_image_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
45 <a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="clutter-ClutterImage.html#clutter-image-set-data" title="clutter_image_set_data ()">clutter_image_set_data</a> (<em class="parameter"><code><a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> *image</code></em>,
46 <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *data</code></em>,
47 <em class="parameter"><code><span class="type">CoglPixelFormat</span> pixel_format</code></em>,
48 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> width</code></em>,
49 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> height</code></em>,
50 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> row_stride</code></em>,
51 <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
52 <a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="clutter-ClutterImage.html#clutter-image-set-area" title="clutter_image_set_area ()">clutter_image_set_area</a> (<em class="parameter"><code><a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> *image</code></em>,
53 <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *data</code></em>,
54 <em class="parameter"><code><span class="type">CoglPixelFormat</span> pixel_format</code></em>,
55 <em class="parameter"><code>const <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/cairo/cairo-Types.html#cairo-rectangle-int-t"><span class="type">cairo_rectangle_int_t</span></a> *rect</code></em>,
56 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> row_stride</code></em>,
57 <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
58 <span class="returnvalue">CoglTexture</span> * <a class="link" href="clutter-ClutterImage.html#clutter-image-get-texture" title="clutter_image_get_texture ()">clutter_image_get_texture</a> (<em class="parameter"><code><a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> *image</code></em>);
61 <div class="refsect1">
62 <a name="clutter-ClutterImage.description"></a><h2>Description</h2>
64 <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> is a <a class="link" href="ClutterContent.html" title="ClutterContent"><span class="type">ClutterContent</span></a> implementation that displays
69 <div class="informalexample">
70 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
73 <td class="listing_lines" align="right"><pre>1
196 <td class="listing_code"><pre class="programlisting"><span class="preproc">#include</span><span class="normal"> </span><span class="string"><stdlib.h></span>
197 <span class="preproc">#include</span><span class="normal"> </span><span class="string"><gmodule.h></span>
198 <span class="preproc">#include</span><span class="normal"> </span><span class="string"><gdk-pixbuf/gdk-pixbuf.h></span>
199 <span class="preproc">#include</span><span class="normal"> </span><span class="string"><clutter/clutter.h></span>
201 <span class="keyword">static</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="keyword">struct</span><span class="normal"> </span><span class="cbracket">{</span>
202 <span class="normal"> </span><span class="usertype">ClutterContentGravity</span><span class="normal"> gravity</span><span class="symbol">;</span>
203 <span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">name</span><span class="symbol">;</span>
204 <span class="cbracket">}</span><span class="normal"> gravities</span><span class="symbol">[]</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span>
205 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-TOP-LEFT:CAPS">CLUTTER_CONTENT_GRAVITY_TOP_LEFT</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Top Left"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
206 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-TOP:CAPS">CLUTTER_CONTENT_GRAVITY_TOP</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Top"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
207 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-TOP-RIGHT:CAPS">CLUTTER_CONTENT_GRAVITY_TOP_RIGHT</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Top Right"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
209 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-LEFT:CAPS">CLUTTER_CONTENT_GRAVITY_LEFT</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Left"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
210 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-CENTER:CAPS">CLUTTER_CONTENT_GRAVITY_CENTER</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Center"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
211 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-RIGHT:CAPS">CLUTTER_CONTENT_GRAVITY_RIGHT</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Right"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
213 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-BOTTOM-LEFT:CAPS">CLUTTER_CONTENT_GRAVITY_BOTTOM_LEFT</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Bottom Left"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
214 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-BOTTOM:CAPS">CLUTTER_CONTENT_GRAVITY_BOTTOM</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Bottom"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
215 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-BOTTOM-RIGHT:CAPS">CLUTTER_CONTENT_GRAVITY_BOTTOM_RIGHT</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Bottom Right"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
217 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-RESIZE-FILL:CAPS">CLUTTER_CONTENT_GRAVITY_RESIZE_FILL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Resize Fill"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
218 <span class="normal"> </span><span class="cbracket">{</span><span class="normal"> <a href="ClutterActor.html#CLUTTER-CONTENT-GRAVITY-RESIZE-ASPECT:CAPS">CLUTTER_CONTENT_GRAVITY_RESIZE_ASPECT</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Resize Aspect"</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">,</span>
219 <span class="cbracket">}</span><span class="symbol">;</span>
221 <span class="keyword">static</span><span class="normal"> </span><span class="type">int</span><span class="normal"> n_gravities </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="../glib/glib-Standard-Macros.html#G-N-ELEMENTS:CAPS">G_N_ELEMENTS</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">gravities</span><span class="symbol">);</span>
222 <span class="keyword">static</span><span class="normal"> </span><span class="type">int</span><span class="normal"> cur_gravity </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
224 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
225 <span class="function">on_clicked</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">ClutterClickAction</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">action</span><span class="symbol">,</span>
226 <span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">actor</span><span class="symbol">,</span>
227 <span class="normal"> </span><span class="usertype">ClutterText</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">label</span><span class="symbol">)</span>
228 <span class="cbracket">{</span>
229 <span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">str</span><span class="symbol">;</span>
231 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-save-easing-state">clutter_actor_save_easing_state</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">);</span>
232 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-content-gravity">clutter_actor_set_content_gravity</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">,</span><span class="normal"> gravities</span><span class="symbol">[</span><span class="normal">cur_gravity</span><span class="symbol">].</span><span class="normal">gravity</span><span class="symbol">);</span>
233 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-restore-easing-state">clutter_actor_restore_easing_state</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">);</span>
235 <span class="normal"> str </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="../glib/glib-String-Utility-Functions.html#g-strconcat">g_strconcat</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Content gravity: "</span><span class="symbol">,</span><span class="normal"> gravities</span><span class="symbol">[</span><span class="normal">cur_gravity</span><span class="symbol">].</span><span class="normal">name</span><span class="symbol">,</span><span class="normal"> <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
236 <span class="normal"> </span><span class="function"><a href="ClutterText.html#clutter-text-set-text">clutter_text_set_text</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">label</span><span class="symbol">,</span><span class="normal"> str</span><span class="symbol">);</span>
237 <span class="normal"> </span><span class="function"><a href="../glib/glib-Memory-Allocation.html#g-free">g_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">str</span><span class="symbol">);</span>
239 <span class="normal"> cur_gravity </span><span class="symbol">+=</span><span class="normal"> </span><span class="number">1</span><span class="symbol">;</span>
241 <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cur_gravity </span><span class="symbol">>=</span><span class="normal"> n_gravities</span><span class="symbol">)</span>
242 <span class="normal"> cur_gravity </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
243 <span class="cbracket">}</span>
245 <span class="normal"><a href="../glib/glib-Dynamic-Loading-of-Modules.html#G-MODULE-EXPORT:CAPS">G_MODULE_EXPORT</a> </span><span class="usertype">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span>
246 <span class="function">test_image_box_describe</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span>
247 <span class="cbracket">{</span>
248 <span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="string">"A test with image content."</span><span class="symbol">;</span>
249 <span class="cbracket">}</span>
251 <span class="normal"><a href="../glib/glib-Dynamic-Loading-of-Modules.html#G-MODULE-EXPORT:CAPS">G_MODULE_EXPORT</a> </span><span class="type">int</span>
252 <span class="function">test_image_box_main</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">argv</span><span class="symbol">[])</span>
253 <span class="cbracket">{</span>
254 <span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">stage</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">text</span><span class="symbol">;</span>
255 <span class="normal"> </span><span class="usertype">ClutterContent</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">image</span><span class="symbol">;</span>
256 <span class="normal"> </span><span class="usertype">ClutterAction</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">action</span><span class="symbol">;</span>
257 <span class="normal"> </span><span class="usertype">GdkPixbuf</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">pixbuf</span><span class="symbol">;</span>
258 <span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">str</span><span class="symbol">;</span>
260 <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="clutter-General.html#clutter-init">clutter_init</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">argv</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">!=</span><span class="normal"> <a href="clutter-General.html#CLUTTER-INIT-SUCCESS:CAPS">CLUTTER_INIT_SUCCESS</a></span><span class="symbol">)</span>
261 <span class="normal"> </span><span class="keyword">return</span><span class="normal"> EXIT_FAILURE</span><span class="symbol">;</span>
263 <span class="normal"> stage </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterStage.html#clutter-stage-new">clutter_stage_new</a></span><span class="normal"> </span><span class="symbol">();</span>
264 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-name">clutter_actor_set_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Stage"</span><span class="symbol">);</span>
265 <span class="normal"> </span><span class="function"><a href="ClutterStage.html#clutter-stage-set-title">clutter_stage_set_title</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_STAGE</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"Content Box"</span><span class="symbol">);</span>
266 <span class="normal"> </span><span class="function"><a href="ClutterStage.html#clutter-stage-set-user-resizable">clutter_stage_set_user_resizable</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_STAGE</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">),</span><span class="normal"> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">);</span>
267 <span class="normal"> </span><span class="function"><a href="../gobject/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"destroy"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="../gobject/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="clutter-General.html#clutter-main-quit">clutter_main_quit</a></span><span class="symbol">),</span><span class="normal"> <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
268 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-show">clutter_actor_show</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">);</span>
270 <span class="normal"> box </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-new">clutter_actor_new</a></span><span class="normal"> </span><span class="symbol">();</span>
271 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-name">clutter_actor_set_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Image"</span><span class="symbol">);</span>
272 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-margin-top">clutter_actor_set_margin_top</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> </span><span class="number">12</span><span class="symbol">);</span>
273 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-margin-right">clutter_actor_set_margin_right</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> </span><span class="number">12</span><span class="symbol">);</span>
274 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-margin-bottom">clutter_actor_set_margin_bottom</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> </span><span class="number">12</span><span class="symbol">);</span>
275 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-margin-left">clutter_actor_set_margin_left</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> </span><span class="number">12</span><span class="symbol">);</span>
276 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-add-constraint">clutter_actor_add_constraint</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="ClutterBindConstraint.html#clutter-bind-constraint-new">clutter_bind_constraint_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">,</span><span class="normal"> <a href="ClutterBindConstraint.html#CLUTTER-BIND-SIZE:CAPS">CLUTTER_BIND_SIZE</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.0</span><span class="symbol">));</span>
277 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-add-child">clutter_actor_add_child</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">,</span><span class="normal"> box</span><span class="symbol">);</span>
279 <span class="normal"> pixbuf </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="../gdk-pixbuf/gdk-pixbuf-File-Loading.html#gdk-pixbuf-new-from-file">gdk_pixbuf_new_from_file</a></span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">TESTS_DATADIR</span><span class="normal"> <a href="../glib/glib-Standard-Macros.html#G-DIR-SEPARATOR-S:CAPS">G_DIR_SEPARATOR_S</a> </span><span class="string">"redhand.png"</span><span class="symbol">,</span><span class="normal"> <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
280 <span class="normal"> image </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="clutter-ClutterImage.html#clutter-image-new">clutter_image_new</a></span><span class="normal"> </span><span class="symbol">();</span>
281 <span class="normal"> </span><span class="function"><a href="clutter-ClutterImage.html#clutter-image-set-data">clutter_image_set_data</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_IMAGE</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">image</span><span class="symbol">),</span>
282 <span class="normal"> </span><span class="function"><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#gdk-pixbuf-get-pixels">gdk_pixbuf_get_pixels</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">),</span>
283 <span class="normal"> </span><span class="function"><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#gdk-pixbuf-get-has-alpha">gdk_pixbuf_get_has_alpha</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">)</span>
284 <span class="normal"> </span><span class="symbol">?</span><span class="normal"> COGL_PIXEL_FORMAT_RGBA_8888</span>
285 <span class="normal"> </span><span class="symbol">:</span><span class="normal"> COGL_PIXEL_FORMAT_RGB_888</span><span class="symbol">,</span>
286 <span class="normal"> </span><span class="function"><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#gdk-pixbuf-get-width">gdk_pixbuf_get_width</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">),</span>
287 <span class="normal"> </span><span class="function"><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#gdk-pixbuf-get-height">gdk_pixbuf_get_height</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">),</span>
288 <span class="normal"> </span><span class="function"><a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#gdk-pixbuf-get-rowstride">gdk_pixbuf_get_rowstride</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">),</span>
289 <span class="normal"> <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
290 <span class="normal"> </span><span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">);</span>
292 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-content-scaling-filters">clutter_actor_set_content_scaling_filters</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span>
293 <span class="normal"> <a href="ClutterActor.html#CLUTTER-SCALING-FILTER-TRILINEAR:CAPS">CLUTTER_SCALING_FILTER_TRILINEAR</a></span><span class="symbol">,</span>
294 <span class="normal"> <a href="ClutterActor.html#CLUTTER-SCALING-FILTER-LINEAR:CAPS">CLUTTER_SCALING_FILTER_LINEAR</a></span><span class="symbol">);</span>
295 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-content-gravity">clutter_actor_set_content_gravity</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> gravities</span><span class="symbol">[</span><span class="normal">n_gravities </span><span class="symbol">-</span><span class="normal"> </span><span class="number">1</span><span class="symbol">].</span><span class="normal">gravity</span><span class="symbol">);</span>
296 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-content">clutter_actor_set_content</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> image</span><span class="symbol">);</span>
297 <span class="normal"> </span><span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">image</span><span class="symbol">);</span>
299 <span class="normal"> str </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="../glib/glib-String-Utility-Functions.html#g-strconcat">g_strconcat</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Content gravity: "</span><span class="symbol">,</span>
300 <span class="normal"> gravities</span><span class="symbol">[</span><span class="normal">n_gravities </span><span class="symbol">-</span><span class="normal"> </span><span class="number">1</span><span class="symbol">].</span><span class="normal">name</span><span class="symbol">,</span>
301 <span class="normal"> <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
303 <span class="normal"> text </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterText.html#clutter-text-new">clutter_text_new</a></span><span class="normal"> </span><span class="symbol">();</span>
304 <span class="normal"> </span><span class="function"><a href="ClutterText.html#clutter-text-set-text">clutter_text_set_text</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_TEXT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">text</span><span class="symbol">),</span><span class="normal"> str</span><span class="symbol">);</span>
305 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-add-constraint">clutter_actor_add_constraint</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">text</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="ClutterAlignConstraint.html#clutter-align-constraint-new">clutter_align_constraint_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">,</span><span class="normal"> <a href="ClutterAlignConstraint.html#CLUTTER-ALIGN-BOTH:CAPS">CLUTTER_ALIGN_BOTH</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.5</span><span class="symbol">));</span>
306 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-add-child">clutter_actor_add_child</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">,</span><span class="normal"> text</span><span class="symbol">);</span>
308 <span class="normal"> </span><span class="function"><a href="../glib/glib-Memory-Allocation.html#g-free">g_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">str</span><span class="symbol">);</span>
310 <span class="normal"> action </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterClickAction.html#clutter-click-action-new">clutter_click_action_new</a></span><span class="normal"> </span><span class="symbol">();</span>
311 <span class="normal"> </span><span class="function"><a href="../gobject/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">action</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="../gobject/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_clicked</span><span class="symbol">),</span><span class="normal"> text</span><span class="symbol">);</span>
312 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-reactive">clutter_actor_set_reactive</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">);</span>
313 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-add-action">clutter_actor_add_action</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">box</span><span class="symbol">,</span><span class="normal"> action</span><span class="symbol">);</span>
315 <span class="normal"> </span><span class="function"><a href="clutter-General.html#clutter-main">clutter_main</a></span><span class="normal"> </span><span class="symbol">();</span>
317 <span class="normal"> </span><span class="keyword">return</span><span class="normal"> EXIT_SUCCESS</span><span class="symbol">;</span>
318 <span class="cbracket">}</span></pre></td>
327 <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> is available since Clutter 1.10.
330 <div class="refsect1">
331 <a name="clutter-ClutterImage.details"></a><h2>Details</h2>
332 <div class="refsect2">
333 <a name="ClutterImage"></a><h3>struct ClutterImage</h3>
334 <pre class="programlisting">struct ClutterImage {
338 The <span class="structname">ClutterImage</span> structure contains
339 private data and should only be accessed using the provided
342 <p class="since">Since 1.10</p>
345 <div class="refsect2">
346 <a name="ClutterImageClass"></a><h3>struct ClutterImageClass</h3>
347 <pre class="programlisting">struct ClutterImageClass {
351 The <span class="structname">ClutterImageClass</span> structure contains
354 <p class="since">Since 1.10</p>
357 <div class="refsect2">
358 <a name="CLUTTER-IMAGE-ERROR:CAPS"></a><h3>CLUTTER_IMAGE_ERROR</h3>
359 <pre class="programlisting">#define CLUTTER_IMAGE_ERROR (clutter_image_error_quark ())
362 Error domain for the <a class="link" href="clutter-ClutterImage.html#ClutterImageError" title="enum ClutterImageError"><span class="type">ClutterImageError</span></a> enumeration.
364 <p class="since">Since 1.10</p>
367 <div class="refsect2">
368 <a name="ClutterImageError"></a><h3>enum ClutterImageError</h3>
369 <pre class="programlisting">typedef enum {
370 CLUTTER_IMAGE_ERROR_INVALID_DATA
374 Error enumeration for <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a>.
376 <div class="variablelist"><table border="0">
377 <col align="left" valign="top">
379 <td><p><a name="CLUTTER-IMAGE-ERROR-INVALID-DATA:CAPS"></a><span class="term"><code class="literal">CLUTTER_IMAGE_ERROR_INVALID_DATA</code></span></p></td>
380 <td>Invalid data passed to the
381 <a class="link" href="clutter-ClutterImage.html#clutter-image-set-data" title="clutter_image_set_data ()"><code class="function">clutter_image_set_data()</code></a> function.
385 <p class="since">Since 1.10</p>
388 <div class="refsect2">
389 <a name="clutter-image-new"></a><h3>clutter_image_new ()</h3>
390 <pre class="programlisting"><a class="link" href="ClutterContent.html" title="ClutterContent"><span class="returnvalue">ClutterContent</span></a> * clutter_image_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
392 Creates a new <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> instance.
394 <div class="variablelist"><table border="0">
395 <col align="left" valign="top">
397 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
398 <td>the newly created <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> instance.
399 Use <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> when done. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
403 <p class="since">Since 1.10</p>
406 <div class="refsect2">
407 <a name="clutter-image-set-data"></a><h3>clutter_image_set_data ()</h3>
408 <pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> clutter_image_set_data (<em class="parameter"><code><a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> *image</code></em>,
409 <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *data</code></em>,
410 <em class="parameter"><code><span class="type">CoglPixelFormat</span> pixel_format</code></em>,
411 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> width</code></em>,
412 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> height</code></em>,
413 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> row_stride</code></em>,
414 <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
416 Sets the image data to be display by <em class="parameter"><code>image</code></em>.
419 If the image data was successfully loaded, the <em class="parameter"><code>image</code></em> will be invalidated.
422 In case of error, the <em class="parameter"><code>error</code></em> value will be set, and this function will
423 return <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
426 The image data is copied in texture memory.
428 <div class="variablelist"><table border="0">
429 <col align="left" valign="top">
432 <td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
433 <td>a <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a>
437 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
438 <td>the image data, as an array of bytes. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym>]</span>
442 <td><p><span class="term"><em class="parameter"><code>pixel_format</code></em> :</span></p></td>
443 <td>the Cogl pixel format of the image data</td>
446 <td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
447 <td>the width of the image data</td>
450 <td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
451 <td>the height of the image data</td>
454 <td><p><span class="term"><em class="parameter"><code>row_stride</code></em> :</span></p></td>
455 <td>the length of each row inside <em class="parameter"><code>data</code></em>
459 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
460 <td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>
464 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
466 <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the image data was successfully loaded,
467 and <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
471 <p class="since">Since 1.10</p>
474 <div class="refsect2">
475 <a name="clutter-image-set-area"></a><h3>clutter_image_set_area ()</h3>
476 <pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> clutter_image_set_area (<em class="parameter"><code><a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> *image</code></em>,
477 <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *data</code></em>,
478 <em class="parameter"><code><span class="type">CoglPixelFormat</span> pixel_format</code></em>,
479 <em class="parameter"><code>const <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/cairo/cairo-Types.html#cairo-rectangle-int-t"><span class="type">cairo_rectangle_int_t</span></a> *rect</code></em>,
480 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> row_stride</code></em>,
481 <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
483 Sets the image data to be display by <em class="parameter"><code>image</code></em>, using <em class="parameter"><code>rect</code></em> to indicate
484 the position and size of the image data to be set.
487 If the <em class="parameter"><code>image</code></em> does not have any image data set when this function is
488 called, a new texture will be created with the size of the width and
489 height of the rectangle, i.e. calling this function on a newly created
490 <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> will be the equivalent of calling <a class="link" href="clutter-ClutterImage.html#clutter-image-set-data" title="clutter_image_set_data ()"><code class="function">clutter_image_set_data()</code></a>.
493 If the image data was successfully loaded, the <em class="parameter"><code>image</code></em> will be invalidated.
496 In case of error, the <em class="parameter"><code>error</code></em> value will be set, and this function will
497 return <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
500 The image data is copied in texture memory.
502 <div class="variablelist"><table border="0">
503 <col align="left" valign="top">
506 <td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
507 <td>a <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a>
511 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
512 <td>the image data, as an array of bytes. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym>]</span>
516 <td><p><span class="term"><em class="parameter"><code>pixel_format</code></em> :</span></p></td>
517 <td>the Cogl pixel format of the image data</td>
520 <td><p><span class="term"><em class="parameter"><code>rect</code></em> :</span></p></td>
521 <td>a rectangle indicating the area that should be set</td>
524 <td><p><span class="term"><em class="parameter"><code>row_stride</code></em> :</span></p></td>
525 <td>the length of each row inside <em class="parameter"><code>data</code></em>
529 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
530 <td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>
534 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
536 <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the image data was successfully loaded,
537 and <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
541 <p class="since">Since 1.10</p>
544 <div class="refsect2">
545 <a name="clutter-image-get-texture"></a><h3>clutter_image_get_texture ()</h3>
546 <pre class="programlisting"><span class="returnvalue">CoglTexture</span> * clutter_image_get_texture (<em class="parameter"><code><a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a> *image</code></em>);</pre>
548 Retrieves a pointer to the Cogl texture used by <em class="parameter"><code>image</code></em>.
551 If you change the contents of the returned Cogl texture you will need
552 to manually invalidate the <em class="parameter"><code>image</code></em> with <a class="link" href="ClutterContent.html#clutter-content-invalidate" title="clutter_content_invalidate ()"><code class="function">clutter_content_invalidate()</code></a>
553 in order to update the actors using <em class="parameter"><code>image</code></em> as their content.
555 <div class="variablelist"><table border="0">
556 <col align="left" valign="top">
559 <td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
560 <td>a <a class="link" href="clutter-ClutterImage.html#ClutterImage" title="struct ClutterImage"><span class="type">ClutterImage</span></a>
564 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
565 <td>a pointer to the Cogl texture, or <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
570 <p class="since">Since 1.10</p>
571 <p class="stability">Stability Level: Unstable</p>
577 Generated by GTK-Doc V1.18.1</div>