diff options
374 files changed, 7923 insertions, 6208 deletions
diff --git a/.github/containers/centos7/Dockerfile b/.github/containers/centos7/Dockerfile deleted file mode 100644 index c27717ec..00000000 --- a/.github/containers/centos7/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM centos:7 - -RUN yum -y groupinstall 'Development Tools' -RUN yum -y install centos-packager -RUN yum -y install sudo -RUN yum -y install epel-release - -RUN useradd -s /bin/bash -m rpm -RUN echo >> /etc/sudoers -RUN echo "rpm ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers - -USER rpm -WORKDIR /home/rpm diff --git a/.github/containers/centos7/build.sh b/.github/containers/centos7/build.sh deleted file mode 100755 index bc4f3828..00000000 --- a/.github/containers/centos7/build.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -set -e -set -x - -## Basic variables - -CURDIR=$(dirname $(readlink -f $0)) -TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null) - -RPMDIR=${TOPDIR}/contrib/packages/rpm/el7 - -VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@') - -## Prepare the build directory - -rm -rf ${CURDIR}/rpmbuild -mkdir -p ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,SOURCES,SPECS,RPMS} -chmod a+w ${CURDIR}/rpmbuild/{BUILD,BUILDROOT,SRPMS,RPMS} -[ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled && chcon -Rt container_file_t ${CURDIR}/rpmbuild - -## Copy over the packaging files - -cp ${RPMDIR}/SOURCES/* ${CURDIR}/rpmbuild/SOURCES -cp ${RPMDIR}/SPECS/tigervnc.spec ${CURDIR}/rpmbuild/SPECS -sed -i "s/@VERSION@/${VERSION}/" ${CURDIR}/rpmbuild/SPECS/tigervnc.spec - -## Copy over the source code - -(cd ${TOPDIR} && git archive --prefix tigervnc-${VERSION}/ HEAD) | bzip2 > ${CURDIR}/rpmbuild/SOURCES/tigervnc-${VERSION}.tar.bz2 - -## Start the build - -docker run --volume ${CURDIR}/rpmbuild:/home/rpm/rpmbuild --interactive --rm tigervnc/${DOCKER} \ - bash -e -x -c " - sudo yum install -y xorg-x11-server-devel - sudo yum-builddep -y ~/rpmbuild/SPECS/tigervnc.spec - sudo chown 0.0 ~/rpmbuild/SOURCES/* - sudo chown 0.0 ~/rpmbuild/SPECS/* - rpmbuild -ba ~/rpmbuild/SPECS/tigervnc.spec - " - -mkdir -p ${CURDIR}/result -cp -av ${CURDIR}/rpmbuild/RPMS ${CURDIR}/result -cp -av ${CURDIR}/rpmbuild/SRPMS ${CURDIR}/result diff --git a/.github/containers/bionic/Dockerfile b/.github/containers/noble/Dockerfile index b3908371..171ab0f9 100644 --- a/.github/containers/bionic/Dockerfile +++ b/.github/containers/noble/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic +FROM ubuntu:noble ARG DEBIAN_FRONTEND=noninteractive diff --git a/.github/containers/bionic/build.sh b/.github/containers/noble/build.sh index 63dcf9b7..1b90f16d 100755 --- a/.github/containers/bionic/build.sh +++ b/.github/containers/noble/build.sh @@ -8,7 +8,7 @@ set -x CURDIR=$(dirname $(readlink -f $0)) TOPDIR=$(git rev-parse --show-toplevel 2>/dev/null) -DEBDIR=${TOPDIR}/contrib/packages/deb/ubuntu-bionic +DEBDIR=${TOPDIR}/contrib/packages/deb/ubuntu-noble VERSION=$(grep '^set(VERSION ' ${TOPDIR}/CMakeLists.txt | sed 's@^set(VERSION \(.*\))@\1@') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f41f7791..c23cada9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,12 +111,11 @@ jobs: strategy: matrix: target: - - centos7 - rocky8 - rocky9 - - bionic - focal - jammy + - noble fail-fast: false runs-on: ubuntu-latest env: diff --git a/BUILDING.txt b/BUILDING.txt index 9bb3d61b..8067bd90 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -44,7 +44,7 @@ Build Requirements (Unix) * PAM -- If building Xvnc/libvnc.so: - * Xorg server source code, 1.16 or later + * Xorg server source code, 1.20 or later * All build requirements Xorg imposes (see its documentation) * patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e797f8c..b57b5e61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(CheckIncludeFiles) include(CheckFunctionExists) include(CheckLibraryExists) +include(CheckVariableExists) include(CheckTypeSize) include(CheckCSourceCompiles) include(CheckCXXSourceCompiles) @@ -20,7 +21,7 @@ include(CMakeMacroLibtoolFile) include(cmake/TargetLinkDirectories.cmake) project(tigervnc) -set(VERSION 1.13.80) +set(VERSION 1.14.80) # The RC version must always be four comma-separated numbers string(REPLACE . , RCVERSION "${VERSION}.0") @@ -69,12 +70,16 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-D_DEBUG) ENDIF() -# Make sure we get a sane C version +# Make sure we get a sane C and C++ version set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") # Tell the compiler to be stringent set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wvla") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat=2 -Wvla") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") # Make sure we catch these issues whilst developing IF(CMAKE_BUILD_TYPE MATCHES Debug) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") @@ -182,6 +187,13 @@ if(ENABLE_H264) add_definitions("-DHAVE_H264") set(H264_LIBS "WIN") # may be LIBAV in the future set(H264_LIBRARIES ole32 mfplat mfuuid wmcodecdspuuid) + + set(CMAKE_REQUIRED_LIBRARIES ${H264_LIBRARIES}) + check_variable_exists(CLSID_VideoProcessorMFT HAVE_VIDEO_PROCESSOR_MFT) + set(CMAKE_REQUIRED_LIBRARIES) + if(HAVE_VIDEO_PROCESSOR_MFT) + add_definitions("-DHAVE_VIDEO_PROCESSOR_MFT") + endif() else() find_package(Ffmpeg) if (AVCODEC_FOUND AND AVUTIL_FOUND AND SWSCALE_FOUND) diff --git a/common/network/Socket.cxx b/common/network/Socket.cxx index 78484f51..8da44366 100644 --- a/common/network/Socket.cxx +++ b/common/network/Socket.cxx @@ -71,7 +71,7 @@ bool network::isSocketListening(int sock) } Socket::Socket(int fd) - : instream(0), outstream(0), + : instream(nullptr), outstream(nullptr), isShutdown_(false), queryConnection(false) { initSockets(); @@ -79,7 +79,7 @@ Socket::Socket(int fd) } Socket::Socket() - : instream(0), outstream(0), + : instream(nullptr), outstream(nullptr), isShutdown_(false), queryConnection(false) { initSockets(); @@ -128,14 +128,14 @@ void Socket::setFd(int fd) isShutdown_ = false; } -SocketListener::SocketListener(int fd) - : fd(fd), filter(0) +SocketListener::SocketListener(int fd_) + : fd(fd_), filter(nullptr) { initSockets(); } SocketListener::SocketListener() - : fd(-1), filter(0) + : fd(-1), filter(nullptr) { initSockets(); } @@ -160,14 +160,14 @@ Socket* SocketListener::accept() { int new_sock = -1; // Accept an incoming connection - if ((new_sock = ::accept(fd, 0, 0)) < 0) + if ((new_sock = ::accept(fd, nullptr, nullptr)) < 0) throw SocketException("unable to accept new connection", errorNumber); // Create the socket object & check connection is allowed Socket* s = createSocket(new_sock); if (filter && !filter->verifyConnection(s)) { delete s; - return NULL; + return nullptr; } return s; diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx index 15730cfd..3f2f0f1f 100644 --- a/common/network/TcpSocket.cxx +++ b/common/network/TcpSocket.cxx @@ -129,17 +129,17 @@ TcpSocket::TcpSocket(const char *host, int port) memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - hints.ai_canonname = NULL; - hints.ai_addr = NULL; - hints.ai_next = NULL; + hints.ai_canonname = nullptr; + hints.ai_addr = nullptr; + hints.ai_next = nullptr; - if ((result = getaddrinfo(host, NULL, &hints, &ai)) != 0) { + if ((result = getaddrinfo(host, nullptr, &hints, &ai)) != 0) { throw GAIException("unable to resolve host by name", result); } sock = -1; err = 0; - for (current = ai; current != NULL; current = current->ai_next) { + for (current = ai; current != nullptr; current = current->ai_next) { int family; vnc_sockaddr_t sa; socklen_t salen; @@ -168,7 +168,7 @@ TcpSocket::TcpSocket(const char *host, int port) else sa.u.sin6.sin6_port = htons(port); - getnameinfo(&sa.u.sa, salen, ntop, sizeof(ntop), NULL, 0, NI_NUMERICHOST); + getnameinfo(&sa.u.sa, salen, ntop, sizeof(ntop), nullptr, 0, NI_NUMERICHOST); vlog.debug("Connecting to %s [%s] port %d", host, ntop, port); sock = socket (family, SOCK_STREAM, 0); @@ -228,7 +228,7 @@ const char* TcpSocket::getPeerAddress() { buffer[0] = '['; ret = getnameinfo(&sa.u.sa, sizeof(sa.u.sin6), - buffer + 1, sizeof(buffer) - 2, NULL, 0, + buffer + 1, sizeof(buffer) - 2, nullptr, 0, NI_NUMERICHOST); if (ret != 0) { vlog.error("unable to convert peer name to a string"); @@ -244,7 +244,7 @@ const char* TcpSocket::getPeerAddress() { char *name; name = inet_ntoa(sa.u.sin.sin_addr); - if (name == NULL) { + if (name == nullptr) { vlog.error("unable to convert peer name to a string"); return "(N/A)"; } @@ -338,8 +338,8 @@ TcpListener::TcpListener(const struct sockaddr *listenaddr, listen(sock); } -Socket* TcpListener::createSocket(int fd) { - return new TcpSocket(fd); +Socket* TcpListener::createSocket(int fd_) { + return new TcpSocket(fd_); } std::list<std::string> TcpListener::getMyAddresses() { @@ -352,15 +352,15 @@ std::list<std::string> TcpListener::getMyAddresses() { hints.ai_flags = AI_PASSIVE | AI_NUMERICSERV; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - hints.ai_canonname = NULL; - hints.ai_addr = NULL; - hints.ai_next = NULL; + hints.ai_canonname = nullptr; + hints.ai_addr = nullptr; + hints.ai_next = nullptr; // Windows doesn't like NULL for service, so specify something - if ((getaddrinfo(NULL, "1", &hints, &ai)) != 0) + if ((getaddrinfo(nullptr, "1", &hints, &ai)) != 0) return result; - for (current= ai; current != NULL; current = current->ai_next) { + for (current= ai; current != nullptr; current = current->ai_next) { char addr[INET6_ADDRSTRLEN]; switch (current->ai_family) { @@ -377,7 +377,7 @@ std::list<std::string> TcpListener::getMyAddresses() { } getnameinfo(current->ai_addr, current->ai_addrlen, addr, INET6_ADDRSTRLEN, - NULL, 0, NI_NUMERICHOST); + nullptr, 0, NI_NUMERICHOST); result.push_back(addr); } @@ -417,7 +417,7 @@ void network::createLocalTcpListeners(std::list<SocketListener*> *listeners, ai[1].ai_family = sa[1].u.sin6.sin6_family; ai[1].ai_addr = &sa[1].u.sa; ai[1].ai_addrlen = sizeof(sa[1].u.sin6); - ai[1].ai_next = NULL; + ai[1].ai_next = nullptr; createTcpListeners(listeners, ai); } @@ -436,9 +436,9 @@ void network::createTcpListeners(std::list<SocketListener*> *listeners, hints.ai_flags = AI_PASSIVE | AI_NUMERICSERV; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - hints.ai_canonname = NULL; - hints.ai_addr = NULL; - hints.ai_next = NULL; + hints.ai_canonname = nullptr; + hints.ai_addr = nullptr; + hints.ai_next = nullptr; snprintf (service, sizeof (service) - 1, "%d", port); service[sizeof (service) - 1] = '\0'; @@ -463,7 +463,7 @@ void network::createTcpListeners(std::list<SocketListener*> *listeners, initSockets(); - for (current = ai; current != NULL; current = current->ai_next) { + for (current = ai; current != nullptr; current = current->ai_next) { switch (current->ai_family) { case AF_INET: if (!UseIPv4) @@ -629,7 +629,7 @@ TcpFilter::Pattern TcpFilter::parsePattern(const char* p) { parts[0].erase(parts.size()-1, 1); } - if ((result = getaddrinfo (parts[0].c_str(), NULL, &hints, &ai)) != 0) { + if ((result = getaddrinfo (parts[0].c_str(), nullptr, &hints, &ai)) != 0) { throw GAIException("unable to resolve host by name", result); } @@ -711,11 +711,11 @@ std::string TcpFilter::patternToStr(const TcpFilter::Pattern& p) { if (p.address.u.sa.sa_family == AF_INET) { getnameinfo(&p.address.u.sa, sizeof(p.address.u.sin), - addr, sizeof(addr), NULL, 0, NI_NUMERICHOST); + addr, sizeof(addr), nullptr, 0, NI_NUMERICHOST); } else if (p.address.u.sa.sa_family == AF_INET6) { addr[0] = '['; getnameinfo(&p.address.u.sa, sizeof(p.address.u.sin6), - addr + 1, sizeof(addr) - 2, NULL, 0, NI_NUMERICHOST); + addr + 1, sizeof(addr) - 2, nullptr, 0, NI_NUMERICHOST); strcat(addr, "]"); } else addr[0] = '\0'; diff --git a/common/network/TcpSocket.h b/common/network/TcpSocket.h index c62dd78b..b029bff2 100644 --- a/common/network/TcpSocket.h +++ b/common/network/TcpSocket.h @@ -56,8 +56,8 @@ namespace network { TcpSocket(int sock); TcpSocket(const char *name, int port); - virtual const char* getPeerAddress(); - virtual const char* getPeerEndpoint(); + const char* getPeerAddress() override; + const char* getPeerEndpoint() override; protected: bool enableNagles(bool enable); @@ -68,12 +68,12 @@ namespace network { TcpListener(const struct sockaddr *listenaddr, socklen_t listenaddrlen); TcpListener(int sock); - virtual int getMyPort(); + int getMyPort() override; static std::list<std::string> getMyAddresses(); protected: - virtual Socket* createSocket(int fd); + Socket* createSocket(int fd) override; }; void createLocalTcpListeners(std::list<SocketListener*> *listeners, @@ -97,7 +97,7 @@ namespace network { TcpFilter(const char* filter); virtual ~TcpFilter(); - virtual bool verifyConnection(Socket* s); + bool verifyConnection(Socket* s) override; typedef enum {Accept, Reject, Query} Action; struct Pattern { diff --git a/common/network/UnixSocket.cxx b/common/network/UnixSocket.cxx index e7793849..3a422b6c 100644 --- a/common/network/UnixSocket.cxx +++ b/common/network/UnixSocket.cxx @@ -157,8 +157,8 @@ UnixListener::~UnixListener() unlink(addr.sun_path); } -Socket* UnixListener::createSocket(int fd) { - return new UnixSocket(fd); +Socket* UnixListener::createSocket(int fd_) { + return new UnixSocket(fd_); } int UnixListener::getMyPort() { diff --git a/common/network/UnixSocket.h b/common/network/UnixSocket.h index e66afcd1..3ecc6179 100644 --- a/common/network/UnixSocket.h +++ b/common/network/UnixSocket.h @@ -38,8 +38,8 @@ namespace network { UnixSocket(int sock); UnixSocket(const char *name); - virtual const char* getPeerAddress(); - virtual const char* getPeerEndpoint(); + const char* getPeerAddress() override; + const char* getPeerEndpoint() override; }; class UnixListener : public SocketListener { @@ -47,10 +47,10 @@ namespace network { UnixListener(const char *listenaddr, int mode); virtual ~UnixListener(); - int getMyPort(); + int getMyPort() override; protected: - virtual Socket* createSocket(int fd); + Socket* createSocket(int fd) override; }; } diff --git a/common/os/Mutex.cxx b/common/os/Mutex.cxx index e6532a7d..2a768b4c 100644 --- a/common/os/Mutex.cxx +++ b/common/os/Mutex.cxx @@ -41,7 +41,7 @@ Mutex::Mutex() int ret; systemMutex = new pthread_mutex_t; - ret = pthread_mutex_init((pthread_mutex_t*)systemMutex, NULL); + ret = pthread_mutex_init((pthread_mutex_t*)systemMutex, nullptr); if (ret != 0) throw rdr::SystemException("Failed to create mutex", ret); #endif @@ -84,9 +84,9 @@ void Mutex::unlock() #endif } -Condition::Condition(Mutex* mutex) +Condition::Condition(Mutex* mutex_) { - this->mutex = mutex; + this->mutex = mutex_; #ifdef WIN32 systemCondition = new CONDITION_VARIABLE; @@ -95,7 +95,7 @@ Condition::Condition(Mutex* mutex) int ret; systemCondition = new pthread_cond_t; - ret = pthread_cond_init((pthread_cond_t*)systemCondition, NULL); + ret = pthread_cond_init((pthread_cond_t*)systemCondition, nullptr); if (ret != 0) throw rdr::SystemException("Failed to create condition variable", ret); #endif diff --git a/common/os/Thread.cxx b/common/os/Thread.cxx index 92cc68d5..91f7fd07 100644 --- a/common/os/Thread.cxx +++ b/common/os/Thread.cxx @@ -35,7 +35,7 @@ using namespace os; -Thread::Thread() : running(false), threadId(NULL) +Thread::Thread() : running(false), threadId(nullptr) { mutex = new Mutex; @@ -64,8 +64,8 @@ void Thread::start() AutoMutex a(mutex); #ifdef WIN32 - *(HANDLE*)threadId = CreateThread(NULL, 0, startRoutine, this, 0, NULL); - if (*(HANDLE*)threadId == NULL) + *(HANDLE*)threadId = CreateThread(nullptr, 0, startRoutine, this, 0, nullptr); + if (*(HANDLE*)threadId == nullptr) throw rdr::SystemException("Failed to create thread", GetLastError()); #else int ret; @@ -78,9 +78,9 @@ void Thread::start() if (ret != 0) throw rdr::SystemException("Failed to mask signals", ret); - ret = pthread_create((pthread_t*)threadId, NULL, startRoutine, this); + ret = pthread_create((pthread_t*)threadId, nullptr, startRoutine, this); - pthread_sigmask(SIG_SETMASK, &old, NULL); + pthread_sigmask(SIG_SETMASK, &old, nullptr); if (ret != 0) throw rdr::SystemException("Failed to create thread", ret); @@ -103,7 +103,7 @@ void Thread::wait() #else int ret; - ret = pthread_join(*(pthread_t*)threadId, NULL); + ret = pthread_join(*(pthread_t*)threadId, nullptr); if (ret != 0) throw rdr::SystemException("Failed to join thread", ret); #endif @@ -165,5 +165,9 @@ void* Thread::startRoutine(void* data) self->running = false; self->mutex->unlock(); +#ifdef WIN32 return 0; +#else + return nullptr; +#endif } diff --git a/common/os/os.cxx b/common/os/os.cxx index 83995d0d..2ac70550 100644 --- a/common/os/os.cxx +++ b/common/os/os.cxx @@ -58,12 +58,12 @@ static const char* getvncdir(bool userDir, const char *xdg_env, const char *xdg_ #ifndef WIN32 homedir = getenv("HOME"); - if (homedir == NULL) { + if (homedir == nullptr) { uid = getuid(); passwd = getpwuid(uid); - if (passwd == NULL) { + if (passwd == nullptr) { /* Do we want emit error msg here? */ - return NULL; + return nullptr; } homedir = passwd->pw_dir; } @@ -72,7 +72,7 @@ static const char* getvncdir(bool userDir, const char *xdg_env, const char *xdg_ return homedir; xdgdir = getenv(xdg_env); - if (xdgdir != NULL && xdgdir[0] == '/') + if (xdgdir != nullptr && xdgdir[0] == '/') snprintf(dir, sizeof(dir), "%s/tigervnc", xdgdir); else snprintf(dir, sizeof(dir), "%s/%s/tigervnc", homedir, xdg_def); @@ -83,25 +83,25 @@ static const char* getvncdir(bool userDir, const char *xdg_env, const char *xdg_ (void) xdg_env; if (userDir) - ret = SHGetSpecialFolderPath(NULL, dir, CSIDL_PROFILE, FALSE); + ret = SHGetSpecialFolderPath(nullptr, dir, CSIDL_PROFILE, FALSE); else - ret = SHGetSpecialFolderPath(NULL, dir, CSIDL_APPDATA, FALSE); + ret = SHGetSpecialFolderPath(nullptr, dir, CSIDL_APPDATA, FALSE); if (ret == FALSE) - return NULL; + return nullptr; if (userDir) return dir; - ret = SHGetSpecialFolderPath(NULL, legacy, CSIDL_APPDATA, FALSE); + ret = SHGetSpecialFolderPath(nullptr, legacy, CSIDL_APPDATA, FALSE); if (ret == FALSE) - return NULL; + return nullptr; if (strlen(dir) + strlen("\\TigerVNC") >= sizeof(dir)) - return NULL; + return nullptr; if (strlen(legacy) + strlen("\\vnc") >= sizeof(legacy)) - return NULL; + return nullptr; strcat(dir, "\\TigerVNC"); strcat(legacy, "\\vnc"); @@ -111,7 +111,7 @@ static const char* getvncdir(bool userDir, const char *xdg_env, const char *xdg_ const char* os::getuserhomedir() { - return getvncdir(true, NULL, NULL); + return getvncdir(true, nullptr, nullptr); } const char* os::getvncconfigdir() diff --git a/common/rdr/AESInStream.cxx b/common/rdr/AESInStream.cxx index de91a3df..d6d944a3 100644 --- a/common/rdr/AESInStream.cxx +++ b/common/rdr/AESInStream.cxx @@ -45,15 +45,15 @@ bool AESInStream::fillBuffer() { if (!in->hasData(2)) return false; - const uint8_t* ptr = in->getptr(2); - size_t length = ((int)ptr[0] << 8) | (int)ptr[1]; + const uint8_t* buf = in->getptr(2); + size_t length = ((int)buf[0] << 8) | (int)buf[1]; if (!in->hasData(2 + length + 16)) return false; ensureSpace(length); - ptr = in->getptr(2 + length + 16); - const uint8_t* ad = ptr; - const uint8_t* data = ptr + 2; - const uint8_t* mac = ptr + 2 + length; + buf = in->getptr(2 + length + 16); + const uint8_t* ad = buf; + const uint8_t* data = buf + 2; + const uint8_t* mac = buf + 2 + length; uint8_t macComputed[16]; if (keySize == 128) { diff --git a/common/rdr/AESInStream.h b/common/rdr/AESInStream.h index 6069bb71..f0e6de53 100644 --- a/common/rdr/AESInStream.h +++ b/common/rdr/AESInStream.h @@ -33,7 +33,7 @@ namespace rdr { virtual ~AESInStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; int keySize; InStream* in; diff --git a/common/rdr/AESOutStream.h b/common/rdr/AESOutStream.h index f9e4f4da..c84ee2b8 100644 --- a/common/rdr/AESOutStream.h +++ b/common/rdr/AESOutStream.h @@ -31,11 +31,11 @@ namespace rdr { AESOutStream(OutStream* out, const uint8_t* key, int keySize); virtual ~AESOutStream(); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; void writeMessage(const uint8_t* data, size_t length); int keySize; diff --git a/common/rdr/BufferedInStream.cxx b/common/rdr/BufferedInStream.cxx index 5978a8c9..3c04bafc 100644 --- a/common/rdr/BufferedInStream.cxx +++ b/common/rdr/BufferedInStream.cxx @@ -35,7 +35,7 @@ BufferedInStream::BufferedInStream() : bufSize(DEFAULT_BUF_SIZE), offset(0) { ptr = end = start = new uint8_t[bufSize]; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = 0; } @@ -80,7 +80,7 @@ void BufferedInStream::ensureSpace(size_t needed) end = newBuffer + (end - ptr); ptr = start = newBuffer; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = needed; } @@ -88,7 +88,7 @@ void BufferedInStream::ensureSpace(size_t needed) peakUsage = needed; // Time to shrink an excessive buffer? - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); if ((avail() == 0) && (bufSize > DEFAULT_BUF_SIZE) && ((now.tv_sec < lastSizeCheck.tv_sec) || (now.tv_sec > (lastSizeCheck.tv_sec + 5)))) { @@ -105,7 +105,7 @@ void BufferedInStream::ensureSpace(size_t needed) bufSize = newSize; } - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = needed; } diff --git a/common/rdr/BufferedInStream.h b/common/rdr/BufferedInStream.h index 89b25ffb..b3d6115e 100644 --- a/common/rdr/BufferedInStream.h +++ b/common/rdr/BufferedInStream.h @@ -35,7 +35,7 @@ namespace rdr { public: virtual ~BufferedInStream(); - virtual size_t pos(); + size_t pos() override; protected: size_t availSpace() { return start + bufSize - end; } @@ -45,7 +45,7 @@ namespace rdr { private: virtual bool fillBuffer() = 0; - virtual bool overrun(size_t needed); + bool overrun(size_t needed) override; private: size_t bufSize; diff --git a/common/rdr/BufferedOutStream.cxx b/common/rdr/BufferedOutStream.cxx index 640f6007..0d6a1eb6 100644 --- a/common/rdr/BufferedOutStream.cxx +++ b/common/rdr/BufferedOutStream.cxx @@ -31,12 +31,12 @@ using namespace rdr; static const size_t DEFAULT_BUF_SIZE = 16384; static const size_t MAX_BUF_SIZE = 32 * 1024 * 1024; -BufferedOutStream::BufferedOutStream(bool emulateCork) - : bufSize(DEFAULT_BUF_SIZE), offset(0), emulateCork(emulateCork) +BufferedOutStream::BufferedOutStream(bool emulateCork_) + : bufSize(DEFAULT_BUF_SIZE), offset(0), emulateCork(emulateCork_) { ptr = start = sentUpTo = new uint8_t[bufSize]; end = start + bufSize; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = 0; } @@ -75,7 +75,7 @@ void BufferedOutStream::flush() ptr = sentUpTo = start; // Time to shrink an excessive buffer? - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); if ((sentUpTo == ptr) && (bufSize > DEFAULT_BUF_SIZE) && ((now.tv_sec < lastSizeCheck.tv_sec) || (now.tv_sec > (lastSizeCheck.tv_sec + 5)))) { @@ -93,7 +93,7 @@ void BufferedOutStream::flush() bufSize = newSize; } - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = 0; } } @@ -156,7 +156,7 @@ void BufferedOutStream::overrun(size_t needed) sentUpTo = start = newBuffer; end = newBuffer + newSize; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = totalNeeded; return; diff --git a/common/rdr/BufferedOutStream.h b/common/rdr/BufferedOutStream.h index 22693257..dd765dc9 100644 --- a/common/rdr/BufferedOutStream.h +++ b/common/rdr/BufferedOutStream.h @@ -35,8 +35,8 @@ namespace rdr { public: virtual ~BufferedOutStream(); - virtual size_t length(); - virtual void flush(); + size_t length() override; + void flush() override; // hasBufferedData() checks if there is any data yet to be flushed @@ -49,7 +49,7 @@ namespace rdr { virtual bool flushBuffer() = 0; - virtual void overrun(size_t needed); + void overrun(size_t needed) override; private: size_t bufSize; diff --git a/common/rdr/CMakeLists.txt b/common/rdr/CMakeLists.txt index 30c2403a..2897119b 100644 --- a/common/rdr/CMakeLists.txt +++ b/common/rdr/CMakeLists.txt @@ -20,6 +20,11 @@ target_include_directories(rdr PUBLIC ${CMAKE_SOURCE_DIR}/common) target_include_directories(rdr SYSTEM PUBLIC ${ZLIB_INCLUDE_DIRS}) target_link_libraries(rdr ${ZLIB_LIBRARIES} os rfb) +if(MSVC) + # undef min and max macro + target_compile_definitions(rfb PRIVATE NOMINMAX) +endif() + if(GNUTLS_FOUND) target_include_directories(rdr SYSTEM PUBLIC ${GNUTLS_INCLUDE_DIR}) target_link_libraries(rdr ${GNUTLS_LIBRARIES}) diff --git a/common/rdr/Exception.cxx b/common/rdr/Exception.cxx index b1e0a841..d5546274 100644 --- a/common/rdr/Exception.cxx +++ b/common/rdr/Exception.cxx @@ -51,15 +51,15 @@ Exception::Exception(const char *format, ...) { va_end(ap); } -GAIException::GAIException(const char* s, int err) - : Exception("%s", s) +GAIException::GAIException(const char* s, int err_) + : Exception("%s", s), err(err_) { strncat(str_, ": ", len-1-strlen(str_)); #ifdef _WIN32 wchar_t *currStr = new wchar_t[len-strlen(str_)]; wcsncpy(currStr, gai_strerrorW(err), len-1-strlen(str_)); WideCharToMultiByte(CP_UTF8, 0, currStr, -1, str_+strlen(str_), - len-1-strlen(str_), 0, 0); + len-1-strlen(str_), nullptr, nullptr); delete [] currStr; #else strncat(str_, gai_strerror(err), len-1-strlen(str_)); @@ -83,9 +83,9 @@ SystemException::SystemException(const char* s, int err_) #ifdef _WIN32 wchar_t *currStr = new wchar_t[len-strlen(str_)]; FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - 0, err, 0, currStr, len-1-strlen(str_), 0); + nullptr, err, 0, currStr, len-1-strlen(str_), nullptr); WideCharToMultiByte(CP_UTF8, 0, currStr, -1, str_+strlen(str_), - len-1-strlen(str_), 0, 0); + len-1-strlen(str_), nullptr, nullptr); delete [] currStr; int l = strlen(str_); diff --git a/common/rdr/Exception.h b/common/rdr/Exception.h index 2c66ffca..f1a167e5 100644 --- a/common/rdr/Exception.h +++ b/common/rdr/Exception.h @@ -26,7 +26,7 @@ namespace rdr { struct Exception { enum { len = 256 }; char str_[len]; - Exception(const char *format = 0, ...) + Exception(const char *format=nullptr, ...) __attribute__((__format__ (__printf__, 2, 3))); virtual ~Exception() {} virtual const char* str() const { return str_; } diff --git a/common/rdr/FdInStream.cxx b/common/rdr/FdInStream.cxx index 8e12f3a4..491dc008 100644 --- a/common/rdr/FdInStream.cxx +++ b/common/rdr/FdInStream.cxx @@ -88,7 +88,7 @@ size_t FdInStream::readFd(uint8_t* buf, size_t len) FD_ZERO(&fds); FD_SET(fd, &fds); - n = select(fd+1, &fds, 0, 0, &tv); + n = select(fd+1, &fds, nullptr, nullptr, &tv); } while (n < 0 && errorNumber == EINTR); if (n < 0) diff --git a/common/rdr/FdInStream.h b/common/rdr/FdInStream.h index 0f8373fe..0bd5bf19 100644 --- a/common/rdr/FdInStream.h +++ b/common/rdr/FdInStream.h @@ -37,7 +37,7 @@ namespace rdr { int getFd() { return fd; } private: - virtual bool fillBuffer(); + bool fillBuffer() override; size_t readFd(uint8_t* buf, size_t len); diff --git a/common/rdr/FdOutStream.cxx b/common/rdr/FdOutStream.cxx index 6827655f..1f60d45b 100644 --- a/common/rdr/FdOutStream.cxx +++ b/common/rdr/FdOutStream.cxx @@ -59,7 +59,7 @@ FdOutStream::FdOutStream(int fd_) #endif fd(fd_) { - gettimeofday(&lastWrite, NULL); + gettimeofday(&lastWrite, nullptr); } FdOutStream::~FdOutStream() @@ -113,7 +113,7 @@ size_t FdOutStream::writeFd(const uint8_t* data, size_t length) FD_ZERO(&fds); FD_SET(fd, &fds); - n = select(fd+1, 0, &fds, 0, &tv); + n = select(fd+1, nullptr, &fds, nullptr, &tv); } while (n < 0 && errorNumber == EINTR); if (n < 0) @@ -136,7 +136,7 @@ size_t FdOutStream::writeFd(const uint8_t* data, size_t length) if (n < 0) throw SystemException("write", errorNumber); - gettimeofday(&lastWrite, NULL); + gettimeofday(&lastWrite, nullptr); return n; } diff --git a/common/rdr/FdOutStream.h b/common/rdr/FdOutStream.h index 05fc1fed..d9f16efb 100644 --- a/common/rdr/FdOutStream.h +++ b/common/rdr/FdOutStream.h @@ -41,10 +41,10 @@ namespace rdr { unsigned getIdleTime(); - virtual void cork(bool enable); + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; size_t writeFd(const uint8_t* data, size_t length); int fd; struct timeval lastWrite; diff --git a/common/rdr/FileInStream.cxx b/common/rdr/FileInStream.cxx index 6de1a5b2..4239a238 100644 --- a/common/rdr/FileInStream.cxx +++ b/common/rdr/FileInStream.cxx @@ -39,7 +39,7 @@ FileInStream::FileInStream(const char *fileName) FileInStream::~FileInStream(void) { if (file) { fclose(file); - file = NULL; + file = nullptr; } } diff --git a/common/rdr/FileInStream.h b/common/rdr/FileInStream.h index e13596ce..1b409e46 100644 --- a/common/rdr/FileInStream.h +++ b/common/rdr/FileInStream.h @@ -34,7 +34,7 @@ namespace rdr { ~FileInStream(void); private: - virtual bool fillBuffer(); + bool fillBuffer() override; private: FILE *file; diff --git a/common/rdr/HexInStream.cxx b/common/rdr/HexInStream.cxx index e23974e1..11f98498 100644 --- a/common/rdr/HexInStream.cxx +++ b/common/rdr/HexInStream.cxx @@ -21,14 +21,13 @@ #include <config.h> #endif +#include <algorithm> #include <rdr/HexInStream.h> #include <rdr/Exception.h> #include <rfb/util.h> using namespace rdr; -static inline int min(int a, int b) {return a<b ? a : b;} - HexInStream::HexInStream(InStream& is) : in_stream(is) { @@ -37,12 +36,11 @@ HexInStream::HexInStream(InStream& is) HexInStream::~HexInStream() { } - bool HexInStream::fillBuffer() { if (!in_stream.hasData(2)) return false; - size_t length = min(in_stream.avail()/2, availSpace()); + size_t length = std::min(in_stream.avail()/2, availSpace()); const uint8_t* iptr = in_stream.getptr(length*2); uint8_t* optr = (uint8_t*) end; diff --git a/common/rdr/HexInStream.h b/common/rdr/HexInStream.h index 76f91c08..c69fcd68 100644 --- a/common/rdr/HexInStream.h +++ b/common/rdr/HexInStream.h @@ -30,7 +30,7 @@ namespace rdr { virtual ~HexInStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; private: InStream& in_stream; diff --git a/common/rdr/HexOutStream.cxx b/common/rdr/HexOutStream.cxx index b1ab2dc0..efab77f8 100644 --- a/common/rdr/HexOutStream.cxx +++ b/common/rdr/HexOutStream.cxx @@ -20,14 +20,12 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif - +#include <algorithm> #include <rdr/HexOutStream.h> #include <rfb/util.h> using namespace rdr; -static inline size_t min(size_t a, size_t b) {return a<b ? a : b;} - HexOutStream::HexOutStream(OutStream& os) : out_stream(os) { @@ -41,7 +39,7 @@ bool HexOutStream::flushBuffer() { while (sentUpTo != ptr) { uint8_t* optr = out_stream.getptr(2); - size_t length = min(ptr-sentUpTo, out_stream.avail()/2); + size_t length = std::min((size_t)(ptr-sentUpTo), out_stream.avail()/2); for (size_t i=0; i<length; i++) rfb::binToHex(&sentUpTo[i], 1, (char*)&optr[i*2], 2); @@ -64,4 +62,3 @@ void HexOutStream::cork(bool enable) BufferedOutStream::cork(enable); out_stream.cork(enable); } - diff --git a/common/rdr/HexOutStream.h b/common/rdr/HexOutStream.h index 16596bf3..7c74f9de 100644 --- a/common/rdr/HexOutStream.h +++ b/common/rdr/HexOutStream.h @@ -29,11 +29,11 @@ namespace rdr { HexOutStream(OutStream& os); virtual ~HexOutStream(); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; void writeBuffer(); OutStream& out_stream; diff --git a/common/rdr/InStream.h b/common/rdr/InStream.h index 019ca5a7..939439e1 100644 --- a/common/rdr/InStream.h +++ b/common/rdr/InStream.h @@ -64,7 +64,7 @@ namespace rdr { #endif if (length > (size_t)(end - ptr)) { - if (restorePoint != NULL) { + if (restorePoint != nullptr) { bool ret; size_t restoreDiff; @@ -100,21 +100,21 @@ namespace rdr { inline void setRestorePoint() { #ifdef RFB_INSTREAM_CHECK - if (restorePoint != NULL) + if (restorePoint != nullptr) throw Exception("Nested use of input stream restore point"); #endif restorePoint = ptr; } inline void clearRestorePoint() { #ifdef RFB_INSTREAM_CHECK - if (restorePoint == NULL) + if (restorePoint == nullptr) throw Exception("Incorrect clearing of input stream restore point"); #endif - restorePoint = NULL; + restorePoint = nullptr; } inline void gotoRestorePoint() { #ifdef RFB_INSTREAM_CHECK - if (restorePoint == NULL) + if (restorePoint == nullptr) throw Exception("Incorrect activation of input stream restore point"); #endif ptr = restorePoint; @@ -204,7 +204,7 @@ namespace rdr { protected: - InStream() : restorePoint(NULL) + InStream() : restorePoint(nullptr) #ifdef RFB_INSTREAM_CHECK ,checkedBytes(0) #endif diff --git a/common/rdr/MemInStream.h b/common/rdr/MemInStream.h index 61d08482..e10273b1 100644 --- a/common/rdr/MemInStream.h +++ b/common/rdr/MemInStream.h @@ -54,12 +54,12 @@ namespace rdr { delete [] start; } - size_t pos() { return ptr - start; } + size_t pos() override { return ptr - start; } void reposition(size_t pos) { ptr = start + pos; } private: - bool overrun(size_t /*needed*/) { throw EndOfStream(); } + bool overrun(size_t /*needed*/) override { throw EndOfStream(); } const uint8_t* start; bool deleteWhenDone; }; diff --git a/common/rdr/MemOutStream.h b/common/rdr/MemOutStream.h index 5ed1ccf7..9bf2b810 100644 --- a/common/rdr/MemOutStream.h +++ b/common/rdr/MemOutStream.h @@ -41,7 +41,7 @@ namespace rdr { delete [] start; } - size_t length() { return ptr - start; } + size_t length() override { return ptr - start; } void clear() { ptr = start; }; void clearAndZero() { memset(start, 0, ptr-start); clear(); } void reposition(size_t pos) { ptr = start + pos; } @@ -55,7 +55,7 @@ namespace rdr { // overrun() either doubles the buffer or adds enough space for // needed bytes. - virtual void overrun(size_t needed) { + void overrun(size_t needed) override { size_t len = ptr - start + needed; if (len < (size_t)(end - start) * 2) len = (end - start) * 2; diff --git a/common/rdr/OutStream.h b/common/rdr/OutStream.h index 8450efd0..2921b232 100644 --- a/common/rdr/OutStream.h +++ b/common/rdr/OutStream.h @@ -36,7 +36,7 @@ namespace rdr { protected: - OutStream() : ptr(NULL), end(NULL), corked(false) {} + OutStream() : ptr(nullptr), end(nullptr), corked(false) {} public: diff --git a/common/rdr/RandomStream.cxx b/common/rdr/RandomStream.cxx index 79a1a0f7..9813abdd 100644 --- a/common/rdr/RandomStream.cxx +++ b/common/rdr/RandomStream.cxx @@ -45,9 +45,11 @@ RandomStream::RandomStream() { #ifdef RFB_HAVE_WINCRYPT provider = 0; - if (!CryptAcquireContext(&provider, 0, 0, PROV_RSA_FULL, 0)) { + if (!CryptAcquireContext(&provider, nullptr, nullptr, + PROV_RSA_FULL, 0)) { if (GetLastError() == (DWORD)NTE_BAD_KEYSET) { - if (!CryptAcquireContext(&provider, 0, 0, PROV_RSA_FULL, CRYPT_NEWKEYSET)) { + if (!CryptAcquireContext(&provider, nullptr, nullptr, + PROV_RSA_FULL, CRYPT_NEWKEYSET)) { vlog.error("unable to create keyset"); provider = 0; } @@ -68,7 +70,7 @@ RandomStream::RandomStream() #endif #endif vlog.error("no OS supplied random source - using rand()"); - seed += (unsigned int) time(0) + getpid() + getpid() * 987654 + rand(); + seed += (unsigned int) time(nullptr) + getpid() + getpid() * 987654 + rand(); srand(seed); } } diff --git a/common/rdr/RandomStream.h b/common/rdr/RandomStream.h index 521012e0..48f373c1 100644 --- a/common/rdr/RandomStream.h +++ b/common/rdr/RandomStream.h @@ -40,7 +40,7 @@ namespace rdr { virtual ~RandomStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; private: static unsigned int seed; diff --git a/common/rdr/TLSInStream.cxx b/common/rdr/TLSInStream.cxx index 7ba98155..d13cee1f 100644 --- a/common/rdr/TLSInStream.cxx +++ b/common/rdr/TLSInStream.cxx @@ -41,7 +41,7 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr_t str, void* data, size_t size) self->streamEmpty = false; delete self->saved_exception; - self->saved_exception = NULL; + self->saved_exception = nullptr; try { if (!in->hasData(1)) { @@ -72,7 +72,7 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr_t str, void* data, size_t size) } TLSInStream::TLSInStream(InStream* _in, gnutls_session_t _session) - : session(_session), in(_in), saved_exception(NULL) + : session(_session), in(_in), saved_exception(nullptr) { gnutls_transport_ptr_t recv, send; @@ -83,7 +83,7 @@ TLSInStream::TLSInStream(InStream* _in, gnutls_session_t _session) TLSInStream::~TLSInStream() { - gnutls_transport_set_pull_function(session, NULL); + gnutls_transport_set_pull_function(session, nullptr); delete saved_exception; } diff --git a/common/rdr/TLSInStream.h b/common/rdr/TLSInStream.h index 5b1b716f..ca69ddde 100644 --- a/common/rdr/TLSInStream.h +++ b/common/rdr/TLSInStream.h @@ -33,7 +33,7 @@ namespace rdr { virtual ~TLSInStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; size_t readTLS(uint8_t* buf, size_t len); static ssize_t pull(gnutls_transport_ptr_t str, void* data, size_t size); diff --git a/common/rdr/TLSOutStream.cxx b/common/rdr/TLSOutStream.cxx index a06dd285..c2f69310 100644 --- a/common/rdr/TLSOutStream.cxx +++ b/common/rdr/TLSOutStream.cxx @@ -41,7 +41,7 @@ ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, OutStream *out = self->out; delete self->saved_exception; - self->saved_exception = NULL; + self->saved_exception = nullptr; try { out->writeBytes((const uint8_t*)data, size); @@ -62,7 +62,7 @@ ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, } TLSOutStream::TLSOutStream(OutStream* _out, gnutls_session_t _session) - : session(_session), out(_out), saved_exception(NULL) + : session(_session), out(_out), saved_exception(nullptr) { gnutls_transport_ptr_t recv, send; @@ -79,7 +79,7 @@ TLSOutStream::~TLSOutStream() } catch (Exception&) { } #endif - gnutls_transport_set_push_function(session, NULL); + gnutls_transport_set_push_function(session, nullptr); delete saved_exception; } diff --git a/common/rdr/TLSOutStream.h b/common/rdr/TLSOutStream.h index 2d365f36..35714238 100644 --- a/common/rdr/TLSOutStream.h +++ b/common/rdr/TLSOutStream.h @@ -31,11 +31,11 @@ namespace rdr { TLSOutStream(OutStream* out, gnutls_session_t session); virtual ~TLSOutStream(); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; size_t writeTLS(const uint8_t* data, size_t length); static ssize_t push(gnutls_transport_ptr_t str, const void* data, size_t size); diff --git a/common/rdr/ZlibInStream.cxx b/common/rdr/ZlibInStream.cxx index 6441f0a1..a90d50f7 100644 --- a/common/rdr/ZlibInStream.cxx +++ b/common/rdr/ZlibInStream.cxx @@ -29,7 +29,7 @@ using namespace rdr; ZlibInStream::ZlibInStream() - : underlying(0), zs(NULL), bytesIn(0) + : underlying(nullptr), zs(nullptr), bytesIn(0) { init(); } @@ -54,7 +54,7 @@ void ZlibInStream::flushUnderlying() skip(avail()); } - setUnderlying(NULL, 0); + setUnderlying(nullptr, 0); } void ZlibInStream::reset() @@ -65,28 +65,28 @@ void ZlibInStream::reset() void ZlibInStream::init() { - assert(zs == NULL); + assert(zs == nullptr); zs = new z_stream; - zs->zalloc = Z_NULL; - zs->zfree = Z_NULL; - zs->opaque = Z_NULL; - zs->next_in = Z_NULL; + zs->zalloc = nullptr; + zs->zfree = nullptr; + zs->opaque = nullptr; + zs->next_in = nullptr; zs->avail_in = 0; if (inflateInit(zs) != Z_OK) { delete zs; - zs = NULL; + zs = nullptr; throw Exception("ZlibInStream: inflateInit failed"); } } void ZlibInStream::deinit() { - assert(zs != NULL); - setUnderlying(NULL, 0); + assert(zs != nullptr); + setUnderlying(nullptr, 0); inflateEnd(zs); delete zs; - zs = NULL; + zs = nullptr; } bool ZlibInStream::fillBuffer() diff --git a/common/rdr/ZlibInStream.h b/common/rdr/ZlibInStream.h index cce6a6e0..a0c31161 100644 --- a/common/rdr/ZlibInStream.h +++ b/common/rdr/ZlibInStream.h @@ -44,7 +44,7 @@ namespace rdr { void init(); void deinit(); - virtual bool fillBuffer(); + bool fillBuffer() override; private: InStream* underlying; diff --git a/common/rdr/ZlibOutStream.cxx b/common/rdr/ZlibOutStream.cxx index 63820b8e..0b167711 100644 --- a/common/rdr/ZlibOutStream.cxx +++ b/common/rdr/ZlibOutStream.cxx @@ -39,10 +39,10 @@ ZlibOutStream::ZlibOutStream(OutStream* os, int compressLevel) : underlying(os), compressionLevel(compressLevel), newLevel(compressLevel) { zs = new z_stream; - zs->zalloc = Z_NULL; - zs->zfree = Z_NULL; - zs->opaque = Z_NULL; - zs->next_in = Z_NULL; + zs->zalloc = nullptr; + zs->zfree = nullptr; + zs->opaque = nullptr; + zs->next_in = nullptr; zs->avail_in = 0; if (deflateInit(zs, compressLevel) != Z_OK) { delete zs; @@ -78,14 +78,14 @@ void ZlibOutStream::setCompressionLevel(int level) void ZlibOutStream::flush() { BufferedOutStream::flush(); - if (underlying != NULL) + if (underlying != nullptr) underlying->flush(); } void ZlibOutStream::cork(bool enable) { BufferedOutStream::cork(enable); - if (underlying != NULL) + if (underlying != nullptr) underlying->cork(enable); } diff --git a/common/rdr/ZlibOutStream.h b/common/rdr/ZlibOutStream.h index 8061a58c..14df2a84 100644 --- a/common/rdr/ZlibOutStream.h +++ b/common/rdr/ZlibOutStream.h @@ -35,16 +35,16 @@ namespace rdr { public: - ZlibOutStream(OutStream* os=0, int compressionLevel=-1); + ZlibOutStream(OutStream* os=nullptr, int compressionLevel=-1); virtual ~ZlibOutStream(); void setUnderlying(OutStream* os); void setCompressionLevel(int level=-1); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; void deflate(int flush); void checkCompressionLevel(); diff --git a/common/rfb/Blacklist.cxx b/common/rfb/Blacklist.cxx index 12a54c45..68420ae2 100644 --- a/common/rfb/Blacklist.cxx +++ b/common/rfb/Blacklist.cxx @@ -67,7 +67,7 @@ bool Blacklist::isBlackmarked(const char* name) { // Entry exists - has it reached the threshold yet? if ((*i).second.marks >= threshold) { // Yes - entry is blocked - has the timeout expired? - time_t now = time(0); + time_t now = time(nullptr); if (now >= (*i).second.blockUntil) { // Timeout has expired. Reset timeout and allow // a re-try. diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index 0f4fc4f8..b4017dba 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -25,6 +25,8 @@ #include <stdio.h> #include <string.h> +#include <algorithm> + #include <rfb/Exception.h> #include <rfb/clipboardTypes.h> #include <rfb/fenceTypes.h> @@ -48,10 +50,10 @@ using namespace rfb; static LogWriter vlog("CConnection"); CConnection::CConnection() - : csecurity(0), + : csecurity(nullptr), supportsLocalCursor(false), supportsCursorPosition(false), supportsDesktopResize(false), supportsLEDState(false), - is(0), os(0), reader_(0), writer_(0), + is(nullptr), os(nullptr), reader_(nullptr), writer_(nullptr), shared(false), state_(RFBSTATE_UNINITIALISED), pendingPFChange(false), preferredEncoding(encodingTight), @@ -59,7 +61,7 @@ CConnection::CConnection() formatChange(false), encodingChange(false), firstUpdate(true), pendingUpdate(false), continuousUpdates(false), forceNonincremental(true), - framebuffer(NULL), decoder(this), + framebuffer(nullptr), decoder(this), hasRemoteClipboard(false), hasLocalClipboard(false) { } @@ -71,7 +73,7 @@ CConnection::~CConnection() void CConnection::setServerName(const char* name_) { - if (name_ == NULL) + if (name_ == nullptr) name_ = ""; serverName = name_; } @@ -91,7 +93,7 @@ void CConnection::setFramebuffer(ModifiablePixelBuffer* fb) assert(fb->height() == server.height()); } - if ((framebuffer != NULL) && (fb != NULL)) { + if ((framebuffer != nullptr) && (fb != nullptr)) { Rect rect; const uint8_t* data; @@ -226,14 +228,8 @@ bool CConnection::processSecurityTypesMsg() state_ = RFBSTATE_SECURITY_REASON; return true; } else if (secType == secTypeNone || secType == secTypeVncAuth) { - std::list<uint8_t>::iterator i; - for (i = secTypes.begin(); i != secTypes.end(); i++) - if (*i == secType) { - secType = *i; - break; - } - - if (i == secTypes.end()) + if (std::find(secTypes.begin(), secTypes.end(), + secType) == secTypes.end()) secType = secTypeInvalid; } else { vlog.error("Unknown 3.3 security type %d", secType); @@ -260,8 +256,6 @@ bool CConnection::processSecurityTypesMsg() return true; } - std::list<uint8_t>::iterator j; - for (int i = 0; i < nServerSecTypes; i++) { uint8_t serverSecType = is->readU8(); vlog.debug("Server offers security type %s(%d)", @@ -272,12 +266,10 @@ bool CConnection::processSecurityTypesMsg() * It means server's order specifies priority. */ if (secType == secTypeInvalid) { - for (j = secTypes.begin(); j != secTypes.end(); j++) - if (*j == serverSecType) { - secType = *j; - break; - } - } + if (std::find(secTypes.begin(), secTypes.end(), + serverSecType) != secTypes.end()) + secType = serverSecType; + } } // Inform the server of our decision @@ -340,7 +332,7 @@ bool CConnection::processSecurityResultMsg() if (server.beforeVersion(3,8)) { state_ = RFBSTATE_INVALID; - throw AuthFailureException(); + throw AuthFailureException("Authentication failed"); } state_ = RFBSTATE_SECURITY_REASON; @@ -399,13 +391,13 @@ void CConnection::close() vlog.error("%s", e.str()); } - setFramebuffer(NULL); + setFramebuffer(nullptr); delete csecurity; - csecurity = NULL; + csecurity = nullptr; delete reader_; - reader_ = NULL; + reader_ = nullptr; delete writer_; - writer_ = NULL; + writer_ = nullptr; } void CConnection::setDesktopSize(int w, int h) @@ -420,7 +412,7 @@ void CConnection::setDesktopSize(int w, int h) server.height()); resizeFramebuffer(); - assert(framebuffer != NULL); + assert(framebuffer != nullptr); assert(framebuffer->width() == server.width()); assert(framebuffer->height() == server.height()); } @@ -440,7 +432,7 @@ void CConnection::setExtendedDesktopSize(unsigned reason, server.height()); resizeFramebuffer(); - assert(framebuffer != NULL); + assert(framebuffer != nullptr); assert(framebuffer->width() == server.width()); assert(framebuffer->height() == server.height()); } @@ -471,7 +463,7 @@ void CConnection::serverInit(int width, int height, vlog.debug("initialisation done"); initDone(); - assert(framebuffer != NULL); + assert(framebuffer != nullptr); assert(framebuffer->width() == server.width()); assert(framebuffer->height() == server.height()); @@ -501,7 +493,7 @@ void CConnection::framebufferUpdateStart() { CMsgHandler::framebufferUpdateStart(); - assert(framebuffer != NULL); + assert(framebuffer != nullptr); // Note: This might not be true if continuous updates are supported pendingUpdate = false; @@ -683,7 +675,7 @@ void CConnection::sendClipboardData(const char* data) // FIXME: This conversion magic should be in CMsgWriter std::string filtered(convertCRLF(data)); size_t sizes[1] = { filtered.size() + 1 }; - const uint8_t* data[1] = { (const uint8_t*)filtered.c_str() }; + const uint8_t* datas[1] = { (const uint8_t*)filtered.c_str() }; if (unsolicitedClipboardAttempt) { unsolicitedClipboardAttempt = false; @@ -695,7 +687,7 @@ void CConnection::sendClipboardData(const char* data) } } - writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, data); + writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, datas); } else { writer()->writeClientCutText(data); } diff --git a/common/rfb/CConnection.h b/common/rfb/CConnection.h index df0fbb14..b30a997b 100644 --- a/common/rfb/CConnection.h +++ b/common/rfb/CConnection.h @@ -35,7 +35,6 @@ namespace rfb { class CMsgReader; class CMsgWriter; class CSecurity; - class IdentityVerifier; class CConnection : public CMsgHandler { public: @@ -75,16 +74,11 @@ namespace rfb { // there is data to read on the InStream. void initialiseProtocol(); - // processMsg() should be called whenever there is either: - // - data available on the underlying network stream - // In this case, processMsg may return without processing an RFB message, - // if the available data does not result in an RFB message being ready - // to handle. e.g. if data is encrypted. - // NB: This makes it safe to call processMsg() in response to select() - // - data available on the CConnection's current InStream - // In this case, processMsg should always process the available RFB - // message before returning. - // NB: In either case, you must have called initialiseProtocol() first. + // processMsg() should be called whenever there is data available on + // the CConnection's current InStream. It will process at most one + // RFB message before returning. If there was insufficient data, + // then it will return false and should be called again once more + // data is available. bool processMsg(); // close() gracefully shuts down the connection to the server and @@ -97,34 +91,32 @@ namespace rfb { // Note: These must be called by any deriving classes - virtual void setDesktopSize(int w, int h); - virtual void setExtendedDesktopSize(unsigned reason, unsigned result, - int w, int h, - const ScreenSet& layout); + void setDesktopSize(int w, int h) override; + void setExtendedDesktopSize(unsigned reason, unsigned result, + int w, int h, + const ScreenSet& layout) override; - virtual void endOfContinuousUpdates(); + void endOfContinuousUpdates() override; - virtual void serverInit(int width, int height, - const PixelFormat& pf, - const char* name); + void serverInit(int width, int height, const PixelFormat& pf, + const char* name) override; - virtual bool readAndDecodeRect(const Rect& r, int encoding, - ModifiablePixelBuffer* pb); + bool readAndDecodeRect(const Rect& r, int encoding, + ModifiablePixelBuffer* pb) override; - virtual void framebufferUpdateStart(); - virtual void framebufferUpdateEnd(); - virtual bool dataRect(const Rect& r, int encoding); + void framebufferUpdateStart() override; + void framebufferUpdateEnd() override; + bool dataRect(const Rect& r, int encoding) override; - virtual void serverCutText(const char* str); + void serverCutText(const char* str) override; - virtual void handleClipboardCaps(uint32_t flags, - const uint32_t* lengths); - virtual void handleClipboardRequest(uint32_t flags); - virtual void handleClipboardPeek(); - virtual void handleClipboardNotify(uint32_t flags); - virtual void handleClipboardProvide(uint32_t flags, - const size_t* lengths, - const uint8_t* const* data); + void handleClipboardCaps(uint32_t flags, + const uint32_t* lengths) override; + void handleClipboardRequest(uint32_t flags) override; + void handleClipboardPeek() override; + void handleClipboardNotify(uint32_t flags) override; + void handleClipboardProvide(uint32_t flags, const size_t* lengths, + const uint8_t* const* data) override; // Methods to be overridden in a derived class @@ -249,7 +241,7 @@ namespace rfb { // responds to requests, stating no support for synchronisation. // When overriding, call CMsgHandler::fence() directly in order to // state correct support for fence flags. - virtual void fence(uint32_t flags, unsigned len, const uint8_t data[]); + void fence(uint32_t flags, unsigned len, const uint8_t data[]) override; private: bool processVersionMsg(); diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt index 360434a9..36535448 100644 --- a/common/rfb/CMakeLists.txt +++ b/common/rfb/CMakeLists.txt @@ -50,7 +50,6 @@ add_library(rfb STATIC SSecurityStack.cxx SSecurityVncAuth.cxx SSecurityVeNCrypt.cxx - ScaleFilters.cxx Timer.cxx TightDecoder.cxx TightEncoder.cxx @@ -101,6 +100,10 @@ if(GNUTLS_FOUND) target_sources(rfb PRIVATE CSecurityTLS.cxx SSecurityTLS.cxx) target_include_directories(rfb SYSTEM PUBLIC ${GNUTLS_INCLUDE_DIR}) target_link_libraries(rfb ${GNUTLS_LIBRARIES}) + # FIXME: Hack to block it marking gnutls_free() as dllimport + if(WIN32 AND BUILD_STATIC) + target_compile_definitions(rfb PRIVATE GNUTLS_INTERNAL_BUILD) + endif() endif() if (NETTLE_FOUND) diff --git a/common/rfb/CMsgHandler.cxx b/common/rfb/CMsgHandler.cxx index c3594af9..4489dbd4 100644 --- a/common/rfb/CMsgHandler.cxx +++ b/common/rfb/CMsgHandler.cxx @@ -59,11 +59,6 @@ void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result, server.setDimensions(width, height, layout); } -void CMsgHandler::setPixelFormat(const PixelFormat& pf) -{ - server.setPF(pf); -} - void CMsgHandler::setName(const char* name) { server.setName(name); diff --git a/common/rfb/CMsgHandler.h b/common/rfb/CMsgHandler.h index 16a53c6a..9e5f7de2 100644 --- a/common/rfb/CMsgHandler.h +++ b/common/rfb/CMsgHandler.h @@ -39,12 +39,12 @@ namespace rfb { CMsgHandler(); virtual ~CMsgHandler(); - // The following methods are called as corresponding messages are read. A - // derived class should override these methods as desired. Note that for - // the setDesktopSize(), setExtendedDesktopSize(), setPixelFormat(), - // setName(), serverInit() and clipboardCaps methods, a derived class - // should call on to CMsgHandler's methods to set the members of "server" - // appropriately. + // The following methods are called as corresponding messages are + // read. A derived class should override these methods as desired. + // Note that for the setDesktopSize(), setExtendedDesktopSize(), + // setName(), serverInit() and handleClipboardCaps() methods, a + // derived class should call on to CMsgHandler's methods to set the + // members of "server" appropriately. virtual void setDesktopSize(int w, int h); virtual void setExtendedDesktopSize(unsigned reason, unsigned result, @@ -53,7 +53,6 @@ namespace rfb { virtual void setCursor(int width, int height, const Point& hotspot, const uint8_t* data) = 0; virtual void setCursorPos(const Point& pos) = 0; - virtual void setPixelFormat(const PixelFormat& pf); virtual void setName(const char* name); virtual void fence(uint32_t flags, unsigned len, const uint8_t data[]); virtual void endOfContinuousUpdates(); diff --git a/common/rfb/CMsgReader.cxx b/common/rfb/CMsgReader.cxx index 006645df..8bcdbfd0 100644 --- a/common/rfb/CMsgReader.cxx +++ b/common/rfb/CMsgReader.cxx @@ -385,7 +385,7 @@ bool CMsgReader::readExtendedClipboard(int32_t len) } zis.flushUnderlying(); - zis.setUnderlying(NULL, 0); + zis.setUnderlying(nullptr, 0); handler->handleClipboardProvide(flags, lengths, buffers); @@ -827,31 +827,31 @@ bool CMsgReader::readExtendedDesktopSize(int x, int y, int w, int h) bool CMsgReader::readLEDState() { - uint8_t state; + uint8_t ledState; if (!is->hasData(1)) return false; - state = is->readU8(); + ledState = is->readU8(); - handler->setLEDState(state); + handler->setLEDState(ledState); return true; } bool CMsgReader::readVMwareLEDState() { - uint32_t state; + uint32_t ledState; if (!is->hasData(4)) return false; - state = is->readU32(); + ledState = is->readU32(); // As luck has it, this extension uses the same bit definitions, // so no conversion required - handler->setLEDState(state); + handler->setLEDState(ledState); return true; } diff --git a/common/rfb/CMsgWriter.cxx b/common/rfb/CMsgWriter.cxx index e941aaa7..1bd8040f 100644 --- a/common/rfb/CMsgWriter.cxx +++ b/common/rfb/CMsgWriter.cxx @@ -65,12 +65,11 @@ void CMsgWriter::writeSetPixelFormat(const PixelFormat& pf) void CMsgWriter::writeSetEncodings(const std::list<uint32_t> encodings) { - std::list<uint32_t>::const_iterator iter; startMsg(msgTypeSetEncodings); os->pad(1); os->writeU16(encodings.size()); - for (iter = encodings.begin(); iter != encodings.end(); ++iter) - os->writeU32(*iter); + for (uint32_t encoding : encodings) + os->writeU32(encoding); endMsg(); } @@ -174,7 +173,7 @@ void CMsgWriter::writeKeyEvent(uint32_t keysym, uint32_t keycode, bool down) } -void CMsgWriter::writePointerEvent(const Point& pos, int buttonMask) +void CMsgWriter::writePointerEvent(const Point& pos, uint8_t buttonMask) { Point p(pos); if (p.x < 0) p.x = 0; @@ -192,7 +191,7 @@ void CMsgWriter::writePointerEvent(const Point& pos, int buttonMask) void CMsgWriter::writeClientCutText(const char* str) { - if (strchr(str, '\r') != NULL) + if (strchr(str, '\r') != nullptr) throw Exception("Invalid carriage return in clipboard data"); std::string latin1(utf8ToLatin1(str)); diff --git a/common/rfb/CMsgWriter.h b/common/rfb/CMsgWriter.h index 1b70a1d0..61df567f 100644 --- a/common/rfb/CMsgWriter.h +++ b/common/rfb/CMsgWriter.h @@ -54,7 +54,7 @@ namespace rfb { void writeFence(uint32_t flags, unsigned len, const uint8_t data[]); void writeKeyEvent(uint32_t keysym, uint32_t keycode, bool down); - void writePointerEvent(const Point& pos, int buttonMask); + void writePointerEvent(const Point& pos, uint8_t buttonMask); void writeClientCutText(const char* str); diff --git a/common/rfb/CSecurityDH.cxx b/common/rfb/CSecurityDH.cxx index f6e5ded4..f3b085c7 100644 --- a/common/rfb/CSecurityDH.cxx +++ b/common/rfb/CSecurityDH.cxx @@ -47,8 +47,8 @@ using namespace rfb; const int MinKeyLength = 128; const int MaxKeyLength = 1024; -CSecurityDH::CSecurityDH(CConnection* cc) - : CSecurity(cc), keyLength(0) +CSecurityDH::CSecurityDH(CConnection* cc_) + : CSecurity(cc_), keyLength(0) { mpz_init(g); mpz_init(p); @@ -86,9 +86,9 @@ bool CSecurityDH::readKey() uint16_t gen = is->readU16(); keyLength = is->readU16(); if (keyLength < MinKeyLength) - throw AuthFailureException("DH key is too short"); + throw Exception("DH key is too short"); if (keyLength > MaxKeyLength) - throw AuthFailureException("DH key is too long"); + throw Exception("DH key is too long"); if (!is->hasDataOrRestore(keyLength * 2)) return false; is->clearRestorePoint(); @@ -112,7 +112,7 @@ void CSecurityDH::writeCredentials() std::vector<uint8_t> bBytes(keyLength); if (!rs.hasData(keyLength)) - throw ConnFailedException("failed to generate DH private key"); + throw Exception("failed to generate DH private key"); rs.readBytes(bBytes.data(), bBytes.size()); nettle_mpz_set_str_256_u(b, bBytes.size(), bBytes.data()); mpz_powm(k, A, b, p); @@ -132,13 +132,13 @@ void CSecurityDH::writeCredentials() uint8_t buf[128]; if (!rs.hasData(128)) - throw ConnFailedException("failed to generate random padding"); + throw Exception("failed to generate random padding"); rs.readBytes(buf, 128); if (username.size() >= 64) - throw AuthFailureException("username is too long"); + throw Exception("username is too long"); memcpy(buf, username.c_str(), username.size() + 1); if (password.size() >= 64) - throw AuthFailureException("password is too long"); + throw Exception("password is too long"); memcpy(buf + 64, password.c_str(), password.size() + 1); aes128_encrypt(&aesCtx, 128, buf, buf); diff --git a/common/rfb/CSecurityDH.h b/common/rfb/CSecurityDH.h index d0e5e894..df33d29b 100644 --- a/common/rfb/CSecurityDH.h +++ b/common/rfb/CSecurityDH.h @@ -33,9 +33,9 @@ namespace rfb { public: CSecurityDH(CConnection* cc); virtual ~CSecurityDH(); - virtual bool processMsg(); - virtual int getType() const { return secTypeDH; } - virtual bool isSecure() const { return false; } + bool processMsg() override; + int getType() const override { return secTypeDH; } + bool isSecure() const override { return false; } private: bool readKey(); diff --git a/common/rfb/CSecurityMSLogonII.cxx b/common/rfb/CSecurityMSLogonII.cxx index d7e23715..dc817518 100644 --- a/common/rfb/CSecurityMSLogonII.cxx +++ b/common/rfb/CSecurityMSLogonII.cxx @@ -44,8 +44,8 @@ using namespace rfb; -CSecurityMSLogonII::CSecurityMSLogonII(CConnection* cc) - : CSecurity(cc) +CSecurityMSLogonII::CSecurityMSLogonII(CConnection* cc_) + : CSecurity(cc_) { mpz_init(g); mpz_init(p); @@ -101,7 +101,7 @@ void CSecurityMSLogonII::writeCredentials() std::vector<uint8_t> bBytes(8); if (!rs.hasData(8)) - throw ConnFailedException("failed to generate DH private key"); + throw Exception("failed to generate DH private key"); rs.readBytes(bBytes.data(), bBytes.size()); nettle_mpz_set_str_256_u(b, bBytes.size(), bBytes.data()); mpz_powm(k, A, b, p); @@ -123,14 +123,14 @@ void CSecurityMSLogonII::writeCredentials() } if (!rs.hasData(256 + 64)) - throw ConnFailedException("failed to generate random padding"); + throw Exception("failed to generate random padding"); rs.readBytes(user, 256); rs.readBytes(pass, 64); if (username.size() >= 256) - throw AuthFailureException("username is too long"); + throw Exception("username is too long"); memcpy(user, username.c_str(), username.size() + 1); if (password.size() >= 64) - throw AuthFailureException("password is too long"); + throw Exception("password is too long"); memcpy(pass, password.c_str(), password.size() + 1); // DES-CBC with the original key as IV, and the reversed one as the DES key diff --git a/common/rfb/CSecurityMSLogonII.h b/common/rfb/CSecurityMSLogonII.h index f7c83a3e..71600c85 100644 --- a/common/rfb/CSecurityMSLogonII.h +++ b/common/rfb/CSecurityMSLogonII.h @@ -33,9 +33,9 @@ namespace rfb { public: CSecurityMSLogonII(CConnection* cc); virtual ~CSecurityMSLogonII(); - virtual bool processMsg(); - virtual int getType() const { return secTypeMSLogonII; } - virtual bool isSecure() const { return false; } + bool processMsg() override; + int getType() const override { return secTypeMSLogonII; } + bool isSecure() const override { return false; } private: bool readKey(); diff --git a/common/rfb/CSecurityNone.h b/common/rfb/CSecurityNone.h index cb887914..df685d0d 100644 --- a/common/rfb/CSecurityNone.h +++ b/common/rfb/CSecurityNone.h @@ -29,9 +29,9 @@ namespace rfb { class CSecurityNone : public CSecurity { public: - CSecurityNone(CConnection* cc) : CSecurity(cc) {} - virtual bool processMsg() { return true; } - virtual int getType() const {return secTypeNone;} + CSecurityNone(CConnection* cc_) : CSecurity(cc_) {} + bool processMsg() override { return true; } + int getType() const override {return secTypeNone;} }; } #endif diff --git a/common/rfb/CSecurityPlain.h b/common/rfb/CSecurityPlain.h index add7e776..0dbf4064 100644 --- a/common/rfb/CSecurityPlain.h +++ b/common/rfb/CSecurityPlain.h @@ -26,9 +26,9 @@ namespace rfb { class CSecurityPlain : public CSecurity { public: - CSecurityPlain(CConnection* cc) : CSecurity(cc) {} - virtual bool processMsg(); - virtual int getType() const { return secTypePlain; } + CSecurityPlain(CConnection* cc_) : CSecurity(cc_) {} + bool processMsg() override; + int getType() const override { return secTypePlain; } }; } #endif diff --git a/common/rfb/CSecurityRSAAES.cxx b/common/rfb/CSecurityRSAAES.cxx index 5a4bc9c9..a78739ac 100644 --- a/common/rfb/CSecurityRSAAES.cxx +++ b/common/rfb/CSecurityRSAAES.cxx @@ -56,14 +56,14 @@ const int MaxKeyLength = 8192; using namespace rfb; -CSecurityRSAAES::CSecurityRSAAES(CConnection* cc, uint32_t _secType, +CSecurityRSAAES::CSecurityRSAAES(CConnection* cc_, uint32_t _secType, int _keySize, bool _isAllEncrypted) - : CSecurity(cc), state(ReadPublicKey), + : CSecurity(cc_), state(ReadPublicKey), keySize(_keySize), isAllEncrypted(_isAllEncrypted), secType(_secType), clientKey(), clientPublicKey(), serverKey(), - serverKeyN(NULL), serverKeyE(NULL), - clientKeyN(NULL), clientKeyE(NULL), - rais(NULL), raos(NULL), rawis(NULL), rawos(NULL) + serverKeyN(nullptr), serverKeyE(nullptr), + clientKeyN(nullptr), clientKeyE(nullptr), + rais(nullptr), raos(nullptr), rawis(nullptr), rawos(nullptr) { assert(keySize == 128 || keySize == 256); } @@ -135,7 +135,7 @@ static void random_func(void* ctx, size_t length, uint8_t* dst) { rdr::RandomStream* rs = (rdr::RandomStream*)ctx; if (!rs->hasData(length)) - throw ConnFailedException("failed to generate random"); + throw Exception("failed to generate random"); rs->readBytes(dst, length); } @@ -154,8 +154,9 @@ void CSecurityRSAAES::writePublicKey() // set e = 65537 mpz_set_ui(clientPublicKey.e, 65537); if (!rsa_generate_keypair(&clientPublicKey, &clientKey, - &rs, random_func, NULL, NULL, clientKeyLength, 0)) - throw AuthFailureException("failed to generate key"); + &rs, random_func, nullptr, nullptr, + clientKeyLength, 0)) + throw Exception("failed to generate key"); clientKeyN = new uint8_t[rsaKeySize]; clientKeyE = new uint8_t[rsaKeySize]; nettle_mpz_get_str_256(rsaKeySize, clientKeyN, clientPublicKey.n); @@ -174,9 +175,9 @@ bool CSecurityRSAAES::readPublicKey() is->setRestorePoint(); serverKeyLength = is->readU32(); if (serverKeyLength < MinKeyLength) - throw AuthFailureException("server key is too short"); + throw Exception("server key is too short"); if (serverKeyLength > MaxKeyLength) - throw AuthFailureException("server key is too long"); + throw Exception("server key is too long"); size_t size = (serverKeyLength + 7) / 8; if (!is->hasDataOrRestore(size * 2)) return false; @@ -189,7 +190,7 @@ bool CSecurityRSAAES::readPublicKey() nettle_mpz_set_str_256_u(serverKey.n, size, serverKeyN); nettle_mpz_set_str_256_u(serverKey.e, size, serverKeyE); if (!rsa_public_key_prepare(&serverKey)) - throw AuthFailureException("server key is invalid"); + throw Exception("server key is invalid"); return true; } @@ -215,14 +216,14 @@ void CSecurityRSAAES::verifyServer() "Please verify that the information is correct and press \"Yes\". " "Otherwise press \"No\"", f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]); if (!msg->showMsgBox(UserMsgBox::M_YESNO, title, text.c_str())) - throw AuthFailureException("server key mismatch"); + throw Exception("server key mismatch"); } void CSecurityRSAAES::writeRandom() { rdr::OutStream* os = cc->getOutStream(); if (!rs.hasData(keySize / 8)) - throw ConnFailedException("failed to generate random"); + throw Exception("failed to generate random"); rs.readBytes(clientRandom, keySize / 8); mpz_t x; mpz_init(x); @@ -236,7 +237,7 @@ void CSecurityRSAAES::writeRandom() } if (!res) { mpz_clear(x); - throw AuthFailureException("failed to encrypt random"); + throw Exception("failed to encrypt random"); } uint8_t* buffer = new uint8_t[serverKey.size]; nettle_mpz_get_str_256(serverKey.size, buffer, x); @@ -255,7 +256,7 @@ bool CSecurityRSAAES::readRandom() is->setRestorePoint(); size_t size = is->readU16(); if (size != clientKey.size) - throw AuthFailureException("client key length doesn't match"); + throw Exception("client key length doesn't match"); if (!is->hasDataOrRestore(size)) return false; is->clearRestorePoint(); @@ -268,7 +269,7 @@ bool CSecurityRSAAES::readRandom() if (!rsa_decrypt(&clientKey, &randomSize, serverRandom, x) || randomSize != (size_t)keySize / 8) { mpz_clear(x); - throw AuthFailureException("failed to decrypt server random"); + throw Exception("failed to decrypt server random"); } mpz_clear(x); return true; @@ -397,7 +398,7 @@ bool CSecurityRSAAES::readHash() sha256_digest(&ctx, hashSize, realHash); } if (memcmp(hash, realHash, hashSize) != 0) - throw AuthFailureException("hash doesn't match"); + throw Exception("hash doesn't match"); return true; } @@ -413,10 +414,10 @@ void CSecurityRSAAES::clearSecrets() delete[] serverKeyE; delete[] clientKeyN; delete[] clientKeyE; - serverKeyN = NULL; - serverKeyE = NULL; - clientKeyN = NULL; - clientKeyE = NULL; + serverKeyN = nullptr; + serverKeyE = nullptr; + clientKeyN = nullptr; + clientKeyE = nullptr; memset(serverRandom, 0, sizeof(serverRandom)); memset(clientRandom, 0, sizeof(clientRandom)); } @@ -427,7 +428,7 @@ bool CSecurityRSAAES::readSubtype() return false; subtype = rais->readU8(); if (subtype != secTypeRA2UserPass && subtype != secTypeRA2Pass) - throw AuthFailureException("unknown RSA-AES subtype"); + throw Exception("unknown RSA-AES subtype"); return true; } @@ -439,11 +440,11 @@ void CSecurityRSAAES::writeCredentials() if (subtype == secTypeRA2UserPass) (CSecurity::upg)->getUserPasswd(isSecure(), &username, &password); else - (CSecurity::upg)->getUserPasswd(isSecure(), NULL, &password); + (CSecurity::upg)->getUserPasswd(isSecure(), nullptr, &password); if (subtype == secTypeRA2UserPass) { if (username.size() > 255) - throw AuthFailureException("username is too long"); + throw Exception("username is too long"); raos->writeU8(username.size()); raos->writeBytes((const uint8_t*)username.data(), username.size()); } else { @@ -451,7 +452,7 @@ void CSecurityRSAAES::writeCredentials() } if (password.size() > 255) - throw AuthFailureException("password is too long"); + throw Exception("password is too long"); raos->writeU8(password.size()); raos->writeBytes((const uint8_t*)password.data(), password.size()); raos->flush(); diff --git a/common/rfb/CSecurityRSAAES.h b/common/rfb/CSecurityRSAAES.h index 543b0152..29bfd575 100644 --- a/common/rfb/CSecurityRSAAES.h +++ b/common/rfb/CSecurityRSAAES.h @@ -39,9 +39,9 @@ namespace rfb { CSecurityRSAAES(CConnection* cc, uint32_t secType, int keySize, bool isAllEncrypted); virtual ~CSecurityRSAAES(); - virtual bool processMsg(); - virtual int getType() const { return secType; } - virtual bool isSecure() const { return secType == secTypeRA256; } + bool processMsg() override; + int getType() const override { return secType; } + bool isSecure() const override { return secType == secTypeRA256; } static IntParameter RSAKeyLength; diff --git a/common/rfb/CSecurityStack.cxx b/common/rfb/CSecurityStack.cxx index 6b8da8dd..838d68ac 100644 --- a/common/rfb/CSecurityStack.cxx +++ b/common/rfb/CSecurityStack.cxx @@ -25,9 +25,9 @@ using namespace rfb; -CSecurityStack::CSecurityStack(CConnection* cc, int Type, +CSecurityStack::CSecurityStack(CConnection* cc_, int Type, CSecurity* s0, CSecurity* s1) - : CSecurity(cc), type(Type) + : CSecurity(cc_), type(Type) { state = 0; state0 = s0; diff --git a/common/rfb/CSecurityStack.h b/common/rfb/CSecurityStack.h index 56ac3fea..521597ec 100644 --- a/common/rfb/CSecurityStack.h +++ b/common/rfb/CSecurityStack.h @@ -28,11 +28,11 @@ namespace rfb { class CSecurityStack : public CSecurity { public: CSecurityStack(CConnection* cc, int Type, - CSecurity* s0 = NULL, CSecurity* s1 = NULL); + CSecurity* s0 = nullptr, CSecurity* s1 = nullptr); ~CSecurityStack(); - virtual bool processMsg(); - virtual int getType() const {return type;}; - virtual bool isSecure() const; + bool processMsg() override; + int getType() const override {return type;}; + bool isSecure() const override; protected: int state; CSecurity* state0; diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx index 11e6dfe3..2a7a1179 100644 --- a/common/rfb/CSecurityTLS.cxx +++ b/common/rfb/CSecurityTLS.cxx @@ -40,22 +40,13 @@ #include <rfb/Exception.h> #include <rfb/UserMsgBox.h> #include <rfb/util.h> +#include <rdr/TLSException.h> #include <rdr/TLSInStream.h> #include <rdr/TLSOutStream.h> #include <os/os.h> #include <gnutls/x509.h> -/* - * GNUTLS doesn't correctly export gnutls_free symbol which is - * a function pointer. Linking with Visual Studio 2008 Express will - * fail when you call gnutls_free(). - */ -#if WIN32 -#undef gnutls_free -#define gnutls_free free -#endif - using namespace rfb; static const char* configdirfn(const char* fn); @@ -75,19 +66,22 @@ static const char* configdirfn(const char* fn) const char* configdir; configdir = os::getvncconfigdir(); - if (configdir == NULL) + if (configdir == nullptr) return ""; snprintf(full_path, sizeof(full_path), "%s/%s", configdir, fn); return full_path; } -CSecurityTLS::CSecurityTLS(CConnection* cc, bool _anon) - : CSecurity(cc), session(NULL), anon_cred(NULL), cert_cred(NULL), - anon(_anon), tlsis(NULL), tlsos(NULL), rawis(NULL), rawos(NULL) +CSecurityTLS::CSecurityTLS(CConnection* cc_, bool _anon) + : CSecurity(cc_), session(nullptr), + anon_cred(nullptr), cert_cred(nullptr), + anon(_anon), tlsis(nullptr), tlsos(nullptr), + rawis(nullptr), rawos(nullptr) { - if (gnutls_global_init() != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_global_init failed"); + int err = gnutls_global_init(); + if (err != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_global_init()", err); } void CSecurityTLS::shutdown() @@ -103,32 +97,32 @@ void CSecurityTLS::shutdown() if (anon_cred) { gnutls_anon_free_client_credentials(anon_cred); - anon_cred = 0; + anon_cred = nullptr; } if (cert_cred) { gnutls_certificate_free_credentials(cert_cred); - cert_cred = 0; + cert_cred = nullptr; } if (rawis && rawos) { cc->setStreams(rawis, rawos); - rawis = NULL; - rawos = NULL; + rawis = nullptr; + rawos = nullptr; } if (tlsis) { delete tlsis; - tlsis = NULL; + tlsis = nullptr; } if (tlsos) { delete tlsos; - tlsos = NULL; + tlsos = nullptr; } if (session) { gnutls_deinit(session); - session = 0; + session = nullptr; } } @@ -147,17 +141,21 @@ bool CSecurityTLS::processMsg() client = cc; if (!session) { + int ret; + if (!is->hasData(1)) return false; if (is->readU8() == 0) - throw AuthFailureException("Server failed to initialize TLS session"); + throw Exception("Server failed to initialize TLS session"); - if (gnutls_init(&session, GNUTLS_CLIENT) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_init failed"); + ret = gnutls_init(&session, GNUTLS_CLIENT); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_init()", ret); - if (gnutls_set_default_priority(session) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_set_default_priority failed"); + ret = gnutls_set_default_priority(session); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_set_default_priority()", ret); setParam(); @@ -180,7 +178,7 @@ bool CSecurityTLS::processMsg() vlog.error("TLS Handshake failed: %s\n", gnutls_strerror (err)); shutdown(); - throw AuthFailureException("TLS Handshake failed"); + throw rdr::TLSException("TLS Handshake failed", err); } vlog.debug("TLS handshake completed with %s", @@ -206,8 +204,8 @@ void CSecurityTLS::setParam() prio = (char*)malloc(strlen(Security::GnuTLSPriority) + strlen(kx_anon_priority) + 1); - if (prio == NULL) - throw AuthFailureException("Not enough memory for GnuTLS priority string"); + if (prio == nullptr) + throw Exception("Not enough memory for GnuTLS priority string"); strcpy(prio, Security::GnuTLSPriority); if (anon) @@ -220,7 +218,7 @@ void CSecurityTLS::setParam() if (ret != GNUTLS_E_SUCCESS) { if (ret == GNUTLS_E_INVALID_REQUEST) vlog.error("GnuTLS priority syntax error at: %s", err); - throw AuthFailureException("gnutls_set_priority_direct failed"); + throw rdr::TLSException("gnutls_set_priority_direct()", ret); } } else if (anon) { const char *err; @@ -232,7 +230,7 @@ void CSecurityTLS::setParam() if (ret != GNUTLS_E_SUCCESS) { if (ret == GNUTLS_E_INVALID_REQUEST) vlog.error("GnuTLS priority syntax error at: %s", err); - throw AuthFailureException("gnutls_set_default_priority_append failed"); + throw rdr::TLSException("gnutls_set_default_priority_append()", ret); } #else // We don't know what the system default priority is, so we guess @@ -242,8 +240,8 @@ void CSecurityTLS::setParam() prio = (char*)malloc(strlen(gnutls_default_priority) + strlen(kx_anon_priority) + 1); - if (prio == NULL) - throw AuthFailureException("Not enough memory for GnuTLS priority string"); + if (prio == nullptr) + throw Exception("Not enough memory for GnuTLS priority string"); strcpy(prio, gnutls_default_priority); strcat(prio, kx_anon_priority); @@ -255,22 +253,25 @@ void CSecurityTLS::setParam() if (ret != GNUTLS_E_SUCCESS) { if (ret == GNUTLS_E_INVALID_REQUEST) vlog.error("GnuTLS priority syntax error at: %s", err); - throw AuthFailureException("gnutls_set_priority_direct failed"); + throw rdr::TLSException("gnutls_set_priority_direct()", ret); } #endif } if (anon) { - if (gnutls_anon_allocate_client_credentials(&anon_cred) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_anon_allocate_client_credentials failed"); + ret = gnutls_anon_allocate_client_credentials(&anon_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_anon_allocate_client_credentials()", ret); - if (gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_credentials_set failed"); + ret = gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_credentials_set()", ret); vlog.debug("Anonymous session has been set"); } else { - if (gnutls_certificate_allocate_credentials(&cert_cred) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_certificate_allocate_credentials failed"); + ret = gnutls_certificate_allocate_credentials(&cert_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_certificate_allocate_credentials()", ret); if (gnutls_certificate_set_x509_system_trust(cert_cred) < 1) vlog.error("Could not load system certificate trust store"); @@ -281,8 +282,9 @@ void CSecurityTLS::setParam() if (gnutls_certificate_set_x509_crl_file(cert_cred, X509CRL, GNUTLS_X509_FMT_PEM) < 0) vlog.error("Could not load user specified certificate revocation list"); - if (gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cert_cred) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_credentials_set failed"); + ret = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cert_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_credentials_set()", ret); if (gnutls_server_name_set(session, GNUTLS_NAME_DNS, client->getServerName(), @@ -304,7 +306,7 @@ void CSecurityTLS::checkSession() unsigned int status; const gnutls_datum_t *cert_list; unsigned int cert_list_size = 0; - int err; + int err, known; bool hostname_match; const char *hostsDir; @@ -315,12 +317,12 @@ void CSecurityTLS::checkSession() return; if (gnutls_certificate_type_get(session) != GNUTLS_CRT_X509) - throw AuthFailureException("unsupported certificate type"); + throw Exception("unsupported certificate type"); err = gnutls_certificate_verify_peers2(session, &status); if (err != 0) { vlog.error("server certificate verification failed: %s", gnutls_strerror(err)); - throw AuthFailureException("server certificate verification failed"); + throw rdr::TLSException("server certificate verification()", err); } if (status != 0) { @@ -338,11 +340,11 @@ void CSecurityTLS::checkSession() 0) < 0) throw Exception("Failed to get certificate error description"); - error = format("Invalid server certificate: %s", status_str.data); + error = (const char*)status_str.data; gnutls_free(status_str.data); - throw AuthFailureException(error.c_str()); + throw Exception("Invalid server certificate: %s", error.c_str()); } if (gnutls_certificate_verification_status_print(status, @@ -360,14 +362,14 @@ void CSecurityTLS::checkSession() cert_list = gnutls_certificate_get_peers(session, &cert_list_size); if (!cert_list_size) - throw AuthFailureException("empty certificate chain"); + throw Exception("empty certificate chain"); /* Process only server's certificate, not issuer's certificate */ gnutls_x509_crt_t crt; gnutls_x509_crt_init(&crt); if (gnutls_x509_crt_import(crt, &cert_list[0], GNUTLS_X509_FMT_DER) < 0) - throw AuthFailureException("decoding of certificate failed"); + throw Exception("decoding of certificate failed"); if (gnutls_x509_crt_check_hostname(crt, client->getServerName()) == 0) { vlog.info("Server certificate doesn't match given server name"); @@ -385,32 +387,33 @@ void CSecurityTLS::checkSession() /* Certificate has some user overridable problems, so TOFU time */ hostsDir = os::getvncstatedir(); - if (hostsDir == NULL) { - throw AuthFailureException("Could not obtain VNC state directory " - "path for known hosts storage"); + if (hostsDir == nullptr) { + throw Exception("Could not obtain VNC state directory path for " + "known hosts storage"); } std::string dbPath; dbPath = (std::string)hostsDir + "/x509_known_hosts"; - err = gnutls_verify_stored_pubkey(dbPath.c_str(), NULL, - client->getServerName(), NULL, - GNUTLS_CRT_X509, &cert_list[0], 0); + known = gnutls_verify_stored_pubkey(dbPath.c_str(), nullptr, + client->getServerName(), nullptr, + GNUTLS_CRT_X509, &cert_list[0], 0); /* Previously known? */ - if (err == GNUTLS_E_SUCCESS) { + if (known == GNUTLS_E_SUCCESS) { vlog.info("Server certificate found in known hosts file"); gnutls_x509_crt_deinit(crt); return; } - if ((err != GNUTLS_E_NO_CERTIFICATE_FOUND) && - (err != GNUTLS_E_CERTIFICATE_KEY_MISMATCH)) { - throw AuthFailureException("Could not load known hosts database"); + if ((known != GNUTLS_E_NO_CERTIFICATE_FOUND) && + (known != GNUTLS_E_CERTIFICATE_KEY_MISMATCH)) { + throw rdr::TLSException("Could not load known hosts database", known); } - if (gnutls_x509_crt_print(crt, GNUTLS_CRT_PRINT_ONELINE, &info)) - throw AuthFailureException("Could not find certificate to display"); + err = gnutls_x509_crt_print(crt, GNUTLS_CRT_PRINT_ONELINE, &info); + if (err != GNUTLS_E_SUCCESS) + throw rdr::TLSException("Could not find certificate to display", err); len = strlen((char*)info.data); for (size_t i = 0; i < len - 1; i++) { @@ -419,7 +422,7 @@ void CSecurityTLS::checkSession() } /* New host */ - if (err == GNUTLS_E_NO_CERTIFICATE_FOUND) { + if (known == GNUTLS_E_NO_CERTIFICATE_FOUND) { std::string text; vlog.info("Server host not previously known"); @@ -442,7 +445,7 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Unknown certificate issuer", text.c_str())) - throw AuthFailureException("Unknown certificate issuer"); + throw AuthCancelledException(); status &= ~(GNUTLS_CERT_INVALID | GNUTLS_CERT_SIGNER_NOT_FOUND | @@ -463,7 +466,7 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Certificate is not yet valid", text.c_str())) - throw AuthFailureException("Certificate is not yet valid"); + throw AuthCancelledException(); status &= ~GNUTLS_CERT_NOT_ACTIVATED; } @@ -482,7 +485,7 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Expired certificate", text.c_str())) - throw AuthFailureException("Expired certificate"); + throw AuthCancelledException(); status &= ~GNUTLS_CERT_EXPIRED; } @@ -501,14 +504,14 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Insecure certificate algorithm", text.c_str())) - throw AuthFailureException("Insecure certificate algorithm"); + throw AuthCancelledException(); status &= ~GNUTLS_CERT_INSECURE_ALGORITHM; } if (status != 0) { vlog.error("Unhandled certificate problems: 0x%x", status); - throw AuthFailureException("Unhandled certificate problems"); + throw Exception("Unhandled certificate problems"); } if (!hostname_match) { @@ -526,9 +529,9 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Certificate hostname mismatch", text.c_str())) - throw AuthFailureException("Certificate hostname mismatch"); + throw AuthCancelledException(); } - } else if (err == GNUTLS_E_CERTIFICATE_KEY_MISMATCH) { + } else if (known == GNUTLS_E_CERTIFICATE_KEY_MISMATCH) { std::string text; vlog.info("Server host key mismatch"); @@ -552,7 +555,7 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Unexpected server certificate", text.c_str())) - throw AuthFailureException("Unexpected server certificate"); + throw AuthCancelledException(); status &= ~(GNUTLS_CERT_INVALID | GNUTLS_CERT_SIGNER_NOT_FOUND | @@ -575,7 +578,7 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Unexpected server certificate", text.c_str())) - throw AuthFailureException("Unexpected server certificate"); + throw AuthCancelledException(); status &= ~GNUTLS_CERT_NOT_ACTIVATED; } @@ -596,7 +599,7 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Unexpected server certificate", text.c_str())) - throw AuthFailureException("Unexpected server certificate"); + throw AuthCancelledException(); status &= ~GNUTLS_CERT_EXPIRED; } @@ -617,14 +620,14 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Unexpected server certificate", text.c_str())) - throw AuthFailureException("Unexpected server certificate"); + throw AuthCancelledException(); status &= ~GNUTLS_CERT_INSECURE_ALGORITHM; } if (status != 0) { vlog.error("Unhandled certificate problems: 0x%x", status); - throw AuthFailureException("Unhandled certificate problems"); + throw Exception("Unhandled certificate problems"); } if (!hostname_match) { @@ -644,12 +647,13 @@ void CSecurityTLS::checkSession() if (!msg->showMsgBox(UserMsgBox::M_YESNO, "Unexpected server certificate", text.c_str())) - throw AuthFailureException("Unexpected server certificate"); + throw AuthCancelledException(); } } - if (gnutls_store_pubkey(dbPath.c_str(), NULL, client->getServerName(), - NULL, GNUTLS_CRT_X509, &cert_list[0], 0, 0)) + if (gnutls_store_pubkey(dbPath.c_str(), nullptr, + client->getServerName(), nullptr, + GNUTLS_CRT_X509, &cert_list[0], 0, 0)) vlog.error("Failed to store server certificate to known hosts database"); vlog.info("Exception added for server host"); diff --git a/common/rfb/CSecurityTLS.h b/common/rfb/CSecurityTLS.h index b9c345cf..8688b742 100644 --- a/common/rfb/CSecurityTLS.h +++ b/common/rfb/CSecurityTLS.h @@ -38,9 +38,9 @@ namespace rfb { public: CSecurityTLS(CConnection* cc, bool _anon); virtual ~CSecurityTLS(); - virtual bool processMsg(); - virtual int getType() const { return anon ? secTypeTLSNone : secTypeX509None; } - virtual bool isSecure() const { return !anon; } + bool processMsg() override; + int getType() const override { return anon ? secTypeTLSNone : secTypeX509None; } + bool isSecure() const override { return !anon; } static StringParameter X509CA; static StringParameter X509CRL; diff --git a/common/rfb/CSecurityVeNCrypt.cxx b/common/rfb/CSecurityVeNCrypt.cxx index 3c8e91ba..3ebb3855 100644 --- a/common/rfb/CSecurityVeNCrypt.cxx +++ b/common/rfb/CSecurityVeNCrypt.cxx @@ -26,22 +26,23 @@ #include <config.h> #endif +#include <algorithm> +#include <list> + #include <rfb/Exception.h> #include <rdr/InStream.h> #include <rdr/OutStream.h> #include <rfb/CConnection.h> #include <rfb/CSecurityVeNCrypt.h> #include <rfb/LogWriter.h> -#include <list> using namespace rfb; -using namespace rdr; -using namespace std; static LogWriter vlog("CVeNCrypt"); -CSecurityVeNCrypt::CSecurityVeNCrypt(CConnection* cc, SecurityClient* sec) - : CSecurity(cc), csecurity(NULL), security(sec) +CSecurityVeNCrypt::CSecurityVeNCrypt(CConnection* cc_, + SecurityClient* sec) + : CSecurity(cc_), csecurity(nullptr), security(sec) { haveRecvdMajorVersion = false; haveRecvdMinorVersion = false; @@ -54,7 +55,7 @@ CSecurityVeNCrypt::CSecurityVeNCrypt(CConnection* cc, SecurityClient* sec) minorVersion = 0; chosenType = secTypeVeNCrypt; nAvailableTypes = 0; - availableTypes = NULL; + availableTypes = nullptr; } CSecurityVeNCrypt::~CSecurityVeNCrypt() @@ -65,8 +66,8 @@ CSecurityVeNCrypt::~CSecurityVeNCrypt() bool CSecurityVeNCrypt::processMsg() { - InStream* is = cc->getInStream(); - OutStream* os = cc->getOutStream(); + rdr::InStream* is = cc->getInStream(); + rdr::OutStream* os = cc->getOutStream(); /* get major, minor versions, send what we can support (or 0.0 for can't support it) */ if (!haveRecvdMajorVersion) { @@ -104,7 +105,7 @@ bool CSecurityVeNCrypt::processMsg() os->writeU8(0); os->writeU8(0); os->flush(); - throw AuthFailureException("The server reported an unsupported VeNCrypt version"); + throw Exception("The server reported an unsupported VeNCrypt version"); } haveSentVersion = true; @@ -116,8 +117,8 @@ bool CSecurityVeNCrypt::processMsg() return false; if (is->readU8()) - throw AuthFailureException("The server reported it could not support the " - "VeNCrypt version"); + throw Exception("The server reported it could not support the " + "VeNCrypt version"); haveAgreedVersion = true; } @@ -130,7 +131,7 @@ bool CSecurityVeNCrypt::processMsg() nAvailableTypes = is->readU8(); if (!nAvailableTypes) - throw AuthFailureException("The server reported no VeNCrypt sub-types"); + throw Exception("The server reported no VeNCrypt sub-types"); availableTypes = new uint32_t[nAvailableTypes]; haveNumberOfTypes = true; @@ -156,27 +157,22 @@ bool CSecurityVeNCrypt::processMsg() if (!haveChosenType) { chosenType = secTypeInvalid; uint8_t i; - list<uint32_t>::iterator j; - list<uint32_t> secTypes; + std::list<uint32_t> secTypes; secTypes = security->GetEnabledExtSecTypes(); /* Honor server's security type order */ for (i = 0; i < nAvailableTypes; i++) { - for (j = secTypes.begin(); j != secTypes.end(); j++) { - if (*j == availableTypes[i]) { - chosenType = *j; - break; - } - } - - if (chosenType != secTypeInvalid) - break; + if (std::find(secTypes.begin(), secTypes.end(), + availableTypes[i]) != secTypes.end()) { + chosenType = availableTypes[i]; + break; + } } /* Set up the stack according to the chosen type: */ if (chosenType == secTypeInvalid || chosenType == secTypeVeNCrypt) - throw AuthFailureException("No valid VeNCrypt sub-type"); + throw Exception("No valid VeNCrypt sub-type"); vlog.info("Choosing security type %s (%d)", secTypeName(chosenType), chosenType); @@ -195,7 +191,7 @@ bool CSecurityVeNCrypt::processMsg() * happen, since if the server supports 0 sub-types, it doesn't support * this security type */ - throw AuthFailureException("The server reported 0 VeNCrypt sub-types"); + throw Exception("The server reported 0 VeNCrypt sub-types"); } return csecurity->processMsg(); diff --git a/common/rfb/CSecurityVeNCrypt.h b/common/rfb/CSecurityVeNCrypt.h index 476bf813..f73e7927 100644 --- a/common/rfb/CSecurityVeNCrypt.h +++ b/common/rfb/CSecurityVeNCrypt.h @@ -37,9 +37,9 @@ namespace rfb { CSecurityVeNCrypt(CConnection* cc, SecurityClient* sec); ~CSecurityVeNCrypt(); - virtual bool processMsg(); - int getType() const {return chosenType;} - virtual bool isSecure() const; + bool processMsg() override; + int getType() const override {return chosenType;} + bool isSecure() const override; protected: CSecurity *csecurity; diff --git a/common/rfb/CSecurityVncAuth.cxx b/common/rfb/CSecurityVncAuth.cxx index f6a5e07a..e5f842ba 100644 --- a/common/rfb/CSecurityVncAuth.cxx +++ b/common/rfb/CSecurityVncAuth.cxx @@ -54,7 +54,7 @@ bool CSecurityVncAuth::processMsg() uint8_t challenge[vncAuthChallengeSize]; is->readBytes(challenge, vncAuthChallengeSize); std::string passwd; - (CSecurity::upg)->getUserPasswd(cc->isSecure(), 0, &passwd); + (CSecurity::upg)->getUserPasswd(cc->isSecure(), nullptr, &passwd); // Calculate the correct response uint8_t key[8]; diff --git a/common/rfb/CSecurityVncAuth.h b/common/rfb/CSecurityVncAuth.h index 3f1f315b..9a9cf6e0 100644 --- a/common/rfb/CSecurityVncAuth.h +++ b/common/rfb/CSecurityVncAuth.h @@ -25,10 +25,10 @@ namespace rfb { class CSecurityVncAuth : public CSecurity { public: - CSecurityVncAuth(CConnection* cc) : CSecurity(cc) {} + CSecurityVncAuth(CConnection* cc_) : CSecurity(cc_) {} virtual ~CSecurityVncAuth() {} - virtual bool processMsg(); - virtual int getType() const {return secTypeVncAuth;}; + bool processMsg() override; + int getType() const override {return secTypeVncAuth;}; }; } #endif diff --git a/common/rfb/ClientParams.cxx b/common/rfb/ClientParams.cxx index ade99018..bc20c3d7 100644 --- a/common/rfb/ClientParams.cxx +++ b/common/rfb/ClientParams.cxx @@ -39,7 +39,7 @@ ClientParams::ClientParams() { setName(""); - cursor_ = new Cursor(0, 0, Point(), NULL); + cursor_ = new Cursor(0, 0, Point(), nullptr); clipFlags = clipboardUTF8 | clipboardRTF | clipboardHTML | clipboardRequest | clipboardNotify | clipboardProvide; diff --git a/common/rfb/Configuration.cxx b/common/rfb/Configuration.cxx index 1c215c7f..f58a9c2f 100644 --- a/common/rfb/Configuration.cxx +++ b/common/rfb/Configuration.cxx @@ -48,9 +48,9 @@ static LogWriter vlog("Config"); // -=- The Global/server/viewer Configuration objects -Configuration* Configuration::global_ = 0; -Configuration* Configuration::server_ = 0; -Configuration* Configuration::viewer_ = 0; +Configuration* Configuration::global_ = nullptr; +Configuration* Configuration::server_ = nullptr; +Configuration* Configuration::viewer_ = nullptr; Configuration* Configuration::global() { if (!global_) @@ -76,13 +76,13 @@ bool Configuration::set(const char* n, const char* v, bool immutable) { return set(n, strlen(n), v, immutable); } -bool Configuration::set(const char* name, int len, +bool Configuration::set(const char* paramName, int len, const char* val, bool immutable) { VoidParameter* current = head; while (current) { if ((int)strlen(current->getName()) == len && - strncasecmp(current->getName(), name, len) == 0) + strncasecmp(current->getName(), paramName, len) == 0) { bool b = current->setParam(val); if (b && immutable) @@ -91,7 +91,7 @@ bool Configuration::set(const char* name, int len, } current = current->_next; } - return _next ? _next->set(name, len, val, immutable) : false; + return _next ? _next->set(paramName, len, val, immutable) : false; } bool Configuration::set(const char* config, bool immutable) { @@ -127,7 +127,7 @@ VoidParameter* Configuration::get(const char* param) return current; current = current->_next; } - return _next ? _next->get(param) : 0; + return _next ? _next->get(param) : nullptr; } void Configuration::list(int width, int nameWidth) { @@ -195,7 +195,7 @@ VoidParameter::VoidParameter(const char* name_, const char* desc_, ConfigurationObject co) : immutable(false), name(name_), description(desc_) { - Configuration *conf = NULL; + Configuration *conf = nullptr; switch (co) { case ConfGlobal: conf = Configuration::global(); @@ -339,7 +339,7 @@ IntParameter::IntParameter(const char* name_, const char* desc_, int v, bool IntParameter::setParam(const char* v) { if (immutable) return true; - return setParam(strtol(v, NULL, 0)); + return setParam(strtol(v, nullptr, 0)); } bool @@ -410,7 +410,8 @@ StringParameter::operator const char *() const { BinaryParameter::BinaryParameter(const char* name_, const char* desc_, const uint8_t* v, size_t l, ConfigurationObject co) -: VoidParameter(name_, desc_, co), value(0), length(0), def_value(0), def_length(0) { +: VoidParameter(name_, desc_, co), + value(nullptr), length(0), def_value(nullptr), def_length(0) { if (l) { assert(v); value = new uint8_t[l]; @@ -440,7 +441,7 @@ void BinaryParameter::setParam(const uint8_t* v, size_t len) { if (immutable) return; vlog.debug("set %s(Binary)", getName()); delete [] value; - value = NULL; + value = nullptr; length = 0; if (len) { assert(v); diff --git a/common/rfb/Configuration.h b/common/rfb/Configuration.h index d73d8005..ec8d789a 100644 --- a/common/rfb/Configuration.h +++ b/common/rfb/Configuration.h @@ -64,7 +64,8 @@ namespace rfb { class Configuration { public: // - Create a new Configuration object - Configuration(const char* name_) : name(name_), head(0), _next(0) {} + Configuration(const char* name_) + : name(name_), head(nullptr), _next(nullptr) {} // - Return the buffer containing the Configuration's name const char* getName() const { return name.c_str(); } @@ -195,12 +196,12 @@ namespace rfb { public: AliasParameter(const char* name_, const char* desc_,VoidParameter* param_, ConfigurationObject co=ConfGlobal); - virtual bool setParam(const char* value); - virtual bool setParam(); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; - virtual bool isBool() const; - virtual void setImmutable(); + bool setParam(const char* value) override; + bool setParam() override; + std::string getDefaultStr() const override; + std::string getValueStr() const override; + bool isBool() const override; + void setImmutable() override; private: VoidParameter* param; }; @@ -209,12 +210,12 @@ namespace rfb { public: BoolParameter(const char* name_, const char* desc_, bool v, ConfigurationObject co=ConfGlobal); - virtual bool setParam(const char* value); - virtual bool setParam(); + bool setParam(const char* value) override; + bool setParam() override; virtual void setParam(bool b); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; - virtual bool isBool() const; + std::string getDefaultStr() const override; + std::string getValueStr() const override; + bool isBool() const override; operator bool() const; protected: bool value; @@ -227,10 +228,10 @@ namespace rfb { int minValue=INT_MIN, int maxValue=INT_MAX, ConfigurationObject co=ConfGlobal); using VoidParameter::setParam; - virtual bool setParam(const char* value); + bool setParam(const char* value) override; virtual bool setParam(int v); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; + std::string getDefaultStr() const override; + std::string getValueStr() const override; operator int() const; protected: int value; @@ -244,10 +245,10 @@ namespace rfb { // be Null, and so neither can the default value! StringParameter(const char* name_, const char* desc_, const char* v, ConfigurationObject co=ConfGlobal); - virtual ~StringParameter(); - virtual bool setParam(const char* value); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; + ~StringParameter() override; + bool setParam(const char* value) override; + std::string getDefaultStr() const override; + std::string getValueStr() const override; operator const char*() const; protected: std::string value; @@ -260,11 +261,11 @@ namespace rfb { const uint8_t* v, size_t l, ConfigurationObject co=ConfGlobal); using VoidParameter::setParam; - virtual ~BinaryParameter(); - virtual bool setParam(const char* value); + ~BinaryParameter() override; + bool setParam(const char* value) override; virtual void setParam(const uint8_t* v, size_t l); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; + std::string getDefaultStr() const override; + std::string getValueStr() const override; std::vector<uint8_t> getData() const; diff --git a/common/rfb/Congestion.cxx b/common/rfb/Congestion.cxx index 1e252165..94f07055 100644 --- a/common/rfb/Congestion.cxx +++ b/common/rfb/Congestion.cxx @@ -85,11 +85,11 @@ Congestion::Congestion() : baseRTT(-1), congWindow(INITIAL_WINDOW), inSlowStart(true), safeBaseRTT(-1), measurements(0), minRTT(-1), minCongestedRTT(-1) { - gettimeofday(&lastUpdate, NULL); - gettimeofday(&lastSent, NULL); + gettimeofday(&lastUpdate, nullptr); + gettimeofday(&lastSent, nullptr); memset(&lastPong, 0, sizeof(lastPong)); - gettimeofday(&lastPongArrival, NULL); - gettimeofday(&lastAdjustment, NULL); + gettimeofday(&lastPongArrival, nullptr); + gettimeofday(&lastAdjustment, nullptr); } Congestion::~Congestion() @@ -101,7 +101,7 @@ void Congestion::updatePosition(unsigned pos) struct timeval now; unsigned delta, consumed; - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); delta = pos - lastPosition; if ((delta > 0) || (extraBuffer > 0)) @@ -121,7 +121,7 @@ void Congestion::updatePosition(unsigned pos) congWindow = __rfbmin(INITIAL_WINDOW, congWindow); baseRTT = -1; measurements = 0; - gettimeofday(&lastAdjustment, NULL); + gettimeofday(&lastAdjustment, nullptr); minRTT = minCongestedRTT = -1; inSlowStart = true; } @@ -149,7 +149,7 @@ void Congestion::sentPing() memset(&rttInfo, 0, sizeof(struct RTTInfo)); - gettimeofday(&rttInfo.tv, NULL); + gettimeofday(&rttInfo.tv, nullptr); rttInfo.pos = lastPosition; rttInfo.extra = getExtraBuffer(); rttInfo.congested = isCongested(); @@ -166,7 +166,7 @@ void Congestion::gotPong() if (pings.empty()) return; - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); rttInfo = pings.front(); pings.pop_front(); @@ -320,7 +320,7 @@ void Congestion::debugTrace(const char* filename, int fd) #ifdef __linux__ FILE *f; f = fopen(filename, "ab"); - if (f != NULL) { + if (f != nullptr) { struct tcp_info info; int buffered; socklen_t len; @@ -329,7 +329,7 @@ void Congestion::debugTrace(const char* filename, int fd) TCP_INFO, &info, &len) == 0) && (ioctl(fd, SIOCOUTQ, &buffered) == 0)) { struct timeval now; - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); fprintf(f, "%u.%06u,%u,%u,%u,%u\n", (unsigned)now.tv_sec, (unsigned)now.tv_usec, congWindow, info.tcpi_snd_cwnd * info.tcpi_snd_mss, @@ -494,7 +494,7 @@ void Congestion::updateCongestion() #endif measurements = 0; - gettimeofday(&lastAdjustment, NULL); + gettimeofday(&lastAdjustment, nullptr); minRTT = minCongestedRTT = -1; } diff --git a/common/rfb/CopyRectDecoder.h b/common/rfb/CopyRectDecoder.h index c9f9c890..51651196 100644 --- a/common/rfb/CopyRectDecoder.h +++ b/common/rfb/CopyRectDecoder.h @@ -26,14 +26,15 @@ namespace rfb { public: CopyRectDecoder(); virtual ~CopyRectDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void getAffectedRegion(const Rect& rect, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - Region* region); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void getAffectedRegion(const Rect& rect, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + Region* region) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; }; } #endif diff --git a/common/rfb/Cursor.cxx b/common/rfb/Cursor.cxx index f0c72eed..fa596bc5 100644 --- a/common/rfb/Cursor.cxx +++ b/common/rfb/Cursor.cxx @@ -33,11 +33,11 @@ using namespace rfb; static LogWriter vlog("Cursor"); Cursor::Cursor(int width, int height, const Point& hotspot, - const uint8_t* data) : + const uint8_t* data_) : width_(width), height_(height), hotspot_(hotspot) { - this->data = new uint8_t[width_*height_*4]; - memcpy(this->data, data, width_*height_*4); + data = new uint8_t[width_*height_*4]; + memcpy(data, data_, width_*height_*4); } Cursor::Cursor(const Cursor& other) : diff --git a/common/rfb/Cursor.h b/common/rfb/Cursor.h index 31d6fda9..c71f5a77 100644 --- a/common/rfb/Cursor.h +++ b/common/rfb/Cursor.h @@ -62,7 +62,7 @@ namespace rfb { Rect getEffectiveRect() const { return buffer.getRect(offset); } - virtual const uint8_t* getBuffer(const Rect& r, int* stride) const; + const uint8_t* getBuffer(const Rect& r, int* stride) const override; void update(PixelBuffer* framebuffer, Cursor* cursor, const Point& pos); diff --git a/common/rfb/DecodeManager.cxx b/common/rfb/DecodeManager.cxx index e39a3943..ef415886 100644 --- a/common/rfb/DecodeManager.cxx +++ b/common/rfb/DecodeManager.cxx @@ -40,8 +40,8 @@ using namespace rfb; static LogWriter vlog("DecodeManager"); -DecodeManager::DecodeManager(CConnection *conn) : - conn(conn), threadException(NULL) +DecodeManager::DecodeManager(CConnection *conn_) : + conn(conn_), threadException(nullptr) { size_t cpuCount; @@ -97,8 +97,8 @@ DecodeManager::~DecodeManager() delete producerCond; delete queueMutex; - for (size_t i = 0; i < sizeof(decoders)/sizeof(decoders[0]); i++) - delete decoders[i]; + for (Decoder* decoder : decoders) + delete decoder; } bool DecodeManager::decodeRect(const Rect& r, int encoding, @@ -110,7 +110,7 @@ bool DecodeManager::decodeRect(const Rect& r, int encoding, QueueEntry *entry; - assert(pb != NULL); + assert(pb != nullptr); if (!Decoder::supported(encoding)) { vlog.error("Unknown encoding %d", encoding); @@ -247,7 +247,7 @@ void DecodeManager::setThreadException(const rdr::Exception& e) { os::AutoMutex a(queueMutex); - if (threadException != NULL) + if (threadException != nullptr) return; threadException = new rdr::Exception("Exception on worker thread: %s", e.str()); @@ -257,23 +257,20 @@ void DecodeManager::throwThreadException() { os::AutoMutex a(queueMutex); - if (threadException == NULL) + if (threadException == nullptr) return; rdr::Exception e(*threadException); delete threadException; - threadException = NULL; + threadException = nullptr; throw e; } -DecodeManager::DecodeThread::DecodeThread(DecodeManager* manager) +DecodeManager::DecodeThread::DecodeThread(DecodeManager* manager_) + : manager(manager_), stopRequested(false) { - this->manager = manager; - - stopRequested = false; - start(); } @@ -305,7 +302,7 @@ void DecodeManager::DecodeThread::worker() // Look for an available entry in the work queue entry = findEntry(); - if (entry == NULL) { + if (entry == nullptr) { // Wait and try again manager->consumerCond->wait(); continue; @@ -347,24 +344,15 @@ void DecodeManager::DecodeThread::worker() DecodeManager::QueueEntry* DecodeManager::DecodeThread::findEntry() { - std::list<DecodeManager::QueueEntry*>::iterator iter; Region lockedRegion; if (manager->workQueue.empty()) - return NULL; + return nullptr; if (!manager->workQueue.front()->active) return manager->workQueue.front(); - for (iter = manager->workQueue.begin(); - iter != manager->workQueue.end(); - ++iter) { - DecodeManager::QueueEntry* entry; - - std::list<DecodeManager::QueueEntry*>::iterator iter2; - - entry = *iter; - + for (DecodeManager::QueueEntry* entry : manager->workQueue) { // Another thread working on this? if (entry->active) goto next; @@ -372,8 +360,10 @@ DecodeManager::QueueEntry* DecodeManager::DecodeThread::findEntry() // If this is an ordered decoder then make sure this is the first // rectangle in the queue for that decoder if (entry->decoder->flags & DecoderOrdered) { - for (iter2 = manager->workQueue.begin(); iter2 != iter; ++iter2) { - if (entry->encoding == (*iter2)->encoding) + for (DecodeManager::QueueEntry* entry2 : manager->workQueue) { + if (entry2 == entry) + break; + if (entry->encoding == entry2->encoding) goto next; } } @@ -381,15 +371,17 @@ DecodeManager::QueueEntry* DecodeManager::DecodeThread::findEntry() // For a partially ordered decoder we must ask the decoder for each // pair of rectangles. if (entry->decoder->flags & DecoderPartiallyOrdered) { - for (iter2 = manager->workQueue.begin(); iter2 != iter; ++iter2) { - if (entry->encoding != (*iter2)->encoding) + for (DecodeManager::QueueEntry* entry2 : manager->workQueue) { + if (entry2 == entry) + break; + if (entry->encoding != entry2->encoding) continue; if (entry->decoder->doRectsConflict(entry->rect, entry->bufferStream->data(), entry->bufferStream->length(), - (*iter2)->rect, - (*iter2)->bufferStream->data(), - (*iter2)->bufferStream->length(), + entry2->rect, + entry2->bufferStream->data(), + entry2->bufferStream->length(), *entry->server)) goto next; } @@ -405,5 +397,5 @@ next: lockedRegion.assign_union(entry->affectedRegion); } - return NULL; + return nullptr; } diff --git a/common/rfb/DecodeManager.h b/common/rfb/DecodeManager.h index a8e0cac9..5435bfc1 100644 --- a/common/rfb/DecodeManager.h +++ b/common/rfb/DecodeManager.h @@ -98,7 +98,7 @@ namespace rfb { void stop(); protected: - void worker(); + void worker() override; DecodeManager::QueueEntry* findEntry(); private: diff --git a/common/rfb/Decoder.cxx b/common/rfb/Decoder.cxx index 78c54ec3..e9bc9a4f 100644 --- a/common/rfb/Decoder.cxx +++ b/common/rfb/Decoder.cxx @@ -37,7 +37,7 @@ using namespace rfb; -Decoder::Decoder(enum DecoderFlags flags) : flags(flags) +Decoder::Decoder(enum DecoderFlags flags_) : flags(flags_) { } @@ -103,6 +103,6 @@ Decoder* Decoder::createDecoder(int encoding) return new H264Decoder(); #endif default: - return NULL; + return nullptr; } } diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx index bc15e74a..5c1429d2 100644 --- a/common/rfb/EncodeManager.cxx +++ b/common/rfb/EncodeManager.cxx @@ -138,7 +138,7 @@ EncodeManager::EncodeManager(SConnection* conn_) { StatsVector::iterator iter; - encoders.resize(encoderClassMax, NULL); + encoders.resize(encoderClassMax, nullptr); activeEncoders.resize(encoderTypeMax, encoderRaw); encoders[encoderRaw] = new RawEncoder(conn); @@ -161,12 +161,10 @@ EncodeManager::EncodeManager(SConnection* conn_) EncodeManager::~EncodeManager() { - std::vector<Encoder*>::iterator iter; - logStats(); - for (iter = encoders.begin();iter != encoders.end();iter++) - delete *iter; + for (Encoder* encoder : encoders) + delete encoder; } void EncodeManager::logStats() @@ -297,7 +295,7 @@ void EncodeManager::writeLosslessRefresh(const Region& req, const PixelBuffer* p Region(), Point(), pb, renderedCursor); } -bool EncodeManager::handleTimeout(Timer* t) +void EncodeManager::handleTimeout(Timer* t) { if (t == &recentChangeTimer) { // Any lossy region that wasn't recently updated can @@ -307,10 +305,8 @@ bool EncodeManager::handleTimeout(Timer* t) // Will there be more to do? (i.e. do we need another round) if (!lossyRegion.subtract(pendingRefreshRegion).is_empty()) - return true; + t->repeat(); } - - return false; } void EncodeManager::doUpdate(bool allowLossy, const Region& changed_, @@ -334,7 +330,7 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_, * We need to render the cursor seperately as it has its own * magical pixel buffer, so split it out from the changed region. */ - if (renderedCursor != NULL) { + if (renderedCursor != nullptr) { cursorRegion = changed.intersect(renderedCursor->getEffectiveRect()); changed.assign_subtract(renderedCursor->getEffectiveRect()); } diff --git a/common/rfb/EncodeManager.h b/common/rfb/EncodeManager.h index f2fd4ca4..a01a1614 100644 --- a/common/rfb/EncodeManager.h +++ b/common/rfb/EncodeManager.h @@ -61,7 +61,7 @@ namespace rfb { size_t maxUpdateSize); protected: - virtual bool handleTimeout(Timer* t); + void handleTimeout(Timer* t) override; void doUpdate(bool allowLossy, const Region& changed, const Region& copied, const Point& copy_delta, @@ -142,7 +142,7 @@ namespace rfb { const uint8_t* data_, int stride); private: - virtual uint8_t* getBufferRW(const Rect& r, int* stride); + uint8_t* getBufferRW(const Rect& r, int* stride) override; }; OffsetPixelBuffer offsetPixelBuffer; diff --git a/common/rfb/Exception.h b/common/rfb/Exception.h index 827ced52..4520bc8c 100644 --- a/common/rfb/Exception.h +++ b/common/rfb/Exception.h @@ -23,20 +23,16 @@ namespace rfb { typedef rdr::Exception Exception; struct AuthFailureException : public Exception { - AuthFailureException() - : Exception("Authentication failure") {} AuthFailureException(const char* reason) - : Exception("Authentication failure: %s", reason) {} + : Exception("%s", reason) {} }; struct AuthCancelledException : public rfb::Exception { AuthCancelledException() : Exception("Authentication cancelled") {} }; struct ConnFailedException : public Exception { - ConnFailedException() - : Exception("Connection failed") {} ConnFailedException(const char* reason) - : Exception("Connection failed: %s", reason) {} + : Exception("%s", reason) {} }; } #endif diff --git a/common/rfb/H264Decoder.cxx b/common/rfb/H264Decoder.cxx index f18554ef..1a310a3c 100644 --- a/common/rfb/H264Decoder.cxx +++ b/common/rfb/H264Decoder.cxx @@ -51,18 +51,18 @@ H264Decoder::~H264Decoder() void H264Decoder::resetContexts() { os::AutoMutex lock(&mutex); - for (std::deque<H264DecoderContext*>::iterator it = contexts.begin(); it != contexts.end(); it++) - delete *it; + for (H264DecoderContext* context : contexts) + delete context; contexts.clear(); } H264DecoderContext* H264Decoder::findContext(const Rect& r) { os::AutoMutex m(&mutex); - for (std::deque<H264DecoderContext*>::iterator it = contexts.begin(); it != contexts.end(); it++) - if ((*it)->isEqualRect(r)) - return *it; - return NULL; + for (H264DecoderContext* context : contexts) + if (context->isEqualRect(r)) + return context; + return nullptr; } bool H264Decoder::readRect(const Rect& /*r*/, @@ -79,9 +79,9 @@ bool H264Decoder::readRect(const Rect& /*r*/, len = is->readU32(); os->writeU32(len); - uint32_t flags = is->readU32(); + uint32_t reset = is->readU32(); - os->writeU32(flags); + os->writeU32(reset); if (!is->hasDataOrRestore(len)) return false; @@ -100,15 +100,15 @@ void H264Decoder::decodeRect(const Rect& r, const uint8_t* buffer, { rdr::MemInStream is(buffer, buflen); uint32_t len = is.readU32(); - uint32_t flags = is.readU32(); + uint32_t reset = is.readU32(); - H264DecoderContext* ctx = NULL; - if (flags & resetAllContexts) + H264DecoderContext* ctx = nullptr; + if (reset & resetAllContexts) { resetContexts(); if (!len) return; - flags &= ~(resetContext | resetAllContexts); + reset &= ~(resetContext | resetAllContexts); } else { ctx = findContext(r); } @@ -131,7 +131,7 @@ void H264Decoder::decodeRect(const Rect& r, const uint8_t* buffer, if (!ctx->isReady()) throw Exception("H264Decoder: Context is not ready"); - if (flags & resetContext) + if (reset & resetContext) ctx->reset(); if (!len) diff --git a/common/rfb/H264Decoder.h b/common/rfb/H264Decoder.h index b4f5553e..8ba47799 100644 --- a/common/rfb/H264Decoder.h +++ b/common/rfb/H264Decoder.h @@ -33,11 +33,12 @@ namespace rfb { public: H264Decoder(); virtual ~H264Decoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: void resetContexts(); diff --git a/common/rfb/H264LibavDecoderContext.cxx b/common/rfb/H264LibavDecoderContext.cxx index 8697a5a5..5bd1dbbf 100644 --- a/common/rfb/H264LibavDecoderContext.cxx +++ b/common/rfb/H264LibavDecoderContext.cxx @@ -42,9 +42,9 @@ static LogWriter vlog("H264LibavDecoderContext"); bool H264LibavDecoderContext::initCodec() { os::AutoMutex lock(&mutex); - sws = NULL; - swsBuffer = NULL; - h264WorkBuffer = NULL; + sws = nullptr; + swsBuffer = nullptr; + h264WorkBuffer = nullptr; h264WorkBufferLength = 0; const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_H264); @@ -78,7 +78,7 @@ bool H264LibavDecoderContext::initCodec() { return false; } - if (avcodec_open2(avctx, codec, NULL) < 0) + if (avcodec_open2(avctx, codec, nullptr) < 0) { av_parser_close(parser); avcodec_free_context(&avctx); @@ -117,7 +117,7 @@ uint8_t* H264LibavDecoderContext::makeH264WorkBuffer(const uint8_t* buffer, uint if (!h264WorkBuffer || reserve_len > h264WorkBufferLength) { h264WorkBuffer = (uint8_t*)realloc(h264WorkBuffer, reserve_len); - if (h264WorkBuffer == NULL) { + if (h264WorkBuffer == nullptr) { throw Exception("H264LibavDecoderContext: Unable to allocate memory"); } h264WorkBufferLength = reserve_len; @@ -204,7 +204,7 @@ void H264LibavDecoderContext::decode(const uint8_t* h264_in_buffer, #ifdef FFMPEG_INIT_PACKET_DEPRECATED packet->size = 0; - packet->data = NULL; + packet->data = nullptr; av_packet_free(&packet); #else delete packet; @@ -218,7 +218,7 @@ void H264LibavDecoderContext::decode(const uint8_t* h264_in_buffer, sws = sws_getCachedContext(sws, frame->width, frame->height, avctx->pix_fmt, frame->width, frame->height, AV_PIX_FMT_RGB32, - 0, NULL, NULL, NULL); + 0, nullptr, nullptr, nullptr); int stride; pb->getBuffer(rect, &stride); diff --git a/common/rfb/H264LibavDecoderContext.h b/common/rfb/H264LibavDecoderContext.h index 148ba1ad..f399b3cc 100644 --- a/common/rfb/H264LibavDecoderContext.h +++ b/common/rfb/H264LibavDecoderContext.h @@ -34,12 +34,12 @@ namespace rfb { H264LibavDecoderContext(const Rect &r) : H264DecoderContext(r) {} ~H264LibavDecoderContext() { freeCodec(); } - virtual void decode(const uint8_t* h264_buffer, uint32_t len, - ModifiablePixelBuffer* pb); + void decode(const uint8_t* h264_buffer, uint32_t len, + ModifiablePixelBuffer* pb) override; protected: - virtual bool initCodec(); - virtual void freeCodec(); + bool initCodec() override; + void freeCodec() override; private: uint8_t* makeH264WorkBuffer(const uint8_t* buffer, uint32_t len); diff --git a/common/rfb/H264WinDecoderContext.cxx b/common/rfb/H264WinDecoderContext.cxx index bb29edb6..8422b5c4 100644 --- a/common/rfb/H264WinDecoderContext.cxx +++ b/common/rfb/H264WinDecoderContext.cxx @@ -21,7 +21,7 @@ #include <mfapi.h> #include <mferror.h> #include <wmcodecdsp.h> -#define SAFE_RELEASE(obj) if (obj) { obj->Release(); obj = NULL; } +#define SAFE_RELEASE(obj) if (obj) { obj->Release(); obj = nullptr; } #include <os/Mutex.h> #include <rfb/LogWriter.h> @@ -32,6 +32,11 @@ using namespace rfb; static LogWriter vlog("H264WinDecoderContext"); +// Older MinGW lacks this definition +#ifndef HAVE_VIDEO_PROCESSOR_MFT +static GUID CLSID_VideoProcessorMFT = { 0x88753b26, 0x5b24, 0x49bd, { 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82 } }; +#endif + bool H264WinDecoderContext::initCodec() { os::AutoMutex lock(&mutex); @@ -41,17 +46,16 @@ bool H264WinDecoderContext::initCodec() { return false; } - if (FAILED(CoCreateInstance(CLSID_CMSH264DecoderMFT, NULL, CLSCTX_INPROC_SERVER, IID_IMFTransform, (LPVOID*)&decoder))) + if (FAILED(CoCreateInstance(CLSID_CMSH264DecoderMFT, nullptr, CLSCTX_INPROC_SERVER, IID_IMFTransform, (LPVOID*)&decoder))) { vlog.error("MediaFoundation H264 codec not found"); return false; } - GUID CLSID_VideoProcessorMFT = { 0x88753b26, 0x5b24, 0x49bd, { 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82 } }; - if (FAILED(CoCreateInstance(CLSID_VideoProcessorMFT, NULL, CLSCTX_INPROC_SERVER, IID_IMFTransform, (LPVOID*)&converter))) + if (FAILED(CoCreateInstance(CLSID_VideoProcessorMFT, nullptr, CLSCTX_INPROC_SERVER, IID_IMFTransform, (LPVOID*)&converter))) { vlog.error("Cannot create MediaFoundation Video Processor (available only on Windows 8+). Trying ColorConvert DMO."); - if (FAILED(CoCreateInstance(CLSID_CColorConvertDMO, NULL, CLSCTX_INPROC_SERVER, IID_IMFTransform, (LPVOID*)&converter))) + if (FAILED(CoCreateInstance(CLSID_CColorConvertDMO, nullptr, CLSCTX_INPROC_SERVER, IID_IMFTransform, (LPVOID*)&converter))) { decoder->Release(); vlog.error("ColorConvert DMO not found"); @@ -87,7 +91,7 @@ bool H264WinDecoderContext::initCodec() { // set decoder output type (NV12) DWORD output_index = 0; - IMFMediaType* output_type = NULL; + IMFMediaType* output_type = nullptr; while (SUCCEEDED(decoder->GetOutputAvailableType(0, output_index++, &output_type))) { GUID subtype; @@ -175,7 +179,7 @@ void H264WinDecoderContext::decode(const uint8_t* h264_buffer, } BYTE* locked; - input_buffer->Lock(&locked, NULL, NULL); + input_buffer->Lock(&locked, nullptr, nullptr); memcpy(locked, h264_buffer, len); input_buffer->Unlock(); @@ -203,7 +207,7 @@ void H264WinDecoderContext::decode(const uint8_t* h264_buffer, decoded_data.dwStreamID = 0; decoded_data.pSample = decoded_sample; decoded_data.dwStatus = 0; - decoded_data.pEvents = NULL; + decoded_data.pEvents = nullptr; DWORD status; HRESULT hr = decoder->ProcessOutput(0, 1, &decoded_data, &status); @@ -232,7 +236,7 @@ void H264WinDecoderContext::decode(const uint8_t* h264_buffer, // need to setup output type and try decoding again DWORD output_index = 0; - IMFMediaType* output_type = NULL; + IMFMediaType* output_type = nullptr; while (SUCCEEDED(decoder->GetOutputAvailableType(0, output_index++, &output_type))) { GUID subtype; @@ -242,7 +246,7 @@ void H264WinDecoderContext::decode(const uint8_t* h264_buffer, break; } output_type->Release(); - output_type = NULL; + output_type = nullptr; } // reinitialize output type (NV12) that now has correct properties (width/height/framerate) @@ -327,7 +331,7 @@ void H264WinDecoderContext::decode(const uint8_t* h264_buffer, converted_data.dwStreamID = 0; converted_data.pSample = converted_sample; converted_data.dwStatus = 0; - converted_data.pEvents = NULL; + converted_data.pEvents = nullptr; DWORD status; HRESULT hr = converter->ProcessOutput(0, 1, &converted_data, &status); @@ -342,8 +346,8 @@ void H264WinDecoderContext::decode(const uint8_t* h264_buffer, vlog.debug("Frame converted to RGB"); BYTE* out; - DWORD len; - converted_buffer->Lock(&out, NULL, &len); + DWORD buflen; + converted_buffer->Lock(&out, nullptr, &buflen); pb->imageRect(rect, out + offset_y * stride + offset_x * 4, (int)stride / 4); converted_buffer->Unlock(); } @@ -359,20 +363,20 @@ void H264WinDecoderContext::ParseSPS(const uint8_t* buffer, int length) if (available == 0) \ { \ if (length == 0) return; \ - byte = *buffer++; \ + byte_ = *buffer++; \ length--; \ available = 8; \ } \ - bit = (byte >> --available) & 1; \ + bit = (byte_ >> --available) & 1; \ } while (0) #define GET_BITS(n, var) do { \ var = 0; \ - for (int i = n-1; i >= 0; i--) \ + for (int b = n-1; b >= 0; b--) \ { \ unsigned bit; \ GET_BIT(bit); \ - var |= bit << i; \ + var |= bit << b; \ } \ } while (0) @@ -411,7 +415,7 @@ void H264WinDecoderContext::ParseSPS(const uint8_t* buffer, int length) length--; int available = 0; - uint8_t byte = 0; + uint8_t byte_ = 0; unsigned profile_idc; unsigned seq_parameter_set_id; diff --git a/common/rfb/H264WinDecoderContext.h b/common/rfb/H264WinDecoderContext.h index de51576c..92041781 100644 --- a/common/rfb/H264WinDecoderContext.h +++ b/common/rfb/H264WinDecoderContext.h @@ -33,12 +33,12 @@ namespace rfb { H264WinDecoderContext(const Rect &r) : H264DecoderContext(r) {}; ~H264WinDecoderContext() { freeCodec(); } - virtual void decode(const uint8_t* h264_buffer, uint32_t len, - ModifiablePixelBuffer* pb); + void decode(const uint8_t* h264_buffer, uint32_t len, + ModifiablePixelBuffer* pb) override; protected: - virtual bool initCodec(); - virtual void freeCodec(); + bool initCodec() override; + void freeCodec() override; private: LONG stride; @@ -48,14 +48,14 @@ namespace rfb { uint32_t crop_height = 0; uint32_t offset_x = 0; uint32_t offset_y = 0; - IMFTransform *decoder = NULL; - IMFTransform *converter = NULL; - IMFSample *input_sample = NULL; - IMFSample *decoded_sample = NULL; - IMFSample *converted_sample = NULL; - IMFMediaBuffer *input_buffer = NULL; - IMFMediaBuffer *decoded_buffer = NULL; - IMFMediaBuffer *converted_buffer = NULL; + IMFTransform *decoder = nullptr; + IMFTransform *converter = nullptr; + IMFSample *input_sample = nullptr; + IMFSample *decoded_sample = nullptr; + IMFSample *converted_sample = nullptr; + IMFMediaBuffer *input_buffer = nullptr; + IMFMediaBuffer *decoded_buffer = nullptr; + IMFMediaBuffer *converted_buffer = nullptr; void ParseSPS(const uint8_t* buffer, int length); }; diff --git a/common/rfb/HextileDecoder.cxx b/common/rfb/HextileDecoder.cxx index 2243d67f..dc9b9be7 100644 --- a/common/rfb/HextileDecoder.cxx +++ b/common/rfb/HextileDecoder.cxx @@ -191,10 +191,10 @@ void HextileDecoder::hextileDecode(const Rect& r, rdr::InStream* is, if (x + w > 16 || y + h > 16) { throw rfb::Exception("HEXTILE_DECODE: Hextile out of bounds"); } - T* ptr = buf + y * t.width() + x; + ptr = buf + y * t.width() + x; int rowAdd = t.width() - w; while (h-- > 0) { - int len = w; + len = w; while (len-- > 0) *ptr++ = fg; ptr += rowAdd; } diff --git a/common/rfb/HextileDecoder.h b/common/rfb/HextileDecoder.h index 9163b5bb..38e8b776 100644 --- a/common/rfb/HextileDecoder.h +++ b/common/rfb/HextileDecoder.h @@ -29,11 +29,12 @@ namespace rfb { public: HextileDecoder(); virtual ~HextileDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: template<class T> inline T readPixel(rdr::InStream* is); diff --git a/common/rfb/HextileEncoder.cxx b/common/rfb/HextileEncoder.cxx index a63cf1fb..0666d02d 100644 --- a/common/rfb/HextileEncoder.cxx +++ b/common/rfb/HextileEncoder.cxx @@ -38,8 +38,8 @@ BoolParameter improvedHextile("ImprovedHextile", "ratios by the cost of using more CPU time", true); -HextileEncoder::HextileEncoder(SConnection* conn) : - Encoder(conn, encodingHextile, EncoderPlain) +HextileEncoder::HextileEncoder(SConnection* conn_) : + Encoder(conn_, encodingHextile, EncoderPlain) { } @@ -365,7 +365,7 @@ class HextileTile { template<class T> HextileTile<T>::HextileTile() - : m_tile(NULL), m_width(0), m_height(0), + : m_tile(nullptr), m_width(0), m_height(0), m_size(0), m_flags(0), m_background(0), m_foreground(0), m_numSubrects(0) { diff --git a/common/rfb/HextileEncoder.h b/common/rfb/HextileEncoder.h index 20721b7c..55f0508d 100644 --- a/common/rfb/HextileEncoder.h +++ b/common/rfb/HextileEncoder.h @@ -27,11 +27,11 @@ namespace rfb { public: HextileEncoder(SConnection* conn); virtual ~HextileEncoder(); - virtual bool isSupported(); - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + bool isSupported() override; + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; private: template<class T> inline void writePixel(rdr::OutStream* os, T pixel); diff --git a/common/rfb/Hostname.h b/common/rfb/Hostname.h index 1971e343..a09cca3f 100644 --- a/common/rfb/Hostname.h +++ b/common/rfb/Hostname.h @@ -29,7 +29,7 @@ namespace rfb { static bool isAllSpace(const char *string) { - if (string == NULL) + if (string == nullptr) return false; while(*string != '\0') { if (! isspace(*string)) @@ -46,7 +46,7 @@ namespace rfb { const char* hostEnd; const char* portStart; - if (hi == NULL) + if (hi == nullptr) throw rdr::Exception("NULL host specified"); // Trim leading whitespace @@ -59,19 +59,19 @@ namespace rfb { if (hi[0] == '[') { hostStart = &hi[1]; hostEnd = strchr(hostStart, ']'); - if (hostEnd == NULL) + if (hostEnd == nullptr) throw rdr::Exception("unmatched [ in host"); portStart = hostEnd + 1; if (isAllSpace(portStart)) - portStart = NULL; + portStart = nullptr; } else { hostStart = &hi[0]; hostEnd = strrchr(hostStart, ':'); - if (hostEnd == NULL) { + if (hostEnd == nullptr) { hostEnd = hostStart + strlen(hostStart); - portStart = NULL; + portStart = nullptr; } else { if ((hostEnd > hostStart) && (hostEnd[-1] == ':')) hostEnd--; @@ -79,7 +79,7 @@ namespace rfb { if (portStart != hostEnd) { // We found more : in the host. This is probably an IPv6 address hostEnd = hostStart + strlen(hostStart); - portStart = NULL; + portStart = nullptr; } } } @@ -93,7 +93,7 @@ namespace rfb { else *host = std::string(hostStart, hostEnd - hostStart); - if (portStart == NULL) + if (portStart == nullptr) *port = basePort; else { char* end; diff --git a/common/rfb/JpegCompressor.cxx b/common/rfb/JpegCompressor.cxx index a4dd5f39..42d5c475 100644 --- a/common/rfb/JpegCompressor.cxx +++ b/common/rfb/JpegCompressor.cxx @@ -162,9 +162,9 @@ void JpegCompressor::compress(const uint8_t *buf, volatile int stride, int w = r.width(); int h = r.height(); int pixelsize; - uint8_t * volatile srcBuf = NULL; + uint8_t * volatile srcBuf = nullptr; volatile bool srcBufIsTemp = false; - JSAMPROW * volatile rowPointer = NULL; + JSAMPROW * volatile rowPointer = nullptr; if(setjmp(err->jmpBuffer)) { // this will execute if libjpeg has an error diff --git a/common/rfb/JpegDecompressor.cxx b/common/rfb/JpegDecompressor.cxx index 44c54fb2..92ef014f 100644 --- a/common/rfb/JpegDecompressor.cxx +++ b/common/rfb/JpegDecompressor.cxx @@ -159,9 +159,9 @@ void JpegDecompressor::decompress(const uint8_t *jpegBuf, int h = r.height(); int pixelsize; int dstBufStride; - uint8_t * volatile dstBuf = NULL; + uint8_t * volatile dstBuf = nullptr; volatile bool dstBufIsTemp = false; - JSAMPROW * volatile rowPointer = NULL; + JSAMPROW * volatile rowPointer = nullptr; if(setjmp(err->jmpBuffer)) { // this will execute if libjpeg has an error diff --git a/common/rfb/KeyRemapper.cxx b/common/rfb/KeyRemapper.cxx index 762eb413..328955d7 100644 --- a/common/rfb/KeyRemapper.cxx +++ b/common/rfb/KeyRemapper.cxx @@ -89,7 +89,7 @@ public: : StringParameter("RemapKeys", "Comma-separated list of incoming keysyms to remap. Mappings are expressed as two hex values, prefixed by 0x, and separated by ->", "") { KeyRemapper::defInstance.setMapping(""); } - bool setParam(const char* v) { + bool setParam(const char* v) override { KeyRemapper::defInstance.setMapping(v); return StringParameter::setParam(v); } diff --git a/common/rfb/KeysymStr.c b/common/rfb/KeysymStr.c index 51d6e897..5bdb1558 100644 --- a/common/rfb/KeysymStr.c +++ b/common/rfb/KeysymStr.c @@ -34,6 +34,9 @@ in this Software without prior written authorization from The Open Group. #include "keysymdef.h" #include "KeysymStr.h" +/* Change the name of this to avoid conflict with libX11 */ +#define _XkeyTable _vncXkeyTable + #define NEEDKTABLE #define NEEDVTABLE #include "ks_tables.h" diff --git a/common/rfb/LogWriter.cxx b/common/rfb/LogWriter.cxx index dc9db9d1..b222d268 100644 --- a/common/rfb/LogWriter.cxx +++ b/common/rfb/LogWriter.cxx @@ -34,7 +34,8 @@ rfb::LogParameter rfb::logParams; using namespace rfb; -LogWriter::LogWriter(const char* name) : m_name(name), m_level(0), m_log(0), m_next(log_writers) { +LogWriter::LogWriter(const char* name) + : m_name(name), m_level(0), m_log(nullptr), m_next(log_writers) { log_writers = this; } @@ -72,7 +73,7 @@ LogWriter::getLogWriter(const char* name) { if (strcasecmp(name, current->m_name) == 0) return current; current = current->m_next; } - return 0; + return nullptr; } bool LogWriter::setLogParams(const char* params) { @@ -83,7 +84,7 @@ bool LogWriter::setLogParams(const char* params) { return false; } int level = atoi(parts[2].c_str()); - Logger* logger = 0; + Logger* logger = nullptr; if (!parts[1].empty()) { logger = Logger::getLogger(parts[1].c_str()); if (!logger) diff --git a/common/rfb/LogWriter.h b/common/rfb/LogWriter.h index 6eff6da1..d1fd4990 100644 --- a/common/rfb/LogWriter.h +++ b/common/rfb/LogWriter.h @@ -104,7 +104,7 @@ namespace rfb { class LogParameter : public StringParameter { public: LogParameter(); - virtual bool setParam(const char* v); + bool setParam(const char* v) override; }; extern LogParameter logParams; diff --git a/common/rfb/Logger.cxx b/common/rfb/Logger.cxx index 7e0895e4..25f7ccb7 100644 --- a/common/rfb/Logger.cxx +++ b/common/rfb/Logger.cxx @@ -31,9 +31,11 @@ using namespace rfb; -Logger* Logger::loggers = 0; +Logger* Logger::loggers = nullptr; -Logger::Logger(const char* name) : registered(false), m_name(name), m_next(0) { +Logger::Logger(const char* name) + : registered(false), m_name(name), m_next(nullptr) +{ } Logger::~Logger() { @@ -78,7 +80,7 @@ Logger::getLogger(const char* name) { if (strcasecmp(name, current->m_name) == 0) return current; current = current->m_next; } - return 0; + return nullptr; } void diff --git a/common/rfb/Logger_file.cxx b/common/rfb/Logger_file.cxx index 099a3501..eabe420a 100644 --- a/common/rfb/Logger_file.cxx +++ b/common/rfb/Logger_file.cxx @@ -33,7 +33,7 @@ using namespace rfb; Logger_File::Logger_File(const char* loggerName) - : Logger(loggerName), indent(13), width(79), m_file(0), + : Logger(loggerName), indent(13), width(79), m_file(nullptr), m_lastLogTime(0) { m_filename[0] = '\0'; @@ -65,7 +65,7 @@ void Logger_File::write(int /*level*/, const char *logname, const char *message) if (!m_file) return; } - time_t current = time(0); + time_t current = time(nullptr); if (current != m_lastLogTime) { m_lastLogTime = current; fprintf(m_file, "\n%s", ctime(&m_lastLogTime)); @@ -115,7 +115,7 @@ void Logger_File::closeFile() { if (m_file) { fclose(m_file); - m_file = 0; + m_file = nullptr; } } diff --git a/common/rfb/Logger_file.h b/common/rfb/Logger_file.h index 4542d23c..6f2a4ef6 100644 --- a/common/rfb/Logger_file.h +++ b/common/rfb/Logger_file.h @@ -35,7 +35,7 @@ namespace rfb { Logger_File(const char* loggerName); ~Logger_File(); - virtual void write(int level, const char *logname, const char *message); + void write(int level, const char *logname, const char *message) override; void setFilename(const char* filename); void setFile(FILE* file); diff --git a/common/rfb/Logger_syslog.cxx b/common/rfb/Logger_syslog.cxx index 320ab4b0..de9e425e 100644 --- a/common/rfb/Logger_syslog.cxx +++ b/common/rfb/Logger_syslog.cxx @@ -35,7 +35,7 @@ using namespace rfb; Logger_Syslog::Logger_Syslog(const char* loggerName) : Logger(loggerName) { - openlog(0, LOG_CONS | LOG_PID, LOG_USER); + openlog(nullptr, LOG_CONS | LOG_PID, LOG_USER); } Logger_Syslog::~Logger_Syslog() diff --git a/common/rfb/Logger_syslog.h b/common/rfb/Logger_syslog.h index cf987281..20c46a5f 100644 --- a/common/rfb/Logger_syslog.h +++ b/common/rfb/Logger_syslog.h @@ -31,7 +31,7 @@ namespace rfb { Logger_Syslog(const char* loggerName); virtual ~Logger_Syslog(); - virtual void write(int level, const char *logname, const char *message); + void write(int level, const char *logname, const char *message) override; }; void initSyslogLogger(); diff --git a/common/rfb/Palette.h b/common/rfb/Palette.h index 6b8cc57e..d22af0dc 100644 --- a/common/rfb/Palette.h +++ b/common/rfb/Palette.h @@ -75,10 +75,10 @@ inline bool rfb::Palette::insert(uint32_t colour, int numPixels) hash_key = genHash(colour); pnode = hash[hash_key]; - prev_pnode = NULL; + prev_pnode = nullptr; // Do we already have an entry for this colour? - while (pnode != NULL) { + while (pnode != nullptr) { if (pnode->colour == colour) { // Yup @@ -114,12 +114,12 @@ inline bool rfb::Palette::insert(uint32_t colour, int numPixels) // Create a new colour entry pnode = &list[numColours]; - pnode->next = NULL; + pnode->next = nullptr; pnode->idx = 0; pnode->colour = colour; // Add it to the hash table - if (prev_pnode != NULL) + if (prev_pnode != nullptr) prev_pnode->next = pnode; else hash[hash_key] = pnode; @@ -152,7 +152,7 @@ inline unsigned char rfb::Palette::lookup(uint32_t colour) const hash_key = genHash(colour); pnode = hash[hash_key]; - while (pnode != NULL) { + while (pnode != nullptr) { if (pnode->colour == colour) return pnode->idx; pnode = pnode->next; diff --git a/common/rfb/PixelBuffer.cxx b/common/rfb/PixelBuffer.cxx index c8b5f3d7..0a287544 100644 --- a/common/rfb/PixelBuffer.cxx +++ b/common/rfb/PixelBuffer.cxx @@ -33,7 +33,6 @@ #include <rfb/PixelBuffer.h> using namespace rfb; -using namespace rdr; static LogWriter vlog("PixelBuffer"); @@ -326,7 +325,7 @@ FullFramePixelBuffer::FullFramePixelBuffer(const PixelFormat& pf, int w, int h, { } -FullFramePixelBuffer::FullFramePixelBuffer() : data(0) {} +FullFramePixelBuffer::FullFramePixelBuffer() : data(nullptr) {} FullFramePixelBuffer::~FullFramePixelBuffer() {} @@ -365,7 +364,7 @@ void FullFramePixelBuffer::setBuffer(int width, int height, throw rfb::Exception("Invalid PixelBuffer height of %d pixels requested", height); if ((stride_ < 0) || (stride_ > maxPixelBufferStride) || (stride_ < width)) throw rfb::Exception("Invalid PixelBuffer stride of %d pixels requested", stride_); - if ((width != 0) && (height != 0) && (data_ == NULL)) + if ((width != 0) && (height != 0) && (data_ == nullptr)) throw rfb::Exception("PixelBuffer requested without a valid memory area"); ModifiablePixelBuffer::setSize(width, height); @@ -383,12 +382,12 @@ void FullFramePixelBuffer::setSize(int /*w*/, int /*h*/) // Automatically allocates enough space for the specified format & area ManagedPixelBuffer::ManagedPixelBuffer() - : data_(NULL), datasize(0) + : data_(nullptr), datasize(0) { } ManagedPixelBuffer::ManagedPixelBuffer(const PixelFormat& pf, int w, int h) - : FullFramePixelBuffer(pf, 0, 0, NULL, 0), data_(NULL), datasize(0) + : FullFramePixelBuffer(pf, 0, 0, nullptr, 0), data_(nullptr), datasize(0) { setSize(w, h); } @@ -413,7 +412,7 @@ void ManagedPixelBuffer::setSize(int w, int h) if (datasize < new_datasize) { if (data_) { delete [] data_; - data_ = NULL; + data_ = nullptr; datasize = 0; } if (new_datasize) { diff --git a/common/rfb/PixelBuffer.h b/common/rfb/PixelBuffer.h index 33a9c7ae..963fbbf6 100644 --- a/common/rfb/PixelBuffer.h +++ b/common/rfb/PixelBuffer.h @@ -151,16 +151,16 @@ namespace rfb { virtual ~FullFramePixelBuffer(); public: - virtual const uint8_t* getBuffer(const Rect& r, int* stride) const; - virtual uint8_t* getBufferRW(const Rect& r, int* stride); - virtual void commitBufferRW(const Rect& r); + const uint8_t* getBuffer(const Rect& r, int* stride) const override; + uint8_t* getBufferRW(const Rect& r, int* stride) override; + void commitBufferRW(const Rect& r) override; protected: FullFramePixelBuffer(); virtual void setBuffer(int width, int height, uint8_t* data, int stride); private: - virtual void setSize(int w, int h); + void setSize(int w, int h) override; private: uint8_t* data; @@ -178,7 +178,7 @@ namespace rfb { // Manage the pixel buffer layout virtual void setPF(const PixelFormat &pf); - virtual void setSize(int w, int h); + void setSize(int w, int h) override; private: uint8_t* data_; // Mirrors FullFramePixelBuffer::data diff --git a/common/rfb/RREDecoder.h b/common/rfb/RREDecoder.h index a1d7f9b8..8490146c 100644 --- a/common/rfb/RREDecoder.h +++ b/common/rfb/RREDecoder.h @@ -29,11 +29,12 @@ namespace rfb { public: RREDecoder(); virtual ~RREDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: template<class T> inline T readPixel(rdr::InStream* is); diff --git a/common/rfb/RREEncoder.cxx b/common/rfb/RREEncoder.cxx index e73a23bf..f3e3b68a 100644 --- a/common/rfb/RREEncoder.cxx +++ b/common/rfb/RREEncoder.cxx @@ -31,8 +31,8 @@ using namespace rfb; -RREEncoder::RREEncoder(SConnection* conn) : - Encoder(conn, encodingRRE, EncoderPlain) +RREEncoder::RREEncoder(SConnection* conn_) : + Encoder(conn_, encodingRRE, EncoderPlain) { } diff --git a/common/rfb/RREEncoder.h b/common/rfb/RREEncoder.h index b13135b4..e21586ec 100644 --- a/common/rfb/RREEncoder.h +++ b/common/rfb/RREEncoder.h @@ -29,11 +29,11 @@ namespace rfb { public: RREEncoder(SConnection* conn); virtual ~RREEncoder(); - virtual bool isSupported(); - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + bool isSupported() override; + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; private: template<class T> inline void writePixel(rdr::OutStream* os, T pixel); diff --git a/common/rfb/RawDecoder.h b/common/rfb/RawDecoder.h index 33948ced..2ac8b0bd 100644 --- a/common/rfb/RawDecoder.h +++ b/common/rfb/RawDecoder.h @@ -25,11 +25,12 @@ namespace rfb { public: RawDecoder(); virtual ~RawDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; }; } #endif diff --git a/common/rfb/RawEncoder.cxx b/common/rfb/RawEncoder.cxx index 2fa1af36..eff8999d 100644 --- a/common/rfb/RawEncoder.cxx +++ b/common/rfb/RawEncoder.cxx @@ -29,8 +29,8 @@ using namespace rfb; -RawEncoder::RawEncoder(SConnection* conn) : - Encoder(conn, encodingRaw, EncoderPlain) +RawEncoder::RawEncoder(SConnection* conn_) : + Encoder(conn_, encodingRaw, EncoderPlain) { } diff --git a/common/rfb/RawEncoder.h b/common/rfb/RawEncoder.h index 76da4c5b..e191645c 100644 --- a/common/rfb/RawEncoder.h +++ b/common/rfb/RawEncoder.h @@ -27,11 +27,11 @@ namespace rfb { public: RawEncoder(SConnection* conn); virtual ~RawEncoder(); - virtual bool isSupported(); - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + bool isSupported() override; + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; }; } #endif diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx index 7a930af5..08cef044 100644 --- a/common/rfb/SConnection.cxx +++ b/common/rfb/SConnection.cxx @@ -23,6 +23,9 @@ #include <stdio.h> #include <string.h> + +#include <algorithm> + #include <rfb/Exception.h> #include <rfb/Security.h> #include <rfb/clipboardTypes.h> @@ -43,12 +46,12 @@ using namespace rfb; static LogWriter vlog("SConnection"); -SConnection::SConnection(AccessRights accessRights) - : readyForSetColourMapEntries(false), - is(0), os(0), reader_(0), writer_(0), ssecurity(0), +SConnection::SConnection(AccessRights accessRights_) + : readyForSetColourMapEntries(false), is(nullptr), os(nullptr), + reader_(nullptr), writer_(nullptr), ssecurity(nullptr), authFailureTimer(this, &SConnection::handleAuthFailureTimeout), state_(RFBSTATE_UNINITIALISED), preferredEncoding(encodingRaw), - accessRights(accessRights), hasRemoteClipboard(false), + accessRights(accessRights_), hasRemoteClipboard(false), hasLocalClipboard(false), unsolicitedClipboardAttempt(false) { @@ -206,12 +209,10 @@ void SConnection::processSecurityType(int secType) { // Verify that the requested security type should be offered std::list<uint8_t> secTypes; - std::list<uint8_t>::iterator i; secTypes = security.GetEnabledSecTypes(); - for (i=secTypes.begin(); i!=secTypes.end(); i++) - if (*i == secType) break; - if (i == secTypes.end()) + if (std::find(secTypes.begin(), secTypes.end(), + secType) == secTypes.end()) throw Exception("Requested security type not available"); vlog.info("Client requests security type %s(%d)", @@ -275,11 +276,11 @@ bool SConnection::processInitMsg() return reader_->readClientInit(); } -bool SConnection::handleAuthFailureTimeout(Timer* /*t*/) +void SConnection::handleAuthFailureTimeout(Timer* /*t*/) { if (state_ != RFBSTATE_SECURITY_FAILURE) { close("SConnection::handleAuthFailureTimeout: invalid state"); - return false; + return; } try { @@ -292,12 +293,10 @@ bool SConnection::handleAuthFailureTimeout(Timer* /*t*/) os->flush(); } catch (rdr::Exception& e) { close(e.str()); - return false; + return; } close(authFailureMsg.c_str()); - - return false; } void SConnection::throwConnFailedException(const char* format, ...) @@ -459,7 +458,7 @@ void SConnection::approveConnection(bool accept, const char* reason) os->writeU32(secResultFailed); if (!client.beforeVersion(3,8)) { // 3.8 onwards have failure message if (!reason) - reason = "Authentication failure"; + reason = "Connection rejected"; os->writeU32(strlen(reason)); os->writeBytes((const uint8_t*)reason, strlen(reason)); } @@ -477,7 +476,7 @@ void SConnection::approveConnection(bool accept, const char* reason) if (reason) throw AuthFailureException(reason); else - throw AuthFailureException(); + throw AuthFailureException("Connection rejected"); } } @@ -588,7 +587,7 @@ void SConnection::sendClipboardData(const char* data) // FIXME: This conversion magic should be in SMsgWriter std::string filtered(convertCRLF(data)); size_t sizes[1] = { filtered.size() + 1 }; - const uint8_t* data[1] = { (const uint8_t*)filtered.c_str() }; + const uint8_t* datas[1] = { (const uint8_t*)filtered.c_str() }; if (unsolicitedClipboardAttempt) { unsolicitedClipboardAttempt = false; @@ -600,7 +599,7 @@ void SConnection::sendClipboardData(const char* data) } } - writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, data); + writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, datas); } else { writer()->writeServerCutText(data); } @@ -609,11 +608,11 @@ void SConnection::sendClipboardData(const char* data) void SConnection::cleanup() { delete ssecurity; - ssecurity = NULL; + ssecurity = nullptr; delete reader_; - reader_ = NULL; + reader_ = nullptr; delete writer_; - writer_ = NULL; + writer_ = nullptr; } void SConnection::writeFakeColourMap(void) diff --git a/common/rfb/SConnection.h b/common/rfb/SConnection.h index cc88cd1e..46b427ed 100644 --- a/common/rfb/SConnection.h +++ b/common/rfb/SConnection.h @@ -61,8 +61,11 @@ namespace rfb { // there is data to read on the InStream. void initialiseProtocol(); - // processMsg() should be called whenever there is data to read on the - // InStream. You must have called initialiseProtocol() first. + // processMsg() should be called whenever there is data available on + // the CConnection's current InStream. It will process at most one + // RFB message before returning. If there was insufficient data, + // then it will return false and should be called again once more + // data is available. bool processMsg(); // approveConnection() is called to either accept or reject the connection. @@ -71,7 +74,7 @@ namespace rfb { // later, after queryConnection() has returned. It can only be called when // in state RFBSTATE_QUERYING. On rejection, an AuthFailureException is // thrown, so this must be handled appropriately by the caller. - void approveConnection(bool accept, const char* reason=0); + void approveConnection(bool accept, const char* reason=nullptr); // Methods to terminate the connection @@ -83,18 +86,17 @@ namespace rfb { // Overridden from SMsgHandler - virtual void setEncodings(int nEncodings, const int32_t* encodings); + void setEncodings(int nEncodings, const int32_t* encodings) override; - virtual void clientCutText(const char* str); + void clientCutText(const char* str) override; - virtual void handleClipboardRequest(uint32_t flags); - virtual void handleClipboardPeek(); - virtual void handleClipboardNotify(uint32_t flags); - virtual void handleClipboardProvide(uint32_t flags, - const size_t* lengths, - const uint8_t* const* data); + void handleClipboardRequest(uint32_t flags) override; + void handleClipboardPeek() override; + void handleClipboardNotify(uint32_t flags) override; + void handleClipboardProvide(uint32_t flags, const size_t* lengths, + const uint8_t* const* data) override; - virtual void supportsQEMUKeyEvent(); + void supportsQEMUKeyEvent() override; // Methods to be overridden in a derived class @@ -118,27 +120,27 @@ namespace rfb { // clientInit() is called when the ClientInit message is received. The // derived class must call on to SConnection::clientInit(). - virtual void clientInit(bool shared); + void clientInit(bool shared) override; // setPixelFormat() is called when a SetPixelFormat message is received. // The derived class must call on to SConnection::setPixelFormat(). - virtual void setPixelFormat(const PixelFormat& pf); + void setPixelFormat(const PixelFormat& pf) override; // framebufferUpdateRequest() is called when a FramebufferUpdateRequest // message is received. The derived class must call on to // SConnection::framebufferUpdateRequest(). - virtual void framebufferUpdateRequest(const Rect& r, bool incremental); + void framebufferUpdateRequest(const Rect& r, bool incremental) override; // fence() is called when we get a fence request or response. By default // it responds directly to requests (stating it doesn't support any // synchronisation) and drops responses. Override to implement more proper // support. - virtual void fence(uint32_t flags, unsigned len, const uint8_t data[]); + void fence(uint32_t flags, unsigned len, const uint8_t data[]) override; // enableContinuousUpdates() is called when the client wants to enable // or disable continuous updates, or change the active area. - virtual void enableContinuousUpdates(bool enable, - int x, int y, int w, int h); + void enableContinuousUpdates(bool enable, + int x, int y, int w, int h) override; // handleClipboardRequest() is called whenever the client requests // the server to send over its clipboard data. It will only be @@ -238,7 +240,7 @@ namespace rfb { bool processSecurityFailure(); bool processInitMsg(); - bool handleAuthFailureTimeout(Timer* t); + void handleAuthFailureTimeout(Timer* t); int defaultMajorVersion, defaultMinorVersion; diff --git a/common/rfb/SDesktop.h b/common/rfb/SDesktop.h index 9db08116..1d3c325f 100644 --- a/common/rfb/SDesktop.h +++ b/common/rfb/SDesktop.h @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2009-2019 Pierre Ossman for Cendio AB + * Copyright 2009-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,29 +40,29 @@ #include <rfb/PixelBuffer.h> #include <rfb/VNCServer.h> -#include <rfb/InputHandler.h> #include <rfb/screenTypes.h> namespace network { class Socket; } namespace rfb { - class SDesktop : public InputHandler { + class SDesktop { public: + // init() is called immediately when the VNCServer gets a reference + // to the SDesktop, so that a reverse reference can be set up. + virtual void init(rfb::VNCServer* vs) = 0; + // start() is called by the server when the first client authenticates // successfully, and can be used to begin any expensive tasks which are not // needed when there are no clients. A valid PixelBuffer must have been // set via the VNCServer's setPixelBuffer() method by the time this call // returns. - - virtual void start(VNCServer* vs) = 0; + virtual void start() {} // stop() is called by the server when there are no longer any // authenticated clients, and therefore the desktop can cease any - // expensive tasks. No further calls to the VNCServer passed to start() - // can be made once stop has returned. - - virtual void stop() = 0; + // expensive tasks. + virtual void stop() {} // queryConnection() is called when a connection has been // successfully authenticated. The sock and userName arguments @@ -86,10 +86,19 @@ namespace rfb { return resultProhibited; } - // InputHandler interface - // pointerEvent(), keyEvent() and clientCutText() are called in response to - // the relevant RFB protocol messages from clients. - // See InputHandler for method signatures. + // frameTick() is called whenever a frame update has been processed, + // signalling that a good time to render new data + virtual void frameTick(uint64_t msc) { (void)msc; } + + // keyEvent() is called whenever a client sends an event that a + // key was pressed or released. + virtual void keyEvent(uint32_t /*keysym*/, uint32_t /*keycode*/, + bool /*down*/) {}; + + // pointerEvent() is called whenever a client sends an event that + // the pointer moved, or a button was pressed or released. + virtual void pointerEvent(const Point& /*pos*/, + uint8_t /*buttonMask*/) {}; // handleClipboardRequest() is called whenever a client requests // the server to send over its clipboard data. It will only be @@ -119,14 +128,18 @@ namespace rfb { // a plain black desktop of the specified format. class SStaticDesktop : public SDesktop { public: - SStaticDesktop(const Point& size) : server(0), buffer(0) { + SStaticDesktop(const Point& size) + : server(nullptr), buffer(nullptr) + { PixelFormat pf; const uint8_t black[4] = { 0, 0, 0, 0 }; buffer = new ManagedPixelBuffer(pf, size.x, size.y); if (buffer) buffer->fillRect(buffer->getRect(), black); } - SStaticDesktop(const Point& size, const PixelFormat& pf) : buffer(0) { + SStaticDesktop(const Point& size, const PixelFormat& pf) + : buffer(nullptr) + { const uint8_t black[4] = { 0, 0, 0, 0 }; buffer = new ManagedPixelBuffer(pf, size.x, size.y); if (buffer) @@ -136,17 +149,13 @@ namespace rfb { if (buffer) delete buffer; } - virtual void start(VNCServer* vs) { + void init(VNCServer* vs) override { server = vs; server->setPixelBuffer(buffer); } - virtual void stop() { - server->setPixelBuffer(0); - server = 0; - } - virtual void queryConnection(network::Socket* sock, - const char* /*userName*/) { - server->approveConnection(sock, true, NULL); + void queryConnection(network::Socket* sock, + const char* /*userName*/) override { + server->approveConnection(sock, true, nullptr); } protected: diff --git a/common/rfb/SMsgHandler.cxx b/common/rfb/SMsgHandler.cxx index 4ecfc2b2..03917926 100644 --- a/common/rfb/SMsgHandler.cxx +++ b/common/rfb/SMsgHandler.cxx @@ -74,6 +74,20 @@ void SMsgHandler::setEncodings(int nEncodings, const int32_t* encodings) supportsQEMUKeyEvent(); } +void SMsgHandler::keyEvent(uint32_t /*keysym*/, uint32_t /*keycode*/, + bool /*down*/) +{ +} + +void SMsgHandler::pointerEvent(const Point& /*pos*/, + uint8_t /*buttonMask*/) +{ +} + +void SMsgHandler::clientCutText(const char* /*str*/) +{ +} + void SMsgHandler::handleClipboardCaps(uint32_t flags, const uint32_t* lengths) { int i; diff --git a/common/rfb/SMsgHandler.h b/common/rfb/SMsgHandler.h index 20dc066f..cff8b1bd 100644 --- a/common/rfb/SMsgHandler.h +++ b/common/rfb/SMsgHandler.h @@ -27,14 +27,13 @@ #include <rfb/PixelFormat.h> #include <rfb/ClientParams.h> -#include <rfb/InputHandler.h> #include <rfb/ScreenSet.h> namespace rdr { class InStream; } namespace rfb { - class SMsgHandler : public InputHandler { + class SMsgHandler { public: SMsgHandler(); virtual ~SMsgHandler(); @@ -55,6 +54,13 @@ namespace rfb { virtual void enableContinuousUpdates(bool enable, int x, int y, int w, int h) = 0; + virtual void keyEvent(uint32_t keysym, uint32_t keycode, + bool down); + virtual void pointerEvent(const Point& pos, + uint8_t buttonMask); + + virtual void clientCutText(const char* str); + virtual void handleClipboardCaps(uint32_t flags, const uint32_t* lengths); virtual void handleClipboardRequest(uint32_t flags); @@ -64,9 +70,6 @@ namespace rfb { const size_t* lengths, const uint8_t* const* data); - // InputHandler interface - // The InputHandler methods will be called for the corresponding messages. - // supportsLocalCursor() is called whenever the status of // cp.supportsLocalCursor has changed. At the moment this happens on a // setEncodings message, but in the future this may be due to a message diff --git a/common/rfb/SMsgReader.cxx b/common/rfb/SMsgReader.cxx index 0792639a..9ddea53d 100644 --- a/common/rfb/SMsgReader.cxx +++ b/common/rfb/SMsgReader.cxx @@ -418,7 +418,7 @@ bool SMsgReader::readExtendedClipboard(int32_t len) } zis.flushUnderlying(); - zis.setUnderlying(NULL, 0); + zis.setUnderlying(nullptr, 0); handler->handleClipboardProvide(flags, lengths, buffers); diff --git a/common/rfb/SMsgWriter.cxx b/common/rfb/SMsgWriter.cxx index 8592e6f4..0c03b51d 100644 --- a/common/rfb/SMsgWriter.cxx +++ b/common/rfb/SMsgWriter.cxx @@ -93,7 +93,7 @@ void SMsgWriter::writeBell() void SMsgWriter::writeServerCutText(const char* str) { - if (strchr(str, '\r') != NULL) + if (strchr(str, '\r') != nullptr) throw Exception("Invalid carriage return in clipboard data"); std::string latin1(utf8ToLatin1(str)); @@ -508,10 +508,9 @@ void SMsgWriter::writeNoDataRects() { if (!extendedDesktopSizeMsgs.empty()) { if (client->supportsEncoding(pseudoEncodingExtendedDesktopSize)) { - std::list<ExtendedDesktopSizeMsg>::const_iterator ri; - for (ri = extendedDesktopSizeMsgs.begin();ri != extendedDesktopSizeMsgs.end();++ri) { + for (ExtendedDesktopSizeMsg msg : extendedDesktopSizeMsgs) { // FIXME: We can probably skip multiple reasonServer entries - writeExtendedDesktopSizeRect(ri->reason, ri->result, + writeExtendedDesktopSizeRect(msg.reason, msg.result, client->width(), client->height(), client->screenLayout()); } diff --git a/common/rfb/SSecurityNone.h b/common/rfb/SSecurityNone.h index f14d83a4..a10b4369 100644 --- a/common/rfb/SSecurityNone.h +++ b/common/rfb/SSecurityNone.h @@ -28,10 +28,10 @@ namespace rfb { class SSecurityNone : public SSecurity { public: - SSecurityNone(SConnection* sc) : SSecurity(sc) {} - virtual bool processMsg() { return true; } - virtual int getType() const {return secTypeNone;} - virtual const char* getUserName() const {return 0;} + SSecurityNone(SConnection* sc_) : SSecurity(sc_) {} + bool processMsg() override { return true; } + int getType() const override {return secTypeNone;} + const char* getUserName() const override {return nullptr;} }; } #endif diff --git a/common/rfb/SSecurityPlain.cxx b/common/rfb/SSecurityPlain.cxx index a100a757..e009de39 100644 --- a/common/rfb/SSecurityPlain.cxx +++ b/common/rfb/SSecurityPlain.cxx @@ -68,14 +68,14 @@ bool PasswordValidator::validUser(const char* username) return false; } -SSecurityPlain::SSecurityPlain(SConnection* sc) : SSecurity(sc) +SSecurityPlain::SSecurityPlain(SConnection* sc_) : SSecurity(sc_) { #ifdef WIN32 valid = new WinPasswdValidator(); #elif !defined(__APPLE__) valid = new UnixPasswordValidator(); #else - valid = NULL; + valid = nullptr; #endif state = 0; @@ -87,7 +87,7 @@ bool SSecurityPlain::processMsg() char password[1024]; if (!valid) - throw AuthFailureException("No password validator configured"); + throw Exception("No password validator configured"); if (state == 0) { if (!is->hasData(8)) @@ -114,7 +114,7 @@ bool SSecurityPlain::processMsg() username[ulen] = 0; plen = 0; if (!valid->validate(sc, username, password)) - throw AuthFailureException("invalid password or username"); + throw AuthFailureException("Authentication failed"); } return true; diff --git a/common/rfb/SSecurityPlain.h b/common/rfb/SSecurityPlain.h index 4ca72781..c0ac049b 100644 --- a/common/rfb/SSecurityPlain.h +++ b/common/rfb/SSecurityPlain.h @@ -43,9 +43,9 @@ namespace rfb { class SSecurityPlain : public SSecurity { public: SSecurityPlain(SConnection* sc); - virtual bool processMsg(); - virtual int getType() const { return secTypePlain; }; - virtual const char* getUserName() const { return username; } + bool processMsg() override; + int getType() const override { return secTypePlain; }; + const char* getUserName() const override { return username; } virtual ~SSecurityPlain() { } diff --git a/common/rfb/SSecurityRSAAES.cxx b/common/rfb/SSecurityRSAAES.cxx index cea62644..37860a10 100644 --- a/common/rfb/SSecurityRSAAES.cxx +++ b/common/rfb/SSecurityRSAAES.cxx @@ -70,14 +70,15 @@ BoolParameter SSecurityRSAAES::requireUsername ("RequireUsername", "Require username for the RSA-AES security types", false, ConfServer); -SSecurityRSAAES::SSecurityRSAAES(SConnection* sc, uint32_t _secType, +SSecurityRSAAES::SSecurityRSAAES(SConnection* sc_, uint32_t _secType, int _keySize, bool _isAllEncrypted) - : SSecurity(sc), state(SendPublicKey), + : SSecurity(sc_), state(SendPublicKey), keySize(_keySize), isAllEncrypted(_isAllEncrypted), secType(_secType), serverKey(), clientKey(), - serverKeyN(NULL), serverKeyE(NULL), clientKeyN(NULL), clientKeyE(NULL), + serverKeyN(nullptr), serverKeyE(nullptr), + clientKeyN(nullptr), clientKeyE(nullptr), accessRights(AccessDefault), - rais(NULL), raos(NULL), rawis(NULL), rawos(NULL) + rais(nullptr), raos(nullptr), rawis(nullptr), rawos(nullptr) { assert(keySize == 128 || keySize == 256); } @@ -154,18 +155,18 @@ void SSecurityRSAAES::loadPrivateKey() { FILE* file = fopen(keyFile, "rb"); if (!file) - throw ConnFailedException("failed to open key file"); + throw Exception("failed to open key file"); fseek(file, 0, SEEK_END); size_t size = ftell(file); if (size == 0 || size > MaxKeyFileSize) { fclose(file); - throw ConnFailedException("size of key file is zero or too big"); + throw Exception("size of key file is zero or too big"); } fseek(file, 0, SEEK_SET); std::vector<uint8_t> data(size); if (fread(data.data(), 1, data.size(), file) != size) { fclose(file); - throw ConnFailedException("failed to read key"); + throw Exception("failed to read key"); } fclose(file); @@ -182,7 +183,7 @@ void SSecurityRSAAES::loadPrivateKey() loadPKCS8Key(der.data(), der.size()); return; } - throw ConnFailedException("failed to import key"); + throw Exception("failed to import key"); } void SSecurityRSAAES::loadPKCS1Key(const uint8_t* data, size_t size) @@ -193,7 +194,7 @@ void SSecurityRSAAES::loadPKCS1Key(const uint8_t* data, size_t size) if (!rsa_keypair_from_der(&pub, &serverKey, 0, size, data)) { rsa_private_key_clear(&serverKey); rsa_public_key_clear(&pub); - throw ConnFailedException("failed to import key"); + throw Exception("failed to import key"); } serverKeyLength = serverKey.size * 8; serverKeyN = new uint8_t[serverKey.size]; @@ -233,7 +234,7 @@ void SSecurityRSAAES::loadPKCS8Key(const uint8_t* data, size_t size) loadPKCS1Key(i.data, i.length); return; failed: - throw ConnFailedException("failed to import key"); + throw Exception("failed to import key"); } bool SSecurityRSAAES::processMsg() @@ -514,10 +515,10 @@ void SSecurityRSAAES::clearSecrets() delete[] serverKeyE; delete[] clientKeyN; delete[] clientKeyE; - serverKeyN = NULL; - serverKeyE = NULL; - clientKeyN = NULL; - clientKeyE = NULL; + serverKeyN = nullptr; + serverKeyE = nullptr; + clientKeyN = nullptr; + clientKeyE = nullptr; memset(serverRandom, 0, sizeof(serverRandom)); memset(clientRandom, 0, sizeof(clientRandom)); } @@ -560,11 +561,11 @@ void SSecurityRSAAES::verifyUserPass() #endif if (!valid->validate(sc, username, password)) { delete valid; - throw AuthFailureException("invalid password or username"); + throw AuthFailureException("Authentication failed"); } delete valid; #else - throw AuthFailureException("No password validator configured"); + throw Exception("No password validator configured"); #endif } @@ -575,7 +576,7 @@ void SSecurityRSAAES::verifyPass() pg->getVncAuthPasswd(&passwd, &passwdReadOnly); if (passwd.empty()) - throw AuthFailureException("No password configured for VNC Auth"); + throw Exception("No password configured"); if (password == passwd) { accessRights = AccessDefault; @@ -587,7 +588,7 @@ void SSecurityRSAAES::verifyPass() return; } - throw AuthFailureException(); + throw AuthFailureException("Authentication failed"); } const char* SSecurityRSAAES::getUserName() const diff --git a/common/rfb/SSecurityRSAAES.h b/common/rfb/SSecurityRSAAES.h index 0c4fc852..edac35c6 100644 --- a/common/rfb/SSecurityRSAAES.h +++ b/common/rfb/SSecurityRSAAES.h @@ -36,10 +36,10 @@ namespace rfb { SSecurityRSAAES(SConnection* sc, uint32_t secType, int keySize, bool isAllEncrypted); virtual ~SSecurityRSAAES(); - virtual bool processMsg(); - virtual const char* getUserName() const; - virtual int getType() const { return secType; } - virtual AccessRights getAccessRights() const + bool processMsg() override; + const char* getUserName() const override; + int getType() const override {return secType;} + AccessRights getAccessRights() const override { return accessRights; } diff --git a/common/rfb/SSecurityStack.cxx b/common/rfb/SSecurityStack.cxx index 9c0321d4..0ce6d754 100644 --- a/common/rfb/SSecurityStack.cxx +++ b/common/rfb/SSecurityStack.cxx @@ -24,9 +24,9 @@ using namespace rfb; -SSecurityStack::SSecurityStack(SConnection* sc, int Type, +SSecurityStack::SSecurityStack(SConnection* sc_, int Type, SSecurity* s0, SSecurity* s1) - : SSecurity(sc), state(0), state0(s0), state1(s1), type(Type) + : SSecurity(sc_), state(0), state0(s0), state1(s1), type(Type) { } @@ -61,7 +61,7 @@ bool SSecurityStack::processMsg() const char* SSecurityStack::getUserName() const { - const char* c = 0; + const char* c = nullptr; if (state1 && !c) c = state1->getUserName(); diff --git a/common/rfb/SSecurityStack.h b/common/rfb/SSecurityStack.h index cf7b10d0..d2949a21 100644 --- a/common/rfb/SSecurityStack.h +++ b/common/rfb/SSecurityStack.h @@ -27,12 +27,12 @@ namespace rfb { class SSecurityStack : public SSecurity { public: SSecurityStack(SConnection* sc, int Type, - SSecurity* s0 = NULL, SSecurity* s1 = NULL); + SSecurity* s0 = nullptr, SSecurity* s1 = nullptr); ~SSecurityStack(); - virtual bool processMsg(); - virtual int getType() const { return type; }; - virtual const char* getUserName() const; - virtual AccessRights getAccessRights() const; + bool processMsg() override; + int getType() const override { return type; }; + const char* getUserName() const override; + AccessRights getAccessRights() const override; protected: short state; SSecurity* state0; diff --git a/common/rfb/SSecurityTLS.cxx b/common/rfb/SSecurityTLS.cxx index 1abfd774..67dced6c 100644 --- a/common/rfb/SSecurityTLS.cxx +++ b/common/rfb/SSecurityTLS.cxx @@ -34,6 +34,7 @@ #include <rfb/SConnection.h> #include <rfb/LogWriter.h> #include <rfb/Exception.h> +#include <rdr/TLSException.h> #include <rdr/TLSInStream.h> #include <rdr/TLSOutStream.h> #include <gnutls/x509.h> @@ -66,17 +67,20 @@ StringParameter SSecurityTLS::X509_KeyFile static LogWriter vlog("TLS"); -SSecurityTLS::SSecurityTLS(SConnection* sc, bool _anon) - : SSecurity(sc), session(NULL), anon_cred(NULL), - cert_cred(NULL), anon(_anon), tlsis(NULL), tlsos(NULL), - rawis(NULL), rawos(NULL) +SSecurityTLS::SSecurityTLS(SConnection* sc_, bool _anon) + : SSecurity(sc_), session(nullptr), anon_cred(nullptr), + cert_cred(nullptr), anon(_anon), tlsis(nullptr), tlsos(nullptr), + rawis(nullptr), rawos(nullptr) { + int ret; + #if defined (SSECURITYTLS__USE_DEPRECATED_DH) - dh_params = NULL; + dh_params = nullptr; #endif - if (gnutls_global_init() != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_global_init failed"); + ret = gnutls_global_init(); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_global_init()", ret); } void SSecurityTLS::shutdown() @@ -99,32 +103,32 @@ void SSecurityTLS::shutdown() if (anon_cred) { gnutls_anon_free_server_credentials(anon_cred); - anon_cred = 0; + anon_cred = nullptr; } if (cert_cred) { gnutls_certificate_free_credentials(cert_cred); - cert_cred = 0; + cert_cred = nullptr; } if (rawis && rawos) { sc->setStreams(rawis, rawos); - rawis = NULL; - rawos = NULL; + rawis = nullptr; + rawos = nullptr; } if (tlsis) { delete tlsis; - tlsis = NULL; + tlsis = nullptr; } if (tlsos) { delete tlsos; - tlsos = NULL; + tlsos = nullptr; } if (session) { gnutls_deinit(session); - session = 0; + session = nullptr; } } @@ -138,20 +142,24 @@ SSecurityTLS::~SSecurityTLS() bool SSecurityTLS::processMsg() { + int err; + vlog.debug("Process security message (session %p)", session); if (!session) { rdr::InStream* is = sc->getInStream(); rdr::OutStream* os = sc->getOutStream(); - if (gnutls_init(&session, GNUTLS_SERVER) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_init failed"); + err = gnutls_init(&session, GNUTLS_SERVER); + if (err != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_init()", err); - if (gnutls_set_default_priority(session) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_set_default_priority failed"); + err = gnutls_set_default_priority(session); + if (err != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_set_default_priority()", err); try { - setParams(session); + setParams(); } catch(...) { os->writeU8(0); @@ -170,7 +178,6 @@ bool SSecurityTLS::processMsg() rawos = os; } - int err; err = gnutls_handshake(session); if (err != GNUTLS_E_SUCCESS) { if (!gnutls_error_is_fatal(err)) { @@ -179,7 +186,7 @@ bool SSecurityTLS::processMsg() } vlog.error("TLS Handshake failed: %s", gnutls_strerror (err)); shutdown(); - throw AuthFailureException("TLS Handshake failed"); + throw rdr::TLSException("TLS Handshake failed", err); } vlog.debug("TLS handshake completed with %s", @@ -190,7 +197,7 @@ bool SSecurityTLS::processMsg() return true; } -void SSecurityTLS::setParams(gnutls_session_t session) +void SSecurityTLS::setParams() { static const char kx_anon_priority[] = ":+ANON-ECDH:+ANON-DH"; @@ -203,8 +210,8 @@ void SSecurityTLS::setParams(gnutls_session_t session) prio = (char*)malloc(strlen(Security::GnuTLSPriority) + strlen(kx_anon_priority) + 1); - if (prio == NULL) - throw AuthFailureException("Not enough memory for GnuTLS priority string"); + if (prio == nullptr) + throw Exception("Not enough memory for GnuTLS priority string"); strcpy(prio, Security::GnuTLSPriority); if (anon) @@ -217,7 +224,7 @@ void SSecurityTLS::setParams(gnutls_session_t session) if (ret != GNUTLS_E_SUCCESS) { if (ret == GNUTLS_E_INVALID_REQUEST) vlog.error("GnuTLS priority syntax error at: %s", err); - throw AuthFailureException("gnutls_set_priority_direct failed"); + throw rdr::TLSException("gnutls_set_priority_direct()", ret); } } else if (anon) { const char *err; @@ -229,7 +236,7 @@ void SSecurityTLS::setParams(gnutls_session_t session) if (ret != GNUTLS_E_SUCCESS) { if (ret == GNUTLS_E_INVALID_REQUEST) vlog.error("GnuTLS priority syntax error at: %s", err); - throw AuthFailureException("gnutls_set_default_priority_append failed"); + throw rdr::TLSException("gnutls_set_default_priority_append()", ret); } #else // We don't know what the system default priority is, so we guess @@ -239,8 +246,8 @@ void SSecurityTLS::setParams(gnutls_session_t session) prio = (char*)malloc(strlen(gnutls_default_priority) + strlen(kx_anon_priority) + 1); - if (prio == NULL) - throw AuthFailureException("Not enough memory for GnuTLS priority string"); + if (prio == nullptr) + throw Exception("Not enough memory for GnuTLS priority string"); strcpy(prio, gnutls_default_priority); strcat(prio, kx_anon_priority); @@ -252,36 +259,41 @@ void SSecurityTLS::setParams(gnutls_session_t session) if (ret != GNUTLS_E_SUCCESS) { if (ret == GNUTLS_E_INVALID_REQUEST) vlog.error("GnuTLS priority syntax error at: %s", err); - throw AuthFailureException("gnutls_set_priority_direct failed"); + throw rdr::TLSException("gnutls_set_priority_direct()", ret); } #endif } #if defined (SSECURITYTLS__USE_DEPRECATED_DH) - if (gnutls_dh_params_init(&dh_params) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_dh_params_init failed"); - - if (gnutls_dh_params_import_pkcs3(dh_params, &ffdhe_pkcs3_param, GNUTLS_X509_FMT_PEM) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_dh_params_import_pkcs3 failed"); + ret = gnutls_dh_params_init(&dh_params); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_dh_params_init()", ret); + + ret = gnutls_dh_params_import_pkcs3(dh_params, &ffdhe_pkcs3_param, + GNUTLS_X509_FMT_PEM); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_dh_params_import_pkcs3()", ret); #endif if (anon) { - if (gnutls_anon_allocate_server_credentials(&anon_cred) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_anon_allocate_server_credentials failed"); + ret = gnutls_anon_allocate_server_credentials(&anon_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_anon_allocate_server_credentials()", ret); #if defined (SSECURITYTLS__USE_DEPRECATED_DH) gnutls_anon_set_server_dh_params(anon_cred, dh_params); #endif - if (gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred) - != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_credentials_set failed"); + ret = gnutls_credentials_set(session, GNUTLS_CRD_ANON, anon_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_credentials_set()", ret); vlog.debug("Anonymous session has been set"); } else { - if (gnutls_certificate_allocate_credentials(&cert_cred) != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_certificate_allocate_credentials failed"); + ret = gnutls_certificate_allocate_credentials(&cert_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_certificate_allocate_credentials()", ret); #if defined (SSECURITYTLS__USE_DEPRECATED_DH) gnutls_certificate_set_dh_params(cert_cred, dh_params); @@ -291,16 +303,16 @@ void SSecurityTLS::setParams(gnutls_session_t session) case GNUTLS_E_SUCCESS: break; case GNUTLS_E_CERTIFICATE_KEY_MISMATCH: - throw AuthFailureException("Private key does not match certificate"); + throw Exception("Private key does not match certificate"); case GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE: - throw AuthFailureException("Unsupported certificate type"); + throw Exception("Unsupported certificate type"); default: - throw AuthFailureException("Error loading X509 certificate or key"); + throw Exception("Error loading X509 certificate or key"); } - if (gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cert_cred) - != GNUTLS_E_SUCCESS) - throw AuthFailureException("gnutls_credentials_set failed"); + ret = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cert_cred); + if (ret != GNUTLS_E_SUCCESS) + throw rdr::TLSException("gnutls_credentials_set()", ret); vlog.debug("X509 session has been set"); diff --git a/common/rfb/SSecurityTLS.h b/common/rfb/SSecurityTLS.h index d0f735fe..c29ee474 100644 --- a/common/rfb/SSecurityTLS.h +++ b/common/rfb/SSecurityTLS.h @@ -45,16 +45,16 @@ namespace rfb { public: SSecurityTLS(SConnection* sc, bool _anon); virtual ~SSecurityTLS(); - virtual bool processMsg(); - virtual const char* getUserName() const {return 0;} - virtual int getType() const { return anon ? secTypeTLSNone : secTypeX509None;} + bool processMsg() override; + const char* getUserName() const override {return nullptr;} + int getType() const override { return anon ? secTypeTLSNone : secTypeX509None;} static StringParameter X509_CertFile; static StringParameter X509_KeyFile; protected: void shutdown(); - void setParams(gnutls_session_t session); + void setParams(); private: gnutls_session_t session; diff --git a/common/rfb/SSecurityVeNCrypt.cxx b/common/rfb/SSecurityVeNCrypt.cxx index 2813f299..164ea927 100644 --- a/common/rfb/SSecurityVeNCrypt.cxx +++ b/common/rfb/SSecurityVeNCrypt.cxx @@ -33,15 +33,14 @@ #include <rdr/OutStream.h> using namespace rfb; -using namespace rdr; -using namespace std; static LogWriter vlog("SVeNCrypt"); -SSecurityVeNCrypt::SSecurityVeNCrypt(SConnection* sc, SecurityServer *sec) - : SSecurity(sc), security(sec) +SSecurityVeNCrypt::SSecurityVeNCrypt(SConnection* sc_, + SecurityServer *sec) + : SSecurity(sc_), security(sec) { - ssecurity = NULL; + ssecurity = nullptr; haveSentVersion = false; haveRecvdMajorVersion = false; haveRecvdMinorVersion = false; @@ -51,7 +50,7 @@ SSecurityVeNCrypt::SSecurityVeNCrypt(SConnection* sc, SecurityServer *sec) haveChosenType = false; chosenType = secTypeVeNCrypt; numTypes = 0; - subTypes = NULL; + subTypes = nullptr; } SSecurityVeNCrypt::~SSecurityVeNCrypt() @@ -100,8 +99,8 @@ bool SSecurityVeNCrypt::processMsg() case 0x0001: /* 0.1 Legacy VeNCrypt, not supported */ os->writeU8(0xFF); /* This is not OK */ os->flush(); - throw AuthFailureException("The client cannot support the server's " - "VeNCrypt version"); + throw Exception("The client cannot support the server's " + "VeNCrypt version"); case 0x0002: /* 0.2 */ os->writeU8(0); /* OK */ @@ -110,7 +109,7 @@ bool SSecurityVeNCrypt::processMsg() default: os->writeU8(0xFF); /* Not OK */ os->flush(); - throw AuthFailureException("The client returned an unsupported VeNCrypt version"); + throw Exception("The client returned an unsupported VeNCrypt version"); } } @@ -119,7 +118,7 @@ bool SSecurityVeNCrypt::processMsg() * followed by authentication types (uint32_t:s) */ if (!haveSentTypes) { - list<uint32_t> listSubTypes; + std::list<uint32_t> listSubTypes; listSubTypes = security->GetEnabledExtSecTypes(); @@ -139,7 +138,7 @@ bool SSecurityVeNCrypt::processMsg() os->flush(); haveSentTypes = true; } else - throw AuthFailureException("There are no VeNCrypt sub-types to send to the client"); + throw Exception("There are no VeNCrypt sub-types to send to the client"); } /* get type back from client (must be one of the ones we sent) */ @@ -164,7 +163,7 @@ bool SSecurityVeNCrypt::processMsg() /* Set up the stack according to the chosen type */ if (chosenType == secTypeInvalid || chosenType == secTypeVeNCrypt) - throw AuthFailureException("No valid VeNCrypt sub-type"); + throw Exception("No valid VeNCrypt sub-type"); ssecurity = security->GetSSecurity(sc, chosenType); } @@ -175,14 +174,14 @@ bool SSecurityVeNCrypt::processMsg() const char* SSecurityVeNCrypt::getUserName() const { - if (ssecurity == NULL) - return NULL; + if (ssecurity == nullptr) + return nullptr; return ssecurity->getUserName(); } AccessRights SSecurityVeNCrypt::getAccessRights() const { - if (ssecurity == NULL) + if (ssecurity == nullptr) return SSecurity::getAccessRights(); return ssecurity->getAccessRights(); } diff --git a/common/rfb/SSecurityVeNCrypt.h b/common/rfb/SSecurityVeNCrypt.h index 91713f89..ea2bb6fb 100644 --- a/common/rfb/SSecurityVeNCrypt.h +++ b/common/rfb/SSecurityVeNCrypt.h @@ -34,10 +34,10 @@ namespace rfb { public: SSecurityVeNCrypt(SConnection* sc, SecurityServer *sec); ~SSecurityVeNCrypt(); - virtual bool processMsg(); - virtual int getType() const { return chosenType; } - virtual const char* getUserName() const; - virtual AccessRights getAccessRights() const; + bool processMsg() override; + int getType() const override { return chosenType; } + const char* getUserName() const override; + AccessRights getAccessRights() const override; protected: SSecurity *ssecurity; diff --git a/common/rfb/SSecurityVncAuth.cxx b/common/rfb/SSecurityVncAuth.cxx index c1ef1f1c..272c7ca1 100644 --- a/common/rfb/SSecurityVncAuth.cxx +++ b/common/rfb/SSecurityVncAuth.cxx @@ -52,8 +52,8 @@ VncAuthPasswdParameter SSecurityVncAuth::vncAuthPasswd ("Password", "Obfuscated binary encoding of the password which clients must supply to " "access the server", &SSecurityVncAuth::vncAuthPasswdFile); -SSecurityVncAuth::SSecurityVncAuth(SConnection* sc) - : SSecurity(sc), sentChallenge(false), +SSecurityVncAuth::SSecurityVncAuth(SConnection* sc_) + : SSecurity(sc_), sentChallenge(false), pg(&vncAuthPasswd), accessRights(AccessNone) { } @@ -100,7 +100,7 @@ bool SSecurityVncAuth::processMsg() pg->getVncAuthPasswd(&passwd, &passwdReadOnly); if (passwd.empty()) - throw AuthFailureException("No password configured for VNC Auth"); + throw Exception("No password configured"); if (verifyResponse(passwd.c_str())) { accessRights = AccessDefault; @@ -113,13 +113,15 @@ bool SSecurityVncAuth::processMsg() return true; } - throw AuthFailureException(); + throw AuthFailureException("Authentication failed"); } -VncAuthPasswdParameter::VncAuthPasswdParameter(const char* name, +VncAuthPasswdParameter::VncAuthPasswdParameter(const char* name_, const char* desc, StringParameter* passwdFile_) -: BinaryParameter(name, desc, 0, 0, ConfServer), passwdFile(passwdFile_) { +: BinaryParameter(name_, desc, nullptr, 0, ConfServer), + passwdFile(passwdFile_) +{ } void VncAuthPasswdParameter::getVncAuthPasswd(std::string *password, std::string *readOnlyPassword) { @@ -151,8 +153,8 @@ void VncAuthPasswdParameter::getVncAuthPasswd(std::string *password, std::string } } - assert(password != NULL); - assert(readOnlyPassword != NULL); + assert(password != nullptr); + assert(readOnlyPassword != nullptr); try { *password = deobfuscate(obfuscated.data(), obfuscated.size()); diff --git a/common/rfb/SSecurityVncAuth.h b/common/rfb/SSecurityVncAuth.h index 7f27b02b..532abe0a 100644 --- a/common/rfb/SSecurityVncAuth.h +++ b/common/rfb/SSecurityVncAuth.h @@ -44,7 +44,7 @@ namespace rfb { class VncAuthPasswdParameter : public VncAuthPasswdGetter, BinaryParameter { public: VncAuthPasswdParameter(const char* name, const char* desc, StringParameter* passwdFile_); - virtual void getVncAuthPasswd(std::string *password, std::string *readOnlyPassword); + void getVncAuthPasswd(std::string *password, std::string *readOnlyPassword) override; protected: StringParameter* passwdFile; }; @@ -52,10 +52,10 @@ namespace rfb { class SSecurityVncAuth : public SSecurity { public: SSecurityVncAuth(SConnection* sc); - virtual bool processMsg(); - virtual int getType() const {return secTypeVncAuth;} - virtual const char* getUserName() const {return 0;} - virtual AccessRights getAccessRights() const { return accessRights; } + bool processMsg() override; + int getType() const override {return secTypeVncAuth;} + const char* getUserName() const override {return nullptr;} + AccessRights getAccessRights() const override { return accessRights; } static StringParameter vncAuthPasswdFile; static VncAuthPasswdParameter vncAuthPasswd; private: diff --git a/common/rfb/ScaleFilters.cxx b/common/rfb/ScaleFilters.cxx deleted file mode 100644 index 823dc740..00000000 --- a/common/rfb/ScaleFilters.cxx +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 2006 TightVNC Team. All Rights Reserved. - * - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <assert.h> -#include <math.h> - -#include <rfb/Rect.h> -#include <rfb/ScaleFilters.h> - -using namespace rfb; - -// -// -=- 1-D filters functions -// - -// Nearest neighbor filter function -double nearest_neighbor(double x) { - if (x < -0.5) return 0.0; - if (x < 0.5) return 1.0; - return 0.0; -} - -// Linear filter function -double linear(double x) { - if (x < -1.0) return 0.0; - if (x < 0.0) return 1.0+x; - if (x < 1.0) return 1.0-x; - return 0.0; -} - -// Cubic filter functions -double cubic(double x) { - double t; - if (x < -2.0) return 0.0; - if (x < -1.0) {t = 2.0+x; return t*t*t/6.0;} - if (x < 0.0) return (4.0+x*x*(-6.0+x*-3.0))/6.0; - if (x < 1.0) return (4.0+x*x*(-6.0+x*3.0))/6.0; - if (x < 2.0) {t = 2.0-x; return t*t*t/6.0;} - return 0.0; -} - - -// -// -=- ScaleFilters class -// - -SFilter &ScaleFilters::operator[](unsigned int filter_id) { - assert(filter_id <= scaleFilterMaxNumber); - return filters[filter_id]; -} - -int ScaleFilters::getFilterIdByName(char *filterName) { - for (unsigned int i = 0; i <= scaleFilterMaxNumber; i++) { - if (strcasecmp(filters[i].name, filterName) == 0) return i; - } - return -1; -} - -void ScaleFilters::initFilters() { - filters[scaleFilterNearestNeighbor] = create("Nearest neighbor", 0.5, nearest_neighbor); - filters[scaleFilterBilinear] = create("Bilinear", 1, linear); - filters[scaleFilterBicubic] = create("Bicubic", 2, cubic); -} - -SFilter ScaleFilters::create(const char *name_, double radius_, filter_func func_) { - SFilter filter; - strncpy(filter.name, name_, sizeof(filter.name)-1); - filter.name[sizeof(filter.name)-1] = '\0'; - filter.radius = radius_; - filter.func = func_; - return filter; -} - -void ScaleFilters::makeWeightTabs(int filter_id, int src_x, int dst_x, SFilterWeightTab **pWeightTabs) { - double sxc; - double offset = 0.5; - double ratio = (double)dst_x / src_x; - double sourceScale = __rfbmax(1.0, 1.0/ratio); - double sourceRadius = __rfbmax(0.5, sourceScale * filters[filter_id].radius); - double sum, nc; - int i, ci; - - SFilter sFilter = filters[filter_id]; - - *pWeightTabs = new SFilterWeightTab[dst_x]; - SFilterWeightTab *weightTabs = *pWeightTabs; - - // Make the weight tab for the each dest x position - for (int x = 0; x < dst_x; x++) { - sxc = (double(x)+offset) / ratio; - - // Calculate the scale filter interval, [i0, i1) - int i0 = int(__rfbmax(sxc-sourceRadius+0.5, 0)); - int i1 = int(__rfbmin(sxc+sourceRadius+0.5, src_x)); - - weightTabs[x].i0 = i0; weightTabs[x].i1 = i1; - weightTabs[x].weight = new short[i1-i0]; - - // Calculate coeff to normalize the filter weights - for (sum = 0, i = i0; i < i1; i++) sum += sFilter.func((double(i)-sxc+0.5)/sourceScale); - if (sum == 0.) nc = (double)(WEIGHT_OF_ONE); else nc = (double)(WEIGHT_OF_ONE)/sum; - - - // Calculate the weight coeffs on the scale filter interval - for (ci = 0, i = i0; i < i1; i++) { - weightTabs[x].weight[ci++] = (short)floor((sFilter.func((double(i)-sxc+0.5)/sourceScale) * nc) + 0.5); - } - } -} diff --git a/common/rfb/ScaleFilters.h b/common/rfb/ScaleFilters.h deleted file mode 100644 index 23c87b64..00000000 --- a/common/rfb/ScaleFilters.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 2006 TightVNC Team. All Rights Reserved. - * - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -// -=- ScaleFilters.h -// -// Definitions of the 1-D filters and routines using for the image scaling. -// -// - -namespace rfb { - - #define SCALE_ERROR (1e-7) - #define BITS_OF_CHANEL 8 - #define BITS_OF_WEIGHT 14 - #define FINALSHIFT (2 * BITS_OF_WEIGHT - BITS_OF_CHANEL) - #define WEIGHT_OF_ONE (1 << BITS_OF_WEIGHT) - - typedef double (*filter_func)(double x); - - const double pi = 3.14159265358979; - - const unsigned int scaleFilterNearestNeighbor = 0; - const unsigned int scaleFilterBilinear = 1; - const unsigned int scaleFilterBicubic = 2; - - const unsigned int scaleFilterMaxNumber = 2; - const unsigned int defaultScaleFilter = scaleFilterBilinear; - - // - // -=- Scale filters structures and routines - // - - // Scale filter stuct - typedef struct { - char name[30]; // Filter name - double radius; // Radius where filter function is nonzero - filter_func func; // Pointer to filter function - } SFilter; - - // Scale filter weight table - typedef struct { - short i0, i1; // Filter function interval, [i0..i1) - short *weight; // Weight coefficients on the filter function interval - } SFilterWeightTab; - - - // ScaleFilters class helps us using a set of 1-d scale filters. - class ScaleFilters { - public: - ScaleFilters() { initFilters(); }; - - SFilter &operator[](unsigned int filter_id); - - int getFilterIdByName(char *filterName); - - void makeWeightTabs(int filter, int src_x, int dst_x, SFilterWeightTab **weightTabs); - - protected: - void initFilters(); - - SFilter create(const char *name_, double radius_, filter_func func_); - - SFilter filters[scaleFilterMaxNumber+1]; - }; - -}; diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx index caf6420f..3b0d95bf 100644 --- a/common/rfb/Security.cxx +++ b/common/rfb/Security.cxx @@ -21,31 +21,15 @@ #include <config.h> #endif -#include <assert.h> -#include <stdlib.h> #include <string.h> -#include <rfb/CSecurityNone.h> -#include <rfb/CSecurityStack.h> -#include <rfb/CSecurityVeNCrypt.h> -#include <rfb/CSecurityVncAuth.h> -#include <rfb/CSecurityPlain.h> -#include <rdr/Exception.h> + +#include <algorithm> + #include <rfb/LogWriter.h> #include <rfb/Security.h> -#include <rfb/SSecurityNone.h> -#include <rfb/SSecurityStack.h> -#include <rfb/SSecurityPlain.h> -#include <rfb/SSecurityVncAuth.h> -#include <rfb/SSecurityVeNCrypt.h> -#ifdef HAVE_GNUTLS -#include <rfb/CSecurityTLS.h> -#include <rfb/SSecurityTLS.h> -#endif #include <rfb/util.h> -using namespace rdr; using namespace rfb; -using namespace std; static LogWriter vlog("Security"); @@ -66,58 +50,52 @@ Security::Security(StringParameter &secTypes) const std::list<uint8_t> Security::GetEnabledSecTypes(void) { - list<uint8_t> result; - list<uint32_t>::iterator i; + std::list<uint8_t> result; /* Partial workaround for Vino's stupid behaviour. It doesn't allow * the basic authentication types as part of the VeNCrypt handshake, * making it impossible for a client to do opportunistic encryption. * At least make it possible to connect when encryption is explicitly * disabled. */ - for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++) { - if (*i >= 0x100) { + for (uint32_t type : enabledSecTypes) { + if (type >= 0x100) { result.push_back(secTypeVeNCrypt); break; } } - for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++) - if (*i < 0x100) - result.push_back(*i); + for (uint32_t type : enabledSecTypes) + if (type < 0x100) + result.push_back(type); return result; } const std::list<uint32_t> Security::GetEnabledExtSecTypes(void) { - list<uint32_t> result; - list<uint32_t>::iterator i; + std::list<uint32_t> result; - for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++) - if (*i != secTypeVeNCrypt) /* Do not include VeNCrypt type to avoid loops */ - result.push_back(*i); + for (uint32_t type : enabledSecTypes) + if (type != secTypeVeNCrypt) /* Do not include VeNCrypt type to avoid loops */ + result.push_back(type); return result; } void Security::EnableSecType(uint32_t secType) { - list<uint32_t>::iterator i; - - for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++) - if (*i == secType) - return; + if (std::find(enabledSecTypes.begin(), enabledSecTypes.end(), + secType) != enabledSecTypes.end()) + return; enabledSecTypes.push_back(secType); } bool Security::IsSupported(uint32_t secType) { - list<uint32_t>::iterator i; - - for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++) - if (*i == secType) - return true; + if (std::find(enabledSecTypes.begin(), enabledSecTypes.end(), + secType) != enabledSecTypes.end()) + return true; if (secType == secTypeVeNCrypt) return true; @@ -126,15 +104,14 @@ bool Security::IsSupported(uint32_t secType) char *Security::ToString(void) { - list<uint32_t>::iterator i; static char out[128]; /* Should be enough */ bool firstpass = true; const char *name; memset(out, 0, sizeof(out)); - for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++) { - name = secTypeName(*i); + for (uint32_t type : enabledSecTypes) { + name = secTypeName(type); if (name[0] == '[') /* Unknown security type */ continue; diff --git a/common/rfb/SecurityClient.cxx b/common/rfb/SecurityClient.cxx index 1350640d..d1507eb5 100644 --- a/common/rfb/SecurityClient.cxx +++ b/common/rfb/SecurityClient.cxx @@ -27,7 +27,7 @@ #include <rfb/CSecurityVeNCrypt.h> #include <rfb/CSecurityVncAuth.h> #include <rfb/CSecurityPlain.h> -#include <rdr/Exception.h> +#include <rfb/Exception.h> #include <rfb/Security.h> #ifdef HAVE_GNUTLS #include <rfb/CSecurityTLS.h> @@ -38,12 +38,11 @@ #include <rfb/CSecurityMSLogonII.h> #endif -using namespace rdr; using namespace rfb; -UserPasswdGetter *CSecurity::upg = NULL; +UserPasswdGetter *CSecurity::upg = nullptr; #if defined(HAVE_GNUTLS) || defined(HAVE_NETTLE) -UserMsgBox *CSecurity::msg = NULL; +UserMsgBox *CSecurity::msg = nullptr; #endif StringParameter SecurityClient::secTypes @@ -60,16 +59,16 @@ StringParameter SecurityClient::secTypes "X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone," #endif #ifdef HAVE_NETTLE - "RA2,RA2_256,RA2ne,RA2ne_256,DH,MSLogonII" + "RA2,RA2_256,RA2ne,RA2ne_256,DH,MSLogonII," #endif "VncAuth,None", ConfViewer); CSecurity* SecurityClient::GetCSecurity(CConnection* cc, uint32_t secType) { - assert (CSecurity::upg != NULL); /* (upg == NULL) means bug in the viewer */ + assert (CSecurity::upg != nullptr); /* (upg == nullptr) means bug in the viewer */ #if defined(HAVE_GNUTLS) || defined(HAVE_NETTLE) - assert (CSecurity::msg != NULL); + assert (CSecurity::msg != nullptr); #endif if (!IsSupported(secType)) diff --git a/common/rfb/SecurityServer.cxx b/common/rfb/SecurityServer.cxx index 3e23a89d..b5297736 100644 --- a/common/rfb/SecurityServer.cxx +++ b/common/rfb/SecurityServer.cxx @@ -21,7 +21,7 @@ #include <config.h> #endif -#include <rdr/Exception.h> +#include <rfb/Exception.h> #include <rfb/Security.h> #include <rfb/SSecurityNone.h> #include <rfb/SSecurityStack.h> @@ -35,7 +35,6 @@ #include <rfb/SSecurityRSAAES.h> #endif -using namespace rdr; using namespace rfb; StringParameter SecurityServer::secTypes diff --git a/common/rfb/ServerParams.cxx b/common/rfb/ServerParams.cxx index 6af446c2..9f6f5307 100644 --- a/common/rfb/ServerParams.cxx +++ b/common/rfb/ServerParams.cxx @@ -38,7 +38,7 @@ ServerParams::ServerParams() { setName(""); - cursor_ = new Cursor(0, 0, Point(), NULL); + cursor_ = new Cursor(0, 0, Point(), nullptr); clipFlags = 0; memset(clipSizes, 0, sizeof(clipSizes)); diff --git a/common/rfb/TightDecoder.cxx b/common/rfb/TightDecoder.cxx index 54b620ea..807f71a5 100644 --- a/common/rfb/TightDecoder.cxx +++ b/common/rfb/TightDecoder.cxx @@ -345,7 +345,7 @@ void TightDecoder::decodeRect(const Rect& r, const uint8_t* buffer, size_t rowSize, dataSize; uint8_t* netbuf; - netbuf = NULL; + netbuf = nullptr; if (palSize != 0) { if (palSize <= 2) @@ -387,7 +387,7 @@ void TightDecoder::decodeRect(const Rect& r, const uint8_t* buffer, zis[streamId].readBytes(netbuf, dataSize); zis[streamId].flushUnderlying(); - zis[streamId].setUnderlying(NULL, 0); + zis[streamId].setUnderlying(nullptr, 0); delete ms; bufptr = netbuf; diff --git a/common/rfb/TightDecoder.h b/common/rfb/TightDecoder.h index 764f138e..d569a7fd 100644 --- a/common/rfb/TightDecoder.h +++ b/common/rfb/TightDecoder.h @@ -31,18 +31,17 @@ namespace rfb { public: TightDecoder(); virtual ~TightDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual bool doRectsConflict(const Rect& rectA, - const uint8_t* bufferA, - size_t buflenA, - const Rect& rectB, - const uint8_t* bufferB, - size_t buflenB, - const ServerParams& server); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + bool doRectsConflict(const Rect& rectA, + const uint8_t* bufferA, size_t buflenA, + const Rect& rectB, + const uint8_t* bufferB, size_t buflenB, + const ServerParams& server) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: uint32_t readCompact(rdr::InStream* is); diff --git a/common/rfb/TightEncoder.cxx b/common/rfb/TightEncoder.cxx index 1a169a3d..169b74f7 100644 --- a/common/rfb/TightEncoder.cxx +++ b/common/rfb/TightEncoder.cxx @@ -60,8 +60,8 @@ static const TightConf conf[10] = { { 9, 9, 9 } // 9 }; -TightEncoder::TightEncoder(SConnection* conn) : - Encoder(conn, encodingTight, EncoderPlain, 256) +TightEncoder::TightEncoder(SConnection* conn_) : + Encoder(conn_, encodingTight, EncoderPlain, 256) { setCompressLevel(-1); } @@ -260,12 +260,12 @@ void TightEncoder::flushZlibOutStream(rdr::OutStream* os_) rdr::ZlibOutStream* zos; zos = dynamic_cast<rdr::ZlibOutStream*>(os_); - if (zos == NULL) + if (zos == nullptr) return; zos->cork(false); zos->flush(); - zos->setUnderlying(NULL); + zos->setUnderlying(nullptr); os = conn->getOutStream(); diff --git a/common/rfb/TightEncoder.h b/common/rfb/TightEncoder.h index 0608eb09..3a7210c7 100644 --- a/common/rfb/TightEncoder.h +++ b/common/rfb/TightEncoder.h @@ -31,14 +31,14 @@ namespace rfb { TightEncoder(SConnection* conn); virtual ~TightEncoder(); - virtual bool isSupported(); + bool isSupported() override; - virtual void setCompressLevel(int level); + void setCompressLevel(int level) override; - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; protected: void writeMonoRect(const PixelBuffer* pb, const Palette& palette); diff --git a/common/rfb/TightJPEGEncoder.cxx b/common/rfb/TightJPEGEncoder.cxx index 5c8706ee..de8fd77f 100644 --- a/common/rfb/TightJPEGEncoder.cxx +++ b/common/rfb/TightJPEGEncoder.cxx @@ -68,8 +68,8 @@ static const struct TightJPEGConfiguration conf[10] = { }; -TightJPEGEncoder::TightJPEGEncoder(SConnection* conn) : - Encoder(conn, encodingTight, +TightJPEGEncoder::TightJPEGEncoder(SConnection* conn_) : + Encoder(conn_, encodingTight, (EncoderFlags)(EncoderUseNativePF | EncoderLossy), -1, 9), qualityLevel(-1), fineQuality(-1), fineSubsampling(subsampleUndefined) { diff --git a/common/rfb/TightJPEGEncoder.h b/common/rfb/TightJPEGEncoder.h index 002deabb..81d9f40d 100644 --- a/common/rfb/TightJPEGEncoder.h +++ b/common/rfb/TightJPEGEncoder.h @@ -30,17 +30,17 @@ namespace rfb { TightJPEGEncoder(SConnection* conn); virtual ~TightJPEGEncoder(); - virtual bool isSupported(); + bool isSupported() override; - virtual void setQualityLevel(int level); - virtual void setFineQualityLevel(int quality, int subsampling); + void setQualityLevel(int level) override; + void setFineQualityLevel(int quality, int subsampling) override; - virtual int getQualityLevel(); + int getQualityLevel() override; - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; protected: void writeCompact(uint32_t value, rdr::OutStream* os); diff --git a/common/rfb/Timer.cxx b/common/rfb/Timer.cxx index 4ff15bc5..fbc9bae9 100644 --- a/common/rfb/Timer.cxx +++ b/common/rfb/Timer.cxx @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2016-2018 Pierre Ossman for Cendio AB + * Copyright 2016-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,8 @@ #include <stdio.h> #include <sys/time.h> +#include <algorithm> + #include <rfb/Timer.h> #include <rfb/util.h> #include <rfb/LogWriter.h> @@ -52,7 +54,10 @@ inline static timeval addMillis(timeval inTime, int millis) { } inline static int diffTimeMillis(timeval later, timeval earlier) { - return ((later.tv_sec - earlier.tv_sec) * 1000) + ((later.tv_usec - earlier.tv_usec) / 1000); + long udiff; + udiff = ((later.tv_sec - earlier.tv_sec) * 1000000) + + (later.tv_usec - earlier.tv_usec); + return (udiff + 999) / 1000; } std::list<Timer*> Timer::pending; @@ -61,44 +66,33 @@ int Timer::checkTimeouts() { timeval start; if (pending.empty()) - return 0; + return -1; - gettimeofday(&start, 0); + gettimeofday(&start, nullptr); while (pending.front()->isBefore(start)) { Timer* timer; - timeval before; timer = pending.front(); pending.pop_front(); - gettimeofday(&before, 0); - if (timer->cb->handleTimeout(timer)) { - timeval now; - - gettimeofday(&now, 0); - - timer->dueTime = addMillis(timer->dueTime, timer->timeoutMs); - if (timer->isBefore(now)) { - // Time has jumped forwards, or we're not getting enough - // CPU time for the timers - - timer->dueTime = addMillis(before, timer->timeoutMs); - if (timer->isBefore(now)) - timer->dueTime = now; - } + timer->lastDueTime = timer->dueTime; + timer->cb->handleTimeout(timer); - insertTimer(timer); - } else if (pending.empty()) { - return 0; - } + if (pending.empty()) + return -1; } return getNextTimeout(); } int Timer::getNextTimeout() { timeval now; - gettimeofday(&now, 0); - int toWait = __rfbmax(1, pending.front()->getRemainingMs()); + gettimeofday(&now, nullptr); + + if (pending.empty()) + return -1; + + int toWait = pending.front()->getRemainingMs(); + if (toWait > pending.front()->timeoutMs) { if (toWait - pending.front()->timeoutMs < 1000) { vlog.info("gettimeofday is broken..."); @@ -107,8 +101,9 @@ int Timer::getNextTimeout() { // Time has jumped backwards! vlog.info("time has moved backwards!"); pending.front()->dueTime = now; - toWait = 1; + toWait = 0; } + return toWait; } @@ -125,27 +120,46 @@ void Timer::insertTimer(Timer* t) { void Timer::start(int timeoutMs_) { timeval now; - gettimeofday(&now, 0); + gettimeofday(&now, nullptr); stop(); timeoutMs = timeoutMs_; - // The rest of the code assumes non-zero timeout - if (timeoutMs <= 0) - timeoutMs = 1; dueTime = addMillis(now, timeoutMs); insertTimer(this); } +void Timer::repeat(int timeoutMs_) { + timeval now; + + gettimeofday(&now, nullptr); + + if (isStarted()) { + vlog.error("Incorrectly repeating already running timer"); + stop(); + } + + if (msBetween(&lastDueTime, &dueTime) != 0) + vlog.error("Timer incorrectly modified whilst repeating"); + + if (timeoutMs_ != -1) + timeoutMs = timeoutMs_; + + dueTime = addMillis(lastDueTime, timeoutMs); + if (isBefore(now)) { + // Time has jumped forwards, or we're not getting enough + // CPU time for the timers + dueTime = now; + } + + insertTimer(this); +} + void Timer::stop() { pending.remove(this); } bool Timer::isStarted() { - std::list<Timer*>::iterator i; - for (i=pending.begin(); i!=pending.end(); i++) { - if (*i == this) - return true; - } - return false; + return std::find(pending.begin(), pending.end(), + this) != pending.end(); } int Timer::getTimeoutMs() { @@ -154,7 +168,7 @@ int Timer::getTimeoutMs() { int Timer::getRemainingMs() { timeval now; - gettimeofday(&now, 0); + gettimeofday(&now, nullptr); return __rfbmax(0, diffTimeMillis(dueTime, now)); } diff --git a/common/rfb/Timer.h b/common/rfb/Timer.h index ddfce1b2..362cb84e 100644 --- a/common/rfb/Timer.h +++ b/common/rfb/Timer.h @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2018 Pierre Ossman for Cendio AB + * Copyright 2018-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,93 +27,108 @@ namespace rfb { /* Timer - Cross-platform timeout handling. The caller creates instances of Timer and passes a - Callback implementation to each. The Callback will then be called with a pointer to - the Timer instance that timed-out when the timeout occurs. + Cross-platform timeout handling. The caller creates instances of + Timer and passes a Callback implementation to each. The Callback + will then be called with a pointer to the Timer instance that + timed-out when the timeout occurs. - The static methods of Timer are used by the main loop of the application both to - dispatch elapsed Timer callbacks and to determine how long to wait in select() for - the next timeout to occur. + The static methods of Timer are used by the main loop of the + application both to dispatch elapsed Timer callbacks and to + determine how long to wait in select() for the next timeout to + occur. - For classes that can be derived it's best to use MethodTimer which can call a specific - method on the class, thus avoiding conflicts when subclassing. + For classes that can be derived it's best to use MethodTimer which + can call a specific method on the class, thus avoiding conflicts + when subclassing. */ struct Timer { struct Callback { // handleTimeout - // Passed a pointer to the Timer that has timed out. If the handler returns true - // then the Timer is reset and left running, causing another timeout after the - // appropriate interval. + // Passed a pointer to the Timer that has timed out. If the + // handler returns true then the Timer is reset and left + // running, causing another timeout after the appropriate + // interval. // If the handler returns false then the Timer is cancelled. - virtual bool handleTimeout(Timer* t) = 0; + virtual void handleTimeout(Timer* t) = 0; virtual ~Callback() {} }; // checkTimeouts() - // Dispatches any elapsed Timers, and returns the number of milliseconds until the - // next Timer will timeout. + // Dispatches any elapsed Timers, and returns the number of + // milliseconds until the next Timer will timeout. static int checkTimeouts(); // getNextTimeout() - // Returns the number of milliseconds until the next timeout, without dispatching - // any elapsed Timers. + // Returns the number of milliseconds until the next timeout, + // without dispatching any elapsed Timers. static int getNextTimeout(); // Create a Timer with the specified callback handler Timer(Callback* cb_) {cb = cb_;} ~Timer() {stop();} - // startTimer - // Starts the timer, causing a timeout after the specified number of milliseconds. - // If the timer is already active then it will be implicitly cancelled and re-started. + // start() + // Starts the timer, causing a timeout after the specified number + // of milliseconds. If the timer is already active then it will + // be implicitly cancelled and re-started. void start(int timeoutMs_); - // stopTimer + // repeat() + // Restarts the timer in a way that repeats that last timeout. + // This allows you to have a periodic timer without the risk of + // accumulating drift caused by processing delays. + // A new interval can be specified, otherwise the previous + // interval is reused. + void repeat(int timeoutMs_=-1); + + // stop() // Cancels the timer. void stop(); - // isStarted + // isStarted() // Determines whether the timer is started. bool isStarted(); - // getTimeoutMs + // getTimeoutMs() // Determines the previously used timeout value, if any. // Usually used with isStarted() to get the _current_ timeout. int getTimeoutMs(); - // getRemainingMs + // getRemainingMs() // Determines how many milliseconds are left before the Timer // will timeout. Only valid for an active timer. int getRemainingMs(); - // isBefore - // Determine whether the Timer will timeout before the specified time. + // isBefore() + // Determine whether the Timer will timeout before the specified + // time. bool isBefore(timeval other); protected: - timeval dueTime; + timeval dueTime, lastDueTime; int timeoutMs; Callback* cb; static void insertTimer(Timer* t); - // The list of currently active Timers, ordered by time left until timeout. + // The list of currently active Timers, ordered by time left until + // timeout. static std::list<Timer*> pending; }; template<class T> class MethodTimer : public Timer, public Timer::Callback { public: - MethodTimer(T* obj_, bool (T::*cb_)(Timer*)) + MethodTimer(T* obj_, void (T::*cb_)(Timer*)) : Timer(this), obj(obj_), cb(cb_) {} - virtual bool handleTimeout(Timer* t) { return (obj->*cb)(t); } + void handleTimeout(Timer* t) override { return (obj->*cb)(t); } private: T* obj; - bool (T::*cb)(Timer*); + void (T::*cb)(Timer*); }; }; diff --git a/common/rfb/UnixPasswordValidator.h b/common/rfb/UnixPasswordValidator.h index 28d083a1..4d623d6c 100644 --- a/common/rfb/UnixPasswordValidator.h +++ b/common/rfb/UnixPasswordValidator.h @@ -28,7 +28,7 @@ namespace rfb class UnixPasswordValidator: public PasswordValidator { protected: bool validateInternal(SConnection * sc, const char *username, - const char *password); + const char *password) override; }; } diff --git a/common/rfb/UpdateTracker.h b/common/rfb/UpdateTracker.h index 8983b378..e91b9621 100644 --- a/common/rfb/UpdateTracker.h +++ b/common/rfb/UpdateTracker.h @@ -53,14 +53,14 @@ namespace rfb { class ClippingUpdateTracker : public UpdateTracker { public: - ClippingUpdateTracker() : ut(0) {} + ClippingUpdateTracker() : ut(nullptr) {} ClippingUpdateTracker(UpdateTracker* ut_, const Rect& r=Rect()) : ut(ut_), clipRect(r) {} void setUpdateTracker(UpdateTracker* ut_) {ut = ut_;} void setClipRect(const Rect& cr) {clipRect = cr;} - virtual void add_changed(const Region ®ion); - virtual void add_copied(const Region &dest, const Point &delta); + void add_changed(const Region ®ion) override; + void add_copied(const Region &dest, const Point &delta) override; protected: UpdateTracker* ut; Rect clipRect; @@ -71,8 +71,8 @@ namespace rfb { SimpleUpdateTracker(); virtual ~SimpleUpdateTracker(); - virtual void add_changed(const Region ®ion); - virtual void add_copied(const Region &dest, const Point &delta); + void add_changed(const Region ®ion) override; + void add_copied(const Region &dest, const Point &delta) override; virtual void subtract(const Region& region); // Fill the supplied UpdateInfo structure with update information diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index f1194eb6..88deff8c 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -48,7 +48,7 @@ using namespace rfb; static LogWriter vlog("VNCSConnST"); -static Cursor emptyCursor(0, 0, Point(0, 0), NULL); +static Cursor emptyCursor(0, 0, Point(0, 0), nullptr); VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s, bool reverse, AccessRights ar) @@ -56,7 +56,7 @@ VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s, sock(s), reverseConnection(reverse), inProcessMessages(false), pendingSyncFence(false), syncFence(false), fenceFlags(0), - fenceDataLen(0), fenceData(NULL), congestionTimer(this), + fenceDataLen(0), fenceData(nullptr), congestionTimer(this), losslessTimer(this), server(server_), updateRenderedCursor(false), removeRenderedCursor(false), continuousUpdates(false), encodeManager(this), idleTimer(this), @@ -409,7 +409,7 @@ bool VNCSConnectionST::needRenderedCursor() if (!client.supportsLocalCursor()) return true; if ((server->getCursorPos() != pointerEventPos) && - (time(0) - pointerEventTime) > 0) + (time(nullptr) - pointerEventTime) > 0) return true; return false; @@ -477,11 +477,11 @@ void VNCSConnectionST::setPixelFormat(const PixelFormat& pf) setCursor(); } -void VNCSConnectionST::pointerEvent(const Point& pos, int buttonMask) +void VNCSConnectionST::pointerEvent(const Point& pos, uint8_t buttonMask) { if (rfb::Server::idleTimeout) idleTimer.start(secsToMillis(rfb::Server::idleTimeout)); - pointerEventTime = time(0); + pointerEventTime = time(nullptr); if (!accessCheck(AccessPtrEvents)) return; if (!rfb::Server::acceptPointerEvents) return; pointerEventPos = pos; @@ -496,12 +496,12 @@ public: ~VNCSConnectionSTShiftPresser() { if (pressed) { vlog.debug("Releasing fake Shift_L"); - server->keyEvent(XK_Shift_L, 0, false); + server->keyEvent(XK_Shift_L, 0x2a, false); } } void press() { vlog.debug("Pressing fake Shift_L"); - server->keyEvent(XK_Shift_L, 0, true); + server->keyEvent(XK_Shift_L, 0x2a, true); pressed = true; } VNCServerST* server; @@ -550,8 +550,8 @@ void VNCSConnectionST::keyEvent(uint32_t keysym, uint32_t keycode, bool down) { if (lock == (uppercase == shift)) { vlog.debug("Inserting fake CapsLock to get in sync with client"); - server->keyEvent(XK_Caps_Lock, 0, true); - server->keyEvent(XK_Caps_Lock, 0, false); + server->keyEvent(XK_Caps_Lock, 0x3a, true); + server->keyEvent(XK_Caps_Lock, 0x3a, false); } } @@ -580,8 +580,8 @@ void VNCSConnectionST::keyEvent(uint32_t keysym, uint32_t keycode, bool down) { // } else if (lock == (number == shift)) { vlog.debug("Inserting fake NumLock to get in sync with client"); - server->keyEvent(XK_Num_Lock, 0, true); - server->keyEvent(XK_Num_Lock, 0, false); + server->keyEvent(XK_Num_Lock, 0x45, true); + server->keyEvent(XK_Num_Lock, 0x45, false); } } } @@ -690,7 +690,7 @@ void VNCSConnectionST::fence(uint32_t flags, unsigned len, const uint8_t data[]) fenceFlags = flags & (fenceFlagBlockBefore | fenceFlagBlockAfter | fenceFlagSyncNext); fenceDataLen = len; delete [] fenceData; - fenceData = NULL; + fenceData = nullptr; if (len > 0) { fenceData = new uint8_t[len]; memcpy(fenceData, data, len); @@ -706,8 +706,10 @@ void VNCSConnectionST::fence(uint32_t flags, unsigned len, const uint8_t data[]) return; } - if (len < 1) + if (len < 1) { vlog.error("Fence response of unexpected size received"); + return; + } type = data[0]; @@ -800,7 +802,7 @@ void VNCSConnectionST::supportsLEDState() writer()->writeLEDState(); } -bool VNCSConnectionST::handleTimeout(Timer* t) +void VNCSConnectionST::handleTimeout(Timer* t) { try { if ((t == &congestionTimer) || @@ -812,8 +814,6 @@ bool VNCSConnectionST::handleTimeout(Timer* t) if (t == &idleTimer) close("Idle timeout"); - - return false; } bool VNCSConnectionST::isShiftPressed() @@ -1003,7 +1003,7 @@ void VNCSConnectionST::writeDataUpdate() // Does the client need a server-side rendered cursor? - cursor = NULL; + cursor = nullptr; if (needRenderedCursor()) { Rect renderedCursorRect; @@ -1085,7 +1085,7 @@ void VNCSConnectionST::writeLosslessRefresh() // Prepare the cursor in case it overlaps with a region getting // refreshed - cursor = NULL; + cursor = nullptr; if (needRenderedCursor()) cursor = server->getRenderedCursor(); diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h index 2f117a75..d857ef32 100644 --- a/common/rfb/VNCSConnectionST.h +++ b/common/rfb/VNCSConnectionST.h @@ -46,8 +46,8 @@ namespace rfb { // SConnection methods - virtual bool accessCheck(AccessRights ar) const; - virtual void close(const char* reason); + bool accessCheck(AccessRights ar) const override; + void close(const char* reason) override; using SConnection::authenticated; @@ -118,30 +118,32 @@ namespace rfb { private: // SConnection callbacks - // These methods are invoked as callbacks from processMsg() - - virtual void authSuccess(); - virtual void queryConnection(const char* userName); - virtual void clientInit(bool shared); - virtual void setPixelFormat(const PixelFormat& pf); - virtual void pointerEvent(const Point& pos, int buttonMask); - virtual void keyEvent(uint32_t keysym, uint32_t keycode, bool down); - virtual void framebufferUpdateRequest(const Rect& r, bool incremental); - virtual void setDesktopSize(int fb_width, int fb_height, - const ScreenSet& layout); - virtual void fence(uint32_t flags, unsigned len, const uint8_t data[]); - virtual void enableContinuousUpdates(bool enable, - int x, int y, int w, int h); - virtual void handleClipboardRequest(); - virtual void handleClipboardAnnounce(bool available); - virtual void handleClipboardData(const char* data); - virtual void supportsLocalCursor(); - virtual void supportsFence(); - virtual void supportsContinuousUpdates(); - virtual void supportsLEDState(); + // These methods are invoked as callbacks from processMsg( + void authSuccess() override; + void queryConnection(const char* userName) override; + void clientInit(bool shared) override; + void setPixelFormat(const PixelFormat& pf) override; + void pointerEvent(const Point& pos, uint8_t buttonMask) override; + void keyEvent(uint32_t keysym, uint32_t keycode, + bool down) override; + void framebufferUpdateRequest(const Rect& r, + bool incremental) override; + void setDesktopSize(int fb_width, int fb_height, + const ScreenSet& layout) override; + void fence(uint32_t flags, unsigned len, + const uint8_t data[]) override; + void enableContinuousUpdates(bool enable, + int x, int y, int w, int h) override; + void handleClipboardRequest() override; + void handleClipboardAnnounce(bool available) override; + void handleClipboardData(const char* data) override; + void supportsLocalCursor() override; + void supportsFence() override; + void supportsContinuousUpdates() override; + void supportsLEDState() override; // Timer callbacks - virtual bool handleTimeout(Timer* t); + void handleTimeout(Timer* t) override; // Internal methods diff --git a/common/rfb/VNCServer.h b/common/rfb/VNCServer.h index cf14bd86..4e3a5b23 100644 --- a/common/rfb/VNCServer.h +++ b/common/rfb/VNCServer.h @@ -73,6 +73,9 @@ namespace rfb { virtual void blockUpdates() = 0; virtual void unblockUpdates() = 0; + virtual uint64_t getMsc() = 0; + virtual void queueMsc(uint64_t target) = 0; + // setPixelBuffer() tells the server to use the given pixel buffer (and // optionally a modified screen layout). If this differs in size from // the previous pixel buffer, this may result in protocol messages being @@ -112,7 +115,7 @@ namespace rfb { // acceptance, or false for rejection, in which case a string // reason may also be given. virtual void approveConnection(network::Socket* sock, bool accept, - const char* reason = NULL) = 0; + const char* reason = nullptr) = 0; // - Close all currently-connected clients, by calling // their close() method with the supplied reason. diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index fb421068..114ff347 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2009-2019 Pierre Ossman for Cendio AB + * Copyright 2009-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,17 +83,19 @@ static LogWriter connectionsLog("Connections"); VNCServerST::VNCServerST(const char* name_, SDesktop* desktop_) : blHosts(&blacklist), desktop(desktop_), desktopStarted(false), - blockCounter(0), pb(0), ledState(ledUnknown), - name(name_), pointerClient(0), clipboardClient(0), + blockCounter(0), pb(nullptr), ledState(ledUnknown), + name(name_), pointerClient(nullptr), clipboardClient(nullptr), pointerClientTime(0), - comparer(0), cursor(new Cursor(0, 0, Point(), NULL)), + comparer(nullptr), cursor(new Cursor(0, 0, Point(), nullptr)), renderedCursorInvalid(false), keyRemapper(&KeyRemapper::defInstance), idleTimer(this), disconnectTimer(this), connectTimer(this), - frameTimer(this) + msc(0), queuedMsc(0), frameTimer(this) { slog.debug("creating single-threaded server %s", name.c_str()); + desktop_->init(this); + // FIXME: Do we really want to kick off these right away? if (rfb::Server::maxIdleTime) idleTimer.start(secsToMillis(rfb::Server::maxIdleTime)); @@ -175,19 +177,19 @@ void VNCServerST::removeSocket(network::Socket* sock) { if ((*ci)->getSock() == sock) { // - Remove any references to it if (pointerClient == *ci) - pointerClient = NULL; + pointerClient = nullptr; if (clipboardClient == *ci) handleClipboardAnnounce(*ci, false); clipboardRequestors.remove(*ci); - std::string name((*ci)->getPeerEndpoint()); + std::string peer((*ci)->getPeerEndpoint()); // - Delete the per-Socket resources delete *ci; clients.remove(*ci); - connectionsLog.status("closed: %s", name.c_str()); + connectionsLog.status("closed: %s", peer.c_str()); // - Check that the desktop object is still required if (authClientCount() == 0) @@ -248,11 +250,22 @@ void VNCServerST::unblockUpdates() blockCounter--; - // Restart the frame clock if we have updates - if (blockCounter == 0) { - if (!comparer->is_empty()) - startFrameClock(); - } + // Restart the frame clock in case we have updates + if (blockCounter == 0) + startFrameClock(); +} + +uint64_t VNCServerST::getMsc() +{ + return msc; +} + +void VNCServerST::queueMsc(uint64_t target) +{ + if (target > queuedMsc) + queuedMsc = target; + + startFrameClock(); } void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout) @@ -262,7 +275,7 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout) pb = pb_; delete comparer; - comparer = 0; + comparer = nullptr; if (!pb) { screenLayout = ScreenSet(); @@ -284,9 +297,8 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout) renderedCursorInvalid = true; add_changed(pb->getRect()); - std::list<VNCSConnectionST*>::iterator ci, ci_next; - for (ci=clients.begin();ci!=clients.end();ci=ci_next) { - ci_next = ci; ci_next++; + std::list<VNCSConnectionST*>::iterator ci; + for (ci = clients.begin(); ci != clients.end(); ++ci) { (*ci)->pixelBufferChange(); // Since the new pixel buffer means an ExtendedDesktopSize needs to // be sent anyway, we don't need to call screenLayoutChange. @@ -333,16 +345,14 @@ void VNCServerST::setScreenLayout(const ScreenSet& layout) screenLayout = layout; - std::list<VNCSConnectionST*>::iterator ci, ci_next; - for (ci=clients.begin();ci!=clients.end();ci=ci_next) { - ci_next = ci; ci_next++; + std::list<VNCSConnectionST*>::iterator ci; + for (ci = clients.begin(); ci != clients.end(); ++ci) (*ci)->screenLayoutChangeOrClose(reasonServer); - } } void VNCServerST::requestClipboard() { - if (clipboardClient == NULL) { + if (clipboardClient == nullptr) { slog.debug("Got request for client clipboard but no client currently owns the clipboard"); return; } @@ -352,54 +362,46 @@ void VNCServerST::requestClipboard() void VNCServerST::announceClipboard(bool available) { - std::list<VNCSConnectionST*>::iterator ci, ci_next; + std::list<VNCSConnectionST*>::iterator ci; clipboardRequestors.clear(); - for (ci = clients.begin(); ci != clients.end(); ci = ci_next) { - ci_next = ci; ci_next++; + for (ci = clients.begin(); ci != clients.end(); ++ci) (*ci)->announceClipboardOrClose(available); - } } void VNCServerST::sendClipboardData(const char* data) { - std::list<VNCSConnectionST*>::iterator ci, ci_next; + std::list<VNCSConnectionST*>::iterator ci; - if (strchr(data, '\r') != NULL) + if (strchr(data, '\r') != nullptr) throw Exception("Invalid carriage return in clipboard data"); for (ci = clipboardRequestors.begin(); - ci != clipboardRequestors.end(); ci = ci_next) { - ci_next = ci; ci_next++; + ci != clipboardRequestors.end(); ++ci) (*ci)->sendClipboardDataOrClose(data); - } clipboardRequestors.clear(); } void VNCServerST::bell() { - std::list<VNCSConnectionST*>::iterator ci, ci_next; - for (ci = clients.begin(); ci != clients.end(); ci = ci_next) { - ci_next = ci; ci_next++; + std::list<VNCSConnectionST*>::iterator ci; + for (ci = clients.begin(); ci != clients.end(); ++ci) (*ci)->bellOrClose(); - } } void VNCServerST::setName(const char* name_) { name = name_; - std::list<VNCSConnectionST*>::iterator ci, ci_next; - for (ci = clients.begin(); ci != clients.end(); ci = ci_next) { - ci_next = ci; ci_next++; + std::list<VNCSConnectionST*>::iterator ci; + for (ci = clients.begin(); ci != clients.end(); ++ci) (*ci)->setDesktopNameOrClose(name_); - } } void VNCServerST::add_changed(const Region& region) { - if (comparer == NULL) + if (comparer == nullptr) return; comparer->add_changed(region); @@ -408,7 +410,7 @@ void VNCServerST::add_changed(const Region& region) void VNCServerST::add_copied(const Region& dest, const Point& delta) { - if (comparer == NULL) + if (comparer == nullptr) return; comparer->add_copied(dest, delta); @@ -424,9 +426,8 @@ void VNCServerST::setCursor(int width, int height, const Point& newHotspot, renderedCursorInvalid = true; - std::list<VNCSConnectionST*>::iterator ci, ci_next; - for (ci = clients.begin(); ci != clients.end(); ci = ci_next) { - ci_next = ci; ci_next++; + std::list<VNCSConnectionST*>::iterator ci; + for (ci = clients.begin(); ci != clients.end(); ++ci) { (*ci)->renderedCursorChange(); (*ci)->setCursorOrClose(); } @@ -448,17 +449,15 @@ void VNCServerST::setCursorPos(const Point& pos, bool warped) void VNCServerST::setLEDState(unsigned int state) { - std::list<VNCSConnectionST*>::iterator ci, ci_next; + std::list<VNCSConnectionST*>::iterator ci; if (state == ledState) return; ledState = state; - for (ci = clients.begin(); ci != clients.end(); ci = ci_next) { - ci_next = ci; ci_next++; + for (ci = clients.begin(); ci != clients.end(); ++ci) (*ci)->setLEDStateOrClose(state); - } } // Event handlers @@ -483,16 +482,16 @@ void VNCServerST::keyEvent(uint32_t keysym, uint32_t keycode, bool down) } void VNCServerST::pointerEvent(VNCSConnectionST* client, - const Point& pos, int buttonMask) + const Point& pos, uint8_t buttonMask) { - time_t now = time(0); + time_t now = time(nullptr); if (rfb::Server::maxIdleTime) idleTimer.start(secsToMillis(rfb::Server::maxIdleTime)); // Let one client own the cursor whilst buttons are pressed in order // to provide a bit more sane user experience. But limit the time to // prevent locking out all others when e.g. the network is down. - if ((pointerClient != NULL) && (pointerClient != client) && + if ((pointerClient != nullptr) && (pointerClient != client) && ((now - pointerClientTime) < 10)) return; @@ -500,7 +499,7 @@ void VNCServerST::pointerEvent(VNCSConnectionST* client, if (buttonMask) pointerClient = client; else - pointerClient = NULL; + pointerClient = nullptr; desktop->pointerEvent(pos, buttonMask); } @@ -520,7 +519,7 @@ void VNCServerST::handleClipboardAnnounce(VNCSConnectionST* client, else { if (client != clipboardClient) return; - clipboardClient = NULL; + clipboardClient = nullptr; } desktop->handleClipboardAnnounce(available); } @@ -540,7 +539,7 @@ unsigned int VNCServerST::setDesktopSize(VNCSConnectionST* requester, const ScreenSet& layout) { unsigned int result; - std::list<VNCSConnectionST*>::iterator ci, ci_next; + std::list<VNCSConnectionST*>::iterator ci; // We can't handle a framebuffer larger than this, so don't let a // client set one (see PixelBuffer.cxx) @@ -567,8 +566,7 @@ unsigned int VNCServerST::setDesktopSize(VNCSConnectionST* requester, throw Exception("Desktop configured a different screen layout than requested"); // Notify other clients - for (ci=clients.begin();ci!=clients.end();ci=ci_next) { - ci_next = ci; ci_next++; + for (ci = clients.begin(); ci != clients.end(); ++ci) { if ((*ci) == requester) continue; (*ci)->screenLayoutChangeOrClose(reasonOtherClient); @@ -593,9 +591,8 @@ void VNCServerST::approveConnection(network::Socket* sock, bool accept, void VNCServerST::closeClients(const char* reason, network::Socket* except) { - std::list<VNCSConnectionST*>::iterator i, next_i; - for (i=clients.begin(); i!=clients.end(); i=next_i) { - next_i = i; next_i++; + std::list<VNCSConnectionST*>::iterator i; + for (i = clients.begin(); i != clients.end(); ++i) { if ((*i)->getSock() != except) (*i)->close(reason); } @@ -620,25 +617,38 @@ SConnection* VNCServerST::getConnection(network::Socket* sock) { if ((*ci)->getSock() == sock) return (SConnection*)*ci; } - return 0; + return nullptr; } -bool VNCServerST::handleTimeout(Timer* t) +void VNCServerST::handleTimeout(Timer* t) { if (t == &frameTimer) { - // We keep running until we go a full interval without any updates - if (comparer->is_empty()) - return false; - - writeUpdate(); + int timeout; + + // We keep running until we go a full interval without any updates, + // or there are no active clients anymore + if (!desktopStarted || + ((comparer != nullptr) && comparer->is_empty())) { + // Unless something waits for us to advance the frame count + if (queuedMsc < msc) + return; + } // If this is the first iteration then we need to adjust the timeout - if (frameTimer.getTimeoutMs() != 1000/rfb::Server::frameRate) { - frameTimer.start(1000/rfb::Server::frameRate); - return false; - } + timeout = 1000/rfb::Server::frameRate; - return true; + // If there are no clients, then slow down the clock + if (!desktopStarted) + timeout = 1000; + + frameTimer.repeat(timeout); + + if (desktopStarted && + ((comparer != nullptr) && !comparer->is_empty())) + writeUpdate(); + + msc++; + desktop->frameTick(msc); } else if (t == &idleTimer) { slog.info("MaxIdleTime reached, exiting"); desktop->terminate(); @@ -649,8 +659,6 @@ bool VNCServerST::handleTimeout(Timer* t) slog.info("MaxConnectionTime reached, exiting"); desktop->terminate(); } - - return false; } void VNCServerST::queryConnection(VNCSConnectionST* client, @@ -675,14 +683,14 @@ void VNCServerST::queryConnection(VNCSConnectionST* client, // - Are we configured to do queries? if (!rfb::Server::queryConnect && !client->getSock()->requiresQuery()) { - approveConnection(client->getSock(), true, NULL); + approveConnection(client->getSock(), true, nullptr); return; } // - Does the client have the right to bypass the query? if (client->accessCheck(AccessNoQuery)) { - approveConnection(client->getSock(), true, NULL); + approveConnection(client->getSock(), true, nullptr); return; } @@ -714,14 +722,21 @@ void VNCServerST::startDesktop() { if (!desktopStarted) { slog.debug("starting desktop"); - desktop->start(this); + desktop->start(); if (!pb) throw Exception("SDesktop::start() did not set a valid PixelBuffer"); desktopStarted = true; // The tracker might have accumulated changes whilst we were // stopped, so flush those out + assert(comparer != nullptr); if (!comparer->is_empty()) writeUpdate(); + // If the frame clock is running, then it will be running slowly, + // so give it a kick to run at normal speed right away + if (frameTimer.isStarted()) { + stopFrameClock(); + startFrameClock(); + } } } @@ -731,7 +746,6 @@ void VNCServerST::stopDesktop() slog.debug("stopping desktop"); desktopStarted = false; desktop->stop(); - stopFrameClock(); } } @@ -759,8 +773,20 @@ void VNCServerST::startFrameClock() return; if (blockCounter > 0) return; - if (!desktopStarted) + + // Anyone actually interested in frames? + if (!desktopStarted || + ((comparer != nullptr) && comparer->is_empty())) { + if (queuedMsc < msc) + return; + } + + // Run the frame clock very slowly if there are no clients to actually + // send updates to + if (!desktopStarted) { + frameTimer.start(1000); return; + } // The first iteration will be just half a frame as we get a very // unstable update rate if we happen to be perfectly in sync with @@ -796,10 +822,11 @@ void VNCServerST::writeUpdate() UpdateInfo ui; Region toCheck; - std::list<VNCSConnectionST*>::iterator ci, ci_next; + std::list<VNCSConnectionST*>::iterator ci; assert(blockCounter == 0); assert(desktopStarted); + assert(comparer != nullptr); comparer->getUpdateInfo(&ui, pb->getRect()); toCheck = ui.changed.union_(ui.copied); @@ -825,8 +852,7 @@ void VNCServerST::writeUpdate() comparer->clear(); - for (ci = clients.begin(); ci != clients.end(); ci = ci_next) { - ci_next = ci; ci_next++; + for (ci = clients.begin(); ci != clients.end(); ++ci) { (*ci)->add_copied(ui.copied, ui.copy_delta); (*ci)->add_changed(ui.changed); (*ci)->writeFramebufferUpdateOrClose(); @@ -844,6 +870,8 @@ Region VNCServerST::getPendingRegion() if (blockCounter > 0) return pb->getRect(); + assert(comparer != nullptr); + // Block client from updating if there are pending updates if (comparer->is_empty()) return Region(); @@ -870,9 +898,8 @@ bool VNCServerST::getComparerState() if (rfb::Server::compareFB != 2) return true; - std::list<VNCSConnectionST*>::iterator ci, ci_next; - for (ci=clients.begin();ci!=clients.end();ci=ci_next) { - ci_next = ci; ci_next++; + std::list<VNCSConnectionST*>::iterator ci; + for (ci = clients.begin(); ci != clients.end(); ++ci) { if ((*ci)->getComparerState()) return true; } diff --git a/common/rfb/VNCServerST.h b/common/rfb/VNCServerST.h index d303831e..6cc75a68 100644 --- a/common/rfb/VNCServerST.h +++ b/common/rfb/VNCServerST.h @@ -56,52 +56,54 @@ namespace rfb { // addSocket // Causes the server to allocate an RFB-protocol management // structure for the socket & initialise it. - virtual void addSocket(network::Socket* sock, bool outgoing=false, - AccessRights ar=AccessDefault); + void addSocket(network::Socket* sock, bool outgoing=false, + AccessRights ar=AccessDefault) override; // removeSocket // Clean up any resources associated with the Socket - virtual void removeSocket(network::Socket* sock); + void removeSocket(network::Socket* sock) override; // getSockets() gets a list of sockets. This can be used to generate an // fd_set for calling select(). - virtual void getSockets(std::list<network::Socket*>* sockets); + void getSockets(std::list<network::Socket*>* sockets) override; // processSocketReadEvent // Read more RFB data from the Socket. If an error occurs during // processing then shutdown() is called on the Socket, causing // removeSocket() to be called by the caller at a later time. - virtual void processSocketReadEvent(network::Socket* sock); + void processSocketReadEvent(network::Socket* sock) override; // processSocketWriteEvent // Flush pending data from the Socket on to the network. - virtual void processSocketWriteEvent(network::Socket* sock); - - virtual void blockUpdates(); - virtual void unblockUpdates(); - virtual void setPixelBuffer(PixelBuffer* pb, const ScreenSet& layout); - virtual void setPixelBuffer(PixelBuffer* pb); - virtual void setScreenLayout(const ScreenSet& layout); - virtual const PixelBuffer* getPixelBuffer() const { return pb; } - - virtual void requestClipboard(); - virtual void announceClipboard(bool available); - virtual void sendClipboardData(const char* data); - - virtual void approveConnection(network::Socket* sock, bool accept, - const char* reason); - virtual void closeClients(const char* reason) {closeClients(reason, 0);} - virtual SConnection* getConnection(network::Socket* sock); - - virtual void add_changed(const Region ®ion); - virtual void add_copied(const Region &dest, const Point &delta); - virtual void setCursor(int width, int height, const Point& hotspot, - const uint8_t* data); - virtual void setCursorPos(const Point& p, bool warped); - virtual void setName(const char* name_); - virtual void setLEDState(unsigned state); - - virtual void bell(); + void processSocketWriteEvent(network::Socket* sock) override; + + void blockUpdates() override; + void unblockUpdates() override; + uint64_t getMsc() override; + void queueMsc(uint64_t target) override; + void setPixelBuffer(PixelBuffer* pb, const ScreenSet& layout) override; + void setPixelBuffer(PixelBuffer* pb) override; + void setScreenLayout(const ScreenSet& layout) override; + const PixelBuffer* getPixelBuffer() const override { return pb; } + + void requestClipboard() override; + void announceClipboard(bool available) override; + void sendClipboardData(const char* data) override; + + void approveConnection(network::Socket* sock, bool accept, + const char* reason) override; + void closeClients(const char* reason) override {closeClients(reason, nullptr);} + SConnection* getConnection(network::Socket* sock) override; + + void add_changed(const Region ®ion) override; + void add_copied(const Region &dest, const Point &delta) override; + void setCursor(int width, int height, const Point& hotspot, + const uint8_t* data) override; + void setCursorPos(const Point& p, bool warped) override; + void setName(const char* name_) override; + void setLEDState(unsigned state) override; + + void bell() override; // VNCServerST-only methods @@ -115,7 +117,7 @@ namespace rfb { // Event handlers void keyEvent(uint32_t keysym, uint32_t keycode, bool down); - void pointerEvent(VNCSConnectionST* client, const Point& pos, int buttonMask); + void pointerEvent(VNCSConnectionST* client, const Point& pos, uint8_t buttonMask); void handleClipboardRequest(VNCSConnectionST* client); void handleClipboardAnnounce(VNCSConnectionST* client, bool available); @@ -153,7 +155,7 @@ namespace rfb { protected: // Timer callbacks - virtual bool handleTimeout(Timer* t); + void handleTimeout(Timer* t) override; // - Internal methods @@ -204,6 +206,7 @@ namespace rfb { Timer disconnectTimer; Timer connectTimer; + uint64_t msc, queuedMsc; Timer frameTimer; }; diff --git a/common/rfb/WinPasswdValidator.h b/common/rfb/WinPasswdValidator.h index ef2310a9..340a6234 100644 --- a/common/rfb/WinPasswdValidator.h +++ b/common/rfb/WinPasswdValidator.h @@ -30,7 +30,7 @@ namespace rfb WinPasswdValidator() {}; virtual ~WinPasswdValidator() {}; protected: - bool validateInternal(SConnection *sc, const char* username, const char* password); + bool validateInternal(SConnection *sc, const char* username, const char* password) override; }; } diff --git a/common/rfb/ZRLEDecoder.cxx b/common/rfb/ZRLEDecoder.cxx index 4b768afc..474fd6ca 100644 --- a/common/rfb/ZRLEDecoder.cxx +++ b/common/rfb/ZRLEDecoder.cxx @@ -106,20 +106,19 @@ void ZRLEDecoder::decodeRect(const Rect& r, const uint8_t* buffer, rdr::MemInStream is(buffer, buflen); const rfb::PixelFormat& pf = server.pf(); switch (pf.bpp) { - case 8: zrleDecode<uint8_t>(r, &is, &zis, pf, pb); break; - case 16: zrleDecode<uint16_t>(r, &is, &zis, pf, pb); break; - case 32: zrleDecode<uint32_t>(r, &is, &zis, pf, pb); break; + case 8: zrleDecode<uint8_t>(r, &is, pf, pb); break; + case 16: zrleDecode<uint16_t>(r, &is, pf, pb); break; + case 32: zrleDecode<uint32_t>(r, &is, pf, pb); break; } } template<class T> void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, - rdr::ZlibInStream* zis, const PixelFormat& pf, ModifiablePixelBuffer* pb) { int length = is->readU32(); - zis->setUnderlying(is, length); + zis.setUnderlying(is, length); Rect t; T buf[64 * 64]; @@ -141,24 +140,24 @@ void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, t.br.x = __rfbmin(r.br.x, t.tl.x + 64); - zlibHasData(zis, 1); - int mode = zis->readU8(); + zlibHasData(&zis, 1); + int mode = zis.readU8(); bool rle = mode & 128; int palSize = mode & 127; T palette[128]; if (isLowCPixel || isHighCPixel) - zlibHasData(zis, 3 * palSize); + zlibHasData(&zis, 3 * palSize); else - zlibHasData(zis, sizeof(T) * palSize); + zlibHasData(&zis, sizeof(T) * palSize); for (int i = 0; i < palSize; i++) { if (isLowCPixel) - palette[i] = readOpaque24A(zis); + palette[i] = readOpaque24A(&zis); else if (isHighCPixel) - palette[i] = readOpaque24B(zis); + palette[i] = readOpaque24B(&zis); else - palette[i] = readPixel<T>(zis); + palette[i] = readPixel<T>(&zis); } if (palSize == 1) { @@ -173,19 +172,19 @@ void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, // raw if (isLowCPixel || isHighCPixel) - zlibHasData(zis, 3 * t.area()); + zlibHasData(&zis, 3 * t.area()); else - zlibHasData(zis, sizeof(T) * t.area()); + zlibHasData(&zis, sizeof(T) * t.area()); if (isLowCPixel || isHighCPixel) { for (T* ptr = buf; ptr < buf+t.area(); ptr++) { if (isLowCPixel) - *ptr = readOpaque24A(zis); + *ptr = readOpaque24A(&zis); else - *ptr = readOpaque24B(zis); + *ptr = readOpaque24B(&zis); } } else { - zis->readBytes((uint8_t*)buf, t.area() * sizeof(T)); + zis.readBytes((uint8_t*)buf, t.area() * sizeof(T)); } } else { @@ -203,8 +202,8 @@ void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, while (ptr < eol) { if (nbits == 0) { - zlibHasData(zis, 1); - byte = zis->readU8(); + zlibHasData(&zis, 1); + byte = zis.readU8(); nbits = 8; } nbits -= bppp; @@ -225,20 +224,20 @@ void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, while (ptr < end) { T pix; if (isLowCPixel || isHighCPixel) - zlibHasData(zis, 3); + zlibHasData(&zis, 3); else - zlibHasData(zis, sizeof(T)); + zlibHasData(&zis, sizeof(T)); if (isLowCPixel) - pix = readOpaque24A(zis); + pix = readOpaque24A(&zis); else if (isHighCPixel) - pix = readOpaque24B(zis); + pix = readOpaque24B(&zis); else - pix = readPixel<T>(zis); + pix = readPixel<T>(&zis); int len = 1; int b; do { - zlibHasData(zis, 1); - b = zis->readU8(); + zlibHasData(&zis, 1); + b = zis.readU8(); len += b; } while (b == 255); @@ -256,14 +255,14 @@ void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, T* ptr = buf; T* end = ptr + t.area(); while (ptr < end) { - zlibHasData(zis, 1); - int index = zis->readU8(); + zlibHasData(&zis, 1); + int index = zis.readU8(); int len = 1; if (index & 128) { int b; do { - zlibHasData(zis, 1); - b = zis->readU8(); + zlibHasData(&zis, 1); + b = zis.readU8(); len += b; } while (b == 255); @@ -285,6 +284,6 @@ void ZRLEDecoder::zrleDecode(const Rect& r, rdr::InStream* is, } } - zis->flushUnderlying(); - zis->setUnderlying(NULL, 0); + zis.flushUnderlying(); + zis.setUnderlying(nullptr, 0); } diff --git a/common/rfb/ZRLEDecoder.h b/common/rfb/ZRLEDecoder.h index e72bf1b6..facf0adc 100644 --- a/common/rfb/ZRLEDecoder.h +++ b/common/rfb/ZRLEDecoder.h @@ -30,16 +30,16 @@ namespace rfb { public: ZRLEDecoder(); virtual ~ZRLEDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: template<class T> void zrleDecode(const Rect& r, rdr::InStream* is, - rdr::ZlibInStream* zis, const PixelFormat& pf, ModifiablePixelBuffer* pb); private: diff --git a/common/rfb/ZRLEEncoder.cxx b/common/rfb/ZRLEEncoder.cxx index ad3aec1a..1e2c6ef4 100644 --- a/common/rfb/ZRLEEncoder.cxx +++ b/common/rfb/ZRLEEncoder.cxx @@ -36,9 +36,9 @@ static LogWriter vlog("ZRLEEncoder"); IntParameter zlibLevel("ZlibLevel","[DEPRECATED] Zlib compression level",-1); -ZRLEEncoder::ZRLEEncoder(SConnection* conn) - : Encoder(conn, encodingZRLE, EncoderPlain, 127), - zos(0, 2), mos(129*1024) +ZRLEEncoder::ZRLEEncoder(SConnection* conn_) + : Encoder(conn_, encodingZRLE, EncoderPlain, 127), + zos(nullptr, 2), mos(129*1024) { if (zlibLevel != -1) { vlog.info("Warning: The ZlibLevel option is deprecated and is " @@ -50,7 +50,7 @@ ZRLEEncoder::ZRLEEncoder(SConnection* conn) ZRLEEncoder::~ZRLEEncoder() { - zos.setUnderlying(NULL); + zos.setUnderlying(nullptr); } bool ZRLEEncoder::isSupported() diff --git a/common/rfb/ZRLEEncoder.h b/common/rfb/ZRLEEncoder.h index fa89f10f..87d87e94 100644 --- a/common/rfb/ZRLEEncoder.h +++ b/common/rfb/ZRLEEncoder.h @@ -30,14 +30,14 @@ namespace rfb { ZRLEEncoder(SConnection* conn); virtual ~ZRLEEncoder(); - virtual bool isSupported(); + bool isSupported() override; - virtual void setCompressLevel(int level); + void setCompressLevel(int level) override; - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; protected: void writePaletteTile(const Rect& tile, const PixelBuffer* pb, diff --git a/common/rfb/obfuscate.cxx b/common/rfb/obfuscate.cxx index d40e25c3..2afc1512 100644 --- a/common/rfb/obfuscate.cxx +++ b/common/rfb/obfuscate.cxx @@ -41,7 +41,7 @@ std::vector<uint8_t> rfb::obfuscate(const char *str) { std::vector<uint8_t> buf(8); - assert(str != NULL); + assert(str != nullptr); size_t l = strlen(str), i; for (i=0; i<8; i++) @@ -59,7 +59,7 @@ std::string rfb::deobfuscate(const uint8_t *data, size_t len) if (len != 8) throw rdr::Exception("bad obfuscated password length"); - assert(data != NULL); + assert(data != nullptr); deskey(d3desObfuscationKey, DE1); des((uint8_t*)data, (uint8_t*)buf); diff --git a/common/rfb/util.cxx b/common/rfb/util.cxx index 48f59846..3c62b1df 100644 --- a/common/rfb/util.cxx +++ b/common/rfb/util.cxx @@ -40,7 +40,7 @@ namespace rfb { std::string out; va_start(ap, fmt); - len = vsnprintf(NULL, 0, fmt, ap); + len = vsnprintf(nullptr, 0, fmt, ap); va_end(ap); if (len < 0) @@ -68,13 +68,13 @@ namespace rfb { start = src; do { stop = strchr(start, delimiter); - if (stop == NULL) { + if (stop == nullptr) { out.push_back(start); } else { out.push_back(std::string(start, stop-start)); start = stop + 1; } - } while (stop != NULL); + } while (stop != nullptr); return out; } @@ -621,7 +621,7 @@ namespace rfb { { struct timeval now; - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); return msBetween(then, &now); } diff --git a/common/rfb/util.h b/common/rfb/util.h index cafea209..b47ac4c9 100644 --- a/common/rfb/util.h +++ b/common/rfb/util.h @@ -73,13 +73,6 @@ namespace rfb { // HELPER functions for timeout handling - // soonestTimeout() is a function to help work out the soonest of several - // timeouts. - inline void soonestTimeout(int* timeout, int newTimeout) { - if (newTimeout && (!*timeout || newTimeout < *timeout)) - *timeout = newTimeout; - } - // secsToMillis() turns seconds into milliseconds, capping the value so it // can't wrap round and become -ve inline int secsToMillis(int secs) { diff --git a/contrib/packages/deb/ubuntu-bionic/debian/changelog b/contrib/packages/deb/ubuntu-bionic/debian/changelog deleted file mode 100644 index 7e11956e..00000000 --- a/contrib/packages/deb/ubuntu-bionic/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -tigervnc (1.10.0) bionic; urgency=low - - * Initial release. - - -- Brian P. Hinz <bphinz@users.sourceforge.net> Mon, 28 Oct 2019 21:25:09 -0400 diff --git a/contrib/packages/deb/ubuntu-focal/debian/control b/contrib/packages/deb/ubuntu-focal/debian/control index b668e436..f88ad733 100644 --- a/contrib/packages/deb/ubuntu-focal/debian/control +++ b/contrib/packages/deb/ubuntu-focal/debian/control @@ -13,7 +13,6 @@ Build-Depends: cmake, pkg-config, gettext, - libpixman-1-dev, zlib1g-dev, libjpeg-turbo8-dev, libavcodec-dev, @@ -24,9 +23,6 @@ Build-Depends: libgmp-dev, libpam0g-dev, libpng-dev, - libxext-dev, - libxi-dev, - libxtst-dev, libxrandr-dev, libxdamage-dev, libxfixes-dev, @@ -37,7 +33,6 @@ Build-Depends: # Xorg dependencies debhelper (>= 10), po-debconf, - dpkg-dev (>= 1.16.1), quilt, lsb-release, pkg-config, diff --git a/contrib/packages/deb/ubuntu-focal/debian/copyright b/contrib/packages/deb/ubuntu-focal/debian/copyright index 905754e3..aa706811 100644 --- a/contrib/packages/deb/ubuntu-focal/debian/copyright +++ b/contrib/packages/deb/ubuntu-focal/debian/copyright @@ -22,7 +22,7 @@ TigerVNC is Copyright (C) 2009-2011 D. R. Commander Copyright (C) 2009-2011 Pierre Ossman for Cendio AB Copyright (C) 2004, 2009-2011 Red Hat, Inc. - Copyright (C) 2009-2019 TigerVNC Team + Copyright (C) 2009-2024 TigerVNC Team All Rights Reserved. This software is distributed under the GNU General Public Licence as published diff --git a/contrib/packages/deb/ubuntu-focal/debian/rules b/contrib/packages/deb/ubuntu-focal/debian/rules index afb7830a..0245a065 100644 --- a/contrib/packages/deb/ubuntu-focal/debian/rules +++ b/contrib/packages/deb/ubuntu-focal/debian/rules @@ -102,7 +102,7 @@ config-stamp: xorg-source-stamp --enable-xdmcp \ --enable-xdm-auth-1 \ --enable-glx \ - --disable-dri --enable-dri2 --disable-dri3 \ + --disable-dri --enable-dri2 --enable-dri3 \ --enable-xinerama \ --enable-xf86vidmode \ --enable-xace \ diff --git a/contrib/packages/deb/ubuntu-jammy/debian/control b/contrib/packages/deb/ubuntu-jammy/debian/control index cf6175ef..f62e398e 100644 --- a/contrib/packages/deb/ubuntu-jammy/debian/control +++ b/contrib/packages/deb/ubuntu-jammy/debian/control @@ -11,25 +11,18 @@ Build-Depends: dpkg-dev (>= 1.16.1), appstream, cmake, - pkg-config, gettext, - libpixman-1-dev, zlib1g-dev, libjpeg-turbo8-dev, libavcodec-dev, libavutil-dev, libswscale-dev, libgnutls28-dev, - nettle-dev, libgmp-dev, libpam0g-dev, libpng-dev, - libxext-dev, - libxi-dev, - libxtst-dev, libxrandr-dev, libxdamage-dev, - libxfixes-dev, libfltk1.3-dev, xorg-server-source, xserver-xorg-dev, diff --git a/contrib/packages/deb/ubuntu-jammy/debian/copyright b/contrib/packages/deb/ubuntu-jammy/debian/copyright index 905754e3..aa706811 100644 --- a/contrib/packages/deb/ubuntu-jammy/debian/copyright +++ b/contrib/packages/deb/ubuntu-jammy/debian/copyright @@ -22,7 +22,7 @@ TigerVNC is Copyright (C) 2009-2011 D. R. Commander Copyright (C) 2009-2011 Pierre Ossman for Cendio AB Copyright (C) 2004, 2009-2011 Red Hat, Inc. - Copyright (C) 2009-2019 TigerVNC Team + Copyright (C) 2009-2024 TigerVNC Team All Rights Reserved. This software is distributed under the GNU General Public Licence as published diff --git a/contrib/packages/deb/ubuntu-jammy/debian/rules b/contrib/packages/deb/ubuntu-jammy/debian/rules index 02e798c9..1b4fd6f8 100644 --- a/contrib/packages/deb/ubuntu-jammy/debian/rules +++ b/contrib/packages/deb/ubuntu-jammy/debian/rules @@ -45,7 +45,7 @@ XORG_SOURCE_ARCHIVE = /usr/src/xorg-server.tar.xz xorg-source-stamp: $(XORG_SOURCE_ARCHIVE) tar -C unix/xserver -axf $(XORG_SOURCE_ARCHIVE) --strip-components=1 - cd unix/xserver && patch -p1 < ../xserver21.1.1.patch + cd unix/xserver && patch -p1 < ../xserver21.patch patch -p1 < debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch touch xorg-source-stamp @@ -102,7 +102,7 @@ config-stamp: xorg-source-stamp --enable-xdmcp \ --enable-xdm-auth-1 \ --enable-glx \ - --disable-dri --enable-dri2 --disable-dri3 \ + --disable-dri --enable-dri2 --enable-dri3 \ --enable-xinerama \ --enable-xf86vidmode \ --enable-xace \ diff --git a/contrib/packages/deb/ubuntu-noble/debian/changelog b/contrib/packages/deb/ubuntu-noble/debian/changelog new file mode 100644 index 00000000..65967959 --- /dev/null +++ b/contrib/packages/deb/ubuntu-noble/debian/changelog @@ -0,0 +1,5 @@ +tigervnc (1.13.80) noble; urgency=low + + * Initial release. + + -- Brian P. Hinz <bphinz@users.sourceforge.net> Tue, 18 Jun 2024 18:50:23 -0400 diff --git a/contrib/packages/deb/ubuntu-bionic/debian/compat b/contrib/packages/deb/ubuntu-noble/debian/compat index f599e28b..f599e28b 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/compat +++ b/contrib/packages/deb/ubuntu-noble/debian/compat diff --git a/contrib/packages/deb/ubuntu-bionic/debian/control b/contrib/packages/deb/ubuntu-noble/debian/control index 184d7eda..1b34193d 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/control +++ b/contrib/packages/deb/ubuntu-noble/debian/control @@ -13,7 +13,6 @@ Build-Depends: cmake, pkg-config, gettext, - libpixman-1-dev, zlib1g-dev, libjpeg-turbo8-dev, libavcodec-dev, @@ -24,74 +23,42 @@ Build-Depends: libgmp-dev, libpam0g-dev, libpng-dev, - libxext-dev, - libxi-dev, - libxtst-dev, libxrandr-dev, libxdamage-dev, - libxfixes-dev, libfltk1.3-dev, xorg-server-source, xserver-xorg-dev, openjdk-8-jdk, # Xorg dependencies - debhelper (>= 9), - dh-autoreconf, - po-debconf, - dpkg-dev (>= 1.16.1), +# debhelper-compat (= 12), quilt, - lsb-release, - pkg-config, bison, flex, xutils-dev (>= 1:7.6+4), xfonts-utils (>= 1:7.5+1), - x11proto-bigreqs-dev (>= 1:1.1.0), - x11proto-composite-dev (>= 1:0.4), - x11proto-core-dev (>= 7.0.31), - x11proto-damage-dev (>= 1.1), - x11proto-fixes-dev (>= 1:5.0), - x11proto-fonts-dev (>= 2.1.3), - x11proto-kb-dev (>= 1.0.3), - x11proto-xinerama-dev, - x11proto-randr-dev (>= 1.5.0), - x11proto-record-dev (>= 1.13.99.1), - x11proto-render-dev (>= 2:0.11), - x11proto-resource-dev (>= 1.2.0), - x11proto-scrnsaver-dev, - x11proto-video-dev, - x11proto-xcmisc-dev (>= 1.2.0), - x11proto-xext-dev (>= 7.2.99.901), - x11proto-xf86bigfont-dev (>= 1.2.0), - x11proto-xf86dga-dev (>= 2.0.99.1), - x11proto-xf86vidmode-dev (>= 2.2.99.1), - x11proto-present-dev, - x11proto-dri3-dev, + x11proto-dev (>= 2021.5), xtrans-dev (>= 1.3.5), libxau-dev (>= 1:1.0.5-2), - x11proto-input-dev (>= 2.3), - x11proto-dri2-dev (>= 2.8), + libxcvt-dev, libxdmcp-dev (>= 1:0.99.1), libxfont-dev (>= 1:2.0.1), libxkbfile-dev (>= 1:0.99.1), libpixman-1-dev (>= 0.27.2), libpciaccess-dev (>= 0.12.901), - libgcrypt-dev, - nettle-dev, + libgcrypt20-dev, libudev-dev (>= 151-3) [linux-any], libselinux1-dev (>= 2.0.80) [linux-any], libaudit-dev [linux-any], - x11proto-xf86dri-dev (>= 2.1.0), - libdrm-dev (>= 2.4.46) [!hurd-i386], - x11proto-gl-dev (>= 1.4.17), + libdrm-dev (>= 2.4.107-5~) [!hurd-i386], libgl1-mesa-dev (>= 9.2), + mesa-common-dev, +# Don't use libunwind for armel, armhf, and arm64 as this library is buggy (bug #923962) on those architectures. + libunwind-dev [amd64 hppa i386 ia64 mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el sh4], libxmuu-dev (>= 1:0.99.1), libxext-dev (>= 1:0.99.1), libx11-dev (>= 2:1.6), libxrender-dev (>= 1:0.9.0), - libxi-dev (>= 2:1.6.99.1), - x11proto-dmx-dev (>= 1:2.2.99.1), - libdmx-dev (>= 1:1.0.1), + libxi-dev (>= 2:1.8), libxpm-dev (>= 1:3.5.3), libxaw7-dev (>= 1:0.99.1), libxt-dev (>= 1:0.99.1), @@ -106,15 +73,31 @@ Build-Depends: libepoxy-dev [linux-any kfreebsd-any], libegl1-mesa-dev [linux-any kfreebsd-any], libgbm-dev (>= 10.2) [linux-any kfreebsd-any], +## XCB bits for Xephyr +# libx11-xcb-dev, +# libxcb1-dev, +# libxcb-xkb-dev, +# libxcb-shape0-dev, +# libxcb-render0-dev, +# libxcb-render-util0-dev, +# libxcb-util0-dev, +# libxcb-image0-dev, +# libxcb-icccm4-dev, +# libxcb-shm0-dev, +# libxcb-keysyms1-dev, +# libxcb-randr0-dev, +# libxcb-xv0-dev, +# libxcb-glx0-dev, +# libxcb-xf86dri0-dev (>= 1.6), # unit tests xkb-data, x11-xkb-utils, # arc4random_buf(), getpeereid() libbsd-dev, #logind - libdbus-1-dev (>= 1.0) [linux-any], + libdbus-1-dev (>= 1.0) [linux-any], # systemd-daemon - libsystemd-dev [linux-any], + libsystemd-dev [linux-any], Homepage: http://www.tigervnc.com Package: tigervncserver diff --git a/contrib/packages/deb/ubuntu-bionic/debian/copyright b/contrib/packages/deb/ubuntu-noble/debian/copyright index 905754e3..8159ec57 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/copyright +++ b/contrib/packages/deb/ubuntu-noble/debian/copyright @@ -1,5 +1,5 @@ This package was packaged for Debian by Brian P. Hinz <bphinz@users.sourceforge.net> -on Mon, 28 Oct 2019 21:29:33 +0500 using the tightvnc package as a base. +on Tue, 18 Jun 2024 18:54:03 -0400 using the tightvnc package as a base. It was downloaded from: https://www.tigervnc.org/ @@ -22,7 +22,7 @@ TigerVNC is Copyright (C) 2009-2011 D. R. Commander Copyright (C) 2009-2011 Pierre Ossman for Cendio AB Copyright (C) 2004, 2009-2011 Red Hat, Inc. - Copyright (C) 2009-2019 TigerVNC Team + Copyright (C) 2009-2024 TigerVNC Team All Rights Reserved. This software is distributed under the GNU General Public Licence as published diff --git a/contrib/packages/deb/ubuntu-bionic/debian/rules b/contrib/packages/deb/ubuntu-noble/debian/rules index 54dfcd44..1b4fd6f8 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/rules +++ b/contrib/packages/deb/ubuntu-noble/debian/rules @@ -45,7 +45,7 @@ XORG_SOURCE_ARCHIVE = /usr/src/xorg-server.tar.xz xorg-source-stamp: $(XORG_SOURCE_ARCHIVE) tar -C unix/xserver -axf $(XORG_SOURCE_ARCHIVE) --strip-components=1 - cd unix/xserver && patch -p1 < ../xserver119.patch + cd unix/xserver && patch -p1 < ../xserver21.patch patch -p1 < debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch touch xorg-source-stamp diff --git a/contrib/packages/deb/ubuntu-bionic/debian/source/format b/contrib/packages/deb/ubuntu-noble/debian/source/format index 163aaf8d..163aaf8d 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/source/format +++ b/contrib/packages/deb/ubuntu-noble/debian/source/format diff --git a/contrib/packages/deb/ubuntu-bionic/debian/tigervncserver.postinst.in b/contrib/packages/deb/ubuntu-noble/debian/tigervncserver.postinst.in index 24913291..24913291 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/tigervncserver.postinst.in +++ b/contrib/packages/deb/ubuntu-noble/debian/tigervncserver.postinst.in diff --git a/contrib/packages/deb/ubuntu-bionic/debian/tigervncserver.prerm b/contrib/packages/deb/ubuntu-noble/debian/tigervncserver.prerm index 2e8e77c4..2e8e77c4 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/tigervncserver.prerm +++ b/contrib/packages/deb/ubuntu-noble/debian/tigervncserver.prerm diff --git a/contrib/packages/deb/ubuntu-bionic/debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch b/contrib/packages/deb/ubuntu-noble/debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch index 4575f6a9..4575f6a9 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch +++ b/contrib/packages/deb/ubuntu-noble/debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch diff --git a/contrib/packages/deb/ubuntu-bionic/debian/xorg-source-patches/debian_libtool.patch b/contrib/packages/deb/ubuntu-noble/debian/xorg-source-patches/debian_libtool.patch index d24877d2..d24877d2 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/xorg-source-patches/debian_libtool.patch +++ b/contrib/packages/deb/ubuntu-noble/debian/xorg-source-patches/debian_libtool.patch diff --git a/contrib/packages/deb/ubuntu-bionic/debian/xtigervncviewer.menu b/contrib/packages/deb/ubuntu-noble/debian/xtigervncviewer.menu index aac942ca..aac942ca 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/xtigervncviewer.menu +++ b/contrib/packages/deb/ubuntu-noble/debian/xtigervncviewer.menu diff --git a/contrib/packages/deb/ubuntu-bionic/debian/xtigervncviewer.postinst b/contrib/packages/deb/ubuntu-noble/debian/xtigervncviewer.postinst index 4df0c65f..4df0c65f 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/xtigervncviewer.postinst +++ b/contrib/packages/deb/ubuntu-noble/debian/xtigervncviewer.postinst diff --git a/contrib/packages/deb/ubuntu-bionic/debian/xtigervncviewer.prerm b/contrib/packages/deb/ubuntu-noble/debian/xtigervncviewer.prerm index 7a51fd2c..7a51fd2c 100644 --- a/contrib/packages/deb/ubuntu-bionic/debian/xtigervncviewer.prerm +++ b/contrib/packages/deb/ubuntu-noble/debian/xtigervncviewer.prerm diff --git a/contrib/packages/rpm/el7/SPECS/tigervnc.spec b/contrib/packages/rpm/el7/SPECS/tigervnc.spec index e16d81e5..ee3baed8 100644 --- a/contrib/packages/rpm/el7/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el7/SPECS/tigervnc.spec @@ -27,7 +27,7 @@ BuildRequires: xorg-x11-server-source BuildRequires: libXext-devel, libX11-devel, libXi-devel, libXfixes-devel BuildRequires: libXdamage-devel, libXrandr-devel, libXt-devel, libXdmcp-devel BuildRequires: libXinerama-devel, mesa-libGL-devel, libxshmfence-devel -BuildRequires: pixman-devel, libdrm-devel, +BuildRequires: pixman-devel, libdrm-devel, mesa-libgbm-devel BuildRequires: xorg-x11-util-macros, xorg-x11-xtrans-devel, libXtst-devel BuildRequires: xorg-x11-font-utils BuildRequires: libXfont2-devel @@ -158,14 +158,11 @@ autoreconf -fiv --disable-xwin --disable-xephyr --disable-kdrive --disable-xwayland \ --with-pic --disable-static \ --with-default-font-path="catalogue:%{_sysconfdir}/X11/fontpath.d,built-ins" \ - --with-fontdir=%{_datadir}/X11/fonts \ --with-xkb-output=%{_localstatedir}/lib/xkb \ - --enable-install-libxf86config \ - --enable-glx --disable-dri --enable-dri2 --disable-dri3 \ + --enable-glx --disable-dri --enable-dri2 --enable-dri3 \ --disable-unit-tests \ --disable-config-hal \ --disable-config-udev \ - --with-dri-driver-path=%{_libdir}/dri \ --without-dtrace \ --disable-devel-docs \ --disable-selective-werror diff --git a/contrib/packages/rpm/el8/SPECS/tigervnc.spec b/contrib/packages/rpm/el8/SPECS/tigervnc.spec index de296b8c..307e26f6 100644 --- a/contrib/packages/rpm/el8/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el8/SPECS/tigervnc.spec @@ -28,7 +28,7 @@ BuildRequires: xorg-x11-server-source BuildRequires: libXext-devel, libX11-devel, libXi-devel, libXfixes-devel BuildRequires: libXdamage-devel, libXrandr-devel, libXt-devel, libXdmcp-devel BuildRequires: libXinerama-devel, mesa-libGL-devel, libxshmfence-devel -BuildRequires: pixman-devel, libdrm-devel, +BuildRequires: pixman-devel, libdrm-devel, mesa-libgbm-devel BuildRequires: xorg-x11-util-macros, xorg-x11-xtrans-devel, libXtst-devel BuildRequires: xorg-x11-font-utils BuildRequires: libXfont2-devel @@ -151,14 +151,11 @@ autoreconf -fiv --disable-xwin --disable-xephyr --disable-kdrive --disable-xwayland \ --with-pic --disable-static \ --with-default-font-path="catalogue:%{_sysconfdir}/X11/fontpath.d,built-ins" \ - --with-fontdir=%{_datadir}/X11/fonts \ --with-xkb-output=%{_localstatedir}/lib/xkb \ - --enable-install-libxf86config \ - --enable-glx --disable-dri --enable-dri2 --disable-dri3 \ + --enable-glx --disable-dri --enable-dri2 --enable-dri3 \ --disable-unit-tests \ --disable-config-hal \ --disable-config-udev \ - --with-dri-driver-path=%{_libdir}/dri \ --without-dtrace \ --disable-devel-docs \ --disable-selective-werror diff --git a/contrib/packages/rpm/el9/SPECS/tigervnc.spec b/contrib/packages/rpm/el9/SPECS/tigervnc.spec index a58d1c50..5d120bc0 100644 --- a/contrib/packages/rpm/el9/SPECS/tigervnc.spec +++ b/contrib/packages/rpm/el9/SPECS/tigervnc.spec @@ -28,7 +28,7 @@ BuildRequires: xorg-x11-server-source BuildRequires: libXext-devel, libX11-devel, libXi-devel, libXfixes-devel BuildRequires: libXdamage-devel, libXrandr-devel, libXt-devel, libXdmcp-devel BuildRequires: libXinerama-devel, mesa-libGL-devel, libxshmfence-devel -BuildRequires: pixman-devel, libdrm-devel, +BuildRequires: pixman-devel, libdrm-devel, mesa-libgbm-devel BuildRequires: xorg-x11-util-macros, xorg-x11-xtrans-devel, libXtst-devel BuildRequires: libXfont2-devel # SELinux @@ -150,14 +150,11 @@ autoreconf -fiv --disable-xwin --disable-xephyr --disable-kdrive --disable-xwayland \ --with-pic --disable-static \ --with-default-font-path="catalogue:%{_sysconfdir}/X11/fontpath.d,built-ins" \ - --with-fontdir=%{_datadir}/X11/fonts \ --with-xkb-output=%{_localstatedir}/lib/xkb \ - --enable-install-libxf86config \ - --enable-glx --disable-dri --enable-dri2 --disable-dri3 \ + --enable-glx --disable-dri --enable-dri2 --enable-dri3 \ --disable-unit-tests \ --disable-config-hal \ --disable-config-udev \ - --with-dri-driver-path=%{_libdir}/dri \ --without-dtrace \ --disable-devel-docs \ --disable-selective-werror diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 7627a2c5..e833bd38 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.0) project(tigervnc-java Java) if(NOT VERSION) - set(VERSION 1.13.80) + set(VERSION 1.14.80) endif() find_package(Java) @@ -20,7 +20,10 @@ set(JAVA_KEYSTORE_TYPE "jks" CACHE STRING "Type of keystore (Default: \"jks\")") set(JAVA_KEY_ALIAS NOTFOUND CACHE STRING "Alias for the keystore entry used to generate the signature") set(JAVA_STOREPASS NOTFOUND CACHE STRING "Password required to access the keystore") set(JAVA_KEYPASS NOTFOUND CACHE STRING "Password used to protect the private key of the specified keystore entry") +set(JAVA_PKCS11_PROVIDER_CLASS "sun.security.pkcs11.SunPKCS11" CACHE STRING "PKCS11 SecurityProvider class name") +set(JAVA_PKCS11_PROVIDER_ARG NOTFOUND CACHE STRING "Path to the PKCS11 security provider class config file") set(JAVA_TSA_URL NOTFOUND CACHE STRING "URL of Time Stamping Authority (TSA)") +set(JAVA_CERT_CHAIN NOTFOUND CACHE STRING "Path to CA certificate chain file") if(NOT BUILD) STRING(TIMESTAMP BUILD "%Y%m%d" UTC) @@ -166,9 +169,12 @@ add_custom_command(OUTPUT VncViewer.jar -DJAVA_KEYSTORE=${JAVA_KEYSTORE} -DJAVA_KEYSTORE_TYPE=${JAVA_KEYSTORE_TYPE} -DJAVA_STOREPASS=${JAVA_STOREPASS} + -DJAVA_PKCS11_PROVIDER_CLASS=${JAVA_PKCS11_PROVIDER_CLASS} + -DJAVA_PKCS11_PROVIDER_ARG=${JAVA_PKCS11_PROVIDER_ARG} -DJAVA_KEYPASS=${JAVA_KEYPASS} -DJAVA_KEY_ALIAS=${JAVA_KEY_ALIAS} -DJAVA_TSA_URL=${JAVA_TSA_URL} + -DJAVA_CERT_CHAIN=${JAVA_CERT_CHAIN} -P ${SRCDIR}/cmake/SignJar.cmake) add_custom_target(java ALL DEPENDS VncViewer.jar) diff --git a/java/cmake/SignJar.cmake b/java/cmake/SignJar.cmake index 067116d4..cfca1ba2 100644 --- a/java/cmake/SignJar.cmake +++ b/java/cmake/SignJar.cmake @@ -10,8 +10,20 @@ set(KEYTOOL "${Java_PATH}/keytool") set(JARSIGNER "${Java_PATH}/jarsigner") if(JAVA_KEYSTORE) - if((NOT JAVA_STOREPASS) OR (NOT JAVA_KEYPASS) OR (NOT JAVA_KEY_ALIAS)) - message(FATAL_ERROR "When JAVA_KEYSTORE is specified, JAVA_KEY_ALIAS, JAVA_STOREPASS, and JAVA_KEYPASS must also be specified:\n${ERROR}") + if((NOT JAVA_KEYSTORE_TYPE)) + message(FATAL_ERROR "When JAVA_KEYSTORE is specified, JAVA_KEYSTORE_TYPE must also be specified:\n${ERROR}") + endif() + string(TOUPPER "${JAVA_KEYSTORE_TYPE}" JAVA_KEYSTORE_TYPE_STRING) + if(${JAVA_KEYSTORE_TYPE_STRING} MATCHES "PKCS11") + if((NOT JAVA_PKCS11_PROVIDER_ARG) OR (NOT JAVA_STOREPASS) OR (NOT JAVA_KEY_ALIAS)) + message(FATAL_ERROR "When JAVA_KEYSTORE_TYPE is PKCS11, JAVA_STOREPASS, JAVA_PKCS11_PROVIDER_ARG, and JAVA_KEY_ALIAS must also be specified:\n${ERROR}") + endif() + elseif((${JAVA_KEYSTORE_TYPE_STRING} MATCHES "JKS") OR (${JAVA_KEYSTORE_TYPE_STRING} MATCHES "PKCS12")) + if((NOT JAVA_STOREPASS) OR (NOT JAVA_KEYPASS) OR (NOT JAVA_KEY_ALIAS)) + message(FATAL_ERROR "When JAVA_KEYSTORE_TYPE is JKS or PKCS12, JAVA_STOREPASS, JAVA_KEYPASS, and JAVA_KEY_ALIAS must also be specified:\n${ERROR}") + endif() + else() + message(FATAL_ERROR "Unsupported keystore type:\n${ERROR}") endif() else() message(STATUS "Generating self-signed certificate") @@ -44,14 +56,23 @@ else() set(ARGS ${ARGS} -storepass ${JAVA_STOREPASS}) endif() -if(${JAVA_KEYPASS} MATCHES "^:env") - string(REGEX REPLACE "^:env[\t ]+(.*)$" "\\1" JAVA_KEYPASS "${JAVA_KEYPASS}") - set(ARGS ${ARGS} -keypass:env ${JAVA_KEYPASS}) -elseif("${JAVA_KEYPASS}" MATCHES "^:file") - string(REGEX REPLACE "^:file[\t ]+(.*)$" "\\1" JAVA_KEYPASS "${JAVA_KEYPASS}") - set(ARGS ${ARGS} -keypass:file ${JAVA_KEYPASS}) -else() - set(ARGS ${ARGS} -keypass ${JAVA_KEYPASS}) +if(${JAVA_KEYSTORE_TYPE_STRING} MATCHES "PKCS11") + set(ARGS ${ARGS} -providerClass ${JAVA_PKCS11_PROVIDER_CLASS}) + set(ARGS ${ARGS} -providerArg ${JAVA_PKCS11_PROVIDER_ARG}) +elseif((${JAVA_KEYSTORE_TYPE_STRING} MATCHES "JKS") OR (${JAVA_KEYSTORE_TYPE_STRING} MATCHES "PKCS12")) + if(${JAVA_KEYPASS} MATCHES "^:env") + string(REGEX REPLACE "^:env[\t ]+(.*)$" "\\1" JAVA_KEYPASS "${JAVA_KEYPASS}") + set(ARGS ${ARGS} -keypass:env ${JAVA_KEYPASS}) + elseif("${JAVA_KEYPASS}" MATCHES "^:file") + string(REGEX REPLACE "^:file[\t ]+(.*)$" "\\1" JAVA_KEYPASS "${JAVA_KEYPASS}") + set(ARGS ${ARGS} -keypass:file ${JAVA_KEYPASS}) + else() + set(ARGS ${ARGS} -keypass ${JAVA_KEYPASS}) + endif() +endif() + +if(JAVA_CERT_CHAIN) + set(ARGS ${ARGS} -certchain ${JAVA_CERT_CHAIN}) endif() if(JAVA_TSA_URL) @@ -1,14 +1,14 @@ # Bulgarian translation of tigervnc po-file. -# Copyright (C) 2015, 2017, 2018, 2019. 2021, 2022 the TigerVNC Team (msgids) +# Copyright (C) 2015, 2017, 2018, 2019. 2021, 2022, 2024 the TigerVNC Team (msgids) # This file is distributed under the same license as the tigervnc package. -# Alexander Shopov <ash@kambanaria.org>, 2015, 2017, 2018, 2019, 2021, 2022. +# Alexander Shopov <ash@kambanaria.org>, 2015, 2017, 2018, 2019, 2021, 2022, 2024. # msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-16 12:27+0200\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-21 10:55+0200\n" "Last-Translator: Alexander Shopov <ash@kambanaria.org>\n" "Language-Team: Bulgarian <dict@ludost.net>\n" "Language: bg\n" @@ -18,17 +18,17 @@ msgstr "" "X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "Връзка към гнездо „%s“" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "Връзка към машина „%s“, порт %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -39,94 +39,94 @@ msgstr "" "\n" "%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Име на работен плот: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Машина: %.80s, порт: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Размер: %d ✕ %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Формат на пикÑелите: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(Ñтандартното за Ñървъра %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "ЗаÑвено кодиране: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "ПоÑледно ползвано кодиране: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Оценка на ÑкороÑтта на линиÑта: %d kbit/s" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "ВерÑÐ¸Ñ Ð½Ð° протокола: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Вид ÑигурноÑÑ‚: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "Връзката бе прекъÑната от Ñтраната на Ñървъра, преди да Ñе уÑтанови ÑеÑиÑ." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "ÐеуÑпешно задаване на размер на плота чрез SetDesktopSize: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "Ðеправилна палитра SetColourMapEntries от Ñървъра!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "СкороÑÑ‚ %d kbit/s — преминаване към качеÑтво %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "СкороÑÑ‚ %d kbit/s — пълниÑÑ‚ цвÑÑ‚ е включен" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "СкороÑÑ‚ %d kbit/s — пълниÑÑ‚ цвÑÑ‚ е изключен" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "Ползва Ñе формат на пикÑелите %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "Указани Ñа неправилни размери!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "ÐамалÑване на размера на прозореца, за да Ñе побере на Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ Ð¼Ð¾Ð½Ð¸Ñ‚Ð¾Ñ€" @@ -139,12 +139,12 @@ msgstr "ПреоразмерÑване на екрана за избÑгване msgid "Press %s to open the context menu" msgstr "За контекÑтното меню натиÑнете клавиша „%s“" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "ÐеуÑпешно прихващане на клавиатурата" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "ИзчиÑлено е неправилно разположение на екрана Ñпоред заÑвката за преоразмерÑване!" @@ -153,218 +153,218 @@ msgid "Invalid state for 3 button emulation" msgstr "Ðеправилно ÑÑŠÑтоÑние за емулиране на 3 бутона" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "ÐеуÑпешно получаване на наÑтройките на монитора" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "Указани Ñа неправилни наÑтройки за „%s“" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "Монитор Ñ Ð¸Ð½Ð´ÐµÐºÑ %d не ÑъщеÑтвува" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Ðеправилен Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° монитор „%s“" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "Ðеочакван знак „%c“" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "Визуализатор на VNC: наÑтройки на връзката" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "ÐаÑтройки на TigerVNC" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "ОтмÑна" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "Добре" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "КомпреÑиÑ" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Ðвтоматичен избор" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "Предпочитано кодиране" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "ЦвÑÑ‚" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Пълен" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "Среден" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "Беден" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "СъвÑем беден" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Ðиво на компреÑиÑ:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" -msgstr "ниво (0=бързо, 9=най-добро)" +msgstr "ниво (0≡бързо, 9≡най-добро)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "Ползване на компреÑÐ¸Ñ JPEG:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" -msgstr "качеÑтво (0=лошо, 9=най-добро)" +msgstr "качеÑтво (0≡лошо, 9≡най-добро)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "СигурноÑÑ‚" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "Шифриране" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Без" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS + анонимен Ñертификат" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS + Ñертификат X509" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "Път към Ñертификата на удоÑÑ‚Ð¾Ð²ÐµÑ€Ð¸Ñ‚ÐµÐ»Ñ Ð¿Ð¾ X509" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "Път към файла CPL по X509" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "ИдентификациÑ" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "Стандартна за VNC (неÑигурна без шифриране)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Име и парола (неÑигурна без шифриране)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" -msgstr "Права" +msgstr "Права̀" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ (без вход от мишка и клавиатура)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "Мишка" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Ð•Ð¼ÑƒÐ»Ð°Ñ†Ð¸Ñ Ð½Ð° Ñреден бутон на мишката" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "Точка, ако нÑма курÑор" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Клавиатура" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "Изпращане на ÑиÑтемните клавиши директно към Ñървъра (при цÑл екран)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Клавиш за контекÑтното меню" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Буфер за обмен" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "Приемане на буфера за обмен от Ñървъра" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "Задаване и на оÑÐ½Ð¾Ð²Ð½Ð¸Ñ Ð¸Ð·Ð±Ð¾Ñ€" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "Изпращане на буфера за обмен към Ñървъра" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "Изпращане на оÑÐ½Ð¾Ð²Ð½Ð¸Ñ Ð¸Ð·Ð±Ð¾Ñ€ като буфер за обмен" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "ВизуализациÑ" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Режим на визуализациÑ" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "Ð’ прозорец" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "Ðа цÑл екран на Ñ‚ÐµÐºÑƒÑ‰Ð¸Ñ Ð¼Ð¾Ð½Ð¸Ñ‚Ð¾Ñ€" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "Ðа цÑл екран на вÑички монитори" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "Ðа цÑл екран на Ð¸Ð·Ð±Ñ€Ð°Ð½Ð¸Ñ Ð¼Ð¾Ð½Ð¸Ñ‚Ð¾Ñ€/и" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "Разни" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "Споделена (без прекъÑване на връзката към оÑтаналите визуализатори)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "Запитване на повторно Ñвързване при грешка" @@ -372,31 +372,31 @@ msgstr "Запитване на повторно Ñвързване при грРmsgid "VNC Viewer: Connection Details" msgstr "Визуализатор: Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° връзката" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "Сървър за VNC:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "ÐаÑтройки…" -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "Зареждане…" -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Запазване като…" -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "ОтноÑно…" -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "Свързване" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -407,15 +407,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "ÐаÑтройки на връзка за TigerVNC (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "Избор на файл Ñ Ð½Ð°Ñтройки на връзка за TigerVNC" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -435,7 +435,7 @@ msgstr "Запазване на наÑтройките на връзката Ð²Ñ msgid "%s already exists. Do you want to overwrite?" msgstr "Файлът „%s“ вече ÑъщеÑтвува, да Ñе презапише ли" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "Ðе" @@ -476,31 +476,29 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "ПътÑÑ‚ до домашната папка не може да бъде получен" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "ПътÑÑ‚ до папката за ÑÑŠÑтоÑнието не може да бъде получен" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "„%s“ не може да Ñе отвори: %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "Ред %d от файл „%s“ не може да Ñе прочете: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "Прекалено дълъг ред" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "Файлът Ñ Ð¿Ð°Ñ€Ð¾Ð»Ð°Ñ‚Ð° не може да Ñе отвори" @@ -516,139 +514,139 @@ msgstr "Тази връзка е Ñигурна" msgid "This connection is not secure" msgstr "Тази връзка не е Ñигурна" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "Име:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Парола:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Отменена идентификациÑ" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "ÐеуÑпешно обновÑване на ÑÑŠÑтоÑнието на Ñветодиодите на клавиатурата: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "ÐеуÑпешно обновÑване на ÑÑŠÑтоÑнието на Ñветодиодите на клавиатурата: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "ÐеуÑпешно обновÑване на ÑÑŠÑтоÑнието на Ñветодиодите на клавиатурата" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "ÐеуÑпешно получаване на ÑÑŠÑтоÑнието на Ñветодиодите на клавиатурата: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "ЛипÑва код на клавиш при натиÑкането на клавиш" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "ЛипÑва код за Ñ€Ð°Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÐµÐ½ клавиш 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "ЛипÑва код за Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Ðеправилен код 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "ЛипÑва знак за Ñ€Ð°Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»ÐµÐ½ клавиш 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "ЛипÑва знак за Ð²Ð¸Ñ€Ñ‚ÑƒÐ°Ð»Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "ЛипÑва знак за кода за клавиш 0x%02x (в текущото ÑÑŠÑтоÑние)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "ЛипÑва знак за кода за клавиш %d (в текущото ÑÑŠÑтоÑние)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "&ПрекъÑване на връзка" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "&ЦÑл екран" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "&Минимизиране" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "&ПреоразмерÑване на прозореца към ÑеÑиÑта" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "„&Ctrl“" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "„&Alt“" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "Изпращане на „%s“" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Изпращане на „Ctrl-Alt-&Del“" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "ОпреÑнÑване на &екрана" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "&ÐаÑтройки…" -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "&Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° връзката…" -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "&ОтноÑно TigerVNC…" -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° връзката по VNC" @@ -656,27 +654,27 @@ msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° връзката по VNC" msgid "Window is registered for touch instead of gestures" msgstr "Прозорецът е региÑтриран за докоÑване, а не за жеÑтове" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "ÐаÑтройките на жеÑтовете не може да Ñе зададат (грешка 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "ÐеуÑпешно получаване на информациÑта за жеÑтове (грешка 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Ðеправилен бутон на мишка: %d — Ñ‚Ñ€Ñбва да е от 1 до 7, включително." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Ðеподдържан клавиш 0x%x — не може да Ñе генерира Ñъбитие от клавиатурата." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "Ðе може да Ñе получи маÑката за ÑÑŠÐ±Ð¸Ñ‚Ð¸Ñ Ð¿Ð¾ X Input 2 за прозорец 0x%08lx" @@ -686,7 +684,7 @@ msgstr "Ðе може да Ñе получи маÑката за ÑÑŠÐ±Ð¸Ñ‚Ð¸Ñ msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "Прозорец 0x%08lx нÑма маÑка за ÑÑŠÐ±Ð¸Ñ‚Ð¸Ñ Ð¿Ð¾ X Input 2" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "Прозорец 0x%08lx има поне две маÑки за ÑÑŠÐ±Ð¸Ñ‚Ð¸Ñ Ð¿Ð¾ X Input 2" @@ -697,7 +695,7 @@ msgid "Failure grabbing device %i" msgstr "ÐеуÑпешно прихващане на уÑтройÑтво %i" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "Визуализатор на TigerVNC" @@ -726,120 +724,124 @@ msgstr "Визуализатор на TigerVNC: връзка към MacOS" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "Визуализатор на TigerVNC: връзка към Windows" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "Името на параметъра е прекалено дълго" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "СтойноÑтта на параметъра е прекалено голÑма" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Ðеправилен формат или прекалено голÑма ÑтойноÑÑ‚" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "Ключът за региÑтъра не може да Ñе Ñъздаде" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "Ключът за региÑтъра не може да Ñе затвори" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "„%s“ не може да Ñе запише: %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Ðепознат вид на параметъра" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "„%s“ не може да Ñе изтрие: %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "Ключът за региÑтъра не може да Ñи отвори" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Ð—Ð°Ð¿Ð¸Ñ â„–%d в иÑториÑта на Ñървърите не може да Ñи прочете: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "ÐеуÑпешно прочитане на параметъра „%s“: %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "ПътÑÑ‚ до папката за наÑтройките не може да бъде получен" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "Параметърът не може да Ñи кодира" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "Ðеправилен формат на файла Ñ Ð½Ð°Ñтройки „%s“" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Ðеправилен формат" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Ðепознат вид на параметъра" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "Получено е Ñъобщение (0x%x) за неподдържан прозорец" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "ПоÑочен е неправилен прозорец 0x%08lx за прихващане на показалеца" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "ФункционалноÑтта за обработка на ÑÑŠÐ±Ð¸Ñ‚Ð¸Ñ Ð´Ð¾ÐºÐ¾Ñване не може да Ñе Ñъздаде: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "Ðе може да Ñе закачи Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ð·Ð° обработка на ÑÑŠÐ±Ð¸Ñ‚Ð¸Ñ ÐºÑŠÐ¼ прозорец (грешка 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "Ðе може да Ñе получат данните за Ñъбитие на X Input" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "Събитие на X Input за неизвеÑтен прозорец" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "Разширението X Input липÑва." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "ЛипÑва верÑÐ¸Ñ 2 или по-нова на разширението X Input." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "ЛипÑва верÑÐ¸Ñ 2.2 или по-нова на разширението X Input. СъбитиÑта жеÑтове не Ñе поддържат." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -854,7 +856,7 @@ msgstr "" "За повече Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð·Ð° TigerVNC: http://www.tigervnc.org\n" "Превод на българÑки: ÐлекÑандър Шопов" -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -865,15 +867,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "ОтноÑно визуализатора на TigerVNC" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "Вътрешна грешка на FLTK. Спиране на програмата." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -884,79 +886,102 @@ msgstr "" "\n" "Ðов опит за връзка?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Грешка при Ñтартирането на нов визуализатор на TigerVNC: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Получен е Ñигнал %d. Визуализаторът на TigerVNC ще Ñпре работа." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "Да" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "ЗатварÑне" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "ОтноÑно" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Скриване" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "Спиране" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "УÑлуги" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Скриване на другите" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "Показване на вÑички" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&Файл" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "Ðова &връзка" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "Папката на VNC в домашната не може да Ñи Ñъздаде: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "ÐаÑтройката „FullScreenAllMonitors“ е оÑтарÑла, вмеÑто това задайте „FullScreenMode“ да е „all“" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "Папката „~/.vnc“ е оÑтарÑла. Вижте ръководÑтвото „man vncviewer“ кои папки Ñе ползват." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "Папката „%%APPDATA%%\\vnc“ е оÑтарÑла. Ползвайте „%%APPDATA%%\\TigerVNC“." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "Папката за наÑтройки на VNC не може да Ñе Ñъздаде: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "Папката за данни на VNC не може да Ñе Ñъздаде: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "Папката за ÑÑŠÑтоÑние на VNC не може да Ñе Ñъздаде: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "„-listen“ и „-via“ Ñа неÑъвмеÑтими" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Ðе може да Ñе Ñлуша за входÑщи връзки" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Слуша Ñе на порт %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -1,14 +1,14 @@ # Czech translation for TigerVNC. # Copyright (C) 2018 the TigerVNC Team (msgids) # This file is distributed under the same license as the tigervnc package. -# Petr Pisar <petr.pisar@atlas.cz>, 2018, 2019, 2021, 2022. +# Petr Pisar <petr.pisar@atlas.cz>, 2018, 2019, 2021, 2022, 2024. # msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-22 13:47+01:00\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-21 20:34+02:00\n" "Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n" "Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n" "Language: cs\n" @@ -17,17 +17,17 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "PÅ™ipojeno na socket %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "PÅ™ipojeno na stroj %s port %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -38,94 +38,94 @@ msgstr "" "\n" "%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Název plochy: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Stroj: %.80s port: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Velikost: %d×%d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Formát pixelu: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(výchozà serveru %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "Požadované kódovánÃ: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "Poslednà použité kódovánÃ: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Odhad rychlosti linky: %d kb/s" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "Verze protokolu: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Způsob zabezpeÄenÃ: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "Spojenà bylo serverem zahozeno dÅ™Ãve, než mohla být ustanovena relace." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "Požadavek SetDesktopSize selhal: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "Neplatná zpráva SetColourMapEntries od serveru!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "Tok %d kb/S – kvalita se mÄ›nà na %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "Tok %d kb/s – plný poÄet barev je nynà zapnut" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "Tok %d kb/s – plný poÄet barev je nynà vypnut" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "PoužÃvá se formát pixelu %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "Zadána neplatná geometrie!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "Velikost okna se zmenÅ¡uje, aby se veÅ¡lo na souÄasný monitor" @@ -138,12 +138,12 @@ msgstr "Upravuje se velikost okna, by se pÅ™edeÅ¡lo nechtÄ›nému požadavku na r msgid "Press %s to open the context menu" msgstr "Kontextovou nabÃdku otevÅ™ete stisknutÃm %s" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "Zabránà klávesnice se nezdaÅ™ilo" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "Pro požadavek na zmÄ›nu velikosti bylo vypoÄteno neplatné rozloženà obrazovky!" @@ -152,220 +152,220 @@ msgid "Invalid state for 3 button emulation" msgstr "Neplatný stav 3-tlaÄÃtkové emulace" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "ZÃskánà nastavenà systémového monitoru selhalo" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "Zadáno neplatné nastavenà pro %s" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "Monitor ÄÃslo %d neexistuje" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Neplatné ÄÃslo monitoru „%s“" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "NeÄekaný znak „%c“" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "ProhlÞeÄ VNC: Volby pÅ™ipojenÃ" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "Volby TigerVNC" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "ZruÅ¡it" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "OK" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "Komprese" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Automaticky vybrat" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "UpÅ™ednostňované kódovánÃ" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "Barevnost" # Attributes for "Color level" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Plná" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "StÅ™ednÃ" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "NÃzká" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "Velmi nÃzká" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Uživatelská úroveň komprese" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "úroveň (0 = rychlá, 9 = nejlepÅ¡Ã)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "Povolit kompresi JPEG:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "kvalita (0 = Å¡patná, 9 = nejlepÅ¡Ã)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "ZabezpeÄenÃ" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "Å ifrovánÃ" # TODO: Conext for gender -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Ne" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS s anonymnÃmi certifikáty" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS s certifikáty X509" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "Cesta k X509 certifikátu autority" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "Cesta k souboru se seznamem odvolaných certifikátů" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "Autentizace" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "Standardnà VNC (bez Å¡ifrovánÃ, nezabezpeÄené)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Uživatelské jméno a heslo (bez Å¡ifrovánÃ, nezabezpeÄené)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "Vstup" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Pouze se dÃvat (ignoruje myÅ¡ a klávesnici)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "MyÅ¡" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Emulovat prostÅ™ednà tlaÄÃtko myÅ¡i" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "Zobrazovat puntÃk, když chybà kurzor" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Klávesnice" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "PÅ™edávat systémové klávesy pÅ™Ãmo serveru (režim celé obrazovky)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Klávesa pro vyvolánà nabÃdky" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Schránka" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "PÅ™ijÃmat schránku ze serveru" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "Rovněž nastavovat primárnà výbÄ›r" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "PosÃlat schránku serveru" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "PosÃlat primárnà výbÄ›r jako schránku" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "ZobrazenÃ" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Režim zobrazenÃ" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "V oknÄ›" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "PÅ™es celou obrazovku souÄasného monitoru" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "PÅ™es celou obrazovku na vÅ¡ech monitorech" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "PÅ™es celou obrazovku na vybraných monitorech" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "OstatnÃ" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "SdÃlené (neodpojit ostatnà diváky)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "PÅ™i chybách spojenà se dotázat na nové" @@ -373,31 +373,31 @@ msgstr "PÅ™i chybách spojenà se dotázat na nové" msgid "VNC Viewer: Connection Details" msgstr "ProhlÞeÄ VNC: Podrobnosti o pÅ™ipojenÃ" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "VNC server:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "Volby…" -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "NaÄÃst…" -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Uložit jako…" -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "O aplikaci…" -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "PÅ™ipojit" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -408,15 +408,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "Nastavenà TigerVNC (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "Vybrat konfiguraÄnà souboru TigerVNC" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -436,7 +436,7 @@ msgstr "Uložit nastavenà TigerVNC do souboru" msgid "%s already exists. Do you want to overwrite?" msgstr "%s již existuje. Chcete pÅ™epsat?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "Ne" @@ -477,31 +477,29 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "Cestu k domovskému adresáři nebylo možné zÃskat" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "Cestu ke stavovému adresáři nebylo možné zÃskat" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "Nebylo možné otevÅ™Ãt „%s“: %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "PÅ™eÄtenà řádku %d v souboru %s selhalo: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "PÅ™ÃliÅ¡ dlouhý řádek" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "OtevÅ™enà souboru s heslem selhalo" @@ -517,139 +515,139 @@ msgstr "Toto spojenà je zabezpeÄené" msgid "This connection is not secure" msgstr "Toto spojenà nenà zabezpeÄené" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "Jméno:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Heslo:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Autentizace zruÅ¡ena" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "Aktualizace stavu diod klávesnice se nezdaÅ™ila: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "Aktualizace stavu diod klávesnice se nezdaÅ™ila: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "Aktualizace stavu diod klávesnice se nezdaÅ™ila" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "ZÃskanà stavu diod klávesnice se nezdaÅ™ilo: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "PÅ™i stisku klávesy nebyl zadán žádný kód klávesy" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "Žádný scan kód pro rozÅ¡ÃÅ™enou virtuálnà klávesu 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "Žádný scan kód pro virtuálnà klávesu 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Neplatný scan kód 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "Žádný symbol pro rozÅ¡ÃÅ™enou virtuálnà klávesu 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "Žádný symbol pro virtuálnà klávesu 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "Žádný symbol pro kód klávesy 0x%02x (v souÄasném stavu)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "Žádný symbol pro kód klávesy %d (v souÄasném stavu)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "Od&pojit" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "PÅ™es celou o&brazovku" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "Minimali&zovat" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "PÅ™izpůsobit &velikost okna relaci" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "Poslat %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Poslat Ctrl-Alt-&Del" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "Obnovit ob&razovku" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "V&olby…" -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "Úda&je o spojenÃ…" -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "O prohlÞeÄi &TigerVNC…" -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "Údaje o spojenà VNC" @@ -657,27 +655,27 @@ msgstr "Údaje o spojenà VNC" msgid "Window is registered for touch instead of gestures" msgstr "Okno je registrováno k dotykům namÃsto ke gestům" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "Nastavenà gest selhalo (chyba 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "ZÃskánà údajů o gestech selhalo (chyba 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Neplatné ÄÃslo tlaÄÃtka myÅ¡i %d. Musà se jednat o ÄÃslo mezi 1 a 7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Neobsluhovaná klávesa 0x%x – nelze vytvoÅ™it událost klávesnice." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "Masku událostà X Input 2 pro okno 0x%08lx nelze zÃskat" @@ -687,7 +685,7 @@ msgstr "Masku událostà X Input 2 pro okno 0x%08lx nelze zÃskat" msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "Okno 0x%08lx nemá žádnou masku událostà X Input 2" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "Okno 0x%08lx má vÃce než jednu masku událostà X Input 2" @@ -698,7 +696,7 @@ msgid "Failure grabbing device %i" msgstr "Zabránà zaÅ™Ãzenà %i se nezdaÅ™ilo" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "ProhlÞeÄ TigerVNC" @@ -727,120 +725,124 @@ msgstr "Spojenà prohlÞeÄe TigerVNC ke stroji s macOS" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "Spojenà prohlÞeÄe TigerVNC ke stroji s Windows" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "Název parametru %s je pÅ™ÃliÅ¡ dlouhý" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "Parametr je pÅ™ÃliÅ¡ dlouhý" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Neplatný formát nebo pÅ™ÃliÅ¡ velká hodnota" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "VytvoÅ™enà klÃÄe v registru selhalo" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "UzavÅ™enà klÃÄe v registru selhalo" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "Uloženà „%s“ selhalo: %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Neznámý typ parametru" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "OdstranÄ›nà „%s“ selhalo: %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "OtevÅ™enà klÃÄe v registru selhalo" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Položku historie serverů %d se nepodaÅ™ilo pÅ™eÄÃst: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "PÅ™eÄtenà parametru „%s“ selhalo: %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "Cestu ke konfiguraÄnÃmu adresáři nebylo možné zÃskat" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "Parametr nebylo možné zakódovat" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "KonfiguraÄnà soubor %s je v neplatném formátu" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Neplatný formát" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Neznámý parametr" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "Obdržena zpráva (0x%x) pro neobsluhované okno" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "Pro zabránà ukazatele byl zadáno neplatné okno 0x%08lx" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "Obsluhu dotyků se nepodaÅ™ilo vytvoÅ™it: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "K oknu nebylo možné pÅ™ipojit obsluhu událostà (chyba 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "Z události X Input nebylo možné zÃskat data události" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "Událost X Input pro neznámé okno" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "RozÅ¡ÃÅ™enà X Input nenà dostupné." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "RozÅ¡ÃÅ™enà X Input 2 (nebo novÄ›jÅ¡Ã) nenà dostupné." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "RozÅ¡ÃÅ™enà X Input 2.2 (nebo novÄ›jÅ¡Ã) nenà dostupné. Dotyková gesta nebudou podporována." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -853,7 +855,7 @@ msgstr "" "Copyright © 1999–%d Tým TigerVNC a mnozà dalÅ¡Ã (vizte README.rst)\n" "Podrobnosti o TigerVNC naleznete na https://www.tigervnc.org/." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -864,15 +866,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "O prohlÞeÄi TigerVNC" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "VnitÅ™nà chyba FLTK. KonÄà se." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -883,79 +885,102 @@ msgstr "" "\n" "Zkusit se znovu pÅ™ipojit?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Chyba pÅ™i spouÅ¡tÄ›nà prohlÞeÄe TigerVNC: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Byl pÅ™ijati vnitÅ™nà signál %d. TigerVNC se nynà ukonÄÃ." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "Ano" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "ZavÅ™Ãt" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "O aplikaci" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Skrýt" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "UkonÄit" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "Služby" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Skrýt ostatnÃ" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "Ukázat vÅ¡echny" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&Soubor" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "&Nové spojenÃ" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "Nebylo možné vytvoÅ™it domovský adresář pro VNC: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "Volba FullScreenAllMonitors je zastaralá, mÃsto nà nastavte FullScreenMode na „all“" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "Cesta ~/.vnc je zastaralá. Cestu, kam pÅ™ejÃt, naleznete popsanou v „man vncviewer“." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "Cesta %%APPDATA%%\\vnc je zastaralá. ProsÃm, cestu změňte na %%APPDATA%%\\TigerVNC." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "Nebylo možné vytvoÅ™it konfiguraÄnà adresář pro VNC: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "Nebylo možné vytvoÅ™it datový adresář pro VNC: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "Nebylo možné vytvoÅ™it stavový adresář pro VNC: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "Parametry -listen a -via se vzájemnÄ› vyluÄujÃ" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Nelze zaÄÃt Äekat na pÅ™Ãchozà spojenÃ" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Poslouchá se na portu %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -970,6 +995,12 @@ msgstr "" msgid "Remote Desktop Viewer" msgstr "ProhlÞeÄ vzdálené plochy" +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "ProhlÞeÄ VNC: Volby pÅ™ipojenÃ" + +#~ msgid "Misc." +#~ msgstr "OstatnÃ" + #~ msgid "Failed to get monitor name because X11 RandR could not be found" #~ msgstr "Nebylo možné zÃskat název monitoru, protože rozÅ¡ÃÅ™enà X11 RandR nebylo nalezeno" @@ -1,14 +1,14 @@ # Spanish translation for tigervnc. -# Copyright (C) 2018 the TigerVNC Team (msgids) +# Copyright (C) 2018, 2022, 2023, 2024 the TigerVNC Team (msgids) # This file is distributed under the same license as the tigervnc package. # Francisco Javier Serrador <fserrador@gmail.com>, 2018. -# Cristian Othón MartÃnez Vera <cfuga@cfuga.mx>, 2022. +# Cristian Othón MartÃnez Vera <cfuga@cfuga.mx>, 2022, 2023, 2024. msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-16 08:54-0600\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-20 14:49-0600\n" "Last-Translator: Cristian Othón MartÃnez Vera <cfuga@cfuga.mx>\n" "Language-Team: Spanish <es@tp.org.es>\n" "Language: es\n" @@ -18,17 +18,17 @@ msgstr "" "X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "Conectado al zócalo %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "Conectado al anfitrión %s puerto %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -39,94 +39,94 @@ msgstr "" "\n" "%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Nombre del escritorio: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Anfitrión: %.80s puerto: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Tamaño: %d x %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Formato de pixel: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(servidor pred. %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "Codificación solicitada: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "Última codificación empleada: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Velocidad de lÃnea estimada: %d kbit/s" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "Versión de protocolo: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Método de seguridad: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "La conexión fue rechazada por el servidor antes de que la sesión se pudiera establecer." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "Error en SetDesktopSize: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "¡SetColourMapEntries inválida del servidor!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "Procesamiento %d kbit/s - cambiado a calidad %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "Procesamiento %d kbit/s - se activa el color total" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "Procesamiento %d kbit/s - se desactiva el color total" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "Utilizando formato de pixel %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "¡Se especificó una geometrÃa inválida!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "Se reduce el tamaño de ventana para ajustar al monitor actual" @@ -139,12 +139,12 @@ msgstr "Se ajusta el tamaño de ventana para evitar peticiones accidentales de p msgid "Press %s to open the context menu" msgstr "Pulse %s para abrir el menú contextual" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "Error al coger el teclado" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "¡Disposición de pantalla computada inválida para petición de redimensionado!" @@ -153,218 +153,218 @@ msgid "Invalid state for 3 button emulation" msgstr "Estado inválido para la emulación de 3 botones" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "Falló al obtener la configuración del monitor del sistema" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "Se especificó una configuración inválida para %s" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "El Ãndice de monitor %d no existe" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Ãndice de monitor '%s' inválido" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "Carácter '%c' inesperado" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "Visor VNC: Opciones de conexión" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "Opciones de TigerVNC" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "Cancelar" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "Aceptar" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "Compresión" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Autoseleccionar" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "Codificación preferida" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "Nivel de color" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Total" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "Medio" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "Bajo" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "Muy bajo" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Nivel de compresión personal:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "calidad (0=rápido, 9=mejor)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "Permitir compresión JPEG:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "calidad (0=peor, 9=mejor)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "Seguridad" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "Cifrado" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Ninguno" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS con certificados anónimos" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS con certificados X509" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "Ruta a AC de certificado X509" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "Ruta a fichero CRL de X509" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "Autenticación" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "VNC común (inseguro sin cifrado)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Usuario y contraseña (inseguro sin cifrado)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "Entrada" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Ver solo (ignora ratón y teclado)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "Ratón" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Emula el botón medio del ratón" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "Muestra punto cuando no hay cursor" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Teclado" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "Pasa las teclas del sistema directamente al servidor (pantalla completa)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Tecla Menú" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Portapapeles" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "Acepta texto desde el portapapeles" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "Además establece selección primaria" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "EnvÃa portapapel al servidor" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "EnvÃa selección primaria como portapapeles" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "Despliegue" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Modo de despliegue" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "Ventana" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "Pantalla completa en el monitor actual" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "Pantalla completa en todos los monitores" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "Pantalla completa en el(los) monitor(es) seleccionado(s)" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." -msgstr "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" +msgstr "Misceláneos" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "Compartido (no desconecta otras visores)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "Pregunta para reconectar después de errores de conexión" @@ -372,31 +372,31 @@ msgstr "Pregunta para reconectar después de errores de conexión" msgid "VNC Viewer: Connection Details" msgstr "Visor VNC: Datos de conexión" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "Servidor VNC:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "Opciones..." -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "Cargar..." -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Guardar como..." -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "Acerca de..." -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "Conectar" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -407,15 +407,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "Configuración de TigerVNC (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "Selecciona un fichero de configuración TigerVNC" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -435,7 +435,7 @@ msgstr "Guarda la configuración de TigerVNC en el fichero" msgid "%s already exists. Do you want to overwrite?" msgstr "%s ya existe. ¿Lo quiere sobreescribir?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "No" @@ -475,31 +475,29 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "No se puede obtener la ruta del directorio inicial" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "No se puede obtener la ruta del directorio de estado" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "No se puede abrir \"%s\": %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "Falló al leer la lÃnea %d en el fichero %s: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "LÃnea demasiado larga" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "Falló al abrir el fichero de contraseña" @@ -515,139 +513,139 @@ msgstr "Esta conexión es segura" msgid "This connection is not secure" msgstr "Esta conexión no es segura" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "Usuario:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Contraseña:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Autenticación cancelada" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "Falló al actualizar el estado de LED del teclado: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "Falló al actualizar el estado de LED del teclado: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "Falló al actualizar el estado de LED del teclado" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "Falló al obtener el estado de LED del teclado: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "No se especificó un código de tecla al presionar la tecla" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "No hay un código de rastreo para la tecla virtual extendida 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "No hay un código de rastreo para la tecla virtual 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Código de rastreo 0x%02x inválido" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "No hay un sÃmbolo para la tecla virtual extendida 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "No hay un sÃmbolo para la tecla virtual 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "No hay un sÃmbolo para el código de tecla 0x%02x (en el estado actual)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "No hay un sÃmbolo para el código de tecla %d (en el estado actual)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "Des&conectar" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "&Pantalla completa" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "Minimi&zar" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "Redimensionar &ventana a sesión" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "Enviar %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Enviar Ctrl+Alt+&Supr" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "&Actualizar pantalla" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "&Opciones..." -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "&Info de conexión..." -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "Acerca del visor &TigerVNC..." -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "Info de conexión VNC" @@ -655,27 +653,27 @@ msgstr "Info de conexión VNC" msgid "Window is registered for touch instead of gestures" msgstr "La ventana está registrada para toques en lugar de gestos" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "Falló al definir la configuración de gestos (error 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "Falló al obtener la información de gestos (error 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Botón de ratón %d inválido, debe ser un número entre 1 y 7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Tecla 0x%x sin manejar - no se puede generar un evento de teclado." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "No se puede obtener la máscara de evento X Input 2 para la ventana 0x%08lx" @@ -685,7 +683,7 @@ msgstr "No se puede obtener la máscara de evento X Input 2 para la ventana 0x%0 msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "La ventana 0x%08lx no tiene máscara de evento X Input 2" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "La ventana 0x%08lx tiene más de una máscara de evento X Input 2" @@ -696,7 +694,7 @@ msgid "Failure grabbing device %i" msgstr "Error al coger el dispositivo %i" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "Visor TigerVNC" @@ -725,120 +723,124 @@ msgstr "Conexión de Visor TigerVNC a una máquina macOS" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "Conexión de Visor TigerVNC a una máquina Windows" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "El nombre del parámetro es demasiado grande" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "El parámetro es demasiado grande" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Formato inválido o valor demansiado grande" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "Falló al crear la llave de registro" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "Falló al cerrar la llave de registro" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "Falló al guardar \"%s\": %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Parámetro de tipo desconocido" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "Falló al borrar \"%s\": %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "Falló al abrir la llave de registro" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Falló al leer la entrada de histora del servidor %d: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "Falló al leer el parámetro \"%s\": %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "No se puede obtener la ruta del directorio de configuración" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "No se puede codificar el parámetro" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "El fichero de configuración %s tiene un formato inválido" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Formato inválido" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Parámetro desconocido" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "Se recibió el mensaje (0x%x) de una ventana sin manejar" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "Se especificó la ventana 0x%08lx inválida para sujetar el puntero" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "Falló al crear el manejador de toque: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "No se puede asociar el manejador de eventos a la ventana (error 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "Falló al obtener datos de eventos para eventos X Input" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "Evento X Input para una ventana desconocida" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "La extensión X Input no está disponible." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "X Input 2 (o más reciente) no está disponible." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "X Input 2.2 (o más reciente) no está disponible. No se admitirán los gestos de toque." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -851,7 +853,7 @@ msgstr "" "Copyright (C) 1999-%d Equipo TigerVNC y muchos otros (vea README.rst)\n" "Vea https://www.tigervnc.org para más información sobre TigerVNC." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -862,15 +864,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "Acerca del visor TigerVNC" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "Error interno en FLTK. Saliendo." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -881,79 +883,102 @@ msgstr "" "\n" "¿Se intenta la reconexión?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Error al iniciar un nuevo visor TigerVNC: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Se recibió la señal de terminación %d. El visor TigerVNC terminará ahora." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "SÃ" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "Cerrar" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "Acerca de" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Ocultar" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "Salir" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "Servicios" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Ocultar Otros" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "Mostrar Todos" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&Archivo" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "&Nueva conexión" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "No se puede crear el directorio del usuario VNC: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "FullScreenAllMonitors es obsoleto, en su lugar defina FullScreenMode a 'all'" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "~/.vnc es obsoleto, por favor consulte 'man vncviewer' para conocer rutas de migración." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "%%APPDATA%%\\vnc es obsoleto, por favor cambie a la ubicación %%APPDATA%%\\TigerVNC." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "No se puede crear el directorio de inicio VNC: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "No se puede crear el directorio de datos VNC: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "No se puede crear el directorio de estado VNC: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "Los parámetros -listen y -via son incompatibles" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "No se pueden escuchar las conexiones entrantes" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Escuchando en el puerto %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -968,6 +993,12 @@ msgstr "" msgid "Remote Desktop Viewer" msgstr "Visor de Escritorio Remoto" +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "Visor VNC: Opciones de conexión" + +#~ msgid "Misc." +#~ msgstr "Misc." + #~ msgid "Failed to get monitor name because X11 RandR could not be found" #~ msgstr "Falló al obtener el nombre del monitor porque no se encuentra X11 RandR" @@ -6,10 +6,10 @@ # msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-21 22:34+0200\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-22 21:10+0300\n" "Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n" "Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n" "Language: fi\n" @@ -18,19 +18,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.2.2\n" +"X-Generator: Poedit 3.4.4\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "Yhdistetty sokettiin %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "Yhdistetty koneeseen %s porttiin %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -41,94 +41,94 @@ msgstr "" "\n" "%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Työpöydän nimi: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Kone: %.80s portti: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Koko: %d × %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Pikselimuoto: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(palvelimen oletus %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "Pyydetty koodaus: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "Viimeksi käytetty koodaus: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Rivinopeusarvio: %d kilobittiä/s" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "Yhteyskäytäntöversio: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Turvamenetelmä: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "Palvelin pudotti yhteyden ennen kuin istuntoa voitiin muodostaa." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "SetDesktopSize epäonnistui: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "Virheellisiä SetColourMapEntries-tietueita palvelimelta!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "Läpisyöttö %d kilobittiä/s - vaihdetaan laaduksi %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "Läpisyöttö %d kilobittiä/s - täysvärit ovat nyt käytössä" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "Läpisyöttö %d kilobittiä/s - täysvärit ovat nyt pois käytöstä" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "Käytetään pikselimuotoa %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "Virheellinen geometria määritelty!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "Pienennetään ikkunan kokoa nykyiseen näyttöön sovittamiseksi" @@ -141,12 +141,12 @@ msgstr "Säädetään ikkunakokoa tahattomien kokonäyttöpyyntöjen välttämis msgid "Press %s to open the context menu" msgstr "%s avaa ponnahdusvalikon" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "Häiriö näppäimistöön tarttumisessa" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "Virheellinen näyttöasettelu laskettu koonmuuttamispyynnölle!" @@ -155,218 +155,218 @@ msgid "Invalid state for 3 button emulation" msgstr "Virheellinen tila kolmen painikkeen jäljittelylle" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "Järjestelmän näyttökokoonpanon selvittäminen epäonnistui" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "%s:lle määritetty virheellinen arvo" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "Näyttöä numero %d ei ole olemassa" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Virheellinen näytön numero â€%sâ€" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "Odottamaton merkki â€%câ€" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "VNC-katselin: Yhteysvalinnat" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "TigerVNC-asetukset" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "Peru" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "Valmis" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "Tiivistys" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Automaattivalinta" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "Ensisijainen koodaus" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "Väritaso" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Täysi" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "Keskilaatu" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "Matala" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "Hyvin matala" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Oma tiivistystaso:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "laatu (0=nopea, 9=paras)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "Salli JPEG-tiivistys:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "laatu (0=heikko, 9=paras)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "Turvallisuus" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "Salaus" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Ei mitään" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS anonyymeilla varmenteilla" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS X509-varmenteilla" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "Polku X509 CA-varmenteeseen" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "Polku X509 CRL-tiedostoon" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "Todennus" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "Standardi-VNC (turvaton salauksetta)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Käyttäjätunnus ja salasana (turvaton salauksetta)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "Syöte" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Vain katselu (hiirtä ja näppäimistöä ei huomioida)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "Hiiri" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Jäljittele hiiren keskipainiketta" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "Näytä piste kohdistimen puuttuessa" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Näppäimistö" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "Välitä järjestelmänäppäimet suoraan palvelimelle (kokonäyttö)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Valikkonäppäin" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Leikepöytä" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "Hyväksy leikepöytä palvelimelta" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "Aseta myös ensisijainen valinta" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "Lähetä leikepöytä palvelimelle" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "Lähetä ensisijainen valinta leikepöytänä" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "Näyttö" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Näyttötila" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "Ikkunoitu" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "Kokonäyttö nykyisellä näytöllä" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "Kokonäyttö kaikilla näytöillä" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "Kokonäyttö valituilla näytöillä" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "Sekalaiset" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "Jaettu (älä katkaise muiden katselimien yhteyksiä)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "Pyydä uudelleenyhdistämään yhteysvirheen sattuessa" @@ -374,32 +374,32 @@ msgstr "Pyydä uudelleenyhdistämään yhteysvirheen sattuessa" msgid "VNC Viewer: Connection Details" msgstr "VNC-katselin: Yhteyden yksityiskohdat" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "VNC-palvelin:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "Valinnat..." -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "Lataa..." # Nappi ei skaalaudu tekstin leveyden mukaan. -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Tall. nimellä..." -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "Tietoja..." -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "Yhdistä" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -410,15 +410,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "TigerVNC-asetukset (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "Valitse TigerVNC-asetustiedosto" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -438,7 +438,7 @@ msgstr "Tallenna TigerVNC-asetukset tiedostoon" msgid "%s already exists. Do you want to overwrite?" msgstr "%s on jo olemassa. Haluatko korvata sen?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "Ei" @@ -479,31 +479,29 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "Kotihakemiston polkua ei saatu tietoon" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "Tilahakemiston polkua ei saatu tietoon" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "Tiedoston â€%s†avaaminen epäonnistui: %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "Rivin %d lukeminen tiedostosta %s epäonnistui: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "Liian pitkä rivi" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "Salasanatiedoston avaaminen epäonnistui" @@ -519,139 +517,139 @@ msgstr "Tämä yhteys on turvallinen" msgid "This connection is not secure" msgstr "Tämä yhteys ei ole turvallinen" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "Käyttäjätunnus:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Salasana:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Todennus peruttu" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "Näppäimistön LED-tilan päivittäminen epäonnistui: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "Näppäimistön LED-tilan päivittäminen epäonnistui: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "Näppäimistön LED-tilan päivittäminen epäonnistui" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "Näppäimistön LED-tilan noutaminen epäonnistui: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "Näppäimenpainalluksella ei tuotettu näppäinkoodia" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "Ei toimintakoodia laajennetulle virtuaalinäppäimelle 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "Ei toimintakoodia virtuaalinäppäimelle 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Virheellinen toimintakoodi 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "Laajennetulle virtuaalinäppäimelle 0x%02x ei ole symbolia" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "Virtuaalinäppäimelle 0x%02x ei ole symbolia" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "Näppäinkoodille 0x%02x ei ole symbolia (nykyisessä tilassa)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "Näppäinkoodille %d ei ole symbolia (nykyisessä tilassa)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "Ka&tkaise yhteys" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "&Kokonäyttö" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "Pi&enennä" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "&Sovita ikkunan koko istuntoon" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "Lähetä %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Lähetä Ctrl-Alt-&Del" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "Vi&rkistä näyttö" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "&Valinnat..." -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "Yh&teyden tiedot..." -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "Tietoa &TigerVNC:stä..." -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "VNC-yhteyden tiedot" @@ -659,27 +657,27 @@ msgstr "VNC-yhteyden tiedot" msgid "Window is registered for touch instead of gestures" msgstr "Ikkuna on rekisteröity kosketuksille eikä eleille" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "Eleasetusten asettaminen epäonnistui (virhe 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "Eletietojen saaminen epäonnistui (virhe 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Virheellinen hiiren painike %d, ei ole välillä 1 – 7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Käsittelemätön näppäin 0x%x - ei voi luoda näppäimistötapahtumaa." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "X Input 2 -tapahtumapeitettä ei saada ikkunalle 0x%08lx" @@ -689,7 +687,7 @@ msgstr "X Input 2 -tapahtumapeitettä ei saada ikkunalle 0x%08lx" msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "Ikkunalla 0x%08lx ei ole X Input 2 -tapahtumapeitettä" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "Ikkunalla 0x%08lx on useampi X Input 2 -tapahtumapeite" @@ -700,7 +698,7 @@ msgid "Failure grabbing device %i" msgstr "Häiriö laitteeseen %i tarttumisessa" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "TigerVNC-katselin" @@ -729,120 +727,124 @@ msgstr "TigerVNC-katselimen yhteys macOS-koneeseen" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "TigerVNC-katselimen yhteys Windows-koneeseen" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "Parametrin nimi on liian suuri" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "Parametri on liian suuri" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Virheellinen muoto tai liian suuri arvo" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "Rekisteriavaimen luominen epäonnistui" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "Rekisteriavaimen sulkeminen epäonnistui" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "Tiedoston â€%s†tallentaminen epäonnistui: %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Tuntematon parametrityyppi" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "Tiedoston â€%s†poistaminen epäonnistui: %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "Rekisteriavaimen avaaminen epäonnistui" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Palvelinhistorian merkinnän %d lukeminen epäonnistui: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "Parametrin â€%s†lukeminen epäonnistui: %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "Asetushakemiston polkua ei saatu selvitettyä" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "Parametria ei voitu koodata" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "Asetustiedosto %s on virheellisessä muodossa" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Virheellinen muoto" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Tuntematon parametri" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "Saatiin viesti (0x%x) käsittelemättömälle ikkunalle" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "Virheellinen ikkuna 0x%08lx annettu osoittimeen tarttumiselle" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "Kosketuskäsittelimen luominen epäonnistui: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "Tapahtumakäsittelintä ei voitu liittää ikkunaan (virhe 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "X Input -tapahtuman tapahtumatietodon noutaminen epäonnistui" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "X Input -tapahtuma tuntemattomalle ikkunalle" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "X Input -laajennos ei ole saatavilla." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "X Input 2 (tai uudempi) ei ole saatavilla." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "X Input 2.2 (tai uudempi) ei ole saatavilla. Kosketuseleitä ei tueta." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -855,7 +857,7 @@ msgstr "" "Copyright © 1999-%d TigerVNC-ryhmä ja monet muut (ks. README.rst)\n" "Lisätietoja TigerVNC:stä osoitteessa https://www.tigervnc.org." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -866,15 +868,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "Tietoa &TigerVNC:stä" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "Sisäinen FLTK-virhe. Poistutaan." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -885,79 +887,102 @@ msgstr "" "\n" "Yritetäänkö uudelleenyhdistämistä?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Virhe käynnistettäessä uutta TigerVNC-katselinta: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Päättämissignaali %d on vastaanotettu. TigerVNC-katselin sulkeutuu." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "Kyllä" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "Sulje" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "Tietoja" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Piilota" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "Poistu" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "Palvelut" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Piilota muut" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "Näytä kaikki" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&Tiedosto" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "&Uusi yhteys" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "VNC-kotihakemiston luominen epäonnistui: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "FullScreenAllMonitors on vanhentunut, aseta FullScreenMode-asetukseksi â€all†sen sijaan" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "~/.vnc on vanhentunut, katso â€man vncviewer†sisältää lisätietoa korvaavista poluista." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "%%APPDATA%%\\vnc on vanhentunut, vaihda sijainniksi %%APPDATA%%\\TigerVNC." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "VNC-asetushakemiston luominen epäonnistui: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "VNC-tietohakemiston luominen epäonnistui: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "VNC-tilahakemiston luominen epäonnistui: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "Parametrit -listen ja -via ovat yhteensopimattomia" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Saapuvia yhteyksiä ei voi kuunnella" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Kuunnellaan portissa %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -972,6 +997,12 @@ msgstr "" msgid "Remote Desktop Viewer" msgstr "Etätyöpöytäkatselin" +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "VNC-katselin: Yhteysvalinnat" + +#~ msgid "Misc." +#~ msgstr "Sekalaiset" + #~ msgid "Failed to get monitor name because X11 RandR could not be found" #~ msgstr "Näytön nimen noutaminen epäonnistui, koska X11:n RandR:ää ei löytynyt" @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: tigervnc-1.12.90\n" +"Project-Id-Version: tigervnc-1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2023-08-17 00:00+0300\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-21 10:14+0300\n" "Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n" "Language-Team: Hebrew <heb-bugzap@hamakor.org.il>\n" "Language: he\n" @@ -17,19 +17,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n==2 ? 1 : n>10 && n%10==0 ? 2 : 3);\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.3.2\n" +"X-Generator: Poedit 3.4.2\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "מחובר לשקע %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "מחובר למ×רח %s פתחה %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -42,94 +42,94 @@ msgstr "" "‬\n" "â€â€«%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "×©× ×©×•×œ×—×Ÿ העבודה %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "מ×רח: %.80s פתחה: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "גודל: %d x %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "תצורת פיקסלי×: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(בררת המחדל של השרת %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "קידוד × ×“×¨×©: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "קידוד ×חרון: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "הערכת מהירות הקו: %d קסל״ש" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "גרסת פרוטוקול: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "שיטת ×בטחה: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "החיבור × ×§×˜×¢ מצד השרת ×‘×˜×¨× ×™×¦×™×¨×ª החיבור הר××©×•× ×™." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "‫SetDesktopSize × ×›×©×œ×”: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "‫SetColourMapEntries שגוי מהשרת!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "תפוקה %d קסל״ש - ×”×יכות תוחלף לכדי %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "‫תפוקה %d קסל״ש - צבע ×ž×œ× ×¤×¢×™×œ מעתה" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "‫תפוקה %d קסל״ש - צבע ×ž×œ× ×ž×•×©×‘×ª מעתה" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "× ×¢×©×” שימוש בתצורת ×¤×™×§×¡×œ×™× %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "×”×ž×ž×“×™× ×©×¦×•×™× ×• שגויי×!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "החלון מוקטן כדי להת××™× ×œ×’×•×“×œ המסך ×”× ×•×›×—×™" @@ -142,12 +142,12 @@ msgstr "Adjusting window size to avoid accidental full-screen request" msgid "Press %s to open the context menu" msgstr "לחיצה על %s תפתח ×ת תפריט ההקשר" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "לכידת המקלדת × ×›×©×œ×”" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "חושבה פריסת מסך שגויה לבקשת ×©×™× ×•×™ הגודל!" @@ -156,218 +156,218 @@ msgid "Invalid state for 3 button emulation" msgstr "מצב שגוי להדמיית 3 כפתורי×" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "קבלת הגדרות צג המערכת × ×›×©×œ×”" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "×¦×•×™× ×• הגדרות שגויות עבור %s" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "מפתח צג %d ×œ× ×§×™×™×" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "מפתח הצג ‚%s’ שגוי" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "התו ‚%c’ ××™× ×• צפוי" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "מציג VNC: ×פשרויות התחברות" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "×פשרויות TigerVNC" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "ביטול" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "×ישור" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "דחיסה" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "בחירה ×וטומטית" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "קידוד מועדף" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "רמת צבע" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "מל××”" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "×‘×™× ×•× ×™×ª" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "× ×ž×•×›×”" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "× ×ž×•×›×” מ×וד" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "רמת דחיבה מות×מת ×ישית:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "רמה (0=מהירה, 9=מיטבית)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "ל×פשר דחיסת JPEG:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "×יכות (0=עלובה, 9=מיטבית)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "×בטחה" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "×”×¦×¤× ×”" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "לל×" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "‫TLS ×¢× ××™×©×•×¨×™× ××œ×ž×•× ×™×™×" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "‫TLS ×¢× ×ישורי X509" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "× ×ª×™×‘ ל×ישורי X509 של רשות ×ישורי×" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "× ×ª×™×‘ לקובץ X509 CRL" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "×ימות" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "רגיל של VNC (בלתי מ×ובטח ×•×œ×œ× ×”×¦×¤× ×”)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "×©× ×ž×©×ª×ž×© וססמה (בלתי מ×ובטח ×•×œ×œ× ×”×¦×¤× ×”)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "קלט" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "להציג בלבד (×œ×”×ª×¢×œ× ×ž×”×¢×›×‘×¨ ומהמקלדת)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "עכבר" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "הדמיית כפתור עכבר ×מצעי" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "להציג × ×§×•×“×” כש×ין סמן" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "מקלדת" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "להעביר ×ת מקשי המערכת ישירות לשרת (מסך מל×)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "מקש תפריט" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "לוח גזירי×" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "לקבל לוח ×’×–×™×¨×™× ×ž×”×©×¨×ª" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "להגדיר ×’× ×ת הבחירה העיקרית" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "לשלוח לוח ×’×–×™×¨×™× ×œ×©×¨×ª" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "לשלוח ×ת הבחירה העיקרית כלוח כזירי×" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "תצוגה" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "מצב תצוגה" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "בחלון" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "מסך ×ž×œ× ×‘×¦×’ ×”× ×•×›×—×™" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "מסך ×ž×œ× ×¢×œ כל הצגי×" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "מסך ×ž×œ× ×‘×¦×’×™× × ×‘×—×¨×™×" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "×©×•× ×•×ª" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "משותף (×œ× ×œ× ×ª×§ ×¦×•×¤×™× ×חרי×)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "לבקש להתחבר מחדש כשיש תקלות חיבור" @@ -375,31 +375,31 @@ msgstr "לבקש להתחבר מחדש כשיש תקלות חיבור" msgid "VNC Viewer: Connection Details" msgstr "מציג VNC: פרטי התחברות" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "שרת VNC:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "×פשרויות…" -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "לטעון…" -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "לשמור בש×…" -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "על ×ודות…" -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "התחברות" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -412,15 +412,15 @@ msgstr "" "‬\n" "â€â€«%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "הגדרות TigerVNC†(‎*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "× × ×œ×‘×—×•×¨ קובץ הגדרות של TigerVNC" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -442,7 +442,7 @@ msgstr "לשמור ×ת הגדרות ×”Ö¾TigerVNC לקובץ" msgid "%s already exists. Do you want to overwrite?" msgstr "‫%s כבר קיי×. לשכתב עליו?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "ל×" @@ -489,31 +489,29 @@ msgstr "" "‬\n" "â€â€«%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "×œ× × ×™×ª×Ÿ לקבל ×ת × ×ª×™×‘ תיקיית הבית" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "×œ× × ×™×ª×Ÿ לקבל ×ת × ×ª×™×‘ תיקיית המצב" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "×œ× × ×™×ª×Ÿ לפתוח ×ת „%sâ€:†%s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "קרי×ת השורה %d בקובץ %s × ×›×©×œ×”: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "השורה ×רוכה מדי" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "פתיחת קובץ הססמה × ×›×©×œ×”" @@ -529,139 +527,139 @@ msgstr "החיבור מ×ובטח" msgid "This connection is not secure" msgstr "החיבור ××™× ×• מ×ובטח" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "×©× ×ž×©×ª×ž×©:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "ססמה:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "×”×ימות × ×›×©×œ" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "עדכון מצב × ×•×¨×™×ª המקלדת × ×›×©×œ: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "עדכון מצב × ×•×¨×™×ª המקלדת × ×›×©×œ: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "עדכון מצב × ×•×¨×™×ª המקלדת × ×›×©×œ" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "קבלת מצב × ×•×¨×™×ª המקלדת × ×›×©×œ×”: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "×œ× ×¦×•×™×Ÿ קוד מקש ×¢× ×œ×—×™×¦×” על מקש" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "×ין קוד סריקה למקש הווירטו×לי המורחב 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "‫×ין קוד סריקה למקש הווירטו×לי 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "קוד סריקה שגוי 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "×ין סימן למקש הווירטו×לי המורחב 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "×ין סימן למקש הווירטו×לי 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "×ין סימן לקוד המקש 0x%02x (במצב ×”× ×•×›×—×™)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "×ין סימן לקוד המקש %d (במצב ×”× ×•×›×—×™)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "&× ×™×ª×•×§" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "מ&סך מל×" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "מ&זעור" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "×©×™× ×•×™ &גודל החלון להפעלה" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "לשלוח %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "לשלוח Ctrl-Alt-&Del" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "&×¨×¢× ×•×Ÿ המסך" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "&×פשרויות…" -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "&פרטי ההתחברות…" -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "&על המציג TigerVNC…" -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "פרטי חיבור VNC" @@ -669,27 +667,27 @@ msgstr "פרטי חיבור VNC" msgid "Window is registered for touch instead of gestures" msgstr "החלון ×¨×©×•× ×œ×ž×’×¢ ×‘×ž×§×•× ×œ×ž×—×•×•×ª" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "קביעת הגדרות המחוות × ×›×©×œ×” (שגי××” 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "קבלת פרטי המחווה × ×›×©×œ×” (שגי××” 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "כפתור העכבר %d שגוי, חייב להיות מספר בין 1 ל־7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "מקש 0x%x ×œ× ×ž×˜×•×¤×œ - ×œ× × ×™×ª×Ÿ לייצר ×ירוע מקלדת." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "×œ× × ×™×ª×Ÿ לקבל מסכת ××™×¨×•×¢×™× ×©×œ X Input 2 לחלון 0x%08lx" @@ -699,7 +697,7 @@ msgstr "×œ× × ×™×ª×Ÿ לקבל מסכת ××™×¨×•×¢×™× ×©×œ X Input 2 לחלון msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "לחלון 0x%08lx ×ין מסכת ××™×¨×•×¢×™× ×©×œ X Input 2" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "לחלון 0x%08lx יש יותר ממסכת ××™×¨×•×¢×™× ×חת של X Input 2" @@ -710,7 +708,7 @@ msgid "Failure grabbing device %i" msgstr "לכידת ההתקן %i × ×›×©×œ×”" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "המציג TigerVNC" @@ -739,120 +737,124 @@ msgstr "התחברות מציג VNC ×œ×ž×›×•× ×ª macOS" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "חיבור מציג VNC ×œ×ž×›×•× ×ª Windows" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "×©× ×”×ž×©×ª× ×” גדול מדי" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "×”×ž×©×ª× ×” גדול מדי" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "תצורה שגויה ×ו שהערך גדול מדי" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "יצירת המפתח ברשומות × ×›×©×œ×”" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "סגירת מפתח הרשומות × ×›×©×œ×”" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "השמירה של „%sâ€ × ×›×©×œ×”: %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "סוג ×”×ž×©×ª× ×” ××™× ×• ידוע" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "ההסרה של „%sâ€ × ×›×©×œ×”: %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "פתיחת מפתח הרשומות × ×›×©×œ×”" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "קרי×ת רשומה %d בהיסטוריית השרת × ×›×©×œ×”: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "קרי×ת ×”×ž×©×ª× ×” „%sâ€ × ×›×©×œ×”: %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "×œ× × ×™×ª×Ÿ לקבל ×ת × ×ª×™×‘ תיקיית ההגדרות" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "×œ× × ×™×ª×Ÿ לקודד ×ת ×”×ž×©×ª× ×™×" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "×”×ž×‘× ×” של קובץ ההגדרות %s שגוי" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "תצורה שגויה" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "×ž×©×ª× ×” ×œ× ×™×“×•×¢" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "התקבלה הודעה (0x%x) לחלון ×œ× ×ž×˜×•×¤×œ" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "צוין חלון שגוי 0x%08lx ללכידת סמן" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "יצירת המטפל ב×ירועי מגע × ×›×©×œ×”: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "הצמדת מטפל ×”××™×¨×•×¢×™× ×œ×—×œ×•×Ÿ ×œ× ×¦×œ×—×” (שגי××” 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "קבלת × ×ª×•× ×™ ×”×ירוע של ×ירוע X Input × ×›×©×œ×”" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "×ירוע X Input לחלון בלתי מוכר" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "הרחבת X Input ××™× ×” ×–×ž×™× ×”." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "‫X Input 2 (ומעלה) ××™× ×• זמין." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "‫X Input 2.2 (ומעלה) ××™× ×• זמין. ×œ× ×ª×”×™×” תמיכה במחוות מגע." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -865,7 +867,7 @@ msgstr "" "‫כל הזכויות שמורות (C) 1999â€-%d לצוות TigerVNC ועוד ×¨×‘×™× ×•×˜×•×‘×™× (× ×™×ª×Ÿ לעיין ב־README.rst)\n" "‬‫למידע על TigerVNC מומלץ ×œ×¤× ×•×ª ×ל https://www.tigervnc.org." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -878,15 +880,15 @@ msgstr "" "‬\n" "â€â€«%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "על ×ודות המציג TigerVNC" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "שגי×ת FLTK ×¤× ×™×ž×™×ª. מתבצעת יצי××”." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -899,79 +901,102 @@ msgstr "" "‬\n" "â€«×œ× ×¡×•×ª להתחבר מחדש?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "שגי××” בהצגת מציג TigerVNC חדש: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "התקבל ×ות חיסול %d. מציג TigerVNC ×™×¡×ª×™×™× ×›×¢×ª." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "כן" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "סגירה" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "על ×ודות" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "להסתיר" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "יצי××”" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "שירותי×" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "להסתיר ×חרי×" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "להציג הכול" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&קובץ" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "&התחברות חדשה" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "×œ× × ×™×ª×Ÿ ליצור ×ת תיקיית הבית של VNC:†%s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "השימוש בהגדרה FullScreenAllMonitors הופסק, יש להגדיר ×ת FullScreenMode לערך ‚all’ במקו×" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "השימוש ב־‎~/.vnc הופסק, × × ×œ×¤× ×•×ª למדריך ‚man vncviewer’ ל×יתור ×”× ×ª×™×‘×™× ×©×™×© לעבור ×ליה×." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "השימוש ב־%%APPDATA%%\\vnc הופסק, × × ×œ×¢×‘×•×¨ ×œ×ž×§×•× %%APPDATA%%\\TigerVNC." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "×œ× × ×™×ª×Ÿ ליצור ×ת תיקיית ההגדרות של VNC:†%s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "×œ× × ×™×ª×Ÿ ליצור ×ת תיקיית ×”× ×ª×•× ×™× ×©×œ VNC:†%s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "×œ× × ×™×ª×Ÿ ליצור ×ת תיקיית המצה של VNC:†%s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "×”×ž×©×ª× ×™× â€Ž-listen ו־‎-via ×œ× ×ž×ª××™×ž×™× ×™×—×“" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "×œ× × ×™×ª×Ÿ לה×זין ×œ×—×™×‘×•×¨×™× × ×›× ×¡×™×" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "בה××–× ×” בפתחה %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -988,6 +1013,12 @@ msgstr "" msgid "Remote Desktop Viewer" msgstr "מציג ×©×•×œ×—× ×•×ª עבודה מרוחקי×" +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "מציג VNC: ×פשרויות התחברות" + +#~ msgid "Misc." +#~ msgstr "×©×•× ×•×ª" + #~ msgid "Failed to get monitor name because X11 RandR could not be found" #~ msgstr "קבלת ×©× ×”×¦×’ × ×›×©×œ×” כיוון ×©×œ× × ×™×ª×Ÿ ×œ×ž×¦×•× ×ת X11 RandR" @@ -1,14 +1,14 @@ # Indonesian translation of TigerVNC # Copyright (C) 2018 the TigerVNC Team (msgids) # This file is distributed under the same license as the tigervnc package. -# Andika Triwidada <andika@gmail.com>, 2018, 2020-2022. +# Andika Triwidada <andika@gmail.com>, 2018, 2020-2022, 2024. # msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-16 18:11+0700\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-21 11:05+0700\n" "Last-Translator: Andika Triwidada <andika@gmail.com>\n" "Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n" "Language: id\n" @@ -17,19 +17,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.2.2\n" +"X-Generator: Poedit 3.4.4\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "Terhubung ke soket %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" -msgstr "Terhubung ke host %s port%d" +msgstr "Terhubung ke host %s port %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -40,94 +40,94 @@ msgstr "" "\n" "%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Nama desktop: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Host: %.80s port: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Ukuran: %d × %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Format piksel: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(server baku %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "Pengkodean yang diminta: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "Pengkodean yang terakhir dipakai: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Estimasi kecepatan saluran: %d kbit/s" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "Versi protokol: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Metode keamanan: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "Koneksi diputus oleh server sebelum sesi dapat dijalin." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "SetDesktopSize gagal: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "SetColourMapEntries yang tidak valid dari server!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "Throughput %d kbit/s - mengubah ke kualitas %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "Throughput %d kbit/s - warna penuh sekarang difungsikan" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "Throughput %d kbit/s - warna penuh sekarang dinonaktifkan" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "Memakai format piksel %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "Geometri yang dinyatakan tidak valid!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "Mengurangi ukuran jendela agar pas di monitor saat ini" @@ -140,12 +140,12 @@ msgstr "Menyesuaikan ukuran jendela untuk menghindari permintaan layar penuh yan msgid "Press %s to open the context menu" msgstr "Tekan %s untuk membuka menu konteks" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "Kegagalan dalam mengambil alih papan ketik" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "Tata letak layar yang tidak valid dihitung untuk permintaan ubah ukuran!" @@ -154,218 +154,218 @@ msgid "Invalid state for 3 button emulation" msgstr "Keadaan yang tidak valid untuk emulasi 3 tombol" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "Gagal mendapatkan konfigurasi monitor sistem" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "Konfigurasi yang tidak valid dinyatakan untuk %s" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "Indeks monitor %d tidak ada" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Indeks monitor tidak valid '%s'" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "Karakter tak terduga '%c'" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "Penampil VNC: Opsi Sambungan" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "Opsi TigerVNC" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "Batal" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "OK" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "Kompresi" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Pilih otomatis" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "Pengkodean yang disukai" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "Tingkat warna" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Penuh" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "Sedang" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "Rendah" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "Sangat rendah" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Tingkat kompresi ubahan:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "tingkat (0=buruk, 9=terbaik)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "Izinkan kompresi JPEG:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "kualitas (0=buruk, 9=terbaik)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "Keamanan" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "Enkripsi" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Nihil" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS dengan sertifikat anonim" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS dengan sertifikat X509" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "Path ke sertifikat CA X509" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "Path ke berkas CRL X509" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "Otentikasi" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "VNC standar (tidak aman tanpa enkripsi)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Nama pengguna dan kata sandi (tidak aman tanpa enkripsi)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "Masukan" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Hanya melihat (mengabaikan tetikus dan papan ketik)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "Tetikus" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Emulasikan tombol tengah tetikus" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "Tampilkan titik saat tidak ada kursor" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Papan Tik" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "Lewatkan tombol-tombol sistem secara langsung ke server (layar penuh)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Tombol menu" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Papan Klip" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "Terima papan klip dari server" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "Juga atur pemilihan primer" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "Kirim papan klip ke server" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "Kirim pilihan primer sebagai papan klip" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "Tampilan" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Mode tampilan" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "Berjendela" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "Layar penuh pada monitor saat ini" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "Layar penuh di semua monitor" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "Layar penuh pada monitor yang dipilih" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "Rupa-rupa" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "Bersama (jangan putuskan pemirsa lain)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "Minta untuk menyambungkan kembali saat kesalahan koneksi" @@ -373,31 +373,31 @@ msgstr "Minta untuk menyambungkan kembali saat kesalahan koneksi" msgid "VNC Viewer: Connection Details" msgstr "Penampil VNC: Rincian Sambungan" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "Server VNC:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "Opsi..." -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "Muat..." -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Simpan Sebagai..." -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "Tentang..." -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "Sambung" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -408,15 +408,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "Konfigurasi TigerVNC (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "Pilih berkas konfigurasi TigerVNC" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -436,7 +436,7 @@ msgstr "Simpan konfigurasi TigerVNC ke berkas" msgid "%s already exists. Do you want to overwrite?" msgstr "%s sudah ada. Apakah Anda ingin menimpa?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "Tidak" @@ -477,31 +477,29 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "Tidak bisa mendapatkan path direktori rumah" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "Tidak bisa mendapatkan path direktori keadaan" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "Tak bisa membuka %s: %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "Gagal membaca baris %d dalam berkas %s: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "Baris terlalu panjang" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "Membuka berkas kata sandi gagal" @@ -517,139 +515,139 @@ msgstr "Sambungan ini aman" msgid "This connection is not secure" msgstr "Sambungan ini tidak aman" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "Nama Pengguna:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Kata Sandi:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Autentikasi dibatalkan" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "Gagal memperbarui keadaan LED papan tik: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "Gagal memperbarui keadaan LED papan tik: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "Gagal memperbarui keadaan LED papan tik" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "Gagal mendapatkan keadaan LED papan tik: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "Tidak ada kode tombol yang dinyatakan saat penekanan tombol" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "Tidak ada kode pindai untuk tombol virtual yang diperluas 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "Tidak ada kode pindai untuk tombol virtual 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Kode pindai tidak valid 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "Tidak ada simbol untuk tombol virtual yang diperluas 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "Tidak ada simbol untuk tombol virtual 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "Tidak ada simbol untuk kode tombol 0x%02x (dalam keadaan saat ini)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "Tidak ada simbol untuk kode tombol %d (dalam keadaan saat ini)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "Putuskan &Sambungan" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "Layar &Penuh" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "Mi&nimalkan" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "Ubah ukuran &jendela ke sesi" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "Kirim %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Kirim Ctrl-Alt-&Del" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "Sega&rkan layar" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "&Opsi..." -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "&Info koneksi..." -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "Tentang penampil &TigerVNC..." -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "Informasi sambungan VNC" @@ -657,27 +655,27 @@ msgstr "Informasi sambungan VNC" msgid "Window is registered for touch instead of gestures" msgstr "Jendela terdaftar untuk sentuhan, bukan gestur" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "Gagal mengatur konfigurasi gestur (galat 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "Gagal mendapatkan informasi gestur (error 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Tombol tetikus yang tidak valid %d, harus angka antara 1 dan 7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Tombol 0x%x yang tidak ditangani - tidak dapat menghasilkan kejadian papan ketik." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "Tidak bisa mendapatkan mask kejadian X Input 2 untuk jendela 0x%08lx" @@ -687,7 +685,7 @@ msgstr "Tidak bisa mendapatkan mask kejadian X Input 2 untuk jendela 0x%08lx" msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "Jendela 0x%08lx tidak memiliki mask kejadian X Input 2" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "Window 0x%08lx memiliki lebih dari satu mask kejadian X Input 2" @@ -698,7 +696,7 @@ msgid "Failure grabbing device %i" msgstr "Kegagalan saat meng-grab perangkat %i" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "Penampil TigerVNC" @@ -727,120 +725,124 @@ msgstr "Koneksi Penampil TigerVNC ke mesin macOS" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "Koneksi Penampil TigerVNC ke mesin Windows" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "Nama parameter terlalu besar" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "Parameter terlalu besar" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Format tidak valid atau nilai terlalu besar" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "Gagal membuat kunci registry" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "Gagal menutup kunci registry" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "Gagal menyimpan \"%s\": %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Tipe parameter tidak dikenal" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "Gagal menghapus \"%s\": %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "Gagal membuka kunci registry" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Gagal membaca entri riwayat server %d: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "Gagal membaca parameter \"%s\": %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "Tidak bisa mendapatkan path direktori konfig" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "Tak bisa meng-enkode parameter" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "Berkas konfigurasi %s berada dalam format yang tidak valid" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Format tidak valid" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Parameter tidak dikenal" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "Mendapat pesan (0x%x) untuk jendela yang tidak tertangani" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "Jendela tidak valid 0x%08lx ditentukan untuk pengambilan penunjuk" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "Gagal membuat penangan sentuh: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "Tak bisa melampirkan penangan kejadian ke jendela (galat 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "Gagal mendapatkan data kejadian untuk kejadian X Input" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "Kejadian X Input untuk jendela yang tidak diketahui" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "Ekstensi X Input tidak tersedia." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "X Input 2 (atau yang lebih baru) tidak tersedia." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "X Input 2.2 (atau yang lebih baru) tidak tersedia. Gestur sentuh tidak akan didukung." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -853,7 +855,7 @@ msgstr "" "Hak Cipta (C) 1999-%d Tim TigerVNC dan banyak lainnya (lihat README.rst)\n" "Lihat https://www.tigervnc.org untuk informasi tentang TigerVNC." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -864,15 +866,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "Tentang Penampil &TigerVNC" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "Kesalahan FLTK internal. Keluar." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -883,79 +885,102 @@ msgstr "" "\n" "Mencoba untuk menyambung kembali?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Kesalahan saat memulai Penampil TigerVNC baru: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Sinyal pengakhiran %d telah diterima. Penampil TigerVNC sekarang akan keluar." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "Ya" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "Tutup" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "Tentang" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Sembunyikan" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "Keluar" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "Layanan" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Sembunyikan Lainnya" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "Tampilkan Semua" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&Berkas" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "Ko&neksi Baru" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "Tidak bisa membuat direktori rumah VNC: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "FullScreenAllMonitors sudah usang, atur FullScreenMode ke 'all' sebagai gantinya" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "~/.vnc usang, harap baca 'man vncviewer' untuk migrasi ke path mana." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "%%APPDATA%%\\vnc usang, harap beralih ke lokasi %%APPDATA%%\\TigerVNC." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "Tidak bisa membuat direktori konfig VNC: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "Tidak bisa membuat direktori data VNC: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "Tidak bisa membuat direktori keadaan VNC: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "Parameter -listen dan -via tidak kompatibel" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Tidak bisa mendengarkan koneksi masuk" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Mendengarkan pada port %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -1,21 +1,22 @@ # Mesajele în limba română pentru pachetul tigervnc. -# Copyright (C) 2022 the TigerVNC Team (msgids) +# Copyright © 2022, 2024 the TigerVNC Team (msgids) # This file is distributed under the same license as the tigervnc package. -# Copyright (C) 2022 TigerVNC Team and many others (see README.rst). +# Copyright © 2022, 2024 TigerVNC Team and many others (see README.rst). # -# Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>, 2022. +# Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>, 2022, 2024. # # Cronologia traducerii fiÈ™ierului „tigervncâ€: # Traducerea iniÈ›ială, făcută de R-GC, pentru versiunea tigervnc 1.11.90. -# Actualizare a traducerii pentru versiunea 1.12.90, făcută de R-GC, 2022. +# Actualizare a traducerii pentru versiunea 1.12.90, făcută de R-GC, dec-2022. +# Actualizare a traducerii pentru versiunea 1.13.90, făcută de R-GC, iun-2024. # Actualizare a traducerii pentru versiunea Y, făcută de X, Z(anul). # msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-16 11:59+0100\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-21 01:03+0200\n" "Last-Translator: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>\n" "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n" "Language: ro\n" @@ -24,19 +25,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n==0 || (n!=1 && n%100>=1 && n%100<=19) ? 1 : 2);\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Lokalize 22.08.3\n" +"X-Generator: Poedit 3.4.3\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "Conectat la soclul %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "Conectat la gazda %s portul %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -77,37 +78,37 @@ msgstr "" # È™i nici bineînÈ›eles „corespondentul†# românesc de, Remote Desktop = # Desktop la distanță -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Numele biroului: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Gazdă: %.80s port: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Dimensiune: %d x %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Format pixel: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(server implicit %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "Codificarea solicitată: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "Ultima codificare utilizată: %s" @@ -118,31 +119,31 @@ msgstr "Ultima codificare utilizată: %s" # linieiâ€(legăturii/circuitului/firului)†# === # Ok, sugestie aplicată -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Viteza estimată a conexiunii: %d kbit/s" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "Versiunea protocolului: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Metoda de securitate: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "Conexiunea a fost întreruptă de server înainte ca sesiunea să poată fi stabilită." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "FuncÈ›ia SetDesktopSize() a eÈ™uat: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "Valoare SetColourMapEntries nevalidă de la server!" @@ -160,31 +161,31 @@ msgstr "Valoare SetColourMapEntries nevalidă de la server!" # // If the bandwidth drops below 256 Kbps, we switch to palette mode. # // # Note: The system here is fairly arbitrary and should be replaced with something more intelligent at the server end.†-#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "Lățimea de bandă este de %d kbit/s - se trece la calitatea %d de JPEG" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "Lățimea de bandă este de %d kbit/s - nivelul de profunditate al culorii → «deplin», este acum activat acum" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "Lățimea de bandă este de %d kbit/s - nivelul de profunditate al culorii → «deplin», este dezactivat acum" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "Se utilizează formatul de pixel %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "Geometria specificată nu este validă!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "Se reduce dimensiunea ferestrei pentru a se potrivi pe monitorul actual" @@ -197,12 +198,12 @@ msgstr "Se ajustează dimensiunea ferestrei pentru a evita solicitarea accidenta msgid "Press %s to open the context menu" msgstr "ApăsaÈ›i %s pentru a deschide meniul contextual" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "Eroare la preluarea tastaturii" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "Aspect nevalid al ecranului calculat pentru cererea de redimensionare!" @@ -211,211 +212,211 @@ msgid "Invalid state for 3 button emulation" msgstr "Stare nevalidă pentru emularea cu trei butoane" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "Nu s-a putut obÈ›ine configuraÈ›ia monitorului sistemului" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "ConfiguraÈ›ie nevalidă specificată pentru %s" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "Indexul de monitor %d nu există" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Index de monitor nevalid „%sâ€" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "Caracter neaÈ™teptat „%câ€" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "Vizualizator VNC: OpÈ›iuni de conectare" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "OpÈ›iuni TigerVNC" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "Anulare" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "Ok" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "Comprimare" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Selectare automată" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "Codificarea preferată" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "Nivelul de profunditate al culorii" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Deplin" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "Mediu" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "Scăzut" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "Foarte scăzut" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Nivel de comprimare personalizat:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "nivel (0 = rapid, 9 = cel mai bun)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "Permite comprimarea JPEG:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "calitate (0 = redusă, 9 = cea mai bună)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "Securitate" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "Criptare" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Niciuna" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS cu certificate anonime" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS cu certificate X509" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" -msgstr "Calea către certificatul CA X509" +msgstr "Ruta către certificatul CA X509" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" -msgstr "Calea către fiÈ™ierul CRL X509" +msgstr "Ruta către fiÈ™ierul CRL X509" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "Autentificare" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "VNC standard (nesigur fără criptare)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Nume de utilizator È™i parolă (nesigure fără criptare)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "Intrare" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Numai vizualizare (se ignoră mouse-ul È™i tastatura)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "Mouse" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Emulează butonul din mijloc al mouse-ului" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "AfiÈ™ează un punct când nu există cursor al mouse-ului" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Tastatură" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "Pasează tastele sistemului direct către server (ecran complet)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Tasta de meniu" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Clipboard" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "Acceptă clipboard-ul de pe server" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "StabileÈ™te, de asemenea, selecÈ›ia principală" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "Trimite clipboard-ul la server" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "Trimite selecÈ›ia principală ca clipboard" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "AfiÈ™are" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Modul de afiÈ™are" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "ÃŽn fereastră" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "Ecran complet pe monitorul actual" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "Ecran complet pe toate monitoare" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "Ecran complet pe monitorul(ele) selectat(e)" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "Diverse" # R-GC, scrie: @@ -423,11 +424,11 @@ msgstr "Diverse" # „→ lipseÈ™te închiderea parantezei†# === # corectare făcută -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "Partajat (nu deconectează alte vizualizatoare)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "Solicită reconectarea în cazul erorilor de conectare" @@ -435,31 +436,31 @@ msgstr "Solicită reconectarea în cazul erorilor de conectare" msgid "VNC Viewer: Connection Details" msgstr "Vizualizator VNC: Detalii de conectare" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "Serverul VNC:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "OpÈ›iuni..." -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "ÃŽncărcare..." -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Salvează ca..." -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "Despre..." -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "Conectare" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -470,15 +471,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "ConfiguraÈ›ia TigerVNC (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "SelectaÈ›i un fiÈ™ier de configurare TigerVNC" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -498,7 +499,7 @@ msgstr "SalvaÈ›i configuraÈ›ia TigerVNC în fiÈ™ier" msgid "%s already exists. Do you want to overwrite?" msgstr "%s există deja. DoriÈ›i să-l suprascrieÈ›i?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "Nu" @@ -539,46 +540,29 @@ msgstr "" "\n" "%s" -# R-GC, scrie: -# după revizarea fiÈ™ierului,DȘ, spune: -# „→ în mare parte se numeÈ™te „dosarul/directorul personal†în -# distribuÈ›iile de Gnu / Linux†-# === -# Cred că trebuie să facem distincÈ›ie, între -# numele unui lucru, È™i descrierea sa; în -# cazul de față: -# nume → descriere -# Directorul Acasă → directorul personal (al -# utilizatorului) -# Și să nu uităm, arborele de directoare: -# . /Acasă la X (directorul personal al lui X) -# /home/Acasă la Y (------------------||---------------- Y) -# . /Acasă la Z (------------------||---------------- Z) -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "Nu s-a putut obÈ›ine calea directorului „Acasăâ€" - -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "Nu s-a putut obÈ›ine ruta directorului de stare" + +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "Nu s-a putut deschide „%sâ€: %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "Nu s-a putut citi linia %d din fiÈ™ierul %s: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "Linia este prea lungă" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "Deschiderea fiÈ™ierului cu parole a eÈ™uat" @@ -594,139 +578,139 @@ msgstr "Această conexiune este sigură" msgid "This connection is not secure" msgstr "Această conexiune nu este sigură" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "Numele utilizatorului:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Parola:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Autentificarea a fost anulată" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "Nu s-a putut actualiza starea LED-ului tastaturii: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "Nu s-a putut actualiza starea LED-ului tastaturii: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "Nu s-a putut actualiza starea LED-ului tastaturii" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "Nu s-a putut obÈ›ine starea LED-ului tastaturii: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "Nu a fost specificat niciun cod de tastă la apăsarea tastei" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "Niciun cod de scanare pentru tasta virtuală extinsă 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "Niciun cod de scanare pentru tasta virtuală 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Cod de scanare nevalid 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "Niciun simbol pentru tasta virtuală extinsă 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "Niciun simbol pentru tasta virtuală 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "Niciun simbol pentru codul tastei 0x%02x (în starea curentă)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "Niciun simbol pentru codul tastei %d (în starea curentă)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" -msgstr "De&conectare" +msgid "Disconn&ect" +msgstr "Deco&nectare" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "&Ecran complet" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "Minimi&zare" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "Redimensionează &fereastra conform sesiunii" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "Trimite %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Trimite Ctrl-Alt-&Del" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "&Reîmprospătează ecranul" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "&OpÈ›iuni..." -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "&InformaÈ›ii despre conexiune..." -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "Despre vizualizatorul &TigerVNC..." -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "InformaÈ›ii despre conexiunea VNC" @@ -734,27 +718,27 @@ msgstr "InformaÈ›ii despre conexiunea VNC" msgid "Window is registered for touch instead of gestures" msgstr "Fereastra este înregistrată pentru atingere în loc de gesturi" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "Nu s-a putut definii configuraÈ›ia gesturilor (eroare 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "Nu s-au putut obÈ›ine informaÈ›ii despre gesturi (eroare 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Butonul mouse-ului %d nu este valid, trebuie să fie un număr între 1 È™i 7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Tasta 0x%x necunoscută - nu se poate genera un eveniment de la tastatură." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "Nu se poate obÈ›ine masca de eveniment X Input 2 pentru fereastra 0x%08lx" @@ -764,7 +748,7 @@ msgstr "Nu se poate obÈ›ine masca de eveniment X Input 2 pentru fereastra 0x%08l msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "Fereastra 0x%08lx nu are mască de eveniment X Input 2" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "Fereastra 0x%08lx are mai mult de o mască de eveniment X Input 2" @@ -775,7 +759,7 @@ msgid "Failure grabbing device %i" msgstr "Eroare la preluarea dispozitivului %i" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "Vizualizator TigerVNC" @@ -786,7 +770,7 @@ msgstr "Se conectează la serverul VNC È™i afiÈ™ează biroul de la distanță" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:17 msgid "Virtual Network Computing (VNC) is a remote display system that allows you to view and interact with a virtual desktop environment running on another computer on the network. Using VNC, you can run graphical applications on a remote machine and send only the display from these applications to your local device. This package contains a client which will enable you to connect to other desktops running a VNC server. VNC is platform-independent and supports various operating systems and architectures as both servers and clients." -msgstr "Calculatoare în ReÈ›ea Virtuală ⟶ (Virtual Network Computing) «VNC» este un sistem de afiÈ™are la distanță care vă permite să vizualizaÈ›i È™i să interacÈ›ionaÈ›i cu un mediu de birou virtual care rulează pe un alt computer din reÈ›ea. Folosind VNC, puteÈ›i rula aplicaÈ›ii grafice pe o maÈ™ină de la distanță È™i puteÈ›i trimite numai afiÈ™area din aceste aplicaÈ›ii pe dispozitivul local. Acest pachet conÈ›ine un client care vă va permite să vă conectaÈ›i la alte calculatoare care rulează un server VNC. VNC este independent de platformă È™i acceptă diverse sisteme de operare È™i arhitecturi atât ca servere, cât È™i ca clienÈ›i." +msgstr "Calculatoare în reÈ›ea virtuală ⟶ (Virtual Network Computing) «VNC» este un sistem de afiÈ™are la distanță care vă permite să vizualizaÈ›i È™i să interacÈ›ionaÈ›i cu un mediu de birou virtual care rulează pe un alt computer din reÈ›ea. Folosind VNC, puteÈ›i rula aplicaÈ›ii grafice pe o maÈ™ină de la distanță È™i puteÈ›i trimite numai afiÈ™area din aceste aplicaÈ›ii pe dispozitivul local. Acest pachet conÈ›ine un client care vă va permite să vă conectaÈ›i la alte calculatoare care rulează un server VNC. VNC este independent de platformă È™i acceptă diverse sisteme de operare È™i arhitecturi atât ca servere, cât È™i ca clienÈ›i." #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:23 msgid "TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code bases. TigerVNC started as a next-generation development effort for TightVNC on Unix and Linux platforms, but it split from its parent project in early 2009 so that TightVNC could focus on Windows platforms. TigerVNC supports a variant of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo JPEG codec." @@ -804,116 +788,120 @@ msgstr "Conexiune a vizualizatorului TigerVNC la o maÈ™ină «macOS»" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "Conexiune a vizualizatorului TigerVNC la o maÈ™ină «Windows»" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "Numele parametrului este prea lung" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "Parametrul este prea lung" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Format nevalid sau valoare prea mare" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "Nu s-a putut crea cheia de registru" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" -msgstr "Cheia de registru a eÈ™uat" +msgstr "Nu s-a putut închide cheia de registru" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "Nu s-a putut salva „%sâ€: %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Tip de parametru necunoscut" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "Nu s-a putut elimina „%sâ€: %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "Nu s-a putut deschide cheia de registru" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Nu s-a putut citi intrarea din istoricul serverului %d: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "Nu s-a putut citi parametrul „%sâ€: %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "Nu s-a putut obÈ›ine ruta directorului de configurare" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "Nu s-a putut codifica parametrul" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "FiÈ™ierul de configurare %s este într-un format nevalid" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Format nevalid" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Parametru necunoscut" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "S-a primit mesajul (0x%x) pentru o fereastră negestionată" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "Fereastra 0x%08lx nevalidă a fost specificată pentru preluarea indicatorului mouse-ului" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "Nu s-a putut crea gestionarul de atingere: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "Nu s-a putut ataÈ™a gestionarul de evenimente la fereastră (eroare 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "Nu s-au putut obÈ›ine datele despre eveniment pentru evenimentul X Input" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "Eveniment X Input pentru o fereastră necunoscută" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "Extensia X Input nu este disponibilă." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "X Input 2 (sau mai nouă) nu este disponibilă." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "X Input 2 (sau mai nouă) nu este disponibilă. Gesturile tactile nu vor fi acceptate." @@ -928,7 +916,7 @@ msgstr "X Input 2 (sau mai nouă) nu este disponibilă. Gesturile tactile nu vor # echivalentul unui almanah sau al unei cărÈ›i, # È™i alta este să-È›i arunci privirea pe-o listă, # deobicei mai mică decît o pagină -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -941,7 +929,7 @@ msgstr "" "Drepturi de autor © 1999-%d Echipa TigerVNC È™i mulÈ›i alÈ›ii (vedeÈ›i fiÈ™ierul README.rst)\n" "ConsultaÈ›i https://www.tigervnc.org pentru informaÈ›ii despre TigerVNC." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -952,15 +940,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "Despre vizualizatorul TigerVNC" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "Eroare FLTK internă. Se finalizează." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -971,79 +959,102 @@ msgstr "" "\n" "ÃŽncercaÈ›i să vă reconectaÈ›i?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Eroare la pornirea noului vizualizator TigerVNC: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Semnalul de terminare %d a fost primit. Vizualizatorul TigerVNC se va închide acum." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "Da" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "ÃŽnchide" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "Despre" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Ascunde" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "IeÈ™ire" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "Servicii" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Ascunde pe celelalte" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "AfiÈ™ează pe toate" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&FiÅŸier" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "Conexiune &nouă" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "Nu s-a putut crea directorul VNC „acasăâ€: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "FullScreenAllMonitors este învechit, setaÈ›i în schimb FullScreenMode la „allâ€" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "~/.vnc este depreciat, vă rugăm să consultaÈ›i «man vncviewer» pentru căile de migrare." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "%%APPDATA%%\\vnc este depreciat, vă rugăm să treceÈ›i la locaÈ›ia %%APPDATA%%\\TigerVNC." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "Nu s-a putut crea directorul de configurare VNC: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "Nu s-a putut crea directorul de date VNC: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "Nu s-a putut crea directorul de stare VNC: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "Parametrii „-listen†și „-via†sunt incompatibili" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Nu se poate asculta pentru conexiunile primite" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Se ascultă pe portul %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -1058,6 +1069,12 @@ msgstr "" msgid "Remote Desktop Viewer" msgstr "Vizualizator pentru birou la distanță" +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "Vizualizator VNC: OpÈ›iuni de conectare" + +#~ msgid "Misc." +#~ msgstr "Diverse" + #~ msgid "Failed to get monitor name because X11 RandR could not be found" #~ msgstr "Nu s-a putut obÈ›ine numele monitorului deoarece X11 RandR nu a putut fi găsit" @@ -1,755 +1,1031 @@ -# Copyright (C) 2011 TigerVNC Team +# Slovak translation of TigerVNC +# Copyright (C) 2024 the TigerVNC Team (msgids) +# This file is distributed under the same license as the tigervnc package. +# Jozef Riha <jose1711@gmail.com>, 2008. +# Marián Haburaj <hajkomajko5@gmail.com>, 2024. +# msgid "" msgstr "" -"Project-Id-Version: TigerVNC 0.0.91\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2014-09-22 11:15+0000\n" -"PO-Revision-Date: 2008-11-30 21:34+0100\n" -"Last-Translator: Jozef Riha <jose1711@gmail.com>\n" -"Language-Team: Slovak <sk@li.org>\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-25 11:04+0200\n" +"Last-Translator: Marián Haburaj <hajkomajko5@gmail.com>\n" +"Language-Team: Slovak <sk-i18n@lists.linux.sk>\n" "Language: sk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.4.3\n" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:99 #, c-format -msgid "(server default %s)" +msgid "Connected to socket %s" +msgstr "Pripojené na socket %s" + +#: vncviewer/CConn.cxx:106 +#, c-format +msgid "Connected to host %s port %d" +msgstr "Pripojené na stroj %s port %d" + +#: vncviewer/CConn.cxx:111 +#, c-format +msgid "" +"Failed to connect to \"%s\":\n" +"\n" +"%s" msgstr "" +"Nepodarilo sa pripojiÅ¥ k \"%s\":\n" +"\n" +"%s" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:227 -#, fuzzy -msgid "About" -msgstr "O programe..." +#: vncviewer/CConn.cxx:155 +#, c-format +msgid "Desktop name: %.80s" +msgstr "Názov plochy: %.80s" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:103 -msgid "About TigerVNC Viewer" -msgstr "O aplikácià VNC Viewer" +#: vncviewer/CConn.cxx:160 +#, c-format +msgid "Host: %.80s port: %d" +msgstr "Stroj: %.80s port: %d" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1086 -#, fuzzy -msgid "About TigerVNC viewer..." -msgstr "O aplikácià VNC Viewer" +#: vncviewer/CConn.cxx:165 +#, c-format +msgid "Size: %d x %d" +msgstr "VeľkosÅ¥: %d x %d" -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:86 -msgid "About..." -msgstr "O programe..." +#: vncviewer/CConn.cxx:173 +#, c-format +msgid "Pixel format: %s" +msgstr "Formát pixelu: %s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:704 -msgid "Accept clipboard from server" -msgstr "AkceptovaÅ¥ schránku zo servera" +#: vncviewer/CConn.cxx:180 +#, c-format +msgid "(server default %s)" +msgstr "(predvolené serveru %s)" -#: /home/ossman/devel/tigervnc/vncviewer/DesktopWindow.cxx:327 -msgid "Adjusting window size to avoid accidental full screen request" -msgstr "" +#: vncviewer/CConn.cxx:185 +#, c-format +msgid "Requested encoding: %s" +msgstr "Požadované kódovanie: %s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:563 -msgid "Allow JPEG compression:" -msgstr "PovoliÅ¥ kompresiu JPEG:" +#: vncviewer/CConn.cxx:190 +#, c-format +msgid "Last used encoding: %s" +msgstr "Naposledy použité kódovanie: %s" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1070 -msgid "Alt" -msgstr "Alt" +#: vncviewer/CConn.cxx:195 +#, c-format +msgid "Line speed estimate: %d kbit/s" +msgstr "Predpokladaná rýchlosÅ¥ linky: %d kbit/s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:648 -#, fuzzy -msgid "Authentication" -msgstr "VNC autorizácia" +#: vncviewer/CConn.cxx:200 +#, c-format +msgid "Protocol version: %d.%d" +msgstr "Verzia protokolu: %d.%d" -#: /home/ossman/devel/tigervnc/vncviewer/UserDialog.cxx:89 -#, fuzzy -msgid "Authentication cancelled" -msgstr "VNC autorizácia" +#: vncviewer/CConn.cxx:205 +#, c-format +msgid "Security method: %s" +msgstr "Metóda zabezpeÄenia: %s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:437 -msgid "Auto select" -msgstr "Automatický výber" +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 +msgid "The connection was dropped by the server before the session could be established." +msgstr "Spojenie bolo preruÅ¡ené serverom skôr, než mohla byÅ¥ nadviazaná relácia." -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:651 +#: vncviewer/CConn.cxx:326 #, c-format -msgid "Bad Name/Value pair on line: %d in file: %s" -msgstr "" +msgid "SetDesktopSize failed: %d" +msgstr "Požiadavka SetDesktopSize zlyhala: %d" -#: /home/ossman/devel/tigervnc/vncviewer/Win32PixelBuffer.cxx:92 -msgid "BitBlt failed" -msgstr "" +#: vncviewer/CConn.cxx:399 +msgid "Invalid SetColourMapEntries from server!" +msgstr "Neplatná správa SetColourMapEntries od serveru!" -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:91 -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:221 -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:83 -msgid "Cancel" -msgstr "ZruÅ¡iÅ¥" +#: vncviewer/CConn.cxx:507 +#, c-format +msgid "Throughput %d kbit/s - changing to quality %d" +msgstr "Dátový tok %d kbit/s - menÃm na kvalitu %d" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:116 -msgid "CleanupSignalHandler called" -msgstr "" +#: vncviewer/CConn.cxx:529 +#, c-format +msgid "Throughput %d kbit/s - full color is now enabled" +msgstr "Dátový tok %d kbit/s - plné farby sú teraz zapnuté" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:222 -msgid "Close" -msgstr "" +#: vncviewer/CConn.cxx:532 +#, c-format +msgid "Throughput %d kbit/s - full color is now disabled" +msgstr "Dátový tok %d kbit/s - plné farby sú teraz vypnuté" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:499 -msgid "Color level" -msgstr "" +#: vncviewer/CConn.cxx:558 +#, c-format +msgid "Using pixel format %s" +msgstr "PoužÃvaný formát pixelu %s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:421 -#, fuzzy -msgid "Compression" -msgstr "Vlastný stupeň kompresie:" +#: vncviewer/DesktopWindow.cxx:146 +msgid "Invalid geometry specified!" +msgstr "Zadaná neplatná geometria!" -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:96 -msgid "Connect" -msgstr "" +#: vncviewer/DesktopWindow.cxx:167 +msgid "Reducing window size to fit on current monitor" +msgstr "ZmenÅ¡ovanie veľkosti okna, aby sa zmestilo na súÄasný monitor" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1085 -msgid "Connection info..." -msgstr "Informácie o pripojenÃ..." +#: vncviewer/DesktopWindow.cxx:648 +msgid "Adjusting window size to avoid accidental full-screen request" +msgstr "Upravovanie veľkosti okna na vyhnutie sa náhodným požiadavkám na celú obrazovku" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:362 -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:404 +#: vncviewer/DesktopWindow.cxx:696 #, c-format -msgid "" -"Could not convert the parameter-name %s to wchar_t* when reading from the " -"Registry, the buffersize is to small." -msgstr "" +msgid "Press %s to open the context menu" +msgstr "StlaÄ %s na otvorenie kontextovej ponuky" + +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 +msgid "Failure grabbing keyboard" +msgstr "Chyba pri preberanà klávesnice" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:302 -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:340 +#: vncviewer/DesktopWindow.cxx:1415 +msgid "Invalid screen layout computed for resize request!" +msgstr "VypoÄÃtané neplatné rozloženie obrazovky pre požiadavku na zmenu veľkosti!" + +#: vncviewer/EmulateMB.cxx:226 vncviewer/EmulateMB.cxx:289 +msgid "Invalid state for 3 button emulation" +msgstr "Neplatný stav pre 3-tlaÄidlovú emuláciu" + +#: vncviewer/MonitorIndicesParameter.cxx:52 +#: vncviewer/MonitorIndicesParameter.cxx:102 +msgid "Failed to get system monitor configuration" +msgstr "Nepodarilo sa zÃskaÅ¥ nastavenie monitora systému" + +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format -msgid "" -"Could not convert the parameter-name %s to wchar_t* when writing to the " -"Registry, the buffersize is to small." -msgstr "" +msgid "Invalid configuration specified for %s" +msgstr "Zadané neplatné nastavenie pre %s" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:318 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format -msgid "" -"Could not convert the parameter-value %s to wchar_t* when writing to the " -"Registry, the buffersize is to small." -msgstr "" +msgid "Monitor index %d does not exist" +msgstr "Monitor s ÄÃslom %d neexistuje" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:381 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format -msgid "" -"Could not convert the parameter-value for %s to utf8 char* when reading from " -"the Registry, the buffer dest is to small." -msgstr "" +msgid "Invalid monitor index '%s'" +msgstr "Neplatné ÄÃslo monitoru \"%s\"" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:256 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format -msgid "Could not create VNC home directory: %s." -msgstr "" +msgid "Unexpected character '%c'" +msgstr "NeoÄakávaný znak \"%c\"" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:251 -msgid "Could not create VNC home directory: can't obtain home directory path." -msgstr "" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "Nastavenia TigerVNC" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:310 -#, c-format -msgid "Could not encode the parameter-value %s when writing to the Registry." -msgstr "" +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 +msgid "Cancel" +msgstr "ZruÅ¡iÅ¥" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:613 -#, c-format -msgid "" -"Could not read the line(%d) in the configuration file,the buffersize is to " -"small." -msgstr "" +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 +msgid "OK" +msgstr "OK" -#: /home/ossman/devel/tigervnc/vncviewer/Win32PixelBuffer.cxx:80 -msgid "CreateCompatibleDC failed" -msgstr "" +#: vncviewer/OptionsDialog.cxx:502 +msgid "Compression" +msgstr "Kompresia" + +#: vncviewer/OptionsDialog.cxx:518 +msgid "Auto select" +msgstr "Automatický výber" + +#: vncviewer/OptionsDialog.cxx:529 +msgid "Preferred encoding" +msgstr "Uprednostňované kódovanie" + +#: vncviewer/OptionsDialog.cxx:590 +msgid "Color level" +msgstr "FarebnosÅ¥" + +#: vncviewer/OptionsDialog.cxx:602 +msgid "Full" +msgstr "Plná" + +#: vncviewer/OptionsDialog.cxx:609 +msgid "Medium" +msgstr "Stredná" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1068 -msgid "Ctrl" -msgstr "Ctrl" +#: vncviewer/OptionsDialog.cxx:616 +msgid "Low" +msgstr "Malá" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:550 +#: vncviewer/OptionsDialog.cxx:623 +msgid "Very low" +msgstr "Veľmi malá" + +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Vlastný stupeň kompresie:" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:283 -msgid "" -"Decoding: The size of the buffer dest is to small, it needs to be 1 byte " -"bigger." -msgstr "" +#: vncviewer/OptionsDialog.cxx:652 +msgid "level (0=fast, 9=best)" +msgstr "úroveň (0=rýchla, 9=najlepÅ¡ia)" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:172 -#, c-format -msgid "Desktop name: %.80s" -msgstr "" +#: vncviewer/OptionsDialog.cxx:659 +msgid "Allow JPEG compression:" +msgstr "PovoliÅ¥ kompresiu JPEG:" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1088 -msgid "Dismiss menu" -msgstr "ZruÅ¡iÅ¥ menu" +#: vncviewer/OptionsDialog.cxx:666 +msgid "quality (0=poor, 9=best)" +msgstr "kvalita (0=nÃzka, 9=najlepÅ¡ia)" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:778 -msgid "Enable full-screen mode over all monitors" -msgstr "" +#: vncviewer/OptionsDialog.cxx:677 +msgid "Security" +msgstr "BezpeÄnosÅ¥" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:469 -msgid "Enabling continuous updates" -msgstr "" +#: vncviewer/OptionsDialog.cxx:691 +msgid "Encryption" +msgstr "Å ifrovanie" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:200 -#, c-format -msgid "" -"Encoding backslash: The size of the buffer dest is to small, it needs to be " -"more than %d bytes bigger." -msgstr "" +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 +msgid "None" +msgstr "Žiadne" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:214 -#, c-format -msgid "" -"Encoding escape sequence: The size of the buffer dest is to small, it needs " -"to be more than %d bytes bigger." -msgstr "" +#: vncviewer/OptionsDialog.cxx:710 +msgid "TLS with anonymous certificates" +msgstr "TLS s anonymnými certifikátmi" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:234 -#, c-format -msgid "" -"Encoding normal character: The size of the buffer dest is to small, it needs " -"to be more than %d bytes bigger." -msgstr "" +#: vncviewer/OptionsDialog.cxx:716 +msgid "TLS with X509 certificates" +msgstr "TLS s X509 certifikátmi" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:595 -msgid "Encryption" -msgstr "" +#: vncviewer/OptionsDialog.cxx:723 +msgid "Path to X509 CA certificate" +msgstr "Cesta k X509 certifikátu autority" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:503 -#, c-format -msgid "Error(%d) closing key: Software\\TigerVNC\\vncviewer" -msgstr "" +#: vncviewer/OptionsDialog.cxx:730 +msgid "Path to X509 CRL file" +msgstr "Cesta k X509 súboru so zoznamom zneplatnených certifikátov" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:455 -#, c-format -msgid "Error(%d) closing key: Software\\TigerVNC\\vncviewer" -msgstr "" +#: vncviewer/OptionsDialog.cxx:758 +msgid "Authentication" +msgstr "Autentifikácia" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:434 -#, c-format -msgid "Error(%d) creating key: Software\\TigerVNC\\vncviewer" -msgstr "" +#: vncviewer/OptionsDialog.cxx:776 +msgid "Standard VNC (insecure without encryption)" +msgstr "Å tandardné VNC (nezabezpeÄené bez Å¡ifrovania)" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:471 -#, c-format -msgid "Error(%d) opening key: Software\\TigerVNC\\vncviewer" -msgstr "" +#: vncviewer/OptionsDialog.cxx:782 +msgid "Username and password (insecure without encryption)" +msgstr "PoužÃvateľské meno a heslo (nezabezpeÄené bez Å¡ifrovania)" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:373 -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:415 -#, c-format -msgid "Error(%d) reading %s from Registry." -msgstr "" +#: vncviewer/OptionsDialog.cxx:805 +msgid "Input" +msgstr "Vstup" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:348 -#, c-format -msgid "Error(%d) writing %d(REG_DWORD) to Registry." -msgstr "" +#: vncviewer/OptionsDialog.cxx:818 +msgid "View only (ignore mouse and keyboard)" +msgstr "Iba prezeraÅ¥ (ignorovaÅ¥ myÅ¡ a klávesnicu)" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:326 -#, c-format -msgid "Error(%d) writing %s(REG_SZ) to Registry." -msgstr "" +#: vncviewer/OptionsDialog.cxx:825 +msgid "Mouse" +msgstr "MyÅ¡" -#: /home/ossman/devel/tigervnc/vncviewer/OSXPixelBuffer.cxx:50 -#: /home/ossman/devel/tigervnc/vncviewer/FLTKPixelBuffer.cxx:33 -msgid "Error: Not enough memory for framebuffer" -msgstr "" +#: vncviewer/OptionsDialog.cxx:837 +msgid "Emulate middle mouse button" +msgstr "EmulovaÅ¥ stredné tlaÄidlo myÅ¡i" -#: /home/ossman/devel/tigervnc/vncviewer/X11PixelBuffer.cxx:69 -msgid "Error: couldn't find suitable pixmap format" -msgstr "" +#: vncviewer/OptionsDialog.cxx:843 +msgid "Show dot when no cursor" +msgstr "ZobraziÅ¥ bodku, ak kurzor nie je zobrazený" -#: /home/ossman/devel/tigervnc/vncviewer/X11PixelBuffer.cxx:60 -msgid "Error: display lacks pixmap format for default depth" -msgstr "" +#: vncviewer/OptionsDialog.cxx:859 +msgid "Keyboard" +msgstr "Klávesnica" -#: /home/ossman/devel/tigervnc/vncviewer/X11PixelBuffer.cxx:78 -msgid "Error: only true colour displays supported" -msgstr "" +#: vncviewer/OptionsDialog.cxx:871 +msgid "Pass system keys directly to server (full screen)" +msgstr "PodávaÅ¥ systémové klávesy priamo na server (celá obrazovka)" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1056 -msgid "Exit viewer" -msgstr "UkonÄiÅ¥ prehliadaÄ" +#: vncviewer/OptionsDialog.cxx:874 +msgid "Menu key" +msgstr "Kláves pre zobrazenie ponuky" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:588 -msgid "Failed to read configuration file, can't obtain home directory path." -msgstr "" +#: vncviewer/OptionsDialog.cxx:895 +msgid "Clipboard" +msgstr "Schránka" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:602 -#, c-format -msgid "Failed to read configuration file, can't open %s" -msgstr "" +#: vncviewer/OptionsDialog.cxx:907 +msgid "Accept clipboard from server" +msgstr "AkceptovaÅ¥ schránku zo servera" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:621 -#, c-format -msgid "Failed to read line %d in file %s" -msgstr "" +#: vncviewer/OptionsDialog.cxx:915 +msgid "Also set primary selection" +msgstr "Tiež nastaviÅ¥ hlavný výber" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:528 -msgid "Failed to write configuration file, can't obtain home directory path." -msgstr "" +#: vncviewer/OptionsDialog.cxx:922 +msgid "Send clipboard to server" +msgstr "PosielaÅ¥ schránku serveru" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:542 -#, c-format -msgid "Failed to write configuration file, can't open %s" -msgstr "" +#: vncviewer/OptionsDialog.cxx:930 +msgid "Send primary selection as clipboard" +msgstr "PoslaÅ¥ hlavný výber ako schránku" -#: /home/ossman/devel/tigervnc/vncviewer/DesktopWindow.cxx:526 -#: /home/ossman/devel/tigervnc/vncviewer/DesktopWindow.cxx:538 -#: /home/ossman/devel/tigervnc/vncviewer/DesktopWindow.cxx:551 -msgid "Failure grabbing keyboard" -msgstr "" +#: vncviewer/OptionsDialog.cxx:951 +msgid "Display" +msgstr "Zobrazenie" -#: /home/ossman/devel/tigervnc/vncviewer/DesktopWindow.cxx:563 -msgid "Failure grabbing mouse" -msgstr "" +#: vncviewer/OptionsDialog.cxx:965 +msgid "Display mode" +msgstr "Režim zobrazenia" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:512 -msgid "Full (all available colors)" -msgstr "Plná (vÅ¡etky dostupné farby)" +#: vncviewer/OptionsDialog.cxx:978 +msgid "Windowed" +msgstr "V okne" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1059 -msgid "Full screen" -msgstr "Režim celej obrazovky" +#: vncviewer/OptionsDialog.cxx:986 +msgid "Full screen on current monitor" +msgstr "Celá obrazovka na tomto monitore" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:770 -msgid "Full-screen mode" -msgstr "Režim celej obrazovky" +#: vncviewer/OptionsDialog.cxx:994 +msgid "Full screen on all monitors" +msgstr "Celá obrazovka na vÅ¡etkých monitoroch" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:230 -msgid "Hide" -msgstr "" +#: vncviewer/OptionsDialog.cxx:1002 +msgid "Full screen on selected monitor(s)" +msgstr "Celá obrazovka na zvolených monitoroch" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:238 -msgid "Hide Others" -msgstr "" +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" +msgstr "Rôzne" + +#: vncviewer/OptionsDialog.cxx:1039 +msgid "Shared (don't disconnect other viewers)" +msgstr "Zdieľané (neodpojiÅ¥ iných klientov)" + +#: vncviewer/OptionsDialog.cxx:1045 +msgid "Ask to reconnect on connection errors" +msgstr "SpýtaÅ¥ sa na opätovné pripojenie pri chybe v spojenÃ" + +#: vncviewer/ServerDialog.cxx:58 +msgid "VNC Viewer: Connection Details" +msgstr "PriehliadaÄ VNC: Detaily o pripojenÃ" + +#: vncviewer/ServerDialog.cxx:68 +msgid "VNC server:" +msgstr "VNC server:" + +#: vncviewer/ServerDialog.cxx:75 +msgid "Options..." +msgstr "Voľby..." + +#: vncviewer/ServerDialog.cxx:79 +msgid "Load..." +msgstr "NaÄÃtaÅ¥..." + +#: vncviewer/ServerDialog.cxx:83 +msgid "Save As..." +msgstr "UložiÅ¥ ako..." + +#: vncviewer/ServerDialog.cxx:97 +msgid "About..." +msgstr "O programe..." -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:177 +#: vncviewer/ServerDialog.cxx:106 +msgid "Connect" +msgstr "PripojiÅ¥" + +#: vncviewer/ServerDialog.cxx:143 #, c-format -msgid "Host: %.80s port: %d" +msgid "" +"Unable to load the server history:\n" +"\n" +"%s" msgstr "" +"Nemožno naÄÃtaÅ¥ históriu servera:\n" +"\n" +"%s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:690 -#, fuzzy -msgid "Input" -msgstr "Vstupy:" +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 +msgid "TigerVNC configuration (*.tigervnc)" +msgstr "Nastavenie TigerVNC (*.tigervnc)" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:510 -msgid "Internal FLTK error. Exiting." -msgstr "" +#: vncviewer/ServerDialog.cxx:173 +msgid "Select a TigerVNC configuration file" +msgstr "ZvoliÅ¥ súbor s nastaveniami TigerVNC" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:384 -msgid "Invalid SetColourMapEntries from server!" +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 +#, c-format +msgid "" +"Unable to load the specified configuration file:\n" +"\n" +"%s" msgstr "" +"Zvolený súbor s nastaveniami nemožno naÄÃtaÅ¥:\n" +"\n" +"%s" -#: /home/ossman/devel/tigervnc/vncviewer/DesktopWindow.cxx:106 -msgid "Invalid geometry specified!" -msgstr "" +#: vncviewer/ServerDialog.cxx:213 +msgid "Save the TigerVNC configuration to file" +msgstr "UložiÅ¥ nastavenie TigerVNC do súboru" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:708 +#: vncviewer/ServerDialog.cxx:239 #, c-format -msgid "Invalid parameter name on line: %d in file: %s" -msgstr "" +msgid "%s already exists. Do you want to overwrite?" +msgstr "%s už existuje. ChceÅ¡ ho prepÃsaÅ¥?" -#: /home/ossman/devel/tigervnc/vncviewer/DesktopWindow.cxx:797 -msgid "Invalid screen layout computed for resize request!" -msgstr "" +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 +msgid "No" +msgstr "Nie" + +#: vncviewer/ServerDialog.cxx:240 +msgid "Overwrite" +msgstr "PrepÃsaÅ¥" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:204 +#: vncviewer/ServerDialog.cxx:256 #, c-format -msgid "Last used encoding: %s" +msgid "" +"Unable to save the specified configuration file:\n" +"\n" +"%s" msgstr "" +"Nemožno uložiÅ¥ zvolený súbor s nastaveniami:\n" +"\n" +"%s" -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:631 +#: vncviewer/ServerDialog.cxx:290 #, c-format msgid "" -"Line 1 in file %s\n" -"must contain the TigerVNC configuration file identifier string:\n" -"\"%s\"" +"Unable to save the default configuration:\n" +"\n" +"%s" msgstr "" +"Nemožno uložiÅ¥ predvolené nastavenia:\n" +"\n" +"%s" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:209 +#: vncviewer/ServerDialog.cxx:303 #, c-format -msgid "Line speed estimate: %d kbit/s" +msgid "" +"Unable to save the server history:\n" +"\n" +"%s" msgstr "" +"Nemožno uložiÅ¥ históriu servera:\n" +"\n" +"%s" + +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "Nemožno zÃskaÅ¥ cestu k adresáru stavu" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:478 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format -msgid "Listening on port %d\n" -msgstr "" +msgid "Could not open \"%s\": %s" +msgstr "Nedá sa otvoriÅ¥ \"%s\": %s" -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:69 -msgid "Load..." -msgstr "" +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 +#, c-format +msgid "Failed to read line %d in file %s: %s" +msgstr "Nedá sa preÄÃtaÅ¥ riadok %d v súbore %s: %s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:526 -msgid "Low (64 colors)" -msgstr "NÃzka (64 farieb)" +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 +msgid "Line too long" +msgstr "PrÃliÅ¡ dlhý riadok" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:519 -msgid "Medium (256 colors)" -msgstr "Stredná (256 farieb)" +#: vncviewer/UserDialog.cxx:99 +msgid "Opening password file failed" +msgstr "Zlyhalo otváranie súboru s heslami" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:725 -msgid "Menu key" -msgstr "" +#: vncviewer/UserDialog.cxx:118 +msgid "VNC authentication" +msgstr "VNC autorizácia" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:791 -#, fuzzy -msgid "Misc." -msgstr "Iné:" +#: vncviewer/UserDialog.cxx:125 +msgid "This connection is secure" +msgstr "Toto spojenie je zabezpeÄené" + +#: vncviewer/UserDialog.cxx:129 +msgid "This connection is not secure" +msgstr "Toto spojenie nie je zabezpeÄené" + +#: vncviewer/UserDialog.cxx:151 +msgid "Username:" +msgstr "Meno použÃvateľa:" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1026 +#: vncviewer/UserDialog.cxx:164 +msgid "Password:" +msgstr "Heslo:" + +#: vncviewer/UserDialog.cxx:207 +msgid "Authentication cancelled" +msgstr "Autentifikácia zruÅ¡ená" + +#: vncviewer/Viewport.cxx:390 #, c-format -msgid "Multiple characters given for key code %d (0x%04x): '%s'" -msgstr "" +msgid "Failed to update keyboard LED state: %lu" +msgstr "Zlyhalo aktualizovanie stavu diód na klávesnici: %lu" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:218 -msgid "No" -msgstr "" +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 +#, c-format +msgid "Failed to update keyboard LED state: %d" +msgstr "Zlyhalo aktualizovanie stavu diód na klávesnici: %d" + +#: vncviewer/Viewport.cxx:432 +msgid "Failed to update keyboard LED state" +msgstr "Zlyhalo aktualizovanie stavu diód na klávesnici" + +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 +#, c-format +msgid "Failed to get keyboard LED state: %d" +msgstr "Zlyhalo zÃskanie stavu diód na klávesnici: %d" + +#: vncviewer/Viewport.cxx:839 +msgid "No key code specified on key press" +msgstr "Pri stlaÄenà klávesa nebol zadaný žiaden kód klávesu" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:688 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" -msgstr "" +msgstr "Žiaden scan kód pre rozÅ¡Ãrený virtuálny kláves 0x%02x" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:690 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" -msgstr "" +msgstr "Žiaden scan kód pre virtuálny kláves 0x%02x" + +#: vncviewer/Viewport.cxx:998 +#, c-format +msgid "Invalid scan code 0x%02x" +msgstr "Neplatný scan kód 0x%02x" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:701 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" -msgstr "" +msgstr "Žiaden symbol pre rozÅ¡Ãrený virtuálny kláves 0x%02x" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:765 +#: vncviewer/Viewport.cxx:1030 #, c-format -msgid "No symbol for key code %d (in the current state)" -msgstr "" +msgid "No symbol for virtual key 0x%02x" +msgstr "Žiaden symbol pre virtuálny kláves 0x%02x" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:739 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" -msgstr "" +msgstr "Žiaden symbol pre kód klávesy 0x%02x (v súÄasnom stave)" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:703 +#: vncviewer/Viewport.cxx:1169 #, c-format -msgid "No symbol for virtual key 0x%02x" -msgstr "" - -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:606 -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:659 -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:727 -msgid "None" -msgstr "" - -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:220 -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:88 -msgid "OK" -msgstr "OK" +msgid "No symbol for key code %d (in the current state)" +msgstr "Žiaden symbol pre kód klávesy %d (v súÄasnom stave)" + +#: vncviewer/Viewport.cxx:1229 +msgctxt "ContextMenu|" +msgid "Disconn&ect" +msgstr "O&dpojiÅ¥" + +#: vncviewer/Viewport.cxx:1232 +msgctxt "ContextMenu|" +msgid "&Full screen" +msgstr "&Režim celej obrazovky" + +#: vncviewer/Viewport.cxx:1235 +msgctxt "ContextMenu|" +msgid "Minimi&ze" +msgstr "Minimali&zovaÅ¥" + +#: vncviewer/Viewport.cxx:1237 +msgctxt "ContextMenu|" +msgid "Resize &window to session" +msgstr "PrispôsobiÅ¥ &veľkosÅ¥ okna relácii" + +#: vncviewer/Viewport.cxx:1242 +msgctxt "ContextMenu|" +msgid "&Ctrl" +msgstr "&Ctrl" + +#: vncviewer/Viewport.cxx:1245 +msgctxt "ContextMenu|" +msgid "&Alt" +msgstr "&Alt" + +#: vncviewer/Viewport.cxx:1251 +#, c-format +msgctxt "ContextMenu|" +msgid "Send %s" +msgstr "PoslaÅ¥ %s" -#: /home/ossman/devel/tigervnc/vncviewer/UserDialog.cxx:74 -msgid "Opening password file failed" -msgstr "" +#: vncviewer/Viewport.cxx:1257 +msgctxt "ContextMenu|" +msgid "Send Ctrl-Alt-&Del" +msgstr "PoslaÅ¥ Ctrl-Alt-&Del" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1084 -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:64 -msgid "Options..." -msgstr "Voľby..." +#: vncviewer/Viewport.cxx:1260 +msgctxt "ContextMenu|" +msgid "&Refresh screen" +msgstr "ObnoviÅ¥ ob&razovku" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:463 -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:464 -msgid "Parameters -listen and -via are incompatible" -msgstr "" +#: vncviewer/Viewport.cxx:1263 +msgctxt "ContextMenu|" +msgid "&Options..." +msgstr "V&oľby..." -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:722 -msgid "Pass system keys directly to server (full screen)" -msgstr "" +#: vncviewer/Viewport.cxx:1265 +msgctxt "ContextMenu|" +msgid "Connection &info..." +msgstr "&Informácie o pripojenÃ..." -#: /home/ossman/devel/tigervnc/vncviewer/UserDialog.cxx:87 -#: /home/ossman/devel/tigervnc/vncviewer/UserDialog.cxx:102 -msgid "Password:" -msgstr "Heslo:" +#: vncviewer/Viewport.cxx:1267 +msgctxt "ContextMenu|" +msgid "About &TigerVNC viewer..." +msgstr "O prehliadaÄi &TigerVNC..." -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:625 -msgid "Path to X509 CA certificate" -msgstr "" +#: vncviewer/Viewport.cxx:1356 +msgid "VNC connection info" +msgstr "Informácie o VNC pripojenÃ" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:632 -msgid "Path to X509 CRL file" -msgstr "" +#: vncviewer/Win32TouchHandler.cxx:47 +msgid "Window is registered for touch instead of gestures" +msgstr "Okno je registrované na dotyk namiesto ku gestám" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:188 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format -msgid "Pixel format: %s" -msgstr "" +msgid "Failed to set gesture configuration (error 0x%x)" +msgstr "Zlyhalo nastavenie pre gestá (chyba 0x%x)" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:449 -msgid "Preferred encoding" -msgstr "" +#: vncviewer/Win32TouchHandler.cxx:94 +#, c-format +msgid "Failed to get gesture information (error 0x%x)" +msgstr "Zlyhalo zÃskanie informácià o gestách (chyba 0x%x)" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:214 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format -msgid "Protocol version: %d.%d" -msgstr "" +msgid "Invalid mouse button %d, must be a number between 1 and 7." +msgstr "Neplatné ÄÃslo tlaÄidla myÅ¡i %d, musà to byÅ¥ ÄÃslo medzi 1 a 7." -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:233 -msgid "Quit" -msgstr "" +#: vncviewer/Win32TouchHandler.cxx:424 +#, c-format +msgid "Unhandled key 0x%x - can't generate keyboard event." +msgstr "Neriadený kláves 0x%x - nedá sa vytvoriÅ¥ udalosÅ¥ klávesnice." -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1082 -msgid "Refresh screen" -msgstr "ObnoviÅ¥ obrazovku" +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 +#, c-format +msgid "Unable to get X Input 2 event mask for window 0x%08lx" +msgstr "Maska udalosti X Input 2 pre okno 0x%08lx sa nedá naÄÃtaÅ¥" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:199 +#: vncviewer/XInputTouchHandler.cxx:104 #, c-format -msgid "Requested encoding: %s" -msgstr "" +msgid "Window 0x%08lx has no X Input 2 event mask" +msgstr "Okno 0x%08lx nemá masku udalosti X Input 2" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:749 -msgid "Resize remote session on connect" -msgstr "" +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 +#, c-format +msgid "Window 0x%08lx has more than one X Input 2 event mask" +msgstr "Okno 0x%08lx má viac než jednu masku udalosti X Input 2" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:762 -msgid "Resize remote session to the local window" -msgstr "" +#: vncviewer/XInputTouchHandler.cxx:143 +#, c-format +msgid "Failure grabbing device %i" +msgstr "Chyba pri preberanà zariadenia %i" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1062 -msgid "Resize window to session" -msgstr "" +#: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 +msgid "TigerVNC Viewer" +msgstr "PrehliadaÄ TigerVNC" + +#: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:14 +#: vncviewer/vncviewer.desktop.in.in:5 +msgid "Connect to VNC server and display remote desktop" +msgstr "PripojiÅ¥ sa na VNC server a zobraziÅ¥ vzdialenú plochu" + +#: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:17 +msgid "Virtual Network Computing (VNC) is a remote display system that allows you to view and interact with a virtual desktop environment running on another computer on the network. Using VNC, you can run graphical applications on a remote machine and send only the display from these applications to your local device. This package contains a client which will enable you to connect to other desktops running a VNC server. VNC is platform-independent and supports various operating systems and architectures as both servers and clients." +msgstr "Virtual Network Computing (VNC) je technológia vzdialenej plochy, ktorá vám umožnà zobraziÅ¥ a interagovaÅ¥ s prostredÃm vzdialenej plochy, ktorá je spustená na inom poÄÃtaÄi v sieti. Pomocou VNC môžete maÅ¥ spustené grafické aplikácie na vzdialenom stroji a posielaÅ¥ len obraz z týchto aplikácià do vášho lokálneho zariadenia. Tento balÃk obsahuje klienta, ktorý vám umožnà pripojiÅ¥ sa k iným plochám, na ktorých je spustený VNC server. VNC je nezávislé na platforme a podporuje rôzne operaÄné systémy a architektúry tak ako na serveri, tak aj u klienta." + +#: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:23 +msgid "TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code bases. TigerVNC started as a next-generation development effort for TightVNC on Unix and Linux platforms, but it split from its parent project in early 2009 so that TightVNC could focus on Windows platforms. TigerVNC supports a variant of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo JPEG codec." +msgstr "TigerVNC je vysokorýchlostná verzia VNC založená na kóde RealVNC 4 a X.org. TigerVNC sa zaÄala ako snaha o vývoj novej generácie TightVNC pre Unix a Linux, ale oddelilo sa od rodiÄovského projektu na zaÄiatku roka 2009, a tak sa TigerVNC mohlo sústrediÅ¥ na platformu Windows. TigerVNC podporuje variant Tight kódovania, ktorý je znaÄne zrýchlený použitÃm JPEG kodeku libjpeg-turbo." + +#: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:33 +msgid "TigerVNC Viewer connection to a CentOS machine" +msgstr "Pripojenie prehliadaÄa TigerVNC k stroju s CentOS" + +#: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:37 +msgid "TigerVNC Viewer connection to a macOS machine" +msgstr "Pripojenie prehliadaÄa TigerVNC k stroju s macOS" + +#: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:41 +msgid "TigerVNC Viewer connection to a Windows machine" +msgstr "Pripojenie prehliadaÄa TigerVNC k stroju s Windows" + +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 +msgid "The name of the parameter is too large" +msgstr "Názov parametru je veľmi dlhý" + +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 +msgid "The parameter is too large" +msgstr "Parameter je veľmi dlhý" + +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 +msgid "Invalid format or too large value" +msgstr "Neplatný formát alebo veľmi veľká hodnota" + +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 +msgid "Failed to create registry key" +msgstr "Zlyhalo vytvorenie kľúÄa v registry" + +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 +msgid "Failed to close registry key" +msgstr "Zlyhalo zatvorenie kľúÄa v registry" + +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 +#, c-format +msgid "Failed to save \"%s\": %s" +msgstr "Zlyhalo uloženie \"%s\": %s" -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:74 -msgid "Save As..." -msgstr "" +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 +msgid "Unknown parameter type" +msgstr "Neznámy typ parametra" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:741 -msgid "Screen" -msgstr "" +#: vncviewer/parameters.cxx:495 +#, c-format +msgid "Failed to remove \"%s\": %s" +msgstr "Zlyhalo vymazanie \"%s\": %s" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:580 -msgid "Security" -msgstr "" +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 +msgid "Failed to open registry key" +msgstr "Zlyhalo otvorenie kľúÄa v registry" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:219 +#: vncviewer/parameters.cxx:534 #, c-format -msgid "Security method: %s" -msgstr "" +msgid "Failed to read server history entry %d: %s" +msgstr "Zlyhalo preÄÃtanie záznamu histórie servera %d: %s" -#: /home/ossman/devel/tigervnc/vncviewer/Win32PixelBuffer.cxx:83 -msgid "SelectObject failed" -msgstr "" - -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1075 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format -msgid "Send %s" -msgstr "PoslaÅ¥ %s" +msgid "Failed to read parameter \"%s\": %s" +msgstr "Zlyhalo preÄÃtanie parametra \"%s\": %s" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1080 -msgid "Send Ctrl-Alt-Del" -msgstr "PoslaÅ¥ Ctrl-Alt-Del" +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "Nedá sa zÃskaÅ¥ cesta k adresáru s nastaveniami" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:710 -msgid "Send clipboard to server" -msgstr "PosielaÅ¥ schránku serveru" +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 +msgid "Could not encode parameter" +msgstr "Nedá sa zakódovaÅ¥ parameter" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:716 -#, fuzzy -msgid "Send primary selection and cut buffer as clipboard" -msgstr "PosielaÅ¥ primárnu selekciu a zásobnÃk pre vymazanie ako schránku" +#: vncviewer/parameters.cxx:780 +#, c-format +msgid "Configuration file %s is in an invalid format" +msgstr "Súbor s nastaveniami %s je v neplatnom formáte" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:237 -msgid "Services" -msgstr "" +#: vncviewer/parameters.cxx:802 +msgid "Invalid format" +msgstr "Neplatný formát" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:319 -#, c-format -msgid "SetDesktopSize failed: %d" -msgstr "" +#: vncviewer/parameters.cxx:837 +msgid "Unknown parameter" +msgstr "Neznámy parameter" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:799 -msgid "Shared (don't disconnect other viewers)" -msgstr "Zdieľané (neodpojiÅ¥ iných klientov)" +#: vncviewer/touch.cxx:76 +#, c-format +msgid "Got message (0x%x) for an unhandled window" +msgstr "Prijatá správa (0x%x) pre neobsluhované okno" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:239 -msgid "Show All" -msgstr "" +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 +#, c-format +msgid "Invalid window 0x%08lx specified for pointer grab" +msgstr "Neplatné okno 0x%08lx nastavené pre zabranie ukazovateľa" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:805 -msgid "Show dot when no cursor" -msgstr "ZobraziÅ¥ bodku, ak kurzor nie je zobrazený" +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 +#, c-format +msgid "Failed to create touch handler: %s" +msgstr "Zlyhalo vytvorenie obsluhy dotyku: %s" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:182 +#: vncviewer/touch.cxx:189 #, c-format -msgid "Size: %d x %d" -msgstr "" +msgid "Couldn't attach event handler to window (error 0x%x)" +msgstr "Nedá sa pripojiÅ¥ obsluha udalostà k oknu (chyba 0x%x)" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:665 -msgid "Standard VNC (insecure without encryption)" -msgstr "" +#: vncviewer/touch.cxx:216 +msgid "Failed to get event data for X Input event" +msgstr "Nepodarilo sa zÃskaÅ¥ dáta udalostà pre udalosÅ¥ X Input" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:618 -msgid "TLS with X509 certificates" -msgstr "" +#: vncviewer/touch.cxx:229 +msgid "X Input event for unknown window" +msgstr "UdalosÅ¥ X Input pre neznáme okno" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:612 -msgid "TLS with anonymous certificates" -msgstr "" +#: vncviewer/touch.cxx:255 +msgid "X Input extension not available." +msgstr "RozÅ¡Ãrenie X Input je nedostupné." -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:448 -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:497 -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:561 -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:701 -#, c-format -msgid "The parameterArray contains a object of a invalid type at line %d." -msgstr "" +#: vncviewer/touch.cxx:262 +msgid "X Input 2 (or newer) is not available." +msgstr "X Input 2 (alebo novÅ¡ie) nie je dostupné." -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:664 -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:680 -#, c-format -msgid "The value of the parameter %s on line %d in file %s is invalid." -msgstr "" +#: vncviewer/touch.cxx:267 +msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." +msgstr "X Input 2 (alebo novÅ¡ie) nie je dostupné. Dotykové gestá nebudú podporované." -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:539 +#: vncviewer/vncviewer.cxx:104 #, c-format -msgid "Throughput %d kbit/s - changing to quality %d" +msgid "" +"TigerVNC Viewer v%s\n" +"Built on: %s\n" +"Copyright (C) 1999-%d TigerVNC Team and many others (see README.rst)\n" +"See https://www.tigervnc.org for information on TigerVNC." msgstr "" +"PrehliadaÄ TigerVNC v%s\n" +"Postavený na: %s\n" +"Copyright (C) 1999-%d TÃm TigerVNC a mnohà ÄalÅ¡Ã (pozri README.txt)\n" +"Pre informácie o TigerVNC navÅ¡tÃvte https://www.tigervnc.org." -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:561 +#: vncviewer/vncviewer.cxx:158 #, c-format -msgid "Throughput %d kbit/s - full color is now %s" +msgid "" +"An unexpected error occurred when communicating with the server:\n" +"\n" +"%s" msgstr "" +"Stala sa neoÄakávaná chyba pri komunikácià so serverom:\n" +"\n" +"%s" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:210 -#, fuzzy -msgid "TigerVNC Viewer" -msgstr "O aplikácià VNC Viewer" +#: vncviewer/vncviewer.cxx:174 +msgid "About TigerVNC Viewer" +msgstr "O aplikácià prehliadaÄ TigerVNC" + +#: vncviewer/vncviewer.cxx:195 +msgid "Internal FLTK error. Exiting." +msgstr "Interná FLTK chyba. UkonÄuje sa." -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:80 -#, fuzzy, c-format +#: vncviewer/vncviewer.cxx:214 +#, c-format msgid "" -"TigerVNC Viewer %d-bit v%s\n" -"Built on: %s\n" -"Copyright (C) 1999-%d TigerVNC Team and many others (see README.txt)\n" -"See http://www.tigervnc.org for information on TigerVNC." +"%s\n" +"\n" +"Attempt to reconnect?" msgstr "" -"TigerVNC Viewer %d-bit verzie %s (%s)\n" "%s\n" -"Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)\n" -"Pre informácie o TigerVNC navÅ¡tÃvte http://www.tigervnc.org." +"\n" +"PokúsiÅ¥ sa znova spojiÅ¥?" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1004 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format -msgid "Unknown FLTK key code %d (0x%04x)" -msgstr "" +msgid "Error starting new TigerVNC Viewer: %s" +msgstr "Chyba pri spustenà prehliadaÄa TigerVNC: %s" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:878 +#: vncviewer/vncviewer.cxx:266 #, c-format -msgid "Unknown decimal separator: '%s'" -msgstr "" +msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." +msgstr "Vnútorný signál na ukonÄenie %d bol prijatý. PrehliadaÄ TigerVNC sa teraz ukonÄÃ." -#: /home/ossman/devel/tigervnc/vncviewer/parameters.cxx:271 -#, c-format -msgid "Unknown escape sequence at character %d" -msgstr "" +#: vncviewer/vncviewer.cxx:393 +msgid "Yes" +msgstr "Ãno" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:430 -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:437 -msgid "Unknown rect encoding" -msgstr "" +#: vncviewer/vncviewer.cxx:396 +msgid "Close" +msgstr "ZatvoriÅ¥" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:429 -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:436 -#, c-format -msgid "Unknown rect encoding %d" -msgstr "" +#: vncviewer/vncviewer.cxx:401 +msgid "About" +msgstr "O programe" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:671 -msgid "Username and password (insecure without encryption)" -msgstr "" +#: vncviewer/vncviewer.cxx:404 +msgid "Hide" +msgstr "SkryÅ¥" -#: /home/ossman/devel/tigervnc/vncviewer/UserDialog.cxx:99 -msgid "Username:" -msgstr "Názov užÃvateľa:" +#: vncviewer/vncviewer.cxx:407 +msgid "Quit" +msgstr "OdÃsÅ¥" + +#: vncviewer/vncviewer.cxx:411 +msgid "Services" +msgstr "Služby" + +#: vncviewer/vncviewer.cxx:412 +msgid "Hide Others" +msgstr "SkryÅ¥ ostatné" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:573 +#: vncviewer/vncviewer.cxx:413 +msgid "Show All" +msgstr "ZobraziÅ¥ vÅ¡etky" + +#: vncviewer/vncviewer.cxx:422 +msgctxt "SysMenu|" +msgid "&File" +msgstr "&Súbor" + +#: vncviewer/vncviewer.cxx:425 +msgctxt "SysMenu|File|" +msgid "&New Connection" +msgstr "&Nové pripojenie" + +#: vncviewer/vncviewer.cxx:525 +msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" +msgstr "FullScreenAllMonitors je zastaralé, nastavte FullScreenMode na \"all\" radÅ¡ej" + +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "~/.vnc je zastaralé, prosÃm poraÄte sa s \"man vncviewer\" pre možnosti, ktoré možno použiÅ¥." + +#: vncviewer/vncviewer.cxx:725 #, c-format -msgid "Using %s encoding" -msgstr "" +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "%%APPDATA%%\\vnc je zastaralé, prosÃm prejdite na %%APPDATA%%\\TigerVNC prieÄinok." -#: /home/ossman/devel/tigervnc/vncviewer/X11PixelBuffer.cxx:80 +#: vncviewer/vncviewer.cxx:730 #, c-format -msgid "Using default colormap and visual, %sdepth %d." -msgstr "" +msgid "Could not create VNC config directory: %s" +msgstr "Nedá sa vytvoriÅ¥ VNC adresár s nastaveniami: %s" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:620 +#: vncviewer/vncviewer.cxx:735 #, c-format -msgid "Using pixel format %s" -msgstr "" +msgid "Could not create VNC data directory: %s" +msgstr "Nedá sa vytvoriÅ¥ VNC adresár pre údaje: %s" -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:42 -msgid "VNC Viewer: Connection Details" -msgstr "VNC Viewer: Detaily o pripojenÃ" +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "Nedá sa vytvoriÅ¥ VNC adresár pre stavy: %s" + +#. TRANSLATORS: "Parameters" are command line arguments, or settings +#. from a file or the Windows registry. +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 +msgid "Parameters -listen and -via are incompatible" +msgstr "Parametre -listen a -via sa navzájom vyluÄujú" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:57 -msgid "VNC Viewer: Connection Options" -msgstr "VNC Viewer: Voľby pripojenia" +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Nedajú sa zachytávaÅ¥ prichádzajúce spojenia" -#: /home/ossman/devel/tigervnc/vncviewer/UserDialog.cxx:86 -#: /home/ossman/devel/tigervnc/vncviewer/UserDialog.cxx:96 -msgid "VNC authentication" -msgstr "VNC autorizácia" +#: vncviewer/vncviewer.cxx:772 +#, c-format +msgid "Listening on port %d" +msgstr "NaÄúva sa na porte %d" -#: /home/ossman/devel/tigervnc/vncviewer/Viewport.cxx:1176 -msgid "VNC connection info" -msgstr "Informácie o VNC pripojenÃ" +#: vncviewer/vncviewer.cxx:805 +#, c-format +msgid "" +"Failure waiting for incoming VNC connection:\n" +"\n" +"%s" +msgstr "" +"Chyba pri Äakanà na prichádzajúce VNC spojenia:\n" +"\n" +"%s" -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:49 -#: /home/ossman/devel/tigervnc/vncviewer/ServerDialog.cxx:54 -msgid "VNC server:" -msgstr "VNC server:" +#: vncviewer/vncviewer.desktop.in.in:4 +msgid "Remote Desktop Viewer" +msgstr "PrehliadaÄ vzdialenej plochy" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:533 -msgid "Very low (8 colors)" -msgstr "Veľmi nÃzka (8 farieb)" +#~ msgid "Alt" +#~ msgstr "Alt" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:698 -#, fuzzy -msgid "View only (ignore mouse and keyboard)" -msgstr "Iba prezeraÅ¥ (ignorovaÅ¥ myÅ¡ a klávesnicu)" +#~ msgid "Dismiss menu" +#~ msgstr "ZruÅ¡iÅ¥ menu" -#: /home/ossman/devel/tigervnc/vncviewer/vncviewer.cxx:219 -msgid "Yes" -msgstr "" +#~ msgid "Exit viewer" +#~ msgstr "UkonÄiÅ¥ prehliadaÄ" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:111 -#, c-format -msgid "connected to host %s port %d" -msgstr "" +#~ msgid "Full (all available colors)" +#~ msgstr "Plná (vÅ¡etky dostupné farby)" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:563 -msgid "disabled" -msgstr "" +#~ msgid "Low (64 colors)" +#~ msgstr "NÃzka (64 farieb)" -#: /home/ossman/devel/tigervnc/vncviewer/CConn.cxx:563 -msgid "enabled" -msgstr "" +#~ msgid "Medium (256 colors)" +#~ msgstr "Stredná (256 farieb)" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:556 #, fuzzy -msgid "level (1=fast, 6=best [4-6 are rarely useful])" -msgstr "stupeň (1=rýchla, 9=najlepÅ¡ia)" +#~ msgid "Misc." +#~ msgstr "Iné:" -#: /home/ossman/devel/tigervnc/vncviewer/OptionsDialog.cxx:569 -#, fuzzy -msgid "quality (0=poor, 9=best)" -msgstr "kvalita (1=nÃzka, 9=najlepÅ¡ia)" +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "VNC Viewer: Voľby pripojenia" -#: /home/ossman/devel/tigervnc/vncviewer/Win32PixelBuffer.cxx:63 -msgid "unable to create DIB section" -msgstr "" +#~ msgid "Very low (8 colors)" +#~ msgstr "Veľmi nÃzka (8 farieb)" + +#, fuzzy +#~ msgid "level (1=fast, 6=best [4-6 are rarely useful])" +#~ msgstr "stupeň (1=rýchla, 9=najlepÅ¡ia)" #~ msgid "About VNCviewer..." #~ msgstr "O VNCviewer..." @@ -780,9 +1056,6 @@ msgstr "" #~ msgid "Encoding and Color Level:" #~ msgstr "Kódovanie a úroveň farieb:" -#~ msgid "New connection..." -#~ msgstr "Nové pripojenie..." - #~ msgid "Render cursor locally" #~ msgstr "VykresľovaÅ¥ kurzor lokálne" @@ -4,15 +4,15 @@ # # Peter Ã…strand <astrand@cendio.se>, 2011. # Göran Uddeborg <goeran@uddeborg.se>, 2015, 2016, 2017, 2018, 2019, 2021, 2022. -# Luna Jernberg <droidbittin@gmail.com>, 2022. +# Luna Jernberg <droidbittin@gmail.com>, 2022, 2024. # # $Revision: 1.25 $ msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-24 00:37+0100\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-23 08:49+0200\n" "Last-Translator: Luna Jernberg <droidbittin@gmail.com>\n" "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" "Language: sv\n" @@ -21,19 +21,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Bugs: Report translation errors to the Language-Team address.\n" -"X-Generator: Poedit 3.2.2\n" +"X-Generator: Poedit 3.4.2\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "Ansluten till uttaget %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "Ansluten till värden %s port %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -44,94 +44,94 @@ msgstr "" "\n" "%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Skrivbordsnamn: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Värd: %.80s port: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Storlek: %d x %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Pixelformat: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(serverstandard %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "Begärd kodning: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "Senast använd kodning: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Uppskattad hastighet pÃ¥ förbindelsen: %d kbit/s" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "Protokollversion: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Säkerhetsmetod: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "Anslutningen släpptes av servern innan sessionen kunde etableras." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "SetDesktopSize misslyckades: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "Ogiltig SetColourMapEntries frÃ¥n server!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "Bandbredd %d kbit/s - byter till kvalitet %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "Bandbredd %d kbit/s – fullfärg är nu aktiverat" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "Bandbredd %d kbit/s – fullfärg är nu avaktiverat" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "Använder pixelformat %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "Ogiltig geometri angiven!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "Reducerar fönsterstorleken till att passa pÃ¥ den aktuella bildskärmen" @@ -144,12 +144,12 @@ msgstr "Justerar fönsterstorleken för att undvika fullskärm av misstag" msgid "Press %s to open the context menu" msgstr "Tryck %s för att öppna sammanhangsmenyn" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "Misslyckades med att fÃ¥nga tangentbordet" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "Ogiltig skärmlayout beräknad för storleksförändrings-begäran!" @@ -158,218 +158,218 @@ msgid "Invalid state for 3 button emulation" msgstr "Felaktigt tillstÃ¥nd för 3-knappsemulering" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "Misslyckades att hämta systemets bildskärmskonfiguration" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "Ogiltig konfiguration angiven för %s" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "Bildskärmsindex %d finns inte" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Felaktigt skärmindex â€%sâ€" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "Oväntat tecken â€%câ€" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "VNC-visare: Anslutningsalternativ" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "TigerVNC-alternativ" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "Avbryt" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "Ok" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "Kompression" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Automatiskt val" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "Föredragen kodning" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "FärgnivÃ¥" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Fullständig" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "Medium" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "LÃ¥g" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "Mycket lÃ¥g" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Anpassad komprimeringsnivÃ¥:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "kvalitet (0=snabb, 9=bäst)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "TillÃ¥t JPEG-komprimering:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "kvalitet (0=dÃ¥lig, 9=bäst)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "Säkerhet" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "Kryptering" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Ingen" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS med anonyma certifikat" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS med X509-certifikat" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "Sökväg till CA-certifikat för X509" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "Sökväg till CRL-fil för X509" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "Autentisering" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "Standard-VNC (osäkert utan kryptering)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Användarnamn och lösenord (osäkert utan kryptering)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "Inmatning" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Endast visning (ignorera mus och tangentbord)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "Mus" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Emulera mittenknapp pÃ¥ musen" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "Visa punkt när muspekare saknas" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Tangentbord" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "Skicka systemtangenter direkt till servern (fullskärm)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Menytangent" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Urklipp" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "Acceptera urklipp frÃ¥n server" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "Sätt även primär markering" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "Skicka urklipp till server" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "Skicka primär markering som urklipp" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "Display" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Visningsläge" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "Fönster" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "Helskärm pÃ¥ nuvarande bildskärm" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "Helskärm pÃ¥ alla bildskärmar" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "Helskärm pÃ¥ valda bildskärmar" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." -msgstr "Diverse." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" +msgstr "Diverse" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "Delad (koppla ej frÃ¥n andra visare)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "Be att fÃ¥ Ã¥teransluta vid anslutningsfel" @@ -377,31 +377,31 @@ msgstr "Be att fÃ¥ Ã¥teransluta vid anslutningsfel" msgid "VNC Viewer: Connection Details" msgstr "VNC-visare: Anslutningsdetaljer" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "VNC-server:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "Inställningar..." -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "Öppna..." -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Spara som..." -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "Om..." -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "Anslut" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -412,15 +412,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "TigerVNC-konfiguration (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "Välj en TigerVNC-konfigurationsfil" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -440,7 +440,7 @@ msgstr "Spara TigerVNC-konfigurationen i en fil" msgid "%s already exists. Do you want to overwrite?" msgstr "%s finns redan. Vill du skriva över den?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "Nej" @@ -481,31 +481,29 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "Kunde inte fÃ¥ tag i hemkatalogens sökväg" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "Det gick inte att hämta tillstÃ¥ndskatalogens sökväg" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "Kunde inte öppna â€%sâ€: %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "Misslyckades med att läsa rad %d i fil %s: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "Raden är för lÃ¥ng" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "Öppning av lösenordsfilen misslyckades" @@ -521,139 +519,139 @@ msgstr "Denna anslutning är säker" msgid "This connection is not secure" msgstr "Denna anslutning är inte säker" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "Användarnamn:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Lösenord:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Autentisering avbruten" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "Misslyckades att uppdatera tillstÃ¥ndet för tangentbords-LED: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "Misslyckades att uppdatera tillstÃ¥ndet för tangentbords-LED: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "Misslyckades att uppdatera tillstÃ¥ndet för tangentbords-LED" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "Misslyckades att hämta tillstÃ¥ndet för tangentbords-LED: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "Ingen tangentkod angiven vid tangenttryckning" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "Ingen scancode för utökad virtuell tangent 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "Ingen scancode för virtuell tangent 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Felaktig skanningskod 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "Ingen symbol för utökad virtuell tangent 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "Ingen symbol för virtuell tangent 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "Ingen symbol för tangentkod 0x%02x (i nuvarande tillstÃ¥nd)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "Ingen symbol för tangentkod %d (i nuvarande tillstÃ¥nd)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "Koppla &ifrÃ¥n" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "&Fullskärm" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "M&inimera" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "Anpassa &fönster till session" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "Skicka %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Skicka Ctrl-Alt-&Del" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "&Uppdatera skärm" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "&Inställningar..." -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "&Information om anslutningen..." -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "Om &TigerVNC-visaren..." -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "VNC anslutningsinformation" @@ -661,27 +659,27 @@ msgstr "VNC anslutningsinformation" msgid "Window is registered for touch instead of gestures" msgstr "Fönstret har registrerats för beröring istället för gester" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "Misslyckades med att sätta gestkonfigurationen (fel 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "Misslyckades att fÃ¥ gestinformation (fel 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Felaktig musknapp %d, mÃ¥ste vara ett nummer mellan 1 och 7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Ej hanterad tangent 0x%x — kan inte generera en tangentbordshändelse." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "Kan inte fÃ¥ X inmatning 2 händelsemask för fönster 0x%08lx" @@ -691,7 +689,7 @@ msgstr "Kan inte fÃ¥ X inmatning 2 händelsemask för fönster 0x%08lx" msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "Fönster 0x%08lx har ingen X inmatning 2 händelsemask" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "Fönster 0x%08lx har mer än en X inmatning 2 händelsemask" @@ -702,7 +700,7 @@ msgid "Failure grabbing device %i" msgstr "Misslyckades med att fÃ¥nga enhet %i" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "VNC-visare" @@ -731,120 +729,124 @@ msgstr "TigerVNC-visares anslutning till en macOS-maskin" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "TigerVNC-visares anslutning till en Windows-maskin" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "Namnet pÃ¥ parametern är för stort" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "Parametern är för stor" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Ogiltigt format eller för stort värde" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "Misslyckades med att skapa registernyckel" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "Misslyckades med att stänga registernyckel" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "Misslyckades att spara â€%sâ€: %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Okänd parametertyp" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "Misslyckades att ta bort â€%sâ€: %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "Misslyckades med att öppna registernyckel" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Misslyckades med att läsa serverhistorikpost %d: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "Misslyckades med att läsa parametern â€%sâ€: %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "Det gick inte att hämta sökvägen till konfigurationskatalogen" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "Kunde inte koda parametern" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "Konfigurationsfilen %s har ogiltigt format" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Ogiltigt format" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Okänd parameter" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "Fick ett meddelande (0x%x) för ett ej hanterat fönster" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "Felaktigt fönster 0x%08lx angivet för pekargrepp" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "Misslyckades med att skapa en beröringshanterare: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "Kunde inte koppla en händelsehanterare till fönstret (fel 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "Misslyckades att fÃ¥ händelsedata för en X inmatningshändelse" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "X inmatningshändelse för ett okänt fönster" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "X inmatningsutökning är inte tillgänglig." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "X inmatning 2 (eller nyare) är inte tillgänglig." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "X inmatning 2.2 (eller nyare) är inte tillgänglig. Beröringsgester kommer inte stödjas." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -857,7 +859,7 @@ msgstr "" "Copyright © 1999-%d TigerVNC-teamet och mÃ¥nga andra (se README.rst)\n" "Se https://www.tigervnc.org för information om TigerVNC." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -868,15 +870,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "Om VNC-visaren" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "Internt FLTK-fel. Avslutar." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -887,79 +889,102 @@ msgstr "" "\n" "Försök att Ã¥teransluta?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Fel vid start av ny TigerVNC-visare: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Termineringssignal %d har mottagits. TigerVNC-visaren kommer nu att avslutas." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "Ja" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "Stäng" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "Om" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Göm" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "Avsluta" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "Tjänster" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Göm andra" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "Visa alla" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&Arkiv" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "&Ny anslutning" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "Kunde inte skapa en VNC-hemkatalog: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "FullScreenAllMonitors är förÃ¥ldrat, sätt FullScreenMode till â€all†istället" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "~/.vnc är utfasad, vänligen konsultera 'man vncviewer' för sökvägar att migrera till." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "%%APPDATA%%\\vnc är utfasad, vänligen byt till %%APPDATA%%\\TigerVNC-platsen." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "Kunde inte skapa en VNC-konfigurationskatalog: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "Kunde inte skapa en VNC-datakatalog: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "Kunde inte skapa VNC-tillstÃ¥ndskatalog: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "Parametrar -listen och -via är inkompatibla" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Misslyckades att lyssna efter inkommande anslutningar" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Lyssnar pÃ¥ port %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -973,3 +998,9 @@ msgstr "" #: vncviewer/vncviewer.desktop.in.in:4 msgid "Remote Desktop Viewer" msgstr "Fjärrskrivbordsvisare" + +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "VNC-visare: Anslutningsalternativ" + +#~ msgid "Misc." +#~ msgstr "Diverse." diff --git a/po/tigervnc.pot b/po/tigervnc.pot index 5427e711..9485b928 100644 --- a/po/tigervnc.pot +++ b/po/tigervnc.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,17 +17,17 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -35,96 +35,96 @@ msgid "" "%s" msgstr "" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "" "The connection was dropped by the server before the session could be " "established." msgstr "" -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "" @@ -137,12 +137,12 @@ msgstr "" msgid "Press %s to open the context menu" msgstr "" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "" @@ -151,218 +151,218 @@ msgid "Invalid state for 3 button emulation" msgstr "" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" msgstr "" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "" @@ -370,31 +370,31 @@ msgstr "" msgid "VNC Viewer: Connection Details" msgstr "" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "" -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "" -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "" -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "" -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -402,15 +402,15 @@ msgid "" "%s" msgstr "" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -427,7 +427,7 @@ msgstr "" msgid "%s already exists. Do you want to overwrite?" msgstr "" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "" @@ -459,31 +459,29 @@ msgid "" "%s" msgstr "" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" msgstr "" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "" @@ -499,139 +497,139 @@ msgstr "" msgid "This connection is not secure" msgstr "" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "" -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "" -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "" -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "" @@ -639,27 +637,27 @@ msgstr "" msgid "Window is registered for touch instead of gestures" msgstr "" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "" -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "" -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "" @@ -669,7 +667,7 @@ msgstr "" msgid "Window 0x%08lx has no X Input 2 event mask" msgstr "" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "" @@ -680,7 +678,7 @@ msgid "Failure grabbing device %i" msgstr "" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "" @@ -723,122 +721,126 @@ msgstr "" msgid "TigerVNC Viewer connection to a Windows machine" msgstr "" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "" -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "" -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "" "X Input 2.2 (or newer) is not available. Touch gestures will not be " "supported." msgstr "" -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -847,7 +849,7 @@ msgid "" "See https://www.tigervnc.org for information on TigerVNC." msgstr "" -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -855,15 +857,15 @@ msgid "" "%s" msgstr "" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "" -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -871,80 +873,106 @@ msgid "" "Attempt to reconnect?" msgstr "" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "" -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" +#: vncviewer/vncviewer.cxx:525 +msgid "" +"FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "" -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:721 msgid "" -"FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" +"~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "" + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "" +"%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC " +"location." +msgstr "" + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" msgstr "" #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -2,14 +2,14 @@ # Copyright (C) 2014 the TigerVNC Team (msgids) # This file is distributed under the same license as the tigervnc package. # -# Yuri Chornoivan <yurchor@ukr.net>, 2014, 2015, 2016, 2017, 2018, 2019, 2021, 2022. +# Yuri Chornoivan <yurchor@ukr.net>, 2014, 2015, 2016, 2017, 2018, 2019, 2021, 2022, 2024. msgid "" msgstr "" -"Project-Id-Version: tigervnc 1.12.90\n" +"Project-Id-Version: tigervnc 1.13.90\n" "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n" -"POT-Creation-Date: 2022-12-15 16:35+0100\n" -"PO-Revision-Date: 2022-12-16 13:54+0200\n" -"Last-Translator: Fracture dept <yurchor@ukr.net>\n" +"POT-Creation-Date: 2024-06-20 15:01+0200\n" +"PO-Revision-Date: 2024-06-20 19:02+0300\n" +"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" "Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n" "Language: uk\n" "MIME-Version: 1.0\n" @@ -17,19 +17,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Lokalize 20.12.0\n" +"X-Generator: Lokalize 23.04.3\n" -#: vncviewer/CConn.cxx:103 +#: vncviewer/CConn.cxx:99 #, c-format msgid "Connected to socket %s" msgstr "З’єднано з Ñокетом %s" -#: vncviewer/CConn.cxx:110 +#: vncviewer/CConn.cxx:106 #, c-format msgid "Connected to host %s port %d" msgstr "З’єднано з вузлом %s, порт %d" -#: vncviewer/CConn.cxx:114 +#: vncviewer/CConn.cxx:111 #, c-format msgid "" "Failed to connect to \"%s\":\n" @@ -40,94 +40,94 @@ msgstr "" "\n" "%s" -#: vncviewer/CConn.cxx:159 +#: vncviewer/CConn.cxx:155 #, c-format msgid "Desktop name: %.80s" msgstr "Ðазва робочої Ñтанції: %.80s" -#: vncviewer/CConn.cxx:164 +#: vncviewer/CConn.cxx:160 #, c-format msgid "Host: %.80s port: %d" msgstr "Вузол: %.80s порт: %d" -#: vncviewer/CConn.cxx:169 +#: vncviewer/CConn.cxx:165 #, c-format msgid "Size: %d x %d" msgstr "Розмір: %d x %d" -#: vncviewer/CConn.cxx:177 +#: vncviewer/CConn.cxx:173 #, c-format msgid "Pixel format: %s" msgstr "Формат у пікÑелÑÑ…: %s" -#: vncviewer/CConn.cxx:184 +#: vncviewer/CConn.cxx:180 #, c-format msgid "(server default %s)" msgstr "(типовий Ð´Ð»Ñ Ñервера %s)" -#: vncviewer/CConn.cxx:189 +#: vncviewer/CConn.cxx:185 #, c-format msgid "Requested encoding: %s" msgstr "Запит щодо кодуваннÑ: %s" -#: vncviewer/CConn.cxx:194 +#: vncviewer/CConn.cxx:190 #, c-format msgid "Last used encoding: %s" msgstr "ОÑтаннє викориÑтане кодуваннÑ: %s" -#: vncviewer/CConn.cxx:199 +#: vncviewer/CConn.cxx:195 #, c-format msgid "Line speed estimate: %d kbit/s" msgstr "Оцінка швидкоÑÑ‚Ñ– лінії: %d кбіт/Ñ" -#: vncviewer/CConn.cxx:204 +#: vncviewer/CConn.cxx:200 #, c-format msgid "Protocol version: %d.%d" msgstr "ВерÑÑ–Ñ Ð¿Ñ€Ð¾Ñ‚Ð¾ÐºÐ¾Ð»Ñƒ: %d.%d" -#: vncviewer/CConn.cxx:209 +#: vncviewer/CConn.cxx:205 #, c-format msgid "Security method: %s" msgstr "Метод захиÑту: %s" -#: vncviewer/CConn.cxx:270 vncviewer/CConn.cxx:272 +#: vncviewer/CConn.cxx:266 vncviewer/CConn.cxx:268 msgid "The connection was dropped by the server before the session could be established." msgstr "З'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð±ÑƒÐ»Ð¾ розірвано Ñервером до того, Ñк виникла можливіÑÑ‚ÑŒ розпочати ÑеанÑ." -#: vncviewer/CConn.cxx:332 +#: vncviewer/CConn.cxx:326 #, c-format msgid "SetDesktopSize failed: %d" msgstr "Помилка SetDesktopSize: %d" -#: vncviewer/CConn.cxx:404 +#: vncviewer/CConn.cxx:399 msgid "Invalid SetColourMapEntries from server!" msgstr "Ðекоректне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ SetColourMapEntries від Ñервера!" -#: vncviewer/CConn.cxx:512 +#: vncviewer/CConn.cxx:507 #, c-format msgid "Throughput %d kbit/s - changing to quality %d" msgstr "ПропуÑкна здатніÑÑ‚ÑŒ %d кбіт/Ñ â€” змінюємо ÑкіÑÑ‚ÑŒ на %d" -#: vncviewer/CConn.cxx:534 +#: vncviewer/CConn.cxx:529 #, c-format msgid "Throughput %d kbit/s - full color is now enabled" msgstr "ПропуÑкна здатніÑÑ‚ÑŒ %d кбіт/Ñ â€” увімкнено повноцінні кольори" -#: vncviewer/CConn.cxx:537 +#: vncviewer/CConn.cxx:532 #, c-format msgid "Throughput %d kbit/s - full color is now disabled" msgstr "ПропуÑкна здатніÑÑ‚ÑŒ %d кбіт/Ñ â€” вимкнено повноцінні кольори" -#: vncviewer/CConn.cxx:563 +#: vncviewer/CConn.cxx:558 #, c-format msgid "Using pixel format %s" msgstr "ВикориÑтовуємо формат у пікÑелÑÑ… %s" -#: vncviewer/DesktopWindow.cxx:145 +#: vncviewer/DesktopWindow.cxx:146 msgid "Invalid geometry specified!" msgstr "Вказано некоректні геометричні параметри!" -#: vncviewer/DesktopWindow.cxx:166 +#: vncviewer/DesktopWindow.cxx:167 msgid "Reducing window size to fit on current monitor" msgstr "Зменшуємо розмір вікна, щоб уміÑтити його на поточному моніторі" @@ -140,12 +140,12 @@ msgstr "Коригувати розміри вікна, щоб уникнути msgid "Press %s to open the context menu" msgstr "ÐатиÑніть %s, щоб відкрити контекÑтне меню" -#: vncviewer/DesktopWindow.cxx:1083 vncviewer/DesktopWindow.cxx:1091 -#: vncviewer/DesktopWindow.cxx:1111 +#: vncviewer/DesktopWindow.cxx:1097 vncviewer/DesktopWindow.cxx:1105 +#: vncviewer/DesktopWindow.cxx:1125 msgid "Failure grabbing keyboard" msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби перехопити клавіатуру" -#: vncviewer/DesktopWindow.cxx:1401 +#: vncviewer/DesktopWindow.cxx:1415 msgid "Invalid screen layout computed for resize request!" msgstr "Результати обчиÑÐ»ÐµÐ½Ð½Ñ ÐºÐ¾Ð¼Ð¿Ð¾Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ñ–ÐºÐ½Ð° Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñ‚Ñƒ щодо зміни розмірів Ñ” некоректними!" @@ -154,218 +154,218 @@ msgid "Invalid state for 3 button emulation" msgstr "Ðекоректний Ñтан Ð´Ð»Ñ ÐµÐ¼ÑƒÐ»Ñції 3 кнопок" #: vncviewer/MonitorIndicesParameter.cxx:52 -#: vncviewer/MonitorIndicesParameter.cxx:105 +#: vncviewer/MonitorIndicesParameter.cxx:102 msgid "Failed to get system monitor configuration" msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¼Ð¾Ð½Ñ–Ñ‚Ð¾Ñ€Ð° з боку ÑиÑтеми" -#: vncviewer/MonitorIndicesParameter.cxx:83 +#: vncviewer/MonitorIndicesParameter.cxx:80 #, c-format msgid "Invalid configuration specified for %s" msgstr "Вказано некоректні Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ %s" -#: vncviewer/MonitorIndicesParameter.cxx:91 +#: vncviewer/MonitorIndicesParameter.cxx:88 #, c-format msgid "Monitor index %d does not exist" msgstr "Монітора із індекÑом %d не Ñ–Ñнує" -#: vncviewer/MonitorIndicesParameter.cxx:169 -#: vncviewer/MonitorIndicesParameter.cxx:189 +#: vncviewer/MonitorIndicesParameter.cxx:166 +#: vncviewer/MonitorIndicesParameter.cxx:186 #, c-format msgid "Invalid monitor index '%s'" msgstr "Ðекоректний Ñ–Ð½Ð´ÐµÐºÑ Ð¼Ð¾Ð½Ñ–Ñ‚Ð¾Ñ€Ð°, «%s»" -#: vncviewer/MonitorIndicesParameter.cxx:177 +#: vncviewer/MonitorIndicesParameter.cxx:174 #, c-format msgid "Unexpected character '%c'" msgstr "Ðеочікуваний Ñимвол «%c»" -#: vncviewer/OptionsDialog.cxx:63 -msgid "VNC Viewer: Connection Options" -msgstr "ЗаÑіб переглÑду VNC: параметри з’єднаннÑ" +#: vncviewer/OptionsDialog.cxx:64 +msgid "TigerVNC Options" +msgstr "Параметри TigerVNC" -#: vncviewer/OptionsDialog.cxx:89 vncviewer/ServerDialog.cxx:108 -#: vncviewer/vncviewer.cxx:417 +#: vncviewer/OptionsDialog.cxx:97 vncviewer/ServerDialog.cxx:102 +#: vncviewer/vncviewer.cxx:395 msgid "Cancel" msgstr "СкаÑувати" -#: vncviewer/OptionsDialog.cxx:94 vncviewer/vncviewer.cxx:416 +#: vncviewer/OptionsDialog.cxx:102 vncviewer/vncviewer.cxx:394 msgid "OK" msgstr "Гаразд" -#: vncviewer/OptionsDialog.cxx:484 +#: vncviewer/OptionsDialog.cxx:502 msgid "Compression" msgstr "СтиÑканнÑ" -#: vncviewer/OptionsDialog.cxx:501 +#: vncviewer/OptionsDialog.cxx:518 msgid "Auto select" msgstr "Ðвтовибір" -#: vncviewer/OptionsDialog.cxx:516 +#: vncviewer/OptionsDialog.cxx:529 msgid "Preferred encoding" msgstr "Бажане кодуваннÑ" -#: vncviewer/OptionsDialog.cxx:574 +#: vncviewer/OptionsDialog.cxx:590 msgid "Color level" msgstr "Рівень Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ ÐºÐ¾Ð»ÑŒÐ¾Ñ€Ñƒ" -#: vncviewer/OptionsDialog.cxx:585 +#: vncviewer/OptionsDialog.cxx:602 msgid "Full" msgstr "Повний" -#: vncviewer/OptionsDialog.cxx:592 +#: vncviewer/OptionsDialog.cxx:609 msgid "Medium" msgstr "Середній" -#: vncviewer/OptionsDialog.cxx:599 +#: vncviewer/OptionsDialog.cxx:616 msgid "Low" msgstr "Ðизький" -#: vncviewer/OptionsDialog.cxx:606 +#: vncviewer/OptionsDialog.cxx:623 msgid "Very low" msgstr "Дуже низький" -#: vncviewer/OptionsDialog.cxx:624 +#: vncviewer/OptionsDialog.cxx:645 msgid "Custom compression level:" msgstr "Ðетиповий рівень ÑтиÑканнÑ:" -#: vncviewer/OptionsDialog.cxx:630 +#: vncviewer/OptionsDialog.cxx:652 msgid "level (0=fast, 9=best)" msgstr "рівень (0=швидко, 9=найкраще)" -#: vncviewer/OptionsDialog.cxx:637 +#: vncviewer/OptionsDialog.cxx:659 msgid "Allow JPEG compression:" msgstr "Дозволити ÑтиÑÐºÐ°Ð½Ð½Ñ JPEG:" -#: vncviewer/OptionsDialog.cxx:643 +#: vncviewer/OptionsDialog.cxx:666 msgid "quality (0=poor, 9=best)" msgstr "ÑкіÑÑ‚ÑŒ (0=найгірша, 9=найкраща)" -#: vncviewer/OptionsDialog.cxx:654 +#: vncviewer/OptionsDialog.cxx:677 msgid "Security" msgstr "ЗахиÑÑ‚" -#: vncviewer/OptionsDialog.cxx:676 +#: vncviewer/OptionsDialog.cxx:691 msgid "Encryption" msgstr "ШифруваннÑ" -#: vncviewer/OptionsDialog.cxx:687 vncviewer/OptionsDialog.cxx:750 -#: vncviewer/OptionsDialog.cxx:854 +#: vncviewer/OptionsDialog.cxx:703 vncviewer/OptionsDialog.cxx:770 +#: vncviewer/OptionsDialog.cxx:876 msgid "None" msgstr "Ðемає" -#: vncviewer/OptionsDialog.cxx:694 +#: vncviewer/OptionsDialog.cxx:710 msgid "TLS with anonymous certificates" msgstr "TLS із анонімними Ñертифікатами" -#: vncviewer/OptionsDialog.cxx:700 +#: vncviewer/OptionsDialog.cxx:716 msgid "TLS with X509 certificates" msgstr "TLS з Ñертифікатами X509" -#: vncviewer/OptionsDialog.cxx:707 +#: vncviewer/OptionsDialog.cxx:723 msgid "Path to X509 CA certificate" msgstr "ШлÑÑ… до Ñертифіката CA X509" -#: vncviewer/OptionsDialog.cxx:714 +#: vncviewer/OptionsDialog.cxx:730 msgid "Path to X509 CRL file" msgstr "ШлÑÑ… до файла CRL X509" -#: vncviewer/OptionsDialog.cxx:739 +#: vncviewer/OptionsDialog.cxx:758 msgid "Authentication" msgstr "РозпізнаваннÑ" -#: vncviewer/OptionsDialog.cxx:756 +#: vncviewer/OptionsDialog.cxx:776 msgid "Standard VNC (insecure without encryption)" msgstr "Стандартний VNC (без захиÑту Ñ– шифруваннÑ)" -#: vncviewer/OptionsDialog.cxx:762 +#: vncviewer/OptionsDialog.cxx:782 msgid "Username and password (insecure without encryption)" msgstr "Ð†Ð¼â€™Ñ ÐºÐ¾Ñ€Ð¸Ñтувача Ñ– пароль (без захиÑту Ñ– шифруваннÑ)" -#: vncviewer/OptionsDialog.cxx:781 +#: vncviewer/OptionsDialog.cxx:805 msgid "Input" msgstr "ВведеннÑ" -#: vncviewer/OptionsDialog.cxx:794 +#: vncviewer/OptionsDialog.cxx:818 msgid "View only (ignore mouse and keyboard)" msgstr "Лише переглÑд (ігнорувати Ñигнали від миші Ñ– клавіатури)" -#: vncviewer/OptionsDialog.cxx:801 +#: vncviewer/OptionsDialog.cxx:825 msgid "Mouse" msgstr "Миша" -#: vncviewer/OptionsDialog.cxx:815 +#: vncviewer/OptionsDialog.cxx:837 msgid "Emulate middle mouse button" msgstr "Емулювати Ñередню кнопку миші" -#: vncviewer/OptionsDialog.cxx:821 +#: vncviewer/OptionsDialog.cxx:843 msgid "Show dot when no cursor" msgstr "Показувати крапку, Ñкщо немає курÑора" -#: vncviewer/OptionsDialog.cxx:835 +#: vncviewer/OptionsDialog.cxx:859 msgid "Keyboard" msgstr "Клавіатура" -#: vncviewer/OptionsDialog.cxx:849 +#: vncviewer/OptionsDialog.cxx:871 msgid "Pass system keys directly to server (full screen)" msgstr "Передавати натиÑÐºÐ°Ð½Ð½Ñ ÑиÑтемних клавіш безпоÑередньо до Ñервера (повноекранний режим)" -#: vncviewer/OptionsDialog.cxx:852 +#: vncviewer/OptionsDialog.cxx:874 msgid "Menu key" msgstr "Клавіша меню" -#: vncviewer/OptionsDialog.cxx:871 +#: vncviewer/OptionsDialog.cxx:895 msgid "Clipboard" msgstr "Буфер обміну" -#: vncviewer/OptionsDialog.cxx:885 +#: vncviewer/OptionsDialog.cxx:907 msgid "Accept clipboard from server" msgstr "Приймати вміÑÑ‚ буфера з Ñервера" -#: vncviewer/OptionsDialog.cxx:893 +#: vncviewer/OptionsDialog.cxx:915 msgid "Also set primary selection" msgstr "Також вÑтановити оÑновне позначене" -#: vncviewer/OptionsDialog.cxx:900 +#: vncviewer/OptionsDialog.cxx:922 msgid "Send clipboard to server" msgstr "ÐадіÑлати вміÑÑ‚ буфера обміну до Ñервера" -#: vncviewer/OptionsDialog.cxx:908 +#: vncviewer/OptionsDialog.cxx:930 msgid "Send primary selection as clipboard" msgstr "ÐадіÑлати оÑновне позначене Ñк буфер обміну" -#: vncviewer/OptionsDialog.cxx:927 +#: vncviewer/OptionsDialog.cxx:951 msgid "Display" msgstr "ДиÑплей" -#: vncviewer/OptionsDialog.cxx:941 +#: vncviewer/OptionsDialog.cxx:965 msgid "Display mode" msgstr "Режим показу" -#: vncviewer/OptionsDialog.cxx:956 +#: vncviewer/OptionsDialog.cxx:978 msgid "Windowed" msgstr "У вікні" -#: vncviewer/OptionsDialog.cxx:964 +#: vncviewer/OptionsDialog.cxx:986 msgid "Full screen on current monitor" msgstr "Повноекранний режим на поточному моніторі" -#: vncviewer/OptionsDialog.cxx:972 +#: vncviewer/OptionsDialog.cxx:994 msgid "Full screen on all monitors" msgstr "Повноекранний режимі на уÑÑ–Ñ… моніторах" -#: vncviewer/OptionsDialog.cxx:980 +#: vncviewer/OptionsDialog.cxx:1002 msgid "Full screen on selected monitor(s)" msgstr "Повноекранний режим на позначених моніторах" -#: vncviewer/OptionsDialog.cxx:1007 -msgid "Misc." +#: vncviewer/OptionsDialog.cxx:1031 +msgid "Miscellaneous" msgstr "Інше" -#: vncviewer/OptionsDialog.cxx:1015 +#: vncviewer/OptionsDialog.cxx:1039 msgid "Shared (don't disconnect other viewers)" msgstr "Спільний (не від’єднувати інші заÑоби переглÑду)" -#: vncviewer/OptionsDialog.cxx:1021 +#: vncviewer/OptionsDialog.cxx:1045 msgid "Ask to reconnect on connection errors" msgstr "Питати про повторне з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸ помилка з'єднаннÑ" @@ -373,31 +373,31 @@ msgstr "Питати про повторне з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð¿Ñ€Ð¸ помил msgid "VNC Viewer: Connection Details" msgstr "ЗаÑіб переглÑду VNC: подробиці з’єднаннÑ" -#: vncviewer/ServerDialog.cxx:65 vncviewer/ServerDialog.cxx:70 +#: vncviewer/ServerDialog.cxx:68 msgid "VNC server:" msgstr "Сервер VNC:" -#: vncviewer/ServerDialog.cxx:81 +#: vncviewer/ServerDialog.cxx:75 msgid "Options..." msgstr "Параметри…" -#: vncviewer/ServerDialog.cxx:86 +#: vncviewer/ServerDialog.cxx:79 msgid "Load..." msgstr "Завантажити…" -#: vncviewer/ServerDialog.cxx:91 +#: vncviewer/ServerDialog.cxx:83 msgid "Save As..." msgstr "Зберегти Ñк…" -#: vncviewer/ServerDialog.cxx:103 +#: vncviewer/ServerDialog.cxx:97 msgid "About..." msgstr "Про програму…" -#: vncviewer/ServerDialog.cxx:113 +#: vncviewer/ServerDialog.cxx:106 msgid "Connect" msgstr "З'єднатиÑÑ" -#: vncviewer/ServerDialog.cxx:145 +#: vncviewer/ServerDialog.cxx:143 #, c-format msgid "" "Unable to load the server history:\n" @@ -408,15 +408,15 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:173 vncviewer/ServerDialog.cxx:212 +#: vncviewer/ServerDialog.cxx:172 vncviewer/ServerDialog.cxx:212 msgid "TigerVNC configuration (*.tigervnc)" msgstr "Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ TigerVNC (*.tigervnc)" -#: vncviewer/ServerDialog.cxx:174 +#: vncviewer/ServerDialog.cxx:173 msgid "Select a TigerVNC configuration file" msgstr "Виберіть файл налаштувань TigerVNC" -#: vncviewer/ServerDialog.cxx:196 vncviewer/vncviewer.cxx:552 +#: vncviewer/ServerDialog.cxx:195 vncviewer/vncviewer.cxx:515 #, c-format msgid "" "Unable to load the specified configuration file:\n" @@ -436,7 +436,7 @@ msgstr "Зберегти Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ TigerVNC до файла" msgid "%s already exists. Do you want to overwrite?" msgstr "%s вже Ñ–Ñнує. ПерезапиÑати?" -#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:414 +#: vncviewer/ServerDialog.cxx:240 vncviewer/vncviewer.cxx:392 msgid "No" msgstr "ÐÑ–" @@ -477,31 +477,29 @@ msgstr "" "\n" "%s" -#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:387 -#: vncviewer/parameters.cxx:635 vncviewer/parameters.cxx:740 -#: vncviewer/vncviewer.cxx:459 -msgid "Could not obtain the home directory path" -msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ шлÑÑ… до домашнього каталогу" +#: vncviewer/ServerDialog.cxx:320 vncviewer/ServerDialog.cxx:386 +msgid "Could not obtain the state directory path" +msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ шлÑÑ… до каталогу Ñтану" -#: vncviewer/ServerDialog.cxx:333 vncviewer/ServerDialog.cxx:396 -#: vncviewer/parameters.cxx:646 vncviewer/parameters.cxx:753 +#: vncviewer/ServerDialog.cxx:332 vncviewer/ServerDialog.cxx:394 +#: vncviewer/parameters.cxx:644 vncviewer/parameters.cxx:750 #, c-format msgid "Could not open \"%s\": %s" msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ «%s»: %s" -#: vncviewer/ServerDialog.cxx:348 vncviewer/ServerDialog.cxx:356 -#: vncviewer/parameters.cxx:767 vncviewer/parameters.cxx:773 -#: vncviewer/parameters.cxx:804 vncviewer/parameters.cxx:833 -#: vncviewer/parameters.cxx:839 +#: vncviewer/ServerDialog.cxx:347 vncviewer/ServerDialog.cxx:355 +#: vncviewer/parameters.cxx:764 vncviewer/parameters.cxx:770 +#: vncviewer/parameters.cxx:801 vncviewer/parameters.cxx:830 +#: vncviewer/parameters.cxx:836 #, c-format msgid "Failed to read line %d in file %s: %s" msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ñ€Ñдок %d у файлі %s: %s" -#: vncviewer/ServerDialog.cxx:357 vncviewer/parameters.cxx:774 +#: vncviewer/ServerDialog.cxx:356 vncviewer/parameters.cxx:771 msgid "Line too long" msgstr "Занадто довгий Ñ€Ñдок" -#: vncviewer/UserDialog.cxx:98 +#: vncviewer/UserDialog.cxx:99 msgid "Opening password file failed" msgstr "Спроба Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ñ‚Ñ Ñ„Ð°Ð¹Ð»Ð° паролів зазнала невдачі" @@ -517,139 +515,139 @@ msgstr "Це з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ” безпечним" msgid "This connection is not secure" msgstr "Це з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð½Ðµ Ñ” безпечним" -#: vncviewer/UserDialog.cxx:146 +#: vncviewer/UserDialog.cxx:151 msgid "Username:" msgstr "КориÑтувач:" -#: vncviewer/UserDialog.cxx:159 +#: vncviewer/UserDialog.cxx:164 msgid "Password:" msgstr "Пароль:" -#: vncviewer/UserDialog.cxx:198 +#: vncviewer/UserDialog.cxx:207 msgid "Authentication cancelled" msgstr "Ð Ð¾Ð·Ð¿Ñ–Ð·Ð½Ð°Ð²Ð°Ð½Ð½Ñ ÑкаÑовано" -#: vncviewer/Viewport.cxx:391 +#: vncviewer/Viewport.cxx:390 #, c-format msgid "Failed to update keyboard LED state: %lu" msgstr "Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ Ñтан лампочки клавіатури: %lu" -#: vncviewer/Viewport.cxx:397 vncviewer/Viewport.cxx:403 +#: vncviewer/Viewport.cxx:396 vncviewer/Viewport.cxx:402 #, c-format msgid "Failed to update keyboard LED state: %d" msgstr "Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ Ñтан лампочки клавіатури: %d" -#: vncviewer/Viewport.cxx:433 +#: vncviewer/Viewport.cxx:432 msgid "Failed to update keyboard LED state" msgstr "Ðе вдалоÑÑ Ð¾Ð½Ð¾Ð²Ð¸Ñ‚Ð¸ Ñтан лампочки клавіатури" -#: vncviewer/Viewport.cxx:460 vncviewer/Viewport.cxx:468 -#: vncviewer/Viewport.cxx:485 +#: vncviewer/Viewport.cxx:459 vncviewer/Viewport.cxx:467 +#: vncviewer/Viewport.cxx:484 #, c-format msgid "Failed to get keyboard LED state: %d" msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ Ñтан лампочки клавіатури: %d" -#: vncviewer/Viewport.cxx:849 +#: vncviewer/Viewport.cxx:839 msgid "No key code specified on key press" msgstr "Ðе вказано коду клавіші при натиÑканні" -#: vncviewer/Viewport.cxx:1008 +#: vncviewer/Viewport.cxx:990 #, c-format msgid "No scan code for extended virtual key 0x%02x" msgstr "Ðемає коду ÑÐºÐ°Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð²Ñ–Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð¾Ñ— клавіші Ñ€Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ 0x%02x" -#: vncviewer/Viewport.cxx:1010 +#: vncviewer/Viewport.cxx:992 #, c-format msgid "No scan code for virtual key 0x%02x" msgstr "Ðемає коду ÑÐºÐ°Ð½ÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð»Ñ Ð²Ñ–Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð¾Ñ— клавіші 0x%02x" -#: vncviewer/Viewport.cxx:1016 +#: vncviewer/Viewport.cxx:998 #, c-format msgid "Invalid scan code 0x%02x" msgstr "Ðекоректний код ÑÐºÐ°Ð½ÑƒÐ²Ð°Ð½Ð½Ñ 0x%02x" -#: vncviewer/Viewport.cxx:1046 +#: vncviewer/Viewport.cxx:1028 #, c-format msgid "No symbol for extended virtual key 0x%02x" msgstr "Ðемає Ñимволу Ð´Ð»Ñ Ð²Ñ–Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð¾Ñ— клавіші Ñ€Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ 0x%02x" -#: vncviewer/Viewport.cxx:1048 +#: vncviewer/Viewport.cxx:1030 #, c-format msgid "No symbol for virtual key 0x%02x" msgstr "Ðемає Ñимволу Ð´Ð»Ñ Ð²Ñ–Ñ€Ñ‚ÑƒÐ°Ð»ÑŒÐ½Ð¾Ñ— клавіші 0x%02x" -#: vncviewer/Viewport.cxx:1154 +#: vncviewer/Viewport.cxx:1136 #, c-format msgid "No symbol for key code 0x%02x (in the current state)" msgstr "Ðемає Ñимволу Ð´Ð»Ñ ÐºÐ»Ð°Ð²Ñ–ÑˆÑ– з кодом 0x%02x (у поточному Ñтані)" -#: vncviewer/Viewport.cxx:1187 +#: vncviewer/Viewport.cxx:1169 #, c-format msgid "No symbol for key code %d (in the current state)" msgstr "Ðемає Ñимволу Ð´Ð»Ñ ÐºÐ»Ð°Ð²Ñ–ÑˆÑ– з кодом %d (у поточному Ñтані)" -#: vncviewer/Viewport.cxx:1247 +#: vncviewer/Viewport.cxx:1229 msgctxt "ContextMenu|" -msgid "Dis&connect" +msgid "Disconn&ect" msgstr "Від'єд&натиÑÑ" -#: vncviewer/Viewport.cxx:1250 +#: vncviewer/Viewport.cxx:1232 msgctxt "ContextMenu|" msgid "&Full screen" msgstr "&Ðа веÑÑŒ екран" -#: vncviewer/Viewport.cxx:1253 +#: vncviewer/Viewport.cxx:1235 msgctxt "ContextMenu|" msgid "Minimi&ze" msgstr "Ðœ&інімізувати" -#: vncviewer/Viewport.cxx:1255 +#: vncviewer/Viewport.cxx:1237 msgctxt "ContextMenu|" msgid "Resize &window to session" msgstr "Змінити &розміри вікна відповідно до ÑеанÑу" -#: vncviewer/Viewport.cxx:1260 +#: vncviewer/Viewport.cxx:1242 msgctxt "ContextMenu|" msgid "&Ctrl" msgstr "&Ctrl" -#: vncviewer/Viewport.cxx:1263 +#: vncviewer/Viewport.cxx:1245 msgctxt "ContextMenu|" msgid "&Alt" msgstr "&Alt" -#: vncviewer/Viewport.cxx:1269 +#: vncviewer/Viewport.cxx:1251 #, c-format msgctxt "ContextMenu|" msgid "Send %s" msgstr "ÐадіÑлати %s" -#: vncviewer/Viewport.cxx:1275 +#: vncviewer/Viewport.cxx:1257 msgctxt "ContextMenu|" msgid "Send Ctrl-Alt-&Del" msgstr "Ðа&діÑлати Ctrl-Alt-Del" -#: vncviewer/Viewport.cxx:1278 +#: vncviewer/Viewport.cxx:1260 msgctxt "ContextMenu|" msgid "&Refresh screen" msgstr "&Оновити вміÑÑ‚ екрана" -#: vncviewer/Viewport.cxx:1281 +#: vncviewer/Viewport.cxx:1263 msgctxt "ContextMenu|" msgid "&Options..." msgstr "П&араметри…" -#: vncviewer/Viewport.cxx:1283 +#: vncviewer/Viewport.cxx:1265 msgctxt "ContextMenu|" msgid "Connection &info..." msgstr "Дані щодо з’&єднаннÑ…" -#: vncviewer/Viewport.cxx:1285 +#: vncviewer/Viewport.cxx:1267 msgctxt "ContextMenu|" msgid "About &TigerVNC viewer..." msgstr "Про &заÑіб переглÑду TigerVNC…" -#: vncviewer/Viewport.cxx:1374 +#: vncviewer/Viewport.cxx:1356 msgid "VNC connection info" msgstr "Дані щодо Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VNC" @@ -657,27 +655,27 @@ msgstr "Дані щодо Ð·â€™Ñ”Ð´Ð½Ð°Ð½Ð½Ñ VNC" msgid "Window is registered for touch instead of gestures" msgstr "Вікно зареєÑтровано Ð´Ð»Ñ ÑенÑорних дій, а не Ð´Ð»Ñ Ð¶ÐµÑтів" -#: vncviewer/Win32TouchHandler.cxx:81 +#: vncviewer/Win32TouchHandler.cxx:82 #, c-format msgid "Failed to set gesture configuration (error 0x%x)" msgstr "Ðе вдалоÑÑ Ð²Ñтановити Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð¶ÐµÑтів (помилка 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:93 +#: vncviewer/Win32TouchHandler.cxx:94 #, c-format msgid "Failed to get gesture information (error 0x%x)" msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ відомоÑÑ‚Ñ– щодо жеÑтів (помилка 0x%x)" -#: vncviewer/Win32TouchHandler.cxx:358 +#: vncviewer/Win32TouchHandler.cxx:359 #, c-format msgid "Invalid mouse button %d, must be a number between 1 and 7." msgstr "Ðекоректна кнопка миші, %d, номер кнопки має бути чиÑлом від 1 до 7." -#: vncviewer/Win32TouchHandler.cxx:423 +#: vncviewer/Win32TouchHandler.cxx:424 #, c-format msgid "Unhandled key 0x%x - can't generate keyboard event." msgstr "Ðепридатна до обробки клавіша 0x%x — не вдалоÑÑ Ñтворити подію клавіатури." -#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:107 +#: vncviewer/XInputTouchHandler.cxx:102 vncviewer/touch.cxx:108 #, c-format msgid "Unable to get X Input 2 event mask for window 0x%08lx" msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ маÑку події X Input 2 Ð´Ð»Ñ Ð²Ñ–ÐºÐ½Ð° 0x%08lx" @@ -687,7 +685,7 @@ msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ маÑку події X Input 2 дРmsgid "Window 0x%08lx has no X Input 2 event mask" msgstr "У вікна 0x%08lx немає маÑки подій X Input 2" -#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:114 +#: vncviewer/XInputTouchHandler.cxx:112 vncviewer/touch.cxx:115 #, c-format msgid "Window 0x%08lx has more than one X Input 2 event mask" msgstr "У вікна 0x%08lx Ñ” декілька маÑок подій X Input 2" @@ -698,7 +696,7 @@ msgid "Failure grabbing device %i" msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби захопити приÑтрій %i" #: vncviewer/org.tigervnc.vncviewer.metainfo.xml.in:13 -#: vncviewer/vncviewer.cxx:406 vncviewer/vncviewer.desktop.in.in:3 +#: vncviewer/vncviewer.cxx:389 vncviewer/vncviewer.desktop.in.in:3 msgid "TigerVNC Viewer" msgstr "ЗаÑіб переглÑду TigerVNC" @@ -727,120 +725,124 @@ msgstr "З'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ ÐŸÐµÑ€ÐµÐ³Ð»Ñдача TigerVNC із комп'ютер msgid "TigerVNC Viewer connection to a Windows machine" msgstr "З'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ ÐŸÐµÑ€ÐµÐ³Ð»Ñдача TigerVNC із комп'ютером, де працює Windows" -#: vncviewer/parameters.cxx:308 vncviewer/parameters.cxx:333 -#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:390 -#: vncviewer/parameters.cxx:410 +#: vncviewer/parameters.cxx:307 vncviewer/parameters.cxx:332 +#: vncviewer/parameters.cxx:349 vncviewer/parameters.cxx:389 +#: vncviewer/parameters.cxx:409 msgid "The name of the parameter is too large" msgstr "Ðазва параметра Ñ” надто довгою" -#: vncviewer/parameters.cxx:312 vncviewer/parameters.cxx:317 -#: vncviewer/parameters.cxx:368 +#: vncviewer/parameters.cxx:311 vncviewer/parameters.cxx:316 +#: vncviewer/parameters.cxx:367 msgid "The parameter is too large" msgstr "Параметр Ñ” надто великим" -#: vncviewer/parameters.cxx:375 vncviewer/parameters.cxx:696 -#: vncviewer/parameters.cxx:818 +#: vncviewer/parameters.cxx:374 vncviewer/parameters.cxx:694 +#: vncviewer/parameters.cxx:815 msgid "Invalid format or too large value" msgstr "Ðекоректне Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ð°Ð±Ð¾ надто велике значеннÑ" -#: vncviewer/parameters.cxx:429 vncviewer/parameters.cxx:460 +#: vncviewer/parameters.cxx:428 vncviewer/parameters.cxx:459 msgid "Failed to create registry key" msgstr "Ðе вдалоÑÑ Ñтворити ключ реєÑтру" -#: vncviewer/parameters.cxx:448 vncviewer/parameters.cxx:503 -#: vncviewer/parameters.cxx:545 vncviewer/parameters.cxx:612 +#: vncviewer/parameters.cxx:447 vncviewer/parameters.cxx:502 +#: vncviewer/parameters.cxx:544 vncviewer/parameters.cxx:611 msgid "Failed to close registry key" msgstr "Ðе вдалоÑÑ Ð·Ð°ÐºÑ€Ð¸Ñ‚Ð¸ ключ реєÑтру" -#: vncviewer/parameters.cxx:466 vncviewer/parameters.cxx:483 -#: vncviewer/parameters.cxx:654 vncviewer/parameters.cxx:664 -#: vncviewer/parameters.cxx:675 +#: vncviewer/parameters.cxx:465 vncviewer/parameters.cxx:482 +#: vncviewer/parameters.cxx:652 vncviewer/parameters.cxx:662 +#: vncviewer/parameters.cxx:673 #, c-format msgid "Failed to save \"%s\": %s" msgstr "Ðе вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ «%s»: %s" -#: vncviewer/parameters.cxx:479 vncviewer/parameters.cxx:567 -#: vncviewer/parameters.cxx:677 vncviewer/parameters.cxx:714 +#: vncviewer/parameters.cxx:478 vncviewer/parameters.cxx:566 +#: vncviewer/parameters.cxx:675 vncviewer/parameters.cxx:712 msgid "Unknown parameter type" msgstr "Ðевідомий тип параметра" -#: vncviewer/parameters.cxx:496 +#: vncviewer/parameters.cxx:495 #, c-format msgid "Failed to remove \"%s\": %s" msgstr "Ðе вдалоÑÑ Ð²Ð¸Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ «%s»: %s" -#: vncviewer/parameters.cxx:518 vncviewer/parameters.cxx:590 +#: vncviewer/parameters.cxx:517 vncviewer/parameters.cxx:589 msgid "Failed to open registry key" msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ ключ реєÑтру" -#: vncviewer/parameters.cxx:535 +#: vncviewer/parameters.cxx:534 #, c-format msgid "Failed to read server history entry %d: %s" msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ Ð·Ð°Ð¿Ð¸Ñ Ð¶ÑƒÑ€Ð½Ð°Ð»Ñƒ Ñервера %d: %s" -#: vncviewer/parameters.cxx:571 vncviewer/parameters.cxx:601 +#: vncviewer/parameters.cxx:570 vncviewer/parameters.cxx:600 #, c-format msgid "Failed to read parameter \"%s\": %s" msgstr "Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ параметр «%s»: %s" -#: vncviewer/parameters.cxx:655 vncviewer/parameters.cxx:666 +#: vncviewer/parameters.cxx:634 vncviewer/parameters.cxx:738 +msgid "Could not obtain the config directory path" +msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ шлÑÑ… до каталогу налаштувань" + +#: vncviewer/parameters.cxx:653 vncviewer/parameters.cxx:664 msgid "Could not encode parameter" msgstr "Ðе вдалоÑÑ Ð·Ð°ÐºÐ¾Ð´ÑƒÐ²Ð°Ñ‚Ð¸ параметр" -#: vncviewer/parameters.cxx:783 +#: vncviewer/parameters.cxx:780 #, c-format msgid "Configuration file %s is in an invalid format" msgstr "Файл налаштувань %s збережено у некоректному форматі" -#: vncviewer/parameters.cxx:805 +#: vncviewer/parameters.cxx:802 msgid "Invalid format" msgstr "Ðекоректне форматуваннÑ" -#: vncviewer/parameters.cxx:840 +#: vncviewer/parameters.cxx:837 msgid "Unknown parameter" msgstr "Ðевідомий параметр" -#: vncviewer/touch.cxx:75 +#: vncviewer/touch.cxx:76 #, c-format msgid "Got message (0x%x) for an unhandled window" msgstr "Отримано Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ (0x%x) Ð´Ð»Ñ Ð²Ñ–ÐºÐ½Ð°, обробка Ñкого не здійÑнюєтьÑÑ" -#: vncviewer/touch.cxx:138 vncviewer/touch.cxx:160 +#: vncviewer/touch.cxx:139 vncviewer/touch.cxx:161 #, c-format msgid "Invalid window 0x%08lx specified for pointer grab" msgstr "Ð”Ð»Ñ Ð·Ð°Ñ…Ð¾Ð¿Ð»ÐµÐ½Ð½Ñ Ð²ÐºÐ°Ð·Ñ–Ð²Ð½Ð¸ÐºÐ° вказано некоректне вікно 0x%08lx" -#: vncviewer/touch.cxx:183 vncviewer/touch.cxx:184 +#: vncviewer/touch.cxx:184 vncviewer/touch.cxx:185 #, c-format msgid "Failed to create touch handler: %s" msgstr "Ðе вдалоÑÑ Ñтворити обробник ÑенÑорних даних: %s" -#: vncviewer/touch.cxx:188 +#: vncviewer/touch.cxx:189 #, c-format msgid "Couldn't attach event handler to window (error 0x%x)" msgstr "Ðе вдалоÑÑ Ð´Ð¾Ð»ÑƒÑ‡Ð¸Ñ‚Ð¸ обробник подій до вікна (помилка 0x%x)" -#: vncviewer/touch.cxx:212 +#: vncviewer/touch.cxx:216 msgid "Failed to get event data for X Input event" msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ дані події Ð´Ð»Ñ Ð¿Ð¾Ð´Ñ–Ñ— X Input" -#: vncviewer/touch.cxx:225 +#: vncviewer/touch.cxx:229 msgid "X Input event for unknown window" msgstr "ÐŸÐ¾Ð´Ñ–Ñ X Input Ð´Ð»Ñ Ð½ÐµÐ²Ñ–Ð´Ð¾Ð¼Ð¾Ð³Ð¾ вікна" -#: vncviewer/touch.cxx:251 +#: vncviewer/touch.cxx:255 msgid "X Input extension not available." msgstr "Ð Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ X Input Ñ” недоÑтупним." -#: vncviewer/touch.cxx:258 +#: vncviewer/touch.cxx:262 msgid "X Input 2 (or newer) is not available." msgstr "Ðемає доÑтупу до X Input 2 (або новішої верÑÑ–Ñ—)." -#: vncviewer/touch.cxx:263 +#: vncviewer/touch.cxx:267 msgid "X Input 2.2 (or newer) is not available. Touch gestures will not be supported." msgstr "Ðемає доÑтупу до X Input 2.2 (або новішої верÑÑ–Ñ—). Ви не зможете ÑкориÑтатиÑÑ Ð¿Ñ–Ð´Ñ‚Ñ€Ð¸Ð¼ÐºÐ¾ÑŽ ÑенÑорних жеÑтів." -#: vncviewer/vncviewer.cxx:107 +#: vncviewer/vncviewer.cxx:104 #, c-format msgid "" "TigerVNC Viewer v%s\n" @@ -853,7 +855,7 @@ msgstr "" "ÐвторÑькі права належать команді TigerVNC та багатьом іншим (див. файл README.rst), 1999–%d\n" "Докладніший Ð¾Ð¿Ð¸Ñ TigerVNC можна знайти на https://www.tigervnc.org." -#: vncviewer/vncviewer.cxx:161 +#: vncviewer/vncviewer.cxx:158 #, c-format msgid "" "An unexpected error occurred when communicating with the server:\n" @@ -864,15 +866,15 @@ msgstr "" "\n" "%s" -#: vncviewer/vncviewer.cxx:177 +#: vncviewer/vncviewer.cxx:174 msgid "About TigerVNC Viewer" msgstr "Про заÑіб переглÑду TigerVNC" -#: vncviewer/vncviewer.cxx:198 +#: vncviewer/vncviewer.cxx:195 msgid "Internal FLTK error. Exiting." msgstr "Ð’Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ° FLTK. Завершуємо роботу." -#: vncviewer/vncviewer.cxx:217 +#: vncviewer/vncviewer.cxx:214 #, c-format msgid "" "%s\n" @@ -883,79 +885,102 @@ msgstr "" "\n" "Спробувати вÑтановити з'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ñ‰Ðµ раз?" -#: vncviewer/vncviewer.cxx:248 vncviewer/vncviewer.cxx:260 +#: vncviewer/vncviewer.cxx:245 vncviewer/vncviewer.cxx:257 #, c-format msgid "Error starting new TigerVNC Viewer: %s" msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби запуÑку нового заÑобу переглÑду TigerVNC: %s" -#: vncviewer/vncviewer.cxx:269 +#: vncviewer/vncviewer.cxx:266 #, c-format msgid "Termination signal %d has been received. TigerVNC Viewer will now exit." msgstr "Отримано Ñигнал Ð¿ÐµÑ€ÐµÑ€Ð¸Ð²Ð°Ð½Ð½Ñ %d. Зараз заÑіб переглÑду TigerVNC завершить роботу." -#: vncviewer/vncviewer.cxx:415 +#: vncviewer/vncviewer.cxx:393 msgid "Yes" msgstr "Так" -#: vncviewer/vncviewer.cxx:418 +#: vncviewer/vncviewer.cxx:396 msgid "Close" msgstr "Закрити" -#: vncviewer/vncviewer.cxx:423 +#: vncviewer/vncviewer.cxx:401 msgid "About" msgstr "Про програму" -#: vncviewer/vncviewer.cxx:426 +#: vncviewer/vncviewer.cxx:404 msgid "Hide" msgstr "Сховати" -#: vncviewer/vncviewer.cxx:429 +#: vncviewer/vncviewer.cxx:407 msgid "Quit" msgstr "Вийти" -#: vncviewer/vncviewer.cxx:433 +#: vncviewer/vncviewer.cxx:411 msgid "Services" msgstr "Служби" -#: vncviewer/vncviewer.cxx:434 +#: vncviewer/vncviewer.cxx:412 msgid "Hide Others" msgstr "Сховати решту" -#: vncviewer/vncviewer.cxx:435 +#: vncviewer/vncviewer.cxx:413 msgid "Show All" msgstr "Показати вÑÑ–" -#: vncviewer/vncviewer.cxx:444 +#: vncviewer/vncviewer.cxx:422 msgctxt "SysMenu|" msgid "&File" msgstr "&Файл" -#: vncviewer/vncviewer.cxx:447 +#: vncviewer/vncviewer.cxx:425 msgctxt "SysMenu|File|" msgid "&New Connection" msgstr "&Створити з'єднаннÑ" -#: vncviewer/vncviewer.cxx:463 -#, c-format -msgid "Could not create VNC home directory: %s" -msgstr "Ðе вдалоÑÑ Ñтворити домашній каталог VNC: %s" - -#: vncviewer/vncviewer.cxx:562 +#: vncviewer/vncviewer.cxx:525 msgid "FullScreenAllMonitors is deprecated, set FullScreenMode to 'all' instead" msgstr "FullScreenAllMonitors вважаєтьÑÑ Ð·Ð°Ñтарілим, заміÑÑ‚ÑŒ нього Ñлід вÑтановити Ð´Ð»Ñ FullScreenMode Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Â«all»" +#: vncviewer/vncviewer.cxx:721 +msgid "~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to." +msgstr "~/.vnc вважаєтьÑÑ Ð·Ð°Ñтарілим, будь лаÑка, ознайомтеÑÑ Ñ–Ð· «man vncviewer», щоб дізнатиÑÑ Ð±Ñ–Ð»ÑŒÑˆÐµ про перенеÑÐµÐ½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ…." + +#: vncviewer/vncviewer.cxx:725 +#, c-format +msgid "%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location." +msgstr "%%APPDATA%%\\vnc вважаєтьÑÑ Ð·Ð°Ñтарілим, будь лаÑка, переходьте на %%APPDATA%%\\TigerVNC." + +#: vncviewer/vncviewer.cxx:730 +#, c-format +msgid "Could not create VNC config directory: %s" +msgstr "Ðе вдалоÑÑ Ñтворити каталог налаштувань VNC: %s" + +#: vncviewer/vncviewer.cxx:735 +#, c-format +msgid "Could not create VNC data directory: %s" +msgstr "Ðе вдалоÑÑ Ñтворити каталог даних VNC: %s" + +#: vncviewer/vncviewer.cxx:740 +#, c-format +msgid "Could not create VNC state directory: %s" +msgstr "Ðе вдалоÑÑ Ñтворити каталог Ñтану VNC: %s" + #. TRANSLATORS: "Parameters" are command line arguments, or settings #. from a file or the Windows registry. -#: vncviewer/vncviewer.cxx:768 vncviewer/vncviewer.cxx:769 +#: vncviewer/vncviewer.cxx:755 vncviewer/vncviewer.cxx:756 msgid "Parameters -listen and -via are incompatible" msgstr "Параметри -listen Ñ– -via Ñ” неÑуміÑними" -#: vncviewer/vncviewer.cxx:783 +#: vncviewer/vncviewer.cxx:770 +msgid "Unable to listen for incoming connections" +msgstr "Ðе вдалоÑÑ Ð²Ð¸ÐºÐ¾Ð½Ð°Ñ‚Ð¸ ÑÑ‚ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° вхідними з'єднаннÑми" + +#: vncviewer/vncviewer.cxx:772 #, c-format msgid "Listening on port %d" msgstr "Очікуємо на дані на порту %d" -#: vncviewer/vncviewer.cxx:816 +#: vncviewer/vncviewer.cxx:805 #, c-format msgid "" "Failure waiting for incoming VNC connection:\n" @@ -970,6 +995,12 @@ msgstr "" msgid "Remote Desktop Viewer" msgstr "ЗаÑіб переглÑду віддаленої Ñтільниці" +#~ msgid "VNC Viewer: Connection Options" +#~ msgstr "ЗаÑіб переглÑду VNC: параметри з’єднаннÑ" + +#~ msgid "Misc." +#~ msgstr "Інше" + #~ msgid "Failed to get monitor name because X11 RandR could not be found" #~ msgstr "Ðе вдалоÑÑ Ð¾Ñ‚Ñ€Ð¸Ð¼Ð°Ñ‚Ð¸ назву монітора, оÑкільки не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñ‚Ð¸ RandR X11" diff --git a/release/CMakeLists.txt b/release/CMakeLists.txt index 043cc1c5..6cb14de0 100644 --- a/release/CMakeLists.txt +++ b/release/CMakeLists.txt @@ -18,7 +18,7 @@ configure_file(tigervnc.iss.in tigervnc.iss) add_custom_target(installer iscc -o. ${INST_DEFS} -F${CMAKE_PROJECT_NAME}${INST_SUFFIX}-${VERSION} tigervnc.iss DEPENDS vncviewer - SOURCES tigervnc.iss) + SOURCES ${CMAKE_CURRENT_BINARY_DIR}/tigervnc.iss) if(BUILD_WINVNC) configure_file(winvnc.iss.in winvnc.iss) @@ -26,7 +26,7 @@ if(BUILD_WINVNC) add_custom_target(winvnc_installer iscc -o. ${INST_DEFS} -F${CMAKE_PROJECT_NAME}${INST_SUFFIX}-winvnc-${VERSION} winvnc.iss DEPENDS winvnc4 wm_hooks vncconfig - SOURCES winvnc.iss) + SOURCES ${CMAKE_CURRENT_BINARY_DIR}/winvnc.iss) endif() endif() # WIN32 diff --git a/tests/perf/decperf.cxx b/tests/perf/decperf.cxx index c72ec1d7..ef53a686 100644 --- a/tests/perf/decperf.cxx +++ b/tests/perf/decperf.cxx @@ -52,11 +52,11 @@ class DummyOutStream : public rdr::OutStream { public: DummyOutStream(); - virtual size_t length(); - virtual void flush(); + size_t length() override; + void flush() override; private: - virtual void overrun(size_t needed); + void overrun(size_t needed) override; int offset; uint8_t buf[131072]; @@ -67,15 +67,14 @@ public: CConn(const char *filename); ~CConn(); - virtual void initDone(); - virtual void setPixelFormat(const rfb::PixelFormat& pf); - virtual void setCursor(int, int, const rfb::Point&, const uint8_t*); - virtual void setCursorPos(const rfb::Point&); - virtual void framebufferUpdateStart(); - virtual void framebufferUpdateEnd(); - virtual void setColourMapEntries(int, int, uint16_t*); - virtual void bell(); - virtual void serverCutText(const char*); + void initDone() override; + void setCursor(int, int, const rfb::Point&, const uint8_t*) override; + void setCursorPos(const rfb::Point&) override; + void framebufferUpdateStart() override; + void framebufferUpdateEnd() override; + void setColourMapEntries(int, int, uint16_t*) override; + void bell() override; + void serverCutText(const char*) override; public: double cpuTime; @@ -139,12 +138,6 @@ void CConn::initDone() server.height())); } -void CConn::setPixelFormat(const rfb::PixelFormat& /*pf*/) -{ - // Override format - CConnection::setPixelFormat(filePF); -} - void CConn::setCursor(int, int, const rfb::Point&, const uint8_t*) { } @@ -193,7 +186,7 @@ static struct stats runTest(const char *fn) struct timeval start, stop; struct stats s; - gettimeofday(&start, NULL); + gettimeofday(&start, nullptr); try { cc = new CConn(fn); @@ -211,7 +204,7 @@ static struct stats runTest(const char *fn) exit(1); } - gettimeofday(&stop, NULL); + gettimeofday(&stop, nullptr); s.decodeTime = cc->cpuTime; s.realTime = (double)stop.tv_sec - start.tv_sec; diff --git a/tests/perf/encperf.cxx b/tests/perf/encperf.cxx index 388dcc95..ac8e9d47 100644 --- a/tests/perf/encperf.cxx +++ b/tests/perf/encperf.cxx @@ -80,11 +80,11 @@ class DummyOutStream : public rdr::OutStream { public: DummyOutStream(); - virtual size_t length(); - virtual void flush(); + size_t length() override; + void flush() override; private: - virtual void overrun(size_t needed); + void overrun(size_t needed) override; int offset; uint8_t buf[131072]; @@ -98,16 +98,16 @@ public: void getStats(double& ratio, unsigned long long& bytes, unsigned long long& rawEquivalent); - virtual void initDone() {}; - virtual void resizeFramebuffer(); - virtual void setCursor(int, int, const rfb::Point&, const uint8_t*); - virtual void setCursorPos(const rfb::Point&); - virtual void framebufferUpdateStart(); - virtual void framebufferUpdateEnd(); - virtual bool dataRect(const rfb::Rect&, int); - virtual void setColourMapEntries(int, int, uint16_t*); - virtual void bell(); - virtual void serverCutText(const char*); + void initDone() override {}; + void resizeFramebuffer() override; + void setCursor(int, int, const rfb::Point&, const uint8_t*) override; + void setCursorPos(const rfb::Point&) override; + void framebufferUpdateStart() override; + void framebufferUpdateEnd() override; + bool dataRect(const rfb::Rect&, int) override; + void setColourMapEntries(int, int, uint16_t*) override; + void bell() override; + void serverCutText(const char*) override; public: double decodeTime; @@ -136,10 +136,10 @@ public: void getStats(double&, unsigned long long&, unsigned long long&); - virtual void setAccessRights(rfb::AccessRights ar); + void setAccessRights(rfb::AccessRights ar) override; - virtual void setDesktopSize(int fb_width, int fb_height, - const rfb::ScreenSet& layout); + void setDesktopSize(int fb_width, int fb_height, + const rfb::ScreenSet& layout) override; protected: DummyOutStream *out; @@ -189,7 +189,7 @@ CConn::CConn(const char *filename) // Nor the frame buffer size and format rfb::PixelFormat pf; pf.parse(format); - setPixelFormat(pf); + server.setPF(pf); setDesktopSize(width, height); sc = new SConn(); @@ -279,8 +279,8 @@ void CConn::serverCutText(const char*) { } -Manager::Manager(class rfb::SConnection *conn) : - EncodeManager(conn) +Manager::Manager(class rfb::SConnection *conn_) : + EncodeManager(conn_) { } @@ -308,7 +308,7 @@ SConn::SConn() : SConnection(rfb::AccessDefault) { out = new DummyOutStream; - setStreams(NULL, out); + setStreams(nullptr, out); setWriter(new rfb::SMsgWriter(&client, out)); @@ -323,7 +323,7 @@ SConn::~SConn() void SConn::writeUpdate(const rfb::UpdateInfo& ui, const rfb::PixelBuffer* pb) { - manager->writeUpdate(ui, pb, NULL); + manager->writeUpdate(ui, pb, nullptr); } void SConn::getStats(double& ratio, unsigned long long& bytes, @@ -357,7 +357,7 @@ static struct stats runTest(const char *fn) struct stats s; struct timeval start, stop; - gettimeofday(&start, NULL); + gettimeofday(&start, nullptr); try { cc = new CConn(fn); @@ -375,7 +375,7 @@ static struct stats runTest(const char *fn) exit(1); } - gettimeofday(&stop, NULL); + gettimeofday(&stop, nullptr); s.decodeTime = cc->decodeTime; s.encodeTime = cc->encodeTime; @@ -388,13 +388,13 @@ static struct stats runTest(const char *fn) return s; } -static void sort(double *array, int count) +static void sort(double *array, int len) { bool sorted; int i; do { sorted = true; - for (i = 1; i < count; i++) { + for (i = 1; i < len; i++) { if (array[i-1] > array[i]) { double d; d = array[i]; @@ -420,7 +420,7 @@ int main(int argc, char **argv) const char *fn; - fn = NULL; + fn = nullptr; for (i = 1; i < argc; i++) { if (rfb::Configuration::setParam(argv[i])) continue; @@ -435,7 +435,7 @@ int main(int argc, char **argv) usage(argv[0]); } - if (fn != NULL) + if (fn != nullptr) usage(argv[0]); fn = argv[i]; @@ -447,7 +447,7 @@ int main(int argc, char **argv) double *dev = new double[runCount]; double median, meddev; - if (fn == NULL) { + if (fn == nullptr) { fprintf(stderr, "No file specified!\n\n"); usage(argv[0]); } diff --git a/tests/perf/fbperf.cxx b/tests/perf/fbperf.cxx index dddf19fb..357aede2 100644 --- a/tests/perf/fbperf.cxx +++ b/tests/perf/fbperf.cxx @@ -43,10 +43,10 @@ public: virtual void start(int width, int height); virtual void stop(); - virtual void draw(); + void draw() override; protected: - virtual void flush(); + void flush() override; void update(); virtual void changefb(); @@ -63,17 +63,17 @@ protected: class PartialTestWindow: public TestWindow { protected: - virtual void changefb(); + void changefb() override; }; class OverlayTestWindow: public PartialTestWindow { public: OverlayTestWindow(); - virtual void start(int width, int height); - virtual void stop(); + void start(int width, int height) override; + void stop() override; - virtual void draw(); + void draw() override; protected: Surface* overlay; @@ -82,7 +82,7 @@ protected: TestWindow::TestWindow() : Fl_Window(0, 0, "Framebuffer Performance Test"), - fb(NULL) + fb(nullptr) { } @@ -116,7 +116,7 @@ void TestWindow::stop() hide(); delete fb; - fb = NULL; + fb = nullptr; Fl::remove_idle(timer, this); } @@ -208,7 +208,7 @@ void PartialTestWindow::changefb() } OverlayTestWindow::OverlayTestWindow() : - overlay(NULL), offscreen(NULL) + overlay(nullptr), offscreen(nullptr) { } @@ -224,7 +224,7 @@ void OverlayTestWindow::start(int width, int height) #if !defined(__APPLE__) offscreen = new Surface(w(), h()); #else - offscreen = NULL; + offscreen = nullptr; #endif } @@ -233,9 +233,9 @@ void OverlayTestWindow::stop() PartialTestWindow::stop(); delete offscreen; - offscreen = NULL; + offscreen = nullptr; delete overlay; - overlay = NULL; + overlay = nullptr; } void OverlayTestWindow::draw() @@ -299,7 +299,7 @@ static void dosubtest(TestWindow* win, int width, int height, win->start(width, height); - gettimeofday(&start, NULL); + gettimeofday(&start, nullptr); while (rfb::msSince(&start) < 3000) Fl::wait(); diff --git a/tests/perf/util.cxx b/tests/perf/util.cxx index 98b2568e..2720c237 100644 --- a/tests/perf/util.cxx +++ b/tests/perf/util.cxx @@ -65,8 +65,8 @@ cpucounter_t newCpuCounter(void) syscounter_t *c; c = (syscounter_t*)malloc(sizeof(syscounter_t) * 2); - if (c == NULL) - return NULL; + if (c == nullptr) + return nullptr; memset(c, 0, sizeof(syscounter_t) * 2); @@ -149,7 +149,7 @@ void startTimeCounter(void) #ifdef WIN32 QueryPerformanceCounter(&timeStart); #else - gettimeofday(&timeStart, NULL); + gettimeofday(&timeStart, nullptr); #endif } @@ -158,7 +158,7 @@ void endTimeCounter(void) #ifdef WIN32 QueryPerformanceCounter(&timeEnd); #else - gettimeofday(&timeEnd, NULL); + gettimeofday(&timeEnd, nullptr); #endif } diff --git a/tests/unit/emulatemb.cxx b/tests/unit/emulatemb.cxx index 7dfc2541..ae022c06 100644 --- a/tests/unit/emulatemb.cxx +++ b/tests/unit/emulatemb.cxx @@ -42,14 +42,14 @@ rfb::BoolParameter emulateMiddleButton("dummy_name", "dummy_desc", true); class TestClass : public EmulateMB { public: - virtual void sendPointerEvent(const rfb::Point& pos, int buttonMask); + void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask) override; - struct PointerEventParams {rfb::Point pos; int mask; }; + struct PointerEventParams {rfb::Point pos; uint8_t mask; }; std::vector<PointerEventParams> results; }; -void TestClass::sendPointerEvent(const rfb::Point& pos, int buttonMask) +void TestClass::sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask) { PointerEventParams params; params.pos = pos; diff --git a/tests/unit/gesturehandler.cxx b/tests/unit/gesturehandler.cxx index bc39c24c..73b8c62c 100644 --- a/tests/unit/gesturehandler.cxx +++ b/tests/unit/gesturehandler.cxx @@ -30,7 +30,7 @@ class TestClass : public GestureHandler { protected: - virtual void handleGestureEvent(const GestureEvent& event); + void handleGestureEvent(const GestureEvent& event) override; public: std::vector<GestureEvent> events; diff --git a/tests/unit/pixelformat.cxx b/tests/unit/pixelformat.cxx index a2ca50d0..614d1255 100644 --- a/tests/unit/pixelformat.cxx +++ b/tests/unit/pixelformat.cxx @@ -36,7 +36,7 @@ static void doTest(bool should_fail, int b, int d, bool e, bool t, try { pf = new rfb::PixelFormat(b, d, e, t, rm, gm, bm, rs, gs, bs); - } catch(rfb::Exception &e) { + } catch(rfb::Exception&) { if (should_fail) printf("OK"); else diff --git a/tests/unit/unicode.cxx b/tests/unit/unicode.cxx index cb15e7e1..71815042 100644 --- a/tests/unit/unicode.cxx +++ b/tests/unit/unicode.cxx @@ -180,7 +180,7 @@ int main(int /*argc*/, char** /*argv*/) for (i = 0;i < ARRAY_SIZE(latin1utf8);i++) { /* Expected failure? */ - if (strchr(latin1utf8[i].latin1, '?') != NULL) + if (strchr(latin1utf8[i].latin1, '?') != nullptr) continue; out = rfb::latin1ToUTF8(latin1utf8[i].latin1); @@ -212,7 +212,7 @@ int main(int /*argc*/, char** /*argv*/) for (i = 0;i < ARRAY_SIZE(utf8utf16);i++) { /* Expected failure? */ - if (strstr(utf8utf16[i].utf8, "\xef\xbf\xbd") != NULL) + if (strstr(utf8utf16[i].utf8, "\xef\xbf\xbd") != nullptr) continue; wout = rfb::utf8ToUTF16(utf8utf16[i].utf8); diff --git a/unix/common/randr.cxx b/unix/common/randr.cxx index 12c4841f..e4e2d7be 100644 --- a/unix/common/randr.cxx +++ b/unix/common/randr.cxx @@ -236,10 +236,14 @@ static unsigned int _setScreenLayout(bool dryrun, /* Next, reconfigure all known outputs */ for (int i = 0;i < vncRandRGetOutputCount();i++) { unsigned int output; + char *name_; + std::string name; rfb::ScreenSet::const_iterator iter; output = vncRandRGetOutputId(i); + name = name_ = vncRandRGetOutputName(i); + free(name_); /* Known? */ if (outputIdMap->count(output) == 0) @@ -259,31 +263,24 @@ static unsigned int _setScreenLayout(bool dryrun, /* Probably not needed, but let's be safe */ if (!vncRandRIsOutputUsable(i)) { - if (logErrors) { - char *name = vncRandRGetOutputName(i); - vlog.error("Required output '%s' cannot be used", name); - free(name); - } + if (logErrors) + vlog.error("Required output '%s' cannot be used", name.c_str()); return rfb::resultInvalid; } /* Possible mode? */ if (!vncRandRCheckOutputMode(i, iter->dimensions.width(), iter->dimensions.height())) { - if (logErrors) { - char *name = vncRandRGetOutputName(i); - vlog.error("Output '%s' does not support required mode %dx%d", name, + if (logErrors) + vlog.error("Output '%s' does not support required mode %dx%d", + name.c_str(), iter->dimensions.width(), iter->dimensions.height()); - free(name); - } return rfb::resultInvalid; } - char *name = vncRandRGetOutputName(i); - vlog.debug("Reconfiguring output '%s' to %dx%d+%d+%d", name, + vlog.debug("Reconfiguring output '%s' to %dx%d+%d+%d", name.c_str(), iter->dimensions.width(), iter->dimensions.height(), iter->dimensions.tl.x, iter->dimensions.tl.y); - free(name); if (dryrun) continue; @@ -295,13 +292,11 @@ static unsigned int _setScreenLayout(bool dryrun, iter->dimensions.width(), iter->dimensions.height()); if (!ret) { - if (logErrors) { - char *name = vncRandRGetOutputName(i); - vlog.error("Failed to reconfigure output '%s' to %dx%d+%d+%d", name, + if (logErrors) + vlog.error("Failed to reconfigure output '%s' to %dx%d+%d+%d", + name.c_str(), iter->dimensions.width(), iter->dimensions.height(), iter->dimensions.tl.x, iter->dimensions.tl.y); - free(name); - } return rfb::resultInvalid; } } @@ -311,6 +306,8 @@ static unsigned int _setScreenLayout(bool dryrun, for (iter = layout.begin();iter != layout.end();++iter) { OutputIdMap::const_iterator oi; unsigned int output; + char *name_; + std::string name; int i; /* Does this screen have an output already? */ @@ -332,6 +329,8 @@ static unsigned int _setScreenLayout(bool dryrun, return rfb::resultInvalid; } output = vncRandRGetOutputId(i); + name = name_ = vncRandRGetOutputName(i); + free(name_); /* * Make sure we already have an entry for this, or @@ -342,31 +341,24 @@ static unsigned int _setScreenLayout(bool dryrun, /* Probably not needed, but let's be safe */ if (!vncRandRIsOutputUsable(i)) { - if (logErrors) { - char *name = vncRandRGetOutputName(i); - vlog.error("Required new output '%s' cannot be used", name); - free(name); - } + if (logErrors) + vlog.error("Required new output '%s' cannot be used", name.c_str()); return rfb::resultInvalid; } /* Possible mode? */ if (!vncRandRCheckOutputMode(i, iter->dimensions.width(), iter->dimensions.height())) { - if (logErrors) { - char *name = vncRandRGetOutputName(i); - vlog.error("New output '%s' does not support required mode %dx%d", name, + if (logErrors) + vlog.error("New output '%s' does not support required mode %dx%d", + name.c_str(), iter->dimensions.width(), iter->dimensions.height()); - free(name); - } return rfb::resultInvalid; } - char *name = vncRandRGetOutputName(i); - vlog.debug("Reconfiguring new output '%s' to %dx%d+%d+%d", name, + vlog.debug("Reconfiguring new output '%s' to %dx%d+%d+%d", name.c_str(), iter->dimensions.width(), iter->dimensions.height(), iter->dimensions.tl.x, iter->dimensions.tl.y); - free(name); if (dryrun) continue; @@ -378,13 +370,11 @@ static unsigned int _setScreenLayout(bool dryrun, iter->dimensions.width(), iter->dimensions.height()); if (!ret) { - if (logErrors) { - char *name = vncRandRGetOutputName(i); - vlog.error("Failed to reconfigure new output '%s' to %dx%d+%d+%d", name, + if (logErrors) + vlog.error("Failed to reconfigure new output '%s' to %dx%d+%d+%d", + name.c_str(), iter->dimensions.width(), iter->dimensions.height(), iter->dimensions.tl.x, iter->dimensions.tl.y); - free(name); - } return rfb::resultInvalid; } } diff --git a/unix/tx/TXButton.h b/unix/tx/TXButton.h index a51f2ecd..88964833 100644 --- a/unix/tx/TXButton.h +++ b/unix/tx/TXButton.h @@ -41,14 +41,15 @@ public: class TXButton : public TXWindow, public TXEventHandler { public: - TXButton(Display* dpy_, const char* text_, TXButtonCallback* cb_=0, - TXWindow* parent_=0, int w=1, int h=1) + TXButton(Display* dpy_, const char* text_, + TXButtonCallback* cb_=nullptr, + TXWindow* parent_=nullptr, int w=1, int h=1) : TXWindow(dpy_, w, h, parent_), cb(cb_), down(false), disabled_(false) { setEventHandler(this); setText(text_); - gc = XCreateGC(dpy, win(), 0, 0); + gc = XCreateGC(dpy, win(), 0, nullptr); XSetFont(dpy, gc, defaultFont); addEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask); } @@ -91,7 +92,7 @@ private: XDrawString(dpy, win(), gc, startx, starty, text.data(), text.size()); } - virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { + void handleEvent(TXWindow* /*w*/, XEvent* ev) override { switch (ev->type) { case Expose: paint(); diff --git a/unix/tx/TXCheckbox.h b/unix/tx/TXCheckbox.h index 76cdc950..179e3e84 100644 --- a/unix/tx/TXCheckbox.h +++ b/unix/tx/TXCheckbox.h @@ -48,14 +48,15 @@ public: class TXCheckbox : public TXWindow, public TXEventHandler { public: TXCheckbox(Display* dpy_, const char* text_, TXCheckboxCallback* cb_, - bool radio_=false, TXWindow* parent_=0, int w=1, int h=1) - : TXWindow(dpy_, w, h, parent_), cb(cb_), text(0), + bool radio_=false, TXWindow* parent_=nullptr, + int w=1, int h=1) + : TXWindow(dpy_, w, h, parent_), cb(cb_), text(nullptr), boxSize(radio_ ? 12 : 13), boxPad(4), checked_(false), disabled_(false), radio(radio_) { setEventHandler(this); setText(text_); - gc = XCreateGC(dpy, win(), 0, 0); + gc = XCreateGC(dpy, win(), 0, nullptr); XSetFont(dpy, gc, defaultFont); addEventMask(ExposureMask| ButtonPressMask | ButtonReleaseMask); } @@ -109,7 +110,7 @@ private: text, strlen(text)); } - virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { + void handleEvent(TXWindow* /*w*/, XEvent* ev) override { switch (ev->type) { case Expose: paint(); diff --git a/unix/tx/TXDialog.h b/unix/tx/TXDialog.h index 861a20be..720c50d0 100644 --- a/unix/tx/TXDialog.h +++ b/unix/tx/TXDialog.h @@ -33,9 +33,9 @@ class TXDialog : public TXWindow, public TXDeleteWindowCallback { public: - TXDialog(Display* dpy, int width, int height, const char* name, + TXDialog(Display* dpy_, int width, int height, const char* name, bool modal_=false) - : TXWindow(dpy, width, height), done(false), ok(false), modal(modal_) + : TXWindow(dpy_, width, height), done(false), ok(false), modal(modal_) { toplevel(name, this); resize(width, height); @@ -62,7 +62,7 @@ public: fd_set rfds; FD_ZERO(&rfds); FD_SET(ConnectionNumber(dpy), &rfds); - int n = select(FD_SETSIZE, &rfds, 0, 0, 0); + int n = select(FD_SETSIZE, &rfds, nullptr, nullptr, nullptr); if (n < 0) throw rdr::SystemException("select",errno); } } @@ -82,7 +82,7 @@ public: } protected: - virtual void deleteWindow(TXWindow* /*w*/) { + void deleteWindow(TXWindow* /*w*/) override { ok = false; done = true; unmap(); diff --git a/unix/tx/TXLabel.h b/unix/tx/TXLabel.h index 24b8cbb3..1e0cc0e5 100644 --- a/unix/tx/TXLabel.h +++ b/unix/tx/TXLabel.h @@ -35,7 +35,7 @@ public: enum HAlign { left, centre, right }; enum VAlign { top, middle, bottom }; - TXLabel(Display* dpy_, const char* text_, TXWindow* parent_=0, + TXLabel(Display* dpy_, const char* text_, TXWindow* parent_=nullptr, int w=1, int h=1, HAlign ha=centre, VAlign va=middle) : TXWindow(dpy_, w, h, parent_), lineSpacing(2), lines(0), halign(ha), valign(va) @@ -108,7 +108,7 @@ private: } while (i < text.size()); } - virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { + void handleEvent(TXWindow* /*w*/, XEvent* ev) override { switch (ev->type) { case Expose: paint(); diff --git a/unix/tx/TXWindow.cxx b/unix/tx/TXWindow.cxx index ee097e45..343b9c28 100644 --- a/unix/tx/TXWindow.cxx +++ b/unix/tx/TXWindow.cxx @@ -44,15 +44,15 @@ unsigned long TXWindow::disabledFg, TXWindow::disabledBg; unsigned long TXWindow::enabledBg; unsigned long TXWindow::scrollbarBg; Colormap TXWindow::cmap = 0; -GC TXWindow::defaultGC = 0; +GC TXWindow::defaultGC = nullptr; Font TXWindow::defaultFont = 0; -XFontStruct* TXWindow::defaultFS = 0; +XFontStruct* TXWindow::defaultFS = nullptr; Time TXWindow::cutBufferTime = 0; Pixmap TXWindow::dot = 0, TXWindow::tick = 0; const int TXWindow::dotSize = 4, TXWindow::tickSize = 8; char* TXWindow::defaultWindowClass; -TXGlobalEventHandler* TXWindow::globalEventHandler = NULL; +TXGlobalEventHandler* TXWindow::globalEventHandler = nullptr; void TXWindow::init(Display* dpy, const char* defaultWindowClass_) { @@ -79,7 +79,7 @@ void TXWindow::init(Display* dpy, const char* defaultWindowClass_) darkBg = disabledFg = cols[3].pixel; scrollbarBg = cols[4].pixel; white = enabledBg = cols[5].pixel; - defaultGC = XCreateGC(dpy, DefaultRootWindow(dpy), 0, 0); + defaultGC = XCreateGC(dpy, DefaultRootWindow(dpy), 0, nullptr); defaultFS = XLoadQueryFont(dpy, "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"); if (!defaultFS) { @@ -258,7 +258,8 @@ Window TXWindow::windowWithName(Display* dpy, Window top, const char* name) TXWindow::TXWindow(Display* dpy_, int w, int h, TXWindow* parent_, int borderWidth) : dpy(dpy_), xPad(3), yPad(3), bevel(2), parent(parent_), width_(w), - height_(h), eventHandler(0), dwc(0), eventMask(0), toplevel_(false) + height_(h), eventHandler(nullptr), dwc(nullptr), eventMask(0), + toplevel_(false) { sizeHints.flags = 0; XSetWindowAttributes attr; @@ -266,7 +267,8 @@ TXWindow::TXWindow(Display* dpy_, int w, int h, TXWindow* parent_, attr.border_pixel = 0; Window par = parent ? parent->win() : DefaultRootWindow(dpy); win_ = XCreateWindow(dpy, par, 0, 0, width_, height_, borderWidth, - CopyFromParent, CopyFromParent, CopyFromParent, + CopyFromParent, CopyFromParent, + (Visual*)CopyFromParent, CWBackPixel | CWBorderPixel, &attr); if (parent) map(); @@ -292,7 +294,7 @@ void TXWindow::toplevel(const char* name, TXDeleteWindowCallback* dwc_, if (!windowClass) windowClass = defaultWindowClass; classHint.res_name = (char*)name; classHint.res_class = (char*)windowClass; - XSetWMProperties(dpy, win(), 0, 0, argv, argc, + XSetWMProperties(dpy, win(), nullptr, nullptr, argv, argc, &sizeHints, &wmHints, &classHint); XStoreName(dpy, win(), name); XSetIconName(dpy, win(), name); @@ -443,7 +445,7 @@ void TXWindow::handleXEvent(XEvent* ev) break; } } - selectionNotify(&ev->xselection, 0, 0, 0, 0); + selectionNotify(&ev->xselection, 0, 0, 0, nullptr); break; case SelectionRequest: diff --git a/unix/tx/TXWindow.h b/unix/tx/TXWindow.h index 223c07a8..9f2a30cb 100644 --- a/unix/tx/TXWindow.h +++ b/unix/tx/TXWindow.h @@ -65,7 +65,8 @@ public: // background (currently grey). It is mapped by default if it has a parent. // If no parent is specified its parent is the root window and it will remain // unmapped. - TXWindow(Display* dpy_, int width=1, int height=1, TXWindow* parent_=0, + TXWindow(Display* dpy_, int width=1, int height=1, + TXWindow* parent_=nullptr, int borderWidth=0); virtual ~TXWindow(); @@ -73,8 +74,9 @@ public: // window-manager-related properties are set on the window. The given // TXDeleteWindowCallback is notified when the window is "deleted" (cloesd) // by the user. - void toplevel(const char* name, TXDeleteWindowCallback* dwc=0, - int argc=0, char** argv=0, const char* windowClass=0, + void toplevel(const char* name, TXDeleteWindowCallback* dwc=nullptr, + int argc=0, char** argv=nullptr, + const char* windowClass=nullptr, bool iconic=false); // setMaxSize() tells the window manager the maximum size to allow a @@ -181,7 +183,7 @@ public: // strEmptyToNull() returns the string it's given but turns an empty string // into null, which can be useful for passing rfb parameters to Xlib calls. - static char* strEmptyToNull(char* s) { return s && s[0] ? s : 0; } + static char* strEmptyToNull(char* s) { return s && s[0] ? s : nullptr; } // The following are default values for various things. static unsigned long black, white; diff --git a/unix/vncconfig/QueryConnectDialog.cxx b/unix/vncconfig/QueryConnectDialog.cxx index e13af34b..aa1b78ad 100644 --- a/unix/vncconfig/QueryConnectDialog.cxx +++ b/unix/vncconfig/QueryConnectDialog.cxx @@ -25,12 +25,12 @@ #include "QueryConnectDialog.h" #include "vncExt.h" -QueryConnectDialog::QueryConnectDialog(Display* dpy, +QueryConnectDialog::QueryConnectDialog(Display* dpy_, const char* address_, const char* user_, int timeout_, QueryResultCallback* cb) - : TXDialog(dpy, 300, 100, "VNC Server : Accept Connection?"), + : TXDialog(dpy_, 300, 100, "VNC Server : Accept Connection?"), addressLbl(dpy, "Host:",this), address(dpy, address_, this), userLbl(dpy, "User:", this), @@ -74,14 +74,13 @@ void QueryConnectDialog::buttonActivate(TXButton* b) { callback->queryRejected(); } -bool QueryConnectDialog::handleTimeout(rfb::Timer* /*t*/) { +void QueryConnectDialog::handleTimeout(rfb::Timer* t) { if (timeUntilReject-- == 0) { unmap(); callback->queryTimedOut(); - return false; } else { refreshTimeout(); - return true; + t->repeat(); } } diff --git a/unix/vncconfig/QueryConnectDialog.h b/unix/vncconfig/QueryConnectDialog.h index f685dc34..5763e1ce 100644 --- a/unix/vncconfig/QueryConnectDialog.h +++ b/unix/vncconfig/QueryConnectDialog.h @@ -40,10 +40,10 @@ class QueryConnectDialog : public TXDialog, public TXEventHandler, QueryConnectDialog(Display* dpy, const char* address_, const char* user_, int timeout_, QueryResultCallback* cb); - void handleEvent(TXWindow*, XEvent* ) { } - void deleteWindow(TXWindow*); - void buttonActivate(TXButton* b); - bool handleTimeout(rfb::Timer* t); + void handleEvent(TXWindow*, XEvent* ) override { } + void deleteWindow(TXWindow*) override; + void buttonActivate(TXButton* b) override; + void handleTimeout(rfb::Timer* t) override; private: void refreshTimeout(); TXLabel addressLbl, address, userLbl, user, timeoutLbl, timeout; diff --git a/unix/vncconfig/vncExt.h b/unix/vncconfig/vncExt.h index 4383248c..5de1685d 100644 --- a/unix/vncconfig/vncExt.h +++ b/unix/vncconfig/vncExt.h @@ -64,7 +64,7 @@ typedef struct { #ifdef _VNCEXT_PROTO_ -#define VNCEXTNAME "VNC-EXTENSION" +#define VNCEXTNAME "TIGERVNC" typedef struct { CARD8 reqType; /* always VncExtReqCode */ diff --git a/unix/vncconfig/vncconfig.cxx b/unix/vncconfig/vncconfig.cxx index e0c9928a..ab7c6315 100644 --- a/unix/vncconfig/vncconfig.cxx +++ b/unix/vncconfig/vncconfig.cxx @@ -62,14 +62,14 @@ BoolParameter iconic("iconic", "Start with window iconified", 0); #define SET_PRIMARY "SetPrimary" #define SEND_PRIMARY "SendPrimary" -char* programName = 0; +char* programName = nullptr; Display* dpy; int vncExtEventBase, vncExtErrorBase; -static bool getBoolParam(Display* dpy, const char* param) { +static bool getBoolParam(Display* dpy_, const char* param) { char* data; int len; - if (XVncExtGetParam(dpy, param, &data, &len)) { + if (XVncExtGetParam(dpy_, param, &data, &len)) { if (strcmp(data,"1") == 0) return true; } return false; @@ -80,13 +80,13 @@ class VncConfigWindow : public TXWindow, public TXEventHandler, public TXCheckboxCallback, public QueryResultCallback { public: - VncConfigWindow(Display* dpy) - : TXWindow(dpy, 300, 100), - acceptClipboard(dpy, "Accept clipboard from viewers", this, false, this), - setPrimaryCB(dpy, "Also set primary selection", this, false, this), - sendClipboard(dpy, "Send clipboard to viewers", this, false, this), - sendPrimaryCB(dpy, "Send primary selection to viewers", this,false,this), - queryConnectDialog(0) + VncConfigWindow(Display* dpy_) + : TXWindow(dpy_, 300, 100), + acceptClipboard(dpy_, "Accept clipboard from viewers", this, false, this), + setPrimaryCB(dpy_, "Also set primary selection", this, false, this), + sendClipboard(dpy_, "Send clipboard to viewers", this, false, this), + sendPrimaryCB(dpy_, "Send primary selection to viewers", this,false,this), + queryConnectDialog(nullptr) { int y = yPad; acceptClipboard.move(xPad, y); @@ -104,18 +104,18 @@ public: sendPrimaryCB.disabled(!sendClipboard.checked()); y += sendPrimaryCB.height(); setEventHandler(this); - toplevel("VNC config", this, 0, 0, 0, iconic); + toplevel("VNC config", this, 0, nullptr, nullptr, iconic); XVncExtSelectInput(dpy, win(), VncExtQueryConnectMask); } // handleEvent() - virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { + void handleEvent(TXWindow* /*w*/, XEvent* ev) override { if (ev->type == vncExtEventBase + VncExtQueryConnectNotify) { vlog.debug("query connection event"); if (queryConnectDialog) delete queryConnectDialog; - queryConnectDialog = 0; + queryConnectDialog = nullptr; char* qcAddress; char* qcUser; int qcTimeout; @@ -134,12 +134,12 @@ public: } // TXDeleteWindowCallback method - virtual void deleteWindow(TXWindow* /*w*/) { + void deleteWindow(TXWindow* /*w*/) override { exit(1); } // TXCheckboxCallback method - virtual void checkboxSelect(TXCheckbox* checkbox) { + void checkboxSelect(TXCheckbox* checkbox) override { if (checkbox == &acceptClipboard) { XVncExtSetParam(dpy, (acceptClipboard.checked() ? ACCEPT_CUT_TEXT "=1" : ACCEPT_CUT_TEXT "=0")); @@ -158,10 +158,10 @@ public: } // QueryResultCallback interface - virtual void queryApproved() { + void queryApproved() override { XVncExtApproveConnect(dpy, queryConnectId, 1); } - virtual void queryRejected() { + void queryRejected() override { XVncExtApproveConnect(dpy, queryConnectId, 0); } @@ -278,8 +278,8 @@ int main(int argc, char** argv) } else if (strcmp(argv[i], "-list") == 0) { int nParams; char** list = XVncExtListParams(dpy, &nParams); - for (int i = 0; i < nParams; i++) { - printf("%s\n",list[i]); + for (int n = 0; n < nParams; n++) { + printf("%s\n",list[n]); } XVncExtFreeParamList(list); } else if (strcmp(argv[i], "-set") == 0) { @@ -306,14 +306,14 @@ int main(int argc, char** argv) while (true) { struct timeval tv; - struct timeval* tvp = 0; + struct timeval* tvp = nullptr; // Process any incoming X events TXWindow::handleXEvents(dpy); // Process expired timers and get the time until the next one int timeoutMs = Timer::checkTimeouts(); - if (timeoutMs) { + if (timeoutMs >= 0) { tv.tv_sec = timeoutMs / 1000; tv.tv_usec = (timeoutMs % 1000) * 1000; tvp = &tv; @@ -329,7 +329,7 @@ int main(int argc, char** argv) fd_set rfds; FD_ZERO(&rfds); FD_SET(ConnectionNumber(dpy), &rfds); - int n = select(FD_SETSIZE, &rfds, 0, 0, tvp); + int n = select(FD_SETSIZE, &rfds, nullptr, nullptr, tvp); if (n < 0) throw rdr::SystemException("select",errno); } diff --git a/unix/vncpasswd/vncpasswd.cxx b/unix/vncpasswd/vncpasswd.cxx index b067719b..b17e73dd 100644 --- a/unix/vncpasswd/vncpasswd.cxx +++ b/unix/vncpasswd/vncpasswd.cxx @@ -75,7 +75,7 @@ static const char* getpassword(const char* prompt) { result[strlen(result)-1] = 0; return buf; } - return 0; + return nullptr; } // Reads passwords from stdin and prints encrypted passwords to stdout. @@ -84,7 +84,7 @@ static int encrypt_pipe() { // We support a maximum of two passwords right now for (i = 0;i < 2;i++) { - const char *result = getpassword(NULL); + const char *result = getpassword(nullptr); if (!result) break; @@ -135,7 +135,7 @@ static int check_passwd_pwquality(const char *password) static std::vector<uint8_t> readpassword() { while (true) { const char *passwd = getpassword("Password:"); - if (passwd == NULL) { + if (passwd == nullptr) { perror("getpassword error"); exit(1); } @@ -164,7 +164,7 @@ static std::vector<uint8_t> readpassword() { #endif passwd = getpassword("Verify:"); - if (passwd == NULL) { + if (passwd == nullptr) { perror("getpass error"); exit(1); } @@ -205,7 +205,7 @@ int main(int argc, char** argv) if (fname[0] == '\0') { const char *configDir = os::getvncconfigdir(); - if (configDir == NULL) { + if (configDir == nullptr) { fprintf(stderr, "Can't obtain VNC config directory\n"); exit(1); } @@ -222,7 +222,7 @@ int main(int argc, char** argv) fprintf(stderr, "Would you like to enter a view-only password (y/n)? "); char yesno[3]; - if (fgets(yesno, 3, stdin) != NULL && (yesno[0] == 'y' || yesno[0] == 'Y')) { + if (fgets(yesno, 3, stdin) != nullptr && (yesno[0] == 'y' || yesno[0] == 'Y')) { obfuscatedReadOnly = readpassword(); } else { fprintf(stderr, "A view-only password is not used\n"); diff --git a/unix/vncserver/vncsession.c b/unix/vncserver/vncsession.c index 1ee096c7..a10e0789 100644 --- a/unix/vncserver/vncsession.c +++ b/unix/vncserver/vncsession.c @@ -393,8 +393,9 @@ redir_stdio(const char *homedir, const char *display, char **envp) int fd; long hostlen; char* hostname = NULL, *xdgstate; - char logfile[PATH_MAX], legacy[PATH_MAX]; + char logdir[PATH_MAX], logfile[PATH_MAX], logfile_old[PATH_MAX], legacy[PATH_MAX]; struct stat st; + size_t fmt_len; fd = open("/dev/null", O_RDONLY); if (fd == -1) { @@ -408,15 +409,24 @@ redir_stdio(const char *homedir, const char *display, char **envp) close(fd); xdgstate = getenvp("XDG_STATE_HOME", envp); - if (xdgstate != NULL && xdgstate[0] == '/') - snprintf(logfile, sizeof(logfile), "%s/tigervnc", xdgstate); - else - snprintf(logfile, sizeof(logfile), "%s/.local/state/tigervnc", homedir); + if (xdgstate != NULL && xdgstate[0] == '/') { + fmt_len = snprintf(logdir, sizeof(logdir), "%s/tigervnc", xdgstate); + if (fmt_len >= sizeof(logdir)) { + syslog(LOG_CRIT, "Log dir path too long"); + _exit(EX_OSERR); + } + } else { + fmt_len = snprintf(logdir, sizeof(logdir), "%s/.local/state/tigervnc", homedir); + if (fmt_len >= sizeof(logdir)) { + syslog(LOG_CRIT, "Log dir path too long"); + _exit(EX_OSERR); + } + } snprintf(legacy, sizeof(legacy), "%s/.vnc", homedir); - if (stat(logfile, &st) != 0 && stat(legacy, &st) == 0) { + if (stat(logdir, &st) != 0 && stat(legacy, &st) == 0) { syslog(LOG_WARNING, "~/.vnc is deprecated, please consult 'man vncsession' for paths to migrate to."); - strcpy(logfile, legacy); + strcpy(logdir, legacy); #ifdef HAVE_SELINUX /* this is only needed to handle historical type changes for the legacy dir */ @@ -431,9 +441,9 @@ redir_stdio(const char *homedir, const char *display, char **envp) #endif } - if (mkdir_p(logfile, 0755) == -1) { + if (mkdir_p(logdir, 0755) == -1) { if (errno != EEXIST) { - syslog(LOG_CRIT, "Failure creating \"%s\": %s", logfile, strerror(errno)); + syslog(LOG_CRIT, "Failure creating \"%s\": %s", logdir, strerror(errno)); _exit(EX_OSERR); } } @@ -450,9 +460,24 @@ redir_stdio(const char *homedir, const char *display, char **envp) _exit(EX_OSERR); } - snprintf(logfile + strlen(logfile), sizeof(logfile) - strlen(logfile), "/%s%s.log", - hostname, display); + fmt_len = snprintf(logfile, sizeof(logfile), "/%s/%s%s.log", logdir, hostname, display); + if (fmt_len >= sizeof(logfile)) { + syslog(LOG_CRIT, "Log path too long"); + _exit(EX_OSERR); + } + fmt_len = snprintf(logfile_old, sizeof(logfile_old), "/%s/%s%s.log.old", logdir, hostname, display); + if (fmt_len >= sizeof(logfile)) { + syslog(LOG_CRIT, "Log.old path too long"); + _exit(EX_OSERR); + } free(hostname); + + if (stat(logfile, &st) == 0) { + if (rename(logfile, logfile_old) != 0) { + syslog(LOG_CRIT, "Failure renaming log file \"%s\" to \"%s\": %s", logfile, logfile_old, strerror(errno)); + _exit(EX_OSERR); + } + } fd = open(logfile, O_CREAT | O_WRONLY | O_TRUNC, 0644); if (fd == -1) { syslog(LOG_CRIT, "Failure creating log file \"%s\": %s", logfile, strerror(errno)); @@ -545,7 +570,7 @@ run_script(const char *username, const char *display, char **envp) // Set up some basic environment for the script setenv("HOME", pwent->pw_dir, 1); - setenv("SHELL", pwent->pw_shell, 1); + setenv("SHELL", *pwent->pw_shell != '\0' ? pwent->pw_shell : "/bin/sh", 1); setenv("LOGNAME", pwent->pw_name, 1); setenv("USER", pwent->pw_name, 1); setenv("USERNAME", pwent->pw_name, 1); diff --git a/unix/x0vncserver/Geometry.cxx b/unix/x0vncserver/Geometry.cxx index 3f7f2863..28e71be4 100644 --- a/unix/x0vncserver/Geometry.cxx +++ b/unix/x0vncserver/Geometry.cxx @@ -71,7 +71,7 @@ Rect Geometry::parseString(const char *arg) const { Rect result; // empty by default - if (arg != NULL && strlen(arg) > 0) { + if (arg != nullptr && strlen(arg) > 0) { int w, h; int x = 0, y = 0; char sign_x[2] = "+"; diff --git a/unix/x0vncserver/Image.cxx b/unix/x0vncserver/Image.cxx index 755da787..c2026134 100644 --- a/unix/x0vncserver/Image.cxx +++ b/unix/x0vncserver/Image.cxx @@ -63,13 +63,13 @@ ImageCleanup imageCleanup; static rfb::LogWriter vlog("Image"); Image::Image(Display *d) - : xim(NULL), dpy(d) + : xim(nullptr), dpy(d) { imageCleanup.images.push_back(this); } Image::Image(Display *d, int width, int height) - : xim(NULL), dpy(d) + : xim(nullptr), dpy(d) { imageCleanup.images.push_back(this); Init(width, height); @@ -85,10 +85,11 @@ void Image::Init(int width, int height) } xim = XCreateImage(dpy, vis, DefaultDepth(dpy, DefaultScreen(dpy)), - ZPixmap, 0, 0, width, height, BitmapPad(dpy), 0); + ZPixmap, 0, nullptr, width, height, + BitmapPad(dpy), 0); xim->data = (char *)malloc(xim->bytes_per_line * xim->height); - if (xim->data == NULL) { + if (xim->data == nullptr) { vlog.error("malloc() failed"); exit(1); } @@ -99,7 +100,7 @@ Image::~Image() imageCleanup.images.remove(this); // XDestroyImage will free xim->data if necessary - if (xim != NULL) + if (xim != nullptr) XDestroyImage(xim); } @@ -217,12 +218,12 @@ static int ShmCreationXErrorHandler(Display* /*dpy*/, } ShmImage::ShmImage(Display *d) - : Image(d), shminfo(NULL) + : Image(d), shminfo(nullptr) { } ShmImage::ShmImage(Display *d, int width, int height) - : Image(d), shminfo(NULL) + : Image(d), shminfo(nullptr) { Init(width, height); } @@ -241,7 +242,7 @@ void ShmImage::Init(int width, int height, const XVisualInfo *vinfo) Visual *visual; int depth; - if (vinfo == NULL) { + if (vinfo == nullptr) { visual = DefaultVisual(dpy, DefaultScreen(dpy)); depth = DefaultDepth(dpy, DefaultScreen(dpy)); } else { @@ -256,12 +257,12 @@ void ShmImage::Init(int width, int height, const XVisualInfo *vinfo) shminfo = new XShmSegmentInfo; - xim = XShmCreateImage(dpy, visual, depth, ZPixmap, 0, shminfo, + xim = XShmCreateImage(dpy, visual, depth, ZPixmap, nullptr, shminfo, width, height); - if (xim == NULL) { + if (xim == nullptr) { vlog.error("XShmCreateImage() failed"); delete shminfo; - shminfo = NULL; + shminfo = nullptr; return; } @@ -273,22 +274,22 @@ void ShmImage::Init(int width, int height, const XVisualInfo *vinfo) vlog.error("shmget() failed (%d bytes requested)", int(xim->bytes_per_line * xim->height)); XDestroyImage(xim); - xim = NULL; + xim = nullptr; delete shminfo; - shminfo = NULL; + shminfo = nullptr; return; } - shminfo->shmaddr = xim->data = (char *)shmat(shminfo->shmid, 0, 0); + shminfo->shmaddr = xim->data = (char *)shmat(shminfo->shmid, nullptr, 0); if (shminfo->shmaddr == (char *)-1) { perror("shmat"); vlog.error("shmat() failed (%d bytes requested)", int(xim->bytes_per_line * xim->height)); - shmctl(shminfo->shmid, IPC_RMID, 0); + shmctl(shminfo->shmid, IPC_RMID, nullptr); XDestroyImage(xim); - xim = NULL; + xim = nullptr; delete shminfo; - shminfo = NULL; + shminfo = nullptr; return; } @@ -301,21 +302,21 @@ void ShmImage::Init(int width, int height, const XVisualInfo *vinfo) if (caughtShmError) { vlog.error("XShmAttach() failed"); shmdt(shminfo->shmaddr); - shmctl(shminfo->shmid, IPC_RMID, 0); + shmctl(shminfo->shmid, IPC_RMID, nullptr); XDestroyImage(xim); - xim = NULL; + xim = nullptr; delete shminfo; - shminfo = NULL; + shminfo = nullptr; return; } } ShmImage::~ShmImage() { - if (shminfo != NULL) { + if (shminfo != nullptr) { XShmDetach(dpy, shminfo); shmdt(shminfo->shmaddr); - shmctl(shminfo->shmid, IPC_RMID, 0); + shmctl(shminfo->shmid, IPC_RMID, nullptr); delete shminfo; } } @@ -354,13 +355,13 @@ ImageFactory::~ImageFactory() Image *ImageFactory::newImage(Display *d, int width, int height) { - Image *image = NULL; + Image *image = nullptr; // Now, try to use shared memory image. if (mayUseShm) { image = new ShmImage(d, width, height); - if (image->xim != NULL) { + if (image->xim != nullptr) { return image; } diff --git a/unix/x0vncserver/Image.h b/unix/x0vncserver/Image.h index bf62e7d0..a89a26ad 100644 --- a/unix/x0vncserver/Image.h +++ b/unix/x0vncserver/Image.h @@ -98,20 +98,20 @@ public: ShmImage(Display *d, int width, int height); virtual ~ShmImage(); - virtual const char *className() const { + const char *className() const override { return "ShmImage"; } - virtual const char *classDesc() const { + const char *classDesc() const override { return "shared memory image"; } - virtual void get(Window wnd, int x = 0, int y = 0); - virtual void get(Window wnd, int x, int y, int w, int h, - int dst_x = 0, int dst_y = 0); + void get(Window wnd, int x = 0, int y = 0) override; + void get(Window wnd, int x, int y, int w, int h, + int dst_x = 0, int dst_y = 0) override; protected: - void Init(int width, int height, const XVisualInfo *vinfo = NULL); + void Init(int width, int height, const XVisualInfo *vinfo = nullptr); XShmSegmentInfo *shminfo; diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index da298d35..29af059f 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -26,6 +26,8 @@ #include <signal.h> #include <unistd.h> +#include <algorithm> + #include <network/Socket.h> #include <rfb/LogWriter.h> @@ -80,11 +82,11 @@ static const char * ledNames[XDESKTOP_N_LEDS] = { }; XDesktop::XDesktop(Display* dpy_, Geometry *geometry_) - : dpy(dpy_), geometry(geometry_), pb(0), server(0), - queryConnectDialog(0), queryConnectSock(0), + : dpy(dpy_), geometry(geometry_), pb(nullptr), server(nullptr), + queryConnectDialog(nullptr), queryConnectSock(nullptr), oldButtonMask(0), haveXtest(false), haveDamage(false), maxButtons(0), running(false), ledMasks(), ledState(0), - codeMap(0), codeMapLen(0) + codeMap(nullptr), codeMapLen(0) { int major, minor; @@ -108,7 +110,7 @@ XDesktop::XDesktop(Display* dpy_, Geometry *geometry_) Bool on; a = XInternAtom(dpy, ledNames[i], True); - if (!a || !XkbGetNamedIndicator(dpy, a, &shift, &on, NULL, NULL)) + if (!a || !XkbGetNamedIndicator(dpy, a, &shift, &on, nullptr, nullptr)) continue; ledMasks[i] = 1u << shift; @@ -232,9 +234,13 @@ void XDesktop::poll() { } } +void XDesktop::init(VNCServer* vs) +{ + server = vs; +} -void XDesktop::start(VNCServer* vs) { - +void XDesktop::start() +{ // Determine actual number of buttons of the X pointer device. unsigned char btnMap[8]; int numButtons = XGetPointerMapping(dpy, btnMap, 8); @@ -249,7 +255,6 @@ void XDesktop::start(VNCServer* vs) { pb = new XPixelBuffer(dpy, factory, geometry->getRect()); vlog.info("Allocated %s", pb->getImage()->classDesc()); - server = vs; server->setPixelBuffer(pb, computeScreenLayout()); #ifdef HAVE_XDAMAGE @@ -280,7 +285,7 @@ void XDesktop::stop() { #ifdef HAVE_XTEST // Delete added keycodes - deleteAddedKeysyms(dpy); + deleteAddedKeysyms(); #endif #ifdef HAVE_XDAMAGE @@ -289,13 +294,12 @@ void XDesktop::stop() { #endif delete queryConnectDialog; - queryConnectDialog = 0; + queryConnectDialog = nullptr; - server->setPixelBuffer(0); - server = 0; + server->setPixelBuffer(nullptr); delete pb; - pb = 0; + pb = nullptr; } void XDesktop::terminate() { @@ -314,15 +318,13 @@ void XDesktop::queryConnection(network::Socket* sock, // Someone already querying? if (queryConnectSock) { std::list<network::Socket*> sockets; - std::list<network::Socket*>::iterator i; // Check if this socket is still valid server->getSockets(&sockets); - for (i = sockets.begin(); i != sockets.end(); i++) { - if (*i == queryConnectSock) { - server->approveConnection(sock, false, "Another connection is currently being queried."); - return; - } + if (std::find(sockets.begin(), sockets.end(), + queryConnectSock) != sockets.end()) { + server->approveConnection(sock, false, "Another connection is currently being queried."); + return; } } @@ -340,7 +342,7 @@ void XDesktop::queryConnection(network::Socket* sock, queryConnectDialog->map(); } -void XDesktop::pointerEvent(const Point& pos, int buttonMask) { +void XDesktop::pointerEvent(const Point& pos, uint8_t buttonMask) { #ifdef HAVE_XTEST if (!haveXtest) return; XTestFakeMotionEvent(dpy, DefaultScreen(dpy), @@ -366,7 +368,7 @@ void XDesktop::pointerEvent(const Point& pos, int buttonMask) { } #ifdef HAVE_XTEST -KeyCode XDesktop::XkbKeysymToKeycode(Display* dpy, KeySym keysym) { +KeyCode XDesktop::XkbKeysymToKeycode(KeySym keysym) { XkbDescPtr xkb; XkbStateRec state; unsigned int mods; @@ -399,12 +401,49 @@ KeyCode XDesktop::XkbKeysymToKeycode(Display* dpy, KeySym keysym) { // Shift+Tab is usually ISO_Left_Tab, but RFB hides this fact. Do // another attempt if we failed the initial lookup if ((keycode == 0) && (keysym == XK_Tab) && (mods & ShiftMask)) - return XkbKeysymToKeycode(dpy, XK_ISO_Left_Tab); + return XkbKeysymToKeycode(XK_ISO_Left_Tab); return keycode; } -KeyCode XDesktop::addKeysym(Display* dpy, KeySym keysym) +/* + * Keeps the list in LRU order by moving the used key to front of the list. + */ +static void onKeyUsed(std::list<AddedKeySym> &list, KeyCode usedKeycode) { + if (list.empty() || list.front().keycode == usedKeycode) + return; + + std::list<AddedKeySym>::iterator it = list.begin(); + ++it; + for (; it != list.end(); ++it) { + AddedKeySym item = *it; + if (item.keycode == usedKeycode) { + list.erase(it); + list.push_front(item); + break; + } + } +} + +/* + * Returns keycode of oldest item from list of manually added keysyms. + * The item is removed from the list. + * Returns 0 if no usable keycode is found. + */ +KeyCode XDesktop::getReusableKeycode(XkbDescPtr xkb) { + while (!addedKeysyms.empty()) { + AddedKeySym last = addedKeysyms.back(); + addedKeysyms.pop_back(); + + // Make sure someone else hasn't modified the key + if (XkbKeyNumGroups(xkb, last.keycode) > 0 && + XkbKeySymsPtr(xkb, last.keycode)[0] == last.keysym) + return last.keycode; + } + return 0; +} + +KeyCode XDesktop::addKeysym(KeySym keysym) { int types[1]; unsigned int key; @@ -424,6 +463,9 @@ KeyCode XDesktop::addKeysym(Display* dpy, KeySym keysym) } if (key < xkb->min_key_code) + key = getReusableKeycode(xkb); + + if (!key) return 0; memset(&changes, 0, sizeof(changes)); @@ -450,15 +492,16 @@ KeyCode XDesktop::addKeysym(Display* dpy, KeySym keysym) changes.num_key_syms = 1; if (XkbChangeMap(dpy, xkb, &changes)) { - vlog.info("Added unknown keysym %s to keycode %d", XKeysymToString(keysym), key); - addedKeysyms[keysym] = key; + vlog.info("Added unknown keysym XK_%s (0x%04x) to keycode %d", + XKeysymToString(keysym), (unsigned)keysym, key); + addedKeysyms.push_front({ syms[0], (KeyCode)key }); return key; } return 0; } -void XDesktop::deleteAddedKeysyms(Display* dpy) { +void XDesktop::deleteAddedKeysyms() { XkbDescPtr xkb; xkb = XkbGetMap(dpy, XkbAllComponentsMask, XkbUseCoreKbd); @@ -470,21 +513,17 @@ void XDesktop::deleteAddedKeysyms(Display* dpy) { KeyCode lowestKeyCode = xkb->max_key_code; KeyCode highestKeyCode = xkb->min_key_code; - std::map<KeySym, KeyCode>::iterator it; - for (it = addedKeysyms.begin(); it != addedKeysyms.end(); it++) { - if (XkbKeyNumGroups(xkb, it->second) != 0) { - // Check if we are removing keysym we added ourself - if (XkbKeysymToKeycode(dpy, it->first) != it->second) - continue; + KeyCode keyCode = getReusableKeycode(xkb); + while (keyCode != 0) { + XkbChangeTypesOfKey(xkb, keyCode, 0, XkbGroup1Mask, nullptr, &changes); - XkbChangeTypesOfKey(xkb, it->second, 0, XkbGroup1Mask, NULL, &changes); + if (keyCode < lowestKeyCode) + lowestKeyCode = keyCode; - if (it->second < lowestKeyCode) - lowestKeyCode = it->second; + if (keyCode > highestKeyCode) + highestKeyCode = keyCode; - if (it->second > highestKeyCode) - highestKeyCode = it->second; - } + keyCode = getReusableKeycode(xkb); } // Did we actually find something to remove? @@ -495,23 +534,21 @@ void XDesktop::deleteAddedKeysyms(Display* dpy) { changes.first_key_sym = lowestKeyCode; changes.num_key_syms = highestKeyCode - lowestKeyCode + 1; XkbChangeMap(dpy, xkb, &changes); - - addedKeysyms.clear(); } -KeyCode XDesktop::keysymToKeycode(Display* dpy, KeySym keysym) { +KeyCode XDesktop::keysymToKeycode(KeySym keysym) { int keycode = 0; // XKeysymToKeycode() doesn't respect state, so we have to use // something slightly more complex - keycode = XkbKeysymToKeycode(dpy, keysym); + keycode = XkbKeysymToKeycode(keysym); if (keycode != 0) return keycode; // TODO: try to further guess keycode with all possible mods as Xvnc does - keycode = addKeysym(dpy, keysym); + keycode = addKeysym(keysym); if (keycode == 0) vlog.error("Failure adding new keysym 0x%lx", keysym); @@ -536,7 +573,7 @@ void XDesktop::keyEvent(uint32_t keysym, uint32_t xtcode, bool down) { if (pressedKeys.find(keysym) != pressedKeys.end()) keycode = pressedKeys[keysym]; else { - keycode = keysymToKeycode(dpy, keysym); + keycode = keysymToKeycode(keysym); } } @@ -550,6 +587,9 @@ void XDesktop::keyEvent(uint32_t keysym, uint32_t xtcode, bool down) { else pressedKeys.erase(keysym); + if (down) + onKeyUsed(addedKeysyms, keycode); + vlog.debug("%d %s", keycode, down ? "down" : "up"); XTestFakeKeyEvent(dpy, keycode, down, CurrentTime); @@ -560,9 +600,6 @@ void XDesktop::keyEvent(uint32_t keysym, uint32_t xtcode, bool down) { #endif } -void XDesktop::clientCutText(const char* /*str*/) { -} - ScreenSet XDesktop::computeScreenLayout() { ScreenSet layout; @@ -929,7 +966,7 @@ bool XDesktop::handleGlobalEvent(XEvent* ev) { if (cev->window == cev->root) return false; - server->setCursor(0, 0, Point(), NULL); + server->setCursor(0, 0, Point(), nullptr); return true; #endif } @@ -940,8 +977,8 @@ bool XDesktop::handleGlobalEvent(XEvent* ev) { void XDesktop::queryApproved() { assert(isRunning()); - server->approveConnection(queryConnectSock, true, 0); - queryConnectSock = 0; + server->approveConnection(queryConnectSock, true, nullptr); + queryConnectSock = nullptr; } void XDesktop::queryRejected() @@ -949,7 +986,7 @@ void XDesktop::queryRejected() assert(isRunning()); server->approveConnection(queryConnectSock, false, "Connection rejected by local user"); - queryConnectSock = 0; + queryConnectSock = nullptr; } #ifdef HAVE_XFIXES @@ -958,7 +995,7 @@ bool XDesktop::setCursor() XFixesCursorImage *cim; cim = XFixesGetCursorImage(dpy); - if (cim == NULL) + if (cim == nullptr) return false; // Copied from XserverDesktop::setCursor() in diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h index 1cb73f43..cf374fb9 100644 --- a/unix/x0vncserver/XDesktop.h +++ b/unix/x0vncserver/XDesktop.h @@ -35,6 +35,12 @@ class Geometry; class XPixelBuffer; +struct AddedKeySym +{ + KeySym keysym; + KeyCode keycode; +}; + // number of XKb indicator leds to handle #define XDESKTOP_N_LEDS 3 @@ -47,24 +53,24 @@ public: virtual ~XDesktop(); void poll(); // -=- SDesktop interface - virtual void start(rfb::VNCServer* vs); - virtual void stop(); - virtual void terminate(); + void init(rfb::VNCServer* vs) override; + void start() override; + void stop() override; + void terminate() override; bool isRunning(); - virtual void queryConnection(network::Socket* sock, - const char* userName); - virtual void pointerEvent(const rfb::Point& pos, int buttonMask); - virtual void keyEvent(uint32_t keysym, uint32_t xtcode, bool down); - virtual void clientCutText(const char* str); - virtual unsigned int setScreenLayout(int fb_width, int fb_height, - const rfb::ScreenSet& layout); + void queryConnection(network::Socket* sock, + const char* userName) override; + void pointerEvent(const rfb::Point& pos, uint8_t buttonMask) override; + void keyEvent(uint32_t keysym, uint32_t xtcode, bool down) override; + unsigned int setScreenLayout(int fb_width, int fb_height, + const rfb::ScreenSet& layout) override; // -=- TXGlobalEventHandler interface - virtual bool handleGlobalEvent(XEvent* ev); + bool handleGlobalEvent(XEvent* ev) override; // -=- QueryResultCallback interface - virtual void queryApproved(); - virtual void queryRejected(); + void queryApproved() override; + void queryRejected() override; protected: Display* dpy; @@ -73,11 +79,11 @@ protected: rfb::VNCServer* server; QueryConnectDialog* queryConnectDialog; network::Socket* queryConnectSock; - int oldButtonMask; + uint8_t oldButtonMask; bool haveXtest; bool haveDamage; int maxButtons; - std::map<KeySym, KeyCode> addedKeysyms; + std::list<AddedKeySym> addedKeysyms; std::map<KeySym, KeyCode> pressedKeys; bool running; #ifdef HAVE_XDAMAGE @@ -100,10 +106,11 @@ protected: protected: #ifdef HAVE_XTEST - KeyCode XkbKeysymToKeycode(Display* dpy, KeySym keysym); - KeyCode addKeysym(Display* dpy, KeySym keysym); - void deleteAddedKeysyms(Display* dpy); - KeyCode keysymToKeycode(Display* dpy, KeySym keysym); + KeyCode XkbKeysymToKeycode(KeySym keysym); + KeyCode getReusableKeycode(XkbDescPtr xkb); + KeyCode addKeysym(KeySym keysym); + void deleteAddedKeysyms(); + KeyCode keysymToKeycode(KeySym keysym); #endif #ifdef HAVE_XFIXES bool setCursor(); diff --git a/unix/x0vncserver/XPixelBuffer.cxx b/unix/x0vncserver/XPixelBuffer.cxx index b7506513..0e24cc51 100644 --- a/unix/x0vncserver/XPixelBuffer.cxx +++ b/unix/x0vncserver/XPixelBuffer.cxx @@ -35,7 +35,7 @@ using namespace rfb; XPixelBuffer::XPixelBuffer(Display *dpy, ImageFactory &factory, const Rect &rect) : FullFramePixelBuffer(), - m_poller(0), + m_poller(nullptr), m_dpy(dpy), m_image(factory.newImage(dpy, rect.width(), rect.height())), m_offsetLeft(rect.tl.x), diff --git a/unix/x0vncserver/XPixelBuffer.h b/unix/x0vncserver/XPixelBuffer.h index 18c85fe2..7556e6ef 100644 --- a/unix/x0vncserver/XPixelBuffer.h +++ b/unix/x0vncserver/XPixelBuffer.h @@ -45,7 +45,7 @@ public: inline void poll(rfb::VNCServer *server) { m_poller->poll(server); } // Override PixelBuffer::grabRegion(). - virtual void grabRegion(const rfb::Region& region); + void grabRegion(const rfb::Region& region) override; protected: PollingManager *m_poller; diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 8e27e62b..802ea252 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -90,10 +90,10 @@ static const char* defaultDesktopName() return ""; struct passwd* pwent = getpwuid(getuid()); - if (pwent == NULL) + if (pwent == nullptr) return ""; - int len = snprintf(NULL, 0, "%s@%s", pwent->pw_name, hostname.data()); + int len = snprintf(nullptr, 0, "%s@%s", pwent->pw_name, hostname.data()); if (len < 0) return ""; @@ -154,19 +154,19 @@ class FileTcpFilter : public TcpFilter public: FileTcpFilter(const char *fname) - : TcpFilter("-"), fileName(NULL), lastModTime(0) + : TcpFilter("-"), fileName(nullptr), lastModTime(0) { - if (fname != NULL) + if (fname != nullptr) fileName = strdup((char *)fname); } virtual ~FileTcpFilter() { - if (fileName != NULL) + if (fileName != nullptr) free(fileName); } - virtual bool verifyConnection(Socket* s) + bool verifyConnection(Socket* s) override { if (!reloadRules()) { vlog.error("Could not read IP filtering rules: rejecting all clients"); @@ -182,7 +182,7 @@ protected: bool reloadRules() { - if (fileName == NULL) + if (fileName == nullptr) return true; struct stat st; @@ -192,7 +192,7 @@ protected: if (st.st_mtime != lastModTime) { // Actually reload only if the file was modified FILE *fp = fopen(fileName, "r"); - if (fp == NULL) + if (fp == nullptr) return false; // Remove all the rules from the parent class @@ -225,14 +225,14 @@ private: bool readLine(char *buf, int bufSize, FILE *fp) { - if (fp == NULL || buf == NULL || bufSize == 0) + if (fp == nullptr || buf == nullptr || bufSize == 0) return false; - if (fgets(buf, bufSize, fp) == NULL) + if (fgets(buf, bufSize, fp) == nullptr) return false; char *ptr = strchr(buf, '\n'); - if (ptr != NULL) { + if (ptr != nullptr) { *ptr = '\0'; // remove newline at the end } else { if (!feof(fp)) { @@ -353,7 +353,7 @@ int main(int argc, char** argv) const char *addr = interface; if (strcasecmp(addr, "all") == 0) - addr = 0; + addr = nullptr; if (localhostOnly) createLocalTcpListeners(&tcp_listeners, (int)rfbport); else @@ -368,10 +368,8 @@ int main(int argc, char** argv) FileTcpFilter fileTcpFilter(hostsFile); if (strlen(hostsFile) != 0) - for (std::list<SocketListener*>::iterator i = listeners.begin(); - i != listeners.end(); - i++) - (*i)->setFilter(&fileTcpFilter); + for (SocketListener* listener : listeners) + listener->setFilter(&fileTcpFilter); } if (listeners.empty()) { @@ -382,7 +380,7 @@ int main(int argc, char** argv) PollingScheduler sched((int)pollingCycle, (int)maxProcessorUsage); while (!caughtSignal) { - int wait_ms; + int wait_ms, nextTimeout; struct timeval tv; fd_set rfds, wfds; std::list<Socket*> sockets; @@ -395,10 +393,8 @@ int main(int argc, char** argv) FD_ZERO(&wfds); FD_SET(ConnectionNumber(dpy), &rfds); - for (std::list<SocketListener*>::iterator i = listeners.begin(); - i != listeners.end(); - i++) - FD_SET((*i)->getFd(), &rfds); + for (SocketListener* listener : listeners) + FD_SET(listener->getFd(), &rfds); server.getSockets(&sockets); int clients_connected = 0; @@ -417,7 +413,7 @@ int main(int argc, char** argv) if (!clients_connected) sched.reset(); - wait_ms = 0; + wait_ms = -1; if (sched.isRunning()) { wait_ms = sched.millisRemaining(); @@ -426,15 +422,18 @@ int main(int argc, char** argv) } } - soonestTimeout(&wait_ms, Timer::checkTimeouts()); + // Trigger timers and check when the next will expire + nextTimeout = Timer::checkTimeouts(); + if (nextTimeout >= 0 && (wait_ms == -1 || nextTimeout < wait_ms)) + wait_ms = nextTimeout; tv.tv_sec = wait_ms / 1000; tv.tv_usec = (wait_ms % 1000) * 1000; // Do the wait... sched.sleepStarted(); - int n = select(FD_SETSIZE, &rfds, &wfds, 0, - wait_ms ? &tv : NULL); + int n = select(FD_SETSIZE, &rfds, &wfds, nullptr, + wait_ms >= 0 ? &tv : nullptr); sched.sleepFinished(); if (n < 0) { @@ -447,11 +446,9 @@ int main(int argc, char** argv) } // Accept new VNC connections - for (std::list<SocketListener*>::iterator i = listeners.begin(); - i != listeners.end(); - i++) { - if (FD_ISSET((*i)->getFd(), &rfds)) { - Socket* sock = (*i)->accept(); + for (SocketListener* listener : listeners) { + if (FD_ISSET(listener->getFd(), &rfds)) { + Socket* sock = listener->accept(); if (sock) { server.addSocket(sock); } else { @@ -491,11 +488,8 @@ int main(int argc, char** argv) TXWindow::handleXEvents(dpy); // Run listener destructors; remove UNIX sockets etc - for (std::list<SocketListener*>::iterator i = listeners.begin(); - i != listeners.end(); - i++) { - delete *i; - } + for (SocketListener* listener : listeners) + delete listener; vlog.info("Terminated"); return 0; diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am index 1e985966..caf3b948 100644 --- a/unix/xserver/hw/vnc/Makefile.am +++ b/unix/xserver/hw/vnc/Makefile.am @@ -8,22 +8,28 @@ NETWORK_LIB=$(TIGERVNC_BUILDDIR)/common/network/libnetwork.la UNIXCOMMON_LIB=$(TIGERVNC_BUILDDIR)/unix/common/libunixcommon.la COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(OS_LIB) $(UNIXCOMMON_LIB) +AM_CPPFLAGS = \ + -I$(TIGERVNC_BUILDDIR) \ + -I$(TIGERVNC_SRCDIR)/common \ + -I$(TIGERVNC_SRCDIR)/unix/common \ + $(DIX_CFLAGS) $(LIBXCVT_CFLAGS) + +AM_CXXFLAGS = -std=gnu++11 + noinst_LTLIBRARIES = libvnccommon.la HDRS = vncExtInit.h vncHooks.h \ - vncBlockHandler.h vncSelection.h \ + vncBlockHandler.h vncPresent.h vncSelection.h \ XorgGlue.h XserverDesktop.h xorg-version.h \ vncInput.h RFBGlue.h libvnccommon_la_SOURCES = $(HDRS) \ - vncExt.c vncExtInit.cc vncHooks.c vncSelection.c \ + vncExt.c vncExtInit.cc vncHooks.c vncPresent.c vncSelection.c \ vncBlockHandler.c XorgGlue.c RandrGlue.c RFBGlue.cc XserverDesktop.cc \ vncInput.c vncInputXKB.c qnum_to_xorgevdev.c qnum_to_xorgkbd.c -libvnccommon_la_CPPFLAGS = -DVENDOR_RELEASE="$(VENDOR_RELEASE)" -I$(TIGERVNC_SRCDIR)/unix/common \ - -DVENDOR_STRING="\"$(VENDOR_STRING)\"" -I$(TIGERVNC_SRCDIR)/common -UHAVE_CONFIG_H \ - -I$(TIGERVNC_SRCDIR)/unix/vncconfig $(XVNC_CPPFLAGS) ${XSERVERLIBS_CFLAGS} \ - -I$(top_srcdir)/include +libvnccommon_la_CPPFLAGS = $(AM_CPPFLAGS) \ + -I$(TIGERVNC_SRCDIR)/unix/vncconfig bin_PROGRAMS = Xvnc @@ -31,18 +37,14 @@ man1_MANS = Xvnc.man Xvnc_SOURCES = xvnc.c \ $(top_srcdir)/Xi/stubs.c $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/fb/fbcmap_mi.c buildtime.c + buildtime.c # Xvnc contains no C++ sources so automake doesn't understand that we # need to use the C++ compiler to link things. This is the upstream # recommendation for coaxing automake. nodist_EXTRA_Xvnc_SOURCES = dummy.cxx -Xvnc_CPPFLAGS = $(XVNC_CPPFLAGS) -DTIGERVNC -DNO_MODULE_EXTS \ - -UHAVE_CONFIG_H \ - -DXFree86Server -DVENDOR_RELEASE="$(VENDOR_RELEASE)" \ - -DVENDOR_STRING="\"$(VENDOR_STRING)\"" -I$(TIGERVNC_SRCDIR)/common -I$(TIGERVNC_SRCDIR)/unix/common \ - -I$(top_srcdir)/include ${XSERVERLIBS_CFLAGS} +Xvnc_CPPFLAGS = $(AM_CPPFLAGS) LOCAL_LIBS = \ $(XVNC_LIBS) \ @@ -51,10 +53,22 @@ LOCAL_LIBS = \ $(COMMON_LIBS) Xvnc_DEPENDENCIES = $(LOCAL_LIBS) -Xvnc_LDADD = $(LOCAL_LIBS) $(XSERVER_SYS_LIBS) $(XVNC_SYS_LIBS) -lX11 +Xvnc_LDADD = \ + $(LOCAL_LIBS) \ + $(XSERVER_SYS_LIBS) \ + $(XVNC_SYS_LIBS) \ + $(LIBXCVT_LIBS) Xvnc_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) +if DRI3 +Xvnc_SOURCES += vncDRI3.h vncDRI3.c vncDRI3Draw.c +Xvnc_CPPFLAGS += \ + -I$(top_srcdir)/dri3 \ + $(GBM_CFLAGS) +Xvnc_LDADD += $(GBM_LIBS) +endif + libvnc_la_LTLIBRARIES = libvnc.la libvnc_ladir = $(moduledir)/extensions @@ -63,13 +77,10 @@ libvnc_la_SOURCES = vncModule.c # See Xvnc magic above nodist_EXTRA_libvnc_la_SOURCES = dummy.cxx -libvnc_la_CPPFLAGS = $(XVNC_CPPFLAGS) -I$(TIGERVNC_SRCDIR)/common -UHAVE_CONFIG_H \ - -I$(TIGERVNC_SRCDIR)/unix/common \ +libvnc_la_CPPFLAGS = $(AM_CPPFLAGS) \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/os-support \ - -I$(top_srcdir)/hw/xfree86/os-support/bus \ - -I$(top_srcdir)/include \ - ${XSERVERLIBS_CFLAGS} + -I$(top_srcdir)/hw/xfree86/os-support/bus libvnc_la_LDFLAGS = -module -avoid-version -Wl,-z,now diff --git a/unix/xserver/hw/vnc/RFBGlue.cc b/unix/xserver/hw/vnc/RFBGlue.cc index 25431b65..2cbee35c 100644 --- a/unix/xserver/hw/vnc/RFBGlue.cc +++ b/unix/xserver/hw/vnc/RFBGlue.cc @@ -51,7 +51,7 @@ void vncLogError(const char *name, const char *format, ...) LogWriter *vlog; va_list ap; vlog = LogWriter::getLogWriter(name); - if (vlog == NULL) + if (vlog == nullptr) return; va_start(ap, format); vlog->verror(format, ap); @@ -63,7 +63,7 @@ void vncLogStatus(const char *name, const char *format, ...) LogWriter *vlog; va_list ap; vlog = LogWriter::getLogWriter(name); - if (vlog == NULL) + if (vlog == nullptr) return; va_start(ap, format); vlog->vstatus(format, ap); @@ -75,7 +75,7 @@ void vncLogInfo(const char *name, const char *format, ...) LogWriter *vlog; va_list ap; vlog = LogWriter::getLogWriter(name); - if (vlog == NULL) + if (vlog == nullptr) return; va_start(ap, format); vlog->vinfo(format, ap); @@ -87,7 +87,7 @@ void vncLogDebug(const char *name, const char *format, ...) LogWriter *vlog; va_list ap; vlog = LogWriter::getLogWriter(name); - if (vlog == NULL) + if (vlog == nullptr) return; va_start(ap, format); vlog->vdebug(format, ap); @@ -96,12 +96,12 @@ void vncLogDebug(const char *name, const char *format, ...) int vncSetParam(const char *name, const char *value) { - if (value != NULL) + if (value != nullptr) return rfb::Configuration::setParam(name, value); else { VoidParameter *param; param = rfb::Configuration::getParam(name); - if (param == NULL) + if (param == nullptr) return false; return param->setParam(); } @@ -118,11 +118,11 @@ char* vncGetParam(const char *name) // Hack to avoid exposing password! if (strcasecmp(name, "Password") == 0) - return NULL; + return nullptr; param = rfb::Configuration::getParam(name); - if (param == NULL) - return NULL; + if (param == nullptr) + return nullptr; return strdup(param->getValueStr().c_str()); } @@ -132,8 +132,8 @@ const char* vncGetParamDesc(const char *name) rfb::VoidParameter *param; param = rfb::Configuration::getParam(name); - if (param == NULL) - return NULL; + if (param == nullptr) + return nullptr; return param->getDescription(); } @@ -144,11 +144,11 @@ int vncIsParamBool(const char *name) BoolParameter *bparam; param = rfb::Configuration::getParam(name); - if (param == NULL) + if (param == nullptr) return false; bparam = dynamic_cast<BoolParameter*>(param); - if (bparam == NULL) + if (bparam == nullptr) return false; return true; @@ -179,8 +179,8 @@ char *vncGetParamList(void) } data = (char*)malloc(len + 1); - if (data == NULL) - return NULL; + if (data == nullptr) + return nullptr; ptr = data; for (ParameterIterator i; i.param; i.next()) { @@ -227,7 +227,7 @@ char* vncConvertLF(const char* src, size_t bytes) try { return strdup(convertLF(src, bytes).c_str()); } catch (...) { - return NULL; + return nullptr; } } @@ -236,7 +236,7 @@ char* vncLatin1ToUTF8(const char* src, size_t bytes) try { return strdup(latin1ToUTF8(src, bytes).c_str()); } catch (...) { - return NULL; + return nullptr; } } @@ -245,7 +245,7 @@ char* vncUTF8ToLatin1(const char* src, size_t bytes) try { return strdup(utf8ToLatin1(src, bytes).c_str()); } catch (...) { - return NULL; + return nullptr; } } diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 4cf37937..e3bc57d8 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2009-2019 Pierre Ossman for Cendio AB + * Copyright 2009-2024 Pierre Ossman for Cendio AB * Copyright 2014 Brian P. Hinz * * This is free software; you can redistribute it and/or modify @@ -54,6 +54,7 @@ extern "C" { void vncSetGlueContext(int screenIndex); +void vncPresentMscEvent(uint64_t id, uint64_t msc); } using namespace rfb; @@ -79,7 +80,7 @@ XserverDesktop::XserverDesktop(int screenIndex_, void* fbptr, int stride_) : screenIndex(screenIndex_), server(0), listeners(listeners_), - shadowFramebuffer(NULL), + shadowFramebuffer(nullptr), queryConnectId(0), queryConnectTimer(this) { format = pf; @@ -87,11 +88,8 @@ XserverDesktop::XserverDesktop(int screenIndex_, server = new VNCServerST(name, this); setFramebuffer(width, height, fbptr, stride_); - for (std::list<SocketListener*>::iterator i = listeners.begin(); - i != listeners.end(); - i++) { - vncSetNotifyFd((*i)->getFd(), screenIndex, true, false); - } + for (SocketListener* listener : listeners) + vncSetNotifyFd(listener->getFd(), screenIndex, true, false); } XserverDesktop::~XserverDesktop() @@ -122,7 +120,7 @@ void XserverDesktop::setFramebuffer(int w, int h, void* fbptr, int stride_) if (shadowFramebuffer) { delete [] shadowFramebuffer; - shadowFramebuffer = NULL; + shadowFramebuffer = nullptr; } if (!fbptr) { @@ -145,15 +143,26 @@ void XserverDesktop::refreshScreenLayout() server->setScreenLayout(::computeScreenLayout(&outputIdMap)); } -void XserverDesktop::start(rfb::VNCServer* vs) +uint64_t XserverDesktop::getMsc() { - // We already own the server object, and we always keep it in a - // ready state - assert(vs == server); + return server->getMsc(); +} + +void XserverDesktop::queueMsc(uint64_t id, uint64_t msc) +{ + pendingMsc[id] = msc; + server->queueMsc(msc); } -void XserverDesktop::stop() +void XserverDesktop::abortMsc(uint64_t id) { + pendingMsc.erase(id); +} + +void XserverDesktop::init(rfb::VNCServer* vs) +{ + // We already own the server object, and we always keep it in a + // ready state } void XserverDesktop::queryConnection(network::Socket* sock, @@ -395,7 +404,7 @@ void XserverDesktop::blockHandler(int* timeout) // Trigger timers and check when the next will expire int nextTimeout = Timer::checkTimeouts(); - if (nextTimeout > 0 && (*timeout == -1 || nextTimeout < *timeout)) + if (nextTimeout >= 0 && (*timeout == -1 || nextTimeout < *timeout)) *timeout = nextTimeout; } catch (rdr::Exception& e) { vlog.error("XserverDesktop::blockHandler: %s",e.str()); @@ -454,7 +463,7 @@ void XserverDesktop::terminate() kill(getpid(), SIGTERM); } -void XserverDesktop::pointerEvent(const Point& pos, int buttonMask) +void XserverDesktop::pointerEvent(const Point& pos, uint8_t buttonMask) { vncPointerMove(pos.x + vncGetScreenX(screenIndex), pos.y + vncGetScreenY(screenIndex)); @@ -476,6 +485,22 @@ unsigned int XserverDesktop::setScreenLayout(int fb_width, int fb_height, return result; } +void XserverDesktop::frameTick(uint64_t msc) +{ + std::map<uint64_t, uint64_t>::iterator iter, next; + + for (iter = pendingMsc.begin(); iter != pendingMsc.end();) { + next = iter; next++; + + if (iter->second <= msc) { + pendingMsc.erase(iter->first); + vncPresentMscEvent(iter->first, msc); + } + + iter = next; + } +} + void XserverDesktop::handleClipboardRequest() { vncHandleClipboardRequest(); @@ -493,7 +518,7 @@ void XserverDesktop::handleClipboardData(const char* data_) void XserverDesktop::grabRegion(const rfb::Region& region) { - if (shadowFramebuffer == NULL) + if (shadowFramebuffer == nullptr) return; std::vector<rfb::Rect> rects; @@ -518,13 +543,11 @@ void XserverDesktop::keyEvent(uint32_t keysym, uint32_t keycode, bool down) vncKeyboardEvent(keysym, keycode, down); } -bool XserverDesktop::handleTimeout(Timer* t) +void XserverDesktop::handleTimeout(Timer* t) { if (t == &queryConnectTimer) { server->approveConnection(queryConnectSocket, false, "The attempt to prompt the user to " "accept the connection failed"); } - - return false; } diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h index 9cc5bf79..d287b72f 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.h +++ b/unix/xserver/hw/vnc/XserverDesktop.h @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2009-2019 Pierre Ossman for Cendio AB + * Copyright 2009-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,6 +59,9 @@ public: void unblockUpdates(); void setFramebuffer(int w, int h, void* fbptr, int stride); void refreshScreenLayout(); + uint64_t getMsc(); + void queueMsc(uint64_t id, uint64_t msc); + void abortMsc(uint64_t id); void requestClipboard(); void announceClipboard(bool available); void sendClipboardData(const char* data); @@ -88,21 +91,21 @@ public: const char* rejectMsg=0); // rfb::SDesktop callbacks - virtual void start(rfb::VNCServer* vs); - virtual void stop(); - virtual void terminate(); - virtual void queryConnection(network::Socket* sock, - const char* userName); - virtual void pointerEvent(const rfb::Point& pos, int buttonMask); - virtual void keyEvent(uint32_t keysym, uint32_t keycode, bool down); - virtual unsigned int setScreenLayout(int fb_width, int fb_height, - const rfb::ScreenSet& layout); - virtual void handleClipboardRequest(); - virtual void handleClipboardAnnounce(bool available); - virtual void handleClipboardData(const char* data); + void init(rfb::VNCServer* vs) override; + void terminate() override; + void queryConnection(network::Socket* sock, + const char* userName) override; + void pointerEvent(const rfb::Point& pos, uint8_t buttonMask) override; + void keyEvent(uint32_t keysym, uint32_t keycode, bool down) override; + unsigned int setScreenLayout(int fb_width, int fb_height, + const rfb::ScreenSet& layout) override; + void frameTick(uint64_t msc) override; + void handleClipboardRequest() override; + void handleClipboardAnnounce(bool available) override; + void handleClipboardData(const char* data) override; // rfb::PixelBuffer callbacks - virtual void grabRegion(const rfb::Region& r); + void grabRegion(const rfb::Region& r) override; protected: bool handleListenerEvent(int fd, @@ -112,7 +115,7 @@ protected: rfb::VNCServer* sockserv, bool read, bool write); - virtual bool handleTimeout(rfb::Timer* t); + void handleTimeout(rfb::Timer* t) override; private: @@ -129,6 +132,8 @@ private: OutputIdMap outputIdMap; + std::map<uint64_t, uint64_t> pendingMsc; + rfb::Point oldCursorPos; }; #endif diff --git a/unix/xserver/hw/vnc/Xvnc.man b/unix/xserver/hw/vnc/Xvnc.man index e43ba150..b9c429f7 100644 --- a/unix/xserver/hw/vnc/Xvnc.man +++ b/unix/xserver/hw/vnc/Xvnc.man @@ -46,6 +46,12 @@ Specify pixel format for server to use (BGRnnn or RGBnnn). The default for depth 16 is RGB565 and for depth 24 and 32 is RGB888. . .TP +.B \-rendernode \fIpath\fP +DRM render node to use for DRI3 GPU acceleration. Specify an empty path to +disable DRI3. Default is \fBauto\fP which makes \fBXvnc\fP pick a suitable +available render node. +. +.TP .B \-interface \fIIP address\fP Listen on interface. By default Xvnc listens on all available interfaces. . diff --git a/unix/xserver/hw/vnc/vncDRI3.c b/unix/xserver/hw/vnc/vncDRI3.c new file mode 100644 index 00000000..79b56f10 --- /dev/null +++ b/unix/xserver/hw/vnc/vncDRI3.c @@ -0,0 +1,537 @@ +/* Copyright 2024 Pierre Ossman for Cendio AB + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <errno.h> +#include <fcntl.h> +#include <glob.h> +#include <unistd.h> + +#ifdef HAVE_GBM +#include <gbm.h> +#endif + +#include "vncDRI3.h" +#include <dri3.h> +#include <fb.h> +#include <misyncshm.h> + +#ifdef FB_ACCESS_WRAPPER +#error "This code is not compatible with accessors" +#endif + +const char *renderNode = "auto"; + +static DevPrivateKeyRec vncDRI3ScreenPrivateKey; +static DevPrivateKeyRec vncDRI3PixmapPrivateKey; + +typedef struct vncDRI3ScreenPrivate { + CloseScreenProcPtr CloseScreen; + + DestroyPixmapProcPtr DestroyPixmap; + +#ifdef HAVE_GBM + const char *devicePath; + struct gbm_device *device; + int fd; +#endif +} vncDRI3ScreenPrivateRec, *vncDRI3ScreenPrivatePtr; + +typedef struct vncDRI3PixmapPrivate { +#ifdef HAVE_GBM + struct gbm_bo *bo; +#endif +} vncDRI3PixmapPrivateRec, *vncDRI3PixmapPrivatePtr; + +#define wrap(priv, real, mem, func) {\ + priv->mem = real->mem; \ + real->mem = func; \ +} + +#define unwrap(priv, real, mem) {\ + real->mem = priv->mem; \ +} + +static inline vncDRI3ScreenPrivatePtr vncDRI3ScreenPrivate(ScreenPtr screen) +{ + return (vncDRI3ScreenPrivatePtr)dixLookupPrivate(&(screen)->devPrivates, &vncDRI3ScreenPrivateKey); +} + +static inline vncDRI3PixmapPrivatePtr vncDRI3PixmapPrivate(PixmapPtr pixmap) +{ + return (vncDRI3PixmapPrivatePtr)dixLookupPrivate(&(pixmap)->devPrivates, &vncDRI3PixmapPrivateKey); +} + +static int vncDRI3Open(ScreenPtr screen, RRProviderPtr provider, + int *fd) +{ +#ifdef HAVE_GBM + vncDRI3ScreenPrivatePtr screenPriv = vncDRI3ScreenPrivate(screen); + + *fd = open(screenPriv->devicePath, O_RDWR|O_CLOEXEC); + if (*fd < 0) + return BadAlloc; + + return Success; +#else + return BadAlloc; +#endif +} + +/* Taken from glamor */ +#ifdef HAVE_GBM +static uint32_t gbm_format_for_depth(CARD8 depth) +{ + switch (depth) { + case 16: + return GBM_FORMAT_RGB565; + case 24: + return GBM_FORMAT_XRGB8888; + case 30: + return GBM_FORMAT_ARGB2101010; + default: + ErrorF("unexpected depth: %d\n", depth); + case 32: + return GBM_FORMAT_ARGB8888; + } +} +#endif + +static PixmapPtr vncPixmapFromFd(ScreenPtr screen, int fd, + CARD16 width, CARD16 height, + CARD16 stride, CARD8 depth, + CARD8 bpp) +{ +#ifdef HAVE_GBM + vncDRI3ScreenPrivatePtr screenPriv = vncDRI3ScreenPrivate(screen); + vncDRI3PixmapPrivatePtr pixmapPriv; + + struct gbm_import_fd_data data; + struct gbm_bo *bo; + PixmapPtr pixmap; + + if (bpp != sizeof(FbBits)*8) { + ErrorF("Incompatible bits per pixel given for GPU buffer\n"); + return NULL; + } + + if ((stride % sizeof(FbBits)) != 0) { + ErrorF("Incompatible stride given for GPU buffer\n"); + return NULL; + } + + data.fd = fd; + data.width = width; + data.height = height; + data.stride = stride; + data.format = gbm_format_for_depth(depth); + + bo = gbm_bo_import(screenPriv->device, GBM_BO_IMPORT_FD, &data, + GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR); + if (bo == NULL) + return NULL; + + pixmap = screen->CreatePixmap(screen, width, height, depth, 0); + + pixmapPriv = vncDRI3PixmapPrivate(pixmap); + pixmapPriv->bo = bo; + + vncDRI3SyncPixmapFromGPU(pixmap); + + return pixmap; +#else + return NULL; +#endif +} + +static Bool vncDRI3DestroyPixmap(PixmapPtr pixmap) +{ + ScreenPtr screen = pixmap->drawable.pScreen; + vncDRI3ScreenPrivatePtr screenPriv = vncDRI3ScreenPrivate(screen); + Bool ret; + +#ifdef HAVE_GBM + if (pixmap->refcnt == 1) { + vncDRI3PixmapPrivatePtr pixmapPriv = vncDRI3PixmapPrivate(pixmap); + + if (pixmapPriv->bo != NULL) { + gbm_bo_destroy(pixmapPriv->bo); + pixmapPriv->bo = NULL; + } + } +#endif + + unwrap(screenPriv, screen, DestroyPixmap); + ret = screen->DestroyPixmap(pixmap); + wrap(screenPriv, screen, DestroyPixmap, vncDRI3DestroyPixmap); + + return ret; +} + +#ifdef HAVE_GBM +static int vncDRI3FdFromPixmapVisitWindow(WindowPtr window, void *data) +{ + ScreenPtr screen = window->drawable.pScreen; + PixmapPtr pixmap = data; + + if ((*screen->GetWindowPixmap)(window) == pixmap) + window->drawable.serialNumber = NEXT_SERIAL_NUMBER; + + return WT_WALKCHILDREN; +} +#endif + +static int vncFdFromPixmap(ScreenPtr screen, PixmapPtr pixmap, + CARD16 *stride, CARD32 *size) +{ +#ifdef HAVE_GBM + vncDRI3ScreenPrivatePtr screenPriv = vncDRI3ScreenPrivate(screen); + vncDRI3PixmapPrivatePtr pixmapPriv = vncDRI3PixmapPrivate(pixmap); + + if (pixmap->drawable.bitsPerPixel != sizeof(FbBits)*8) { + ErrorF("Incompatible bits per pixel given for pixmap\n"); + return -1; + } + + if (pixmapPriv->bo == NULL) { + /* GBM_BO_USE_LINEAR ? */ + pixmapPriv->bo = gbm_bo_create(screenPriv->device, + pixmap->drawable.width, + pixmap->drawable.height, + gbm_format_for_depth(pixmap->drawable.depth), + GBM_BO_USE_RENDERING | GBM_BO_USE_LINEAR); + if (pixmapPriv->bo == NULL) { + ErrorF("Failed to create GPU buffer: %s\n", strerror(errno)); + return -1; + } + + if ((gbm_bo_get_stride(pixmapPriv->bo) % sizeof(FbBits)) != 0) { + ErrorF("Incompatible stride for created GPU buffer\n"); + gbm_bo_destroy(pixmapPriv->bo); + pixmapPriv->bo = NULL; + return -1; + } + + /* Force re-validation of any gc:s */ + pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; + WalkTree(screen, vncDRI3FdFromPixmapVisitWindow, pixmap); + } + + vncDRI3SyncPixmapToGPU(pixmap); + + *stride = gbm_bo_get_stride(pixmapPriv->bo); + /* FIXME */ + *size = *stride * gbm_bo_get_height(pixmapPriv->bo); + + return gbm_bo_get_fd(pixmapPriv->bo); +#else + return -1; +#endif +} + +Bool vncDRI3IsHardwarePixmap(PixmapPtr pixmap) +{ +#ifdef HAVE_GBM + vncDRI3PixmapPrivatePtr pixmapPriv = vncDRI3PixmapPrivate(pixmap); + return pixmapPriv->bo != NULL; +#else + return FALSE; +#endif +} + +Bool vncDRI3IsHardwareDrawable(DrawablePtr drawable) +{ + PixmapPtr pixmap; + int xoff, yoff; + + fbGetDrawablePixmap(drawable, pixmap, xoff, yoff); + (void)xoff; + (void)yoff; + + return vncDRI3IsHardwarePixmap(pixmap); +} + +Bool vncDRI3SyncPixmapToGPU(PixmapPtr pixmap) +{ +#ifdef HAVE_GBM + vncDRI3PixmapPrivatePtr pixmapPriv = vncDRI3PixmapPrivate(pixmap); + + int width, height; + + FbBits *bo_data; + uint32_t bo_stride; + void *map_data; + uint32_t bo_bpp; + + FbBits *pixmap_data; + int pixmap_stride; + int pixmap_bpp; + + pixman_bool_t ret; + + if (pixmapPriv->bo == NULL) + return TRUE; + + width = gbm_bo_get_width(pixmapPriv->bo); + height = gbm_bo_get_height(pixmapPriv->bo); + + map_data = NULL; + bo_data = gbm_bo_map(pixmapPriv->bo, 0, 0, width, height, + GBM_BO_TRANSFER_WRITE, &bo_stride, &map_data); + if (bo_data == NULL) { + ErrorF("Could not map GPU buffer: %s\n", strerror(errno)); + return FALSE; + } + + bo_bpp = gbm_bo_get_bpp(pixmapPriv->bo); + assert(bo_bpp == sizeof(FbBits)*8); + assert((bo_stride % (bo_bpp/8)) == 0); + + fbGetPixmapBitsData(pixmap, pixmap_data, + pixmap_stride, pixmap_bpp); + assert(pixmap_data != NULL); + assert(pixmap_bpp == sizeof(FbBits)*8); + + assert(bo_bpp == pixmap_bpp); + + /* Try accelerated copy first */ + ret = pixman_blt((uint32_t*)pixmap_data, (uint32_t*)bo_data, + pixmap_stride, bo_stride / (bo_bpp/8), + pixmap_bpp, bo_bpp, 0, 0, 0, 0, width, height); + if (!ret) { + /* Fall back to slow pure C version */ + fbBlt(pixmap_data, pixmap_stride, 0, + bo_data, bo_stride / (bo_bpp/8), 0, + width * bo_bpp, height, + GXcopy, FB_ALLONES, bo_bpp, FALSE, FALSE); + } + + gbm_bo_unmap(pixmapPriv->bo, map_data); +#endif + + return TRUE; +} + +Bool vncDRI3SyncPixmapFromGPU(PixmapPtr pixmap) +{ +#ifdef HAVE_GBM + vncDRI3PixmapPrivatePtr pixmapPriv = vncDRI3PixmapPrivate(pixmap); + + int width, height; + + FbBits *bo_data; + uint32_t bo_stride; + void *map_data; + uint32_t bo_bpp; + + FbBits *pixmap_data; + int pixmap_stride; + int pixmap_bpp; + + pixman_bool_t ret; + + if (pixmapPriv->bo == NULL) + return TRUE; + + width = gbm_bo_get_width(pixmapPriv->bo); + height = gbm_bo_get_height(pixmapPriv->bo); + + map_data = NULL; + bo_data = gbm_bo_map(pixmapPriv->bo, 0, 0, width, height, + GBM_BO_TRANSFER_READ, &bo_stride, &map_data); + if (bo_data == NULL) { + ErrorF("Could not map GPU buffer: %s\n", strerror(errno)); + return FALSE; + } + + bo_bpp = gbm_bo_get_bpp(pixmapPriv->bo); + assert(bo_bpp == sizeof(FbBits)*8); + assert((bo_stride % (bo_bpp/8)) == 0); + + fbGetPixmapBitsData(pixmap, pixmap_data, + pixmap_stride, pixmap_bpp); + assert(pixmap_data != NULL); + assert(pixmap_bpp == sizeof(FbBits)*8); + + assert(bo_bpp == pixmap_bpp); + + /* Try accelerated copy first */ + ret = pixman_blt((uint32_t*)bo_data, (uint32_t*)pixmap_data, + bo_stride / (bo_bpp/8), pixmap_stride, + bo_bpp, pixmap_bpp, 0, 0, 0, 0, width, height); + if (!ret) { + /* Fall back to slow pure C version */ + fbBlt(bo_data, bo_stride / (bo_bpp/8), 0, + pixmap_data, pixmap_stride, 0, + width * bo_bpp, height, + GXcopy, FB_ALLONES, bo_bpp, FALSE, FALSE); + } + + gbm_bo_unmap(pixmapPriv->bo, map_data); +#endif + + return TRUE; +} + +Bool vncDRI3SyncDrawableToGPU(DrawablePtr drawable) +{ + PixmapPtr pixmap; + int xoff, yoff; + + fbGetDrawablePixmap(drawable, pixmap, xoff, yoff); + (void)xoff; + (void)yoff; + + return vncDRI3SyncPixmapToGPU(pixmap); +} + +Bool vncDRI3SyncDrawableFromGPU(DrawablePtr drawable) +{ + PixmapPtr pixmap; + int xoff, yoff; + + fbGetDrawablePixmap(drawable, pixmap, xoff, yoff); + (void)xoff; + (void)yoff; + + return vncDRI3SyncPixmapFromGPU(pixmap); +} + +static const dri3_screen_info_rec vncDRI3ScreenInfo = { + .version = 1, + + .open = vncDRI3Open, + .pixmap_from_fd = vncPixmapFromFd, + .fd_from_pixmap = vncFdFromPixmap, +}; + +static Bool vncDRI3CloseScreen(ScreenPtr screen) +{ + vncDRI3ScreenPrivatePtr screenPriv = vncDRI3ScreenPrivate(screen); + + unwrap(screenPriv, screen, CloseScreen); + + unwrap(screenPriv, screen, DestroyPixmap); + +#ifdef HAVE_GBM + gbm_device_destroy(screenPriv->device); + screenPriv->device = NULL; + + close(screenPriv->fd); + screenPriv->fd = -1; +#endif + + return (*screen->CloseScreen)(screen); +} + +Bool vncDRI3Init(ScreenPtr screen) +{ + vncDRI3ScreenPrivatePtr screenPriv; + + /* + * We don't queue any gbm operations, so we don't have to do anything + * more than simply activate this extension. + */ +#ifdef HAVE_XSHMFENCE + if (!miSyncShmScreenInit(screen)) + return FALSE; +#endif + + /* Empty render node is interpreted as disabling DRI3 */ + if (renderNode[0] == '\0') + return TRUE; + + if ((renderNode[0] != '/') && + (strcasecmp(renderNode, "auto") != 0)) { + ErrorF("Invalid render node path \"%s\"\n", renderNode); + return FALSE; + } + + if (!dixRegisterPrivateKey(&vncDRI3ScreenPrivateKey, PRIVATE_SCREEN, + sizeof(vncDRI3ScreenPrivateRec))) + return FALSE; + if (!dixRegisterPrivateKey(&vncDRI3PixmapPrivateKey, PRIVATE_PIXMAP, + sizeof(vncDRI3PixmapPrivateRec))) + return FALSE; + + if (!vncDRI3DrawInit(screen)) + return FALSE; + +#ifdef HAVE_GBM + screenPriv = vncDRI3ScreenPrivate(screen); + + if (strcasecmp(renderNode, "auto") == 0) { + glob_t globbuf; + int ret; + + ret = glob("/dev/dri/renderD*", 0, NULL, &globbuf); + if (ret == GLOB_NOMATCH) { + ErrorF("Could not find any render nodes\n"); + return FALSE; + } + if (ret != 0) { + ErrorF("Failure enumerating render nodes\n"); + return FALSE; + } + + screenPriv->devicePath = NULL; + for (size_t i = 0;i < globbuf.gl_pathc;i++) { + if (access(globbuf.gl_pathv[i], R_OK|W_OK) == 0) { + screenPriv->devicePath = strdup(globbuf.gl_pathv[i]); + break; + } + } + + globfree(&globbuf); + + if (screenPriv->devicePath == NULL) { + ErrorF("Could not find any available render nodes\n"); + return FALSE; + } + } else { + screenPriv->devicePath = renderNode; + } + + screenPriv->fd = open(screenPriv->devicePath, O_RDWR|O_CLOEXEC); + if (screenPriv->fd < 0) { + ErrorF("Failed to open \"%s\": %s\n", + screenPriv->devicePath, strerror(errno)); + return FALSE; + } + + screenPriv->device = gbm_create_device(screenPriv->fd); + if (screenPriv->device == NULL) { + close(screenPriv->fd); + screenPriv->fd = -1; + ErrorF("Could create GPU render device\n"); + return FALSE; + } +#else + ErrorF("Built without GBM support\n"); + return FALSE; +#endif + + wrap(screenPriv, screen, CloseScreen, vncDRI3CloseScreen); + + wrap(screenPriv, screen, DestroyPixmap, vncDRI3DestroyPixmap); + + return dri3_screen_init(screen, &vncDRI3ScreenInfo); +} diff --git a/common/rfb/InputHandler.h b/unix/xserver/hw/vnc/vncDRI3.h index ad6c4be5..4f89a25a 100644 --- a/common/rfb/InputHandler.h +++ b/unix/xserver/hw/vnc/vncDRI3.h @@ -1,43 +1,43 @@ -/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * +/* Copyright 2024 Pierre Ossman for Cendio AB + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ -// -// InputHandler - abstract interface for accepting keyboard & -// pointer input and clipboard data. -// -#ifndef __RFB_INPUTHANDLER_H__ -#define __RFB_INPUTHANDLER_H__ +#ifndef __VNCDRI3_H__ +#define __VNCDRI3_H__ -#include <stdint.h> +#ifdef DRI3 -#include <rfb/Rect.h> +#include <dix.h> -namespace rfb { +extern const char *renderNode; - class InputHandler { - public: - virtual ~InputHandler() {} - virtual void keyEvent(uint32_t /*keysym*/, uint32_t /*keycode*/, - bool /*down*/) { } - virtual void pointerEvent(const Point& /*pos*/, - int /*buttonMask*/) { } - virtual void clientCutText(const char* /*str*/) { } - }; +Bool vncDRI3Init(ScreenPtr screen); + +Bool vncDRI3IsHardwarePixmap(PixmapPtr pixmap); +Bool vncDRI3IsHardwareDrawable(DrawablePtr drawable); + +Bool vncDRI3SyncPixmapToGPU(PixmapPtr pixmap); +Bool vncDRI3SyncPixmapFromGPU(PixmapPtr pixmap); + +Bool vncDRI3SyncDrawableToGPU(DrawablePtr drawable); +Bool vncDRI3SyncDrawableFromGPU(DrawablePtr drawable); + +Bool vncDRI3DrawInit(ScreenPtr screen); + +#endif -} #endif diff --git a/unix/xserver/hw/vnc/vncDRI3Draw.c b/unix/xserver/hw/vnc/vncDRI3Draw.c new file mode 100644 index 00000000..8aa6625d --- /dev/null +++ b/unix/xserver/hw/vnc/vncDRI3Draw.c @@ -0,0 +1,785 @@ +/* Copyright 2024 Pierre Ossman for Cendio AB + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "vncDRI3.h" + +#include <fb.h> +#include <gcstruct.h> +#include <pixmapstr.h> + +static DevPrivateKeyRec vncDRI3DrawScreenPrivateKey; +static DevPrivateKeyRec vncDRI3GCPrivateKey; + +typedef struct vncDRI3DrawScreenPrivateRec { + CloseScreenProcPtr CloseScreen; + + CreateGCProcPtr CreateGC; + SourceValidateProcPtr SourceValidate; + + CompositeProcPtr Composite; + GlyphsProcPtr Glyphs; + CompositeRectsProcPtr CompositeRects; + TrapezoidsProcPtr Trapezoids; + TrianglesProcPtr Triangles; + TriStripProcPtr TriStrip; + TriFanProcPtr TriFan; +} vncDRI3DrawScreenPrivateRec, *vncDRI3DrawScreenPrivatePtr; + +typedef struct vncDRI3GCPrivateRec { + const GCFuncs *funcs; + const GCOps *ops; +} vncDRI3GCPrivateRec, *vncDRI3GCPrivatePtr; + +#define wrap(priv, real, mem, func) {\ + priv->mem = real->mem; \ + real->mem = func; \ +} + +#define unwrap(priv, real, mem) {\ + real->mem = priv->mem; \ +} + +static inline vncDRI3DrawScreenPrivatePtr vncDRI3DrawScreenPrivate(ScreenPtr screen) +{ + return (vncDRI3DrawScreenPrivatePtr)dixLookupPrivate(&(screen)->devPrivates, &vncDRI3DrawScreenPrivateKey); +} + +static inline vncDRI3GCPrivatePtr vncDRI3GCPrivate(GCPtr gc) +{ + return (vncDRI3GCPrivatePtr)dixLookupPrivate(&(gc)->devPrivates, &vncDRI3GCPrivateKey); +} + +static GCFuncs vncDRI3GCFuncs; +static GCOps vncDRI3GCOps; + +/* GC functions */ + +static void vncDRI3ValidateGC(GCPtr gc, unsigned long changes, + DrawablePtr drawable) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + unwrap(gcPriv, gc, funcs); + if (gcPriv->ops != NULL) + unwrap(gcPriv, gc, ops); + + (*gc->funcs->ValidateGC)(gc, changes, drawable); + + if (vncDRI3IsHardwareDrawable(drawable)) { + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + } else { + gcPriv->ops = NULL; + } + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); +} + +static void vncDRI3ChangeGC(GCPtr gc, unsigned long mask) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + unwrap(gcPriv, gc, funcs); + if (gcPriv->ops != NULL) + unwrap(gcPriv, gc, ops); + (*gc->funcs->ChangeGC)(gc, mask); + if (gcPriv->ops != NULL) + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); +} + +static void vncDRI3CopyGC(GCPtr src, unsigned long mask, GCPtr dst) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(dst); + unwrap(gcPriv, dst, funcs); + if (gcPriv->ops != NULL) + unwrap(gcPriv, dst, ops); + (*dst->funcs->CopyGC)(src, mask, dst); + if (gcPriv->ops != NULL) + wrap(gcPriv, dst, ops, &vncDRI3GCOps); + wrap(gcPriv, dst, funcs, &vncDRI3GCFuncs); +} + +static void vncDRI3DestroyGC(GCPtr gc) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + unwrap(gcPriv, gc, funcs); + if (gcPriv->ops != NULL) + unwrap(gcPriv, gc, ops); + (*gc->funcs->DestroyGC)(gc); + if (gcPriv->ops != NULL) + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); +} + +static void vncDRI3ChangeClip(GCPtr gc, int type, void *value, int nrects) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + unwrap(gcPriv, gc, funcs); + if (gcPriv->ops != NULL) + unwrap(gcPriv, gc, ops); + (*gc->funcs->ChangeClip)(gc, type, value, nrects); + if (gcPriv->ops != NULL) + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); +} + +static void vncDRI3DestroyClip(GCPtr gc) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + unwrap(gcPriv, gc, funcs); + if (gcPriv->ops != NULL) + unwrap(gcPriv, gc, ops); + (*gc->funcs->DestroyClip)(gc); + if (gcPriv->ops != NULL) + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); +} + +static void vncDRI3CopyClip(GCPtr dst, GCPtr src) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(dst); + unwrap(gcPriv, dst, funcs); + if (gcPriv->ops != NULL) + unwrap(gcPriv, dst, ops); + (*dst->funcs->CopyClip)(dst, src); + if (gcPriv->ops != NULL) + wrap(gcPriv, dst, ops, &vncDRI3GCOps); + wrap(gcPriv, dst, funcs, &vncDRI3GCFuncs); +} + +/* GC operations */ + +static void vncDRI3FillSpans(DrawablePtr drawable, GCPtr gc, int nInit, + DDXPointPtr pptInit, int *pwidthInit, + int fSorted) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->FillSpans)(drawable, gc, nInit, pptInit, pwidthInit, fSorted); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3SetSpans(DrawablePtr drawable, GCPtr gc, char *psrc, + DDXPointPtr ppt, int *pwidth, int nspans, + int fSorted) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->SetSpans)(drawable, gc, psrc, ppt, pwidth, nspans, fSorted); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PutImage(DrawablePtr drawable, GCPtr gc, int depth, + int x, int y, int w, int h, int leftPad, + int format, char *pBits) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PutImage)(drawable, gc, depth, x, y, w, h, leftPad, format, pBits); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static RegionPtr vncDRI3CopyArea(DrawablePtr src, DrawablePtr dst, + GCPtr gc, int srcx, int srcy, + int w, int h, int dstx, int dsty) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + RegionPtr ret; + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(dst); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + ret = (*gc->ops->CopyArea)(src, dst, gc, srcx, srcy, w, h, dstx, dsty); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(dst); + + return ret; +} + +static RegionPtr vncDRI3CopyPlane(DrawablePtr src, DrawablePtr dst, + GCPtr gc, int srcx, int srcy, + int w, int h, int dstx, int dsty, + unsigned long plane) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + RegionPtr ret; + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(dst); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + ret = (*gc->ops->CopyPlane)(src, dst, gc, srcx, srcy, w, h, dstx, dsty, plane); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(dst); + + return ret; +} + +static void vncDRI3PolyPoint(DrawablePtr drawable, GCPtr gc, int mode, + int npt, xPoint *pts) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PolyPoint)(drawable, gc, mode, npt, pts); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3Polylines(DrawablePtr drawable, GCPtr gc, int mode, + int npt, DDXPointPtr ppts) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->Polylines)(drawable, gc, mode, npt, ppts); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PolySegment(DrawablePtr drawable, GCPtr gc, int nseg, + xSegment *segs) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PolySegment)(drawable, gc, nseg, segs); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PolyRectangle(DrawablePtr drawable, GCPtr gc, + int nrects, xRectangle *rects) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PolyRectangle)(drawable, gc, nrects, rects); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PolyArc(DrawablePtr drawable, GCPtr gc, int narcs, + xArc *arcs) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PolyArc)(drawable, gc, narcs, arcs); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3FillPolygon(DrawablePtr drawable, GCPtr gc, + int shape, int mode, int count, + DDXPointPtr pts) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->FillPolygon)(drawable, gc, shape, mode, count, pts); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PolyFillRect(DrawablePtr drawable, GCPtr gc, + int nrects, xRectangle *rects) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PolyFillRect)(drawable, gc, nrects, rects); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PolyFillArc(DrawablePtr drawable, GCPtr gc, + int narcs, xArc *arcs) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PolyFillArc)(drawable, gc, narcs, arcs); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static int vncDRI3PolyText8(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, char *chars) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + int ret; + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + ret = (*gc->ops->PolyText8)(drawable, gc, x, y, count, chars); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); + + return ret; +} + +static int vncDRI3PolyText16(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, + unsigned short *chars) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + int ret; + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + ret = (*gc->ops->PolyText16)(drawable, gc, x, y, count, chars); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); + + return ret; +} + +static void vncDRI3ImageText8(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, char *chars) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->ImageText8)(drawable, gc, x, y, count, chars); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3ImageText16(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, + unsigned short *chars) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->ImageText16)(drawable, gc, x, y, count, chars); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3ImageGlyphBlt(DrawablePtr drawable, GCPtr gc, int x, + int y, unsigned int nglyph, + CharInfoPtr *ppci, void * pglyphBase) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->ImageGlyphBlt)(drawable, gc, x, y, nglyph, ppci, pglyphBase); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PolyGlyphBlt(DrawablePtr drawable, GCPtr gc, int x, + int y, unsigned int nglyph, + CharInfoPtr *ppci, void * pglyphBase) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PolyGlyphBlt)(drawable, gc, x, y, nglyph, ppci, pglyphBase); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static void vncDRI3PushPixels(GCPtr gc, PixmapPtr pBitMap, + DrawablePtr drawable, + int w, int h, int x, int y) +{ + vncDRI3GCPrivatePtr gcPriv = vncDRI3GCPrivate(gc); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(gcPriv, gc, funcs); + unwrap(gcPriv, gc, ops); + (*gc->ops->PushPixels)(gc, pBitMap, drawable, w, h, x, y); + wrap(gcPriv, gc, ops, &vncDRI3GCOps); + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + vncDRI3SyncDrawableToGPU(drawable); +} + +static GCFuncs vncDRI3GCFuncs = { + .ValidateGC = vncDRI3ValidateGC, + .ChangeGC = vncDRI3ChangeGC, + .CopyGC = vncDRI3CopyGC, + .DestroyGC = vncDRI3DestroyGC, + .ChangeClip = vncDRI3ChangeClip, + .DestroyClip = vncDRI3DestroyClip, + .CopyClip = vncDRI3CopyClip, +}; + +static GCOps vncDRI3GCOps = { + .FillSpans = vncDRI3FillSpans, + .SetSpans = vncDRI3SetSpans, + .PutImage = vncDRI3PutImage, + .CopyArea = vncDRI3CopyArea, + .CopyPlane = vncDRI3CopyPlane, + .PolyPoint = vncDRI3PolyPoint, + .Polylines = vncDRI3Polylines, + .PolySegment = vncDRI3PolySegment, + .PolyRectangle = vncDRI3PolyRectangle, + .PolyArc = vncDRI3PolyArc, + .FillPolygon = vncDRI3FillPolygon, + .PolyFillRect = vncDRI3PolyFillRect, + .PolyFillArc = vncDRI3PolyFillArc, + .PolyText8 = vncDRI3PolyText8, + .PolyText16 = vncDRI3PolyText16, + .ImageText8 = vncDRI3ImageText8, + .ImageText16 = vncDRI3ImageText16, + .ImageGlyphBlt = vncDRI3ImageGlyphBlt, + .PolyGlyphBlt = vncDRI3PolyGlyphBlt, + .PushPixels = vncDRI3PushPixels, +}; + +static Bool vncDRI3CreateGC(GCPtr gc) +{ + ScreenPtr screen = gc->pScreen; + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + vncDRI3GCPrivatePtr gcPriv; + Bool ret; + + unwrap(screenPriv, screen, CreateGC); + ret = (*screen->CreateGC)(gc); + wrap(screenPriv, screen, CreateGC, vncDRI3CreateGC); + + gcPriv = vncDRI3GCPrivate(gc); + + wrap(gcPriv, gc, funcs, &vncDRI3GCFuncs); + + return ret; +} + +static void vncDRI3SourceValidate(DrawablePtr drawable, + int x, int y, + int width, int height, + unsigned int subWindowMode) +{ + ScreenPtr screen = drawable->pScreen; + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + /* FIXME: Compute what we need to sync */ + vncDRI3SyncDrawableFromGPU(drawable); + + unwrap(screenPriv, screen, SourceValidate); + screen->SourceValidate(drawable, x, y, width, height, subWindowMode); + wrap(screenPriv, screen, SourceValidate, vncDRI3SourceValidate); +} + +static void vncDRI3Composite(CARD8 op, PicturePtr pSrc, + PicturePtr pMask, PicturePtr pDst, + INT16 xSrc, INT16 ySrc, INT16 xMask, + INT16 yMask, INT16 xDst, INT16 yDst, + CARD16 width, CARD16 height) +{ + ScreenPtr screen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(screen); + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + vncDRI3SyncDrawableFromGPU(pDst->pDrawable); + + unwrap(screenPriv, ps, Composite); + (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc, + xMask, yMask, xDst, yDst, width, height); + wrap(screenPriv, ps, Composite, vncDRI3Composite); + + vncDRI3SyncDrawableToGPU(pDst->pDrawable); +} + +static void vncDRI3Glyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, INT16 ySrc, int nlists, + GlyphListPtr lists, GlyphPtr * glyphs) +{ + ScreenPtr screen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(screen); + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + vncDRI3SyncDrawableFromGPU(pDst->pDrawable); + + unwrap(screenPriv, ps, Glyphs); + (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, + nlists, lists, glyphs); + wrap(screenPriv, ps, Glyphs, vncDRI3Glyphs); + + vncDRI3SyncDrawableToGPU(pDst->pDrawable); +} + +static void vncDRI3CompositeRects(CARD8 op, PicturePtr pDst, + xRenderColor * color, int nRect, xRectangle *rects) +{ + ScreenPtr screen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(screen); + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + vncDRI3SyncDrawableFromGPU(pDst->pDrawable); + + unwrap(screenPriv, ps, CompositeRects); + (*ps->CompositeRects)(op, pDst, color, nRect, rects); + wrap(screenPriv, ps, CompositeRects, vncDRI3CompositeRects); + + vncDRI3SyncDrawableToGPU(pDst->pDrawable); +} + +static void vncDRI3Trapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid * traps) +{ + ScreenPtr screen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(screen); + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + /* FIXME: Rarely used, so we just sync everything */ + vncDRI3SyncDrawableFromGPU(pDst->pDrawable); + + unwrap(screenPriv, ps, Trapezoids); + (*ps->Trapezoids)(op, pSrc, pDst, maskFormat, xSrc, ySrc, + ntrap, traps); + wrap(screenPriv, ps, Trapezoids, vncDRI3Trapezoids); + + vncDRI3SyncDrawableToGPU(pDst->pDrawable); +} + +static void vncDRI3Triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntri, xTriangle * tris) +{ + ScreenPtr screen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(screen); + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + /* FIXME: Rarely used, so we just sync everything */ + vncDRI3SyncDrawableFromGPU(pDst->pDrawable); + + unwrap(screenPriv, ps, Triangles); + (*ps->Triangles)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); + wrap(screenPriv, ps, Triangles, vncDRI3Triangles); + + vncDRI3SyncDrawableToGPU(pDst->pDrawable); +} + +static void vncDRI3TriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int npoint, xPointFixed * points) +{ + ScreenPtr screen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(screen); + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + /* FIXME: Rarely used, so we just sync everything */ + vncDRI3SyncDrawableFromGPU(pDst->pDrawable); + + unwrap(screenPriv, ps, TriStrip); + (*ps->TriStrip)(op, pSrc, pDst, maskFormat, xSrc, ySrc, + npoint, points); + wrap(screenPriv, ps, TriStrip, vncDRI3TriStrip) + + vncDRI3SyncDrawableToGPU(pDst->pDrawable); +} + +static void vncDRI3TriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int npoint, xPointFixed * points) +{ + ScreenPtr screen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(screen); + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + + /* FIXME: Rarely used, so we just sync everything */ + vncDRI3SyncDrawableFromGPU(pDst->pDrawable); + + unwrap(screenPriv, ps, TriFan); + (*ps->TriFan)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points); + wrap(screenPriv, ps, TriFan, vncDRI3TriFan); + + vncDRI3SyncDrawableToGPU(pDst->pDrawable); +} + +static Bool vncDRI3DrawCloseScreen(ScreenPtr screen) +{ + vncDRI3DrawScreenPrivatePtr screenPriv = vncDRI3DrawScreenPrivate(screen); + PictureScreenPtr ps; + + unwrap(screenPriv, screen, CloseScreen); + + unwrap(screenPriv, screen, CreateGC); + unwrap(screenPriv, screen, SourceValidate); + + ps = GetPictureScreenIfSet(screen); + if (ps) { + unwrap(screenPriv, ps, Composite); + unwrap(screenPriv, ps, Glyphs); + unwrap(screenPriv, ps, CompositeRects); + unwrap(screenPriv, ps, Trapezoids); + unwrap(screenPriv, ps, Triangles); + unwrap(screenPriv, ps, TriStrip); + unwrap(screenPriv, ps, TriFan); + } + + return (*screen->CloseScreen)(screen); +} + +Bool vncDRI3DrawInit(ScreenPtr screen) +{ + vncDRI3DrawScreenPrivatePtr screenPriv; + PictureScreenPtr ps; + + if (!dixRegisterPrivateKey(&vncDRI3DrawScreenPrivateKey, + PRIVATE_SCREEN, + sizeof(vncDRI3DrawScreenPrivateRec))) + return FALSE; + if (!dixRegisterPrivateKey(&vncDRI3GCPrivateKey, PRIVATE_GC, + sizeof(vncDRI3GCPrivateRec))) + return FALSE; + + screenPriv = vncDRI3DrawScreenPrivate(screen); + + wrap(screenPriv, screen, CloseScreen, vncDRI3DrawCloseScreen); + + wrap(screenPriv, screen, CreateGC, vncDRI3CreateGC); + wrap(screenPriv, screen, SourceValidate, vncDRI3SourceValidate); + + ps = GetPictureScreenIfSet(screen); + if (ps) { + wrap(screenPriv, ps, Composite, vncDRI3Composite); + wrap(screenPriv, ps, Glyphs, vncDRI3Glyphs); + wrap(screenPriv, ps, CompositeRects, vncDRI3CompositeRects); + wrap(screenPriv, ps, Trapezoids, vncDRI3Trapezoids); + wrap(screenPriv, ps, Triangles, vncDRI3Triangles); + wrap(screenPriv, ps, TriStrip, vncDRI3TriStrip); + wrap(screenPriv, ps, TriFan, vncDRI3TriFan); + } + + return TRUE; +}
\ No newline at end of file diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc index b260e626..073b07e2 100644 --- a/unix/xserver/hw/vnc/vncExtInit.cc +++ b/unix/xserver/hw/vnc/vncExtInit.cc @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2011-2019 Pierre Ossman for Cendio AB + * Copyright 2011-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -114,10 +114,10 @@ static const char* defaultDesktopName() return ""; struct passwd* pwent = getpwuid(getuid()); - if (pwent == NULL) + if (pwent == nullptr) return ""; - size_t len = snprintf(NULL, 0, "%s@%s", pwent->pw_name, hostname.data()); + size_t len = snprintf(nullptr, 0, "%s@%s", pwent->pw_name, hostname.data()); if (len < 0) return ""; @@ -286,7 +286,7 @@ void vncExtensionClose(void) try { for (int scr = 0; scr < vncGetScreenCount(); scr++) { delete desktop[scr]; - desktop[scr] = NULL; + desktop[scr] = nullptr; } } catch (rdr::Exception& e) { vncFatalError("vncExtInit: %s\n",e.str()); @@ -484,6 +484,33 @@ void vncRefreshScreenLayout(int scrIdx) } } +uint64_t vncGetMsc(int scrIdx) +{ + try { + return desktop[scrIdx]->getMsc(); + } catch (rdr::Exception& e) { + vncFatalError("vncGetMsc: %s\n", e.str()); + } +} + +void vncQueueMsc(int scrIdx, uint64_t id, uint64_t msc) +{ + try { + desktop[scrIdx]->queueMsc(id, msc); + } catch (rdr::Exception& e) { + vncFatalError("vncQueueMsc: %s\n", e.str()); + } +} + +void vncAbortMsc(int scrIdx, uint64_t id) +{ + try { + desktop[scrIdx]->abortMsc(id); + } catch (rdr::Exception& e) { + vncFatalError("vncAbortMsc: %s\n", e.str()); + } +} + int vncOverrideParam(const char *nameAndValue) { const char* equalSign = strchr(nameAndValue, '='); diff --git a/unix/xserver/hw/vnc/vncExtInit.h b/unix/xserver/hw/vnc/vncExtInit.h index 333e32a9..6b37fe62 100644 --- a/unix/xserver/hw/vnc/vncExtInit.h +++ b/unix/xserver/hw/vnc/vncExtInit.h @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2011-2019 Pierre Ossman for Cendio AB + * Copyright 2011-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,6 +87,10 @@ void vncPreScreenResize(int scrIdx); void vncPostScreenResize(int scrIdx, int success, int width, int height); void vncRefreshScreenLayout(int scrIdx); +uint64_t vncGetMsc(int scrIdx); +void vncQueueMsc(int scrIdx, uint64_t id, uint64_t msc); +void vncAbortMsc(int scrIdx, uint64_t id); + int vncOverrideParam(const char *nameAndValue); #ifdef __cplusplus diff --git a/unix/xserver/hw/vnc/vncHooks.c b/unix/xserver/hw/vnc/vncHooks.c index 3838c10d..7fe35ada 100644 --- a/unix/xserver/hw/vnc/vncHooks.c +++ b/unix/xserver/hw/vnc/vncHooks.c @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2009-2017 Pierre Ossman for Cendio AB + * Copyright 2009-2024 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -469,39 +469,47 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) { int dx, dy; - BoxRec screen_box; - RegionRec copied, screen_rgn; + RegionRec copied; SCREEN_PROLOGUE(pWin->drawable.pScreen, CopyWindow); - RegionNull(&copied); - RegionCopy(&copied, pOldRegion); + if (is_visible(&pWin->drawable)) { + BoxRec screen_box; + RegionRec screen_rgn; - screen_box.x1 = 0; - screen_box.y1 = 0; - screen_box.x2 = pScreen->width; - screen_box.y2 = pScreen->height; + RegionNull(&copied); + RegionCopy(&copied, pOldRegion); - RegionInitBoxes(&screen_rgn, &screen_box, 1); + screen_box.x1 = 0; + screen_box.y1 = 0; + screen_box.x2 = pScreen->width; + screen_box.y2 = pScreen->height; - dx = pWin->drawable.x - ptOldOrg.x; - dy = pWin->drawable.y - ptOldOrg.y; + RegionInitBoxes(&screen_rgn, &screen_box, 1); - // RFB tracks copies in terms of destination rectangle, not source. - // We also need to copy with changes to the Window's clipping region. - // Finally, make sure we don't get copies to or from regions outside - // the framebuffer. - RegionIntersect(&copied, &copied, &screen_rgn); - RegionTranslate(&copied, dx, dy); - RegionIntersect(&copied, &copied, &screen_rgn); - RegionIntersect(&copied, &copied, &pWin->borderClip); + dx = pWin->drawable.x - ptOldOrg.x; + dy = pWin->drawable.y - ptOldOrg.y; + + // RFB tracks copies in terms of destination rectangle, not source. + // We also need to copy with changes to the Window's clipping region. + // Finally, make sure we don't get copies to or from regions outside + // the framebuffer. + RegionIntersect(&copied, &copied, &screen_rgn); + RegionTranslate(&copied, dx, dy); + RegionIntersect(&copied, &copied, &screen_rgn); + RegionIntersect(&copied, &copied, &pWin->borderClip); + + RegionUninit(&screen_rgn); + } else { + RegionNull(&copied); + dx = dy = 0; + } (*pScreen->CopyWindow) (pWin, ptOldOrg, pOldRegion); add_copied(pScreen, &copied, dx, dy); RegionUninit(&copied); - RegionUninit(&screen_rgn); SCREEN_EPILOGUE(CopyWindow); } @@ -512,18 +520,23 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w, int h, Bool generateExposures) { - BoxRec box; RegionRec reg; SCREEN_PROLOGUE(pWin->drawable.pScreen, ClearToBackground); - box.x1 = x + pWin->drawable.x; - box.y1 = y + pWin->drawable.y; - box.x2 = w ? (box.x1 + w) : (pWin->drawable.x + pWin->drawable.width); - box.y2 = h ? (box.y1 + h) : (pWin->drawable.y + pWin->drawable.height); + if (is_visible(&pWin->drawable)) { + BoxRec box; - RegionInitBoxes(®, &box, 1); - RegionIntersect(®, ®, &pWin->clipList); + box.x1 = x + pWin->drawable.x; + box.y1 = y + pWin->drawable.y; + box.x2 = w ? (box.x1 + w) : (pWin->drawable.x + pWin->drawable.width); + box.y2 = h ? (box.y1 + h) : (pWin->drawable.y + pWin->drawable.height); + + RegionInitBoxes(®, &box, 1); + RegionIntersect(®, ®, &pWin->clipList); + } else { + RegionNull(®); + } (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures); diff --git a/unix/xserver/hw/vnc/vncInput.c b/unix/xserver/hw/vnc/vncInput.c index b3d0926d..1de41430 100644 --- a/unix/xserver/hw/vnc/vncInput.c +++ b/unix/xserver/hw/vnc/vncInput.c @@ -612,6 +612,9 @@ static void vncKeysymKeyboardEvent(KeySym keysym, int down) /* Now press the actual key */ pressKey(vncKeyboardDev, keycode, TRUE, "keycode"); + if(down) + vncOnKeyUsed(keycode); + /* And store the mapping so that we can do a proper release later */ for (i = 0;i < 256;i++) { if (i == keycode) diff --git a/unix/xserver/hw/vnc/vncInput.h b/unix/xserver/hw/vnc/vncInput.h index 08cab6cb..0a130ada 100644 --- a/unix/xserver/hw/vnc/vncInput.h +++ b/unix/xserver/hw/vnc/vncInput.h @@ -55,6 +55,7 @@ KeyCode vncKeysymToKeycode(KeySym keysym, unsigned state, unsigned *new_state); int vncIsAffectedByNumLock(KeyCode keycode); KeyCode vncAddKeysym(KeySym keysym, unsigned state); +void vncOnKeyUsed(KeyCode usedKeycode); #ifdef __cplusplus } diff --git a/unix/xserver/hw/vnc/vncInputXKB.c b/unix/xserver/hw/vnc/vncInputXKB.c index d5fe286a..77983482 100644 --- a/unix/xserver/hw/vnc/vncInputXKB.c +++ b/unix/xserver/hw/vnc/vncInputXKB.c @@ -30,6 +30,7 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> +#include "list.h" #include "xkbsrv.h" #include "xkbstr.h" #include "eventstr.h" @@ -56,6 +57,25 @@ static const KeyCode fakeKeys[] = { #endif }; +typedef struct +{ + KeySym keysym; + KeyCode keycode; + struct xorg_list entry; +} AddedKeySym; + +/* + * If a KeySym recieved from client is not mapped to any KeyCode, it needs to be + * mapped to an unused KeyCode to generate required key events. + * + * This list tracks such assignments. A KeyCode from this list can be reused if + * we run out of unused KeyCodes. + * + * Items in this list are maintained in LRU order, with most recently used key + * in front. + */ +static struct xorg_list addedKeysyms; + static void vncXkbProcessDeviceEvent(int screenNum, InternalEvent *event, DeviceIntPtr dev); @@ -218,6 +238,8 @@ void vncPrepareInputDevices(void) */ mieqSetHandler(ET_KeyPress, vncXkbProcessDeviceEvent); mieqSetHandler(ET_KeyRelease, vncXkbProcessDeviceEvent); + + xorg_list_init(&addedKeysyms); } unsigned vncGetKeyboardState(void) @@ -568,6 +590,68 @@ int vncIsAffectedByNumLock(KeyCode keycode) return 1; } +static void saveAddedKeysym(KeyCode code, KeySym sym) +{ + AddedKeySym* item; + + item = malloc(sizeof(AddedKeySym)); + if (!item) + return; + + item->keycode = code; + item->keysym = sym; + xorg_list_add(&item->entry, &addedKeysyms); +} + +/* + * Keeps the list in LRU order by moving the used key to front of the list. + */ +void vncOnKeyUsed(KeyCode usedKeycode) +{ + AddedKeySym* it; + + if (xorg_list_is_empty(&addedKeysyms)) + return; + + it = xorg_list_first_entry(&addedKeysyms, AddedKeySym, entry); + if (it->keycode == usedKeycode) + return; + + xorg_list_for_each_entry(it, &addedKeysyms, entry) { + if (it->keycode == usedKeycode) { + xorg_list_del(&it->entry); + xorg_list_add(&it->entry, &addedKeysyms); + break; + } + } +} + +/* + * Returns keycode of oldest item from list of manually added keysyms. + * The item is removed from the list. + * Returns 0 if no usable keycode is found. + */ +static KeyCode getReusableKeycode(XkbDescPtr xkb) +{ + AddedKeySym* last; + KeyCode result; + + result = 0; + while (result == 0 && !xorg_list_is_empty(&addedKeysyms)) { + last = xorg_list_last_entry(&addedKeysyms, AddedKeySym, entry); + + // Make sure someone else hasn't modified the key + if (XkbKeyNumGroups(xkb, last->keycode) > 0 && + XkbKeySymsPtr(xkb, last->keycode)[0] == last->keysym && + (xkb->names == NULL || xkb->names->keys[last->keycode].name[0] == 'T')) + result = last->keycode; + + xorg_list_del(&last->entry); + free(last); + } + return result; +} + KeyCode vncAddKeysym(KeySym keysym, unsigned state) { DeviceIntPtr master; @@ -589,6 +673,9 @@ KeyCode vncAddKeysym(KeySym keysym, unsigned state) } if (key < xkb->min_key_code) + key = getReusableKeycode(xkb); + + if (!key) return 0; memset(&changes, 0, sizeof(changes)); @@ -600,9 +687,8 @@ KeyCode vncAddKeysym(KeySym keysym, unsigned state) * Tools like xkbcomp get confused if there isn't a name * assigned to the keycode we're trying to use. */ - if (xkb->names && xkb->names->keys && - (xkb->names->keys[key].name[0] == '\0')) { - xkb->names->keys[key].name[0] = 'I'; + if (xkb->names && xkb->names->keys) { + xkb->names->keys[key].name[0] = 'T'; xkb->names->keys[key].name[1] = '0' + (key / 100) % 10; xkb->names->keys[key].name[2] = '0' + (key / 10) % 10; xkb->names->keys[key].name[3] = '0' + (key / 1) % 10; @@ -641,6 +727,8 @@ KeyCode vncAddKeysym(KeySym keysym, unsigned state) XkbSendNotification(master, &changes, &cause); + saveAddedKeysym(key, syms[0]); + return key; } diff --git a/unix/xserver/hw/vnc/vncModule.c b/unix/xserver/hw/vnc/vncModule.c index fb8ce047..68900804 100644 --- a/unix/xserver/hw/vnc/vncModule.c +++ b/unix/xserver/hw/vnc/vncModule.c @@ -53,7 +53,7 @@ static XF86ModuleVersionInfo vncVersRec = "TigerVNC Project", MODINFOSTRING1, MODINFOSTRING2, - XORG_VERSION_CURRENT, + VENDOR_RELEASE, 1, 0, 0, ABI_CLASS_EXTENSION, /* needs the server extension ABI */ ABI_EXTENSION_VERSION, diff --git a/unix/xserver/hw/vnc/vncPresent.c b/unix/xserver/hw/vnc/vncPresent.c new file mode 100644 index 00000000..89dcc1d0 --- /dev/null +++ b/unix/xserver/hw/vnc/vncPresent.c @@ -0,0 +1,93 @@ +/* Copyright 2024 Pierre Ossman for Cendio AB + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include "vncExtInit.h" +#include "vncPresent.h" + +#include <present.h> + +static RRCrtcPtr vncPresentGetCrtc(WindowPtr window) +{ + ScreenPtr pScreen = window->drawable.pScreen; + rrScrPrivPtr rp = rrGetScrPriv(pScreen); + + /* All output is synchronized, so just pick the first active crtc */ + for (int c = 0; c < rp->numCrtcs; c++) { + RRCrtcPtr crtc; + + crtc = rp->crtcs[c]; + if (crtc->mode == NULL) + continue; + + return crtc; + } + + return NULL; +} + +static int vncPresentGetUstMsc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc) +{ + *ust = GetTimeInMicros(); + *msc = vncGetMsc(crtc->pScreen->myNum); + + return Success; +} + +static int vncPresentQueueVBlank(RRCrtcPtr crtc, uint64_t event_id, + uint64_t msc) +{ + vncQueueMsc(crtc->pScreen->myNum, event_id, msc); + return Success; +} + +void vncPresentMscEvent(uint64_t id, uint64_t msc) +{ + present_event_notify(id, GetTimeInMicros(), msc); +} + +static void vncPresentAbortVBlank(RRCrtcPtr crtc, uint64_t event_id, + uint64_t msc) +{ + vncAbortMsc(crtc->pScreen->myNum, event_id); +} + +static void vncPresentFlush(WindowPtr window) +{ +} + +static present_screen_info_rec vncPresentScreenInfo = { + .version = PRESENT_SCREEN_INFO_VERSION, + + .get_crtc = vncPresentGetCrtc, + .get_ust_msc = vncPresentGetUstMsc, + .queue_vblank = vncPresentQueueVBlank, + .abort_vblank = vncPresentAbortVBlank, + .flush = vncPresentFlush, + + .capabilities = PresentCapabilityNone, +}; + +Bool +vncPresentInit(ScreenPtr screen) +{ + return present_screen_init(screen, &vncPresentScreenInfo); +}
\ No newline at end of file diff --git a/unix/xserver/hw/vnc/vncPresent.h b/unix/xserver/hw/vnc/vncPresent.h new file mode 100644 index 00000000..17407402 --- /dev/null +++ b/unix/xserver/hw/vnc/vncPresent.h @@ -0,0 +1,27 @@ +/* Copyright 2024 Pierre Ossman for Cendio AB + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#ifndef __PRESENT_H__ +#define __PRESENT_H__ + +#include <dix.h> + +Bool vncPresentInit(ScreenPtr screen); +void vncPresentMscEvent(uint64_t id, uint64_t msc); + +#endif diff --git a/unix/xserver/hw/vnc/xorg-version.h b/unix/xserver/hw/vnc/xorg-version.h index a0d44d92..0ed1c93b 100644 --- a/unix/xserver/hw/vnc/xorg-version.h +++ b/unix/xserver/hw/vnc/xorg-version.h @@ -24,10 +24,12 @@ #include <dix-config.h> #endif +#include <version-config.h> + #define XORG_AT_LEAST(major, minor, patch) \ - (XORG_VERSION_CURRENT >= ((major * 10000000) + (minor * 100000) + (patch * 1000))) + (VENDOR_RELEASE >= ((major * 10000000) + (minor * 100000) + (patch * 1000))) #define XORG_OLDER_THAN(major, minor, patch) \ - (XORG_VERSION_CURRENT < ((major * 10000000) + (minor * 100000) + (patch * 1000))) + (VENDOR_RELEASE < ((major * 10000000) + (minor * 100000) + (patch * 1000))) #if XORG_OLDER_THAN(1, 16, 0) #error "X.Org older than 1.16 is not supported" diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c index 16a28831..0165d598 100644 --- a/unix/xserver/hw/vnc/xvnc.c +++ b/unix/xserver/hw/vnc/xvnc.c @@ -1,6 +1,6 @@ /* Copyright (c) 1993 X Consortium Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - Copyright 2009-2015 Pierre Ossman for Cendio AB + Copyright 2009-2024 Pierre Ossman for Cendio AB Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -36,9 +36,14 @@ from the X Consortium. #include "RFBGlue.h" #include "XorgGlue.h" #include "RandrGlue.h" +#include "vncDRI3.h" +#include "vncPresent.h" #include "xorg-version.h" #include <stdio.h> +#ifdef HAVE_LIBXCVT +#include <libxcvt/libxcvt.h> +#endif #include <X11/X.h> #include <X11/Xproto.h> #include <X11/Xos.h> @@ -66,11 +71,9 @@ from the X Consortium. #include <X11/keysym.h> extern char buildtime[]; -#undef VENDOR_RELEASE -#undef VENDOR_STRING #include "version-config.h" -#define XVNCVERSION "TigerVNC 1.13.80" +#define XVNCVERSION "TigerVNC 1.14.80" #define XVNCCOPYRIGHT ("Copyright (C) 1999-2024 TigerVNC Team and many others (see README.rst)\n" \ "See https://www.tigervnc.org for information on TigerVNC.\n") @@ -223,6 +226,9 @@ ddxUseMsg(void) ErrorF("-inetd has been launched from inetd\n"); ErrorF ("-noclipboard disable clipboard settings modification via vncconfig utility\n"); +#ifdef DRI3 + ErrorF("-rendernode PATH DRM render node to use for DRI3\n"); +#endif ErrorF("-verbose [n] verbose startup messages\n"); ErrorF("-quiet minimal startup messages\n"); ErrorF("-version show the server version\n"); @@ -405,6 +411,15 @@ ddxProcessArgument(int argc, char *argv[], int i) return 1; } +#ifdef DRI3 + if (strcmp(argv[i], "-rendernode") == 0) { + CHECK_FOR_REQUIRED_ARGUMENTS(1); + ++i; + renderNode = argv[i]; + return 2; + } +#endif + if (!strcmp(argv[i], "-verbose")) { if (++i < argc && argv[i]) { char *end; @@ -670,14 +685,14 @@ vncRandRScreenSetSize(ScreenPtr pScreen, ret = vncRandRCrtcSet(pScreen, crtc, NULL, crtc->x, crtc->y, crtc->rotation, 0, NULL); if (!ret) - ErrorF("Warning: Unable to disable CRTC that is outside of new screen dimensions"); + ErrorF("Warning: Unable to disable CRTC that is outside of new screen dimensions\n"); continue; } /* Just needs to be resized to a temporary mode */ mode = vncRandRModeGet(width - crtc->x, height - crtc->y); if (mode == NULL) { - ErrorF("Warning: Unable to create custom mode for %dx%d", + ErrorF("Warning: Unable to create custom mode for %dx%d\n", width - crtc->x, height - crtc->y); continue; } @@ -687,7 +702,7 @@ vncRandRScreenSetSize(ScreenPtr pScreen, crtc->numOutputs, crtc->outputs); RRModeDestroy(mode); if (!ret) - ErrorF("Warning: Unable to crop CRTC to new screen dimensions"); + ErrorF("Warning: Unable to crop CRTC to new screen dimensions\n"); } return TRUE; @@ -752,13 +767,37 @@ vncRandRModeGet(int width, int height) RRModePtr mode; memset(&modeInfo, 0, sizeof(modeInfo)); - sprintf(name, "%dx%d", width, height); +#ifdef HAVE_LIBXCVT + struct libxcvt_mode_info *cvtMode; + + cvtMode = libxcvt_gen_mode_info(width, height, 60.0, false, false); + + modeInfo.width = cvtMode->hdisplay; + modeInfo.height = cvtMode->vdisplay; + modeInfo.dotClock = cvtMode->dot_clock * 1000.0; + modeInfo.hSyncStart = cvtMode->hsync_start; + modeInfo.hSyncEnd = cvtMode->hsync_end; + modeInfo.hTotal = cvtMode->htotal; + modeInfo.vSyncStart = cvtMode->vsync_start; + modeInfo.vSyncEnd = cvtMode->vsync_end; + modeInfo.vTotal = cvtMode->vtotal; + modeInfo.modeFlags = cvtMode->mode_flags; + + free(cvtMode); + + /* libxcvt rounds up to multiples of 8, so override them here */ + modeInfo.width = width; + modeInfo.height = height; +#else modeInfo.width = width; modeInfo.height = height; modeInfo.hTotal = width; modeInfo.vTotal = height; modeInfo.dotClock = ((CARD32) width * (CARD32) height * 60); +#endif + + sprintf(name, "%dx%d", width, height); modeInfo.nameLength = strlen(name); mode = RRModeGet(&modeInfo, name); if (mode == NULL) @@ -1085,6 +1124,16 @@ vncScreenInit(ScreenPtr pScreen, int argc, char **argv) if (!ret) return FALSE; + ret = vncPresentInit(pScreen); + if (!ret) + ErrorF("Failed to initialize Present extension\n"); + +#ifdef DRI3 + ret = vncDRI3Init(pScreen); + if (!ret) + ErrorF("Failed to initialize DRI3 extension\n"); +#endif + return TRUE; } /* end vncScreenInit */ @@ -1103,14 +1152,17 @@ vncClientStateChange(CallbackListPtr *a, void *b, void *c) #ifdef GLXEXT #if XORG_OLDER_THAN(1, 20, 0) extern void GlxExtensionInit(void); +#endif +#endif -static ExtensionModule glxExt = { - GlxExtensionInit, - "GLX", - &noGlxExtension -}; +static const ExtensionModule vncExtensions[] = { + {vncExtensionInit, "TIGERVNC", NULL}, +#ifdef GLXEXT +#if XORG_OLDER_THAN(1, 20, 0) + { GlxExtensionInit, "GLX", &noGlxExtension }, #endif #endif +}; void InitOutput(ScreenInfo * scrInfo, int argc, char **argv) @@ -1120,15 +1172,11 @@ InitOutput(ScreenInfo * scrInfo, int argc, char **argv) vncPrintBanner(); -#if XORG_AT_LEAST(1, 20, 0) - xorgGlxCreateVendor(); -#else - -#ifdef GLXEXT if (serverGeneration == 1) - LoadExtensionList(&glxExt, 1, TRUE); -#endif + LoadExtensionList(vncExtensions, ARRAY_SIZE(vncExtensions), TRUE); +#if XORG_AT_LEAST(1, 20, 0) + xorgGlxCreateVendor(); #endif /* initialize pixmap formats */ diff --git a/unix/xserver116.patch b/unix/xserver116.patch deleted file mode 100644 index 2edcd307..00000000 --- a/unix/xserver116.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff -up xorg-server-1.16.0/configure.ac.vnc xorg-server-1.16.0/configure.ac ---- xorg-server-1.16.0/configure.ac.vnc 2014-07-17 08:00:51.000000000 +0100 -+++ xorg-server-1.16.0/configure.ac 2014-09-03 10:21:49.506109235 +0100 -@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x - AC_CONFIG_HEADERS(include/version-config.h) - - AM_PROG_AS -+AC_PROG_CXX - AC_PROG_LN_S - LT_PREREQ([2.2]) - LT_INIT([disable-static win32-dll]) -@@ -1795,6 +1796,10 @@ if test "x$XVFB" = xyes; then - AC_SUBST([XVFB_SYS_LIBS]) - fi - -+dnl Xvnc DDX -+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"]) -+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"]) -+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"]) - - dnl Xnest DDX - -@@ -1830,6 +1835,8 @@ if test "x$XORG" = xauto; then - fi - AC_MSG_RESULT([$XORG]) - -+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) -+ - if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' -@@ -2051,7 +2058,6 @@ if test "x$XORG" = xyes; then - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) -- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) -@@ -2589,6 +2595,7 @@ hw/dmx/Makefile - hw/dmx/man/Makefile - hw/vfb/Makefile - hw/vfb/man/Makefile -+hw/vnc/Makefile - hw/xnest/Makefile - hw/xnest/man/Makefile - hw/xwin/Makefile -diff -up xorg-server-1.16.0/hw/Makefile.am.vnc xorg-server-1.16.0/hw/Makefile.am ---- xorg-server-1.16.0/hw/Makefile.am.vnc 2014-04-16 21:24:00.000000000 +0100 -+++ xorg-server-1.16.0/hw/Makefile.am 2014-09-03 10:21:49.507109234 +0100 -@@ -38,7 +38,8 @@ SUBDIRS = \ - $(DMX_SUBDIRS) \ - $(KDRIVE_SUBDIRS) \ - $(XQUARTZ_SUBDIRS) \ -- $(XWAYLAND_SUBDIRS) -+ $(XWAYLAND_SUBDIRS) \ -+ vnc - - DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland - -diff -up xorg-server-1.16.0/mi/miinitext.c.vnc xorg-server-1.16.0/mi/miinitext.c ---- xorg-server-1.16.0/mi/miinitext.c.vnc 2014-04-16 21:24:00.000000000 +0100 -+++ xorg-server-1.16.0/mi/miinitext.c 2014-09-03 10:21:49.508109234 +0100 -@@ -111,6 +111,10 @@ SOFTWARE. - #include "micmap.h" - #include "globals.h" - -+#ifdef TIGERVNC -+extern void vncExtensionInit(void); -+#endif -+ - /* The following is only a small first step towards run-time - * configurable extensions. - */ -@@ -235,6 +239,9 @@ EnableDisableExtensionError(const char * - - /* List of built-in (statically linked) extensions */ - static const ExtensionModule staticExtensions[] = { -+#ifdef TIGERVNC -+ {vncExtensionInit, "VNC-EXTENSION", NULL}, -+#endif - {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, - #ifdef MITSHM -diff -up xorg-server-1.16.0/os/WaitFor.c.vnc xorg-server-1.16.0/os/WaitFor.c ---- xorg-server-1.16.0/os/WaitFor.c.vnc 2014-02-05 03:08:57.000000000 +0000 -+++ xorg-server-1.16.0/os/WaitFor.c 2014-09-03 10:21:49.508109234 +0100 -@@ -125,6 +125,9 @@ static void DoTimer(OsTimerPtr timer, CA - static void CheckAllTimers(void); - static OsTimerPtr timers = NULL; - -+extern void vncWriteBlockHandler(fd_set *fds); -+extern void vncWriteWakeupHandler(int nfds, fd_set *fds); -+ - /***************** - * WaitForSomething: - * Make the server suspend until there is -@@ -150,6 +153,7 @@ WaitForSomething(int *pClientsReady) - INT32 timeout = 0; - fd_set clientsReadable; - fd_set clientsWritable; -+ fd_set socketsWritable; - int curclient; - int selecterr; - static int nready; -@@ -212,6 +216,9 @@ WaitForSomething(int *pClientsReady) - XFD_COPYSET(&AllSockets, &LastSelectMask); - } - -+ FD_ZERO(&socketsWritable); -+ vncWriteBlockHandler(&socketsWritable); -+ - BlockHandler((void *) &wt, (void *) &LastSelectMask); - if (NewOutputPending) - FlushAllOutput(); -@@ -223,10 +223,20 @@ WaitForSomething(int *pClientsReady) - i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); - } - else { -- i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); -+ if (AnyClientsWriteBlocked) -+ XFD_ORSET(&socketsWritable, &ClientsWriteBlocked, &socketsWritable); -+ -+ if (XFD_ANYSET(&socketsWritable)) { -+ i = Select(MaxClients, &LastSelectMask, &socketsWritable, NULL, wt); -+ if (AnyClientsWriteBlocked) -+ XFD_ANDSET(&clientsWritable, &socketsWritable, &ClientsWriteBlocked); -+ } else { -+ i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); -+ } - } - selecterr = GetErrno(); - WakeupHandler(i, (void *) &LastSelectMask); -+ vncWriteWakeupHandler(i, &socketsWritable); - if (i <= 0) { /* An error or timeout occurred */ - if (dispatchException) - return 0; diff --git a/unix/xserver117.patch b/unix/xserver117.patch deleted file mode 100644 index f4cb94c3..00000000 --- a/unix/xserver117.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff -up xorg-server-1.17.1/configure.ac.vnc xorg-server-1.17.1/configure.ac ---- xorg-server-1.17.1/configure.ac.vnc 2015-02-10 22:43:52.000000000 +0000 -+++ xorg-server-1.17.1/configure.ac 2015-02-13 16:14:05.074515927 +0000 -@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x - AC_CONFIG_HEADERS(include/version-config.h) - - AM_PROG_AS -+AC_PROG_CXX - AC_PROG_LN_S - LT_PREREQ([2.2]) - LT_INIT([disable-static win32-dll]) -@@ -1795,6 +1796,10 @@ if test "x$XVFB" = xyes; then - AC_SUBST([XVFB_SYS_LIBS]) - fi - -+dnl Xvnc DDX -+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"]) -+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"]) -+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"]) - - dnl Xnest DDX - -@@ -1830,6 +1835,8 @@ if test "x$XORG" = xauto; then - fi - AC_MSG_RESULT([$XORG]) - -+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) -+ - if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' -@@ -2059,7 +2066,6 @@ if test "x$XORG" = xyes; then - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) -- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) -@@ -2599,6 +2605,7 @@ hw/dmx/Makefile - hw/dmx/man/Makefile - hw/vfb/Makefile - hw/vfb/man/Makefile -+hw/vnc/Makefile - hw/xnest/Makefile - hw/xnest/man/Makefile - hw/xwin/Makefile -diff -up xorg-server-1.17.1/hw/Makefile.am.vnc xorg-server-1.17.1/hw/Makefile.am ---- xorg-server-1.17.1/hw/Makefile.am.vnc 2014-04-16 21:24:00.000000000 +0100 -+++ xorg-server-1.17.1/hw/Makefile.am 2015-02-13 16:14:05.131516821 +0000 -@@ -38,7 +38,8 @@ SUBDIRS = \ - $(DMX_SUBDIRS) \ - $(KDRIVE_SUBDIRS) \ - $(XQUARTZ_SUBDIRS) \ -- $(XWAYLAND_SUBDIRS) -+ $(XWAYLAND_SUBDIRS) \ -+ vnc - - DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland - -diff -up xorg-server-1.17.1/mi/miinitext.c.vnc xorg-server-1.17.1/mi/miinitext.c ---- xorg-server-1.17.1/mi/miinitext.c.vnc 2015-01-17 23:42:52.000000000 +0000 -+++ xorg-server-1.17.1/mi/miinitext.c 2015-02-13 16:14:05.131516821 +0000 -@@ -111,6 +111,10 @@ SOFTWARE. - #include "micmap.h" - #include "globals.h" - -+#ifdef TIGERVNC -+extern void vncExtensionInit(void); -+#endif -+ - /* The following is only a small first step towards run-time - * configurable extensions. - */ -@@ -235,6 +239,9 @@ EnableDisableExtensionError(const char * - - /* List of built-in (statically linked) extensions */ - static const ExtensionModule staticExtensions[] = { -+#ifdef TIGERVNC -+ {vncExtensionInit, "VNC-EXTENSION", NULL}, -+#endif - {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, - #ifdef MITSHM -diff -up xorg-server-1.17.1/os/WaitFor.c.vnc xorg-server-1.17.1/os/WaitFor.c ---- xorg-server-1.17.1/os/WaitFor.c.vnc 2015-01-26 18:40:30.000000000 +0000 -+++ xorg-server-1.17.1/os/WaitFor.c 2015-02-13 16:14:05.132516837 +0000 -@@ -125,6 +125,9 @@ static void DoTimer(OsTimerPtr timer, CA - static void CheckAllTimers(void); - static volatile OsTimerPtr timers = NULL; - -+extern void vncWriteBlockHandler(fd_set *fds); -+extern void vncWriteWakeupHandler(int nfds, fd_set *fds); -+ - /***************** - * WaitForSomething: - * Make the server suspend until there is -@@ -150,6 +153,7 @@ WaitForSomething(int *pClientsReady) - INT32 timeout = 0; - fd_set clientsReadable; - fd_set clientsWritable; -+ fd_set socketsWritable; - int curclient; - int selecterr; - static int nready; -@@ -212,6 +216,9 @@ WaitForSomething(int *pClientsReady) - XFD_COPYSET(&AllSockets, &LastSelectMask); - } - -+ FD_ZERO(&socketsWritable); -+ vncWriteBlockHandler(&socketsWritable); -+ - BlockHandler((void *) &wt, (void *) &LastSelectMask); - if (NewOutputPending) - FlushAllOutput(); -@@ -223,10 +230,20 @@ WaitForSomething(int *pClientsReady) - i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); - } - else { -- i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); -+ if (AnyClientsWriteBlocked) -+ XFD_ORSET(&socketsWritable, &ClientsWriteBlocked, &socketsWritable); -+ -+ if (XFD_ANYSET(&socketsWritable)) { -+ i = Select(MaxClients, &LastSelectMask, &socketsWritable, NULL, wt); -+ if (AnyClientsWriteBlocked) -+ XFD_ANDSET(&clientsWritable, &socketsWritable, &ClientsWriteBlocked); -+ } else { -+ i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); -+ } - } - selecterr = GetErrno(); - WakeupHandler(i, (void *) &LastSelectMask); -+ vncWriteWakeupHandler(i, &socketsWritable); - if (i <= 0) { /* An error or timeout occurred */ - if (dispatchException) - return 0; diff --git a/unix/xserver118.patch b/unix/xserver118.patch deleted file mode 100644 index 1c03317f..00000000 --- a/unix/xserver118.patch +++ /dev/null @@ -1,136 +0,0 @@ -diff -ur xorg-server.orig/configure.ac xorg-server/configure.ac ---- xorg-server.orig/configure.ac 2016-04-09 21:28:27.007999965 +0200 -+++ xorg-server/configure.ac 2016-04-09 21:28:57.587999860 +0200 -@@ -74,6 +74,7 @@ - AC_CONFIG_HEADERS(include/version-config.h) - - AM_PROG_AS -+AC_PROG_CXX - AC_PROG_LN_S - LT_PREREQ([2.2]) - LT_INIT([disable-static win32-dll]) -@@ -1828,6 +1829,10 @@ - AC_SUBST([XVFB_SYS_LIBS]) - fi - -+dnl Xvnc DDX -+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"]) -+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"]) -+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"]) - - dnl Xnest DDX - -@@ -1863,6 +1868,8 @@ - fi - AC_MSG_RESULT([$XORG]) - -+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) -+ - if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' -@@ -2081,7 +2088,6 @@ - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) -- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) -@@ -2653,6 +2659,7 @@ - hw/dmx/man/Makefile - hw/vfb/Makefile - hw/vfb/man/Makefile -+hw/vnc/Makefile - hw/xnest/Makefile - hw/xnest/man/Makefile - hw/xwin/Makefile -diff -ur xorg-server.orig/hw/Makefile.am xorg-server/hw/Makefile.am ---- xorg-server.orig/hw/Makefile.am 2016-04-09 21:28:27.059999965 +0200 -+++ xorg-server/hw/Makefile.am 2016-04-09 21:28:57.587999860 +0200 -@@ -43,6 +43,7 @@ - $(KDRIVE_SUBDIRS) \ - $(XQUARTZ_SUBDIRS) \ -- $(XWAYLAND_SUBDIRS) -+ $(XWAYLAND_SUBDIRS) \ -+ vnc - - DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland - -diff -ur xorg-server.orig/mi/miinitext.c xorg-server/mi/miinitext.c ---- xorg-server.orig/mi/miinitext.c 2016-04-09 21:28:27.015999965 +0200 -+++ xorg-server/mi/miinitext.c 2016-04-09 21:28:57.587999860 +0200 -@@ -114,6 +114,10 @@ - #include "micmap.h" - #include "globals.h" - -+#ifdef TIGERVNC -+extern void vncExtensionInit(void); -+#endif -+ - /* The following is only a small first step towards run-time - * configurable extensions. - */ -@@ -238,6 +242,9 @@ - - /* List of built-in (statically linked) extensions */ - static const ExtensionModule staticExtensions[] = { -+#ifdef TIGERVNC -+ {vncExtensionInit, "VNC-EXTENSION", NULL}, -+#endif - {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, - #ifdef MITSHM -diff -ur xorg-server.orig/os/WaitFor.c xorg-server/os/WaitFor.c ---- xorg-server.orig/os/WaitFor.c 2016-04-09 21:28:27.071999965 +0200 -+++ xorg-server/os/WaitFor.c 2016-04-09 21:28:57.587999860 +0200 -@@ -125,6 +125,9 @@ - static void CheckAllTimers(void); - static volatile OsTimerPtr timers = NULL; - -+extern void vncWriteBlockHandler(fd_set *fds); -+extern void vncWriteWakeupHandler(int nfds, fd_set *fds); -+ - /***************** - * WaitForSomething: - * Make the server suspend until there is -@@ -150,6 +153,7 @@ - INT32 timeout = 0; - fd_set clientsReadable; - fd_set clientsWritable; -+ fd_set socketsWritable; - int curclient; - int selecterr; - static int nready; -@@ -213,6 +217,9 @@ - XFD_COPYSET(&AllSockets, &LastSelectMask); - } - -+ FD_ZERO(&socketsWritable); -+ vncWriteBlockHandler(&socketsWritable); -+ - BlockHandler((void *) &wt, (void *) &LastSelectMask); - if (NewOutputPending) - FlushAllOutput(); -@@ -224,10 +231,20 @@ - i = Select(MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); - } - else { -- i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); -+ if (AnyClientsWriteBlocked) -+ XFD_ORSET(&socketsWritable, &ClientsWriteBlocked, &socketsWritable); -+ -+ if (XFD_ANYSET(&socketsWritable)) { -+ i = Select(MaxClients, &LastSelectMask, &socketsWritable, NULL, wt); -+ if (AnyClientsWriteBlocked) -+ XFD_ANDSET(&clientsWritable, &socketsWritable, &ClientsWriteBlocked); -+ } else { -+ i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt); -+ } - } - selecterr = GetErrno(); - WakeupHandler(i, (void *) &LastSelectMask); -+ vncWriteWakeupHandler(i, &socketsWritable); - if (i <= 0) { /* An error or timeout occurred */ - if (dispatchException) - return 0; diff --git a/unix/xserver119.patch b/unix/xserver119.patch deleted file mode 100644 index 7adf314d..00000000 --- a/unix/xserver119.patch +++ /dev/null @@ -1,95 +0,0 @@ -diff -up xserver/configure.ac.xserver116-rebased xserver/configure.ac ---- xserver/configure.ac.xserver116-rebased 2016-09-29 13:14:45.595441590 +0200 -+++ xserver/configure.ac 2016-09-29 13:14:45.631442006 +0200 -@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x - AC_CONFIG_HEADERS(include/version-config.h) - - AM_PROG_AS -+AC_PROG_CXX - AC_PROG_LN_S - LT_PREREQ([2.2]) - LT_INIT([disable-static win32-dll]) -@@ -1863,6 +1864,10 @@ if test "x$XVFB" = xyes; then - AC_SUBST([XVFB_SYS_LIBS]) - fi - -+dnl Xvnc DDX -+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"]) -+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"]) -+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"]) - - dnl Xnest DDX - -@@ -1898,6 +1903,8 @@ if test "x$XORG" = xauto; then - fi - AC_MSG_RESULT([$XORG]) - -+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) -+ - if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' -@@ -2116,7 +2123,6 @@ if test "x$XORG" = xyes; then - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) -- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) -@@ -2691,6 +2697,7 @@ hw/dmx/Makefile - hw/dmx/man/Makefile - hw/vfb/Makefile - hw/vfb/man/Makefile -+hw/vnc/Makefile - hw/xnest/Makefile - hw/xnest/man/Makefile - hw/xwin/Makefile -diff -up xserver/hw/Makefile.am.xserver116-rebased xserver/hw/Makefile.am ---- xserver/hw/Makefile.am.xserver116-rebased 2016-09-29 13:14:45.601441659 +0200 -+++ xserver/hw/Makefile.am 2016-09-29 13:14:45.631442006 +0200 -@@ -38,7 +38,8 @@ SUBDIRS = \ - $(DMX_SUBDIRS) \ - $(KDRIVE_SUBDIRS) \ - $(XQUARTZ_SUBDIRS) \ -- $(XWAYLAND_SUBDIRS) -+ $(XWAYLAND_SUBDIRS) \ -+ vnc - - DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland - -diff -up xserver/mi/miinitext.c.xserver116-rebased xserver/mi/miinitext.c ---- xserver/mi/miinitext.c.xserver116-rebased 2016-09-29 13:14:45.618441855 +0200 -+++ xserver/mi/miinitext.c 2016-09-29 13:14:45.631442006 +0200 -@@ -114,6 +114,10 @@ SOFTWARE. - #include "micmap.h" - #include "globals.h" - -+#ifdef TIGERVNC -+extern void vncExtensionInit(void); -+#endif -+ - /* The following is only a small first step towards run-time - * configurable extensions. - */ -@@ -238,6 +242,9 @@ EnableDisableExtensionError(const char * - - /* List of built-in (statically linked) extensions */ - static const ExtensionModule staticExtensions[] = { -+#ifdef TIGERVNC -+ {vncExtensionInit, "VNC-EXTENSION", NULL}, -+#endif - {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, - #ifdef MITSHM ---- xserver/include/os.h~ 2016-10-03 09:07:29.000000000 +0200 -+++ xserver/include/os.h 2016-10-03 14:13:00.013654506 +0200 -@@ -621,7 +621,7 @@ - extern _X_EXPORT void - LogClose(enum ExitCode error); - extern _X_EXPORT Bool --LogSetParameter(LogParameter param, int value); -+LogSetParameter(enum _LogParameter param, int value); - extern _X_EXPORT void - LogVWrite(int verb, const char *f, va_list args) - _X_ATTRIBUTE_PRINTF(2, 0); diff --git a/unix/xserver120.patch b/unix/xserver120.patch index d8598494..d36e5075 100644 --- a/unix/xserver120.patch +++ b/unix/xserver120.patch @@ -1,7 +1,7 @@ -Index: xserver/configure.ac -=================================================================== ---- xserver.orig/configure.ac -+++ xserver/configure.ac +diff --git a/configure.ac b/configure.ac +index 0909cc5b4..c01873200 100644 +--- a/configure.ac ++++ b/configure.ac @@ -74,6 +74,7 @@ dnl forcing an entire recompile.x AC_CONFIG_HEADERS(include/version-config.h) @@ -10,35 +10,35 @@ Index: xserver/configure.ac AC_PROG_LN_S LT_PREREQ([2.2]) LT_INIT([disable-static win32-dll]) -@@ -1777,6 +1778,10 @@ if test "x$XVFB" = xyes; then +@@ -1735,6 +1736,19 @@ if test "x$XVFB" = xyes; then AC_SUBST([XVFB_SYS_LIBS]) fi +dnl Xvnc DDX -+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"]) +AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"]) +AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"]) ++ ++PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) ++if test "x$GBM" = xyes; then ++ AC_DEFINE(HAVE_GBM, 1, [Have GBM support]) ++fi ++ ++PKG_CHECK_MODULES(LIBXCVT, "libxcvt", [XCVT=yes], [XCVT=no]) ++if test "x$XCVT" = xyes; then ++ AC_DEFINE(HAVE_LIBXCVT, 1, [Have libxcvt support]) ++fi dnl Xnest DDX -@@ -1812,6 +1817,8 @@ if test "x$XORG" = xauto; then - fi - AC_MSG_RESULT([$XORG]) +@@ -2058,7 +2067,6 @@ if test "x$GLAMOR" = xyes; then + [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DRIVER, 1, [Have GLAMOR_HAS_EGL_QUERY_DRIVER])], + []) -+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) -+ - if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' -@@ -2029,7 +2036,6 @@ if test "x$XORG" = xyes; then - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) -- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) -@@ -2565,6 +2571,7 @@ hw/dmx/Makefile +- PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) + if test "x$GBM" = xyes; then + AC_DEFINE(GLAMOR_HAS_GBM, 1, + [Build glamor with GBM-based EGL support]) +@@ -2523,6 +2531,7 @@ hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile @@ -46,37 +46,108 @@ Index: xserver/configure.ac hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile -Index: xserver/hw/Makefile.am -=================================================================== ---- xserver.orig/hw/Makefile.am -+++ xserver/hw/Makefile.am -@@ -38,7 +38,8 @@ SUBDIRS = \ - $(DMX_SUBDIRS) \ - $(KDRIVE_SUBDIRS) \ - $(XQUARTZ_SUBDIRS) \ -- $(XWAYLAND_SUBDIRS) -+ $(XWAYLAND_SUBDIRS) \ -+ vnc +diff --git a/dri3/Makefile.am b/dri3/Makefile.am +index e47a734e0..99c3718a5 100644 +--- a/dri3/Makefile.am ++++ b/dri3/Makefile.am +@@ -1,7 +1,7 @@ + noinst_LTLIBRARIES = libdri3.la + AM_CFLAGS = \ +- -DHAVE_XORG_CONFIG_H \ +- @DIX_CFLAGS@ @XORG_CFLAGS@ ++ @DIX_CFLAGS@ \ ++ @LIBDRM_CFLAGS@ + + libdri3_la_SOURCES = \ + dri3.h \ +diff --git a/dri3/dri3.c b/dri3/dri3.c +index ba32facd7..191252969 100644 +--- a/dri3/dri3.c ++++ b/dri3/dri3.c +@@ -20,10 +20,6 @@ + * OF THIS SOFTWARE. + */ + +-#ifdef HAVE_XORG_CONFIG_H +-#include <xorg-config.h> +-#endif +- + #include "dri3_priv.h" + + #include <drm_fourcc.h> +diff --git a/dri3/dri3_priv.h b/dri3/dri3_priv.h +index b087a9529..f319d1770 100644 +--- a/dri3/dri3_priv.h ++++ b/dri3/dri3_priv.h +@@ -23,6 +23,7 @@ + #ifndef _DRI3PRIV_H_ + #define _DRI3PRIV_H_ - DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland ++#include "dix-config.h" + #include <X11/X.h> + #include "scrnintstr.h" + #include "misc.h" +diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c +index 958877efa..687168930 100644 +--- a/dri3/dri3_request.c ++++ b/dri3/dri3_request.c +@@ -20,10 +20,6 @@ + * OF THIS SOFTWARE. + */ -Index: xserver/mi/miinitext.c -=================================================================== ---- xserver.orig/mi/miinitext.c -+++ xserver/mi/miinitext.c -@@ -107,8 +107,15 @@ SOFTWARE. - #include "os.h" - #include "globals.h" +-#ifdef HAVE_XORG_CONFIG_H +-#include <xorg-config.h> +-#endif +- + #include "dri3_priv.h" + #include <syncsrv.h> + #include <unistd.h> +diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c +index b98259753..3c7e5bf60 100644 +--- a/dri3/dri3_screen.c ++++ b/dri3/dri3_screen.c +@@ -20,10 +20,6 @@ + * OF THIS SOFTWARE. + */ -+#ifdef TIGERVNC -+extern void vncExtensionInit(void); -+#endif +-#ifdef HAVE_XORG_CONFIG_H +-#include <xorg-config.h> +-#endif +- + #include "dri3_priv.h" + #include <syncsdk.h> + #include <misync.h> +diff --git a/hw/Makefile.am b/hw/Makefile.am +index 19895dc77..3ecfa8b7a 100644 +--- a/hw/Makefile.am ++++ b/hw/Makefile.am +@@ -44,3 +44,5 @@ DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland + + relink: + $(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done ++ ++SUBDIRS += vnc +diff --git a/include/dix-config.h.in b/include/dix-config.h.in +index f8fc67067..d53c4e72f 100644 +--- a/include/dix-config.h.in ++++ b/include/dix-config.h.in +@@ -63,6 +63,9 @@ + /* Has libunwind support */ + #undef HAVE_LIBUNWIND + ++/* Have libxcvt support */ ++#undef HAVE_LIBXCVT + - /* List of built-in (statically linked) extensions */ - static const ExtensionModule staticExtensions[] = { -+#ifdef TIGERVNC -+ {vncExtensionInit, "VNC-EXTENSION", NULL}, -+#endif - {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, - #ifdef MITSHM + /* Define to 1 if you have the `cbrt' function. */ + #undef HAVE_CBRT + +@@ -83,6 +83,9 @@ + /* Define to 1 if you have the <fcntl.h> header file. */ + #undef HAVE_FCNTL_H + ++/* Have GBM support */ ++#undef HAVE_GBM ++ + /* Define to 1 if you have the `getdtablesize' function. */ + #undef HAVE_GETDTABLESIZE + diff --git a/unix/xserver21.1.1.patch b/unix/xserver21.1.1.patch deleted file mode 100644 index a349af75..00000000 --- a/unix/xserver21.1.1.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff -urpN xorg-server-1.20.0/configure.ac xorg-server-1.20.0/configure.ac ---- xorg-server-1.20.0/configure.ac 2018-05-10 09:32:34.000000000 -0700 -+++ xorg-server-1.20.0/configure.ac 2018-06-13 19:04:47.536413626 -0700 -@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x - AC_CONFIG_HEADERS(include/version-config.h) - - AM_PROG_AS -+AC_PROG_CXX - AC_PROG_LN_S - LT_PREREQ([2.2]) - LT_INIT([disable-static win32-dll]) -@@ -1777,6 +1778,10 @@ if test "x$XVFB" = xyes; then - AC_SUBST([XVFB_SYS_LIBS]) - fi - -+dnl Xvnc DDX -+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"]) -+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"]) -+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"]) - - dnl Xnest DDX - -@@ -1812,6 +1817,8 @@ if test "x$XORG" = xauto; then - fi - AC_MSG_RESULT([$XORG]) - -+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) -+ - if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' -@@ -2029,7 +2036,6 @@ if test "x$XORG" = xyes; then - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) -- AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) -@@ -2565,6 +2571,7 @@ hw/dmx/Makefile - hw/dmx/man/Makefile - hw/vfb/Makefile - hw/vfb/man/Makefile -+hw/vnc/Makefile - hw/xnest/Makefile - hw/xnest/man/Makefile - hw/xwin/Makefile -diff -urpN xorg-server-1.20.0/hw/Makefile.am xorg-server-1.20.0/hw/Makefile.am ---- xorg-server-1.20.0/hw/Makefile.am 2018-05-10 09:32:34.000000000 -0700 -+++ xorg-server-1.20.0/hw/Makefile.am 2018-06-13 19:04:47.536413626 -0700 -@@ -44,3 +44,5 @@ - - relink: - $(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done -+ -+SUBDIRS += vnc -diff -urpN xorg-server-1.20.0/mi/miinitext.c xorg-server-1.20.0/mi/miinitext.c ---- xorg-server-1.20.0/mi/miinitext.c 2018-05-10 09:32:37.000000000 -0700 -+++ xorg-server-1.20.0/mi/miinitext.c 2018-06-13 19:05:14.742200675 -0700 -@@ -107,8 +107,15 @@ SOFTWARE. - #include "os.h" - #include "globals.h" - -+#ifdef TIGERVNC -+extern void vncExtensionInit(void); -+#endif -+ - /* List of built-in (statically linked) extensions */ - static const ExtensionModule staticExtensions[] = { -+#ifdef TIGERVNC -+ {vncExtensionInit, "VNC-EXTENSION", NULL}, -+#endif - {GEExtensionInit, "Generic Event Extension", &noGEExtension}, - {ShapeExtensionInit, "SHAPE", NULL}, - #ifdef MITSHM diff --git a/unix/xserver21.patch b/unix/xserver21.patch new file mode 100644 index 00000000..c4258adf --- /dev/null +++ b/unix/xserver21.patch @@ -0,0 +1,82 @@ +diff --git a/configure.ac b/configure.ac +index fad7b5769..2c167de3d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -72,6 +72,7 @@ dnl forcing an entire recompile.x + AC_CONFIG_HEADERS(include/version-config.h) + + AM_PROG_AS ++AC_PROG_CXX + AC_PROG_LN_S + LT_PREREQ([2.2]) + LT_INIT([disable-static win32-dll]) +@@ -1720,6 +1721,19 @@ if test "x$XVFB" = xyes; then + AC_SUBST([XVFB_SYS_LIBS]) + fi + ++dnl Xvnc DDX ++AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"]) ++AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"]) ++ ++PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) ++if test "x$GBM" = xyes; then ++ AC_DEFINE(HAVE_GBM, 1, [Have GBM support]) ++fi ++ ++PKG_CHECK_MODULES(LIBXCVT, "$LIBXCVT", [XCVT=yes], [XCVT=no]) ++if test "x$XCVT" = xyes; then ++ AC_DEFINE(HAVE_LIBXCVT, 1, [Have libxcvt support]) ++fi + + dnl Xnest DDX + +@@ -2038,7 +2047,6 @@ if test "x$GLAMOR" = xyes; then + [AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DRIVER, 1, [Have GLAMOR_HAS_EGL_QUERY_DRIVER])], + []) + +- PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no]) + if test "x$GBM" = xyes; then + AC_DEFINE(GLAMOR_HAS_GBM, 1, + [Build glamor with GBM-based EGL support]) +@@ -2346,6 +2354,7 @@ hw/xfree86/utils/man/Makefile + hw/xfree86/utils/gtf/Makefile + hw/vfb/Makefile + hw/vfb/man/Makefile ++hw/vnc/Makefile + hw/xnest/Makefile + hw/xnest/man/Makefile + hw/xwin/Makefile +diff --git a/hw/Makefile.am b/hw/Makefile.am +index 1749018fa..1172cd59b 100644 +--- a/hw/Makefile.am ++++ b/hw/Makefile.am +@@ -34,3 +34,5 @@ DIST_SUBDIRS = xfree86 vfb xnest xwin xquartz kdrive + + relink: + $(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done ++ ++SUBDIRS += vnc +diff --git a/include/dix-config.h.in b/include/dix-config.h.in +index 382d70609..04a4fd263 100644 +--- a/include/dix-config.h.in ++++ b/include/dix-config.h.in +@@ -63,6 +63,9 @@ + /* Has libunwind support */ + #undef HAVE_LIBUNWIND + ++/* Have libxcvt support */ ++#undef HAVE_LIBXCVT ++ + /* Define to 1 if you have the `cbrt' function. */ + #undef HAVE_CBRT + +@@ -77,6 +77,9 @@ + /* Define to 1 if you have the <fcntl.h> header file. */ + #undef HAVE_FCNTL_H + ++/* Have GBM support */ ++#undef HAVE_GBM ++ + /* Define to 1 if you have the `getdtablesize' function. */ + #undef HAVE_GETDTABLESIZE + diff --git a/vncviewer/BaseTouchHandler.cxx b/vncviewer/BaseTouchHandler.cxx index 1bcf66c9..6552634b 100644 --- a/vncviewer/BaseTouchHandler.cxx +++ b/vncviewer/BaseTouchHandler.cxx @@ -40,7 +40,7 @@ static const unsigned DOUBLE_TAP_THRESHOLD = 50; BaseTouchHandler::BaseTouchHandler() { - gettimeofday(&lastTapTime, NULL); + gettimeofday(&lastTapTime, nullptr); } BaseTouchHandler::~BaseTouchHandler() @@ -188,7 +188,7 @@ void BaseTouchHandler::handleTapEvent(const GestureEvent& ev, } else { firstDoubleTapEvent = ev; } - gettimeofday(&lastTapTime, NULL); + gettimeofday(&lastTapTime, nullptr); fakeMotionEvent(newEv); fakeButtonEvent(true, buttonEvent, newEv); diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx index 82c4af41..e1c75962 100644 --- a/vncviewer/CConn.cxx +++ b/vncviewer/CConn.cxx @@ -29,6 +29,7 @@ #include <rfb/CMsgWriter.h> #include <rfb/CSecurity.h> +#include <rfb/Exception.h> #include <rfb/Hostname.h> #include <rfb/LogWriter.h> #include <rfb/Security.h> @@ -72,8 +73,8 @@ static const PixelFormat mediumColourPF(8, 8, false, true, // Time new bandwidth estimates are weighted against (in ms) static const unsigned bpsEstimateWindow = 1000; -CConn::CConn(const char* vncServerName, network::Socket* socket=NULL) - : serverPort(0), desktop(NULL), updateCount(0), pixelCount(0), +CConn::CConn(const char* vncServerName, network::Socket* socket=nullptr) + : serverPort(0), desktop(nullptr), updateCount(0), pixelCount(0), lastServerEncoding((unsigned int)-1), bpsEstimate(20000000) { setShared(::shared); @@ -90,10 +91,10 @@ CConn::CConn(const char* vncServerName, network::Socket* socket=NULL) if (!noJpeg) setQualityLevel(::qualityLevel); - if(sock == NULL) { + if(sock == nullptr) { try { #ifndef WIN32 - if (strchr(vncServerName, '/') != NULL) { + if (strchr(vncServerName, '/') != nullptr) { sock = new network::UnixSocket(vncServerName); serverHost = sock->getPeerAddress(); vlog.info(_("Connected to socket %s"), serverHost.c_str()); @@ -270,6 +271,14 @@ void CConn::socketEvent(FL_SOCKET fd, void *data) } else { disconnect(); } + } catch (rfb::AuthCancelledException& e) { + vlog.info("%s", e.str()); + disconnect(); + } catch (rfb::AuthFailureException& e) { + reset_password_data(); + vlog.error(_("Authentication failed: %s"), e.str()); + abort_connection(_("Failed to authenticate with the server. Reason " + "given by the server:\n\n%s"), e.str()); } catch (rdr::Exception& e) { vlog.error("%s", e.str()); abort_connection_with_unexpected_error(e); @@ -346,7 +355,7 @@ void CConn::framebufferUpdateStart() CConnection::framebufferUpdateStart(); // For bandwidth estimate - gettimeofday(&updateStartTime, NULL); + gettimeofday(&updateStartTime, nullptr); updateStartPos = sock->inStream().pos(); // Update the screen prematurely for very slow updates @@ -367,7 +376,7 @@ void CConn::framebufferUpdateEnd() updateCount++; // Calculate bandwidth everything managed to maintain during this update - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); elapsed = (now.tv_sec - updateStartTime.tv_sec) * 1000000; elapsed += now.tv_usec - updateStartTime.tv_usec; if (elapsed == 0) diff --git a/vncviewer/CConn.h b/vncviewer/CConn.h index 835699e5..fcaf49f6 100644 --- a/vncviewer/CConn.h +++ b/vncviewer/CConn.h @@ -45,37 +45,40 @@ public: static void socketEvent(FL_SOCKET fd, void *data); // CConnection callback methods - void initDone(); + void initDone() override; - void setDesktopSize(int w, int h); + void setDesktopSize(int w, int h) override; void setExtendedDesktopSize(unsigned reason, unsigned result, - int w, int h, const rfb::ScreenSet& layout); + int w, int h, + const rfb::ScreenSet& layout) override; - void setName(const char* name); + void setName(const char* name) override; - void setColourMapEntries(int firstColour, int nColours, uint16_t* rgbs); + void setColourMapEntries(int firstColour, int nColours, + uint16_t* rgbs) override; - void bell(); + void bell() override; - void framebufferUpdateStart(); - void framebufferUpdateEnd(); - bool dataRect(const rfb::Rect& r, int encoding); + void framebufferUpdateStart() override; + void framebufferUpdateEnd() override; + bool dataRect(const rfb::Rect& r, int encoding) override; void setCursor(int width, int height, const rfb::Point& hotspot, - const uint8_t* data); - void setCursorPos(const rfb::Point& pos); + const uint8_t* data) override; + void setCursorPos(const rfb::Point& pos) override; - void fence(uint32_t flags, unsigned len, const uint8_t data[]); + void fence(uint32_t flags, unsigned len, + const uint8_t data[]) override; - void setLEDState(unsigned int state); + void setLEDState(unsigned int state) override; - virtual void handleClipboardRequest(); - virtual void handleClipboardAnnounce(bool available); - virtual void handleClipboardData(const char* data); + void handleClipboardRequest() override; + void handleClipboardAnnounce(bool available) override; + void handleClipboardData(const char* data) override; private: - void resizeFramebuffer(); + void resizeFramebuffer() override; void autoSelectFormatAndEncoding(); void updatePixelFormat(); diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 7d7ae7c3..2d363781 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -81,18 +81,18 @@ static std::set<DesktopWindow *> instances; DesktopWindow::DesktopWindow(int w, int h, const char *name, const rfb::PixelFormat& serverPF, CConn* cc_) - : Fl_Window(w, h), cc(cc_), offscreen(NULL), overlay(NULL), + : Fl_Window(w, h), cc(cc_), offscreen(nullptr), overlay(nullptr), firstUpdate(true), delayedFullscreen(false), delayedDesktopSize(false), keyboardGrabbed(false), mouseGrabbed(false), statsLastUpdates(0), statsLastPixels(0), statsLastPosition(0), - statsGraph(NULL) + statsGraph(nullptr) { Fl_Group* group; // Dummy group to prevent FLTK from moving our widgets around group = new Fl_Group(0, 0, w, h); - group->resizable(NULL); + group->resizable(nullptr); resizable(group); viewport = new Viewport(w, h, serverPF, cc); @@ -342,9 +342,9 @@ void DesktopWindow::resizeFramebuffer(int new_w, int new_h) XGetWindowProperty(fl_display, fl_xid(this), net_wm_state, 0, 1024, False, XA_ATOM, &type, &format, &nitems, &remain, (unsigned char**)&atoms); - for (unsigned long i = 0;i < nitems;i++) { - if ((atoms[i] == net_wm_state_maximized_vert) || - (atoms[i] == net_wm_state_maximized_horz)) { + for (unsigned long n = 0;n < nitems;n++) { + if ((atoms[n] == net_wm_state_maximized_vert) || + (atoms[n] == net_wm_state_maximized_horz)) { maximized = true; break; } @@ -359,13 +359,6 @@ void DesktopWindow::resizeFramebuffer(int new_w, int new_h) if (!fullscreen_active() && !maximized) { if ((w() == viewport->w()) && (h() == viewport->h())) size(new_w, new_h); - else { - // Make sure the window isn't too big. We do this manually because - // we have to disable the window size restriction (and it isn't - // entirely trustworthy to begin with). - if ((w() > new_w) || (h() > new_h)) - size(__rfbmin(w(), new_w), __rfbmin(h(), new_h)); - } } viewport->size(new_w, new_h); @@ -438,7 +431,7 @@ void DesktopWindow::draw() #if !defined(__APPLE__) // Adjust offscreen surface dimensions - if ((offscreen == NULL) || + if ((offscreen == nullptr) || (offscreen->width() != w()) || (offscreen->height() != h())) { delete offscreen; offscreen = new Surface(w(), h()); @@ -513,8 +506,8 @@ void DesktopWindow::draw() windowRect.setXYWH(x(), y(), w(), h()); bool foundEnclosedScreen = false; - for (int i = 0; i < Fl::screen_count(); i++) { - Fl::screen_xywh(sx, sy, sw, sh, i); + for (int idx = 0; idx < Fl::screen_count(); idx++) { + Fl::screen_xywh(sx, sy, sw, sh, idx); // The screen with the smallest index that are enclosed by // the viewport will be used for showing the overlay. @@ -632,10 +625,10 @@ void DesktopWindow::resize(int x, int y, int w, int h) } if (resize_req) { - for (int i = 0;i < Fl::screen_count();i++) { + for (int idx = 0;idx < Fl::screen_count();idx++) { int sx, sy, sw, sh; - Fl::screen_xywh(sx, sy, sw, sh, i); + Fl::screen_xywh(sx, sy, sw, sh, idx); // We can't trust x and y if the window isn't mapped as the // window manager might adjust those numbers @@ -786,7 +779,7 @@ void DesktopWindow::setOverlay(const char* text, ...) overlay = new Surface(image); overlayAlpha = 0; - gettimeofday(&overlayStart, NULL); + gettimeofday(&overlayStart, nullptr); delete image; delete [] buffer; @@ -814,7 +807,7 @@ void DesktopWindow::updateOverlay(void *data) Fl::add_timeout(1.0/60, updateOverlay, self); } else { delete self->overlay; - self->overlay = NULL; + self->overlay = nullptr; } self->damage(FL_DAMAGE_USER1); @@ -891,7 +884,7 @@ int DesktopWindow::fltkDispatch(int event, Fl_Window *win) // FLTK keeps spamming bogus FL_MOVE events if _any_ X event is // received with the mouse pointer outside our windows // https://github.com/fltk/fltk/issues/76 - if ((event == FL_MOVE) && (win == NULL)) + if ((event == FL_MOVE) && (win == nullptr)) return 0; ret = Fl::handle_(event, win); @@ -977,9 +970,8 @@ void DesktopWindow::fullscreen_on() std::set<int> selected = fullScreenSelectedMonitors.getParam(); monitors.insert(selected.begin(), selected.end()); } else { - for (int i = 0; i < Fl::screen_count(); i++) { - monitors.insert(i); - } + for (int idx = 0; idx < Fl::screen_count(); idx++) + monitors.insert(idx); } // If no monitors were found in the selected monitors case, we want @@ -1332,7 +1324,6 @@ void DesktopWindow::remoteResize(int width, int height) layout.begin()->dimensions.br.x = width; layout.begin()->dimensions.br.y = height; } else { - int i; uint32_t id; int sx, sy, sw, sh; rfb::Rect viewport_rect, screen_rect; @@ -1348,8 +1339,8 @@ void DesktopWindow::remoteResize(int width, int height) // FIXME: We should really track screens better so we can handle // a resized one. // - for (i = 0;i < Fl::screen_count();i++) { - Fl::screen_xywh(sx, sy, sw, sh, i); + for (int idx = 0;idx < Fl::screen_count();idx++) { + Fl::screen_xywh(sx, sy, sw, sh, idx); // Check that the screen is fully inside the framebuffer screen_rect.setXYWH(sx, sy, sw, sh); @@ -1658,7 +1649,7 @@ void DesktopWindow::handleStatsTimeout(void *data) self->stats[statsCount-1].pps = (pixels - self->statsLastPixels) * 1000 / elapsed; self->stats[statsCount-1].bps = (pos - self->statsLastPosition) * 1000 / elapsed; - gettimeofday(&self->statsLastTime, NULL); + gettimeofday(&self->statsLastTime, nullptr); self->statsLastUpdates = updates; self->statsLastPixels = pixels; self->statsLastPosition = pos; diff --git a/vncviewer/DesktopWindow.h b/vncviewer/DesktopWindow.h index fd622c6d..ce7960ce 100644 --- a/vncviewer/DesktopWindow.h +++ b/vncviewer/DesktopWindow.h @@ -71,11 +71,11 @@ public: void handleClipboardData(const char* data); // Fl_Window callback methods - virtual void show(); - virtual void draw(); - virtual void resize(int x, int y, int w, int h); + void show() override; + void draw() override; + void resize(int x, int y, int w, int h) override; - virtual int handle(int event); + int handle(int event) override; void fullscreen_on(); diff --git a/vncviewer/EmulateMB.cxx b/vncviewer/EmulateMB.cxx index 72335eb8..fef8b3d9 100644 --- a/vncviewer/EmulateMB.cxx +++ b/vncviewer/EmulateMB.cxx @@ -199,7 +199,7 @@ EmulateMB::EmulateMB() { } -void EmulateMB::filterPointerEvent(const rfb::Point& pos, int buttonMask) +void EmulateMB::filterPointerEvent(const rfb::Point& pos, uint8_t buttonMask) { int btstate; int action1, action2; @@ -277,13 +277,13 @@ void EmulateMB::filterPointerEvent(const rfb::Point& pos, int buttonMask) } } -bool EmulateMB::handleTimeout(rfb::Timer *t) +void EmulateMB::handleTimeout(rfb::Timer *t) { int action1, action2; - int buttonMask; + uint8_t buttonMask; if (&timer != t) - return false; + return; if ((state > 10) || (state < 0)) throw rfb::Exception(_("Invalid state for 3 button emulation")); @@ -310,11 +310,9 @@ bool EmulateMB::handleTimeout(rfb::Timer *t) } state = stateTab[state][4][2]; - - return false; } -void EmulateMB::sendAction(const rfb::Point& pos, int buttonMask, int action) +void EmulateMB::sendAction(const rfb::Point& pos, uint8_t buttonMask, int action) { assert(action != 0); @@ -327,7 +325,7 @@ void EmulateMB::sendAction(const rfb::Point& pos, int buttonMask, int action) sendPointerEvent(pos, buttonMask); } -int EmulateMB::createButtonMask(int buttonMask) +int EmulateMB::createButtonMask(uint8_t buttonMask) { // Unset left and right buttons in the mask buttonMask &= ~0x5; diff --git a/vncviewer/EmulateMB.h b/vncviewer/EmulateMB.h index 132f44fe..1afa4881 100644 --- a/vncviewer/EmulateMB.h +++ b/vncviewer/EmulateMB.h @@ -26,22 +26,22 @@ class EmulateMB : public rfb::Timer::Callback { public: EmulateMB(); - void filterPointerEvent(const rfb::Point& pos, int buttonMask); + void filterPointerEvent(const rfb::Point& pos, uint8_t buttonMask); protected: - virtual void sendPointerEvent(const rfb::Point& pos, int buttonMask)=0; + virtual void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask)=0; - virtual bool handleTimeout(rfb::Timer *t); + void handleTimeout(rfb::Timer *t) override; private: - void sendAction(const rfb::Point& pos, int buttonMask, int action); + void sendAction(const rfb::Point& pos, uint8_t buttonMask, int action); - int createButtonMask(int buttonMask); + int createButtonMask(uint8_t buttonMask); private: int state; - int emulatedButtonMask; - int lastButtonMask; + uint8_t emulatedButtonMask; + uint8_t lastButtonMask; rfb::Point lastPos, origPos; rfb::Timer timer; }; diff --git a/vncviewer/GestureHandler.cxx b/vncviewer/GestureHandler.cxx index c3cc1531..121ceecf 100644 --- a/vncviewer/GestureHandler.cxx +++ b/vncviewer/GestureHandler.cxx @@ -95,7 +95,7 @@ void GestureHandler::handleTouchBegin(int id, double x, double y) return; } - gettimeofday(&ght.started, NULL); + gettimeofday(&ght.started, nullptr); ght.active = true; ght.lastX = ght.firstX = x; ght.lastY = ght.firstY = y; @@ -238,7 +238,7 @@ void GestureHandler::handleTouchEnd(int id) longpressTimer.stop(); if (!waitingRelease) { - gettimeofday(&releaseStart, NULL); + gettimeofday(&releaseStart, nullptr); waitingRelease = true; // Can't be a tap that requires more touches than we current have @@ -323,14 +323,12 @@ bool GestureHandler::hasDetectedGesture() return true; } -bool GestureHandler::handleTimeout(rfb::Timer* t) +void GestureHandler::handleTimeout(rfb::Timer* t) { if (t == &longpressTimer) longpressTimeout(); else if (t == &twoTouchTimer) twoTouchTimeout(); - - return false; } void GestureHandler::longpressTimeout() @@ -377,19 +375,19 @@ void GestureHandler::pushEvent(GestureEventType t) // For most gesture events the current (average) position is the // most useful - getPosition(NULL, NULL, &avgX, &avgY); + getPosition(nullptr, nullptr, &avgX, &avgY); // However we have a slight distance to detect gestures, so for the // first gesture event we want to use the first positions we saw if (t == GestureBegin) - getPosition(&avgX, &avgY, NULL, NULL); + getPosition(&avgX, &avgY, nullptr, nullptr); // For these gestures, we always want the event coordinates // to be where the gesture began, not the current touch location. switch (state) { case GH_TWODRAG: case GH_PINCH: - getPosition(&avgX, &avgY, NULL, NULL); + getPosition(&avgX, &avgY, nullptr, nullptr); break; } @@ -400,9 +398,9 @@ void GestureHandler::pushEvent(GestureEventType t) if (state == GH_PINCH) { if (t == GestureBegin) getAverageDistance(&gev.magnitudeX, &gev.magnitudeY, - NULL, NULL); + nullptr, nullptr); else - getAverageDistance(NULL, NULL, + getAverageDistance(nullptr, nullptr, &gev.magnitudeX, &gev.magnitudeY); } else if (state == GH_TWODRAG) { if (t == GestureBegin) diff --git a/vncviewer/GestureHandler.h b/vncviewer/GestureHandler.h index 372b7865..2b31703a 100644 --- a/vncviewer/GestureHandler.h +++ b/vncviewer/GestureHandler.h @@ -42,12 +42,12 @@ class GestureHandler : public rfb::Timer::Callback { private: bool hasDetectedGesture(); - virtual bool handleTimeout(rfb::Timer* t); + void handleTimeout(rfb::Timer* t) override; void longpressTimeout(); void twoTouchTimeout(); void pushEvent(GestureEventType t); - GestureEventGesture stateToGesture(unsigned char state); + static GestureEventGesture stateToGesture(unsigned char state); void getPosition(double *firstX, double *firstY, double *lastX, double *lastY); diff --git a/vncviewer/MonitorIndicesParameter.cxx b/vncviewer/MonitorIndicesParameter.cxx index dcc762a3..957ade06 100644 --- a/vncviewer/MonitorIndicesParameter.cxx +++ b/vncviewer/MonitorIndicesParameter.cxx @@ -71,24 +71,22 @@ std::set<int> MonitorIndicesParameter::getParam() return indices; } -bool MonitorIndicesParameter::setParam(const char* value) +bool MonitorIndicesParameter::setParam(const char* v) { - int index; std::set<int> indices; - if (!parseIndices(value, &indices, true)) { + if (!parseIndices(v, &indices, true)) { vlog.error(_("Invalid configuration specified for %s"), name); return false; } - for (std::set<int>::iterator it = indices.begin(); it != indices.end(); it++) { - index = *it + 1; - + for (int index : indices) { + index += 1; if (index <= 0 || index > Fl::screen_count()) vlog.error(_("Monitor index %d does not exist"), index); } - return StringParameter::setParam(value); + return StringParameter::setParam(v); } bool MonitorIndicesParameter::setParam(std::set<int> indices) @@ -111,16 +109,14 @@ bool MonitorIndicesParameter::setParam(std::set<int> indices) int bytesWritten = 0; char const * separator = ""; - for (std::set<int>::iterator index = configIndices.begin(); - index != configIndices.end(); - index++) + for (int configIndex : configIndices) { bytesWritten += snprintf( buf+bytesWritten, BUF_MAX_LEN-bytesWritten, "%s%u", separator, - (*index)+1 + configIndex+1 ); separator = ","; @@ -134,7 +130,7 @@ static bool parseNumber(std::string number, std::set<int> *indices) if (number.size() <= 0) return false; - int v = strtol(number.c_str(), NULL, 0); + int v = strtol(number.c_str(), nullptr, 0); if (v <= 0) return false; diff --git a/vncviewer/MonitorIndicesParameter.h b/vncviewer/MonitorIndicesParameter.h index 58e55e43..d91c84fe 100644 --- a/vncviewer/MonitorIndicesParameter.h +++ b/vncviewer/MonitorIndicesParameter.h @@ -29,15 +29,15 @@ public: MonitorIndicesParameter(const char* name_, const char* desc_, const char* v); std::set<int> getParam(); bool setParam(std::set<int> indices); - bool setParam(const char* value); + bool setParam(const char* v) override; private: typedef struct { int x, y, w, h; int fltkIndex; } Monitor; - bool parseIndices(const char* value, std::set<int> *indices, - bool complain=false); + static bool parseIndices(const char* value, std::set<int> *indices, + bool complain=false); std::vector<MonitorIndicesParameter::Monitor> fetchMonitors(); static int compare(const void*, const void*); }; diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx index 3c293fac..e04065ec 100644 --- a/vncviewer/OptionsDialog.cxx +++ b/vncviewer/OptionsDialog.cxx @@ -123,7 +123,7 @@ OptionsDialog::~OptionsDialog() void OptionsDialog::showDialog(void) { - static OptionsDialog *dialog = NULL; + static OptionsDialog *dialog = nullptr; if (!dialog) dialog = new OptionsDialog(); @@ -218,10 +218,8 @@ void OptionsDialog::loadOptions(void) Security security(SecurityClient::secTypes); list<uint8_t> secTypes; - list<uint8_t>::iterator iter; list<uint32_t> secTypesExt; - list<uint32_t>::iterator iterExt; encNoneCheckbox->value(false); #ifdef HAVE_GNUTLS @@ -237,8 +235,8 @@ void OptionsDialog::loadOptions(void) authPlainCheckbox->value(false); secTypes = security.GetEnabledSecTypes(); - for (iter = secTypes.begin(); iter != secTypes.end(); ++iter) { - switch (*iter) { + for (uint8_t type : secTypes) { + switch (type) { case secTypeNone: encNoneCheckbox->value(true); authNoneCheckbox->value(true); @@ -251,8 +249,8 @@ void OptionsDialog::loadOptions(void) } secTypesExt = security.GetEnabledExtSecTypes(); - for (iterExt = secTypesExt.begin(); iterExt != secTypesExt.end(); ++iterExt) { - switch (*iterExt) { + for (uint32_t type : secTypesExt) { + switch (type) { case secTypePlain: encNoneCheckbox->value(true); authPlainCheckbox->value(true); @@ -330,9 +328,9 @@ void OptionsDialog::loadOptions(void) menuKeyChoice->value(0); menuKeyBuf = menuKey; - for (int i = 0; i < getMenuKeySymbolCount(); i++) - if (!strcmp(getMenuKeySymbols()[i].name, menuKeyBuf)) - menuKeyChoice->value(i + 1); + for (int idx = 0; idx < getMenuKeySymbolCount(); idx++) + if (!strcmp(getMenuKeySymbols()[idx].name, menuKeyBuf)) + menuKeyChoice->value(idx + 1); /* Display */ if (!fullScreen) { @@ -577,7 +575,7 @@ void OptionsDialog::createCompressionPage(int tx, int ty, int tw, int th) encodingGroup->end(); /* Needed for resize to work sanely */ - encodingGroup->resizable(NULL); + encodingGroup->resizable(nullptr); encodingGroup->size(encodingGroup->w(), ty - encodingGroup->y()); col1_ty = ty; @@ -629,7 +627,7 @@ void OptionsDialog::createCompressionPage(int tx, int ty, int tw, int th) colorlevelGroup->end(); /* Needed for resize to work sanely */ - colorlevelGroup->resizable(NULL); + colorlevelGroup->resizable(nullptr); colorlevelGroup->size(colorlevelGroup->w(), ty - colorlevelGroup->y()); col2_ty = ty; @@ -745,7 +743,7 @@ void OptionsDialog::createSecurityPage(int tx, int ty, int tw, int th) encryptionGroup->end(); /* Needed for resize to work sanely */ - encryptionGroup->resizable(NULL); + encryptionGroup->resizable(nullptr); encryptionGroup->size(encryptionGroup->w(), ty - encryptionGroup->y()); @@ -787,7 +785,7 @@ void OptionsDialog::createSecurityPage(int tx, int ty, int tw, int th) authenticationGroup->end(); /* Needed for resize to work sanely */ - authenticationGroup->resizable(NULL); + authenticationGroup->resizable(nullptr); authenticationGroup->size(authenticationGroup->w(), ty - authenticationGroup->y()); @@ -847,7 +845,7 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th) mouseGroup->end(); /* Needed for resize to work sanely */ - mouseGroup->resizable(NULL); + mouseGroup->resizable(nullptr); mouseGroup->size(mouseGroup->w(), ty - mouseGroup->y()); /* Back to normal */ @@ -873,9 +871,9 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th) menuKeyChoice = new Fl_Choice(LBLLEFT(tx, ty, 150, CHOICE_HEIGHT, _("Menu key"))); - fltk_menu_add(menuKeyChoice, _("None"), 0, NULL, (void*)0, FL_MENU_DIVIDER); - for (int i = 0; i < getMenuKeySymbolCount(); i++) - fltk_menu_add(menuKeyChoice, getMenuKeySymbols()[i].name, 0, NULL, 0, 0); + fltk_menu_add(menuKeyChoice, _("None"), 0, nullptr, nullptr, FL_MENU_DIVIDER); + for (int idx = 0; idx < getMenuKeySymbolCount(); idx++) + fltk_menu_add(menuKeyChoice, getMenuKeySymbols()[idx].name, 0, nullptr, nullptr, 0); ty += CHOICE_HEIGHT + TIGHT_MARGIN; } @@ -883,7 +881,7 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th) keyboardGroup->end(); /* Needed for resize to work sanely */ - keyboardGroup->resizable(NULL); + keyboardGroup->resizable(nullptr); keyboardGroup->size(keyboardGroup->w(), ty - keyboardGroup->y()); /* Back to normal */ @@ -935,7 +933,7 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th) clipboardGroup->end(); /* Needed for resize to work sanely */ - clipboardGroup->resizable(NULL); + clipboardGroup->resizable(nullptr); clipboardGroup->size(clipboardGroup->w(), ty - clipboardGroup->y()); /* Back to normal */ @@ -1013,7 +1011,7 @@ void OptionsDialog::createDisplayPage(int tx, int ty, int tw, int th) displayModeGroup->end(); /* Needed for resize to work sanely */ - displayModeGroup->resizable(NULL); + displayModeGroup->resizable(nullptr); displayModeGroup->size(displayModeGroup->w(), ty - displayModeGroup->y()); diff --git a/vncviewer/OptionsDialog.h b/vncviewer/OptionsDialog.h index be08620d..f6ca89b1 100644 --- a/vncviewer/OptionsDialog.h +++ b/vncviewer/OptionsDialog.h @@ -42,10 +42,10 @@ protected: public: static void showDialog(void); - static void addCallback(OptionsCallback *cb, void *data = NULL); + static void addCallback(OptionsCallback *cb, void *data = nullptr); static void removeCallback(OptionsCallback *cb); - void show(void); + void show(void) override; protected: void loadOptions(void); diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx index 2c91c704..bcb4cb23 100644 --- a/vncviewer/PlatformPixelBuffer.cxx +++ b/vncviewer/PlatformPixelBuffer.cxx @@ -41,16 +41,16 @@ static rfb::LogWriter vlog("PlatformPixelBuffer"); PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) : FullFramePixelBuffer(rfb::PixelFormat(32, 24, false, true, 255, 255, 255, 16, 8, 0), - 0, 0, NULL, 0), + 0, 0, nullptr, 0), Surface(width, height) #if !defined(WIN32) && !defined(__APPLE__) - , shminfo(NULL), xim(NULL) + , shminfo(nullptr), xim(nullptr) #endif { #if !defined(WIN32) && !defined(__APPLE__) if (!setupShm(width, height)) { - xim = XCreateImage(fl_display, CopyFromParent, 32, - ZPixmap, 0, 0, width, height, 32, 0); + xim = XCreateImage(fl_display, (Visual*)CopyFromParent, 32, + ZPixmap, 0, nullptr, width, height, 32, 0); if (!xim) throw rdr::Exception("XCreateImage"); @@ -78,15 +78,15 @@ PlatformPixelBuffer::~PlatformPixelBuffer() vlog.debug("Freeing shared memory XImage"); XShmDetach(fl_display, shminfo); shmdt(shminfo->shmaddr); - shmctl(shminfo->shmid, IPC_RMID, 0); + shmctl(shminfo->shmid, IPC_RMID, nullptr); delete shminfo; - shminfo = NULL; + shminfo = nullptr; } // XDestroyImage() will free(xim->data) if appropriate if (xim) XDestroyImage(xim); - xim = NULL; + xim = nullptr; #endif } @@ -113,7 +113,7 @@ rfb::Rect PlatformPixelBuffer::getDamage(void) GC gc; - gc = XCreateGC(fl_display, pixmap, 0, NULL); + gc = XCreateGC(fl_display, pixmap, 0, nullptr); if (shminfo) { XShmPutImage(fl_display, pixmap, gc, xim, r.tl.x, r.tl.y, r.tl.x, r.tl.y, @@ -147,7 +147,7 @@ bool PlatformPixelBuffer::setupShm(int width, int height) int major, minor; Bool pixmaps; XErrorHandler old_handler; - const char *display_name = XDisplayName (NULL); + const char *display_name = XDisplayName(nullptr); /* Don't use MIT-SHM on remote displays */ if (*display_name && *display_name != ':') @@ -158,8 +158,8 @@ bool PlatformPixelBuffer::setupShm(int width, int height) shminfo = new XShmSegmentInfo; - xim = XShmCreateImage(fl_display, CopyFromParent, 32, - ZPixmap, 0, shminfo, width, height); + xim = XShmCreateImage(fl_display, (Visual*)CopyFromParent, 32, + ZPixmap, nullptr, shminfo, width, height); if (!xim) goto free_shminfo; @@ -169,8 +169,8 @@ bool PlatformPixelBuffer::setupShm(int width, int height) if (shminfo->shmid == -1) goto free_xim; - shminfo->shmaddr = xim->data = (char*)shmat(shminfo->shmid, 0, 0); - shmctl(shminfo->shmid, IPC_RMID, 0); // to avoid memory leakage + shminfo->shmaddr = xim->data = (char*)shmat(shminfo->shmid, nullptr, 0); + shmctl(shminfo->shmid, IPC_RMID, nullptr); // to avoid memory leakage if (shminfo->shmaddr == (char *)-1) goto free_xim; @@ -202,11 +202,11 @@ free_shmaddr: free_xim: XDestroyImage(xim); - xim = NULL; + xim = nullptr; free_shminfo: delete shminfo; - shminfo = NULL; + shminfo = nullptr; return 0; } diff --git a/vncviewer/PlatformPixelBuffer.h b/vncviewer/PlatformPixelBuffer.h index ec439f64..24763d46 100644 --- a/vncviewer/PlatformPixelBuffer.h +++ b/vncviewer/PlatformPixelBuffer.h @@ -40,7 +40,7 @@ public: PlatformPixelBuffer(int width, int height); ~PlatformPixelBuffer(); - virtual void commitBufferRW(const rfb::Rect& r); + void commitBufferRW(const rfb::Rect& r) override; rfb::Rect getDamage(void); diff --git a/vncviewer/ServerDialog.cxx b/vncviewer/ServerDialog.cxx index 4d57b5fb..3bce2b51 100644 --- a/vncviewer/ServerDialog.cxx +++ b/vncviewer/ServerDialog.cxx @@ -110,7 +110,7 @@ ServerDialog::ServerDialog() y += BUTTON_HEIGHT + INNER_MARGIN; /* Needed for resize to work sanely */ - resizable(NULL); + resizable(nullptr); h(y-INNER_MARGIN+OUTER_MARGIN); callback(this->handleCancel, this); @@ -146,7 +146,7 @@ void ServerDialog::run(const char* servername, char *newservername) while (dialog.shown()) Fl::wait(); - if (dialog.serverName->value() == NULL) { + if (dialog.serverName->value() == nullptr) { newservername[0] = '\0'; return; } @@ -180,7 +180,7 @@ void ServerDialog::handleLoad(Fl_Widget* /*widget*/, void* data) Fl::wait(); // Did the user hit cancel? - if (file_chooser->value() == NULL) { + if (file_chooser->value() == nullptr) { delete(file_chooser); return; } @@ -223,7 +223,7 @@ void ServerDialog::handleSaveAs(Fl_Widget* /*widget*/, void* data) Fl::wait(); // Did the user hit cancel? - if (file_chooser->value() == NULL) { + if (file_chooser->value() == nullptr) { delete(file_chooser); return; } @@ -237,7 +237,7 @@ void ServerDialog::handleSaveAs(Fl_Widget* /*widget*/, void* data) // The file already exists. fclose(f); int overwrite_choice = fl_choice(_("%s already exists. Do you want to overwrite?"), - _("Overwrite"), _("No"), NULL, filename); + _("Overwrite"), _("No"), nullptr, filename); if (overwrite_choice == 1) { // If the user doesn't want to overwrite: @@ -284,7 +284,7 @@ void ServerDialog::handleConnect(Fl_Widget* /*widget*/, void *data) dialog->hide(); try { - saveViewerParameters(NULL, servername); + saveViewerParameters(nullptr, servername); } catch (Exception& e) { vlog.error("%s", e.str()); fl_alert(_("Unable to save the default configuration:\n\n%s"), @@ -316,7 +316,7 @@ void ServerDialog::loadServerHistory() #endif const char* stateDir = os::getvncstatedir(); - if (stateDir == NULL) + if (stateDir == nullptr) throw Exception(_("Could not obtain the state directory path")); char filepath[PATH_MAX]; @@ -382,7 +382,7 @@ void ServerDialog::saveServerHistory() #endif const char* stateDir = os::getvncstatedir(); - if (stateDir == NULL) + if (stateDir == nullptr) throw Exception(_("Could not obtain the state directory path")); char filepath[PATH_MAX]; @@ -395,8 +395,8 @@ void ServerDialog::saveServerHistory() filepath, strerror(errno)); // Save the last X elements to the config file. - for(size_t i=0; i < serverHistory.size() && i <= SERVER_HISTORY_SIZE; i++) - fprintf(f, "%s\n", serverHistory[i].c_str()); + for(size_t idx=0; idx < serverHistory.size() && idx <= SERVER_HISTORY_SIZE; idx++) + fprintf(f, "%s\n", serverHistory[idx].c_str()); fclose(f); } diff --git a/vncviewer/Surface.h b/vncviewer/Surface.h index 1cb87f50..60e452b1 100644 --- a/vncviewer/Surface.h +++ b/vncviewer/Surface.h @@ -41,11 +41,15 @@ public: void clear(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255); - void draw(int src_x, int src_y, int x, int y, int w, int h); - void draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h); + void draw(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h); + void draw(Surface* dst, int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h); - void blend(int src_x, int src_y, int x, int y, int w, int h, int a=255); - void blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a=255); + void blend(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h, int a=255); + void blend(Surface* dst, int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h, int a=255); protected: void alloc(); diff --git a/vncviewer/Surface_OSX.cxx b/vncviewer/Surface_OSX.cxx index 445c9e6c..673f37e9 100644 --- a/vncviewer/Surface_OSX.cxx +++ b/vncviewer/Surface_OSX.cxx @@ -44,8 +44,8 @@ static CGImageRef create_image(CGColorSpaceRef lut, CGImageRef image; - provider = CGDataProviderCreateWithData(NULL, data, - w * h * 4, NULL); + provider = CGDataProviderCreateWithData(nullptr, data, + w * h * 4, nullptr); if (!provider) throw rdr::Exception("CGDataProviderCreateWithData"); @@ -58,7 +58,8 @@ static CGImageRef create_image(CGColorSpaceRef lut, image = CGImageCreate(w, h, 8, 32, w * 4, lut, alpha | kCGBitmapByteOrder32Little, - provider, NULL, false, kCGRenderingIntentDefault); + provider, nullptr, false, + kCGRenderingIntentDefault); CGDataProviderRelease(provider); if (!image) throw rdr::Exception("CGImageCreate"); @@ -136,7 +137,8 @@ void Surface::clear(unsigned char r, unsigned char g, unsigned char b, unsigned } } -void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h) { CGColorSpaceRef lut; @@ -147,32 +149,34 @@ void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) CGContextConcatCTM(fl_gc, CGAffineTransformInvert(CGContextGetCTM(fl_gc))); // macOS Coordinates are from bottom left, not top left - y = Fl_Window::current()->h() - (y + h); + dst_y = Fl_Window::current()->h() - (dst_y + dst_h); lut = cocoa_win_color_space(Fl_Window::current()); render(fl_gc, lut, data, kCGBlendModeCopy, 1.0, - src_x, src_y, width(), height(), x, y, w, h); + src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h); CGColorSpaceRelease(lut); CGContextRestoreGState(fl_gc); } -void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h) { CGContextRef bitmap; bitmap = make_bitmap(dst->width(), dst->height(), dst->data); // macOS Coordinates are from bottom left, not top left - y = dst->height() - (y + h); + dst_y = dst->height() - (dst_y + dst_h); render(bitmap, srgb, data, kCGBlendModeCopy, 1.0, - src_x, src_y, width(), height(), x, y, w, h); + src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h); CGContextRelease(bitmap); } -void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a) +void Surface::blend(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h, int a) { CGColorSpaceRef lut; @@ -183,27 +187,28 @@ void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a) CGContextConcatCTM(fl_gc, CGAffineTransformInvert(CGContextGetCTM(fl_gc))); // macOS Coordinates are from bottom left, not top left - y = Fl_Window::current()->h() - (y + h); + dst_y = Fl_Window::current()->h() - (dst_y + dst_h); lut = cocoa_win_color_space(Fl_Window::current()); render(fl_gc, lut, data, kCGBlendModeNormal, (CGFloat)a/255.0, - src_x, src_y, width(), height(), x, y, w, h); + src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h); CGColorSpaceRelease(lut); CGContextRestoreGState(fl_gc); } -void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a) +void Surface::blend(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h, int a) { CGContextRef bitmap; bitmap = make_bitmap(dst->width(), dst->height(), dst->data); // macOS Coordinates are from bottom left, not top left - y = dst->height() - (y + h); + dst_y = dst->height() - (dst_y + dst_h); render(bitmap, srgb, data, kCGBlendModeNormal, (CGFloat)a/255.0, - src_x, src_y, width(), height(), x, y, w, h); + src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h); CGContextRelease(bitmap); } diff --git a/vncviewer/Surface_Win32.cxx b/vncviewer/Surface_Win32.cxx index d438fa12..46a2b055 100644 --- a/vncviewer/Surface_Win32.cxx +++ b/vncviewer/Surface_Win32.cxx @@ -50,7 +50,8 @@ void Surface::clear(unsigned char r, unsigned char g, unsigned char b, unsigned } } -void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h) { HDC dc; @@ -61,7 +62,8 @@ void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) if (!SelectObject(dc, bitmap)) throw rdr::SystemException("SelectObject", GetLastError()); - if (!BitBlt(fl_gc, x, y, w, h, dc, src_x, src_y, SRCCOPY)) { + if (!BitBlt(fl_gc, dst_x, dst_y, dst_w, dst_h, + dc, src_x, src_y, SRCCOPY)) { // If the desktop we're rendering to is inactive (like when the screen // is locked or the UAC is active), then GDI calls will randomly fail. // This is completely undocumented so we have no idea how best to deal @@ -74,11 +76,12 @@ void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) DeleteDC(dc); } -void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h) { HDC origdc, dstdc; - dstdc = CreateCompatibleDC(NULL); + dstdc = CreateCompatibleDC(nullptr); if (!dstdc) throw rdr::SystemException("CreateCompatibleDC", GetLastError()); @@ -87,29 +90,31 @@ void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int origdc = fl_gc; fl_gc = dstdc; - draw(src_x, src_y, x, y, w, h); + draw(src_x, src_y, dst_x, dst_y, dst_w, dst_h); fl_gc = origdc; DeleteDC(dstdc); } void Surface::blend(int /*src_x*/, int /*src_y*/, - int /*x*/, int /*y*/, int /*w*/, int /*h*/, + int /*dst_x*/, int /*dst_y*/, + int /*dst_w*/, int /*dst_h*/, int /*a*/) { // Compositing doesn't work properly for window DC:s assert(false); } -void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a) +void Surface::blend(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h, int a) { HDC dstdc, srcdc; BLENDFUNCTION blend; - dstdc = CreateCompatibleDC(NULL); + dstdc = CreateCompatibleDC(nullptr); if (!dstdc) throw rdr::SystemException("CreateCompatibleDC", GetLastError()); - srcdc = CreateCompatibleDC(NULL); + srcdc = CreateCompatibleDC(nullptr); if (!srcdc) throw rdr::SystemException("CreateCompatibleDC", GetLastError()); @@ -123,7 +128,8 @@ void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int blend.SourceConstantAlpha = a; blend.AlphaFormat = AC_SRC_ALPHA; - if (!AlphaBlend(dstdc, x, y, w, h, srcdc, src_x, src_y, w, h, blend)) { + if (!AlphaBlend(dstdc, dst_x, dst_y, dst_w, dst_h, + srcdc, src_x, src_y, dst_w, dst_h, blend)) { // If the desktop we're rendering to is inactive (like when the screen // is locked or the UAC is active), then GDI calls will randomly fail. // This is completely undocumented so we have no idea how best to deal @@ -152,8 +158,8 @@ void Surface::alloc() bih.biHeight = -height(); // Negative to get top-down bih.biCompression = BI_RGB; - bitmap = CreateDIBSection(NULL, (BITMAPINFO*)&bih, - DIB_RGB_COLORS, (void**)&data, NULL, 0); + bitmap = CreateDIBSection(nullptr, (BITMAPINFO*)&bih, + DIB_RGB_COLORS, (void**)&data, nullptr, 0); if (!bitmap) throw rdr::SystemException("CreateDIBSection", GetLastError()); } diff --git a/vncviewer/Surface_X11.cxx b/vncviewer/Surface_X11.cxx index 7725cb5b..d27fcd26 100644 --- a/vncviewer/Surface_X11.cxx +++ b/vncviewer/Surface_X11.cxx @@ -43,20 +43,22 @@ void Surface::clear(unsigned char r, unsigned char g, unsigned char b, unsigned 0, 0, width(), height()); } -void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h) { Picture winPict; - winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, NULL); + winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, nullptr); XRenderComposite(fl_display, PictOpSrc, picture, None, winPict, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); XRenderFreePicture(fl_display, winPict); } -void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h) +void Surface::draw(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h) { XRenderComposite(fl_display, PictOpSrc, picture, None, dst->picture, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); } static Picture alpha_mask(int a) @@ -86,27 +88,29 @@ static Picture alpha_mask(int a) return pict; } -void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a) +void Surface::blend(int src_x, int src_y, int dst_x, int dst_y, + int dst_w, int dst_h, int a) { Picture winPict, alpha; - winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, NULL); + winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, nullptr); alpha = alpha_mask(a); XRenderComposite(fl_display, PictOpOver, picture, alpha, winPict, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); XRenderFreePicture(fl_display, winPict); if (alpha != None) XRenderFreePicture(fl_display, alpha); } -void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a) +void Surface::blend(Surface* dst, int src_x, int src_y, + int dst_x, int dst_y, int dst_w, int dst_h, int a) { Picture alpha; alpha = alpha_mask(a); XRenderComposite(fl_display, PictOpOver, picture, alpha, dst->picture, - src_x, src_y, 0, 0, x, y, w, h); + src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h); if (alpha != None) XRenderFreePicture(fl_display, alpha); } @@ -154,7 +158,7 @@ void Surface::alloc() if (!format) throw rdr::Exception("XRenderFindFormat"); - picture = XRenderCreatePicture(fl_display, pixmap, format, 0, NULL); + picture = XRenderCreatePicture(fl_display, pixmap, format, 0, nullptr); visFormat = XRenderFindVisualFormat(fl_display, fl_visual->visual); } @@ -177,8 +181,8 @@ void Surface::update(const Fl_RGB_Image* image) assert(image->w() == width()); assert(image->h() == height()); - img = XCreateImage(fl_display, CopyFromParent, 32, - ZPixmap, 0, NULL, width(), height(), + img = XCreateImage(fl_display, (Visual*)CopyFromParent, 32, + ZPixmap, 0, nullptr, width(), height(), 32, 0); if (!img) throw rdr::Exception("XCreateImage"); @@ -224,7 +228,7 @@ void Surface::update(const Fl_RGB_Image* image) in += image->ld() - image->w() * image->d(); } - gc = XCreateGC(fl_display, pixmap, 0, NULL); + gc = XCreateGC(fl_display, pixmap, 0, nullptr); XPutImage(fl_display, pixmap, gc, img, 0, 0, 0, 0, img->width, img->height); XFreeGC(fl_display, gc); diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx index 7f8b3c8e..a3767857 100644 --- a/vncviewer/UserDialog.cxx +++ b/vncviewer/UserDialog.cxx @@ -31,6 +31,7 @@ #include <FL/Fl_Input.H> #include <FL/Fl_Secret_Input.H> #include <FL/Fl_Button.H> +#include <FL/Fl_Check_Button.H> #include <FL/Fl_Return_Button.H> #include <FL/Fl_Pixmap.H> @@ -55,10 +56,10 @@ using namespace rfb; static Fl_Pixmap secure_icon(secure); static Fl_Pixmap insecure_icon(insecure); -static int ret_val = 0; +static long ret_val = 0; -static void button_cb(Fl_Widget *widget, void *val) { - ret_val = (fl_intptr_t)val; +static void button_cb(Fl_Widget *widget, long val) { + ret_val = val; widget->window()->hide(); } @@ -70,7 +71,13 @@ UserDialog::~UserDialog() { } -void UserDialog::getUserPasswd(bool secure, std::string* user, +void UserDialog::resetPassword() +{ + savedUsername.clear(); + savedPassword.clear(); +} + +void UserDialog::getUserPasswd(bool secure_, std::string* user, std::string* password) { const char *passwordFileName(passwordFile); @@ -90,6 +97,17 @@ void UserDialog::getUserPasswd(bool secure, std::string* user, return; } + if (user && !savedUsername.empty() && !savedPassword.empty()) { + *user = savedUsername; + *password = savedPassword; + return; + } + + if (!user && !savedPassword.empty()) { + *password = savedPassword; + return; + } + if (!user && passwordFileName[0]) { std::vector<uint8_t> obfPwd(256); FILE* fp; @@ -112,16 +130,17 @@ void UserDialog::getUserPasswd(bool secure, std::string* user, Fl_Secret_Input *passwd; Fl_Box *icon; Fl_Button *button; + Fl_Check_Button *keepPasswdCheckbox; int x, y; win = new Fl_Window(410, 0, _("VNC authentication")); - win->callback(button_cb,(void *)0); + win->callback(button_cb, 0); banner = new Fl_Box(0, 0, win->w(), 20); banner->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE|FL_ALIGN_IMAGE_NEXT_TO_TEXT); banner->box(FL_FLAT_BOX); - if (secure) { + if (secure_) { banner->label(_("This connection is secure")); banner->color(FL_GREEN); banner->image(secure_icon); @@ -156,7 +175,7 @@ void UserDialog::getUserPasswd(bool secure, std::string* user, * Compiler is not bright enough to understand that * username won't be used further down... */ - username = NULL; + username = nullptr; } y += INPUT_LABEL_OFFSET; @@ -165,18 +184,28 @@ void UserDialog::getUserPasswd(bool secure, std::string* user, passwd->align(FL_ALIGN_LEFT | FL_ALIGN_TOP); y += INPUT_HEIGHT + INNER_MARGIN; + if (reconnectOnError) { + keepPasswdCheckbox = new Fl_Check_Button(LBLRIGHT(x, y, + CHECK_MIN_WIDTH, + CHECK_HEIGHT, + _("Keep password for reconnect"))); + y += CHECK_HEIGHT + INNER_MARGIN; + } else { + keepPasswdCheckbox = nullptr; + } + x = win->w() - OUTER_MARGIN; y += OUTER_MARGIN - INNER_MARGIN; x -= BUTTON_WIDTH; button = new Fl_Return_Button(x, y, BUTTON_WIDTH, BUTTON_HEIGHT, fl_ok); - button->callback(button_cb, (void*)0); + button->callback(button_cb, 0); x -= INNER_MARGIN; x -= BUTTON_WIDTH; button = new Fl_Button(x, y, BUTTON_WIDTH, BUTTON_HEIGHT, fl_cancel); - button->callback(button_cb, (void*)1); + button->callback(button_cb, 1); button->shortcut(FL_Escape); x -= INNER_MARGIN; @@ -196,15 +225,27 @@ void UserDialog::getUserPasswd(bool secure, std::string* user, while (win->shown()) Fl::wait(); if (ret_val == 0) { - if (user) + bool keepPasswd; + + if (reconnectOnError) + keepPasswd = keepPasswdCheckbox->value(); + else + keepPasswd = false; + + if (user) { *user = username->value(); + if (keepPasswd) + savedUsername = username->value(); + } *password = passwd->value(); + if (keepPasswd) + savedPassword = passwd->value(); } delete win; if (ret_val != 0) - throw rfb::Exception(_("Authentication cancelled")); + throw rfb::AuthCancelledException(); } bool UserDialog::showMsgBox(int flags, const char* title, const char* text) @@ -221,9 +262,9 @@ bool UserDialog::showMsgBox(int flags, const char* title, const char* text) switch (flags & 0xf) { case M_OKCANCEL: - return fl_choice("%s", NULL, fl_ok, fl_cancel, buffer) == 1; + return fl_choice("%s", nullptr, fl_ok, fl_cancel, buffer) == 1; case M_YESNO: - return fl_choice("%s", NULL, fl_yes, fl_no, buffer) == 1; + return fl_choice("%s", nullptr, fl_yes, fl_no, buffer) == 1; case M_OK: default: if (((flags & 0xf0) == M_ICONERROR) || diff --git a/vncviewer/UserDialog.h b/vncviewer/UserDialog.h index 913af841..aa50127e 100644 --- a/vncviewer/UserDialog.h +++ b/vncviewer/UserDialog.h @@ -32,11 +32,17 @@ public: // UserPasswdGetter callbacks void getUserPasswd(bool secure, std::string* user, - std::string* password); + std::string* password) override; // UserMsgBox callbacks - bool showMsgBox(int flags, const char* title, const char* text); + bool showMsgBox(int flags, const char* title, const char* text) override; + + void resetPassword(); + + private: + std::string savedUsername; + std::string savedPassword; }; #endif diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 5dd5f7ef..b0778505 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -116,13 +116,13 @@ static const WORD SCAN_FAKE = 0xaa; #endif Viewport::Viewport(int w, int h, const rfb::PixelFormat& /*serverPF*/, CConn* cc_) - : Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL), + : Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(nullptr), lastPointerPos(0, 0), lastButtonMask(0), #ifdef WIN32 altGrArmed(false), #endif firstLEDState(true), pendingClientClipboard(false), - menuCtrlKey(false), menuAltKey(false), cursor(NULL) + menuCtrlKey(false), menuAltKey(false), cursor(nullptr) { #if !defined(WIN32) && !defined(__APPLE__) XkbDescPtr xkb; @@ -188,7 +188,7 @@ Viewport::Viewport(int w, int h, const rfb::PixelFormat& /*serverPF*/, CConn* cc OptionsDialog::addCallback(handleOptions, this); // Make sure we have an initial blank cursor set - setCursor(0, 0, rfb::Point(0, 0), NULL); + setCursor(0, 0, rfb::Point(0, 0), nullptr); } @@ -329,9 +329,9 @@ void Viewport::handleClipboardData(const char* data) Fl::copy(data, len, 1); } -void Viewport::setLEDState(unsigned int state) +void Viewport::setLEDState(unsigned int ledState) { - vlog.debug("Got server LED state: 0x%08x", state); + vlog.debug("Got server LED state: 0x%08x", ledState); // The first message is just considered to be the server announcing // support for this extension. We will push our state to sync up the @@ -355,7 +355,7 @@ void Viewport::setLEDState(unsigned int state) memset(input, 0, sizeof(input)); count = 0; - if (!!(state & ledCapsLock) != !!(GetKeyState(VK_CAPITAL) & 0x1)) { + if (!!(ledState & ledCapsLock) != !!(GetKeyState(VK_CAPITAL) & 0x1)) { input[count].type = input[count+1].type = INPUT_KEYBOARD; input[count].ki.wVk = input[count+1].ki.wVk = VK_CAPITAL; input[count].ki.wScan = input[count+1].ki.wScan = SCAN_FAKE; @@ -364,7 +364,7 @@ void Viewport::setLEDState(unsigned int state) count += 2; } - if (!!(state & ledNumLock) != !!(GetKeyState(VK_NUMLOCK) & 0x1)) { + if (!!(ledState & ledNumLock) != !!(GetKeyState(VK_NUMLOCK) & 0x1)) { input[count].type = input[count+1].type = INPUT_KEYBOARD; input[count].ki.wVk = input[count+1].ki.wVk = VK_NUMLOCK; input[count].ki.wScan = input[count+1].ki.wScan = SCAN_FAKE; @@ -373,7 +373,7 @@ void Viewport::setLEDState(unsigned int state) count += 2; } - if (!!(state & ledScrollLock) != !!(GetKeyState(VK_SCROLL) & 0x1)) { + if (!!(ledState & ledScrollLock) != !!(GetKeyState(VK_SCROLL) & 0x1)) { input[count].type = input[count+1].type = INPUT_KEYBOARD; input[count].ki.wVk = input[count+1].ki.wVk = VK_SCROLL; input[count].ki.wScan = input[count+1].ki.wScan = SCAN_FAKE; @@ -391,13 +391,13 @@ void Viewport::setLEDState(unsigned int state) #elif defined(__APPLE__) int ret; - ret = cocoa_set_caps_lock_state(state & ledCapsLock); + ret = cocoa_set_caps_lock_state(ledState & ledCapsLock); if (ret != 0) { vlog.error(_("Failed to update keyboard LED state: %d"), ret); return; } - ret = cocoa_set_num_lock_state(state & ledNumLock); + ret = cocoa_set_num_lock_state(ledState & ledNumLock); if (ret != 0) { vlog.error(_("Failed to update keyboard LED state: %d"), ret); return; @@ -414,17 +414,17 @@ void Viewport::setLEDState(unsigned int state) affect = values = 0; affect |= LockMask; - if (state & ledCapsLock) + if (ledState & ledCapsLock) values |= LockMask; mask = getModifierMask(XK_Num_Lock); affect |= mask; - if (state & ledNumLock) + if (ledState & ledNumLock) values |= mask; mask = getModifierMask(XK_Scroll_Lock); affect |= mask; - if (state & ledScrollLock) + if (ledState & ledScrollLock) values |= mask; ret = XkbLockModifiers(fl_display, XkbUseCoreKbd, affect, values); @@ -435,21 +435,21 @@ void Viewport::setLEDState(unsigned int state) void Viewport::pushLEDState() { - unsigned int state; + unsigned int ledState; // Server support? if (cc->server.ledState() == ledUnknown) return; - state = 0; + ledState = 0; #if defined(WIN32) if (GetKeyState(VK_CAPITAL) & 0x1) - state |= ledCapsLock; + ledState |= ledCapsLock; if (GetKeyState(VK_NUMLOCK) & 0x1) - state |= ledNumLock; + ledState |= ledNumLock; if (GetKeyState(VK_SCROLL) & 0x1) - state |= ledScrollLock; + ledState |= ledScrollLock; #elif defined(__APPLE__) int ret; bool on; @@ -460,7 +460,7 @@ void Viewport::pushLEDState() return; } if (on) - state |= ledCapsLock; + ledState |= ledCapsLock; ret = cocoa_get_num_lock_state(&on); if (ret != 0) { @@ -468,10 +468,10 @@ void Viewport::pushLEDState() return; } if (on) - state |= ledNumLock; + ledState |= ledNumLock; // No support for Scroll Lock // - state |= (cc->server.ledState() & ledScrollLock); + ledState |= (cc->server.ledState() & ledScrollLock); #else unsigned int mask; @@ -486,28 +486,28 @@ void Viewport::pushLEDState() } if (xkbState.locked_mods & LockMask) - state |= ledCapsLock; + ledState |= ledCapsLock; mask = getModifierMask(XK_Num_Lock); if (xkbState.locked_mods & mask) - state |= ledNumLock; + ledState |= ledNumLock; mask = getModifierMask(XK_Scroll_Lock); if (xkbState.locked_mods & mask) - state |= ledScrollLock; + ledState |= ledScrollLock; #endif - if ((state & ledCapsLock) != (cc->server.ledState() & ledCapsLock)) { + if ((ledState & ledCapsLock) != (cc->server.ledState() & ledCapsLock)) { vlog.debug("Inserting fake CapsLock to get in sync with server"); handleKeyPress(0x3a, XK_Caps_Lock); handleKeyRelease(0x3a); } - if ((state & ledNumLock) != (cc->server.ledState() & ledNumLock)) { + if ((ledState & ledNumLock) != (cc->server.ledState() & ledNumLock)) { vlog.debug("Inserting fake NumLock to get in sync with server"); handleKeyPress(0x45, XK_Num_Lock); handleKeyRelease(0x45); } - if ((state & ledScrollLock) != (cc->server.ledState() & ledScrollLock)) { + if ((ledState & ledScrollLock) != (cc->server.ledState() & ledScrollLock)) { vlog.debug("Inserting fake ScrollLock to get in sync with server"); handleKeyPress(0x46, XK_Scroll_Lock); handleKeyRelease(0x46); @@ -660,7 +660,7 @@ int Viewport::handle(int event) return Fl_Widget::handle(event); } -void Viewport::sendPointerEvent(const rfb::Point& pos, int buttonMask) +void Viewport::sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask) { if (viewOnly) return; @@ -702,7 +702,7 @@ unsigned int Viewport::getModifierMask(unsigned int keysym) mask = 0; xkb = XkbGetMap(fl_display, XkbAllComponentsMask, XkbUseCoreKbd); - if (xkb == NULL) + if (xkb == nullptr) return 0; for (keycode = xkb->min_key_code; keycode <= xkb->max_key_code; keycode++) { @@ -722,7 +722,7 @@ unsigned int Viewport::getModifierMask(unsigned int keysym) goto out; act = XkbKeyAction(xkb, keycode, 0); - if (act == NULL) + if (act == nullptr) goto out; if (act->type != XkbSA_LockMods) goto out; @@ -790,7 +790,7 @@ void Viewport::flushPendingClipboard() } -void Viewport::handlePointerEvent(const rfb::Point& pos, int buttonMask) +void Viewport::handlePointerEvent(const rfb::Point& pos, uint8_t buttonMask) { filterPointerEvent(pos, buttonMask); } @@ -1164,7 +1164,7 @@ int Viewport::handleSystemEvent(void *event, void *data) if (keycode == 0) keycode = 0x100 | xevent->xkey.keycode; - XLookupString(&xevent->xkey, &str, 1, &keysym, NULL); + XLookupString(&xevent->xkey, &str, 1, &keysym, nullptr); if (keysym == NoSymbol) { vlog.error(_("No symbol for key code %d (in the current state)"), (int)xevent->xkey.keycode); @@ -1222,52 +1222,56 @@ void Viewport::resolveAltGrDetection(bool isAltGrSequence) } #endif +// FIXME: gcc confuses ID_DISCONNECT with NULL +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" void Viewport::initContextMenu() { contextMenu->clear(); fltk_menu_add(contextMenu, p_("ContextMenu|", "Disconn&ect"), - 0, NULL, (void*)ID_DISCONNECT, FL_MENU_DIVIDER); + 0, nullptr, (void*)ID_DISCONNECT, FL_MENU_DIVIDER); fltk_menu_add(contextMenu, p_("ContextMenu|", "&Full screen"), - 0, NULL, (void*)ID_FULLSCREEN, + 0, nullptr, (void*)ID_FULLSCREEN, FL_MENU_TOGGLE | (window()->fullscreen_active()?FL_MENU_VALUE:0)); fltk_menu_add(contextMenu, p_("ContextMenu|", "Minimi&ze"), - 0, NULL, (void*)ID_MINIMIZE, 0); + 0, nullptr, (void*)ID_MINIMIZE, 0); fltk_menu_add(contextMenu, p_("ContextMenu|", "Resize &window to session"), - 0, NULL, (void*)ID_RESIZE, + 0, nullptr, (void*)ID_RESIZE, (window()->fullscreen_active()?FL_MENU_INACTIVE:0) | FL_MENU_DIVIDER); fltk_menu_add(contextMenu, p_("ContextMenu|", "&Ctrl"), - 0, NULL, (void*)ID_CTRL, + 0, nullptr, (void*)ID_CTRL, FL_MENU_TOGGLE | (menuCtrlKey?FL_MENU_VALUE:0)); fltk_menu_add(contextMenu, p_("ContextMenu|", "&Alt"), - 0, NULL, (void*)ID_ALT, + 0, nullptr, (void*)ID_ALT, FL_MENU_TOGGLE | (menuAltKey?FL_MENU_VALUE:0)); if (menuKeySym) { char sendMenuKey[64]; snprintf(sendMenuKey, 64, p_("ContextMenu|", "Send %s"), (const char *)menuKey); - fltk_menu_add(contextMenu, sendMenuKey, 0, NULL, (void*)ID_MENUKEY, 0); - fltk_menu_add(contextMenu, "Secret shortcut menu key", menuKeyFLTK, NULL, + fltk_menu_add(contextMenu, sendMenuKey, 0, nullptr, (void*)ID_MENUKEY, 0); + fltk_menu_add(contextMenu, "Secret shortcut menu key", + menuKeyFLTK, nullptr, (void*)ID_MENUKEY, FL_MENU_INVISIBLE); } fltk_menu_add(contextMenu, p_("ContextMenu|", "Send Ctrl-Alt-&Del"), - 0, NULL, (void*)ID_CTRLALTDEL, FL_MENU_DIVIDER); + 0, nullptr, (void*)ID_CTRLALTDEL, FL_MENU_DIVIDER); fltk_menu_add(contextMenu, p_("ContextMenu|", "&Refresh screen"), - 0, NULL, (void*)ID_REFRESH, FL_MENU_DIVIDER); + 0, nullptr, (void*)ID_REFRESH, FL_MENU_DIVIDER); fltk_menu_add(contextMenu, p_("ContextMenu|", "&Options..."), - 0, NULL, (void*)ID_OPTIONS, 0); + 0, nullptr, (void*)ID_OPTIONS, 0); fltk_menu_add(contextMenu, p_("ContextMenu|", "Connection &info..."), - 0, NULL, (void*)ID_INFO, 0); + 0, nullptr, (void*)ID_INFO, 0); fltk_menu_add(contextMenu, p_("ContextMenu|", "About &TigerVNC viewer..."), - 0, NULL, (void*)ID_ABOUT, 0); + 0, nullptr, (void*)ID_ABOUT, 0); } - +#pragma GCC diagnostic pop void Viewport::popupContextMenu() { @@ -1297,7 +1301,7 @@ void Viewport::popupContextMenu() if (Fl::belowmouse()) window()->cursor(cursor, cursorHotspot.x, cursorHotspot.y); - if (m == NULL) + if (m == nullptr) return; switch (m->argument()) { diff --git a/vncviewer/Viewport.h b/vncviewer/Viewport.h index 4b674aa1..5f4c1ca7 100644 --- a/vncviewer/Viewport.h +++ b/vncviewer/Viewport.h @@ -63,14 +63,14 @@ public: // Fl_Widget callback methods - void draw(); + void draw() override; - void resize(int x, int y, int w, int h); + void resize(int x, int y, int w, int h) override; - int handle(int event); + int handle(int event) override; protected: - virtual void sendPointerEvent(const rfb::Point& pos, int buttonMask); + void sendPointerEvent(const rfb::Point& pos, uint8_t buttonMask) override; private: bool hasFocus(); @@ -81,7 +81,7 @@ private: void flushPendingClipboard(); - void handlePointerEvent(const rfb::Point& pos, int buttonMask); + void handlePointerEvent(const rfb::Point& pos, uint8_t buttonMask); static void handlePointerTimeout(void *data); void resetKeyboard(); @@ -111,7 +111,7 @@ private: PlatformPixelBuffer* frameBuffer; rfb::Point lastPointerPos; - int lastButtonMask; + uint8_t lastButtonMask; typedef std::map<int, uint32_t> DownMap; DownMap downKeySym; diff --git a/vncviewer/Win32TouchHandler.cxx b/vncviewer/Win32TouchHandler.cxx index d6dc7aa4..e21768f9 100644 --- a/vncviewer/Win32TouchHandler.cxx +++ b/vncviewer/Win32TouchHandler.cxx @@ -37,13 +37,13 @@ static const DWORD MOUSEMOVE_FLAGS = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | static const unsigned SINGLE_PAN_THRESHOLD = 50; -Win32TouchHandler::Win32TouchHandler(HWND hWnd) : - hWnd(hWnd), gesturesConfigured(false), gestureActive(false), +Win32TouchHandler::Win32TouchHandler(HWND hWnd_) : + hWnd(hWnd_), gesturesConfigured(false), gestureActive(false), ignoringGesture(false), fakeButtonMask(0) { // If window is registered as touch we can not receive gestures, // this should not happen - if (IsTouchWindow(hWnd, NULL)) + if (IsTouchWindow(hWnd, nullptr)) throw rfb::Exception(_("Window is registered for touch instead of gestures")); // We will not receive any touch/gesture events if this service diff --git a/vncviewer/Win32TouchHandler.h b/vncviewer/Win32TouchHandler.h index 05039c88..a0554ccd 100644 --- a/vncviewer/Win32TouchHandler.h +++ b/vncviewer/Win32TouchHandler.h @@ -35,11 +35,11 @@ class Win32TouchHandler: public BaseTouchHandler { bool isSinglePan(GESTUREINFO gi); protected: - virtual void fakeMotionEvent(const GestureEvent origEvent); - virtual void fakeButtonEvent(bool press, int button, - const GestureEvent origEvent); - virtual void fakeKeyEvent(bool press, int keycode, - const GestureEvent origEvent); + void fakeMotionEvent(const GestureEvent origEvent) override; + void fakeButtonEvent(bool press, int button, + const GestureEvent origEvent) override; + void fakeKeyEvent(bool press, int keycode, + const GestureEvent origEvent) override; private: void pushFakeEvent(UINT Msg, WPARAM wParam, LPARAM lParam); diff --git a/vncviewer/XInputTouchHandler.cxx b/vncviewer/XInputTouchHandler.cxx index 6203bda5..2b2e02c6 100644 --- a/vncviewer/XInputTouchHandler.cxx +++ b/vncviewer/XInputTouchHandler.cxx @@ -43,8 +43,8 @@ static rfb::LogWriter vlog("XInputTouchHandler"); static bool grabbed = false; -XInputTouchHandler::XInputTouchHandler(Window wnd) - : wnd(wnd), fakeStateMask(0) +XInputTouchHandler::XInputTouchHandler(Window wnd_) + : wnd(wnd_), fakeStateMask(0) { XIEventMask eventmask; unsigned char flags[XIMaskLen(XI_LASTEVENT)] = { 0 }; @@ -97,7 +97,7 @@ bool XInputTouchHandler::grabPointer() // We grab for the same events as the window is currently interested in curmasks = XIGetSelectedEvents(fl_display, wnd, &num_masks); - if (curmasks == NULL) { + if (curmasks == nullptr) { if (num_masks == -1) vlog.error(_("Unable to get X Input 2 event mask for window 0x%08lx"), wnd); else @@ -314,7 +314,7 @@ void XInputTouchHandler::preparePointerEvent(XEvent* dst, const GestureEvent src { Window root, child; int rootX, rootY; - XkbStateRec state; + XkbStateRec xkbState; // We don't have a real event to steal things from, so we'll have // to fake these events based on the current state of things @@ -324,7 +324,7 @@ void XInputTouchHandler::preparePointerEvent(XEvent* dst, const GestureEvent src src.eventX, src.eventY, &rootX, &rootY, &child); - XkbGetState(fl_display, XkbUseCoreKbd, &state); + XkbGetState(fl_display, XkbUseCoreKbd, &xkbState); // XButtonEvent and XMotionEvent are almost identical, so we // don't have to care which it is for these fields @@ -338,8 +338,8 @@ void XInputTouchHandler::preparePointerEvent(XEvent* dst, const GestureEvent src dst->xbutton.y = src.eventY; dst->xbutton.x_root = rootX; dst->xbutton.y_root = rootY; - dst->xbutton.state = state.mods; - dst->xbutton.state |= ((state.ptr_buttons >> 1) & 0x1f) << 8; + dst->xbutton.state = xkbState.mods; + dst->xbutton.state |= ((xkbState.ptr_buttons >> 1) & 0x1f) << 8; dst->xbutton.same_screen = True; } @@ -390,7 +390,7 @@ void XInputTouchHandler::fakeKeyEvent(bool press, int keysym, Window root, child; int rootX, rootY; - XkbStateRec state; + XkbStateRec xkbState; int modmask; @@ -399,7 +399,7 @@ void XInputTouchHandler::fakeKeyEvent(bool press, int keysym, origEvent.eventX, origEvent.eventY, &rootX, &rootY, &child); - XkbGetState(fl_display, XkbUseCoreKbd, &state); + XkbGetState(fl_display, XkbUseCoreKbd, &xkbState); KeyCode kc = XKeysymToKeycode(fl_display, keysym); @@ -418,8 +418,8 @@ void XInputTouchHandler::fakeKeyEvent(bool press, int keysym, fakeEvent.xkey.y = origEvent.eventY; fakeEvent.xkey.x_root = rootX; fakeEvent.xkey.y_root = rootY; - fakeEvent.xkey.state = state.mods; - fakeEvent.xkey.state |= ((state.ptr_buttons >> 1) & 0x1f) << 8; + fakeEvent.xkey.state = xkbState.mods; + fakeEvent.xkey.state |= ((xkbState.ptr_buttons >> 1) & 0x1f) << 8; fakeEvent.xkey.same_screen = True; // Apply our fake mask diff --git a/vncviewer/XInputTouchHandler.h b/vncviewer/XInputTouchHandler.h index 6360b974..897c55ae 100644 --- a/vncviewer/XInputTouchHandler.h +++ b/vncviewer/XInputTouchHandler.h @@ -39,13 +39,13 @@ class XInputTouchHandler: public BaseTouchHandler, GestureHandler { const XIDeviceEvent* origEvent); void preparePointerEvent(XEvent* dst, const GestureEvent src); - virtual void fakeMotionEvent(const GestureEvent origEvent); - virtual void fakeButtonEvent(bool press, int button, - const GestureEvent origEvent); - virtual void fakeKeyEvent(bool press, int keycode, - const GestureEvent origEvent); + void fakeMotionEvent(const GestureEvent origEvent) override; + void fakeButtonEvent(bool press, int button, + const GestureEvent origEvent) override; + void fakeKeyEvent(bool press, int keycode, + const GestureEvent origEvent) override; - virtual void handleGestureEvent(const GestureEvent& event); + void handleGestureEvent(const GestureEvent& event) override; private: void pushFakeEvent(XEvent* event); diff --git a/vncviewer/cocoa.mm b/vncviewer/cocoa.mm index d801a106..a355b484 100644 --- a/vncviewer/cocoa.mm +++ b/vncviewer/cocoa.mm @@ -301,7 +301,7 @@ static NSString *key_translate(UInt16 keyCode, UInt32 modifierFlags) const UCKeyboardLayout *layout; OSStatus err; - layout = NULL; + layout = nullptr; TISInputSourceRef keyboard; CFDataRef uchr; @@ -309,11 +309,11 @@ static NSString *key_translate(UInt16 keyCode, UInt32 modifierFlags) keyboard = TISCopyCurrentKeyboardLayoutInputSource(); uchr = (CFDataRef)TISGetInputSourceProperty(keyboard, kTISPropertyUnicodeKeyLayoutData); - if (uchr == NULL) + if (uchr == nullptr) return nil; layout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr); - if (layout == NULL) + if (layout == nullptr) return nil; UInt32 dead_state; diff --git a/vncviewer/fltk/Fl_Monitor_Arrangement.cxx b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx index 7c72ff68..02011e1f 100644 --- a/vncviewer/fltk/Fl_Monitor_Arrangement.cxx +++ b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx @@ -379,7 +379,7 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m) Fl::screen_xywh(x, y, w, h, m); - EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsCallback, + EnumDisplayMonitors(nullptr, nullptr, EnumDisplayMonitorsCallback, (LPARAM)&sys_monitors); for (iter = sys_monitors.begin(); iter != sys_monitors.end(); ++iter) { @@ -441,11 +441,11 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m) info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName); - if (info == NULL) + if (info == nullptr) return ""; dict = (CFDictionaryRef) CFDictionaryGetValue(info, CFSTR(kDisplayProductName)); - if (dict == NULL) { + if (dict == nullptr) { CFRelease(info); return ""; } @@ -454,7 +454,7 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m) if (dict_len > 0) { CFTypeRef * names = new CFTypeRef[dict_len]; - CFDictionaryGetKeysAndValues(dict, NULL, (const void **) names); + CFDictionaryGetKeysAndValues(dict, nullptr, (const void **) names); if (names[0]) { @@ -496,7 +496,7 @@ std::string Fl_Monitor_Arrangement::get_monitor_name(int m) std::string name; fl_open_display(); - assert(fl_display != NULL); + assert(fl_display != nullptr); Fl::screen_xywh(x, y, w, h, m); if (!XQueryExtension(fl_display, "RANDR", &xi_major, &ev, &err)) diff --git a/vncviewer/fltk/Fl_Monitor_Arrangement.h b/vncviewer/fltk/Fl_Monitor_Arrangement.h index c71dd199..d8bf582b 100644 --- a/vncviewer/fltk/Fl_Monitor_Arrangement.h +++ b/vncviewer/fltk/Fl_Monitor_Arrangement.h @@ -45,7 +45,7 @@ public: int value(std::set<int> indices); protected: - virtual void draw(); + void draw() override; private: const Fl_Color AVAILABLE_COLOR; diff --git a/vncviewer/fltk/Fl_Navigation.cxx b/vncviewer/fltk/Fl_Navigation.cxx index 603c69ce..d3117aae 100644 --- a/vncviewer/fltk/Fl_Navigation.cxx +++ b/vncviewer/fltk/Fl_Navigation.cxx @@ -72,7 +72,7 @@ Fl_Widget *Fl_Navigation::value() return pages->child(i); } - return NULL; + return nullptr; } int Fl_Navigation::value(Fl_Widget *newpage) @@ -145,7 +145,7 @@ void Fl_Navigation::update_labels() int i, offset; labels->clear(); - labels->resizable(NULL); + labels->resizable(nullptr); if (!pages->children()) return; diff --git a/vncviewer/fltk/Fl_Navigation.h b/vncviewer/fltk/Fl_Navigation.h index 7f5e44ac..44515691 100644 --- a/vncviewer/fltk/Fl_Navigation.h +++ b/vncviewer/fltk/Fl_Navigation.h @@ -38,7 +38,7 @@ public: void client_area(int &rx, int &ry, int &rw, int &rh, int lw); - virtual void draw(); + void draw() override; // Delegation to underlying widget void begin(); diff --git a/vncviewer/fltk/theme.cxx b/vncviewer/fltk/theme.cxx index 22e04dc6..2b37fb6e 100644 --- a/vncviewer/fltk/theme.cxx +++ b/vncviewer/fltk/theme.cxx @@ -313,10 +313,10 @@ void init_theme() CTFontRef font; CFStringRef name; - font = CTFontCreateUIFontForLanguage(kCTFontSystemFontType, 0.0, NULL); - if (font != NULL) { + font = CTFontCreateUIFontForLanguage(kCTFontSystemFontType, 0.0, nullptr); + if (font != nullptr) { name = CTFontCopyFullName(font); - if (name != NULL) { + if (name != nullptr) { CFStringGetCString(name, font_name, sizeof(font_name), kCFStringEncodingUTF8); diff --git a/vncviewer/fltk/util.h b/vncviewer/fltk/util.h index 87765396..9ce3c7aa 100644 --- a/vncviewer/fltk/util.h +++ b/vncviewer/fltk/util.h @@ -97,7 +97,7 @@ static inline size_t fltk_menu_escape(const char *in, char *out, size_t maxlen) /* Helper to add menu entries safely */ static inline void fltk_menu_add(Fl_Menu_ *menu, const char *text, int shortcut, Fl_Callback *cb, - void *data = 0, int flags = 0) + void *data=nullptr, int flags=0) { char buffer[1024]; diff --git a/vncviewer/gettext.h b/vncviewer/gettext.h index 768a6995..09473d97 100644 --- a/vncviewer/gettext.h +++ b/vncviewer/gettext.h @@ -120,7 +120,7 @@ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ - pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) + pgettext_aux (nullptr, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) @@ -131,7 +131,7 @@ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) + npgettext_aux (nullptr, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) @@ -197,7 +197,7 @@ npgettext_aux (const char *domain, #endif #define pgettext_expr(Msgctxt, Msgid) \ - dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) + dcpgettext_expr (nullptr, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) @@ -224,7 +224,7 @@ dcpgettext_expr (const char *domain, (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); - if (msg_ctxt_id != NULL) + if (msg_ctxt_id != nullptr) #endif { int found_translation; @@ -244,7 +244,7 @@ dcpgettext_expr (const char *domain, } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ - dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + dcnpgettext_expr (nullptr, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) @@ -272,7 +272,7 @@ dcnpgettext_expr (const char *domain, (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); - if (msg_ctxt_id != NULL) + if (msg_ctxt_id != nullptr) #endif { int found_translation; diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx index 15ea4ee8..a03623db 100644 --- a/vncviewer/parameters.cxx +++ b/vncviewer/parameters.cxx @@ -214,7 +214,7 @@ static VoidParameter* readOnlyParameterArray[] = { }; // Encoding Table -static struct { +static const struct EscapeMap { const char first; const char second; } replaceMap[] = { { '\n', 'n' }, @@ -230,15 +230,15 @@ static bool encodeValue(const char* val, char* dest, size_t destSize) { // Check for sequences which will need encoding normalCharacter = true; - for (size_t j = 0; j < sizeof(replaceMap)/sizeof(replaceMap[0]); j++) { + for (EscapeMap esc : replaceMap) { - if (val[i] == replaceMap[j].first) { + if (val[i] == esc.first) { dest[pos] = '\\'; pos++; if (pos >= destSize) return false; - dest[pos] = replaceMap[j].second; + dest[pos] = esc.second; normalCharacter = false; break; } @@ -269,9 +269,9 @@ static bool decodeValue(const char* val, char* dest, size_t destSize) { bool escapedCharacter; escapedCharacter = false; - for (size_t j = 0; j < sizeof(replaceMap)/sizeof(replaceMap[0]); j++) { - if (val[i+1] == replaceMap[j].second) { - dest[pos] = replaceMap[j].first; + for (EscapeMap esc : replaceMap) { + if (val[i+1] == esc.second) { + dest[pos] = esc.first; escapedCharacter = true; i++; break; @@ -350,7 +350,7 @@ static bool getKeyString(const char* _name, char* dest, size_t destSize, HKEY* h value = new WCHAR[destSize]; valuesize = destSize; - LONG res = RegQueryValueExW(*hKey, name, 0, NULL, (LPBYTE)value, &valuesize); + LONG res = RegQueryValueExW(*hKey, name, nullptr, nullptr, (LPBYTE)value, &valuesize); if (res != ERROR_SUCCESS){ delete [] value; if (res != ERROR_FILE_NOT_FOUND) @@ -388,7 +388,7 @@ static bool getKeyInt(const char* _name, int* dest, HKEY* hKey) { if (size >= buffersize) throw Exception(_("The name of the parameter is too large")); - LONG res = RegQueryValueExW(*hKey, name, 0, NULL, (LPBYTE)&value, &dwordsize); + LONG res = RegQueryValueExW(*hKey, name, nullptr, nullptr, (LPBYTE)&value, &dwordsize); if (res != ERROR_SUCCESS){ if (res != ERROR_FILE_NOT_FOUND) throw rdr::SystemException("RegQueryValueExW", res); @@ -420,9 +420,9 @@ static void removeValue(const char* _name, HKEY* hKey) { void saveHistoryToRegKey(const vector<string>& serverHistory) { HKEY hKey; LONG res = RegCreateKeyExW(HKEY_CURRENT_USER, - L"Software\\TigerVNC\\vncviewer\\history", 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, - &hKey, NULL); + L"Software\\TigerVNC\\vncviewer\\history", 0, nullptr, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, + &hKey, nullptr); if (res != ERROR_SUCCESS) throw rdr::SystemException(_("Failed to create registry key"), res); @@ -452,9 +452,9 @@ static void saveToReg(const char* servername) { HKEY hKey; LONG res = RegCreateKeyExW(HKEY_CURRENT_USER, - L"Software\\TigerVNC\\vncviewer", 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, - &hKey, NULL); + L"Software\\TigerVNC\\vncviewer", 0, nullptr, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, + &hKey, nullptr); if (res != ERROR_SUCCESS) throw rdr::SystemException(_("Failed to create registry key"), res); @@ -468,11 +468,11 @@ static void saveToReg(const char* servername) { for (size_t i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) { try { - if (dynamic_cast<StringParameter*>(parameterArray[i]) != NULL) { + if (dynamic_cast<StringParameter*>(parameterArray[i]) != nullptr) { setKeyString(parameterArray[i]->getName(), *(StringParameter*)parameterArray[i], &hKey); - } else if (dynamic_cast<IntParameter*>(parameterArray[i]) != NULL) { + } else if (dynamic_cast<IntParameter*>(parameterArray[i]) != nullptr) { setKeyInt(parameterArray[i]->getName(), (int)*(IntParameter*)parameterArray[i], &hKey); - } else if (dynamic_cast<BoolParameter*>(parameterArray[i]) != NULL) { + } else if (dynamic_cast<BoolParameter*>(parameterArray[i]) != nullptr) { setKeyInt(parameterArray[i]->getName(), (int)*(BoolParameter*)parameterArray[i], &hKey); } else { throw Exception(_("Unknown parameter type")); @@ -553,13 +553,13 @@ static void getParametersFromReg(VoidParameter* parameters[], for (size_t i = 0; i < parameters_len/sizeof(VoidParameter*); i++) { try { - if (dynamic_cast<StringParameter*>(parameters[i]) != NULL) { + if (dynamic_cast<StringParameter*>(parameters[i]) != nullptr) { if (getKeyString(parameters[i]->getName(), stringValue, buffersize, hKey)) parameters[i]->setParam(stringValue); - } else if (dynamic_cast<IntParameter*>(parameters[i]) != NULL) { + } else if (dynamic_cast<IntParameter*>(parameters[i]) != nullptr) { if (getKeyInt(parameters[i]->getName(), &intValue, hKey)) ((IntParameter*)parameters[i])->setParam(intValue); - } else if (dynamic_cast<BoolParameter*>(parameters[i]) != NULL) { + } else if (dynamic_cast<BoolParameter*>(parameters[i]) != nullptr) { if (getKeyInt(parameters[i]->getName(), &intValue, hKey)) ((BoolParameter*)parameters[i])->setParam(intValue); } else { @@ -583,7 +583,7 @@ static char* loadFromReg() { if (res != ERROR_SUCCESS) { if (res == ERROR_FILE_NOT_FOUND) { // The key does not exist, defaults will be used. - return NULL; + return nullptr; } throw rdr::SystemException(_("Failed to open registry key"), res); @@ -622,7 +622,7 @@ void saveViewerParameters(const char *filename, const char *servername) { char encodingBuffer[buffersize]; // Write to the registry or a predefined file if no filename was specified. - if(filename == NULL) { + if(filename == nullptr) { #ifdef _WIN32 saveToReg(servername); @@ -630,7 +630,7 @@ void saveViewerParameters(const char *filename, const char *servername) { #endif const char* configDir = os::getvncconfigdir(); - if (configDir == NULL) + if (configDir == nullptr) throw Exception(_("Could not obtain the config directory path")); snprintf(filepath, sizeof(filepath), "%s/default.tigervnc", configDir); @@ -654,24 +654,24 @@ void saveViewerParameters(const char *filename, const char *servername) { } fprintf(f, "ServerName=%s\n", encodingBuffer); - for (size_t i = 0; i < sizeof(parameterArray)/sizeof(VoidParameter*); i++) { - if (dynamic_cast<StringParameter*>(parameterArray[i]) != NULL) { - if (!encodeValue(*(StringParameter*)parameterArray[i], + for (VoidParameter* param : parameterArray) { + if (dynamic_cast<StringParameter*>(param) != nullptr) { + if (!encodeValue(*(StringParameter*)param, encodingBuffer, buffersize)) { fclose(f); throw Exception(_("Failed to save \"%s\": %s"), - parameterArray[i]->getName(), + param->getName(), _("Could not encode parameter")); } - fprintf(f, "%s=%s\n", ((StringParameter*)parameterArray[i])->getName(), encodingBuffer); - } else if (dynamic_cast<IntParameter*>(parameterArray[i]) != NULL) { - fprintf(f, "%s=%d\n", ((IntParameter*)parameterArray[i])->getName(), (int)*(IntParameter*)parameterArray[i]); - } else if (dynamic_cast<BoolParameter*>(parameterArray[i]) != NULL) { - fprintf(f, "%s=%d\n", ((BoolParameter*)parameterArray[i])->getName(), (int)*(BoolParameter*)parameterArray[i]); + fprintf(f, "%s=%s\n", ((StringParameter*)param)->getName(), encodingBuffer); + } else if (dynamic_cast<IntParameter*>(param) != nullptr) { + fprintf(f, "%s=%d\n", ((IntParameter*)param)->getName(), (int)*(IntParameter*)param); + } else if (dynamic_cast<BoolParameter*>(param) != nullptr) { + fprintf(f, "%s=%d\n", ((BoolParameter*)param)->getName(), (int)*(BoolParameter*)param); } else { fclose(f); throw Exception(_("Failed to save \"%s\": %s"), - parameterArray[i]->getName(), + param->getName(), _("Unknown parameter type")); } } @@ -688,7 +688,7 @@ static bool findAndSetViewerParameterFromValue( // Find and set the correct parameter for (size_t i = 0; i < parameters_len/sizeof(VoidParameter*); i++) { - if (dynamic_cast<StringParameter*>(parameters[i]) != NULL) { + if (dynamic_cast<StringParameter*>(parameters[i]) != nullptr) { if (strcasecmp(line, ((StringParameter*)parameters[i])->getName()) == 0) { if(!decodeValue(value, decodingBuffer, sizeof(decodingBuffer))) throw Exception(_("Invalid format or too large value")); @@ -696,13 +696,13 @@ static bool findAndSetViewerParameterFromValue( return false; } - } else if (dynamic_cast<IntParameter*>(parameters[i]) != NULL) { + } else if (dynamic_cast<IntParameter*>(parameters[i]) != nullptr) { if (strcasecmp(line, ((IntParameter*)parameters[i])->getName()) == 0) { ((IntParameter*)parameters[i])->setParam(atoi(value)); return false; } - } else if (dynamic_cast<BoolParameter*>(parameters[i]) != NULL) { + } else if (dynamic_cast<BoolParameter*>(parameters[i]) != nullptr) { if (strcasecmp(line, ((BoolParameter*)parameters[i])->getName()) == 0) { ((BoolParameter*)parameters[i])->setParam(atoi(value)); return false; @@ -727,14 +727,14 @@ char* loadViewerParameters(const char *filename) { memset(servername, '\0', sizeof(servername)); // Load from the registry or a predefined file if no filename was specified. - if(filename == NULL) { + if(filename == nullptr) { #ifdef _WIN32 return loadFromReg(); #endif const char* configDir = os::getvncconfigdir(); - if (configDir == NULL) + if (configDir == nullptr) throw Exception(_("Could not obtain the config directory path")); snprintf(filepath, sizeof(filepath), "%s/default.tigervnc", configDir); @@ -746,7 +746,7 @@ char* loadViewerParameters(const char *filename) { FILE* f = fopen(filepath, "r"); if (!f) { if (!filename) - return NULL; // Use defaults. + return nullptr; // Use defaults. throw Exception(_("Could not open \"%s\": %s"), filepath, strerror(errno)); } @@ -797,7 +797,7 @@ char* loadViewerParameters(const char *filename) { // Find the parameter value char *value = strchr(line, '='); - if (value == NULL) { + if (value == nullptr) { vlog.error(_("Failed to read line %d in file %s: %s"), lineNr, filepath, _("Invalid format")); continue; @@ -836,7 +836,8 @@ char* loadViewerParameters(const char *filename) { vlog.error(_("Failed to read line %d in file %s: %s"), lineNr, filepath, _("Unknown parameter")); } - fclose(f); f=0; - + fclose(f); + f = nullptr; + return servername; } diff --git a/vncviewer/parameters.h b/vncviewer/parameters.h index 1dd9aca2..df7bc420 100644 --- a/vncviewer/parameters.h +++ b/vncviewer/parameters.h @@ -80,7 +80,7 @@ extern rfb::BoolParameter reconnectOnError; extern rfb::StringParameter via; #endif -void saveViewerParameters(const char *filename, const char *servername=NULL); +void saveViewerParameters(const char *filename, const char *servername=nullptr); char* loadViewerParameters(const char *filename); #ifdef _WIN32 diff --git a/vncviewer/touch.cxx b/vncviewer/touch.cxx index d4f4098a..1efd3e46 100644 --- a/vncviewer/touch.cxx +++ b/vncviewer/touch.cxx @@ -103,7 +103,7 @@ static void x11_change_touch_ownership(bool enable) for (iter = handlers.begin(); iter != handlers.end(); ++iter) { curmasks = XIGetSelectedEvents(fl_display, iter->first, &num_masks); - if (curmasks == NULL) { + if (curmasks == nullptr) { if (num_masks == -1) vlog.error(_("Unable to get X Input 2 event mask for window 0x%08lx"), iter->first); continue; @@ -267,7 +267,7 @@ void enable_touch() vlog.error(_("X Input 2.2 (or newer) is not available. Touch gestures will not be supported.")); #endif - Fl::add_system_handler(handleTouchEvent, NULL); + Fl::add_system_handler(handleTouchEvent, nullptr); } void disable_touch() diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index 91e2be3b..27946f3f 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -86,13 +86,15 @@ using namespace rfb; char vncServerName[VNCSERVERNAMELEN] = { '\0' }; -static const char *argv0 = NULL; +static const char *argv0 = nullptr; static bool inMainloop = false; static bool exitMainloop = false; -static char *exitError = NULL; +static char *exitError = nullptr; static bool fatalError = false; +static UserDialog dlg; + static const char *about_text() { static char buffer[1024]; @@ -117,7 +119,7 @@ void abort_vncviewer(const char *error, ...) // Prioritise the first error we get as that is probably the most // relevant one. - if (exitError == NULL) { + if (exitError == nullptr) { va_list ap; va_start(ap, error); @@ -130,7 +132,7 @@ void abort_vncviewer(const char *error, ...) exitMainloop = true; else { // We're early in the startup. Assume we can just exit(). - if (alertOnFatalError && (exitError != NULL)) + if (alertOnFatalError && (exitError != nullptr)) fl_alert("%s", exitError); exit(EXIT_FAILURE); } @@ -142,7 +144,7 @@ void abort_connection(const char *error, ...) // Prioritise the first error we get as that is probably the most // relevant one. - if (exitError == NULL) { + if (exitError == nullptr) { va_list ap; va_start(ap, error); @@ -169,6 +171,11 @@ bool should_disconnect() return exitMainloop; } +void reset_password_data() +{ + dlg.resetPassword(); +} + void about_vncviewer() { fl_message_title(_("About TigerVNC Viewer")); @@ -188,7 +195,7 @@ static void mainloop(const char* vncserver, network::Socket* sock) int next_timer; next_timer = Timer::checkTimeouts(); - if (next_timer == 0) + if (next_timer < 0) next_timer = INT_MAX; if (Fl::wait((double)next_timer / 1000.0) < 0.0) { @@ -200,22 +207,22 @@ static void mainloop(const char* vncserver, network::Socket* sock) delete cc; if (fatalError) { - assert(exitError != NULL); + assert(exitError != nullptr); if (alertOnFatalError) fl_alert("%s", exitError); break; } - if (exitError == NULL) + if (exitError == nullptr) break; - if(reconnectOnError && (sock == NULL)) { + if(reconnectOnError && (sock == nullptr)) { int ret; ret = fl_choice(_("%s\n\n" "Attempt to reconnect?"), - NULL, fl_yes, fl_no, exitError); + nullptr, fl_yes, fl_no, exitError); free(exitError); - exitError = NULL; + exitError = nullptr; if (ret == 1) continue; else @@ -250,7 +257,7 @@ static void new_connection_cb(Fl_Widget* /*widget*/, void* /*data*/) return; argv[0] = argv0; - argv[1] = NULL; + argv[1] = nullptr; execvp(argv[0], (char * const *)argv); @@ -273,16 +280,16 @@ static const char* getlocaledir() static char localebuf[PATH_MAX]; char *slash; - GetModuleFileName(NULL, localebuf, sizeof(localebuf)); + GetModuleFileName(nullptr, localebuf, sizeof(localebuf)); slash = strrchr(localebuf, '\\'); - if (slash == NULL) - return NULL; + if (slash == nullptr) + return nullptr; *slash = '\0'; if ((strlen(localebuf) + strlen("\\locale")) >= sizeof(localebuf)) - return NULL; + return nullptr; strcat(localebuf, "\\locale"); @@ -296,13 +303,13 @@ static const char* getlocaledir() static char localebuf[PATH_MAX]; bundle = CFBundleGetMainBundle(); - if (bundle == NULL) - return NULL; + if (bundle == nullptr) + return nullptr; localeurl = CFBundleCopyResourceURL(bundle, CFSTR("locale"), - NULL, NULL); - if (localeurl == NULL) - return NULL; + nullptr, nullptr); + if (localeurl == nullptr) + return nullptr; localestr = CFURLCopyFileSystemPath(localeurl, kCFURLPOSIXPathStyle); @@ -311,7 +318,7 @@ static const char* getlocaledir() ret = CFStringGetCString(localestr, localebuf, sizeof(localebuf), kCFStringEncodingUTF8); if (!ret) - return NULL; + return nullptr; return localebuf; #else @@ -331,11 +338,13 @@ static void init_fltk() #ifdef WIN32 HICON lg, sm; - lg = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), + lg = (HICON)LoadImage(GetModuleHandle(nullptr), + MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR | LR_SHARED); - sm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), + sm = (HICON)LoadImage(GetModuleHandle(nullptr), + MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR | LR_SHARED); @@ -350,12 +359,12 @@ static void init_fltk() count = 0; // FIXME: Follow icon theme specification - for (size_t i = 0;i < sizeof(icon_sizes)/sizeof(icon_sizes[0]);i++) { + for (int icon_size : icon_sizes) { char icon_path[PATH_MAX]; bool exists; sprintf(icon_path, "%s/icons/hicolor/%dx%d/apps/tigervnc.png", - CMAKE_INSTALL_FULL_DATADIR, icon_sizes[i], icon_sizes[i]); + CMAKE_INSTALL_FULL_DATADIR, icon_size, icon_size); struct stat st; if (stat(icon_path, &st) != 0) @@ -412,7 +421,7 @@ static void init_fltk() Fl_Mac_App_Menu::hide_others = _("Hide Others"); Fl_Mac_App_Menu::show = _("Show All"); - fl_mac_set_about(about_callback, NULL); + fl_mac_set_about(about_callback, nullptr); Fl_Sys_Menu_Bar *menubar; char buffer[1024]; @@ -421,7 +430,7 @@ static void init_fltk() // which means we cannot use our generic Fl_Menu_ helpers. if (fltk_menu_escape(p_("SysMenu|", "&File"), buffer, sizeof(buffer)) < sizeof(buffer)) - menubar->add(buffer, 0, 0, 0, FL_SUBMENU); + menubar->add(buffer, 0, nullptr, nullptr, FL_SUBMENU); if (fltk_menu_escape(p_("SysMenu|File|", "&New Connection"), buffer, sizeof(buffer)) < sizeof(buffer)) menubar->insert(1, buffer, FL_COMMAND | 'n', new_connection_cb); @@ -432,7 +441,7 @@ static void usage(const char *programName) { #ifdef WIN32 // If we don't have a console then we need to create one for output - if (GetConsoleWindow() == NULL) { + if (GetConsoleWindow() == nullptr) { HANDLE handle; int fd; @@ -485,17 +494,17 @@ static void usage(const char *programName) } static void -potentiallyLoadConfigurationFile(char *vncServerName) +potentiallyLoadConfigurationFile(const char *filename) { - const bool hasPathSeparator = (strchr(vncServerName, '/') != NULL || - (strchr(vncServerName, '\\')) != NULL); + const bool hasPathSeparator = (strchr(filename, '/') != nullptr || + (strchr(filename, '\\')) != nullptr); if (hasPathSeparator) { #ifndef WIN32 struct stat sb; // This might be a UNIX socket, we need to check - if (stat(vncServerName, &sb) == -1) { + if (stat(filename, &sb) == -1) { // Some access problem; let loadViewerParameters() deal with it... } else { if ((sb.st_mode & S_IFMT) == S_IFSOCK) @@ -505,7 +514,7 @@ potentiallyLoadConfigurationFile(char *vncServerName) try { const char* newServerName; - newServerName = loadViewerParameters(vncServerName); + newServerName = loadViewerParameters(filename); // This might be empty, but we still need to clear it so we // don't try to connect to the filename strncpy(vncServerName, newServerName, VNCSERVERNAMELEN-1); @@ -534,7 +543,7 @@ interpretViaParam(char *remoteHost, int *remotePort, int localPort) { const int SERVER_PORT_OFFSET = 5900; char *pos = strchr(vncServerName, ':'); - if (pos == NULL) + if (pos == nullptr) *remotePort = SERVER_PORT_OFFSET; else { int portOffset = SERVER_PORT_OFFSET; @@ -580,7 +589,7 @@ createTunnel(const char *gatewayHost, const char *remoteHost, cmd = "/usr/bin/ssh -f -L \"$L\":\"$H\":\"$R\" \"$G\" sleep 20"; /* Compatibility with TigerVNC's method. */ cmd2 = strdup(cmd); - while ((percent = strchr(cmd2, '%')) != NULL) + while ((percent = strchr(cmd2, '%')) != nullptr) *percent = '$'; system(cmd2); free(cmd2); @@ -605,14 +614,13 @@ static int mktunnel() int main(int argc, char** argv) { const char *localedir; - UserDialog dlg; argv0 = argv[0]; setlocale(LC_ALL, ""); localedir = getlocaledir(); - if (localedir == NULL) + if (localedir == nullptr) fprintf(stderr, "Failed to determine locale directory\n"); else bindtextdomain(PACKAGE_NAME, localedir); @@ -647,8 +655,8 @@ int main(int argc, char** argv) char defaultServerName[VNCSERVERNAMELEN] = ""; try { const char* configServerName; - configServerName = loadViewerParameters(NULL); - if (configServerName != NULL) { + configServerName = loadViewerParameters(nullptr); + if (configServerName != nullptr) { strncpy(defaultServerName, configServerName, VNCSERVERNAMELEN-1); defaultServerName[VNCSERVERNAMELEN-1] = '\0'; } @@ -662,8 +670,8 @@ int main(int argc, char** argv) VoidParameter *param; param = Configuration::getParam(&argv[i][1]); - if ((param != NULL) && - (dynamic_cast<BoolParameter*>(param) != NULL)) { + if ((param != nullptr) && + (dynamic_cast<BoolParameter*>(param) != nullptr)) { if ((strcasecmp(argv[i+1], "0") == 0) || (strcasecmp(argv[i+1], "1") == 0) || (strcasecmp(argv[i+1], "true") == 0) || @@ -703,7 +711,7 @@ int main(int argc, char** argv) Fl::display(display); } fl_open_display(); - XkbSetDetectableAutoRepeat(fl_display, True, NULL); + XkbSetDetectableAutoRepeat(fl_display, True, nullptr); #endif init_fltk(); @@ -717,11 +725,11 @@ int main(int argc, char** argv) char *confdir = strdup(os::getvncconfigdir()); #ifndef WIN32 char *dotdir = strrchr(confdir, '.'); - if (dotdir != NULL && strcmp(dotdir, ".vnc") == 0) + if (dotdir != nullptr && strcmp(dotdir, ".vnc") == 0) vlog.info(_("~/.vnc is deprecated, please consult 'man vncviewer' for paths to migrate to.")); #else char *vncdir = strrchr(confdir, '\\'); - if (vncdir != NULL && strcmp(vncdir, "vnc") == 0) + if (vncdir != nullptr && strcmp(vncdir, "vnc") == 0) vlog.info(_("%%APPDATA%%\\vnc is deprecated, please switch to the %%APPDATA%%\\TigerVNC location.")); #endif @@ -745,7 +753,7 @@ int main(int argc, char** argv) CSecurity::msg = &dlg; #endif - Socket *sock = NULL; + Socket *sock = nullptr; #ifndef WIN32 /* Specifying -via and -listen together is nonsense */ @@ -765,22 +773,20 @@ int main(int argc, char** argv) if (isdigit(vncServerName[0])) port = atoi(vncServerName); - createTcpListeners(&listeners, 0, port); + createTcpListeners(&listeners, nullptr, port); if (listeners.empty()) throw Exception(_("Unable to listen for incoming connections")); vlog.info(_("Listening on port %d"), port); /* Wait for a connection */ - while (sock == NULL) { + while (sock == nullptr) { fd_set rfds; FD_ZERO(&rfds); - for (std::list<SocketListener*>::iterator i = listeners.begin(); - i != listeners.end(); - i++) - FD_SET((*i)->getFd(), &rfds); + for (SocketListener* listener : listeners) + FD_SET(listener->getFd(), &rfds); - int n = select(FD_SETSIZE, &rfds, 0, 0, 0); + int n = select(FD_SETSIZE, &rfds, nullptr, nullptr, nullptr); if (n < 0) { if (errno == EINTR) { vlog.debug("Interrupted select() system call"); @@ -790,11 +796,9 @@ int main(int argc, char** argv) } } - for (std::list<SocketListener*>::iterator i = listeners.begin (); - i != listeners.end(); - i++) - if (FD_ISSET((*i)->getFd(), &rfds)) { - sock = (*i)->accept(); + for (SocketListener* listener : listeners) + if (FD_ISSET(listener->getFd(), &rfds)) { + sock = listener->accept(); if (sock) /* Got a connection */ break; diff --git a/vncviewer/vncviewer.h b/vncviewer/vncviewer.h index f39a5776..c864805c 100644 --- a/vncviewer/vncviewer.h +++ b/vncviewer/vncviewer.h @@ -33,6 +33,7 @@ void abort_connection_with_unexpected_error(const rdr::Exception &); void disconnect(); bool should_disconnect(); +void reset_password_data(); void about_vncviewer(); diff --git a/vncviewer/vncviewer.man b/vncviewer/vncviewer.man index 1a282126..79c410ae 100644 --- a/vncviewer/vncviewer.man +++ b/vncviewer/vncviewer.man @@ -71,7 +71,7 @@ faster to generate, thus improving the interactive feel. The viewer normally starts in full-color mode, but switches to low-color mode if the bandwidth is insufficient. However, this only occurs when communicating with servers supporting protocol 3.8 or -newer, since many old servers does not support color mode changes +newer, since many old servers do not support color mode changes safely. Automatic selection can be turned off by setting the @@ -325,7 +325,7 @@ was launched. The environment variable \fIVNC_VIA_CMD\fR can override the default tunnel command of \fB/usr/bin/ssh\ -f\ -L\ "$L":"$H":"$R"\ "$G"\ sleep\ 20\fR. The tunnel command is executed with the environment variables \fIL\fR, \fIH\fR, -\fIR\fR, and \fIG\fR taken the values of the local port number, the remote +\fIR\fR, and \fIG\fR taking the values of the local port number, the remote host, the port number on the remote host, and the gateway machine respectively. . diff --git a/win/rfb_win32/AboutDialog.cxx b/win/rfb_win32/AboutDialog.cxx index a48a1ea7..a41ceefd 100644 --- a/win/rfb_win32/AboutDialog.cxx +++ b/win/rfb_win32/AboutDialog.cxx @@ -32,7 +32,7 @@ static LogWriter vlog("AboutDialog"); AboutDialog AboutDialog::instance; -AboutDialog::AboutDialog() : Dialog(GetModuleHandle(0)) { +AboutDialog::AboutDialog() : Dialog(GetModuleHandle(nullptr)) { } bool AboutDialog::showDialog() { diff --git a/win/rfb_win32/AboutDialog.h b/win/rfb_win32/AboutDialog.h index 705d6b3c..00cf0d42 100644 --- a/win/rfb_win32/AboutDialog.h +++ b/win/rfb_win32/AboutDialog.h @@ -33,7 +33,7 @@ namespace rfb { public: AboutDialog(); virtual bool showDialog(); - virtual void initDialog(); + void initDialog() override; static AboutDialog instance; diff --git a/win/rfb_win32/CleanDesktop.cxx b/win/rfb_win32/CleanDesktop.cxx index e69acd7f..d2d6d2d1 100644 --- a/win/rfb_win32/CleanDesktop.cxx +++ b/win/rfb_win32/CleanDesktop.cxx @@ -40,9 +40,9 @@ static LogWriter vlog("CleanDesktop"); struct ActiveDesktop { - ActiveDesktop() : handle(0) { + ActiveDesktop() : handle(nullptr) { // - Contact Active Desktop - HRESULT result = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, + HRESULT result = CoCreateInstance(CLSID_ActiveDesktop, nullptr, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (PVOID*)&handle); if (result != S_OK) throw rdr::SystemException("failed to contact Active Desktop", result); @@ -153,7 +153,7 @@ DWORD SysParamsInfo(UINT action, UINT param, PVOID ptr, UINT ini) { CleanDesktop::CleanDesktop() : restoreActiveDesktop(false), restoreWallpaper(false), restoreEffects(false) { - CoInitialize(0); + CoInitialize(nullptr); } CleanDesktop::~CleanDesktop() { @@ -207,7 +207,7 @@ void CleanDesktop::enableWallpaper() { vlog.debug("restore desktop wallpaper"); // -=- Then restore the standard wallpaper if required - SysParamsInfo(SPI_SETDESKWALLPAPER, 0, NULL, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETDESKWALLPAPER, 0, nullptr, SPIF_SENDCHANGE); restoreWallpaper = false; } @@ -223,20 +223,20 @@ void CleanDesktop::disableEffects() { vlog.debug("disable desktop effects"); - SysParamsInfo(SPI_SETFONTSMOOTHING, FALSE, 0, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETFONTSMOOTHING, FALSE, nullptr, SPIF_SENDCHANGE); if (SysParamsInfo(SPI_GETUIEFFECTS, 0, &uiEffects, 0) == ERROR_CALL_NOT_IMPLEMENTED) { SysParamsInfo(SPI_GETCOMBOBOXANIMATION, 0, &comboBoxAnim, 0); SysParamsInfo(SPI_GETGRADIENTCAPTIONS, 0, &gradientCaptions, 0); SysParamsInfo(SPI_GETHOTTRACKING, 0, &hotTracking, 0); SysParamsInfo(SPI_GETLISTBOXSMOOTHSCROLLING, 0, &listBoxSmoothScroll, 0); SysParamsInfo(SPI_GETMENUANIMATION, 0, &menuAnim, 0); - SysParamsInfo(SPI_SETCOMBOBOXANIMATION, 0, FALSE, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETGRADIENTCAPTIONS, 0, FALSE, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETHOTTRACKING, 0, FALSE, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETLISTBOXSMOOTHSCROLLING, 0, FALSE, SPIF_SENDCHANGE); - SysParamsInfo(SPI_SETMENUANIMATION, 0, FALSE, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETCOMBOBOXANIMATION, 0, (PVOID)FALSE, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETGRADIENTCAPTIONS, 0, (PVOID)FALSE, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETHOTTRACKING, 0, (PVOID)FALSE, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETLISTBOXSMOOTHSCROLLING, 0, (PVOID)FALSE, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETMENUANIMATION, 0, (PVOID)FALSE, SPIF_SENDCHANGE); } else { - SysParamsInfo(SPI_SETUIEFFECTS, 0, FALSE, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETUIEFFECTS, 0, (PVOID)FALSE, SPIF_SENDCHANGE); // We *always* restore UI effects overall, since there is no Windows GUI to do it uiEffects = TRUE; @@ -257,7 +257,7 @@ void CleanDesktop::enableEffects() { RegKey desktopCfg; desktopCfg.openKey(HKEY_CURRENT_USER, "Control Panel\\Desktop"); - SysParamsInfo(SPI_SETFONTSMOOTHING, desktopCfg.getInt("FontSmoothing", 0) != 0, 0, SPIF_SENDCHANGE); + SysParamsInfo(SPI_SETFONTSMOOTHING, desktopCfg.getInt("FontSmoothing", 0) != 0, nullptr, SPIF_SENDCHANGE); if (SysParamsInfo(SPI_SETUIEFFECTS, 0, (void*)(intptr_t)uiEffects, SPIF_SENDCHANGE) == ERROR_CALL_NOT_IMPLEMENTED) { SysParamsInfo(SPI_SETCOMBOBOXANIMATION, 0, (void*)(intptr_t)comboBoxAnim, SPIF_SENDCHANGE); SysParamsInfo(SPI_SETGRADIENTCAPTIONS, 0, (void*)(intptr_t)gradientCaptions, SPIF_SENDCHANGE); diff --git a/win/rfb_win32/Clipboard.cxx b/win/rfb_win32/Clipboard.cxx index d90d0b7a..79115893 100644 --- a/win/rfb_win32/Clipboard.cxx +++ b/win/rfb_win32/Clipboard.cxx @@ -39,7 +39,7 @@ static LogWriter vlog("Clipboard"); // Clipboard::Clipboard() - : MsgWindow("Clipboard"), notifier(0), next_window(0) { + : MsgWindow("Clipboard"), notifier(nullptr), next_window(nullptr) { next_window = SetClipboardViewer(getHandle()); vlog.debug("registered clipboard handler"); } @@ -58,7 +58,7 @@ Clipboard::processMessage(UINT msg, WPARAM wParam, LPARAM lParam) { (long long)wParam, (long long)lParam); if ((HWND) wParam == next_window) next_window = (HWND) lParam; - else if (next_window != 0) + else if (next_window != nullptr) SendMessage(next_window, msg, wParam, lParam); else vlog.error("bad clipboard chain change!"); @@ -72,7 +72,7 @@ Clipboard::processMessage(UINT msg, WPARAM wParam, LPARAM lParam) { } else { vlog.debug("local clipboard changed by %p", owner); - if (notifier == NULL) + if (notifier == nullptr) vlog.debug("no clipboard notifier registered"); else notifier->notifyClipboardChanged(IsClipboardFormatAvailable(CF_UNICODETEXT)); @@ -94,19 +94,19 @@ Clipboard::getClipText() { // Open the clipboard if (!OpenClipboard(getHandle())) - return NULL; + return nullptr; // Get the clipboard data cliphandle = GetClipboardData(CF_UNICODETEXT); if (!cliphandle) { CloseClipboard(); - return NULL; + return nullptr; } clipdata = (wchar_t*) GlobalLock(cliphandle); if (!clipdata) { CloseClipboard(); - return NULL; + return nullptr; } // Convert it to UTF-8 @@ -121,7 +121,7 @@ Clipboard::getClipText() { void Clipboard::setClipText(const char* text) { - HANDLE clip_handle = 0; + HANDLE clip_handle = nullptr; try { @@ -147,7 +147,7 @@ Clipboard::setClipText(const char* text) { // - Set the new clipboard data if (!SetClipboardData(CF_UNICODETEXT, clip_handle)) throw rdr::SystemException("unable to set Win32 clipboard", GetLastError()); - clip_handle = 0; + clip_handle = nullptr; vlog.debug("set clipboard"); } catch (rdr::Exception& e) { diff --git a/win/rfb_win32/Clipboard.h b/win/rfb_win32/Clipboard.h index 588f1086..b66aa5a4 100644 --- a/win/rfb_win32/Clipboard.h +++ b/win/rfb_win32/Clipboard.h @@ -57,7 +57,7 @@ namespace rfb { protected: // - Internal MsgWindow callback - virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam); + LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam) override; Notifier* notifier; HWND next_window; diff --git a/win/rfb_win32/DIBSectionBuffer.cxx b/win/rfb_win32/DIBSectionBuffer.cxx index 632c0a4c..aa03315c 100644 --- a/win/rfb_win32/DIBSectionBuffer.cxx +++ b/win/rfb_win32/DIBSectionBuffer.cxx @@ -33,11 +33,11 @@ static LogWriter vlog("DIBSectionBuffer"); DIBSectionBuffer::DIBSectionBuffer(HWND window_) - : bitmap(0), window(window_), device(0) { + : bitmap(nullptr), window(window_), device(nullptr) { } DIBSectionBuffer::DIBSectionBuffer(HDC device_) - : bitmap(0), window(0), device(device_) { + : bitmap(nullptr), window(nullptr), device(device_) { } DIBSectionBuffer::~DIBSectionBuffer() { @@ -52,8 +52,8 @@ inline void initMaxAndShift(DWORD mask, int* max, int* shift) { } void DIBSectionBuffer::initBuffer(const PixelFormat& pf, int w, int h) { - HBITMAP new_bitmap = 0; - uint8_t* new_data = 0; + HBITMAP new_bitmap = nullptr; + uint8_t* new_data = nullptr; if (!pf.trueColour) throw rfb::Exception("palette format not supported"); @@ -78,10 +78,10 @@ void DIBSectionBuffer::initBuffer(const PixelFormat& pf, int w, int h) { // Create a DIBSection to draw into if (device) new_bitmap = ::CreateDIBSection(device, (BITMAPINFO*)&bi.bmiHeader, iUsage, - (void**)&new_data, NULL, 0); + (void**)&new_data, nullptr, 0); else new_bitmap = ::CreateDIBSection(WindowDC(window), (BITMAPINFO*)&bi.bmiHeader, iUsage, - (void**)&new_data, NULL, 0); + (void**)&new_data, nullptr, 0); if (!new_bitmap) { int err = GetLastError(); @@ -112,8 +112,8 @@ void DIBSectionBuffer::initBuffer(const PixelFormat& pf, int w, int h) { if (bitmap) { // Delete the old bitmap DeleteObject(bitmap); - bitmap = 0; - setBuffer(0, 0, NULL, 0); + bitmap = nullptr; + setBuffer(0, 0, nullptr, 0); } if (new_bitmap) { diff --git a/win/rfb_win32/DeviceContext.cxx b/win/rfb_win32/DeviceContext.cxx index e59672f5..1efc3a59 100644 --- a/win/rfb_win32/DeviceContext.cxx +++ b/win/rfb_win32/DeviceContext.cxx @@ -50,10 +50,10 @@ PixelFormat DeviceContext::getPF(HDC dc) { memset(&bi, 0, sizeof(bi)); bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bi.bmiHeader.biBitCount = 0; - if (!::GetDIBits(dc, bitmap, 0, 1, NULL, (BITMAPINFO*)&bi, DIB_RGB_COLORS)) { + if (!::GetDIBits(dc, bitmap, 0, 1, nullptr, (BITMAPINFO*)&bi, DIB_RGB_COLORS)) { throw rdr::SystemException("unable to determine device pixel format", GetLastError()); } - if (!::GetDIBits(dc, bitmap, 0, 1, NULL, (BITMAPINFO*)&bi, DIB_RGB_COLORS)) { + if (!::GetDIBits(dc, bitmap, 0, 1, nullptr, (BITMAPINFO*)&bi, DIB_RGB_COLORS)) { throw rdr::SystemException("unable to determine pixel shifts/palette", GetLastError()); } @@ -157,7 +157,7 @@ Rect DeviceContext::getClipBox(HDC dc) { DeviceDC::DeviceDC(const char* deviceName) { - dc = ::CreateDC("DISPLAY", deviceName, NULL, NULL); + dc = ::CreateDC("DISPLAY", deviceName, nullptr, nullptr); if (!dc) throw rdr::SystemException("failed to create DeviceDC", GetLastError()); } diff --git a/win/rfb_win32/DeviceContext.h b/win/rfb_win32/DeviceContext.h index 0664684b..7e89723c 100644 --- a/win/rfb_win32/DeviceContext.h +++ b/win/rfb_win32/DeviceContext.h @@ -35,7 +35,7 @@ namespace rfb { // and the pixel format, and access to the HDC itself. class DeviceContext { public: - DeviceContext() : dc(0) {} + DeviceContext() : dc(nullptr) {} virtual ~DeviceContext() {} operator HDC() const {return dc;} PixelFormat getPF() const; diff --git a/win/rfb_win32/DeviceFrameBuffer.cxx b/win/rfb_win32/DeviceFrameBuffer.cxx index 5d866de8..bba1dbdb 100644 --- a/win/rfb_win32/DeviceFrameBuffer.cxx +++ b/win/rfb_win32/DeviceFrameBuffer.cxx @@ -122,8 +122,8 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server) { // - If hCursor is null then there is no cursor - clear the old one - if (hCursor == 0) { - server->setCursor(0, 0, Point(), NULL); + if (hCursor == nullptr) { + server->setCursor(0, 0, Point(), nullptr); return; } @@ -223,19 +223,19 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server) uint8_t* rwbuffer = buffer.data(); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { - int byte = y * maskInfo.bmWidthBytes + x / 8; + int byte_ = y * maskInfo.bmWidthBytes + x / 8; int bit = 7 - x % 8; - if (!(andMask[byte] & (1 << bit))) { + if (!(andMask[byte_] & (1 << bit))) { // Valid pixel, so make it opaque rwbuffer[3] = 0xff; // Black or white? - if (xorMask[byte] & (1 << bit)) + if (xorMask[byte_] & (1 << bit)) rwbuffer[0] = rwbuffer[1] = rwbuffer[2] = 0xff; else rwbuffer[0] = rwbuffer[1] = rwbuffer[2] = 0; - } else if (xorMask[byte] & (1 << bit)) { + } else if (xorMask[byte_] & (1 << bit)) { // Replace any XORed pixels with black, because RFB doesn't support // XORing of cursors. XORing is used for the I-beam cursor, which is most // often used over a white background, but also sometimes over a black diff --git a/win/rfb_win32/DeviceFrameBuffer.h b/win/rfb_win32/DeviceFrameBuffer.h index c8715724..e9f06cb0 100644 --- a/win/rfb_win32/DeviceFrameBuffer.h +++ b/win/rfb_win32/DeviceFrameBuffer.h @@ -69,7 +69,7 @@ namespace rfb { // - FrameBuffer overrides virtual void grabRect(const Rect &rect); - virtual void grabRegion(const Region ®ion); + void grabRegion(const Region ®ion) override; // - DeviceFrameBuffer specific methods diff --git a/win/rfb_win32/Dialog.cxx b/win/rfb_win32/Dialog.cxx index 8e2c1ee8..432439ce 100644 --- a/win/rfb_win32/Dialog.cxx +++ b/win/rfb_win32/Dialog.cxx @@ -48,7 +48,7 @@ static LogWriter plog("PropSheet"); Dialog::Dialog(HINSTANCE inst_) -: inst(inst_), handle(0), alreadyShowing(false) +: inst(inst_), handle(nullptr), alreadyShowing(false) { } @@ -60,7 +60,7 @@ Dialog::~Dialog() bool Dialog::showDialog(const char* resource, HWND owner) { if (alreadyShowing) return false; - handle = 0; + handle = nullptr; alreadyShowing = true; INT_PTR result = DialogBoxParam(inst, resource, owner, staticDialogProc, (LPARAM)this); @@ -151,14 +151,14 @@ BOOL Dialog::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } -PropSheetPage::PropSheetPage(HINSTANCE inst, const char* id) : Dialog(inst), propSheet(0) { +PropSheetPage::PropSheetPage(HINSTANCE inst_, const char* id) : Dialog(inst_), propSheet(nullptr) { page.dwSize = sizeof(page); page.dwFlags = 0; // PSP_USECALLBACK; page.hInstance = inst; page.pszTemplate = id; page.pfnDlgProc = staticPageProc; page.lParam = (LPARAM)this; - page.pfnCallback = 0; // staticPageProc; + page.pfnCallback = nullptr; // staticPageProc; } PropSheetPage::~PropSheetPage() { @@ -207,7 +207,7 @@ BOOL PropSheetPage::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam PropSheet::PropSheet(HINSTANCE inst_, const char* title_, std::list<PropSheetPage*> pages_, HICON icon_) -: icon(icon_), pages(pages_), inst(inst_), title(title_), handle(0), alreadyShowing(0) { +: icon(icon_), pages(pages_), inst(inst_), title(title_), handle(nullptr), alreadyShowing(0) { } PropSheet::~PropSheet() { @@ -241,7 +241,7 @@ static int CALLBACK removeCtxtHelp(HWND /*hwnd*/, UINT message, LPARAM lParam) { } -bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, bool capture) { +bool PropSheet::showPropSheet(HWND owner_, bool showApply, bool showCtxtHelp, bool capture) { if (alreadyShowing) return false; alreadyShowing = true; int count = pages.size(); @@ -262,7 +262,7 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo header.dwSize = sizeof(PROPSHEETHEADER); // Requires comctl32.dll 4.71 or greater, ie IE 4 or later header.dwFlags = PSH_MODELESS | (showApply ? 0 : PSH_NOAPPLYNOW) | (showCtxtHelp ? 0 : PSH_USECALLBACK); header.pfnCallback = removeCtxtHelp; - header.hwndParent = owner; + header.hwndParent = owner_; header.hInstance = inst; header.pszCaption = title.c_str(); header.nPages = count; @@ -274,9 +274,9 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo } handle = (HWND)PropertySheet(&header); - if ((handle == 0) || (handle == (HWND)-1)) + if ((handle == nullptr) || (handle == (HWND)-1)) throw rdr::SystemException("PropertySheet failed", GetLastError()); - centerWindow(handle, owner); + centerWindow(handle, owner_); plog.info("created %p", handle); (void)capture; @@ -314,21 +314,21 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo } else { #endif try { - if (owner) - EnableWindow(owner, FALSE); + if (owner_) + EnableWindow(owner_, FALSE); // Run the PropertySheet MSG msg; - while (GetMessage(&msg, 0, 0, 0)) { + while (GetMessage(&msg, nullptr, 0, 0)) { if (!PropSheet_IsDialogMessage(handle, &msg)) DispatchMessage(&msg); if (!PropSheet_GetCurrentPageHwnd(handle)) break; } - if (owner) - EnableWindow(owner, TRUE); + if (owner_) + EnableWindow(owner_, TRUE); } catch (...) { - if (owner) - EnableWindow(owner, TRUE); + if (owner_) + EnableWindow(owner_, TRUE); throw; } #ifdef _DIALOG_CAPTURE @@ -338,13 +338,13 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo plog.info("finished %p", handle); DestroyWindow(handle); - handle = 0; + handle = nullptr; alreadyShowing = false; // Clear up the pages' GDI objects for (pspi=pages.begin(); pspi!=pages.end(); pspi++) - (*pspi)->setPropSheet(0); - delete [] hpages; hpages = 0; + (*pspi)->setPropSheet(nullptr); + delete [] hpages; hpages = nullptr; return true; } catch (rdr::Exception&) { @@ -352,8 +352,8 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo std::list<PropSheetPage*>::iterator pspi; for (pspi=pages.begin(); pspi!=pages.end(); pspi++) - (*pspi)->setPropSheet(0); - delete [] hpages; hpages = 0; + (*pspi)->setPropSheet(nullptr); + delete [] hpages; hpages = nullptr; throw; } diff --git a/win/rfb_win32/Dialog.h b/win/rfb_win32/Dialog.h index d1a8e831..69374bb1 100644 --- a/win/rfb_win32/Dialog.h +++ b/win/rfb_win32/Dialog.h @@ -52,7 +52,7 @@ namespace rfb { // expansion), and owner is an optional window handle - the corresponding // window is disabled while the dialog box is displayed. - bool showDialog(const char* resource, HWND owner=0); + bool showDialog(const char* resource, HWND owner=nullptr); // initDialog() is called upon receipt of the WM_INITDIALOG message. @@ -106,7 +106,7 @@ namespace rfb { class PropSheet { public: - PropSheet(HINSTANCE inst, const char* title, std::list<PropSheetPage*> pages, HICON icon=0); + PropSheet(HINSTANCE inst, const char* title, std::list<PropSheetPage*> pages, HICON icon=nullptr); virtual ~PropSheet(); // Display the PropertySheet @@ -148,7 +148,7 @@ namespace rfb { protected: void setPropSheet(PropSheet* ps) {propSheet = ps;}; static INT_PTR CALLBACK staticPageProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - virtual BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) override; PROPSHEETPAGE page; PropSheet* propSheet; }; diff --git a/win/rfb_win32/EventManager.cxx b/win/rfb_win32/EventManager.cxx index 0f33f5ac..f034d36d 100644 --- a/win/rfb_win32/EventManager.cxx +++ b/win/rfb_win32/EventManager.cxx @@ -64,14 +64,14 @@ void EventManager::removeEvent(HANDLE event) { int EventManager::checkTimeouts() { - return 0; + return -1; } BOOL EventManager::getMessage(MSG* msg, HWND hwnd, UINT minMsg, UINT maxMsg) { while (true) { // - Process any pending timeouts - DWORD timeout = checkTimeouts(); - if (timeout == 0) + int timeout = checkTimeouts(); + if (timeout < 0) timeout = INFINITE; // - Events take precedence over messages diff --git a/win/rfb_win32/Handle.h b/win/rfb_win32/Handle.h index d3baa580..6b88a8f1 100644 --- a/win/rfb_win32/Handle.h +++ b/win/rfb_win32/Handle.h @@ -29,7 +29,7 @@ namespace rfb { class Handle { public: - Handle(HANDLE h_=0) : h(h_) {} + Handle(HANDLE h_=nullptr) : h(h_) {} ~Handle() { if (h) CloseHandle(h); } diff --git a/win/rfb_win32/IntervalTimer.h b/win/rfb_win32/IntervalTimer.h index deb2abc6..89cd9312 100644 --- a/win/rfb_win32/IntervalTimer.h +++ b/win/rfb_win32/IntervalTimer.h @@ -31,7 +31,7 @@ namespace rfb { IntervalTimer(HWND hwnd_, int id_) : hwnd(hwnd_), id(id_), active(false) { } - IntervalTimer() : hwnd(0), id(0), active(false) { + IntervalTimer() : hwnd(nullptr), id(0), active(false) { } ~IntervalTimer() { stop(); @@ -40,7 +40,7 @@ namespace rfb { void start(int interval_) { if (!active || interval_ != interval) { interval = interval_; - if (!SetTimer(hwnd, id, interval, 0)) + if (!SetTimer(hwnd, id, interval, nullptr)) throw rdr::SystemException("SetTimer", GetLastError()); active = true; } diff --git a/win/rfb_win32/LaunchProcess.cxx b/win/rfb_win32/LaunchProcess.cxx index 5e702a00..92a68273 100644 --- a/win/rfb_win32/LaunchProcess.cxx +++ b/win/rfb_win32/LaunchProcess.cxx @@ -85,11 +85,15 @@ void LaunchProcess::start(HANDLE userToken, bool createConsole) { BOOL success; if (userToken != INVALID_HANDLE_VALUE) success = CreateProcessAsUser(userToken, exePath.c_str(), - (char*)cmdLine.c_str(), 0, 0, FALSE, - flags, 0, 0, &sinfo, &procInfo); + (char*)cmdLine.c_str(), + nullptr, nullptr, FALSE, + flags, nullptr, nullptr, + &sinfo, &procInfo); else - success = CreateProcess(exePath.c_str(), (char*)cmdLine.c_str(), 0, - 0, FALSE, flags, 0, 0, &sinfo, &procInfo); + success = CreateProcess(exePath.c_str(), (char*)cmdLine.c_str(), + nullptr, nullptr, FALSE, + flags, nullptr, nullptr, + &sinfo, &procInfo); if (!success) throw rdr::SystemException("unable to launch process", GetLastError()); diff --git a/win/rfb_win32/LocalMem.h b/win/rfb_win32/LocalMem.h index a99d3241..239e8c1f 100644 --- a/win/rfb_win32/LocalMem.h +++ b/win/rfb_win32/LocalMem.h @@ -34,7 +34,7 @@ namespace rfb { ~LocalMem() {LocalFree(ptr);} operator void*() {return ptr;} void* takePtr() { - void* t = ptr; ptr = 0; return t; + void* t = ptr; ptr = nullptr; return t; } void* ptr; }; diff --git a/win/rfb_win32/ModuleFileName.h b/win/rfb_win32/ModuleFileName.h index 9a06f50d..c95ad1f1 100644 --- a/win/rfb_win32/ModuleFileName.h +++ b/win/rfb_win32/ModuleFileName.h @@ -25,9 +25,9 @@ namespace rfb { namespace win32 { struct ModuleFileName { - ModuleFileName(HMODULE module=0) { + ModuleFileName(HMODULE module=nullptr) { if (!module) - module = GetModuleHandle(0); + module = GetModuleHandle(nullptr); if (!GetModuleFileName(module, buf, MAX_PATH)) buf[0] = 0; } diff --git a/win/rfb_win32/MonitorInfo.cxx b/win/rfb_win32/MonitorInfo.cxx index c7217c19..fb4fb3a9 100644 --- a/win/rfb_win32/MonitorInfo.cxx +++ b/win/rfb_win32/MonitorInfo.cxx @@ -96,7 +96,7 @@ MonitorInfo::MonitorInfo(const char* devName) { monitorByNameData data; data.info = this; data.monitorName = devName; - EnumDisplayMonitors(0, 0, &monitorByNameEnumProc, (LPARAM)&data); + EnumDisplayMonitors(nullptr, nullptr, &monitorByNameEnumProc, (LPARAM)&data); } void MonitorInfo::moveTo(HWND handle) { @@ -134,7 +134,7 @@ void MonitorInfo::clipTo(HWND handle) { RECT r; GetWindowRect(handle, &r); clipTo(&r); - SetWindowPos(handle, 0, r.left, r.top, r.right-r.left, r.bottom-r.top, + SetWindowPos(handle, nullptr, r.left, r.top, r.right-r.left, r.bottom-r.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER); } diff --git a/win/rfb_win32/MsgBox.h b/win/rfb_win32/MsgBox.h index 25d36383..e831d745 100644 --- a/win/rfb_win32/MsgBox.h +++ b/win/rfb_win32/MsgBox.h @@ -36,7 +36,7 @@ namespace rfb { // Wrapper around Win32 MessageBox() static int MsgBox(HWND parent, const char* msg, UINT flags) { - const char* msgType = 0; + const char* msgType = nullptr; UINT tflags = flags & 0x70; if (tflags == MB_ICONHAND) msgType = "Error"; diff --git a/win/rfb_win32/MsgWindow.cxx b/win/rfb_win32/MsgWindow.cxx index 251b2762..30c9373e 100644 --- a/win/rfb_win32/MsgWindow.cxx +++ b/win/rfb_win32/MsgWindow.cxx @@ -74,11 +74,11 @@ MsgWindowClass::MsgWindowClass() : classAtom(0) { wndClass.lpfnWndProc = MsgWindowProc; wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; - wndClass.hInstance = instance = GetModuleHandle(0); - wndClass.hIcon = 0; - wndClass.hCursor = 0; - wndClass.hbrBackground = 0; - wndClass.lpszMenuName = 0; + wndClass.hInstance = instance = GetModuleHandle(nullptr); + wndClass.hIcon = nullptr; + wndClass.hCursor = nullptr; + wndClass.hbrBackground = nullptr; + wndClass.lpszMenuName = nullptr; wndClass.lpszClassName = "rfb::win32::MsgWindowClass"; classAtom = RegisterClass(&wndClass); if (!classAtom) { @@ -98,11 +98,11 @@ static MsgWindowClass baseClass; // -=- MsgWindow // -MsgWindow::MsgWindow(const char* name_) : name(name_), handle(0) { +MsgWindow::MsgWindow(const char* name_) : name(name_), handle(nullptr) { vlog.debug("creating window \"%s\"", name.c_str()); handle = CreateWindow((const char*)(intptr_t)baseClass.classAtom, - name.c_str(), WS_OVERLAPPED, 0, 0, 10, 10, 0, 0, - baseClass.instance, this); + name.c_str(), WS_OVERLAPPED, 0, 0, 10, 10, + nullptr, nullptr, baseClass.instance, this); if (!handle) { throw rdr::SystemException("unable to create WMNotifier window instance", GetLastError()); } diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx index 38ca52f9..770330ce 100644 --- a/win/rfb_win32/RegConfig.cxx +++ b/win/rfb_win32/RegConfig.cxx @@ -35,7 +35,10 @@ using namespace rfb::win32; static LogWriter vlog("RegConfig"); -RegConfig::RegConfig(EventManager* em) : eventMgr(em), event(CreateEvent(0, TRUE, FALSE, 0)), callback(0) { +RegConfig::RegConfig(EventManager* em) + : eventMgr(em), event(CreateEvent(nullptr, TRUE, FALSE, nullptr)), + callback(nullptr) +{ if (em->addEvent(event, this)) eventMgr = em; } @@ -110,7 +113,7 @@ void RegConfigThread::worker() { BOOL result = 0; MSG msg; thread_id = GetCurrentThreadId(); - while ((result = eventMgr.getMessage(&msg, 0, 0, 0)) > 0) {} + while ((result = eventMgr.getMessage(&msg, nullptr, 0, 0)) > 0) {} if (result < 0) throw rdr::SystemException("RegConfigThread failed", GetLastError()); } diff --git a/win/rfb_win32/RegConfig.h b/win/rfb_win32/RegConfig.h index ef8e45bd..401cb148 100644 --- a/win/rfb_win32/RegConfig.h +++ b/win/rfb_win32/RegConfig.h @@ -56,7 +56,7 @@ namespace rfb { static void loadRegistryConfig(RegKey& key); protected: // EventHandler interface and trigger event - virtual void processEvent(HANDLE event); + void processEvent(HANDLE event) override; EventManager* eventMgr; Handle event; @@ -72,7 +72,7 @@ namespace rfb { // Start the thread, reading from the specified key bool start(const HKEY rootkey, const char* keyname); protected: - virtual void worker(); + void worker() override; EventManager eventMgr; RegConfig config; DWORD thread_id; diff --git a/win/rfb_win32/Registry.cxx b/win/rfb_win32/Registry.cxx index d0db60e2..bcb98704 100644 --- a/win/rfb_win32/Registry.cxx +++ b/win/rfb_win32/Registry.cxx @@ -49,18 +49,18 @@ using namespace rfb::win32; static LogWriter vlog("Registry"); -RegKey::RegKey() : key(0), freeKey(false), valueName(NULL), valueNameBufLen(0) {} +RegKey::RegKey() : key(nullptr), freeKey(false), valueName(nullptr), valueNameBufLen(0) {} -RegKey::RegKey(const HKEY k) : key(0), freeKey(false), valueName(NULL), valueNameBufLen(0) { - LONG result = RegOpenKeyEx(k, 0, 0, KEY_ALL_ACCESS, &key); +RegKey::RegKey(const HKEY k) : key(nullptr), freeKey(false), valueName(nullptr), valueNameBufLen(0) { + LONG result = RegOpenKeyEx(k, nullptr, 0, KEY_ALL_ACCESS, &key); if (result != ERROR_SUCCESS) throw rdr::SystemException("RegOpenKeyEx(HKEY)", result); vlog.debug("duplicated %p to %p", k, key); freeKey = true; } -RegKey::RegKey(const RegKey& k) : key(0), freeKey(false), valueName(NULL), valueNameBufLen(0) { - LONG result = RegOpenKeyEx(k.key, 0, 0, KEY_ALL_ACCESS, &key); +RegKey::RegKey(const RegKey& k) : key(nullptr), freeKey(false), valueName(nullptr), valueNameBufLen(0) { + LONG result = RegOpenKeyEx(k.key, nullptr, 0, KEY_ALL_ACCESS, &key); if (result != ERROR_SUCCESS) throw rdr::SystemException("RegOpenKeyEx(RegKey&)", result); vlog.debug("duplicated %p to %p", k.key, key); @@ -108,7 +108,7 @@ void RegKey::setDACL(const PACL acl, bool inherit) { if ((result = SetSecurityInfo(key, SE_REGISTRY_KEY, DACL_SECURITY_INFORMATION | (inherit ? UNPROTECTED_DACL_SECURITY_INFORMATION : PROTECTED_DACL_SECURITY_INFORMATION), - 0, 0, acl, 0)) != ERROR_SUCCESS) + nullptr, nullptr, acl, nullptr)) != ERROR_SUCCESS) throw rdr::SystemException("RegKey::setDACL failed", result); } @@ -116,7 +116,7 @@ void RegKey::close() { if (freeKey) { vlog.debug("RegCloseKey(%p)", key); RegCloseKey(key); - key = 0; + key = nullptr; } } @@ -133,7 +133,7 @@ void RegKey::deleteValue(const char* name) const { } void RegKey::awaitChange(bool watchSubTree, DWORD filter, HANDLE event) const { - LONG result = RegNotifyChangeKeyValue(key, watchSubTree, filter, event, event != 0); + LONG result = RegNotifyChangeKeyValue(key, watchSubTree, filter, event, event != nullptr); if (result != ERROR_SUCCESS) throw rdr::SystemException("RegNotifyChangeKeyValue", result); } @@ -212,11 +212,11 @@ bool RegKey::getBool(const char* valname, bool def) const { std::string RegKey::getRepresentation(const char* valname) const { DWORD type, length; - LONG result = RegQueryValueEx(key, valname, 0, &type, 0, &length); + LONG result = RegQueryValueEx(key, valname, nullptr, &type, nullptr, &length); if (result != ERROR_SUCCESS) throw rdr::SystemException("get registry value length", result); std::vector<uint8_t> data(length); - result = RegQueryValueEx(key, valname, 0, &type, (BYTE*)data.data(), &length); + result = RegQueryValueEx(key, valname, nullptr, &type, (BYTE*)data.data(), &length); if (result != ERROR_SUCCESS) throw rdr::SystemException("get registry value", result); @@ -241,14 +241,14 @@ std::string RegKey::getRepresentation(const char* valname) const { { if (length) { std::string str((char*)data.data(), length); - DWORD required = ExpandEnvironmentStrings(str.c_str(), 0, 0); + DWORD required = ExpandEnvironmentStrings(str.c_str(), nullptr, 0); if (required==0) throw rdr::SystemException("ExpandEnvironmentStrings", GetLastError()); - std::vector<char> result(required); - length = ExpandEnvironmentStrings(str.c_str(), result.data(), required); + std::vector<char> expanded(required); + length = ExpandEnvironmentStrings(str.c_str(), expanded.data(), required); if (required<length) throw rdr::Exception("unable to expand environment strings"); - return result.data(); + return expanded.data(); } else { return ""; } @@ -269,7 +269,7 @@ bool RegKey::isValue(const char* valname) const { const char* RegKey::getValueName(int i) { DWORD maxValueNameLen; - LONG result = RegQueryInfoKey(key, 0, 0, 0, 0, 0, 0, 0, &maxValueNameLen, 0, 0, 0); + LONG result = RegQueryInfoKey(key, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, &maxValueNameLen, nullptr, nullptr, nullptr); if (result != ERROR_SUCCESS) throw rdr::SystemException("RegQueryInfoKey", result); if (valueNameBufLen < maxValueNameLen + 1) { @@ -278,8 +278,8 @@ const char* RegKey::getValueName(int i) { valueName = new char[valueNameBufLen]; } DWORD length = valueNameBufLen; - result = RegEnumValue(key, i, valueName, &length, NULL, 0, 0, 0); - if (result == ERROR_NO_MORE_ITEMS) return 0; + result = RegEnumValue(key, i, valueName, &length, nullptr, nullptr, nullptr, nullptr); + if (result == ERROR_NO_MORE_ITEMS) return nullptr; if (result != ERROR_SUCCESS) throw rdr::SystemException("RegEnumValue", result); return valueName; @@ -287,7 +287,7 @@ const char* RegKey::getValueName(int i) { const char* RegKey::getKeyName(int i) { DWORD maxValueNameLen; - LONG result = RegQueryInfoKey(key, 0, 0, 0, 0, &maxValueNameLen, 0, 0, 0, 0, 0, 0); + LONG result = RegQueryInfoKey(key, nullptr, nullptr, nullptr, nullptr, &maxValueNameLen, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); if (result != ERROR_SUCCESS) throw rdr::SystemException("RegQueryInfoKey", result); if (valueNameBufLen < maxValueNameLen + 1) { @@ -296,8 +296,8 @@ const char* RegKey::getKeyName(int i) { valueName = new char[valueNameBufLen]; } DWORD length = valueNameBufLen; - result = RegEnumKeyEx(key, i, valueName, &length, NULL, 0, 0, 0); - if (result == ERROR_NO_MORE_ITEMS) return 0; + result = RegEnumKeyEx(key, i, valueName, &length, nullptr, nullptr, nullptr, nullptr); + if (result == ERROR_NO_MORE_ITEMS) return nullptr; if (result != ERROR_SUCCESS) throw rdr::SystemException("RegEnumKey", result); return valueName; diff --git a/win/rfb_win32/Registry.h b/win/rfb_win32/Registry.h index b99c95bc..10c9e099 100644 --- a/win/rfb_win32/Registry.h +++ b/win/rfb_win32/Registry.h @@ -68,7 +68,7 @@ namespace rfb { // Block waiting for a registry change, OR return immediately and notify the // event when there is a change, if specified - void awaitChange(bool watchSubTree, DWORD filter, HANDLE event=0) const; + void awaitChange(bool watchSubTree, DWORD filter, HANDLE event=nullptr) const; void setExpandString(const char* valname, const char* s) const; void setString(const char* valname, const char* s) const; diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx index 612f883b..0ec5e231 100644 --- a/win/rfb_win32/SDisplay.cxx +++ b/win/rfb_win32/SDisplay.cxx @@ -70,13 +70,13 @@ BoolParameter rfb::win32::SDisplay::disableEffects("DisableEffects", // -=- Constructor/Destructor SDisplay::SDisplay() - : server(0), pb(0), device(0), - core(0), ptr(0), kbd(0), clipboard(0), - inputs(0), monitor(0), cleanDesktop(0), cursor(0), - statusLocation(0), queryConnectionHandler(0), ledState(0) + : server(nullptr), pb(nullptr), device(nullptr), + core(nullptr), ptr(nullptr), kbd(nullptr), clipboard(nullptr), + inputs(nullptr), monitor(nullptr), cleanDesktop(nullptr), cursor(nullptr), + statusLocation(nullptr), queryConnectionHandler(nullptr), ledState(0) { - updateEvent.h = CreateEvent(0, TRUE, FALSE, 0); - terminateEvent.h = CreateEvent(0, TRUE, FALSE, 0); + updateEvent.h = CreateEvent(nullptr, TRUE, FALSE, nullptr); + terminateEvent.h = CreateEvent(nullptr, TRUE, FALSE, nullptr); } SDisplay::~SDisplay() @@ -89,14 +89,19 @@ SDisplay::~SDisplay() // the VNCServer ought not to exist and therefore we shouldn't invoke any // methods on it. Setting server to zero here ensures that stop() doesn't // call setPixelBuffer(0) on the server. - server = 0; + server = nullptr; if (core) stop(); } // -=- SDesktop interface -void SDisplay::start(VNCServer* vs) +void SDisplay::init(VNCServer* vs) +{ + server = vs; +} + +void SDisplay::start() { vlog.debug("starting"); @@ -105,7 +110,6 @@ void SDisplay::start(VNCServer* vs) setConsoleSession(); // Start the SDisplay core - server = vs; startCore(); vlog.debug("started"); @@ -135,10 +139,8 @@ void SDisplay::stop() } // Stop the SDisplayCore - if (server) - server->setPixelBuffer(0); + server->setPixelBuffer(nullptr); stopCore(); - server = 0; vlog.debug("stopped"); @@ -154,7 +156,7 @@ void SDisplay::terminate() void SDisplay::queryConnection(network::Socket* sock, const char* userName) { - assert(server != NULL); + assert(server != nullptr); if (queryConnectionHandler) { queryConnectionHandler->queryConnection(sock, userName); @@ -196,7 +198,7 @@ void SDisplay::startCore() { core = new SDisplayCorePolling(this, &updates); core->setScreenRect(screenRect); } catch (rdr::Exception& e) { - delete core; core = 0; + delete core; core = nullptr; if (tryMethod == 0) throw rdr::Exception("unable to access desktop"); tryMethod--; @@ -232,16 +234,16 @@ void SDisplay::startCore() { void SDisplay::stopCore() { if (core) vlog.info("Stopping %s", core->methodName()); - delete core; core = 0; - delete pb; pb = 0; - delete device; device = 0; - delete monitor; monitor = 0; - delete clipboard; clipboard = 0; - delete inputs; inputs = 0; - delete ptr; ptr = 0; - delete kbd; kbd = 0; - delete cleanDesktop; cleanDesktop = 0; - delete cursor; cursor = 0; + delete core; core = nullptr; + delete pb; pb = nullptr; + delete device; device = nullptr; + delete monitor; monitor = nullptr; + delete clipboard; clipboard = nullptr; + delete inputs; inputs = nullptr; + delete ptr; ptr = nullptr; + delete kbd; kbd = nullptr; + delete cleanDesktop; cleanDesktop = nullptr; + delete cursor; cursor = nullptr; ResetEvent(updateEvent); } @@ -310,7 +312,7 @@ void SDisplay::handleClipboardData(const char* data) { } -void SDisplay::pointerEvent(const Point& pos, int buttonmask) { +void SDisplay::pointerEvent(const Point& pos, uint8_t buttonmask) { if (pb->getRect().contains(pos)) { Point screenPos = pos.translate(screenRect.tl); // - Check that the SDesktop doesn't need restarting @@ -414,7 +416,7 @@ SDisplay::processEvent(HANDLE event) { // Update the cursor shape if (set_cursor) - pb->setCursor(info.visible ? info.cursor : 0, server); + pb->setCursor(info.visible ? info.cursor : nullptr, server); // Update the cursor position // NB: First translate from Screen coordinates to Desktop @@ -445,14 +447,14 @@ SDisplay::recreatePixelBuffer(bool force) { // If no device is specified, open entire screen using GetDC(). // Opening the whole display with CreateDC doesn't work on multi-monitor // systems for some reason. - DeviceContext* new_device = 0; + DeviceContext* new_device = nullptr; if (strlen(displayDevice) > 0) { vlog.info("Attaching to device %s", (const char*)displayDevice); new_device = new DeviceDC(displayDevice); } if (!new_device) { vlog.info("Attaching to virtual desktop"); - new_device = new WindowDC(0); + new_device = new WindowDC(nullptr); } // Get the coordinates of the specified dispay device diff --git a/win/rfb_win32/SDisplay.h b/win/rfb_win32/SDisplay.h index febc720e..d4cf23e4 100644 --- a/win/rfb_win32/SDisplay.h +++ b/win/rfb_win32/SDisplay.h @@ -71,30 +71,31 @@ namespace rfb { // -=- SDesktop interface - virtual void start(VNCServer* vs); - virtual void stop(); - virtual void terminate(); - virtual void queryConnection(network::Socket* sock, - const char* userName); - virtual void handleClipboardRequest(); - virtual void handleClipboardAnnounce(bool available); - virtual void handleClipboardData(const char* data); - virtual void pointerEvent(const Point& pos, int buttonmask); - virtual void keyEvent(uint32_t keysym, uint32_t keycode, bool down); + void init(VNCServer* vs) override; + void start() override; + void stop() override; + void terminate() override; + void queryConnection(network::Socket* sock, + const char* userName) override; + void handleClipboardRequest() override; + void handleClipboardAnnounce(bool available) override; + void handleClipboardData(const char* data) override; + void pointerEvent(const Point& pos, uint8_t buttonmask) override; + void keyEvent(uint32_t keysym, uint32_t keycode, bool down) override; // -=- Clipboard events - virtual void notifyClipboardChanged(bool available); + void notifyClipboardChanged(bool available) override; // -=- Display events - virtual void notifyDisplayEvent(WMMonitor::Notifier::DisplayEventType evt); + void notifyDisplayEvent(WMMonitor::Notifier::DisplayEventType evt) override; // -=- EventHandler interface HANDLE getUpdateEvent() {return updateEvent;} HANDLE getTerminateEvent() {return terminateEvent;} - virtual void processEvent(HANDLE event); + void processEvent(HANDLE event) override; // -=- Notification of whether or not SDisplay is started diff --git a/win/rfb_win32/SDisplayCorePolling.h b/win/rfb_win32/SDisplayCorePolling.h index 9a8bc29b..00de2d40 100644 --- a/win/rfb_win32/SDisplayCorePolling.h +++ b/win/rfb_win32/SDisplayCorePolling.h @@ -40,17 +40,17 @@ namespace rfb { ~SDisplayCorePolling(); // - Called by SDisplay to inform Core of the screen size - virtual void setScreenRect(const Rect& screenRect_); + void setScreenRect(const Rect& screenRect_) override; // - Called by SDisplay to flush updates to the specified tracker - virtual void flushUpdates(); + void flushUpdates() override; - virtual const char* methodName() const { return "Polling"; } + const char* methodName() const override { return "Polling"; } protected: // - MsgWindow overrides // processMessage is used to service the cursor & polling timers - virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam); + LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam) override; // - Hooking subcomponents used to track the desktop state WMCopyRect copyrect; diff --git a/win/rfb_win32/SDisplayCoreWMHooks.h b/win/rfb_win32/SDisplayCoreWMHooks.h index 82557f13..3358a1ee 100644 --- a/win/rfb_win32/SDisplayCoreWMHooks.h +++ b/win/rfb_win32/SDisplayCoreWMHooks.h @@ -43,14 +43,14 @@ namespace rfb { ~SDisplayCoreWMHooks(); // - Called by SDisplay to flush updates to the specified tracker - virtual void flushUpdates(); + void flushUpdates() override; - virtual const char* methodName() const { return "VNC Hooks"; } + const char* methodName() const override { return "VNC Hooks"; } protected: // - MsgWindow overrides // processMessage is used to service the cursor & polling timers - virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam); + LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam) override; // - Hooking subcomponents used to track the desktop state WMHooks hooks; diff --git a/win/rfb_win32/SInput.cxx b/win/rfb_win32/SInput.cxx index 94df6e98..65d4a703 100644 --- a/win/rfb_win32/SInput.cxx +++ b/win/rfb_win32/SInput.cxx @@ -65,7 +65,7 @@ win32::SPointer::SPointer() } void -win32::SPointer::pointerEvent(const Point& pos, int buttonmask) +win32::SPointer::pointerEvent(const Point& pos, uint8_t buttonmask) { // - We are specifying absolute coordinates DWORD flags = MOUSEEVENTF_ABSOLUTE; diff --git a/win/rfb_win32/SInput.h b/win/rfb_win32/SInput.h index 9013a37e..29e1df41 100644 --- a/win/rfb_win32/SInput.h +++ b/win/rfb_win32/SInput.h @@ -44,7 +44,7 @@ namespace rfb { // - Create a pointer event at a the given coordinates, with the // specified button state. The event must be specified using // Screen coordinates. - void pointerEvent(const Point& pos, int buttonmask); + void pointerEvent(const Point& pos, uint8_t buttonmask); protected: Point last_position; uint8_t last_buttonmask; diff --git a/win/rfb_win32/Security.cxx b/win/rfb_win32/Security.cxx index 8dfc5b8d..e706ddb4 100644 --- a/win/rfb_win32/Security.cxx +++ b/win/rfb_win32/Security.cxx @@ -38,7 +38,7 @@ static LogWriter vlog("SecurityWin32"); Trustee::Trustee(const char* name, TRUSTEE_FORM form, TRUSTEE_TYPE type) { - pMultipleTrustee = 0; + pMultipleTrustee = nullptr; MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; TrusteeForm = form; TrusteeType = type; @@ -58,7 +58,7 @@ ExplicitAccess::ExplicitAccess(const char* name, } -AccessEntries::AccessEntries() : entries(0), entry_count(0) {} +AccessEntries::AccessEntries() : entries(nullptr), entry_count(0) {} AccessEntries::~AccessEntries() { delete [] entries; @@ -115,19 +115,19 @@ void Sid::getUserNameAndDomain(char** name, char** domain) { DWORD nameLen = 0; DWORD domainLen = 0; SID_NAME_USE use; - LookupAccountSid(0, (PSID)*this, 0, &nameLen, 0, &domainLen, &use); + LookupAccountSid(nullptr, (PSID)*this, nullptr, &nameLen, nullptr, &domainLen, &use); if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) throw rdr::SystemException("Unable to determine SID name lengths", GetLastError()); vlog.info("nameLen=%lu, domainLen=%lu, use=%d", nameLen, domainLen, use); *name = new char[nameLen]; *domain = new char[domainLen]; - if (!LookupAccountSid(0, (PSID)*this, *name, &nameLen, *domain, &domainLen, &use)) + if (!LookupAccountSid(nullptr, (PSID)*this, *name, &nameLen, *domain, &domainLen, &use)) throw rdr::SystemException("Unable to lookup account SID", GetLastError()); } Sid::Administrators::Administrators() { - PSID sid = 0; + PSID sid = nullptr; SID_IDENTIFIER_AUTHORITY ntAuth = { SECURITY_NT_AUTHORITY }; if (!AllocateAndInitializeSid(&ntAuth, 2, SECURITY_BUILTIN_DOMAIN_RID, @@ -139,7 +139,7 @@ Sid::Administrators::Administrators() { } Sid::SYSTEM::SYSTEM() { - PSID sid = 0; + PSID sid = nullptr; SID_IDENTIFIER_AUTHORITY ntAuth = { SECURITY_NT_AUTHORITY }; if (!AllocateAndInitializeSid(&ntAuth, 1, SECURITY_LOCAL_SYSTEM_RID, @@ -151,7 +151,7 @@ Sid::SYSTEM::SYSTEM() { Sid::FromToken::FromToken(HANDLE h) { DWORD required = 0; - GetTokenInformation(h, TokenUser, 0, 0, &required); + GetTokenInformation(h, TokenUser, nullptr, 0, &required); std::vector<uint8_t> tmp(required); if (!GetTokenInformation(h, TokenUser, tmp.data(), tmp.size(), &required)) throw rdr::SystemException("GetTokenInformation", GetLastError()); diff --git a/win/rfb_win32/Security.h b/win/rfb_win32/Security.h index a24c359f..a4471f97 100644 --- a/win/rfb_win32/Security.h +++ b/win/rfb_win32/Security.h @@ -96,17 +96,17 @@ namespace rfb { // Helper class for handling & freeing ACLs struct AccessControlList : public LocalMem { AccessControlList(int size) : LocalMem(size) {} - AccessControlList(PACL acl_=0) : LocalMem(acl_) {} + AccessControlList(PACL acl_=nullptr) : LocalMem(acl_) {} operator PACL() {return (PACL)ptr;} }; // Create a new ACL based on supplied entries and, if supplied, existing ACL - PACL CreateACL(const AccessEntries& ae, PACL existing_acl=0); + PACL CreateACL(const AccessEntries& ae, PACL existing_acl=nullptr); // Helper class for memory-management of self-relative SecurityDescriptors struct SecurityDescriptorPtr : LocalMem { SecurityDescriptorPtr(int size) : LocalMem(size) {} - SecurityDescriptorPtr(PSECURITY_DESCRIPTOR sd_=0) : LocalMem(sd_) {} + SecurityDescriptorPtr(PSECURITY_DESCRIPTOR sd_=nullptr) : LocalMem(sd_) {} PSECURITY_DESCRIPTOR takeSD() {return (PSECURITY_DESCRIPTOR)takePtr();} }; diff --git a/win/rfb_win32/SecurityPage.cxx b/win/rfb_win32/SecurityPage.cxx index 600a8a34..a6f026cf 100644 --- a/win/rfb_win32/SecurityPage.cxx +++ b/win/rfb_win32/SecurityPage.cxx @@ -40,7 +40,7 @@ static LogWriter vlog("AuthDialog"); /* XXX: This class contains bunch of similar code to unix/vncviewer/CConn.cxx */ SecurityPage::SecurityPage(Security *security_) - : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_SECURITY)), + : PropSheetPage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_SECURITY)), security(security_) { } @@ -48,7 +48,6 @@ void SecurityPage::initDialog() { list<uint8_t> secTypes; - list<uint8_t>::iterator i; if (isItemChecked(IDC_ENC_X509)) enableX509Dialogs(); @@ -58,8 +57,8 @@ SecurityPage::initDialog() secTypes = security->GetEnabledSecTypes(); /* Process non-VeNCrypt sectypes */ - for (i = secTypes.begin(); i != secTypes.end(); i++) { - switch (*i) { + for (uint8_t type : secTypes) { + switch (type) { case secTypeNone: enableAuthMethod(IDC_ENC_NONE, IDC_AUTH_NONE); break; @@ -70,13 +69,12 @@ SecurityPage::initDialog() } list<uint32_t> secTypesExt; - list<uint32_t>::iterator iext; secTypesExt = security->GetEnabledExtSecTypes(); /* Process VeNCrypt subtypes */ - for (iext = secTypesExt.begin(); iext != secTypesExt.end(); iext++) { - switch (*iext) { + for (uint32_t type : secTypesExt) { + switch (type) { case secTypePlain: enableAuthMethod(IDC_ENC_NONE, IDC_AUTH_PLAIN); break; diff --git a/win/rfb_win32/SecurityPage.h b/win/rfb_win32/SecurityPage.h index 258b58e0..62c50388 100644 --- a/win/rfb_win32/SecurityPage.h +++ b/win/rfb_win32/SecurityPage.h @@ -39,9 +39,9 @@ public: virtual void disableX509Dialogs(void) = 0; virtual void loadVncPasswd(void) = 0; - virtual void initDialog(); - virtual bool onCommand(int id, int cmd); - virtual bool onOk(); + void initDialog() override; + bool onCommand(int id, int cmd) override; + bool onOk() override; protected: Security *security; diff --git a/win/rfb_win32/Service.cxx b/win/rfb_win32/Service.cxx index 62230b07..dafa38b5 100644 --- a/win/rfb_win32/Service.cxx +++ b/win/rfb_win32/Service.cxx @@ -42,7 +42,7 @@ static LogWriter vlog("Service"); // - Internal service implementation functions -Service* service = 0; +Service* service = nullptr; bool runAsService = false; VOID WINAPI serviceHandler(DWORD control) { @@ -93,7 +93,7 @@ VOID WINAPI serviceProc(DWORD dwArgc, LPTSTR* lpszArgv) { Service::Service(const char* name_) : name(name_) { vlog.debug("Service"); - status_handle = 0; + status_handle = nullptr; status.dwControlsAccepted = SERVICE_CONTROL_INTERROGATE | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP; status.dwServiceType = SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS; status.dwWin32ExitCode = NO_ERROR; @@ -108,8 +108,8 @@ Service::start() { SERVICE_TABLE_ENTRY entry[2]; entry[0].lpServiceName = (char*)name; entry[0].lpServiceProc = serviceProc; - entry[1].lpServiceName = NULL; - entry[1].lpServiceProc = NULL; + entry[1].lpServiceName = nullptr; + entry[1].lpServiceProc = nullptr; vlog.debug("entering dispatcher"); if (!SetProcessShutdownParameters(0x100, 0)) vlog.error("unable to set shutdown parameters: %lu", GetLastError()); @@ -125,7 +125,7 @@ Service::setStatus() { void Service::setStatus(DWORD state) { - if (status_handle == 0) { + if (status_handle == nullptr) { vlog.debug("warning - cannot setStatus"); return; } @@ -141,7 +141,7 @@ Service::setStatus(DWORD state) { Service::~Service() { vlog.debug("~Service"); - service = 0; + service = nullptr; } @@ -254,7 +254,7 @@ rfb::win32::changeDesktop() { bool rfb::win32::emulateCtrlAltDel() { rfb::win32::Handle sessionEventCad = - CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNCCad"); + CreateEvent(nullptr, FALSE, FALSE, "Global\\SessionEventTigerVNCCad"); SetEvent(sessionEventCad); return true; } @@ -265,7 +265,7 @@ rfb::win32::emulateCtrlAltDel() { class Logger_EventLog : public Logger { public: Logger_EventLog(const char* srcname) : Logger("EventLog") { - eventlog = RegisterEventSource(NULL, srcname); + eventlog = RegisterEventSource(nullptr, srcname); if (!eventlog) printf("Unable to open event log:%ld\n", GetLastError()); } @@ -274,12 +274,12 @@ public: DeregisterEventSource(eventlog); } - virtual void write(int level, const char *logname, const char *message) { + void write(int level, const char *logname, const char *message) override { if (!eventlog) return; const char* strings[] = {logname, message}; WORD type = EVENTLOG_INFORMATION_TYPE; if (level == 0) type = EVENTLOG_ERROR_TYPE; - if (!ReportEvent(eventlog, type, 0, VNC4LogMessage, NULL, 2, 0, strings, NULL)) { + if (!ReportEvent(eventlog, type, 0, VNC4LogMessage, nullptr, 2, 0, strings, nullptr)) { // *** It's not at all clear what is the correct behaviour if this fails... printf("ReportEvent failed:%ld\n", GetLastError()); } @@ -289,7 +289,7 @@ protected: HANDLE eventlog; }; -static Logger_EventLog* logger = 0; +static Logger_EventLog* logger = nullptr; bool rfb::win32::initEventLogLogger(const char* srcname) { if (logger) @@ -333,22 +333,22 @@ bool rfb::win32::registerService(const char* name, // - Register the service // - Open the SCM - ServiceHandle scm = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE); + ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CREATE_SERVICE); if (!scm) throw rdr::SystemException("unable to open Service Control Manager", GetLastError()); // - Add the service - ServiceHandle service = CreateService(scm, + ServiceHandle handle = CreateService(scm, name, display, SC_MANAGER_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_IGNORE, - cmdline.c_str(), NULL, NULL, NULL, NULL, NULL); - if (!service) + cmdline.c_str(), nullptr, nullptr, nullptr, nullptr, nullptr); + if (!handle) throw rdr::SystemException("unable to create service", GetLastError()); // - Set a description SERVICE_DESCRIPTION sdesc = {(LPTSTR)desc}; - ChangeServiceConfig2(service, SERVICE_CONFIG_DESCRIPTION, &sdesc); + ChangeServiceConfig2(handle, SERVICE_CONFIG_DESCRIPTION, &sdesc); // - Register the event log source RegKey hk, hk2; @@ -378,15 +378,15 @@ bool rfb::win32::registerService(const char* name, bool rfb::win32::unregisterService(const char* name) { // - Open the SCM - ServiceHandle scm = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE); + ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CREATE_SERVICE); if (!scm) throw rdr::SystemException("unable to open Service Control Manager", GetLastError()); // - Create the service - ServiceHandle service = OpenService(scm, name, SC_MANAGER_ALL_ACCESS); - if (!service) + ServiceHandle handle = OpenService(scm, name, SC_MANAGER_ALL_ACCESS); + if (!handle) throw rdr::SystemException("unable to locate the service", GetLastError()); - if (!DeleteService(service)) + if (!DeleteService(handle)) throw rdr::SystemException("unable to remove the service", GetLastError()); // - Register the event log source @@ -405,17 +405,17 @@ bool rfb::win32::unregisterService(const char* name) { bool rfb::win32::startService(const char* name) { // - Open the SCM - ServiceHandle scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); + ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT); if (!scm) throw rdr::SystemException("unable to open Service Control Manager", GetLastError()); // - Locate the service - ServiceHandle service = OpenService(scm, name, SERVICE_START); - if (!service) + ServiceHandle handle = OpenService(scm, name, SERVICE_START); + if (!handle) throw rdr::SystemException("unable to open the service", GetLastError()); // - Start the service - if (!StartService(service, 0, NULL)) + if (!StartService(handle, 0, nullptr)) throw rdr::SystemException("unable to start the service", GetLastError()); Sleep(500); @@ -425,18 +425,18 @@ bool rfb::win32::startService(const char* name) { bool rfb::win32::stopService(const char* name) { // - Open the SCM - ServiceHandle scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); + ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT); if (!scm) throw rdr::SystemException("unable to open Service Control Manager", GetLastError()); // - Locate the service - ServiceHandle service = OpenService(scm, name, SERVICE_STOP); - if (!service) + ServiceHandle handle = OpenService(scm, name, SERVICE_STOP); + if (!handle) throw rdr::SystemException("unable to open the service", GetLastError()); // - Start the service SERVICE_STATUS status; - if (!ControlService(service, SERVICE_CONTROL_STOP, &status)) + if (!ControlService(handle, SERVICE_CONTROL_STOP, &status)) throw rdr::SystemException("unable to stop the service", GetLastError()); Sleep(500); @@ -446,18 +446,18 @@ bool rfb::win32::stopService(const char* name) { DWORD rfb::win32::getServiceState(const char* name) { // - Open the SCM - ServiceHandle scm = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); + ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT); if (!scm) throw rdr::SystemException("unable to open Service Control Manager", GetLastError()); // - Locate the service - ServiceHandle service = OpenService(scm, name, SERVICE_INTERROGATE); - if (!service) + ServiceHandle handle = OpenService(scm, name, SERVICE_INTERROGATE); + if (!handle) throw rdr::SystemException("unable to open the service", GetLastError()); // - Get the service status SERVICE_STATUS status; - if (!ControlService(service, SERVICE_CONTROL_INTERROGATE, (SERVICE_STATUS*)&status)) + if (!ControlService(handle, SERVICE_CONTROL_INTERROGATE, (SERVICE_STATUS*)&status)) throw rdr::SystemException("unable to query the service", GetLastError()); return status.dwCurrentState; diff --git a/win/rfb_win32/SocketManager.cxx b/win/rfb_win32/SocketManager.cxx index 8e88b79b..57b65aef 100644 --- a/win/rfb_win32/SocketManager.cxx +++ b/win/rfb_win32/SocketManager.cxx @@ -50,7 +50,7 @@ SocketManager::~SocketManager() { static void requestAddressChangeEvents(network::SocketListener* sock_) { DWORD dummy = 0; - if (WSAIoctl(sock_->getFd(), SIO_ADDRESS_LIST_CHANGE, 0, 0, 0, 0, &dummy, 0, 0) == SOCKET_ERROR) { + if (WSAIoctl(sock_->getFd(), SIO_ADDRESS_LIST_CHANGE, nullptr, 0, nullptr, 0, &dummy, nullptr, nullptr) == SOCKET_ERROR) { DWORD err = WSAGetLastError(); if (err != WSAEWOULDBLOCK) vlog.error("Unable to track address changes: 0x%08x", (unsigned)err); @@ -169,9 +169,9 @@ void SocketManager::setDisable(VNCServer* srvr, bool disable) int SocketManager::checkTimeouts() { int timeout = EventManager::checkTimeouts(); - std::map<HANDLE,ListenInfo>::iterator i; - for (i=listeners.begin(); i!=listeners.end(); i++) - soonestTimeout(&timeout, Timer::checkTimeouts()); + int nextTimeout = Timer::checkTimeouts(); + if (nextTimeout >= 0 && nextTimeout < timeout) + timeout = nextTimeout; std::list<network::Socket*> shutdownSocks; std::map<HANDLE,ConnInfo>::iterator j, j_next; @@ -210,7 +210,7 @@ void SocketManager::processEvent(HANDLE event) { network::Socket* new_sock = li.sock->accept(); if (new_sock && li.disable) { delete new_sock; - new_sock = 0; + new_sock = nullptr; } if (new_sock) addSocket(new_sock, li.server, false); @@ -229,11 +229,11 @@ void SocketManager::processEvent(HANDLE event) { try { // Process data from an active connection - WSANETWORKEVENTS events; + WSANETWORKEVENTS network_events; long eventMask; // Fetch why this event notification triggered - if (WSAEnumNetworkEvents(ci.sock->getFd(), event, &events) == SOCKET_ERROR) + if (WSAEnumNetworkEvents(ci.sock->getFd(), event, &network_events) == SOCKET_ERROR) throw rdr::SystemException("unable to get WSAEnumNetworkEvents:%u", WSAGetLastError()); // Cancel event notification for this socket @@ -245,14 +245,14 @@ void SocketManager::processEvent(HANDLE event) { // Call the socket server to process the event - if (events.lNetworkEvents & FD_WRITE) { + if (network_events.lNetworkEvents & FD_WRITE) { ci.server->processSocketWriteEvent(ci.sock); if (ci.sock->isShutdown()) { remSocket(ci.sock); return; } } - if (events.lNetworkEvents & (FD_READ | FD_CLOSE)) { + if (network_events.lNetworkEvents & (FD_READ | FD_CLOSE)) { ci.server->processSocketReadEvent(ci.sock); if (ci.sock->isShutdown()) { remSocket(ci.sock); diff --git a/win/rfb_win32/SocketManager.h b/win/rfb_win32/SocketManager.h index 809c470e..4302bbbe 100644 --- a/win/rfb_win32/SocketManager.h +++ b/win/rfb_win32/SocketManager.h @@ -61,7 +61,7 @@ namespace rfb { // VNCServer. void addListener(network::SocketListener* sock_, VNCServer* srvr, - AddressChangeNotifier* acn = 0); + AddressChangeNotifier* acn = nullptr); // Remove and delete a listening socket. void remListener(network::SocketListener* sock); @@ -75,8 +75,8 @@ namespace rfb { void setDisable(VNCServer* srvr, bool disable); protected: - virtual int checkTimeouts(); - virtual void processEvent(HANDLE event); + int checkTimeouts() override; + void processEvent(HANDLE event) override; virtual void remSocket(network::Socket* sock); struct ConnInfo { diff --git a/win/rfb_win32/TrayIcon.h b/win/rfb_win32/TrayIcon.h index c99203d1..61d2c9ac 100644 --- a/win/rfb_win32/TrayIcon.h +++ b/win/rfb_win32/TrayIcon.h @@ -43,7 +43,7 @@ namespace rfb { nid.hWnd = getHandle(); nid.uID = 0; - nid.hIcon = 0; + nid.hIcon = nullptr; nid.uFlags = NIF_ICON | NIF_MESSAGE; nid.uCallbackMessage = WM_USER; } @@ -54,13 +54,13 @@ namespace rfb { if (icon == 0) { return remove(); } else { - nid.hIcon = (HICON)LoadImage(GetModuleHandle(0), MAKEINTRESOURCE(icon), + nid.hIcon = (HICON)LoadImage(GetModuleHandle(nullptr), MAKEINTRESOURCE(icon), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); return refresh(); } } bool setToolTip(const char* text) { - if (text == 0) { + if (text == nullptr) { nid.uFlags &= ~NIF_TIP; } else { const int tipLen = sizeof(nid.szTip)/sizeof(char); diff --git a/win/rfb_win32/WMCursor.cxx b/win/rfb_win32/WMCursor.cxx index 32a89930..54e31cdc 100644 --- a/win/rfb_win32/WMCursor.cxx +++ b/win/rfb_win32/WMCursor.cxx @@ -32,8 +32,8 @@ using namespace rfb::win32; static LogWriter vlog("WMCursor"); -WMCursor::WMCursor() : cursor(0) { - cursor = (HCURSOR)LoadImage(0, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE | LR_SHARED); +WMCursor::WMCursor() : cursor(nullptr) { + cursor = (HCURSOR)LoadImage(nullptr, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE | LR_SHARED); } WMCursor::~WMCursor() { diff --git a/win/rfb_win32/WMCursor.h b/win/rfb_win32/WMCursor.h index f4366583..465331de 100644 --- a/win/rfb_win32/WMCursor.h +++ b/win/rfb_win32/WMCursor.h @@ -40,7 +40,7 @@ namespace rfb { HCURSOR cursor; Point position; bool visible; - Info() : cursor(0), visible(false) {} + Info() : cursor(nullptr), visible(false) {} bool operator!=(const Info& info) { return ((cursor != info.cursor) || (position != info.position) || diff --git a/win/rfb_win32/WMHooks.cxx b/win/rfb_win32/WMHooks.cxx index 017972ba..cb2e0275 100644 --- a/win/rfb_win32/WMHooks.cxx +++ b/win/rfb_win32/WMHooks.cxx @@ -65,52 +65,52 @@ static WM_Hooks_EnableRealInputs_proto WM_Hooks_EnableRealInputs; static void LoadHooks() { - if (hooksLibrary != NULL) + if (hooksLibrary != nullptr) return; hooksLibrary = LoadLibrary("wm_hooks.dll"); - if (hooksLibrary == NULL) + if (hooksLibrary == nullptr) return; WM_Hooks_WindowChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_WindowChanged"); - if (WM_Hooks_WindowChanged == NULL) + if (WM_Hooks_WindowChanged == nullptr) goto error; WM_Hooks_WindowBorderChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_WindowBorderChanged"); - if (WM_Hooks_WindowBorderChanged == NULL) + if (WM_Hooks_WindowBorderChanged == nullptr) goto error; WM_Hooks_WindowClientAreaChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_WindowClientAreaChanged"); - if (WM_Hooks_WindowClientAreaChanged == NULL) + if (WM_Hooks_WindowClientAreaChanged == nullptr) goto error; WM_Hooks_RectangleChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_RectangleChanged"); - if (WM_Hooks_RectangleChanged == NULL) + if (WM_Hooks_RectangleChanged == nullptr) goto error; #ifdef _DEBUG WM_Hooks_Diagnostic = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_Diagnostic"); - if (WM_Hooks_Diagnostic == NULL) + if (WM_Hooks_Diagnostic == nullptr) goto error; #endif WM_Hooks_Install = (WM_Hooks_Install_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_Install"); - if (WM_Hooks_Install == NULL) + if (WM_Hooks_Install == nullptr) goto error; WM_Hooks_Remove = (WM_Hooks_Remove_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_Remove"); - if (WM_Hooks_Remove == NULL) + if (WM_Hooks_Remove == nullptr) goto error; #ifdef _DEBUG WM_Hooks_SetDiagnosticRange = (WM_Hooks_SetDiagnosticRange_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_SetDiagnosticRange"); - if (WM_Hooks_SetDiagnosticRange == NULL) + if (WM_Hooks_SetDiagnosticRange == nullptr) goto error; #endif WM_Hooks_EnableRealInputs = (WM_Hooks_EnableRealInputs_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_EnableRealInputs"); - if (WM_Hooks_EnableRealInputs == NULL) + if (WM_Hooks_EnableRealInputs == nullptr) goto error; return; error: FreeLibrary(hooksLibrary); - hooksLibrary = NULL; + hooksLibrary = nullptr; } @@ -120,13 +120,13 @@ public: void stop(); DWORD getThreadId() { return thread_id; } protected: - virtual void worker(); + void worker() override; protected: bool active; DWORD thread_id; }; -static WMHooksThread* hook_mgr = 0; +static WMHooksThread* hook_mgr = nullptr; static std::list<WMHooks*> hooks; static os::Mutex hook_mgr_lock; @@ -134,7 +134,7 @@ static os::Mutex hook_mgr_lock; static bool StartHookThread() { if (hook_mgr) return true; - if (hooksLibrary == NULL) + if (hooksLibrary == nullptr) return false; vlog.debug("creating thread"); hook_mgr = new WMHooksThread(); @@ -146,7 +146,7 @@ static bool StartHookThread() { vlog.error("failed to initialise hooks"); hook_mgr->stop(); delete hook_mgr; - hook_mgr = 0; + hook_mgr = nullptr; return false; } return true; @@ -160,7 +160,7 @@ static void StopHookThread() { vlog.debug("closing thread"); hook_mgr->stop(); delete hook_mgr; - hook_mgr = 0; + hook_mgr = nullptr; } @@ -220,7 +220,7 @@ WMHooksThread::worker() { thread_id = GetCurrentThreadId(); - while (active && GetMessage(&msg, NULL, 0, 0)) { + while (active && GetMessage(&msg, nullptr, 0, 0)) { count++; if (msg.message == WM_TIMER) { @@ -306,7 +306,7 @@ WMHooksThread::stop() { // -=- WMHooks class -rfb::win32::WMHooks::WMHooks() : updateEvent(0) { +rfb::win32::WMHooks::WMHooks() : updateEvent(nullptr) { LoadHooks(); } @@ -358,7 +358,7 @@ rfb::win32::WMBlockInput::~WMBlockInput() { static bool blocking = false; static bool blockRealInputs(bool block_) { // NB: Requires blockMutex to be held! - if (hooksLibrary == NULL) + if (hooksLibrary == nullptr) return false; if (block_) { if (blocking) diff --git a/win/rfb_win32/WMNotifier.cxx b/win/rfb_win32/WMNotifier.cxx index 81b4fa51..894add1c 100644 --- a/win/rfb_win32/WMNotifier.cxx +++ b/win/rfb_win32/WMNotifier.cxx @@ -34,7 +34,7 @@ using namespace rfb::win32; static LogWriter vlog("WMMonitor"); -WMMonitor::WMMonitor() : MsgWindow("WMMonitor"), notifier(0) { +WMMonitor::WMMonitor() : MsgWindow("WMMonitor"), notifier(nullptr) { } WMMonitor::~WMMonitor() { diff --git a/win/rfb_win32/WMNotifier.h b/win/rfb_win32/WMNotifier.h index 3855430b..937a655d 100644 --- a/win/rfb_win32/WMNotifier.h +++ b/win/rfb_win32/WMNotifier.h @@ -55,7 +55,7 @@ namespace rfb { protected: // - Internal MsgWindow callback - virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam); + LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam) override; Notifier* notifier; }; diff --git a/win/rfb_win32/WMPoller.h b/win/rfb_win32/WMPoller.h index 851b69f4..0783e4ff 100644 --- a/win/rfb_win32/WMPoller.h +++ b/win/rfb_win32/WMPoller.h @@ -38,7 +38,7 @@ namespace rfb { class WMPoller { public: - WMPoller() : ut(0) {} + WMPoller() : ut(nullptr) {} bool processEvent(); bool setUpdateTracker(UpdateTracker* ut); diff --git a/win/rfb_win32/WMWindowCopyRect.cxx b/win/rfb_win32/WMWindowCopyRect.cxx index 4d69d54b..ec6e1fdc 100644 --- a/win/rfb_win32/WMWindowCopyRect.cxx +++ b/win/rfb_win32/WMWindowCopyRect.cxx @@ -33,7 +33,7 @@ static LogWriter vlog("WMCopyRect"); // -=- WMHooks class -rfb::win32::WMCopyRect::WMCopyRect() : ut(0), fg_window(0) { +rfb::win32::WMCopyRect::WMCopyRect() : ut(nullptr), fg_window(nullptr) { } bool @@ -56,10 +56,10 @@ rfb::win32::WMCopyRect::processEvent() { fg_window = window; fg_window_rect = winrect; } else { - fg_window = 0; + fg_window = nullptr; } } else { - fg_window = 0; + fg_window = nullptr; } return false; } diff --git a/win/rfb_win32/Win32Util.cxx b/win/rfb_win32/Win32Util.cxx index ed6b70cb..c3b7ad19 100644 --- a/win/rfb_win32/Win32Util.cxx +++ b/win/rfb_win32/Win32Util.cxx @@ -44,7 +44,7 @@ FileVersionInfo::FileVersionInfo(const char* filename) { // Attempt to open the file, to cause Access Denied, etc, errors // to be correctly reported, since the GetFileVersionInfoXXX calls lie... { - Handle file(CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)); + Handle file(CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr)); if (file.h == INVALID_HANDLE_VALUE) throw rdr::SystemException("Failed to open file", GetLastError()); } @@ -77,7 +77,7 @@ const char* FileVersionInfo::getVerString(const char* name, DWORD langId) { infoName = format("\\StringFileInfo\\%s\\%s", langIdStr.c_str(), name); // Locate the required version string within the version info - char* buffer = 0; + char* buffer = nullptr; UINT length = 0; if (!VerQueryValue(buf, infoName.c_str(), (void**)&buffer, &length)) { printf("unable to find %s version string", infoName.c_str()); @@ -104,13 +104,13 @@ void centerWindow(HWND handle, const RECT& r) { int x = (r.left + r.right - w)/2; int y = (r.top + r.bottom - h)/2; UINT flags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOSIZE; - SetWindowPos(handle, 0, x, y, 0, 0, flags); + SetWindowPos(handle, nullptr, x, y, 0, 0, flags); } void resizeWindow(HWND handle, int width, int height) { RECT r; GetWindowRect(handle, &r); - SetWindowPos(handle, 0, 0, 0, width, height, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOMOVE); + SetWindowPos(handle, nullptr, 0, 0, width, height, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOMOVE); centerWindow(handle, r); } diff --git a/win/rfb_win32/Win32Util.h b/win/rfb_win32/Win32Util.h index 24d5905d..927ca1e2 100644 --- a/win/rfb_win32/Win32Util.h +++ b/win/rfb_win32/Win32Util.h @@ -30,7 +30,7 @@ namespace rfb { namespace win32 { struct FileVersionInfo { - FileVersionInfo(const char* filename=0); + FileVersionInfo(const char* filename=nullptr); ~FileVersionInfo(); const char* getVerString(const char* name, DWORD langId = 0x080904b0); private: diff --git a/win/vncconfig/Authentication.h b/win/vncconfig/Authentication.h index a69f7592..1123678f 100644 --- a/win/vncconfig/Authentication.h +++ b/win/vncconfig/Authentication.h @@ -43,11 +43,11 @@ namespace rfb { class SecPage : public SecurityPage { public: SecPage(const RegKey& rk) - : SecurityPage(NULL), regKey(rk) { + : SecurityPage(nullptr), regKey(rk) { security = new SecurityServer(); } - void initDialog() { + void initDialog() override { SecurityPage::initDialog(); setItemChecked(IDC_QUERY_CONNECT, rfb::Server::queryConnect); @@ -55,7 +55,7 @@ namespace rfb { onCommand(IDC_AUTH_NONE, 0); } - bool onCommand(int id, int cmd) { + bool onCommand(int id, int cmd) override { SecurityPage::onCommand(id, cmd); setChanged(true); @@ -78,16 +78,16 @@ namespace rfb { return true; } - bool onOk() { + bool onOk() override { SecurityPage::onOk(); if (isItemChecked(IDC_AUTH_VNC)) verifyVncPassword(regKey); else if (haveVncPassword() && - MsgBox(0, "The VNC authentication method is disabled, but a password is still stored for it.\n" + MsgBox(nullptr, "The VNC authentication method is disabled, but a password is still stored for it.\n" "Do you want to remove the VNC authentication password from the registry?", MB_ICONWARNING | MB_YESNO) == IDYES) { - regKey.setBinary("Password", 0, 0); + regKey.setBinary("Password", nullptr, 0); } #ifdef HAVE_GNUTLS @@ -119,23 +119,23 @@ namespace rfb { static void verifyVncPassword(const RegKey& regKey) { if (!haveVncPassword()) { - MsgBox(0, "The VNC authentication method is enabled, but no password is specified.\n" + MsgBox(nullptr, "The VNC authentication method is enabled, but no password is specified.\n" "The password dialog will now be shown.", MB_ICONINFORMATION | MB_OK); PasswordDialog passwd(regKey, registryInsecure); passwd.showDialog(); } } - virtual void loadX509Certs(void) {} - virtual void enableX509Dialogs(void) { + void loadX509Certs(void) override {} + void enableX509Dialogs(void) override { enableItem(IDC_LOAD_CERT, true); enableItem(IDC_LOAD_CERTKEY, true); } - virtual void disableX509Dialogs(void) { + void disableX509Dialogs(void) override { enableItem(IDC_LOAD_CERT, false); enableItem(IDC_LOAD_CERTKEY, false); } - virtual void loadVncPasswd() { + void loadVncPasswd() override { enableItem(IDC_AUTH_VNC_PASSWD, isItemChecked(IDC_AUTH_VNC)); } @@ -165,10 +165,10 @@ namespace rfb { ofn.nMaxFile = sizeof(filename); ofn.lpstrFilter = (char*)filter; ofn.nFilterIndex = 1; - ofn.lpstrFileTitle = NULL; + ofn.lpstrFileTitle = nullptr; ofn.nMaxFileTitle = 0; ofn.lpstrTitle = (char*)title; - ofn.lpstrInitialDir = NULL; + ofn.lpstrInitialDir = nullptr; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; if (GetOpenFileName(&ofn)==TRUE) { diff --git a/win/vncconfig/Connections.h b/win/vncconfig/Connections.h index fcaae203..a540bd76 100644 --- a/win/vncconfig/Connections.h +++ b/win/vncconfig/Connections.h @@ -41,12 +41,12 @@ namespace rfb { class ConnHostDialog : public Dialog { public: - ConnHostDialog() : Dialog(GetModuleHandle(0)) {} + ConnHostDialog() : Dialog(GetModuleHandle(nullptr)) {} bool showDialog(const char* pat) { pattern = pat; return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONN_HOST)); } - void initDialog() { + void initDialog() override { if (pattern.empty()) pattern = "+"; @@ -60,7 +60,7 @@ namespace rfb { setItemString(IDC_HOST_PATTERN, &pattern.c_str()[1]); pattern.clear(); } - bool onOk() { + bool onOk() override { std::string newPat; if (isItemChecked(IDC_ALLOW)) newPat = '+'; @@ -74,7 +74,7 @@ namespace rfb { network::TcpFilter::Pattern pat(network::TcpFilter::parsePattern(newPat.c_str())); pattern = network::TcpFilter::patternToStr(pat); } catch(rdr::Exception& e) { - MsgBox(NULL, e.str(), MB_ICONEXCLAMATION | MB_OK); + MsgBox(nullptr, e.str(), MB_ICONEXCLAMATION | MB_OK); return false; } return true; @@ -87,8 +87,8 @@ namespace rfb { class ConnectionsPage : public PropSheetPage { public: ConnectionsPage(const RegKey& rk) - : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_CONNECTIONS)), regKey(rk) {} - void initDialog() { + : PropSheetPage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_CONNECTIONS)), regKey(rk) {} + void initDialog() override { vlog.debug("set IDC_PORT %d", (int)port_number); setItemInt(IDC_PORT, port_number ? port_number : 5900); setItemChecked(IDC_RFB_ENABLE, port_number != 0); @@ -108,7 +108,7 @@ namespace rfb { onCommand(IDC_RFB_ENABLE, EN_CHANGE); } - bool onCommand(int id, int cmd) { + bool onCommand(int id, int cmd) override { switch (id) { case IDC_HOSTS: { @@ -221,7 +221,7 @@ namespace rfb { } return false; } - bool onOk() { + bool onOk() override { regKey.setInt("PortNumber", isItemChecked(IDC_RFB_ENABLE) ? getItemInt(IDC_PORT) : 0); regKey.setInt("IdleTimeout", getItemInt(IDC_IDLE_TIMEOUT)); regKey.setInt("LocalHost", isItemChecked(IDC_LOCALHOST)); diff --git a/win/vncconfig/Desktop.h b/win/vncconfig/Desktop.h index d7ed0bc8..a5058389 100644 --- a/win/vncconfig/Desktop.h +++ b/win/vncconfig/Desktop.h @@ -29,8 +29,8 @@ namespace rfb { class DesktopPage : public PropSheetPage { public: DesktopPage(const RegKey& rk) - : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_DESKTOP)), regKey(rk) {} - void initDialog() { + : PropSheetPage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_DESKTOP)), regKey(rk) {} + void initDialog() override { const char *action(rfb::win32::SDisplay::disconnectAction); bool disconnectLock = stricmp(action, "Lock") == 0; bool disconnectLogoff = stricmp(action, "Logoff") == 0; @@ -40,7 +40,7 @@ namespace rfb { setItemChecked(IDC_REMOVE_WALLPAPER, rfb::win32::SDisplay::removeWallpaper); setItemChecked(IDC_DISABLE_EFFECTS, rfb::win32::SDisplay::disableEffects); } - bool onCommand(int id, int /*cmd*/) { + bool onCommand(int id, int /*cmd*/) override { switch (id) { case IDC_DISCONNECT_LOGOFF: case IDC_DISCONNECT_LOCK: @@ -58,7 +58,7 @@ namespace rfb { } return false; } - bool onOk() { + bool onOk() override { const char* action = "None"; if (isItemChecked(IDC_DISCONNECT_LOGOFF)) action = "Logoff"; diff --git a/win/vncconfig/Hooking.h b/win/vncconfig/Hooking.h index e775f290..9f84230d 100644 --- a/win/vncconfig/Hooking.h +++ b/win/vncconfig/Hooking.h @@ -31,15 +31,15 @@ namespace rfb { class HookingPage : public PropSheetPage { public: HookingPage(const RegKey& rk) - : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {} - void initDialog() { + : PropSheetPage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {} + void initDialog() override { setItemChecked(IDC_USEPOLLING, rfb::win32::SDisplay::updateMethod == 0); setItemChecked(IDC_USEHOOKS, (rfb::win32::SDisplay::updateMethod == 1)); setItemChecked(IDC_POLLCONSOLES, rfb::win32::WMPoller::poll_console_windows); setItemChecked(IDC_CAPTUREBLT, rfb::win32::DeviceFrameBuffer::useCaptureBlt); onCommand(IDC_USEHOOKS, 0); } - bool onCommand(int id, int /*cmd*/) { + bool onCommand(int id, int /*cmd*/) override { switch (id) { case IDC_USEPOLLING: case IDC_USEHOOKS: @@ -54,7 +54,7 @@ namespace rfb { } return false; } - bool onOk() { + bool onOk() override { if (isItemChecked(IDC_USEPOLLING)) regKey.setInt("UpdateMethod", 0); if (isItemChecked(IDC_USEHOOKS)) diff --git a/win/vncconfig/Inputs.h b/win/vncconfig/Inputs.h index a2ac5a46..2ffdda03 100644 --- a/win/vncconfig/Inputs.h +++ b/win/vncconfig/Inputs.h @@ -33,9 +33,9 @@ namespace rfb { class InputsPage : public PropSheetPage { public: InputsPage(const RegKey& rk) - : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_INPUTS)), + : PropSheetPage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_INPUTS)), regKey(rk), enableAffectSSaver(true) {} - void initDialog() { + void initDialog() override { setItemChecked(IDC_ACCEPT_KEYS, rfb::Server::acceptKeyEvents); setItemChecked(IDC_RAW_KEYBOARD, SKeyboard::rawKeyboard); setItemChecked(IDC_ACCEPT_PTR, rfb::Server::acceptPointerEvents); @@ -49,7 +49,7 @@ namespace rfb { enableAffectSSaver = false; enableItem(IDC_AFFECT_SCREENSAVER, enableAffectSSaver); } - bool onCommand(int /*id*/, int /*cmd*/) { + bool onCommand(int /*id*/, int /*cmd*/) override { BOOL inputResetsBlocked; SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &inputResetsBlocked, 0); setChanged((rfb::Server::acceptKeyEvents != isItemChecked(IDC_ACCEPT_KEYS)) || @@ -61,7 +61,7 @@ namespace rfb { (enableAffectSSaver && (!inputResetsBlocked != isItemChecked(IDC_AFFECT_SCREENSAVER)))); return false; } - bool onOk() { + bool onOk() override { regKey.setBool("AcceptKeyEvents", isItemChecked(IDC_ACCEPT_KEYS)); regKey.setBool("RawKeyboard", isItemChecked(IDC_RAW_KEYBOARD)); regKey.setBool("AcceptPointerEvents", isItemChecked(IDC_ACCEPT_PTR)); @@ -70,7 +70,7 @@ namespace rfb { regKey.setBool("DisableLocalInputs", isItemChecked(IDC_DISABLE_LOCAL_INPUTS)); if (enableAffectSSaver) { BOOL blocked = !isItemChecked(IDC_AFFECT_SCREENSAVER); - SystemParametersInfo(SPI_SETBLOCKSENDINPUTRESETS, blocked, 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); + SystemParametersInfo(SPI_SETBLOCKSENDINPUTRESETS, blocked, nullptr, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE); } return true; } diff --git a/win/vncconfig/Legacy.cxx b/win/vncconfig/Legacy.cxx index 3a22bb52..1ea867fb 100644 --- a/win/vncconfig/Legacy.cxx +++ b/win/vncconfig/Legacy.cxx @@ -53,7 +53,7 @@ void LegacyPage::LoadPrefs() try { winvnc3.openKey(HKEY_LOCAL_MACHINE, "Software\\ORL\\WinVNC3"); int debugMode = winvnc3.getInt("DebugMode", 0); - const char* debugTarget = 0; + const char* debugTarget = nullptr; if (debugMode & 2) debugTarget = "file"; if (debugMode & 4) debugTarget = "stderr"; if (debugTarget) { @@ -115,7 +115,7 @@ void LegacyPage::LoadPrefs() // Finally, save the Hosts value regKey.setString("Hosts", newHosts.c_str()); } catch (rdr::Exception&) { - MsgBox(0, "Unable to convert AuthHosts setting to Hosts format.", + MsgBox(nullptr, "Unable to convert AuthHosts setting to Hosts format.", MB_ICONWARNING | MB_OK); } } else { @@ -181,7 +181,7 @@ void LegacyPage::LoadPrefs() { regKey.setInt("PortNumber", key.getBool("SocketConnect") ? key.getInt("PortNumber", 5900) : 0); if (key.getBool("AutoPortSelect", false)) { - MsgBox(0, "The AutoPortSelect setting is not supported by this release." + MsgBox(nullptr, "The AutoPortSelect setting is not supported by this release." "The port number will default to 5900.", MB_ICONWARNING | MB_OK); regKey.setInt("PortNumber", 5900); @@ -193,7 +193,7 @@ void LegacyPage::LoadPrefs() if (key.getInt("QuerySetting", 2) != 2) { regKey.setBool("QueryConnect", key.getInt("QuerySetting") > 2); - MsgBox(0, "The QuerySetting option has been replaced by QueryConnect." + MsgBox(nullptr, "The QuerySetting option has been replaced by QueryConnect." "Please see the documentation for details of the QueryConnect option.", MB_ICONWARNING | MB_OK); } @@ -222,9 +222,9 @@ void LegacyPage::LoadPrefs() regKey.setBool("UseHooks", !key.getBool("PollFullScreen", false)); if (key.isValue("AllowShutdown")) - MsgBox(0, "The AllowShutdown option is not supported by this release.", MB_ICONWARNING | MB_OK); + MsgBox(nullptr, "The AllowShutdown option is not supported by this release.", MB_ICONWARNING | MB_OK); if (key.isValue("AllowEditClients")) - MsgBox(0, "The AllowEditClients option is not supported by this release.", MB_ICONWARNING | MB_OK); + MsgBox(nullptr, "The AllowEditClients option is not supported by this release.", MB_ICONWARNING | MB_OK); allowProperties = key.getBool("AllowProperties", allowProperties); } diff --git a/win/vncconfig/Legacy.h b/win/vncconfig/Legacy.h index 884a151a..47bec7d6 100644 --- a/win/vncconfig/Legacy.h +++ b/win/vncconfig/Legacy.h @@ -35,21 +35,21 @@ namespace rfb { class LegacyPage : public PropSheetPage { public: LegacyPage(const RegKey& rk, bool userSettings_) - : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_LEGACY)), regKey(rk), userSettings(userSettings_) {} - void initDialog() { + : PropSheetPage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_LEGACY)), regKey(rk), userSettings(userSettings_) {} + void initDialog() override { setItemChecked(IDC_PROTOCOL_3_3, rfb::Server::protocol3_3); } - bool onCommand(int id, int /*cmd*/) { + bool onCommand(int id, int /*cmd*/) override { switch (id) { case IDC_LEGACY_IMPORT: { - DWORD result = MsgBox(0, + DWORD result = MsgBox(nullptr, "Importing your legacy VNC 3.3 settings will overwrite your existing settings.\n" "Are you sure you wish to continue?", MB_ICONWARNING | MB_YESNO); if (result == IDYES) { LoadPrefs(); - MsgBox(0, "Imported VNC 3.3 settings successfully.", + MsgBox(nullptr, "Imported VNC 3.3 settings successfully.", MB_ICONINFORMATION | MB_OK); // Sleep to allow RegConfig thread to reload settings @@ -64,7 +64,7 @@ namespace rfb { }; return false; } - bool onOk() { + bool onOk() override { regKey.setBool("Protocol3.3", isItemChecked(IDC_PROTOCOL_3_3)); return true; } diff --git a/win/vncconfig/PasswordDialog.cxx b/win/vncconfig/PasswordDialog.cxx index f35aeb54..8a7103ca 100644 --- a/win/vncconfig/PasswordDialog.cxx +++ b/win/vncconfig/PasswordDialog.cxx @@ -25,7 +25,7 @@ using namespace rfb; using namespace win32; PasswordDialog::PasswordDialog(const RegKey& rk, bool registryInsecure_) - : Dialog(GetModuleHandle(0)), regKey(rk), registryInsecure(registryInsecure_) { + : Dialog(GetModuleHandle(nullptr)), regKey(rk), registryInsecure(registryInsecure_) { } bool PasswordDialog::showDialog(HWND owner) { @@ -36,12 +36,12 @@ bool PasswordDialog::onOk() { std::string password1(getItemString(IDC_PASSWORD1)); std::string password2(getItemString(IDC_PASSWORD2)); if (password1 != password2) { - MsgBox(0, "The supplied passwords do not match", + MsgBox(nullptr, "The supplied passwords do not match", MB_ICONEXCLAMATION | MB_OK); return false; } if (registryInsecure && - (MsgBox(0, "Please note that your password cannot be stored securely on this system. " + (MsgBox(nullptr, "Please note that your password cannot be stored securely on this system. " "Are you sure you wish to continue?", MB_YESNO | MB_ICONWARNING) == IDNO)) return false; diff --git a/win/vncconfig/PasswordDialog.h b/win/vncconfig/PasswordDialog.h index dd23f8e3..06973bb9 100644 --- a/win/vncconfig/PasswordDialog.h +++ b/win/vncconfig/PasswordDialog.h @@ -27,8 +27,8 @@ namespace rfb { class PasswordDialog : public Dialog { public: PasswordDialog(const RegKey& rk, bool registryInsecure_); - bool showDialog(HWND owner=0); - bool onOk(); + bool showDialog(HWND owner=nullptr); + bool onOk() override; protected: const RegKey& regKey; bool registryInsecure; diff --git a/win/vncconfig/Sharing.h b/win/vncconfig/Sharing.h index 0a2bbe40..a6459e5f 100644 --- a/win/vncconfig/Sharing.h +++ b/win/vncconfig/Sharing.h @@ -29,20 +29,20 @@ namespace rfb { class SharingPage : public PropSheetPage { public: SharingPage(const RegKey& rk) - : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_SHARING)), regKey(rk) {} - void initDialog() { + : PropSheetPage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDD_SHARING)), regKey(rk) {} + void initDialog() override { setItemChecked(IDC_DISCONNECT_CLIENTS, rfb::Server::disconnectClients); setItemChecked(IDC_SHARE_NEVER, rfb::Server::neverShared); setItemChecked(IDC_SHARE_ALWAYS, rfb::Server::alwaysShared); setItemChecked(IDC_SHARE_CLIENT, !(rfb::Server::neverShared || rfb::Server::alwaysShared)); } - bool onCommand(int /*id*/, int /*cmd*/) { + bool onCommand(int /*id*/, int /*cmd*/) override { setChanged((isItemChecked(IDC_DISCONNECT_CLIENTS) != rfb::Server::disconnectClients) || (isItemChecked(IDC_SHARE_NEVER) != rfb::Server::neverShared) || (isItemChecked(IDC_SHARE_ALWAYS) != rfb::Server::alwaysShared)); return true; } - bool onOk() { + bool onOk() override { regKey.setBool("DisconnectClients", isItemChecked(IDC_DISCONNECT_CLIENTS)); regKey.setBool("AlwaysShared", isItemChecked(IDC_SHARE_ALWAYS)); regKey.setBool("NeverShared", isItemChecked(IDC_SHARE_NEVER)); diff --git a/win/vncconfig/vncconfig.cxx b/win/vncconfig/vncconfig.cxx index 2b7eaa1e..b8cb5dc8 100644 --- a/win/vncconfig/vncconfig.cxx +++ b/win/vncconfig/vncconfig.cxx @@ -84,9 +84,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE /*prev*/, char* /*cmdLine*/, int /* freopen("CONIN$","rb",stdin); freopen("CONOUT$","wb",stdout); freopen("CONOUT$","wb",stderr); - setbuf(stderr, 0); + setbuf(stderr, nullptr); initStdIOLoggers(); - LogWriter vlog("main"); logParams.setParam("*:stderr:100"); vlog.info("Starting vncconfig applet"); #endif @@ -130,7 +129,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE /*prev*/, char* /*cmdLine*/, int /* // Something weird happens on NT 4.0 SP5 but I can't reproduce it on other // NT 4.0 service pack revisions. if (e.err == ERROR_INVALID_PARAMETER) { - MsgBox(0, "Windows reported an error trying to secure the VNC Server settings for this user. " + MsgBox(nullptr, "Windows reported an error trying to secure the VNC Server settings for this user. " "Your settings may not be secure!", MB_ICONWARNING | MB_OK); } else if (e.err != ERROR_CALL_NOT_IMPLEMENTED && e.err != ERROR_NOT_LOGGED_ON) { @@ -166,14 +165,14 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE /*prev*/, char* /*cmdLine*/, int /* #ifdef _DEBUG vlog.debug("capture dialogs=%s", captureDialogs ? "true" : "false"); - sheet.showPropSheet(0, true, false, captureDialogs); + sheet.showPropSheet(nullptr, true, false, captureDialogs); #else - sheet.showPropSheet(0, true, false); + sheet.showPropSheet(nullptr, true, false); #endif } catch (rdr::SystemException& e) { switch (e.err) { case ERROR_ACCESS_DENIED: - MsgBox(0, "You do not have sufficient access rights to run the VNC Configuration applet", + MsgBox(nullptr, "You do not have sufficient access rights to run the VNC Configuration applet", MB_ICONSTOP | MB_OK); return 1; }; @@ -181,7 +180,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE /*prev*/, char* /*cmdLine*/, int /* } } catch (rdr::Exception& e) { - MsgBox(NULL, e.str(), MB_ICONEXCLAMATION | MB_OK); + MsgBox(nullptr, e.str(), MB_ICONEXCLAMATION | MB_OK); return 1; } diff --git a/win/winvnc/AddNewClientDialog.h b/win/winvnc/AddNewClientDialog.h index 44e15e70..ad34ec23 100644 --- a/win/winvnc/AddNewClientDialog.h +++ b/win/winvnc/AddNewClientDialog.h @@ -28,7 +28,7 @@ namespace winvnc { class AddNewClientDialog : public rfb::win32::Dialog { public: - AddNewClientDialog() : Dialog(GetModuleHandle(0)) {} + AddNewClientDialog() : Dialog(GetModuleHandle(nullptr)) {} // - Show the dialog and return true if OK was clicked, // false in case of error or Cancel virtual bool showDialog() { @@ -38,11 +38,11 @@ namespace winvnc { protected: // Dialog methods (protected) - virtual void initDialog() { + void initDialog() override { if (!hostName.empty()) setItemString(IDC_HOST, hostName.c_str()); } - virtual bool onOk() { + bool onOk() override { hostName = getItemString(IDC_HOST); return true; } diff --git a/win/winvnc/ControlPanel.cxx b/win/winvnc/ControlPanel.cxx index 1b3c40eb..6c593c45 100644 --- a/win/winvnc/ControlPanel.cxx +++ b/win/winvnc/ControlPanel.cxx @@ -16,7 +16,7 @@ using namespace winvnc; bool ControlPanel::showDialog() { - return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONTROL_PANEL), NULL); + return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONTROL_PANEL), nullptr); } void ControlPanel::initDialog() @@ -118,7 +118,7 @@ BOOL ControlPanel::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM /*lPara case WM_COMMAND: switch (LOWORD(wParam)) { case IDCANCEL: - handle = NULL; + handle = nullptr; EndDialog(hwnd, 0); return TRUE; default: @@ -145,7 +145,7 @@ void ControlPanel::SendCommand(DWORD command, int data) COPYDATASTRUCT copyData; copyData.dwData = command; copyData.cbData = 0; - copyData.lpData = 0; + copyData.lpData = nullptr; getSelConnInfo(); if (data != -1) { ListConnStatus.Copy(&ListSelConn); diff --git a/win/winvnc/ControlPanel.h b/win/winvnc/ControlPanel.h index f64a6081..23aff0a5 100644 --- a/win/winvnc/ControlPanel.h +++ b/win/winvnc/ControlPanel.h @@ -20,12 +20,12 @@ namespace winvnc { class ControlPanel : rfb::win32::Dialog, rfb::win32::ListViewControl { public: - ControlPanel(HWND hSTIcon) : Dialog(GetModuleHandle(0)), ListViewControl(){ + ControlPanel(HWND hSTIcon) : Dialog(GetModuleHandle(nullptr)), ListViewControl(){ m_hSTIcon = hSTIcon; stop_updating = false; }; virtual bool showDialog(); - virtual void initDialog(); + void initDialog() override; virtual bool onCommand(int cmd); void UpdateListView(ListConnInfo* LCInfo); HWND GetHandle() {return handle;}; @@ -33,7 +33,7 @@ namespace winvnc { ~ControlPanel(); ListConnInfo ListConnStatus; protected: - virtual BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) override; void getSelConnInfo(); HWND m_hSTIcon; ListConnInfo ListConn; diff --git a/win/winvnc/ManagedListener.cxx b/win/winvnc/ManagedListener.cxx index 1a278678..adc074cf 100644 --- a/win/winvnc/ManagedListener.cxx +++ b/win/winvnc/ManagedListener.cxx @@ -31,7 +31,7 @@ static LogWriter vlog("ManagedListener"); ManagedListener::ManagedListener(SocketManager* mgr) -: filter(0), manager(mgr), addrChangeNotifier(0), server(0), port(0), localOnly(false) { +: filter(nullptr), manager(mgr), addrChangeNotifier(nullptr), server(nullptr), port(0), localOnly(false) { } ManagedListener::~ManagedListener() { @@ -98,7 +98,7 @@ void ManagedListener::refresh() { if (localOnly) network::createLocalTcpListeners(&sockets, port); else - network::createTcpListeners(&sockets, NULL, port); + network::createTcpListeners(&sockets, nullptr, port); } } catch (rdr::Exception& e) { vlog.error("%s", e.str()); diff --git a/win/winvnc/QueryConnectDialog.cxx b/win/winvnc/QueryConnectDialog.cxx index 26bd9331..bedfe5a9 100644 --- a/win/winvnc/QueryConnectDialog.cxx +++ b/win/winvnc/QueryConnectDialog.cxx @@ -44,7 +44,7 @@ static IntParameter timeout("QueryConnectTimeout", QueryConnectDialog::QueryConnectDialog(network::Socket* sock_, const char* userName_, VNCServerWin32* s) -: Dialog(GetModuleHandle(0)), +: Dialog(GetModuleHandle(nullptr)), sock(sock_), peerIp(sock->getPeerAddress()), userName(userName_), approve(false), server(s) { } @@ -73,7 +73,7 @@ void QueryConnectDialog::worker() { // - Dialog overrides void QueryConnectDialog::initDialog() { - if (!SetTimer(handle, 1, 1000, 0)) + if (!SetTimer(handle, 1, 1000, nullptr)) throw rdr::SystemException("SetTimer", GetLastError()); setItemString(IDC_QUERY_HOST, peerIp.c_str()); if (userName.empty()) diff --git a/win/winvnc/QueryConnectDialog.h b/win/winvnc/QueryConnectDialog.h index 36e885f9..332e7439 100644 --- a/win/winvnc/QueryConnectDialog.h +++ b/win/winvnc/QueryConnectDialog.h @@ -39,11 +39,11 @@ namespace winvnc { bool isAccepted() const {return approve;} protected: // Thread methods - virtual void worker(); + void worker() override; // Dialog methods (protected) - virtual void initDialog(); - virtual BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + void initDialog() override; + BOOL dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) override; // Custom internal methods void setCountdownLabel(); diff --git a/win/winvnc/STrayIcon.cxx b/win/winvnc/STrayIcon.cxx index e7032998..d703f47a 100644 --- a/win/winvnc/STrayIcon.cxx +++ b/win/winvnc/STrayIcon.cxx @@ -80,13 +80,13 @@ public: SetWindowText(getHandle(), "winvnc::IPC_Interface"); // *** - SetTimer(getHandle(), 1, 3000, 0); + SetTimer(getHandle(), 1, 3000, nullptr); PostMessage(getHandle(), WM_TIMER, 1, 0); PostMessage(getHandle(), WM_SET_TOOLTIP, 0, 0); CPanel = new ControlPanel(getHandle()); } - virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam) { + LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam) override { switch(msg) { case WM_USER: @@ -100,7 +100,7 @@ public: SendMessage(getHandle(), WM_COMMAND, ID_CONTR0L_PANEL, 0); break; case WM_RBUTTONUP: - HMENU menu = LoadMenu(GetModuleHandle(0), MAKEINTRESOURCE(thread.menu)); + HMENU menu = LoadMenu(GetModuleHandle(nullptr), MAKEINTRESOURCE(thread.menu)); HMENU trayMenu = GetSubMenu(menu, 0); @@ -123,7 +123,7 @@ public: // Display the menu POINT pos; GetCursorPos(&pos); - TrackPopupMenu(trayMenu, 0, pos.x, pos.y, 0, getHandle(), 0); + TrackPopupMenu(trayMenu, 0, pos.x, pos.y, 0, getHandle(), nullptr); break; } @@ -154,13 +154,13 @@ public: thread.server.disconnectClients("tray menu disconnect"); break; case ID_CLOSE: - if (MsgBox(0, "Are you sure you want to close the server?", + if (MsgBox(nullptr, "Are you sure you want to close the server?", MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) == IDYES) { if (isServiceProcess()) { try { rfb::win32::stopService(VNCServerService::Name); } catch (rdr::Exception& e) { - MsgBox(0, e.str(), MB_ICONERROR | MB_OK); + MsgBox(nullptr, e.str(), MB_ICONERROR | MB_OK); } } else { thread.server.stop(); @@ -239,7 +239,7 @@ protected: STrayIconThread::STrayIconThread(VNCServerWin32& sm, UINT inactiveIcon_, UINT activeIcon_, UINT dis_inactiveIcon_, UINT dis_activeIcon_, UINT menu_) -: thread_id(-1), windowHandle(0), server(sm), +: thread_id(-1), windowHandle(nullptr), server(sm), inactiveIcon(inactiveIcon_), activeIcon(activeIcon_), dis_inactiveIcon(dis_inactiveIcon_), dis_activeIcon(dis_activeIcon_), menu(menu_), runTrayIcon(true) { @@ -266,12 +266,12 @@ void STrayIconThread::worker() { windowHandle = icon.getHandle(); MSG msg; - while (runTrayIcon && ::GetMessage(&msg, 0, 0, 0) > 0) { + while (runTrayIcon && ::GetMessage(&msg, nullptr, 0, 0) > 0) { TranslateMessage(&msg); DispatchMessage(&msg); } - windowHandle = 0; + windowHandle = nullptr; } } diff --git a/win/winvnc/STrayIcon.h b/win/winvnc/STrayIcon.h index 511c3ae2..1aa7bfbc 100644 --- a/win/winvnc/STrayIcon.h +++ b/win/winvnc/STrayIcon.h @@ -42,7 +42,7 @@ namespace winvnc { friend class STrayIcon; protected: - virtual void worker(); + void worker() override; os::Mutex* lock; DWORD thread_id; diff --git a/win/winvnc/VNCServerService.cxx b/win/winvnc/VNCServerService.cxx index 09a0707b..8ae4b747 100644 --- a/win/winvnc/VNCServerService.cxx +++ b/win/winvnc/VNCServerService.cxx @@ -38,18 +38,18 @@ using namespace win32; const char* winvnc::VNCServerService::Name = "TigerVNC"; // SendSAS is not available until Windows 7, and missing from MinGW -static HMODULE sasLibrary = NULL; +static HMODULE sasLibrary = nullptr; typedef void WINAPI (*SendSAS_proto)(BOOL AsUser); -static SendSAS_proto _SendSAS = NULL; +static SendSAS_proto _SendSAS = nullptr; VNCServerService::VNCServerService() : Service(Name) - , stopServiceEvent(CreateEvent(0, FALSE, FALSE, 0)) - , sessionEvent(CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNC")) - , sessionEventCad(CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNCCad")) { - if (sasLibrary == NULL) { + , stopServiceEvent(CreateEvent(nullptr, FALSE, FALSE, nullptr)) + , sessionEvent(CreateEvent(nullptr, FALSE, FALSE, "Global\\SessionEventTigerVNC")) + , sessionEventCad(CreateEvent(nullptr, FALSE, FALSE, "Global\\SessionEventTigerVNCCad")) { + if (sasLibrary == nullptr) { sasLibrary = LoadLibrary("sas.dll"); - if (sasLibrary != NULL) + if (sasLibrary != nullptr) _SendSAS = (SendSAS_proto)(void*)GetProcAddress(sasLibrary, "SendSAS"); } // - Set the service-mode logging defaults @@ -104,8 +104,8 @@ BOOL GetSessionUserTokenWin(OUT LPHANDLE lphUserToken) // START the app as system HANDLE LaunchProcessWin(DWORD /*dwSessionId*/) { - HANDLE hProcess = NULL; - HANDLE hToken = NULL; + HANDLE hProcess = nullptr; + HANDLE hToken = nullptr; if (GetSessionUserTokenWin(&hToken)) { ModuleFileName filename; @@ -116,9 +116,9 @@ HANDLE LaunchProcessWin(DWORD /*dwSessionId*/) si.cb = sizeof si; si.dwFlags = STARTF_USESHOWWINDOW; PROCESS_INFORMATION pi; - if (CreateProcessAsUser(hToken, NULL, (char*)cmdLine.c_str(), - NULL, NULL, FALSE, DETACHED_PROCESS, - NULL, NULL, &si, &pi)) + if (CreateProcessAsUser(hToken, nullptr, (char*)cmdLine.c_str(), + nullptr, nullptr, FALSE, DETACHED_PROCESS, + nullptr, nullptr, &si, &pi)) { CloseHandle(pi.hThread); hProcess = pi.hProcess; @@ -132,7 +132,7 @@ DWORD VNCServerService::serviceMain(int /*argc*/, char* /*argv*/ []) { ConsoleSessionId OlddwSessionId; - HANDLE hProcess = NULL; + HANDLE hProcess = nullptr; //We use this event to notify the program that the session has changed //The program need to end so the service can restart the program in the correct session //wait_for_existing_process(); @@ -150,7 +150,7 @@ DWORD VNCServerService::serviceMain(int /*argc*/, char* /*argv*/ []) //cad request case WAIT_OBJECT_0 + 1: - if (_SendSAS != NULL) + if (_SendSAS != nullptr) _SendSAS(FALSE); break; @@ -163,7 +163,7 @@ DWORD VNCServerService::serviceMain(int /*argc*/, char* /*argv*/ []) SetEvent(sessionEvent); } DWORD dwExitCode = 0; - if (hProcess == NULL || + if (hProcess == nullptr || (GetExitCodeProcess(hProcess, &dwExitCode) && dwExitCode != STILL_ACTIVE && CloseHandle(hProcess))) diff --git a/win/winvnc/VNCServerService.h b/win/winvnc/VNCServerService.h index cae44868..3992bc91 100644 --- a/win/winvnc/VNCServerService.h +++ b/win/winvnc/VNCServerService.h @@ -28,8 +28,8 @@ namespace winvnc { public: VNCServerService(); - DWORD serviceMain(int argc, char* argv[]); - void stop(); + DWORD serviceMain(int argc, char* argv[]) override; + void stop() override; static const char* Name; protected: diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx index 38b2ef16..4912d6c5 100644 --- a/win/winvnc/VNCServerWin32.cxx +++ b/win/winvnc/VNCServerWin32.cxx @@ -61,13 +61,13 @@ static BoolParameter showTrayIcon("ShowTrayIcon", VNCServerWin32::VNCServerWin32() : command(NoCommand), - commandEvent(CreateEvent(0, TRUE, FALSE, 0)), + commandEvent(CreateEvent(nullptr, TRUE, FALSE, nullptr)), sessionEvent(isServiceProcess() ? - CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNC") : 0), + CreateEvent(nullptr, FALSE, FALSE, "Global\\SessionEventTigerVNC") : nullptr), vncServer(ComputerName().buf, &desktop), thread_id(-1), runServer(false), isDesktopStarted(false), - config(&sockMgr), rfbSock(&sockMgr), trayIcon(0), - queryConnectDialog(0) + config(&sockMgr), rfbSock(&sockMgr), trayIcon(nullptr), + queryConnectDialog(nullptr) { commandLock = new os::Mutex; commandSig = new os::Condition(commandLock); @@ -92,7 +92,7 @@ VNCServerWin32::~VNCServerWin32() { delete trayIcon; // Stop the SDisplay from updating our state - desktop.setStatusLocation(0); + desktop.setStatusLocation(nullptr); // Join the Accept/Reject dialog thread if (queryConnectDialog) { @@ -179,15 +179,14 @@ int VNCServerWin32::run() { // - Set the address-changed handler for the RFB socket rfbSock.setAddressChangeNotifier(this); - DWORD result = 0; + int result = 0; try { vlog.debug("Entering message loop"); // - Run the server until we're told to quit MSG msg; - int result = 0; while (runServer) { - result = sockMgr.getMessage(&msg, NULL, 0, 0); + result = sockMgr.getMessage(&msg, nullptr, 0, 0); if (result < 0) throw rdr::SystemException("getMessage", GetLastError()); if (!isServiceProcess() && (result == 0)) @@ -226,7 +225,7 @@ bool VNCServerWin32::disconnectClients(const char* reason) { } bool VNCServerWin32::addNewClient(const char* client) { - TcpSocket* sock = 0; + TcpSocket* sock = nullptr; try { std::string hostname; int port; @@ -254,7 +253,7 @@ void VNCServerWin32::queryConnection(network::Socket* sock, const char* userName) { if (queryOnlyIfLoggedOn && CurrentUserToken().noUserLoggedOn()) { - vncServer.approveConnection(sock, true, NULL); + vncServer.approveConnection(sock, true, nullptr); return; } if (queryConnectDialog) { @@ -266,7 +265,7 @@ void VNCServerWin32::queryConnection(network::Socket* sock, } void VNCServerWin32::queryConnectionComplete() { - queueCommand(QueryConnectionComplete, 0, 0, false); + queueCommand(QueryConnectionComplete, nullptr, 0, false); } @@ -324,7 +323,7 @@ void VNCServerWin32::processEvent(HANDLE event_) { "Connection rejected by user"); queryConnectDialog->wait(); delete queryConnectDialog; - queryConnectDialog = 0; + queryConnectDialog = nullptr; break; default: @@ -396,7 +395,7 @@ void VNCServerWin32::setConnStatus(ListConnInfo* listConn) status = listConn->iGetStatus(); if (status == 3) { - conn->close(0); + conn->close(nullptr); } else { rfb::AccessRights ar; @@ -420,7 +419,6 @@ void VNCServerWin32::setConnStatus(ListConnInfo* listConn) break; } conn->setAccessRights(ar); - conn->framebufferUpdateRequest(vncServer.getPixelBuffer()->getRect(), false); } } } diff --git a/win/winvnc/VNCServerWin32.h b/win/winvnc/VNCServerWin32.h index 0a2c330c..493b3fa6 100644 --- a/win/winvnc/VNCServerWin32.h +++ b/win/winvnc/VNCServerWin32.h @@ -64,7 +64,7 @@ namespace winvnc { // Disconnect all connected clients // THREAD-SAFE - bool disconnectClients(const char* reason=0); + bool disconnectClients(const char* reason=nullptr); // Call used to notify VNCServerST of user accept/reject query completion // CALLED FROM AcceptConnectDialog THREAD @@ -81,20 +81,20 @@ namespace winvnc { // QueryConnectionHandler interface // Callback used to prompt user to accept or reject a connection. // CALLBACK IN VNCServerST "HOST" THREAD - virtual void queryConnection(network::Socket* sock, - const char* userName); + void queryConnection(network::Socket* sock, + const char* userName) override; // SocketManager::AddressChangeNotifier interface // Used to keep tray icon up to date - virtual void processAddressChange(); + void processAddressChange() override; // RegConfig::Callback interface // Called via the EventManager whenever RegConfig sees the registry change - virtual void regConfigChanged(); + void regConfigChanged() override; // EventHandler interface // Used to perform queued commands - virtual void processEvent(HANDLE event); + void processEvent(HANDLE event) override; void getConnInfo(ListConnInfo * listConn); void setConnStatus(ListConnInfo* listConn); diff --git a/win/winvnc/winvnc.cxx b/win/winvnc/winvnc.cxx index 51246407..d612a43e 100644 --- a/win/winvnc/winvnc.cxx +++ b/win/winvnc/winvnc.cxx @@ -88,7 +88,7 @@ static void programUsage() { static void MsgBoxOrLog(const char* msg, bool isError=false) { if (close_console) { - MsgBox(0, msg, (isError ? MB_ICONERROR : MB_ICONINFORMATION) | MB_OK); + MsgBox(nullptr, msg, (isError ? MB_ICONERROR : MB_ICONINFORMATION) | MB_OK); } else { if (isError) { try { @@ -116,8 +116,8 @@ static void processParams(int argc, char** argv) { if (ancd.showDialog()) host = ancd.getHostName(); } - if (host != NULL) { - HWND hwnd = FindWindow(0, "winvnc::IPC_Interface"); + if (host != nullptr) { + HWND hwnd = FindWindow(nullptr, "winvnc::IPC_Interface"); if (!hwnd) throw rdr::Exception("Unable to locate existing VNC Server."); COPYDATASTRUCT copyData; @@ -130,12 +130,12 @@ static void processParams(int argc, char** argv) { } } else if (strcasecmp(argv[i], "-disconnect") == 0) { runServer = false; - HWND hwnd = FindWindow(0, "winvnc::IPC_Interface"); + HWND hwnd = FindWindow(nullptr, "winvnc::IPC_Interface"); if (!hwnd) throw rdr::Exception("Unable to locate existing VNC Server."); COPYDATASTRUCT copyData; copyData.dwData = 2; // *** DisconnectClients - copyData.lpData = 0; + copyData.lpData = nullptr; copyData.cbData = 0; printf("Sending disconnect request to VNC Server...\n"); if (!SendMessage(hwnd, WM_COPYDATA, 0, (LPARAM)©Data)) @@ -250,7 +250,7 @@ int WINAPI WinMain(HINSTANCE /*inst*/, HINSTANCE /*prevInst*/, char* /*cmdLine*/ freopen("CONIN$", "rb", stdin); freopen("CONOUT$", "wb", stdout); freopen("CONOUT$", "wb", stderr); - setbuf(stderr, 0); + setbuf(stderr, nullptr); initStdIOLoggers(); initFileLogger("C:\\temp\\WinVNC4.log"); logParams.setParam("*:stderr:100"); diff --git a/win/wm_hooks/wm_hooks.cxx b/win/wm_hooks/wm_hooks.cxx index c864171b..a48a1738 100644 --- a/win/wm_hooks/wm_hooks.cxx +++ b/win/wm_hooks/wm_hooks.cxx @@ -69,7 +69,7 @@ ATOM ATOM_Popup_Selection = GlobalAddAtom("RFB.WM_Hooks.PopupSelectionAtom"); // -=- DLL entry point // -HINSTANCE dll_instance = 0; +HINSTANCE dll_instance = nullptr; BOOL WINAPI DllMain(HANDLE instance, ULONG reason, LPVOID /*reserved*/) { switch (reason) { @@ -92,12 +92,12 @@ BOOL WINAPI DllMain(HANDLE instance, ULONG reason, LPVOID /*reserved*/) { DWORD hook_owner SHARED = 0; DWORD hook_target SHARED = 0; -HHOOK hook_CallWndProc SHARED = 0; -HHOOK hook_CallWndProcRet SHARED = 0; -HHOOK hook_GetMessage SHARED = 0; -HHOOK hook_DialogMessage SHARED = 0; +HHOOK hook_CallWndProc SHARED = nullptr; +HHOOK hook_CallWndProcRet SHARED = nullptr; +HHOOK hook_GetMessage SHARED = nullptr; +HHOOK hook_DialogMessage SHARED = nullptr; BOOL enable_cursor_shape SHARED = FALSE; -HCURSOR cursor SHARED = 0; +HCURSOR cursor SHARED = nullptr; #ifdef _DEBUG UINT diagnostic_min SHARED =1; UINT diagnostic_max SHARED =0; @@ -138,8 +138,8 @@ bool NotifyRectangle(RECT* rect) { LPARAM l = MAKELONG((SHORT)rect->right, (SHORT)rect->bottom); return NotifyHookOwner(WM_HK_RectangleChanged, w, l); } -bool NotifyCursor(HCURSOR cursor) { - return NotifyHookOwner(WM_HK_CursorChanged, 0, (LPARAM)cursor); +bool NotifyCursor(HCURSOR cursor_) { + return NotifyHookOwner(WM_HK_CursorChanged, 0, (LPARAM)cursor_); } void ProcessWindowMessage(UINT msg, HWND wnd, WPARAM wParam, LPARAM /*lParam*/) { @@ -252,7 +252,7 @@ void ProcessWindowMessage(UINT msg, HWND wnd, WPARAM wParam, LPARAM /*lParam*/) if (buffsize != 0) { buff = (RGNDATA *) new BYTE [buffsize]; - if (buff == NULL) + if (buff == nullptr) break; // Now get the region data @@ -277,7 +277,7 @@ void ProcessWindowMessage(UINT msg, HWND wnd, WPARAM wParam, LPARAM /*lParam*/) } // Now free the region - if (region != NULL) + if (region != nullptr) DeleteObject(region); } */ @@ -353,19 +353,19 @@ BOOL WM_Hooks_Remove(DWORD owner) { if (owner != hook_owner) return FALSE; if (hook_CallWndProc) { UnhookWindowsHookEx(hook_CallWndProc); - hook_CallWndProc = 0; + hook_CallWndProc = nullptr; } if (hook_CallWndProcRet) { UnhookWindowsHookEx(hook_CallWndProcRet); - hook_CallWndProcRet = 0; + hook_CallWndProcRet = nullptr; } if (hook_GetMessage) { UnhookWindowsHookEx(hook_GetMessage); - hook_GetMessage = 0; + hook_GetMessage = nullptr; } if (hook_DialogMessage) { UnhookWindowsHookEx(hook_DialogMessage); - hook_DialogMessage = 0; + hook_DialogMessage = nullptr; } hook_owner = 0; hook_target = 0; @@ -376,8 +376,8 @@ BOOL WM_Hooks_Remove(DWORD owner) { // -=- User input hooks // -HHOOK hook_keyboard SHARED = 0; -HHOOK hook_pointer SHARED = 0; +HHOOK hook_keyboard SHARED = nullptr; +HHOOK hook_pointer SHARED = nullptr; bool enable_real_ptr SHARED = true; bool enable_synth_ptr SHARED = true; bool enable_real_kbd SHARED = true; @@ -414,11 +414,11 @@ bool RefreshInputHooks() { bool set_kbd_hook = !enable_real_kbd || !enable_synth_kbd; if (hook_keyboard && !set_kbd_hook) { UnhookWindowsHookEx(hook_keyboard); - hook_keyboard = 0; + hook_keyboard = nullptr; } if (hook_pointer && !set_ptr_hook) { UnhookWindowsHookEx(hook_pointer); - hook_pointer = 0; + hook_pointer = nullptr; } if (!hook_keyboard && set_kbd_hook) { hook_keyboard = SetWindowsHookEx(WH_KEYBOARD_LL, HookKeyboardHook, dll_instance, 0); |