3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/28/2010 Added this text. :-)
15 #include "rs_clipboard.h"
18 #include "rs_entity.h"
20 RS_Clipboard* RS_Clipboard::uniqueInstance = NULL;
24 void RS_Clipboard::clear() {
26 graphic.clearBlocks();
27 graphic.clearLayers();
28 graphic.clearVariables();
35 void RS_Clipboard::addBlock(RS_Block* b) {
37 graphic.addBlock(b, false);
42 bool RS_Clipboard::hasBlock(const QString& name) {
43 return (graphic.findBlock(name)!=NULL);
47 void RS_Clipboard::addLayer(RS_Layer* l) {
49 //graphic.addLayer(l->clone());
56 bool RS_Clipboard::hasLayer(const QString& name) {
57 return (graphic.findLayer(name)!=NULL);
62 void RS_Clipboard::addEntity(RS_Entity* e) {
64 //graphic.addEntity(e->clone());
66 e->reparent(&graphic);
71 * Dumps the clipboard contents to stdout.
73 std::ostream& operator << (std::ostream& os, RS_Clipboard& cb) {
74 os << "Clipboard: " << cb.graphic << "\n";