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 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/28/2010 Added this text. :-)
17 #include "clipboard.h"
22 RS_Clipboard* RS_Clipboard::uniqueInstance = NULL;
26 void RS_Clipboard::clear() {
28 graphic.clearBlocks();
29 graphic.clearLayers();
30 graphic.clearVariables();
37 void RS_Clipboard::addBlock(RS_Block* b) {
39 graphic.addBlock(b, false);
44 bool RS_Clipboard::hasBlock(const QString& name) {
45 return (graphic.findBlock(name)!=NULL);
49 void RS_Clipboard::addLayer(RS_Layer* l) {
51 //graphic.addLayer(l->clone());
58 bool RS_Clipboard::hasLayer(const QString& name) {
59 return (graphic.findLayer(name)!=NULL);
64 void RS_Clipboard::addEntity(RS_Entity* e) {
66 //graphic.addEntity(e->clone());
68 e->reparent(&graphic);
73 * Dumps the clipboard contents to stdout.
75 std::ostream& operator << (std::ostream& os, RS_Clipboard& cb) {
76 os << "Clipboard: " << cb.graphic << "\n";