Compare commits
1 Commits
v21.12.0
...
Applicatio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
016cf346ae |
26
.gitignore
vendored
@@ -1,26 +0,0 @@
|
||||
# Ignore the following files
|
||||
*~
|
||||
*.[oa]
|
||||
*.diff
|
||||
*.kate-swp
|
||||
*.kdev4
|
||||
.kdev_include_paths
|
||||
*.kdevelop.pcs
|
||||
*.moc
|
||||
*.moc.cpp
|
||||
*.orig
|
||||
*.user
|
||||
.*.swp
|
||||
.swp.*
|
||||
Doxyfile
|
||||
Makefile
|
||||
/build*/
|
||||
.cmake/
|
||||
CMakeLists.txt.user*
|
||||
*.unc-backup*
|
||||
.clang-format
|
||||
/compile_commands.json
|
||||
.clangd
|
||||
.cache
|
||||
.idea
|
||||
/cmake-build*
|
||||
@@ -1,6 +0,0 @@
|
||||
# SPDX-FileCopyrightText: None
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
include:
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
|
||||
21
.kde-ci.yml
@@ -1,21 +0,0 @@
|
||||
# SPDX-FileCopyrightText: None
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
Dependencies:
|
||||
- 'on': ['@all']
|
||||
'require':
|
||||
'frameworks/extra-cmake-modules': '@stable'
|
||||
'frameworks/ki18n': '@stable'
|
||||
'frameworks/kconfig': '@stable'
|
||||
'frameworks/kcoreaddons': '@stable'
|
||||
'frameworks/kcrash': '@stable'
|
||||
'frameworks/kdbusaddons': '@stable'
|
||||
'frameworks/kdnssd': '@stable'
|
||||
'frameworks/kdoctools': '@stable'
|
||||
'frameworks/knotifications': '@stable'
|
||||
'frameworks/kwallet': '@stable'
|
||||
'frameworks/kwidgetsaddons': '@stable'
|
||||
'frameworks/kwindowsystem': '@stable'
|
||||
'frameworks/kxmlgui': '@stable'
|
||||
'frameworks/kwayland': '@stable'
|
||||
'libraries/plasma-wayland-protocols': '@latest' # can be switched to @stable when 1.5.0 is released
|
||||
154
CMakeLists.txt
@@ -1,123 +1,47 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(krfb)
|
||||
|
||||
# KDE Application Version, managed by release script
|
||||
set (RELEASE_SERVICE_VERSION_MAJOR "21")
|
||||
set (RELEASE_SERVICE_VERSION_MINOR "12")
|
||||
set (RELEASE_SERVICE_VERSION_MICRO "0")
|
||||
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
|
||||
if(NOT INSIDE_KDENETWORK)
|
||||
message("Not building inside KDENetwork, loading KDE CMake Macros.")
|
||||
|
||||
project(krfb VERSION ${RELEASE_SERVICE_VERSION})
|
||||
find_package(KDE4 REQUIRED)
|
||||
|
||||
set(QT_MIN_VERSION 5.15.0)
|
||||
set(KF5_MIN_VERSION 5.85.0)
|
||||
include(KDE4Defaults)
|
||||
include(MacroLibrary)
|
||||
|
||||
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE REQUIRED)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH})
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckPrototypeExists)
|
||||
include(CheckTypeSize)
|
||||
|
||||
include(KDEInstallDirs)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
include(ECMInstallIcons)
|
||||
include(ECMAddAppIcon)
|
||||
include(ECMSetupVersion)
|
||||
include(ECMQtDeclareLoggingCategory)
|
||||
include(FeatureSummary)
|
||||
include(CheckIncludeFile)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
|
||||
if(WIN32)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
|
||||
endif(WIN32)
|
||||
add_definitions(${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
|
||||
endif(NOT INSIDE_KDENETWORK)
|
||||
|
||||
check_include_file("linux/input.h" HAVE_LINUX_INPUT_H)
|
||||
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core DBus Widgets X11Extras)
|
||||
|
||||
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
||||
I18n
|
||||
Config
|
||||
CoreAddons
|
||||
Crash
|
||||
DBusAddons
|
||||
DNSSD
|
||||
DocTools
|
||||
Notifications
|
||||
Wallet
|
||||
Wayland
|
||||
WidgetsAddons
|
||||
WindowSystem
|
||||
XmlGui
|
||||
set(IS_KTP_INTERNAL_MODULE TRUE)
|
||||
set(CMAKE_MODULE_PATH
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
|
||||
${CMAKE_MODULE_PATH}
|
||||
)
|
||||
|
||||
find_package(X11 REQUIRED)
|
||||
|
||||
find_package(XCB REQUIRED COMPONENTS
|
||||
XCB
|
||||
RENDER
|
||||
SHAPE
|
||||
XFIXES
|
||||
DAMAGE
|
||||
SHM
|
||||
IMAGE
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
|
||||
endif(WIN32)
|
||||
|
||||
add_definitions(
|
||||
-DQT_DEPRECATED_WARNINGS
|
||||
-DQT_DISABLE_DEPRECATED_BEFORE=0x050600
|
||||
-DQT_USE_QSTRINGBUILDER
|
||||
-DQT_NO_CAST_TO_ASCII
|
||||
-DQT_NO_CAST_FROM_ASCII
|
||||
-DQT_NO_CAST_FROM_BYTEARRAY
|
||||
-DQT_STRICT_ITERATORS
|
||||
-DQT_NO_URL_CAST_FROM_STRING
|
||||
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
|
||||
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
|
||||
|
||||
find_package(LibVNCServer REQUIRED)
|
||||
|
||||
macro_optional_find_package(TelepathyQt4)
|
||||
macro_log_feature(TelepathyQt4_FOUND "telepathy-qt" "Telepathy Qt Bindings" "http://telepathy.freedesktop.org" FALSE "0.9" "Needed to build Telepathy Tubes support.")
|
||||
|
||||
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
|
||||
add_feature_info(PipeWire PipeWire_FOUND "Required for pipewire screencast plugin")
|
||||
find_package(PlasmaWaylandProtocols 1.5.0)
|
||||
macro_optional_find_package(KTp)
|
||||
macro_log_feature(KTP_FOUND "KTP" "KDE Telepathy" "https://projects.kde.org/projects/extragear/network/telepathy" FALSE "" "Needed to build KDE IM Contacts Display in KRFB.")
|
||||
|
||||
if(PipeWire_FOUND AND PlasmaWaylandProtocols_FOUND)
|
||||
find_package(QtWaylandScanner REQUIRED)
|
||||
find_package(Qt5WaylandClient)
|
||||
find_package(Qt5XkbCommonSupport)
|
||||
find_package(Wayland REQUIRED COMPONENTS Client)
|
||||
endif()
|
||||
|
||||
find_package(gbm)
|
||||
set_package_properties(gbm PROPERTIES
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
|
||||
)
|
||||
|
||||
find_package(EGL)
|
||||
set_package_properties(EGL PROPERTIES
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
|
||||
)
|
||||
|
||||
find_package(epoxy)
|
||||
set_package_properties(epoxy PROPERTIES DESCRIPTION "libepoxy"
|
||||
URL "https://github.com/anholt/libepoxy"
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
|
||||
)
|
||||
|
||||
if(EGL_FOUND AND gbm_FOUND AND epoxy_FOUND)
|
||||
set (HAVE_DMA_BUF TRUE)
|
||||
else()
|
||||
set (HAVE_DMA_BUF FALSE)
|
||||
endif()
|
||||
|
||||
ecm_setup_version(PROJECT
|
||||
VARIABLE_PREFIX KRFB
|
||||
VERSION_HEADER "krfb_version.h")
|
||||
macro_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE)
|
||||
macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM)
|
||||
|
||||
include_directories ("${CMAKE_CURRENT_BINARY_DIR}/krfb"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/krfb"
|
||||
@@ -126,20 +50,14 @@ include_directories ("${CMAKE_CURRENT_BINARY_DIR}/krfb"
|
||||
|
||||
if(Q_WS_X11)
|
||||
if(NOT X11_XTest_FOUND)
|
||||
message(FATAL_ERROR "krfb requires the libXtst (https://xorg.freedesktop.org) to be built")
|
||||
message(FATAL_ERROR "krfb requires the libXtst (http://xorg.freedesktop.org) to be built")
|
||||
endif(NOT X11_XTest_FOUND)
|
||||
endif(Q_WS_X11)
|
||||
|
||||
add_subdirectory(events)
|
||||
add_subdirectory(krfb)
|
||||
add_subdirectory(framebuffers)
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(icons)
|
||||
|
||||
ecm_qt_install_logging_categories(
|
||||
EXPORT KRFB
|
||||
FILE krfb.categories
|
||||
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
|
||||
)
|
||||
|
||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
if (NOT INSIDE_KDENETWORK)
|
||||
macro_display_feature_log()
|
||||
endif ()
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "dev",
|
||||
"displayName": "Build as debug",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "asan",
|
||||
"displayName": "Build with Asan support.",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-asan",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dev-clang",
|
||||
"displayName": "dev-clang",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-clang",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
},
|
||||
"environment": {
|
||||
"CXX": "clang++",
|
||||
"CCACHE_DISABLE": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unity",
|
||||
"displayName": "Build with CMake unity support.",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-unity",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_UNITY_BUILD": "ON",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Build as release mode.",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-release",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "profile",
|
||||
"displayName": "profile",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-profile",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "clazy",
|
||||
"displayName": "clazy",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-clazy",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
},
|
||||
"environment": {
|
||||
"CXX": "clazy",
|
||||
"CCACHE_DISABLE": "ON"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "dev",
|
||||
"configurePreset": "dev"
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"configurePreset": "release"
|
||||
},
|
||||
{
|
||||
"name": "dev-clang",
|
||||
"configurePreset": "dev-clang"
|
||||
},
|
||||
{
|
||||
"name": "asan",
|
||||
"configurePreset": "asan"
|
||||
},
|
||||
{
|
||||
"name": "unity",
|
||||
"configurePreset": "unity"
|
||||
},
|
||||
{
|
||||
"name": "clazy",
|
||||
"configurePreset": "clazy",
|
||||
"environment": {
|
||||
"CLAZY_CHECKS" : "level0,level1,detaching-member,ifndef-define-typo,isempty-vs-count,qrequiredresult-candidates,reserve-candidates,signal-with-return-value,unneeded-cast,function-args-by-ref,function-args-by-value,returning-void-expression,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch,old-style-connect,qstring-allocations,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,qstring-varargs,level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo",
|
||||
"CCACHE_DISABLE" : "ON"
|
||||
}
|
||||
}
|
||||
],
|
||||
"testPresets": [
|
||||
{
|
||||
"name": "dev",
|
||||
"configurePreset": "dev",
|
||||
"output": {"outputOnFailure": true},
|
||||
"execution": {"noTestsAction": "error", "stopOnFailure": false}
|
||||
},
|
||||
{
|
||||
"name": "asan",
|
||||
"configurePreset": "asan",
|
||||
"output": {"outputOnFailure": true},
|
||||
"execution": {"noTestsAction": "error", "stopOnFailure": true}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
38
cmake/modules/FindKTp.cmake
Normal file
@@ -0,0 +1,38 @@
|
||||
# Try to find the KTp library
|
||||
# KTP_FOUND
|
||||
# KTP_INCLUDE_DIR
|
||||
# KTP_LIBRARIES
|
||||
# KTP_MODELS_LIBRARIES
|
||||
# KTP_WIDGETS_LIBRARIES
|
||||
|
||||
# Copyright (c) 2011, Dario Freddi <drf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if (NOT IS_KTP_INTERNAL_MODULE)
|
||||
message (FATAL_ERROR "KTp can be used just from internal components at this time")
|
||||
endif (NOT IS_KTP_INTERNAL_MODULE)
|
||||
|
||||
SET (KTP_FIND_REQUIRED ${KTp_FIND_REQUIRED})
|
||||
if (KTP_INCLUDE_DIRS AND KTP_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
set(KTP_FIND_QUIETLY TRUE)
|
||||
endif (KTP_INCLUDE_DIRS AND KTP_LIBRARIES)
|
||||
|
||||
find_path(KTP_INCLUDE_DIR
|
||||
NAMES KTp/presence.h
|
||||
PATHS ${KDE4_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
find_library(KTP_LIBRARIES NAMES ktpcommoninternalsprivate )
|
||||
find_library(KTP_MODELS_LIBRARIES NAMES ktpmodelsprivate )
|
||||
find_library(KTP_WIDGETS_LIBRARIES NAMES ktpwidgetsprivate )
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(KTp DEFAULT_MSG
|
||||
KTP_LIBRARIES
|
||||
KTP_MODELS_LIBRARIES
|
||||
KTP_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(KTP_INCLUDE_DIRS KTP_LIBRARIES)
|
||||
@@ -6,7 +6,7 @@
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
INCLUDE(CheckStructHasMember)
|
||||
INCLUDE(CheckPointerMember)
|
||||
|
||||
IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
@@ -25,7 +25,7 @@ FIND_LIBRARY(LIBVNCCLIENT_LIBRARIES NAMES vncclient libvncclient)
|
||||
|
||||
IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
|
||||
SET(CMAKE_REQUIRED_INCLUDES "${LIBVNCSERVER_INCLUDE_DIR}" "${CMAKE_REQUIRED_INCLUDES}")
|
||||
CHECK_STRUCT_HAS_MEMBER("struct _rfbClient" GotXCutText rfb/rfbclient.h LIBVNCSERVER_FOUND)
|
||||
CHECK_POINTER_MEMBER(rfbClient* GotXCutText rfb/rfbclient.h LIBVNCSERVER_FOUND)
|
||||
ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
|
||||
|
||||
IF (LIBVNCSERVER_FOUND)
|
||||
@@ -38,4 +38,4 @@ ELSE (LIBVNCSERVER_FOUND)
|
||||
ENDIF (LIBVNCSERVER_FIND_REQUIRED)
|
||||
ENDIF (LIBVNCSERVER_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(LIBVNCSERVER_INCLUDE_DIR LIBVNCSERVER_LIBRARIES)
|
||||
MARK_AS_ADVANCED(LIBVNCSERVER_INCLUDE_DIR LIBVNCSERVER_LIBRARIES)
|
||||
@@ -1,104 +0,0 @@
|
||||
#.rst:
|
||||
# Findgbm
|
||||
# -------
|
||||
#
|
||||
# Try to find gbm on a Unix system.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``gbm_FOUND``
|
||||
# True if (the requested version of) gbm is available
|
||||
# ``gbm_VERSION``
|
||||
# The version of gbm
|
||||
# ``gbm_LIBRARIES``
|
||||
# This can be passed to target_link_libraries() instead of the ``gbm::gbm``
|
||||
# target
|
||||
# ``gbm_INCLUDE_DIRS``
|
||||
# This should be passed to target_include_directories() if the target is not
|
||||
# used for linking
|
||||
# ``gbm_DEFINITIONS``
|
||||
# This should be passed to target_compile_options() if the target is not
|
||||
# used for linking
|
||||
#
|
||||
# If ``gbm_FOUND`` is TRUE, it will also define the following imported target:
|
||||
#
|
||||
# ``gbm::gbm``
|
||||
# The gbm library
|
||||
#
|
||||
# In general we recommend using the imported target, as it is easier to use.
|
||||
# Bear in mind, however, that if the target is in the link interface of an
|
||||
# exported library, it must be made available by the package config file.
|
||||
|
||||
#=============================================================================
|
||||
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
|
||||
# SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#=============================================================================
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 2.8.12)
|
||||
message(FATAL_ERROR "CMake 2.8.12 is required by Findgbm.cmake")
|
||||
endif()
|
||||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
|
||||
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Findgbm.cmake")
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_gbm QUIET gbm)
|
||||
|
||||
set(gbm_DEFINITIONS ${PKG_gbm_CFLAGS_OTHER})
|
||||
set(gbm_VERSION ${PKG_gbm_VERSION})
|
||||
|
||||
find_path(gbm_INCLUDE_DIR
|
||||
NAMES
|
||||
gbm.h
|
||||
HINTS
|
||||
${PKG_gbm_INCLUDE_DIRS}
|
||||
)
|
||||
find_library(gbm_LIBRARY
|
||||
NAMES
|
||||
gbm
|
||||
HINTS
|
||||
${PKG_gbm_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(gbm
|
||||
FOUND_VAR
|
||||
gbm_FOUND
|
||||
REQUIRED_VARS
|
||||
gbm_LIBRARY
|
||||
gbm_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
gbm_VERSION
|
||||
)
|
||||
|
||||
if(gbm_FOUND AND NOT TARGET gbm::gbm)
|
||||
add_library(gbm::gbm UNKNOWN IMPORTED)
|
||||
set_target_properties(gbm::gbm PROPERTIES
|
||||
IMPORTED_LOCATION "${gbm_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${gbm_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${gbm_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(gbm_LIBRARY gbm_INCLUDE_DIR)
|
||||
|
||||
# compatibility variables
|
||||
set(gbm_LIBRARIES ${gbm_LIBRARY})
|
||||
set(gbm_INCLUDE_DIRS ${gbm_INCLUDE_DIR})
|
||||
set(gbm_VERSION_STRING ${gbm_VERSION})
|
||||
|
||||
else()
|
||||
message(STATUS "Findgbm.cmake cannot find gbm on Windows systems.")
|
||||
set(gbm_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(gbm PROPERTIES
|
||||
URL "https://www.mesa3d.org"
|
||||
DESCRIPTION "Mesa gbm library."
|
||||
)
|
||||
@@ -1,374 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (C) 2017-2018 Red Hat, Inc.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
<!--
|
||||
org.freedesktop.portal.RemoteDesktop:
|
||||
@short_description: Remote desktop portal
|
||||
The Remote desktop portal allows to create remote desktop sessions.
|
||||
This documentation describes version 1 of this interface.
|
||||
-->
|
||||
<interface name="org.freedesktop.portal.RemoteDesktop">
|
||||
<!--
|
||||
CreateSession:
|
||||
@options: Vardict with optional further information
|
||||
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
|
||||
Create a remote desktop session.
|
||||
A remote desktop session is used to allow remote controlling a desktop
|
||||
session. It can also be used together with a screen cast session (see
|
||||
org.freedesktop.portal.ScreenCast), but may only be started and stopped
|
||||
with this interface.
|
||||
To also get a screen content, call the
|
||||
#org.freedesktop.ScreenCast.SelectSources with the
|
||||
#org.freedesktop.Session object created with this method.
|
||||
Supported keys in the @options vardict include:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>handle_token s</term>
|
||||
<listitem><para>
|
||||
A string that will be used as the last element of the @handle. Must be a valid
|
||||
object path element. See the #org.freedesktop.portal.Request documentation for
|
||||
more information about the @handle.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>session_handle_token s</term>
|
||||
<listitem><para>
|
||||
A string that will be used as the last element of the session handle. Must be a valid
|
||||
object path element. See the #org.freedesktop.portal.Session documentation for
|
||||
more information about the session handle.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
The following results get returned via the #org.freedesktop.portal.Request::Response signal:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>session_handle o</term>
|
||||
<listitem><para>
|
||||
The session handle. An object path for the
|
||||
#org.freedesktop.portal.Session object representing the created
|
||||
session.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
-->
|
||||
<method name="CreateSession">
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
|
||||
<arg type="o" name="handle" direction="out"/>
|
||||
</method>
|
||||
<!--
|
||||
SelectDevices:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
|
||||
Select input devices to remote control.
|
||||
Supported keys in the @options vardict include:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>handle_token s</term>
|
||||
<listitem><para>
|
||||
A string that will be used as the last element of the @handle. Must be a valid
|
||||
object path element. See the #org.freedesktop.portal.Request documentation for
|
||||
more information about the @handle.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>type u</term>
|
||||
<listitem><para>
|
||||
Bitmask of what device types to request remote controlling of.
|
||||
Default is all.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
For available source types, see the AvailableDeviceTypes property.
|
||||
-->
|
||||
<method name="SelectDevices">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="o" name="handle" direction="out"/>
|
||||
</method>
|
||||
<!--
|
||||
Start:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@parent_window: Identifier for the application window, see <link linkend="parent_window">Common Conventions</link>
|
||||
@options: Vardict with optional further information
|
||||
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
|
||||
Start the remote desktop session. This will typically result in the portal
|
||||
presenting a dialog letting the user select what to share, including
|
||||
devices and optionally screen content if screen cast sources was
|
||||
selected.
|
||||
Supported keys in the @options vardict include:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>handle_token s</term>
|
||||
<listitem><para>
|
||||
A string that will be used as the last element of the @handle. Must be a valid
|
||||
object path element. See the #org.freedesktop.portal.Request documentation for
|
||||
more information about the @handle.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
The following results get returned via the
|
||||
#org.freedesktop.portal.Request::Response signal:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>devices u</term>
|
||||
<listitem><para>
|
||||
A bitmask of the devices selected by the user.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
If a screen cast source was selected, the results of the
|
||||
#org.freedesktop.portal.ScreenCast.Start response signal may be
|
||||
included.
|
||||
-->
|
||||
<method name="Start">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="s" name="parent_window" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
|
||||
<arg type="o" name="handle" direction="out"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyPointerMotion:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@dx: Relative movement on the x axis
|
||||
@dy: Relative movement on the y axis
|
||||
Notify about a new relative pointer motion event. The (dx, dy) vector
|
||||
represents the new pointer position in the streams logical coordinate
|
||||
space.
|
||||
-->
|
||||
<method name="NotifyPointerMotion">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="d" name="dx" direction="in"/>
|
||||
<arg type="d" name="dy" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyPointerMotionAbsolute:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@stream: The PipeWire stream node the coordinate is relative to
|
||||
@x: Pointer motion x coordinate
|
||||
@y: Pointer motion y coordinate
|
||||
Notify about a new absolute pointer motion event. The (x, y) position
|
||||
represents the new pointer position in the streams logical coordinate
|
||||
space (see the logical_size stream property in
|
||||
#org.freedesktop.portal.ScreenCast).
|
||||
-->
|
||||
<method name="NotifyPointerMotionAbsolute">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="u" name="stream" direction="in"/>
|
||||
<arg type="d" name="x" direction="in"/>
|
||||
<arg type="d" name="y" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyPointerButton:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@button: The pointer button was pressed or released
|
||||
@state: The new state of the button
|
||||
The pointer button is encoded according to Linux Evdev button codes.
|
||||
May only be called if POINTER access was provided after starting the
|
||||
session.
|
||||
Available button states:
|
||||
<simplelist>
|
||||
<member>0: Released</member>
|
||||
<member>1: Pressed</member>
|
||||
</simplelist>
|
||||
-->
|
||||
<method name="NotifyPointerButton">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="i" name="button" direction="in"/>
|
||||
<arg type="u" name="state" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyPointerAxis:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@dx: Relative axis movement on the x axis
|
||||
@dy: Relative axis movement on the y axis
|
||||
The axis movement from a 'smooth scroll' device, such as a touchpad.
|
||||
When applicable, the size of the motion delta should be equivalent to
|
||||
the motion vector of a pointer motion done using the same advice.
|
||||
May only be called if POINTER access was provided after starting the
|
||||
session.
|
||||
Supported keys in the @options vardict include:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>finish b</term>
|
||||
<listitem><para>
|
||||
If set to true, this is the last axis event in a series, for
|
||||
example as a result of the fingers being lifted from a touchpad
|
||||
after a two-finger scroll. Default is false.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
-->
|
||||
<method name="NotifyPointerAxis">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="d" name="dx" direction="in"/>
|
||||
<arg type="d" name="dy" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyPointerAxisDiscrete:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@axis: The axis that was scrolled
|
||||
@steps: The number of steps scrolled
|
||||
May only be called if POINTER access was provided after starting the
|
||||
session.
|
||||
Available axes:
|
||||
<simplelist>
|
||||
<member>0: Vertical scroll</member>
|
||||
<member>1: Horizontal scroll</member>
|
||||
</simplelist>
|
||||
-->
|
||||
<method name="NotifyPointerAxisDiscrete">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="u" name="axis" direction="in"/>
|
||||
<arg type="i" name="steps" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyKeyboardKeycode:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@keycode: Keyboard code that was pressed or released
|
||||
@state: New state of keyboard keysym
|
||||
May only be called if KEYBOARD access was provided after starting the
|
||||
session.
|
||||
Available keyboard keysym states:
|
||||
<simplelist>
|
||||
<member>0: Released</member>
|
||||
<member>1: Pressed</member>
|
||||
</simplelist>
|
||||
-->
|
||||
<method name="NotifyKeyboardKeycode">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="i" name="keycode" direction="in"/>
|
||||
<arg type="u" name="state" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyKeyboardKeysym:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@keysym: Keyboard symbol that was pressed or released
|
||||
@state: New state of keyboard keysym
|
||||
May only be called if KEYBOARD access was provided after starting the
|
||||
session.
|
||||
Available keyboard keysym states:
|
||||
<simplelist>
|
||||
<member>0: Released</member>
|
||||
<member>1: Pressed</member>
|
||||
</simplelist>
|
||||
-->
|
||||
<method name="NotifyKeyboardKeysym">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="i" name="keysym" direction="in"/>
|
||||
<arg type="u" name="state" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyTouchDown:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@stream: The PipeWire stream node the coordinate is relative to
|
||||
@slot: Touch slot where touch point appeared
|
||||
@x: Touch down x coordinate
|
||||
@y: Touch down y coordinate
|
||||
May only be called if TOUCHSCREEN access was provided after starting the
|
||||
session.
|
||||
Notify about a new touch down event. The (x, y) position
|
||||
represents the new touch point position in the streams logical
|
||||
coordinate space (see the logical_size stream property in
|
||||
#org.freedesktop.portal.ScreenCast).
|
||||
-->
|
||||
<method name="NotifyTouchDown">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="u" name="stream" direction="in"/>
|
||||
<arg type="u" name="slot" direction="in"/>
|
||||
<arg type="d" name="x" direction="in"/>
|
||||
<arg type="d" name="y" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyTouchMotion:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@stream: The PipeWire stream node the coordinate is relative to
|
||||
@slot: Touch slot where touch point appeared
|
||||
@x: Touch motion x coordinate
|
||||
@y: Touch motion y coordinate
|
||||
May only be called if TOUCHSCREEN access was provided after starting the
|
||||
session.
|
||||
Notify about a new touch motion event. The (x, y) position
|
||||
represents where the touch point position in the streams logical
|
||||
coordinate space moved (see the logical_size stream property in
|
||||
#org.freedesktop.portal.ScreenCast).
|
||||
-->
|
||||
<method name="NotifyTouchMotion">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="u" name="stream" direction="in"/>
|
||||
<arg type="u" name="slot" direction="in"/>
|
||||
<arg type="d" name="x" direction="in"/>
|
||||
<arg type="d" name="y" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
NotifyTouchUp:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@slot: Touch slot where touch point appeared
|
||||
May only be called if TOUCHSCREEN access was provided after starting the
|
||||
session.
|
||||
Notify about a new touch up event.
|
||||
-->
|
||||
<method name="NotifyTouchUp">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="u" name="slot" direction="in"/>
|
||||
</method>
|
||||
<!--
|
||||
AvailableDeviceTypes:
|
||||
A bitmask of available source types. Currently defined types are:
|
||||
<simplelist>
|
||||
<member>1: KEYBOARD</member>
|
||||
<member>2: POINTER</member>
|
||||
<member>4: TOUCHSCREEN</member>
|
||||
</simplelist>
|
||||
-->
|
||||
<property name="AvailableDeviceTypes" type="u" access="read"/>
|
||||
<property name="version" type="u" access="read"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -1,186 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (C) 2017-2018 Red Hat, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
<!--
|
||||
org.freedesktop.portal.ScreenCast:
|
||||
@short_description: Screen cast portal
|
||||
-->
|
||||
<interface name="org.freedesktop.portal.ScreenCast">
|
||||
<!--
|
||||
CreateSession:
|
||||
@options: Vardict with optional further information
|
||||
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
|
||||
|
||||
Create a screen cast session. A successfully created session can at
|
||||
any time be closed using org.freedesktop.portal.Session::Close, or may
|
||||
at any time be closed by the portal implementation, which will be
|
||||
signalled via org.freedesktop.portal.Session::Closed.
|
||||
|
||||
The following results get returned via the #org.freedesktop.portal.Request::Response signal:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>session_handle o</term>
|
||||
<listitem><para>
|
||||
The session handle. An object path for the
|
||||
#org.freedesktop.portal.Session object representing the created
|
||||
session.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
-->
|
||||
<method name="CreateSession">
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
|
||||
<arg type="o" name="handle" direction="out"/>
|
||||
</method>
|
||||
<!--
|
||||
SelectSources:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
|
||||
|
||||
Configure what the screen cast session should record. This method must
|
||||
be called before starting the session.
|
||||
|
||||
Passing invalid input to this method will cause the session to be
|
||||
closed. An application may only attempt to select sources once per
|
||||
session.
|
||||
|
||||
Supported keys in the @options vardict include:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>types u</term>
|
||||
<listitem><para>
|
||||
Bitmask of what types of content to record. Default is MONITOR.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>multiple b</term>
|
||||
<listitem><para>
|
||||
Whether to allow selecting multiple sources. Default is no.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
For available source types, see the AvailableSourceTypes property.
|
||||
-->
|
||||
<method name="SelectSources">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="o" name="handle" direction="out"/>
|
||||
</method>
|
||||
<!--
|
||||
Start:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@parent_window: Identifier for the application window
|
||||
@options: Vardict with optional further information
|
||||
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
|
||||
|
||||
Start the screen cast session. This will typically result the portal
|
||||
presenting a dialog letting the user do the selection set up by
|
||||
SelectSources. An application can only attempt start a session once.
|
||||
|
||||
A screen cast session may only be started after having selected sources
|
||||
using org.freedesktop.portal.ScreenCast::SelectSources.
|
||||
|
||||
The @parent_window identifier must be of the form "x11:$XID" for an X11
|
||||
window. Support for other window systems may be added in the future.
|
||||
|
||||
The following results get returned via the
|
||||
#org.freedesktop.portal.Request::Response signal:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>streams a(ua{sv})</term>
|
||||
<listitem><para>
|
||||
An array of PipeWire streams. Each stream consists of a PipeWire
|
||||
node ID (the first element in the tuple, and a Vardict of
|
||||
properties.
|
||||
|
||||
The array will contain a single stream if 'multiple' (see
|
||||
SelectSources) was set to 'false', or at least one stream if
|
||||
'multiple' was set to 'true' as part of the SelectSources method.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
Stream properties include:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>position (ii)</term>
|
||||
<listitem><para>
|
||||
A tuple consisting of the position (x, y) in the compositor
|
||||
coordinate space. Note that the position may not be equivalent to a
|
||||
position in a pixel coordinate space. Only available for monitor
|
||||
streams.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>size (ii)</term>
|
||||
<listitem><para>
|
||||
A tuple consisting of (width, height). The size represents the size
|
||||
of the stream as it is displayed in the compositor coordinate
|
||||
space. Note that this size may not be equivalent to a size in a
|
||||
pixel coordinate space. The size may differ from the size of the
|
||||
stream.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
-->
|
||||
<method name="Start">
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="s" name="parent_window" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
|
||||
<arg type="o" name="handle" direction="out"/>
|
||||
</method>
|
||||
<!--
|
||||
OpenPipeWireRemote:
|
||||
@session_handle: Object path for the #org.freedesktop.portal.Session object
|
||||
@options: Vardict with optional further information
|
||||
@fd: File descriptor of an open PipeWire remote.
|
||||
|
||||
Open a file descriptor to the PipeWire remote where the screen cast
|
||||
streams are available. The file descriptor should be used to create a
|
||||
<classname>pw_remote</classname> object, by using
|
||||
<function>pw_remote_connect_fd</function>. Only the screen cast stream
|
||||
nodes will be available from this PipeWire node.
|
||||
-->
|
||||
<method name="OpenPipeWireRemote">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="open_pipewire_remote"/>
|
||||
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
|
||||
<arg type="o" name="session_handle" direction="in"/>
|
||||
<arg type="a{sv}" name="options" direction="in"/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
|
||||
<arg type="h" name="fd" direction="out"/>
|
||||
</method>
|
||||
<!--
|
||||
AvailableSourceTypes:
|
||||
|
||||
A bitmask of available source types. Currently defined types are:
|
||||
|
||||
<simplelist>
|
||||
<member>1: MONITOR</member>
|
||||
<member>2: WINDOW</member>
|
||||
</simplelist>
|
||||
-->
|
||||
<property name="AvailableSourceTypes" type="u" access="read"/>
|
||||
<property name="version" type="u" access="read"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -1,2 +1,2 @@
|
||||
########### install files ###############
|
||||
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR krfb)
|
||||
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR krfb)
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 46 KiB |
BIN
doc/email_invitation.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
@@ -1,11 +1,22 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
|
||||
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
|
||||
<!ENTITY kappname "&krfb;">
|
||||
<!ENTITY package "kdenetwork">
|
||||
<!ENTITY % addindex "IGNORE">
|
||||
<!ENTITY % English "INCLUDE">
|
||||
<!ENTITY % English "INCLUDE"> <!-- ONLY If you are writing non-English
|
||||
original documentation, change
|
||||
the language here -->
|
||||
|
||||
<!-- Do not define any other entities; instead, use the entities
|
||||
from entities/general.entities and $LANG/user.entities. -->
|
||||
]>
|
||||
<!-- Based on kdoctemplate v0.9 January 10 2003 -->
|
||||
|
||||
<book id="krfb" lang="&language;">
|
||||
|
||||
<!-- This header contains all of the meta-information for the document such
|
||||
as Authors, publish date, the abstract, and Keywords -->
|
||||
|
||||
<bookinfo>
|
||||
<title>The &krfb; Handbook</title>
|
||||
|
||||
@@ -21,11 +32,21 @@
|
||||
<year>2003</year>
|
||||
<holder>&Brad.Hards;</holder>
|
||||
</copyright>
|
||||
<!-- Translators: put here the copyright notice of the translation -->
|
||||
|
||||
<legalnotice>&FDLNotice;</legalnotice>
|
||||
|
||||
<date>2016-07-25</date>
|
||||
<releaseinfo>5.0 (Applications 16.08)</releaseinfo>
|
||||
<!-- Date and version information of the documentation
|
||||
Don't forget to include this last date and this last revision number, we
|
||||
need them for translation coordination !
|
||||
Please respect the format of the date (YYYY-MM-DD) and of the version
|
||||
(V.MM.LL), it could be used by automation scripts.
|
||||
Do NOT change these in the translation. -->
|
||||
|
||||
<date>2013-06-19</date>
|
||||
<releaseinfo>&kde; 4.11</releaseinfo>
|
||||
|
||||
<!-- Abstract about this handbook -->
|
||||
|
||||
<abstract>
|
||||
<para>
|
||||
@@ -35,6 +56,10 @@ view or even control the desktop.
|
||||
</para>
|
||||
</abstract>
|
||||
|
||||
<!-- This is a set of Keywords for indexing by search engines.
|
||||
Please at least include KDE, the KDE package it is in, the name
|
||||
of your application, and a few relevant keywords. -->
|
||||
|
||||
<keywordset>
|
||||
<keyword>KDE</keyword>
|
||||
<keyword>kdenetwork</keyword>
|
||||
@@ -50,9 +75,23 @@ view or even control the desktop.
|
||||
|
||||
</bookinfo>
|
||||
|
||||
<!-- The contents of the documentation begin here. Label
|
||||
each chapter so with the id attribute. This is necessary for two reasons: it
|
||||
allows you to easily reference the chapter from other chapters of your
|
||||
document, and if there is no ID, the name of the generated HTML files will vary
|
||||
from time to time making it hard to manage for maintainers and for the CVS
|
||||
system. Any chapter labelled (OPTIONAL) may be left out at the author's
|
||||
discretion. Other chapters should not be left out in order to maintain a
|
||||
consistent documentation style across all KDE apps. -->
|
||||
|
||||
<chapter id="introduction">
|
||||
<title>Introduction</title>
|
||||
|
||||
<!-- The introduction chapter contains a brief introduction for the
|
||||
application that explains what it does and where to report
|
||||
problems. Basically a long version of the abstract. Don't include a
|
||||
revision history. (see installation appendix comment) -->
|
||||
|
||||
<para>
|
||||
&krfb; is a server application that allows you to share your current
|
||||
session with a user on another machine, who can use a <acronym>VNC</acronym> client to
|
||||
@@ -73,7 +112,7 @@ to help you perform a task.
|
||||
<para>
|
||||
Please report any problems or feature requests to the &kde; mailing
|
||||
lists or file a bug at <ulink
|
||||
url="https://bugs.kde.org">https://bugs.kde.org</ulink>.
|
||||
url="http://bugs.kde.org">http://bugs.kde.org</ulink>.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
@@ -126,8 +165,10 @@ use &krfb; over other links, but performance is unlikely to be as good.
|
||||
<chapter id="using-krfb">
|
||||
<title>Using &krfb;</title>
|
||||
|
||||
<sect1 id="main-windw">
|
||||
<title>&krfb; Main Window</title>
|
||||
<!-- This chapter should tell the user how to use your app. You should use as
|
||||
many sections (Chapter, Sect1, Sect3, etc...) as is necessary to fully document
|
||||
your application. -->
|
||||
|
||||
<para>
|
||||
It is very easy to use &krfb; - it has a simple interface, as shown in
|
||||
the screenshot below.
|
||||
@@ -148,69 +189,64 @@ the screenshot below.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When you want to allow someone to access your desktop, you have to
|
||||
enable the checkbox <guilabel>Enable Desktop Sharing</guilabel>,
|
||||
which will start the server.
|
||||
</para>
|
||||
|
||||
<sect2 id="connection-details">
|
||||
<title>Connection Details</title>
|
||||
|
||||
<para>
|
||||
The <guilabel>Address</guilabel> contains the address of your
|
||||
computer and the port number, separated by a colon.
|
||||
The address is just a hint - you can use any address that can
|
||||
reach your computer. &krfb; tries to guess your address from your
|
||||
network configuration, but does not always succeed in doing so.
|
||||
If your computer is behind a firewall it may have a different
|
||||
address or be unreachable for other computers.
|
||||
</para>
|
||||
<para>
|
||||
You can change the port on the <guilabel>Network</guilabel>
|
||||
page in the configuration dialog.
|
||||
</para>
|
||||
<para>
|
||||
The next field is prefilled with an automatically generated password.
|
||||
Click in the icon at the right of the field to change the password.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="unattended-access">
|
||||
<title>Unattended Access</title>
|
||||
|
||||
<para>
|
||||
Any remote user with the desktop sharing password will have to be authenticated.
|
||||
If unattended access is activated, and the remote user provides the password
|
||||
for unattended mode, desktop sharing access will be granted without explicit
|
||||
confirmation.
|
||||
</para>
|
||||
<para>
|
||||
By default the password for this mode is empty, to change that click on
|
||||
the button and enter a password.
|
||||
</para>
|
||||
<para>
|
||||
If unattended access is allowed, then you should probably specify a
|
||||
password.
|
||||
When you want to allow someone to access your desktop, you can create
|
||||
an personal invitation using the <guibutton>New Personal
|
||||
Invitation...</guibutton> button, which will bring up a window
|
||||
containing the information needed to access your desktop. An example
|
||||
is shown below.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the machine is a server and you are using &krfb; for remote
|
||||
administration, you probably want to use unattended access.
|
||||
<screenshot>
|
||||
<screeninfo>Example &krfb; personal invitation</screeninfo>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="personal_invitation.png" format="PNG"/>
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>Example &krfb; personal invitation</phrase>
|
||||
</textobject>
|
||||
</mediaobject>
|
||||
</screenshot>
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="transfer-login-information">
|
||||
<title>Transfer Login Information</title>
|
||||
<para>
|
||||
To increase security, the invitation is only valid for an
|
||||
hour after it is created, and of course the person connecting has to
|
||||
have the correct password.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
&krfb; has no invitation feature any more as in previous versions.
|
||||
So you have to transfer the login information yourself using email
|
||||
or a personal invitation.
|
||||
Since you may want to invite someone to access your desktop by email,
|
||||
&krfb; can create invitations as email messages. You can create such
|
||||
an invitation using the <guibutton>New Email Invitation...</guibutton>
|
||||
button on the &krfb; main window. This will usually bring up an email
|
||||
message that looks like the following, ready for you to type in the
|
||||
email address of the person you are sending the invitation to.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screenshot>
|
||||
<screeninfo>Example &krfb; email invitation</screeninfo>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="email_invitation.png" format="PNG"/>
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>Example &krfb; email invitation</phrase>
|
||||
</textobject>
|
||||
</mediaobject>
|
||||
</screenshot>
|
||||
</para>
|
||||
|
||||
<warning>
|
||||
<para>
|
||||
&krfb; will warn you about the security implications of sending this
|
||||
information across an insecure link. You must heed those warnings.
|
||||
</para>
|
||||
<para>
|
||||
If you cannot encrypt the email (or otherwise secure the link),
|
||||
sending a password by email is a very serious security risk, since
|
||||
sending invitations by email is a very serious security risk, since
|
||||
anyone can read the password and address from the email as it passes
|
||||
over the network. This means that they can potentially take control of
|
||||
your machine.
|
||||
@@ -219,32 +255,33 @@ your machine.
|
||||
If you cannot encrypt the email message, it may be better to use a
|
||||
personal invitation, telephone the person you are giving access to,
|
||||
verify the identity of that person, and provide the required
|
||||
information that way.
|
||||
invitation information that way.
|
||||
</para>
|
||||
</warning>
|
||||
|
||||
<sect1 id="krfb-managing-invitations">
|
||||
<title>Managing &krfb; invitations</title>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
&krfb; uses the normal <acronym>RFB</acronym> password system, which does not transfer
|
||||
your password in the clear across the network. Instead, it uses a
|
||||
challenge-response system. This is reasonably secure, as long as the
|
||||
password is securely guarded.
|
||||
Having created an invitation (either a personal invitation or one that
|
||||
was sent by email), &krfb; main window allows you to delete existing
|
||||
invitations. To just delete one of the invitations, select it with the
|
||||
mouse (it should become highlighted), and then select
|
||||
the <guibutton>Delete</guibutton>. To delete all invitations, just
|
||||
select the <guibutton>Delete All</guibutton> button.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect2 id="krfb-qqit">
|
||||
<sect1 id="krfb-qit">
|
||||
<title>Quit &krfb;</title>
|
||||
|
||||
<para>
|
||||
If you close the &krfb; main window by clicking on the window close icon or using the
|
||||
shortcut <keycombo action="simul">&Alt;<keycap>F4</keycap></keycombo> the server
|
||||
keeps running, which is indicated by an icon in the system tray.
|
||||
To stop &krfb; either use <menuchoice><guimenu>File</guimenu><guimenuitem>Quit</guimenuitem></menuchoice>
|
||||
in the main window or right click on the icon in the system tray and select
|
||||
If you close the &krfb; main window the server keeps running, which is
|
||||
indicated by an icon in the system tray.
|
||||
To stop &krfb; right click on the icon in the systems tray and select
|
||||
<guimenuitem>Quit</guimenuitem>.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
||||
@@ -253,7 +290,7 @@ in the main window or right click on the icon in the system tray and select
|
||||
<para>
|
||||
In addition to the main &krfb; interface shown and described above,
|
||||
you can also control &krfb; using the
|
||||
<guimenuitem>Configure...</guimenuitem> on the &krfb; main window. The &krfb;
|
||||
<guibutton>Configure...</guibutton> on the &krfb; main window. The &krfb;
|
||||
configuration has two pages, as shown in the screenshot below:
|
||||
</para>
|
||||
|
||||
@@ -277,8 +314,8 @@ The <guilabel>Network</guilabel> page allows control over the port that
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <guilabel>Announce service on the local network</guilabel> checkbox
|
||||
controls whether &krfb; announces the service over the local network using
|
||||
The <guilabel>Announce service on the network</guilabel> checkbox
|
||||
controls whether &krfb; announces invitations over the network using
|
||||
Service Location Protocol. This is normally a good idea, but only
|
||||
works really well with a Service Location Protocol aware client, such
|
||||
as &krdc;.
|
||||
@@ -286,8 +323,8 @@ as &krdc;.
|
||||
|
||||
<para>
|
||||
If you select the <guilabel>Use default port</guilabel> checkbox,
|
||||
then &krfb; will locate a suitable port.
|
||||
If you deselect this checkbox, you can specify a particular
|
||||
then &krfb; will locate a suitable port, and invitations will match
|
||||
this port. If you deselect this checkbox, you can specify a particular
|
||||
port. Specifying a particular port may be useful if you are using
|
||||
port-forwarding on the firewall. Note that if Service Location
|
||||
Protocol is turned on, this will automatically deal with identifying
|
||||
@@ -295,8 +332,8 @@ the correct port.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <guilabel>Security</guilabel> page allows you to configure whether the
|
||||
person connecting to the &krfb; server can control the desktop, or only view.
|
||||
The <guilabel>Security</guilabel> page allows you configure settings
|
||||
related to access to the &krfb; server.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -313,15 +350,41 @@ person connecting to the &krfb; server can control the desktop, or only view.
|
||||
</screenshot>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <guilabel>Allow uninvited connections</guilabel> check box controls
|
||||
whether &krfb; allows connection without an invitation. If uninvited
|
||||
connections are allowed, then you should probably specify a
|
||||
password. You can also use the check boxes here to choose whether you
|
||||
have to confirm the connection before it proceeds, and whether the
|
||||
person connecting can control the desktop, or only view.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the machine is a workstation, and you choose to allow uninvited
|
||||
connections, you probably want to select the <guilabel>Ask
|
||||
before accepting connections </guilabel>. Conversely, if the
|
||||
machine is a server and you are using &krfb; for remote
|
||||
administration, you probably want to deselect this option.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
&krfb; uses the normal <acronym>RFB</acronym> password system, which does not transfer
|
||||
your password in the clear across the network. Instead, it uses a
|
||||
challenge-response system. This is reasonably secure, as long as the
|
||||
password is securely guarded.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="krfb-connection">
|
||||
<title>Connecting to &krfb;</title>
|
||||
<title>What happens when someone connects to &krfb;</title>
|
||||
|
||||
<para>
|
||||
When someone connects to &krfb; on your machine, you will get a pop-up
|
||||
notification that looks like the following screenshot, unless you are
|
||||
accepting unattended access without confirmation.
|
||||
accepting uninvited connections without warning.
|
||||
</para>
|
||||
<para>
|
||||
<screenshot>
|
||||
@@ -339,8 +402,8 @@ accepting unattended access without confirmation.
|
||||
|
||||
<para>
|
||||
If you <guibutton>Accept Connection</guibutton>, the client can
|
||||
proceed to authenticate, which requires the correct password for a
|
||||
login. If you <guibutton>Refuse
|
||||
proceed to authenticate (which requires the correct password for a
|
||||
personal invitation or email invitation). If you <guibutton>Refuse
|
||||
Connection</guibutton>, then the attempt to connect will be terminated.
|
||||
</para>
|
||||
|
||||
@@ -350,11 +413,23 @@ mouse</guilabel> check box determines whether this client can only
|
||||
observe, or can take control of your machine.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the client connection is successful, and used the password from a
|
||||
personal invitation or email invitation, then that invitation is
|
||||
deleted and cannot be used again. You will also get a small pop-up
|
||||
window in the dock, that shows that the connection has been made.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<chapter id="credits">
|
||||
|
||||
<!-- Include credits for the programmers, documentation writers, and
|
||||
contributors here. The license for your software should then be included below
|
||||
the credits with a reference to the appropriate license file included in the KDE
|
||||
distribution. -->
|
||||
|
||||
<title>Credits and License</title>
|
||||
|
||||
<para>
|
||||
@@ -383,6 +458,33 @@ Documentation Copyright © 2003 &Brad.Hards; &Brad.Hards.mail;
|
||||
|
||||
</chapter>
|
||||
|
||||
<appendix id="installation">
|
||||
<title>Installation</title>
|
||||
|
||||
<sect1 id="getting-krfb">
|
||||
<title>How to obtain &krfb;</title>
|
||||
|
||||
<!-- This first entity contains boiler plate for applications that are
|
||||
part of KDE CVS. You should remove it if you are releasing your
|
||||
application -->
|
||||
|
||||
&install.intro.documentation;
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="compilation">
|
||||
<title>Compilation and Installation</title>
|
||||
|
||||
<!-- This entity contains the boilerplate text for standard -->
|
||||
<!-- compilation instructions. If your application requires any -->
|
||||
<!-- special handling, remove it, and replace with your own text. -->
|
||||
|
||||
&install.compile.documentation;
|
||||
|
||||
</sect1>
|
||||
|
||||
</appendix>
|
||||
|
||||
&documentation.index;
|
||||
</book>
|
||||
|
||||
|
||||
BIN
doc/personal_invitation.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 51 KiB |
@@ -1,6 +0,0 @@
|
||||
add_subdirectory(x11)
|
||||
|
||||
# Makes sense to use only when PW framebuffer is used
|
||||
if (${PipeWire_FOUND})
|
||||
add_subdirectory(xdp)
|
||||
endif()
|
||||
@@ -1,18 +0,0 @@
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set (krfb_events_x11_SRCS
|
||||
x11events.cpp
|
||||
x11eventsplugin.cpp
|
||||
)
|
||||
|
||||
add_library (krfb_events_x11 MODULE ${krfb_events_x11_SRCS})
|
||||
|
||||
target_link_libraries (krfb_events_x11
|
||||
${X11_XTest_LIB}
|
||||
KF5::CoreAddons
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_events_x11 DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events)
|
||||
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"Encoding": "UTF-8",
|
||||
"KPlugin": {
|
||||
"Description": "X11 XFakeInput based event handler for KRfb",
|
||||
"Description[ca@valencia]": "Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb",
|
||||
"Description[ca]": "Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb",
|
||||
"Description[da]": "X11 XFakeInput baseret hændelseshåndtering til KRfb",
|
||||
"Description[de]": "Ereignis-Modul basierend auf X11 XFakeInput für KRfb",
|
||||
"Description[el]": "Χειριστής γεγονότων με βάση το X11 XFakeInput για το KRfb",
|
||||
"Description[en_GB]": "X11 XFakeInput based event handler for KRfb",
|
||||
"Description[es]": "Gestor de eventos basado en XFakeInput de X11 para KRfb",
|
||||
"Description[et]": "KRfb X11 XFakeInput'i põhine sündmuste käitleja",
|
||||
"Description[eu]": "KRfb-rako «X11 XFakeInput»en oinarritutako gertaera maneiatzailea",
|
||||
"Description[fi]": "KRfb:n X11 XFakeInput -pohjainen tapahtumakäsittelijä",
|
||||
"Description[fr]": "Gestionnaire d'évènements utilisant XFakeInput de X11 pour KRfb",
|
||||
"Description[gl]": "Xestor de eventos para KRfb baseado no XFakeInput de X11",
|
||||
"Description[ia]": "Maneator de evento de X11 basate sur XFakeInput per KRfb",
|
||||
"Description[it]": "Gestore eventi basato su XFakeInput di X11 per KRfb",
|
||||
"Description[ko]": "X11 XFakeInput 기반 KRfb 이벤트 핸들러",
|
||||
"Description[nl]": "Op X11 XFakeInput gebaseerde behandelaar van gebeurtenis voor KRfb",
|
||||
"Description[nn]": "X11 XFakeInput-basert hendingshandtering for KRfb",
|
||||
"Description[pl]": "Obsługa wydarzeń X11 oparta na XFakeInput dla KRfb",
|
||||
"Description[pt]": "Tratamento de eventos baseado no XFakeInput do X11 para o KRfb",
|
||||
"Description[pt_BR]": "Manipulador de eventos baseado no XFakeInput do X11 para o KRfb",
|
||||
"Description[sk]": "X11 Spracovateľ udalostí založený na XFakeInput pre KRfb",
|
||||
"Description[sl]": "Upravljavec dogodkov za KRfb na osnovi X11 XFakeInput",
|
||||
"Description[sv]": "Händelsehanterare för KRfb baserad på X11 XFakeInput",
|
||||
"Description[uk]": "Обробник подій для KRfb на основі XFakeInput X11",
|
||||
"Description[x-test]": "xxX11 XFakeInput based event handler for KRfbxx",
|
||||
"Description[zh_CN]": "基于 X11 XFakeInput 的 KRfb 事件处理器",
|
||||
"Description[zh_TW]": "KRfb 基於 X11 XFakeInput 的事件處理器",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "x11",
|
||||
"License": "GPL",
|
||||
"Name": "X11 Event handler for KRfb",
|
||||
"Name[ca@valencia]": "Gestor d'esdeveniments de l'X11 per al KRfb",
|
||||
"Name[ca]": "Gestor d'esdeveniments de l'X11 per al KRfb",
|
||||
"Name[da]": "X11 hændelseshåndtering til KRfb",
|
||||
"Name[de]": "Ereignis-Modul basierend auf X11 für KRfb",
|
||||
"Name[el]": "Χειριστής γεγονότων X11 για το KRfb",
|
||||
"Name[en_GB]": "X11 Event handler for KRfb",
|
||||
"Name[es]": "Gestor de eventos de X11 para KRfb",
|
||||
"Name[et]": "KRfb X11 sündmuste käitleja",
|
||||
"Name[eu]": "KRfb-rako X11 gertaera maneiatzailea",
|
||||
"Name[fi]": "KRfb:n X11-tapahtumakäsittelijä",
|
||||
"Name[fr]": "Gestionnaire d'évènements X11 pour KRfb",
|
||||
"Name[gl]": "Xestor de eventos de X11 para KRfb",
|
||||
"Name[ia]": "Manipulator de evento de X11 per KRfb",
|
||||
"Name[it]": "Gestore eventi X11 per KRfb",
|
||||
"Name[ko]": "KRfb X11 이벤트 핸들러",
|
||||
"Name[nl]": "Op X11 behandelaar van gebeurtenis voor KRfb",
|
||||
"Name[nn]": "X11-hendingshandsamar for KRfb",
|
||||
"Name[pl]": "Obsługa wydarzeń X11 dla KRfb",
|
||||
"Name[pt]": "Tratamento de eventos do X11 para o KRfb",
|
||||
"Name[pt_BR]": "Manipulador de eventos do X11 para o KRfb",
|
||||
"Name[sk]": "X11 Obsluha udalostí pre KRfb",
|
||||
"Name[sl]": "Upravljavec dogodkov za KRfb na osnovi X11",
|
||||
"Name[sv]": "X11-händelsehanterare för Krfb",
|
||||
"Name[uk]": "Обробник подій для KRfb на основі X11",
|
||||
"Name[x-test]": "xxX11 Event handler for KRfbxx",
|
||||
"Name[zh_CN]": "X11 KRfb 事件处理器",
|
||||
"Name[zh_TW]": "KRfb 的 X11 事件處理器",
|
||||
"Version": "0.1",
|
||||
"Website": "http://www.kde.org"
|
||||
}
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2016 by Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "x11events.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QX11Info>
|
||||
#include <QDesktopWidget>
|
||||
#include <QGlobalStatic>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
|
||||
#include <QX11Info>
|
||||
|
||||
enum {
|
||||
LEFTSHIFT = 1,
|
||||
RIGHTSHIFT = 2,
|
||||
ALTGR = 4
|
||||
};
|
||||
|
||||
class EventData
|
||||
{
|
||||
public:
|
||||
EventData();
|
||||
|
||||
//keyboard
|
||||
Display *dpy = nullptr;
|
||||
signed char modifiers[0x100] = {};
|
||||
KeyCode keycodes[0x100] = {};
|
||||
KeyCode leftShiftCode = 0;
|
||||
KeyCode rightShiftCode = 0;
|
||||
KeyCode altGrCode = 0;
|
||||
char modifierState = 0;
|
||||
|
||||
//mouse
|
||||
int buttonMask = 0;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
private:
|
||||
void init();
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(EventData, data)
|
||||
|
||||
EventData::EventData()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
void EventData::init()
|
||||
{
|
||||
buttonMask = 0;
|
||||
|
||||
dpy = QX11Info::display();
|
||||
//initialize keycodes
|
||||
KeySym key, *keymap;
|
||||
int i, j, minkey, maxkey, syms_per_keycode;
|
||||
|
||||
memset(modifiers, -1, sizeof(modifiers));
|
||||
|
||||
XDisplayKeycodes(dpy, &minkey, &maxkey);
|
||||
Q_ASSERT(minkey >= 8);
|
||||
Q_ASSERT(maxkey < 256);
|
||||
keymap = (KeySym *) XGetKeyboardMapping(dpy, minkey,
|
||||
(maxkey - minkey + 1),
|
||||
&syms_per_keycode);
|
||||
Q_ASSERT(keymap);
|
||||
|
||||
for (i = minkey; i <= maxkey; i++) {
|
||||
for (j = 0; j < syms_per_keycode; j++) {
|
||||
key = keymap[(i-minkey)*syms_per_keycode+j];
|
||||
|
||||
if (key >= ' ' && key < 0x100 && i == XKeysymToKeycode(dpy, key)) {
|
||||
keycodes[key] = i;
|
||||
modifiers[key] = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leftShiftCode = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
rightShiftCode = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
altGrCode = XKeysymToKeycode(dpy, XK_Mode_switch);
|
||||
|
||||
XFree((char *)keymap);
|
||||
}
|
||||
|
||||
/* this function adjusts the modifiers according to mod (as from modifiers) and data->modifierState */
|
||||
static void tweakModifiers(signed char mod, bool down)
|
||||
{
|
||||
bool isShift = data->modifierState & (LEFTSHIFT | RIGHTSHIFT);
|
||||
|
||||
if (mod < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isShift && mod != 1) {
|
||||
if (data->modifierState & LEFTSHIFT) {
|
||||
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
|
||||
if (data->modifierState & RIGHTSHIFT) {
|
||||
XTestFakeKeyEvent(data->dpy, data->rightShiftCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isShift && mod == 1) {
|
||||
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
|
||||
if ((data->modifierState & ALTGR) && mod != 2) {
|
||||
XTestFakeKeyEvent(data->dpy, data->altGrCode,
|
||||
!down, CurrentTime);
|
||||
}
|
||||
|
||||
if (!(data->modifierState & ALTGR) && mod == 2) {
|
||||
XTestFakeKeyEvent(data->dpy, data->altGrCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
void X11EventHandler::handleKeyboard(bool down, rfbKeySym keySym)
|
||||
{
|
||||
#define ADJUSTMOD(sym,state) \
|
||||
if(keySym==sym) { if(down) data->modifierState|=state; else data->modifierState&=~state; }
|
||||
|
||||
if (QX11Info::isPlatformX11()) {
|
||||
ADJUSTMOD(XK_Shift_L, LEFTSHIFT);
|
||||
ADJUSTMOD(XK_Shift_R, RIGHTSHIFT);
|
||||
ADJUSTMOD(XK_Mode_switch, ALTGR);
|
||||
|
||||
if (keySym >= ' ' && keySym < 0x100) {
|
||||
KeyCode k;
|
||||
|
||||
if (down) {
|
||||
tweakModifiers(data->modifiers[keySym], True);
|
||||
}
|
||||
|
||||
k = data->keycodes[keySym];
|
||||
|
||||
if (k != NoSymbol) {
|
||||
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
|
||||
}
|
||||
|
||||
if (down) {
|
||||
tweakModifiers(data->modifiers[keySym], False);
|
||||
}
|
||||
} else {
|
||||
KeyCode k = XKeysymToKeycode(data->dpy, keySym);
|
||||
|
||||
if (k != NoSymbol) {
|
||||
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
// Wayland platform and pipweire plugin in use
|
||||
if (KrfbConfig::preferredFrameBufferPlugin() == QStringLiteral("pw")) {
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
void X11EventHandler::handlePointer(int buttonMask, int x, int y)
|
||||
{
|
||||
if (QX11Info::isPlatformX11()) {
|
||||
QDesktopWidget *desktopWidget = QApplication::desktop();
|
||||
|
||||
int screen = desktopWidget->screenNumber();
|
||||
|
||||
if (screen < 0) {
|
||||
screen = 0;
|
||||
}
|
||||
|
||||
XTestFakeMotionEvent(data->dpy, screen, x, y, CurrentTime);
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if ((data->buttonMask&(1 << i)) != (buttonMask&(1 << i))) {
|
||||
XTestFakeButtonEvent(data->dpy,
|
||||
i + 1,
|
||||
(buttonMask&(1 << i)) ? True : False,
|
||||
CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
data->buttonMask = buttonMask;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2016 by Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef EVENTS_X11EVENTS_H
|
||||
#define EVENTS_X11EVENTS_H
|
||||
|
||||
#include "../../krfb/events.h"
|
||||
|
||||
class X11EventHandler : public EventHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit X11EventHandler(QObject *parent = nullptr)
|
||||
: EventHandler(parent)
|
||||
{
|
||||
};
|
||||
|
||||
void handleKeyboard(bool down, rfbKeySym key) override;
|
||||
void handlePointer(int buttonMask, int x, int y) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2016 Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_EVENTS_X11_X11EVENTSPLUGIN_H
|
||||
#define KRFB_EVENTS_X11_X11EVENTSPLUGIN_H
|
||||
|
||||
#include "eventsplugin.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class EventHandler;
|
||||
|
||||
class X11EventsPlugin : public EventsPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
X11EventsPlugin(QObject *parent, const QVariantList &args);
|
||||
~X11EventsPlugin() override = default;
|
||||
|
||||
EventHandler *eventHandler() override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(X11EventsPlugin)
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
@@ -1,27 +0,0 @@
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set (krfb_events_xdp_SRCS
|
||||
xdpevents.cpp
|
||||
xdpeventsplugin.cpp
|
||||
)
|
||||
|
||||
qt5_add_dbus_interface(
|
||||
krfb_events_xdp_SRCS
|
||||
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_remotedesktop_interface.xml
|
||||
xdp_dbus_remotedesktop_interface
|
||||
)
|
||||
|
||||
add_library (krfb_events_xdp MODULE ${krfb_events_xdp_SRCS})
|
||||
|
||||
target_link_libraries (krfb_events_xdp
|
||||
KF5::CoreAddons
|
||||
KF5::I18n
|
||||
Qt5::DBus
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_events_xdp
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events
|
||||
)
|
||||
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"Encoding": "UTF-8",
|
||||
"KPlugin": {
|
||||
"Description": "Xdg-desktop-portal based event handler for KRfb",
|
||||
"Description[ca@valencia]": "Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb",
|
||||
"Description[ca]": "Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb",
|
||||
"Description[da]": "Xdg-desktop-portal baseret hændelseshåndtering til KRfb",
|
||||
"Description[de]": "Ereignis-Modul basierend auf Xdg-desktop-portal für KRfb",
|
||||
"Description[el]": "Χειριστής γεγονότων με βάση το xdg-desktop-portal για το KRfb",
|
||||
"Description[en_GB]": "Xdg-desktop-portal based event handler for KRfb",
|
||||
"Description[es]": "Gestor de eventos basado en Xdg-desktop-portal para KRfb",
|
||||
"Description[et]": "KRfb Xdg-desktop-portal'i põhine sündmuste käitleja",
|
||||
"Description[eu]": "KRfb-rako «xdg-desktop-portal»en oinarritutako maneiatzailea",
|
||||
"Description[fi]": "KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä",
|
||||
"Description[fr]": "Gestionnaire d'évènements utilisant Xdg-desktop-portal pour KRfb",
|
||||
"Description[gl]": "Xestor de eventos para KRfb baseado en Xdg-desktop-portal",
|
||||
"Description[ia]": "Maneator de evento basate sur Xdg-desktop-portal per KRfb",
|
||||
"Description[it]": "Gestore eventi basato su xdg-desktop-portal per KRfb",
|
||||
"Description[ko]": "Xdg-desktop-portal 기반 KRfb 이벤트 핸들러",
|
||||
"Description[nl]": "Op Xdg-desktop-portal gebaseerde behandelaar van gebeurtenis voor KRfb",
|
||||
"Description[nn]": "Xdg-desktop-portal-basert hendingshandtering for KRfb",
|
||||
"Description[pl]": "Obsługa wydarzeń oparta na Xdg-desktop-portal dla KRfb",
|
||||
"Description[pt]": "Tratamento de eventos baseado no Xdg-desktop-portal para o KRfb",
|
||||
"Description[pt_BR]": "Manipulador de eventos baseado no xdg-desktop-portal para o KRfb",
|
||||
"Description[sk]": "Obsluha udalostí založená na Xdg-desktop-portal pre KRfb",
|
||||
"Description[sl]": "Upravljavec dogodkov, na osnovi portala Xdg-desktop za KRfb",
|
||||
"Description[sv]": "Händelsehanterare för KRfb baserad på xdg-desktop-portal",
|
||||
"Description[uk]": "Обробник подій для KRfb на основі Xdg-desktop-portal",
|
||||
"Description[x-test]": "xxXdg-desktop-portal based event handler for KRfbxx",
|
||||
"Description[zh_CN]": "基于 xdg-desktop-portal 的 KRfb 事件处理器",
|
||||
"Description[zh_TW]": "KRfb 基於 Xdg-desktop-portal 的事件處理器",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "xdp",
|
||||
"License": "GPL",
|
||||
"Name": "Xdg-desktop-portal Event handler for KRfb",
|
||||
"Name[ca@valencia]": "Gestor d'esdeveniments «Xdg-desktop-portal» per al KRfb",
|
||||
"Name[ca]": "Gestor d'esdeveniments «Xdg-desktop-portal» per al KRfb",
|
||||
"Name[da]": "Xdg-desktop-portal hændelseshåndtering til KRfb",
|
||||
"Name[de]": "Ereignis-Modul basierend auf Xdg-desktop-portal für KRfb",
|
||||
"Name[el]": "Χειριστής γεγονότων xdg-desktop-portal για το KRfb",
|
||||
"Name[en_GB]": "Xdg-desktop-portal Event handler for KRfb",
|
||||
"Name[es]": "Gestor de eventos de Xdg-desktop-portal para KRfb",
|
||||
"Name[et]": "KRfb Xdg-desktop-portal'i sündmuste käitleja",
|
||||
"Name[eu]": "KRfb-rako «xdg-desktop-portal» gertaera maneiatzailea",
|
||||
"Name[fi]": "KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä",
|
||||
"Name[fr]": "Gestionnaire d'évènements Xdg-desktop-portal pour KRfb",
|
||||
"Name[gl]": "Xestor de eventos de Xdg-desktop-portal para KRfb",
|
||||
"Name[ia]": "Maneator de evento basate sur Xdg-desktop-portal per KRfb",
|
||||
"Name[it]": "Gestore eventi xdg-desktop-portal per KRfb",
|
||||
"Name[ko]": "KRfb Xdg-desktop-portal 이벤트 핸들러",
|
||||
"Name[nl]": "Op Xdg-desktop-portal behandelaar van gebeurtenis voor KRfb",
|
||||
"Name[nn]": "Xdg-desktop-portal-hendingshandtering for KRfb",
|
||||
"Name[pl]": "Obsługa wydarzeń Xdg-desktop-portal dla KRfb",
|
||||
"Name[pt]": "Tratamento de eventos do Xdg-desktop-portal para o KRfb",
|
||||
"Name[pt_BR]": "Manipulador de eventos xdg-desktop-portal para o KRfb",
|
||||
"Name[sk]": "Xdg-desktop-portal Obsluha udalostí pre KRfb",
|
||||
"Name[sl]": "Upravljavec dogodkov za KRfb na osnovi portala Xdg-desktop",
|
||||
"Name[sv]": "Xdg-desktop-portal händelsehanterare för Krfb",
|
||||
"Name[uk]": "Обробник подій для KRfb на основі Xdg-desktop-portal",
|
||||
"Name[x-test]": "xxXdg-desktop-portal Event handler for KRfbxx",
|
||||
"Name[zh_CN]": "xdg-desktop-portal KRfb 事件处理器",
|
||||
"Name[zh_TW]": "KRfb 的 Xdg-desktop-portal 事件處理器",
|
||||
"Version": "0.1",
|
||||
"Website": "http://www.kde.org"
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "xdpevents.h"
|
||||
|
||||
#include "rfbservermanager.h"
|
||||
#include "xdp_dbus_remotedesktop_interface.h"
|
||||
|
||||
#include <linux/input.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QGlobalStatic>
|
||||
|
||||
class EventData
|
||||
{
|
||||
public:
|
||||
EventData();
|
||||
|
||||
//mouse
|
||||
int buttonMask = 0;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
QScopedPointer<OrgFreedesktopPortalRemoteDesktopInterface> dbusXdpRemoteDesktopService;
|
||||
|
||||
private:
|
||||
void init();
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(EventData, data)
|
||||
|
||||
EventData::EventData()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
void EventData::init()
|
||||
{
|
||||
dbusXdpRemoteDesktopService.reset(new OrgFreedesktopPortalRemoteDesktopInterface(QStringLiteral("org.freedesktop.portal.Desktop"),
|
||||
QStringLiteral("/org/freedesktop/portal/desktop"), QDBusConnection::sessionBus()));
|
||||
}
|
||||
|
||||
void XdpEventHandler::handleKeyboard(bool down, rfbKeySym keySym)
|
||||
{
|
||||
// TODO: implement button handling
|
||||
// both in FakeInput interface and here
|
||||
Q_UNUSED(down)
|
||||
Q_UNUSED(keySym)
|
||||
}
|
||||
|
||||
void XdpEventHandler::handlePointer(int buttonMask, int x, int y)
|
||||
{
|
||||
const uint streamNodeId = frameBuffer()->customProperty(QStringLiteral("stream_node_id")).toUInt();
|
||||
const QDBusObjectPath sessionHandle = frameBuffer()->customProperty(QStringLiteral("session_handle")).value<QDBusObjectPath>();
|
||||
|
||||
if (streamNodeId == 0 || sessionHandle.path().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (x != data->x || y != data->y) {
|
||||
data->dbusXdpRemoteDesktopService->NotifyPointerMotionAbsolute(sessionHandle, QVariantMap(), streamNodeId, x, y);
|
||||
data->x = x;
|
||||
data->y = y;
|
||||
}
|
||||
|
||||
if (buttonMask != data->buttonMask) {
|
||||
int i = 0;
|
||||
QVector<int> buttons = { BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, 0, 0, 0, 0, BTN_SIDE, BTN_EXTRA };
|
||||
for (auto it = buttons.constBegin(); it != buttons.constEnd(); ++it) {
|
||||
int prevButtonState = (data->buttonMask >> i) & 0x01;
|
||||
int currentButtonState = (buttonMask >> i) & 0x01;
|
||||
|
||||
if (prevButtonState != currentButtonState) {
|
||||
if (*it) {
|
||||
data->dbusXdpRemoteDesktopService->NotifyPointerButton(sessionHandle, QVariantMap(), *it, buttonMask);
|
||||
} else {
|
||||
int axis = 0;
|
||||
int steps = 0;
|
||||
switch (i) {
|
||||
case 3:
|
||||
axis = 0; // Vertical
|
||||
steps = -1;
|
||||
break;
|
||||
case 4:
|
||||
axis = 0; // Vertical
|
||||
steps = 1;
|
||||
break;
|
||||
case 5:
|
||||
axis = 1; // Horizontal
|
||||
steps = -1;
|
||||
break;
|
||||
case 6:
|
||||
axis = 1; // Horizontal
|
||||
steps = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
data->dbusXdpRemoteDesktopService->NotifyPointerAxisDiscrete(sessionHandle, QVariantMap(), axis, steps);
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
data->buttonMask = buttonMask;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef EVENTS_XDPEVENTS_H
|
||||
#define EVENTS_XDPEVENTS_H
|
||||
|
||||
#include "../../krfb/events.h"
|
||||
|
||||
class XdpEventHandler : public EventHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
void handleKeyboard(bool down, rfbKeySym key) override;
|
||||
void handlePointer(int buttonMask, int x, int y) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "xdpeventsplugin.h"
|
||||
|
||||
#include "xdpevents.h"
|
||||
|
||||
#include <KPluginFactory>
|
||||
|
||||
K_PLUGIN_FACTORY_WITH_JSON(XdpEventsPluginFactory, "krfb_events_xdp.json",
|
||||
registerPlugin<XdpEventsPlugin>();)
|
||||
|
||||
XdpEventsPlugin::XdpEventsPlugin(QObject *parent, const QVariantList &args)
|
||||
: EventsPlugin(parent, args)
|
||||
{
|
||||
}
|
||||
|
||||
EventHandler *XdpEventsPlugin::eventHandler()
|
||||
{
|
||||
// works only under Wayland
|
||||
return new XdpEventHandler();
|
||||
}
|
||||
|
||||
#include "xdpeventsplugin.moc"
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
This file is part of the KDE project
|
||||
|
||||
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_EVENTS_XDP_XDPEVENTSPLUGIN_H
|
||||
#define KRFB_EVENTS_XDP_XDPEVENTSPLUGIN_H
|
||||
|
||||
#include "eventsplugin.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class EventHandler;
|
||||
|
||||
class XdpEventsPlugin : public EventsPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
XdpEventsPlugin(QObject *parent, const QVariantList &args);
|
||||
~XdpEventsPlugin() override = default;
|
||||
|
||||
EventHandler *eventHandler() override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(XdpEventsPlugin)
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
add_subdirectory (qt)
|
||||
add_subdirectory (x11)
|
||||
|
||||
if (${XCB_DAMAGE_FOUND} AND ${XCB_SHM_FOUND} AND ${XCB_IMAGE_FOUND})
|
||||
add_subdirectory (xcb)
|
||||
endif()
|
||||
|
||||
if (${PipeWire_FOUND})
|
||||
add_subdirectory(pipewire)
|
||||
endif()
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set (krfb_framebuffer_pw_SRCS
|
||||
pw_framebuffer.cpp
|
||||
pw_framebufferplugin.cpp
|
||||
|
||||
screencasting.cpp
|
||||
)
|
||||
|
||||
ecm_add_qtwayland_client_protocol(krfb_framebuffer_pw_SRCS
|
||||
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/screencast.xml
|
||||
BASENAME zkde-screencast-unstable-v1
|
||||
)
|
||||
|
||||
ecm_qt_declare_logging_category(krfb_framebuffer_pw_SRCS
|
||||
HEADER krfb_fb_pipewire_debug.h
|
||||
IDENTIFIER KRFB_FB_PIPEWIRE
|
||||
CATEGORY_NAME krfb.framebuffer.pipewire
|
||||
DESCRIPTION "KRFB PipeWire framebuffer plugin"
|
||||
EXPORT KRFB
|
||||
)
|
||||
|
||||
qt5_add_dbus_interface(
|
||||
krfb_framebuffer_pw_SRCS
|
||||
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_screencast_interface.xml
|
||||
xdp_dbus_screencast_interface
|
||||
)
|
||||
|
||||
qt5_add_dbus_interface(
|
||||
krfb_framebuffer_pw_SRCS
|
||||
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_remotedesktop_interface.xml
|
||||
xdp_dbus_remotedesktop_interface
|
||||
)
|
||||
|
||||
add_library(krfb_framebuffer_pw
|
||||
MODULE
|
||||
${krfb_framebuffer_pw_SRCS}
|
||||
)
|
||||
set_property(TARGET krfb_framebuffer_pw PROPERTY C_STANDARD 99)
|
||||
|
||||
target_link_libraries(krfb_framebuffer_pw
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::DBus
|
||||
KF5::CoreAddons
|
||||
KF5::WaylandClient
|
||||
Wayland::Client
|
||||
krfbprivate
|
||||
PkgConfig::PipeWire
|
||||
)
|
||||
|
||||
if (HAVE_DMA_BUF)
|
||||
target_link_libraries(krfb_framebuffer_pw
|
||||
${epoxy_LIBRARIES}
|
||||
gbm::gbm
|
||||
)
|
||||
endif()
|
||||
|
||||
install (TARGETS krfb_framebuffer_pw
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
||||
)
|
||||
@@ -1,70 +0,0 @@
|
||||
{
|
||||
"Encoding": "UTF-8",
|
||||
"KPlugin": {
|
||||
"Description": "PipeWire based Framebuffer for KRfb.",
|
||||
"Description[ca@valencia]": "«Framebuffer» basat en «PipeWire» per al KRfb.",
|
||||
"Description[ca]": "«Framebuffer» basat en «PipeWire» per al KRfb.",
|
||||
"Description[cs]": "Framebuffer založený na Pipe pro KRfb.",
|
||||
"Description[da]": "PipeWire baseret framebuffer til KRfb.",
|
||||
"Description[de]": "PipeWire-basierter Framebuffer für KRfb.",
|
||||
"Description[el]": "Μνήμη ανανέωσης με βάση το pipewire για το KRfb.",
|
||||
"Description[en_GB]": "PipeWire based Framebuffer for KRfb.",
|
||||
"Description[es]": "Framebuffer basado en PipeWire para KRfb.",
|
||||
"Description[et]": "KRfb PipeWire põhine kaadripuhver",
|
||||
"Description[eu]": "KRfb-rako «PipeWire»n oinarritutako «Framebuffer».",
|
||||
"Description[fi]": "KRfb:n PipeWire-pohjainen kehyspuskuri.",
|
||||
"Description[fr]": "Tampon d'images utilisant PipeWire pour KRfb.",
|
||||
"Description[gl]": "Búfer de fotograma para KRfb baseado en PipeWire.",
|
||||
"Description[ia]": "Framebuffer basate sur PipeWire per KRfb.",
|
||||
"Description[it]": "Framebuffer basato su PipeWire per KRfb.",
|
||||
"Description[ko]": "KRfb용 PipeWire 기반 프레임버퍼입니다.",
|
||||
"Description[nl]": "Op PipeWire gebaseerd framebuffer voor KRfb.",
|
||||
"Description[nn]": "PipeWire-basert biletbuffer for KRfb.",
|
||||
"Description[pl]": "Bufor ramki oparty na PipeWire dla KRfb.",
|
||||
"Description[pt]": "'Framebuffer' baseado no PipeWire para o KRfb.",
|
||||
"Description[pt_BR]": "Framebuffer baseado no PipeWire para o KRfb.",
|
||||
"Description[ru]": "Буфер кадров для KRfb на базе Framebuffer",
|
||||
"Description[sk]": "Framebuffer založený na PipeWire pre KRfb.",
|
||||
"Description[sl]": "Slikovni medpomnilnik na osnovi PipeWire za KRfb.",
|
||||
"Description[sv]": "Rambuffert för Krfb baserad på PipeWire",
|
||||
"Description[uk]": "Буфер кадрів на основі PipeWire для KRfb.",
|
||||
"Description[x-test]": "xxPipeWire based Framebuffer for KRfb.xx",
|
||||
"Description[zh_CN]": "基于 PipeWire 的 KRfb 帧缓冲机制。",
|
||||
"Description[zh_TW]": "KRfb 基於 PipeWire 的 Framebuffer。",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "pw",
|
||||
"License": "GPL3",
|
||||
"Name": "PipeWire Framebuffer for KRfb",
|
||||
"Name[ca@valencia]": "«Framebuffer» del «PipeWire» per al KRfb",
|
||||
"Name[ca]": "«Framebuffer» del «PipeWire» per al KRfb",
|
||||
"Name[cs]": "PipeWire Framebuffer pro KRfb",
|
||||
"Name[da]": "PipeWire framebuffer til KRfb",
|
||||
"Name[de]": "PipeWire-Framebuffer für KRfb",
|
||||
"Name[el]": "Μνήμη ανανέωσης pipewire για το KRfb",
|
||||
"Name[en_GB]": "PipeWire Framebuffer for KRfb",
|
||||
"Name[es]": "Framebuffer de PipeWire para KRfb",
|
||||
"Name[et]": "KRfb PipeWire kaadripuhver",
|
||||
"Name[eu]": "KRfb-rako «PipeWire Framebuffer»",
|
||||
"Name[fi]": "KRfb:n PipeWire-kehyspuskuri",
|
||||
"Name[fr]": "Tampon d'images PipeWire pour KRfb",
|
||||
"Name[gl]": "Búfer de fotograma de PipeWire para KRfb",
|
||||
"Name[ia]": "Framebuffer de PipeWire per KRfb",
|
||||
"Name[it]": "Framebuffer PipeWire per KRfb",
|
||||
"Name[ko]": "KRfb용 PipeWire 프레임버퍼",
|
||||
"Name[nl]": "PipeWire-framebuffer voor KRfb",
|
||||
"Name[nn]": "PipeWire-biletbuffer for KRfb",
|
||||
"Name[pl]": "Wtyczki buforów ramek PipeWire dla KRfb",
|
||||
"Name[pt]": "'Framebuffer' do PipeWire para o KRfb",
|
||||
"Name[pt_BR]": "Framebuffer PipeWire para o KRfb",
|
||||
"Name[ru]": "Буфер кадров PipeWire для KRfb",
|
||||
"Name[sk]": "PipeWire Framebuffer pre KRfb",
|
||||
"Name[sl]": "Slikovni medpomnilnik za KRfb na osnovi PipeWire",
|
||||
"Name[sv]": "PipeWire-rambuffert för Krfb",
|
||||
"Name[uk]": "Буфер кадрів PipeWire для KRfb",
|
||||
"Name[x-test]": "xxPipeWire Framebuffer for KRfbxx",
|
||||
"Name[zh_CN]": "KRfb 的 PipeWire 帧缓冲机制",
|
||||
"Name[zh_TW]": "KRfb 的 PipeWire Framebuffer",
|
||||
"Version": "0.1",
|
||||
"Website": "http://www.kde.org"
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
Copyright (C) 2018-2020 Jan Grulich <jgrulich@redhat.com>
|
||||
|
||||
This program 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 3 of the License, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
|
||||
#define KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
|
||||
|
||||
#include "framebuffer.h"
|
||||
#include <QWidget>
|
||||
#include <QVariantMap>
|
||||
|
||||
/**
|
||||
* @brief The PWFrameBuffer class - framebuffer implementation based on XDG Desktop Portal ScreenCast interface.
|
||||
* The design relies heavily on a presence of XDG D-Bus service and PipeWire daemon.
|
||||
*
|
||||
* @author Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
*/
|
||||
class PWFrameBuffer: public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using Stream = struct {
|
||||
uint nodeId;
|
||||
QVariantMap map;
|
||||
};
|
||||
using Streams = QList<Stream>;
|
||||
|
||||
PWFrameBuffer(WId winid, QObject *parent = nullptr);
|
||||
virtual ~PWFrameBuffer() override;
|
||||
|
||||
void initDBus();
|
||||
void startVirtualMonitor(const QString &name, const QSize &resolution, qreal dpr);
|
||||
|
||||
int depth() override;
|
||||
int height() override;
|
||||
int width() override;
|
||||
int paddedWidth() override;
|
||||
void getServerFormat(rfbPixelFormat &format) override;
|
||||
void startMonitor() override;
|
||||
void stopMonitor() override;
|
||||
QPoint cursorPosition() override;
|
||||
|
||||
QVariant customProperty(const QString &property) const override;
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleXdpSessionCreated(quint32 code, QVariantMap results);
|
||||
void handleXdpDevicesSelected(quint32 code, QVariantMap results);
|
||||
void handleXdpSourcesSelected(quint32 code, QVariantMap results);
|
||||
void handleXdpRemoteDesktopStarted(quint32 code, QVariantMap results);
|
||||
|
||||
private:
|
||||
class Private;
|
||||
const QScopedPointer<Private> d;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,61 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
|
||||
This program 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
#include "pw_framebufferplugin.h"
|
||||
#include "pw_framebuffer.h"
|
||||
#include <KPluginFactory>
|
||||
|
||||
|
||||
K_PLUGIN_FACTORY_WITH_JSON(PWFrameBufferPluginFactory, "krfb_framebuffer_pw.json",
|
||||
registerPlugin<PWFrameBufferPlugin>();)
|
||||
|
||||
PWFrameBufferPlugin::PWFrameBufferPlugin(QObject *parent, const QVariantList &args)
|
||||
: FrameBufferPlugin(parent, args)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PWFrameBufferPlugin::~PWFrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer *PWFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
//NOTE WId is irrelevant in Wayland
|
||||
|
||||
auto pwfb = new PWFrameBuffer(id);
|
||||
if (args.contains(QLatin1String("name"))) {
|
||||
pwfb->startVirtualMonitor(args[QStringLiteral("name")].toString(), args[QStringLiteral("resolution")].toSize(), args[QStringLiteral("scale")].toDouble());
|
||||
} else {
|
||||
// D-Bus is most important in XDG-Desktop-Portals init chain, no toys for us if something is wrong with XDP
|
||||
// PipeWire connectivity is initialized after D-Bus session is started
|
||||
pwfb->initDBus();
|
||||
}
|
||||
|
||||
// sanity check for dbus/wayland/pipewire errors
|
||||
if (!pwfb->isValid()) {
|
||||
delete pwfb;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return pwfb;
|
||||
}
|
||||
|
||||
#include "pw_framebufferplugin.moc"
|
||||
@@ -1,45 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
|
||||
This program 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_FRAMEBUFFER_PW_PWFRAMEBUFFERPLUGIN_H
|
||||
#define KRFB_FRAMEBUFFER_PW_PWFRAMEBUFFERPLUGIN_H
|
||||
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
class FrameBuffer;
|
||||
|
||||
class PWFrameBufferPlugin: public FrameBufferPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PWFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~PWFrameBufferPlugin() override;
|
||||
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(PWFrameBufferPlugin)
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
#include "screencasting.h"
|
||||
#include "qwayland-zkde-screencast-unstable-v1.h"
|
||||
#include <KWayland/Client/output.h>
|
||||
#include <KWayland/Client/plasmawindowmanagement.h>
|
||||
#include <KWayland/Client/registry.h>
|
||||
#include <QDebug>
|
||||
#include <QRect>
|
||||
|
||||
using namespace KWayland::Client;
|
||||
|
||||
class ScreencastingStreamPrivate : public QtWayland::zkde_screencast_stream_unstable_v1
|
||||
{
|
||||
public:
|
||||
ScreencastingStreamPrivate(ScreencastingStream *q)
|
||||
: q(q)
|
||||
{
|
||||
}
|
||||
~ScreencastingStreamPrivate()
|
||||
{
|
||||
close();
|
||||
q->deleteLater();
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_created(uint32_t node) override
|
||||
{
|
||||
m_nodeId = node;
|
||||
Q_EMIT q->created(node);
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_closed() override
|
||||
{
|
||||
Q_EMIT q->closed();
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_failed(const QString &error) override
|
||||
{
|
||||
Q_EMIT q->failed(error);
|
||||
}
|
||||
|
||||
uint m_nodeId = 0;
|
||||
QPointer<ScreencastingStream> q;
|
||||
};
|
||||
|
||||
ScreencastingStream::ScreencastingStream(QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new ScreencastingStreamPrivate(this))
|
||||
{
|
||||
}
|
||||
|
||||
ScreencastingStream::~ScreencastingStream() = default;
|
||||
|
||||
quint32 ScreencastingStream::nodeId() const
|
||||
{
|
||||
return d->m_nodeId;
|
||||
}
|
||||
|
||||
class ScreencastingPrivate : public QtWayland::zkde_screencast_unstable_v1
|
||||
{
|
||||
public:
|
||||
ScreencastingPrivate(Registry *registry, int id, int version, Screencasting *q)
|
||||
: QtWayland::zkde_screencast_unstable_v1(*registry, id, version)
|
||||
, q(q)
|
||||
{
|
||||
}
|
||||
|
||||
ScreencastingPrivate(::zkde_screencast_unstable_v1 *screencasting, Screencasting *q)
|
||||
: QtWayland::zkde_screencast_unstable_v1(screencasting)
|
||||
, q(q)
|
||||
{
|
||||
}
|
||||
|
||||
~ScreencastingPrivate()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
Screencasting *const q;
|
||||
};
|
||||
|
||||
Screencasting::Screencasting(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
Screencasting::Screencasting(Registry *registry, int id, int version, QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new ScreencastingPrivate(registry, id, version, this))
|
||||
{
|
||||
}
|
||||
|
||||
Screencasting::~Screencasting() = default;
|
||||
|
||||
ScreencastingStream *Screencasting::createOutputStream(Output *output, CursorMode mode)
|
||||
{
|
||||
auto stream = new ScreencastingStream(this);
|
||||
stream->setObjectName(output->model());
|
||||
stream->d->init(d->stream_output(*output, mode));
|
||||
return stream;
|
||||
}
|
||||
|
||||
ScreencastingStream *Screencasting::createWindowStream(PlasmaWindow *window, CursorMode mode)
|
||||
{
|
||||
auto stream = createWindowStream(QString::fromUtf8(window->uuid()), mode);
|
||||
stream->setObjectName(window->appId());
|
||||
return stream;
|
||||
}
|
||||
|
||||
ScreencastingStream *Screencasting::createWindowStream(const QString &uuid, CursorMode mode)
|
||||
{
|
||||
auto stream = new ScreencastingStream(this);
|
||||
stream->d->init(d->stream_window(uuid, mode));
|
||||
return stream;
|
||||
}
|
||||
|
||||
ScreencastingStream * Screencasting::createVirtualMonitorStream(const QString& name, const QSize& resolution, qreal dpr, Screencasting::CursorMode mode)
|
||||
{
|
||||
auto stream = new ScreencastingStream(this);
|
||||
stream->d->init(d->stream_virtual_output(name, resolution.width(), resolution.height(), wl_fixed_from_double(dpr), mode));
|
||||
return stream;
|
||||
}
|
||||
|
||||
void Screencasting::setup(::zkde_screencast_unstable_v1 *screencasting)
|
||||
{
|
||||
d.reset(new ScreencastingPrivate(screencasting, this));
|
||||
}
|
||||
|
||||
void Screencasting::destroy()
|
||||
{
|
||||
d.reset(nullptr);
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
#include <QVector>
|
||||
#include <optional>
|
||||
|
||||
struct zkde_screencast_unstable_v1;
|
||||
|
||||
namespace KWayland
|
||||
{
|
||||
namespace Client
|
||||
{
|
||||
class PlasmaWindow;
|
||||
class Registry;
|
||||
class Output;
|
||||
}
|
||||
}
|
||||
|
||||
class ScreencastingPrivate;
|
||||
class ScreencastingSourcePrivate;
|
||||
class ScreencastingStreamPrivate;
|
||||
class ScreencastingStream : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScreencastingStream(QObject *parent);
|
||||
~ScreencastingStream() override;
|
||||
|
||||
quint32 nodeId() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void created(quint32 nodeid);
|
||||
void failed(const QString &error);
|
||||
void closed();
|
||||
|
||||
private:
|
||||
friend class Screencasting;
|
||||
QScopedPointer<ScreencastingStreamPrivate> d;
|
||||
};
|
||||
|
||||
class Screencasting : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Screencasting(QObject *parent = nullptr);
|
||||
explicit Screencasting(KWayland::Client::Registry *registry, int id, int version, QObject *parent = nullptr);
|
||||
~Screencasting() override;
|
||||
|
||||
enum CursorMode {
|
||||
Hidden = 1,
|
||||
Embedded = 2,
|
||||
Metadata = 4,
|
||||
};
|
||||
Q_ENUM(CursorMode);
|
||||
|
||||
ScreencastingStream *createOutputStream(KWayland::Client::Output *output, CursorMode mode);
|
||||
ScreencastingStream *createWindowStream(KWayland::Client::PlasmaWindow *window, CursorMode mode);
|
||||
ScreencastingStream *createWindowStream(const QString &uuid, CursorMode mode);
|
||||
ScreencastingStream *createVirtualMonitorStream(const QString &name, const QSize &resolution, qreal dpr, CursorMode mode);
|
||||
|
||||
void setup(zkde_screencast_unstable_v1 *screencasting);
|
||||
void destroy();
|
||||
|
||||
Q_SIGNALS:
|
||||
void initialized();
|
||||
void removed();
|
||||
void sourcesChanged();
|
||||
|
||||
private:
|
||||
QScopedPointer<ScreencastingPrivate> d;
|
||||
};
|
||||
@@ -7,26 +7,22 @@ set (krfb_framebuffer_qt_SRCS
|
||||
qtframebufferplugin.cpp
|
||||
)
|
||||
|
||||
ecm_qt_declare_logging_category(krfb_framebuffer_qt_SRCS
|
||||
HEADER krfb_fb_qt_debug.h
|
||||
IDENTIFIER KRFB_FB_QT
|
||||
CATEGORY_NAME krfb.framebuffer.qt
|
||||
DESCRIPTION "KRFB Qt framebuffer plugin"
|
||||
EXPORT KRFB
|
||||
)
|
||||
|
||||
add_library(krfb_framebuffer_qt
|
||||
MODULE
|
||||
kde4_add_plugin (krfb_framebuffer_qt
|
||||
${krfb_framebuffer_qt_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries (krfb_framebuffer_qt
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
KF5::CoreAddons
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${KDE4_KDEUI_LIBS}
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_framebuffer_qt
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install (FILES krfb_framebuffer_qt.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
|
||||
107
framebuffers/qt/krfb_framebuffer_qt.desktop
Normal file
@@ -0,0 +1,107 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Comment=Qt based Framebuffer for KRfb.
|
||||
Comment[ast]=Esquema Qt de buffer pa KRfb
|
||||
Comment[bg]=Основан на Qt фреймбуфер за KRfb.
|
||||
Comment[bs]=Kadrobafer za KRfb na osnovu Qt.
|
||||
Comment[ca]=«Framebuffer» basat en Qt per al KRfb.
|
||||
Comment[ca@valencia]=«Framebuffer» basat en Qt per al KRfb.
|
||||
Comment[cs]=Framebuffer založený na Qt pro KRfb.
|
||||
Comment[da]=Qt-baseret framebuffer til KRfb.
|
||||
Comment[de]=Qt-basierter Framebuffer für KRfb
|
||||
Comment[el]=Μνήμη εξόδου βίντεο καρέ με βάση το Qt για το KRfb.
|
||||
Comment[en_GB]=Qt based Framebuffer for KRfb.
|
||||
Comment[es]=Memoria intermedia de vídeo basada en Qt para KRfb.
|
||||
Comment[et]=KRfb Qt põhine kaadripuhver
|
||||
Comment[eu]=Qt-n oinarritutako KRfb-ren irteerako bideoa
|
||||
Comment[fi]=QT-perustainen Kehyspuskuri KRfb:lle
|
||||
Comment[fr]=Sortie vidéo fondée sur Qt pour Krfb.
|
||||
Comment[ga]=Maolán fráma le haghaidh KRfb, bunaithe ar Qt.
|
||||
Comment[gl]=Framebuffer baseado en Qt para KRfb.
|
||||
Comment[hr]=Međuspremnik okvira baziran na Qt-u za KRfb.
|
||||
Comment[hu]=Qt-alapú framebuffer a Krfb-hez.
|
||||
Comment[ia]=Framebuffer basate sur Qt per KRfb
|
||||
Comment[it]=Framebuffer basato su Qt per KRfb.
|
||||
Comment[kk]=Qt негіздеген KRfb-нің кадр буфері.
|
||||
Comment[km]=Framebuffer មានមូលដ្ឋានលើ Qt សម្រាប់ KRfb ។
|
||||
Comment[ko]=KRfb를 위한 Qt 기반 프레임버퍼.
|
||||
Comment[lt]=Qt pagrindu veikiantis Framebuffer skirtas KRfb.
|
||||
Comment[lv]=Qt balstīts kadrbuferis priekš KRfb.
|
||||
Comment[nb]=Qt-basert rammebuffer for KRfb.
|
||||
Comment[nds]=Op Qt opbuut Bildpuffer för KRfb
|
||||
Comment[nl]=Op Qt gebaseerd framebuffer voor KRfb.
|
||||
Comment[nn]=Qt basert framebuffer for KRfb.
|
||||
Comment[pl]=Bufor ramki na podstawie Qt dla KRfb.
|
||||
Comment[pt]='Framebuffer' baseado no Qt para o KRfb.
|
||||
Comment[pt_BR]=Framebuffer baseado no Qt para o KRfb.
|
||||
Comment[ru]=Буфер экрана для KRfb на базе Qt.
|
||||
Comment[si]=KRfb සඳහා Qt මත පදනම් වූ රාමු බෆරය
|
||||
Comment[sk]=Framebuffer založený na Qt pre KRfb.
|
||||
Comment[sl]=Slikovni medpomnilnik za KRFB, ki temelji na Qt
|
||||
Comment[sr]=Кадробафер за КРФБ на основу КуТ‑у
|
||||
Comment[sr@ijekavian]=Кадробафер за КРФБ на основу КуТ‑у
|
||||
Comment[sr@ijekavianlatin]=Kadrobafer za KRFB na osnovu Qt‑u
|
||||
Comment[sr@latin]=Kadrobafer za KRFB na osnovu Qt‑u
|
||||
Comment[sv]=Qt-baserad rambuffert för Krfb.
|
||||
Comment[tr]=KRfb için Qt temelli Çerçeve tamponu.
|
||||
Comment[uk]=Заснований на Qt буфер кадрів для KRfb.
|
||||
Comment[x-test]=xxQt based Framebuffer for KRfb.xx
|
||||
Comment[zh_CN]=基于 Qt 的 KRfb 帧缓冲机制
|
||||
Comment[zh_TW]=KRfb 的 Qt-based Framebuffer
|
||||
Name=Qt Framebuffer for KRfb
|
||||
Name[ast]=Esquema Qt de buffer pa KRfb
|
||||
Name[bg]=Qt фреймбуфер за KRfb
|
||||
Name[bs]=Qt-ov kadrobafer za KRFB
|
||||
Name[ca]=«Framebuffer» Qt per al KRfb.
|
||||
Name[ca@valencia]=«Framebuffer» Qt per al KRfb.
|
||||
Name[cs]=Qt Framebuffer pro KRfb
|
||||
Name[da]=Qt-framebuffer til KRfb
|
||||
Name[de]=Qt-Framebuffer für KRfb
|
||||
Name[el]=Qt Framebuffer for KRfb
|
||||
Name[en_GB]=Qt Framebuffer for KRfb
|
||||
Name[es]=Memoria intermedia de vídeo Qt para KRfb
|
||||
Name[et]=KRfb Qt kaadripuhver
|
||||
Name[eu]=KRfb-ren Qt-ko irteerako bideoa
|
||||
Name[fi]=QT-kehyspuskuri KRfb:lle
|
||||
Name[fr]=Sortie vidéo Qt pour Krfb
|
||||
Name[ga]=Maolán fráma Qt le haghaidh KRfb
|
||||
Name[gl]=Framebuffer de Qt para KRfb
|
||||
Name[hr]=Qt Framebuffer za KRfb
|
||||
Name[hu]=Qt framebuffer a Krfb-hez
|
||||
Name[ia]=Framebuffer Qt per KRfb
|
||||
Name[it]=Framebuffer Qt per KRfb
|
||||
Name[kk]=Qt KRfb кадр буфері
|
||||
Name[km]=Qt Framebuffer សម្រាប់for KRfb
|
||||
Name[ko]=KRfb를 위한 Qt 프레임버퍼
|
||||
Name[lt]=Qt Framebufferis skirtas KRfb
|
||||
Name[lv]=Qt kadrbuferis priekš KRfb.
|
||||
Name[nb]=Qt rammebuffer for KRfb
|
||||
Name[nds]=Qt-Bildpuffer för KRfb
|
||||
Name[nl]=Qt-framebuffer voor KRfb
|
||||
Name[nn]=Qt-framebuffer for KRfb
|
||||
Name[pl]=Bufor ramki Qt dla KRfb
|
||||
Name[pt]='Framebuffer' do Qt para o KRfb
|
||||
Name[pt_BR]=Framebuffer do Qt para o KRfb
|
||||
Name[ru]=Буфер экрана Qt для KRfb
|
||||
Name[si]=KRfb සඳහා වන Qt රාමුබෆරය
|
||||
Name[sk]=Qt Framebuffer pre KRfb
|
||||
Name[sl]=Slikovni medpomnilnik Qt za KRFB
|
||||
Name[sr]=КуТ‑ов кадробафер за КРФБ
|
||||
Name[sr@ijekavian]=КуТ‑ов кадробафер за КРФБ
|
||||
Name[sr@ijekavianlatin]=Qt‑ov kadrobafer za KRFB
|
||||
Name[sr@latin]=Qt‑ov kadrobafer za KRFB
|
||||
Name[sv]=Qt-rambuffert för Krfb
|
||||
Name[tr]=KRfb için Qt Çerçeve tamponu
|
||||
Name[uk]=Буфер кадрів на Qt для KRfb
|
||||
Name[x-test]=xxQt Framebuffer for KRfbxx
|
||||
Name[zh_CN]=KRfb 的 Qt 帧缓冲机制
|
||||
Name[zh_TW]=Krfb 的 Qt Framebuffer
|
||||
Type=Service
|
||||
ServiceTypes=krfb/framebuffer
|
||||
|
||||
X-KDE-Library=krfb_framebuffer_qt
|
||||
X-KDE-PluginInfo-Name=qt
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=http://www.kde.org
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
@@ -1,81 +0,0 @@
|
||||
{
|
||||
"KPlugin": {
|
||||
"Description": "Qt based Framebuffer for KRfb.",
|
||||
"Description[ca@valencia]": "«Framebuffer» basat en les Qt per al KRfb.",
|
||||
"Description[ca]": "«Framebuffer» basat en les Qt per al KRfb.",
|
||||
"Description[cs]": "Framebuffer založený na Qt pro KRfb.",
|
||||
"Description[da]": "Qt-baseret framebuffer til KRfb.",
|
||||
"Description[de]": "Qt-basierter Framebuffer für KRfb.",
|
||||
"Description[el]": "Μνήμη ανανέωσης βίντεο με βάση τhn Qt για το KRfb.",
|
||||
"Description[en_GB]": "Qt based Framebuffer for KRfb.",
|
||||
"Description[es]": "Framebuffer basado en Qt para KRfb.",
|
||||
"Description[et]": "KRfb Qt põhine kaadripuhver",
|
||||
"Description[eu]": "KRfb-rako Qt-n oinarritutako «Framebuffer».",
|
||||
"Description[fi]": "KRfb:n Qt-pohjainen kehyspuskuri.",
|
||||
"Description[fr]": "Tampon d'images utilisant Qt pour KRfb.",
|
||||
"Description[gl]": "Framebuffer baseado en Qt para KRfb.",
|
||||
"Description[ia]": "Framebuffer basate sur Qt per KRfb",
|
||||
"Description[id]": "Framebuffer berbasiskan Qt untuk KRfb.",
|
||||
"Description[it]": "Framebuffer basato su Qt per KRfb.",
|
||||
"Description[ko]": "KRfb용 Qt 기반 프레임버퍼입니다.",
|
||||
"Description[nl]": "Op Qt gebaseerd framebuffer voor KRfb.",
|
||||
"Description[nn]": "Qt-basert biletbuffer for KRfb.",
|
||||
"Description[pl]": "Bufor ramki oparty na Qt dla KRfb.",
|
||||
"Description[pt]": "'Framebuffer' baseado no Qt para o KRfb.",
|
||||
"Description[pt_BR]": "Framebuffer baseado no Qt para o KRfb.",
|
||||
"Description[ru]": "Буфер кадров для KRfb на базе Qt",
|
||||
"Description[sk]": "Framebuffer založený na Qt pre KRfb.",
|
||||
"Description[sl]": "Slikovni medpomnilnik za KRfb na osnovi Qt.",
|
||||
"Description[sr@ijekavian]": "Кадробафер за КРФБ на основу КуТ‑у",
|
||||
"Description[sr@ijekavianlatin]": "Kadrobafer za KRFB na osnovu Qt‑u",
|
||||
"Description[sr@latin]": "Kadrobafer za KRFB na osnovu Qt‑u",
|
||||
"Description[sr]": "Кадробафер за КРФБ на основу КуТ‑у",
|
||||
"Description[sv]": "X11-rambuffert för Krfb.",
|
||||
"Description[tr]": "KRfb için Qt tabanlı Çerçeve tamponu.",
|
||||
"Description[uk]": "Заснований на Qt буфер кадрів для KRfb.",
|
||||
"Description[x-test]": "xxQt based Framebuffer for KRfb.xx",
|
||||
"Description[zh_CN]": "KRfb 的基于 Qt 的帧缓冲。",
|
||||
"Description[zh_TW]": "KRfb 的 Qt-based Framebuffer",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "qt",
|
||||
"License": "GPL",
|
||||
"Name": "Qt Framebuffer for KRfb",
|
||||
"Name[ca@valencia]": "«Framebuffer» de les Qt per al KRfb",
|
||||
"Name[ca]": "«Framebuffer» de les Qt per al KRfb",
|
||||
"Name[cs]": "Qt Framebuffer pro KRfb",
|
||||
"Name[da]": "Qt-framebuffer til KRfb",
|
||||
"Name[de]": "Qt-Framebuffer für KRfb",
|
||||
"Name[el]": "Μνήμη ανανέωσης βίντεο Qt για το KRfb",
|
||||
"Name[en_GB]": "Qt Framebuffer for KRfb",
|
||||
"Name[es]": "Framebuffer de Qt para KRfb",
|
||||
"Name[et]": "KRfb Qt kaadripuhver",
|
||||
"Name[eu]": "KRfb-rako Qt «Framebuffer»",
|
||||
"Name[fi]": "KRfb:n Qt-kehyspuskuri",
|
||||
"Name[fr]": "Tampon d'images Qt pour KRfb",
|
||||
"Name[gl]": "Framebuffer de Qt para KRfb",
|
||||
"Name[ia]": "Framebuffer Qt per KRfb",
|
||||
"Name[id]": "Qt Framebuffer untuk KRfb",
|
||||
"Name[it]": "Framebuffer Qt per KRfb",
|
||||
"Name[ko]": "KRfb용 Qt 프레임버퍼",
|
||||
"Name[nl]": "Qt-framebuffer voor KRfb",
|
||||
"Name[nn]": "Qt-biletbuffer for KRfb",
|
||||
"Name[pl]": "Bufor ramki Qt dla KRfb",
|
||||
"Name[pt]": "'Framebuffer' do Qt para o KRfb",
|
||||
"Name[pt_BR]": "Framebuffer do Qt para o KRfb",
|
||||
"Name[ru]": "Буфер кадров Qt для KRfb",
|
||||
"Name[sk]": "Qt Framebuffer pre KRfb",
|
||||
"Name[sl]": "Slikovni medpomnilnik za KRfb na osnovi Qt",
|
||||
"Name[sr@ijekavian]": "КуТ‑ов кадробафер за КРФБ",
|
||||
"Name[sr@ijekavianlatin]": "Qt‑ov kadrobafer za KRFB",
|
||||
"Name[sr@latin]": "Qt‑ov kadrobafer za KRFB",
|
||||
"Name[sr]": "КуТ‑ов кадробафер за КРФБ",
|
||||
"Name[sv]": "QT-rambuffert för Krfb",
|
||||
"Name[tr]": "KRfb için Qt Çerçeve tamponu",
|
||||
"Name[uk]": "Буфер кадрів на Qt для KRfb",
|
||||
"Name[x-test]": "xxQt Framebuffer for KRfbxx",
|
||||
"Name[zh_CN]": "KRfb 的 Qt 帧缓冲",
|
||||
"Name[zh_TW]": "Krfb 的 Qt Framebuffer",
|
||||
"Version": "0.1",
|
||||
"Website": "https://www.kde.org"
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,12 @@
|
||||
*/
|
||||
|
||||
#include "qtframebuffer.h"
|
||||
#include "qtframebuffer.moc"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QRegion>
|
||||
#include <QPixmap>
|
||||
#include <QBitmap>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
|
||||
|
||||
const int UPDATE_TIME = 500;
|
||||
@@ -22,26 +21,17 @@ const int UPDATE_TIME = 500;
|
||||
QtFrameBuffer::QtFrameBuffer(WId id, QObject *parent)
|
||||
: FrameBuffer(id, parent)
|
||||
{
|
||||
QScreen *screen = QGuiApplication::primaryScreen();
|
||||
if (screen) {
|
||||
primaryScreen = screen;
|
||||
fbImage = screen->grabWindow(win).toImage();
|
||||
fb = new char[fbImage.sizeInBytes()];
|
||||
} else {
|
||||
fb = nullptr;
|
||||
primaryScreen = nullptr;
|
||||
}
|
||||
|
||||
fbImage = QPixmap::grabWindow(win).toImage();
|
||||
fb = new char[fbImage.numBytes()];
|
||||
t = new QTimer(this);
|
||||
connect(t, &QTimer::timeout, this, &QtFrameBuffer::updateFrameBuffer);
|
||||
connect(t, SIGNAL(timeout()), SLOT(updateFrameBuffer()));
|
||||
}
|
||||
|
||||
|
||||
QtFrameBuffer::~QtFrameBuffer()
|
||||
{
|
||||
if (fb)
|
||||
delete [] fb;
|
||||
fb = nullptr;
|
||||
delete [] fb;
|
||||
fb = 0;
|
||||
}
|
||||
|
||||
int QtFrameBuffer::depth()
|
||||
@@ -76,9 +66,7 @@ void QtFrameBuffer::getServerFormat(rfbPixelFormat &format)
|
||||
|
||||
void QtFrameBuffer::updateFrameBuffer()
|
||||
{
|
||||
if (!fb || !primaryScreen) return;
|
||||
QImage img = primaryScreen->grabWindow(win).toImage();
|
||||
#if 0 // This is actually slower than updating the whole desktop...
|
||||
QImage img = QPixmap::grabWindow(win).toImage();
|
||||
QSize imgSize = img.size();
|
||||
|
||||
|
||||
@@ -86,6 +74,8 @@ void QtFrameBuffer::updateFrameBuffer()
|
||||
// fbImage is the previous version of the image,
|
||||
// img is the current one
|
||||
|
||||
#if 0 // This is actually slower than updating the whole desktop...
|
||||
|
||||
QImage map(imgSize, QImage::Format_Mono);
|
||||
map.fill(0);
|
||||
|
||||
@@ -104,7 +94,7 @@ void QtFrameBuffer::updateFrameBuffer()
|
||||
tiles.append(img.rect());
|
||||
#endif
|
||||
|
||||
memcpy(fb, img.bits(), static_cast<size_t>(img.sizeInBytes()));
|
||||
memcpy(fb, (const char *)img.bits(), img.numBytes());
|
||||
fbImage = img;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "framebuffer.h"
|
||||
|
||||
class QTimer;
|
||||
class QScreen;
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
@@ -22,17 +21,17 @@ class QtFrameBuffer : public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QtFrameBuffer(WId id, QObject *parent = nullptr);
|
||||
explicit QtFrameBuffer(WId id, QObject *parent = 0);
|
||||
|
||||
~QtFrameBuffer() override;
|
||||
~QtFrameBuffer();
|
||||
|
||||
int depth() override;
|
||||
int height() override;
|
||||
int width() override;
|
||||
int paddedWidth() override;
|
||||
void getServerFormat(rfbPixelFormat &format) override;
|
||||
void startMonitor() override;
|
||||
void stopMonitor() override;
|
||||
virtual int depth();
|
||||
virtual int height();
|
||||
virtual int width();
|
||||
virtual int paddedWidth();
|
||||
virtual void getServerFormat(rfbPixelFormat &format);
|
||||
virtual void startMonitor();
|
||||
virtual void stopMonitor();
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateFrameBuffer();
|
||||
@@ -40,7 +39,6 @@ public Q_SLOTS:
|
||||
private:
|
||||
QImage fbImage;
|
||||
QTimer *t;
|
||||
QScreen *primaryScreen;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,10 +22,8 @@
|
||||
|
||||
#include "qtframebuffer.h"
|
||||
|
||||
#include <KPluginFactory>
|
||||
#include <KGenericFactory>
|
||||
|
||||
K_PLUGIN_FACTORY_WITH_JSON(QtFrameBufferPluginFactory, "krfb_framebuffer_qt.json",
|
||||
registerPlugin<QtFrameBufferPlugin>();)
|
||||
|
||||
QtFrameBufferPlugin::QtFrameBufferPlugin(QObject *parent, const QVariantList &args)
|
||||
: FrameBufferPlugin(parent, args)
|
||||
@@ -36,11 +34,14 @@ QtFrameBufferPlugin::~QtFrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
return new QtFrameBuffer(id);
|
||||
}
|
||||
|
||||
K_PLUGIN_FACTORY(factory, registerPlugin<QtFrameBufferPlugin>();) \
|
||||
K_EXPORT_PLUGIN(factory("krfb_framebuffer_qt"))
|
||||
|
||||
|
||||
#include "qtframebufferplugin.moc"
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBuffer;
|
||||
|
||||
@@ -33,9 +35,9 @@ class QtFrameBufferPlugin : public FrameBufferPlugin
|
||||
|
||||
public:
|
||||
QtFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
~QtFrameBufferPlugin() override;
|
||||
virtual ~QtFrameBufferPlugin();
|
||||
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
virtual FrameBuffer *frameBuffer(WId id);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QtFrameBufferPlugin)
|
||||
|
||||
31
framebuffers/x11/CMakeLists.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set (krfb_framebuffer_x11_SRCS
|
||||
x11framebuffer.cpp
|
||||
x11framebufferplugin.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin (krfb_framebuffer_x11
|
||||
${krfb_framebuffer_x11_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries (krfb_framebuffer_x11
|
||||
${KDE4_KDEUI_LIBS}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${X11_X11_LIB}
|
||||
${X11_Xdamage_LIB}
|
||||
${X11_Xext_LIB}
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_framebuffer_x11
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install (FILES krfb_framebuffer_x11.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
107
framebuffers/x11/krfb_framebuffer_x11.desktop
Normal file
@@ -0,0 +1,107 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Comment=X11 XDamage/XShm based Framebuffer for KRfb.
|
||||
Comment[ast]=Esquema de buffer pa KRfb basáu en XDamage/XShm
|
||||
Comment[bg]=Основан на X11 XDamage/XShm фреймбуфер за KRfb.
|
||||
Comment[bs]=X11 XDamage/XShm baziran framebafer za KRfb.
|
||||
Comment[ca]=«Framebuffer» basat en XDamage/XShmQt de l'X11 per al KRfb.
|
||||
Comment[ca@valencia]=«Framebuffer» basat en XDamage/XShmQt de l'X11 per al KRfb.
|
||||
Comment[cs]=Framebuffer založený na X11 XDamage/XShm pro KRfb.
|
||||
Comment[da]=X11 XDamage/XShm-baseret framebuffer til KRfb.
|
||||
Comment[de]=X11 XDamage/XShm-basierter Framebuffer für KRfb.
|
||||
Comment[el]=Μνήμη εξόδου βίντεο καρέ με βάση το X11 XDamage/XShm για το KRfb.
|
||||
Comment[en_GB]=X11 XDamage/XShm based Framebuffer for KRfb.
|
||||
Comment[es]=Memoria intermedia de vídeo basada en X11 Damage/XShm para KRfb.
|
||||
Comment[et]=KRfb X11 XDamage/XShm põhine kaadripuhver
|
||||
Comment[eu]=X11 XDamage/XShm oinarritutako KRfb-ren irteerako bideoa.
|
||||
Comment[fi]=X11 XDamage/XShm-perustainen kehyspuskui KRfb:lle.
|
||||
Comment[fr]=Sortie vidéo fondée sur X11 « XDamage / XShm » pour Krfb.
|
||||
Comment[ga]=Maolán fráma le haghaidh KRfb, bunaithe ar X11 XDamage/XShm
|
||||
Comment[gl]=Framebuffer baseado en Xll XDamage/Xshm para XRfb.
|
||||
Comment[hr]=Međuspreminik okvira baziran na X11 XDamage/XShm za KRfb.
|
||||
Comment[hu]=X11 XDamage/XShm-alapú framebuffer a Krfb-hez.
|
||||
Comment[ia]=Framebuffer basate sur X11 XDamage/XShm per KRfb.
|
||||
Comment[it]=Framebuffer basato su XDamage/XShm di X11 per KRfb.
|
||||
Comment[kk]=X11 XDamage/XShm негіздеген KRfb кадр буфері.
|
||||
Comment[km]=X11 XDamage/XShm based Framebuffer សម្រាប់ KRfb ។
|
||||
Comment[ko]=KRfb를 위한 X11 XDamage/XShm 기반 프레임버퍼.
|
||||
Comment[lt]=X11 XDamage/XShm paremtas Framebuffer skirtas KRfb.
|
||||
Comment[lv]=X11 XDamage/XShm balstīts kadrbuferis priekš KRfb.
|
||||
Comment[nb]=Rammebuffer for KRfb basert på X11 XDamage/XShm.
|
||||
Comment[nds]=Op X11-XDamage/-XShm opbuut Bildpuffer för KRfb
|
||||
Comment[nl]=Op X11 XDamage/XShm gebaseerd framebuffer voor KRfb.
|
||||
Comment[nn]=X11 XDamage/XShm basert framebuffer for KRfb.
|
||||
Comment[pl]=Bufor ramki na podstawie X11 XDamage/XShm dla KRfb.
|
||||
Comment[pt]='Framebuffer' baseado no XDamage/XShm do X11 para o KRfb.
|
||||
Comment[pt_BR]=Framebuffer baseado no XDamage/XShm do X11 para o KRfb.
|
||||
Comment[ru]=Буфер экрана для KRfb на базе X11 XDamage/XShm
|
||||
Comment[si]=KRfb සඳහා වන රාමු බෆරය මත පදනම් වූ X11 XDamage/XShm.
|
||||
Comment[sk]=Framebuffer založený na X11 XDamage/XShm pre KRfb.
|
||||
Comment[sl]=Slikovni medpomnilnik za KRFB, ki temelji na X11 XDamage/XShm
|
||||
Comment[sr]=Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.
|
||||
Comment[sr@ijekavian]=Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.
|
||||
Comment[sr@ijekavianlatin]=Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.
|
||||
Comment[sr@latin]=Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.
|
||||
Comment[sv]=X11 XDamage/XShm-baserad rambuffert för Krfb.
|
||||
Comment[tr]=KRfb için X11 XDamage/XShm temelli Çerçeve Tamponu.
|
||||
Comment[uk]=Заснований на XDamage/XShm X11 буфер кадрів для KRfb.
|
||||
Comment[x-test]=xxX11 XDamage/XShm based Framebuffer for KRfb.xx
|
||||
Comment[zh_CN]=基于 X11 XDamage/XShm 扩展的 KRfb 帧缓冲机制。
|
||||
Comment[zh_TW]=KRfb 的 X11 XDamage/XShm based Framebuffer
|
||||
Name=X11 Framebuffer for KRfb
|
||||
Name[ast]=Buffer de X11 pa KRfb
|
||||
Name[bg]=X11 фреймбуфер за KRfb
|
||||
Name[bs]=X11 frame bafer za KRfb
|
||||
Name[ca]=«Framebuffer» de l'X11 per al KRfb.
|
||||
Name[ca@valencia]=«Framebuffer» de l'X11 per al KRfb.
|
||||
Name[cs]=X11 Framebuffer pro KRfb
|
||||
Name[da]=X11-framebuffer til KRfb
|
||||
Name[de]=X11-Framebuffer für KRfb
|
||||
Name[el]=X11 Framebuffer for KRfb
|
||||
Name[en_GB]=X11 Framebuffer for KRfb
|
||||
Name[es]=Memoria intermedia de vídeo X11 para KRfb
|
||||
Name[et]=KRfb X11 kaadripuhver
|
||||
Name[eu]=KRfb-ren X11-ko irteerako bideoa
|
||||
Name[fi]=X11-kehyspuskuri KRfb:lle
|
||||
Name[fr]=Sortie vidéo X11 pour Krfb
|
||||
Name[ga]=Maolán fráma X11 le haghaidh KRfb
|
||||
Name[gl]=Framebuffer de X11 para KRfb
|
||||
Name[hr]=Međuspremnik okvira X11 za KRfb
|
||||
Name[hu]=X11 framebuffer a Krfb-hez
|
||||
Name[ia]=Framebuffer X11 per KRfb
|
||||
Name[it]=Framebuffer X11 per KRfb
|
||||
Name[kk]=X11 KRfb кадр буфері
|
||||
Name[km]=X11 Framebuffer សម្រាប់ KRfb
|
||||
Name[ko]=KRfb를 위한 X11 프레임버퍼
|
||||
Name[lt]=X11 Framebuffer skirtas KRfb
|
||||
Name[lv]=X11 kadrbuferis priekš KRfb
|
||||
Name[nb]=X11 rammebuffer for KRfb
|
||||
Name[nds]=X11-Bildpuffer för KRfb
|
||||
Name[nl]=X11 framebuffer voor KRfb
|
||||
Name[nn]=X11-framebuffer for KRfb
|
||||
Name[pl]=Bufor ramki X11 dla KRfb
|
||||
Name[pt]='Framebuffer' do X11 para o KRfb
|
||||
Name[pt_BR]=Framebuffer do X11 para o KRfb
|
||||
Name[ru]=Буфер экрана X11 для KRfb
|
||||
Name[si]=KRfb සඳහා X11 රාමු බෆරය
|
||||
Name[sk]=X11 Framebuffer pre KRfb
|
||||
Name[sl]=Slikovni medpomnilnik X11 za KRFB
|
||||
Name[sr]=Икс11 кадробафер за КРФБ.
|
||||
Name[sr@ijekavian]=Икс11 кадробафер за КРФБ.
|
||||
Name[sr@ijekavianlatin]=X11 kadrobafer za KRFB.
|
||||
Name[sr@latin]=X11 kadrobafer za KRFB.
|
||||
Name[sv]=X11-rambuffert för Krfb
|
||||
Name[tr]=KRfb için X11 Çerçeve Tamponu
|
||||
Name[uk]=Буфер кадрів X11 для KRfb
|
||||
Name[x-test]=xxX11 Framebuffer for KRfbxx
|
||||
Name[zh_CN]=KRfb 的 X11 帧缓冲机制
|
||||
Name[zh_TW]=KRfb 的 X11 Framebuffer
|
||||
Type=Service
|
||||
ServiceTypes=krfb/framebuffer
|
||||
|
||||
X-KDE-Library=krfb_framebuffer_x11
|
||||
X-KDE-PluginInfo-Name=x11
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=http://www.kde.org
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
388
framebuffers/x11/x11framebuffer.cpp
Normal file
@@ -0,0 +1,388 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program 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.
|
||||
*/
|
||||
|
||||
#include "x11framebuffer.h"
|
||||
#include "x11framebuffer.moc"
|
||||
|
||||
#include <config-krfb.h>
|
||||
|
||||
#include <QX11Info>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include <KApplication>
|
||||
#include <KDebug>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#ifdef HAVE_XDAMAGE
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XSHM
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
#endif
|
||||
|
||||
class X11FrameBuffer::P
|
||||
{
|
||||
|
||||
public:
|
||||
#ifdef HAVE_XDAMAGE
|
||||
Damage damage;
|
||||
#endif
|
||||
#ifdef HAVE_XSHM
|
||||
XShmSegmentInfo shminfo;
|
||||
#endif
|
||||
|
||||
XImage *framebufferImage;
|
||||
XImage *updateTile;
|
||||
EvWidget *ev;
|
||||
bool useShm;
|
||||
int xdamageBaseEvent;
|
||||
bool running;
|
||||
};
|
||||
|
||||
X11FrameBuffer::X11FrameBuffer(WId id, QObject *parent)
|
||||
: FrameBuffer(id, parent), d(new X11FrameBuffer::P)
|
||||
{
|
||||
#ifdef HAVE_XSHM
|
||||
d->useShm = XShmQueryExtension(QX11Info::display());
|
||||
kDebug() << "shm: " << d->useShm;
|
||||
#else
|
||||
d->useShm = false;
|
||||
#endif
|
||||
d->running = false;
|
||||
d->framebufferImage = XGetImage(QX11Info::display(),
|
||||
id,
|
||||
0,
|
||||
0,
|
||||
QApplication::desktop()->width(), //arg, must get a widget ???
|
||||
QApplication::desktop()->height(),
|
||||
AllPlanes,
|
||||
ZPixmap);
|
||||
|
||||
if (d->useShm) {
|
||||
#ifdef HAVE_XSHM
|
||||
d->updateTile = XShmCreateImage(QX11Info::display(),
|
||||
DefaultVisual(QX11Info::display(), 0),
|
||||
d->framebufferImage->bits_per_pixel,
|
||||
ZPixmap,
|
||||
NULL,
|
||||
&d->shminfo,
|
||||
32,
|
||||
32);
|
||||
d->shminfo.shmid = shmget(IPC_PRIVATE,
|
||||
d->updateTile->bytes_per_line * d->updateTile->height,
|
||||
IPC_CREAT | 0777);
|
||||
|
||||
d->shminfo.shmaddr = d->updateTile->data = (char *)
|
||||
shmat(d->shminfo.shmid, 0, 0);
|
||||
d->shminfo.readOnly = False;
|
||||
|
||||
XShmAttach(QX11Info::display(), &d->shminfo);
|
||||
#endif
|
||||
} else {
|
||||
;
|
||||
}
|
||||
|
||||
kDebug() << "Got image. bpp: " << d->framebufferImage->bits_per_pixel
|
||||
<< ", depth: " << d->framebufferImage->depth
|
||||
<< ", padded width: " << d->framebufferImage->bytes_per_line
|
||||
<< " (sent: " << d->framebufferImage->width * 4 << ")"
|
||||
<< endl;
|
||||
|
||||
fb = d->framebufferImage->data;
|
||||
#ifdef HAVE_XDAMAGE
|
||||
d->ev = new EvWidget(this);
|
||||
kapp->installX11EventFilter(d->ev);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
X11FrameBuffer::~X11FrameBuffer()
|
||||
{
|
||||
XDestroyImage(d->framebufferImage);
|
||||
#ifdef HAVE_XDAMAGE
|
||||
kapp->removeX11EventFilter(d->ev);
|
||||
#endif
|
||||
#ifdef HAVE_XSHM
|
||||
XShmDetach(QX11Info::display(), &d->shminfo);
|
||||
XDestroyImage(d->updateTile);
|
||||
shmdt(d->shminfo.shmaddr);
|
||||
shmctl(d->shminfo.shmid, IPC_RMID, 0);
|
||||
#endif
|
||||
delete d;
|
||||
fb = 0; // already deleted by XDestroyImage
|
||||
}
|
||||
|
||||
|
||||
int X11FrameBuffer::depth()
|
||||
{
|
||||
return d->framebufferImage->depth;
|
||||
}
|
||||
|
||||
int X11FrameBuffer::height()
|
||||
{
|
||||
return d->framebufferImage->height;
|
||||
}
|
||||
|
||||
int X11FrameBuffer::width()
|
||||
{
|
||||
return d->framebufferImage->width;
|
||||
}
|
||||
|
||||
int X11FrameBuffer::paddedWidth()
|
||||
{
|
||||
return d->framebufferImage->bytes_per_line;
|
||||
}
|
||||
|
||||
void X11FrameBuffer::getServerFormat(rfbPixelFormat &format)
|
||||
{
|
||||
format.bitsPerPixel = d->framebufferImage->bits_per_pixel;
|
||||
format.depth = d->framebufferImage->depth;
|
||||
format.trueColour = true;
|
||||
format.bigEndian = ((d->framebufferImage->bitmap_bit_order == MSBFirst) ? true : false);
|
||||
|
||||
if (format.bitsPerPixel == 8) {
|
||||
format.redShift = 0;
|
||||
format.greenShift = 3;
|
||||
format.blueShift = 6;
|
||||
format.redMax = 7;
|
||||
format.greenMax = 7;
|
||||
format.blueMax = 3;
|
||||
} else {
|
||||
format.redShift = 0;
|
||||
|
||||
if (d->framebufferImage->red_mask)
|
||||
while (!(d->framebufferImage->red_mask & (1 << format.redShift))) {
|
||||
format.redShift++;
|
||||
}
|
||||
|
||||
format.greenShift = 0;
|
||||
|
||||
if (d->framebufferImage->green_mask)
|
||||
while (!(d->framebufferImage->green_mask & (1 << format.greenShift))) {
|
||||
format.greenShift++;
|
||||
}
|
||||
|
||||
format.blueShift = 0;
|
||||
|
||||
if (d->framebufferImage->blue_mask)
|
||||
while (!(d->framebufferImage->blue_mask & (1 << format.blueShift))) {
|
||||
format.blueShift++;
|
||||
}
|
||||
|
||||
format.redMax = d->framebufferImage->red_mask >> format.redShift;
|
||||
format.greenMax = d->framebufferImage->green_mask >> format.greenShift;
|
||||
format.blueMax = d->framebufferImage->blue_mask >> format.blueShift;
|
||||
}
|
||||
}
|
||||
|
||||
void X11FrameBuffer::handleXDamage(XEvent *event)
|
||||
{
|
||||
#ifdef HAVE_XDAMAGE
|
||||
XDamageNotifyEvent *dev = (XDamageNotifyEvent *)event;
|
||||
QRect r(dev->area.x, dev->area.y, dev->area.width, dev->area.height);
|
||||
tiles.append(r);
|
||||
|
||||
/*if (!dev->more) {
|
||||
XDamageSubtract(QX11Info::display(),d->damage, None, None);
|
||||
}*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void X11FrameBuffer::cleanupRects()
|
||||
{
|
||||
|
||||
QList<QRect> cpy = tiles;
|
||||
bool inserted = false;
|
||||
tiles.clear();
|
||||
// kDebug() << "before cleanup: " << cpy.size();
|
||||
foreach(const QRect & r, cpy) {
|
||||
if (tiles.size() > 0) {
|
||||
for (int i = 0; i < tiles.size(); i++) {
|
||||
// kDebug() << r << tiles[i];
|
||||
if (r.intersects(tiles[i])) {
|
||||
tiles[i] |= r;
|
||||
inserted = true;
|
||||
break;
|
||||
// kDebug() << "merged into " << tiles[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (!inserted) {
|
||||
tiles.append(r);
|
||||
// kDebug() << "appended " << r;
|
||||
}
|
||||
} else {
|
||||
// kDebug() << "appended " << r;
|
||||
tiles.append(r);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < tiles.size(); i++) {
|
||||
tiles[i].adjust(-30, -30, 30, 30);
|
||||
|
||||
if (tiles[i].top() < 0) {
|
||||
tiles[i].setTop(0);
|
||||
}
|
||||
|
||||
if (tiles[i].left() < 0) {
|
||||
tiles[i].setLeft(0);
|
||||
}
|
||||
|
||||
if (tiles[i].bottom() > d->framebufferImage->height) {
|
||||
tiles[i].setBottom(d->framebufferImage->height);
|
||||
}
|
||||
|
||||
if (tiles[i].right() > d->framebufferImage->width) {
|
||||
tiles[i].setRight(d->framebufferImage->width);
|
||||
}
|
||||
}
|
||||
|
||||
// kDebug() << "after cleanup: " << tiles.size();
|
||||
}
|
||||
|
||||
void X11FrameBuffer::acquireEvents()
|
||||
{
|
||||
|
||||
XEvent ev;
|
||||
|
||||
while (XCheckTypedEvent(QX11Info::display(), d->xdamageBaseEvent + XDamageNotify, &ev)) {
|
||||
handleXDamage(&ev);
|
||||
}
|
||||
|
||||
XDamageSubtract(QX11Info::display(), d->damage, None, None);
|
||||
}
|
||||
|
||||
QList< QRect > X11FrameBuffer::modifiedTiles()
|
||||
{
|
||||
QList<QRect> ret;
|
||||
|
||||
if (!d->running) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
kapp->processEvents(); // try to make sure every damage event goes trough;
|
||||
cleanupRects();
|
||||
QRect gl;
|
||||
|
||||
//d->useShm = false;
|
||||
if (tiles.size() > 0) {
|
||||
if (d->useShm) {
|
||||
#ifdef HAVE_XSHM
|
||||
|
||||
foreach(const QRect & r, tiles) {
|
||||
// kDebug() << r;
|
||||
gl |= r;
|
||||
int y = r.y();
|
||||
int x = r.x();
|
||||
|
||||
while (x < r.right()) {
|
||||
while (y < r.bottom()) {
|
||||
if (y + d->updateTile->height > d->framebufferImage->height) {
|
||||
y = d->framebufferImage->height - d->updateTile->height;
|
||||
}
|
||||
|
||||
if (x + d->updateTile->width > d->framebufferImage->width) {
|
||||
x = d->framebufferImage->width - d->updateTile->width;
|
||||
}
|
||||
|
||||
// kDebug() << "x: " << x << " (" << r.x() << ") y: " << y << " (" << r.y() << ") " << r;
|
||||
XShmGetImage(QX11Info::display(), win, d->updateTile, x, y, AllPlanes);
|
||||
int pxsize = d->framebufferImage->bits_per_pixel / 8;
|
||||
char *dest = fb + ((d->framebufferImage->bytes_per_line * y) + (x * pxsize));
|
||||
char *src = d->updateTile->data;
|
||||
|
||||
for (int i = 0; i < d->updateTile->height; i++) {
|
||||
memcpy(dest, src, d->updateTile->bytes_per_line);
|
||||
dest += d->framebufferImage->bytes_per_line;
|
||||
src += d->updateTile->bytes_per_line;
|
||||
}
|
||||
|
||||
y += d->updateTile->height;
|
||||
}
|
||||
|
||||
x += d->updateTile->width;
|
||||
y = r.y();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
foreach(const QRect & r, tiles) {
|
||||
XGetSubImage(QX11Info::display(),
|
||||
win,
|
||||
r.left(),
|
||||
r.top(),
|
||||
r.width(),
|
||||
r.height(),
|
||||
AllPlanes,
|
||||
ZPixmap,
|
||||
d->framebufferImage,
|
||||
r.left(),
|
||||
r.top()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// kDebug() << "tot: " << gl;
|
||||
// kDebug() << tiles.size();
|
||||
ret = tiles;
|
||||
tiles.clear();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void X11FrameBuffer::startMonitor()
|
||||
{
|
||||
d->running = true;
|
||||
#ifdef HAVE_XDAMAGE
|
||||
d->damage = XDamageCreate(QX11Info::display(), win, XDamageReportRawRectangles);
|
||||
XDamageSubtract(QX11Info::display(), d->damage, None, None);
|
||||
#endif
|
||||
}
|
||||
|
||||
void X11FrameBuffer::stopMonitor()
|
||||
{
|
||||
d->running = false;
|
||||
#ifdef HAVE_XDAMAGE
|
||||
XDamageDestroy(QX11Info::display(), d->damage);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
EvWidget::EvWidget(X11FrameBuffer *x11fb)
|
||||
: QWidget(0), fb(x11fb)
|
||||
{
|
||||
#ifdef HAVE_XDAMAGE
|
||||
int er;
|
||||
XDamageQueryExtension(QX11Info::display(), &xdamageBaseEvent, &er);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool EvWidget::x11Event(XEvent *event)
|
||||
{
|
||||
#ifdef HAVE_XDAMAGE
|
||||
|
||||
if (event->type == xdamageBaseEvent + XDamageNotify) {
|
||||
fb->handleXDamage(event);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
62
framebuffers/x11/x11framebuffer.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program 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.
|
||||
*/
|
||||
#ifndef KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFER_H
|
||||
#define KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFER_H
|
||||
|
||||
#include <framebuffer.h>
|
||||
#include <QWidget>
|
||||
|
||||
class X11FrameBuffer;
|
||||
|
||||
class EvWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EvWidget(X11FrameBuffer *x11fb);
|
||||
|
||||
protected:
|
||||
bool x11Event(XEvent *event);
|
||||
|
||||
private:
|
||||
X11FrameBuffer *fb;
|
||||
int xdamageBaseEvent;
|
||||
};
|
||||
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class X11FrameBuffer : public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
X11FrameBuffer(WId id, QObject *parent = 0);
|
||||
|
||||
~X11FrameBuffer();
|
||||
|
||||
virtual QList<QRect> modifiedTiles();
|
||||
virtual int depth();
|
||||
virtual int height();
|
||||
virtual int width();
|
||||
virtual int paddedWidth();
|
||||
virtual void getServerFormat(rfbPixelFormat &format);
|
||||
virtual void startMonitor();
|
||||
virtual void stopMonitor();
|
||||
|
||||
|
||||
void handleXDamage(XEvent *event);
|
||||
private:
|
||||
void cleanupRects();
|
||||
void acquireEvents();
|
||||
|
||||
class P;
|
||||
P *const d;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,6 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2016 Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
@@ -17,29 +18,30 @@
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "x11eventsplugin.h"
|
||||
#include "x11framebufferplugin.h"
|
||||
|
||||
#include "x11events.h"
|
||||
#include "x11framebuffer.h"
|
||||
|
||||
#include <KPluginFactory>
|
||||
#include <QX11Info>
|
||||
#include <KGenericFactory>
|
||||
|
||||
K_PLUGIN_FACTORY_WITH_JSON(X11EventsPluginFactory, "krfb_events_x11.json",
|
||||
registerPlugin<X11EventsPlugin>();)
|
||||
|
||||
X11EventsPlugin::X11EventsPlugin(QObject *parent, const QVariantList &args)
|
||||
: EventsPlugin(parent, args)
|
||||
X11FrameBufferPlugin::X11FrameBufferPlugin(QObject *parent, const QVariantList &args)
|
||||
: FrameBufferPlugin(parent, args)
|
||||
{
|
||||
}
|
||||
|
||||
EventHandler *X11EventsPlugin::eventHandler()
|
||||
X11FrameBufferPlugin::~X11FrameBufferPlugin()
|
||||
{
|
||||
// works only under X11
|
||||
if(!QX11Info::isPlatformX11())
|
||||
return nullptr;
|
||||
|
||||
return new X11EventHandler();
|
||||
}
|
||||
|
||||
#include "x11eventsplugin.moc"
|
||||
FrameBuffer *X11FrameBufferPlugin::frameBuffer(WId id)
|
||||
{
|
||||
return new X11FrameBuffer(id);
|
||||
}
|
||||
|
||||
K_PLUGIN_FACTORY(factory, registerPlugin<X11FrameBufferPlugin>();) \
|
||||
K_EXPORT_PLUGIN(factory("krfb_framebuffer_x11"))
|
||||
|
||||
|
||||
#include "x11framebufferplugin.moc"
|
||||
|
||||
@@ -18,25 +18,31 @@
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef LIB_KRFB_EVENTSPLUGIN_H
|
||||
#define LIB_KRFB_EVENTSPLUGIN_H
|
||||
#ifndef KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFERPLUGIN_H
|
||||
#define KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFERPLUGIN_H
|
||||
|
||||
#include "krfbprivate_export.h"
|
||||
#include "framebufferplugin.h"
|
||||
|
||||
#include <QtCore/QVariantList>
|
||||
#include <QWidget>
|
||||
#include <kdemacros.h>
|
||||
|
||||
class EventHandler;
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class KRFBPRIVATE_EXPORT EventsPlugin : public QObject
|
||||
class FrameBuffer;
|
||||
|
||||
class X11FrameBufferPlugin : public FrameBufferPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EventsPlugin(QObject *parent, const QVariantList &args);
|
||||
~EventsPlugin() override;
|
||||
|
||||
virtual EventHandler *eventHandler() = 0;
|
||||
public:
|
||||
X11FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~X11FrameBufferPlugin();
|
||||
|
||||
virtual FrameBuffer *frameBuffer(WId id);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(X11FrameBufferPlugin)
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set (krfb_framebuffer_xcb_SRCS
|
||||
xcb_framebufferplugin.cpp
|
||||
xcb_framebuffer.cpp
|
||||
)
|
||||
|
||||
ecm_qt_declare_logging_category(krfb_framebuffer_xcb_SRCS
|
||||
HEADER krfb_fb_xcb_debug.h
|
||||
IDENTIFIER KRFB_FB_XCB
|
||||
CATEGORY_NAME krfb.framebuffer.xcb
|
||||
DESCRIPTION "KRFB XCB framebuffer plugin"
|
||||
EXPORT KRFB
|
||||
)
|
||||
|
||||
add_library(krfb_framebuffer_xcb MODULE ${krfb_framebuffer_xcb_SRCS})
|
||||
|
||||
target_link_libraries (krfb_framebuffer_xcb
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
XCB::XCB
|
||||
XCB::RENDER
|
||||
XCB::SHAPE
|
||||
XCB::XFIXES
|
||||
XCB::DAMAGE
|
||||
XCB::SHM
|
||||
XCB::IMAGE
|
||||
KF5::CoreAddons
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_framebuffer_xcb
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
||||
)
|
||||
@@ -1,81 +0,0 @@
|
||||
{
|
||||
"KPlugin": {
|
||||
"Description": "X11 XDamage/XShm based Framebuffer for KRfb.",
|
||||
"Description[ca@valencia]": "«Framebuffer» basat en «XDamage/XShm» de l'X11 per al KRfb.",
|
||||
"Description[ca]": "«Framebuffer» basat en «XDamage/XShm» de l'X11 per al KRfb.",
|
||||
"Description[cs]": "Framebuffer založený na X11 XDamage/XShm pro KRfb.",
|
||||
"Description[da]": "X11 XDamage/XShm-baseret framebuffer til KRfb.",
|
||||
"Description[de]": "X11 XDamage/XShm-basierter Framebuffer für KRfb.",
|
||||
"Description[el]": "Μνήμη ανανέωσης βίντεο με βάση το X11 XDamage/XShm για το KRfb.",
|
||||
"Description[en_GB]": "X11 XDamage/XShm based Framebuffer for KRfb.",
|
||||
"Description[es]": "Framebuffer basado en XDamage/XShm de X11 para KRfb.",
|
||||
"Description[et]": "KRfb X11 XDamage/XShm põhine kaadripuhver",
|
||||
"Description[eu]": "KRfb-rako «X11 XDamage/XShm»en oinarritutako «Framebuffer».",
|
||||
"Description[fi]": "KRfb:n X11 XDamage/XShm -pohjainen kehyspuskuri.",
|
||||
"Description[fr]": "Tampon d'images utilisant XDamage/XShm de X11 pour KRfb.",
|
||||
"Description[gl]": "Framebuffer baseado en X11 XDamage/Xshm para XRfb.",
|
||||
"Description[ia]": "Framebuffer basate sur X11 XDamage/XShm per KRfb.",
|
||||
"Description[id]": "Framebuffer berbasiskan X11 XDamage/XShm untuk KRfb.",
|
||||
"Description[it]": "Framebuffer basato su XDamage/XShm di X11 per KRfb.",
|
||||
"Description[ko]": "KRfb용 X11 XDamage/XShm 기반 프레임버퍼입니다.",
|
||||
"Description[nl]": "Op X11 XDamage/XShm gebaseerd framebuffer voor KRfb.",
|
||||
"Description[nn]": "X11 XDamage/XShm-basert biletbuffer for KRfb.",
|
||||
"Description[pl]": "Bufor ramki na podstawie X11 XDamage/XShm dla KRfb.",
|
||||
"Description[pt]": "'Framebuffer' do X11, baseado no XDamage/XShm, para o KRfb.",
|
||||
"Description[pt_BR]": "Framebuffer baseado no XDamage/XShm do X11 para o KRfb.",
|
||||
"Description[ru]": "Буфер кадров для KRfb на базе X11 XDamage/XShm",
|
||||
"Description[sk]": "Framebuffer založený na X11 XDamage/XShm pre KRfb.",
|
||||
"Description[sl]": "Slikovni medpomnilnik za KRfb, na osnovi X11 XDamage/XShm.",
|
||||
"Description[sr@ijekavian]": "Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.",
|
||||
"Description[sr@ijekavianlatin]": "Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.",
|
||||
"Description[sr@latin]": "Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.",
|
||||
"Description[sr]": "Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.",
|
||||
"Description[sv]": "X11 XDamage/XShm-baserad rambuffert för Krfb.",
|
||||
"Description[tr]": "KRfb için X11 XDamage/XShm tabanlı Çerçeve tamponu.",
|
||||
"Description[uk]": "Заснований на XDamage/XShm X11 буфер кадрів для KRfb.",
|
||||
"Description[x-test]": "xxX11 XDamage/XShm based Framebuffer for KRfb.xx",
|
||||
"Description[zh_CN]": "KRfb 的基于 X11 XDamage/XShm 的帧缓冲。",
|
||||
"Description[zh_TW]": "KRfb 的 X11 XDamage/XShm based Framebuffer",
|
||||
"EnabledByDefault": true,
|
||||
"Id": "xcb",
|
||||
"License": "GPL",
|
||||
"Name": "X11 Framebuffer for KRfb",
|
||||
"Name[ca@valencia]": "«Framebuffer» de l'X11 per al KRfb",
|
||||
"Name[ca]": "«Framebuffer» de l'X11 per al KRfb",
|
||||
"Name[cs]": "X11 Framebuffer pro KRfb",
|
||||
"Name[da]": "X11-framebuffer til KRfb",
|
||||
"Name[de]": "X11-Framebuffer für KRfb",
|
||||
"Name[el]": "Μνήμη ανανέωσης βίντεο X11 για το KRfb.",
|
||||
"Name[en_GB]": "X11 Framebuffer for KRfb",
|
||||
"Name[es]": "Framebuffer X11 para KRfb",
|
||||
"Name[et]": "KRfb X11 kaadripuhver",
|
||||
"Name[eu]": "KRfb-rako «X11 Framebuffer»",
|
||||
"Name[fi]": "KRfb:n X11-kehyspuskuri",
|
||||
"Name[fr]": "Tampon d'images X11 pour KRfb",
|
||||
"Name[gl]": "Framebuffer de X11 para KRfb",
|
||||
"Name[ia]": "Framebuffer X11 per KRfb",
|
||||
"Name[id]": "Framebuffer X11 untuk KRfb",
|
||||
"Name[it]": "Framebuffer X11 per KRfb",
|
||||
"Name[ko]": "KRfb용 X11 프레임버퍼",
|
||||
"Name[nl]": "X11 framebuffer voor KRfb",
|
||||
"Name[nn]": "X11-biletbuffer for KRfb",
|
||||
"Name[pl]": "Bufor ramki X11 dla KRfb",
|
||||
"Name[pt]": "'Framebuffer' do X11 para o KRfb",
|
||||
"Name[pt_BR]": "Framebuffer do X11 para o KRfb",
|
||||
"Name[ru]": "Буфер кадров X11 для KRfb",
|
||||
"Name[sk]": "X11 Framebuffer pre KRfb",
|
||||
"Name[sl]": "Slikovni medpomnilnik za KRfb na osnovi X11",
|
||||
"Name[sr@ijekavian]": "Икс11 кадробафер за КРФБ.",
|
||||
"Name[sr@ijekavianlatin]": "X11 kadrobafer za KRFB.",
|
||||
"Name[sr@latin]": "X11 kadrobafer za KRFB.",
|
||||
"Name[sr]": "Икс11 кадробафер за КРФБ.",
|
||||
"Name[sv]": "X11-rambuffert för Krfb",
|
||||
"Name[tr]": "KRfb için X11 Çerçeve tamponu",
|
||||
"Name[uk]": "Буфер кадрів X11 для KRfb",
|
||||
"Name[x-test]": "xxX11 Framebuffer for KRfbxx",
|
||||
"Name[zh_CN]": "XRfb 的 X11 帧缓冲",
|
||||
"Name[zh_TW]": "KRfb 的 X11 Framebuffer",
|
||||
"Version": "0.1",
|
||||
"Website": "https://www.kde.org"
|
||||
}
|
||||
}
|
||||
@@ -1,691 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2017 Alexey Min <alexey.min@gmail.com>
|
||||
|
||||
This program 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.
|
||||
*/
|
||||
|
||||
#include "xcb_framebuffer.h"
|
||||
#include "krfb_fb_xcb_debug.h"
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/xproto.h>
|
||||
#include <xcb/damage.h>
|
||||
#include <xcb/shm.h>
|
||||
#include <xcb/xcb_image.h>
|
||||
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
|
||||
#include <QX11Info>
|
||||
#include <QCoreApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QAbstractNativeEventFilter>
|
||||
|
||||
|
||||
class KrfbXCBEventFilter: public QAbstractNativeEventFilter
|
||||
{
|
||||
public:
|
||||
KrfbXCBEventFilter(XCBFrameBuffer *owner);
|
||||
|
||||
public:
|
||||
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
|
||||
|
||||
public:
|
||||
int xdamageBaseEvent;
|
||||
int xdamageBaseError;
|
||||
int xshmBaseEvent;
|
||||
int xshmBaseError;
|
||||
bool xshmAvail;
|
||||
XCBFrameBuffer *fb_owner;
|
||||
};
|
||||
|
||||
|
||||
|
||||
KrfbXCBEventFilter::KrfbXCBEventFilter(XCBFrameBuffer *owner):
|
||||
xdamageBaseEvent(0), xdamageBaseError(0),
|
||||
xshmBaseEvent(0), xshmBaseError(0), xshmAvail(false),
|
||||
fb_owner(owner)
|
||||
{
|
||||
const xcb_query_extension_reply_t *xdamage_data = xcb_get_extension_data(
|
||||
QX11Info::connection(), &xcb_damage_id);
|
||||
if (xdamage_data) {
|
||||
// also query extension version!
|
||||
// ATTENTION: if we don't do that, xcb_damage_create() will always FAIL!
|
||||
xcb_damage_query_version_reply_t *xdamage_version = xcb_damage_query_version_reply(
|
||||
QX11Info::connection(),
|
||||
xcb_damage_query_version(
|
||||
QX11Info::connection(),
|
||||
XCB_DAMAGE_MAJOR_VERSION,
|
||||
XCB_DAMAGE_MINOR_VERSION),
|
||||
nullptr);
|
||||
if (!xdamage_version) {
|
||||
qWarning() << "xcb framebuffer: ERROR: Failed to get XDamage extension version!\n";
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: XDamage extension version:" <<
|
||||
xdamage_version->major_version << "." << xdamage_version->minor_version;
|
||||
#endif
|
||||
|
||||
free(xdamage_version);
|
||||
|
||||
xdamageBaseEvent = xdamage_data->first_event;
|
||||
xdamageBaseError = xdamage_data->first_error;
|
||||
|
||||
// XShm presence is optional. If it is present, all image getting
|
||||
// operations will be faster, without XShm it will only be slower.
|
||||
const xcb_query_extension_reply_t *xshm_data = xcb_get_extension_data(
|
||||
QX11Info::connection(), &xcb_shm_id);
|
||||
if (xshm_data) {
|
||||
xshmAvail = true;
|
||||
xshmBaseEvent = xshm_data->first_event;
|
||||
xshmBaseError = xshm_data->first_error;
|
||||
} else {
|
||||
xshmAvail = false;
|
||||
qWarning() << "xcb framebuffer: WARNING: XSHM extension not available!";
|
||||
}
|
||||
} else {
|
||||
// if there is no xdamage available, this plugin can be considered useless anyway.
|
||||
// you can use just qt framebuffer plugin instead...
|
||||
qWarning() << "xcb framebuffer: ERROR: no XDamage extension available. I am useless.";
|
||||
qWarning() << "xcb framebuffer: use qt framebuffer plugin instead.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool KrfbXCBEventFilter::nativeEventFilter(const QByteArray &eventType,
|
||||
void *message, long *result) {
|
||||
Q_UNUSED(result); // "result" is only used on windows
|
||||
|
||||
if (xdamageBaseEvent == 0) return false; // no xdamage extension
|
||||
|
||||
if (eventType == "xcb_generic_event_t") {
|
||||
auto ev = static_cast<xcb_generic_event_t *>(message);
|
||||
if ((ev->response_type & 0x7F) == (xdamageBaseEvent + XCB_DAMAGE_NOTIFY)) {
|
||||
// this is xdamage notification
|
||||
this->fb_owner->handleXDamageNotify(ev);
|
||||
return true; // filter out this event, stop its processing
|
||||
}
|
||||
}
|
||||
|
||||
// continue event processing
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
class XCBFrameBuffer::P {
|
||||
public:
|
||||
xcb_damage_damage_t damage;
|
||||
xcb_shm_segment_info_t shminfo;
|
||||
xcb_screen_t *rootScreen; // X screen info (all monitors)
|
||||
xcb_image_t *framebufferImage;
|
||||
xcb_image_t *updateTile;
|
||||
|
||||
KrfbXCBEventFilter *x11EvtFilter;
|
||||
|
||||
bool running;
|
||||
|
||||
QRect area; // capture area, primary monitor coordinates
|
||||
};
|
||||
|
||||
|
||||
static xcb_screen_t *get_xcb_screen(xcb_connection_t *conn, int screen_num) {
|
||||
xcb_screen_t *screen = nullptr;
|
||||
xcb_screen_iterator_t screens_iter = xcb_setup_roots_iterator(xcb_get_setup(conn));
|
||||
for (; screens_iter.rem; --screen_num, xcb_screen_next(&screens_iter))
|
||||
if (screen_num == 0)
|
||||
screen = screens_iter.data;
|
||||
return screen;
|
||||
}
|
||||
|
||||
|
||||
|
||||
XCBFrameBuffer::XCBFrameBuffer(WId winid, QObject *parent):
|
||||
FrameBuffer(winid, parent), d(new XCBFrameBuffer::P)
|
||||
{
|
||||
d->running = false;
|
||||
d->damage = XCB_NONE;
|
||||
d->framebufferImage = nullptr;
|
||||
d->shminfo.shmaddr = nullptr;
|
||||
d->shminfo.shmid = XCB_NONE;
|
||||
d->shminfo.shmseg = XCB_NONE;
|
||||
d->updateTile = nullptr;
|
||||
d->area.setRect(0, 0, 0, 0);
|
||||
d->x11EvtFilter = new KrfbXCBEventFilter(this);
|
||||
d->rootScreen = get_xcb_screen(QX11Info::connection(), QX11Info::appScreen());
|
||||
|
||||
this->fb = nullptr;
|
||||
|
||||
QScreen *primaryScreen = QGuiApplication::primaryScreen();
|
||||
if (primaryScreen) {
|
||||
qreal scaleFactor = primaryScreen->devicePixelRatio();
|
||||
d->area = { primaryScreen->geometry().topLeft() * scaleFactor,
|
||||
primaryScreen->geometry().bottomRight() * scaleFactor };
|
||||
|
||||
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: Primary screen: " << primaryScreen->name()
|
||||
<< ", geometry: " << primaryScreen->geometry()
|
||||
<< ", device scaling: " << scaleFactor
|
||||
<< ", native size: " << d->area
|
||||
<< ", depth: " << primaryScreen->depth();
|
||||
} else {
|
||||
qWarning() << "xcb framebuffer: ERROR: Failed to get application's primary screen info!";
|
||||
return;
|
||||
}
|
||||
|
||||
d->framebufferImage = xcb_image_get(QX11Info::connection(),
|
||||
this->win,
|
||||
d->area.left(),
|
||||
d->area.top(),
|
||||
d->area.width(),
|
||||
d->area.height(),
|
||||
0xFFFFFFFF, // == Xlib: AllPlanes ((unsigned long)~0L)
|
||||
XCB_IMAGE_FORMAT_Z_PIXMAP);
|
||||
if (d->framebufferImage) {
|
||||
#ifdef _DEBUG
|
||||
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: Got primary screen image. bpp: " << d->framebufferImage->bpp
|
||||
<< ", size (" << d->framebufferImage->width << d->framebufferImage->height << ")"
|
||||
<< ", depth: " << d->framebufferImage->depth
|
||||
<< ", padded width: " << d->framebufferImage->stride;
|
||||
#endif
|
||||
this->fb = (char *)d->framebufferImage->data;
|
||||
} else {
|
||||
qWarning() << "xcb framebuffer: ERROR: Failed to get primary screen image!";
|
||||
return;
|
||||
}
|
||||
|
||||
// all XShm operations should take place only if Xshm extension was loaded
|
||||
if (d->x11EvtFilter->xshmAvail) {
|
||||
// Create xcb_image_t structure, but do not automatically allocate memory
|
||||
// for image data storage - it will be allocated as shared memory.
|
||||
// "If base == 0 and bytes == ~0 and data == 0, no storage will be auto-allocated."
|
||||
// Width and height of the image = size of the capture area.
|
||||
d->updateTile = xcb_image_create_native(
|
||||
QX11Info::connection(),
|
||||
d->area.width(), // width
|
||||
d->area.height(), // height
|
||||
XCB_IMAGE_FORMAT_Z_PIXMAP, // image format
|
||||
d->rootScreen->root_depth, // depth
|
||||
nullptr, // base address = 0
|
||||
(uint32_t)~0, // bytes = 0xffffffff
|
||||
nullptr); // data = 0
|
||||
if (d->updateTile) {
|
||||
#ifdef _DEBUG
|
||||
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: Successfully created new empty image in native format"
|
||||
<< "\n size: " << d->updateTile->width << "x" << d->updateTile->height
|
||||
<< "(stride: " << d->updateTile->stride << ")"
|
||||
<< "\n bpp, depth: " << d->updateTile->bpp << d->updateTile->depth // 32, 24
|
||||
<< "\n addr of base, data: " << d->updateTile->base << (void *)d->updateTile->data
|
||||
<< "\n size: " << d->updateTile->size
|
||||
<< "\n image byte order = " << d->updateTile->byte_order // == 0 .._LSB_FIRST
|
||||
<< "\n image bit order = " << d->updateTile->bit_order // == 1 .._MSB_FIRST
|
||||
<< "\n image plane_mask = " << d->updateTile->plane_mask; // == 16777215 == 0x00FFFFFF
|
||||
#endif
|
||||
|
||||
// allocate shared memory block only once, make its size large enough
|
||||
// to fit whole capture area (d->area rect)
|
||||
// so, we get as many bytes as needed for image (updateTile->size)
|
||||
d->shminfo.shmid = shmget(IPC_PRIVATE, d->updateTile->size, IPC_CREAT | 0777);
|
||||
// attached shared memory address is stored both in shminfo structure and in xcb_image_t->data
|
||||
d->shminfo.shmaddr = (uint8_t *)shmat(d->shminfo.shmid, nullptr, 0);
|
||||
d->updateTile->data = d->shminfo.shmaddr;
|
||||
// we keep updateTile->base == NULL here, so xcb_image_destroy() will not attempt
|
||||
// to free this block, just in case.
|
||||
|
||||
// attach this shm segment also to X server
|
||||
d->shminfo.shmseg = xcb_generate_id(QX11Info::connection());
|
||||
xcb_shm_attach(QX11Info::connection(), d->shminfo.shmseg, d->shminfo.shmid, 0);
|
||||
|
||||
#ifdef _DEBUG
|
||||
qCDebug(KRFB_FB_XCB) << " shm id: " << d->shminfo.shmseg << ", addr: " << (void *)d->shminfo.shmaddr;
|
||||
#endif
|
||||
|
||||
// will return 1 on success (yes!)
|
||||
int shmget_res = xcb_image_shm_get(
|
||||
QX11Info::connection(),
|
||||
this->win,
|
||||
d->updateTile,
|
||||
d->shminfo,
|
||||
d->area.left(), // x
|
||||
d->area.top(), // y (size taken from image structure itself)?
|
||||
0xFFFFFFFF);
|
||||
|
||||
if (shmget_res == 0) {
|
||||
// error! shared mem not working?
|
||||
// will not use shared mem! detach and cleanup
|
||||
xcb_shm_detach(QX11Info::connection(), d->shminfo.shmseg);
|
||||
shmdt(d->shminfo.shmaddr);
|
||||
shmctl(d->shminfo.shmid, IPC_RMID, nullptr); // mark shm segment as removed
|
||||
d->x11EvtFilter->xshmAvail = false;
|
||||
d->shminfo.shmaddr = nullptr;
|
||||
d->shminfo.shmid = XCB_NONE;
|
||||
d->shminfo.shmseg = XCB_NONE;
|
||||
qWarning() << "xcb framebuffer: ERROR: xcb_image_shm_get() result: " << shmget_res;
|
||||
}
|
||||
|
||||
// image is freed, and recreated again for every new damage rectangle
|
||||
// data was allocated manually and points to shared mem;
|
||||
// tell xcb_image_destroy() do not free image data
|
||||
d->updateTile->data = nullptr;
|
||||
xcb_image_destroy(d->updateTile);
|
||||
d->updateTile = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: XCBFrameBuffer(), xshm base event = " << d->x11EvtFilter->xshmBaseEvent
|
||||
<< ", xshm base error = " << d->x11EvtFilter->xdamageBaseError
|
||||
<< ", xdamage base event = " << d->x11EvtFilter->xdamageBaseEvent
|
||||
<< ", xdamage base error = " << d->x11EvtFilter->xdamageBaseError;
|
||||
#endif
|
||||
|
||||
QCoreApplication::instance()->installNativeEventFilter(d->x11EvtFilter);
|
||||
}
|
||||
|
||||
|
||||
XCBFrameBuffer::~XCBFrameBuffer() {
|
||||
// first - uninstall x11 event filter
|
||||
QCoreApplication::instance()->removeNativeEventFilter(d->x11EvtFilter);
|
||||
//
|
||||
if (d->framebufferImage) {
|
||||
xcb_image_destroy(d->framebufferImage);
|
||||
fb = nullptr; // image data was already destroyed by above call
|
||||
}
|
||||
if (d->x11EvtFilter->xshmAvail) {
|
||||
// detach shared memory
|
||||
if (d->shminfo.shmseg != XCB_NONE)
|
||||
xcb_shm_detach(QX11Info::connection(), d->shminfo.shmseg); // detach from X server
|
||||
if (d->shminfo.shmaddr)
|
||||
shmdt(d->shminfo.shmaddr); // detach addr from our address space
|
||||
if (d->shminfo.shmid != XCB_NONE)
|
||||
shmctl(d->shminfo.shmid, IPC_RMID, nullptr); // mark shm segment as removed
|
||||
}
|
||||
// and delete image used for shared mem
|
||||
if (d->updateTile) {
|
||||
d->updateTile->base = nullptr;
|
||||
d->updateTile->data = nullptr;
|
||||
xcb_image_destroy(d->updateTile);
|
||||
}
|
||||
// we don't use d->x11EvtFilter anymore, can delete it now
|
||||
if (d->x11EvtFilter) {
|
||||
delete d->x11EvtFilter;
|
||||
}
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
||||
int XCBFrameBuffer::depth() {
|
||||
if (d->framebufferImage) {
|
||||
return d->framebufferImage->depth;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int XCBFrameBuffer::height() {
|
||||
if (d->framebufferImage) {
|
||||
return d->framebufferImage->height;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int XCBFrameBuffer::width() {
|
||||
if (d->framebufferImage) {
|
||||
return d->framebufferImage->width;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XCBFrameBuffer::paddedWidth() {
|
||||
if (d->framebufferImage) {
|
||||
return d->framebufferImage->stride;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void XCBFrameBuffer::getServerFormat(rfbPixelFormat &format) {
|
||||
if (!d->framebufferImage) return;
|
||||
|
||||
// get information about XCB visual params
|
||||
xcb_visualtype_t *root_visualtype = nullptr; // visual info
|
||||
if (d->rootScreen) {
|
||||
xcb_visualid_t root_visual = d->rootScreen->root_visual;
|
||||
xcb_depth_iterator_t depth_iter;
|
||||
// To get the xcb_visualtype_t structure, it's a bit less easy.
|
||||
// You have to get the xcb_screen_t structure that you want, get its
|
||||
// root_visual member, then iterate over the xcb_depth_t's and the
|
||||
// xcb_visualtype_t's, and compare the xcb_visualid_t of these
|
||||
// xcb_visualtype_ts: with root_visual
|
||||
depth_iter = xcb_screen_allowed_depths_iterator(d->rootScreen);
|
||||
for (; depth_iter.rem; xcb_depth_next(&depth_iter)) {
|
||||
xcb_visualtype_iterator_t visual_iter;
|
||||
visual_iter = xcb_depth_visuals_iterator(depth_iter.data);
|
||||
for (; visual_iter.rem; xcb_visualtype_next(&visual_iter)) {
|
||||
if (root_visual == visual_iter.data->visual_id) {
|
||||
root_visualtype = visual_iter.data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// fill in format common info
|
||||
format.bitsPerPixel = d->framebufferImage->bpp;
|
||||
format.depth = d->framebufferImage->depth;
|
||||
format.trueColour = true; // not using color palettes
|
||||
format.bigEndian = false; // always false for ZPIXMAP format!
|
||||
|
||||
// information about pixels layout
|
||||
|
||||
if (root_visualtype) {
|
||||
#ifdef _DEBUG
|
||||
qDebug("xcb framebuffer: Got info about root visual:\n"
|
||||
" bits per rgb value: %d\n"
|
||||
" red mask: %08x\n"
|
||||
" green mask: %08x\n"
|
||||
" blue mask: %08x\n",
|
||||
(int)root_visualtype->bits_per_rgb_value,
|
||||
root_visualtype->red_mask,
|
||||
root_visualtype->green_mask,
|
||||
root_visualtype->blue_mask);
|
||||
#endif
|
||||
|
||||
// calculate shifts
|
||||
format.redShift = 0;
|
||||
if (root_visualtype->red_mask) {
|
||||
while (!(root_visualtype->red_mask & (1 << format.redShift))) {
|
||||
format.redShift++;
|
||||
}
|
||||
}
|
||||
format.greenShift = 0;
|
||||
if (root_visualtype->green_mask) {
|
||||
while (!(root_visualtype->green_mask & (1 << format.greenShift))) {
|
||||
format.greenShift++;
|
||||
}
|
||||
}
|
||||
format.blueShift = 0;
|
||||
if (root_visualtype->blue_mask) {
|
||||
while (!(root_visualtype->blue_mask & (1 << format.blueShift))) {
|
||||
format.blueShift++;
|
||||
}
|
||||
}
|
||||
|
||||
// calculate pixel max value.
|
||||
// NOTE: bits_per_rgb_value is unreliable, thus should be avoided.
|
||||
format.redMax = root_visualtype->red_mask >> format.redShift;
|
||||
format.greenMax = root_visualtype->green_mask >> format.greenShift;
|
||||
format.blueMax = root_visualtype->blue_mask >> format.blueShift;
|
||||
|
||||
#ifdef _DEBUG
|
||||
qCDebug(KRFB_FB_XCB,
|
||||
" Calculated redShift = %d\n"
|
||||
" Calculated greenShift = %d\n"
|
||||
" Calculated blueShift = %d\n"
|
||||
" Calculated max values: R%d G%d B%d",
|
||||
format.redShift, format.greenShift, format.blueShift
|
||||
format.redMax, format.greenMax, format.blueMax);
|
||||
#endif
|
||||
} else {
|
||||
// some kind of fallback (unlikely code execution will go this way)
|
||||
// idea taken from qt framefuffer sources
|
||||
if (format.bitsPerPixel == 8) {
|
||||
format.redShift = 0;
|
||||
format.greenShift = 3;
|
||||
format.blueShift = 6;
|
||||
format.redMax = 7;
|
||||
format.greenMax = 7;
|
||||
format.blueMax = 3;
|
||||
} else if (format.bitsPerPixel == 16) {
|
||||
// TODO: 16 bits per pixel format ??
|
||||
// what format of pixels does X server use for 16-bpp?
|
||||
} else if (format.bitsPerPixel == 32) {
|
||||
format.redMax = 0xff;
|
||||
format.greenMax = 0xff;
|
||||
format.blueMax = 0xff;
|
||||
if (format.bigEndian) {
|
||||
format.redShift = 0;
|
||||
format.greenShift = 8;
|
||||
format.blueShift = 16;
|
||||
} else {
|
||||
format.redShift = 16;
|
||||
format.greenShift = 8;
|
||||
format.blueShift = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function contents was taken from X11 framebuffer source code.
|
||||
* It simply several intersecting rectangles into one bigger rect.
|
||||
* Non-intersecting rects are treated as different rects and exist
|
||||
* separately in this->tiles QList.
|
||||
*/
|
||||
void XCBFrameBuffer::cleanupRects() {
|
||||
QList<QRect> cpy = tiles;
|
||||
bool inserted = false;
|
||||
tiles.clear();
|
||||
|
||||
QListIterator<QRect> iter(cpy);
|
||||
while (iter.hasNext()) {
|
||||
const QRect &r = iter.next();
|
||||
// skip rects not intersecting with primary monitor
|
||||
if (!r.intersects(d->area)) continue;
|
||||
// only take intersection of this rect with primary monitor rect
|
||||
QRect ri = r.intersected(d->area);
|
||||
|
||||
if (tiles.size() > 0) {
|
||||
for (auto &tile : tiles) {
|
||||
// if current rect has intersection with tile, unite them
|
||||
if (ri.intersects(tile)) {
|
||||
tile |= ri;
|
||||
inserted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!inserted) {
|
||||
// else, append to list as different rect
|
||||
tiles.append(ri);
|
||||
}
|
||||
} else {
|
||||
// tiles list is empty, append first item
|
||||
tiles.append(ri);
|
||||
}
|
||||
}
|
||||
|
||||
// increase all rectangles size by 30 pixels each side.
|
||||
// limit coordinates to primary monitor boundaries.
|
||||
for (auto &tile : tiles) {
|
||||
tile.adjust(-30, -30, 30, 30);
|
||||
if (tile.top() < d->area.top()) {
|
||||
tile.setTop(d->area.top());
|
||||
}
|
||||
if (tile.bottom() > d->area.bottom()) {
|
||||
tile.setBottom(d->area.bottom());
|
||||
}
|
||||
//
|
||||
if (tile.left() < d->area.left()) {
|
||||
tile.setLeft(d->area.left());
|
||||
}
|
||||
if (tile.right() > d->area.right()) {
|
||||
tile.setRight(d->area.right());
|
||||
}
|
||||
// move update rects so that they are positioned relative to
|
||||
// framebuffer image, not whole screen
|
||||
tile.moveTo(tile.left() - d->area.left(),
|
||||
tile.top() - d->area.top());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is called by RfbServerManager::updateScreens()
|
||||
* approximately every 50ms (!!), driven by QTimer to get all
|
||||
* modified rectangles on the screen
|
||||
*/
|
||||
QList<QRect> XCBFrameBuffer::modifiedTiles() {
|
||||
QList<QRect> ret;
|
||||
if (!d->running) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
cleanupRects();
|
||||
|
||||
if (tiles.size() > 0) {
|
||||
if (d->x11EvtFilter->xshmAvail) {
|
||||
|
||||
// loop over all damage rectangles gathered up to this time
|
||||
QListIterator<QRect> iter(tiles);
|
||||
//foreach(const QRect &r, tiles) {
|
||||
while (iter.hasNext()) {
|
||||
const QRect &r = iter.next();
|
||||
|
||||
// get image data into shared memory segment
|
||||
// now rects are positioned relative to framebufferImage,
|
||||
// but we need to get image from the whole screen, so
|
||||
// translate whe coordinates
|
||||
xcb_shm_get_image_cookie_t sgi_cookie = xcb_shm_get_image(
|
||||
QX11Info::connection(),
|
||||
this->win,
|
||||
d->area.left() + r.left(),
|
||||
d->area.top() + r.top(),
|
||||
r.width(),
|
||||
r.height(),
|
||||
0xFFFFFFFF,
|
||||
XCB_IMAGE_FORMAT_Z_PIXMAP,
|
||||
d->shminfo.shmseg,
|
||||
0);
|
||||
|
||||
xcb_shm_get_image_reply_t *sgi_reply = xcb_shm_get_image_reply(
|
||||
QX11Info::connection(), sgi_cookie, nullptr);
|
||||
if (sgi_reply) {
|
||||
// create temporary image to get update rect contents into
|
||||
d->updateTile = xcb_image_create_native(
|
||||
QX11Info::connection(),
|
||||
r.width(),
|
||||
r.height(),
|
||||
XCB_IMAGE_FORMAT_Z_PIXMAP,
|
||||
d->rootScreen->root_depth,
|
||||
nullptr, // base == 0
|
||||
(uint32_t)~0, // bytes == ~0
|
||||
nullptr);
|
||||
|
||||
if (d->updateTile) {
|
||||
d->updateTile->data = d->shminfo.shmaddr;
|
||||
|
||||
// copy pixels from this damage rectangle image
|
||||
// to our total framebuffer image
|
||||
int pxsize = d->framebufferImage->bpp / 8;
|
||||
char *dest = fb + ((d->framebufferImage->stride * r.top()) + (r.left() * pxsize));
|
||||
char *src = (char *)d->updateTile->data;
|
||||
for (int i = 0; i < d->updateTile->height; i++) {
|
||||
memcpy(dest, src, d->updateTile->stride); // copy whole row of pixels
|
||||
dest += d->framebufferImage->stride;
|
||||
src += d->updateTile->stride;
|
||||
}
|
||||
|
||||
// delete temporary image
|
||||
d->updateTile->data = nullptr;
|
||||
xcb_image_destroy(d->updateTile);
|
||||
d->updateTile = nullptr;
|
||||
}
|
||||
|
||||
free(sgi_reply);
|
||||
}
|
||||
} // foreach
|
||||
} else {
|
||||
// not using shared memory
|
||||
// will use just xcb_image_get() and copy pixels
|
||||
for (const QRect& r : std::as_const(tiles)) {
|
||||
// I did not find XGetSubImage() analog in XCB!!
|
||||
// need function that copies pixels from one image to another
|
||||
xcb_image_t *damagedImage = xcb_image_get(
|
||||
QX11Info::connection(),
|
||||
this->win,
|
||||
r.left(),
|
||||
r.top(),
|
||||
r.width(),
|
||||
r.height(),
|
||||
0xFFFFFFFF, // AllPlanes
|
||||
XCB_IMAGE_FORMAT_Z_PIXMAP);
|
||||
// manually copy pixels
|
||||
int pxsize = d->framebufferImage->bpp / 8;
|
||||
char *dest = fb + ((d->framebufferImage->stride * r.top()) + (r.left() * pxsize));
|
||||
char *src = (char *)damagedImage->data;
|
||||
// loop every row in damaged image
|
||||
for (int i = 0; i < damagedImage->height; i++) {
|
||||
// copy whole row of pixels from src image to dest
|
||||
memcpy(dest, src, damagedImage->stride);
|
||||
dest += d->framebufferImage->stride; // move 1 row down in dest
|
||||
src += damagedImage->stride; // move 1 row down in src
|
||||
}
|
||||
//
|
||||
xcb_image_destroy(damagedImage);
|
||||
}
|
||||
}
|
||||
} // if (tiles.size() > 0)
|
||||
|
||||
ret = tiles;
|
||||
tiles.clear();
|
||||
// ^^ If we clear here all our known "damage areas", then we can also clear
|
||||
// damaged area for xdamage? No, we don't need to in our case
|
||||
// (XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES report mode)
|
||||
//xcb_damage_subtract(QX11Info::connection(), d->damage, XCB_NONE, XCB_NONE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void XCBFrameBuffer::startMonitor() {
|
||||
if (d->running) return;
|
||||
|
||||
d->running = true;
|
||||
d->damage = xcb_generate_id(QX11Info::connection());
|
||||
xcb_damage_create(QX11Info::connection(), d->damage, this->win,
|
||||
XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES);
|
||||
|
||||
// (currently) we do not call xcb_damage_subtract() EVER, because
|
||||
// RAW rectangles are reported. every time some area of the screen
|
||||
// was changed, we get only that rectangle
|
||||
//xcb_damage_subtract(QX11Info::connection(), d->damage, XCB_NONE, XCB_NONE);
|
||||
}
|
||||
|
||||
|
||||
void XCBFrameBuffer::stopMonitor() {
|
||||
if (!d->running) return;
|
||||
d->running = false;
|
||||
xcb_damage_destroy(QX11Info::connection(), d->damage);
|
||||
}
|
||||
|
||||
|
||||
// void XCBFrameBuffer::acquireEvents() {} // this function was totally unused
|
||||
// in X11 framebuffer, but it was the only function where XDamageSubtract() was called?
|
||||
// Also it had a blocking event loop like:
|
||||
//
|
||||
// XEvent ev;
|
||||
// while (XCheckTypedEvent(QX11Info::display(), d->xdamageBaseEvent + XDamageNotify, &ev)) {
|
||||
// handleXDamage(&ev);
|
||||
// }
|
||||
// XDamageSubtract(QX11Info::display(), d->damage, None, None);
|
||||
//
|
||||
// This loop takes all available Xdamage events from queue, and ends if there are no
|
||||
// more such events in input queue.
|
||||
|
||||
|
||||
void XCBFrameBuffer::handleXDamageNotify(xcb_generic_event_t *xevent) {
|
||||
auto xdevt = (xcb_damage_notify_event_t *)xevent;
|
||||
|
||||
QRect r((int)xdevt->area.x, (int)xdevt->area.y,
|
||||
(int)xdevt->area.width, (int)xdevt->area.height);
|
||||
this->tiles.append(r);
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2017 Alexey Min <alexey.min@gmail.com>
|
||||
|
||||
This program 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.
|
||||
*/
|
||||
#ifndef KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
|
||||
#define KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
|
||||
|
||||
#include "framebuffer.h"
|
||||
#include <QWidget>
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@author Alexey Min <alexey.min@gmail.com>
|
||||
*/
|
||||
class XCBFrameBuffer: public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit XCBFrameBuffer(WId winid, QObject *parent = nullptr);
|
||||
~XCBFrameBuffer() override;
|
||||
|
||||
public:
|
||||
QList<QRect> modifiedTiles() override;
|
||||
int depth() override;
|
||||
int height() override;
|
||||
int width() override;
|
||||
int paddedWidth() override;
|
||||
void getServerFormat(rfbPixelFormat &format) override;
|
||||
void startMonitor() override;
|
||||
void stopMonitor() override;
|
||||
|
||||
public:
|
||||
void handleXDamageNotify(xcb_generic_event_t *xevent);
|
||||
|
||||
private:
|
||||
void cleanupRects();
|
||||
|
||||
class P;
|
||||
P *const d;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,47 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2017 Alexey Min <alexey.min@gmail.com>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
#include "xcb_framebufferplugin.h"
|
||||
#include "xcb_framebuffer.h"
|
||||
#include <KPluginFactory>
|
||||
|
||||
|
||||
K_PLUGIN_FACTORY_WITH_JSON(XCBFrameBufferPluginFactory, "krfb_framebuffer_xcb.json",
|
||||
registerPlugin<XCBFrameBufferPlugin>();)
|
||||
|
||||
XCBFrameBufferPlugin::XCBFrameBufferPlugin(QObject *parent, const QVariantList &args)
|
||||
: FrameBufferPlugin(parent, args)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
XCBFrameBufferPlugin::~XCBFrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
FrameBuffer *XCBFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
return new XCBFrameBuffer(id);
|
||||
}
|
||||
|
||||
#include "xcb_framebufferplugin.moc"
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
@author Alexey Min <alexey.min@gmail.com>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_FRAMEBUFFER_XCB_XCBFRAMEBUFFERPLUGIN_H
|
||||
#define KRFB_FRAMEBUFFER_XCB_XCBFRAMEBUFFERPLUGIN_H
|
||||
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
class FrameBuffer;
|
||||
|
||||
class XCBFrameBufferPlugin: public FrameBufferPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
XCBFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
~XCBFrameBufferPlugin() override;
|
||||
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(XCBFrameBufferPlugin)
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +0,0 @@
|
||||
ecm_install_icons(ICONS
|
||||
sc-apps-krfb.svgz
|
||||
48-apps-krfb.png
|
||||
DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor )
|
||||
@@ -2,8 +2,6 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config-krfb.h.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config-krfb.h
|
||||
)
|
||||
|
||||
include(GenerateExportHeader)
|
||||
|
||||
#####################################
|
||||
# First target: libkrfbprivate - a library
|
||||
# for linking plugins against.
|
||||
@@ -11,50 +9,53 @@ include(GenerateExportHeader)
|
||||
set (krfbprivate_SRCS
|
||||
framebuffer.cpp
|
||||
framebufferplugin.cpp
|
||||
events.cpp
|
||||
eventsplugin.cpp
|
||||
)
|
||||
|
||||
add_library (krfbprivate
|
||||
kde4_add_library (krfbprivate
|
||||
SHARED
|
||||
${krfbprivate_SRCS}
|
||||
)
|
||||
generate_export_header(krfbprivate BASE_NAME krfbprivate)
|
||||
|
||||
|
||||
target_link_libraries (krfbprivate
|
||||
Qt5::Core
|
||||
Qt5::Widgets
|
||||
Qt5::X11Extras
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${X11_X11_LIB}
|
||||
${LIBVNCSERVER_LIBRARIES}
|
||||
)
|
||||
|
||||
set_target_properties (krfbprivate PROPERTIES
|
||||
VERSION 5
|
||||
SOVERSION 5.0
|
||||
VERSION ${GENERIC_LIB_VERSION}
|
||||
SOVERSION ${GENERIC_LIB_VERSION}
|
||||
)
|
||||
|
||||
install (TARGETS krfbprivate
|
||||
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
LIBRARY NAMELINK_SKIP
|
||||
)
|
||||
|
||||
install (FILES
|
||||
krfb-framebuffer.desktop
|
||||
krfb-events.desktop
|
||||
DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}
|
||||
DESTINATION ${SERVICETYPES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
#####################################
|
||||
# Second target: krfb - the app
|
||||
# itself.
|
||||
|
||||
if(TelepathyQt4_FOUND)
|
||||
add_definitions(-DKRFB_WITH_TELEPATHY_TUBES)
|
||||
include_directories(${TELEPATHY_QT4_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if(KTP_FOUND)
|
||||
add_definitions(-DKRFB_WITH_KDE_TELEPATHY)
|
||||
include_directories(${KTP_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
set (krfb_SRCS
|
||||
connectiondialog.cpp
|
||||
framebuffermanager.cpp
|
||||
events.cpp
|
||||
eventsmanager.cpp
|
||||
framebuffermanager.cpp
|
||||
main.cpp
|
||||
mainwindow.cpp
|
||||
sockethelpers.cpp
|
||||
@@ -66,54 +67,60 @@ set (krfb_SRCS
|
||||
invitationsrfbclient.cpp
|
||||
)
|
||||
|
||||
ecm_qt_declare_logging_category(krfb_SRCS
|
||||
HEADER krfbdebug.h
|
||||
IDENTIFIER KRFB
|
||||
CATEGORY_NAME krfb.krfb
|
||||
DESCRIPTION "KRFB Application"
|
||||
EXPORT KRFB
|
||||
)
|
||||
if(TelepathyQt4_FOUND)
|
||||
set (krfb_SRCS
|
||||
${krfb_SRCS}
|
||||
tubesrfbserver.cpp
|
||||
tubesrfbclient.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
kconfig_add_kcfg_files (krfb_SRCS
|
||||
kde4_add_kcfg_files (krfb_SRCS
|
||||
krfbconfig.kcfgc
|
||||
)
|
||||
|
||||
ki18n_wrap_ui (krfb_UI_SRCS
|
||||
kde4_add_ui_files (krfb_SRCS
|
||||
ui/configtcp.ui
|
||||
ui/configsecurity.ui
|
||||
ui/configframebuffer.ui
|
||||
ui/connectionwidget.ui
|
||||
ui/mainwidget.ui
|
||||
)
|
||||
|
||||
qt5_add_resources(krfb_SRCS
|
||||
krfb.qrc
|
||||
)
|
||||
if(TelepathyQt4_FOUND)
|
||||
kde4_add_ui_files(krfb_SRCS ui/tubesconnectionwidget.ui)
|
||||
endif()
|
||||
|
||||
add_executable (krfb
|
||||
kde4_add_executable (krfb
|
||||
${krfb_SRCS}
|
||||
${krfb_UI_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries (krfb
|
||||
krfbprivate
|
||||
vncserver
|
||||
${JPEG_LIBRARIES}
|
||||
${X11_Xext_LIB}
|
||||
${X11_X11_LIB}
|
||||
${X11_Xdamage_LIB}
|
||||
Qt5::Network
|
||||
KF5::CoreAddons
|
||||
KF5::DBusAddons
|
||||
KF5::DNSSD
|
||||
KF5::I18n
|
||||
KF5::Notifications
|
||||
KF5::Wallet
|
||||
KF5::WidgetsAddons
|
||||
KF5::WindowSystem
|
||||
KF5::XmlGui
|
||||
${QT_QTNETWORK_LIBRARY}
|
||||
${KDE4_KDNSSD_LIBS}
|
||||
${KDE4_KDEUI_LIBS}
|
||||
${LIBVNCSERVER_LIBRARIES}
|
||||
)
|
||||
|
||||
if(TelepathyQt4_FOUND)
|
||||
target_link_libraries(krfb
|
||||
${TELEPATHY_QT4_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(KTP_FOUND)
|
||||
target_link_libraries(krfb
|
||||
${KTP_LIBRARIES}
|
||||
${KTP_MODELS_LIBRARIES}
|
||||
${KTP_WIDGETS_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (X11_XTest_FOUND)
|
||||
target_link_libraries (krfb
|
||||
${X11_XTest_LIB}
|
||||
@@ -121,55 +128,25 @@ if (X11_XTest_FOUND)
|
||||
endif (X11_XTest_FOUND)
|
||||
|
||||
install (TARGETS krfb
|
||||
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
#################################
|
||||
kconfig_add_kcfg_files (krfbvm_SRCS
|
||||
krfbconfig.kcfgc
|
||||
)
|
||||
if(TelepathyQt4_FOUND)
|
||||
configure_file(org.freedesktop.Telepathy.Client.krfb_rfb_handler.service.in
|
||||
org.freedesktop.Telepathy.Client.krfb_rfb_handler.service)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krfb_rfb_handler.service
|
||||
DESTINATION ${DBUS_SERVICES_INSTALL_DIR})
|
||||
|
||||
ecm_qt_declare_logging_category(krfbvm_SRCS
|
||||
HEADER krfbdebug.h
|
||||
IDENTIFIER KRFB
|
||||
CATEGORY_NAME krfb.krfb
|
||||
DESCRIPTION "KRFB Application"
|
||||
EXPORT KRFB
|
||||
)
|
||||
|
||||
add_executable(krfb-virtualmonitor main-virtualmonitor.cpp ${krfbvm_SRCS} ${krfb_UI_SRCS}
|
||||
rfbserver.cpp rfbclient.cpp rfbservermanager.cpp eventsmanager.cpp framebuffermanager.cpp sockethelpers.cpp)
|
||||
target_link_libraries(krfb-virtualmonitor
|
||||
krfbprivate
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
KF5::ConfigGui
|
||||
KF5::CoreAddons
|
||||
KF5::I18n
|
||||
KF5::Notifications
|
||||
KF5::WindowSystem
|
||||
)
|
||||
|
||||
install (TARGETS krfb-virtualmonitor
|
||||
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
configure_file(org.kde.krfb.virtualmonitor.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.krfb.virtualmonitor.desktop @ONLY)
|
||||
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.krfb.virtualmonitor.desktop
|
||||
DESTINATION ${KDE_INSTALL_APPDIR}
|
||||
)
|
||||
install(FILES krfb_rfb_handler.client DESTINATION ${CMAKE_INSTALL_PREFIX}/share/telepathy/clients/)
|
||||
endif()
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install (PROGRAMS org.kde.krfb.desktop
|
||||
DESTINATION ${KDE_INSTALL_APPDIR}
|
||||
)
|
||||
|
||||
install(FILES org.kde.krfb.appdata.xml
|
||||
DESTINATION ${KDE_INSTALL_METAINFODIR}
|
||||
install (PROGRAMS krfb.desktop
|
||||
DESTINATION ${XDG_APPS_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install (FILES krfb.notifyrc
|
||||
DESTINATION ${KDE_INSTALL_DATADIR}/krfb
|
||||
DESTINATION ${DATA_INSTALL_DIR}/krfb
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,3 @@
|
||||
|
||||
/* Define if XShm is available */
|
||||
#cmakedefine HAVE_XSHM 1
|
||||
|
||||
/* Define if DMA-BUF support is available */
|
||||
#cmakedefine01 HAVE_DMA_BUF
|
||||
|
||||
@@ -21,33 +21,20 @@
|
||||
|
||||
#include "connectiondialog.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QIcon>
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include <KIconLoader>
|
||||
#include <KLocale>
|
||||
#include <KStandardGuiItem>
|
||||
#include <KConfigGroup>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
#include <KGuiItem>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
template <typename UI>
|
||||
ConnectionDialog<UI>::ConnectionDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
: KDialog(parent)
|
||||
{
|
||||
setWindowTitle(i18n("New Connection"));
|
||||
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
|
||||
auto mainWidget = new QWidget(this);
|
||||
auto mainLayout = new QVBoxLayout;
|
||||
setLayout(mainLayout);
|
||||
mainLayout->addWidget(mainWidget);
|
||||
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
|
||||
okButton->setDefault(true);
|
||||
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
|
||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &ConnectionDialog<UI>::accept);
|
||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &ConnectionDialog<UI>::reject);
|
||||
buttonBox->button(QDialogButtonBox::Cancel)->setDefault(true);
|
||||
setCaption(i18n("New Connection"));
|
||||
setButtons(Ok | Cancel);
|
||||
setDefaultButton(Cancel);
|
||||
setModal(true);
|
||||
|
||||
setMinimumSize(500, 200);
|
||||
@@ -55,18 +42,17 @@ ConnectionDialog<UI>::ConnectionDialog(QWidget *parent)
|
||||
m_connectWidget = new QWidget(this);
|
||||
m_ui.setupUi(m_connectWidget);
|
||||
|
||||
m_ui.pixmapLabel->setPixmap(QIcon::fromTheme(QStringLiteral("krfb")).pixmap(128));
|
||||
m_ui.pixmapLabel->setPixmap(KIcon("krfb").pixmap(128));
|
||||
|
||||
KGuiItem accept = KStandardGuiItem::ok();
|
||||
accept.setText(i18n("Accept Connection"));
|
||||
KGuiItem::assign(okButton, accept);
|
||||
setButtonGuiItem(Ok, accept);
|
||||
|
||||
KGuiItem refuse = KStandardGuiItem::cancel();
|
||||
refuse.setText(i18n("Refuse Connection"));
|
||||
KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), refuse);
|
||||
setButtonGuiItem(Cancel, refuse);
|
||||
|
||||
mainLayout->addWidget(m_connectWidget);
|
||||
mainLayout->addWidget(buttonBox);
|
||||
setMainWidget(m_connectWidget);
|
||||
}
|
||||
|
||||
//**********
|
||||
@@ -80,3 +66,23 @@ void InvitationsConnectionDialog::setRemoteHost(const QString &host)
|
||||
{
|
||||
m_ui.remoteHost->setText(host);
|
||||
}
|
||||
|
||||
//**********
|
||||
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
|
||||
TubesConnectionDialog::TubesConnectionDialog(QWidget *parent)
|
||||
: ConnectionDialog<Ui::TubesConnectionWidget>(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void TubesConnectionDialog::setContactName(const QString & name)
|
||||
{
|
||||
QString txt = i18n("You have requested to share your desktop with %1. If you proceed, "
|
||||
"you will allow the remote user to watch your desktop.", name);
|
||||
m_ui.mainTextLabel->setText(txt);
|
||||
}
|
||||
|
||||
#endif // KRFB_WITH_TELEPATHY_TUBES
|
||||
|
||||
#include "connectiondialog.moc"
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
#define CONNECTIONDIALOG_H
|
||||
|
||||
#include "ui_connectionwidget.h"
|
||||
#include <QDialog>
|
||||
#include <KDialog>
|
||||
|
||||
template <typename UI>
|
||||
class ConnectionDialog : public QDialog
|
||||
class ConnectionDialog : public KDialog
|
||||
{
|
||||
public:
|
||||
explicit ConnectionDialog(QWidget *parent);
|
||||
~ConnectionDialog() override {};
|
||||
ConnectionDialog(QWidget *parent);
|
||||
~ConnectionDialog() {};
|
||||
|
||||
void setAllowRemoteControl(bool b);
|
||||
bool allowRemoteControl();
|
||||
@@ -59,11 +59,24 @@ class InvitationsConnectionDialog : public ConnectionDialog<Ui::ConnectionWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InvitationsConnectionDialog(QWidget *parent);
|
||||
InvitationsConnectionDialog(QWidget *parent);
|
||||
void setRemoteHost(const QString & host);
|
||||
};
|
||||
|
||||
//*********
|
||||
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
# include "ui_tubesconnectionwidget.h"
|
||||
|
||||
class TubesConnectionDialog : public ConnectionDialog<Ui::TubesConnectionWidget>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TubesConnectionDialog(QWidget *parent);
|
||||
void setContactName(const QString & name);
|
||||
};
|
||||
|
||||
#endif // KRFB_WITH_TELEPATHY_TUBES
|
||||
|
||||
#endif // CONNECTIONDIALOG_H
|
||||
|
||||
|
||||
172
krfb/events.cpp
@@ -24,17 +24,177 @@
|
||||
|
||||
#include "events.h"
|
||||
|
||||
EventHandler::EventHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QX11Info>
|
||||
#include <QtGui/QDesktopWidget>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
|
||||
enum {
|
||||
LEFTSHIFT = 1,
|
||||
RIGHTSHIFT = 2,
|
||||
ALTGR = 4
|
||||
};
|
||||
|
||||
class EventData
|
||||
{
|
||||
public:
|
||||
EventData();
|
||||
|
||||
//keyboard
|
||||
Display *dpy;
|
||||
signed char modifiers[0x100];
|
||||
KeyCode keycodes[0x100];
|
||||
KeyCode leftShiftCode;
|
||||
KeyCode rightShiftCode;
|
||||
KeyCode altGrCode;
|
||||
char modifierState;
|
||||
|
||||
//mouse
|
||||
int buttonMask;
|
||||
|
||||
private:
|
||||
void init();
|
||||
};
|
||||
|
||||
K_GLOBAL_STATIC(EventData, data)
|
||||
|
||||
EventData::EventData()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
void EventHandler::setFrameBufferPlugin(const QSharedPointer<FrameBuffer> &frameBuffer)
|
||||
void EventData::init()
|
||||
{
|
||||
fb = frameBuffer;
|
||||
dpy = QX11Info::display();
|
||||
buttonMask = 0;
|
||||
|
||||
//initialize keycodes
|
||||
KeySym key, *keymap;
|
||||
int i, j, minkey, maxkey, syms_per_keycode;
|
||||
|
||||
memset(modifiers, -1, sizeof(modifiers));
|
||||
|
||||
XDisplayKeycodes(dpy, &minkey, &maxkey);
|
||||
Q_ASSERT(minkey >= 8);
|
||||
Q_ASSERT(maxkey < 256);
|
||||
keymap = (KeySym *) XGetKeyboardMapping(dpy, minkey,
|
||||
(maxkey - minkey + 1),
|
||||
&syms_per_keycode);
|
||||
Q_ASSERT(keymap);
|
||||
|
||||
for (i = minkey; i <= maxkey; i++) {
|
||||
for (j = 0; j < syms_per_keycode; j++) {
|
||||
key = keymap[(i-minkey)*syms_per_keycode+j];
|
||||
|
||||
if (key >= ' ' && key < 0x100 && i == XKeysymToKeycode(dpy, key)) {
|
||||
keycodes[key] = i;
|
||||
modifiers[key] = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leftShiftCode = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
rightShiftCode = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
altGrCode = XKeysymToKeycode(dpy, XK_Mode_switch);
|
||||
|
||||
XFree((char *)keymap);
|
||||
}
|
||||
|
||||
QSharedPointer<FrameBuffer> EventHandler::frameBuffer()
|
||||
/* this function adjusts the modifiers according to mod (as from modifiers) and data->modifierState */
|
||||
static void tweakModifiers(signed char mod, bool down)
|
||||
{
|
||||
return fb;
|
||||
bool isShift = data->modifierState & (LEFTSHIFT | RIGHTSHIFT);
|
||||
|
||||
if (mod < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isShift && mod != 1) {
|
||||
if (data->modifierState & LEFTSHIFT) {
|
||||
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
|
||||
if (data->modifierState & RIGHTSHIFT) {
|
||||
XTestFakeKeyEvent(data->dpy, data->rightShiftCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isShift && mod == 1) {
|
||||
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
|
||||
if ((data->modifierState & ALTGR) && mod != 2) {
|
||||
XTestFakeKeyEvent(data->dpy, data->altGrCode,
|
||||
!down, CurrentTime);
|
||||
}
|
||||
|
||||
if (!(data->modifierState & ALTGR) && mod == 2) {
|
||||
XTestFakeKeyEvent(data->dpy, data->altGrCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
void EventHandler::handleKeyboard(bool down, rfbKeySym keySym)
|
||||
{
|
||||
#define ADJUSTMOD(sym,state) \
|
||||
if(keySym==sym) { if(down) data->modifierState|=state; else data->modifierState&=~state; }
|
||||
|
||||
ADJUSTMOD(XK_Shift_L, LEFTSHIFT);
|
||||
ADJUSTMOD(XK_Shift_R, RIGHTSHIFT);
|
||||
ADJUSTMOD(XK_Mode_switch, ALTGR);
|
||||
|
||||
if (keySym >= ' ' && keySym < 0x100) {
|
||||
KeyCode k;
|
||||
|
||||
if (down) {
|
||||
tweakModifiers(data->modifiers[keySym], True);
|
||||
}
|
||||
|
||||
k = data->keycodes[keySym];
|
||||
|
||||
if (k != NoSymbol) {
|
||||
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
|
||||
}
|
||||
|
||||
if (down) {
|
||||
tweakModifiers(data->modifiers[keySym], False);
|
||||
}
|
||||
} else {
|
||||
KeyCode k = XKeysymToKeycode(data->dpy, keySym);
|
||||
|
||||
if (k != NoSymbol) {
|
||||
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EventHandler::handlePointer(int buttonMask, int x, int y)
|
||||
{
|
||||
QDesktopWidget *desktopWidget = QApplication::desktop();
|
||||
|
||||
int screen = desktopWidget->screenNumber();
|
||||
|
||||
if (screen < 0) {
|
||||
screen = 0;
|
||||
}
|
||||
|
||||
XTestFakeMotionEvent(data->dpy, screen, x, y, CurrentTime);
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if ((data->buttonMask&(1 << i)) != (buttonMask&(1 << i))) {
|
||||
XTestFakeButtonEvent(data->dpy,
|
||||
i + 1,
|
||||
(buttonMask&(1 << i)) ? True : False,
|
||||
CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
data->buttonMask = buttonMask;
|
||||
}
|
||||
|
||||
@@ -25,26 +25,13 @@
|
||||
#ifndef EVENTS_H
|
||||
#define EVENTS_H
|
||||
|
||||
#include "framebuffer.h"
|
||||
#include "rfb.h"
|
||||
#include "krfbprivate_export.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class KRFBPRIVATE_EXPORT EventHandler : public QObject
|
||||
class EventHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EventHandler(QObject *parent = nullptr);
|
||||
~EventHandler() override = default;
|
||||
virtual void handleKeyboard(bool down, rfbKeySym key) = 0;
|
||||
virtual void handlePointer(int buttonMask, int x, int y) = 0;
|
||||
|
||||
void setFrameBufferPlugin(const QSharedPointer<FrameBuffer> &frameBuffer);
|
||||
QSharedPointer<FrameBuffer> frameBuffer();
|
||||
private:
|
||||
// Used to track framebuffer plugin which we need for xdp event plugin
|
||||
QSharedPointer<FrameBuffer> fb;
|
||||
static void handleKeyboard(bool down, rfbKeySym key);
|
||||
static void handlePointer(int buttonMask, int x, int y);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "eventsmanager.h"
|
||||
|
||||
#include "eventsplugin.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "rfbservermanager.h"
|
||||
#include "krfbdebug.h"
|
||||
|
||||
#include <QGlobalStatic>
|
||||
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KPluginMetaData>
|
||||
|
||||
#include <QtCore/QSharedPointer>
|
||||
|
||||
class EventsManagerStatic
|
||||
{
|
||||
public:
|
||||
EventsManager instance;
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(EventsManagerStatic, eventsManagerStatic)
|
||||
|
||||
EventsManager::EventsManager()
|
||||
{
|
||||
//qDebug();
|
||||
|
||||
loadPlugins();
|
||||
}
|
||||
|
||||
EventsManager::~EventsManager()
|
||||
{
|
||||
//qDebug();
|
||||
}
|
||||
|
||||
EventsManager *EventsManager::instance()
|
||||
{
|
||||
//qDebug();
|
||||
|
||||
return &eventsManagerStatic->instance;
|
||||
}
|
||||
|
||||
void EventsManager::loadPlugins()
|
||||
{
|
||||
//qDebug();
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("krfb/events"));
|
||||
|
||||
QVectorIterator<KPluginMetaData> i(plugins);
|
||||
i.toBack();
|
||||
QSet<QString> unique;
|
||||
while (i.hasPrevious()) {
|
||||
KPluginMetaData data = i.previous();
|
||||
// only load plugins once, even if found multiple times!
|
||||
if (unique.contains(data.name()))
|
||||
continue;
|
||||
KPluginFactory *factory = KPluginLoader(data.fileName()).factory();
|
||||
|
||||
if (!factory) {
|
||||
qCDebug(KRFB) << "KPluginFactory could not load the plugin:" << data.fileName();
|
||||
continue;
|
||||
} else {
|
||||
qCDebug(KRFB) << "found plugin at " << data.fileName();
|
||||
}
|
||||
|
||||
auto plugin = factory->create<EventsPlugin>(this);
|
||||
if (plugin) {
|
||||
m_plugins.insert(data.pluginId(), plugin);
|
||||
qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId();
|
||||
} else {
|
||||
qCDebug(KRFB) << "unable to load plugin for " << data.fileName();
|
||||
}
|
||||
unique.insert (data.name());
|
||||
}
|
||||
}
|
||||
|
||||
QSharedPointer<EventHandler> EventsManager::eventHandler()
|
||||
{
|
||||
QMap<QString, EventsPlugin *>::const_iterator iter = m_plugins.constBegin();
|
||||
|
||||
while (iter != m_plugins.constEnd()) {
|
||||
|
||||
QSharedPointer<EventHandler> eventHandler(iter.value()->eventHandler());
|
||||
|
||||
if (eventHandler) {
|
||||
eventHandler->setFrameBufferPlugin(RfbServerManager::instance()->framebuffer());
|
||||
return eventHandler;
|
||||
}
|
||||
|
||||
++iter;
|
||||
}
|
||||
|
||||
// No valid events plugin found.
|
||||
qCDebug(KRFB) << "No valid event handlers found. returning null.";
|
||||
return QSharedPointer<EventHandler>();
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_EVENTSMANAGER_H
|
||||
#define KRFB_EVENTSMANAGER_H
|
||||
|
||||
#include "events.h"
|
||||
|
||||
#include "krfbprivate_export.h"
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QWeakPointer>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class EventsPlugin;
|
||||
class KPluginFactory;
|
||||
|
||||
class KRFBPRIVATE_EXPORT EventsManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class EventsManagerStatic;
|
||||
|
||||
public:
|
||||
static EventsManager *instance();
|
||||
|
||||
~EventsManager() override;
|
||||
|
||||
QSharedPointer<EventHandler> eventHandler();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(EventsManager)
|
||||
|
||||
EventsManager();
|
||||
|
||||
void loadPlugins();
|
||||
|
||||
QMap<QString, EventsPlugin *> m_plugins;
|
||||
QList<QWeakPointer<EventHandler> > m_eventHandlers;
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2016 Oleg Chernovskiy <kanedias@xaker.ru>
|
||||
|
||||
This program 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 program 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 program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "eventsplugin.h"
|
||||
|
||||
#include "events.h"
|
||||
|
||||
EventsPlugin::EventsPlugin(QObject *parent, const QVariantList &)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
EventsPlugin::~EventsPlugin()
|
||||
{
|
||||
}
|
||||
@@ -9,8 +9,9 @@
|
||||
|
||||
#include "framebuffer.h"
|
||||
|
||||
#include <config-krfb.h>
|
||||
#include <QCursor>
|
||||
#include "config-krfb.h"
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
|
||||
FrameBuffer::FrameBuffer(WId id, QObject *parent)
|
||||
@@ -49,12 +50,6 @@ void FrameBuffer::getServerFormat(rfbPixelFormat &)
|
||||
{
|
||||
}
|
||||
|
||||
QVariant FrameBuffer::customProperty(const QString &property) const
|
||||
{
|
||||
Q_UNUSED(property)
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
int FrameBuffer::depth()
|
||||
{
|
||||
return 32;
|
||||
@@ -73,7 +68,6 @@ void FrameBuffer::stopMonitor()
|
||||
{
|
||||
}
|
||||
|
||||
QPoint FrameBuffer::cursorPosition()
|
||||
{
|
||||
return QCursor::pos();
|
||||
}
|
||||
|
||||
#include "framebuffer.moc"
|
||||
|
||||
|
||||
@@ -12,26 +12,25 @@
|
||||
|
||||
#include "rfb.h"
|
||||
|
||||
#include "krfbprivate_export.h"
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QRect>
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
#include <QWidget>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QRect>
|
||||
#include <QtCore/QList>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBuffer;
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class KRFBPRIVATE_EXPORT FrameBuffer : public QObject
|
||||
class KDE_EXPORT FrameBuffer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FrameBuffer(WId id, QObject *parent = nullptr);
|
||||
explicit FrameBuffer(WId id, QObject *parent = 0);
|
||||
|
||||
~FrameBuffer() override;
|
||||
virtual ~FrameBuffer();
|
||||
|
||||
char *data();
|
||||
|
||||
@@ -42,18 +41,12 @@ public:
|
||||
virtual int depth();
|
||||
virtual void startMonitor();
|
||||
virtual void stopMonitor();
|
||||
virtual QPoint cursorPosition();
|
||||
|
||||
virtual void getServerFormat(rfbPixelFormat &format);
|
||||
|
||||
virtual QVariant customProperty(const QString &property) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void frameBufferChanged();
|
||||
|
||||
protected:
|
||||
WId win;
|
||||
char *fb = nullptr;
|
||||
char *fb;
|
||||
QList<QRect> tiles;
|
||||
|
||||
private:
|
||||
|
||||
@@ -22,15 +22,12 @@
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "krfbdebug.h"
|
||||
|
||||
#include <QGlobalStatic>
|
||||
#include <KDebug>
|
||||
#include <KGlobal>
|
||||
#include <KServiceTypeTrader>
|
||||
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KPluginMetaData>
|
||||
|
||||
#include <QSharedPointer>
|
||||
#include <QtCore/QSharedPointer>
|
||||
|
||||
class FrameBufferManagerStatic
|
||||
{
|
||||
@@ -38,74 +35,71 @@ public:
|
||||
FrameBufferManager instance;
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(FrameBufferManagerStatic, frameBufferManagerStatic)
|
||||
K_GLOBAL_STATIC(FrameBufferManagerStatic, frameBufferManagerStatic)
|
||||
|
||||
FrameBufferManager::FrameBufferManager()
|
||||
{
|
||||
//qDebug();
|
||||
kDebug();
|
||||
|
||||
loadPlugins();
|
||||
}
|
||||
|
||||
FrameBufferManager::~FrameBufferManager()
|
||||
{
|
||||
//qDebug();
|
||||
kDebug();
|
||||
}
|
||||
|
||||
FrameBufferManager *FrameBufferManager::instance()
|
||||
{
|
||||
//qDebug();
|
||||
kDebug();
|
||||
|
||||
return &frameBufferManagerStatic->instance;
|
||||
}
|
||||
|
||||
void FrameBufferManager::loadPlugins()
|
||||
{
|
||||
//qDebug();
|
||||
kDebug();
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
|
||||
// Load the all the plugin factories here, for use later.
|
||||
KService::List offers = KServiceTypeTrader::self()->query("krfb/framebuffer");
|
||||
|
||||
QVectorIterator<KPluginMetaData> i(plugins);
|
||||
i.toBack();
|
||||
QSet<QString> unique;
|
||||
while (i.hasPrevious()) {
|
||||
const KPluginMetaData &data = i.previous();
|
||||
// only load plugins once, even if found multiple times!
|
||||
if (unique.contains(data.name()))
|
||||
continue;
|
||||
KPluginFactory *factory = KPluginLoader(data.fileName()).factory();
|
||||
KService::List::const_iterator iter;
|
||||
|
||||
for (iter = offers.constBegin(); iter < offers.constEnd(); ++iter) {
|
||||
QString error;
|
||||
KService::Ptr service = *iter;
|
||||
|
||||
KPluginFactory *factory = KPluginLoader(service->library()).factory();
|
||||
|
||||
if (!factory) {
|
||||
qCDebug(KRFB) << "KPluginFactory could not load the plugin:" << data.fileName();
|
||||
kWarning() << "KPluginFactory could not load the plugin:" << service->library();
|
||||
continue;
|
||||
} else {
|
||||
qCDebug(KRFB) << "found plugin at " << data.fileName();
|
||||
}
|
||||
|
||||
auto plugin = factory->create<FrameBufferPlugin>(this);
|
||||
FrameBufferPlugin *plugin = factory->create<FrameBufferPlugin>(this);
|
||||
|
||||
if (plugin) {
|
||||
m_plugins.insert(data.pluginId(), plugin);
|
||||
qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId();
|
||||
kDebug() << "Loaded plugin:" << service->name();
|
||||
m_plugins.insert(service->library(), plugin);
|
||||
} else {
|
||||
qCDebug(KRFB) << "unable to load plugin for " << data.fileName();
|
||||
kDebug() << error;
|
||||
}
|
||||
unique.insert (data.name());
|
||||
}
|
||||
}
|
||||
|
||||
QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id, const QVariantMap &args)
|
||||
QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
|
||||
{
|
||||
//qDebug();
|
||||
kDebug();
|
||||
|
||||
// See if there is still an existing framebuffer to this WId.
|
||||
if (m_frameBuffers.contains(id)) {
|
||||
QWeakPointer<FrameBuffer> weakFrameBuffer = m_frameBuffers.value(id);
|
||||
|
||||
if (weakFrameBuffer) {
|
||||
//qDebug() << "Found cached frame buffer.";
|
||||
kDebug() << "Found cached frame buffer.";
|
||||
return weakFrameBuffer.toStrongRef();
|
||||
} else {
|
||||
//qDebug() << "Found deleted cached frame buffer. Don't use.";
|
||||
kDebug() << "Found deleted cached frame buffer. Don't use.";
|
||||
m_frameBuffers.remove(id);
|
||||
}
|
||||
}
|
||||
@@ -116,9 +110,9 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id, const QVaria
|
||||
while (iter != m_plugins.constEnd()) {
|
||||
|
||||
if (iter.key() == KrfbConfig::preferredFrameBufferPlugin()) {
|
||||
qCDebug(KRFB) << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
|
||||
kDebug() << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
|
||||
|
||||
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id, args));
|
||||
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id));
|
||||
|
||||
if (frameBuffer) {
|
||||
m_frameBuffers.insert(id, frameBuffer.toWeakRef());
|
||||
@@ -131,6 +125,10 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id, const QVaria
|
||||
}
|
||||
|
||||
// No valid framebuffer plugin found.
|
||||
qCDebug(KRFB) << "No valid framebuffer found. returning null.";
|
||||
kDebug() << "No valid framebuffer found. returning null.";
|
||||
return QSharedPointer<FrameBuffer>();
|
||||
}
|
||||
|
||||
|
||||
#include "framebuffermanager.moc"
|
||||
|
||||
|
||||
@@ -23,19 +23,19 @@
|
||||
|
||||
#include "framebuffer.h"
|
||||
|
||||
#include "krfbprivate_export.h"
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
#include <QWeakPointer>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QWeakPointer>
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBufferPlugin;
|
||||
class KPluginFactory;
|
||||
|
||||
class KRFBPRIVATE_EXPORT FrameBufferManager : public QObject
|
||||
class KDE_EXPORT FrameBufferManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class FrameBufferManagerStatic;
|
||||
@@ -43,9 +43,9 @@ class KRFBPRIVATE_EXPORT FrameBufferManager : public QObject
|
||||
public:
|
||||
static FrameBufferManager *instance();
|
||||
|
||||
~FrameBufferManager() override;
|
||||
virtual ~FrameBufferManager();
|
||||
|
||||
QSharedPointer<FrameBuffer> frameBuffer(WId id, const QVariantMap &args);
|
||||
QSharedPointer<FrameBuffer> frameBuffer(WId id);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(FrameBufferManager)
|
||||
|
||||
@@ -30,3 +30,7 @@ FrameBufferPlugin::FrameBufferPlugin(QObject *parent, const QVariantList &)
|
||||
FrameBufferPlugin::~FrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#include "framebufferplugin.moc"
|
||||
|
||||
|
||||
@@ -21,24 +21,25 @@
|
||||
#ifndef LIB_KRFB_FRAMEBUFFERPLUGIN_H
|
||||
#define LIB_KRFB_FRAMEBUFFERPLUGIN_H
|
||||
|
||||
#include "krfbprivate_export.h"
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QVariantList>
|
||||
#include <QWidget>
|
||||
#include <QtCore/QVariantList>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBuffer;
|
||||
|
||||
class KRFBPRIVATE_EXPORT FrameBufferPlugin : public QObject
|
||||
class KDE_EXPORT FrameBufferPlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
~FrameBufferPlugin() override;
|
||||
FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~FrameBufferPlugin();
|
||||
|
||||
virtual FrameBuffer *frameBuffer(WId id, const QVariantMap &args) = 0;
|
||||
virtual FrameBuffer *frameBuffer(WId id) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
|
||||
@@ -24,14 +24,10 @@
|
||||
#include "krfbconfig.h"
|
||||
#include "sockethelpers.h"
|
||||
#include "connectiondialog.h"
|
||||
#include "krfbdebug.h"
|
||||
|
||||
#include <KNotification>
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <QSocketNotifier>
|
||||
#include <KLocale>
|
||||
#include <QtCore/QSocketNotifier>
|
||||
#include <poll.h>
|
||||
#include <KConfigGroup>
|
||||
|
||||
struct PendingInvitationsRfbClient::Private
|
||||
{
|
||||
@@ -41,7 +37,7 @@ struct PendingInvitationsRfbClient::Private
|
||||
{}
|
||||
|
||||
rfbClientPtr client;
|
||||
QSocketNotifier *notifier = nullptr;
|
||||
QSocketNotifier *notifier;
|
||||
bool askOnConnect;
|
||||
};
|
||||
|
||||
@@ -52,6 +48,10 @@ PendingInvitationsRfbClient::PendingInvitationsRfbClient(rfbClientPtr client, QO
|
||||
d(new Private(client))
|
||||
{
|
||||
d->client->clientGoneHook = clientGoneHookNoop;
|
||||
d->notifier = new QSocketNotifier(client->sock, QSocketNotifier::Read, this);
|
||||
d->notifier->setEnabled(true);
|
||||
connect(d->notifier, SIGNAL(activated(int)),
|
||||
this, SLOT(onSocketActivated()));
|
||||
}
|
||||
|
||||
PendingInvitationsRfbClient::~PendingInvitationsRfbClient()
|
||||
@@ -61,34 +61,68 @@ PendingInvitationsRfbClient::~PendingInvitationsRfbClient()
|
||||
|
||||
void PendingInvitationsRfbClient::processNewClient()
|
||||
{
|
||||
QString host = peerAddress(m_rfbClient->sock) + QLatin1Char(':') + QString::number(peerPort(m_rfbClient->sock));
|
||||
QString host = peerAddress(m_rfbClient->sock) + ":" + QString::number(peerPort(m_rfbClient->sock));
|
||||
|
||||
if (d->askOnConnect == false) {
|
||||
|
||||
KNotification::event(QStringLiteral("NewConnectionAutoAccepted"),
|
||||
KNotification::event("NewConnectionAutoAccepted",
|
||||
i18n("Accepted connection from %1", host));
|
||||
accept(new InvitationsRfbClient(m_rfbClient, parent()));
|
||||
|
||||
} else {
|
||||
|
||||
KNotification::event(QStringLiteral("NewConnectionOnHold"),
|
||||
KNotification::event("NewConnectionOnHold",
|
||||
i18n("Received connection from %1, on hold (waiting for confirmation)",
|
||||
host));
|
||||
|
||||
auto dialog = new InvitationsConnectionDialog(nullptr);
|
||||
InvitationsConnectionDialog *dialog = new InvitationsConnectionDialog(0);
|
||||
dialog->setRemoteHost(host);
|
||||
dialog->setAllowRemoteControl(KrfbConfig::allowDesktopControl());
|
||||
|
||||
connect(dialog, &InvitationsConnectionDialog::accepted, this, &PendingInvitationsRfbClient::dialogAccepted);
|
||||
connect(dialog, &InvitationsConnectionDialog::rejected, this, &PendingInvitationsRfbClient::reject);
|
||||
connect(dialog, SIGNAL(okClicked()), SLOT(dialogAccepted()));
|
||||
connect(dialog, SIGNAL(cancelClicked()), SLOT(reject()));
|
||||
|
||||
dialog->show();
|
||||
}
|
||||
}
|
||||
|
||||
void PendingInvitationsRfbClient::onSocketActivated()
|
||||
{
|
||||
//Process not only one, but all pending messages.
|
||||
//poll() idea/code copied from vino:
|
||||
// Copyright (C) 2003 Sun Microsystems, Inc.
|
||||
// License: GPL v2 or later
|
||||
struct pollfd pollfd = { d->client->sock, POLLIN|POLLPRI, 0 };
|
||||
|
||||
while(poll(&pollfd, 1, 0) == 1) {
|
||||
|
||||
if(d->client->state == rfbClientRec::RFB_INITIALISATION) {
|
||||
d->notifier->setEnabled(false);
|
||||
//Client is Authenticated
|
||||
processNewClient();
|
||||
break;
|
||||
}
|
||||
rfbProcessClientMessage(d->client);
|
||||
|
||||
//This is how we handle disconnection.
|
||||
//if rfbProcessClientMessage() finds out that it can't read the socket,
|
||||
//it closes it and sets it to -1. So, we just have to check this here
|
||||
//and call rfbClientConnectionGone() if necessary. This will call
|
||||
//the clientGoneHook which in turn will remove this RfbClient instance
|
||||
//from the server manager and will call deleteLater() to delete it
|
||||
if (d->client->sock == -1) {
|
||||
kDebug() << "disconnected from socket signal";
|
||||
d->notifier->setEnabled(false);
|
||||
rfbClientConnectionGone(d->client);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool PendingInvitationsRfbClient::checkPassword(const QByteArray & encryptedPassword)
|
||||
{
|
||||
qCDebug(KRFB) << "about to start authentication";
|
||||
QByteArray password ;
|
||||
kDebug() << "about to start autentication";
|
||||
|
||||
if(InvitationsRfbServer::instance->allowUnattendedAccess() && vncAuthCheckPassword(
|
||||
InvitationsRfbServer::instance->unattendedPassword().toLocal8Bit(),
|
||||
@@ -104,10 +138,12 @@ bool PendingInvitationsRfbClient::checkPassword(const QByteArray & encryptedPass
|
||||
|
||||
void PendingInvitationsRfbClient::dialogAccepted()
|
||||
{
|
||||
auto dialog = qobject_cast<InvitationsConnectionDialog *>(sender());
|
||||
InvitationsConnectionDialog *dialog = qobject_cast<InvitationsConnectionDialog *>(sender());
|
||||
Q_ASSERT(dialog);
|
||||
|
||||
auto client = new InvitationsRfbClient(m_rfbClient, parent());
|
||||
InvitationsRfbClient *client = new InvitationsRfbClient(m_rfbClient, parent());
|
||||
client->setControlEnabled(dialog->allowRemoteControl());
|
||||
accept(client);
|
||||
}
|
||||
|
||||
#include "invitationsrfbclient.moc"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
class InvitationsRfbClient : public RfbClient
|
||||
{
|
||||
public:
|
||||
explicit InvitationsRfbClient(rfbClientPtr client, QObject* parent = nullptr)
|
||||
InvitationsRfbClient(rfbClientPtr client, QObject* parent = 0)
|
||||
: RfbClient(client, parent) {}
|
||||
};
|
||||
|
||||
@@ -32,12 +32,13 @@ class PendingInvitationsRfbClient : public PendingRfbClient
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent = nullptr);
|
||||
~PendingInvitationsRfbClient() override;
|
||||
PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent = 0);
|
||||
virtual ~PendingInvitationsRfbClient();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void processNewClient() override;
|
||||
bool checkPassword(const QByteArray & encryptedPassword) override;
|
||||
virtual void processNewClient();
|
||||
virtual void onSocketActivated();
|
||||
virtual bool checkPassword(const QByteArray & encryptedPassword);
|
||||
|
||||
private Q_SLOTS:
|
||||
void dialogAccepted();
|
||||
|
||||
@@ -21,29 +21,20 @@
|
||||
#include "invitationsrfbserver.h"
|
||||
#include "invitationsrfbclient.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "krfbdebug.h"
|
||||
#include <QTimer>
|
||||
#include <QApplication>
|
||||
#include <QHostInfo>
|
||||
#include <QRandomGenerator>
|
||||
|
||||
#include <KLocalizedString>
|
||||
#include "rfbservermanager.h"
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtNetwork/QHostInfo>
|
||||
#include <KNotification>
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KUser>
|
||||
#include <KRandom>
|
||||
#include <KStringHandler>
|
||||
#include <KWallet/KWallet>
|
||||
|
||||
#include <kdnssd_version.h>
|
||||
#if KDNSSD_VERSION >= QT_VERSION_CHECK(5, 84, 0)
|
||||
#include <KDNSSD/PublicService>
|
||||
#else
|
||||
#include <KWallet/Wallet>
|
||||
#include <DNSSD/PublicService>
|
||||
#endif
|
||||
|
||||
using KWallet::Wallet;
|
||||
|
||||
// used for KWallet folder name
|
||||
static const QString s_krfbFolderName(QStringLiteral("krfb"));
|
||||
|
||||
//static
|
||||
InvitationsRfbServer *InvitationsRfbServer::instance;
|
||||
|
||||
@@ -51,21 +42,21 @@ InvitationsRfbServer *InvitationsRfbServer::instance;
|
||||
void InvitationsRfbServer::init()
|
||||
{
|
||||
instance = new InvitationsRfbServer;
|
||||
instance->m_publicService = new KDNSSD::PublicService(
|
||||
instance->m_publicService = new DNSSD::PublicService(
|
||||
i18n("%1@%2 (shared desktop)",
|
||||
KUser().loginName(),
|
||||
QHostInfo::localHostName()),
|
||||
QStringLiteral("_rfb._tcp"),
|
||||
"_rfb._tcp",
|
||||
KrfbConfig::port());
|
||||
instance->setListeningAddress("0.0.0.0");
|
||||
instance->setListeningPort(KrfbConfig::port());
|
||||
instance->setPasswordRequired(true);
|
||||
|
||||
instance->m_wallet = nullptr;
|
||||
if (KrfbConfig::noWallet()) {
|
||||
instance->walletOpened(false);
|
||||
} else {
|
||||
instance->openKWallet();
|
||||
instance->m_wallet = Wallet::openWallet(
|
||||
Wallet::NetworkWallet(), 0, Wallet::Asynchronous);
|
||||
if(instance->m_wallet) {
|
||||
connect(instance->m_wallet, SIGNAL(walletOpened(bool)),
|
||||
instance, SLOT(walletOpened(bool)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +68,6 @@ const QString& InvitationsRfbServer::desktopPassword() const
|
||||
void InvitationsRfbServer::setDesktopPassword(const QString& password)
|
||||
{
|
||||
m_desktopPassword = password;
|
||||
// this is called from GUI every time desktop password is edited.
|
||||
// make sure we save settings immediately each time
|
||||
saveSecuritySettings();
|
||||
}
|
||||
|
||||
const QString& InvitationsRfbServer::unattendedPassword() const
|
||||
@@ -90,9 +78,6 @@ const QString& InvitationsRfbServer::unattendedPassword() const
|
||||
void InvitationsRfbServer::setUnattendedPassword(const QString& password)
|
||||
{
|
||||
m_unattendedPassword = password;
|
||||
// this is called from GUI every time unattended password is edited.
|
||||
// make sure we save settings immediately each time
|
||||
saveSecuritySettings();
|
||||
}
|
||||
|
||||
bool InvitationsRfbServer::allowUnattendedAccess() const
|
||||
@@ -110,38 +95,51 @@ bool InvitationsRfbServer::start()
|
||||
return false;
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::stop()
|
||||
void InvitationsRfbServer::stop(bool disconnectClients)
|
||||
{
|
||||
if(m_publicService->isPublished())
|
||||
m_publicService->stop();
|
||||
RfbServer::stop();
|
||||
RfbServer::stop(disconnectClients);
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
|
||||
{
|
||||
m_allowUnattendedAccess = allow;
|
||||
// this is called from GUI every time unattended access is toggled.
|
||||
// make sure we save settings immediately each time
|
||||
saveSecuritySettings();
|
||||
}
|
||||
|
||||
InvitationsRfbServer::InvitationsRfbServer()
|
||||
{
|
||||
m_desktopPassword = readableRandomString(4) + QLatin1Char('-') + readableRandomString(3);
|
||||
m_unattendedPassword = readableRandomString(4) + QLatin1Char('-') + readableRandomString(3);
|
||||
KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
|
||||
m_desktopPassword = readableRandomString(4)+"-"+readableRandomString(3);
|
||||
m_unattendedPassword = readableRandomString(4)+"-"+readableRandomString(3);
|
||||
KSharedConfigPtr config = KGlobal::config();
|
||||
KConfigGroup krfbConfig(config,"Security");
|
||||
m_allowUnattendedAccess = krfbConfig.readEntry(
|
||||
"allowUnattendedAccess", QVariant(false)).toBool();
|
||||
}
|
||||
|
||||
InvitationsRfbServer::~InvitationsRfbServer()
|
||||
{
|
||||
InvitationsRfbServer::stop(); // calling virtual funcs in destructor is bad
|
||||
saveSecuritySettings();
|
||||
// ^^ also saves passwords in kwallet,
|
||||
// do it before closing kwallet
|
||||
if (!KrfbConfig::noWallet() && m_wallet) {
|
||||
closeKWallet();
|
||||
stop();
|
||||
KSharedConfigPtr config = KGlobal::config();
|
||||
KConfigGroup krfbConfig(config,"Security");
|
||||
krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);
|
||||
if(m_wallet && m_wallet->isOpen()) {
|
||||
|
||||
if( (m_wallet->currentFolder()=="krfb") ||
|
||||
((m_wallet->hasFolder("krfb") || m_wallet->createFolder("krfb")) &&
|
||||
m_wallet->setFolder("krfb")) ) {
|
||||
|
||||
m_wallet->writePassword("desktopSharingPassword",m_desktopPassword);
|
||||
m_wallet->writePassword("unattendedAccessPassword",m_unattendedPassword);
|
||||
}
|
||||
|
||||
} else {
|
||||
krfbConfig.writeEntry("desktopPassword",
|
||||
KStringHandler::obscure(m_desktopPassword));
|
||||
krfbConfig.writeEntry("unattendedPassword",
|
||||
KStringHandler::obscure(m_unattendedPassword));
|
||||
krfbConfig.writeEntry("allowUnattendedAccess",
|
||||
m_allowUnattendedAccess);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,51 +148,37 @@ PendingRfbClient* InvitationsRfbServer::newClient(rfbClientPtr client)
|
||||
return new PendingInvitationsRfbClient(client, this);
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::openKWallet()
|
||||
{
|
||||
m_wallet = Wallet::openWallet(Wallet::NetworkWallet(), 0, Wallet::Asynchronous);
|
||||
if (m_wallet) {
|
||||
connect(instance->m_wallet, &KWallet::Wallet::walletOpened,
|
||||
this, &InvitationsRfbServer::walletOpened);
|
||||
}
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::closeKWallet()
|
||||
{
|
||||
if (m_wallet && m_wallet->isOpen()) {
|
||||
delete m_wallet; // closes the wallet
|
||||
m_wallet = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::walletOpened(bool opened)
|
||||
{
|
||||
QString desktopPassword;
|
||||
QString unattendedPassword;
|
||||
Q_ASSERT(m_wallet);
|
||||
if( opened &&
|
||||
( m_wallet->hasFolder("krfb") || m_wallet->createFolder("krfb") ) &&
|
||||
m_wallet->setFolder("krfb") ) {
|
||||
|
||||
if (opened && m_wallet->hasFolder(s_krfbFolderName) && m_wallet->setFolder(s_krfbFolderName) ) {
|
||||
if (m_wallet->readPassword(QStringLiteral("desktopSharingPassword"), desktopPassword) == 0 &&
|
||||
if(m_wallet->readPassword("desktopSharingPassword", desktopPassword)==0 &&
|
||||
!desktopPassword.isEmpty()) {
|
||||
m_desktopPassword = desktopPassword;
|
||||
Q_EMIT passwordChanged(m_desktopPassword);
|
||||
emit passwordChanged(m_desktopPassword);
|
||||
}
|
||||
|
||||
if(m_wallet->readPassword(QStringLiteral("unattendedAccessPassword"), unattendedPassword) == 0 &&
|
||||
if(m_wallet->readPassword("unattendedAccessPassword", unattendedPassword)==0 &&
|
||||
!unattendedPassword.isEmpty()) {
|
||||
m_unattendedPassword = unattendedPassword;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
qCDebug(KRFB) << "Could not open KWallet, Falling back to config file";
|
||||
KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
|
||||
kDebug() << "Could not open KWallet, Falling back to config file";
|
||||
KSharedConfigPtr config = KGlobal::config();
|
||||
KConfigGroup krfbConfig(config,"Security");
|
||||
|
||||
desktopPassword = KStringHandler::obscure(krfbConfig.readEntry(
|
||||
"desktopPassword", QString()));
|
||||
if(!desktopPassword.isEmpty()) {
|
||||
m_desktopPassword = desktopPassword;
|
||||
Q_EMIT passwordChanged(m_desktopPassword);
|
||||
emit passwordChanged(m_desktopPassword);
|
||||
}
|
||||
|
||||
unattendedPassword = KStringHandler::obscure(krfbConfig.readEntry(
|
||||
@@ -212,7 +196,7 @@ QString InvitationsRfbServer::readableRandomString(int length)
|
||||
{
|
||||
QString str;
|
||||
while (length) {
|
||||
int r = QRandomGenerator::global()->bounded(62);
|
||||
int r = KRandom::random() % 62;
|
||||
r += 48;
|
||||
if (r > 57) {
|
||||
r += 7;
|
||||
@@ -230,36 +214,10 @@ QString InvitationsRfbServer::readableRandomString(int length)
|
||||
(c == '0')) {
|
||||
continue;
|
||||
}
|
||||
str += QLatin1Char(c);
|
||||
str += c;
|
||||
length--;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// one place to deal with all security configuration
|
||||
void InvitationsRfbServer::saveSecuritySettings()
|
||||
{
|
||||
KConfigGroup secConfigGroup(KSharedConfig::openConfig(), "Security");
|
||||
secConfigGroup.writeEntry("allowUnattendedAccess", m_allowUnattendedAccess);
|
||||
if (KrfbConfig::noWallet()) {
|
||||
// save passwords in config file only if not using kwallet integration
|
||||
secConfigGroup.writeEntry("desktopPassword", KStringHandler::obscure(m_desktopPassword));
|
||||
secConfigGroup.writeEntry("unattendedPassword", KStringHandler::obscure(m_unattendedPassword));
|
||||
} else {
|
||||
// using KWallet, erase possibly stored passwords from krfbrc file
|
||||
secConfigGroup.deleteEntry("desktopPassword");
|
||||
secConfigGroup.deleteEntry("unattendedPassword");
|
||||
// update passwords in kwallet
|
||||
if (m_wallet && m_wallet->isOpen()) {
|
||||
if (!m_wallet->hasFolder(s_krfbFolderName)) {
|
||||
m_wallet->createFolder(s_krfbFolderName);
|
||||
}
|
||||
if (m_wallet->currentFolder() != s_krfbFolderName) {
|
||||
m_wallet->setFolder(s_krfbFolderName);
|
||||
}
|
||||
m_wallet->writePassword(QStringLiteral("desktopSharingPassword"), m_desktopPassword);
|
||||
m_wallet->writePassword(QStringLiteral("unattendedAccessPassword"), m_unattendedPassword);
|
||||
}
|
||||
}
|
||||
KrfbConfig::self()->save();
|
||||
}
|
||||
#include "invitationsrfbserver.moc"
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace KWallet {
|
||||
class Wallet;
|
||||
}
|
||||
|
||||
namespace KDNSSD {
|
||||
namespace DNSSD {
|
||||
class PublicService;
|
||||
}
|
||||
|
||||
@@ -47,27 +47,24 @@ Q_SIGNALS:
|
||||
void passwordChanged(const QString&);
|
||||
|
||||
public Q_SLOTS:
|
||||
bool start() override;
|
||||
void stop() override;
|
||||
void toggleUnattendedAccess(bool allow);
|
||||
void openKWallet();
|
||||
void closeKWallet();
|
||||
void saveSecuritySettings();
|
||||
bool start();
|
||||
void stop(bool disconnectClients=true);
|
||||
void toggleUnattendedAccess(bool allow=true);
|
||||
|
||||
protected:
|
||||
InvitationsRfbServer();
|
||||
~InvitationsRfbServer() override;
|
||||
PendingRfbClient* newClient(rfbClientPtr client) override;
|
||||
virtual ~InvitationsRfbServer();
|
||||
virtual PendingRfbClient* newClient(rfbClientPtr client);
|
||||
|
||||
private Q_SLOTS:
|
||||
void walletOpened(bool);
|
||||
|
||||
private:
|
||||
KDNSSD::PublicService *m_publicService = nullptr;
|
||||
DNSSD::PublicService *m_publicService;
|
||||
bool m_allowUnattendedAccess;
|
||||
QString m_desktopPassword;
|
||||
QString m_unattendedPassword;
|
||||
KWallet::Wallet *m_wallet = nullptr;
|
||||
KWallet::Wallet *m_wallet;
|
||||
|
||||
QString readableRandomString(int);
|
||||
Q_DISABLE_COPY(InvitationsRfbServer)
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=ServiceType
|
||||
X-KDE-ServiceType=krfb/events
|
||||
|
||||
Comment=Event plugins for KRfb
|
||||
Comment[ca]=Connectors d'esdeveniments per al KRfb
|
||||
Comment[ca@valencia]=Connectors d'esdeveniments per al KRfb
|
||||
Comment[cs]=Moduly událostí pro KRfb
|
||||
Comment[da]=Hændelses-plugins til KRfb
|
||||
Comment[de]=Ereignis-Module für KRfb
|
||||
Comment[el]=Πρόσθετα γεγονότων για το KRfb
|
||||
Comment[en_GB]=Event plugins for KRfb
|
||||
Comment[es]=Complementos de eventos para KRfb
|
||||
Comment[et]=KRfb sündmuste pluginad
|
||||
Comment[eu]=KRfb-rako gertaeren pluginak
|
||||
Comment[fi]=KRfb:n tapahtumaliitännäinen
|
||||
Comment[fr]=Modules externes d'évènements pour Krfb
|
||||
Comment[gl]=Complementos de eventos para KRfb
|
||||
Comment[ia]=Plug-ins de evento per KRfb
|
||||
Comment[it]=Estensioni degli eventi per KRfb
|
||||
Comment[ko]=KRfb 이벤트 플러그인
|
||||
Comment[nl]=Plug-ins voor gebeurtenis voor KRfb
|
||||
Comment[nn]=Hendingstillegg for KRfb
|
||||
Comment[pl]=Wtyczki wydarzeń dla KRfb
|
||||
Comment[pt]='Plugins' de eventos para o KRfb
|
||||
Comment[pt_BR]=Plugins de evento para o KRfb
|
||||
Comment[sk]=Doplnky udalostí pre KRfb
|
||||
Comment[sl]=Vstavki dogodkov za KRFB
|
||||
Comment[sv]=Händelseinsticksprogram för Krfb
|
||||
Comment[uk]=Додатки обробки подій для KRfb
|
||||
Comment[x-test]=xxEvent plugins for KRfbxx
|
||||
Comment[zh_CN]=KRfb 事件插件
|
||||
Comment[zh_TW]=KRfb 的事件外掛程式
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"KPlugin": {
|
||||
"Description": "Events plugins for KRfb",
|
||||
"Description[ca@valencia]": "Connectors d'esdeveniments per al KRfb",
|
||||
"Description[ca]": "Connectors d'esdeveniments per al KRfb",
|
||||
"Description[cs]": "Moduly událostí pro KRfb",
|
||||
"Description[da]": "Hændelses-plugins til KRfb",
|
||||
"Description[de]": "Ereignis-Module für KRfb",
|
||||
"Description[el]": "Πρόσθετα γεγονότων για το KRfb",
|
||||
"Description[en_GB]": "Events plugins for KRfb",
|
||||
"Description[es]": "Complementos de eventos para KRfb",
|
||||
"Description[et]": "KRfb sündmuste pluginad",
|
||||
"Description[eu]": "KRfb-rako gertaeren pluginak",
|
||||
"Description[fi]": "KRfb:n tapahtumaliitännäinen",
|
||||
"Description[fr]": "Modules externes d'évènements pour KRfb",
|
||||
"Description[gl]": "Complementos de eventos para KRfb",
|
||||
"Description[ia]": "Plug-ins de eventos per KRfb",
|
||||
"Description[it]": "Estensioni degli eventi per KRfb",
|
||||
"Description[ko]": "KRfb 이벤트 플러그인",
|
||||
"Description[nl]": "Plug-ins voor gebeurtenis voor KRfb",
|
||||
"Description[nn]": "Hendingstillegg for KRfb",
|
||||
"Description[pl]": "Wtyczki wydarzeń dla KRfb",
|
||||
"Description[pt]": "'Plugins' de eventos para o KRfb",
|
||||
"Description[pt_BR]": "Plugins de evento para o KRfb",
|
||||
"Description[sk]": "Doplnky udalostí pre KRfb",
|
||||
"Description[sl]": "Vtičniki za dogodke za KRfb",
|
||||
"Description[sv]": "Händelseinsticksprogram för Krfb",
|
||||
"Description[uk]": "Додатки обробки подій для KRfb",
|
||||
"Description[x-test]": "xxEvents plugins for KRfbxx",
|
||||
"Description[zh_CN]": "KRfb 事件插件",
|
||||
"Description[zh_TW]": "KRfb 的事件外掛程式"
|
||||
},
|
||||
"X-KDE-ServiceType": "krfb/events"
|
||||
}
|
||||
@@ -3,10 +3,11 @@ Type=ServiceType
|
||||
X-KDE-ServiceType=krfb/framebuffer
|
||||
|
||||
Comment=Frame Buffer plugins for KRfb
|
||||
Comment[ast]=Complementu de buffer pa KRfb
|
||||
Comment[bg]=Приставки за фреймбуфер за KRfb
|
||||
Comment[bs]=Priključci framebafera za KRfb
|
||||
Comment[ca]=Connectors de «framebuffer» per al KRfb
|
||||
Comment[ca@valencia]=Connectors de «framebuffer» per al KRfb
|
||||
Comment[ca]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[ca@valencia]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[cs]=Moduly Frame bufferu pro KRfb
|
||||
Comment[da]=Framebuffer-plugins til KRfb
|
||||
Comment[de]=Framebuffer-Module für KRfb
|
||||
@@ -18,17 +19,16 @@ Comment[eu]=Irteerako bideoaren pluginak KRfb-rentzako
|
||||
Comment[fi]=Kehyspuskuriliitännäinen kohteelle KRfb
|
||||
Comment[fr]=Modules externes de sortie vidéo pour Krfb
|
||||
Comment[ga]=Breiseáin Mhaoláin Fráma le haghaidh KRfb
|
||||
Comment[gl]=Complementos de búfer de fotograma para KRfb
|
||||
Comment[gl]=Engadido de frame buffer para KRfb
|
||||
Comment[hr]=Priključci za međuspremnike okvira za KRfb
|
||||
Comment[hu]=Framebuffer bővítmények a Krfb-hez
|
||||
Comment[ia]=Plug-ins de Frame Buffer per KRfb
|
||||
Comment[id]=Plugin Frame Buffer untuk KRfb
|
||||
Comment[it]=Estensioni del framebuffer per KRfb
|
||||
Comment[ja]=KRfb の フレームバッファプラグイン
|
||||
Comment[kk]=KRfb кадр буфер плагині
|
||||
Comment[km]=កម្មវិធីជំនួយ Frame Buffer សម្រាប់ KRfb
|
||||
Comment[ko]=KRfb 프레임버퍼 플러그인
|
||||
Comment[lt]=Frame Buffer papildiniai skirti KRfb
|
||||
Comment[lt]=Frame Buffer priedai skirti KRfb
|
||||
Comment[lv]=Kadru bufera sprudņi priekš KRfb
|
||||
Comment[nb]=Rammebuffer-programtillegg for KRfb
|
||||
Comment[nds]=Bildpuffer-Modulen för KRfb
|
||||
@@ -36,7 +36,7 @@ Comment[nl]=Framebuffer-plugins voor KRfb
|
||||
Comment[nn]=Framebuffer-tillegg KRfb
|
||||
Comment[pa]=KRfb ਲਈ ਫਰੇਮ ਬਫ਼ਰ ਪਲੱਗਇਨ
|
||||
Comment[pl]=Wtyczki buforów ramek dla KRfb
|
||||
Comment[pt]='Plugins' do 'Framebuffer' para o KRfb
|
||||
Comment[pt]='Plugins' de 'framebuffers' para o KRfb
|
||||
Comment[pt_BR]=Plugins de framebuffers para o KRfb
|
||||
Comment[ru]=Модуль буфера кадров для KRfb
|
||||
Comment[si]=KRfb සඳහා රාමු බෆර ප්ලගින
|
||||
@@ -51,5 +51,5 @@ Comment[th]=ส่วนเสริมของ KRfb สำหรับจั
|
||||
Comment[tr]=KRfb için Çerçeve Tamponu eklentileri
|
||||
Comment[uk]=Додатки буфера кадрів для KRfb
|
||||
Comment[x-test]=xxFrame Buffer plugins for KRfbxx
|
||||
Comment[zh_CN]=KRfb 的帧缓冲插件
|
||||
Comment[zh_CN]=KRfb 帧缓冲插件
|
||||
Comment[zh_TW]=KRfb 的 Frame Buffer 外掛程式
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"KPlugin": {
|
||||
"Description": "Frame Buffer plugins for KRfb",
|
||||
"Description[ca@valencia]": "Connectors de «Frame Buffer» per al KRfb",
|
||||
"Description[ca]": "Connectors de «Frame Buffer» per al KRfb",
|
||||
"Description[cs]": "Moduly Frame bufferu pro KRfb",
|
||||
"Description[da]": "Framebuffer-plugins til KRfb",
|
||||
"Description[de]": "Framebuffer-Module für KRfb",
|
||||
"Description[el]": "Πρόσθετα μνήμης ανανέωσης βίντεο καρέ για το KRfb",
|
||||
"Description[en_GB]": "Frame Buffer plugins for KRfb",
|
||||
"Description[es]": "Complementos de framebuffer para KRfb",
|
||||
"Description[et]": "KRfb kaadripuhvri pluginad",
|
||||
"Description[eu]": "KRfb-rako «Frame Buffer» pluginak",
|
||||
"Description[fi]": "KRfb:n kehyspuskuriliitännäinen",
|
||||
"Description[fr]": "Modules de tampons d'image pour KRfb",
|
||||
"Description[gl]": "Complemento de búfer de fotograma para KRfb",
|
||||
"Description[ia]": "Plug-ins de Frame Buffer per KRfb",
|
||||
"Description[id]": "Plugin Frame Buffer untuk KRfb",
|
||||
"Description[it]": "Estensioni del framebuffer per KRfb",
|
||||
"Description[ko]": "KRfb 프레임버퍼 플러그인",
|
||||
"Description[nl]": "Framebuffer-plugins voor KRfb",
|
||||
"Description[nn]": "Biletbuffer-tillegg KRfb",
|
||||
"Description[pl]": "Wtyczki buforów ramek dla KRfb",
|
||||
"Description[pt]": "'Plugins' do 'Framebuffer' para o KRfb",
|
||||
"Description[pt_BR]": "Plugins de framebuffers para o KRfb",
|
||||
"Description[ru]": "Модули буфера кадров для KRfb",
|
||||
"Description[sk]": "Frame Buffer modul pre KRfb",
|
||||
"Description[sl]": "Vtičniki vmesnika medpomnilnika za KRfb",
|
||||
"Description[sr@ijekavian]": "Прикључци кадробафера за КРФБ",
|
||||
"Description[sr@ijekavianlatin]": "Priključci kadrobafera za KRFB",
|
||||
"Description[sr@latin]": "Priključci kadrobafera za KRFB",
|
||||
"Description[sr]": "Прикључци кадробафера за КРФБ",
|
||||
"Description[sv]": "Insticksprogram med rambuffert för Krfb",
|
||||
"Description[tr]": "KRfb için Çerçeve Tamponu eklentileri",
|
||||
"Description[uk]": "Додатки буфера кадрів для KRfb",
|
||||
"Description[x-test]": "xxFrame Buffer plugins for KRfbxx",
|
||||
"Description[zh_CN]": "KRfb 的帧缓冲插件",
|
||||
"Description[zh_TW]": "KRfb 的 Frame Buffer 外掛程式"
|
||||
},
|
||||
"X-KDE-ServiceType": "krfb/framebuffer"
|
||||
}
|
||||
147
krfb/krfb.desktop
Executable file
@@ -0,0 +1,147 @@
|
||||
# KDE Config File
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=krfb -caption %c %i
|
||||
Icon=krfb
|
||||
X-DBUS-StartupType=Unique
|
||||
X-DocPath=krfb/index.html
|
||||
Terminal=false
|
||||
Name=Krfb
|
||||
Name[ar]=Krfb
|
||||
Name[ast]=Krfb
|
||||
Name[bg]=Krfb
|
||||
Name[bn]=কে-আর-এফ-বি
|
||||
Name[br]=Krfb
|
||||
Name[bs]=Krfb
|
||||
Name[ca]=Krfb
|
||||
Name[ca@valencia]=Krfb
|
||||
Name[cs]=Krfb
|
||||
Name[da]=Krfb
|
||||
Name[de]=Krfb
|
||||
Name[el]=Krfb
|
||||
Name[en_GB]=Krfb
|
||||
Name[eo]=Krfb
|
||||
Name[es]=Krfb
|
||||
Name[et]=Krfb
|
||||
Name[eu]=Krfb
|
||||
Name[fi]=Krfb
|
||||
Name[fr]=Krfb
|
||||
Name[ga]=Krfb
|
||||
Name[gl]=Krfb
|
||||
Name[he]=Krfb
|
||||
Name[hi]=केआरएफबी
|
||||
Name[hne]=केआरएफबी
|
||||
Name[hr]=Krfb
|
||||
Name[hu]=Krfb
|
||||
Name[ia]=Krfb
|
||||
Name[is]=Krfb
|
||||
Name[it]=Krfb
|
||||
Name[ja]=Krfb
|
||||
Name[kk]=Krfb
|
||||
Name[km]=Krfb
|
||||
Name[ko]=Krfb
|
||||
Name[lt]=Krfb
|
||||
Name[lv]=Krfb
|
||||
Name[ml]=കെആര്എഫ്ബി
|
||||
Name[mr]=के-आर-एफ-बी
|
||||
Name[nb]=Krfb
|
||||
Name[nds]=KRfb
|
||||
Name[ne]=Krfb
|
||||
Name[nl]=Krfb
|
||||
Name[nn]=Krfb
|
||||
Name[pa]=Krfb
|
||||
Name[pl]=Krfb
|
||||
Name[pt]=Krfb
|
||||
Name[pt_BR]=Krfb
|
||||
Name[ro]=Krfb
|
||||
Name[ru]=Krfb
|
||||
Name[si]=Krfb
|
||||
Name[sk]=Krfb
|
||||
Name[sl]=Krfb
|
||||
Name[sq]=Krfb
|
||||
Name[sr]=КРФБ
|
||||
Name[sr@ijekavian]=КРФБ
|
||||
Name[sr@ijekavianlatin]=KRFB
|
||||
Name[sr@latin]=KRFB
|
||||
Name[sv]=Krfb
|
||||
Name[tr]=Krfb
|
||||
Name[ug]=Krfb
|
||||
Name[uk]=Krfb
|
||||
Name[uz]=Krfb
|
||||
Name[uz@cyrillic]=Krfb
|
||||
Name[vi]=Krfb
|
||||
Name[x-test]=xxKrfbxx
|
||||
Name[zh_CN]=Krfb
|
||||
Name[zh_HK]=Krfb
|
||||
Name[zh_TW]=桌面分享_Krfb
|
||||
GenericName=Desktop Sharing
|
||||
GenericName[ar]=مشاركة سطح المكتب
|
||||
GenericName[ast]=Escritoriu compartíu
|
||||
GenericName[bg]=Споделяне на работния плот
|
||||
GenericName[bn]=ডেস্কটপ ভাগাভাগি
|
||||
GenericName[br]=Rannañ ar vurev
|
||||
GenericName[bs]=Dijeljenje radne površine
|
||||
GenericName[ca]=Compartició de l'escriptori
|
||||
GenericName[ca@valencia]=Compartició de l'escriptori
|
||||
GenericName[cs]=Sdílení pracovní plochy
|
||||
GenericName[cy]=Rhannu Penbwrdd
|
||||
GenericName[da]=Skrivebordsdeling
|
||||
GenericName[de]=Arbeitsfläche freigeben
|
||||
GenericName[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
GenericName[en_GB]=Desktop Sharing
|
||||
GenericName[eo]=Tabula komunigado
|
||||
GenericName[es]=Escritorio compartido
|
||||
GenericName[et]=Töölaua jagamine
|
||||
GenericName[eu]=Mahaigaina partekatzea
|
||||
GenericName[fa]=اشتراک رومیزی
|
||||
GenericName[fi]=Työpöydän jakaminen
|
||||
GenericName[fr]=Partage de bureaux
|
||||
GenericName[ga]=Roinnt Deisce
|
||||
GenericName[gl]=Compartimento de escritorio
|
||||
GenericName[he]=שיתוף שולחנות עבודה
|
||||
GenericName[hi]=डेस्कटॉप साझेदारी
|
||||
GenericName[hne]=डेस्कटाप साझेदारी
|
||||
GenericName[hr]=Dijeljenje radne površine
|
||||
GenericName[hu]=Munkaasztal-megosztás
|
||||
GenericName[ia]=Compartir de scriptorio
|
||||
GenericName[is]=Skjáborðsmiðlun
|
||||
GenericName[it]=Condivisione del desktop
|
||||
GenericName[ja]=デスクトップ共有
|
||||
GenericName[kk]=Үстелді ортақтастыру
|
||||
GenericName[km]=ការចែករំលែកផ្ទៃតុ
|
||||
GenericName[ko]=데스크톱 공유
|
||||
GenericName[lt]=Dalinimasis darbastaliu
|
||||
GenericName[lv]=Darbvirsmas koplietošana
|
||||
GenericName[ml]=പണിയിടം പങ്കുവെക്കല്
|
||||
GenericName[mr]=डेस्कटॉप शेअरींग
|
||||
GenericName[nb]=Delte skrivebord
|
||||
GenericName[nds]=Schriefdisch-Freegaav
|
||||
GenericName[ne]=डेस्कटप साझेदारी
|
||||
GenericName[nl]=Bureaublad delen
|
||||
GenericName[nn]=Skrivebordsdeling
|
||||
GenericName[pa]=ਡੈਸਕਟਾਪ ਸ਼ੇਅਰਿੰਗ
|
||||
GenericName[pl]=Współdzielenie pulpitu
|
||||
GenericName[pt]=Partilha do Ecrã
|
||||
GenericName[pt_BR]=Compartilhamento de ambiente de trabalho
|
||||
GenericName[ro]=Partajare birou
|
||||
GenericName[ru]=Общий рабочий стол
|
||||
GenericName[si]=වැඩතල හවුල්
|
||||
GenericName[sk]=Zdieľanie pracovnej plochy
|
||||
GenericName[sl]=Souporaba namizja
|
||||
GenericName[sr]=Дељење површи
|
||||
GenericName[sr@ijekavian]=Дијељење површи
|
||||
GenericName[sr@ijekavianlatin]=Dijeljenje površi
|
||||
GenericName[sr@latin]=Deljenje površi
|
||||
GenericName[sv]=Dela ut skrivbordet
|
||||
GenericName[th]=ใช้งานพื้นที่ทำงานร่วมกัน
|
||||
GenericName[tr]=Masaüstü Paylaşımı
|
||||
GenericName[ug]=ئۈستەلئۈستىنى ھەمبەھىرلەش
|
||||
GenericName[uk]=Спільні стільниці
|
||||
GenericName[uz]=Ish stoli bilan boʻlishish
|
||||
GenericName[uz@cyrillic]=Иш столи билан бўлишиш
|
||||
GenericName[vi]=Chia sẻ màn hình nền
|
||||
GenericName[x-test]=xxDesktop Sharingxx
|
||||
GenericName[zh_CN]=桌面共享
|
||||
GenericName[zh_HK]=桌面分享
|
||||
GenericName[zh_TW]=桌面分享
|
||||
Categories=Qt;KDE;System;Network;RemoteAccess;
|
||||
@@ -1,15 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||
<kcfgfile name="krfbrc"/>
|
||||
<group name="MainWindow">
|
||||
<entry name="startMinimized" type="Bool">
|
||||
<label>Start minimized</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
</group>
|
||||
<!DOCTYPE kcfg SYSTEM
|
||||
"http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
|
||||
<kcfg>
|
||||
<kcfgfile />
|
||||
<group name="TCP">
|
||||
<entry name="useDefaultPort" type="Bool">
|
||||
<label>Use the default port for VNC (5900)</label>
|
||||
@@ -25,10 +18,6 @@
|
||||
</entry>
|
||||
</group>
|
||||
<group name="Security">
|
||||
<entry name="noWallet" type="Bool">
|
||||
<label>Do not store passwords in KWallet</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="allowDesktopControl" type="Bool">
|
||||
<label>Allow remote connections to manage the desktop.</label>
|
||||
<default>true</default>
|
||||
@@ -47,7 +36,7 @@
|
||||
<group name="FrameBuffer">
|
||||
<entry name="preferredFrameBufferPlugin" type="String">
|
||||
<label>Preferred Frame Buffer Plugin</label>
|
||||
<default>xcb</default>
|
||||
<default>krfb_framebuffer_x11</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
||||
@@ -3,12 +3,13 @@ IconName=krfb
|
||||
Comment=Desktop Sharing
|
||||
Comment[af]=Werkskerm Deeling
|
||||
Comment[ar]=مشاركة سطح المكتب
|
||||
Comment[ast]=Escritoriu compartíu
|
||||
Comment[bg]=Споделяне на работния плот
|
||||
Comment[bn]=ডেস্কটপ ভাগাভাগি
|
||||
Comment[br]=Rannañ ar vurev
|
||||
Comment[bs]=Dijeljenje radne površine
|
||||
Comment[ca]=Compartir l'escriptori
|
||||
Comment[ca@valencia]=Compartir l'escriptori
|
||||
Comment[ca]=Compartició de l'escriptori
|
||||
Comment[ca@valencia]=Compartició de l'escriptori
|
||||
Comment[cs]=Sdílení pracovní plochy
|
||||
Comment[cy]=Rhannu Penbwrdd
|
||||
Comment[da]=Skrivebordsdeling
|
||||
@@ -29,14 +30,13 @@ Comment[hne]=डेस्कटाप साझेदारी
|
||||
Comment[hr]=Dijeljenje radne površine
|
||||
Comment[hu]=Munkaasztal-megosztás
|
||||
Comment[ia]=Compartir de scriptorio
|
||||
Comment[id]=Desktop Sharing
|
||||
Comment[is]=Skjáborðamiðlun
|
||||
Comment[it]=Condivisione del desktop
|
||||
Comment[ja]=デスクトップ共有
|
||||
Comment[kk]=Үстелді ортақтастыру
|
||||
Comment[km]=ការចែករំលែកផ្ទែតុ
|
||||
Comment[ko]=데스크톱 공유
|
||||
Comment[lt]=Dalinimasis darbalaukiu
|
||||
Comment[lt]=Dalinimasis darbastaliu
|
||||
Comment[lv]=Darbvirsmas koplietošana
|
||||
Comment[mk]=Делење на работната површина
|
||||
Comment[ml]=പണിയിടം പങ്കുവെക്കല്
|
||||
@@ -75,6 +75,7 @@ Comment[zh_TW]=桌面分享
|
||||
[Event/UserAcceptsConnection]
|
||||
Name=User Accepts Connection
|
||||
Name[ar]=المستخدم يقبل الاتصال
|
||||
Name[ast]=L'usuariu aceuta la conexón
|
||||
Name[bg]=Потребителят приема връзката
|
||||
Name[bs]=Korisnik prihvata vezu
|
||||
Name[ca]=L'usuari accepta la connexió
|
||||
@@ -97,7 +98,6 @@ Name[hne]=कमइया हर कनेक्सन स्वीकारा
|
||||
Name[hr]=Korisnik prihvaća vezu
|
||||
Name[hu]=A felhasználó engedélyezi a csatlakozást
|
||||
Name[ia]=Usator da acceptation a connexion
|
||||
Name[id]=Pengguna Menyetujui Koneksi
|
||||
Name[is]=Notandi samþykkir tengingar
|
||||
Name[it]=L'utente accetta la connessione
|
||||
Name[ja]=ユーザが接続を許可
|
||||
@@ -136,6 +136,7 @@ Name[zh_TW]=使用者接受連線
|
||||
Comment=User accepts connection
|
||||
Comment[af]=Gebruiker aanvaar verbinding
|
||||
Comment[ar]=المستخدم يقبل الاتصال
|
||||
Comment[ast]=L'usuariu aceuta la conexón
|
||||
Comment[bg]=Потребителят приема връзката
|
||||
Comment[bn]=ব্যবহারকারী সংযোগ গ্রহণ করে
|
||||
Comment[bs]=Korisnik prihvata vezu
|
||||
@@ -161,7 +162,6 @@ Comment[hne]=कमइया हर कनेक्सन स्वीकार
|
||||
Comment[hr]=Korisnik prihvaća vezu
|
||||
Comment[hu]=A felhasználó engedélyezi a csatlakozást
|
||||
Comment[ia]=Usator da acceptation a connexion
|
||||
Comment[id]=Pengguna menyetujui koneksi
|
||||
Comment[is]=Notandi samþykkir tengingu
|
||||
Comment[it]=L'utente accetta la connessione
|
||||
Comment[ja]=ユーザが接続を許可
|
||||
@@ -208,6 +208,7 @@ Action=Popup
|
||||
[Event/UserRefusesConnection]
|
||||
Name=User Refuses Connection
|
||||
Name[ar]=المستخدم يرفض الاتصال
|
||||
Name[ast]=L'usuariu refuga la conexón
|
||||
Name[bg]=Потребителят отказва връзката
|
||||
Name[bs]=Korisnik odbija vezu
|
||||
Name[ca]=L'usuari refusa la connexió
|
||||
@@ -230,7 +231,6 @@ Name[hne]=कमइया हर कनेक्सन अस्वीकार
|
||||
Name[hr]=Korisnik odbija vezu
|
||||
Name[hu]=A felhasználó elutasítja a csatlakozást
|
||||
Name[ia]=Usator refuta connexion
|
||||
Name[id]=Pengguna Menampik Koneksi
|
||||
Name[is]=Notandi hafnar tengingum
|
||||
Name[it]=L'utente rifiuta la connessione
|
||||
Name[ja]=ユーザが接続を拒否
|
||||
@@ -269,6 +269,7 @@ Name[zh_TW]=使用者拒絕連線
|
||||
Comment=User refuses connection
|
||||
Comment[af]=Gebruiker weier verbinding
|
||||
Comment[ar]=المستخدم يرفض الاتصال
|
||||
Comment[ast]=L'usuariu refuga la conexón
|
||||
Comment[bg]=Потребителят отказва връзката
|
||||
Comment[bn]=ব্যবহারকারী সংযোগ অস্বীকার করে
|
||||
Comment[bs]=Korisnik odbija vezu
|
||||
@@ -294,7 +295,6 @@ Comment[hne]=कमइया हर कनेक्सन अस्वीका
|
||||
Comment[hr]=Korisnik odbija vezu
|
||||
Comment[hu]=A felhasználó elutasítja a csatlakozást
|
||||
Comment[ia]=Usator refuta connexion
|
||||
Comment[id]=Pengguna menampik koneksi
|
||||
Comment[is]=Notandi hafnar tengingu
|
||||
Comment[it]=L'utente rifiuta la connessione
|
||||
Comment[ja]=ユーザが接続を拒否
|
||||
@@ -341,6 +341,7 @@ Action=Popup
|
||||
[Event/ConnectionClosed]
|
||||
Name=Connection Closed
|
||||
Name[ar]=الاتصال أغلق
|
||||
Name[ast]=Conexón zarrada
|
||||
Name[bg]=Връзката е прекъсната
|
||||
Name[bs]=Konekcija zatvorena
|
||||
Name[ca]=Connexió tancada
|
||||
@@ -357,13 +358,12 @@ Name[eu]=Konexioa itxi da
|
||||
Name[fi]=Yhteys suljettu
|
||||
Name[fr]=Connexion fermée
|
||||
Name[ga]=Ceangal Dúnta
|
||||
Name[gl]=Conexión pechada
|
||||
Name[gl]=Conexión fechada
|
||||
Name[hi]=कनेक्शन बन्द
|
||||
Name[hne]=कनेक्सन बन्द
|
||||
Name[hr]=Veza prekinuta
|
||||
Name[hu]=A kapcsolat megszűnt
|
||||
Name[ia]=Connexion claudite
|
||||
Name[id]=Koneksi Ditutup
|
||||
Name[is]=Tengingu lokað
|
||||
Name[it]=Connessione chiusa
|
||||
Name[ja]=接続切断
|
||||
@@ -404,6 +404,7 @@ Name[zh_TW]=連線已關閉
|
||||
Comment=Connection closed
|
||||
Comment[af]=Verbinding gesluit
|
||||
Comment[ar]=تمّ غلق الاتصال
|
||||
Comment[ast]=Conexón zarrada
|
||||
Comment[bg]=Връзката е прекъсната
|
||||
Comment[bn]=সংযোগ বন্ধ করা হল
|
||||
Comment[br]=Serret eo ar gevreadenn
|
||||
@@ -423,14 +424,13 @@ Comment[eu]=Konexioa itxi da
|
||||
Comment[fi]=Yhteys suljettu
|
||||
Comment[fr]=Connexion fermée
|
||||
Comment[ga]=Ceangal dúnta
|
||||
Comment[gl]=A conexión está pechada
|
||||
Comment[gl]=A conexión está fechada
|
||||
Comment[he]=החיבור נסגר
|
||||
Comment[hi]=कनेक्शन बन्द
|
||||
Comment[hne]=कनेक्सन बन्द
|
||||
Comment[hr]=Veza prekinuta
|
||||
Comment[hu]=A kapcsolat megszűnt
|
||||
Comment[ia]=Connexion claudite
|
||||
Comment[id]=Koneksi ditutup
|
||||
Comment[is]=Tengingu lokað
|
||||
Comment[it]=Connessione chiusa
|
||||
Comment[ja]=接続が閉じられました
|
||||
@@ -480,6 +480,7 @@ Action=Popup
|
||||
[Event/InvalidPassword]
|
||||
Name=Invalid Password
|
||||
Name[ar]=كلمة المرور غير صحيحة
|
||||
Name[ast]=Contraseña incorreuta
|
||||
Name[bg]=Неправилна парола
|
||||
Name[bs]=Neispravna šifra
|
||||
Name[ca]=Contrasenya no vàlida
|
||||
@@ -496,13 +497,12 @@ Name[eu]=Baliogabeko pasahitza
|
||||
Name[fi]=Virheellinen salasana
|
||||
Name[fr]=Mot de passe non valable
|
||||
Name[ga]=Focal Faire Neamhbhailí
|
||||
Name[gl]=O contrasinal é incorrecto
|
||||
Name[gl]=O contrasinal non é válido
|
||||
Name[hi]=अवैध पासवर्ड
|
||||
Name[hne]=अवैध पासवर्ड
|
||||
Name[hr]=Nevažeća zaporka
|
||||
Name[hu]=Érvénytelen jelszó
|
||||
Name[ia]=Contrasigno invalide
|
||||
Name[id]=Sandi Tidak Absah
|
||||
Name[is]=Ógilt lykilorð
|
||||
Name[it]=Password non valida
|
||||
Name[ja]=無効なパスワード
|
||||
@@ -543,6 +543,7 @@ Name[zh_TW]=不正確的密碼
|
||||
Comment=Invalid password
|
||||
Comment[af]=Ongeldige wagwoord
|
||||
Comment[ar]=كلمة المرور غير صحيحة
|
||||
Comment[ast]=Contraseña incorreuta
|
||||
Comment[bg]=Неправилна парола
|
||||
Comment[bn]=অবৈধ পাসওয়ার্ড
|
||||
Comment[br]=Tremenger siek
|
||||
@@ -562,14 +563,13 @@ Comment[eu]=Baliogabeko pasahitza
|
||||
Comment[fi]=Virheellinen salasana
|
||||
Comment[fr]=Mot de passe non valable
|
||||
Comment[ga]=Focal faire neamhbhailí
|
||||
Comment[gl]=Este contrasinal é incorrecto
|
||||
Comment[gl]=Este contrasinal non é válido
|
||||
Comment[he]=הסיסמה שגויה
|
||||
Comment[hi]=अवैध पासवर्ड
|
||||
Comment[hne]=अवैध पासवर्ड
|
||||
Comment[hr]=Nevažeća šifra
|
||||
Comment[hu]=Érvénytelen jelszó
|
||||
Comment[ia]=Contrasigno invalide
|
||||
Comment[id]=Sandi tidak absah
|
||||
Comment[is]=Lykilorð ógilt
|
||||
Comment[it]=Password non valida
|
||||
Comment[ja]=無効なパスワード
|
||||
@@ -622,10 +622,11 @@ Action=Popup
|
||||
[Event/InvalidPasswordInvitations]
|
||||
Name=Invalid Password Invitations
|
||||
Name[ar]=كلمة المرور الدعوات غير صحيحة
|
||||
Name[ast]=Contraseñas d'invitaciones incorreutes
|
||||
Name[bg]=Неправилна парола за покана
|
||||
Name[bs]=Neispravna šifra pozivnice
|
||||
Name[ca]=Contrasenya no vàlida de les invitacions
|
||||
Name[ca@valencia]=Contrasenya no vàlida de les invitacions
|
||||
Name[ca]=Contrasenya de les invitacions no vàlides
|
||||
Name[ca@valencia]=Contrasenya de les invitacions no vàlides
|
||||
Name[cs]=Neplatné hesla výzev
|
||||
Name[da]=Ugyldige adgangskodeinvitationer
|
||||
Name[de]=Ungültiges Einladungs-Passwort
|
||||
@@ -638,13 +639,12 @@ Name[eu]=Gonbitearen pasahitza baliogabea
|
||||
Name[fi]=Virheellinen salasana kutsuun
|
||||
Name[fr]=Invitations de mots de passe non valables
|
||||
Name[ga]=Cuirí Neamhbhailí Focal Faire
|
||||
Name[gl]=O contrasinal de convidado incorrecto
|
||||
Name[gl]=O contrasinal de convidado non válido
|
||||
Name[hi]=अवैध पासवर्ड निमंत्रण
|
||||
Name[hne]=अवैध पासवर्ड निमंत्रन
|
||||
Name[hr]=Pozivnice s nevažećim zaporkama
|
||||
Name[hu]=Érvénytelen jelszavas meghívó
|
||||
Name[ia]=Invitationes de contrasigno invalide
|
||||
Name[id]=Undangan Sandi Tidak Absah
|
||||
Name[is]=Ógild lykilorðsboð
|
||||
Name[it]=Password di invito non valida
|
||||
Name[ja]=招待に対する無効なパスワード
|
||||
@@ -683,6 +683,7 @@ Name[zh_TW]=不合法的密碼邀請
|
||||
Comment=The invited party sent an invalid password. Connection refused.
|
||||
Comment[af]=Die uitgenooi party gestuur 'n ongeldige wagwoord. Verbinding geweier.
|
||||
Comment[ar]=المدعو أرسل كلمة مرور غير صحيحة. رفض الإتصال.
|
||||
Comment[ast]=L'invitáu unvió una contraseña incorreuta. Conexón refugada.
|
||||
Comment[bg]=Поканената страна изпрати неправилна парола. Връзката е отказана.
|
||||
Comment[bn]=আমন্ত্রিত দল একটি অবৈধ পাসওয়ার্ড পাঠাল। সংযোগ অস্বীকার করা হল।
|
||||
Comment[bs]=Pozvana strana je poslala pogrešnu šifru. Veza je odbijena.
|
||||
@@ -701,14 +702,13 @@ Comment[eu]=Gonbidatutako parekoak baliogabeko pasahitza bidali du. Konexioa uka
|
||||
Comment[fi]=Kutsuttu taho lähetti virheellisen salasanan. Yhteys hylättiin.
|
||||
Comment[fr]=La partie invitée a envoyé un mot de passe non valable. Connexion refusée.
|
||||
Comment[ga]=Sheol an duine le cuireadh focal faire neamhbhailí. Diúltaíodh an ceangal.
|
||||
Comment[gl]=A parte convidada envioulle un contrasinal incorrecto. Rexeitouse a conexión.
|
||||
Comment[gl]=A parte convidada envioulle un contrasinal non válido. A conexión foi rexeitada.
|
||||
Comment[he]=הצד המוזמן שלח סיסמה שגויה. החיבור נדחה.
|
||||
Comment[hi]=निमंत्रित पार्टी ने अवैध पासवर्ड भेजा. कनेक्शन अस्वीकृत.
|
||||
Comment[hne]=निमंत्रित पार्टी हर अवैध पासवर्ड भेजिस. कनेक्सन अस्वीकृत.
|
||||
Comment[hr]=Stranka koju ste pozvali je poslala nevažeću šifru. Veza odbijena.
|
||||
Comment[hu]=A meghívott fél érvénytelen jelszót küldött. A csatlakozási kérés elutasítva.
|
||||
Comment[ia]=Le partita invitate inviava un contrasigno invalide. Connexion refusate.
|
||||
Comment[id]=Undangan mengirimkan sebuah sandi tidak absah. Koneksi ditampik.
|
||||
Comment[is]=Boðinn aðili sendi ógilt lykilorð. Tengingu hafnað
|
||||
Comment[it]=La parte invitata ha inviato una password non valida. Connessione rifiutata.
|
||||
Comment[ja]=招待された人が無効なパスワードを送ってきました。接続を拒否しました。
|
||||
@@ -753,10 +753,11 @@ Action=Popup
|
||||
[Event/NewConnectionOnHold]
|
||||
Name=New Connection on Hold
|
||||
Name[ar]=اتصال جديد على التوقف
|
||||
Name[ast]=Conexón nueva a la espera
|
||||
Name[bg]=Изчакване на новата връзка
|
||||
Name[bs]=Nova veza je na čekanju
|
||||
Name[ca]=Connexió nova en espera
|
||||
Name[ca@valencia]=Connexió nova en espera
|
||||
Name[ca]=Nova connexió en espera
|
||||
Name[ca@valencia]=Nova connexió en espera
|
||||
Name[cs]=Nové spojení pozdrženo
|
||||
Name[da]=Ny forbindelse sat til at vente
|
||||
Name[de]=Neue Verbindung wartet
|
||||
@@ -775,7 +776,6 @@ Name[hne]=नवा कनेक्सन होल्ड मं रखा
|
||||
Name[hr]=Nova veza na čekanju
|
||||
Name[hu]=Új kapcsolat tartva
|
||||
Name[ia]=Nove connexion in pausa
|
||||
Name[id]=Koneksi Baru sedang Tertahan
|
||||
Name[is]=Ný tenging á bið
|
||||
Name[it]=Nuova connessione in attesa
|
||||
Name[ja]=保留中の新しい接続
|
||||
@@ -813,11 +813,12 @@ Name[zh_TW]=新連線等待處理
|
||||
Comment=Connection requested, user must accept
|
||||
Comment[af]=Verbinding versoekte, gebruiker moet aanvaar
|
||||
Comment[ar]=الاتصال طلب، يجب موافقة المستخدم
|
||||
Comment[ast]=Conexón solicitada, l'usuario tien d'aceutala
|
||||
Comment[bg]=Поискана е връзка, следва потребителят да приеме
|
||||
Comment[bn]=সংযোগ অনুরোধ করা হল, ব্যবহারকারীকে অবশ্যই স্বীকার করতে হবে
|
||||
Comment[bs]=Veza je zahtijevana, korinik mora da je prihvati
|
||||
Comment[ca]=Connexió sol·licitada, l'usuari l'ha d'acceptar
|
||||
Comment[ca@valencia]=Connexió sol·licitada, l'usuari l'ha d'acceptar
|
||||
Comment[ca]=Connexió sol·licitada, l'usuari ha d'acceptar-la
|
||||
Comment[ca@valencia]=Connexió sol·licitada, l'usuari ha d'acceptar-la
|
||||
Comment[cs]=Vyžadováno spojení, uživatel musí přijmout
|
||||
Comment[cy]=Cais wedi'i wneud am gysylltiad,rhaid i'r ddefnyddiwr ei dderbyn
|
||||
Comment[da]=Forbindelse forespurgt, bruger skal acceptere
|
||||
@@ -838,7 +839,6 @@ Comment[hne]=कनेक्सन निवेदित. कमइया ल
|
||||
Comment[hr]=Veza je zatražena, korisnik mora prihvatiti
|
||||
Comment[hu]=Csatlakozási kérés, a felhasználónak el kell fogadnia
|
||||
Comment[ia]=Connexion requirite, usator debe dar acceptation
|
||||
Comment[id]=Koneksi diminta, pengguna harus menyetujui
|
||||
Comment[is]=Beiðni um tengingu, notandi verður að samþykkja
|
||||
Comment[it]=Connessione richiesta, l'utente deve accettare
|
||||
Comment[ja]=接続が要求されています。ユーザが許可しなければなりません。
|
||||
@@ -884,10 +884,11 @@ Action=Popup
|
||||
[Event/NewConnectionAutoAccepted]
|
||||
Name=New Connection Auto Accepted
|
||||
Name[ar]=اتصال جديد مقبول تلقائيا
|
||||
Name[ast]=Conexón nueva aceutada automáticamente
|
||||
Name[bg]=Автоматично приемане на новата връзка
|
||||
Name[bs]=Nova veza je automatski prihvaćena
|
||||
Name[ca]=Connexió nova acceptada automàticament
|
||||
Name[ca@valencia]=Connexió nova acceptada automàticament
|
||||
Name[ca]=Nova connexió acceptada automàticament
|
||||
Name[ca@valencia]=Nova connexió acceptada automàticament
|
||||
Name[cs]=Nové spojení automaticky přijato
|
||||
Name[da]=Ny forbindelse automatisk accepteret
|
||||
Name[de]=Neue Verbindung automatisch angenommen
|
||||
@@ -906,7 +907,6 @@ Name[hne]=नय कनेक्सन अपने अपन स्वीका
|
||||
Name[hr]=Nova veza automatski prihvaćena
|
||||
Name[hu]=Új kapcsolat automatikusan engedélyezve
|
||||
Name[ia]=Nove connexion con acceptation automatic
|
||||
Name[id]=Koneksi Baru Tersetujui Otomatis
|
||||
Name[is]=Ný tenging sjálfvirkt samþykkt
|
||||
Name[it]=Nuova connessione accettata automaticamente
|
||||
Name[ja]=新しい接続の自動受け入れ
|
||||
@@ -944,11 +944,12 @@ Name[zh_TW]=新連線自動接受
|
||||
Comment=New connection automatically established
|
||||
Comment[af]=Nuwe verbinding automaties vasgestel
|
||||
Comment[ar]=اتصال جديد مفعل تلقائيا
|
||||
Comment[ast]=Conexón nueva afitada automáticamente
|
||||
Comment[bg]=Новата връзка е автоматично приета
|
||||
Comment[bn]=নতুন সংযোগ স্বয়ংক্রীয়ভাবে স্থাপন করা হল
|
||||
Comment[bs]=Nova veza je automatski uspostavljena
|
||||
Comment[ca]=Connexió nova establerta automàticament
|
||||
Comment[ca@valencia]=Connexió nova establida automàticament
|
||||
Comment[ca]=Nova connexió establerta automàticament
|
||||
Comment[ca@valencia]=Nova connexió establerta automàticament
|
||||
Comment[cs]=Automaticky navázáno nové spojení
|
||||
Comment[cy]=Sefydlwyd cysylltiad newydd yn awtomatig
|
||||
Comment[da]=Ny forbindelse automatisk etableret
|
||||
@@ -969,7 +970,6 @@ Comment[hne]=नवा कनेक्सन अपने अपन स्था
|
||||
Comment[hr]=Nova veza automatski prihvaćena
|
||||
Comment[hu]=Automatikusan létrejött egy új kapcsolat
|
||||
Comment[ia]=Nove connexion establite automaticamente
|
||||
Comment[id]=Koneksi baru secara otomatis terpancang
|
||||
Comment[is]=Nýjar tengingar sjálfkrafa samþykktar
|
||||
Comment[it]=Nuova connessione stabilita automaticamente
|
||||
Comment[ja]=新しい接続を自動的に確立しました
|
||||
@@ -1015,6 +1015,7 @@ Action=Popup
|
||||
[Event/TooManyConnections]
|
||||
Name=Too Many Connections
|
||||
Name[ar]=اتصالات عديدة
|
||||
Name[ast]=Abondes conexones
|
||||
Name[bg]=Твърде много връзки
|
||||
Name[bs]=Previše veza
|
||||
Name[ca]=Massa connexions
|
||||
@@ -1037,7 +1038,6 @@ Name[hne]=बहुत अकन कनेक्सन
|
||||
Name[hr]=Previše veza
|
||||
Name[hu]=Túl sok kapcsolat
|
||||
Name[ia]=Nimie connexiones
|
||||
Name[id]=Terlalu Banyak Koneksi
|
||||
Name[is]=Of margar tengingar
|
||||
Name[it]=Troppe connessioni
|
||||
Name[ja]=多すぎる接続
|
||||
@@ -1075,6 +1075,7 @@ Name[zh_TW]=太多連線
|
||||
Comment=Busy, connection refused
|
||||
Comment[af]=Besig, verbinding geweier
|
||||
Comment[ar]=مشغول، الإتصال رفض
|
||||
Comment[ast]=Ocupáu, conexón refugada
|
||||
Comment[bg]=Заето. Връзката е отказана.
|
||||
Comment[bn]=ব্যস্ত, সংযোগ অস্বীকার করল
|
||||
Comment[br]=Dalc'het, kevreadenn disteuleret
|
||||
@@ -1094,14 +1095,13 @@ Comment[eu]=Lanpetuta, konexioa ukatu da
|
||||
Comment[fi]=Varattu, yhteys hylättiin
|
||||
Comment[fr]=Occupé. Connexion refusée
|
||||
Comment[ga]=Gnóthach; ceangal diúltaithe
|
||||
Comment[gl]=Ocupado, rexeitouse a conexión.
|
||||
Comment[gl]=Ocupado; a conexión foi rexeitada
|
||||
Comment[he]=תפוס, החיבור נדחה
|
||||
Comment[hi]=व्यस्त, कनेक्शन अस्वीकृत
|
||||
Comment[hne]=व्यस्त, कनेक्सन अस्वीकृत
|
||||
Comment[hr]=Zauzeto, veza odbijena
|
||||
Comment[hu]=A csatlakozási kérés elutasítva túlterhelés miatt
|
||||
Comment[ia]=Occupate, connexion refusate
|
||||
Comment[id]=Sibuk, koneksi ditampik
|
||||
Comment[is]=Uptekinn, tengingu hafnað
|
||||
Comment[it]=Occupato, connessione rifiutata
|
||||
Comment[ja]=ビジーです、接続を拒否しました
|
||||
@@ -1149,6 +1149,7 @@ Action=Popup
|
||||
[Event/UnexpectedConnection]
|
||||
Name=Unexpected Connection
|
||||
Name[ar]=الاتصال غير متوقّع
|
||||
Name[ast]=Conexón inesperada
|
||||
Name[bg]=Неочаквана връзка
|
||||
Name[bs]=Neočekivana veza
|
||||
Name[ca]=Connexió inesperada
|
||||
@@ -1171,7 +1172,6 @@ Name[hne]=अप्रत्यासित कनेक्सन
|
||||
Name[hr]=Neočekivana veza
|
||||
Name[hu]=Nem várt kapcsolat
|
||||
Name[ia]=Connexion impreviste
|
||||
Name[id]=Koneksi Tak Terduga
|
||||
Name[is]=Óvænt Tenging
|
||||
Name[it]=Connessione inattesa
|
||||
Name[ja]=予期しない接続
|
||||
@@ -1210,11 +1210,12 @@ Name[zh_TW]=未知的連線
|
||||
Comment=Received unexpected connection, abort
|
||||
Comment[af]=Ontvang onverwagte verbinding, staak
|
||||
Comment[ar]=استقبال اتصال غير متوقع، إنهاء
|
||||
Comment[ast]=Recibióse conexón inesperada, albortando
|
||||
Comment[bg]=Получена е неочаквана връзка. Прекъсване.
|
||||
Comment[bn]=অপ্রত্যাশিত সংযোগ গ্রহণ করল, বাতিল করুন
|
||||
Comment[bs]=Primljena je neočekivana veza, prekini
|
||||
Comment[ca]=S'ha rebut una connexió inesperada, s'està interrompent
|
||||
Comment[ca@valencia]=S'ha rebut una connexió inesperada, s'està interrompent
|
||||
Comment[ca]=Rebuda una connexió inesperada, avortant
|
||||
Comment[ca@valencia]=Rebuda una connexió inesperada, avortant
|
||||
Comment[cs]=Obdrženo neočekávané spojení, přerušeno
|
||||
Comment[cy]=Derbynwyd cysylltiad annisgwyl,terfynu
|
||||
Comment[da]=Modtog uventet forbindelse, afbrød
|
||||
@@ -1228,14 +1229,13 @@ Comment[eu]=Ustekabeko konexioa jaso da, abortatzen
|
||||
Comment[fi]=Vastaanotettiin odottamaton yhteys, lopeta
|
||||
Comment[fr]=Connexion inattendue reçue. Annulation
|
||||
Comment[ga]=Fuarthas ceangal gan choinne, á thobscor
|
||||
Comment[gl]=Recibiuse unha conexión non agardada; interrómpese
|
||||
Comment[gl]=Recibiuse unha conexión non agardada; cancélase
|
||||
Comment[he]=נתקבל חיבור בלתי צפוי, בוטל
|
||||
Comment[hi]=अप्रत्याशित कनेक्शन प्राप्त. छोड़ा
|
||||
Comment[hne]=अप्रत्यासित कनेक्सन प्राप्त. छोड़ा
|
||||
Comment[hr]=Primio sam neočekivanu vezu, prekid
|
||||
Comment[hu]=Nem várt csatlakozási kérés érkezett, megszakítás
|
||||
Comment[ia]=On recipeva connexion impreviste, aborta
|
||||
Comment[id]=Diperoleh koneksi tak terduga, gugurkan
|
||||
Comment[is]=Tók á móti óvæntri tengingu, hætti
|
||||
Comment[it]=Ricevuta connessione inattesa, terminata
|
||||
Comment[ja]=予期しない接続を受信しました。廃棄します。
|
||||
@@ -1253,7 +1253,7 @@ Comment[nl]=Ontving een onverwachte verbinding, afgebroken
|
||||
Comment[nn]=Fekk ei uventa tilkopling, så avbryt no
|
||||
Comment[pl]=Otrzymano niespodziewane połączenie. Przerwane.
|
||||
Comment[pt]=Foi recebida uma ligação inesperada, pelo que foi interrompida
|
||||
Comment[pt_BR]=Conexão recebida inesperadamente; cancelar
|
||||
Comment[pt_BR]=Conexão recebida inesperadamente; abortar
|
||||
Comment[ro]=Conexiune neașteptată recepționată, abandonare
|
||||
Comment[ru]=Получено неожиданное соединение. Отключение
|
||||
Comment[si]=බලාපොරොත්තු රහිත සබඳතාවක් ලැබිනි, පිටවෙමින්
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0">
|
||||
<qresource prefix="/kxmlgui5/krfb">
|
||||
<file>krfbui.rc</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
7
krfb/krfb_rfb_handler.client
Normal file
@@ -0,0 +1,7 @@
|
||||
[org.freedesktop.Telepathy.Client]
|
||||
Interfaces=org.freedesktop.Telepathy.Client.Handler;
|
||||
|
||||
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0]
|
||||
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube
|
||||
org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=rfb
|
||||
org.freedesktop.Telepathy.Channel.Requested b=true
|
||||
@@ -1,7 +0,0 @@
|
||||
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
|
||||
<gui name="krfb" version="0">
|
||||
|
||||
<MenuBar>
|
||||
</MenuBar>
|
||||
|
||||
</gui>
|
||||
@@ -1,173 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2021 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
|
||||
This program 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 3 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QCommandLineOption>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <KNotification>
|
||||
#include <KLocalizedString>
|
||||
#include <KWindowSystem>
|
||||
#include <KAboutData>
|
||||
#include "sockethelpers.h"
|
||||
#include "krfb_version.h"
|
||||
#include "rfbserver.h"
|
||||
#include <signal.h>
|
||||
#include "rfbservermanager.h"
|
||||
|
||||
class VirtualMonitorRfbClient : public RfbClient
|
||||
{
|
||||
public:
|
||||
explicit VirtualMonitorRfbClient(rfbClientPtr client, QObject *parent = nullptr)
|
||||
: RfbClient(client, parent)
|
||||
{}
|
||||
};
|
||||
|
||||
class PendingVirtualMonitorRfbClient : public PendingRfbClient
|
||||
{
|
||||
public:
|
||||
explicit PendingVirtualMonitorRfbClient(rfbClientPtr client, QObject *parent = nullptr)
|
||||
: PendingRfbClient(client, parent)
|
||||
{}
|
||||
~PendingVirtualMonitorRfbClient() override {}
|
||||
|
||||
static QByteArray password;
|
||||
|
||||
protected:
|
||||
void processNewClient() override {
|
||||
qDebug() << "new client!";
|
||||
const QString host = peerAddress(m_rfbClient->sock) + QLatin1Char(':') + QString::number(peerPort(m_rfbClient->sock));
|
||||
|
||||
KNotification::event(QStringLiteral("NewConnectionAutoAccepted"),
|
||||
i18n("Creating a Virtual Monitor from %1", host));
|
||||
}
|
||||
bool checkPassword(const QByteArray & encryptedPassword) override {
|
||||
bool b = vncAuthCheckPassword(password, encryptedPassword);
|
||||
if (b) {
|
||||
QTimer::singleShot(0, this, [this] {
|
||||
accept(new VirtualMonitorRfbClient(m_rfbClient, parent()));
|
||||
});
|
||||
}
|
||||
return b;
|
||||
}
|
||||
};
|
||||
|
||||
QByteArray PendingVirtualMonitorRfbClient::password;
|
||||
|
||||
class VirtualMonitorRfbServer : public RfbServer
|
||||
{
|
||||
public:
|
||||
PendingRfbClient *newClient(rfbClientPtr client) {
|
||||
qDebug() << "new client request";
|
||||
return new PendingVirtualMonitorRfbClient(client, this);
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
KLocalizedString::setApplicationDomain("krfb");
|
||||
|
||||
KAboutData aboutData(QStringLiteral("krfb-virtualmonitor"),
|
||||
i18n("Remote Virtual Monitor"),
|
||||
QStringLiteral(KRFB_VERSION_STRING),
|
||||
i18n("Offer a Virtual Monitor that can be accessed remotely"),
|
||||
KAboutLicense::GPL,
|
||||
i18n("(c) 2009-2010, Collabora Ltd.\n"
|
||||
"(c) 2007, Alessandro Praduroux\n"
|
||||
"(c) 2001-2003, Tim Jansen\n"
|
||||
"(c) 2001, Johannes E. Schindelin\n"
|
||||
"(c) 2000-2001, Const Kaplinsky\n"
|
||||
"(c) 2000, Tridia Corporation\n"
|
||||
"(c) 1999, AT&T Laboratories Boston\n"));
|
||||
aboutData.addAuthor(QStringLiteral("Aleix Pol i Gonzalez"), i18n("Virtual Monitor implementation"), QStringLiteral("aleixpol@kde.org"));
|
||||
aboutData.addAuthor(i18n("George Kiagiadakis"), QString(), QStringLiteral("george.kiagiadakis@collabora.co.uk"));
|
||||
aboutData.addAuthor(i18n("Alessandro Praduroux"), i18n("KDE4 porting"), QStringLiteral("pradu@pradu.it"));
|
||||
aboutData.addAuthor(i18n("Tim Jansen"), i18n("Original author"), QStringLiteral("tim@tjansen.de"));
|
||||
aboutData.addCredit(i18n("Johannes E. Schindelin"),
|
||||
i18n("libvncserver"));
|
||||
aboutData.addCredit(i18n("Const Kaplinsky"),
|
||||
i18n("TightVNC encoder"));
|
||||
aboutData.addCredit(i18n("Tridia Corporation"),
|
||||
i18n("ZLib encoder"));
|
||||
aboutData.addCredit(i18n("AT&T Laboratories Boston"),
|
||||
i18n("original VNC encoders and "
|
||||
"protocol design"));
|
||||
KAboutData::setApplicationData(aboutData);
|
||||
|
||||
QCommandLineParser parser;
|
||||
aboutData.setupCommandLine(&parser);
|
||||
const QCommandLineOption resolutionOption({ QStringLiteral("resolution") }, i18n("Logical resolution of the new monitor"), i18n("resolution"));
|
||||
parser.addOption(resolutionOption);
|
||||
const QCommandLineOption nameOption({ QStringLiteral("name") }, i18n("Name of the monitor"), i18n("name"));
|
||||
parser.addOption(nameOption);
|
||||
const QCommandLineOption passwordOption({ QStringLiteral("password") }, i18n("Password for the client to connect to it"), i18n("password"));
|
||||
parser.addOption(passwordOption);
|
||||
const QCommandLineOption scaleOption({ QStringLiteral("scale") }, i18n("The device-pixel-ratio of the device, the scaling factor"), i18n("dpr"), QStringLiteral("1"));
|
||||
parser.addOption(scaleOption);
|
||||
const QCommandLineOption portOption({ QStringLiteral("port") }, i18n("The port we will be listening to"), i18n("number"), QStringLiteral("9999"));
|
||||
parser.addOption(portOption);
|
||||
|
||||
parser.process(app);
|
||||
aboutData.processCommandLine(&parser);
|
||||
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
if (!KWindowSystem::isPlatformWayland()) {
|
||||
qCritical() << "Virtual Monitors are only supported on Wayland";
|
||||
return 1;
|
||||
}
|
||||
if (!parser.isSet(nameOption)) {
|
||||
qCritical() << "error: please define --name";
|
||||
return 2;
|
||||
} else {
|
||||
if (!parser.isSet(passwordOption)) {
|
||||
qCritical() << "error: please define --password";
|
||||
return 3;
|
||||
}
|
||||
if (!parser.isSet(resolutionOption)) {
|
||||
qCritical() << "error: please define --resolution";
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
if (!parser.isSet(portOption)) {
|
||||
qCritical() << "error: please define --port";
|
||||
return 5;
|
||||
}
|
||||
const QString res = parser.value(resolutionOption);
|
||||
const auto resSplit = res.split(QLatin1Char('x'));
|
||||
if (resSplit.size() != 2) {
|
||||
qCritical() << "error: the resolution should be formatted as WIDTHxHEIGHT (e.g. --resolution 1920x1080)";
|
||||
return 6;
|
||||
}
|
||||
|
||||
|
||||
if (parser.isSet(nameOption)) {
|
||||
RfbServerManager::s_pluginArgs = {
|
||||
{ QStringLiteral("name"), parser.value(nameOption) },
|
||||
{ QStringLiteral("resolution"), QSize(resSplit[0].toInt(), resSplit[1].toInt()) },
|
||||
{ QStringLiteral("scale"), parser.value(scaleOption).toDouble() },
|
||||
};
|
||||
}
|
||||
|
||||
VirtualMonitorRfbServer server;
|
||||
server.setPasswordRequired(true);
|
||||
server.setListeningPort(parser.value(portOption).toInt());
|
||||
PendingVirtualMonitorRfbClient::password = parser.value(passwordOption).toUtf8();
|
||||
|
||||
sigset_t sigs;
|
||||
sigemptyset(&sigs);
|
||||
sigaddset(&sigs, SIGPIPE);
|
||||
sigprocmask(SIG_BLOCK, &sigs, nullptr);
|
||||
server.start();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
150
krfb/main.cpp
@@ -18,28 +18,30 @@
|
||||
#include "mainwindow.h"
|
||||
#include "trayicon.h"
|
||||
#include "invitationsrfbserver.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "krfb_version.h"
|
||||
#include "krfbdebug.h"
|
||||
|
||||
#include <KAboutApplicationDialog>
|
||||
#include <KAboutData>
|
||||
#include <KDBusService>
|
||||
#include <KLocalizedString>
|
||||
#include <KAction>
|
||||
#include <KUniqueApplication>
|
||||
#include <KCmdLineArgs>
|
||||
#include <KDebug>
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KWindowSystem>
|
||||
#include <KNotification>
|
||||
|
||||
#include <QPixmap>
|
||||
#include <qwindowdefs.h>
|
||||
#include <QX11Info>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/qwindowdefs.h>
|
||||
|
||||
#include <csignal>
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
# include "tubesrfbserver.h"
|
||||
#endif
|
||||
|
||||
#include <signal.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
#include <QCommandLineParser>
|
||||
#include <QCommandLineOption>
|
||||
|
||||
|
||||
static const char description[] = I18N_NOOP("VNC-compatible server to share "
|
||||
"desktops");
|
||||
"KDE desktops");
|
||||
|
||||
static bool checkX11Capabilities()
|
||||
{
|
||||
int bp1, bp2, majorv, minorv;
|
||||
@@ -47,7 +49,7 @@ static bool checkX11Capabilities()
|
||||
&majorv, &minorv);
|
||||
|
||||
if ((!r) || (((majorv * 1000) + minorv) < 2002)) {
|
||||
KMessageBox::error(nullptr,
|
||||
KMessageBox::error(0,
|
||||
i18n("Your X11 Server does not support the required XTest extension "
|
||||
"version 2.2. Sharing your desktop is not possible."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
@@ -57,121 +59,69 @@ static bool checkX11Capabilities()
|
||||
return true;
|
||||
}
|
||||
|
||||
static void checkOldX11PluginConfig() {
|
||||
if (KrfbConfig::preferredFrameBufferPlugin() == QStringLiteral("x11")) {
|
||||
qCDebug(KRFB) << "Detected deprecated configuration: preferredFrameBufferPlugin = x11";
|
||||
KConfigSkeletonItem *config_item = KrfbConfig::self()->findItem(
|
||||
QStringLiteral("preferredFrameBufferPlugin"));
|
||||
if (config_item) {
|
||||
config_item->setProperty(QStringLiteral("xcb"));
|
||||
KrfbConfig::self()->save();
|
||||
qCDebug(KRFB) << " Fixed preferredFrameBufferPlugin from x11 to xcb.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void checkWaylandPluginConfig()
|
||||
{
|
||||
if (KrfbConfig::preferredFrameBufferPlugin() != QStringLiteral("pw")) {
|
||||
qWarning() << "Wayland: Detected invalid configuration: "
|
||||
"preferredFrameBufferPlugin is not pipewire: "
|
||||
<< KrfbConfig::preferredFrameBufferPlugin();
|
||||
KConfigSkeletonItem *config_item = KrfbConfig::self()->findItem(
|
||||
QStringLiteral("preferredFrameBufferPlugin"));
|
||||
if (config_item) {
|
||||
config_item->setProperty(QStringLiteral("pw"));
|
||||
KrfbConfig::self()->save();
|
||||
qCDebug(KRFB) << "Wayland: Fixed preferredFrameBufferPlugin to \"pw\".";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
KLocalizedString::setApplicationDomain("krfb");
|
||||
|
||||
KAboutData aboutData(QStringLiteral("krfb"),
|
||||
i18n("Desktop Sharing"),
|
||||
QStringLiteral(KRFB_VERSION_STRING),
|
||||
i18n(description),
|
||||
KAboutLicense::GPL,
|
||||
i18n("(c) 2009-2010, Collabora Ltd.\n"
|
||||
KAboutData aboutData("krfb", 0, ki18n("Desktop Sharing"), KDE_VERSION_STRING,
|
||||
ki18n(description), KAboutData::License_GPL,
|
||||
ki18n("(c) 2009-2010, Collabora Ltd.\n"
|
||||
"(c) 2007, Alessandro Praduroux\n"
|
||||
"(c) 2001-2003, Tim Jansen\n"
|
||||
"(c) 2001, Johannes E. Schindelin\n"
|
||||
"(c) 2000-2001, Const Kaplinsky\n"
|
||||
"(c) 2000, Tridia Corporation\n"
|
||||
"(c) 1999, AT&T Laboratories Boston\n"));
|
||||
aboutData.addAuthor(i18n("George Goldberg"),
|
||||
i18n("Telepathy tubes support"),
|
||||
QStringLiteral("george.goldberg@collabora.co.uk"));
|
||||
aboutData.addAuthor(i18n("George Kiagiadakis"),
|
||||
QString(),
|
||||
QStringLiteral("george.kiagiadakis@collabora.co.uk"));
|
||||
aboutData.addAuthor(i18n("Alessandro Praduroux"), i18n("KDE4 porting"), QStringLiteral("pradu@pradu.it"));
|
||||
aboutData.addAuthor(i18n("Tim Jansen"), i18n("Original author"), QStringLiteral("tim@tjansen.de"));
|
||||
aboutData.addCredit(i18n("Johannes E. Schindelin"),
|
||||
i18n("libvncserver"));
|
||||
aboutData.addCredit(i18n("Const Kaplinsky"),
|
||||
i18n("TightVNC encoder"));
|
||||
aboutData.addCredit(i18n("Tridia Corporation"),
|
||||
i18n("ZLib encoder"));
|
||||
aboutData.addCredit(i18n("AT&T Laboratories Boston"),
|
||||
i18n("original VNC encoders and "
|
||||
aboutData.addAuthor(ki18n("George Goldberg"),
|
||||
ki18n("Telepathy tubes support"),
|
||||
"george.goldberg@collabora.co.uk");
|
||||
aboutData.addAuthor(ki18n("George Kiagiadakis"),
|
||||
KLocalizedString(),
|
||||
"george.kiagiadakis@collabora.co.uk");
|
||||
aboutData.addAuthor(ki18n("Alessandro Praduroux"), ki18n("KDE4 porting"), "pradu@pradu.it");
|
||||
aboutData.addAuthor(ki18n("Tim Jansen"), ki18n("Original author"), "tim@tjansen.de");
|
||||
aboutData.addCredit(ki18n("Johannes E. Schindelin"),
|
||||
ki18n("libvncserver"));
|
||||
aboutData.addCredit(ki18n("Const Kaplinsky"),
|
||||
ki18n("TightVNC encoder"));
|
||||
aboutData.addCredit(ki18n("Tridia Corporation"),
|
||||
ki18n("ZLib encoder"));
|
||||
aboutData.addCredit(ki18n("AT&T Laboratories Boston"),
|
||||
ki18n("original VNC encoders and "
|
||||
"protocol design"));
|
||||
KAboutData::setApplicationData(aboutData);
|
||||
KCmdLineArgs::init(argc, argv, &aboutData);
|
||||
|
||||
QCommandLineParser parser;
|
||||
aboutData.setupCommandLine(&parser);
|
||||
const QCommandLineOption nodialogOption(QStringList{ QStringLiteral("nodialog") }, i18n("Do not show the invitations management dialog at startup"));
|
||||
parser.addOption(nodialogOption);
|
||||
|
||||
parser.process(app);
|
||||
aboutData.processCommandLine(&parser);
|
||||
|
||||
KDBusService service(KDBusService::Unique, &app);
|
||||
KCmdLineOptions options;
|
||||
options.add("nodialog", ki18n("Do not show the invitations management dialog at startup"));
|
||||
KCmdLineArgs::addCmdLineOptions(options);
|
||||
|
||||
KUniqueApplication app;
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
if (KWindowSystem::isPlatformX11()) {
|
||||
if (!checkX11Capabilities()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// upgrade the configuration
|
||||
checkOldX11PluginConfig();
|
||||
} else if (KWindowSystem::isPlatformWayland()) {
|
||||
// check that default plugin in Wayland is PipeWire
|
||||
checkWaylandPluginConfig();
|
||||
} else {
|
||||
KMessageBox::error(nullptr,
|
||||
i18n("Desktop Sharing is not running under an X11 Server or Wayland.\n"
|
||||
"Other display servers are currently not supported."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
if (!checkX11Capabilities()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
//init the core
|
||||
InvitationsRfbServer::init();
|
||||
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
TubesRfbServer::init();
|
||||
#endif
|
||||
|
||||
//init the GUI
|
||||
MainWindow mainWindow;
|
||||
TrayIcon trayicon(&mainWindow);
|
||||
|
||||
if (KrfbConfig::startMinimized()) {
|
||||
mainWindow.hide();
|
||||
} else if (app.isSessionRestored() && KMainWindow::canBeRestored(1)) {
|
||||
if (app.isSessionRestored() && KMainWindow::canBeRestored(1)) {
|
||||
mainWindow.restore(1, false);
|
||||
} else if (!parser.isSet(nodialogOption)) {
|
||||
} else if (KCmdLineArgs::parsedArgs()->isSet("dialog")) {
|
||||
mainWindow.show();
|
||||
}
|
||||
|
||||
sigset_t sigs;
|
||||
sigemptyset(&sigs);
|
||||
sigaddset(&sigs, SIGPIPE);
|
||||
sigprocmask(SIG_BLOCK, &sigs, nullptr);
|
||||
sigprocmask(SIG_BLOCK, &sigs, 0);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,33 +13,37 @@
|
||||
#include "krfbconfig.h"
|
||||
#include "ui_configtcp.h"
|
||||
#include "ui_configsecurity.h"
|
||||
#include "ui_configframebuffer.h"
|
||||
|
||||
#include <KConfigDialog>
|
||||
#include <KLocalizedString>
|
||||
#include <KIcon>
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KMessageWidget>
|
||||
#include <KStandardGuiItem>
|
||||
#include <KSystemTimeZone>
|
||||
#include <KToolInvocation>
|
||||
#include <KStandardAction>
|
||||
#include <KActionCollection>
|
||||
#include <KLineEdit>
|
||||
#include <KNewPasswordDialog>
|
||||
#include <KPluginLoader>
|
||||
#include <KPluginMetaData>
|
||||
|
||||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
#include <QLineEdit>
|
||||
#include <QComboBox>
|
||||
#include <QSizePolicy>
|
||||
#include <QVector>
|
||||
#include <QSet>
|
||||
#include <QNetworkInterface>
|
||||
#include <QHostInfo>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QSizePolicy>
|
||||
#include <QtNetwork/QNetworkInterface>
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
#include "tubesrfbserver.h"
|
||||
#include <TelepathyQt/PendingReady>
|
||||
#include <TelepathyQt/PendingChannelRequest>
|
||||
#include <KTp/actions.h>
|
||||
#include <KTp/Widgets/contact-view-widget.h>
|
||||
#include <KTp/Models/contacts-list-model.h>
|
||||
#include <KTp/Models/contacts-filter-model.h>
|
||||
#endif
|
||||
|
||||
class TCP: public QWidget, public Ui::TCP
|
||||
{
|
||||
public:
|
||||
explicit TCP(QWidget *parent = nullptr) : QWidget(parent) {
|
||||
TCP(QWidget *parent = 0) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
}
|
||||
};
|
||||
@@ -47,52 +51,8 @@ public:
|
||||
class Security: public QWidget, public Ui::Security
|
||||
{
|
||||
public:
|
||||
explicit Security(QWidget *parent = nullptr) : QWidget(parent) {
|
||||
Security(QWidget *parent = 0) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
walletWarning = new KMessageWidget(this);
|
||||
walletWarning->setText(i18n("Storing passwords in config file is insecure!"));
|
||||
walletWarning->setCloseButtonVisible(false);
|
||||
walletWarning->setMessageType(KMessageWidget::Warning);
|
||||
walletWarning->hide();
|
||||
vboxLayout->addWidget(walletWarning);
|
||||
|
||||
// show warning when "noWallet" checkbox is checked
|
||||
QObject::connect(kcfg_noWallet, &QCheckBox::toggled, this, [this] (bool checked) {
|
||||
walletWarning->setVisible(checked);
|
||||
});
|
||||
}
|
||||
|
||||
KMessageWidget *walletWarning = nullptr;
|
||||
};
|
||||
|
||||
class ConfigFramebuffer: public QWidget, public Ui::Framebuffer
|
||||
{
|
||||
public:
|
||||
ConfigFramebuffer(QWidget *parent = nullptr) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
// hide the line edit with framebuffer string
|
||||
kcfg_preferredFrameBufferPlugin->hide();
|
||||
// fill drop-down combo with a list of real existing plugins
|
||||
this->fillFrameBuffersCombo();
|
||||
// initialize combo with currently configured framebuffer plugin
|
||||
cb_preferredFrameBufferPlugin->setCurrentText(KrfbConfig::preferredFrameBufferPlugin());
|
||||
// connect signals between combo<->lineedit
|
||||
// if we change selection in combo, lineedit is updated
|
||||
QObject::connect(cb_preferredFrameBufferPlugin, &QComboBox::currentTextChanged,
|
||||
kcfg_preferredFrameBufferPlugin, &QLineEdit::setText);
|
||||
}
|
||||
|
||||
void fillFrameBuffersCombo() {
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
|
||||
QSet<QString> unique;
|
||||
QVectorIterator<KPluginMetaData> i(plugins);
|
||||
i.toBack();
|
||||
while (i.hasPrevious()) {
|
||||
const KPluginMetaData &metadata = i.previous();
|
||||
if (unique.contains(metadata.pluginId())) continue;
|
||||
cb_preferredFrameBufferPlugin->addItem(metadata.pluginId());
|
||||
unique.insert(metadata.pluginId());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -103,64 +63,81 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
|
||||
m_passwordEditable = false;
|
||||
m_passwordLineEdit = new QLineEdit(this);
|
||||
m_passwordLineEdit = new KLineEdit(this);
|
||||
m_passwordLineEdit->setVisible(false);
|
||||
m_passwordLineEdit->setAlignment(Qt::AlignHCenter);
|
||||
|
||||
auto mainWidget = new QWidget;
|
||||
QWidget *mainWidget = new QWidget;
|
||||
m_ui.setupUi(mainWidget);
|
||||
m_ui.krfbIconLabel->setPixmap(QIcon::fromTheme(QStringLiteral("krfb")).pixmap(128));
|
||||
m_ui.krfbIconLabel->setPixmap(KIcon("krfb").pixmap(128));
|
||||
m_ui.enableUnattendedCheckBox->setChecked(
|
||||
InvitationsRfbServer::instance->allowUnattendedAccess());
|
||||
|
||||
setCentralWidget(mainWidget);
|
||||
|
||||
connect(m_ui.passwordEditButton, &QToolButton::clicked,
|
||||
this, &MainWindow::editPassword);
|
||||
connect(m_ui.enableSharingCheckBox, &QCheckBox::toggled,
|
||||
this, &MainWindow::toggleDesktopSharing);
|
||||
connect(m_ui.enableUnattendedCheckBox, &QCheckBox::toggled,
|
||||
InvitationsRfbServer::instance, &InvitationsRfbServer::toggleUnattendedAccess);
|
||||
connect(m_ui.unattendedPasswordButton, &QPushButton::clicked,
|
||||
this, &MainWindow::editUnattendedPassword);
|
||||
connect(m_ui.addressAboutButton, &QToolButton::clicked,
|
||||
this, &MainWindow::aboutConnectionAddress);
|
||||
connect(m_ui.unattendedAboutButton, &QToolButton::clicked,
|
||||
this, &MainWindow::aboutUnattendedMode);
|
||||
connect(InvitationsRfbServer::instance, &InvitationsRfbServer::passwordChanged,
|
||||
this, &MainWindow::passwordChanged);
|
||||
connect(m_ui.passwordEditButton,SIGNAL(clicked()),
|
||||
this,SLOT(editPassword()));
|
||||
connect(m_ui.enableSharingCheckBox,SIGNAL(toggled(bool)),
|
||||
this, SLOT(toggleDesktopSharing(bool)));
|
||||
connect(m_ui.enableUnattendedCheckBox, SIGNAL(toggled(bool)),
|
||||
InvitationsRfbServer::instance, SLOT(toggleUnattendedAccess(bool)));
|
||||
connect(m_ui.unattendedPasswordButton, SIGNAL(clicked()),
|
||||
this, SLOT(editUnattendedPassword()));
|
||||
connect(m_ui.addressAboutButton, SIGNAL(clicked()),
|
||||
this, SLOT(aboutConnectionAddress()));
|
||||
connect(m_ui.unattendedAboutButton, SIGNAL(clicked()),
|
||||
this, SLOT(aboutUnattendedMode()));
|
||||
connect(InvitationsRfbServer::instance, SIGNAL(passwordChanged(const QString&)),
|
||||
this, SLOT(passwordChanged(const QString&)));
|
||||
|
||||
// Figure out the address
|
||||
int port = KrfbConfig::port();
|
||||
const QList<QNetworkInterface> interfaceList = QNetworkInterface::allInterfaces();
|
||||
for (const QNetworkInterface& interface : interfaceList) {
|
||||
QList<QNetworkInterface> interfaceList = QNetworkInterface::allInterfaces();
|
||||
foreach(const QNetworkInterface & interface, interfaceList) {
|
||||
if(interface.flags() & QNetworkInterface::IsLoopBack)
|
||||
continue;
|
||||
|
||||
if(interface.flags() & QNetworkInterface::IsRunning &&
|
||||
!interface.addressEntries().isEmpty()) {
|
||||
const QString hostName = QHostInfo::localHostName();
|
||||
const QString ipAddress = interface.addressEntries().constFirst().ip().toString();
|
||||
const QString addressLabelText = hostName.isEmpty()
|
||||
? QStringLiteral("%1 : %2").arg(ipAddress).arg(port)
|
||||
: QStringLiteral("%1 (%2) : %3").arg(hostName, ipAddress).arg(port);
|
||||
m_ui.addressDisplayLabel->setText(addressLabelText);
|
||||
}
|
||||
!interface.addressEntries().isEmpty())
|
||||
m_ui.addressDisplayLabel->setText(QString("%1 : %2")
|
||||
.arg(interface.addressEntries().first().ip().toString())
|
||||
.arg(port));
|
||||
}
|
||||
|
||||
//Figure out the password
|
||||
m_ui.passwordDisplayLabel->setText(
|
||||
InvitationsRfbServer::instance->desktopPassword());
|
||||
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
|
||||
m_contactViewWidget = new KTp::ContactViewWidget(
|
||||
TubesRfbServer::instance->contactsListModel(), this);
|
||||
|
||||
m_contactViewWidget->setEnabled(false);
|
||||
connect(m_ui.enableSharingCheckBox, SIGNAL(toggled(bool)),
|
||||
m_contactViewWidget, SLOT(setEnabled(bool)));
|
||||
m_contactViewWidget->setIconSize(QSize(32,32));
|
||||
m_contactViewWidget->setMinimumWidth(120);
|
||||
m_contactViewWidget->setMaximumWidth(360);
|
||||
m_contactViewWidget->setMinimumHeight(300);
|
||||
m_contactViewWidget->contactFilterLineEdit()->setClickMessage(i18n("Search in Contacts..."));
|
||||
m_contactViewWidget->filter()->setPresenceTypeFilterFlags(KTp::ContactsFilterModel::ShowOnlyConnected);
|
||||
m_contactViewWidget->filter()->setTubesFilterStrings(QStringList("rfb"));
|
||||
m_contactViewWidget->filter()->setCapabilityFilterFlags(KTp::ContactsFilterModel::FilterByTubes);
|
||||
|
||||
m_contactViewWidget->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
|
||||
m_ui.tpContactsLayout->addWidget(m_contactViewWidget);
|
||||
connect(m_contactViewWidget, SIGNAL(contactDoubleClicked(const Tp::AccountPtr &, const KTp::ContactPtr &)),
|
||||
this, SLOT(onContactDoubleClicked(const Tp::AccountPtr &, const KTp::ContactPtr &)));
|
||||
#endif
|
||||
|
||||
|
||||
KStandardAction::quit(QCoreApplication::instance(), SLOT(quit()), actionCollection());
|
||||
KStandardAction::preferences(this, SLOT(showConfiguration()), actionCollection());
|
||||
|
||||
setupGUI();
|
||||
|
||||
if (KrfbConfig::allowDesktopControl()) {
|
||||
m_ui.enableSharingCheckBox->setChecked(true);
|
||||
}
|
||||
|
||||
setAutoSaveSettings();
|
||||
}
|
||||
|
||||
@@ -172,7 +149,7 @@ void MainWindow::editPassword()
|
||||
{
|
||||
if(m_passwordEditable) {
|
||||
m_passwordEditable = false;
|
||||
m_ui.passwordEditButton->setIcon(QIcon::fromTheme(QStringLiteral("document-properties")));
|
||||
m_ui.passwordEditButton->setIcon(KIcon("document-properties"));
|
||||
m_ui.passwordGridLayout->removeWidget(m_passwordLineEdit);
|
||||
InvitationsRfbServer::instance->setDesktopPassword(
|
||||
m_passwordLineEdit->text());
|
||||
@@ -181,7 +158,7 @@ void MainWindow::editPassword()
|
||||
m_passwordLineEdit->setVisible(false);
|
||||
} else {
|
||||
m_passwordEditable = true;
|
||||
m_ui.passwordEditButton->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
|
||||
m_ui.passwordEditButton->setIcon(KIcon("document-save"));
|
||||
m_ui.passwordGridLayout->addWidget(m_passwordLineEdit,0,0);
|
||||
m_passwordLineEdit->setText(
|
||||
InvitationsRfbServer::instance->desktopPassword());
|
||||
@@ -213,7 +190,7 @@ void MainWindow::toggleDesktopSharing(bool enable)
|
||||
if(m_passwordEditable) {
|
||||
m_passwordEditable = false;
|
||||
m_passwordLineEdit->setVisible(false);
|
||||
m_ui.passwordEditButton->setIcon(QIcon::fromTheme(QStringLiteral("document-properties")));
|
||||
m_ui.passwordEditButton->setIcon(KIcon("document-properties"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,45 +215,36 @@ void MainWindow::aboutUnattendedMode()
|
||||
i18n("KDE Desktop Sharing"));
|
||||
}
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
|
||||
void MainWindow::onContactDoubleClicked(const Tp::AccountPtr &account, const KTp::ContactPtr &contact)
|
||||
{
|
||||
Tp::PendingOperation *op = KTp::Actions::startDesktopSharing(account, contact);
|
||||
connect(op, SIGNAL(finished(Tp::PendingOperation*)),
|
||||
this, SLOT(pendingDesktopShareFinished(Tp::PendingOperation*)));
|
||||
}
|
||||
|
||||
void MainWindow::pendingDesktopShareFinished(Tp::PendingOperation *operation)
|
||||
{
|
||||
if(operation->isError()) {
|
||||
KMessageBox::error(this,
|
||||
operation->errorName() + ": " + operation->errorMessage());
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MainWindow::showConfiguration()
|
||||
{
|
||||
static QString s_prevFramebufferPlugin;
|
||||
static bool s_prevNoWallet;
|
||||
// ^^ needs to be static, because lambda will be called long time
|
||||
// after showConfiguration() ends, so auto variable would go out of scope
|
||||
// save previously selected framebuffer plugin config
|
||||
s_prevFramebufferPlugin = KrfbConfig::preferredFrameBufferPlugin();
|
||||
s_prevNoWallet = KrfbConfig::noWallet();
|
||||
|
||||
if (KConfigDialog::showDialog(QStringLiteral("settings"))) {
|
||||
if (KConfigDialog::showDialog("settings")) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto dialog = new KConfigDialog(this, QStringLiteral("settings"), KrfbConfig::self());
|
||||
dialog->addPage(new TCP, i18n("Network"), QStringLiteral("network-wired"));
|
||||
dialog->addPage(new Security, i18n("Security"), QStringLiteral("security-high"));
|
||||
dialog->addPage(new ConfigFramebuffer, i18n("Screen capture"), QStringLiteral("video-display"));
|
||||
KConfigDialog *dialog = new KConfigDialog(this, "settings", KrfbConfig::self());
|
||||
dialog->addPage(new TCP, i18n("Network"), "network-workgroup");
|
||||
dialog->addPage(new Security, i18n("Security"), "security-high");
|
||||
dialog->setHelp(QString(), "krfb");
|
||||
dialog->show();
|
||||
connect(dialog, &KConfigDialog::settingsChanged, this, [this] () {
|
||||
// check if framebuffer plugin config has changed
|
||||
if (s_prevFramebufferPlugin != KrfbConfig::preferredFrameBufferPlugin()) {
|
||||
KMessageBox::information(this, i18n("To apply framebuffer plugin setting, "
|
||||
"you need to restart the program."));
|
||||
}
|
||||
// check if kwallet config has changed
|
||||
if (s_prevNoWallet != KrfbConfig::noWallet()) {
|
||||
// try to apply settings immediately
|
||||
if (KrfbConfig::noWallet()) {
|
||||
InvitationsRfbServer::instance->closeKWallet();
|
||||
} else {
|
||||
InvitationsRfbServer::instance->openKWallet();
|
||||
// erase stored passwords from krfbconfig file
|
||||
KConfigGroup securityConfigGroup(KSharedConfig::openConfig(), "Security");
|
||||
securityConfigGroup.deleteEntry("desktopPassword");
|
||||
securityConfigGroup.deleteEntry("unattendedPassword");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::readProperties(const KConfigGroup& group)
|
||||
@@ -292,3 +260,5 @@ void MainWindow::saveProperties(KConfigGroup& group)
|
||||
group.writeEntry("Visible", isVisible());
|
||||
KMainWindow::saveProperties(group);
|
||||
}
|
||||
|
||||
#include "mainwindow.moc"
|
||||
|
||||
@@ -8,29 +8,40 @@
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_MAINWINDOW_H
|
||||
#define KRFB_MAINWINDOW_H
|
||||
#ifndef MANAGEINVITATIONSDIALOG_H
|
||||
#define MANAGEINVITATIONSDIALOG_H
|
||||
|
||||
#include "ui_mainwidget.h"
|
||||
|
||||
#include <KXmlGuiWindow>
|
||||
|
||||
class QLineEdit;
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
#include <KTp/contact.h>
|
||||
#include <TelepathyQt/PendingReady>
|
||||
namespace KTp {
|
||||
class ContactViewWidget;
|
||||
}
|
||||
namespace Tp {
|
||||
class PendingOperation;
|
||||
}
|
||||
#endif
|
||||
|
||||
class KLineEdit;
|
||||
|
||||
class MainWindow : public KXmlGuiWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow() override;
|
||||
MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
public Q_SLOTS:
|
||||
void showConfiguration();
|
||||
|
||||
protected:
|
||||
void readProperties(const KConfigGroup & group) override;
|
||||
void saveProperties(KConfigGroup & group) override;
|
||||
virtual void readProperties(const KConfigGroup & group);
|
||||
virtual void saveProperties(KConfigGroup & group);
|
||||
|
||||
private Q_SLOTS:
|
||||
void editPassword();
|
||||
@@ -39,11 +50,19 @@ class MainWindow : public KXmlGuiWindow
|
||||
void passwordChanged(const QString&);
|
||||
void aboutConnectionAddress();
|
||||
void aboutUnattendedMode();
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
void onContactDoubleClicked(const Tp::AccountPtr &, const KTp::ContactPtr &);
|
||||
void pendingDesktopShareFinished(Tp::PendingOperation*);
|
||||
#endif
|
||||
|
||||
private:
|
||||
Ui::MainWidget m_ui;
|
||||
bool m_passwordEditable;
|
||||
QLineEdit *m_passwordLineEdit = nullptr;
|
||||
KLineEdit *m_passwordLineEdit;
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
KTp::ContactViewWidget *m_contactViewWidget;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.Telepathy.Client.krfb_rfb_handler
|
||||
Exec=@CMAKE_INSTALL_PREFIX@/bin/krfb --nodialog
|
||||
@@ -1,156 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.kde.krfb.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0+</project_license>
|
||||
<name>Krfb</name>
|
||||
<name xml:lang="ca">Krfb</name>
|
||||
<name xml:lang="ca-valencia">Krfb</name>
|
||||
<name xml:lang="cs">Krfb</name>
|
||||
<name xml:lang="da">Krfb</name>
|
||||
<name xml:lang="de">Krfb</name>
|
||||
<name xml:lang="el">Krfb</name>
|
||||
<name xml:lang="en-GB">Krfb</name>
|
||||
<name xml:lang="es">Krfb</name>
|
||||
<name xml:lang="et">Krfb</name>
|
||||
<name xml:lang="eu">Krfb</name>
|
||||
<name xml:lang="fi">Krfb</name>
|
||||
<name xml:lang="fr">Krfb</name>
|
||||
<name xml:lang="gl">Krfb</name>
|
||||
<name xml:lang="ia">Krfb</name>
|
||||
<name xml:lang="id">Krfb</name>
|
||||
<name xml:lang="it">Krfb</name>
|
||||
<name xml:lang="ko">Krfb</name>
|
||||
<name xml:lang="nl">Krfb</name>
|
||||
<name xml:lang="nn">Krfb</name>
|
||||
<name xml:lang="pl">Krfb</name>
|
||||
<name xml:lang="pt">Krfb</name>
|
||||
<name xml:lang="pt-BR">Krfb</name>
|
||||
<name xml:lang="ru">Krfb</name>
|
||||
<name xml:lang="sk">Krfb</name>
|
||||
<name xml:lang="sl">Krfb</name>
|
||||
<name xml:lang="sr">КРФБ</name>
|
||||
<name xml:lang="sr-Latn">KRFB</name>
|
||||
<name xml:lang="sr-ijekavian">КРФБ</name>
|
||||
<name xml:lang="sr-ijekavianlatin">KRFB</name>
|
||||
<name xml:lang="sv">Krfb</name>
|
||||
<name xml:lang="tr">Krfb</name>
|
||||
<name xml:lang="uk">Krfb</name>
|
||||
<name xml:lang="x-test">xxKrfbxx</name>
|
||||
<name xml:lang="zh-CN">Krfb</name>
|
||||
<name xml:lang="zh-TW">Krfb</name>
|
||||
<summary>Share your desktop to another computer via VNC</summary>
|
||||
<summary xml:lang="ca">Comparteix l'escriptori amb un altre ordinador a través de VNC</summary>
|
||||
<summary xml:lang="ca-valencia">Comparteix l'escriptori amb un altre ordinador a través de VNC</summary>
|
||||
<summary xml:lang="cs">Sdílejte své pracovní prostředí na jiný počítač pomocí VNC</summary>
|
||||
<summary xml:lang="da">Del dit skrivebord til en anden computer via VNC</summary>
|
||||
<summary xml:lang="de">Verbindung Ihrer Arbeitsfläche zu anderen Rechnern über VNC</summary>
|
||||
<summary xml:lang="el">Μοιραστείτε την επιφάνεια εργασίας σας με άλλον υπολογιστή μέσω VNC</summary>
|
||||
<summary xml:lang="en-GB">Share your desktop to another computer via VNC</summary>
|
||||
<summary xml:lang="es">Compartir su escritorio con otro equipo usando VNC</summary>
|
||||
<summary xml:lang="et">Oma töölaua jagamine VNC kaudu teise arvutisse</summary>
|
||||
<summary xml:lang="eu">Partekatu zure mahaigaina beste ordenagailu batekin VNC erabiliz</summary>
|
||||
<summary xml:lang="fi">Jaa työpöytä toiselle koneelle VNC:n kautta</summary>
|
||||
<summary xml:lang="fr">Partager votre bureau avec un autre ordinateur grâce à « VNC »</summary>
|
||||
<summary xml:lang="ia">Compartir tu scriptorio a un altere computator via VNC</summary>
|
||||
<summary xml:lang="id">Bagikan desktopmu ke komputer lainnya via VNC</summary>
|
||||
<summary xml:lang="it">Condividi il desktop con un altro computer tramite VNC</summary>
|
||||
<summary xml:lang="ko">내 데스크톱을 VNC로 다른 컴퓨터와 공유</summary>
|
||||
<summary xml:lang="nl">Uw bureaublad delen naar een andere computer via VNC</summary>
|
||||
<summary xml:lang="nn">Del skrivebordet med ei anna maskin via VNC</summary>
|
||||
<summary xml:lang="pl">Udostępnij swój pulpit innemu komputerowi przez VNC</summary>
|
||||
<summary xml:lang="pt">Partilhar o seu ecrã com outro computador por VNC</summary>
|
||||
<summary xml:lang="pt-BR">Compartilhar sua área de trabalho com outro computador via VNC</summary>
|
||||
<summary xml:lang="sl">Deli namizje z drugim računalnikom prek VNC</summary>
|
||||
<summary xml:lang="sv">Dela ditt skrivbord med en annan dator via VNC</summary>
|
||||
<summary xml:lang="uk">Надайте вашу стільницю у спільне користування з іншим комп'ютером за допомогою VNC</summary>
|
||||
<summary xml:lang="x-test">xxShare your desktop to another computer via VNCxx</summary>
|
||||
<summary xml:lang="zh-CN">通过 VNC 分享您的桌面到另一台电脑</summary>
|
||||
<description>
|
||||
<p>Krfb Desktop Sharing is a server application that allows you to share your current session with a user on another machine, who can use a VNC client to view or even control the desktop.</p>
|
||||
<p xml:lang="ca">El Krfb és una aplicació de servidor que permet compartir la vostra sessió actual amb un usuari en una altra màquina, la qual pot emprar un client VNC per a veure o controlar l'escriptori.</p>
|
||||
<p xml:lang="ca-valencia">El Krfb és una aplicació de servidor que permet compartir la vostra sessió actual amb un usuari en una altra màquina, la qual pot emprar un client VNC per a veure o controlar l'escriptori.</p>
|
||||
<p xml:lang="da">Krfb-skrivebordsdeling er et serverprogram der giver dig mulighed for at dele din nuværende session med en bruger på en anden maskine som kan bruge en VNC-klient til at vise eller endda styrer skrivebordet.</p>
|
||||
<p xml:lang="de">Krfb ist eine Serveranwendung, welche die gemeinsame Benutzung der aktuellen Sitzung mit einem Benutzer auf einem anderen Rechner ermöglicht, der mit Hilfe eines VNC-Programms den Bildschirminhalt sehen oder sogar die Arbeitsfläche bedienen kann.</p>
|
||||
<p xml:lang="el">Η κοινή χρήση επιφάνειας εργασίας Krfb είναι μια εφαρμογή εξυπηρετητή που σας επιτρέπει να μοιράζεστε την τρέχουσα συνεδρία σας με έναν χρήστη σε άλλο μηχάνημα, ο οποίος μπορεί να χρησιμοποιεί έναν πελάτη VNC για να παρακολουθεί ή και να ελέγχει την επιφάνεια εργασίας σας.</p>
|
||||
<p xml:lang="en-GB">Krfb Desktop Sharing is a server application that allows you to share your current session with a user on another machine, who can use a VNC client to view or even control the desktop.</p>
|
||||
<p xml:lang="es">Krfb para compartir el escritorio es una aplicación de servidor que le permite compartir su sesión actual con un usuario de otra máquina, que puede usar un cliente VNC para ver e incluso controlar su escritorio.</p>
|
||||
<p xml:lang="et">Krfb töölaua jagamine on serverirakendus, mis võimaldab jagada aktiivset seanssi mõne teise masina taga istuva kasutajaga, kes saab VNC kliendi kaudu töölauda näha või isegi juhtida.</p>
|
||||
<p xml:lang="eu">Krfb Mahaigaina Partekatzea zerbitzari aplikazio bat da zure uneko saioa beste makina batean dagoen erabiltzaile batekin partekatzen uzten dizuna. Beste makinan VNC bezeroa erabil dezake zure mahaigaina ikusi edo baita kontrolatzeko ere.</p>
|
||||
<p xml:lang="fi">Krfb-työpöytäjako on palvelinsovellus, jolla voit jakaa nykyisen istuntosi toisen koneen käyttäjälle, joka voi VNC-asiakkaalla nähdä tai jopa hallita työpöytääsi.</p>
|
||||
<p xml:lang="fr">Le partage de bureau Krfb est une application de serveur qui vous permet de partager votre session courante avec un utilisateur sur une autre machine, qui peut utiliser un client VNC pour afficher et même contrôler le bureau.</p>
|
||||
<p xml:lang="gl">Krfb é unha aplicación de servidor que permite compartir a sesión actual cun usuario que está noutro equipo, que pode usar un cliente VNC para ver ou mesmo controlar o escritorio.</p>
|
||||
<p xml:lang="ia">Krfb Desktop Sharing es un application de servitor que te permitte compartir tu session currente con un usator sur un altere machina,le qual pote usar un cliente VNC per vider o anque controlar le scriptorio.</p>
|
||||
<p xml:lang="id">Krfb Desktop Sharing adalah aplikasi server yang memungkinkan kamu untuk berbagi sesimu saat ini dengan pengguna di mesin lain, yang bisa menggunakan klien VNC untuk menampilkan atau bahkan mengendalikan desktop.</p>
|
||||
<p xml:lang="it">Condivisione del desktop Krfb è un'applicazione server che permette di condividere la sessione attuale con un utente su un'altra macchina, che potrà usare un client VNC per visualizzare ed anche controllare il desktop.</p>
|
||||
<p xml:lang="ko">Krfb 데스크톱 공유는 현재 세션을 다른 머신의 사용자와 VNC를 통해서 공유하거나 원격 제어를 요청할 수 있는 서버 프로그램입니다.</p>
|
||||
<p xml:lang="nl">Bureaublad delen is een server-applicatie die u in staat stelt uw huidige sessie te delen met een gebruiker op een andere machine, die een VNC-client kan gebruiken om uw bureaublad te bekijken of zelfs te besturen.</p>
|
||||
<p xml:lang="nn">Krfb skrivebordsdeling er eit tenarprogram som lèt deg dela skrivebordsøkta di med ein brukar på ei anna maskin. Vedkommande kan så bruka ein VNC-klient for å sjå og eventuelt òg styra økta.</p>
|
||||
<p xml:lang="pl">Współdzielenie pulpitu Krfb jest aplikacją serwerową, która umożliwia współdzielenie twojej bieżącej sesji z użytkownikiem na innym komputerze, który może użyć klienta VNC do oglądania,a a nawet sterowania twoim pulpitem.</p>
|
||||
<p xml:lang="pt">A Partilha de Ecrã Krfb é uma aplicação de servidor que lhe permite partilhar a sua sessão actual com um utilizador noutra máquina, o qual poderá usar um cliente de VNC para ver ou mesmo controlar o ambiente de trabalho.</p>
|
||||
<p xml:lang="pt-BR">Krfb Desktop Sharing é um aplicativo de servidor que lhe permite compartilhar a sua sessão atual com um usuário em outra máquina, que poderá usar um cliente de VNC para ver ou mesmo controlar a máquina.</p>
|
||||
<p xml:lang="ru">Krfb является сервером, который позволяет вам предоставлять доступ к своему текущему сеансу пользователю на другом компьютере, который использует клиент VNC для просмотра или управления вашим рабочим столом.</p>
|
||||
<p xml:lang="sk">Krfb je serverová aplikácia, ktorá vám umožní zdieľať vaše aktuálne sedenie s používateľom na inom stroji, ktorý môže používať VNC klienta na pripojenie alebo ovládanie stanice.</p>
|
||||
<p xml:lang="sl">Souporaba namizja Krfb je strežniški program, ki vam dovoli, da delite vašo trenutno sejo z uporabnikom na drugem računalniku, ki ima odjemalec VNC. Uporabnik lahko gleda ali celo nadzira namizje.</p>
|
||||
<p xml:lang="sr">КРФБ је серверски програм за дељење површи, којим можете да поделите своју текућу сесију са корисником на другој машини. Удаљени корисник може да употреби неки ВНЦ клијент за гледање површи, па чак и управљање њоме.</p>
|
||||
<p xml:lang="sr-Latn">KRFB je serverski program za deljenje površi, kojim možete da podelite svoju tekuću sesiju sa korisnikom na drugoj mašini. Udaljeni korisnik može da upotrebi neki VNC klijent za gledanje površi, pa čak i upravljanje njome.</p>
|
||||
<p xml:lang="sr-ijekavian">КРФБ је серверски програм за дељење површи, којим можете да поделите своју текућу сесију са корисником на другој машини. Удаљени корисник може да употреби неки ВНЦ клијент за гледање површи, па чак и управљање њоме.</p>
|
||||
<p xml:lang="sr-ijekavianlatin">KRFB je serverski program za deljenje površi, kojim možete da podelite svoju tekuću sesiju sa korisnikom na drugoj mašini. Udaljeni korisnik može da upotrebi neki VNC klijent za gledanje površi, pa čak i upravljanje njome.</p>
|
||||
<p xml:lang="sv">Krfb-skrivbordsdelning är ett serverprogram som gör det möjligt att dela aktuell session med en användare på en annan dator, som kan använda en VNC-klient för att betrakta eller till och med kontrollera skrivbordet.</p>
|
||||
<p xml:lang="tr">Krfb Masaüstü Paylaşımı, mevcut oturumu masaüstünü görüntülemek veya kontrol etmek için, VNC istemcisi kullanan başka bir makinedeki, kullanıcıyla paylaşmanızı sağlayan bir sunucu uygulamasıdır.</p>
|
||||
<p xml:lang="uk">Програма для спільного використання стільниці Krfb — це серверна програма, яка надає вам змогу розділити ваш поточний сеанс роботи з користувачем, який працює на іншому комп’ютері, так, щоб цей користувач зміг скористатися клієнтом VNC для перегляду або навіть керування вашою стільницею.</p>
|
||||
<p xml:lang="x-test">xxKrfb Desktop Sharing is a server application that allows you to share your current session with a user on another machine, who can use a VNC client to view or even control the desktop.xx</p>
|
||||
<p xml:lang="zh-CN">Krfb 桌面共享是一个可以让您与另一个在其他机器上的用户共享当前会话的服务器程序,他可以使用 VNC 客户端来查看甚至控制桌面。</p>
|
||||
<p xml:lang="zh-TW">Krfb 桌面分享是款伺服器應用程式,它可以將您目前的桌面階段分享給一位於其他主機上的使用者,以讓他能使用 VNC 用戶端檢視、甚至控制您的桌面。</p>
|
||||
</description>
|
||||
<url type="homepage">https://userbase.kde.org/Krfb</url>
|
||||
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&product=krfb</url>
|
||||
<url type="donation">https://www.kde.org/community/donations</url>
|
||||
<url type="help">https://docs.kde.org/?application=krfb</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<caption>Sharing desktop with Krfb</caption>
|
||||
<caption xml:lang="ca">Compartint l'escriptori amb el Krfb</caption>
|
||||
<caption xml:lang="ca-valencia">Compartint l'escriptori amb el Krfb</caption>
|
||||
<caption xml:lang="cs">Sdílím pracovní plochu pomocí Krfb</caption>
|
||||
<caption xml:lang="da">Deler skrivebord med Krfb</caption>
|
||||
<caption xml:lang="de">Freigabe der Arbeitsfläche mit Krfb</caption>
|
||||
<caption xml:lang="el">Κοινή χρήση επιφάνειας εργασίας με το Krfb</caption>
|
||||
<caption xml:lang="en-GB">Sharing desktop with Krfb</caption>
|
||||
<caption xml:lang="es">Compartiendo el escritorio con Krfb</caption>
|
||||
<caption xml:lang="et">Töölaua jagamine Krfb abil</caption>
|
||||
<caption xml:lang="eu">Mahaigaina Krfb-ren bidez partekatzea</caption>
|
||||
<caption xml:lang="fi">Työpöydän jakaminen Krfb:llä</caption>
|
||||
<caption xml:lang="fr">Partage de bureau grâce à Krfb</caption>
|
||||
<caption xml:lang="gl">Compartindo o escritorio con Krfb</caption>
|
||||
<caption xml:lang="ia">Compartir scriptorio con Krfb</caption>
|
||||
<caption xml:lang="id">Berbagi desktop dengan Krfb</caption>
|
||||
<caption xml:lang="it">Condivisone del desktop con Krfb</caption>
|
||||
<caption xml:lang="ko">Krfb로 데스크톱 공유</caption>
|
||||
<caption xml:lang="nl">Bureaublad delen met Krfb</caption>
|
||||
<caption xml:lang="nn">Skrivebordsdeling med Krfb</caption>
|
||||
<caption xml:lang="pl">Udostępnienie pulpitu przy użyciu Krfb</caption>
|
||||
<caption xml:lang="pt">Partilha do ecrã com o Krfb</caption>
|
||||
<caption xml:lang="pt-BR">Compartilhando a área de trabalho com o Krfb</caption>
|
||||
<caption xml:lang="ru">Общий доступ к рабочему столу с использованием Krfb</caption>
|
||||
<caption xml:lang="sk">Zdieľanie pracovnej plochy s Krfb</caption>
|
||||
<caption xml:lang="sl">Deljenje namizij s Krfb</caption>
|
||||
<caption xml:lang="sv">Dela skrivbord med Krfb</caption>
|
||||
<caption xml:lang="uk">Спільне використання стільниці за допомогою Krfb</caption>
|
||||
<caption xml:lang="x-test">xxSharing desktop with Krfbxx</caption>
|
||||
<caption xml:lang="zh-CN">使用 Krfb 共享桌面</caption>
|
||||
<caption xml:lang="zh-TW">使用 Krfb 分享桌面</caption>
|
||||
<image>https://cdn.kde.org/screenshots/krfb/krfb.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<provides>
|
||||
<binary>krfb</binary>
|
||||
</provides>
|
||||
<project_group>KDE</project_group>
|
||||
<releases>
|
||||
<release version="21.08.3" date="2021-11-04"/>
|
||||
<release version="21.08.2" date="2021-10-07"/>
|
||||
<release version="21.08.1" date="2021-09-02"/>
|
||||
<release version="21.08.0" date="2021-08-12"/>
|
||||
</releases>
|
||||
</component>
|
||||
@@ -1,176 +0,0 @@
|
||||
# KDE Config File
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=krfb -qwindowtitle %c %i
|
||||
Icon=krfb
|
||||
X-DBUS-StartupType=Unique
|
||||
X-DocPath=krfb/index.html
|
||||
Terminal=false
|
||||
Name=Krfb
|
||||
Name[ar]=Krfb
|
||||
Name[bg]=Krfb
|
||||
Name[bn]=কে-আর-এফ-বি
|
||||
Name[br]=Krfb
|
||||
Name[bs]=Krfb
|
||||
Name[ca]=Krfb
|
||||
Name[ca@valencia]=Krfb
|
||||
Name[cs]=Krfb
|
||||
Name[da]=Krfb
|
||||
Name[de]=Krfb
|
||||
Name[el]=Krfb
|
||||
Name[en_GB]=Krfb
|
||||
Name[eo]=Krfb
|
||||
Name[es]=Krfb
|
||||
Name[et]=Krfb
|
||||
Name[eu]=Krfb
|
||||
Name[fi]=Krfb
|
||||
Name[fr]=Krfb
|
||||
Name[ga]=Krfb
|
||||
Name[gl]=Krfb
|
||||
Name[he]=Krfb
|
||||
Name[hi]=केआरएफबी
|
||||
Name[hne]=केआरएफबी
|
||||
Name[hr]=Krfb
|
||||
Name[hu]=Krfb
|
||||
Name[ia]=Krfb
|
||||
Name[id]=Krfb
|
||||
Name[is]=Krfb
|
||||
Name[it]=Krfb
|
||||
Name[ja]=Krfb
|
||||
Name[kk]=Krfb
|
||||
Name[km]=Krfb
|
||||
Name[ko]=Krfb
|
||||
Name[lt]=Krfb
|
||||
Name[lv]=Krfb
|
||||
Name[ml]=കെആര്എഫ്ബി
|
||||
Name[mr]=के-आर-एफ-बी
|
||||
Name[nb]=Krfb
|
||||
Name[nds]=KRfb
|
||||
Name[ne]=Krfb
|
||||
Name[nl]=Krfb
|
||||
Name[nn]=Krfb
|
||||
Name[pa]=Krfb
|
||||
Name[pl]=Krfb
|
||||
Name[pt]=Krfb
|
||||
Name[pt_BR]=Krfb
|
||||
Name[ro]=Krfb
|
||||
Name[ru]=Krfb
|
||||
Name[si]=Krfb
|
||||
Name[sk]=Krfb
|
||||
Name[sl]=Krfb
|
||||
Name[sq]=Krfb
|
||||
Name[sr]=КРФБ
|
||||
Name[sr@ijekavian]=КРФБ
|
||||
Name[sr@ijekavianlatin]=KRFB
|
||||
Name[sr@latin]=KRFB
|
||||
Name[sv]=Krfb
|
||||
Name[tr]=Krfb
|
||||
Name[ug]=Krfb
|
||||
Name[uk]=Krfb
|
||||
Name[uz]=Krfb
|
||||
Name[uz@cyrillic]=Krfb
|
||||
Name[vi]=Krfb
|
||||
Name[x-test]=xxKrfbxx
|
||||
Name[zh_CN]=Krfb
|
||||
Name[zh_HK]=Krfb
|
||||
Name[zh_TW]=桌面分享_Krfb
|
||||
GenericName=Desktop Sharing (VNC)
|
||||
GenericName[ca]=Compartició de l'escriptori (VNC)
|
||||
GenericName[ca@valencia]=Compartició de l'escriptori (VNC)
|
||||
GenericName[cs]=Sdílení pracovní plochy (VNC)
|
||||
GenericName[da]=Skrivebordsdeling (VNC)
|
||||
GenericName[de]=Arbeitsflächen-Freigabe (VNC)
|
||||
GenericName[el]=Κοινή χρήση επιφάνειας εργασίας (VNC)
|
||||
GenericName[en_GB]=Desktop Sharing (VNC)
|
||||
GenericName[es]=Escritorio compartido (VNC)
|
||||
GenericName[et]=Töölaua jagamine (VNC)
|
||||
GenericName[eu]=Mahaigaina partekatzea (VNC)
|
||||
GenericName[fi]=Työpöydän jakaminen (VNC)
|
||||
GenericName[fr]=Partage de bureaux (VNC)
|
||||
GenericName[ia]=Compartir de scriptorio (VNC)
|
||||
GenericName[it]=Condivisione del desktop (VNC)
|
||||
GenericName[ko]=데스크톱 공유(VNC)
|
||||
GenericName[nl]=Bureaublad delen (VNC)
|
||||
GenericName[nn]=Skrivebordsdeling (VNC)
|
||||
GenericName[pl]=Współdzielenie pulpitu (VNC)
|
||||
GenericName[pt]=Partilha do Ecrã (VNC)
|
||||
GenericName[pt_BR]=Compartilhamento de ambiente de trabalho (VNC)
|
||||
GenericName[sl]=Souporaba namizja (VNC)
|
||||
GenericName[sv]=Skrivbordsdelning (VNC)
|
||||
GenericName[uk]=Спільні стільниці (VNC)
|
||||
GenericName[x-test]=xxDesktop Sharing (VNC)xx
|
||||
GenericName[zh_CN]=桌面共享 (VNC)
|
||||
Comment=Desktop Sharing
|
||||
Comment[af]=Werkskerm Deeling
|
||||
Comment[ar]=مشاركة سطح المكتب
|
||||
Comment[bg]=Споделяне на работния плот
|
||||
Comment[bn]=ডেস্কটপ ভাগাভাগি
|
||||
Comment[br]=Rannañ ar vurev
|
||||
Comment[bs]=Dijeljenje radne površine
|
||||
Comment[ca]=Compartir l'escriptori
|
||||
Comment[ca@valencia]=Compartir l'escriptori
|
||||
Comment[cs]=Sdílení pracovní plochy
|
||||
Comment[cy]=Rhannu Penbwrdd
|
||||
Comment[da]=Skrivebordsdeling
|
||||
Comment[de]=Arbeitsflächen-Freigabe
|
||||
Comment[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
Comment[en_GB]=Desktop Sharing
|
||||
Comment[eo]=Tabula komunigado
|
||||
Comment[es]=Escritorio compartido
|
||||
Comment[et]=Töölaua jagamine
|
||||
Comment[eu]=Mahaigaina partekatzea
|
||||
Comment[fi]=Työpöydän jakaminen
|
||||
Comment[fr]=Partage de bureaux
|
||||
Comment[ga]=Roinnt Deisce
|
||||
Comment[gl]=Compartición do escritorio
|
||||
Comment[he]=שיתוף שולחנות עבודה
|
||||
Comment[hi]=डेस्कटॉप साझेदारी
|
||||
Comment[hne]=डेस्कटाप साझेदारी
|
||||
Comment[hr]=Dijeljenje radne površine
|
||||
Comment[hu]=Munkaasztal-megosztás
|
||||
Comment[ia]=Compartir de scriptorio
|
||||
Comment[id]=Desktop Sharing
|
||||
Comment[is]=Skjáborðamiðlun
|
||||
Comment[it]=Condivisione del desktop
|
||||
Comment[ja]=デスクトップ共有
|
||||
Comment[kk]=Үстелді ортақтастыру
|
||||
Comment[km]=ការចែករំលែកផ្ទែតុ
|
||||
Comment[ko]=데스크톱 공유
|
||||
Comment[lt]=Dalinimasis darbalaukiu
|
||||
Comment[lv]=Darbvirsmas koplietošana
|
||||
Comment[mk]=Делење на работната површина
|
||||
Comment[ml]=പണിയിടം പങ്കുവെക്കല്
|
||||
Comment[mr]=डेस्कटॉप शेअरींग
|
||||
Comment[ms]=Perkongsian Ruang Kerja
|
||||
Comment[nb]=Delte skrivebord
|
||||
Comment[nds]=Schriefdisch-Freegaav
|
||||
Comment[nl]=Bureaublad delen
|
||||
Comment[nn]=Skrivebordsdeling
|
||||
Comment[pa]=ਡੈਸਕਟਾਪ ਸ਼ੇਅਰਿੰਗ
|
||||
Comment[pl]=Współdzielenie pulpitu
|
||||
Comment[pt]=Partilha do Ecrã
|
||||
Comment[pt_BR]=Compartilhamento do ambiente de trabalho
|
||||
Comment[ro]=Partajare birou
|
||||
Comment[ru]=Параметры общего рабочего стола
|
||||
Comment[si]=වැඩතල හවුල්
|
||||
Comment[sk]=Zdieľanie pracovnej plochy
|
||||
Comment[sl]=Souporaba namizja
|
||||
Comment[sr]=Дељење површи
|
||||
Comment[sr@ijekavian]=Дијељење површи
|
||||
Comment[sr@ijekavianlatin]=Dijeljenje površi
|
||||
Comment[sr@latin]=Deljenje površi
|
||||
Comment[sv]=Dela ut skrivbordet
|
||||
Comment[ta]=பணிமேடை பகிர்வு
|
||||
Comment[tg]=Истифодаи Муштараки Мизи Корӣ
|
||||
Comment[th]=ใช้งานพื้นที่ทำงานร่วมกัน
|
||||
Comment[tr]=Masaüstü Paylaşımı
|
||||
Comment[ug]=ئۈستەلئۈستىنى ھەمبەھىرلەش
|
||||
Comment[uk]=Спільні стільниці
|
||||
Comment[xh]=Ulwahlulelano lwe Desktop
|
||||
Comment[x-test]=xxDesktop Sharingxx
|
||||
Comment[zh_CN]=桌面共享
|
||||
Comment[zh_HK]=桌面分享
|
||||
Comment[zh_TW]=桌面分享
|
||||
Categories=Qt;KDE;Network;RemoteAccess;
|
||||
X-DBUS-ServiceName=org.kde.krfb
|
||||
X-KDE-Wayland-Interfaces=org_kde_kwin_fake_input,org_kde_kwin_remote_access_manager
|
||||
@@ -1,44 +0,0 @@
|
||||
# KDE Config File
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=@CMAKE_INSTALL_PREFIX@/bin/krfb-virtualmonitor
|
||||
Icon=krfb
|
||||
Terminal=false
|
||||
Name=KRFBs Virtual Monitor
|
||||
Name[ca]=Monitor virtual del Krfb
|
||||
Name[ca@valencia]=Monitor virtual del Krfb
|
||||
Name[el]=Εικονική οθόνη του KRFB
|
||||
Name[es]=Monitor virtual de KRFB
|
||||
Name[fi]=KRFB:n virtuaalinäyttö
|
||||
Name[fr]=Moniteur virtuel « Krfb »
|
||||
Name[ia]=Virtual Monitor de KRFB
|
||||
Name[it]=Monitor virtuale di KRFB
|
||||
Name[ko]=KRFBs 가상 모니터
|
||||
Name[nl]=Virtuele monitor van KRFB
|
||||
Name[pl]=Monitor wirtualny KRFB
|
||||
Name[pt]=Monitor Virtual do KRFB
|
||||
Name[pt_BR]=Monitor virtual do KRFB
|
||||
Name[sl]=Navidezni monitor KRFB
|
||||
Name[sv]=Krfb:s virtuella bildskärm
|
||||
Name[uk]=Віртуальний монітор KRFB
|
||||
Name[x-test]=xxKRFBs Virtual Monitorxx
|
||||
Comment=Remote Virtual Monitor
|
||||
Comment[ca]=Monitor virtual remot
|
||||
Comment[ca@valencia]=Monitor virtual remot
|
||||
Comment[el]=Απομακρυσμένη εικονική οθόνη
|
||||
Comment[es]=Monitor virtual remoto
|
||||
Comment[fi]=Virtuaalinen etänäyttö
|
||||
Comment[fr]=Moniteur virtuel distant
|
||||
Comment[ia]=Monitor Virtual Remote
|
||||
Comment[it]=Monitor virtuale remoto
|
||||
Comment[ko]=원격 가상 모니터
|
||||
Comment[nl]=Virtual Monitor op afstand
|
||||
Comment[pl]=Zdalny monitor wirtualny
|
||||
Comment[pt]=Monitor Virtual Remoto
|
||||
Comment[pt_BR]=Monitor virtual remoto
|
||||
Comment[sl]=Oddaljeni navidezni monitor
|
||||
Comment[sv]=Virtuell fjärrbildskärm
|
||||
Comment[uk]=Віддалений віртуальний монітор
|
||||
Comment[x-test]=xxRemote Virtual Monitorxx
|
||||
NoDisplay=true
|
||||
X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1
|
||||
@@ -8,10 +8,6 @@
|
||||
|
||||
#include "rfb/rfb.h"
|
||||
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
#undef TRUE
|
||||
#undef FALSE
|
||||
|
||||
|
||||