Compare commits

..

19 Commits

Author SHA1 Message Date
nobody
29e6aa4636 This commit was manufactured by cvs2svn to create tag
'KDE_3_1_2_RELEASE'.

svn path=/tags/KDE_3_1_2_RELEASE/kdenetwork/krfb/; revision=225764
2003-05-14 08:22:51 +00:00
Script Kiddy
aac12c0641 CVS_SILENT made messages
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=223116
2003-05-01 02:49:04 +00:00
Tim Jansen
ec5aec621c Get rid of in6_addr (on systems without AF_INET6)
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=219162
2003-04-08 21:56:42 +00:00
Script Kiddy
78d6970930 CVS_SILENT made messages
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=218189
2003-04-04 01:32:14 +00:00
Tim Jansen
fe4bbda0c5 #53620: solaris 7 problems / AF_INET6 compilation problems again
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=216209
2003-03-25 19:37:17 +00:00
Tim Jansen
0b256c5117 #54873: get rid of socklen_t which is not available on Solaris 2.6
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=215975
2003-03-24 12:44:23 +00:00
Tim Jansen
12e8effc1a #51792: a bunch of includes to make Solaris 2/6 happy
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=215971
2003-03-24 12:26:25 +00:00
Tim Jansen
98debc4910 Make krfb work on thin-clients without XShm. You need a lot of bandwidth
though...

svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=205753
2003-02-09 01:10:59 +00:00
Tim Jansen
a65c5fd148 Fix #52126 (krfb mangles colours when serving 8-bit displays)
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=205627
2003-02-08 13:04:33 +00:00
Tim Jansen
1405623863 fix krfb on machines with big-endian framebuffers
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=205094
2003-02-05 18:49:51 +00:00
Tim Jansen
612e3b8aab Fix behaviour for clients that support soft cursor and rich cursor encodings (like krdc will soon): soft cursor has the higher priority
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=204221
2003-02-01 19:35:40 +00:00
Tim Jansen
f80311e260 #53620: krfb did not compile on Solaris 7
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=203810
2003-01-30 22:39:31 +00:00
Tim Jansen
caab1aad51 Backport from HEAD:
Remove read timeouts. Instead make sure to send something at least every
10 seconds (empty framebuffer requests if nothing else has been sent).
This fixes problems with the windows vnc client which had been kicked after
a minute of inactivity without losing the capability to detect dead
clients.

svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=201809
2003-01-21 21:31:43 +00:00
Tim Jansen
9a4432a0fd #51792: Compile patch for solaris versions without IPv6
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=201807
2003-01-21 21:15:28 +00:00
Dirk Mueller
fefe8c1a11 don't interpret format strings here (backport)
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=199229
2003-01-12 13:14:55 +00:00
Waldo Bastian
6b36501ba0 CCMAIL: peter@hawkins.emu.id.au
string fixes, patches by Peter Hawkins <peter@hawkins.emu.id.au>

svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=194091
2002-12-15 15:44:47 +00:00
Luboš Luňák
7426b84321 Max size limits for scanf().
Correct arguments to scanf() - people, can't you read the warnings?
Got rid of two more warnings.

svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=192448
2002-12-06 16:01:45 +00:00
Lauri Watts
b04b1591e5 Fixing Date
svn path=/branches/KDE_3_1_BRANCH/kdenetwork/doc/krfb/; revision=191476
2002-12-01 18:57:36 +00:00
Andy Fawcett
42f9c6e578 +#ifndef _BYTE_ORDER
#define _BYTE_ORDER BYTE_ORDER
+#endif
+#ifndef _LITTLE_ENDIAN
 #define _LITTLE_ENDIAN LITTLE_ENDIAN
+#endif

These are already defined on FreeBSD, so don't try and do it again.

Previously applied to HEAD, these didn't make it to the release or the branch.

svn path=/branches/KDE_3_1_BRANCH/kdenetwork/krfb/; revision=191459
2002-12-01 17:13:07 +00:00
210 changed files with 25477 additions and 11847 deletions

View File

@@ -1,3 +0,0 @@
{
"phabricator.uri" : "https://phabricator.kde.org/"
}

1
.krazy
View File

@@ -1 +0,0 @@
SKIP /kinetd/

View File

@@ -1,113 +0,0 @@
cmake_minimum_required(VERSION 3.0)
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "04")
set (RELEASE_SERVICE_VERSION_MICRO "2")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(krfb VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION 5.12.0)
set(KF5_MIN_VERSION 5.68.0)
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(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMInstallIcons)
include(ECMAddAppIcon)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
include(FeatureSummary)
include(CheckIncludeFile)
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
WidgetsAddons
WindowSystem
XmlGui
)
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)
find_package(PipeWire)
set_package_properties(PipeWire PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for pipewire screencast plugin"
)
ecm_setup_version(PROJECT
VARIABLE_PREFIX KRFB
VERSION_HEADER "krfb_version.h")
include_directories ("${CMAKE_CURRENT_BINARY_DIR}/krfb"
"${CMAKE_CURRENT_SOURCE_DIR}/krfb"
"${CMAKE_CURRENT_SOURCE_DIR}/krfb/ui"
)
if(Q_WS_X11)
if(NOT X11_XTest_FOUND)
message(FATAL_ERROR "krfb requires the libXtst (https://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)

View File

@@ -1,397 +0,0 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

View File

@@ -1,510 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes a de-facto standard. To achieve this, non-free programs must
be allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least
three years, to give the same user the materials specified in
Subsection 6a, above, for a charge no more than the cost of
performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.1 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, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the library,
if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

9
DCOP-INTERFACE Normal file
View File

@@ -0,0 +1,9 @@
DCOP Interfaces:
// Exits the application, disconnects clients
void exit()
// Set the desktop to be controlable from remote clients
void setAllowDesktopControl(bool)

View File

@@ -1,5 +0,0 @@
/** @mainpage Krfb API Reference
*
* Krfb provides a VNC-compatible server to share KDE desktops.
*
*/

8
Makefile.am Normal file
View File

@@ -0,0 +1,8 @@
SUBDIRS = srvloc kinetd libvncserver krfb kcm_krfb
EXTRA_DIST = AUTHORS README TODO NOTES DCOP-INTERFACE
# not a GNU package. You can remove this line, if
# have all needed files, that a GNU package needs
AUTOMAKE_OPTIONS = foreign

21
TODO
View File

@@ -1,18 +1,23 @@
For 3.2:
For 3.1:
- write SLP service template for remote desktop protocols
(documentation)
- enhance RFB with SASL authentication (Kerberos)
- encrypted connections (using SASL and/or SSL/TLS)
- with kerberos/ssl: display name of remote user in connection dialog,
kpassivepopup and systray (if name is available)
- mention that invitations are one-time on personal invitation dialog
Todo (unscheduled features):
For 3.2:
- set desktop name (username@hostname)
- apply multi-desktop patch
- trayicon mouse-over text
- configurable slp lifetime in kinetd
- slp registration refresh in kinetd when lifetime expired
- when krfb is started with URL arguments and without connection
quality, add some kind of smart algorithm to determine whether the
other host is local (maybe using SLP to announce the connectivity
of a LAN)
- enhance RFB with SASL authentication (Kerberos)
- encrypted connections (using SASL and/or SSL/TLS)
- try to solve the non-atomic KConfig changes problem
- mention that invitations are one-time on personal invitation dialog
Todo (unscheduled features):
- NAT traversal support if I can find an acceptable implementation
(probably using TURN, as soon as there is a server and newer spec for that)
- when OpenSLP supports this, allow scope configuration

View File

@@ -1,22 +0,0 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,41 +0,0 @@
# cmake macro to test LIBVNCSERVER LIB
# Copyright (c) 2006, Alessandro Praduroux <pradu@pradu.it>
# Copyright (c) 2007, Urs Wolfer <uwolfer @ kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
INCLUDE(CheckStructHasMember)
IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
# Already in cache, be silent
SET(LIBVNCSERVER_FIND_QUIETLY TRUE)
ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
FIND_PATH(LIBVNCSERVER_INCLUDE_DIR rfb/rfb.h)
FIND_LIBRARY(LIBVNCSERVER_LIBRARIES NAMES vncserver libvncserver)
# libvncserver and libvncclient are in the same package, so it does
# not make sense to add a new cmake script for finding libvncclient.
# instead just find the libvncclient also in this file.
FIND_PATH(LIBVNCCLIENT_INCLUDE_DIR rfb/rfbclient.h)
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)
ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
IF (LIBVNCSERVER_FOUND)
IF (NOT LIBVNCSERVER_FIND_QUIETLY)
MESSAGE(STATUS "Found LibVNCServer: ${LIBVNCSERVER_LIBRARIES}")
ENDIF (NOT LIBVNCSERVER_FIND_QUIETLY)
ELSE (LIBVNCSERVER_FOUND)
IF (LIBVNCSERVER_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could NOT find acceptable version of LibVNCServer (version 0.9 or later required).")
ENDIF (LIBVNCSERVER_FIND_REQUIRED)
ENDIF (LIBVNCSERVER_FOUND)
MARK_AS_ADVANCED(LIBVNCSERVER_INCLUDE_DIR LIBVNCSERVER_LIBRARIES)

View File

@@ -1,122 +0,0 @@
#.rst:
# FindPipeWire
# -------
#
# Try to find PipeWire on a Unix system.
#
# This will define the following variables:
#
# ``PipeWire_FOUND``
# True if (the requested version of) PipeWire is available
# ``PipeWire_VERSION``
# The version of PipeWire
# ``PipeWire_LIBRARIES``
# This can be passed to target_link_libraries() instead of the ``PipeWire::PipeWire``
# target
# ``PipeWire_INCLUDE_DIRS``
# This should be passed to target_include_directories() if the target is not
# used for linking
# ``PipeWire_DEFINITIONS``
# This should be passed to target_compile_options() if the target is not
# used for linking
#
# If ``PipeWire_FOUND`` is TRUE, it will also define the following imported target:
#
# ``PipeWire::PipeWire``
# The PipeWire 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.
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
# Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_search_module(PKG_PipeWire QUIET libpipewire-0.3 libpipewire-0.2)
pkg_search_module(PKG_Spa QUIET libspa-0.2 libspa-0.1)
set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS}" "${PKG_Spa_CFLAGS}")
set(PipeWire_VERSION "${PKG_PipeWire_VERSION}")
find_path(PipeWire_INCLUDE_DIRS
NAMES
pipewire/pipewire.h
HINTS
${PKG_PipeWire_INCLUDE_DIRS}
${PKG_PipeWire_INCLUDE_DIRS}/pipewire-0.3
)
find_path(Spa_INCLUDE_DIRS
NAMES
spa/param/props.h
HINTS
${PKG_Spa_INCLUDE_DIRS}
${PKG_Spa_INCLUDE_DIRS}/spa-0.2
)
find_library(PipeWire_LIBRARIES
NAMES
pipewire-0.3
pipewire-0.2
HINTS
${PKG_PipeWire_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PipeWire
FOUND_VAR
PipeWire_FOUND
REQUIRED_VARS
PipeWire_LIBRARIES
PipeWire_INCLUDE_DIRS
Spa_INCLUDE_DIRS
VERSION_VAR
PipeWire_VERSION
)
if(PipeWire_FOUND AND NOT TARGET PipeWire::PipeWire)
add_library(PipeWire::PipeWire UNKNOWN IMPORTED)
set_target_properties(PipeWire::PipeWire PROPERTIES
IMPORTED_LOCATION "${PipeWire_LIBRARIES}"
INTERFACE_COMPILE_OPTIONS "${PipeWire_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS};${Spa_INCLUDE_DIRS}"
)
endif()
mark_as_advanced(PipeWire_LIBRARIES PipeWire_INCLUDE_DIRS)
include(FeatureSummary)
set_package_properties(PipeWire PROPERTIES
URL "https://www.pipewire.org"
DESCRIPTION "PipeWire - multimedia processing"
)

4
configure.in.in Normal file
View File

@@ -0,0 +1,4 @@
KDE_CHECK_HEADER(X11/extensions/XTest.h,
[],
AC_MSG_ERROR([XTest extension header not found / no xlib headers]))

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,2 +0,0 @@
########### install files ###############
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR krfb)

4
doc/Makefile.am Executable file
View File

@@ -0,0 +1,4 @@
KDE_LANG = en
KDE_DOCS = AUTO

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

391
doc/index.docbook Normal file → Executable file
View File

@@ -1,399 +1,78 @@
<?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.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!ENTITY kappname "<application>krfb</application>">
<!ENTITY package "kdenetwork">
<!ENTITY % addindex "IGNORE">
<!ENTITY % English "INCLUDE">
]>
<book id="krfb" lang="&language;">
<book lang="&language;">
<bookinfo>
<title>The &krfb; Handbook</title>
<title>The &kappname; Handbook</title>
<authorgroup>
<author>
&Brad.Hards;
&Brad.Hards.mail;
<firstname></firstname>
<othername></othername>
<surname></surname>
<affiliation>
<address><email></email></address>
</affiliation>
</author>
<!-- TRANS:ROLES_OF_TRANSLATORS -->
</authorgroup>
<copyright>
<year>2003</year>
<holder>&Brad.Hards;</holder>
</copyright>
<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
(Major.minor.lesser), it could be used by automation scripts -->
<date>2000-09-02</date>
<releaseinfo>0.00.00</releaseinfo>
<!-- Abstract about this handbook -->
<abstract>
<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
view or even control the desktop.
&kappname; is a desktop sharing application for &kde;
</para>
</abstract>
<keywordset>
<keyword>KDE</keyword>
<keyword>kdenetwork</keyword>
<keyword>krfb</keyword>
<keyword>VNC</keyword>
<keyword>RFB</keyword>
<keyword>krdc</keyword>
<keyword>Desktop Sharing</keyword>
<keyword>Remote Control</keyword>
<keyword>Remote Assistance</keyword>
<keyword>Remote Desktop</keyword>
<keyword>Kapp</keyword>
</keywordset>
</bookinfo>
<chapter id="introduction">
<title>Introduction</title>
<chapter id="introduction"> <title>Introduction</title> <para>Sorry, but
the documentation for &kappname; was not finished when &kde; was installed on
this computer.</para> <para>If you need help, please check <ulink
url="http://www.kde.org">The &kde; Website</ulink> for updates, or by
submitting your question to <ulink url="mailto:kde-user@kde.org">The
&kde; User Mailing list</ulink>.</para> <para><emphasis>The &kde;
Team</emphasis></para>
<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
view or even control the desktop.
</para>
<para>
You would typically use &krfb; with the &kde; <acronym>VNC</acronym> client, which is
&krdc;, since it closely matches the special features of &krfb;.
</para>
<para>
&krfb; doesn't require you to start a new X session - it can share
the current session. This makes it very useful when you want someone
to help you perform a task.
</para>
<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>.
</para>
</chapter>
<chapter id="what-is-RFB">
<title>The Remote Frame Buffer protocol</title>
<para>
This chapter provides a brief description of the Remote Frame Buffer
protocol used by &krfb; and by other compatible systems. If you are
already familiar with Remote Frame Buffer, you can safely skip this
chapter.
</para>
<para>
The high level implementation of a system using the Remote Frame
Buffer protocol is known as Virtual Network Computer, or more often
just as <acronym>VNC</acronym>.
</para>
<para>
Remote Frame Buffer (or <acronym>RFB</acronym> for short) is a simple
protocol for remote access to graphical user interfaces. It works at
the frame-buffer level, which roughly corresponds to the rendered
screen image, which means that it can be applied to all windowing
systems (including X11, &MacOS; and &Microsoft; &Windows;). Remote
Frame Buffer applications exist for many platforms, and can often be
freely re-distributed.
</para>
<para>
In the Remote Frame Buffer protocol, the application that runs on the
machine where the user sits (containing the display, keyboard and
pointer) is called the client. The application that runs on the
machine where the framebuffer is located (which is running the
windowing system and applications that the user is remotely
controlling) is called the server. &krfb; is the &kde; server for the
Remote Frame Buffer protocol. &krdc; is the &kde; client for the
Remote Frame Buffer protocol.
</para>
<para>
It takes a reasonable amount of network traffic to send an image of
the framebuffer, so Remote Frame Buffer works best over high
bandwidth links, such as a local area network. It is still possible to
use &krfb; over other links, but performance is unlikely to be as good.
</para>
&underFDL;
</chapter>
<chapter id="using-krfb">
<title>Using &krfb;</title>
<sect1 id="main-windw">
<title>&krfb; Main Window</title>
<para>
It is very easy to use &krfb; - it has a simple interface, as shown in
the screenshot below.
</para>
<para>
<screenshot>
<screeninfo>Here's a screenshot of &krfb;</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="screenshot.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>&krfb; main window</phrase>
</textobject>
</mediaobject>
</screenshot>
</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.
</para>
<para>
If the machine is a server and you are using &krfb; for remote
administration, you probably want to use unattended access.
</para>
</sect2>
<sect2 id="transfer-login-information">
<title>Transfer Login Information</title>
<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.
</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
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.
</para>
<para>
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.
</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>
</sect2>
<sect2 id="krfb-qqit">
<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
<guimenuitem>Quit</guimenuitem>.
</para>
</sect2>
</sect1>
<sect1 id="krfb-configuration">
<title>Configuring &krfb;</title>
<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;
configuration has two pages, as shown in the screenshot below:
</para>
<para>
The <guilabel>Network</guilabel> page allows control over the port that
&krfb; uses, as shown below.
</para>
<para>
<screenshot>
<screeninfo>&krfb; Configuration (Network page)</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="configuration_network.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>&krfb; Configuration (Network page)</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>
<para>
The <guilabel>Announce service on the local network</guilabel> checkbox
controls whether &krfb; announces the service over the local 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;.
</para>
<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
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
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.
</para>
<para>
<screenshot>
<screeninfo>&krfb; Configuration (Security page)</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="configuration_security.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>&krfb; Configuration (Security page)</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>
</sect1>
<sect1 id="krfb-connection">
<title>Connecting 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.
</para>
<para>
<screenshot>
<screeninfo>&krfb; Connection Window</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="connection.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>&krfb; Connection Window</phrase>
</textobject>
</mediaobject>
</screenshot>
</para>
<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
Connection</guibutton>, then the attempt to connect will be terminated.
</para>
<para>
The <guilabel>Allow remote user to control keyboard and
mouse</guilabel> check box determines whether this client can only
observe, or can take control of your machine.
</para>
</sect1>
</chapter>
<chapter id="credits">
<title>Credits and License</title>
<para>
&krfb;
</para>
<para>
Program copyright 2002 Tim Jansen <email>tim@tjansen.de</email>
</para>
<para>
Contributors:
<itemizedlist>
<listitem><para>Ian Reinhart Geiser <email>geiseri@kde.org</email></para>
</listitem>
</itemizedlist>
</para>
<para>
Documentation Copyright &copy; 2003 &Brad.Hards; &Brad.Hards.mail;
</para>
<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
&underFDL; <!-- FDL: do not remove -->
&underGPL; <!-- GPL License -->
</chapter>
&documentation.index;
&documentation.index;
</book>
<!--
Local Variables:
mode: xml
mode: sgml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-indent-step:0
sgml-indent-data:nil
End:
vim:tabstop=2:shiftwidth=2:expandtab
// vim:ts=2:sw=2:tw=78:noet
-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -1,6 +0,0 @@
add_subdirectory(x11)
# Makes sense to use only when PW framebuffer is used
if (${PipeWire_FOUND})
add_subdirectory(xdp)
endif()

View File

@@ -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)

View File

@@ -1,67 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Comment=X11 XFakeInput based event handler for KRfb
Comment[ca]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
Comment[ca@valencia]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
Comment[da]=X11 XFakeInput baseret hændelseshåndtering til KRfb
Comment[de]=Ereignis-Modul basierend auf X11 XFakeInput für KRfb
Comment[el]=Χειριστής γεγονότων με βάση το X11 XFakeInput για το KRfb
Comment[en_GB]=X11 XFakeInput based event handler for KRfb
Comment[es]=Gestor de eventos basado en XFakeInput de X11 para KRfb
Comment[et]=KRfb X11 XFakeInput'i põhine sündmuste käitleja
Comment[eu]=KRfb-rako «X11 XFakeInput»en oinarritutako gertaera maneiatzailea
Comment[fi]=KRfb:n X11 XFakeInput -pohjainen tapahtumakäsittelijä
Comment[fr]=Gestionnaire d'évènements utilisant XFakeInput de X11 pour KRfb
Comment[gl]=Xestor de eventos para KRfb baseado no XFakeInput de X11
Comment[ia]=Maneator de evento de X11 basate sur XFakeInput per KRfb
Comment[it]=Gestore eventi basato su XFakeInput di X11 per KRfb
Comment[ko]=X11 XFakeInput 기반 KRfb 이벤트 핸들러
Comment[nl]=Op X11 XFakeInput gebaseerde behandelaar van gebeurtenis voor KRfb
Comment[nn]=X11 XFakeInput-basert hendingshandtering for KRfb
Comment[pl]=Obsługa wydarzeń X11 oparta na XFakeInput dla KRfb
Comment[pt]=Tratamento de eventos baseado no XFakeInput do X11 para o KRfb
Comment[pt_BR]=Manipulador de eventos baseado no XFakeInput do X11 para o KRfb
Comment[sk]=X11 Spracovateľ udalostí založený na XFakeInput pre KRfb
Comment[sl]=Upravljalnik dogodkov za KRfb na podlagi X11 XFakeInput
Comment[sv]=Händelsehanterare för Krfb baserad på X11 XFakeInput
Comment[uk]=Обробник подій для KRfb на основі XFakeInput X11
Comment[x-test]=xxX11 XFakeInput based event handler for KRfbxx
Comment[zh_CN]=基于 X11 XFakeInput 的 KRfb 事件处理器
Comment[zh_TW]=KRfb 基於 X11 XFakeInput 的事件處理器
Name=X11 XFakeInput based event handler for KRfb
Name[ca]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
Name[ca@valencia]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
Name[da]=X11 XFakeInput baseret hændelseshåndtering til KRfb
Name[de]=Ereignis-Modul basierend auf X11 XFakeInput für KRfb
Name[el]=Χειριστής γεγονότων με βάση το X11 XFakeInput για το KRfb
Name[en_GB]=X11 XFakeInput based event handler for KRfb
Name[es]=Gestor de eventos basado en XFakeInput de X11 para KRfb
Name[et]=KRfb X11 XFakeInput'i põhine sündmuste käitleja
Name[eu]=KRfb-rako «X11 XFakeInput»en oinarritutako gertaera maneiatzailea
Name[fi]=KRfb:n X11 XFakeInput -pohjainen tapahtumakäsittelijä
Name[fr]=Gestionnaire d'évènements utilisant XFakeInput de X11 pour KRfb
Name[gl]=Xestor de eventos para KRfb baseado no XFakeInput de X11
Name[ia]=Maneator de evento de X11 basate sur XFakeInput per KRfb
Name[it]=Gestore eventi basato su XFakeInput di X11 per KRfb
Name[ko]=X11 XFakeInput 기반 KRfb 이벤트 핸들러
Name[nl]=Op X11 XFakeInput gebaseerde behandelaar van gebeurtenis voor KRfb
Name[nn]=X11 XFakeInput-basert hendingshandtering for KRfb
Name[pl]=Obsługa wydarzeń X11 oparta na XFakeInput dla KRfb
Name[pt]=Tratamento de eventos baseado no XFakeInput do X11 para o KRfb
Name[pt_BR]=Manipulador de eventos baseado no XFakeInput do X11 para o KRfb
Name[sk]=X11 Spracovateľ udalostí založený na XFakeInput pre KRfb
Name[sl]=Upravljalnik dogodkov za KRfb na podlagi X11 XFakeInput
Name[sv]=Händelsehanterare för Krfb baserad på X11 XFakeInput
Name[uk]=Обробник подій для KRfb на основі XFakeInput X11
Name[x-test]=xxX11 XFakeInput based event handler for KRfbxx
Name[zh_CN]=基于 X11 XFakeInput 的 KRfb 事件处理器
Name[zh_TW]=KRfb 基於 X11 XFakeInput 的事件處理器
Type=Service
ServiceTypes=krfb/events
X-KDE-Library=krfb_events_x11
X-KDE-PluginInfo-Name=x11
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=https://www.kde.org
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true

View File

@@ -1,69 +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 事件處理器",
"ServiceTypes": [
"krfb/events"
],
"Version": "0.1",
"Website": "http://www.kde.org"
}
}

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -1,45 +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 "x11eventsplugin.h"
#include "x11events.h"
#include <KPluginFactory>
#include <QX11Info>
K_PLUGIN_FACTORY_WITH_JSON(X11EventsPluginFactory, "krfb_events_x11.json",
registerPlugin<X11EventsPlugin>();)
X11EventsPlugin::X11EventsPlugin(QObject *parent, const QVariantList &args)
: EventsPlugin(parent, args)
{
}
EventHandler *X11EventsPlugin::eventHandler()
{
// works only under X11
if(!QX11Info::isPlatformX11())
return nullptr;
return new X11EventHandler();
}
#include "x11eventsplugin.moc"

View File

@@ -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);
virtual ~X11EventsPlugin() = default;
EventHandler *eventHandler() override;
private:
Q_DISABLE_COPY(X11EventsPlugin)
};
#endif // Header guard

View File

@@ -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
)

View File

