comparison 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
comparison
equal deleted inserted replaced
7:49a95b174050 8:214054a0d8b8
13 #include <QFrame> 13 #include <QFrame>
14 #include <QProgressBar> 14 #include <QProgressBar>
15 15
16 #include "base/ZoomConstraint.h" 16 #include "base/ZoomConstraint.h"
17 #include "base/PropertyContainer.h" 17 #include "base/PropertyContainer.h"
18 #include "base/ViewManager.h"
18 #include "base/XmlExportable.h" 19 #include "base/XmlExportable.h"
19 20
20 class Layer; 21 class Layer;
21 class ViewManager;
22 22
23 #include <map> 23 #include <map>
24 24
25 /** 25 /**
26 * View is the base class of widgets that display one or more 26 * View is the base class of widgets that display one or more
109 * Return a layer, counted in stacking order. That is, layer 0 is 109 * Return a layer, counted in stacking order. That is, layer 0 is
110 * the bottom layer and layer "getLayerCount()-1" is the top one. 110 * the bottom layer and layer "getLayerCount()-1" is the top one.
111 */ 111 */
112 virtual Layer *getLayer(int n) { return m_layers[n]; } 112 virtual Layer *getLayer(int n) { return m_layers[n]; }
113 113
114 /**
115 * Return the layer last selected by the user. This is normally
116 * the top layer, the same as getLayer(getLayerCount()-1).
117 * However, if the user has selected the pane itself more recently
118 * than any of the layers on it, this function will return 0. It
119 * will also return 0 if there are no layers.
120 */
121 virtual Layer *getSelectedLayer();
122
114 virtual void setViewManager(ViewManager *m); 123 virtual void setViewManager(ViewManager *m);
115 124
116 virtual void setFollowGlobalPan(bool f); 125 virtual void setFollowGlobalPan(bool f);
117 virtual bool getFollowGlobalPan() const { return m_followPan; } 126 virtual bool getFollowGlobalPan() const { return m_followPan; }
118 127
173 virtual void viewManagerCentreFrameChanged(void *, unsigned long, bool); 182 virtual void viewManagerCentreFrameChanged(void *, unsigned long, bool);
174 virtual void viewManagerPlaybackFrameChanged(unsigned long); 183 virtual void viewManagerPlaybackFrameChanged(unsigned long);
175 virtual void viewManagerZoomLevelChanged(void *, unsigned long, bool); 184 virtual void viewManagerZoomLevelChanged(void *, unsigned long, bool);
176 185
177 virtual void propertyContainerSelected(PropertyContainer *pc); 186 virtual void propertyContainerSelected(PropertyContainer *pc);
187
188 virtual void toolModeChanged();
178 189
179 protected: 190 protected:
180 View(QWidget *, bool showProgress); 191 View(QWidget *, bool showProgress);
181 virtual void paintEvent(QPaintEvent *e); 192 virtual void paintEvent(QPaintEvent *e);
182 193
211 int m_cacheZoomLevel; 222 int m_cacheZoomLevel;
212 223
213 bool m_deleting; 224 bool m_deleting;
214 225
215 LayerList m_layers; // I don't own these, but see dtor note above 226 LayerList m_layers; // I don't own these, but see dtor note above
227 bool m_haveSelectedLayer;
216 228
217 // caches for use in getScrollableBackLayers, getNonScrollableFrontLayers 229 // caches for use in getScrollableBackLayers, getNonScrollableFrontLayers
218 mutable LayerList m_lastScrollableBackLayers; 230 mutable LayerList m_lastScrollableBackLayers;
219 mutable LayerList m_lastNonScrollableBackLayers; 231 mutable LayerList m_lastNonScrollableBackLayers;
220 232