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>ClutterDropAction</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="ch04.html" title="Actions">
9 <link rel="prev" href="ClutterDragAction.html" title="ClutterDragAction">
10 <link rel="next" href="ClutterGestureAction.html" title="ClutterGestureAction">
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="ClutterDragAction.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch04.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="ClutterGestureAction.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="#ClutterDropAction.synopsis" class="shortcut">Top</a>
26 <a href="#ClutterDropAction.description" class="shortcut">Description</a>
28 <a href="#ClutterDropAction.object-hierarchy" class="shortcut">Object Hierarchy</a>
30 <a href="#ClutterDropAction.signals" class="shortcut">Signals</a>
33 <div class="refentry">
34 <a name="ClutterDropAction"></a><div class="titlepage"></div>
35 <div class="refnamediv"><table width="100%"><tr>
37 <h2><span class="refentrytitle"><a name="ClutterDropAction.top_of_page"></a>ClutterDropAction</span></h2>
38 <p>ClutterDropAction — An action for drop targets</p>
40 <td valign="top" align="right"></td>
42 <div class="refsynopsisdiv">
43 <a name="ClutterDropAction.synopsis"></a><h2>Synopsis</h2>
44 <pre class="synopsis">struct <a class="link" href="ClutterDropAction.html#ClutterDropAction-struct" title="struct ClutterDropAction">ClutterDropAction</a>;
45 struct <a class="link" href="ClutterDropAction.html#ClutterDropActionClass" title="struct ClutterDropActionClass">ClutterDropActionClass</a>;
46 <a class="link" href="ClutterAction.html" title="ClutterAction"><span class="returnvalue">ClutterAction</span></a> * <a class="link" href="ClutterDropAction.html#clutter-drop-action-new" title="clutter_drop_action_new ()">clutter_drop_action_new</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
49 <div class="refsect1">
50 <a name="ClutterDropAction.object-hierarchy"></a><h2>Object Hierarchy</h2>
51 <pre class="synopsis">
53 +----GInitiallyUnowned
54 +----<a class="link" href="ClutterActorMeta.html" title="ClutterActorMeta">ClutterActorMeta</a>
55 +----<a class="link" href="ClutterAction.html" title="ClutterAction">ClutterAction</a>
56 +----ClutterDropAction
59 <div class="refsect1">
60 <a name="ClutterDropAction.signals"></a><h2>Signals</h2>
61 <pre class="synopsis">
62 "<a class="link" href="ClutterDropAction.html#ClutterDropAction-can-drop" title='The "can-drop" signal'>can-drop</a>" : <code class="literal">Run Last</code>
63 "<a class="link" href="ClutterDropAction.html#ClutterDropAction-drop" title='The "drop" signal'>drop</a>" : <code class="literal">Run Last</code>
64 "<a class="link" href="ClutterDropAction.html#ClutterDropAction-over-in" title='The "over-in" signal'>over-in</a>" : <code class="literal">Run Last</code>
65 "<a class="link" href="ClutterDropAction.html#ClutterDropAction-over-out" title='The "over-out" signal'>over-out</a>" : <code class="literal">Run Last</code>
68 <div class="refsect1">
69 <a name="ClutterDropAction.description"></a><h2>Description</h2>
71 <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> is a <a class="link" href="ClutterAction.html" title="ClutterAction"><span class="type">ClutterAction</span></a> that allows a <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>
72 implementation to control what happens when an actor dragged using
73 a <a class="link" href="ClutterDragAction.html" title="ClutterDragAction"><span class="type">ClutterDragAction</span></a> crosses the target area or when a dragged actor
74 is released (or "dropped") on the target area.
77 A trivial use of <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> consists in connecting to the
78 <a class="link" href="ClutterDropAction.html#ClutterDropAction-drop" title='The "drop" signal'><span class="type">"drop"</span></a> signal and handling the drop from there,
83 <div class="informalexample">
84 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
87 <td class="listing_lines" align="right"><pre>1
91 <td class="listing_code"><pre class="programlisting"><span class="usertype">ClutterAction</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">action </span><span class="symbol">=</span><span class="normal"> </span><span class="function">clutter_drop_action</span><span class="normal"> </span><span class="symbol">();</span>
93 <span class="function">g_signal_connect</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">"drop"</span><span class="symbol">,</span><span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_drop</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>
94 <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">an_actor</span><span class="symbol">,</span><span class="normal"> action</span><span class="symbol">);</span></pre></td>
103 The <a class="link" href="ClutterDropAction.html#ClutterDropAction-can-drop" title='The "can-drop" signal'><span class="type">"can-drop"</span></a> can be used to control whether the
104 <a class="link" href="ClutterDropAction.html#ClutterDropAction-drop" title='The "drop" signal'><span class="type">"drop"</span></a> signal is going to be emitted; returning <code class="literal">FALSE</code>
105 from a handler connected to the <a class="link" href="ClutterDropAction.html#ClutterDropAction-can-drop" title='The "can-drop" signal'><span class="type">"can-drop"</span></a> signal will
106 cause the <a class="link" href="ClutterDropAction.html#ClutterDropAction-drop" title='The "drop" signal'><span class="type">"drop"</span></a> signal to be skipped when the input
107 device button is released.
111 <div class="example">
112 <a name="drop-action-example"></a><p class="title"><b>Example 7. Drop targets</b></p>
113 <div class="example-contents">
114 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
117 <td class="listing_lines" align="right"><pre>1
368 <td class="listing_code"><pre class="programlisting"><span class="preproc">#include</span><span class="normal"> </span><span class="string"><stdlib.h></span>
369 <span class="preproc">#include</span><span class="normal"> </span><span class="string"><clutter/clutter.h></span>
371 <span class="preproc">#define</span><span class="normal"> TARGET_SIZE </span><span class="number">200</span>
372 <span class="preproc">#define</span><span class="normal"> HANDLE_SIZE </span><span class="number">128</span>
374 <span class="keyword">static</span><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"> <a href="/home/ebassi/gnome3/install/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS">NULL</a></span><span class="symbol">;</span>
375 <span class="keyword">static</span><span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">target1 </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>
376 <span class="keyword">static</span><span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">target2 </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>
377 <span class="keyword">static</span><span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">drag </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>
379 <span class="keyword">static</span><span class="normal"> </span><span class="usertype">gboolean</span><span class="normal"> drop_successful </span><span class="symbol">=</span><span class="normal"> FALSE</span><span class="symbol">;</span>
381 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal"> </span><span class="function">add_drag_object</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">target</span><span class="symbol">);</span>
383 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
384 <span class="function">on_drag_end</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">ClutterDragAction</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">action</span><span class="symbol">,</span>
385 <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>
386 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> event_x</span><span class="symbol">,</span>
387 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> event_y</span><span class="symbol">,</span>
388 <span class="normal"> </span><span class="usertype">ClutterModifierType</span><span class="normal"> modifiers</span><span class="symbol">)</span>
389 <span class="cbracket">{</span>
390 <span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">handle </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterDragAction.html#clutter-drag-action-get-drag-handle">clutter_drag_action_get_drag_handle</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">action</span><span class="symbol">);</span>
392 <span class="normal"> </span><span class="function">g_print</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Drag ended at: %.0f, %.0f</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span>
393 <span class="normal"> event_x</span><span class="symbol">,</span><span class="normal"> event_y</span><span class="symbol">);</span>
395 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">150</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">255</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>
397 <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="normal">drop_successful</span><span class="symbol">)</span>
398 <span class="normal"> </span><span class="cbracket">{</span>
399 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> x_pos</span><span class="symbol">,</span><span class="normal"> y_pos</span><span class="symbol">;</span>
401 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterActor.html#clutter-actor-get-parent">clutter_actor_get_parent</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">),</span>
402 <span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">150</span><span class="symbol">,</span>
403 <span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">255</span><span class="symbol">,</span>
404 <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>
406 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-get-transformed-position">clutter_actor_get_transformed_position</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">x_pos</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">y_pos</span><span class="symbol">);</span>
407 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">handle</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-EASE-OUT-BOUNCE:CAPS">CLUTTER_EASE_OUT_BOUNCE</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">250</span><span class="symbol">,</span>
408 <span class="normal"> </span><span class="string">"x"</span><span class="symbol">,</span><span class="normal"> x_pos</span><span class="symbol">,</span>
409 <span class="normal"> </span><span class="string">"y"</span><span class="symbol">,</span><span class="normal"> y_pos</span><span class="symbol">,</span>
410 <span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span>
411 <span class="normal"> </span><span class="string">"signal-swapped::completed"</span><span class="symbol">,</span>
412 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="ClutterActor.html#clutter-actor-destroy">clutter_actor_destroy</a></span><span class="symbol">),</span>
413 <span class="normal"> handle</span><span class="symbol">,</span>
414 <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>
415 <span class="normal"> </span><span class="cbracket">}</span>
416 <span class="normal"> </span><span class="keyword">else</span>
417 <span class="normal"> </span><span class="cbracket">{</span>
418 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">handle</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">250</span><span class="symbol">,</span>
419 <span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span>
420 <span class="normal"> </span><span class="string">"signal-swapped::completed"</span><span class="symbol">,</span>
421 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="ClutterActor.html#clutter-actor-destroy">clutter_actor_destroy</a></span><span class="symbol">),</span>
422 <span class="normal"> handle</span><span class="symbol">,</span>
423 <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>
424 <span class="normal"> </span><span class="cbracket">}</span>
425 <span class="cbracket">}</span>
427 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
428 <span class="function">on_drag_begin</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">ClutterDragAction</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">action</span><span class="symbol">,</span>
429 <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>
430 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> event_x</span><span class="symbol">,</span>
431 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> event_y</span><span class="symbol">,</span>
432 <span class="normal"> </span><span class="usertype">ClutterModifierType</span><span class="normal"> modifiers</span><span class="symbol">)</span>
433 <span class="cbracket">{</span>
434 <span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">handle</span><span class="symbol">;</span>
435 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> x_pos</span><span class="symbol">,</span><span class="normal"> y_pos</span><span class="symbol">;</span>
437 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-get-position">clutter_actor_get_position</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">x_pos</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">y_pos</span><span class="symbol">);</span>
439 <span class="normal"> handle </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterRectangle.html#clutter-rectangle-new-with-color">clutter_rectangle_new_with_color</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">CLUTTER_COLOR_DarkSkyBlue</span><span class="symbol">);</span>
440 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-size">clutter_actor_set_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">handle</span><span class="symbol">,</span><span class="normal"> </span><span class="number">128</span><span class="symbol">,</span><span class="normal"> </span><span class="number">128</span><span class="symbol">);</span>
441 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-position">clutter_actor_set_position</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">handle</span><span class="symbol">,</span><span class="normal"> event_x </span><span class="symbol">-</span><span class="normal"> x_pos</span><span class="symbol">,</span><span class="normal"> event_y </span><span class="symbol">-</span><span class="normal"> y_pos</span><span class="symbol">);</span>
442 <span class="normal"> </span><span class="function"><a href="ClutterContainer.html#clutter-container-add-actor">clutter_container_add_actor</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">),</span><span class="normal"> handle</span><span class="symbol">);</span>
444 <span class="normal"> </span><span class="function"><a href="ClutterDragAction.html#clutter-drag-action-set-drag-handle">clutter_drag_action_set_drag_handle</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">action</span><span class="symbol">,</span><span class="normal"> handle</span><span class="symbol">);</span>
446 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">150</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">128</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>
448 <span class="normal"> drop_successful </span><span class="symbol">=</span><span class="normal"> FALSE</span><span class="symbol">;</span>
449 <span class="cbracket">}</span>
451 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
452 <span class="function">add_drag_object</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">target</span><span class="symbol">)</span>
453 <span class="cbracket">{</span>
454 <span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">parent</span><span class="symbol">;</span>
456 <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drag </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>
457 <span class="normal"> </span><span class="cbracket">{</span>
458 <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>
460 <span class="normal"> drag </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterRectangle.html#clutter-rectangle-new-with-color">clutter_rectangle_new_with_color</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">CLUTTER_COLOR_LightSkyBlue</span><span class="symbol">);</span>
461 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-size">clutter_actor_set_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drag</span><span class="symbol">,</span><span class="normal"> HANDLE_SIZE</span><span class="symbol">,</span><span class="normal"> HANDLE_SIZE</span><span class="symbol">);</span>
462 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-position">clutter_actor_set_position</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drag</span><span class="symbol">,</span>
463 <span class="normal"> </span><span class="symbol">(</span><span class="normal">TARGET_SIZE </span><span class="symbol">-</span><span class="normal"> HANDLE_SIZE</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2.0</span><span class="symbol">,</span>
464 <span class="normal"> </span><span class="symbol">(</span><span class="normal">TARGET_SIZE </span><span class="symbol">-</span><span class="normal"> HANDLE_SIZE</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">/</span><span class="normal"> </span><span class="number">2.0</span><span class="symbol">);</span>
465 <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">drag</span><span class="symbol">,</span><span class="normal"> TRUE</span><span class="symbol">);</span>
467 <span class="normal"> action </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterDragAction.html#clutter-drag-action-new">clutter_drag_action_new</a></span><span class="normal"> </span><span class="symbol">();</span>
468 <span class="normal"> </span><span class="function">g_signal_connect</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">"drag-begin"</span><span class="symbol">,</span><span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_drag_begin</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>
469 <span class="normal"> </span><span class="function">g_signal_connect</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">"drag-end"</span><span class="symbol">,</span><span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_drag_end</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>
471 <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">drag</span><span class="symbol">,</span><span class="normal"> action</span><span class="symbol">);</span>
472 <span class="normal"> </span><span class="cbracket">}</span>
474 <span class="normal"> parent </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-get-parent">clutter_actor_get_parent</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drag</span><span class="symbol">);</span>
476 <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">parent </span><span class="symbol">==</span><span class="normal"> target</span><span class="symbol">)</span>
477 <span class="normal"> </span><span class="cbracket">{</span>
478 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">150</span><span class="symbol">,</span>
479 <span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">255</span><span class="symbol">,</span>
480 <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>
481 <span class="normal"> </span><span class="keyword">return</span><span class="symbol">;</span>
482 <span class="normal"> </span><span class="cbracket">}</span>
484 <span class="normal"> </span><span class="function">g_object_ref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drag</span><span class="symbol">);</span>
485 <span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">parent </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><span class="normal"> parent </span><span class="symbol">!=</span><span class="normal"> stage</span><span class="symbol">)</span>
486 <span class="normal"> </span><span class="cbracket">{</span>
487 <span class="normal"> </span><span class="function"><a href="ClutterContainer.html#clutter-container-remove-actor">clutter_container_remove_actor</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">parent</span><span class="symbol">),</span><span class="normal"> drag</span><span class="symbol">);</span>
488 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">parent</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">150</span><span class="symbol">,</span>
489 <span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">64</span><span class="symbol">,</span>
490 <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>
491 <span class="normal"> </span><span class="cbracket">}</span>
493 <span class="normal"> </span><span class="function"><a href="ClutterContainer.html#clutter-container-add-actor">clutter_container_add_actor</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target</span><span class="symbol">),</span><span class="normal"> drag</span><span class="symbol">);</span>
494 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">150</span><span class="symbol">,</span>
495 <span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">255</span><span class="symbol">,</span>
496 <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>
498 <span class="normal"> </span><span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">drag</span><span class="symbol">);</span>
499 <span class="cbracket">}</span>
501 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
502 <span class="function">on_target_over</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">ClutterDropAction</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">action</span><span class="symbol">,</span>
503 <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>
504 <span class="normal"> gpointer _data</span><span class="symbol">)</span>
505 <span class="cbracket">{</span>
506 <span class="normal"> </span><span class="usertype">gboolean</span><span class="normal"> is_over </span><span class="symbol">=</span><span class="normal"> </span><span class="function">GPOINTER_TO_UINT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">_data</span><span class="symbol">);</span>
507 <span class="normal"> </span><span class="usertype">guint8</span><span class="normal"> final_opacity </span><span class="symbol">=</span><span class="normal"> is_over </span><span class="symbol">?</span><span class="normal"> </span><span class="number">128</span><span class="normal"> </span><span class="symbol">:</span><span class="normal"> </span><span class="number">64</span><span class="symbol">;</span>
508 <span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">target</span><span class="symbol">;</span>
510 <span class="normal"> target </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterActorMeta.html#clutter-actor-meta-get-actor">clutter_actor_meta_get_actor</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_ACTOR_META</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">action</span><span class="symbol">));</span>
512 <span class="normal"> </span><span class="function"><a href="clutter-Implicit-Animations.html#clutter-actor-animate">clutter_actor_animate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target</span><span class="symbol">,</span><span class="normal"> <a href="clutter-Implicit-Animations.html#CLUTTER-LINEAR:CAPS">CLUTTER_LINEAR</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">250</span><span class="symbol">,</span>
513 <span class="normal"> </span><span class="string">"opacity"</span><span class="symbol">,</span><span class="normal"> final_opacity</span><span class="symbol">,</span>
514 <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>
515 <span class="cbracket">}</span>
517 <span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
518 <span class="function">on_target_drop</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">ClutterDropAction</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">action</span><span class="symbol">,</span>
519 <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>
520 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> event_x</span><span class="symbol">,</span>
521 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> event_y</span><span class="symbol">)</span>
522 <span class="cbracket">{</span>
523 <span class="normal"> </span><span class="usertype">gfloat</span><span class="normal"> actor_x</span><span class="symbol">,</span><span class="normal"> actor_y</span><span class="symbol">;</span>
525 <span class="normal"> actor_x </span><span class="symbol">=</span><span class="normal"> actor_y </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">.</span><span class="normal">0f</span><span class="symbol">;</span>
527 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-transform-stage-point">clutter_actor_transform_stage_point</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">,</span><span class="normal"> event_x</span><span class="symbol">,</span><span class="normal"> event_y</span><span class="symbol">,</span>
528 <span class="normal"> </span><span class="symbol">&</span><span class="normal">actor_x</span><span class="symbol">,</span>
529 <span class="normal"> </span><span class="symbol">&</span><span class="normal">actor_y</span><span class="symbol">);</span>
531 <span class="normal"> </span><span class="function">g_print</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Dropped at %.0f, %.0f (screen: %.0f, %.0f)</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span>
532 <span class="normal"> actor_x</span><span class="symbol">,</span><span class="normal"> actor_y</span><span class="symbol">,</span>
533 <span class="normal"> event_x</span><span class="symbol">,</span><span class="normal"> event_y</span><span class="symbol">);</span>
535 <span class="normal"> drop_successful </span><span class="symbol">=</span><span class="normal"> TRUE</span><span class="symbol">;</span>
536 <span class="normal"> </span><span class="function">add_drag_object</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">actor</span><span class="symbol">);</span>
537 <span class="cbracket">}</span>
539 <span class="normal">G_MODULE_EXPORT </span><span class="type">int</span>
540 <span class="function">test_drop_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>
541 <span class="cbracket">{</span>
542 <span class="normal"> </span><span class="usertype">ClutterActor</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">dummy</span><span class="symbol">;</span>
544 <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>
545 <span class="normal"> </span><span class="keyword">return</span><span class="normal"> EXIT_FAILURE</span><span class="symbol">;</span>
547 <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>
548 <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">"Drop Action"</span><span class="symbol">);</span>
549 <span class="normal"> </span><span class="function">g_signal_connect</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">G_CALLBACK</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>
551 <span class="normal"> target1 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterBox.html#clutter-box-new">clutter_box_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterFixedLayout.html#clutter-fixed-layout-new">clutter_fixed_layout_new</a></span><span class="normal"> </span><span class="symbol">());</span>
552 <span class="normal"> </span><span class="function"><a href="ClutterBox.html#clutter-box-set-color">clutter_box_set_color</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_BOX</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">),</span><span class="normal"> CLUTTER_COLOR_LightScarletRed</span><span class="symbol">);</span>
553 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-size">clutter_actor_set_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">,</span><span class="normal"> TARGET_SIZE</span><span class="symbol">,</span><span class="normal"> TARGET_SIZE</span><span class="symbol">);</span>
554 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-opacity">clutter_actor_set_opacity</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">,</span><span class="normal"> </span><span class="number">64</span><span class="symbol">);</span>
555 <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">target1</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-Y-AXIS:CAPS">CLUTTER_ALIGN_Y_AXIS</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.5</span><span class="symbol">));</span>
556 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-x">clutter_actor_set_x</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">,</span><span class="normal"> </span><span class="number">10</span><span class="symbol">);</span>
557 <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">target1</span><span class="symbol">,</span><span class="normal"> TRUE</span><span class="symbol">);</span>
559 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-add-action-with-name">clutter_actor_add_action_with_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="ClutterDropAction.html#clutter-drop-action-new">clutter_drop_action_new</a></span><span class="normal"> </span><span class="symbol">());</span>
560 <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterActor.html#clutter-actor-get-action">clutter_actor_get_action</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">),</span>
561 <span class="normal"> </span><span class="string">"over-in"</span><span class="symbol">,</span>
562 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_target_over</span><span class="symbol">),</span>
563 <span class="normal"> </span><span class="function">GUINT_TO_POINTER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TRUE</span><span class="symbol">));</span>
564 <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterActor.html#clutter-actor-get-action">clutter_actor_get_action</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">),</span>
565 <span class="normal"> </span><span class="string">"over-out"</span><span class="symbol">,</span>
566 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_target_over</span><span class="symbol">),</span>
567 <span class="normal"> </span><span class="function">GUINT_TO_POINTER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">FALSE</span><span class="symbol">));</span>
568 <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterActor.html#clutter-actor-get-action">clutter_actor_get_action</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">),</span>
569 <span class="normal"> </span><span class="string">"drop"</span><span class="symbol">,</span>
570 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_target_drop</span><span class="symbol">),</span>
571 <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>
573 <span class="normal"> dummy </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterRectangle.html#clutter-rectangle-new-with-color">clutter_rectangle_new_with_color</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">CLUTTER_COLOR_DarkOrange</span><span class="symbol">);</span>
574 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-size">clutter_actor_set_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dummy</span><span class="symbol">,</span>
575 <span class="normal"> </span><span class="number">640</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> </span><span class="symbol">(</span><span class="number">2</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> </span><span class="number">10</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> </span><span class="symbol">(</span><span class="number">2</span><span class="normal"> </span><span class="symbol">*</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TARGET_SIZE </span><span class="symbol">+</span><span class="normal"> </span><span class="number">10</span><span class="symbol">)),</span>
576 <span class="normal"> TARGET_SIZE</span><span class="symbol">);</span>
577 <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">dummy</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-X-AXIS:CAPS">CLUTTER_ALIGN_X_AXIS</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.5</span><span class="symbol">));</span>
578 <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">dummy</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-Y-AXIS:CAPS">CLUTTER_ALIGN_Y_AXIS</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.5</span><span class="symbol">));</span>
579 <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">dummy</span><span class="symbol">,</span><span class="normal"> TRUE</span><span class="symbol">);</span>
581 <span class="normal"> target2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="ClutterBox.html#clutter-box-new">clutter_box_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterFixedLayout.html#clutter-fixed-layout-new">clutter_fixed_layout_new</a></span><span class="normal"> </span><span class="symbol">());</span>
582 <span class="normal"> </span><span class="function"><a href="ClutterBox.html#clutter-box-set-color">clutter_box_set_color</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_BOX</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">),</span><span class="normal"> CLUTTER_COLOR_LightChameleon</span><span class="symbol">);</span>
583 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-size">clutter_actor_set_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">,</span><span class="normal"> TARGET_SIZE</span><span class="symbol">,</span><span class="normal"> TARGET_SIZE</span><span class="symbol">);</span>
584 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-opacity">clutter_actor_set_opacity</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">,</span><span class="normal"> </span><span class="number">64</span><span class="symbol">);</span>
585 <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">target2</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-Y-AXIS:CAPS">CLUTTER_ALIGN_Y_AXIS</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">0.5</span><span class="symbol">));</span>
586 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-set-x">clutter_actor_set_x</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">,</span><span class="normal"> </span><span class="number">640</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> TARGET_SIZE </span><span class="symbol">-</span><span class="normal"> </span><span class="number">10</span><span class="symbol">);</span>
587 <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">target2</span><span class="symbol">,</span><span class="normal"> TRUE</span><span class="symbol">);</span>
589 <span class="normal"> </span><span class="function"><a href="ClutterActor.html#clutter-actor-add-action-with-name">clutter_actor_add_action_with_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="ClutterDropAction.html#clutter-drop-action-new">clutter_drop_action_new</a></span><span class="normal"> </span><span class="symbol">());</span>
590 <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterActor.html#clutter-actor-get-action">clutter_actor_get_action</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">),</span>
591 <span class="normal"> </span><span class="string">"over-in"</span><span class="symbol">,</span>
592 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_target_over</span><span class="symbol">),</span>
593 <span class="normal"> </span><span class="function">GUINT_TO_POINTER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">TRUE</span><span class="symbol">));</span>
594 <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterActor.html#clutter-actor-get-action">clutter_actor_get_action</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">),</span>
595 <span class="normal"> </span><span class="string">"over-out"</span><span class="symbol">,</span>
596 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_target_over</span><span class="symbol">),</span>
597 <span class="normal"> </span><span class="function">GUINT_TO_POINTER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">FALSE</span><span class="symbol">));</span>
598 <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="ClutterActor.html#clutter-actor-get-action">clutter_actor_get_action</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"drop"</span><span class="symbol">),</span>
599 <span class="normal"> </span><span class="string">"drop"</span><span class="symbol">,</span>
600 <span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">on_target_drop</span><span class="symbol">),</span>
601 <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>
603 <span class="normal"> </span><span class="function"><a href="ClutterContainer.html#clutter-container-add">clutter_container_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">CLUTTER_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">stage</span><span class="symbol">),</span><span class="normal"> target1</span><span class="symbol">,</span><span class="normal"> dummy</span><span class="symbol">,</span><span class="normal"> target2</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>
605 <span class="normal"> </span><span class="function">add_drag_object</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">target1</span><span class="symbol">);</span>
607 <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>
609 <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>
611 <span class="normal"> </span><span class="keyword">return</span><span class="normal"> EXIT_SUCCESS</span><span class="symbol">;</span>
612 <span class="cbracket">}</span>
614 <span class="normal">G_MODULE_EXPORT </span><span class="usertype">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span>
615 <span class="function">test_drop_describe</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span>
616 <span class="cbracket">{</span>
617 <span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="string">"Drop action support"</span><span class="symbol">;</span>
618 <span class="cbracket">}</span></pre></td>
625 <p><br class="example-break">
628 It's important to note that <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> will only work with
629 actors dragged using <a class="link" href="ClutterDragAction.html" title="ClutterDragAction"><span class="type">ClutterDragAction</span></a>.
632 <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> is available since Clutter 1.8
635 <div class="refsect1">
636 <a name="ClutterDropAction.details"></a><h2>Details</h2>
637 <div class="refsect2">
638 <a name="ClutterDropAction-struct"></a><h3>struct ClutterDropAction</h3>
639 <pre class="programlisting">struct ClutterDropAction;</pre>
641 The <span class="structname">ClutterDropAction</span> structure contains only
642 private data and should be accessed using the provided API.
644 <p class="since">Since 1.8</p>
647 <div class="refsect2">
648 <a name="ClutterDropActionClass"></a><h3>struct ClutterDropActionClass</h3>
649 <pre class="programlisting">struct ClutterDropActionClass {
650 gboolean (* can_drop) (ClutterDropAction *action,
655 void (* over_in) (ClutterDropAction *action,
656 ClutterActor *actor);
657 void (* over_out) (ClutterDropAction *action,
658 ClutterActor *actor);
660 void (* drop) (ClutterDropAction *action,
667 The <span class="structname">ClutterDropActionClass</span> structure contains
670 <div class="variablelist"><table border="0">
671 <col align="left" valign="top">
674 <td><p><span class="term"><em class="structfield"><code><a name="ClutterDropActionClass.can-drop"></a>can_drop</code></em> ()</span></p></td>
675 <td>class handler for the <a class="link" href="ClutterDropAction.html#ClutterDropAction-can-drop" title='The "can-drop" signal'><span class="type">"can-drop"</span></a> signal</td>
678 <td><p><span class="term"><em class="structfield"><code><a name="ClutterDropActionClass.over-in"></a>over_in</code></em> ()</span></p></td>
679 <td>class handler for the <a class="link" href="ClutterDropAction.html#ClutterDropAction-over-in" title='The "over-in" signal'><span class="type">"over-in"</span></a> signal</td>
682 <td><p><span class="term"><em class="structfield"><code><a name="ClutterDropActionClass.over-out"></a>over_out</code></em> ()</span></p></td>
683 <td>class handler for the <a class="link" href="ClutterDropAction.html#ClutterDropAction-over-out" title='The "over-out" signal'><span class="type">"over-out"</span></a> signal</td>
686 <td><p><span class="term"><em class="structfield"><code><a name="ClutterDropActionClass.drop"></a>drop</code></em> ()</span></p></td>
687 <td>class handler for the <a class="link" href="ClutterDropAction.html#ClutterDropAction-drop" title='The "drop" signal'><span class="type">"drop"</span></a> signal</td>
691 <p class="since">Since 1.8</p>
694 <div class="refsect2">
695 <a name="clutter-drop-action-new"></a><h3>clutter_drop_action_new ()</h3>
696 <pre class="programlisting"><a class="link" href="ClutterAction.html" title="ClutterAction"><span class="returnvalue">ClutterAction</span></a> * clutter_drop_action_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
698 Creates a new <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a>.
701 Use <a class="link" href="ClutterActor.html#clutter-actor-add-action" title="clutter_actor_add_action ()"><code class="function">clutter_actor_add_action()</code></a> to add the action to a <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a>.
703 <div class="variablelist"><table border="0">
704 <col align="left" valign="top">
706 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
707 <td>the newly created <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a>
711 <p class="since">Since 1.8</p>
714 <div class="refsect1">
715 <a name="ClutterDropAction.signal-details"></a><h2>Signal Details</h2>
716 <div class="refsect2">
717 <a name="ClutterDropAction-can-drop"></a><h3>The <code class="literal">"can-drop"</code> signal</h3>
718 <pre class="programlisting"><span class="returnvalue">gboolean</span> user_function (<a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> *action,
719 <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor,
720 <span class="type">gfloat</span> event_x,
721 <span class="type">gfloat</span> event_y,
722 <span class="type">gpointer</span> user_data) : <code class="literal">Run Last</code></pre>
724 The ::can-drop signal is emitted when the dragged actor is dropped
725 on <em class="parameter"><code>actor</code></em>. The return value of the ::can-drop signal will determine
726 whether or not the <a class="link" href="ClutterDropAction.html#ClutterDropAction-drop" title='The "drop" signal'><span class="type">"drop"</span></a> signal is going to be
727 emitted on <em class="parameter"><code>action</code></em>.
730 The default implementation of <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> returns <code class="literal">TRUE</code> for
733 <div class="variablelist"><table border="0">
734 <col align="left" valign="top">
737 <td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
738 <td>the <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> that emitted the signal</td>
741 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
742 <td>the <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> attached to the <em class="parameter"><code>action</code></em>
746 <td><p><span class="term"><em class="parameter"><code>event_x</code></em> :</span></p></td>
747 <td>the X coordinate (in stage space) of the drop event</td>
750 <td><p><span class="term"><em class="parameter"><code>event_y</code></em> :</span></p></td>
751 <td>the Y coordinate (in stage space) of the drop event</td>
754 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
755 <td>user data set when the signal handler was connected.</td>
758 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
760 <code class="literal">TRUE</code> if the drop is accepted, and <code class="literal">FALSE</code> otherwise</td>
764 <p class="since">Since 1.8</p>
767 <div class="refsect2">
768 <a name="ClutterDropAction-drop"></a><h3>The <code class="literal">"drop"</code> signal</h3>
769 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> *action,
770 <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor,
771 <span class="type">gfloat</span> event_x,
772 <span class="type">gfloat</span> event_y,
773 <span class="type">gpointer</span> user_data) : <code class="literal">Run Last</code></pre>
775 The ::drop signal is emitted when the dragged actor is dropped
776 on <em class="parameter"><code>actor</code></em>. This signal is only emitted if at least an handler of
777 <a class="link" href="ClutterDropAction.html#ClutterDropAction-can-drop" title='The "can-drop" signal'><span class="type">"can-drop"</span></a> returns <code class="literal">TRUE</code>.
779 <div class="variablelist"><table border="0">
780 <col align="left" valign="top">
783 <td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
784 <td>the <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> that emitted the signal</td>
787 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
788 <td>the <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> attached to the <em class="parameter"><code>action</code></em>
792 <td><p><span class="term"><em class="parameter"><code>event_x</code></em> :</span></p></td>
793 <td>the X coordinate (in stage space) of the drop event</td>
796 <td><p><span class="term"><em class="parameter"><code>event_y</code></em> :</span></p></td>
797 <td>the Y coordinate (in stage space) of the drop event</td>
800 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
801 <td>user data set when the signal handler was connected.</td>
805 <p class="since">Since 1.8</p>
808 <div class="refsect2">
809 <a name="ClutterDropAction-over-in"></a><h3>The <code class="literal">"over-in"</code> signal</h3>
810 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> *action,
811 <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor,
812 <span class="type">gpointer</span> user_data) : <code class="literal">Run Last</code></pre>
814 The ::over-in signal is emitted when the dragged actor crosses
815 into <em class="parameter"><code>actor</code></em>.
817 <div class="variablelist"><table border="0">
818 <col align="left" valign="top">
821 <td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
822 <td>the <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> that emitted the signal</td>
825 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
826 <td>the <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> attached to the <em class="parameter"><code>action</code></em>
830 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
831 <td>user data set when the signal handler was connected.</td>
835 <p class="since">Since 1.8</p>
838 <div class="refsect2">
839 <a name="ClutterDropAction-over-out"></a><h3>The <code class="literal">"over-out"</code> signal</h3>
840 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> *action,
841 <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> *actor,
842 <span class="type">gpointer</span> user_data) : <code class="literal">Run Last</code></pre>
844 The ::over-out signal is emitted when the dragged actor crosses
845 outside <em class="parameter"><code>actor</code></em>.
847 <div class="variablelist"><table border="0">
848 <col align="left" valign="top">
851 <td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
852 <td>the <a class="link" href="ClutterDropAction.html" title="ClutterDropAction"><span class="type">ClutterDropAction</span></a> that emitted the signal</td>
855 <td><p><span class="term"><em class="parameter"><code>actor</code></em> :</span></p></td>
856 <td>the <a class="link" href="ClutterActor.html" title="ClutterActor"><span class="type">ClutterActor</span></a> attached to the <em class="parameter"><code>action</code></em>
860 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
861 <td>user data set when the signal handler was connected.</td>
865 <p class="since">Since 1.8</p>
871 Generated by GTK-Doc V1.18.1</div>