]> git.sesse.net Git - kdenlive/blob - src/regiongrabber.h
Comment out names of unused parameters [PATCH by Ray Lehtiniemi]
[kdenlive] / src / regiongrabber.h
1 /*
2  *   Copyright (C) 2007 Luca Gugelmann <lucag@student.ethz.ch>
3  *   Adapted for Kdenlive by Jean-Baptiste Mardelle (2008) jb@kdenlive.org
4  *
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
8  *
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
13  *
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.
18  */
19
20 #ifndef REGIONGRABBER_H
21 #define REGIONGRABBER_H
22
23 #include <QWidget>
24 #include <QRegion>
25 #include <QPoint>
26 #include <QVector>
27 #include <QRect>
28 #include <QTimer>
29
30 class QPaintEvent;
31 class QResizeEvent;
32 class QMouseEvent;
33
34 class RegionGrabber : public QWidget {
35     Q_OBJECT
36 public:
37     RegionGrabber();
38     ~RegionGrabber();
39
40 protected slots:
41     void init();
42     void displayHelp();
43
44 signals:
45     void regionGrabbed(const QRect &);
46
47 protected:
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);
55     void updateHandles();
56     QRegion handleMask() const;
57     QPoint limitPointToRect(const QPoint &p, const QRect &r) const;
58     void grabRect();
59
60     QRect selection;
61     bool mouseDown;
62     bool newSelection;
63     const int handleSize;
64     QRect* mouseOverHandle;
65     QPoint dragStartPoint;
66     QRect  selectionBeforeDrag;
67     QTimer idleTimer;
68     bool showHelp;
69     bool grabbing;
70
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;
77
78     QVector<QRect*> handles;
79     QPixmap pixmap;
80 };
81
82 #endif