@@ -1,68 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Comment=Xdg-desktop-portal based event handler for KRfb
Comment[ca]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
Comment[ca@valencia]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
Comment[da]=Xdg-desktop-portal baseret hændelseshåndtering til KRfb
Comment[de]=Ereignis-Modul basierend auf Xdg-desktop-portal für KRfb
Comment[el]=Χειριστής γεγονότων με βάση το xdg-desktop-portal για το KRfb
Comment[en_GB]=Xdg-desktop-portal based event handler for KRfb
Comment[es]=Gestor de eventos basado en Xdg-desktop-portal para KRfb
Comment[et]=KRfb Xdg-desktop-portal'i põhine sündmuste käitleja
Comment[eu]=KRfb-rako «xdg-desktop-portal»en oinarritutako maneiatzailea
Comment[fi]=KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä
Comment[fr]=Gestionnaire d'évènements utilisant Xdg-desktop-portal pour KRfb
Comment[gl]=Xestor de eventos para KRfb baseado en Xdg-desktop-portal
Comment[ia]=Maneator de evento basate sur Xdg-desktop-portal per KRfb
Comment[it]=Gestore eventi basato su xdg-desktop-portal per KRfb
Comment[ko]=Xdg-desktop-portal 기반 KRfb 이벤트 핸들러
Comment[nl]=Op Xdg-desktop-portal gebaseerde behandelaar van gebeurtenis voor KRfb
Comment[nn]=Xdg-desktop-portal-basert hendingshandtering for KRfb
Comment[pl]=Obsługa wydarzeń oparta na Xdg-desktop-portal dla KRfb
Comment[pt]=Tratamento de eventos baseado no Xdg-desktop-portal para o KRfb
Comment[pt_BR]=Manipulador de eventos baseado no xdg-desktop-portal para o KRfb
Comment[sk]=Obsluha udalostí založená na Xdg-desktop-portal pre KRfb
Comment[sl]=Upravljalnik dogodkov za KRfb na podlagi namiznega portala Xdg
Comment[sv]=Händelsehanterare för Krfb baserad på xdg-desktop-portal
Comment[uk]=Обробник подій для KRfb на основі Xdg-desktop-portal
Comment[x-test]=xxXdg-desktop-portal based event handler for KRfbxx
Comment[zh_CN]=基于 xdg-desktop-portal 的 KRfb 事件处理器
Comment[zh_TW]=KRfb 基於 Xdg-desktop-portal 的事件處理器
Name=Xdg-desktop-portal based event handler for KRfb
Name[ca]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
Name[ca@valencia]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
Name[da]=Xdg-desktop-portal baseret 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 based event handler for KRfb
Name[es]=Gestor de eventos basado en Xdg-desktop-portal para KRfb
Name[et]=KRfb Xdg-desktop-portal'i põhine sündmuste käitleja
Name[eu]=KRfb-rako «xdg-desktop-portal»en oinarritutako maneiatzailea
Name[fi]=KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä
Name[fr]=Gestionnaire d'évènements utilisant Xdg-desktop-portal pour KRfb
Name[gl]=Xestor de eventos para KRfb baseado en Xdg-desktop-portal
Name[ia]=Mneator de evento basate sur Xdg-desktop-portal per KRfb
Name[it]=Gestore eventi basato su xdg-desktop-portal per KRfb
Name[ko]=Xdg-desktop-portal 기반 KRfb 이벤트 핸들러
Name[nl]=Op Xdg-desktop-portal gebaseerde behandelaar van gebeurtenis voor KRfb
Name[nn]=Xdg-desktop-portal-basert hendingshandtering for KRfb
Name[pl]=Obsługa wydarzeń oparta na Xdg-desktop-portal dla KRfb
Name[pt]=Tratamento de eventos baseado no Xdg-desktop-portal para o KRfb
Name[pt_BR]=Manipulador de eventos baseado no xdg-desktop-portal para o KRfb
Name[sk]=Obsluha udalostí založená na Xdg-desktop-portal pre KRfb
Name[sl]=Upravljalnik dogodkov za KRfb na podlagi namiznega portala Xdg
Name[sv]=Händelsehanterare för Krfb baserad på xdg-desktop-portal
Name[uk]=Обробник подій для KRfb на основі Xdg-desktop-portal
Name[x-test]=xxXdg-desktop-portal based event handler for KRfbxx
Name[zh_CN]=基于 xdg-desktop-portal 的 KRfb 事件处理器
Name[zh_TW]=KRfb 基於 Xdg-desktop-portal 的事件處理器
Type=Service
ServiceTypes=krfb/events
X-KDE-Library=krfb_events_xdp
X-KDE-PluginInfo-Name=xdp
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=https://www.kde.org
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true

View File

@@ -1,69 +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 事件處理器",
"ServiceTypes": [
"krfb/events"
],
"Version": "0.1",
"Website": "http://www.kde.org"
}
}

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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"

View File

@@ -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);
virtual ~XdpEventsPlugin() = default;
EventHandler *eventHandler() override;
private:
Q_DISABLE_COPY(XdpEventsPlugin)
};
#endif // Header guard

View File

@@ -1,9 +0,0 @@
add_subdirectory (qt)
if (${XCB_DAMAGE_FOUND} AND ${XCB_SHM_FOUND} AND ${XCB_IMAGE_FOUND})
add_subdirectory (xcb)
endif()
if (${PipeWire_FOUND})
add_subdirectory(pipewire)
endif()

View File

@@ -1,53 +0,0 @@
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set (krfb_framebuffer_pw_SRCS
pw_framebuffer.cpp
pw_framebufferplugin.cpp
)
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}
)
check_include_file("linux/dma-buf.h" HAVE_LINUX_DMABUF_H)
if (HAVE_LINUX_DMABUF_H)
target_compile_definitions(krfb_framebuffer_pw PRIVATE -DHAVE_LINUX_DMABUF_H)
endif ()
target_link_libraries (krfb_framebuffer_pw
Qt5::Core
Qt5::Gui
Qt5::DBus
KF5::CoreAddons
krfbprivate
PipeWire::PipeWire
)
install (TARGETS krfb_framebuffer_pw
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb
)

View File

@@ -1,73 +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",
"ServiceTypes": [
"krfb/framebuffer"
],
"Version": "0.1",
"Website": "http://www.kde.org"
}
}

View File

@@ -1,984 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
Copyright (C) 2018 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.
*/
// system
#include <sys/mman.h>
#include <cstring>
// Qt
#include <QCoreApplication>
#include <QGuiApplication>
#include <QScreen>
#include <QSocketNotifier>
#include <QDebug>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator>
#endif
// pipewire
#include <pipewire/version.h>
#if PW_CHECK_VERSION(0, 2, 90)
#include <spa/utils/result.h>
#ifdef HAVE_LINUX_DMABUF_H
#include <linux/dma-buf.h>
#endif
#include <sys/ioctl.h>
#endif
#include <spa/param/format-utils.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/props.h>
#include <pipewire/pipewire.h>
#include <climits>
#include "pw_framebuffer.h"
#include "xdp_dbus_screencast_interface.h"
#include "xdp_dbus_remotedesktop_interface.h"
#include "krfb_fb_pipewire_debug.h"
static const uint MIN_SUPPORTED_XDP_KDE_SC_VERSION = 1;
Q_DECLARE_METATYPE(PWFrameBuffer::Stream);
Q_DECLARE_METATYPE(PWFrameBuffer::Streams);
const QDBusArgument &operator >> (const QDBusArgument &arg, PWFrameBuffer::Stream &stream)
{
arg.beginStructure();
arg >> stream.nodeId;
arg.beginMap();
while (!arg.atEnd()) {
QString key;
QVariant map;
arg.beginMapEntry();
arg >> key >> map;
arg.endMapEntry();
stream.map.insert(key, map);
}
arg.endMap();
arg.endStructure();
return arg;
}
#if !PW_CHECK_VERSION(0, 2, 90)
/**
* @brief The PwType class - helper class to contain pointers to raw C pipewire media mappings
*/
class PwType {
public:
spa_type_media_type media_type;
spa_type_media_subtype media_subtype;
spa_type_format_video format_video;
spa_type_video_format video_format;
};
#endif
/**
* @brief The PWFrameBuffer::Private class - private counterpart of PWFramebuffer class. This is the entity where
* whole logic resides, for more info search for "d-pointer pattern" information.
*/
class PWFrameBuffer::Private {
public:
Private(PWFrameBuffer *q);
~Private();
private:
friend class PWFrameBuffer;
#if PW_CHECK_VERSION(0, 2, 90)
static void onCoreError(void *data, uint32_t id, int seq, int res, const char *message);
static void onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format);
#else
static void onStateChanged(void *data, pw_remote_state old, pw_remote_state state, const char *error);
static void onStreamFormatChanged(void *data, const struct spa_pod *format);
#endif
static void onStreamStateChanged(void *data, pw_stream_state old, pw_stream_state state, const char *error_message);
static void onStreamProcess(void *data);
void initDbus();
void initPw();
#if !PW_CHECK_VERSION(0, 2, 90)
void initializePwTypes();
#endif
// dbus handling
void handleSessionCreated(quint32 &code, QVariantMap &results);
void handleDevicesSelected(quint32 &code, QVariantMap &results);
void handleSourcesSelected(quint32 &code, QVariantMap &results);
void handleRemoteDesktopStarted(quint32 &code, QVariantMap &results);
// pw handling
pw_stream *createReceivingStream();
void handleFrame(pw_buffer *pwBuffer);
// link to public interface
PWFrameBuffer *q;
// pipewire stuff
#if PW_CHECK_VERSION(0, 2, 90)
struct pw_context *pwContext = nullptr;
struct pw_core *pwCore = nullptr;
struct pw_stream *pwStream = nullptr;
struct pw_thread_loop *pwMainLoop = nullptr;
// wayland-like listeners
// ...of events that happen in pipewire server
spa_hook coreListener = {};
spa_hook streamListener = {};
// event handlers
pw_core_events pwCoreEvents = {};
pw_stream_events pwStreamEvents = {};
#else
pw_core *pwCore = nullptr;
pw_loop *pwLoop = nullptr;
pw_thread_loop *pwMainLoop = nullptr;
pw_stream *pwStream = nullptr;
pw_remote *pwRemote = nullptr;
pw_type *pwCoreType = nullptr;
PwType *pwType = nullptr;
spa_hook remoteListener = {};
spa_hook streamListener = {};
// event handlers
pw_remote_events pwRemoteEvents = {};
pw_stream_events pwStreamEvents = {};
#endif
uint pwStreamNodeId = 0;
// negotiated video format
spa_video_info_raw *videoFormat = nullptr;
// requests a session from XDG Desktop Portal
// auto-generated and compiled from xdp_dbus_interface.xml file
QScopedPointer<OrgFreedesktopPortalScreenCastInterface> dbusXdpScreenCastService;
QScopedPointer<OrgFreedesktopPortalRemoteDesktopInterface> dbusXdpRemoteDesktopService;
// XDP screencast session handle
QDBusObjectPath sessionPath;
// Pipewire file descriptor
QDBusUnixFileDescriptor pipewireFd;
// screen geometry holder
struct {
quint32 width;
quint32 height;
} screenGeometry = {};
// Allowed devices
uint devices = 0;
// sanity indicator
bool isValid = true;
};
PWFrameBuffer::Private::Private(PWFrameBuffer *q) : q(q)
{
#if PW_CHECK_VERSION(0, 2, 90)
pwCoreEvents.version = PW_VERSION_CORE_EVENTS;
pwCoreEvents.error = &onCoreError;
pwStreamEvents.version = PW_VERSION_STREAM_EVENTS;
pwStreamEvents.state_changed = &onStreamStateChanged;
pwStreamEvents.param_changed = &onStreamParamChanged;
pwStreamEvents.process = &onStreamProcess;
#else
// initialize event handlers, remote end and stream-related
pwRemoteEvents.version = PW_VERSION_REMOTE_EVENTS;
pwRemoteEvents.state_changed = &onStateChanged;
pwStreamEvents.version = PW_VERSION_STREAM_EVENTS;
pwStreamEvents.state_changed = &onStreamStateChanged;
pwStreamEvents.format_changed = &onStreamFormatChanged;
pwStreamEvents.process = &onStreamProcess;
#endif
}
/**
* @brief PWFrameBuffer::Private::initDbus - initialize D-Bus connectivity with XDG Desktop Portal.
* Based on XDG_CURRENT_DESKTOP environment variable it will give us implementation that we need,
* in case of KDE it is xdg-desktop-portal-kde binary.
*/
void PWFrameBuffer::Private::initDbus()
{
qInfo() << "Initializing D-Bus connectivity with XDG Desktop Portal";
dbusXdpScreenCastService.reset(new OrgFreedesktopPortalScreenCastInterface(QStringLiteral("org.freedesktop.portal.Desktop"),
QStringLiteral("/org/freedesktop/portal/desktop"),
QDBusConnection::sessionBus()));
dbusXdpRemoteDesktopService.reset(new OrgFreedesktopPortalRemoteDesktopInterface(QStringLiteral("org.freedesktop.portal.Desktop"),
QStringLiteral("/org/freedesktop/portal/desktop"),
QDBusConnection::sessionBus()));
auto version = dbusXdpScreenCastService->version();
if (version < MIN_SUPPORTED_XDP_KDE_SC_VERSION) {
qCWarning(KRFB_FB_PIPEWIRE) << "Unsupported XDG Portal screencast interface version:" << version;
isValid = false;
return;
}
// create session
auto sessionParameters = QVariantMap {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
{ QStringLiteral("session_handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) },
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
#else
{ QStringLiteral("session_handle_token"), QStringLiteral("krfb%1").arg(qrand()) },
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(qrand()) }
#endif
};
auto sessionReply = dbusXdpRemoteDesktopService->CreateSession(sessionParameters);
sessionReply.waitForFinished();
if (!sessionReply.isValid()) {
qWarning("Couldn't initialize XDP-KDE screencast session");
isValid = false;
return;
}
qInfo() << "DBus session created: " << sessionReply.value().path();
QDBusConnection::sessionBus().connect(QString(),
sessionReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpSessionCreated(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpSessionCreated(quint32 code, QVariantMap results)
{
d->handleSessionCreated(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleSessionCreated - handle creation of ScreenCast session.
* XDG Portal answers with session path if it was able to successfully create the screencast.
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleSessionCreated(quint32 &code, QVariantMap &results)
{
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to create session: " << code;
isValid = false;
return;
}
sessionPath = QDBusObjectPath(results.value(QStringLiteral("session_handle")).toString());
// select sources for the session
auto selectionOptions = QVariantMap {
// We have to specify it's an uint, otherwise xdg-desktop-portal will not forward it to backend implementation
{ QStringLiteral("types"), QVariant::fromValue<uint>(7) }, // request all (KeyBoard, Pointer, TouchScreen)
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
#else
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(qrand()) }
#endif
};
auto selectorReply = dbusXdpRemoteDesktopService->SelectDevices(sessionPath, selectionOptions);
selectorReply.waitForFinished();
if (!selectorReply.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't select devices for the remote-desktop session";
isValid = false;
return;
}
QDBusConnection::sessionBus().connect(QString(),
selectorReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpDevicesSelected(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpDevicesSelected(quint32 code, QVariantMap results)
{
d->handleDevicesSelected(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleDevicesCreated - handle selection of devices we want to use for remote desktop
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleDevicesSelected(quint32 &code, QVariantMap &results)
{
Q_UNUSED(results)
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to select devices: " << code;
isValid = false;
return;
}
// select sources for the session
auto selectionOptions = QVariantMap {
{ QStringLiteral("types"), QVariant::fromValue<uint>(1) }, // only MONITOR is supported
{ QStringLiteral("multiple"), false },
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
#else
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(qrand()) }
#endif
};
auto selectorReply = dbusXdpScreenCastService->SelectSources(sessionPath, selectionOptions);
selectorReply.waitForFinished();
if (!selectorReply.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't select sources for the screen-casting session";
isValid = false;
return;
}
QDBusConnection::sessionBus().connect(QString(),
selectorReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpSourcesSelected(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpSourcesSelected(quint32 code, QVariantMap results)
{
d->handleSourcesSelected(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleSourcesSelected - handle Screencast sources selection.
* XDG Portal shows a dialog at this point which allows you to select monitor from the list.
* This function is called after you make a selection.
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleSourcesSelected(quint32 &code, QVariantMap &)
{
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to select sources: " << code;
isValid = false;
return;
}
// start session
auto startParameters = QVariantMap {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
#else
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(qrand()) }
#endif
};
auto startReply = dbusXdpRemoteDesktopService->Start(sessionPath, QString(), startParameters);
startReply.waitForFinished();
QDBusConnection::sessionBus().connect(QString(),
startReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpRemoteDesktopStarted(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpRemoteDesktopStarted(quint32 code, QVariantMap results)
{
d->handleRemoteDesktopStarted(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleScreencastStarted - handle Screencast start.
* At this point there shall be ready pipewire stream to consume.
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleRemoteDesktopStarted(quint32 &code, QVariantMap &results)
{
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to start screencast: " << code;
isValid = false;
return;
}
// there should be only one stream
Streams streams = qdbus_cast<Streams>(results.value(QStringLiteral("streams")));
if (streams.isEmpty()) {
// maybe we should check deeper with qdbus_cast but this suffices for now
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to get screencast streams";
isValid = false;
return;
}
auto streamReply = dbusXdpScreenCastService->OpenPipeWireRemote(sessionPath, QVariantMap());
streamReply.waitForFinished();
if (!streamReply.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't open pipewire remote for the screen-casting session";
isValid = false;
return;
}
pipewireFd = streamReply.value();
if (!pipewireFd.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't get pipewire connection file descriptor";
isValid = false;
return;
}
QSize streamResolution = qdbus_cast<QSize>(streams.first().map.value(QStringLiteral("size")));
screenGeometry.width = streamResolution.width();
screenGeometry.height = streamResolution.height();
devices = results.value(QStringLiteral("types")).toUInt();
pwStreamNodeId = streams.first().nodeId;
// Reallocate our buffer with actual needed size
q->fb = static_cast<char*>(malloc(screenGeometry.width * screenGeometry.height * 4));
if (!q->fb) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to allocate buffer";
isValid = false;
return;
}
Q_EMIT q->frameBufferChanged();
initPw();
}
/**
* @brief PWFrameBuffer::Private::initPw - initialize Pipewire socket connectivity.
* pipewireFd should be pointing to existing file descriptor that was passed by D-Bus at this point.
*/
void PWFrameBuffer::Private::initPw() {
qInfo() << "Initializing Pipewire connectivity";
// init pipewire (required)
pw_init(nullptr, nullptr); // args are not used anyways
#if PW_CHECK_VERSION(0, 2, 90)
pwMainLoop = pw_thread_loop_new("pipewire-main-loop", nullptr);
pwContext = pw_context_new(pw_thread_loop_get_loop(pwMainLoop), nullptr, 0);
if (!pwContext) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to create PipeWire context";
return;
}
pwCore = pw_context_connect(pwContext, nullptr, 0);
if (!pwCore) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to connect PipeWire context";
return;
}
pw_core_add_listener(pwCore, &coreListener, &pwCoreEvents, this);
pwStream = createReceivingStream();
if (!pwStream) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to create PipeWire stream";
return;
}
#else
// initialize our source
pwLoop = pw_loop_new(nullptr);
pwMainLoop = pw_thread_loop_new(pwLoop, "pipewire-main-loop");
// create PipeWire core object (required)
pwCore = pw_core_new(pwLoop, nullptr);
pwCoreType = pw_core_get_type(pwCore);
initializePwTypes();
// pw_remote should be initialized before type maps or connection error will happen
pwRemote = pw_remote_new(pwCore, nullptr, 0);
// init PipeWire remote, add listener to handle events
pw_remote_add_listener(pwRemote, &remoteListener, &pwRemoteEvents, this);
pw_remote_connect_fd(pwRemote, pipewireFd.fileDescriptor());
#endif
if (pw_thread_loop_start(pwMainLoop) < 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to start main PipeWire loop";
isValid = false;
}
}
#if !PW_CHECK_VERSION(0, 2, 90)
/**
* @brief PWFrameBuffer::Private::initializePwTypes - helper method to initialize and map all needed
* Pipewire types from core to type structure.
*/
void PWFrameBuffer::Private::initializePwTypes()
{
// raw C-like PipeWire type map
spa_type_map *map = pwCoreType->map;
pwType = new PwType();
spa_type_media_type_map(map, &pwType->media_type);
spa_type_media_subtype_map(map, &pwType->media_subtype);
spa_type_format_video_map(map, &pwType->format_video);
spa_type_video_format_map(map, &pwType->video_format);
}
#endif
#if PW_CHECK_VERSION(0, 2, 90)
void PWFrameBuffer::Private::onCoreError(void *data, uint32_t id, int seq, int res, const char *message)
{
Q_UNUSED(data);
Q_UNUSED(id);
Q_UNUSED(seq);
Q_UNUSED(res);
qInfo() << "core error: " << message;
}
#else
/**
* @brief PWFrameBuffer::Private::onStateChanged - global state tracking for pipewire connection
* @param data pointer that you have set in pw_remote_add_listener call's last argument
* @param state new state that connection has changed to
* @param error optional error message, is set to non-null if state is error
*/
void PWFrameBuffer::Private::onStateChanged(void *data, pw_remote_state /*old*/, pw_remote_state state, const char *error)
{
qInfo() << "remote state: " << pw_remote_state_as_string(state);
auto d = static_cast<PWFrameBuffer::Private*>(data);
switch (state) {
case PW_REMOTE_STATE_ERROR:
qCWarning(KRFB_FB_PIPEWIRE) << "remote error: " << error;
break;
case PW_REMOTE_STATE_CONNECTED:
d->pwStream = d->createReceivingStream();
break;
default:
qInfo() << "remote state: " << pw_remote_state_as_string(state);
break;
}
}
#endif
/**
* @brief PWFrameBuffer::Private::onStreamStateChanged - called whenever stream state changes on pipewire server
* @param data pointer that you have set in pw_stream_add_listener call's last argument
* @param state new state that stream has changed to
* @param error_message optional error message, is set to non-null if state is error
*/
void PWFrameBuffer::Private::onStreamStateChanged(void *data, pw_stream_state /*old*/, pw_stream_state state, const char *error_message)
{
qInfo() << "Stream state changed: " << pw_stream_state_as_string(state);
auto *d = static_cast<PWFrameBuffer::Private *>(data);
#if PW_CHECK_VERSION(0, 2, 90)
switch (state) {
case PW_STREAM_STATE_ERROR:
qCWarning(KRFB_FB_PIPEWIRE) << "pipewire stream error: " << error_message;
break;
case PW_STREAM_STATE_PAUSED:
pw_stream_set_active(d->pwStream, true);
break;
case PW_STREAM_STATE_STREAMING:
case PW_STREAM_STATE_UNCONNECTED:
case PW_STREAM_STATE_CONNECTING:
break;
}
#else
switch (state) {
case PW_STREAM_STATE_ERROR:
qCWarning(KRFB_FB_PIPEWIRE) << "pipewire stream error: " << error_message;
break;
case PW_STREAM_STATE_CONFIGURE:
pw_stream_set_active(d->pwStream, true);
break;
default:
break;
}
#endif
}
/**
* @brief PWFrameBuffer::Private::onStreamFormatChanged - being executed after stream is set to active
* and after setup has been requested to connect to it. The actual video format is being negotiated here.
* @param data pointer that you have set in pw_stream_add_listener call's last argument
* @param format format that's being proposed
*/
#if PW_CHECK_VERSION(0, 2, 90)
void PWFrameBuffer::Private::onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format)
#else
void PWFrameBuffer::Private::onStreamFormatChanged(void *data, const struct spa_pod *format)
#endif
{
qInfo() << "Stream format changed";
auto *d = static_cast<PWFrameBuffer::Private *>(data);
const int bpp = 4;
#if PW_CHECK_VERSION(0, 2, 90)
if (!format || id != SPA_PARAM_Format) {
#else
if (!format) {
pw_stream_finish_format(d->pwStream, 0, nullptr, 0);
#endif
return;
}
d->videoFormat = new spa_video_info_raw();
#if PW_CHECK_VERSION(0, 2, 90)
spa_format_video_raw_parse(format, d->videoFormat);
#else
spa_format_video_raw_parse(format, d->videoFormat, &d->pwType->format_video);
#endif
auto width = d->videoFormat->size.width;
auto height = d->videoFormat->size.height;
auto stride = SPA_ROUND_UP_N(width * bpp, 4);
auto size = height * stride;
uint8_t buffer[1024];
auto builder = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
// setup buffers and meta header for new format
const struct spa_pod *params[2];
#if PW_CHECK_VERSION(0, 2, 90)
params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
SPA_PARAM_BUFFERS_size, SPA_POD_Int(size),
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride),
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(8, 1, 32),
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16)));
params[1] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header))));
pw_stream_update_params(d->pwStream, params, 2);
#else
params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_object(&builder,
d->pwCoreType->param.idBuffers, d->pwCoreType->param_buffers.Buffers,
":", d->pwCoreType->param_buffers.size, "i", size,
":", d->pwCoreType->param_buffers.stride, "i", stride,
":", d->pwCoreType->param_buffers.buffers, "iru", 8, SPA_POD_PROP_MIN_MAX(1, 32),
":", d->pwCoreType->param_buffers.align, "i", 16));
params[1] = reinterpret_cast<spa_pod *>(spa_pod_builder_object(&builder,
d->pwCoreType->param.idMeta, d->pwCoreType->param_meta.Meta,
":", d->pwCoreType->param_meta.type, "I", d->pwCoreType->meta.Header,
":", d->pwCoreType->param_meta.size, "i", sizeof(struct spa_meta_header)));
pw_stream_finish_format(d->pwStream, 0, params, 2);
#endif
}
/**
* @brief PWFrameBuffer::Private::onNewBuffer - called when new buffer is available in pipewire stream
* @param data pointer that you have set in pw_stream_add_listener call's last argument
* @param id
*/
void PWFrameBuffer::Private::onStreamProcess(void *data)
{
auto *d = static_cast<PWFrameBuffer::Private *>(data);
pw_buffer *buf;
if (!(buf = pw_stream_dequeue_buffer(d->pwStream))) {
return;
}
d->handleFrame(buf);
pw_stream_queue_buffer(d->pwStream, buf);
}
#if PW_CHECK_VERSION(0, 2, 90) && defined(HAVE_LINUX_DMABUF_H)
static void syncDmaBuf(int fd, uint64_t start_or_end)
{
struct dma_buf_sync sync = { 0 };
sync.flags = start_or_end | DMA_BUF_SYNC_READ;
while(true) {
int ret;
ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync);
if (ret == -1 && errno == EINTR) {
continue;
} else if (ret == -1) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to synchronize DMA buffer: " << strerror(errno);
break;
} else {
break;
}
}
}
#endif
void PWFrameBuffer::Private::handleFrame(pw_buffer *pwBuffer)
{
auto *spaBuffer = pwBuffer->buffer;
void *src = spaBuffer->datas[0].data;
#if PW_CHECK_VERSION(0, 2, 90)
if (!src && spaBuffer->datas->type != SPA_DATA_DmaBuf) {
qCDebug(KRFB_FB_PIPEWIRE) << "discarding null buffer";
return;
}
#endif
const quint32 maxSize = spaBuffer->datas[0].maxsize;
std::function<void()> cleanup;
#if PW_CHECK_VERSION(0, 2, 90)
#ifdef HAVE_LINUX_DMABUF_H
if (spaBuffer->datas->type == SPA_DATA_DmaBuf) {
const int fd = spaBuffer->datas[0].fd;
auto map = mmap(
nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset,
PROT_READ, MAP_PRIVATE, fd, 0);
if (map == MAP_FAILED) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to mmap the dmabuf: " << strerror(errno);
return;
}
syncDmaBuf(fd, DMA_BUF_SYNC_START);
src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
cleanup = [map, spaBuffer, fd] {
syncDmaBuf(fd, DMA_BUF_SYNC_END);
munmap(map, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset);
};
} else
#endif
if (spaBuffer->datas->type == SPA_DATA_MemFd) {
uint8_t *map = static_cast<uint8_t*>(mmap(
nullptr, spaBuffer->datas->maxsize + spaBuffer->datas->mapoffset,
PROT_READ, MAP_PRIVATE, spaBuffer->datas->fd, 0));
if (map == MAP_FAILED) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to mmap the memory: " << strerror(errno);
return;
}
src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
cleanup = [map, spaBuffer] {
munmap(map, spaBuffer->datas->maxsize + spaBuffer->datas->mapoffset);
};
}
#endif
const qint32 srcStride = spaBuffer->datas[0].chunk->stride;
if (srcStride != q->paddedWidth()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Got buffer with stride different from screen stride" << srcStride << "!=" << q->paddedWidth();
return;
}
q->tiles.append(QRect(0, 0, q->width(), q->height()));
std::memcpy(q->fb, src, maxSize);
cleanup();
#if PW_CHECK_VERSION(0, 2, 90)
if (videoFormat->format == SPA_VIDEO_FORMAT_BGRA || videoFormat->format == SPA_VIDEO_FORMAT_BGRx) {
for (uint y = 0; y < videoFormat->size.height; y++) {
for (uint x = 0; x < videoFormat->size.width; x++) {
uint offset = y * spaBuffer->datas->chunk->stride + x * 4;
std::swap(q->fb[offset], q->fb[offset + 2]);
}
}
} else if (videoFormat->format != SPA_VIDEO_FORMAT_RGB) {
const QImage::Format format = videoFormat->format == SPA_VIDEO_FORMAT_BGR ? QImage::Format_BGR888
: videoFormat->format == SPA_VIDEO_FORMAT_RGBx ? QImage::Format_RGBX8888
: QImage::Format_RGB32;
QImage img((uchar*) q->fb, videoFormat->size.width, videoFormat->size.height, spaBuffer->datas->chunk->stride, format);
img.convertTo(QImage::Format_RGB888);
}
#endif
}
/**
* @brief PWFrameBuffer::Private::createReceivingStream - create a stream that will consume Pipewire buffers
* and copy the framebuffer to the existing image that we track. The state of the stream and configuration
* are later handled by the corresponding listener.
*/
pw_stream *PWFrameBuffer::Private::createReceivingStream()
{
spa_rectangle pwMinScreenBounds = SPA_RECTANGLE(1, 1);
spa_rectangle pwMaxScreenBounds = SPA_RECTANGLE(screenGeometry.width, screenGeometry.height);
spa_fraction pwFramerateMin = SPA_FRACTION(0, 1);
spa_fraction pwFramerateMax = SPA_FRACTION(60, 1);
#if PW_CHECK_VERSION(0, 2, 90)
auto stream = pw_stream_new_simple(pw_thread_loop_get_loop(pwMainLoop), "krfb-fb-consume-stream",
pw_properties_new(PW_KEY_MEDIA_TYPE, "Video",
PW_KEY_MEDIA_CATEGORY, "Capture",
PW_KEY_MEDIA_ROLE, "Screen",
nullptr),
&pwStreamEvents, this);
#else
auto reuseProps = pw_properties_new("pipewire.client.reuse", "1", nullptr); // null marks end of varargs
auto stream = pw_stream_new(pwRemote, "krfb-fb-consume-stream", reuseProps);
#endif
uint8_t buffer[1024] = {};
const spa_pod *params[1];
auto builder = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
#if PW_CHECK_VERSION(0, 2, 90)
params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video),
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(6,
SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA,
SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA,
SPA_VIDEO_FORMAT_RGB, SPA_VIDEO_FORMAT_BGR),
SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMaxScreenBounds, &pwMinScreenBounds, &pwMaxScreenBounds),
SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&pwFramerateMin),
SPA_FORMAT_VIDEO_maxFramerate, SPA_POD_CHOICE_RANGE_Fraction(&pwFramerateMax, &pwFramerateMin, &pwFramerateMax)));
#else
params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_object(&builder,
pwCoreType->param.idEnumFormat, pwCoreType->spa_format,
"I", pwType->media_type.video,
"I", pwType->media_subtype.raw,
":", pwType->format_video.format, "I", pwType->video_format.RGBx,
":", pwType->format_video.size, "Rru", &pwMaxScreenBounds, SPA_POD_PROP_MIN_MAX(&pwMinScreenBounds, &pwMaxScreenBounds),
":", pwType->format_video.framerate, "F", &pwFramerateMin,
":", pwType->format_video.max_framerate, "Fru", &pwFramerateMax, 2, &pwFramerateMin, &pwFramerateMax));
pw_stream_add_listener(stream, &streamListener, &pwStreamEvents, this);
#endif
auto flags = static_cast<pw_stream_flags>(PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE | PW_STREAM_FLAG_MAP_BUFFERS);
#if PW_CHECK_VERSION(0, 2, 90)
if (pw_stream_connect(stream, PW_DIRECTION_INPUT, PW_ID_ANY, flags, params, 1) != 0) {
#else
if (pw_stream_connect(stream, PW_DIRECTION_INPUT, nullptr, flags, params, 1) != 0) {
#endif
qCWarning(KRFB_FB_PIPEWIRE) << "Could not connect receiving stream";
isValid = false;
}
return stream;
}
PWFrameBuffer::Private::~Private()
{
if (pwMainLoop) {
pw_thread_loop_stop(pwMainLoop);
}
#if !PW_CHECK_VERSION(0, 2, 9)
if (pwType) {
delete pwType;
}
#endif
if (pwStream) {
pw_stream_destroy(pwStream);
}
#if !PW_CHECK_VERSION(0, 2, 90)
if (pwRemote) {
pw_remote_destroy(pwRemote);
}
#endif
#if PW_CHECK_VERSION(0, 2, 90)
if (pwCore) {
pw_core_disconnect(pwCore);
}
if (pwContext) {
pw_context_destroy(pwContext);
}
#else
if (pwCore) {
pw_core_destroy(pwCore);
}
#endif
if (pwMainLoop) {
pw_thread_loop_destroy(pwMainLoop);
}
#if !PW_CHECK_VERSION(0, 2, 90)
if (pwLoop) {
pw_loop_leave(pwLoop);
pw_loop_destroy(pwLoop);
}
#endif
}
PWFrameBuffer::PWFrameBuffer(WId winid, QObject *parent)
: FrameBuffer (winid, parent),
d(new Private(this))
{
// D-Bus is most important in init chain, no toys for us if something is wrong with XDP
// PipeWire connectivity is initialized after D-Bus session is started
d->initDbus();
// FIXME: for now use some initial size, later on we will reallocate this with the actual size we get from portal
d->screenGeometry.width = 800;
d->screenGeometry.height = 600;
fb = nullptr;
}
PWFrameBuffer::~PWFrameBuffer()
{
free(fb);
fb = nullptr;
}
int PWFrameBuffer::depth()
{
return 32;
}
int PWFrameBuffer::height()
{
return static_cast<qint32>(d->screenGeometry.height);
}
int PWFrameBuffer::width()
{
return static_cast<qint32>(d->screenGeometry.width);
}
int PWFrameBuffer::paddedWidth()
{
return width() * 4;
}
void PWFrameBuffer::getServerFormat(rfbPixelFormat &format)
{
format.bitsPerPixel = 32;
format.depth = 32;
format.trueColour = true;
format.bigEndian = false;
}
void PWFrameBuffer::startMonitor()
{
}
void PWFrameBuffer::stopMonitor()
{
}
QVariant PWFrameBuffer::customProperty(const QString &property) const
{
if (property == QLatin1String("stream_node_id")) {
return QVariant::fromValue<uint>(d->pwStreamNodeId);
} if (property == QLatin1String("session_handle")) {
return QVariant::fromValue<QDBusObjectPath>(d->sessionPath);
}
return FrameBuffer::customProperty(property);
}
bool PWFrameBuffer::isValid() const
{
return d->isValid;
}

