diff doodle/dia/tool.d @ 58:c63719604adb

Beginnings of creating a rectangle...
author "David Bryant <bagnose@gmail.com>"
date Mon, 09 Aug 2010 21:43:24 +0930
parents 9960c4fbd0dd
children eb5436b47d13
line wrap: on
line diff
--- a/doodle/dia/tool.d	Sun Aug 08 22:01:54 2010 +0930
+++ b/doodle/dia/tool.d	Mon Aug 09 21:43:24 2010 +0930
@@ -6,31 +6,12 @@
     import doodle.tk.events;
 }
 
-/*
-interface IToolStack {
-    void push(Tool tool);
-    void pop();
-    void replace(Tool tool);
-}
-*/
-
 abstract class Tool {
-    /*
-    enum Response {
-    START, CONTINUE, FINISH
+    this (in string name) {
+        _name = name;
+    }
 
-    }
-    */
-
-    /*
-    abstract bool isSticky();
-    abstract bool isReplaceable();
-    */
-
-    /*
-    abstract void start(IToolStack tool_stack);
-    abstract void stop(IToolStack tool_stack);
-    */
+    string name() const { return _name; }
 
     bool handleButtonPress(scope IViewport viewport, in ButtonEvent event) { return false; }
     bool handleButtonRelease(scope IViewport viewport, in ButtonEvent event) { return false; }
@@ -45,4 +26,8 @@
 
     void draw(in IViewport viewport,
               in Rectangle pixelDamage, scope Context pixelCr) const { }
+
+    private {
+        immutable string _name;
+    }
 }