Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F621984
areadialog.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
areadialog.h
View Options
/*
* Copyright (C) 2012 Christian Kaiser
*
* 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, or (at your option) any later version.
*
* 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 library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
******
*
* Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann <lucag@student.ethz.ch>
* released under the GNU LGPL <http://www.gnu.org/licenses/old-licenses/library.txt>
*
*/
#ifndef AREADIALOG_H
#define AREADIALOG_H
#include
<QDialog>
#include
<QVector>
#include
<QPointer>
#include
<QTimer>
#include
<QRegion>
#include
<QRect>
#include
<QPoint>
class
QPaintEvent
;
class
QResizeEvent
;
class
QMouseEvent
;
class
Screenshot
;
class
AreaDialog
:
public
QDialog
{
Q_OBJECT
public
:
AreaDialog
(
Screenshot
*
screenshot
);
QRect
&
resultRect
();
protected
slots
:
void
animationTick
(
int
frame
);
void
cancel
();
void
displayHelp
();
void
grabRect
();
signals
:
void
regionGrabbed
(
const
QPixmap
&
);
protected
:
void
keyPressEvent
(
QKeyEvent
*
e
);
void
mouseDoubleClickEvent
(
QMouseEvent
*
);
void
mouseMoveEvent
(
QMouseEvent
*
e
);
void
mousePressEvent
(
QMouseEvent
*
e
);
void
mouseReleaseEvent
(
QMouseEvent
*
e
);
void
paintEvent
(
QPaintEvent
*
e
);
void
resizeEvent
(
QResizeEvent
*
e
);
void
showEvent
(
QShowEvent
*
e
);
void
updateHandles
();
QRegion
handleMask
()
const
;
QPoint
limitPointToRect
(
const
QPoint
&
p
,
const
QRect
&
r
)
const
;
bool
mAutoclose
;
QPoint
mDragStartPoint
;
bool
mGrabbing
;
const
int
mHandleSize
;
QTimer
mIdleTimer
;
bool
mMouseDown
;
bool
mMouseMagnifier
;
QRect
*
mMouseOverHandle
;
QPoint
mMousePos
;
bool
mNewSelection
;
int
mOverlayAlpha
;
Screenshot
*
mScreenshot
;
QRect
mSelection
;
QRect
mSelectionBeforeDrag
;
bool
mShowHelp
;
// naming convention for handles
// T top, B bottom, R Right, L left
// 2 letters: a corner
// 1 letter: the handle on the middle of the corresponding side
QRect
mTLHandle
,
mTRHandle
,
mBLHandle
,
mBRHandle
;
QRect
mLHandle
,
mTHandle
,
mRHandle
,
mBHandle
;
QVector
<
QRect
*>
mHandles
;
QPointer
<
QWidget
>
mAcceptWidget
;
};
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Nov 14, 7:41 PM (6 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
133681
Default Alt Text
areadialog.h (2 KB)
Attached To
Mode
R63 darkscreen
Attached
Detach File
Event Timeline