View File

@@ -1,59 +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:
typedef struct {
uint nodeId;
QVariantMap map;
} Stream;
typedef QList<Stream> Streams;
PWFrameBuffer(WId winid, QObject *parent = nullptr);
virtual ~PWFrameBuffer() override;
int depth() override;
int height() override;
int width() override;
int paddedWidth() override;
void getServerFormat(rfbPixelFormat &format) override;
void startMonitor() override;
void stopMonitor() 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

View File

@@ -1,53 +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)
{
auto pwfb = new PWFrameBuffer(id);
// sanity check for dbus/wayland/pipewire errors
if (!pwfb->isValid()) {
delete pwfb;
return nullptr;
}
return pwfb;
}
#include "pw_framebufferplugin.moc"

View File

@@ -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) override;
private:
Q_DISABLE_COPY(PWFrameBufferPlugin)
};
#endif // Header guard

View File

@@ -1,32 +0,0 @@
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set (krfb_framebuffer_qt_SRCS
qtframebuffer.cpp
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
${krfb_framebuffer_qt_SRCS}
)
target_link_libraries (krfb_framebuffer_qt
Qt5::Core
Qt5::Gui
KF5::CoreAddons
krfbprivate
)
install (TARGETS krfb_framebuffer_qt
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb
)

View File

@@ -1,84 +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 Qtu",
"Description[sr@latin]": "Kadrobafer za KRFB na osnovu Qtu",
"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]": "Qtov kadrobafer za KRFB",
"Name[sr@latin]": "Qtov 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",
"ServiceTypes": [
"krfb/framebuffer"
],
"Version": "0.1",
"Website": "https://www.kde.org"
}
}

View File

@@ -1,134 +0,0 @@
/* 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 "qtframebuffer.h"
#include <QTimer>
#include <QRegion>
#include <QPixmap>
#include <QBitmap>
#include <QGuiApplication>
#include <QScreen>
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();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
fb = new char[fbImage.sizeInBytes()];
#else
fb = new char[fbImage.byteCount()];
#endif
} else {
fb = nullptr;
primaryScreen = nullptr;
}
t = new QTimer(this);
connect(t, &QTimer::timeout, this, &QtFrameBuffer::updateFrameBuffer);
}
QtFrameBuffer::~QtFrameBuffer()
{
if (fb)
delete [] fb;
fb = nullptr;
}
int QtFrameBuffer::depth()
{
return fbImage.depth();
}
int QtFrameBuffer::height()
{
return fbImage.height();
}
int QtFrameBuffer::width()
{
return fbImage.width();
}
void QtFrameBuffer::getServerFormat(rfbPixelFormat &format)
{
format.bitsPerPixel = 32;
format.depth = 32;
format.trueColour = true;
format.bigEndian = false;
format.redShift = 16;
format.greenShift = 8;
format.blueShift = 0;
format.redMax = 0xff;
format.greenMax = 0xff;
format.blueMax = 0xff;
}
void QtFrameBuffer::updateFrameBuffer()
{
if (!fb || !primaryScreen) return;
QImage img = primaryScreen->grabWindow(win).toImage();
#if 0 // This is actually slower than updating the whole desktop...
QSize imgSize = img.size();
// verify what part of the image need to be marked as changed
// fbImage is the previous version of the image,
// img is the current one
QImage map(imgSize, QImage::Format_Mono);
map.fill(0);
for (int x = 0; x < imgSize.width(); x++) {
for (int y = 0; y < imgSize.height(); y++) {
if (img.pixel(x, y) != fbImage.pixel(x, y)) {
map.setPixel(x, y, 1);
}
}
}
QRegion r(QBitmap::fromImage(map));
tiles = tiles + r.rects();
#else
tiles.append(img.rect());
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
memcpy(fb, img.bits(), static_cast<size_t>(img.sizeInBytes()));
#else
memcpy(fb, img.bits(), img.byteCount());
#endif
fbImage = img;
}
int QtFrameBuffer::paddedWidth()
{
return fbImage.width() * 4;
}
void QtFrameBuffer::startMonitor()
{
t->start(UPDATE_TIME);
}
void QtFrameBuffer::stopMonitor()
{
t->stop();
}

View File

@@ -1,46 +0,0 @@
/* 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_QT_QTFRAMEBUFFER_H
#define KRFB_FRAMEBUFFER_QT_QTFRAMEBUFFER_H
#include <QImage>
#include "framebuffer.h"
class QTimer;
class QScreen;
/**
@author Alessandro Praduroux <pradu@pradu.it>
*/
class QtFrameBuffer : public FrameBuffer
{
Q_OBJECT
public:
explicit QtFrameBuffer(WId id, QObject *parent = nullptr);
~QtFrameBuffer() 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 Q_SLOTS:
void updateFrameBuffer();
private:
QImage fbImage;
QTimer *t;
QScreen *primaryScreen;
};
#endif

View File

@@ -1,45 +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 "qtframebufferplugin.h"
#include "qtframebuffer.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(QtFrameBufferPluginFactory, "krfb_framebuffer_qt.json",
registerPlugin<QtFrameBufferPlugin>();)
QtFrameBufferPlugin::QtFrameBufferPlugin(QObject *parent, const QVariantList &args)
: FrameBufferPlugin(parent, args)
{
}
QtFrameBufferPlugin::~QtFrameBufferPlugin()
{
}
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id)
{
return new QtFrameBuffer(id);
}
#include "qtframebufferplugin.moc"

View File

@@ -1,46 +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_FRAMEBUFFER_QT_QTFRAMEBUFFERPLUGIN_H
#define KRFB_FRAMEBUFFER_QT_QTFRAMEBUFFERPLUGIN_H
#include "framebufferplugin.h"
#include <QWidget>
class FrameBuffer;
class QtFrameBufferPlugin : public FrameBufferPlugin
{
Q_OBJECT
public:
QtFrameBufferPlugin(QObject *parent, const QVariantList &args);
~QtFrameBufferPlugin() override;
FrameBuffer *frameBuffer(WId id) override;
private:
Q_DISABLE_COPY(QtFrameBufferPlugin)
};
#endif // Header guard

View File

@@ -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
)

View File

@@ -1,84 +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",
"ServiceTypes": [
"krfb/framebuffer"
],
"Version": "0.1",
"Website": "https://www.kde.org"
}
}

View File

@@ -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 : qAsConst(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);
}

View File

@@ -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

View File

@@ -1,46 +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)
{
return new XCBFrameBuffer(id);
}
#include "xcb_framebufferplugin.moc"

View File

@@ -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) override;
private:
Q_DISABLE_COPY(XCBFrameBufferPlugin)
};
#endif // Header guard

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,4 +0,0 @@
ecm_install_icons(ICONS
sc-apps-krfb.svgz
48-apps-krfb.png
DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor )

Binary file not shown.

21
kcm_krfb/Makefile.am Normal file
View File

@@ -0,0 +1,21 @@
METASOURCES = AUTO
# Code
kde_module_LTLIBRARIES = kcm_krfb.la
kcm_krfb_la_SOURCES = configurationwidget.ui kcm_krfb.cpp
kcm_krfb_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
kcm_krfb_la_LIBADD = ../krfb/libkrfbconfig.la $(LIB_KDEUI)
# Services
kcmdir = $(kde_appsdir)/Settings/Network
kcm_DATA = kcmkrfb.desktop
EXTRA_DIST = $(kcm_krfb_la_SOURCES)\
$(kcm_DATA)
# set the include path for X, qt and KDE
INCLUDES= -I../krfb $(all_includes)
messages: rc.cpp
$(XGETTEXT) *.cpp *.h -o $(podir)/kcm_krfb.pot

View File

@@ -0,0 +1,439 @@
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>ConfigurationWidget</class>
<widget class="QWidget">
<property name="name">
<cstring>ConfigurationWidget</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>421</width>
<height>445</height>
</rect>
</property>
<property name="caption">
<string>ConfWidget</string>
</property>
<property name="icon">
<pixmap>image0</pixmap>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QTabWidget">
<property name="name">
<cstring>TabWidget2</cstring>
</property>
<widget class="QWidget">
<property name="name">
<cstring>tab</cstring>
</property>
<attribute name="title">
<string>Acc&amp;ess</string>
</attribute>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QGroupBox">
<property name="name">
<cstring>GroupBox1</cstring>
</property>
<property name="frameShape">
<enum>Box</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
<property name="title">
<string>Invitations</string>
</property>
<property name="alignment">
<set>AlignAuto</set>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QLabel">
<property name="name">
<cstring>invitationNumLabel</cstring>
</property>
<property name="text">
<string>You have no open invitation.</string>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>manageInvitations</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Create &amp;&amp; &amp;Manage Invitations...</string>
</property>
<property name="whatsThis" stdset="0">
<string>Click to view or delete the open invitations.</string>
</property>
</widget>
</vbox>
</widget>
<widget class="QButtonGroup">
<property name="name">
<cstring>ButtonGroup7</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Uninvited Connections</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>allowUninvitedCB</cstring>
</property>
<property name="text">
<string>Allow &amp;uninvited connections</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="whatsThis" stdset="0">
<string>Select this option to allow connecting without inviting. This is useful if you want to access your desktop remotely.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>enableSLPCB</cstring>
</property>
<property name="text">
<string>Announce &amp;service on the network</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="whatsThis" stdset="0">
<string>If you allow uninvited connections and enable this option, Desktop Sharing will announce the service and your identity on the local network, so people can find you and your computer.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>confirmConnectionsCB</cstring>
</property>
<property name="text">
<string>&amp;Confirm uninvited connections before accepting</string>
</property>
<property name="whatsThis" stdset="0">
<string>If enabled, a dialog will appear when somebody attempts to connect, asking you whether you want to accept the connection.</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>allowDesktopControlCB</cstring>
</property>
<property name="text">
<string>A&amp;llow uninvited connections to control the desktop</string>
</property>
<property name="whatsThis" stdset="0">
<string>Enable this option to allow uninvited user to control your desktop (using mouse and keyboard).</string>
</property>
</widget>
<widget class="QFrame">
<property name="name">
<cstring>Frame4</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
</property>
<property name="layoutMargin" stdset="0">
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QLabel">
<property name="name">
<cstring>TextLabel1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Password:</string>
</property>
<property name="buddy" stdset="0">
<cstring>passwordInput</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>passwordInput</cstring>
</property>
<property name="maxLength">
<number>9</number>
</property>
<property name="echoMode">
<enum>Password</enum>
</property>
<property name="whatsThis" stdset="0">
<string>If you allow uninvited connections, it is highly recommended to set a password in order to protect your computer from unauthorized access.</string>
</property>
</widget>
</vbox>
</widget>
</vbox>
</widget>
<spacer>
<property name="name">
<cstring>Spacer3</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
</spacer>
</vbox>
</widget>
<widget class="QWidget">
<property name="name">
<cstring>tab</cstring>
</property>
<attribute name="title">
<string>&amp;Network</string>
</attribute>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QGroupBox">
<property name="name">
<cstring>GroupBox3</cstring>
</property>
<property name="title">
<string>Network Port</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>autoPortCB</cstring>
</property>
<property name="text">
<string>A&amp;ssign port automatically</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="whatsThis" stdset="0">
<string>Check this option to assign the network port automatically. This is recommended unless your network setup requires you to use a fixed port, for example because of a firewall.</string>
</property>
</widget>
<widget class="QFrame">
<property name="name">
<cstring>portInputFrame</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>Plain</enum>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QLabel">
<property name="name">
<cstring>TextLabel1_2</cstring>
</property>
<property name="text">
<string>&amp;Port:</string>
</property>
<property name="buddy" stdset="0">
<cstring>portInput</cstring>
</property>
</widget>
<widget class="KIntNumInput">
<property name="name">
<cstring>portInput</cstring>
</property>
<property name="value">
<number>5900</number>
</property>
<property name="minValue">
<number>1024</number>
</property>
<property name="maxValue">
<number>32767</number>
</property>
<property name="toolTip" stdset="0">
<string>Enter the TCP port number here</string>
</property>
<property name="whatsThis" stdset="0">
<string>Use this field to set a static port number for the desktop sharing service. Note that if the port is already in use the Desktop Sharing service will not be accessible until you free it. It is recommended to assign the port automatically unless you know what you are doing.
Most VNC clients use a display number instead of the actual port. This display number is the offset to port 5900, so port 5901 has the display number 1.</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<spacer>
<property name="name">
<cstring>Spacer4</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</vbox>
</widget>
</widget>
</vbox>
</widget>
<images>
<image name="image0">
<data format="XPM.GZ" length="8078">789cdd98c7721cc91186ef7c0a04f3c650d4b637a1d001de5b8200880d1db2da604038c29b0dbdbb32ffeceec582b30448015a85fa2726e69b32592633ab9abf7c98d8db589df8f0cbbbcb2bbe3aac26aa115f4c7ca8af4f4eee7ffde73f7e7bf73e2926e45f144413d1fbbfbd7bbf7935514dac9d9d360a540a50204f91827707f6e09d9ecb045c0c8c726e7be600e579cfde787960eb7f69e01cbc38b08d67a6e7cadaef0d8cc15336b0f5b73270095e1898c1d33dd7d65f3a30ca997b6eac7c75e00a3cdf738bf9f36dc789f5cfdd78c3a8e3bb9ebbfa67c651d0b4e059e3b4ecca0fc06110e636ff29701224b5958fc07990e7982f1f838ba0c863d4bfeb990bf06dcfb65eecc0555065980faff45cdafc6e94c57c5085e0497012266cfd7f06a761da98fd7be3346d6d3e042ec222857d5eee39afc14b3d97369e4d30879cc31e1f82abb04a8dbf2847611426d6df09b8888a18fdd145cf564ee7039bbd4fe0322a131baf0773c4dd78578de3dcfc81bf1a6741577e04aea22a36ffb4f2366a538cdf61be71a002c37f623c688f7889b3986d3c740dce55ca1efb19972a947f04b30a7c05ae5460ac775cabd0ff3eb851c13ee697a8c398ff263d77fe760ad60db5f5c57e26910aed2b70ac42f95ec789ad1f617f123c28dfedd8a7660ff3497215cae14f89ec4e6bf383ff279cb0ad1f617f13af427dc46bd2a850bedf73b71f5bc659d2f9f38331e7564e985faa0e6af35b372eb8b6f961fc69a44239e22b8d55e035e33ca96dbf108f291e30fc2fcd5560c45f5aa49dbfd343cfa5cd7f71602b877fa4a50ae3413e49598572f853ea5528477e936013a11cf34f5b1518fb95052ad4477916aac073e04805463ece6215da07e04485f20d70aa02637db24285f94c0f0cfb0ef3cd4a15fac3fa659c716bf9cfec3377f1e642709575f9c7213eb24605b6f1b42af477a98c70c1781dfc01ee65feb7615c8a03a17c1b8c0d427bc4439ea9c0c87f391eb4afc1850aede17f79a902233fe75e0546fce5950a6ced1b1518f92c6f5560c46fa109d8e263aee7ce5fd1bed08465fb83f82f621518fe05f7b2fd803f633b301f1781310130fcadc083fe91bfc4f94428473e90c34104463e2abc0aeb61e5f5b01e8db10a8cfd281a15ea6f1bcbf6dbfa20df16ad0a8c7c50062a30e2bfd4846cf385bf20fd59fc7d34f67965ed11cf65a2c27c62b0844fe74fc83f703fac8747fc9479ef1fd41aabd03fe683e5b0f9e1bc2ef18011dfa55781719e9655d99d8f0ef9a0ac55b067fd377dff0ee74fd9aac028e780bbfb9047bc72d8f7478db10af5b15fac0794e527c4030febe30f3aeec7931aab501ff1cdc9b0bf38df905ecc7f70bf630d50ac175bfba2efdf4d1b73777f7038afb954c13efc957def8fdec65f0dfe3569ac42ff8877ae5311eab3f130be0b631518e7918f5460ecb78f55609cbf382e2cfe71fff4591cc6b67e386fe0ce367e9c5fd84e1b1fee239e55606b5fa9c0b82ff95a85fe111fbef56d63fb8178ab8234b0f3cee1fe54e985c5ce1b8cb78afaf3c0e17cc3f16dfb83f8a9121518f9bd2afaf561ac078663f1087fa9e5f6d79d7fe71db71d633feb34f4a1ddcf118f75a502aff7dcd59f346eea8e919f6a3cd81fe4c7bad11b0f18f9b389faf5a559631518ebd170d3e577c27e3778c0c8cf4807666fbe63dfd547be40b8d8f981fcd9e251debc7a5bfd3fd970f4b6ea6cb0f3ae7a1379c79d0def6ad7bc896ae73b1b9550fb266a5cf5071b076ef48a3318497fdfda18b9c357dc8943e9ef5b1bc2afe84f439fdfda18efe3eecb78fd594cfc6fd9403f47eed89db85377e6beba737c5ec86f47ee12ba72d7eee65b7b2fb1d18df356dadfc1c6bd7b7093d2df949b76336e56becdb979b720658b6ec92dbb15b7ea7ecec68d5b73eb9d8d0de97bd36db98f6e5b2cad49ff7332ab4f52b2e376dd9eb4fe211bd2fb9e8cebb3accb2c32c0a6db7781f4baef42c8beebe7ba8bc4eeb1cc65512c0d6bf6021bb72e76898c3b95fe16e4db9cacd4becb9e7c6ebb5c4a75fd1624166a996d2163bb79a18d52685dfa08c9c96865e5895c46fce433971a819b222f9f3955549346f7f5f33630df496aa5fd9cf4f3209f0734a2c331fa227bd4d721cc6ec10574841ebe6fe356b4a4eb43c774e20ee994cee82b9dd3c5139dcbaf67526a3aa64bf7402c6b78891ebe6fa3141d637d8ec5c2155d4b5f37744b774f742bbf7e9552d3bd58913594b98cd0c3f76d8c44fbb63e92d7127aa0499aa2699a79a269f975524a5b95ccbb5fbd7df1e6fbefdba04b99f59c3b84029aa5399aa705e973919668b9d392d00cadd02aadd13a6dd026cdcabea38dcc678bb69eb1712ffa28b557685b2c7c1a6c2cd10eed76da119aa13db1f299f6c5caa6d49ba56d8976b1213bbff0cc5a8928704b144acb88624a28a58c722aa864c7e2b4eca814ca75c5e4a5de7325354da15be25a6672fcbc0d6eac8dbc257866f4d5f2018ff810a587f2ed80db3136b44df3fcf9f1a73646fc858f507a24df466f62e3984ffa338e4f84feaa79c8ce4b0efa791b2fd90ff1603e7d990dc955f0abdf6d8cf5ab8c523ee3af7cde8de8c2ad0f169ecfbb44a77cc9577ccd3712012b120963e2836ff98eeff98127bb55bab4de5f98dbe517b132c5d37c2d91bc2a56c6c439cff02ccff124cf77abb4f023365047577ec15df2222ff132af3ccd57bcca6bbcce1bac2f5f8dd45b787cdff8817bc97023e3cda77997b7f823eb4938d4f9c9bbcfef363e3d3d3f788777794f6efcffa18d71d69eeaf5ee893faabfdec6ab69bc0dbc7ff067de7f95b7c3f1ef1f788fa223b9535db9377a8fe280438e38e6c48d38e54cbe871cd87b1d37b84b8ce49e7b80d1ac0ddf1f973eae33f67d90732eb8f4ce935bf3ec3d97c27957774dee43aa44eef1adfc25c3f7c7a58feb8cb5e12bce7ded1b2fe3f40762a516aebaba07729b55ddc93b482b7f77c3f7c7a58feb3cb1e147725b997a0bd1961ffd17ff2fe36d6dfcebefeffe0dd22dc353</data>
</image>
</images>
<connections>
<connection>
<sender>autoPortCB</sender>
<signal>toggled(bool)</signal>
<receiver>portInputFrame</receiver>
<slot>setDisabled(bool)</slot>
</connection>
<connection>
<sender>allowUninvitedCB</sender>
<signal>toggled(bool)</signal>
<receiver>confirmConnectionsCB</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>allowUninvitedCB</sender>
<signal>toggled(bool)</signal>
<receiver>allowDesktopControlCB</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>allowUninvitedCB</sender>
<signal>toggled(bool)</signal>
<receiver>Frame4</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<tabstops>
<tabstop>autoPortCB</tabstop>
<tabstop>TabWidget2</tabstop>
<tabstop>manageInvitations</tabstop>
<tabstop>allowUninvitedCB</tabstop>
<tabstop>confirmConnectionsCB</tabstop>
<tabstop>allowDesktopControlCB</tabstop>
<tabstop>passwordInput</tabstop>
<tabstop>portInput</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
</UI>

