#include "vncwindow.h"
|
void | open (const QString &host, int port, const QString &passwd, bool ro, bool fullscreen, const QString &caption, const int clientId, const QByteArray &rawThumb) |
| Show the VNC client window and connect to the given VNC server. More...
|
|
|
void | running (const bool isRunning, const int clientId) |
|
|
void | paintEvent (QPaintEvent *event) |
| Called by Qt when a part of the window should be redrawn. More...
|
|
void | resizeEvent (QResizeEvent *) |
|
void | closeEvent (QCloseEvent *e) |
| Called by Qt if the window is requested to be closed. More...
|
|
void | timerEvent (QTimerEvent *event) |
| Called when a Qt timer fires. More...
|
|
void | keyReleaseEvent (QKeyEvent *event) |
| Called when user releases a pressed key and the window has focus. More...
|
|
|
void | draw (const int x, const int y, const int w, const int h) |
| Draws given part of the current VNC frame buffer to the window. More...
|
|
void | terminateVncThread () |
| Terminates the vnc worker thread and stops all related timers. More...
|
|
bool | calcScaling (const QImage *remote) |
| When using image scaling, calc matching pixel borders for both resolutions to prevent artifacts through bilinear scaling. More...
|
|
Definition at line 25 of file vncwindow.h.
VncWindow::VncWindow |
( |
QWidget * |
parent = 0 | ) |
|
VncWindow::~VncWindow |
( |
| ) |
|
|
virtualdefault |
bool VncWindow::calcScaling |
( |
const QImage * |
remote | ) |
|
|
private |
When using image scaling, calc matching pixel borders for both resolutions to prevent artifacts through bilinear scaling.
If you simply round to the nearest number when scaling, you would slightly stretch or shrink the image area, which leads to strange sub-pixel-movements of parts of the image when being updated. The values calculated here are used to determine a larger area around the area that should actually be updated, that will not cause any artifacts when scaling down/up.
- Returns
- whether scaling factors changed
Definition at line 147 of file vncwindow.cpp.
void VncWindow::closeEvent |
( |
QCloseEvent * |
e | ) |
|
|
protected |
void VncWindow::deleteVncThread |
( |
| ) |
|
|
protectedslot |
void VncWindow::draw |
( |
const int |
x, |
|
|
const int |
y, |
|
|
const int |
w, |
|
|
const int |
h |
|
) |
| |
|
private |
Draws given part of the current VNC frame buffer to the window.
- Parameters
-
x | X offset of the region to draw |
y | Y offset of the region to draw |
w | width of the region to draw |
h | height of the region to draw |
Definition at line 97 of file vncwindow.cpp.
void VncWindow::keyReleaseEvent |
( |
QKeyEvent * |
event | ) |
|
|
protected |
Called when user releases a pressed key and the window has focus.
Definition at line 379 of file vncwindow.cpp.
void VncWindow::onProjectionStarted |
( |
| ) |
|
|
protectedslot |
Triggered by _vncWorker after successfully connecting to the VNC server.
This emits a signal that will eventually lead to the ServerConnection telling the server that we're now watching another client.
Definition at line 288 of file vncwindow.cpp.
void VncWindow::onProjectionStopped |
( |
| ) |
|
|
protectedslot |
Triggered by _vncWorker when the connection to the VNC server is lost.
We'll terminate the thread (detached) and close the window. A signal telling the server that we're not watching a VNC stream anymore will eventually be emited by the closeEvent.
Definition at line 305 of file vncwindow.cpp.
void VncWindow::onUpdateImage |
( |
const int |
x, |
|
|
const int |
y, |
|
|
const int |
w, |
|
|
const int |
h |
|
) |
| |
|
protectedslot |
Triggered by imageUpdate signal from the _vncWorker thread telling that the given region of the image changed.
Simply repaints the given area of the window. Since these are client coordinates we might have to do some scaling.
- Parameters
-
x | X offset of the region to update |
y | Y offset of the region to update |
w | width of the region to update |
h | height of the region to update |
Definition at line 264 of file vncwindow.cpp.
void VncWindow::open |
( |
const QString & |
host, |
|
|
int |
port, |
|
|
const QString & |
passwd, |
|
|
bool |
ro, |
|
|
bool |
fullscreen, |
|
|
const QString & |
caption, |
|
|
const int |
clientId, |
|
|
const QByteArray & |
rawThumb |
|
) |
| |
|
slot |
Show the VNC client window and connect to the given VNC server.
Any currently active VNC client connection is signaled to terminate, and a new VNC client worker thread is created for the new connection.
- Parameters
-
host | IP address of VNC server to connect to |
port | Port of VNC server to connect to |
passwd | (view only) password of VNC server to connect to |
ro | currently unused |
fullscreen | display VNC image in fullscreen mode |
caption | caption of window (only visible if not running in fullscreen mode) |
clientId | the ID of the client we're connecting to (echoed back to server, not used locally) |
Definition at line 186 of file vncwindow.cpp.
void VncWindow::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
protected |
Called by Qt when a part of the window should be redrawn.
This can either be caused by Qt (or the underlying graphical subsystem), or by an explicit call to QWidget::repaint()
- Parameters
-
event | the paint event, containing data like location and size area that should be repainted |
Definition at line 356 of file vncwindow.cpp.
void VncWindow::resizeEvent |
( |
QResizeEvent * |
| ) |
|
|
inlineprotected |
void VncWindow::running |
( |
const bool |
isRunning, |
|
|
const int |
clientId |
|
) |
| |
|
signal |
void VncWindow::terminateVncThread |
( |
| ) |
|
|
private |
Terminates the vnc worker thread and stops all related timers.
The thread will be signalled to stop, but we don't wait for it to actually terminate. All signals of the thread are blocked, and we nullptr our reference to it. It will finish running in a detached state and finally delete itself upon completion.
Definition at line 63 of file vncwindow.cpp.
void VncWindow::timer_moveToTop |
( |
| ) |
|
|
protectedslot |
void VncWindow::timerEvent |
( |
QTimerEvent * |
event | ) |
|
|
protected |
Called when a Qt timer fires.
redrawTimer: Redraw whole viewer window.
tcpTimeoutTimer: Check if we're connected, close window if not.
- Parameters
-
Definition at line 332 of file vncwindow.cpp.
QSize VncWindow::_desiredSize |
|
private |
bool VncWindow::_multiScreen |
|
private |
int VncWindow::_redrawTimer |
|
private |
QSize VncWindow::_remoteSize |
|
private |
QPixmap VncWindow::_remoteThumb |
|
private |
int VncWindow::_tcpTimeoutTimer |
|
private |
bool VncWindow::_viewOnly |
|
private |
The documentation for this class was generated from the following files: