if(!normal_entry) {
if(newtext != LISTEN_FOR_INCOMING_CONNECTIONS_STRING) {
hosts.setCurrentIndex(-1);
- } else {
+ } else {
return;
}
}
//ask user if listen_port is correct
bool ok;
listen_port = QInputDialog::getInt(this,
- tr("Listen for Incoming Connections"),
- tr("Listen on Port:"),
- listen_port, 1, 65535, //value, min, max
- 1, &ok);
+ tr("Listen for Incoming Connections"),
+ tr("Listen on Port:"),
+ listen_port, 1, 65535, //value, min, max
+ 1, &ok);
if(ok) {
settings.setValue("listen_port", listen_port);
class QMaemo5ListPickSelector;
-class ConnectDialog : public QDialog {
- Q_OBJECT
+class ConnectDialog : public QDialog
+{
+ Q_OBJECT
public:
- ConnectDialog(QWidget *parent);
+ ConnectDialog(QWidget *parent);
public slots:
- virtual void accept();
+ virtual void accept();
signals:
- void connectToHost(QString url, int quality, int listen_port, bool view_only);
+ void connectToHost(QString url, int quality, int listen_port, bool view_only);
private slots:
- void hostnameUpdated(QString newtext);
+ void hostnameUpdated(QString newtext);
private:
- QStringList hostnames_sorted;
- QPushButton done;
- QComboBox hosts;
- QComboBox quality_combobox;
- QCheckBox viewonly;
+ QStringList hostnames_sorted;
+ QPushButton done;
+ QComboBox hosts;
+ QComboBox quality_combobox;
+ QCheckBox viewonly;
};
#endif
};
FullScreenExitButton::FullScreenExitButton(QWidget *parent)
- : QToolButton(parent)
+ : QToolButton(parent)
{
Q_ASSERT(parent);
case QEvent::MouseButtonRelease:
case QEvent::MouseMove:
case QEvent::HoverMove:
- //fall through to show button
+ //fall through to show button
case QEvent::WindowStateChange:
setVisible(isFullScreen);
if (isFullScreen)
#include <QtGui>
-class KeyMenu : public QDialog {
- Q_OBJECT
+class KeyMenu : public QDialog
+{
+ Q_OBJECT
public:
- KeyMenu(QWidget *parent);
- QKeySequence getKeySequence() { return keysequence; }
+ KeyMenu(QWidget *parent);
+ QKeySequence getKeySequence() { return keysequence; }
public slots:
- virtual void accept();
- virtual int exec() { keysequence = QKeySequence(); return QDialog::exec(); }
+ virtual void accept();
+ virtual int exec() { keysequence = QKeySequence(); return QDialog::exec(); }
private:
- QKeySequence keysequence;
+ QKeySequence keysequence;
};
-class ActionTab : public QScrollArea {
- Q_OBJECT
+class ActionTab : public QScrollArea
+{
+ Q_OBJECT
public:
- ActionTab(KeyMenu *parent);
- void addAction(QAction *action); //adds action and connects it to keymenu->accept()
- void addAction(QString text, QKeySequence keysequence);
+ ActionTab(KeyMenu *parent);
+ void addAction(QAction *action); //adds action and connects it to keymenu->accept()
+ void addAction(QString text, QKeySequence keysequence);
private:
- QWidget widget;
- QHBoxLayout layout;
- KeyMenu *keymenu;
+ QWidget widget;
+ QHBoxLayout layout;
+ KeyMenu *keymenu;
};
#endif
const QString APPNAME("Presence VNC");
-void printHelp() {
+void printHelp()
+{
std::cout << "Usage: " << qPrintable(QCoreApplication::arguments().at(0)) << " [options] [URL [quality]]\n"
- << "\nOptions:\n"
- << " --help\t\t\t Print this text and exit.\n"
- << " --listen [port]\t Listen for incoming connections on given port, or 5500 if omitted. Cannot be used with an URL.\n"
- << " --viewonly\t\t Don't send mouse/keyboard input to remote desktop. This is only useful if you also supply a URL, or --listen.\n"
+ << "\nOptions:\n"
+ << " --help\t\t\t Print this text and exit.\n"
+ << " --listen [port]\t Listen for incoming connections on given port, or 5500 if omitted. Cannot be used with an URL.\n"
+ << " --viewonly\t\t Don't send mouse/keyboard input to remote desktop. This is only useful if you also supply a URL, or --listen.\n"
- << "\nURLs:\n"
- << " vnc://:password@server:display\n\n"
- << " Password and display can be omitted, e.g. vnc://server is a valid URL.\n"
- << " Optionally, you can define the quality as a second argument (1-3, where 1 is the best). Default is 2.\n";
+ << "\nURLs:\n"
+ << " vnc://:password@server:display\n\n"
+ << " Password and display can be omitted, e.g. vnc://server is a valid URL.\n"
+ << " Optionally, you can define the quality as a second argument (1-3, where 1 is the best). Default is 2.\n";
}
int main(int argc, char *argv[])
this, SLOT(updateScreenSpaceDelayed()));
#ifdef Q_WS_MAEMO_5
QDBusConnection::systemBus().connect("", MCE_SIGNAL_PATH, MCE_SIGNAL_IF, MCE_DISPLAY_SIG,
- this, SLOT(displayStateChanged(QString)));
+ this, SLOT(displayStateChanged(QString)));
#endif
setCentralWidget(scroll_area);
return;
}
XChangeProperty(QX11Info::display(), winId(), atom, XA_INTEGER,
- 32, PropModeReplace, reinterpret_cast<unsigned char *>(&val), 1);
+ 32, PropModeReplace, reinterpret_cast<unsigned char *>(&val), 1);
#endif
}
-void MainWindow::closeEvent(QCloseEvent*) {
+void MainWindow::closeEvent(QCloseEvent*)
+{
grabZoomKeys(false);
QSettings settings;
disconnectFromHost();
}
-void MainWindow::about() {
+void MainWindow::about()
+{
QMessageBox::about(this, tr("About Presence VNC"),
- tr("<center><h1>Presence VNC 0.8</h1>\
+ tr("<center><h1>Presence VNC 0.8</h1>\
<p>A touchscreen friendly VNC client</p>\
<p><a href=\"http://presencevnc.garage.maemo.org/\">http://presencevnc.garage.maemo.org/</a></p></center>\
<small><p>©2010 Christian Pulvermacher <pulvermacher@gmx.de><br />\
static RemoteView::RemoteStatus old_status = RemoteView::Disconnected;
switch(status) {
- case RemoteView::Connecting:
+ case RemoteView::Connecting:
#ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
+ setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
#endif
- break;
- case RemoteView::Connected:
+ break;
+ case RemoteView::Connected:
#ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+ setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
#endif
- toolbar->setEnabled(true);
+ toolbar->setEnabled(true);
- //disable key input buttons in view only mode
- input_toolbuttons->setEnabled(!vnc_view->viewOnly());
+ //disable key input buttons in view only mode
+ input_toolbuttons->setEnabled(!vnc_view->viewOnly());
- vnc_view->setZoomLevel(zoom_slider->value());
- vnc_view->useFastTransformations(false);
- vnc_view->repaint();
- break;
- case RemoteView::Disconnecting:
- if(old_status == RemoteView::Disconnected) //Disconnecting also occurs while connecting, so check last state
- break;
-
- if(disconnect_action->isEnabled()) //don't show when manually disconnecting
- scroll_area->showMessage(tr("Connection lost"));
-
- //clean up
- scroll_area->setWidget(0);
- vnc_view = 0;
- setWindowTitle("Presence VNC");
- disconnect_action->setEnabled(false);
- toolbar->setEnabled(false);
-
- //exit fullscreen mode
- if(windowState() & Qt::WindowFullScreen)
- setWindowState(windowState() ^ Qt::WindowFullScreen);
+ vnc_view->setZoomLevel(zoom_slider->value());
+ vnc_view->useFastTransformations(false);
+ vnc_view->repaint();
+ break;
+ case RemoteView::Disconnecting:
+ if(old_status == RemoteView::Disconnected) //Disconnecting also occurs while connecting, so check last state
break;
- case RemoteView::Disconnected:
+
+ if(disconnect_action->isEnabled()) //don't show when manually disconnecting
+ scroll_area->showMessage(tr("Connection lost"));
+
+ //clean up
+ scroll_area->setWidget(0);
+ vnc_view = 0;
+ setWindowTitle("Presence VNC");
+ disconnect_action->setEnabled(false);
+ toolbar->setEnabled(false);
+
+ //exit fullscreen mode
+ if(windowState() & Qt::WindowFullScreen)
+ setWindowState(windowState() ^ Qt::WindowFullScreen);
+ break;
+ case RemoteView::Disconnected:
#ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+ setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
#endif
- if(old_status == RemoteView::Disconnecting) {
- scroll_area->setWidget(0); //remove widget
- }
- break;
- default: //avoid compiler warnings
- break;
+ if(old_status == RemoteView::Disconnecting) {
+ scroll_area->setWidget(0); //remove widget
+ }
+ break;
+ default: //avoid compiler warnings
+ break;
}
old_status = status;
menuBar()->setVisible(in_fullscreen);
#endif
- setWindowState(windowState() ^ Qt::WindowFullScreen);
+ setWindowState(windowState() ^ Qt::WindowFullScreen);
updateScreenSpaceDelayed();
}
center = center * (double(new_factor)/old_factor);
scroll_area->ensureVisible(center.x(), center.y(),
- vnc_view->visibleRegion().boundingRect().width()/2,
- vnc_view->visibleRegion().boundingRect().height()/2);
+ vnc_view->visibleRegion().boundingRect().width()/2,
+ vnc_view->visibleRegion().boundingRect().height()/2);
vnc_view->useFastTransformations(zoom_slider->isSliderDown());
vnc_view->update();
class ScrollArea;
class VncView;
-class MainWindow : public QMainWindow {
- Q_OBJECT
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
public:
- MainWindow(QString url, int quality, int listen_port, bool view_only);
+ MainWindow(QString url, int quality, int listen_port, bool view_only);
public slots:
- void about();
- void showConnectDialog();
- void connectToHost(QString url, int quality, int listen_port, bool view_only);
- void disconnectFromHost();
- void updateScreenSpace();
- void updateScreenSpaceDelayed();
- void sendTab();
- void sendEsc();
- void sendPgUp();
- void sendPgDn();
- void sendReturn();
- void setZoomLevel(int level);
- void showInputPanel();
- void showKeyMenu();
- void showPreferences();
- void statusChanged(RemoteView::RemoteStatus status);
- void toggleFullscreen();
- void zoomSliderReleased();
+ void about();
+ void showConnectDialog();
+ void connectToHost(QString url, int quality, int listen_port, bool view_only);
+ void disconnectFromHost();
+ void updateScreenSpace();
+ void updateScreenSpaceDelayed();
+ void sendTab();
+ void sendEsc();
+ void sendPgUp();
+ void sendPgDn();
+ void sendReturn();
+ void setZoomLevel(int level);
+ void showInputPanel();
+ void showKeyMenu();
+ void showPreferences();
+ void statusChanged(RemoteView::RemoteStatus status);
+ void toggleFullscreen();
+ void zoomSliderReleased();
void displayStateChanged(QString state);
protected:
- void closeEvent(QCloseEvent*);
- void resizeEvent(QResizeEvent *event);
+ void closeEvent(QCloseEvent*);
+ void resizeEvent(QResizeEvent *event);
private:
- void grabZoomKeys(bool grab);
- void reloadSettings();
+ void grabZoomKeys(bool grab);
+ void reloadSettings();
- VncView *vnc_view;
- ScrollArea *scroll_area;
- QToolBar *toolbar;
- QSlider *zoom_slider;
- QAction *scaling, *show_toolbar, *disconnect_action;
- QActionGroup *input_toolbuttons;
- KeyMenu *key_menu;
- bool zoom_to_cursor;
+ VncView *vnc_view;
+ ScrollArea *scroll_area;
+ QToolBar *toolbar;
+ QSlider *zoom_slider;
+ QAction *scaling, *show_toolbar, *disconnect_action;
+ QActionGroup *input_toolbuttons;
+ KeyMenu *key_menu;
+ bool zoom_to_cursor;
};
#endif
void migrateConfiguration(); //checks for old configuration and migrates them if necessary
-class Preferences : public QDialog {
- Q_OBJECT
+class Preferences : public QDialog
+{
+ Q_OBJECT
public:
- Preferences(QWidget *parent);
+ Preferences(QWidget *parent);
private slots:
- void save();
+ void save();
private:
- QSettings settings;
+ QSettings settings;
#ifdef Q_WS_MAEMO_5
- QMaemo5ListPickSelector *rotation_selector;
- QMaemo5ListPickSelector *leftzoom_selector;
- QMaemo5ListPickSelector *rightzoom_selector;
- QCheckBox *disable_tapping;
+ QMaemo5ListPickSelector *rotation_selector;
+ QMaemo5ListPickSelector *leftzoom_selector;
+ QMaemo5ListPickSelector *rightzoom_selector;
+ QCheckBox *disable_tapping;
#endif
- QCheckBox *always_show_local_cursor, *zoom_to_cursor;
+ QCheckBox *always_show_local_cursor, *zoom_to_cursor;
};
#endif
#include "remoteview.h"
#ifndef QTONLY
- #include <KDebug>
- #include <KStandardDirs>
+#include <KDebug>
+#include <KStandardDirs>
#endif
#include <QBitmap>
RemoteView::RemoteView(QWidget *parent)
- : QWidget(parent),
- m_status(Disconnected),
- m_host(QString()),
- m_port(0),
- m_viewOnly(false),
- m_grabAllKeys(false),
- m_scale(true),
- m_keyboardIsGrabbed(false),
+ : QWidget(parent),
+ m_status(Disconnected),
+ m_host(QString()),
+ m_port(0),
+ m_viewOnly(false),
+ m_grabAllKeys(false),
+ m_scale(true),
+ m_keyboardIsGrabbed(false),
#ifndef QTONLY
- m_wallet(0),
+ m_wallet(0),
#endif
- m_dotCursorState(CursorOff)
+ m_dotCursorState(CursorOff)
{
}
kDebug(5010) << "Wallet OK";
m_wallet->setFolder(KRDCFOLDER);
QString password;
-
+
QString key;
if (fromUserNameOnly)
key = m_url.userName();
QCursor RemoteView::localDotCursor() const
{
- //we take care of this in paintEvent()
- return QCursor(Qt::BlankCursor);
+ //we take care of this in paintEvent()
+ return QCursor(Qt::BlankCursor);
}
void RemoteView::focusInEvent(QFocusEvent *event)
#define REMOTEVIEW_H
#ifdef QTONLY
- #include <QUrl>
- #define KUrl QUrl
- #define KDE_EXPORT
+#include <QUrl>
+#define KUrl QUrl
+#define KDE_EXPORT
#else
- #include <KUrl>
- #include <KWallet/Wallet>
+#include <KUrl>
+#include <KWallet/Wallet>
#endif
#include <QWidget>
* @see statusChanged()
*/
virtual bool start() = 0;
-
+
/**
* Called when the configuration is changed.
* The default implementation does nothing.
*/
virtual void updateConfiguration();
-
+
#ifndef QTONLY
/**
* Returns the current host preferences of this view.
*/
virtual HostPreferences* hostPreferences() = 0;
#endif
-
+
/**
* Returns the current status of the connection.
* @return the status of the connection
* Emitted when the view has a specific error.
*/
void errorMessage(const QString &title, const QString &message);
-
+
/**
* Emitted when the status of the view changed.
* @param s the new status
#include <QTimer>
//fixes tearing during scrolling and can display messages
-class ScrollArea : public QScrollArea {
+class ScrollArea : public QScrollArea
+{
public:
- ScrollArea(QWidget *parent):
- QScrollArea(parent)
- {
- message.setParent(this);
- message.setVisible(false);
- message.setAlignment(Qt::AlignCenter);
- message.setWordWrap(true);
+ ScrollArea(QWidget *parent):
+ QScrollArea(parent) {
+ message.setParent(this);
+ message.setVisible(false);
+ message.setAlignment(Qt::AlignCenter);
+ message.setWordWrap(true);
- QPalette pal = message.palette();
- QColor backgroundColor = pal.color(backgroundRole());
- backgroundColor.setAlpha(128);
- pal.setColor(backgroundRole(), backgroundColor);
- message.setPalette(pal);
- message.setAutoFillBackground(true);
+ QPalette pal = message.palette();
+ QColor backgroundColor = pal.color(backgroundRole());
+ backgroundColor.setAlpha(128);
+ pal.setColor(backgroundRole(), backgroundColor);
+ message.setPalette(pal);
+ message.setAutoFillBackground(true);
- timer.setSingleShot(true);
- timer.setInterval(2500);
- connect(&timer, SIGNAL(timeout()),
- &message, SLOT(hide()));
- }
+ timer.setSingleShot(true);
+ timer.setInterval(2500);
+ connect(&timer, SIGNAL(timeout()),
+ &message, SLOT(hide()));
+ }
- void showMessage(const QString &s)
- {
- message.setText(s);
- message.show();
- timer.start();
- }
+ void showMessage(const QString &s) {
+ message.setText(s);
+ message.show();
+ timer.start();
+ }
protected:
- virtual void resizeEvent(QResizeEvent* ev)
- {
- QScrollArea::resizeEvent(ev);
- message.setFixedWidth(width());
- }
- virtual void scrollContentsBy(int dx, int dy)
- {
- QScrollArea::scrollContentsBy(dx, dy);
- if(widget())
- widget()->update(); //update whole widget
- }
+ virtual void resizeEvent(QResizeEvent* ev) {
+ QScrollArea::resizeEvent(ev);
+ message.setFixedWidth(width());
+ }
+ virtual void scrollContentsBy(int dx, int dy) {
+ QScrollArea::scrollContentsBy(dx, dy);
+ if(widget())
+ widget()->update(); //update whole widget
+ }
private:
- QLabel message;
- QTimer timer;
+ QLabel message;
+ QTimer timer;
};
#endif
cl->format.blueMax = 0xff;
switch (t->quality()) {
- case RemoteView::High:
- cl->appData.useBGR233 = 0;
- cl->appData.encodingsString = "copyrect hextile raw";
- cl->appData.compressLevel = 0;
- cl->appData.qualityLevel = 9;
- break;
- case RemoteView::Medium:
- cl->appData.useBGR233 = 0;
- cl->appData.encodingsString = "tight zrle ultra copyrect hextile zlib corre rre raw";
- cl->appData.compressLevel = 5;
- cl->appData.qualityLevel = 7;
- break;
- case RemoteView::Low:
- case RemoteView::Unknown:
- default:
- cl->appData.useBGR233 = 1;
- cl->appData.encodingsString = "tight zrle ultra copyrect hextile zlib corre rre raw";
- cl->appData.compressLevel = 9;
- cl->appData.qualityLevel = 1;
+ case RemoteView::High:
+ cl->appData.useBGR233 = 0;
+ cl->appData.encodingsString = "copyrect hextile raw";
+ cl->appData.compressLevel = 0;
+ cl->appData.qualityLevel = 9;
+ break;
+ case RemoteView::Medium:
+ cl->appData.useBGR233 = 0;
+ cl->appData.encodingsString = "tight zrle ultra copyrect hextile zlib corre rre raw";
+ cl->appData.compressLevel = 5;
+ cl->appData.qualityLevel = 7;
+ break;
+ case RemoteView::Low:
+ case RemoteView::Unknown:
+ default:
+ cl->appData.useBGR233 = 1;
+ cl->appData.encodingsString = "tight zrle ultra copyrect hextile zlib corre rre raw";
+ cl->appData.compressLevel = 9;
+ cl->appData.qualityLevel = 1;
}
SetFormatAndEncodings(cl);
outputErrorMessageString = "INTERNAL:APPLE_VNC_COMPATIBILTY";
}
- VncClientThread::VncClientThread(QObject *parent)
+VncClientThread::VncClientThread(QObject *parent)
: QThread(parent)
- , frameBuffer(0)
+ , frameBuffer(0)
{
QMutexLocker locker(&mutex);
m_stopped = false;
#define VNCCLIENTTHREAD_H
#ifdef QTONLY
- #include <QDebug>
- #define kDebug(n) qDebug()
- #define kBacktrace() ""
- #define i18n tr
+#include <QDebug>
+#define kDebug(n) qDebug()
+#define kBacktrace() ""
+#define i18n tr
#else
- #include <KDebug>
- #include <KLocale>
+#include <KDebug>
+#include <KLocale>
#endif
#include "remoteview.h"
{
public:
KeyClientEvent(int key, int pressed)
- : m_key(key), m_pressed(pressed) {}
+ : m_key(key), m_pressed(pressed) {}
void fire(rfbClient*);
{
public:
PointerClientEvent(int x, int y, int buttonMask)
- : m_x(x), m_y(y), m_buttonMask(buttonMask) {}
+ : m_x(x), m_y(y), m_buttonMask(buttonMask) {}
void fire(rfbClient*);
{
public:
ClientCutEvent(const QString &text)
- : text(text) {}
+ : text(text) {}
void fire(rfbClient*);
VncView::VncView(QWidget *parent, const KUrl &url, RemoteView::Quality quality, int listen_port)
- : RemoteView(parent),
- m_initDone(false),
- m_buttonMask(0),
- cursor_x(0),
- cursor_y(0),
- m_quitFlag(false),
- m_firstPasswordTry(true),
- m_dontSendClipboard(false),
- m_horizontalFactor(1.0),
- m_verticalFactor(1.0),
- m_forceLocalCursor(false),
- quality(quality),
- listen_port(listen_port),
- transformation_mode(Qt::FastTransformation),
- display_off(false)
+ : RemoteView(parent),
+ m_initDone(false),
+ m_buttonMask(0),
+ cursor_x(0),
+ cursor_y(0),
+ m_quitFlag(false),
+ m_firstPasswordTry(true),
+ m_dontSendClipboard(false),
+ m_horizontalFactor(1.0),
+ m_verticalFactor(1.0),
+ m_forceLocalCursor(false),
+ quality(quality),
+ listen_port(listen_port),
+ transformation_mode(Qt::FastTransformation),
+ display_off(false)
{
m_url = url;
m_host = url.host();
event->ignore();
return true;
- }
+ }
}
return RemoteView::eventFilter(obj, event);
m_quitFlag = true;
- vncThread.stop();
+ vncThread.stop();
const bool quitSuccess = vncThread.wait(700);
if(!quitSuccess) {
{
vncThread.setHost(m_host);
vncThread.setPort(m_port);
- vncThread.setListenPort(listen_port); //if port is != 0, thread will listen for connections
+ vncThread.setListenPort(listen_port); //if port is != 0, thread will listen for connections
vncThread.setQuality(quality);
// set local cursor on by default because low quality mostly means slow internet connection
return;
}
- //kDebug(5011) << "got update" << width() << height();
+ //kDebug(5011) << "got update" << width() << height();
m_x = x;
m_y = y;
setFocusPolicy(Qt::WheelFocus);
setStatus(Connected);
emit connected();
-
+
resize(width(), height());
-
+
m_initDone = true;
}
- static QSize old_frame_size = QSize();
+ static QSize old_frame_size = QSize();
if ((y == 0 && x == 0) && (m_frame.size() != old_frame_size)) {
- old_frame_size = m_frame.size();
+ old_frame_size = m_frame.size();
kDebug(5011) << "Updating framebuffer size";
setZoomLevel();
useFastTransformations(false);
m_dontSendClipboard = viewOnly;
if (viewOnly) {
- showDotCursor(CursorOff);
+ showDotCursor(CursorOff);
setCursor(Qt::ArrowCursor);
} else {
setCursor(m_dotCursorState == CursorOn ? localDotCursor() : Qt::BlankCursor);
- }
+ }
}
void VncView::showDotCursor(DotCursorState state)
const int sw = qRound(update_rect.width()/m_horizontalFactor);
const int sh = qRound(update_rect.height()/m_verticalFactor);
- painter.drawImage(update_rect,
- m_frame.copy(sx, sy, sw, sh)
- .scaled(update_rect.size(), Qt::IgnoreAspectRatio, transformation_mode));
+ painter.drawImage(update_rect,
+ m_frame.copy(sx, sy, sw, sh)
+ .scaled(update_rect.size(), Qt::IgnoreAspectRatio, transformation_mode));
} else {
//kDebug(5011) << "Full repaint" << width() << height() << m_frame.width() << m_frame.height();
painter.drawImage(rect(),
- m_frame.scaled(size(), Qt::IgnoreAspectRatio, transformation_mode));
+ m_frame.scaled(size(), Qt::IgnoreAspectRatio, transformation_mode));
}
//draw local cursor ourselves, normal mouse pointer doesn't deal with scrolling
//and refresh new one
repaint(cursor_x*m_horizontalFactor - CURSOR_SIZE/2, cursor_y*m_verticalFactor - CURSOR_SIZE/2, CURSOR_SIZE, CURSOR_SIZE);
- old_cursor_x = cursor_x; old_cursor_y = cursor_y;
+ old_cursor_x = cursor_x;
+ old_cursor_y = cursor_y;
}
}
//don't send ISO_Level3_Shift (would break things like Win+0-9)
//also enable IM so symbol key works
if(k == 0xfe03) {
- setAttribute(Qt::WA_InputMethodEnabled, pressed);
- e->ignore();
- return;
+ setAttribute(Qt::WA_InputMethodEnabled, pressed);
+ e->ignore();
+ return;
}
#endif
#include "remoteview.h"
#include "vncclientthread.h"
-class KConfigGroup{};
+class KConfigGroup {};
#include <QClipboard>
bool start();
bool supportsScaling() const;
bool supportsLocalCursor() const;
-
+
void setQuality(int q);
void setViewOnly(bool viewOnly);
void showDotCursor(DotCursorState state);
void useFastTransformations(bool enabled);
QPoint cursorPosition() { return QPoint(cursor_x, cursor_y); }
void setDisplayOff(bool off) { display_off = off; }
-
+
public slots:
void setZoomLevel(int level = -1); //'level' doesn't correspond to actual magnification, though mapping is done here
void sendKey(Qt::Key key);
void keyEventHandler(QKeyEvent *e);
void unpressModifiers();
void wheelEventHandler(QWheelEvent *event);
-
+
private slots:
void mouseEventHandler(QMouseEvent *event = 0);