2 * Copyright (C) 2007 Luca Gugelmann <lucag@student.ethz.ch>
3 * Adapted for Kdenlive by Jean-Baptiste Mardelle (2008) jb@kdenlive.org
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Library General Public License version 2 as
7 * published by the Free Software Foundation
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef REGIONGRABBER_H
21 #define REGIONGRABBER_H
34 class RegionGrabber : public QWidget {
45 void regionGrabbed(const QRect &);
48 void paintEvent(QPaintEvent* e);
49 void resizeEvent(QResizeEvent* e);
50 void mousePressEvent(QMouseEvent* e);
51 void mouseMoveEvent(QMouseEvent* e);
52 void mouseReleaseEvent(QMouseEvent* e);
53 void mouseDoubleClickEvent(QMouseEvent*);
54 void keyPressEvent(QKeyEvent* e);
56 QRegion handleMask() const;
57 QPoint limitPointToRect(const QPoint &p, const QRect &r) const;
64 QRect* mouseOverHandle;
65 QPoint dragStartPoint;
66 QRect selectionBeforeDrag;
71 // naming convention for handles
72 // T top, B bottom, R Right, L left
73 // 2 letters: a corner
74 // 1 letter: the handle on the middle of the corresponding side
75 QRect TLHandle, TRHandle, BLHandle, BRHandle;
76 QRect LHandle, THandle, RHandle, BHandle;
78 QVector<QRect*> handles;