From 016f7f2a57dbb776846a511e06e03b2e2572ab7c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 28 Jul 2011 23:59:21 +0200 Subject: First attemt on the selections tool in the new CanvasTool structure. --- dgedit/canvastoolselections.h | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'dgedit/canvastoolselections.h') 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 + +#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__*/ -- cgit v1.2.3