2 * Copyright (c) 2007,2008 Harry Bock <hbock@providence.edu>
3 * Copyright (c) 2007 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
4 * Copyright (c) 2002,2003 Hamish Rodda <rodda@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include <config-randr.h>
29 #include "ktimerdialog.h"
35 #define INT32 _X11INT32
36 #include <X11/Xproto.h>
39 #include <X11/extensions/Xrandr.h>
49 typedef QMap
<RRCrtc
,RandRCrtc
*> CrtcMap
;
50 typedef QMap
<RROutput
,RandROutput
*> OutputMap
;
51 typedef QMap
<RRMode
,RandRMode
> ModeMap
;
54 typedef QList
<RandRScreen
*> ScreenList
;
55 typedef QList
<RROutput
> OutputList
;
56 typedef QList
<RRCrtc
> CrtcList
;
57 typedef QList
<RRMode
> ModeList
;
60 typedef QList
<float> RateList
;
61 typedef QList
<QSize
> SizeList
;
63 class LegacyRandRScreen
;
64 typedef QList
<LegacyRandRScreen
*> LegacyScreenList
;
70 static Time timestamp
;
72 static const int OrientationCount
= 6;
73 static const int RotationCount
= 4;
76 Rotate0
= RR_Rotate_0
,
77 Rotate90
= RR_Rotate_90
,
78 Rotate180
= RR_Rotate_180
,
79 Rotate270
= RR_Rotate_270
,
80 RotateMask
= (RR_Rotate_0
| RR_Rotate_90
| RR_Rotate_180
| RR_Rotate_270
),
81 ReflectX
= RR_Reflect_X
,
82 ReflectY
= RR_Reflect_Y
,
83 ReflectMask
= (RR_Reflect_X
| RR_Reflect_Y
),
84 OrientationMask
= (RotateMask
| ReflectMask
)
92 ChangeRotation
= 0x08,
93 ChangeConnection
= 0x10,
98 static QString
rotationName(int rotation
, bool pastTense
= false, bool capitalised
= true);
99 static QPixmap
rotationIcon(int rotation
, int currentRotation
);
101 static bool confirm(const QRect
&rect
= QRect());
103 static SizeList
sortSizes(const SizeList
&sizes
);