summaryrefslogtreecommitdiff
path: root/dgedit/canvastoolselections.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-07-28 23:59:21 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2011-07-29 00:00:24 +0200
commit016f7f2a57dbb776846a511e06e03b2e2572ab7c (patch)
tree1b04cce78d92ffcf540063f6dd54c8270b298cf8 /dgedit/canvastoolselections.h
parent11ae33c3b0a0cbad772b23eb7d0714eef8ab9b03 (diff)
First attemt on the selections tool in the new CanvasTool structure.
Diffstat (limited to 'dgedit/canvastoolselections.h')
-rw-r--r--dgedit/canvastoolselections.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/dgedit/canvastoolselections.h b/dgedit/canvastoolselections.h
index 730f99d..a8b37a3 100644
--- a/dgedit/canvastoolselections.h
+++ b/dgedit/canvastoolselections.h
@@ -26,4 +26,51 @@
*/
#ifndef __DRUMGIZMO_CANVASTOOLSELECTIONS_H__
#define __DRUMGIZMO_CANVASTOOLSELECTIONS_H__
+
+#include "canvastool.h"
+
+#include <QColor>
+
+#include "canvas.h"
+
+#include "selection.h"
+
+class CanvasToolSelections : public CanvasTool {
+Q_OBJECT
+public:
+ CanvasToolSelections(Canvas *canvas);
+
+ bool mouseMoveEvent(QMouseEvent *event);
+ bool mousePressEvent(QMouseEvent *event);
+ bool mouseReleaseEvent(QMouseEvent *event);
+ void paintEvent(QPaintEvent *event, QPainter &painter);
+ void keyReleaseEvent(QKeyEvent *event);
+
+ Selections selections();
+
+signals:
+ void selectionsChanged(Selections selections);
+ void activeSelectionChanged(Selection selection);
+
+public slots:
+ void autoCreateSelections();
+ void clearSelections();
+
+private:
+ bool selection_is_moving_left;
+ bool selection_is_moving_right;
+ Selection *active_selection;
+ Selections _selections;
+
+ Canvas *canvas;
+
+ float *data;
+ size_t size;
+
+ QColor colSelBg;
+ QColor colSel;
+ QColor colActiveSelBg;
+ QColor colActiveSel;
+};
+
#endif/*__DRUMGIZMO_CANVASTOOLSELECTIONS_H__*/