change names for signal handlers accordingly, tweak annotations

This commit is contained in:
Tom Beckmann 2013-06-27 19:39:41 +02:00
parent 2f0e3dcf2e
commit 32f899c85d
2 changed files with 21 additions and 14 deletions

View File

@ -36,34 +36,37 @@ namespace Gala
/**
* A drag has been started. You have to connect to this signal
* @return A ClutterActor that serves as handle
**/
*/
public signal Clutter.Actor drag_begin ();
/**
* A drag has been canceled. You may want to consider cleaning up
* your handle.
**/
*/
public signal void drag_canceled ();
/**
* A drag action has successfully been finished.
*
* @param actor The actor on which the drag finished
**/
*/
public signal void drag_end (Clutter.Actor actor);
/**
* The destination has been crossed
*
* @param hovered indicates whether the actor is now hovered or not
**/
*/
public signal void crossed (bool hovered);
/**
* Create a new DragDropAction
*
* @param type The type of this actor
* @param id An ID that marks which sources can be dragged on
* which destinations. It has to be the same for all actors that
* should be compatible with each other.
**/
*/
public DragDropAction (DragDropActionType type, string id)
{
Object (drag_type : type, drag_id : id);
@ -177,8 +180,12 @@ namespace Gala
return false;
}
// returns a DragDropAction instance if this actor has one or null.
// It also checks if it is a DESTINATION and if the id matches
/**
* Looks for a DragDropAction instance if this actor has one or NULL.
* It also checks if it is a DESTINATION and if the id matches
*
* @return the DragDropAction instance on this actor or NULL
*/
DragDropAction? get_drag_drop_action (Clutter.Actor actor)
{
DragDropAction? drop_action = null;
@ -198,7 +205,7 @@ namespace Gala
/**
* Abort the drag
**/
*/
public void cancel ()
{
if (dragging) {

View File

@ -37,15 +37,15 @@ namespace Gala
} catch (Error e) { warning (e.message); }
var action = new DragDropAction (DragDropActionType.SOURCE, WorkspaceThumb.DRAG_ID);
action.drag_begin.connect (drag_started);
action.drag_end.connect (drag_finished);
action.drag_canceled.connect (drag_failed);
action.drag_begin.connect (drag_begin);
action.drag_end.connect (drag_end);
action.drag_canceled.connect (drag_canceled);
add_action_with_name (DRAG_ACTION, action);
reactive = true;
}
void drag_failed ()
void drag_canceled ()
{
var action = get_action (DRAG_ACTION) as DragDropAction;
@ -58,7 +58,7 @@ namespace Gala
});
}
void drag_finished (Actor destination)
void drag_end (Actor destination)
{
var action = get_action (DRAG_ACTION) as DragDropAction;
action.handle.destroy ();
@ -91,7 +91,7 @@ namespace Gala
icons.animate (AnimationMode.LINEAR, 100, x:Math.floorf (wallpaper.x + wallpaper.width / 2 - icons.width / 2));
}
Clutter.Actor drag_started ()
Clutter.Actor drag_begin ()
{
opacity = 0;