X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fclipboard.h;fp=src%2Fbase%2Fclipboard.h;h=22d00270bdcdff5fa71637bbb9161712a3a0dffe;hb=16354e0421b316a62c6b9f7b0b4f3b8cf6f06284;hp=247d07b10c16bf2384b807187b73580388860b1a;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/base/clipboard.h b/src/base/clipboard.h index 247d07b..22d0027 100644 --- a/src/base/clipboard.h +++ b/src/base/clipboard.h @@ -4,82 +4,49 @@ #include #include "drawing.h" -#define RS_CLIPBOARD RS_Clipboard::instance() +#define CLIPBOARD Clipboard::instance() -class RS_Block; -class RS_Layer; -class RS_Entity; +class Block; +class Layer; +class Entity; /** * QCad internal clipboard. We don't use the system clipboard for - * better portaility. - * Implemented as singleton. + * better portability. Implemented as singleton. * + * @author James Hammons * @author Andrew Mustun */ -class RS_Clipboard { -protected: - RS_Clipboard() { - } - -public: - /** - * @return Instance to the unique clipboard object. - */ - static RS_Clipboard* instance() { - if (uniqueInstance==NULL) { - uniqueInstance = new RS_Clipboard(); - } - return uniqueInstance; - } - - void clear(); - - void addBlock(RS_Block* b); - bool hasBlock(const QString& name); - int countBlocks() { - return graphic.countBlocks(); - } - RS_Block* blockAt(int i) { - return graphic.blockAt(i); - } - - void addLayer(RS_Layer* l); - bool hasLayer(const QString& name); - int countLayers() { - return graphic.countLayers(); - } - RS_Layer* layerAt(int i) { - return graphic.layerAt(i); - } - - void addEntity(RS_Entity* e); - - uint count() { - return graphic.count(); - } - RS_Entity* entityAt(uint i) { - return graphic.entityAt(i); - } - RS_Entity* firstEntity() { - return graphic.firstEntity(); - } - - RS_Entity* nextEntity() { - return graphic.nextEntity(); - } - - Drawing* getGraphic() { - return &graphic; - } - - friend std::ostream& operator << (std::ostream& os, RS_Clipboard& cb); - -protected: - static RS_Clipboard* uniqueInstance; - - Drawing graphic; +class Clipboard +{ + protected: + Clipboard(); + + public: + static Clipboard * instance(); + + void clear(); + void addBlock(Block * b); + bool hasBlock(const QString & name); + int countBlocks(); + Block * blockAt(int i); + void addLayer(Layer* l); + bool hasLayer(const QString & name); + int countLayers(); + Layer * layerAt(int i); + void addEntity(Entity * e); + uint count(); + Entity * entityAt(uint i); + Entity * firstEntity(); + Entity * nextEntity(); + Drawing * getGraphic(); + + friend std::ostream & operator<<(std::ostream & os, Clipboard & cb); + + protected: + static Clipboard * uniqueInstance; + + Drawing graphic; }; #endif -