diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-26 00:29:37 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-26 00:29:37 +0000 |
commit | 2785103a6bd4de55bd26d79e34d0fdd4b329a73a (patch) | |
tree | c2738b1095bfdb263da27bc1391403d829522a14 /krita/ui/kis_save_visitor.h | |
parent | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (diff) | |
download | koffice-2785103a6bd4de55bd26d79e34d0fdd4b329a73a.tar.gz koffice-2785103a6bd4de55bd26d79e34d0fdd4b329a73a.zip |
Remove krita* in preparation for name switch from Krita to Chalk
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238361 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/ui/kis_save_visitor.h')
-rw-r--r-- | krita/ui/kis_save_visitor.h | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/krita/ui/kis_save_visitor.h b/krita/ui/kis_save_visitor.h deleted file mode 100644 index ce668a53..00000000 --- a/krita/ui/kis_save_visitor.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2002 Patrick Julien <[email protected]> - * Copyright (c) 2005 Casper Boemann <[email protected]> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef KIS_SAVE_VISITOR_H_ -#define KIS_SAVE_VISITOR_H_ - -#include <tqrect.h> -#include "kis_types.h" -#include "kis_layer_visitor.h" -#include "kis_image.h" -#include "kis_layer.h" -#include "kis_paint_layer.h" -#include "kis_group_layer.h" - -class KisSaveVisitor : public KisLayerVisitor { -public: - KisSaveVisitor(KisImageSP img, KoStore *store, TQ_UINT32 &count) : - KisLayerVisitor(), - m_count(count) - { - m_external = false; - m_img = img; - m_store = store; - } - -public: - void setExternalUri(TQString &uri) - { - m_external = true; - m_uri = uri; - } - - virtual bool visit(KisPaintLayer *layer) - { - //connect(*layer->paintDevice(), TQT_SIGNAL(ioProgress(TQ_INT8)), m_img, TQT_SLOT(slotIOProgress(TQ_INT8))); - - TQString location = m_external ? TQString() : m_uri; - location += m_img->name() + TQString("/layers/layer%1").tqarg(m_count); - - // Layer data - if (m_store->open(location)) { - if (!layer->paintDevice()->write(m_store)) { - layer->paintDevice()->disconnect(); - m_store->close(); - //IODone(); - return false; - } - - m_store->close(); - } - - if (layer->paintDevice()->colorSpace()->getProfile()) { - KisAnnotationSP annotation = layer->paintDevice()->colorSpace()->getProfile()->annotation(); - - if (annotation) { - // save layer profile - location = m_external ? TQString() : m_uri; - location += m_img->name() + TQString("/layers/layer%1").tqarg(m_count) + ".icc"; - - if (m_store->open(location)) { - m_store->write(annotation->annotation()); - m_store->close(); - } - } - } - - if (layer->hasMask()) { - KisPaintDeviceSP tqmask = layer->getMask(); - - if (tqmask) { - // save layer profile - location = m_external ? TQString() : m_uri; - location += m_img->name() + TQString("/layers/layer%1").tqarg(m_count) + ".tqmask"; - - if (m_store->open(location)) { - if (!tqmask->write(m_store)) { - tqmask->disconnect(); - m_store->close(); - return false; - } - - m_store->close(); - } - } - } - - m_count++; - return true; - } - - virtual bool visit(KisGroupLayer *layer) - { - KisSaveVisitor visitor(m_img, m_store, m_count); - - if(m_external) - visitor.setExternalUri(m_uri); - - KisLayerSP child = layer->firstChild(); - - while(child) - { - child->accept(visitor); - child = child->nextSibling(); - } - return true; - } - - virtual bool visit(KisPartLayer *) - { - return true; - } - - virtual bool visit(KisAdjustmentLayer* layer) - { - - if (layer->selection()) { - TQString location = m_external ? TQString() : m_uri; - location += m_img->name() + TQString("/layers/layer%1").tqarg(m_count) + ".selection"; - - // Layer data - if (m_store->open(location)) { - if (!layer->selection()->write(m_store)) { - layer->selection()->disconnect(); - m_store->close(); - //IODone(); - return false; - } - m_store->close(); - } - } - - if (layer->filter()) { - TQString location = m_external ? TQString() : m_uri; - location = m_external ? TQString() : m_uri; - location += m_img->name() + TQString("/layers/layer%1").tqarg(m_count) + ".filterconfig"; - - if (m_store->open(location)) { - TQString s = layer->filter()->toString(); - m_store->write(s.utf8(), tqstrlen(s.utf8())); - m_store->close(); - } - } - m_count++; - return true; - } - -private: - KisImageSP m_img; - KoStore *m_store; - bool m_external; - TQString m_uri; - TQ_UINT32 &m_count; -}; - -#endif // KIS_SAVE_VISITOR_H_ - |