// Who When What
// --- ---------- -----------------------------------------------------------
// JLH 05/22/2010 Added this text. :-)
+// JLH 08/09/2010 Preparation for removal of GraphicView object from this
+// class
//
#include "actioninterface.h"
/**
* Constructor.
*
- * Sets the entity container on which the action class inherited
- * from this interface operates.
+ * Sets the entity container on which the action class inherited from this
+ * interface operates.
*
- * @param name Action name. This can be used internally for
- * debugging mainly.
+ * @param name Action name. This can be used internally for debugging mainly.
* @param container Entity container this action operates on.
- * @param graphicView Graphic view instance this action operates on.
- * Please note that an action belongs to this
- * view.
- * @param cursor Default mouse cursor for this action. If the action
- * is suspended and resumed again the cursor will always
- * be reset to the one given here.
+ * @param graphicView Graphic view instance this action operates on. Please
+ * note that an action belongs to this view.
*/
-ActionInterface::ActionInterface(const char * name, RS_EntityContainer & c,
- GraphicView & v): graphicView(&v), container(&c)
+ActionInterface::ActionInterface(const char * name, RS_EntityContainer & ec,
+ GraphicView & gv): graphicView(&gv), container(&ec)
{
RS_DEBUG->print("ActionInterface::ActionInterface: Setting up action: \"%s\"", name);
finished = false;
// Graphic provides a pointer to the graphic if the entity container is a
- //graphic (i.e. can also hold layers).
- graphic = c.getGraphic();
+ // graphic (i.e. can also hold layers).
+ graphic = ec.getGraphic();
// Document pointer will be used for undo / redo
- document = c.getDocument();
+ document = ec.getDocument();
// This is here until I can figure out a better way to contain all of this
// circular referential nonsense that exists in this codebase. It will be
// expunged, by Grabthar's Hammer!
graphicView->snapper.SetContainer(container);
graphicView->snapper.SetGraphicView(graphicView); // <-- THIS is what I mean! INSANE!
+ // Not all actions use these. Perhaps we need to pass params to the contructor
+ // in order to set these? Setting the default to true for both?
graphicView->snapper.SetVisible();
graphicView->preview.SetVisible();
/**
* Destructor.
*/
-ActionInterface::~ActionInterface()
+/*virtual*/ ActionInterface::~ActionInterface()
{
// would be pure virtual now:
// hideOptions();
{
graphicView->snapper.SetVisible(false);
graphicView->preview.SetVisible(false);
+ graphicView->preview.clear();
}
}
*/
void ActionInterface::suspend()
{
+ // Maybe this is where we need to save the state of the snapper
+ // & preview objects???
// graphicView->setMouseCursor(RS2::ArrowCursor);
// RS_Snapper::suspend();
}
return graphicView->snapper.catchEntity(v, level);
}
+#warning "!!! Dummy functions need to be deleted once all actions no longer use these !!!"
//dummy functions, will delete later...
void ActionInterface::drawSnapper(void)
{