X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Factioninterface.cpp;fp=src%2Fbase%2Factioninterface.cpp;h=10f452408161383c5dd9e9a35f096a2e723401d8;hb=dd17716b803ab2aa4163b905904a078f9fa5ae02;hp=9f38848e2df778ae588dc33ab3dfb9dee8e2435d;hpb=1f0d096a7fc370ff02477f3860beae2669bf8903;p=architektonas diff --git a/src/base/actioninterface.cpp b/src/base/actioninterface.cpp index 9f38848..10f4524 100644 --- a/src/base/actioninterface.cpp +++ b/src/base/actioninterface.cpp @@ -12,6 +12,8 @@ // 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" @@ -24,21 +26,16 @@ /** * 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); @@ -47,17 +44,19 @@ ActionInterface::ActionInterface(const char * name, RS_EntityContainer & c, 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(); @@ -67,7 +66,7 @@ ActionInterface::ActionInterface(const char * name, RS_EntityContainer & c, /** * Destructor. */ -ActionInterface::~ActionInterface() +/*virtual*/ ActionInterface::~ActionInterface() { // would be pure virtual now: // hideOptions(); @@ -115,6 +114,7 @@ void ActionInterface::init(int status/*= 0*/) { graphicView->snapper.SetVisible(false); graphicView->preview.SetVisible(false); + graphicView->preview.clear(); } } @@ -312,6 +312,8 @@ void ActionInterface::setPredecessor(ActionInterface * p) */ 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(); } @@ -384,6 +386,7 @@ RS_Entity * ActionInterface::catchEntity(Vector v, RS2::ResolveLevel level/*= RS 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) {