178
kcm_krfb/kcm_krfb.cpp Normal file
View File

@@ -0,0 +1,178 @@
/***************************************************************************
kcm_krfb.cpp
--------------
begin : Sat Mar 02 2002
copyright : (C) 2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 "kcm_krfb.h"
#include "kcm_krfb.moc"
#include <qlayout.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qbuttongroup.h>
#include <qcstring.h>
#include <qdatastream.h>
#include <kapplication.h>
#include <kdialog.h>
#include <knuminput.h>
#include <klocale.h>
#include <kaboutdata.h>
#include <kconfig.h>
#include <kgenericfactory.h>
#include <kdatastream.h>
#include <kdebug.h>
#include <dcopclient.h>
#define VERSION "0.7"
typedef KGenericFactory<KcmKRfb, QWidget> KcmKRfbFactory;
// Can't use K_EXPORT_COMPONENT_FACTORY, since insertCatalogue necessary
extern "C" {
void *init_kcm_krfb() {
KGlobal::locale()->insertCatalogue("krfb"); // For invitation translations
return new KcmKRfbFactory("kcm_krfb");
}
};
KcmKRfb::KcmKRfb(QWidget *p, const char *name, const QStringList &) :
KCModule(KcmKRfbFactory::instance(), p, name),
m_configuration(KRFB_CONFIGURATION_MODE) {
m_confWidget = new ConfigurationWidget(this);
QVBoxLayout *l = new QVBoxLayout(this, 0, KDialog::spacingHint());
l->add(m_confWidget);
setButtons(Default|Apply|Reset);
m_about = new KAboutData( "kcm_krfb", I18N_NOOP("Desktop Sharing Control Module"),
VERSION,
I18N_NOOP("Configure desktop sharing"), KAboutData::License_GPL,
"(c) 2002, Tim Jansen\n",
0, "http://www.tjansen.de/krfb", "tim@tjansen.de");
m_about->addAuthor("Tim Jansen", 0, "tim@tjansen.de");
load();
connect(m_confWidget->passwordInput, SIGNAL(textChanged(const QString&)), SLOT(configChanged()) );
connect(m_confWidget->allowUninvitedCB, SIGNAL(clicked()), SLOT(configChanged()) );
connect(m_confWidget->enableSLPCB, SIGNAL(clicked()), SLOT(configChanged()) );
connect(m_confWidget->confirmConnectionsCB, SIGNAL(clicked()), SLOT(configChanged()) );
connect(m_confWidget->allowDesktopControlCB, SIGNAL(clicked()), SLOT(configChanged()) );
connect(m_confWidget->autoPortCB, SIGNAL(clicked()), SLOT(configChanged()) );
connect(m_confWidget->portInput, SIGNAL(valueChanged(int)), SLOT(configChanged()) );
connect((QObject*)m_confWidget->manageInvitations, SIGNAL(clicked()),
&m_configuration, SLOT(showManageInvitationsDialog()) );
connect(&m_configuration, SIGNAL(invitationNumChanged(int)),
this, SLOT(setInvitationNum(int)));
setInvitationNum(m_configuration.invitations().size());
}
KcmKRfb::~KcmKRfb() {
delete m_about;
}
void KcmKRfb::configChanged() {
emit changed(true);
}
void KcmKRfb::setInvitationNum(int num) {
if (num == 0)
m_confWidget->invitationNumLabel->setText(i18n("You have no open invitation."));
else
m_confWidget->invitationNumLabel->setText(i18n("Open invitations: %1").arg(num));
}
void KcmKRfb::checkKInetd(bool &kinetdAvailable, bool &krfbAvailable) {
kinetdAvailable = false;
krfbAvailable = false;
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata, rdata;
QCString replyType;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb");
if (!d->call ("kded", "kinetd", "isInstalled(QString)", sdata, replyType, rdata))
return;
if (replyType != "bool")
return;
QDataStream answer(rdata, IO_ReadOnly);
answer >> krfbAvailable;
kinetdAvailable = true;
}
void KcmKRfb::load() {
bool kinetdAvailable, krfbAvailable;
checkKInetd(kinetdAvailable, krfbAvailable);
m_confWidget->allowUninvitedCB->setChecked(m_configuration.allowUninvitedConnections());
m_confWidget->enableSLPCB->setChecked(m_configuration.enableSLP());
m_confWidget->confirmConnectionsCB->setChecked(m_configuration.askOnConnect());
m_confWidget->allowDesktopControlCB->setChecked(m_configuration.allowDesktopControl());
m_confWidget->passwordInput->setText(m_configuration.password());
m_confWidget->autoPortCB->setChecked(m_configuration.preferredPort()<0);
m_confWidget->portInput->setValue(m_configuration.preferredPort()> 0 ?
m_configuration.preferredPort() : 5900);
}
void KcmKRfb::save() {
m_configuration.update();
bool allowUninvited = m_confWidget->allowUninvitedCB->isChecked();
m_configuration.setAllowUninvited(allowUninvited);
m_configuration.setEnableSLP(m_confWidget->enableSLPCB->isChecked());
m_configuration.setAskOnConnect(m_confWidget->confirmConnectionsCB->isChecked());
m_configuration.setAllowDesktopControl(m_confWidget->allowDesktopControlCB->isChecked());
m_configuration.setPassword(m_confWidget->passwordInput->text());
if (m_confWidget->autoPortCB->isChecked())
m_configuration.setPreferredPort(-1);
else
m_configuration.setPreferredPort(m_confWidget->portInput->value());
m_configuration.save();
}
void KcmKRfb::defaults() {
bool kinetdAvailable, krfbAvailable;
checkKInetd(kinetdAvailable, krfbAvailable);
m_confWidget->allowUninvitedCB->setChecked(false);
m_confWidget->enableSLPCB->setChecked(true);
m_confWidget->confirmConnectionsCB->setChecked(false);
m_confWidget->allowDesktopControlCB->setChecked(false);
m_confWidget->passwordInput->setText("");
m_confWidget->autoPortCB->setChecked(true);
m_confWidget->portInput->setValue(5900);
}
const KAboutData *KcmKRfb::aboutData() const
{
return m_about;
}
QString KcmKRfb::quickHelp() const
{
return i18n("<h1>Desktop Sharing Configuration</h1> This module allows you to configure"
" the KDE desktop sharing.");
}

50
kcm_krfb/kcm_krfb.h Normal file
View File

@@ -0,0 +1,50 @@
/***************************************************************************
kcm_krfb.h
------------
begin : Sat Mar 02 2002
copyright : (C) 2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 _KCM_KRFB_H_
#define _KCM_KRFB_H_
#include <qobject.h>
#include <qdatetime.h>
#include <kcmodule.h>
#include "configurationwidget.h"
#include "../krfb/configuration.h"
class KcmKRfb : public KCModule {
Q_OBJECT
private:
Configuration m_configuration;
ConfigurationWidget *m_confWidget;
KAboutData *m_about;
void checkKInetd(bool&, bool&);
public:
KcmKRfb(QWidget *p, const char *name, const QStringList &);
~KcmKRfb();
void load();
void save();
void defaults();
QString quickHelp() const;
const KAboutData *aboutData() const;
private slots:
void setInvitationNum(int num);
void configChanged();
};
#endif

129
kcm_krfb/kcmkrfb.desktop Normal file
View File

@@ -0,0 +1,129 @@
[Desktop Entry]
Encoding=UTF-8
Icon=krfb
Type=Application
Exec=kcmshell kcmkrfb
X-KDE-ModuleType=Library
X-KDE-Library=krfb
Name=Desktop Sharing
Name[af]=Werkskerm Deeling
Name[ar]=مشاركة سطح المكتب
Name[bg]=Споделяне на Работно място
Name[bs]=Dijeljenje desktopa
Name[ca]=Compartició de l'escriptori
Name[cs]=Sdílení pracovní plochy
Name[da]=Skrivebordsdeling
Name[de]=Arbeitsfläche freigeben
Name[el]=Μοίρασμα της επιφάνειας εργασίας
Name[eo]=Tabuloj komunaj
Name[es]=Compartición de escritorio
Name[et]=Töölaua jagamine
Name[fi]=Työpöytien jako
Name[fr]=Partage de bureau
Name[he]=שיתוף שולחנות עבודה
Name[hr]=Dijeljenje radne površine
Name[hu]=Munkaasztal-megosztás
Name[is]=Skjáborðamiðlun
Name[it]=Condivisione Desktop
Name[ja]=デスクトップ共有
Name[lt]=Dalinimasis darbastaliu
Name[mk]=Десктоп Делење
Name[mt]=Qsim tad-desktop
Name[nb]=Delte skrivebord
Name[nl]=Bureaubladvrijgave
Name[nn]=Skrivebordsdeling
Name[nso]=Kabagano ya Desktop
Name[pl]=Współdzielenie pulpitu
Name[pt]=Partilha do Ambiente de Trabalho
Name[pt_BR]=Compartilhamento do Desktop
Name[ro]=Partajare ecran
Name[ru]=Общий рабочий стол
Name[sk]=Zdieľanie pracovnej plochy
Name[sl]=Deljenje namizja
Name[sv]=Dela ut skrivbordet
Name[th]=ใช้งานพื้นที่ทำงานร่วมกัน
Name[tr]=Masaüstü Paylaşımı
Name[uk]=Спільні стільниці
Name[ven]=U kovhekana ha Desikithopo
Name[xh]=Ukwehlulelana kwe Desktop
Name[zh_CN]=桌面共享
Name[zh_TW]=桌面分享
Name[zu]=Ukwahlulelana kwe-Desktop
Comment=Configure Desktop Sharing
Comment[af]=Konfigureer Werkskerm Deeling
Comment[ar]=تعديل مشاركة سطح المكتب
Comment[bg]=Конфигуриране на 'Споделяне на Работно място'
Comment[bs]=Podesite dijeljenje desktopa
Comment[ca]=Lupa de l'escriptori
Comment[cs]=Nastavit sdílení pracovní plochy
Comment[da]=Indstil skrivebordsdeling
Comment[de]=Freigabe der Arbeitsfläche einrichten
Comment[el]=Ρύθμιση του μοιράσματος της επιφάνειας εργασίας
Comment[eo]=Agordu fordonadon de viaj tabuloj
Comment[es]=Compartición de escritorio
Comment[et]=Töölaua jagamise seadistamine
Comment[fi]=Aseta työpöytien jakoa
Comment[fr]=Configuration du partage du bureau
Comment[he]=שינוי הגדרות שיתוף שולחנות העבודה
Comment[hu]=A munkaasztal-megosztás beállításai
Comment[is]=Stilla skjáborðsmiðlun
Comment[it]=Configura condivisione desktop
Comment[ja]=デスクトップ共有の設定
Comment[lt]=Konfigūruoti dalinimąsi darbastaliu
Comment[mk]=Конфигурирај Десктоп Делење
Comment[nb]=Tilpass delte skrivebord
Comment[nl]=Bureaubladvrijgave configureren
Comment[nn]=Set opp skrivebordsdeling
Comment[nso]=Beakanya Kabagano ya Desktop
Comment[pl]=Konfiguracja współdzielenia pulpitu
Comment[pt]=Configura a Partilha do Ecrã
Comment[pt_BR]=Configurar Compartilhamento do Desktop
Comment[ru]=Параметры общего рабочего стола
Comment[sk]=Nastavenie zdieľania pracovnej plochy
Comment[sl]=Nastavi deljenje namizja
Comment[sv]=Anpassa utdelning av skrivbord
Comment[uk]=Налаштувати спільні стільниці
Comment[ven]=Dzudzanyani u kovhekana ha desikithopo
Comment[xh]=Qwalasela Ukusebenzisa ngokuhlangeneyo kwe Desktop
Comment[zh_CN]=配置桌面共享
Comment[zh_TW]=設定桌面分享
Comment[zu]=Hlela kahle Ukwahlulelana kwe-Desktop
Keywords=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,rdp
Keywords[ar]=مشاركة سطح المكتب,krfb,vnc,مشاركة,rdp,krdc,اتصال سطح مكتب بعيد,rdp
Keywords[bs]=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,rdp,dijeljenje desktopa,dijeljenje
Keywords[ca]=compartició de l'escriptori,krfb,vnc,compartir,rdp,krdc,connexió a l'escriptori remot,rdp
Keywords[cs]=sdílení plochy,krfb,vnc,sdílení,rdp,krdc,připojení vzdálené plochy
Keywords[da]=skrivebordsdeling,krfb,vnc,deling,rdp,krdc,ekstern skrivebordsforbindelse ,rdp
Keywords[de]=Arbeitsfläche freigen,krfb,vnc,freigeben,rdp,krdc,Verbindung zur Arbeitsfläche über das Netzwerk,rdp
Keywords[el]=μοίρασμα επιφάνειας εργασίας,krfb,vnc,μοίρασμα,rdp,krdc,σύνδεση σε απομακρυσμένη επιφάνεια εργασίας,rdp
Keywords[eo]=tabulo,tabulofordonado,fordonado,rdp,krdc,foraj tabuloj
Keywords[es]=compartición de escritorio,krfb,vnc,compartir,rdp,krdc, conexión escritorio remoto,rdp
Keywords[et]=töölaua jagamine,krfb,vnc,jagamine,rdp,krdc,kaugtöölaua ühendus,rdp
Keywords[fi]=työpöydän jako,krfb,vnc,jako,rdp,krdc,etätyöpöytä
Keywords[fr]=partage du bureau,krfb,vnc,rdp,krdc,connexion à un bureau distant,rdp
Keywords[he]=שיתוף שולחן עבודה,krfb,vnc,שיתוף,rdp,krdc,חיבור לשולחן עבודה מרוחק,rdp
Keywords[hu]=munkaasztal-megosztás,krfb,vnc,megosztás,rdp,krdc,csatlakozás távoli munkaasztalhoz,rdp
Keywords[is]=skjáborðsmiðlun,miðlun,krfb,vnc,rdp,krdc,fjarvinnsla,remote desktop connection,rdp
Keywords[it]=condivisione desktop,krfb,vnc,condivisione,rdp,krdc, connessione desktop remoto,rdp
Keywords[ja]=デスクトップ共有,krfb,vnc,共有,rdp,krdc,リモートデスクトップ接続,rdp
Keywords[lt]=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,rdp, dalinimasis darbastaliu,prisijungimas prie nutolusio darbastalio
Keywords[nb]=skrivebordsdeling,krfb,vnc,deling,rdp,krdc,fjernt skrivebord,rdp
Keywords[nl]=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,rdp,verbinding,bureaubladvrijgave,bureaublad op afstand
Keywords[nn]=skrivebordsdeling,krfb,vnc,deling,rdp,krdc,nettverksskrivebord
Keywords[nso]=kabagano ya Desktop,krfb,vnc,kabagano,rdp,krdc,kopantšho desktop ya remote, rdp
Keywords[pl]=współdzielenie pulpitu,krfb,vnc,współdzielenie,rdp,krdc,zdalne połączenie
Keywords[pt]=partilha do ecrã,krfb,vnc,partilha,rdp,krdc,ligação a um ecrã remoto,rdp
Keywords[pt_BR]=compartilhamento de desktop,krfb,vnc,sharing,rdp,krdc,conexão a desktop remoto,rdp
Keywords[sk]=zdieľanie plochy,krfb,vnc,zdieľanie,rdp,krdc,pripojenie vzdialenej pracovnej plochy,rdp
Keywords[sl]=namizje,deljenje,krfb,vnc,rdp,krdc,povezava oddaljenega namizja,rdp
Keywords[sv]=dela skrivbord,krfb,vnc,dela,rdp,krdc,fjärrskrivbordsanslutning,rdp
Keywords[th]=การใช้งานพื้นที่ทำงานร่วมกัน,krfb,vnc,ใช้ทรัพยากรร่วมกัน,rdp,krdc,เชื่อมต่อพื้นที่ทำงานระยะไกล,rdp
Keywords[uk]=спільні стільниці,krfb,vnc,спільний,rdp,krdc,з'єднання віддаленої стільниці,rdp
Keywords[ven]=U kovhekana ha desktop,krfb,vnc,kovhekana,rdp,krdc,vhukwamani ha desktop ya kule, rdp
Keywords[xh]=usebenziso oluhlangeneyo lwe desktop,krfb,vnc, ukusebenzisa ngokuhlangeneyo,rdp,krdc,uxhumaniso lwe desktop elikude,rdp
Keywords[zh_CN]=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,rdp,桌面共享,共享,远程桌面连接
Keywords[zh_TW]=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,rdp,桌面分享,分享,遠端桌面連線
Keywords[zu]=ukuhlukaniselana kwe-desktop,krfb,vnc,ukuhlukaniselana,rdp,krdc,ukuxhumanisela kude kwe-desktop,rdp

30
kinetd/Makefile.am Normal file
View File

@@ -0,0 +1,30 @@
METASOURCES = AUTO
# Code
kde_module_LTLIBRARIES = kded_kinetd.la
kded_kinetd_la_SOURCES = kinetd.cpp kinetd.skel
kded_kinetd_la_LDFLAGS = $(all_libraries) -module -avoid-version
kded_kinetd_la_LIBADD = ../srvloc/libsrvloc.la $(LIB_KIO)
# Services
kde_servicetypes_DATA = kinetdmodule.desktop
kdeddir = $(kde_servicesdir)/kded
kded_DATA = kinetd.desktop
EXTRA_DIST = $(kded_kinetd_la_SOURCES)\
$(kded_DATA) \
$(kde_servicetypes_DATA) \
eventsrc README.debugging
KDE_ICON = kinetd
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kinetd
$(INSTALL_DATA) $(srcdir)/eventsrc $(DESTDIR)$(kde_datadir)/kinetd/eventsrc
# set the include path for X, qt and KDE
INCLUDES= -I$(top_srcdir)/krfb/srvloc $(all_includes)
messages: rc.cpp
$(XGETTEXT) *.cpp -o $(podir)/kinetd.pot

13
kinetd/README.debugging Normal file
View File

@@ -0,0 +1,13 @@
Recommended practice to debug a kinetd program
==============================================
Instead of executing your program directly, start a wrapper script that
looks like this:
#!/bin/sh
exec xterm -e gdb --args /opt/kde/bin/krfb $1 $2
Note that you cannot use konsole because it closes the file descriptor. You need
a very recent gdb version for the "--args" option (>= 5.2, only available as
CVS snapshot at this time).

174
kinetd/eventsrc Normal file
View File

@@ -0,0 +1,174 @@
[!Global!]
IconName=kinetd
Comment=KInetD
Comment[sv]=Kinetd
[IncomingConnection]
Name=IncomingConnection
Name[ar]=اتصال وارد
Name[ca]=Connexió entrant
Name[cs]=Příchozí spojení
Name[da]=IndkommendeForbindelse
Name[de]=Eingehende Verbindung
Name[el]=Εισερχόμενη σύνδεση
Name[eo]=EnvenantaKonekto
Name[es]=Conexión entrante
Name[et]=SissetulevÜhendus
Name[fi]=Saapuva yhteys
Name[fr]=Connexion entrante
Name[he]=חיבור נכנס
Name[hr]=DolaznaVeza
Name[hu]=Bejövő kapcsolat
Name[it]=Connessioni in entrata
Name[ja]=外部からの接続
Name[lt]=Ateinantis prisijungimas
Name[mk]=ВлезнаВрска
Name[mt]=KonnessjonijiDieħla
Name[nb]=Innkommende tilknytning
Name[nl]=Inkomende verbinding
Name[nn]=Innkomande samband
Name[nso]=Kgokagano yeo e Tsenago
Name[pl]=Połączenia przychodzące
Name[pt_BR]=Conexões de Entrada
Name[ro]=Conexiune de intrare
Name[ru]=Входящее соединение
Name[sk]=Prichádzajúce spojenia
Name[sl]=Prihajajoča povezava
Name[sv]=Inkommande anslutning
Name[th]=มีการเชื่อมต่อเข้ามา
Name[tr]=Gelen Bağlantı
Name[uk]=ВхіднеЗ'єднання
Name[ven]=Vhukwamanihanga ngomu
Name[xh]=Uxhumaniso Olungenayo
Name[zh_CN]=进入的连接
Name[zh_TW]=進來的連接
Name[zu]=UkuxhumanaOkuzayo
Comment=Received incoming connection
Comment[af]=Ontvang inkomende verbinding
Comment[ar]=تم استلام اتصال وارد
Comment[bg]=Получена Входяща Връзка
Comment[bs]=Primio dolaznu konekciju
Comment[ca]=Rebuda connexió entrant
Comment[cs]=Obdrženo příchozí spojení
Comment[da]=Modtog indkommende forbindelse
Comment[de]=Verbindungsanfrage eingegangen
Comment[el]=Λήψη εισερχόμενης σύνδεσης
Comment[eo]=Ricevantaj envenantaj konektoj
Comment[es]=Recibida conexión entrante
Comment[et]=Saadi sissetulev ühendus
Comment[fi]=Vastaanotettiin saapuva yhteys
Comment[fr]=Reçu une connexion entrante
Comment[he]=נתקבל חיבור נכנס
Comment[hr]=Primio dolaznu vezu
Comment[hu]=Csatlakozási kérés érkezett
Comment[is]=Tók á móti uppkalli
Comment[it]=Connessione in entrata stabilita
Comment[ja]=着信した外部からの接続
Comment[lt]=Gautas įeinantis prisijungimas
Comment[mk]=Примена влезна врска
Comment[mt]=Irċevejt konnessjoni dieħla
Comment[nb]=Motta innkommende tilknytning
Comment[nl]=Ontving een inkomende verbinding
Comment[nn]=Motta innkomande samband
Comment[nso]=Amogetše kgokagano yeo e tsenago
Comment[pl]=Otrzymano połącznie przychodzące
Comment[pt]=Foi recebida uma ligação
Comment[pt_BR]=Recebendo conexão de entrada
Comment[ro]=Conexiune de intrare recepţionată
Comment[ru]=Входящее соединение завершилось успешно
Comment[sk]=Prijaté príchodzie spojenia
Comment[sl]=Prejeta je prihajajoča povezava
Comment[sv]=Tar emot inkommande anslutning
Comment[th]=ได้รับการเชื่อมต่อเข้ามา
Comment[tr]=Gelen bağlantı alınıyor
Comment[uk]=Отримано вхідне з'єднання
Comment[ven]=Vhukwamani hau dzhena ho tanganedzhwaho
Comment[xh]=Uxhulumano olungenayo olufunyenweyo
Comment[zh_CN]=收到进入的连接
Comment[zh_TW]=已接收的進來的連線
Comment[zu]=Ukuxhumanisa okungenayo okutholakele
default_presentation=4
[ProcessFailed]
Name=ProcessFailed
Name[ar]=فشلت العملية
Name[bg]=Пропаднал Процес
Name[ca]=Procés fallit
Name[cs]=Proces selhal
Name[da]=ProcesMislykkedes
Name[de]=Prozess fehlgeschlagen
Name[el]=Η επεξεργασία απέτυχε
Name[eo]=ProcezoFiaskis
Name[es]=Proceso fallido
Name[et]=ProtsessEbaõnnestus
Name[fi]=Prosessi epäonnistui
Name[fr]=Échec du processus
Name[he]=תהליך נכשל
Name[hr]=ProcesNeuspješan
Name[hu]=Hibás folyamat
Name[it]=Processo fallito
Name[ja]=プロセス失敗
Name[lt]=Procesas nepavyko
Name[mk]=ПроцесотНеУспеа
Name[mt]=ProċessFalla
Name[nb]=Prosess mislyktes
Name[nl]=Proces faalde
Name[nn]=Prosess mislukkast
Name[nso]=Tiragalo e Paletšwe
Name[pl]=Błąd procesu
Name[pt_BR]=Falha de Processo
Name[ro]=Proces eşuat
Name[ru]=Ошибка процесса
Name[sk]=Proces neúspešný
Name[sl]=Proces ni uspel
Name[sv]=Process misslyckades
Name[th]=โปรเซสล้มเหลว
Name[uk]=ПомилкаПроцесу
Name[ven]=Tshitenwa tsho bala
Name[xh]=Inkqubo Yahlulekile
Name[zh_CN]=处理失败
Name[zh_TW]=程序失敗
Name[zu]=UkwenzekaKuhlulekile
Comment=Could not call process to handle connection
Comment[af]=Kon nie roep proses na handvatsel verbinding
Comment[ar]=لم أستطع استحضار العملية لحمل المكالمة
Comment[bg]=Не мога да извикам процес за подръжка на страницата
Comment[bs]=Ne mogu pokrenuti proces koji upravlja konekcijom
Comment[ca]=No es pot cridar al procés per a manejar la connexió
Comment[cs]=Nelze spustit proces k obsluze spojení
Comment[da]=Kunne ikke kalde proces til at håndtere forbindelse
Comment[de]=Der Prozess zur Bearbeitung der Verbindungsanfrage wurde nicht gefunden
Comment[el]=Δεν ήταν δυνατή η κλήση της διεργασίας για τον έλεγχο της σύνδεσης
Comment[eo]=Ne eblis lanĉi instancon por prizorgi la konekton
Comment[es]=Imposible lanzar proceso para manejar conexión
Comment[et]=Ei suuda käivitada protsessi ühenduse käsitsemiseks
Comment[fi]=Ei voitu kutsua prosessia yhteyden hoitamiseksi
Comment[fr]=Impossible d'appeler le processus pour gérer la connexion
Comment[he]=אין אפשרות לקרוא לתהליך על מנת לטפל בחיבור
Comment[hr]=Nisam mogao pozvati proces za kontrolu veze
Comment[hu]=A kapcsolat kezelése nem sikerült
Comment[is]=Gat ekki kallað á forrit til að höndla tengingu
Comment[it]=Impossibile richiamare il processo per gestire la connessione
Comment[ja]=接続を扱うプロセスを呼び出せません
Comment[lt]=Negaliu iškviesti proceso prisijungimui apdoroti
Comment[mk]=Не може да повикам процес да ја превземе врската
Comment[mt]=Ma stajtx insejjaħ proċess biex jieħu ħsieb il-konnessjoni
Comment[nb]=Kunne ikke kalle en prosess for å håndtere tilknytningen
Comment[nl]=Het proces om de verbinding af te handelen kon niet worden aangeroepen
Comment[nn]=Klarte ikkje kalla prosess for sambandshandtering
Comment[nso]=Ebe ekase bitše tiragalo go swara kopantšho
Comment[pl]=Nie można było uruchomić procesu obsługi połączenia
Comment[pt]=Não foi possível chamar o processo de tratamento da ligação
Comment[pt_BR]=Não foi possível chamar o processo de controle da conexão
Comment[ru]=Не удается запустить процесс обработки соединения
Comment[sk]=Nemohol som zavolať proces pre spracovanie spojenia
Comment[sl]=Ni možno poklicati procesa za upravljanje s povezavo
Comment[sv]=Kunde inte anropa process för att hantera anslutning
Comment[th]=ไม่สามารถเรียกโปรเซสเพื่อรับการเชื่อมต่อได้
Comment[uk]=Неможливо викликати процес для обробки з'єднання
Comment[ven]=Ingasi vhidze tshitenwa uitela u fara vhukwamani
Comment[xh]=Ayikwazanga ukubiza inkqubo ezakuphatha uxhulumano
Comment[zh_CN]=无法调用进程处理连接
Comment[zh_TW]=無法呼叫處理連線的程序
Comment[zu]=Ayikwazanga ukubiza umsebenzi ukuzophatha ukuxhumanisa
default_presentation=4

511
kinetd/kinetd.cpp Normal file
View File

@@ -0,0 +1,511 @@
/***************************************************************************
kinetd.cpp
--------------
begin : Mon Feb 11 2002
copyright : (C) 2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 "kinetd.h"
#include "kinetd.moc"
#include "kinetaddr.h"
#include "kuser.h"
#include <qregexp.h>
#include <kservicetype.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kconfig.h>
#include <knotifyclient.h>
#include <ksockaddr.h>
#include <kextsock.h>
#include <klocale.h>
#include <kglobal.h>
PortListener::PortListener(KService::Ptr s,
KConfig *config,
KServiceRegistry *srvreg) :
m_port(-1),
m_serviceRegistered(false),
m_socket(0),
m_config(config),
m_srvreg(srvreg)
{
loadConfig(s);
if (m_valid && m_enabled)
acquirePort();
}
bool PortListener::acquirePort() {
if (m_socket) {
if ((m_port >= m_portBase) &&
(m_port < (m_portBase + m_autoPortRange)))
return true;
else
delete m_socket;
}
m_port = m_portBase;
m_socket = new KServerSocket(m_port, false);
while (!m_socket->bindAndListen()) {
m_port++;
if (m_port >= (m_portBase+m_autoPortRange)) {
kdDebug() << "Kinetd cannot load service "<<m_serviceName
<<": unable to get port" << endl;
m_port = -1;
delete m_socket;
m_socket = 0;
return false;
}
delete m_socket;
m_socket = new KServerSocket(m_port, false);
}
connect(m_socket, SIGNAL(accepted(KSocket*)),
SLOT(accepted(KSocket*)));
bool s = m_registerService;
setServiceRegistrationEnabledInternal(false);
setServiceRegistrationEnabledInternal(s);
return true;
}
void PortListener::freePort() {
m_port = -1;
if (m_socket)
delete m_socket;
m_socket = 0;
setServiceRegistrationEnabledInternal(m_registerService);
}
void PortListener::loadConfig(KService::Ptr s) {
m_valid = true;
m_autoPortRange = 0;
m_enabled = true;
m_argument = QString::null;
m_multiInstance = false;
QVariant vid, vport, vautoport, venabled, vargument, vmultiInstance, vurl, vsattributes;
m_execPath = s->exec().utf8();
vid = s->property("X-KDE-KINETD-id");
vport = s->property("X-KDE-KINETD-port");
vautoport = s->property("X-KDE-KINETD-autoPortRange");
venabled = s->property("X-KDE-KINETD-enabled");
vargument = s->property("X-KDE-KINETD-argument");
vmultiInstance = s->property("X-KDE-KINETD-multiInstance");
vurl = s->property("X-KDE-KINETD-serviceURL");
vsattributes = s->property("X-KDE-KINETD-serviceAttributes");
if (!vid.isValid()) {
kdDebug() << "Kinetd cannot load service "<<m_serviceName
<<": no id set" << endl;
m_valid = false;
return;
}
if (!vport.isValid()) {
kdDebug() << "Kinetd cannot load service "<<m_serviceName
<<": invalid port" << endl;
m_valid = false;
return;
}
m_serviceName = vid.toString();
m_portBase = vport.toInt();
if (vautoport.isValid())
m_autoPortRange = vautoport.toInt();
if (venabled.isValid())
m_enabled = venabled.toBool();
if (vargument.isValid())
m_argument = vargument.toString();
if (vmultiInstance.isValid())
m_multiInstance = vmultiInstance.toBool();
if (vurl.isValid()) {
m_serviceURL = vurl.toString();
m_registerService = true;
}
else {
m_serviceURL = QString::null;
m_registerService = false;
}
if (vsattributes.isValid()) {
m_serviceAttributes = vsattributes.toString();
}
else
m_serviceAttributes = "";
m_defaultPortBase = m_portBase;
m_defaultAutoPortRange = m_autoPortRange;
m_config->setGroup("ListenerConfig");
m_enabled = m_config->readBoolEntry("enabled_" + m_serviceName,
m_enabled);
m_portBase = m_config->readNumEntry("port_base_" + m_serviceName,
m_portBase);
m_autoPortRange = m_config->readNumEntry("auto_port_range_" + m_serviceName,
m_autoPortRange);
QDateTime nullTime;
m_expirationTime = m_config->readDateTimeEntry("enabled_expiration_"+m_serviceName,
&nullTime);
if ((!m_expirationTime.isNull()) && (m_expirationTime < QDateTime::currentDateTime()))
m_enabled = false;
m_registerService = m_config->readBoolEntry("enabled_srvreg_"+m_serviceName,
m_registerService);
}
void PortListener::accepted(KSocket *sock) {
QString host, port;
KSocketAddress *ksa = KExtendedSocket::peerAddress(sock->socket());
KExtendedSocket::resolve(ksa, host, port);
KNotifyClient::event("IncomingConnection",
i18n("Connection from %1").arg(host));
delete ksa;
if ((!m_enabled) ||
((!m_multiInstance) && m_process.isRunning())) {
delete sock;
return;
}
m_process.clearArguments();
m_process << m_execPath << m_argument << QString::number(sock->socket());
if (!m_process.start(KProcess::DontCare)) {
KNotifyClient::event("ProcessFailed",
i18n("Call \"%1 %2 %3\" failed").arg(m_execPath)
.arg(m_argument)
.arg(sock->socket()));
}
delete sock;
}
bool PortListener::isValid() {
return m_valid;
}
bool PortListener::isEnabled() {
return m_enabled;
}
int PortListener::port() {
return m_port;
}
QString PortListener::processServiceTemplate(const QString &a) {
KInetAddress *kia = KInetAddress::getLocalAddress();
QString hostName = kia->nodeName();
delete kia;
KUser u;
QString x = a; // replace does not work in const QString. Why??
return x.replace(QRegExp("%h"), KServiceRegistry::encodeAttributeValue(hostName))
.replace(QRegExp("%p"), QString::number(m_port))
.replace(QRegExp("%u"), KServiceRegistry::encodeAttributeValue(u.loginName()))
.replace(QRegExp("%f"), KServiceRegistry::encodeAttributeValue(u.fullName()));
}
bool PortListener::setPort(int port, int autoPortRange) {
if ((port == m_portBase) && (autoPortRange == m_autoPortRange))
return (m_port != -1);
m_config->setGroup("ListenerConfig");
if (port > 0) {
m_portBase = port;
m_autoPortRange = autoPortRange;
m_config->writeEntry("port_base_" + m_serviceName, m_portBase);
m_config->writeEntry("auto_port_range_"+m_serviceName, m_autoPortRange);
}
else {
m_portBase = m_defaultPortBase;
m_autoPortRange = m_defaultAutoPortRange;
m_config->deleteEntry("port_base_" + m_serviceName);
m_config->deleteEntry("auto_port_range_"+m_serviceName);
}
m_config->sync();
if (m_enabled)
return acquirePort();
else
return false;
}
void PortListener::setEnabled(bool e) {
setEnabledInternal(e, QDateTime());
}
void PortListener::setEnabledInternal(bool e, const QDateTime &ex) {
m_config->setGroup("ListenerConfig");
m_config->writeEntry("enabled_" + m_serviceName, e);
m_config->writeEntry("enabled_expiration_"+m_serviceName, ex);
m_config->sync();
m_expirationTime = ex;
if (e) {
if (m_port < 0)
acquirePort();
m_enabled = m_port >= 0;
}
else {
freePort();
m_enabled = false;
}
}
void PortListener::setEnabled(const QDateTime &ex) {
setEnabledInternal(true, ex);
}
bool PortListener::isServiceRegistrationEnabled() {
return m_registerService;
}
void PortListener::setServiceRegistrationEnabled(bool e) {
setServiceRegistrationEnabledInternal(e);
m_config->setGroup("ListenerConfig");
m_config->writeEntry("enable_srvreg_" + m_serviceName, e);
m_config->sync();
}
void PortListener::setServiceRegistrationEnabledInternal(bool e) {
m_registerService = e;
if ((!m_srvreg) || m_serviceURL.isNull())
return;
if (m_serviceRegistered == (m_enabled && e))
return;
if (m_enabled && e) {
m_registeredServiceURL = processServiceTemplate(m_serviceURL);
m_serviceRegistered = m_srvreg->registerService(
m_registeredServiceURL,
processServiceTemplate(m_serviceAttributes));
if (!m_serviceRegistered)
kdDebug(7021) << "Failure registering SLP service (no slpd running?)"<< endl;
} else {
m_srvreg->unregisterService(m_registeredServiceURL);
m_serviceRegistered = false;
}
}
QDateTime PortListener::expiration() {
return m_expirationTime;
}
QString PortListener::name() {
return m_serviceName;
}
PortListener::~PortListener() {
setServiceRegistrationEnabledInternal(false);
delete m_socket;
}
KInetD::KInetD(QCString &n) :
KDEDModule(n)
{
m_config = new KConfig("kinetdrc");
m_srvreg = new KServiceRegistry();
if (!m_srvreg->available()) {
kdDebug(7021) << "SLP not available"<< endl;
delete m_srvreg;
m_srvreg = 0;
}
m_portListeners.setAutoDelete(true);
connect(&m_expirationTimer, SIGNAL(timeout()), SLOT(setExpirationTimer()));
connect(&m_portRetryTimer, SIGNAL(timeout()), SLOT(portRetryTimer()));
loadServiceList();
}
void KInetD::loadServiceList()
{
m_portListeners.clear();
KService::List kinetdModules =
KServiceType::offers("KInetDModule");
for(KService::List::ConstIterator it = kinetdModules.begin();
it != kinetdModules.end();
it++) {
KService::Ptr s = *it;
PortListener *pl = new PortListener(s, m_config, m_srvreg);
if (pl->isValid())
m_portListeners.append(pl);
}
setExpirationTimer();
setPortRetryTimer(true);
}
void KInetD::setExpirationTimer() {
QDateTime nextEx = getNextExpirationTime(); // disables expired portlistener!
if (!nextEx.isNull())
m_expirationTimer.start(QDateTime::currentDateTime().secsTo(nextEx)*1000 + 30000,
false);
else
m_expirationTimer.stop();
}
void KInetD::portRetryTimer() {
setPortRetryTimer(true);
}
void KInetD::setPortRetryTimer(bool retry) {
int unmappedPorts = 0;
PortListener *pl = m_portListeners.first();
while (pl) {
if (pl->isEnabled() && (pl->port() == -1))
if (retry) {
if (!pl->acquirePort())
unmappedPorts++;
}
else if (pl->port() == -1)
unmappedPorts++;
pl = m_portListeners.next();
}
if (unmappedPorts > 0)
m_portRetryTimer.start(30000, false);
else
m_portRetryTimer.stop();
}
PortListener *KInetD::getListenerByName(QString name)
{
PortListener *pl = m_portListeners.first();
while (pl) {
if (pl->name() == name)
return pl;
pl = m_portListeners.next();
}
return pl;
}
// gets next expiration timer, SIDEEFFECT: disables expired portlisteners while doing this
QDateTime KInetD::getNextExpirationTime()
{
PortListener *pl = m_portListeners.first();
QDateTime d;
while (pl) {
QDateTime d2 = pl->expiration();
if (!d2.isNull()) {
if (d2 < QDateTime::currentDateTime())
pl->setEnabled(false);
else if (d.isNull() || (d2 < d))
d = d2;
}
pl = m_portListeners.next();
}
return d;
}
QStringList KInetD::services()
{
QStringList list;
PortListener *pl = m_portListeners.first();
while (pl) {
list.append(pl->name());
pl = m_portListeners.next();
}
return list;
}
bool KInetD::isEnabled(QString service)
{
PortListener *pl = getListenerByName(service);
if (!pl)
return false;
return pl->isEnabled();
}
int KInetD::port(QString service)
{
PortListener *pl = getListenerByName(service);
if (!pl)
return -1;
return pl->port();
}
bool KInetD::setPort(QString service, int port, int autoPortRange)
{
PortListener *pl = getListenerByName(service);
if (!pl)
return false;
bool s = pl->setPort(port, autoPortRange);
setPortRetryTimer(false);
return s;
}
bool KInetD::isInstalled(QString service)
{
PortListener *pl = getListenerByName(service);
return (pl != 0);
}
void KInetD::setEnabled(QString service, bool enable)
{
PortListener *pl = getListenerByName(service);
if (!pl)
return;
pl->setEnabled(enable);
setExpirationTimer();
}
void KInetD::setEnabled(QString service, QDateTime expiration)
{
PortListener *pl = getListenerByName(service);
if (!pl)
return;
pl->setEnabled(expiration);
setExpirationTimer();
}
void KInetD::setServiceRegistrationEnabled(QString service, bool enable)
{
PortListener *pl = getListenerByName(service);
if (!pl)
return;
pl->setServiceRegistrationEnabled(enable);
}
bool KInetD::isServiceRegistrationEnabled(QString service)
{
PortListener *pl = getListenerByName(service);
if (!pl)
return false;
return pl->isServiceRegistrationEnabled();
}
KInetD::~KInetD() {
m_portListeners.clear();
delete m_config;
if (m_srvreg)
delete m_srvreg;
}
extern "C" {
KDEDModule *create_kinetd(QCString &name)
{
KGlobal::locale()->insertCatalogue("kinetd");
return new KInetD(name);
}
}

91
kinetd/kinetd.desktop Normal file
View File

@@ -0,0 +1,91 @@
[Desktop Entry]
Encoding=UTF-8
Type=Service
ServiceTypes=KDEDModule
X-KDE-ModuleType=Library
X-KDE-Library=kinetd
X-KDE-FactoryName=kinetd
X-KDE-Kded-autoload=true
Name=KDE Internet Daemon
Name[af]=Kde Internet Bediener
Name[ar]=مراقب انترنت كيدي
Name[bg]=KDE Демон на Интернет
Name[ca]=Dimoni d'Internet per al KDE
Name[cs]=KDE Internet démon
Name[da]=KDE Internet-dæmon
Name[de]=KDE Internet-Dämon
Name[el]=Δαίμονας ίντερνετ για το KDE
Name[eo]=Retodemono
Name[es]=Demonio de Internet de KDE
Name[et]=KDE internetideemon
Name[fi]=KDE Internet palvelin
Name[fr]=Démon Internet de KDE
Name[he]=תהליך שירות האינטרנט של KDE
Name[hu]=KDE internetes szolgáltatás
Name[is]=KDE Internetþjónn
Name[it]=Demone internet di KDE
Name[ja]=KDE インターネットデーモン
Name[lt]=KDE Interneto tarnyba
Name[mk]=KDE Интернет Демон
Name[mt]=Daemon tal-internet KDE
Name[nb]=KDEs Internett-nisse
Name[nn]=KDE-Internett-nisse
Name[nso]=Daemon ya Internet ya KDE
Name[pl]=Demon internetowy KDE
Name[pt]=Servidor de Internet do KDE
Name[pt_BR]=Servidor Internet do do KDE
Name[ro]=Demon internet KDE
Name[ru]=Интернет-демон KDE
Name[sk]=KDE Internet démon
Name[sl]=Internetni strežnik za KDE
Name[sv]=KDE:s Internetdemon
Name[th]=เดมอนอินเตอร์เน็ต KDE
Name[tr]=KDE İnternet Programı
Name[uk]=Демон Інтернет KDE
Name[zh_CN]=KDE Internet 守护进程
Name[zh_TW]=KDE Internet 伺服程式
Name[zu]=KDE Internet ye-Daemon
Comment=An Internet daemon that starts network services on demand
Comment[ar]=مراقب انترنت يقوم ببدء خدمات الشبكة عند الطلب
Comment[bg]=Демон на Интернет който стартира мрежови обслужвания при поискване
Comment[bs]=Internet daemon koji pokreće mrežne servise po potrebi
Comment[ca]=Un dimoni d'Internet que arrenca els serveis de xarxa sota demanda
Comment[cs]=Internetový démon spouštějící síťové služby na požádání
Comment[da]=En internet-dæmon der starter netværkstjenester efter forespørgsel
Comment[de]=Ein Internet-Dämon, der Netzwerkdienste bei Bedarf startet
Comment[el]=Ένας δαίμονας για το ίντερνετ ο οποίος ξεκινάει τις υπηρεσίες δικτύου βάση αίτησης
Comment[eo]=retdemono kiu lanĉas retajn servojn laŭ bezono
Comment[es]=Un demonio de Internet que inicia los servicios de red a demanda
Comment[et]=Internetideemon, mis käivitab nõudmisel võrguteenused
Comment[fi]=Internet palvelin, joka käynnistää verkkopalveluita
Comment[fr]=Un démon Internet qui démarre le service réseau à la demande
Comment[he]=תהליך שירות אינטרנט שמתחיל שירותי רשת לפי דרישה
Comment[hr]=Internet daemon koji pokreće mrežne usluge kada su zatražene
Comment[hu]=A hálózati szolgáltatások vezérlését biztosító program
Comment[is]=Internetþjónn sem ræsir tengingar við Internetið eftir þörfum
Comment[it]=Un demone internet che avvia i servizi di rete a richiesta
Comment[ja]=要求時にネットワークサービスを起動するインターネットデーモン
Comment[lt]=Interneto tarnyba, paleidžianti tinklo tarnybas esant poreikiui
Comment[mk]=Интернет демон кој стартува мрежни сервиси на побарување
Comment[mt]=Proċess tal-internet li jħaddem servizzi skond il-bżonn
Comment[nb]=Internett-nisse som starter nettverkstjenester ved behov
Comment[nl]=Een Internetdaemon die netwerkdiensten op afroep start
Comment[nn]=Internett-nisse som startar nettverkstenester når dei trengst
Comment[nso]=Daemon ya Internet yeo e thomišago ditirelo tša kgokagano ge e nyakilwe
Comment[pl]=Demon internetowy, który uruchamia na żądanie usługi sieciowe
Comment[pt]=Um servidor da Internet que inicia os serviços de rede a pedido
Comment[pt_BR]=Um servidor Internet que inicia os serviços de rede por demanda
Comment[ro]=Un demone internet care porneşte serviciile de reţea la cerere
Comment[ru]=Сетевой демон, запускающий серверы по запросу из сети
Comment[sk]=Internetový démon ktorý spúšťa sieťové služby na požiadanie
Comment[sl]=Internetni strežnik, ki zažene omrežne storitve na zahtevo
Comment[sv]=Internetdemon som startar nätverkstjänster vid behov
Comment[th]=เดมอนอินเตอร์เน็ตซึ่งจะเริ่มทำงานบริการเครือข่ายเมื่อมีความต้องการ
Comment[uk]=Демон Інтернет, що запускає служби мережі при запиті
Comment[ven]=Internet daemon ine ya thoma tshumelo ya vhukwamani kha muthetho
Comment[xh]=Internet daemon eqala iinkonzo zomsebenzi wonatha xa zifunwa
Comment[zh_CN]=按需启动网络服务的守护进程
Comment[zh_TW]=依要求起動網路服務的 Internet 伺服程式
Comment[zu]=I-Internet ye-daemon eqala ama-sevisi we-network adingekayo

184
kinetd/kinetd.h Normal file
View File

@@ -0,0 +1,184 @@
/***************************************************************************
kinetd.h
------------
begin : Mon Feb 11 2002
copyright : (C) 2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 _KINETD_H_
#define _KINETD_H_
#include <kdedmodule.h>
#include <kservice.h>
#include <ksock.h>
#include <kprocess.h>
#include <qstringlist.h>
#include <qstring.h>
#include <qdatetime.h>
#include <qtimer.h>
#include "kserviceregistry.h"
class PortListener : public QObject {
Q_OBJECT
private:
bool m_valid;
QString m_serviceName;
QString m_serviceURL, m_serviceAttributes, m_registeredServiceURL;
int m_port;
int m_portBase, m_autoPortRange;
int m_defaultPortBase, m_defaultAutoPortRange;
bool m_multiInstance;
QString m_execPath;
QString m_argument;
bool m_enabled;
bool m_serviceRegistered, m_registerService;
QDateTime m_expirationTime;
KServerSocket *m_socket;
KProcess m_process;
KConfig *m_config;
KServiceRegistry *m_srvreg;
void freePort();
void loadConfig(KService::Ptr s);
void setEnabledInternal(bool e, const QDateTime &ex);
void setServiceRegistrationEnabledInternal(bool enabled);
public:
PortListener(KService::Ptr s, KConfig *c, KServiceRegistry *srvreg);
~PortListener();
bool acquirePort();
bool isValid();
QString name();
void setEnabled(bool enabled);
void setEnabled(const QDateTime &expiration);
void setServiceRegistrationEnabled(bool enabled);
bool isServiceRegistrationEnabled();
QDateTime expiration();
bool isEnabled();
int port();
QString processServiceTemplate(const QString &a);
bool setPort(int port = -1, int autoProbeRange = 1);
private slots:
void accepted(KSocket*);
};
class KInetD : public KDEDModule {
Q_OBJECT
K_DCOP
k_dcop:
/**
* Returns a list of all registered services in KInetd.
* To add a service you need to add a .desktop file with
* the servicetype "KInetDModule" into the services director
* (see kinetdmodule.desktop in servicetypes dir).
* @return a list with the names of all services
*/
QStringList services();
/**
* Returns true if the service exists and is available.
* @param service name of a service as specified in its .desktop file
* @return true if a service with the given name exists and is enabled
*/
bool isEnabled(QString service);
/**
* Enables or disabled the given service. Ignored if the given service
* does not exist.
* @param service name of a service as specified in its .desktop file
* @param enable true to enable, false to disable.
*/
void setEnabled(QString service, bool enable);
/**
* Enables the given service until the given time. Ignored if the given
* service does not exist.
* @param service name of a service as specified in its .desktop file
* @param expiration the time the service will be disabled at
*/
void setEnabled(QString service, QDateTime expiration);
/**
* Returns the port of the service, or -1 if not listening.
* @param service name of a service as specified in its .desktop file
* @return the port or -1 if no port used or service does not exist
*/
int port(QString service);
/**
* Sets the port of the service, and possibly a range of ports to try.
* It will return true if a port could be found. If it didnt find one but is
* enabled it will start a timer that probes that port every 30s.
* @param service name of a service as specified in its .desktop file
* @param port the first port number to try or -1 to restore defaults
* @param autoPortRange the number of ports to try
* @return true if a port could be found or service is disabled, false
* otherwise.
*/
bool setPort(QString service, int port = -1, int autoPortRange = 1);
/**
* Tests whether the given service is installed..
* @param service name of a service as specified in its .desktop file
* @return true if installed, false otherwise
*/
bool isInstalled(QString service);
/**
* Enables or disables the SLP registration. Ignored if the service does
* not have a service URL. If the service is disabled the service will
* registered as soon as it is enabled.
* @param service name of a service as specified in its .desktop file
* @param enable true to enable, false to disable.
*/
void setServiceRegistrationEnabled(QString service, bool enabled);
/**
* Returns true if service registration for the given service is enabled.
* Note that this does not mean that the service is currently registered,
* because the service may be disabled.
* @param service name of a service as specified in its .desktop file
* @return true if service registration is enabled
*/
bool isServiceRegistrationEnabled(QString service);
private:
QDateTime getNextExpirationTime();
void setPortRetryTimer(bool retry);
KConfig *m_config;
KServiceRegistry *m_srvreg;
QPtrList<PortListener> m_portListeners;
QTimer m_expirationTimer;
QTimer m_portRetryTimer;
private slots:
void setExpirationTimer();
void portRetryTimer();
public:
KInetD(QCString &n);
virtual ~KInetD();
void loadServiceList();
PortListener *getListenerByName(QString name);
};
#endif

