source: trunk/tools/qvfb/qvfbx11view.h@ 452

Last change on this file since 452 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 3.7 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 1992-2006 TROLLTECH ASA. All rights reserved.
4**
5** This file is part of the Phone Edition of the Qt Toolkit.
6**
7** $QT_BEGIN_LICENSE:LGPL$
8** Commercial Usage
9** Licensees holding valid Qt Commercial licenses may use this file in
10** accordance with the Qt Commercial License Agreement provided with the
11** Software or, alternatively, in accordance with the terms contained in
12** a written agreement between you and Nokia.
13**
14** GNU Lesser General Public License Usage
15** Alternatively, this file may be used under the terms of the GNU Lesser
16** General Public License version 2.1 as published by the Free Software
17** Foundation and appearing in the file LICENSE.LGPL included in the
18** packaging of this file. Please review the following information to
19** ensure the GNU Lesser General Public License version 2.1 requirements
20** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
21**
22** In addition, as a special exception, Nokia gives you certain
23** additional rights. These rights are described in the Nokia Qt LGPL
24** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
25** package.
26**
27** GNU General Public License Usage
28** Alternatively, this file may be used under the terms of the GNU
29** General Public License version 3.0 as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL included in the
31** packaging of this file. Please review the following information to
32** ensure the GNU General Public License version 3.0 requirements will be
33** met: http://www.gnu.org/copyleft/gpl.html.
34**
35** If you are unsure which license is appropriate for your use, please
36** contact the sales department at [email protected].
37** $QT_END_LICENSE$
38**
39****************************************************************************/
40
41#ifndef QVFBX11VIEW_H
42#define QVFBX11VIEW_H
43
44#include "qvfbview.h"
45
46QT_BEGIN_NAMESPACE
47
48class X11KeyFaker;
49class QProcess;
50class QTemporaryFile;
51
52class QVFbX11View : public QVFbAbstractView
53{
54 Q_OBJECT
55public:
56 QVFbX11View( int id, int w, int h, int d, Rotation r, QWidget *parent = 0);
57 virtual ~QVFbX11View();
58
59 QString xServerPath() const { return xserver; }
60 void setXServerPath(const QString& path) { xserver = path; }
61
62 int displayId() const;
63 int displayWidth() const;
64 int displayHeight() const;
65 int displayDepth() const;
66 Rotation displayRotation() const;
67
68 void skinKeyPressEvent( int code, const QString& text, bool autorep=FALSE );
69 void skinKeyReleaseEvent( int code, const QString& text, bool autorep=FALSE );
70
71 void setGamma(double gr, double gg, double gb);
72 double gammaRed() const;
73 double gammaGreen() const;
74 double gammaBlue() const;
75 void getGamma(int i, QRgb& rgb);
76
77 bool touchScreenEmulation() const;
78 bool lcdScreenEmulation() const;
79 int rate();
80 bool animating() const;
81 QImage image() const;
82 void setRate(int);
83
84 double zoomH() const;
85 double zoomV() const;
86
87 QSize sizeHint() const;
88
89public slots:
90 void setTouchscreenEmulation( bool );
91 void setLcdScreenEmulation( bool );
92 void setZoom( double, double );
93 void setRotation(Rotation);
94 void startAnimation( const QString& );
95 void stopAnimation();
96
97protected:
98 void showEvent(QShowEvent *);
99 void keyPressEvent(QKeyEvent *);
100 void keyReleaseEvent(QKeyEvent *);
101
102private slots:
103 void startXnest();
104 void xnestStopped();
105 void startKeyFaker();
106
107private:
108 int id, w, h, d;
109 Rotation rotation;
110 double gr, gg, gb;
111 bool touchscreen, lcd;
112 X11KeyFaker *keyFaker;
113 QProcess *xnest;
114 QTemporaryFile *serverAuthFile;
115 bool shutdown;
116 QString xserver;
117};
118
119QT_END_NAMESPACE
120
121#endif
Note: See TracBrowser for help on using the repository browser.