diff base/View.h @ 8:214054a0d8b8

* Hook up tool selection buttons to switch the cursor mode * Implement simple and multi-selection, snapping to the resolution of the current layer. You can't actually do anything with a selection yet
author Chris Cannam
date Mon, 23 Jan 2006 17:02:57 +0000
parents 581f67f370f3
children 73d85d19919f
line wrap: on
line diff
--- a/base/View.h	Thu Jan 19 17:59:11 2006 +0000
+++ b/base/View.h	Mon Jan 23 17:02:57 2006 +0000
@@ -15,10 +15,10 @@
 
 #include "base/ZoomConstraint.h"
 #include "base/PropertyContainer.h"
+#include "base/ViewManager.h"
 #include "base/XmlExportable.h"
 
 class Layer;
-class ViewManager;
 
 #include <map>
 
@@ -111,6 +111,15 @@
      */
     virtual Layer *getLayer(int n) { return m_layers[n]; }
 
+    /**
+     * Return the layer last selected by the user.  This is normally
+     * the top layer, the same as getLayer(getLayerCount()-1).
+     * However, if the user has selected the pane itself more recently
+     * than any of the layers on it, this function will return 0.  It
+     * will also return 0 if there are no layers.
+     */
+    virtual Layer *getSelectedLayer();
+
     virtual void setViewManager(ViewManager *m);
 
     virtual void setFollowGlobalPan(bool f);
@@ -176,6 +185,8 @@
 
     virtual void propertyContainerSelected(PropertyContainer *pc);
 
+    virtual void toolModeChanged();
+
 protected:
     View(QWidget *, bool showProgress);
     virtual void paintEvent(QPaintEvent *e);
@@ -213,6 +224,7 @@
     bool                m_deleting;
 
     LayerList           m_layers; // I don't own these, but see dtor note above
+    bool                m_haveSelectedLayer;
 
     // caches for use in getScrollableBackLayers, getNonScrollableFrontLayers
     mutable LayerList m_lastScrollableBackLayers;