23#include <tqapplication.h>
28#include <tqstringlist.h>
30#include <tqpaintdevicemetrics.h>
33#include <dcopobject.h>
34#include <tdeapplication.h>
38#include <tdefiledialog.h>
41#include <knotifyclient.h>
43#include <tdemessagebox.h>
46#include <KoFilterManager.h>
47#include <KoMainWindow.h>
48#include <KoQueryTrader.h>
50#include <KoStoreDevice.h>
51#include <KoTemplateChooseDia.h>
52#include <KoApplication.h>
53#include <KoCommandHistory.h>
56#include <kis_clipboard.h>
57#include <kis_meta_registry.h>
58#include "kis_annotation.h"
60#include "kis_config.h"
61#include "kis_debug_areas.h"
63#include "kis_factory.h"
66#include "kis_paint_layer.h"
67#include "kis_nameserver.h"
68#include "kis_painter.h"
69#include "kis_selection.h"
70#include "kis_fill_painter.h"
71#include "kis_command.h"
73#include "kis_colorspace.h"
74#include "kis_colorspace_factory_registry.h"
75#include "kis_profile.h"
77#include "kis_part_layer.h"
78#include "kis_doc_iface.h"
79#include "kis_paint_device_action.h"
80#include "kis_custom_image_widget.h"
81#include "kis_load_visitor.h"
82#include "kis_save_visitor.h"
83#include "kis_savexml_visitor.h"
85static const char *CURRENT_DTD_VERSION =
"1.3";
92#define APP_MIMETYPE "application/x-chalk"
97#define NATIVE_MIMETYPE "application/x-kra"
100 class KisCommandImageMv :
public KisCommand {
101 typedef KisCommand super;
104 KisCommandImageMv(KisDoc *doc,
105 KisUndoAdapter *adapter,
106 const TQString& name,
107 const TQString& oldName) : super(i18n(
"Rename Image"), adapter)
114 virtual ~KisCommandImageMv()
118 virtual void execute()
120 adapter()->setUndo(
false);
121 m_doc->renameImage(m_oldName, m_name);
122 adapter()->setUndo(
true);
125 virtual void unexecute()
127 adapter()->setUndo(
false);
128 m_doc->renameImage(m_name, m_oldName);
129 adapter()->setUndo(
true);
140KisDoc::KisDoc(TQWidget *parentWidget,
const char *widgetName, TQObject *parent,
const char *name,
bool singleViewMode) :
141 super(parentWidget, widgetName, parent, name, singleViewMode)
150 m_macroNestDepth = 0;
151 m_ioProgressBase = 0;
152 m_ioProgressTotalSteps = 0;
154 setInstance( KisFactory::instance(),
false );
155 setTemplateType(
"chalk_template" );
167 m_undoListeners.setAutoDelete(
false);
171TQCString KisDoc::mimeType()
const
176DCOPObject *KisDoc::dcopObject()
179 m_dcop =
new KisDocIface(
this);
180 TQ_CHECK_PTR(m_dcop);
185bool KisDoc::initDoc(InitDocFlags flags, TQWidget* parentWidget)
193 KoTemplateChooseDia::DialogType dlgtype;
195 if (flags != KoDocument::InitDocFileNew) {
196 dlgtype = KoTemplateChooseDia::Everything;
198 dlgtype = KoTemplateChooseDia::OnlyTemplates;
201 KoTemplateChooseDia::ReturnType ret =
202 KoTemplateChooseDia::choose(KisFactory::instance(),
209 if (ret == KoTemplateChooseDia::Template) {
211 ok = loadNativeFormat( file );
215 }
else if (ret == KoTemplateChooseDia::File) {
218 }
else if (ret == KoTemplateChooseDia::Empty) {
225 setUndo(cfg.undoEnabled());
230void KisDoc::openExistingFile(
const TQString& file)
234 KoDocument::openExistingFile(file);
239void KisDoc::openTemplate(
const TQString& file)
243 KoDocument::openTemplate(file);
260 m_cmdHistory =
new KoCommandHistory(actionCollection(),
true);
261 TQ_CHECK_PTR(m_cmdHistory);
263 connect(m_cmdHistory, TQ_SIGNAL(documentRestored()),
this, TQ_SLOT(slotDocumentRestored()));
264 connect(m_cmdHistory, TQ_SIGNAL(commandExecuted(KCommand *)),
this, TQ_SLOT(slotCommandExecuted(KCommand *)));
267 m_nserver =
new KisNameServer(i18n(
"Image %1"), 1);
268 TQ_CHECK_PTR(m_nserver);
270 if (!KisMetaRegistry::instance()->csRegistry()->exists(
KisID(
"RGBA",
""))) {
271 KMessageBox::sorry(0, i18n(
"No colorspace modules loaded: cannot run Chalk"));
275 m_undoListeners.setAutoDelete(
false);
280TQDomDocument KisDoc::saveXML()
282 TQDomDocument doc = createDomDocument(
"DOC", CURRENT_DTD_VERSION);
283 TQDomElement root = doc.documentElement();
285 root.setAttribute(
"editor",
"Chalk");
286 root.setAttribute(
"depth",
sizeof(TQ_UINT8));
287 root.setAttribute(
"syntaxVersion",
"1");
289 root.appendChild(saveImage(doc, m_currentImage));
294bool KisDoc::loadOasis(
const TQDomDocument&, KoOasisStyles&,
const TQDomDocument&, KoStore* )
301bool KisDoc::saveOasis( KoStore*, KoXmlWriter* )
307bool KisDoc::loadXML(TQIODevice *,
const TQDomDocument& doc)
316 if (doc.doctype().name() !=
"DOC")
318 root = doc.documentElement();
319 attr = root.attribute(
"syntaxVersion");
320 if (attr.toInt() > 1)
322 if ((attr = root.attribute(
"depth")).isNull())
324 m_conversionDepth = attr.toInt();
326 if (!root.hasChildNodes()) {
332 for (node = root.firstChild(); !node.isNull(); node = node.nextSibling()) {
333 if (node.isElement()) {
334 if (node.nodeName() ==
"IMAGE") {
335 TQDomElement elem = node.toElement();
336 if (!(img = loadImage(elem)))
338 m_currentImage = img;
345 emit loadingFinished();
349bool KisDoc::loadChildren(KoStore* store) {
350 TQPtrListIterator<KoDocumentChild> it(children());
351 for( ; it.current(); ++it ) {
352 if (!it.current()->loadDocument(store)) {
359TQDomElement KisDoc::saveImage(TQDomDocument& doc, KisImageSP img)
361 TQDomElement image = doc.createElement(
"IMAGE");
364 image.setAttribute(
"name", img->name());
365 image.setAttribute(
"mime",
"application/x-kra");
366 image.setAttribute(
"width", img->width());
367 image.setAttribute(
"height", img->height());
368 image.setAttribute(
"colorspacename", img->colorSpace()->id().id());
369 image.setAttribute(
"description", img->description());
371 if (img->getProfile() && img->getProfile()-> valid())
372 image.setAttribute(
"profile", img->getProfile()->productName());
373 image.setAttribute(
"x-res", img->xRes());
374 image.setAttribute(
"y-res", img->yRes());
377 KisSaveXmlVisitor visitor(doc, image, count,
true);
379 m_currentImage->rootLayer()->accept(visitor);
384KisImageSP KisDoc::loadImage(
const TQDomElement& element)
395 TQString description;
396 TQString profileProductName;
399 TQString colorspacename;
402 if ((attr = element.attribute(
"mime")) == NATIVE_MIMETYPE) {
403 if ((name = element.attribute(
"name")).isNull())
405 if ((attr = element.attribute(
"width")).isNull())
407 width = attr.toInt();
408 if ((attr = element.attribute(
"height")).isNull())
410 height = attr.toInt();
412 description = element.attribute(
"description");
414 if ((attr = element.attribute(
"x-res")).isNull())
416 xres = attr.toDouble();
418 if ((attr = element.attribute(
"y-res")).isNull())
420 yres = attr.toDouble();
422 if ((colorspacename = element.attribute(
"colorspacename")).isNull())
427 colorspacename =
"RGBA";
431 if (colorspacename ==
"Grayscale + Alpha")
432 colorspacename =
"GRAYA";
434 if ((profileProductName = element.attribute(
"profile")).isNull()) {
436 cs = KisMetaRegistry::instance()->csRegistry()->
getColorSpace(colorspacename,
"");
439 cs = KisMetaRegistry::instance()->csRegistry()->
getColorSpace(colorspacename, profileProductName);
443 kdWarning(DBG_AREA_FILE) <<
"Could not open colorspace\n";
447 img =
new KisImage(
this, width, height, cs, name);
448 img->blockSignals(
true);
450 connect( img, TQ_SIGNAL( sigImageModified() ),
this, TQ_SLOT( slotImageUpdated() ));
451 img->setDescription(description);
452 img->setResolution(xres, yres);
454 loadLayers(element, img, img->rootLayer().data());
458 img->notifyImageLoaded();
463void KisDoc::loadLayers(
const TQDomElement& element, KisImageSP img, KisGroupLayerSP parent)
465 TQDomNode node = element.firstChild();
470 if (node.isElement()) {
471 if (node.nodeName() ==
"LAYERS") {
472 for (child = node.firstChild(); !child.isNull(); child = child.nextSibling()) {
473 KisLayerSP layer = loadLayer(child.toElement(), img);
476 kdWarning(DBG_AREA_FILE) <<
"Could not load layer\n";
479 img->nextLayerName();
480 img->addLayer(layer, parent, 0);
488KisLayerSP KisDoc::loadLayer(
const TQDomElement& element, KisImageSP img)
502 if ((name = element.attribute(
"name")).isNull())
505 if ((attr = element.attribute(
"x")).isNull())
509 if ((attr = element.attribute(
"y")).isNull())
514 if ((attr = element.attribute(
"opacity")).isNull())
517 if ((opacity = attr.toInt()) < 0 || opacity > TQ_UINT8_MAX)
518 opacity = OPACITY_OPAQUE;
521 TQString compositeOpName = element.attribute(
"compositeop");
522 KisCompositeOp compositeOp;
524 if (compositeOpName.isNull()) {
525 compositeOp = COMPOSITE_OVER;
527 compositeOp = KisCompositeOp(compositeOpName);
530 if (!compositeOp.isValid()) {
534 if ((attr = element.attribute(
"visible")).isNull())
537 visible = attr ==
"0" ? false :
true;
539 if ((attr = element.attribute(
"locked")).isNull())
542 locked = attr ==
"0" ? false :
true;
545 if ((attr = element.attribute(
"layertype")).isNull())
546 return loadPaintLayer(element, img, name, x, y, opacity, visible, locked, compositeOp) ;
548 if(attr ==
"paintlayer")
549 return loadPaintLayer(element, img, name, x, y, opacity, visible, locked, compositeOp);
551 if(attr ==
"grouplayer")
552 return loadGroupLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data();
554 if(attr ==
"adjustmentlayer")
555 return loadAdjustmentLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data();
557 if(attr ==
"partlayer")
558 return loadPartLayer(element, img, name, x, y, opacity, visible, locked, compositeOp).data();
560 kdWarning(DBG_AREA_FILE) <<
"Specified layertype is not recognised\n";
565KisLayerSP KisDoc::loadPaintLayer(
const TQDomElement& element, KisImageSP img,
566 TQString name, TQ_INT32 x, TQ_INT32 y,
567 TQ_INT32 opacity,
bool visible,
bool locked, KisCompositeOp compositeOp)
570 KisPaintLayerSP layer;
573 TQString colorspacename;
574 TQString profileProductName;
576 if ((colorspacename = element.attribute(
"colorspacename")).isNull())
577 cs = img->colorSpace();
580 cs = KisMetaRegistry::instance()->csRegistry()->
getColorSpace(colorspacename,
"");
585 layer->setCompositeOp(compositeOp);
586 layer->setVisible(visible);
587 layer->setLocked(locked);
591 if ((element.attribute(
"filename")).isNull())
592 m_layerFilenames[layer.data()] = name;
594 m_layerFilenames[layer.data()] = TQString(element.attribute(
"filename"));
596 if ((attr = element.attribute(
"hasmask")).isNull())
606 for( TQDomNode node = element.firstChild(); !node.isNull(); node = node.nextSibling() )
608 TQDomElement e = node.toElement();
609 if ( !e.isNull() && e.tagName() ==
"ExifInfo" )
611 layer->paintDevice()->exifInfo()->load(e);
617KisGroupLayerSP KisDoc::loadGroupLayer(
const TQDomElement& element, KisImageSP img,
618 TQString name, TQ_INT32 x, TQ_INT32 y, TQ_INT32 opacity,
bool visible,
bool locked,
619 KisCompositeOp compositeOp)
622 KisGroupLayerSP layer;
627 layer->setCompositeOp(compositeOp);
628 layer->setVisible(visible);
629 layer->setLocked(locked);
633 loadLayers(element, img, layer);
638KisAdjustmentLayerSP KisDoc::loadAdjustmentLayer(
const TQDomElement& element, KisImageSP img,
639 TQString name, TQ_INT32 x, TQ_INT32 y, TQ_INT32 opacity,
bool visible,
bool locked,
640 KisCompositeOp compositeOp)
643 KisAdjustmentLayerSP layer;
646 if ((filtername = element.attribute(
"filtername")).isNull()) {
648 kdWarning(DBG_AREA_FILE) <<
"No filter in adjustment layer" << endl;
652 KisFilter * f = KisFilterRegistry::instance()->get(filtername);
654 kdWarning(DBG_AREA_FILE) <<
"No filter for filtername " << filtername <<
"\n";
664 layer->setCompositeOp(compositeOp);
665 layer->setVisible(visible);
666 layer->setLocked(locked);
669 layer->setOpacity(opacity);
671 if ((element.attribute(
"filename")).isNull())
672 m_layerFilenames[layer.data()] = name;
674 m_layerFilenames[layer.data()] = TQString(element.attribute(
"filename"));
679KisPartLayerSP KisDoc::loadPartLayer(
const TQDomElement& element, KisImageSP img,
680 TQString name, TQ_INT32 , TQ_INT32 , TQ_INT32 opacity,
681 bool visible,
bool locked,
682 KisCompositeOp compositeOp) {
684 TQString filename(element.attribute(
"filename"));
685 TQDomElement partElement = element.namedItem(
"object").toElement();
687 if (partElement.isNull()) {
688 kdWarning() <<
"loadPartLayer failed with partElement isNull" << endl;
692 child->load(partElement);
698 layer->setCompositeOp(compositeOp);
699 layer->setVisible(visible);
700 layer->setLocked(locked);
701 layer->setOpacity(opacity);
702 layer->setName(name);
707bool KisDoc::completeSaving(KoStore *store)
709 TQString uri = url().url();
711 bool external = isStoredExtern();
712 TQ_INT32 totalSteps = 0;
714 if (!m_currentImage)
return false;
716 totalSteps = (m_currentImage)->nlayers();
719 setIOSteps(totalSteps + 1);
723 KisSaveVisitor visitor(m_currentImage, store, count);
726 visitor.setExternalUri(uri);
728 m_currentImage->rootLayer()->accept(visitor);
734 KisAnnotationSP annotation = (m_currentImage)->annotation(
"exif");
736 location = external ? TQString() : uri;
737 location += (m_currentImage)->name() +
"/annotations/exif";
738 if (store->open(location)) {
739 store->write(annotation->annotation());
743 if (m_currentImage->getProfile()) {
744 annotation = m_currentImage->getProfile()->annotation();
747 location = external ? TQString() : uri;
748 location += m_currentImage->name() +
"/annotations/icc";
749 if (store->open(location)) {
750 store->write(annotation->annotation());
760bool KisDoc::completeLoading(KoStore *store)
762 TQString uri = url().url();
764 bool external = isStoredExtern();
765 TQ_INT32 totalSteps = 0;
767 totalSteps = (m_currentImage)->nlayers();
769 setIOSteps(totalSteps);
772 KisLoadVisitor visitor(m_currentImage, store, m_layerFilenames);
775 visitor.setExternalUri(uri);
777 m_currentImage->rootLayer()->accept(visitor);
781 location = external ? TQString() : uri;
782 location += (m_currentImage)->name() +
"/annotations/exif";
783 if (store->hasFile(location)) {
785 store->open(location);
786 data = store->read(store->size());
788 (m_currentImage)->addAnnotation(
new KisAnnotation(
"exif",
"", data));
791 location = external ? TQString() : uri;
792 location += (m_currentImage)->name() +
"/annotations/icc";
793 if (store->hasFile(location)) {
795 store->open(location);
796 data = store->read(store->size());
798 (m_currentImage)->setProfile(
new KisProfile(data));
803 setModified(
false );
808TQWidget* KisDoc::createCustomDocumentWidget(TQWidget *parent)
813 int w = cfg.defImgWidth();
814 int h = cfg.defImgHeight();
816 TQSize sz = KisClipboard::instance()->clipSize();
817 if (sz.isValid() && sz.width() != 0 && sz.height() != 0) {
821 return new KisCustomImageWidget(parent,
this, w, h, cfg.defImgResolution(), cfg.workingColorSpace(),
"unnamed");
825KoDocument* KisDoc::hitTest(
const TQPoint &pos,
const TQWMatrix& matrix) {
826 KoDocument* doc = super::hitTest(pos, matrix);
827 if (doc && doc !=
this) {
836 if (doc == partLayer->
childDoc()->document()) {
844void KisDoc::renameImage(
const TQString& oldName,
const TQString& newName)
846 (m_currentImage)->setName(newName);
849 addCommand(
new KisCommandImageMv(
this,
this, newName, oldName));
853KisImageSP KisDoc::newImage(
const TQString& name, TQ_INT32 width, TQ_INT32 height,
KisColorSpace * colorstrategy)
860 KisImageSP img =
new KisImage(
this, width, height, colorstrategy, name);
862 connect( img, TQ_SIGNAL( sigImageModified() ),
this, TQ_SLOT( slotImageUpdated() ));
870 painter.
begin(layer->paintDevice());
871 painter.
fillRect(0, 0, width, height,
KisColor(TQt::white, cs), OPACITY_OPAQUE);
874 img->addLayer(layer, img->rootLayer(), 0);
875 img->activate(layer);
877 m_currentImage = img;
884bool KisDoc::newImage(
const TQString& name, TQ_INT32 width, TQ_INT32 height,
KisColorSpace * cs,
const KisColor &bgColor,
const TQString &imgDescription,
const double imgResolution)
891 TQ_UINT8 opacity = OPACITY_OPAQUE;
895 if (!cs)
return false;
899 img =
new KisImage(
this, width, height, cs, name);
901 connect( img, TQ_SIGNAL( sigImageModified() ),
this, TQ_SLOT( slotImageUpdated() ));
902 img->setResolution(imgResolution, imgResolution);
903 img->setDescription(imgDescription);
906 layer =
new KisPaintLayer(img, img->nextLayerName(), OPACITY_OPAQUE, cs);
910 painter.
begin(layer->paintDevice());
911 painter.
fillRect(0, 0, width, height, bgColor, opacity);
914 TQValueVector<KisPaintDeviceAction *> actions = KisMetaRegistry::instance() ->
915 csRegistry()->paintDeviceActionsFor(cs);
916 for (uint i = 0; i < actions.count(); i++)
917 actions.at(i)->act(layer->paintDevice(), img->width(), img->height());
919 img->setBackgroundColor(bgColor);
920 img->addLayer(layer, img->rootLayer(), 0);
921 img->activate(layer);
923 m_currentImage = img;
925 cfg.defImgWidth(width);
926 cfg.defImgHeight(height);
927 cfg.defImgResolution(imgResolution);
934KoView* KisDoc::createViewInstance(TQWidget* parent,
const char *name)
936 KisView * v =
new KisView(
this,
this, parent, name);
942void KisDoc::paintContent(TQPainter& painter,
const TQRect& rc,
bool transparent,
double zoomX,
double zoomY)
945 TQString monitorProfileName = cfg.monitorProfile();
946 KisProfile * profile = KisMetaRegistry::instance()->csRegistry()->
getProfileByName(monitorProfileName);
947 painter.scale(zoomX, zoomY);
948 TQRect rect = rc & m_currentImage->bounds();
949 KisImage::PaintFlags paintFlags;
951 paintFlags = KisImage::PAINT_SELECTION;
953 paintFlags = (KisImage::PaintFlags)(KisImage::PAINT_BACKGROUND|KisImage::PAINT_SELECTION);
956 paintFlags = (KisImage::PaintFlags)(paintFlags | KisImage::PAINT_EMBEDDED_RECT);
958 m_currentImage->renderToPainter(rect.left(), rect.top(), rect.right(), rect.bottom(), painter, profile, paintFlags);
961void KisDoc::slotImageUpdated()
967void KisDoc::slotImageUpdated(
const TQRect& rect)
969 emit docUpdated(rect);
972void KisDoc::beginMacro(
const TQString& macroName)
975 if (m_macroNestDepth == 0) {
976 Q_ASSERT(m_currentMacro == 0);
977 m_currentMacro =
new KMacroCommand(macroName);
978 TQ_CHECK_PTR(m_currentMacro);
985void KisDoc::endMacro()
988 Q_ASSERT(m_macroNestDepth > 0);
989 if (m_macroNestDepth > 0) {
992 if (m_macroNestDepth == 0) {
993 Q_ASSERT(m_currentMacro != 0);
995 m_cmdHistory->addCommand(m_currentMacro,
false);
997 emit sigCommandExecuted();
1006 m_undoListeners.removeRef(l);
1007 m_undoListeners.append(l);
1012 m_undoListeners.removeRef(l);
1015KCommand * KisDoc::presentCommand()
1017 return m_cmdHistory->presentCommand();
1020void KisDoc::addCommand(KCommand *cmd)
1026 for (l = m_undoListeners.first(); l; l = m_undoListeners.next()) {
1027 l->notifyCommandAdded(cmd);
1034 m_currentMacro->addCommand(cmd);
1036 m_cmdHistory->addCommand(cmd,
false);
1037 emit sigCommandExecuted();
1040 kdDebug() <<
"Deleting command\n";
1045void KisDoc::setUndo(
bool undo)
1048 if (m_undo && m_cmdHistory->undoLimit() == 50 ) {
1050 setUndoLimit( cfg.defUndoLimit() );
1054TQ_INT32 KisDoc::undoLimit()
const
1056 return m_cmdHistory->undoLimit();
1059void KisDoc::setUndoLimit(TQ_INT32 limit)
1061 m_cmdHistory->setUndoLimit(limit);
1064TQ_INT32 KisDoc::redoLimit()
const
1066 return m_cmdHistory->redoLimit();
1069void KisDoc::setRedoLimit(TQ_INT32 limit)
1071 m_cmdHistory->setRedoLimit(limit);
1074void KisDoc::slotDocumentRestored()
1079void KisDoc::slotCommandExecuted(KCommand *command)
1082 emit sigCommandExecuted();
1086 for (l = m_undoListeners.first(); l; l = m_undoListeners.next()) {
1087 l->notifyCommandExecuted(command);
1092void KisDoc::slotUpdate(KisImageSP, TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 w, TQ_UINT32 h)
1094 TQRect rc(x, y, w, h);
1096 emit docUpdated(rc);
1099bool KisDoc::undo()
const
1104void KisDoc::setIOSteps(TQ_INT32 nsteps)
1106 m_ioProgressTotalSteps = nsteps * 100;
1107 m_ioProgressBase = 0;
1111void KisDoc::IOCompletedStep()
1113 m_ioProgressBase += 100;
1116void KisDoc::IODone()
1121void KisDoc::slotIOProgress(TQ_INT8 percentage)
1123 TDEApplication *app = TDEApplication::kApplication();
1127 if (app->hasPendingEvents())
1128 app->processEvents();
1130 int totalPercentage = ((m_ioProgressBase + percentage) * 100) / m_ioProgressTotalSteps;
1132 emitProgress(totalPercentage);
1135KisChildDoc * KisDoc::createChildDoc(
const TQRect & rect, KoDocument* childDoc )
1139 ch->document()->setStoreInternal(
true);
1143void KisDoc::prepareForImport()
1150KisImageSP KisDoc::currentImage()
1152 return m_currentImage;
1155void KisDoc::setCurrentImage(KisImageSP image)
1157 m_currentImage = image;
1159 image->notifyImageLoaded();
1160 emit loadingFinished();
1163void KisDoc::initEmpty()
1167 newImage(
"", cfg.defImgWidth(), cfg.defImgHeight(), rgb);
1170#include "kis_doc.moc"
Class that contains a KisFilter and optionally a KisSelection.
An data extension mechanism for Chalk.
The child document is responsible for saving and loading the embedded layers.
KisColorSpace * getRGB8()
Convenience method to get an RGB colorspace with the default lcms profile.
KisColorSpace * getColorSpace(const KisID &csID, const TQString &profileName)
Return the colorspace + profile as named, or NULL if impossible combination.
KisProfile * getProfileByName(const TQString &name)
Return the profile associated with the given product name, or 0.
A colorspace is the definition of a certain color model in Chalk.
virtual KisProfile * getProfile() const =0
Return the profile of this color space.
A KisColor describes a color in a certain colorspace.
Undo listeners want to be notified of undo and redo actions.
This painter can be used to fill paint devices in different ways.
void fillRect(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const KisColor &c)
Fill a rectangle with a certain color.
A KisFilterConfiguration is the serializable representation of the filter parameters.
Basic interface of a Chalk filter.
virtual KisFilterConfiguration * configuration(TQWidget *)
A KisLayer that bundles child layers into a single layer.
Chalk has a large number of extensible resources.
This layer is of a type that can be painted on.
KCommand * end()
Finish painting on the current device.
void begin(KisPaintDeviceSP device)
Start painting on the specified device.
A PartLayer is a layer that contains a KOffice Part like a KWord document or a KSpread spreadsheet.
virtual KisChildDoc * childDoc() const
Returns the childDoc so that we can access the doc from other places, if need be (KisDoc)