View File

@@ -0,0 +1,93 @@
# describes the servicetype that you need to implement in order to use
# kinetd.
[Desktop Entry]
Type=ServiceType
X-KDE-ServiceType=KInetDModule
Name=KInetD Module Type
Name[ar]=KInetD نوع وحدة
Name[bg]=KInetD Тип на Модул
Name[bs]=KInetD tip modula
Name[ca]=Tipus de mòdul del KInetD
Name[cs]=Typ modulu KInetD
Name[da]=KInetD-modultype
Name[de]=KInetD Modultyp
Name[el]=Τύπος αρθρώματος KInetD
Name[eo]=KInetD-modulotipo
Name[es]=Tipo de módulo KInetD
Name[et]=KInetD mooduli tüüp
Name[fi]=KInetD modulityyppi
Name[fr]=Type de module de KInetD
Name[he]=סוג מודול של KInetD
Name[hr]=Tip KInetD Modula
Name[hu]=KInetD modultípus
Name[is]=KInetD Module tegund
Name[it]=Tipo modulo KInetD
Name[ja]=KInetD モジュールタイプ
Name[lt]=KInetD modulio tipas
Name[mk]=KInetD Тип на Модул
Name[mt]=Tip ta' modulu KInetD
Name[nb]=KInetd-programtillegstype
Name[nl]=KInetD-moduletype
Name[nn]=KInetD-programtilleggstype
Name[nso]=Mohuta wa Seripa sa KInetD
Name[pl]=Typ modułu KInetD
Name[pt]=Tipo de Módulo do KInetD
Name[pt_BR]=Módulo KInetD
Name[ro]=Tip modul KInetD
Name[ru]=Модуль KInetD
Name[sk]=Typ modulu KInetD
Name[sl]=Vrsta modula KInetD
Name[sv]=Kinetd-modultyp
Name[tr]=KDED Modül Türü
Name[uk]=Тип модулю KinetD
Name[ven]=Lushaka lwa Modulu ya KInetD
Name[xh]=Udidi Lomqongo womlinganiselo we KInetD
Name[zh_CN]=KInetD 模块类型
Name[zh_TW]=KInetD 模組類型
Name[zu]=KInetD Uhlobo Lokwenza
# id to manipulate the service
[PropertyDef::X-KDE-KINETD-id]
Type=QString
# describes the TCP port kinetd should listen to
[PropertyDef::X-KDE-KINETD-port]
Type=int
# if set and >0, the number of ports kinetd should probe if the port is in use
[PropertyDef::X-KDE-KINETD-autoPortRange]
Type=int
# if enabled, kinetd will listen on the port. Can be overridden using the
# dcop interface.
[PropertyDef::X-KDE-KINETD-enabled]
Type=bool
# if set, this argument is given to the app to start, followed by the number
# of the socket's fd
[PropertyDef::X-KDE-KINETD-argument]
Type=QString
# if true, kinetd can accepts several connections at the same time. Otherwise
# it will block the port when a connection has been established.
[PropertyDef::X-KDE-KINETD-multiInstance]
Type=bool
# if set, kinetd will register the given URL at the local SLP SA while
# the port is open. The following strings will be substituted:
# %h with the local IP address
# %p with the port number
# %u with the user's login name
# %f with the user's full name
[PropertyDef::X-KDE-KINETD-serviceURL]
Type=QString
# if kinetd registers a service URL, this string will be used for its attributes.
# The following strings will be substituted:
# %h with the local IP address
# %p with the port number
# %u with the user's login name
# %f with the user's full name
[PropertyDef::X-KDE-KINETD-serviceAttributes]
Type=QString

