Commit 8e3080ec authored by Eskil Abrahamsen-Blomfeldt's avatar Eskil Abrahamsen-Blomfeldt
Browse files

Port vncserver lib to Qt 5

parent 241eb055
load(qt_build_config)
CONFIG += warning_clean
DEFINES += QT_NO_LINKED_LIST
DEFINES += QT_NO_JAVA_STYLE_ITERATORS
MODULE_VERSION = 5.15.9
load(qt_parts)
TEMPLATE = subdirs
SUBDIRS += \
vncserver
......@@ -30,7 +30,20 @@
#ifndef QTVNCSERVERGLOBAL_H
#define QTVNCSERVERGLOBAL_H
#include <QtVncServer/qtvncserverexports.h>
#include <QtCore/qglobal.h>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
# include <QtVncServer/qtvncserverexports.h>
#else
# if !defined(Q_VNCSERVERT_EXPORT)
# if defined(QT_SHARED)
# define Q_VNCSERVER_EXPORT Q_DECL_EXPORT
# else
# define Q_VNCSERVER_EXPORT
# endif
# endif
#endif
#include <QtCore/qloggingcategory.h>
Q_DECLARE_LOGGING_CATEGORY(lcVnc)
......
......@@ -112,7 +112,11 @@ QVNCDirtyMap::QVNCDirtyMap(QImage referenceImage)
bufferStride = bufferWidth * bytesPerPixel;
const size_t bufferSize = bufferHeight * bufferStride;
buffer = new uchar[bufferSize];
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
std::memcpy(buffer, referenceImage.constBits(), bufferSize);
#else
memcpy(buffer, referenceImage.constBits(), bufferSize);
#endif
mapWidth = (bufferWidth + MAP_TILE_SIZE - 1) / MAP_TILE_SIZE;
mapHeight = (bufferHeight + MAP_TILE_SIZE - 1) / MAP_TILE_SIZE;
......@@ -1300,7 +1304,11 @@ void QVncClient::keyEvent()
emit keyEventReceived(ev.down ? QEvent::KeyPress : QEvent::KeyRelease,
Qt::Key(ev.keycode),
m_keymod,
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
QChar::fromUcs2(ev.unicode));
#else
QChar(ev.unicode));
#endif
}
if (ev.keycode == Qt::Key_Shift)
m_keymod = ev.down ? m_keymod | Qt::ShiftModifier :
......
TARGET = QtVncServer
QMAKE_USE_PRIVATE += zlib
QT = core-private gui-private network-private
HEADERS += \
$$PWD/qrfbprotocol_p.h \
$$PWD/qtvncserverglobal.h \
$$PWD/qvncclient_p.h \
$$PWD/qvncclientcursor_p.h \
$$PWD/qvncserver.h
SOURCES += \
$$PWD/qrfbprotocol.cpp \
$$PWD/qtvncserverglobal.cpp \
$$PWD/qvncclient.cpp \
$$PWD/qvncclientcursor.cpp \
$$PWD/qvncserver.cpp
load(qt_module)
CONFIG -= create_cmake
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment