From 32f899c85dc975827abd03fc6941b8552718568a Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Thu, 27 Jun 2013 19:39:41 +0200 Subject: [PATCH] change names for signal handlers accordingly, tweak annotations --- src/DragDropAction.vala | 23 +++++++++++++++-------- src/Widgets/AppIcon.vala | 12 ++++++------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/DragDropAction.vala b/src/DragDropAction.vala index 3c31bd92..13ef133a 100644 --- a/src/DragDropAction.vala +++ b/src/DragDropAction.vala @@ -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) { diff --git a/src/Widgets/AppIcon.vala b/src/Widgets/AppIcon.vala index 62aa8a10..3f553959 100644 --- a/src/Widgets/AppIcon.vala +++ b/src/Widgets/AppIcon.vala @@ -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;