forked from atilacamurca/vokoscreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregionselection.h
125 lines (105 loc) · 3.21 KB
/
regionselection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/* vokoscreen - A desktop recorder
* Copyright (C) 2011-2012 Volker Kohaupt
*
* 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.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef regionselection_H
#define regionselection_H
#include <QPainter>
#include <QDebug>
#include <QRegion>
#include <QCursor>
#include <QX11Info>
#include <QPainterPath>
#include <QMouseEvent>
#include <QApplication>
#include <QDesktopWidget>
#include <QMainWindow>
#include <QDialog>
class regionselection : public QDialog
{
Q_OBJECT
public:
regionselection();
regionselection( QWidget *parent );
virtual ~regionselection();
void lockFrame( bool status = true );
bool isFrameLocked();
int borderLeft;
int borderTop;
int borderRight;
int borderBottom;
int frameWidth;
public slots:
int getX();
int getY();
int getHeight();
int getWidth();
void cleanRecordArea( bool state );
int getXRecordArea();
int getYRecordArea();
void saveSettings();
private slots:
void moveTopLeft ( QMouseEvent *event );
void moveTopMiddle ( QMouseEvent *event );
void moveTopRight ( QMouseEvent *event );
void moveRightMiddle ( QMouseEvent *event );
void moveBottomRight ( QMouseEvent *event );
void moveBottomMiddle( QMouseEvent *event );
void moveBottomLeft ( QMouseEvent *event );
void moveLeftMiddle ( QMouseEvent *event );
void moveMiddle ( QMouseEvent *event );
void HandleTopLeft();
void HandleTopMiddle();
void HandleTopRight();
void HandleRightMiddle();
void HandleBottomRight();
void HandleBottomMiddle();
void HandleBottomLeft();
void HandleLeftMiddle();
void HandleMiddle();
void printSize();
void setPrintSizeRectForMask( QRect rec );
QRect getPrintSizeRectForMask();
void setHandleMiddleForMask( QRect rec );
QRect getHandleMiddleForMask();
protected:
void mouseMoveEvent( QMouseEvent *event );
void mousePressEvent( QMouseEvent *event );
void mouseReleaseEvent ( QMouseEvent * event );
void paintEvent( QPaintEvent *event );
QPainter * painter;
void resizeEvent( QResizeEvent * event );
private:
enum Handle { NoHandle, TopLeft, TopMiddle, TopRight, RightMiddle, BottomRight, BottomMiddle, BottomLeft, LeftMiddle, Middle };
int radius;
int penWidth;
int penHalf;
bool frameLocked;
void handlingFrameLock();
int currentMouseLocalX;
int currentMouseLocalY;
int currentMouseRightLocalX;
int currentMouseRightLocalY;
int currentWidgetWidth;
int currentWidgetHeight;
int currentWidgetY;
int currentbottomY;
Handle handlePressed;
Handle handleUnderMouse;
QRect printSizeRectForMask;
QRect HandleMiddleForMask;
int Setting_Area_NoShowInTaskBar;
};
#endif