View File

@@ -1,139 +0,0 @@
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.
set (krfbprivate_SRCS
framebuffer.cpp
framebufferplugin.cpp
events.cpp
eventsplugin.cpp
)
add_library (krfbprivate
SHARED
${krfbprivate_SRCS}
)
generate_export_header(krfbprivate BASE_NAME krfbprivate)
target_link_libraries (krfbprivate
Qt5::Core
Qt5::Widgets
Qt5::X11Extras
${X11_X11_LIB}
${LIBVNCSERVER_LIBRARIES}
)
set_target_properties (krfbprivate PROPERTIES
VERSION 5
SOVERSION 5.0
)
install (TARGETS krfbprivate
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
)
install (FILES
krfb-framebuffer.desktop
krfb-events.desktop
DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}
)
#####################################
# Second target: krfb - the app
# itself.
set (krfb_SRCS
connectiondialog.cpp
framebuffermanager.cpp
events.cpp
eventsmanager.cpp
main.cpp
mainwindow.cpp
sockethelpers.cpp
trayicon.cpp
rfbservermanager.cpp
rfbserver.cpp
rfbclient.cpp
invitationsrfbserver.cpp
invitationsrfbclient.cpp
)
ecm_qt_declare_logging_category(krfb_SRCS
HEADER krfbdebug.h
IDENTIFIER KRFB
CATEGORY_NAME krfb.krfb
DESCRIPTION "KRFB Application"
EXPORT KRFB
)
kconfig_add_kcfg_files (krfb_SRCS
krfbconfig.kcfgc
)
ki18n_wrap_ui (krfb_SRCS
ui/configtcp.ui
ui/configsecurity.ui
ui/configframebuffer.ui
ui/connectionwidget.ui
ui/mainwidget.ui
)
qt5_add_resources(krfb_SRCS
krfb.qrc
)
add_executable (krfb
${krfb_SRCS}
)
target_link_libraries (krfb
krfbprivate
${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
${LIBVNCSERVER_LIBRARIES}
)
if (X11_XTest_FOUND)
target_link_libraries (krfb
${X11_XTest_LIB}
)
endif (X11_XTest_FOUND)
install (TARGETS krfb
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
)
########### install files ###############
install (PROGRAMS org.kde.krfb.desktop
DESTINATION ${KDE_INSTALL_APPDIR}
)
install(FILES org.kde.krfb.appdata.xml
DESTINATION ${KDE_INSTALL_METAINFODIR}
)
install (FILES krfb.notifyrc
DESTINATION ${KDE_INSTALL_DATADIR}/krfb
)

38
krfb/Makefile.am Normal file
View File

@@ -0,0 +1,38 @@
KDE_CXXFLAGS = $(USE_THREADS)
METASOURCES = AUTO
noinst_LTLIBRARIES = libkrfbconfig.la
libkrfbconfig_la_SOURCES = configuration.cc manageinvitations.ui \
personalinvitation.ui invite.ui invitation.cc
libkrfbconfig_la_LIBADD = ../srvloc/libsrvloc.la $(LIB_KDEUI)
bin_PROGRAMS = krfb
krfb_SOURCES = rfbcontroller.cc xupdatescanner.cc main.cpp \
newconnectiondialog.ui krfbifaceimpl.cc krfbiface.skel \
trayicon.cpp
krfb_LDADD = libkrfbconfig.la ../libvncserver/libvncserver.la ../srvloc/libsrvloc.la -lXtst $(LIB_KDEUI) $(LIBJPEG)
krfb_LDFLAGS = $(all_libraries) $(KDE_RPATH)
noinst_HEADER = configuration.h invitation.h invite.h krfbiface.h \
krfbifaceimpl.h rfbcontroller.h trayicon.h xupdatescanner.h
datadir = $(kde_datadir)/krfb/pics
data_DATA = eyes-open24.png eyes-closed24.png connection-side-image.png
kde_services_DATA = kinetd_krfb.desktop
lnkdir = $(kde_appsdir)/System
lnk_DATA = krfb.desktop
appdir = $(kde_datadir)/krfb
app_DATA = eventsrc
KDE_ICON = krfb
INCLUDES= -I$(top_srcdir)/krfb/libvncserver -I$(top_srcdir)/krfb/srvloc \
$(all_includes)
messages: rc.cpp
$(XGETTEXT) rc.cpp *.cpp *.cc -o $(podir)/krfb.pot

View File

@@ -1,3 +0,0 @@
#! /bin/sh
$EXTRACTRC ui/*.ui *.kcfg >> rc.cpp
$XGETTEXT *.cpp -o $podir/krfb.pot

View File

@@ -1,11 +0,0 @@
/* Define to 1 if you have the `getifaddrs' function. */
#cmakedefine HAVE_GETIFADDRS 1
/* Define if SLP is available */
#cmakedefine HAVE_SLP 1
/* Define if XDamage is available */
#cmakedefine HAVE_XDAMAGE 1
/* Define if XShm is available */
#cmakedefine HAVE_XSHM 1

483
krfb/configuration.cc Normal file
View File

@@ -0,0 +1,483 @@
/***************************************************************************
configuration.cpp
-------------------
begin : Tue Dec 11 2001
copyright : (C) 2001-2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 "configuration.h"
#include "kinetaddr.h"
#include <kglobal.h>
#include <klocale.h>
#include <kapplication.h>
#include <kmessagebox.h>
#include <kprocess.h>
#include <qdatastream.h>
#include <dcopclient.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qcheckbox.h>
ManageInvitationsDialog2::ManageInvitationsDialog2() :
ManageInvitationsDialog(0, 0, false, WShowModal)
{ }
void ManageInvitationsDialog2::closeEvent(QCloseEvent *)
{ emit closed(); }
InvitationDialog2::InvitationDialog2() :
InvitationDialog(0, 0, false, WShowModal)
{ }
void InvitationDialog2::closeEvent(QCloseEvent *)
{ emit closed(); }
PersonalInvitationDialog2::PersonalInvitationDialog2() :
PersonalInvitationDialog(0, 0, false, WShowModal)
{ }
void PersonalInvitationDialog2::closeEvent(QCloseEvent *)
{ emit closed(); }
Configuration::Configuration(krfb_mode mode) :
m_mode(mode),
portNum(-1)
{
loadFromKConfig();
saveToDialogs();
doKinetdConf();
connect(invMngDlg.closeButton, SIGNAL(clicked()), SLOT(invMngDlgClosed()));
connect(&invMngDlg, SIGNAL(closed()), SLOT(invMngDlgClosed()));
connect(invMngDlg.newPersonalInvitationButton, SIGNAL(clicked()),
SLOT(showPersonalInvitationDialog()));
connect(invMngDlg.newEmailInvitationButton, SIGNAL(clicked()), SLOT(inviteEmail()));
connect(invMngDlg.deleteOneButton, SIGNAL(clicked()), SLOT(invMngDlgDeleteOnePressed()));
connect(invMngDlg.deleteAllButton, SIGNAL(clicked()), SLOT(invMngDlgDeleteAllPressed()));
invMngDlg.listView->setSelectionMode(QListView::Extended);
invMngDlg.listView->setMinimumSize(QSize(400, 100)); // QTs size is much to small
connect(invDlg.closeButton, SIGNAL(clicked()), SLOT(invDlgClosed()));
connect(&invDlg, SIGNAL(closed()), SLOT(invDlgClosed()));
connect(invDlg.createInvitationButton, SIGNAL(clicked()),
SLOT(showPersonalInvitationDialog()));
connect(invDlg.createInvitationEMailButton, SIGNAL(clicked()),
SLOT(inviteEmail()));
connect(invDlg.manageInvitationButton, SIGNAL(clicked()),
SLOT(showManageInvitationsDialog()));
connect(this, SIGNAL(invitationNumChanged(int)), this, SLOT(changeInvDlgNum(int)));
connect(this, SIGNAL(invitationNumChanged(int)),
&invMngDlg, SLOT(listSizeChanged(int)));
emit invitationNumChanged(invitationList.size());
connect(persInvDlg.closeButton, SIGNAL(clicked()), SLOT(persInvDlgClosed()));
connect(&persInvDlg, SIGNAL(closed()), SLOT(persInvDlgClosed()));
connect(&refreshTimer, SIGNAL(timeout()), SLOT(refreshTimeout()));
refreshTimer.start(1000*60);
}
Configuration::~Configuration() {
save();
}
void Configuration::setKInetdEnabled(bool enabled) {
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb");
arg << enabled;
d->send ("kded", "kinetd", "setEnabled(QString,bool)", sdata);
}
void Configuration::setKInetdEnabled(const QDateTime &date) {
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb");
arg << date;
d->send ("kded", "kinetd", "setEnabled(QString,QDateTime)", sdata);
}
void Configuration::setKInetdServiceRegistrationEnabled(bool enabled) {
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb");
arg << enabled;
d->send ("kded", "kinetd", "setServiceRegistrationEnabled(QString,bool)", sdata);
}
void Configuration::getPortFromKInetd() {
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata, rdata;
QCString replyType;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb");
if (!d->call ("kded", "kinetd", "port(QString)", sdata, replyType, rdata))
return; // nicer error here
if (replyType != "int")
return; // nicer error here
QDataStream answer(rdata, IO_ReadOnly);
answer >> portNum;
}
void Configuration::setKInetdPort(int p) {
DCOPClient *d = KApplication::dcopClient();
QByteArray sdata, rdata;
QCString replyType;
QDataStream arg(sdata, IO_WriteOnly);
arg << QString("krfb") << p << 1;
if (!d->call ("kded", "kinetd", "setPort(QString,int,int)", sdata, replyType, rdata))
return; // nicer error here
}
void Configuration::removeInvitation(QValueList<Invitation>::iterator it) {
invitationList.remove(it);
save();
}
void Configuration::doKinetdConf() {
setKInetdPort(preferredPortNum);
if (allowUninvitedFlag) {
setKInetdEnabled(true);
setKInetdServiceRegistrationEnabled(enableSLPFlag);
getPortFromKInetd();
return;
}
QDateTime lastExpiration;
QValueList<Invitation>::iterator it = invitationList.begin();
while (it != invitationList.end()) {
Invitation &ix = (*it);
QDateTime t = ix.expirationTime();
if (t > lastExpiration)
lastExpiration = t;
it++;
}
if (lastExpiration.isNull() || (lastExpiration < QDateTime::currentDateTime())) {
setKInetdEnabled(false);
portNum = -1;
}
else {
setKInetdServiceRegistrationEnabled(false);
setKInetdEnabled(lastExpiration);
getPortFromKInetd();
}
}
void Configuration::loadFromKConfig() {
KConfig c("krfbrc");
allowUninvitedFlag = c.readBoolEntry("allowUninvited", false);
enableSLPFlag = c.readBoolEntry("enableSLP", true);
askOnConnectFlag = c.readBoolEntry("confirmUninvitedConnection", true);
allowDesktopControlFlag = c.readBoolEntry("allowDesktopControl", false);
preferredPortNum = c.readNumEntry("preferredPort", -1);
if (c.hasKey("uninvitedPasswordCrypted"))
passwordString = cryptStr(c.readEntry("uninvitedPasswordCrypted", ""));
else
passwordString = c.readEntry("uninvitedPassword", "");
unsigned int invNum = invitationList.size();
invitationList.clear();
c.setGroup("invitations");
int num = c.readNumEntry("invitation_num", 0);
for (int i = 0; i < num; i++)
invitationList.push_back(Invitation(&c, i));
invalidateOldInvitations();
if (invNum != invitationList.size())
emit invitationNumChanged(invitationList.size());
}
void Configuration::saveToKConfig() {
KConfig c("krfbrc");
c.writeEntry("confirmUninvitedConnection", askOnConnectFlag);
c.writeEntry("allowDesktopControl", allowDesktopControlFlag);
c.writeEntry("allowUninvited", allowUninvitedFlag);
c.writeEntry("enableSLP", enableSLPFlag);
c.writeEntry("preferredPort", preferredPortNum);
c.writeEntry("uninvitedPasswordCrypted", cryptStr(passwordString));
c.deleteEntry("uninvitedPassword");
c.setGroup("invitations");
int num = invitationList.count();
c.writeEntry("invitation_num", num);
int i = 0;
while (i < num) {
invitationList[i].save(&c, i);
i++;
}
}
void Configuration::saveToDialogs() {
invalidateOldInvitations();
QValueList<Invitation>::iterator it = invitationList.begin();
while (it != invitationList.end()) {
Invitation &inv = *(it++);
if (!inv.getViewItem())
inv.setViewItem(new KListViewItem(invMngDlg.listView,
inv.creationTime().toString(Qt::LocalDate),
inv.expirationTime().toString(Qt::LocalDate)));
}
invMngDlg.adjustSize();
}
void Configuration::save() {
saveToKConfig();
saveToDialogs();
doKinetdConf();
}
void Configuration::update() {
loadFromKConfig();
saveToDialogs();
}
Invitation Configuration::createInvitation() {
Invitation inv;
invitationList.push_back(inv);
return inv;
}
void Configuration::invalidateOldInvitations() {
QValueList<Invitation>::iterator it = invitationList.begin();
while (it != invitationList.end()) {
if (!(*it).isValid())
it = invitationList.remove(it);
else
it++;
}
}
void Configuration::refreshTimeout() {
unsigned int invNum = invitationList.size();
loadFromKConfig();
saveToDialogs();
if (invNum != invitationList.size())
emit invitationNumChanged(invitationList.size());
}
QString Configuration::hostname() const
{
KInetAddress *a = KInetAddress::getPrivateInetAddress();
QString hostName = a->nodeName();
delete a;
return hostName;
}
///////// properties ///////////////////////////
krfb_mode Configuration::mode() const {
return m_mode;
}
bool Configuration::askOnConnect() const {
return askOnConnectFlag;
}
bool Configuration::allowDesktopControl() const {
return allowDesktopControlFlag;
}
bool Configuration::allowUninvitedConnections() const {
return allowUninvitedFlag;
}
bool Configuration::enableSLP() const {
return enableSLPFlag;
}
QString Configuration::password() const {
return passwordString;
}
QValueList<Invitation> &Configuration::invitations() {
return invitationList;
}
void Configuration::setAllowUninvited(bool allowUninvited) {
allowUninvitedFlag = allowUninvited;
}
void Configuration::setEnableSLP(bool e) {
enableSLPFlag = e;
}
void Configuration::setAskOnConnect(bool askOnConnect)
{
askOnConnectFlag = askOnConnect;
}
void Configuration::setAllowDesktopControl(bool allowDesktopControl)
{
allowDesktopControlFlag = allowDesktopControl;
}
void Configuration::setPassword(QString password)
{
passwordString = password;
}
int Configuration::port() const
{
if ((portNum < 5900) || (portNum >= 6000))
return portNum;
else
return portNum - 5900;
}
// use p=-1 for defaults
void Configuration::setPreferredPort(int p)
{
preferredPortNum = p;
}
int Configuration::preferredPort() const
{
return preferredPortNum;
}
////////////// invitation manage dialog //////////////////////////
void Configuration::showManageInvitationsDialog() {
loadFromKConfig();
saveToDialogs();
invMngDlg.show();
}
void Configuration::invMngDlgClosed() {
invMngDlg.hide();
}
void Configuration::invMngDlgDeleteOnePressed() {
QValueList<Invitation>::iterator it = invitationList.begin();
while (it != invitationList.end()) {
Invitation &ix = (*it);
KListViewItem *iv = ix.getViewItem();
if (iv && iv->isSelected())
it = invitationList.remove(it);
else
it++;
}
saveToKConfig();
doKinetdConf();
emit invitationNumChanged(invitationList.size());
}
void Configuration::invMngDlgDeleteAllPressed() {
invitationList.clear();
saveToKConfig();
doKinetdConf();
emit invitationNumChanged(invitationList.size());
}
////////////// invitation dialog //////////////////////////
void Configuration::showInvitationDialog() {
invDlg.show();
}
void Configuration::invDlgClosed() {
closeInvDlg();
emit invitationFinished();
}
void Configuration::closeInvDlg() {
saveToKConfig();
invDlg.hide();
}
void Configuration::changeInvDlgNum(int newNum) {
invDlg.manageInvitationButton->setText( i18n("Manage Invitations (%1)...").arg(newNum) );
}
////////////// personal invitation dialog //////////////////////////
void Configuration::showPersonalInvitationDialog() {
loadFromKConfig();
Invitation inv = createInvitation();
save();
emit invitationNumChanged(invitationList.size());
invDlg.createInvitationButton->setEnabled(false);
invMngDlg.newPersonalInvitationButton->setEnabled(false);
persInvDlg.hostLabel->setText(QString("%1:%2").arg(hostname()).arg(port()));
persInvDlg.passwordLabel->setText(inv.password());
persInvDlg.expirationLabel->setText(
inv.expirationTime().toString(Qt::LocalDate));
persInvDlg.show();
}
void Configuration::persInvDlgClosed() {
persInvDlg.hide();
invDlg.createInvitationButton->setEnabled(true);
invMngDlg.newPersonalInvitationButton->setEnabled(true);
}
////////////// invite email //////////////////////////
void Configuration::inviteEmail() {
int r = KMessageBox::warningContinueCancel(0,
i18n("When sending an invitation by email, note that everybody who reads this email "
"will be able to connect to your computer for one hour, or until the first "
"successful connection took place, whatever comes first. \n"
"You should either encrypt the email or at least send it only in a "
"secure network, but not over the Internet."),
i18n("Send Invitation via Email"),
KStdGuiItem::cont(),
"showEmailInvitationWarning");
if (r == KMessageBox::Cancel)
return;
loadFromKConfig();
Invitation inv = createInvitation();
save();
emit invitationNumChanged(invitationList.size());
KApplication *app = KApplication::kApplication();
app->invokeMailer(QString::null, QString::null, QString::null,
i18n("Desktop Sharing (VNC) invitation"),
i18n("You have been invited to a VNC session. If you have the KDE Remote "
"Desktop Connection installed, just click on the link below.\n\n"
"vnc://invitation:%1@%2:%3\n\n"
"Otherwise you can use any VNC client with the following parameters:\n\n"
"Host: %4:%5\n"
"Password: %6\n\n"
"For security reasons this invitation will expire at %7.")
.arg(inv.password())
.arg(hostname())
.arg(port())
.arg(hostname())
.arg(port())
.arg(inv.password())
.arg(KGlobal::locale()->formatDateTime(inv.expirationTime())));
}
#include "configuration.moc"

151
krfb/configuration.h Normal file
View File

@@ -0,0 +1,151 @@
/***************************************************************************
configuration.h
-------------------
begin : Tue Dec 11 2001
copyright : (C) 2001-2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 CONFIGURATION_H
#define CONFIGURATION_H
#include "invitation.h"
#include "manageinvitations.h"
#include "personalinvitation.h"
#include "invite.h"
#include <kconfig.h>
#include <qtimer.h>
#include <qobject.h>
#include <qvalidator.h>
#include <qstring.h>
enum krfb_mode {
KRFB_UNKNOWN_MODE = 0,
KRFB_KINETD_MODE,
KRFB_INVITATION_MODE,
KRFB_CONFIGURATION_MODE
};
class ManageInvitationsDialog2 : public ManageInvitationsDialog {
Q_OBJECT
public:
ManageInvitationsDialog2();
virtual void closeEvent(QCloseEvent *);
signals:
void closed();
};
class InvitationDialog2 : public InvitationDialog {
Q_OBJECT
public:
InvitationDialog2();
virtual void closeEvent(QCloseEvent *);
signals:
void closed();
};
class PersonalInvitationDialog2 : public PersonalInvitationDialog {
Q_OBJECT
public:
PersonalInvitationDialog2();
virtual void closeEvent(QCloseEvent *);
signals:
void closed();
};
/**
* This class stores the app's configuration, manages the
* standalone-config-dialog and all the invitation dialogs
* @author Tim Jansen
*/
class Configuration : public QObject {
Q_OBJECT
public:
Configuration(krfb_mode mode);
~Configuration();
krfb_mode mode() const;
bool askOnConnect() const;
bool allowDesktopControl() const;
bool allowUninvitedConnections() const;
bool enableSLP() const;
QString password() const;
QString hostname() const;
int port() const;
int preferredPort() const;
void setAllowUninvited(bool allowUninvited);
void setEnableSLP(bool e);
void setAskOnConnect(bool askOnConnect);
void setPassword(QString password);
void setPreferredPort(int p);
void save();
void update();
QValueList<Invitation> &invitations();
void removeInvitation(QValueList<Invitation>::iterator it);
signals:
void invitationFinished();
void invitationNumChanged(int num);
public slots:
void setAllowDesktopControl(bool allowDesktopControl);
void showManageInvitationsDialog();
void showInvitationDialog();
void showPersonalInvitationDialog();
void inviteEmail();
private:
void loadFromKConfig();
void loadFromDialogs();
void saveToKConfig();
void saveToDialogs();
Invitation createInvitation();
void closeInvDlg();
void invalidateOldInvitations();
void setKInetdEnabled(const QDateTime &date);
void setKInetdEnabled(bool enabled);
void setKInetdServiceRegistrationEnabled(bool enabled);
void getPortFromKInetd();
void setKInetdPort(int port);
void doKinetdConf();
krfb_mode m_mode;
ManageInvitationsDialog2 invMngDlg;
InvitationDialog2 invDlg;
PersonalInvitationDialog2 persInvDlg;
QTimer refreshTimer;
bool askOnConnectFlag;
bool allowDesktopControlFlag;
bool allowUninvitedFlag;
bool enableSLPFlag;
int portNum, preferredPortNum;
QString passwordString;
QValueList<Invitation> invitationList;
private slots:
void refreshTimeout();
void invMngDlgClosed();
void invMngDlgDeleteOnePressed();
void invMngDlgDeleteAllPressed();
void invDlgClosed();
void changeInvDlgNum(int newNum);
void persInvDlgClosed();
};
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -1,82 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2010 Collabora Ltd <info@collabora.co.uk>
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
Copyright (C) 2004 Nadeem Hasan <nhasan@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 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 "connectiondialog.h"
#include <QCheckBox>
#include <QIcon>
#include <KLocalizedString>
#include <KStandardGuiItem>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <KGuiItem>
#include <QVBoxLayout>
template <typename UI>
ConnectionDialog<UI>::ConnectionDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("New Connection"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *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);
setModal(true);
setMinimumSize(500, 200);
m_connectWidget = new QWidget(this);
m_ui.setupUi(m_connectWidget);
m_ui.pixmapLabel->setPixmap(QIcon::fromTheme(QStringLiteral("krfb")).pixmap(128));
KGuiItem accept = KStandardGuiItem::ok();
accept.setText(i18n("Accept Connection"));
KGuiItem::assign(okButton, accept);
KGuiItem refuse = KStandardGuiItem::cancel();
refuse.setText(i18n("Refuse Connection"));
KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), refuse);
mainLayout->addWidget(m_connectWidget);
mainLayout->addWidget(buttonBox);
}
//**********
InvitationsConnectionDialog::InvitationsConnectionDialog(QWidget *parent)
: ConnectionDialog<Ui::ConnectionWidget>(parent)
{
}
void InvitationsConnectionDialog::setRemoteHost(const QString &host)
{
m_ui.remoteHost->setText(host);
}

View File

@@ -1,69 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2010 Collabora Ltd <info@collabora.co.uk>
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
Copyright (C) 2004 Nadeem Hasan <nhasan@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 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 CONNECTIONDIALOG_H
#define CONNECTIONDIALOG_H
#include "ui_connectionwidget.h"
#include <QDialog>
template <typename UI>
class ConnectionDialog : public QDialog
{
public:
explicit ConnectionDialog(QWidget *parent);
~ConnectionDialog() override {};
void setAllowRemoteControl(bool b);
bool allowRemoteControl();
protected:
QWidget *m_connectWidget;
UI m_ui;
};
template <typename UI>
void ConnectionDialog<UI>::setAllowRemoteControl(bool b)
{
m_ui.cbAllowRemoteControl->setChecked(b);
m_ui.cbAllowRemoteControl->setVisible(b);
}
template <typename UI>
bool ConnectionDialog<UI>::allowRemoteControl()
{
return m_ui.cbAllowRemoteControl->isChecked();
}
//*********
class InvitationsConnectionDialog : public ConnectionDialog<Ui::ConnectionWidget>
{
Q_OBJECT
public:
explicit InvitationsConnectionDialog(QWidget *parent);
void setRemoteHost(const QString & host);
};
//*********
#endif // CONNECTIONDIALOG_H

BIN
krfb/cr32-app-krfb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

