Code

still more utility functions
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 7 Oct 2007 20:48:12 +0000 (20:48 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 7 Oct 2007 20:48:12 +0000 (20:48 +0000)
src/gradient-drag.h

index 890ab23ee468ddcdd7a51271d480e08f98e8f1be..5b8c867f1162a59bb358c954fbadc24f9a4e6d8f 100644 (file)
@@ -108,6 +108,10 @@ public: // FIXME: make more of this private!
 
                bool isNonEmpty() {return (draggers != NULL);}
                bool hasSelection() {return (selected != NULL);}
+               guint numSelected() {return (selected? g_list_length(selected) : 0);}
+               guint numDraggers() {return (draggers? g_list_length(draggers) : 0);}
+               guint singleSelectedDraggerNumDraggables() {return (selected? g_slist_length(((GrDragger *) selected->data)->draggables) : 0);}
+               guint singleSelectedDraggerSingleDraggableType() {return (selected? ((GrDraggable *) ((GrDragger *) selected->data)->draggables->data)->point_type : 0);}
 
     // especially the selection must be private, fix gradient-context to remove direct access to it
     GList *selected; // list of GrDragger*