~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kcontrol/randr/randr.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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>
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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.
 
19
 */
 
20
 
 
21
#ifndef __RANDR_H__
 
22
#define __RANDR_H__
 
23
 
 
24
#include <KDebug>
 
25
#include <KLocale>
 
26
#include <QString>
 
27
#include <QPixmap>
 
28
#include <config-randr.h>
 
29
#include "ktimerdialog.h"
 
30
 
 
31
extern "C"
 
32
{
 
33
#include <X11/Xlib.h>
 
34
#define INT8 _X11INT8
 
35
#define INT32 _X11INT32
 
36
#include <X11/Xproto.h>
 
37
#undef INT8
 
38
#undef INT32
 
39
#include <X11/extensions/Xrandr.h>
 
40
}
 
41
 
 
42
#include <fixx11h.h>
 
43
 
 
44
#ifdef HAS_RANDR_1_2
 
45
class RandRScreen;
 
46
class RandRCrtc;
 
47
class RandROutput;
 
48
class RandRMode;
 
49
 
 
50
// maps
 
51
typedef QMap<RRCrtc,RandRCrtc*> CrtcMap;
 
52
typedef QMap<RROutput,RandROutput*> OutputMap;
 
53
typedef QMap<RRMode,RandRMode> ModeMap;
 
54
 
 
55
//lists
 
56
typedef QList<RandRScreen*> ScreenList;
 
57
typedef QList<RROutput> OutputList;
 
58
typedef QList<RRCrtc> CrtcList;
 
59
typedef QList<RRMode> ModeList;
 
60
#endif
 
61
 
 
62
typedef QList<float> RateList;
 
63
typedef QList<QSize> SizeList;
 
64
 
 
65
class LegacyRandRScreen;
 
66
typedef QList<LegacyRandRScreen*> LegacyScreenList;
 
67
 
 
68
class RandR
 
69
{
 
70
public:
 
71
        static bool has_1_2;
 
72
        static bool has_1_3;
 
73
        static Time timestamp;
 
74
        
 
75
        static const int OrientationCount = 6;
 
76
        static const int RotationCount    = 4;
 
77
        
 
78
        enum Orientations {
 
79
                Rotate0        = RR_Rotate_0,
 
80
                Rotate90       = RR_Rotate_90,
 
81
                Rotate180      = RR_Rotate_180,
 
82
                Rotate270      = RR_Rotate_270,
 
83
                RotateMask     = (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270),
 
84
                ReflectX       = RR_Reflect_X,
 
85
                ReflectY       = RR_Reflect_Y,
 
86
                ReflectMask    = (RR_Reflect_X | RR_Reflect_Y),
 
87
                OrientationMask = (RotateMask | ReflectMask)
 
88
        };
 
89
        
 
90
        enum Changes 
 
91
        {
 
92
                ChangeCrtc       = 0x01,
 
93
                ChangeOutputs    = 0x02,
 
94
                ChangeMode       = 0x04,
 
95
                ChangeRotation   = 0x08,
 
96
                ChangeConnection = 0x10,
 
97
                ChangeRect       = 0x20,
 
98
                ChangeRate       = 0x40
 
99
        };
 
100
 
 
101
        static QString rotationName(int rotation, bool pastTense = false, bool capitalised = true);
 
102
        static QPixmap rotationIcon(int rotation, int currentRotation);
 
103
 
 
104
        static bool confirm(const QRect &rect = QRect());
 
105
 
 
106
        static SizeList sortSizes(const SizeList &sizes);
 
107
};
 
108
 
 
109
#endif