BIN
krfb/cr48-app-krfb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,40 +0,0 @@
/*
This file is part of the KDE project
Copyright (C) 2010 Collabora Ltd.
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
Copyright (C) 2001-2003 by Tim Jansen <tim@tjansen.de>
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 "events.h"
EventHandler::EventHandler(QObject *parent)
: QObject(parent)
{
}
void EventHandler::setFrameBufferPlugin(const QSharedPointer<FrameBuffer> &frameBuffer)
{
fb = frameBuffer;
}
QSharedPointer<FrameBuffer> EventHandler::frameBuffer()
{
return fb;
}

View File

@@ -1,50 +0,0 @@
/*
This file is part of the KDE project
Copyright (C) 2010 Collabora Ltd.
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
Copyright (C) 2001-2003 by Tim Jansen <tim@tjansen.de>
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_H
#define EVENTS_H
#include "framebuffer.h"
#include "rfb.h"
#include "krfbprivate_export.h"
#include <QObject>
class KRFBPRIVATE_EXPORT EventHandler : public QObject
{
Q_OBJECT
public:
explicit EventHandler(QObject *parent = nullptr);
virtual ~EventHandler() = 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;
};
#endif

View File

@@ -1,118 +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 = KPluginLoader::findPlugins(QStringLiteral("krfb"), [](const KPluginMetaData & md) {
return md.serviceTypes().contains(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>();
}

View File

@@ -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();
virtual ~EventsManager();
QSharedPointer<EventHandler> eventHandler();
private:
Q_DISABLE_COPY(EventsManager)
EventsManager();
void loadPlugins();
QMap<QString, EventsPlugin *> m_plugins;
QList<QWeakPointer<EventHandler> > m_eventHandlers;
};
#endif // Header guard

View File

@@ -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()
{
}

View File

@@ -1,42 +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 LIB_KRFB_EVENTSPLUGIN_H
#define LIB_KRFB_EVENTSPLUGIN_H
#include "krfbprivate_export.h"
#include <QtCore/QVariantList>
#include <QWidget>
class EventHandler;
class KRFBPRIVATE_EXPORT EventsPlugin : public QObject
{
Q_OBJECT
public:
EventsPlugin(QObject *parent, const QVariantList &args);
virtual ~EventsPlugin();
virtual EventHandler *eventHandler() = 0;
};
#endif // Header guard

817
krfb/eventsrc Normal file
View File

@@ -0,0 +1,817 @@
[!Global!]
IconName=krfb
Comment=Desktop Sharing
Comment[af]=Werkskerm Deeling
Comment[ar]=مشاركة سطح المكتب
Comment[bg]=Споделяне на Работно място
Comment[bs]=Dijeljenje desktopa
Comment[ca]=Compartició de l'escriptori
Comment[cs]=Sdílení pracovní plochy
Comment[da]=Skrivebordsdeling
Comment[de]=Arbeitsfläche freigeben
Comment[el]=Μοίρασμα επιφάνειας εργασίας
Comment[eo]=Tabula fordonado
Comment[es]=Compartición de escritorio
Comment[et]=Töölaua jagamine
Comment[fi]=Työpöytien jako
Comment[fr]=Partage du bureau
Comment[he]=שיתוף שולחנות עבודה
Comment[hr]=Dijeljenje radne površine
Comment[hu]=Munkaasztal-megosztás
Comment[is]=Skjáborðamiðlun
Comment[it]=Condivisione desktop
Comment[ja]=デスクトップ共有
Comment[lt]=Dalinimasis darbastaliu
Comment[mk]=Десктоп Делење
Comment[mt]=Qsim tad-desktop
Comment[nb]=Skrivebordsdeling
Comment[nl]=Bureaubladvrijgave
Comment[nn]=Skrivebordsdeling
Comment[nso]=Kabagano ya Desktop
Comment[pl]=Współdzielenie pulpitu
Comment[pt]=Partilha do Ecrã
Comment[pt_BR]=Compartilhamento do Ambiente de Trabalho
Comment[ro]=Partajare ecran
Comment[ru]=Параметры общего рабочего стола
Comment[sk]=Zdieľanie pracovnej plochy
Comment[sl]=Deljenje namizja
Comment[sv]=Dela ut skrivbord
Comment[th]=ใช้งานพื้นที่ทำงานร่วมกัน
Comment[tr]=Masaüstü Paylaşımı
Comment[uk]=Спільні стільниці
Comment[ven]=U kovhekana ha desikithopo
Comment[xh]=Ukwahlulelano kwe Desktop
Comment[zh_CN]=桌面共享
Comment[zh_TW]=桌面分享
Comment[zu]=Ukuhlukaniselana kwe-Desktop
[UserAcceptsConnection]
Name=UserAcceptsConnection
Name[ar]=المستخدم قبل الاتصال
Name[bg]=Потребител Приема Връзка
Name[ca]=L'usuari accepta la connexió
Name[cs]=Uživatel přijímá spojení
Name[da]=BrugerAcceptererForbindelse
Name[de]=BenutzerBestätigtVerbindung
Name[el]=Ο χρήστης δέχεται σύνδεση
Name[eo]=UzantoAkceptasKonektojn
Name[es]=El usuario acepta la conexión
Name[et]=KasutajaÜhendusegaNõus
Name[fr]=L'utilisateur accepte les connexions
Name[he]=משתמש מקבל חיבור
Name[hr]=KorisnikPrihvaćaVezu
Name[hu]=KapcsolatElfogadva
Name[is]=NotandiSamþykkirTengingar
Name[it]=L'utente accetta la connessione
Name[ja]=ユーザが許可した接続
Name[lt]=Vartotojas priima prisijungima
Name[mk]=КорисникотПрифатиВрска
Name[mt]=UserJaċċettaKonnessjoni
Name[nb]=Bruker aksepterer oppkobling
Name[nl]=Gebruiker accepteert verbinding
Name[nn]=Brukar godtek samband
Name[nso]=Modiriši o Amogela Kgokagano
Name[pl]=Połączenie akceptowane przez użytkownika
Name[pt_BR]=Aceita Conexões do Usuário
Name[ro]=Conexiune acceptată de utilizator
Name[ru]=Пользователь принимает соединения
Name[sk]=Užívateľ akceptoval spojenie
Name[sl]=Uporabnik sprejema povezavo
Name[sv]=Användare accepterar anslutning
Name[th]=ผู้ใช้ยอมรับการเชื่อมต่อ
Name[uk]=КористувачПриймаєЗ'єднання
Name[ven]=Mushumisi o tanganedza vhukwamani
Name[xh]=Umsebenzisi Wamkela Uxhulumaniso
Name[zh_CN]=用户接受连接
Name[zh_TW]=使用者接受連線
Name[zu]=UmsebenziUvumelaUkuxhumana
Comment=User accepts connection
Comment[af]=Gebruiker aanvaar verbinding
Comment[ar]=المستخدم قبل الإتصال
Comment[bg]=Потребител приема връзка
Comment[bs]=Korisnik prihvata konekciju
Comment[ca]=L'usuari accepta la connexió
Comment[cs]=Uživatel přijímá spojení
Comment[da]=Bruger accepterer forbindelse
Comment[de]=Der Benutzer bestätigt die Verbindung
Comment[el]=Ο χρήστης δέχεται σύνδεση
Comment[eo]=Uzanto akceptas konektojn
Comment[es]=El usuario acepta la conexión
Comment[et]=Kasutaja nõustub ühendusega
Comment[fi]=Käyttäjä hyväksyy yhteyden
Comment[fr]=l'utilisateur accepte les connexions
Comment[he]=המשתמש מקבל את החיבור
Comment[hr]=Korisnik prihvaća vezu
Comment[hu]=A felhasználó elfogadja a csatlakozási kérést
Comment[is]=Notandi samþykkir tengingu
Comment[it]=L'utente accetta la connessione
Comment[ja]=ユーザが接続を許可
Comment[lt]=Vartotojas priima prisijungimą
Comment[mk]=Корисникот ја прифати врската
Comment[mt]=User jaċċetta l-konnessjoni
Comment[nb]=Bruker aksepterer oppkobling
Comment[nl]=Gebruiker accepteert verbinding
Comment[nn]=Brukar godtek samband
Comment[nso]=Modiriši o Amogela Kgokagano
Comment[pl]=Użytkownik akceptuje połączenie
Comment[pt]=O utilizador aceita a ligação
Comment[pt_BR]=O usuário aceita a conexão
Comment[ro]=Utilizatorul acceptă conexiunea
Comment[ru]=Пользователь принимает соединения
Comment[sk]=Užívateľ akceptoval spojenie
Comment[sl]=Uporabnik sprejema povezavo
Comment[sv]=Användaren accepterar anslutning
Comment[th]=ผู้ใช้ยอมรับการเชื่อมต่อ
Comment[tr]=Kullanıcı bağlantıyı kabul etti
Comment[uk]=Користувач приймає з'єднання
Comment[ven]=Mushumisi o tanganedza vhukwamani
Comment[xh]=Umsebenzisi wamkela uxhulumaniso
Comment[zh_CN]=用户接受连接
Comment[zh_TW]=使用者接受的連線
Comment[zu]=Umsebenzi uyakuvumela ukuxhumana
default_presentation=4
[UserRefusesConnection]
Name=UserRefusesConnection
Name[ar]=المستخدم رفض الاتصال
Name[bg]=Потребител Отказва Връзка
Name[ca]=L'usuari refusa la connexió
Name[cs]=Uživatel odmítá spojení
Name[da]=BrugerAfslårForbindelse
Name[de]=BenutzerLehntVerbindungAb
Name[el]=Ο χρήστης δε δέχεται σύνδεση
Name[eo]=UzantoRifuzasKonektojn
Name[es]=El usuario rechaza la conexión
Name[et]=KasutajaKeeldubÜhendusest
Name[fr]=L'utilisateur refuse les connexions
Name[he]=משתמש דוחה חיבור
Name[hr]=KorisnikOdbijaVezu
Name[hu]=KapcsolatVisszautasítva
Name[is]=NotandiHafnarTengingum
Name[it]=L'utente rifiuta la connessione
Name[ja]=ユーザが拒否した接続
Name[lt]=Vartotojas atmeta prisijungimą
Name[mk]=КорисникотОдбиВрска
Name[mt]=UserJirrifjutaKonnessjoni
Name[nb]=Bruker avviser oppkobling
Name[nl]=Gebruiker weigert verbinding
Name[nn]=Brukar nektar samband
Name[nso]=Modiriši o Gana Kgokagano
Name[pl]=Połączenie odrzucone przez użytkownika
Name[pt_BR]=Rejeita Conexões do Usuário
Name[ro]=Conexiune respinsă de utilizator
Name[ru]=Пользователь не принимает соединения
Name[sk]=Užívateľ zamietol spojenie
Name[sl]=Uporabnik zavrača povezavo
Name[sv]=Användaren vägrar anslutning
Name[th]=ผู้ใช้ปฏิเสธการเชื่อมต่อ
Name[uk]=КористувачВідмовляєУЗ'єднанні
Name[ven]=Mushumisi o hana Vhukwamani
Name[xh]=Umsebenzisi Uyalwala Uxhulumaniso
Name[zh_CN]=用户拒绝连接
Name[zh_TW]=使用者拒絕連線
Name[zu]=UmsebenzisiWalaUxhumaniso
Comment=User refuses connection
Comment[af]=Gebruiker weier verbinding
Comment[ar]=المستخدم رفض الاتصال
Comment[bg]=Потребител отказва връзка
Comment[bs]=Korisnik odbija konekciju
Comment[ca]=L'usuari refusa la connexió
Comment[cs]=Uživatel odmítá spojení
Comment[da]=Bruger afslår forbindelse
Comment[de]=Der Benutzer lehnt die Verbindung ab
Comment[el]=Ο χρήστης δε δέχεται σύνδεση
Comment[eo]=Uzanto rifuzas konektojn
Comment[es]=El usuario rechaza la conexión
Comment[et]=Kasutaja keeldub ühendusest
Comment[fi]=Käyttäjä hylkää yhteyden
Comment[fr]=L'utilisateur refuse les connexions
Comment[he]=המשתמש מסרב לחיבור
Comment[hr]=Korisnik odbija vezu
Comment[hu]=A felhasználó visszautasítja a csatlakozási kérést
Comment[is]=Notandi hafnar tengingu
Comment[it]=L'utente rifiuta la connessione
Comment[ja]=ユーザが接続を拒否
Comment[lt]=Vartotojas atmeta prisijungimą
Comment[mk]=Корисникот ја одби врската
Comment[mt]=User jiċħad il-konnessjoni
Comment[nb]=Bruker avviser oppkobling
Comment[nl]=Gebruiker weigert verbinding
Comment[nn]=Brukar nektar samband
Comment[nso]=Modiriši o gana kgokagano
Comment[pl]=Użytkownik odrzuca połączenie
Comment[pt]=O utilizador recusa a ligação
Comment[pt_BR]=O usuário rejeita a conexão
Comment[ro]=Utilizatorul refuză conexiunea
Comment[ru]=Пользователь не принимает соединения
Comment[sk]=Užívateľ odmietol spojenie
Comment[sl]=Uporabnik zavrnil povezavo
Comment[sv]=Användaren vägrar anslutning
Comment[th]=ผู้ใช้ปฏิเสธการเชื่อมต่อ
Comment[tr]=Kullanıcı bağlantıyı iptal etti
Comment[uk]=Користувач відмовляє у з'єднанні
Comment[ven]=Mushumisi o hana vhukwamani
Comment[xh]=Umsebenzisi wala uxhulumaniso
Comment[zh_CN]=用户拒绝连接
Comment[zh_TW]=使用者拒絕的連線
Comment[zu]=Umsebenzi awukuvumeli ukuxhumana
default_presentation=4
[ConnectionClosed]
Name=ConnectionClosed
Name[ar]=اتصال مغلق
Name[bg]=Връзката е Затворена
Name[ca]=Connexió tancada
Name[cs]=Spojení ukončeno
Name[da]=ForbindelseLukket
Name[de]=VerbindungGeschlossen
Name[el]=Η σύνδεση έκλεισε
Name[eo]=KonektoFermita
Name[es]=Conexión cerrada
Name[et]=ÜhendusSuletud
Name[fr]=Connexion fermée
Name[he]=חיבור נסגר
Name[hr]=VezaPrekinuta
Name[hu]=KapcsolatBezárva
Name[is]=TenginguLokað
Name[it]=Connessione chiusa
Name[ja]=接続切断
Name[lt]=Prisijungimas uždarytas
Name[mk]=ВрскатаЗатворена
Name[mt]=KonnessjonijiMagħluqa
Name[nb]=Kobling stengt
Name[nl]=Verbinding gesloten
Name[nn]=Samband stengt
Name[nso]=Kgokagano e Tswaletšwe
Name[pl]=Połączenia zakończone
Name[pt_BR]=Conexão fechada
Name[ro]=Conexiune închisă
Name[ru]=Соединение закрыто
Name[sk]=Spojenie ukončené
Name[sl]=Povezava zaprta
Name[sv]=Anslutning stängd
Name[th]=การเชื่อมต่อยุติ
Name[tr]=Bağlantı Kapatıldı
Name[uk]=З'єднанняЗакрито
Name[ven]=Vhukwamani ho valwa
Name[xh]=Uxhulumaniso Luvaliwe
Name[zh_CN]=连接关闭
Name[zh_TW]=連線已關閉
Name[zu]=UkuxhumanisaKuvaliwe
Comment=Connection closed
Comment[af]=Verbinding gesluit
Comment[ar]=الاتصال قُطع
Comment[bg]=Връзката е затворена
Comment[bs]=Konekcija prekinuta
Comment[ca]=Connexió tancada
Comment[cs]=Spojení ukončeno
Comment[da]=Forbindelse lukket
Comment[de]=Verbindung geschlossen
Comment[el]=Η σύνδεση έκλεισε
Comment[eo]=Konekto fermita
Comment[es]=Conexión rechazada
Comment[et]=Ühendus suletud
Comment[fi]=Yhteys suljettu
Comment[fr]=Connexion coupée
Comment[he]=החיבור נסגר
Comment[hr]=Veza prekinuta
Comment[hu]=A kapcsolat bezárva
Comment[is]=Tengingu lokað
Comment[it]=Connessione chiusa
Comment[ja]=接続が閉じられました
Comment[lt]=Prisijungimas uždarytas
Comment[mk]=Врската е затворена
Comment[mt]=Konnessjoni magħluqa
Comment[nb]=Oppkobling stengt
Comment[nl]=Verbinding verbroken
Comment[nn]=Samband stengt
Comment[nso]=Kopantšho e tswaletšwe
Comment[pl]=Połączenie zakończone
Comment[pt]=Ligação fechada
Comment[pt_BR]=conexão encerrada
Comment[ro]=Conexiune închisă
Comment[ru]=Соединение закрыто
Comment[sk]=Spojenie ukončené
Comment[sl]=Povezava zaprta
Comment[sv]=Anslutning stängd
Comment[th]=การเชื่อมต่อยุติ
Comment[tr]=Bağlantı kesildi
Comment[uk]=З'єднання закрито
Comment[ven]=Vhukwamani ho valwa
Comment[xh]=Uxhulumaniso luvaliwe
Comment[zh_CN]=连接关闭
Comment[zh_TW]=連線已關閉
Comment[zu]=Ukuxhumana kuvaliwe
default_presentation=4
[InvalidPassword]
Name=InvalidPassword
Name[ar]=كلمة مرور غير صالحة
Name[be]=Некарэктны пароль
Name[bg]=Грешна Парола
Name[ca]=Contrasenya no vàlida
Name[cs]=Neplatné heslo
Name[da]=UgyldigtKodeord
Name[de]=UngültigesPasswort
Name[el]=Λάθος κωδικός πρόσβασης
Name[eo]=NevalidaPasvorto
Name[es]=Contraseña errónea
Name[et]=ValeParool
Name[fr]=Mots de passe non valable
Name[he]=סיסמה לא תקפה
Name[hr]=NevažećaLozinka
Name[hu]=ÉrvénytelenJelszó
Name[is]=ÓgiltLykilorð
Name[it]=Password non valida
Name[ja]=不正なパスワード
Name[lt]=Neteisingas slaptažodžis
Name[mk]=НевалиднаЛозинка
Name[mt]=PasswordĦażin
Name[nb]=Ugyldig passord
Name[nl]=Ongeldig wachtwoord
Name[nn]=Ugyldig passord
Name[nso]=Lentšuphetišo gase la Nnete
Name[pl]=Błędne hasło
Name[pt_BR]=Senha inválida
Name[ro]=Parolă eronată
Name[ru]=Неверный пароль
Name[sk]=Zlé heslo
Name[sl]=Nepravilno geslo
Name[sv]=Ogiltigt lösenord
Name[th]=รหัสผ่านไม่ถูกต้อง
Name[tr]=Geçersiz Parola
Name[uk]=НевірнийПароль
Name[ven]=Phasiwede asi yone
Name[xh]=Igama lokugqitha Elingasebenziyo
Name[zh_CN]=无效口令
Name[zh_TW]=無效的密碼
Name[zu]=IgamaEliyimfihloLokudlulaOkungasiyilona
Comment=Invalid password
Comment[af]=Ongeldige wagwoord
Comment[ar]=كلمة مرور غير صالحة
Comment[be]=Некарэктны пароль
Comment[bg]=Грешна парола
Comment[bs]=Neispravna šifra
Comment[ca]=Contrasenya no vàlida
Comment[cs]=Neplatné heslo
Comment[da]=Ugyldigt kodeord
Comment[de]=Ungültiges Passwort
Comment[el]=Λάθος κωδικός πρόσβασης
Comment[eo]=nevalida pasvorto
Comment[es]=Contraseña errónea
Comment[et]=Vale parool
Comment[fi]=Virheellinen salasana
Comment[fr]=Mot de passe non valable
Comment[he]=הסיסמה אינה תקפה
Comment[hr]=Nevažeća šifra
Comment[hu]=Érvénytelen jelszó
Comment[is]=Lykilorð ógilt
Comment[it]=Password non valida
Comment[ja]=不正なパスワード
Comment[lt]=Neteisingas slaptažodis
Comment[mk]=Невалидна лозинка
Comment[mt]=Password ħażin
Comment[nb]=Ugyldig passord
Comment[nl]=Ongeldig wachtwoord
Comment[nn]=Ugyldig passord
Comment[nso]=Lentšuphetišo gase la nnete
Comment[pl]=Błędne hasło
Comment[pt]=Senha inválida
Comment[pt_BR]=senha inválida
Comment[ro]=Parolă eronată
Comment[ru]=Неверный пароль
Comment[sk]=Zlé heslo
Comment[sl]=Nepravilno geslo
Comment[sv]=Ogiltigt lösenord
Comment[th]=รหัสผ่านไม่ถูกต้อง
Comment[tr]=Geçersiz parola
Comment[uk]=Невірний пароль
Comment[ven]=Phasiwede isa shumi
Comment[xh]=Igama lokugqitha elingasebenziyo
Comment[zh_CN]=无效口令
Comment[zh_TW]=無效的密碼
Comment[zu]=Igama elifihlikeli
default_presentation=4
[InvalidPasswordInvitations]
Name=InvalidPasswordInvitations
Name[ar]=دعوات كلمات مرور غير صالحة
Name[bg]=Грешна Парола за Покана
Name[ca]=Contrasenya convidats no vàlides
Name[cs]=Neplatné hesla výzev
Name[da]=UgyldigtKodeordInvitationer
Name[de]=UngültigePasswortAnfragen
Name[eo]=NevalidaPasvortoInvito
Name[es]=Invitación de contraseñas erróneas
Name[et]=ValeParoolKutsed
Name[fr]=Invitations de mot de passe non valable
Name[he]=סיסמת לא תקפה - הזמנות
Name[hr]=KrivePizovniceŠifri
Name[hu]=ÉrvénytelenJelszóMeghívások
Name[is]=ÓgildLykilorðsBoð
Name[it]=Invito password non valida
Name[ja]=不正なパスワードの招待
Name[lt]=Neteisingo slaptažodžio kvietimai
Name[mk]=ПоканиСоНевалидниЛозинки
Name[mt]=PasswordĦażinaStediniet
Name[nb]=Ugyldig passord ved invitasjon
Name[nl]=Ongeldige wachtwoordaanvragen
Name[nn]=Ugyldige passordinvitasjonar
Name[nso]=Ditaletšo tša Mantsuphetišo tšeo esego tša Nnete
Name[pl]=Informacja o błędnym haśle
Name[pt_BR]=Aviso de senha inválida
Name[ru]=Неверный запрос пароля
Name[sk]=Zlé heslo pozvánky
Name[sl]=Povabila z nepravilnimi gesli
Name[sv]=Ogiltigt lösenord vid inbjudan
Name[uk]=ЗапрошенняЗНевірнимПаролем
Name[ven]=Mbidzo ya phasiwede isi yone
Name[xh]=IzimemoZegamalokugqithaEzingasebebenziyo
Name[zh_CN]=无效口令邀请
Name[zh_TW]=無效的密碼邀請函
Name[zu]=IsimemoSegamaEliyimfihloLokudlulaOkungasiyilona
Comment=The invited party sent an invalid password. Connection refused.
Comment[af]=Die uitgenooi party gestuur 'n ongeldige wagwoord. Verbinding geweier.
Comment[ar]=الجهة المدعوة أرسلت كلمة مرور غير صالحة. الاتصال رُفض
Comment[bs]=Pozvana strana je poslala neispravnu šifru. Konekcija je odbijena.
Comment[ca]=La part invitada ha enviat una contrasenya no vàlida. Connexió refusada.
Comment[cs]=Pozvaná strana poslala neplatné heslo. Spojení odmítnuto.
Comment[da]=Den inviterede part sendte et ugyldigt kodeord. Forbindelse afslået.
Comment[de]=Die eingeladene Partei hat ein ungültiges Passwort gesendet: Verbindung abgelehnt.
Comment[el]=Η προσκαλεσμένη ομάδα έστειλε άκυρο κωδικό πρόσβασης. Η σύνδεση απορρίφθηκε.
Comment[eo]=La invitita kliento sendis nevalidan pasvorton. Konekto rifuzita.
Comment[es]=La parte invitada envió una contraseña incorrecta. Conexión rechazada
Comment[et]=Kutsutu saatis vigase parooli. Ühendusest keelduti.
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[he]=הצד המוזמן שלח סיסמה לא תקפה. החיבור נדחה.
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ás nem sikerült.
Comment[is]=Boðinn aðili sendi ógilt lykilorð. Tengingu hafnað
Comment[it]=La festa invitata ha inviato una password non valida. Connessione rifiutata.
Comment[ja]=招待された人が不正なパスワードを送って来ました。接続は拒否されました。
Comment[lt]=Kviečiančioji pusė atsiuntė blogą slaptažodį. Prisijungimas atmestas.
Comment[mk]=Поканетата странка испрати невалидна лозинка. Врската одбиена.
Comment[mt]=Il-persuna mistiedna bagħtet password ħażin. Konnessjoni miċħuda.
Comment[nb]=Den inviterte parten sendte ugyldig passord. Oppkobling avvist.
Comment[nl]=De uitgenodigde partij stuurde een ongeldig wachtwoord. Verbinding geweigerd.
Comment[nn]=Den inviterte parten sende eit ugyldig passord. Sambandet vart nekta.
Comment[nso]=Sehlopha seo se memilwego se romela lentšuphetišo leo esego la nnete. Kgokagano e gannwe.
Comment[pl]=Z drugiej strony podano błędne hasło. Połączenie odrzucone.
Comment[pt]=O convidado enviou uma senha inválida. A ligação foi recusada.
Comment[pt_BR]=A parte "convidada" enviou uma senha inválida. Conexão recusada.
Comment[ru]=Удалённый пользователь ввёл неверный пароль. В доступе отказано.
Comment[sk]=Pozvaný účastník poslal zlé heslo. Spojenie zamietnuté.
Comment[sl]=Povabljena stranka je poslala nepravilno geslo. Povezava zavrnjena.
Comment[sv]=Den inbjudna personen skickade ett ogiltigt lösenord. Anslutning vägrades.
Comment[th]=ผู้เข้าร่วมการเชิญชวนส่งรหัสผ่านมาไม่ถูกต้อง ทำการปฏิเสธการเชื่อมต่อ
Comment[uk]=Запрошена сторона надіслала невірний пароль. У з'єднанні відмовлено.
Comment[ven]=Murado o rambiwaho o rumela phasiwede isa shumi. Vhukwamani ho hanwa.
Comment[xh]=Umhlangano omenyiweyo uthumele igama lokugqitha elisebenzayo. Uxhulumano lwa liwe.
Comment[zh_CN]=受邀请方发送的口令不对。连接被拒绝。
Comment[zh_TW]=被邀請的一方送出無效的密碼。已拒絕連線。
Comment[zu]=Ingxenye emenyiwe ithumele igama lokungena alivunyelwanga. Ukuxhumana kwaliwe.
default_presentation=2
[NewConnectionOnHold]
Name=NewConnectionOnHold
Name[ar]=اتصال جديد على الانتظار
Name[bg]=Поддържа Нова Връзка
Name[ca]=Nova connexió en espera
Name[cs]=Nové spojení pozdrženo
Name[da]=NyForbindelseSatPåHold
Name[de]=NeueVerbindungWartet
Name[el]=Νέα σύνδεση σε αναμονή
Name[eo]=NovaKonektoAtendante
Name[es]=Nueva conexión en espera
Name[et]=UusÜhendusOotel
Name[fr]=Nouvelle connexion au raccroché
Name[he]=חיבור חדש בהמתנה
Name[hr]=NovaVezaNaČekanju
Name[hu]=ÚjKapcsolatTartva
Name[is]=NýTengingÁBið
Name[it]=Nuova connessione da tenere
Name[ja]=維持中の新規接続
Name[lt]=Naujas prisijungimas sulaikytas
Name[mk]=НоваВрскаНаПочек
Name[mt]=KonnessjoniĠdidaMiżmuma
Name[nb]=Ny oppkobling venter
Name[nl]=Nieuwe verbinding is wachtende
Name[nn]=Nytt samband ventar
Name[nso]=Kgokagano ye Ntshwa e Emišitšwe
Name[pl]=Nowe połączenie wstrzymane
Name[pt_BR]=Nova Conexão
Name[ro]=Conexiune nouă în aşteptare
Name[ru]=Новое соединение отключено
Name[sk]=Nové spojenie podržané
Name[sl]=Nova povezava na čakanju
Name[sv]=Ny anslutning väntar
Name[uk]=ОчікуютьНовіЗ'єднання
Name[ven]=Vhukwamani vhuswa ho imiswa
Name[xh]=Uxhulumano Olutsha Lumisiwe
Name[zh_CN]=新连接暂时搁置
Name[zh_TW]=保持的新連線
Name[zu]=UkuxhumanisaOkushaKubanjiwe
Comment=Connection requested, user must accept
Comment[af]=Verbinding versoekte, gebruiker moet aanvaar
Comment[ar]=طلب اتصال, يجب أن يقبل المستخدم
Comment[bg]=Заявка за връзка, потребителя трябва да приеме
Comment[bs]=Zatražena konekcija, korisnik mora prihvatiti
Comment[ca]=Connexió solicitada, l'usuari ha d'acceptar-la
Comment[cs]=Vyžadováno spojení, uživatel musí přijmout
Comment[da]=Forbindelse forespurgt, bruger skal acceptere
Comment[de]=Verbindungsanfrage, Benutzer muss bestätigen
Comment[el]=Ζητήθηκε σύνδεση, ο χρήστης πρέπει να αποδεχθεί
Comment[eo]=Konekto pridemandita, uzanto devas akcepti
Comment[es]=Conexón solicitada, el usuario debe aceptar
Comment[et]=Nõutakse ühendust, kasutaja peab seda lubama
Comment[fi]=Yhteyttä pyydettiin, käyttäjän tulee hyväksyä
Comment[fr]=Connexion demandée, l'utilisateur doit accepter
Comment[he]=נתבקש חיבור, על המשתמש לקבלו
Comment[hr]=Veza je zatražena, korisnik mora prihvatiti
Comment[hu]=Csatlakozási kérés, megerősítés szükséges
Comment[is]=Beiðni um tengingu, notandi verður að samþykkja
Comment[it]=Connessione richiesta, l'utente deve accettare
Comment[ja]=接続が要求されています。ユーザは受け入れなければなりません。
Comment[lt]=Paprašyta prisijungimo, vartotojas turėtų priimti prašymą
Comment[mk]=Врска е побарана, корисникот мора да прифати
Comment[mt]=Konnessjoni mitluba, user irid jaċċetta
Comment[nb]=Oppkobling ønskes, bruker må akseptere.
Comment[nl]=Verbinding verzocht, gebruiker dient te accepteren
Comment[nn]=Samband førespurd, brukar må godta
Comment[nso]=Kgokagano e kgopetšwe, modiriši o swanetše go dumela
Comment[pl]=Próba połączenia, musi być zaakceptowana przez użytkownika
Comment[pt]=A ligação foi pedida e o utilizador deve aceitar
Comment[pt_BR]=Conexão requisitada; o usuário deve aceitar
Comment[ro]=Cerere de conectare; utilizatorul trebuie să accepte
Comment[ru]=Запрос на соединение, требуется подтверждение пользователя
Comment[sk]=Vyžiadané spojenie, užívateľ musí akceptovať
Comment[sl]=Povezava vzpostavljena, uporabnik mora sprejeti
Comment[sv]=Anslutning begärd, användaren måste acceptera
Comment[th]=มีการร้องขอเชื่อมต่อ ผู้ใช้ต้องทำการยอมรับ
Comment[uk]=Запрошено з'єднання, користувач має прийняти
Comment[ven]=Vhukwamani ho humbelwa, mushumisi u fanela u tanganedza
Comment[xh]=Uxhulumaniso luceliwe, umsebenzisi kufanele amkele
Comment[zh_CN]=连接已请求,用户必须接受
Comment[zh_TW]=已請求連線,使用者必須接受
Comment[zu]=Ukuxhumanisa kuceliwe, umsebenzi kumele ivunyelwe
default_presentation=4
[NewConnectionAutoAccepted]
Name=NewConnectionAutoAccepted
Name[ar]=اتصال جديد مقبول تلقائياً
Name[bg]=Автоматично Приема Нова Връзка
Name[ca]=Nova connexió auto-acceptada
Name[cs]=Nové spojení automaticky přijato
Name[da]=NyForbindelseAutomatiskAccepteret
Name[de]=NeueVerbindungAutomatischAkzeptiert
Name[el]=Αυτόματη αποδοχή νέας σύνδεσης
Name[eo]=NovaKonektoAŭtomateAkceptita
Name[es]=Nueva conexión auto aceptada
Name[et]=UueÜhendusegaAutomaatseltNõus
Name[fr]=Nouvelle connexion auto-acceptée
Name[he]=חיבור חדש נתקבל אוטומטית
Name[hr]=NovaVezaAutoPrihvaćena
Name[hu]=ÚjKapcsolatAutoElfogadva
Name[is]=NýTengingSjálfvirktSamþykkt
Name[it]=Accettata nuova connessione automatica
Name[ja]=新規接続の新規受け入れ
Name[lt]=Naujas prisijungimas automatiškai priimtas
Name[mk]=НоваВрскаАвтоматскиПрифатена
Name[mt]=KonnessjoniĠdidaAwtoAċċettata
Name[nb]=Ny oppkobling aksepteres automatisk
Name[nl]=Nieuwe verbinding automatisch geaccepteerd
Name[nn]=Nytt samband automatisk godteke
Name[nso]=Kgokagano ye Ntshwa yago Itiriša e Amogetšwe
Name[pl]=Nowe połączenie automatycznie przyjęte
Name[pt_BR]=Nova Conexão com aceitação automática
Name[ro]=Conexiune nouă acceptată automat
Name[ru]=Соединение создается автоматически
Name[sk]=Nové spojenie automaticky akceptované
Name[sl]=Nova povezava samodejno sprejeta
Name[sv]=Ny anslutning accepterades automatiskt
Name[th]=รับการเชื่อมต่ออัตโนมัติ
Name[uk]=НовіЗ'єднанняАвтоматичноПрийняті
Name[ven]=Vhukwamani vhuswa ho tanganedzhwa
Name[xh]=Uxhulumano Olutsha Lwamkelwe Ngokuzenzekelayo
Name[zh_CN]=新连接自动接受
Name[zh_TW]=自動接受的新連線
Name[zu]=UkuxhumanisaOkushaKokuzenzakalelaKuvunyelwe
Comment=New connection automatically established
Comment[af]=Nuwe verbinding automaties vasgestel
Comment[ar]=اتصالات جديدة أُنشئت تلقائياً
Comment[bg]=Автоматично установяване на нова връзка
Comment[bs]=Automatski uspostavljena nova konekcija
Comment[ca]=Nova connexió establerta automàticament
Comment[cs]=Automaticky navázáno nové spojení
Comment[da]=Ny forbindelse automatisk etableret
Comment[de]=Neue Verbindung automatisch hergestellt
Comment[el]=Νέα σύνδεση αυτόματα αποκαταστάθηκε
Comment[eo]=Nova konekto aŭtomate akceptita
Comment[es]=Nueva conexión establecida automáticamente
Comment[et]=Uus ühendus automaatselt loodud
Comment[fi]=Uisi yhteys muodostettu automaattisesti
Comment[fr]=Nouvelle connexion établie automatiquement
Comment[he]=נוצר חיבור חדש באופן אוטומטי
Comment[hr]=Nova veza automatski prihvaćena
Comment[hu]=Automatikusan létrejött az új kapcsolat
Comment[is]=Nýjar tengingar sjálfkrafa samþykktar
Comment[it]=Stabilita nuova connessione automaticamente
Comment[ja]=新規接続は自動的に確立されます
Comment[lt]=Naujas prisijungimas sukurtas automatiškai
Comment[mk]=Нова врска автоматски поставена
Comment[mt]=Konnessjoni ġdida aċċettata awtomatikament
Comment[nb]=Ny oppkobling automatisk opprettet
Comment[nl]=Nieuwe verbinding automatisch opgebouwd
Comment[nn]=Nytt samband automatisk oppretta
Comment[nso]=Kgokagano ye ntshwa e hlagišitšwe kago itiriša
Comment[pl]=Nowe połączenie ustanowiono automatycznie
Comment[pt]=A nova ligação foi estabelecida automaticamente
Comment[pt_BR]=Nova conexão estabelecida automaticamente
Comment[ro]=Conexiune nouă stabilită automat
Comment[ru]=Новое соединение устанавливается автоматически
Comment[sk]=Nové spojenie automaticky vytvorené
Comment[sl]=Nova povezava samodejno vzpostavljena
Comment[sv]=Ny anslutning automatiskt upprättad
Comment[th]=เปิดการเชื่อมต่อใหม่อัตโนมัติ
Comment[uk]=Автоматично встановлено нове з'єднання
Comment[ven]=Vhukwamani vhuswa ho itwa na zwenezwo
Comment[xh]=Uxhulumaniso olutsha lufunyenwe ngokuzenzekelayo
Comment[zh_CN]=自动建立新连接
Comment[zh_TW]=已自動建立新連線
Comment[zu]=Ukuxhumana okusha kuyazisungulela
default_presentation=4
[TooManyConnections]
Name=TooManyConnections
Name[ar]=اتصالات عديدة جداً
Name[bg]=Твърде Много Връзки
Name[ca]=Masses connexions
Name[cs]=Příliš mnoho spojení
Name[da]=ForMangeForbindelser
Name[de]=ZuVieleVerbindungen
Name[el]=Πάρα πολλές συνδέσεις
Name[eo]=TroMultajKonektoj
Name[es]=Demasiadas conexiones
Name[et]=LiigaPaljuÜhendusi
Name[fr]=Trop de connexions
Name[he]=יותר מדיי חיבורים
Name[hr]=PrevišeVeza
Name[hu]=TúlSokKapcsolat
Name[is]=OfMargarTengingar
Name[it]=Troppe Connessioni
Name[ja]=多すぎる接続
Name[lt]=Per daug prisijungimų
Name[mk]=ПремногуВрски
Name[mt]=WisqKonnessjonijiet
Name[nb]=For mange oppkoblinger
Name[nl]=Teveel verbindingen
Name[nn]=For mange samband
Name[nso]=Dikgokagano tše Ntšhi Kudu
Name[pl]=Zbyt wiele połączeń
Name[pt_BR]=Conexões em excesso
Name[ro]=Prea multe conexiuni
Name[ru]=Слишком много соединений
Name[sk]=Príliš veľa spojení
Name[sl]=Preveč povezav
Name[sv]=För många anslutningar
Name[th]=มีการเชื่อมต่อมากเกินไป
Name[tr]=ÇokFazlaBağlantı
Name[uk]=ЗабагатоЗ'єднань
Name[ven]=Vhukwamani vhunzhi
Name[xh]=Uxhulumaniso Oluninzi Kakhulu
Name[zh_CN]=连接太多
Name[zh_TW]=太多連線
Name[zu]=UkuxhumanaOkuningi
Comment=Busy, connection refused
Comment[af]=Besig, verbinding geweier
Comment[ar]=مشغول , الاتصال رُفض
Comment[bg]=Заето, връзката е отказана
Comment[bs]=Zauzet, konekcija odbijena
Comment[ca]=Ocupat, connexió refusada
Comment[cs]=Zaneprázdněn, spojení odmítnuto
Comment[da]=Optaget, forbindelse afslået
Comment[de]=Beschäftigt, Verbindung abgelehnt
Comment[el]=Απασχολημένο, η σύνδεση απορρίφθηκε
Comment[eo]=Laborante, konekto rifuzita
Comment[es]=Ocupado, conexión rechazada
Comment[et]=Hõivatud, ühendusest keelduti
Comment[fi]=Varattu, yhteys hylättiin
Comment[fr]=Occupé, connexion refusée
Comment[he]=תפוס, החיבור נדחה
Comment[hr]=Zauzeto, veza odbijena
Comment[hu]=Foglalt, a csatlakozási kérés visszautasítva
Comment[is]=Uptekinn, tengingu hafnað
Comment[it]=Occupato, connessione rifiutata
Comment[ja]=ビジーです。接続は拒否されました
Comment[lt]=Užimtas, prisijungimas atmestas
Comment[mk]=Зафатено, врската одбиена
Comment[mt]=Okkupat, konnessjoni miċħuda
Comment[nb]=Opptatt, oppkobling avvist
Comment[nl]=Bezig, verbinding geweigerd
Comment[nn]=Oppteken, samband nekta
Comment[nso]=E swaregile, kgokagano e gannwe
Comment[pl]=Zajęte, połączenie odrzucone
Comment[pt]=Ocupado, a ligação foi recusada
Comment[pt_BR]=Ocupado; conexão recusada
Comment[ro]=Ocupat; conexiune refuzată
Comment[ru]=Занято, соединение закрыто
Comment[sk]=Zaneprázdnený, spojenie odmietnuté
Comment[sl]=zaposlen, povezava zavrnjena
Comment[sv]=Upptagen, anslutning vägras
Comment[th]=ยังไม่ว่าง ทำการปฏิเสธการเชื่อมต่อ
Comment[uk]=Зайнято, у з'єднанні відмовлено
Comment[ven]=U farakanea, vhukwamani ho hanwa
Comment[xh]=Uxhulumaniso, olu xakekileyo lwaliwe
Comment[zh_CN]=占线,连接拒绝
Comment[zh_TW]=忙碌,已拒絕連線
Comment[zu]=Imatasa,ukuxhumana kwaliwe
default_presentation=4
default_logfile=
[UnexpectedConnection]
Name=UnexpectedConnection
Name[ar]=اتصال غير متوقع
Name[bg]=Неочаквана Връзка
Name[ca]=Connexió inesperada
Name[cs]=Neočekávané spojení
Name[da]=UventetForbindelse
Name[de]=UnerwarteteVerbindung
Name[el]=Μη αναμενόμενη σύνδεση
Name[eo]=NeatenditaKonekto
Name[es]=Conexión inesperada
Name[et]=OotamatuÜhendus
Name[fr]=Connexion inattendue
Name[he]=חיבור בלתי צפוי
Name[hr]=NeočekivanaVeza
Name[hu]=NemVártKapcsolat
Name[is]=ÓvæntTenging
Name[it]=Connessione inaspettata
Name[ja]=予期しない接続
Name[lt]=Netikėtas prisijungimas
Name[mk]=НеочекуванаВрска
Name[mt]=KonnessjonijietMhuxMistennija
Name[nb]=Uventet oppkobling
Name[nl]=Onverwachte verbinding
Name[nn]=Uventa samband
Name[nso]=Kgokagano yeo ebego esa Emelwa
Name[pl]=Niespodziewane połączenie
Name[pt_BR]=Conexão não-aceita
Name[ro]=Conexiune neaşteptată
Name[ru]=Неожиданное соединение
Name[sk]=Neočakávane spojenie
Name[sl]=Nepričakovana povezava
Name[sv]=Oväntad anslutning
Name[th]=การเชื่อมต่อที่ไม่คาดหวัง
Name[tr]=Beklenmedik Bağlantı
Name[uk]=НеочікуванеЗ'єднання
Name[ven]=Vhukwamani vhu songo lavhelelwaho
Name[xh]=Uxhulumaniso Olungalindelwanga
Name[zh_CN]=未料到的连接
Name[zh_TW]=非預期的連線
Name[zu]=UkuxhumanaOkungalindelwe
Comment=Received unexpected connection, abort
Comment[af]=Ontvang onverwagte verbinding, staak
Comment[ar]=تم استلام اتصال غير متوقع , اقطع
Comment[bg]=Получи се неочаквана връзка, прекъсва
Comment[bs]=Primio neočekivanu konekciju, prekidam
Comment[ca]=Rebuda una connexió inesperada, abortant
Comment[cs]=Obdrženo neočekávané spojení, přerušeno
Comment[da]=Modtog uventet forbindelse, afbrød
Comment[de]=Unerwartete Verbindung hergestallt, Abbruch
Comment[el]=Λήψη μη αναμενόμενης σύνδεσης, διακοπή
Comment[eo]=Ricevis neatenditan konekton, haltis
Comment[es]=Recibida conexión inesperada, abortar
Comment[et]=Saadi ootamatu ühendus, loobuti
Comment[fi]=Vastaanotettiin odottamaton yhteys, lopeta
Comment[fr]=Reçu une connexion inattendue, interruption
Comment[he]=נתקבל חיבור בלתי צפוי, בוטל
Comment[hr]=Primio sam neočekivanu vezu, prekid
Comment[hu]=Nem várt csatlakozási kérés, kilépés
Comment[is]=Tók á móti óvæntri tengingu, hætti
Comment[it]=Ricevuta connessione inaspettata, termina
Comment[ja]=予期しない接続を受信しました。廃棄します。
Comment[lt]=Gautas netikėtas prisijungimas, nutraukiama
Comment[mk]=Примена неочекувана врска, прекини
Comment[mt]=Irċevejt konnessjoni mhux mistennija, ieqaf
Comment[nb]=Mottok uventet oppkobling, avbryt
Comment[nl]=Ontving een onverwachte verbinding, gestopt
Comment[nn]=Mottok uventa samband, avbryt
Comment[nso]=Amogetše kgokagano yeo ebego esa emelwa, bolaya
Comment[pl]=Otrzymano niespodziewane połączenie. Przerwane.
Comment[pt]=Foi recebida uma ligação inesperada, a interromper
Comment[pt_BR]=conexão recebida inesperadamente; abortar
Comment[ro]=A fost recepţionată o conexiune neaşteptată şi a fost anulată
Comment[ru]=Получено неожиданное соединение. Отключение
Comment[sk]=Prijaté neočakávane spojenie, ukončujem
Comment[sl]=Prejeta nepričakovana povezava, prekinjam
Comment[sv]=Tog emot oväntad anslutning, avbryter
Comment[th]=ได้รับการเชื่อมต่อที่ไม่คาดหวัง ทำการยกเลิก
Comment[uk]=Отримано неочікуване з'єднання, скасовую
Comment[ven]=Vhukwamani vhu songo lavhelelwaho ho tanganedzhwaho, litsha
Comment[xh]=Ufumene uxhulumaniso olungalindelekanga, lahla
Comment[zh_CN]=收到未料到连接,中止
Comment[zh_TW]=接收到非預期的連線,放棄
Comment[zu]=Isithole ukuxhumana okungalindelekanga, hushula
default_presentation=4

BIN
krfb/eyes-closed24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

BIN
krfb/eyes-open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

BIN
krfb/eyes-open24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

View File

@@ -1,75 +0,0 @@
/* 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 "framebuffer.h"
#include <config-krfb.h>
#include <X11/Xutil.h>
FrameBuffer::FrameBuffer(WId id, QObject *parent)
: QObject(parent), win(id)
{
}
FrameBuffer::~FrameBuffer()
{
delete fb;
}
char *FrameBuffer::data()
{
return fb;
}
QList< QRect > FrameBuffer::modifiedTiles()
{
QList<QRect> ret = tiles;
tiles.clear();
return ret;
}
int FrameBuffer::width()
{
return 0;
}
int FrameBuffer::height()
{
return 0;
}
void FrameBuffer::getServerFormat(rfbPixelFormat &)
{
}
QVariant FrameBuffer::customProperty(const QString &property) const
{
Q_UNUSED(property)
return QVariant();
}
int FrameBuffer::depth()
{
return 32;
}
int FrameBuffer::paddedWidth()
{
return width() * depth() / 8;
}
void FrameBuffer::startMonitor()
{
}
void FrameBuffer::stopMonitor()
{
}

View File

@@ -1,62 +0,0 @@
/* 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 FRAMEBUFFER_H
#define FRAMEBUFFER_H
#include "rfb.h"
#include "krfbprivate_export.h"
#include <QObject>
#include <QRect>
#include <QList>
#include <QVariant>
#include <QWidget>
class FrameBuffer;
/**
@author Alessandro Praduroux <pradu@pradu.it>
*/
class KRFBPRIVATE_EXPORT FrameBuffer : public QObject
{
Q_OBJECT
public:
explicit FrameBuffer(WId id, QObject *parent = nullptr);
~FrameBuffer() override;
char *data();
virtual QList<QRect> modifiedTiles();
virtual int paddedWidth();
virtual int width();
virtual int height();
virtual int depth();
virtual void startMonitor();
virtual void stopMonitor();
virtual void getServerFormat(rfbPixelFormat &format);
virtual QVariant customProperty(const QString &property) const;
Q_SIGNALS:
void frameBufferChanged();
protected:
WId win;
char *fb = nullptr;
QList<QRect> tiles;
private:
Q_DISABLE_COPY(FrameBuffer)
};
#endif

