Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


APIC bug fixes and cleanup
[palacios.git] / linux_usr / gui / palacios / vnc_module / vncview.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2007-2012 Urs Wolfer <uwolfer @ kde.org>
4 **
5 ** This file is part of KDE.
6 **
7 ** This program is free software; you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License as published by
9 ** the Free Software Foundation; either version 2 of the License, or
10 ** (at your option) any later version.
11 **
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ** GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; see the file COPYING. If not, write to
19 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 ** Boston, MA 02110-1301, USA.
21 **
22 ****************************************************************************/
23
24 #ifndef VNCVIEW_H
25 #define VNCVIEW_H
26
27 #include "remoteview.h"
28 #include "vncclientthread.h"
29
30 #ifdef QTONLY
31     class KConfigGroup{};
32 #else
33     #include "vnchostpreferences.h"
34 #endif
35
36 #include <QClipboard>
37
38 extern "C" {
39 #include <rfb/rfbclient.h>
40 }
41
42 class VncView: public RemoteView
43 {
44     Q_OBJECT
45
46 public:
47     explicit VncView(QWidget *parent = 0, const KUrl &url = KUrl(), KConfigGroup configGroup = KConfigGroup());
48     ~VncView();
49
50     QSize framebufferSize();
51     QSize sizeHint() const;
52     QSize minimumSizeHint() const;
53     void startQuitting();
54     bool isQuitting();
55     bool start();
56     bool supportsScaling() const;
57     bool supportsLocalCursor() const;
58     
59 #ifndef QTONLY
60     HostPreferences* hostPreferences();
61 #endif
62
63     void setViewOnly(bool viewOnly);
64     void showDotCursor(DotCursorState state);
65     void enableScaling(bool scale);
66     
67     virtual void updateConfiguration();
68
69 public slots:
70     void scaleResize(int w, int h);
71
72 protected:
73     void paintEvent(QPaintEvent *event);
74     bool event(QEvent *event);
75     void resizeEvent(QResizeEvent *event);
76     bool eventFilter(QObject *obj, QEvent *event);
77
78 private:
79     VncClientThread vncThread;
80     QClipboard *m_clipboard;
81     bool m_initDone;
82     int m_buttonMask;
83     QMap<unsigned int, bool> m_mods;
84     int m_x, m_y, m_w, m_h;
85     bool m_repaint;
86     bool m_quitFlag;
87     bool m_firstPasswordTry;
88     bool m_dontSendClipboard;
89     qreal m_horizontalFactor;
90     qreal m_verticalFactor;
91 #ifndef QTONLY
92     VncHostPreferences *m_hostPreferences;
93 #endif
94     QImage m_frame;
95     bool m_forceLocalCursor;
96
97     void keyEventHandler(QKeyEvent *e);
98     void unpressModifiers();
99     void wheelEventHandler(QWheelEvent *event);
100     void mouseEventHandler(QMouseEvent *event);
101     
102 private slots:
103     void updateImage(int x, int y, int w, int h);
104     void setCut(const QString &text);
105     void requestPassword();
106     void outputErrorMessage(const QString &message);
107     void clipboardDataChanged();
108 };
109
110 #endif