1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 or version 3 as published by the Free
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22 ** following information to ensure the GNU Lesser General Public License
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** As a special exception, The Qt Company gives you certain additional
27 ** rights. These rights are described in The Qt Company LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** GNU General Public License Usage
31 ** Alternatively, this file may be used under the terms of the GNU
32 ** General Public License version 3.0 as published by the Free Software
33 ** Foundation and appearing in the file LICENSE.GPL included in the
34 ** packaging of this file.  Please review the following information to
35 ** ensure the GNU General Public License version 3.0 requirements will be
36 ** met: http://www.gnu.org/copyleft/gpl.html.
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QPROXYSCREEN_QWS_H
43 #define QPROXYSCREEN_QWS_H
44 
45 #include <QtGui/qscreen_qws.h>
46 
47 #ifndef QT_NO_QWS_PROXYSCREEN
48 
49 QT_BEGIN_HEADER
50 
51 QT_BEGIN_NAMESPACE
52 
53 QT_MODULE(Gui)
54 
55 class QProxyScreenPrivate;
56 
57 #ifndef QT_NO_QWS_CURSOR
58 
59 class QProxyScreenCursorPrivate;
60 
61 class Q_GUI_EXPORT QProxyScreenCursor : public QScreenCursor
62 {
63 public:
64     QProxyScreenCursor();
65     ~QProxyScreenCursor();
66 
67     void setScreenCursor(QScreenCursor *cursor);
68     QScreenCursor* screenCursor() const;
69 
70     void set(const QImage &image, int hotx, int hoty);
71     void move(int x, int y);
72     void show();
73     void hide();
74 
75 private:
76     void configure();
77 
78     QScreenCursor *realCursor;
79     QProxyScreenCursorPrivate *d_ptr;
80 };
81 
82 #endif // QT_NO_QWS_CURSOR
83 
84 class Q_GUI_EXPORT QProxyScreen : public QScreen
85 {
86 public:
87     QProxyScreen(int display_id, ClassId = ProxyClass);
88     ~QProxyScreen();
89 
90     void setScreen(QScreen *screen);
91     QScreen *screen() const;
92 
93     QSize mapToDevice(const QSize &s) const;
94     QSize mapFromDevice(const QSize &s) const;
95 
96     QPoint mapToDevice(const QPoint &, const QSize &) const;
97     QPoint mapFromDevice(const QPoint &, const QSize &) const;
98 
99     QRect mapToDevice(const QRect &, const QSize &) const;
100     QRect mapFromDevice(const QRect &, const QSize &) const;
101 
102     QRegion mapToDevice(const QRegion &, const QSize &) const;
103     QRegion mapFromDevice(const QRegion &, const QSize &) const;
104 
105     bool connect(const QString &displaySpec);
106     bool initDevice();
107     void shutdownDevice();
108     void disconnect();
109 
110     void setMode(int width, int height, int depth);
111     bool supportsDepth(int) const;
112 
113     void save();
114     void restore();
115     void blank(bool on);
116 
117     bool onCard(const unsigned char *) const;
118     bool onCard(const unsigned char *, ulong& out_offset) const;
119 
120     bool isInterlaced() const;
121     bool isTransformed() const;
122     int transformOrientation() const;
123 
124     int memoryNeeded(const QString&);
125     int sharedRamSize(void *);
126 
127     void haltUpdates();
128     void resumeUpdates();
129 
130     void exposeRegion(QRegion r, int changing);
131     void blit(const QImage &img, const QPoint &topLeft, const QRegion &region);
132     void solidFill(const QColor &color, const QRegion &region);
133     void setDirty(const QRect&);
134 
135     QWSWindowSurface* createSurface(QWidget *widget) const;
136     QWSWindowSurface* createSurface(const QString &key) const;
137 
138     QList<QScreen*> subScreens() const;
139     QRegion region() const;
140 
141 private:
142     void configure();
143 
144     QScreen *realScreen;
145     QProxyScreenPrivate *d_ptr;
146 };
147 
148 QT_END_NAMESPACE
149 
150 QT_END_HEADER
151 
152 #endif // QT_NO_QWS_PROXYSCREEN
153 #endif // QPROXYSCREEN_QWS_H
154