
@c %start of fragment

@node ClutterDropAction
@chapter ClutterDropAction
An action for drop targets

@section Overview
@code{<clutter-drop-action>} is a @code{<clutter-action>} that allows a
@code{<clutter-actor>} implementation to control what happens when an
actor dragged using a @code{<clutter-drag-action>} crosses the target
area or when a dragged actor is released (or "dropped") on the target
area.

A trivial use of @code{<clutter-drop-action>} consists in connecting to
the @code{<"drop">} signal and handling the drop from there, for
instance:

@example 

  ClutterAction *action = clutter_drop_action ();

  g_signal_connect (action, "drop", G_CALLBACK (on_drop), NULL);
  clutter_actor_add_action (an_actor, action);
@end example

The @code{<"can-drop">} can be used to control whether the
@code{<"drop">} signal is going to be emitted; returning
@samp{@code{#f}} from a handler connected to the @code{<"can-drop">}
signal will cause the @code{<"drop">} signal to be skipped when the
input device button is released.

@c (example (@ (id "drop-action-example")))
@c (title "Drop targets")
@example 
@c (http://www.w3.org/2001/XInclude:include (@ (parse "text") (href "../../../../tests/interactive/test-drop.c")) (c (% (all "(http://www.w3.org/2001/XInclude:fallback \"FIXME: MISSING XINCLUDE CONTENT\")"))))
@end example

It's important to note that @code{<clutter-drop-action>} will only work
with actors dragged using @code{<clutter-drag-action>}.

@code{<clutter-drop-action>} is available since Clutter 1.8

@section Usage
@include defuns-clutter-drop-action.xml.texi

@c %end of fragment
