summaryrefslogtreecommitdiffstats
path: root/chalk/ui/kis_layerbox.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-26 00:41:16 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-26 00:41:16 +0000
commit698569f8428ca088f764d704034a1330517b98c0 (patch)
treebf45be6946ebbbee9cce5a5bcf838f4c952d87e6 /chalk/ui/kis_layerbox.h
parent2785103a6bd4de55bd26d79e34d0fdd4b329a73a (diff)
downloadkoffice-698569f8428ca088f764d704034a1330517b98c0.tar.gz
koffice-698569f8428ca088f764d704034a1330517b98c0.zip
Finish rebranding of Krita as Chalk
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238363 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'chalk/ui/kis_layerbox.h')
-rw-r--r--chalk/ui/kis_layerbox.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/chalk/ui/kis_layerbox.h b/chalk/ui/kis_layerbox.h
new file mode 100644
index 000000000..c9d14a881
--- /dev/null
+++ b/chalk/ui/kis_layerbox.h
@@ -0,0 +1,124 @@
+/*
+ * kis_layerbox.h - part of Chalk aka Krayon aka KimageShop
+ *
+ * Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
+ * Copyright (C) 2006 Gábor Lehel <illissius@gmail.com>
+ *
+ * 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_LAYERBOX_H
+#define KIS_LAYERBOX_H
+
+#include <tqframe.h>
+#include <kdebug.h>
+#include <tqtimer.h>
+
+#include "kis_types.h"
+#include "kis_colorspace.h"
+
+class WdgLayerBox;
+class TQButton;
+class TQPainter;
+class TQWidget;
+class KIconLoader;
+class KPopupMenu;
+class KoDocumentEntry;
+class KisCompositeOp;
+class KisLayerList;
+class LayerItem;
+class KisCanvasSubject;
+
+class KisLayerBox : public TQFrame {
+ typedef TQFrame super;
+ Q_OBJECT
+ TQ_OBJECT
+
+public:
+ KisLayerBox(KisCanvasSubject *subject, TQWidget *tqparent = 0, const char *name = 0);
+ virtual ~KisLayerBox();
+
+ void clear();
+ void setUpdatesAndSignalsEnabled(bool enable);
+ void setImage(KisImageSP image);
+
+public slots:
+ // connect to KisImage signals
+ void slotLayerActivated(KisLayerSP layer);
+ void slotLayerAdded(KisLayerSP layer);
+ void slotLayerRemoved(KisLayerSP layer, KisGroupLayerSP wasParent, KisLayerSP wasAboveThis);
+ void slotLayerMoved(KisLayerSP layer, KisGroupLayerSP wasParent, KisLayerSP wasAboveThis);
+ void slotLayerPropertiesChanged(KisLayerSP layer);
+ void slotLayersChanged(KisGroupLayerSP rootLayer);
+ void slotLayerUpdated(KisLayerSP layer, TQRect rc);
+
+ void slotSetCompositeOp(const KisCompositeOp& compositeOp);
+ void slotSetOpacity(int opacity);
+ void slotSetColorSpace(const KisColorSpace * colorSpace);
+
+signals:
+ void sigRequestLayer(KisGroupLayerSP tqparent, KisLayerSP above);
+ void sigRequestGroupLayer(KisGroupLayerSP tqparent, KisLayerSP above);
+ void sigRequestAdjustmentLayer(KisGroupLayerSP tqparent, KisLayerSP above);
+ void sigRequestPartLayer(KisGroupLayerSP tqparent, KisLayerSP above, const KoDocumentEntry& entry);
+ void sigRequestLayerProperties(KisLayerSP layer);
+
+ void sigOpacityChanged(int opacity, bool withSlider);
+ void sigOpacityFinishedChanging(int previous, int opacity);
+ void sigItemComposite(const KisCompositeOp&);
+
+private:
+ enum LayerTypes { PAINT_LAYER, GROUP_LAYER, ADJUSTMENT_LAYER, OBJECT_LAYER };
+
+private slots:
+ // connect to LayerList signals
+ void slotLayerActivated(LayerItem* layer);
+ void slotLayerDisplayNameChanged(LayerItem* layer, const TQString& displayName);
+ void slotLayerPropertyChanged(LayerItem* layer, const TQString& name, bool on);
+ void slotLayerMoved(LayerItem* layer, LayerItem* tqparent, LayerItem* after);
+ void slotRequestNewLayer(LayerItem* tqparent, LayerItem* after);
+ void slotRequestNewFolder(LayerItem* tqparent, LayerItem* after);
+ void slotRequestNewAdjustmentLayer(LayerItem* tqparent, LayerItem* after);
+ void slotRequestNewObjectLayer(LayerItem* tqparent, LayerItem* item, const KoDocumentEntry& entry);
+ void slotRequestRemoveLayer(LayerItem* layer);
+ void slotRequestLayerProperties(LayerItem* layer);
+
+ void slotAboutToShow();
+ void slotAddMenuActivated(int type = OBJECT_LAYER);
+ void slotRmClicked();
+ void slotRaiseClicked();
+ void slotLowerClicked();
+ void slotPropertiesClicked();
+
+ void updateThumbnails();
+
+private:
+ void updateUI();
+ TQPixmap loadPixmap(const TQString& filename, const KIconLoader& il, int size);
+ KisLayerList* list() const;
+ void markModified(KisLayer *layer);
+
+ KPopupMenu *m_newLayerMenu;
+ KoPartSelectAction *m_partLayerAction;
+ KisImageSP m_image;
+ TQValueList<int> m_modified;
+ WdgLayerBox *m_lst;
+
+ void printChalkLayers() const;
+ void printLayerboxLayers() const;
+};
+
+#endif // KIS_LAYERBOX_H
+