X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fclipboard.cpp;fp=src%2Fbase%2Fclipboard.cpp;h=0000000000000000000000000000000000000000;hb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;hp=943781afafc5040591d7d7a2ca4ab5884c0a610e;hpb=43c13b052d069ba435277d93867380d00c04931f;p=architektonas diff --git a/src/base/clipboard.cpp b/src/base/clipboard.cpp deleted file mode 100644 index 943781a..0000000 --- a/src/base/clipboard.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// clipboard.cpp -// -// Part of the Architektonas Project -// Originally part of QCad Community Edition by Andrew Mustun -// Extensively rewritten and refactored by James L. Hammons -// Portions copyright (C) 2001-2003 RibbonSoft -// Copyright (C) 2010 Underground Software -// See the README and GPLv2 files for licensing and warranty information -// -// JLH = James L. Hammons -// -// Who When What -// --- ---------- ----------------------------------------------------------- -// JLH 05/28/2010 Added this text. :-) -// JLH 09/09/2010 Removed implementation from header (where it DOESN'T -// belong) and moved it here (where it DOES) -// - -#include "clipboard.h" - -#include "block.h" -#include "layer.h" -#include "entity.h" - -Clipboard * Clipboard::uniqueInstance = NULL; - -void Clipboard::clear() -{ - graphic.clear(); - graphic.clearBlocks(); - graphic.clearLayers(); - graphic.clearVariables(); -} - -void Clipboard::addBlock(Block * b) -{ - if (b) - graphic.addBlock(b, false); -} - -bool Clipboard::hasBlock(const QString & name) -{ - return (graphic.findBlock(name) != NULL); -} - -void Clipboard::addLayer(Layer * l) -{ - if (l) - graphic.addLayer(l); -} - -bool Clipboard::hasLayer(const QString & name) -{ - return (graphic.findLayer(name) != NULL); -} - -void Clipboard::addEntity(Entity * e) -{ - if (e) - { - graphic.addEntity(e); - e->reparent(&graphic); - } -} - -/** - * Dumps the clipboard contents to stdout. - */ -std::ostream & operator<<(std::ostream & os, Clipboard & cb) -{ - os << "Clipboard: " << cb.graphic << "\n"; - return os; -} - -Clipboard::Clipboard() -{ -} - -/** - * @return Instance to the unique clipboard object. - */ -/*static*/ Clipboard * Clipboard::instance() -{ - if (uniqueInstance == NULL) - uniqueInstance = new Clipboard(); - - return uniqueInstance; -} - -int Clipboard::countBlocks() -{ - return graphic.countBlocks(); -} - -Block * Clipboard::blockAt(int i) -{ - return graphic.blockAt(i); -} - -int Clipboard::countLayers() -{ - return graphic.countLayers(); -} - -Layer * Clipboard::layerAt(int i) -{ - return graphic.layerAt(i); -} - -uint Clipboard::count() -{ - return graphic.count(); -} - -Entity * Clipboard::entityAt(uint i) -{ - return graphic.entityAt(i); -} - -Entity * Clipboard::firstEntity() -{ - return graphic.firstEntity(); -} - -Entity * Clipboard::nextEntity() -{ - return graphic.nextEntity(); -} - -Drawing * Clipboard::getGraphic() -{ - return &graphic; -}