18#ifndef _KIS_PART_LAYER_
19#define _KIS_PART_LAYER_
23#include <KoDocument.h>
24#include <KoDocumentChild.h>
26#include "kis_paint_layer.h"
29#include "kis_part_layer_iface.h"
31#include "kis_layer_visitor.h"
40class KisChildDoc : public KoDocumentChild
44 KisChildDoc ( KisDoc * kisDoc, const TQRect& rect, KoDocument * childDoc );
45 KisChildDoc ( KisDoc * kisDdoc );
47 virtual ~KisChildDoc();
49 KisDoc * parent() const { return m_doc; }
51 void setPartLayer (KisPartLayerSP layer) { m_partLayer = layer; }
53 KisPartLayerSP partLayer() const { return m_partLayer; }
57 KisPartLayerSP m_partLayer;
74class KisPartLayerImpl : public KisPartLayer {
77 typedef KisPartLayer super;
79 KisPartLayerImpl(KisImageSP img, KisChildDoc * doc);
80 virtual ~KisPartLayerImpl();
82 virtual KisLayerSP clone() const;
93 void setDocType( const TQString& type) { m_docType = type; }
94 TQString docType() const { return m_docType; }
96 virtual void setX(TQ_INT32 x);
97 virtual void setY(TQ_INT32 y);
98 virtual TQ_INT32 x() const { return m_doc->geometry() . x(); }
99 virtual TQ_INT32 y() const { return m_doc->geometry() . y(); }
100 virtual TQRect extent() const { return m_doc->geometry(); }
105 virtual bool accept(KisLayerVisitor& visitor) {
106 return visitor.visit( this);
109 virtual KisPaintDeviceSP prepareProjection(KisPaintDeviceSP projection, const TQRect& r);
111 virtual void paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h);
113 virtual bool saveToXML(TQDomDocument doc, TQDomElement elem);
118 void childActivated(KoDocumentChild* child);
119 void childDeactivated( bool activated);
124 KisPaintDeviceSP m_cache;
134class KisConnectPartLayerVisitor : public KisLayerVisitor {
139 KisConnectPartLayerVisitor(KisImageSP img, KisView* view, bool mode);
140 virtual ~KisConnectPartLayerVisitor() {}
Class that contains a KisFilter and optionally a KisSelection.
The child document is responsible for saving and loading the embedded layers.
A KisLayer that bundles child layers into a single layer.
This layer is of a type that can be painted on.
virtual TQRect extent() const Returns an approximation of where the bounds on actual data are in this layer.
virtual TQImage createThumbnail(TQ_INT32 w, TQ_INT32 h) Returns a thumbnail in requested size.
virtual KisChildDoc * childDoc() const Returns the childDoc so that we can access the doc from other places, if need be (KisDoc).
virtual void deactivate() Called when another layer is made inactive.
virtual TQRect exactBounds() const Returns the exact bounds of where the actual data resides in this layer.
virtual void activate() Called when the layer is made active.
virtual bool accept(KisLayerVisitor &visitor) Accept the KisLayerVisitor (for the Visitor design pattern), should call the correct function on the ...
virtual KisLayerSP clone() const Return a copy of this layer.
virtual void paintSelection(TQImage &img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) paints a mask where the selection on this layer resides
An interface for the Part Layer so that we can use it in core/, but can implement it in ui/.
|