View File

@@ -1,138 +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 "framebuffermanager.h"
#include "framebufferplugin.h"
#include "krfbconfig.h"
#include "krfbdebug.h"
#include <QGlobalStatic>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QSharedPointer>
class FrameBufferManagerStatic
{
public:
FrameBufferManager instance;
};
Q_GLOBAL_STATIC(FrameBufferManagerStatic, frameBufferManagerStatic)
FrameBufferManager::FrameBufferManager()
{
//qDebug();
loadPlugins();
}
FrameBufferManager::~FrameBufferManager()
{
//qDebug();
}
FrameBufferManager *FrameBufferManager::instance()
{
//qDebug();
return &frameBufferManagerStatic->instance;
}
void FrameBufferManager::loadPlugins()
{
//qDebug();
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb"), [](const KPluginMetaData & md) {
return md.serviceTypes().contains(QStringLiteral("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();
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<FrameBufferPlugin>(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<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
{
//qDebug();
// 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.";
return weakFrameBuffer.toStrongRef();
} else {
//qDebug() << "Found deleted cached frame buffer. Don't use.";
m_frameBuffers.remove(id);
}
}
// We don't already have that frame buffer.
QMap<QString, FrameBufferPlugin *>::const_iterator iter = m_plugins.constBegin();
while (iter != m_plugins.constEnd()) {
if (iter.key() == KrfbConfig::preferredFrameBufferPlugin()) {
qCDebug(KRFB) << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id));
if (frameBuffer) {
m_frameBuffers.insert(id, frameBuffer.toWeakRef());
return frameBuffer;
}
}
++iter;
}
// No valid framebuffer plugin found.
qCDebug(KRFB) << "No valid framebuffer found. returning null.";
return QSharedPointer<FrameBuffer>();
}

View File

@@ -1,63 +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_FRAMEBUFFERMANAGER_H
#define KRFB_FRAMEBUFFERMANAGER_H
#include "framebuffer.h"
#include "krfbprivate_export.h"
#include <QMap>
#include <QObject>
#include <QSharedPointer>
#include <QWeakPointer>
#include <QWidget>
class FrameBufferPlugin;
class KPluginFactory;
class KRFBPRIVATE_EXPORT FrameBufferManager : public QObject
{
Q_OBJECT
friend class FrameBufferManagerStatic;
public:
static FrameBufferManager *instance();
~FrameBufferManager() override;
QSharedPointer<FrameBuffer> frameBuffer(WId id);
private:
Q_DISABLE_COPY(FrameBufferManager)
FrameBufferManager();
void loadPlugins();
QMap<QString, FrameBufferPlugin *> m_plugins;
QMap<WId, QWeakPointer<FrameBuffer> > m_frameBuffers;
};
#endif // Header guard

View File

@@ -1,32 +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 "framebufferplugin.h"
#include "framebuffer.h"
FrameBufferPlugin::FrameBufferPlugin(QObject *parent, const QVariantList &)
: QObject(parent)
{
}
FrameBufferPlugin::~FrameBufferPlugin()
{
}

View File

@@ -1,44 +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 LIB_KRFB_FRAMEBUFFERPLUGIN_H
#define LIB_KRFB_FRAMEBUFFERPLUGIN_H
#include "krfbprivate_export.h"
#include <QVariantList>
#include <QWidget>
class FrameBuffer;
class KRFBPRIVATE_EXPORT FrameBufferPlugin : public QObject
{
Q_OBJECT
public:
FrameBufferPlugin(QObject *parent, const QVariantList &args);
~FrameBufferPlugin() override;
virtual FrameBuffer *frameBuffer(WId id) = 0;
};
#endif // Header guard

102
krfb/invitation.cc Normal file
View File

@@ -0,0 +1,102 @@
/***************************************************************************
invitation.cpp
-------------------
begin : Sat Mar 30 2002
copyright : (C) 2002 by Tim Jansen
(C) Stefan Taferner (password encryption)
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 "invitation.h"
/*
* Function for (en/de)crypting strings for config file, taken from KMail
* Author: Stefan Taferner <taferner@alpin.or.at>
*/
QString cryptStr(const QString &aStr) {
QString result;
for (unsigned int i = 0; i < aStr.length(); i++)
result += (aStr[i].unicode() < 0x20) ? aStr[i] :
QChar(0x1001F - aStr[i].unicode());
return result;
}
Invitation::Invitation() :
m_viewItem(0) {
m_password = KApplication::randomString(4)+
"-"+
KApplication::randomString(4);
m_creationTime = QDateTime::currentDateTime();
m_expirationTime = QDateTime::currentDateTime().addSecs(INVITATION_DURATION);
}
Invitation::Invitation(const Invitation &x) :
m_password(x.m_password),
m_creationTime(x.m_creationTime),
m_expirationTime(x.m_expirationTime),
m_viewItem(0) {
}
Invitation::Invitation(KConfig* config, int num) {
m_password = cryptStr(config->readEntry(QString("password%1").arg(num), ""));
m_creationTime = config->readDateTimeEntry(QString("creation%1").arg(num));
m_expirationTime = config->readDateTimeEntry(QString("expiration%1").arg(num));
m_viewItem = 0;
}
Invitation::~Invitation() {
if (m_viewItem)
delete m_viewItem;
}
Invitation &Invitation::operator= (const Invitation&x) {
m_password = x.m_password;
m_creationTime = x.m_creationTime;
m_expirationTime = x.m_expirationTime;
if (m_viewItem)
delete m_viewItem;
m_viewItem = 0;
return *this;
}
void Invitation::save(KConfig *config, int num) const {
config->writeEntry(QString("password%1").arg(num), cryptStr(m_password));
config->writeEntry(QString("creation%1").arg(num), m_creationTime);
config->writeEntry(QString("expiration%1").arg(num), m_expirationTime);
}
QString Invitation::password() const {
return m_password;
}
QDateTime Invitation::expirationTime() const {
return m_expirationTime;
}
QDateTime Invitation::creationTime() const {
return m_creationTime;
}
bool Invitation::isValid() const {
return m_expirationTime > QDateTime::currentDateTime();
}
void Invitation::setViewItem(KListViewItem *i) {
if (m_viewItem)
delete m_viewItem;
m_viewItem = i;
}
KListViewItem *Invitation::getViewItem() const{
return m_viewItem;
}

57
krfb/invitation.h Normal file
View File

@@ -0,0 +1,57 @@
/***************************************************************************
invitation.h
-------------------
begin : Sat Mar 30 2002
copyright : (C) 2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 INVITATION_H
#define INVITATION_H
#include <kapplication.h>
#include <klistview.h>
#include <kconfig.h>
#include <qobject.h>
#include <qstring.h>
#include <qdatetime.h>
const int INVITATION_DURATION = 60*60;
QString cryptStr(const QString &aStr);
class Invitation {
public:
Invitation();
~Invitation();
Invitation(KConfig* config, int num);
Invitation(const Invitation &x);
Invitation &operator= (const Invitation&x);
QString password() const;
QDateTime expirationTime() const;
QDateTime creationTime() const;
bool isValid() const;
void setViewItem(KListViewItem*);
KListViewItem* getViewItem() const;
void save(KConfig *config, int num) const;
private:
QString m_password;
QDateTime m_creationTime;
QDateTime m_expirationTime;
KListViewItem *m_viewItem;
};
#endif

Some files were not shown because too many files have changed in this diff Show More