mirror of
https://github.com/KDE/krfb
synced 2026-07-01 15:51:18 -07:00
Compare commits
87 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d931eafccf | ||
|
|
126a746dd7 | ||
|
|
2e21157945 | ||
|
|
857c2b411e | ||
|
|
b6b20c84e8 | ||
|
|
0bff5df104 | ||
|
|
83767fea93 | ||
|
|
8597d3c4a7 | ||
|
|
fd9f566d0b | ||
|
|
2eb0a2a9d2 | ||
|
|
85e13b7908 | ||
|
|
ad79d51e8b | ||
|
|
a1de26dde7 | ||
|
|
f074491e60 | ||
|
|
2e35cd2e08 | ||
|
|
6eefee2677 | ||
|
|
e452d68f05 | ||
|
|
c558eaf9b6 | ||
|
|
db5c2528cd | ||
|
|
c87064a797 | ||
|
|
c5c415c042 | ||
|
|
f64abc21ce | ||
|
|
f0714d9b30 | ||
|
|
45edf9d0ed | ||
|
|
7714a2a7f6 | ||
|
|
debffc2e10 | ||
|
|
13e2c2ace3 | ||
|
|
07b70bb411 | ||
|
|
0739a89908 | ||
|
|
2531061f3d | ||
|
|
22536aff9a | ||
|
|
0635d70b17 | ||
|
|
e5256cbf77 | ||
|
|
81fcc1e561 | ||
|
|
6c8e0f57fc | ||
|
|
53e4912a65 | ||
|
|
e016859ea8 | ||
|
|
05febb3fe8 | ||
|
|
806ddcc48f | ||
|
|
dcf2be6919 | ||
|
|
3abd0b6e63 | ||
|
|
89679f63c7 | ||
|
|
b61182da16 | ||
|
|
a8f42c73ec | ||
|
|
a11a86cdb9 | ||
|
|
aed9b9a236 | ||
|
|
41c9ecfc6a | ||
|
|
10cb2e2489 | ||
|
|
f417d6efce | ||
|
|
5a3fdd3774 | ||
|
|
dd2ced46ec | ||
|
|
96ee366c73 | ||
|
|
aa5701f354 | ||
|
|
32b69cb2f3 | ||
|
|
5cd069d45e | ||
|
|
da6f1d35a0 | ||
|
|
a5e58a8a83 | ||
|
|
3428e62959 | ||
|
|
2d778f6b18 | ||
|
|
66b4e8520a | ||
|
|
e237d18812 | ||
|
|
530098eba3 | ||
|
|
39bca53c76 | ||
|
|
c476ef5e3e | ||
|
|
142935f3dc | ||
|
|
4bd481ad54 | ||
|
|
e72807e225 | ||
|
|
51c54d7dd8 | ||
|
|
e270fb9186 | ||
|
|
f13c451752 | ||
|
|
e00ee00314 | ||
|
|
e45bad0e33 | ||
|
|
bdb22dca4d | ||
|
|
bfa0444be7 | ||
|
|
8a82a27da8 | ||
|
|
5097a44442 | ||
|
|
b24786205f | ||
|
|
9f56633c0b | ||
|
|
7c061ccbf1 | ||
|
|
e69fc2b61f | ||
|
|
dda89a146f | ||
|
|
ff967c23c1 | ||
|
|
672311ccea | ||
|
|
2b938c712e | ||
|
|
5fd621abc9 | ||
|
|
59183f3c69 | ||
|
|
33cc068753 |
@@ -3,28 +3,41 @@ project(krfb)
|
||||
if(NOT INSIDE_KDENETWORK)
|
||||
message("Not building inside KDENetwork, loading KDE CMake Macros.")
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
||||
|
||||
find_package(KDE4 REQUIRED)
|
||||
|
||||
include(KDE4Defaults)
|
||||
include(MacroLibrary)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT)
|
||||
message(WARNING "You enabled experimental Tubes support. Expect breakage!!")
|
||||
include(CheckFunctionExists)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckPrototypeExists)
|
||||
include(CheckTypeSize)
|
||||
|
||||
macro_optional_find_package(TelepathyQt4)
|
||||
macro_log_feature(TELEPATHY_QT4_FOUND "telepathy-qt4" "Telepathy Qt Bindings" "http://telepathy.freedesktop.org" FALSE "0.18" "Needed to build Telepathy Tubes support.")
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_SUPPORT)
|
||||
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE_PLATFORM_DEFINITIONS})
|
||||
|
||||
add_definitions(${QT_DEFINITIONS} ${QT_DBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
|
||||
if(WIN32)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
|
||||
endif(WIN32)
|
||||
add_definitions(${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
|
||||
endif(NOT INSIDE_KDENETWORK)
|
||||
|
||||
set(IS_KTP_INTERNAL_MODULE TRUE)
|
||||
set(CMAKE_MODULE_PATH
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
|
||||
${CMAKE_MODULE_PATH}
|
||||
)
|
||||
|
||||
macro_optional_find_package(TelepathyQt4)
|
||||
macro_log_feature(TelepathyQt4_FOUND "telepathy-qt" "Telepathy Qt Bindings" "http://telepathy.freedesktop.org" FALSE "0.9" "Needed to build Telepathy Tubes support.")
|
||||
|
||||
macro_optional_find_package(KTp)
|
||||
macro_log_feature(KTP_FOUND "KTP" "KDE Telepathy" "https://projects.kde.org/projects/extragear/network/telepathy" FALSE "" "Needed to build KDE IM Contacts Display in KRFB.")
|
||||
|
||||
macro_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE)
|
||||
macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM)
|
||||
|
||||
@@ -37,13 +50,14 @@ include_directories ("${CMAKE_CURRENT_BINARY_DIR}/krfb"
|
||||
|
||||
if(Q_WS_X11)
|
||||
if(NOT X11_XTest_FOUND)
|
||||
macro_log_feature(X11_XTest_FOUND "libXtst" "X11 Testing Resource extension library" "http://xorg.freedesktop.org" FALSE "" "useful for automated testing of X clients.")
|
||||
message(FATAL_ERROR "krfb requires the libXtst (http://xorg.freedesktop.org) to be built")
|
||||
endif(NOT X11_XTest_FOUND)
|
||||
endif(Q_WS_X11)
|
||||
|
||||
add_subdirectory(libvncserver)
|
||||
add_subdirectory(krfb)
|
||||
add_subdirectory (framebuffers)
|
||||
add_subdirectory(doc)
|
||||
|
||||
if (NOT INSIDE_KDENETWORK)
|
||||
macro_display_feature_log()
|
||||
|
||||
347
COPYING
Normal file
347
COPYING
Normal file
@@ -0,0 +1,347 @@
|
||||
NOTE! The GPL below is copyrighted by the Free Software Foundation, but
|
||||
the instance of code that it refers to (the kde programs) are copyrighted
|
||||
by the authors who actually wrote it.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, 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.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, 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 or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
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 give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
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 Program or any portion
|
||||
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
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 Program, 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 Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) 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; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, 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 executable. However, as a
|
||||
special exception, the source code 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.
|
||||
|
||||
If distribution of executable or 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 counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program 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.
|
||||
|
||||
5. 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 Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program 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 to
|
||||
this License.
|
||||
|
||||
7. 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 Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program 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 Program.
|
||||
|
||||
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.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program 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.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 Program
|
||||
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 Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, 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
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), 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 Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. 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 program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
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; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
397
COPYING.DOC
Normal file
397
COPYING.DOC
Normal file
@@ -0,0 +1,397 @@
|
||||
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.
|
||||
510
COPYING.LIB
Normal file
510
COPYING.LIB
Normal file
@@ -0,0 +1,510 @@
|
||||
|
||||
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!
|
||||
|
||||
|
||||
38
cmake/modules/FindKTp.cmake
Normal file
38
cmake/modules/FindKTp.cmake
Normal file
@@ -0,0 +1,38 @@
|
||||
# Try to find the KTp library
|
||||
# KTP_FOUND
|
||||
# KTP_INCLUDE_DIR
|
||||
# KTP_LIBRARIES
|
||||
# KTP_MODELS_LIBRARIES
|
||||
# KTP_WIDGETS_LIBRARIES
|
||||
|
||||
# Copyright (c) 2011, Dario Freddi <drf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if (NOT IS_KTP_INTERNAL_MODULE)
|
||||
message (FATAL_ERROR "KTp can be used just from internal components at this time")
|
||||
endif (NOT IS_KTP_INTERNAL_MODULE)
|
||||
|
||||
SET (KTP_FIND_REQUIRED ${KTp_FIND_REQUIRED})
|
||||
if (KTP_INCLUDE_DIRS AND KTP_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
set(KTP_FIND_QUIETLY TRUE)
|
||||
endif (KTP_INCLUDE_DIRS AND KTP_LIBRARIES)
|
||||
|
||||
find_path(KTP_INCLUDE_DIR
|
||||
NAMES KTp/presence.h
|
||||
PATHS ${KDE4_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
find_library(KTP_LIBRARIES NAMES ktpcommoninternalsprivate )
|
||||
find_library(KTP_MODELS_LIBRARIES NAMES ktpmodelsprivate )
|
||||
find_library(KTP_WIDGETS_LIBRARIES NAMES ktpwidgetsprivate )
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(KTp DEFAULT_MSG
|
||||
KTP_LIBRARIES
|
||||
KTP_MODELS_LIBRARIES
|
||||
KTP_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(KTP_INCLUDE_DIRS KTP_LIBRARIES)
|
||||
@@ -1,39 +0,0 @@
|
||||
# Try to find the Qt4 binding of the Telepathy library
|
||||
# TELEPATHY_QT4_FOUND - system has TelepathyQt4
|
||||
# TELEPATHY_QT4_INCLUDE_DIR - the TelepathyQt4 include directory
|
||||
# TELEPATHY_QT4_LIBRARIES - Link these to use TelepathyQt4
|
||||
|
||||
# Copyright (c) 2008, Allen Winter <winter@kde.org>
|
||||
# Copyright (c) 2009, Andre Moreira Magalhaes <andrunko@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
set(TELEPATHY_QT4_FIND_REQUIRED ${TelepathyQt4_FIND_REQUIRED})
|
||||
if(TELEPATHY_QT4_INCLUDE_DIR AND TELEPATHY_QT4_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
set(TELEPATHY_QT4_FIND_QUIETLY TRUE)
|
||||
endif(TELEPATHY_QT4_INCLUDE_DIR AND TELEPATHY_QT4_LIBRARIES)
|
||||
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_TELEPATHY_QT4 QUIET TelepathyQt4>=0.1.8)
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
|
||||
find_path(TELEPATHY_QT4_INCLUDE_DIR
|
||||
NAMES TelepathyQt4/Types
|
||||
HINTS
|
||||
${PC_TELEPATHY_QT4_INCLUDEDIR}
|
||||
${PC_TELEPATHY_QT4_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(TELEPATHY_QT4_LIBRARIES
|
||||
NAMES telepathy-qt4
|
||||
HINTS
|
||||
${PC_TELEPATHY_QT4_LIBDIR}
|
||||
${PC_TELEPATHY_QT4_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(TELEPATHY_QT4 DEFAULT_MSG
|
||||
TELEPATHY_QT4_LIBRARIES TELEPATHY_QT4_INCLUDE_DIR)
|
||||
@@ -1,2 +1,2 @@
|
||||
########### install files ###############
|
||||
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en)
|
||||
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR krfb)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
]>
|
||||
<!-- Based on kdoctemplate v0.9 January 10 2003 -->
|
||||
|
||||
<book lang="&language;">
|
||||
<book id="krfb" lang="&language;">
|
||||
|
||||
<!-- This header contains all of the meta-information for the document such
|
||||
as Authors, publish date, the abstract, and Keywords -->
|
||||
@@ -43,8 +43,8 @@ Please respect the format of the date (YYYY-MM-DD) and of the version
|
||||
(V.MM.LL), it could be used by automation scripts.
|
||||
Do NOT change these in the translation. -->
|
||||
|
||||
<date>2010-02-09</date>
|
||||
<releaseinfo>&kde; 4.4</releaseinfo>
|
||||
<date>2013-06-19</date>
|
||||
<releaseinfo>&kde; 4.11</releaseinfo>
|
||||
|
||||
<!-- Abstract about this handbook -->
|
||||
|
||||
|
||||
@@ -2,31 +2,40 @@
|
||||
Encoding=UTF-8
|
||||
Comment=Qt based Framebuffer for KRfb.
|
||||
Comment[ast]=Esquema Qt de buffer pa KRfb
|
||||
Comment[bg]=Основан на Qt фреймбуфер за KRfb.
|
||||
Comment[bs]=Kadrobafer za KRfb na osnovu Qt
|
||||
Comment[ca]=«Framebuffer» basat en Qt per al KRfb.
|
||||
Comment[ca@valencia]=«Framebuffer» basat en Qt per al KRfb.
|
||||
Comment[cs]=Framebuffer založený na Qt pro KRfb.
|
||||
Comment[da]=Qt-baseret framebuffer til KRfb.
|
||||
Comment[de]=Qt-basierter Framebuffer für KRfb
|
||||
Comment[el]=Μνήμη εξόδου βίντεο καρέ με βάση το Qt για το KRfb.
|
||||
Comment[en_GB]=Qt based Framebuffer for KRfb.
|
||||
Comment[es]=Memoria intermedia de vídeo basada en Qt para KRfb.
|
||||
Comment[et]=KRfb Qt põhine kaadripuhver
|
||||
Comment[eu]=Qt-n oinarritutako KRfb-ren irteerako bideoa
|
||||
Comment[fi]=QT-perustainen Kehyspuskuri KRfb:lle
|
||||
Comment[fr]=Sortie vidéo basée sur Qt pour KRfb.
|
||||
Comment[fr]=Sortie vidéo fondée sur Qt pour Krfb.
|
||||
Comment[ga]=Maolán fráma le haghaidh KRfb, bunaithe ar Qt.
|
||||
Comment[gl]=Framebuffer baseado en Qt para KRfb.
|
||||
Comment[hr]=Međuspremnik okvira baziran na Qt-u za KRfb.
|
||||
Comment[hu]=Qt-alapú framebuffer a Krfb-hez.
|
||||
Comment[ia]=Framebuffer basate sur Qt per KRfb
|
||||
Comment[it]=Framebuffer basato su Qt per KRfb.
|
||||
Comment[kk]=Qt негіздеген KRfb-нің кадр буфері.
|
||||
Comment[km]=Framebuffer មានមូលដ្ឋានលើ Qt សម្រាប់ KRfb ។
|
||||
Comment[ko]=KRfb를 위한 Qt 기반 프레임버퍼.
|
||||
Comment[lt]=Qt pagrindu veikiantis Framebuffer skirtas KRfb.
|
||||
Comment[lv]=Qt balstīts kadrbuferis priekš KRfb.
|
||||
Comment[nb]=Qt-basert rammebuffer for KRfb.
|
||||
Comment[nds]=Op Qt opbuut Bildpuffer för KRfb
|
||||
Comment[nl]=Op Qt gebaseerd framebuffer voor KRfb.
|
||||
Comment[nn]=Qt basert framebuffer for KRfb.
|
||||
Comment[pl]=Bufor ramki na podstawie Qt dla KRfb.
|
||||
Comment[pt]='Framebuffer' baseado no Qt para o KRfb.
|
||||
Comment[pt_BR]=Framebuffer baseado no Qt para o KRfb.
|
||||
Comment[ru]=Буфер экрана для KRfb на базе Qt.
|
||||
Comment[si]=KRfb සඳහා Qt මත පදනම් වූ රාමු බෆරය
|
||||
Comment[sk]=Framebuffer založený na Qt pre KRfb.
|
||||
Comment[sl]=Slikovni medpomnilnik za KRFB, ki temelji na Qt
|
||||
Comment[sr]=Кадробафер за КРФБ на основу КуТ‑у
|
||||
@@ -41,31 +50,40 @@ Comment[zh_CN]=基于 Qt 的 KRfb 帧缓冲机制
|
||||
Comment[zh_TW]=KRfb 的 Qt-based Framebuffer
|
||||
Name=Qt Framebuffer for KRfb
|
||||
Name[ast]=Esquema Qt de buffer pa KRfb
|
||||
Name[bg]=Qt фреймбуфер за KRfb
|
||||
Name[bs]=Qt-ov kadrobafer za KRFB
|
||||
Name[ca]=«Framebuffer» Qt per al KRfb.
|
||||
Name[ca@valencia]=«Framebuffer» Qt per al KRfb.
|
||||
Name[cs]=Qt Framebuffer pro KRfb
|
||||
Name[da]=Qt-framebuffer til KRfb
|
||||
Name[de]=Qt-Framebuffer für KRfb
|
||||
Name[el]=Qt Framebuffer for KRfb
|
||||
Name[en_GB]=Qt Framebuffer for KRfb
|
||||
Name[es]=Memoria intermedia de vídeo Qt para KRfb
|
||||
Name[et]=KRfb Qt kaadripuhver
|
||||
Name[eu]=KRfb-ren Qt-ko irteerako bideoa
|
||||
Name[fi]=QT-kehyspuskuri KRfb:lle
|
||||
Name[fr]=Sortie vidéo Qt pour KRfb
|
||||
Name[fr]=Sortie vidéo Qt pour Krfb
|
||||
Name[ga]=Maolán fráma Qt le haghaidh KRfb
|
||||
Name[gl]=Framebuffer de Qt para KRfb
|
||||
Name[hr]=Qt Framebuffer za KRfb
|
||||
Name[hu]=Qt framebuffer a Krfb-hez
|
||||
Name[ia]=Framebuffer Qt per KRfb
|
||||
Name[it]=Framebuffer Qt per KRfb
|
||||
Name[kk]=Qt KRfb кадр буфері
|
||||
Name[km]=Qt Framebuffer សម្រាប់for KRfb
|
||||
Name[ko]=KRfb를 위한 Qt 프레임버퍼
|
||||
Name[lt]=Qt Framebufferis skirtas KRfb
|
||||
Name[lv]=Qt kadrbuferis priekš KRfb.
|
||||
Name[nb]=Qt rammebuffer for KRfb
|
||||
Name[nds]=Qt-Bildpuffer för KRfb
|
||||
Name[nl]=Qt-framebuffer voor KRfb
|
||||
Name[nn]=Qt-framebuffer for KRfb
|
||||
Name[pl]=Bufor ramki Qt dla KRfb
|
||||
Name[pt]='Framebuffer' do Qt para o KRfb
|
||||
Name[pt_BR]=Framebuffer do Qt para o KRfb
|
||||
Name[ru]=Буфер экрана Qt для KRfb
|
||||
Name[si]=KRfb සඳහා වන Qt රාමුබෆරය
|
||||
Name[sk]=Qt Framebuffer pre KRfb
|
||||
Name[sl]=Slikovni medpomnilnik Qt za KRFB
|
||||
Name[sr]=КуТ‑ов кадробафер за КРФБ
|
||||
|
||||
@@ -2,31 +2,40 @@
|
||||
Encoding=UTF-8
|
||||
Comment=X11 XDamage/XShm based Framebuffer for KRfb.
|
||||
Comment[ast]=Esquema de buffer pa KRfb basáu en XDamage/XShm
|
||||
Comment[bg]=Основан на X11 XDamage/XShm фреймбуфер за KRfb.
|
||||
Comment[bs]=X11 XDamage/XShm baziran framebafer za KRfb.
|
||||
Comment[ca]=«Framebuffer» basat en XDamage/XShmQt de l'X11 per al KRfb.
|
||||
Comment[ca@valencia]=«Framebuffer» basat en XDamage/XShmQt de l'X11 per al KRfb.
|
||||
Comment[cs]=Framebuffer založený na X11 XDamage/XShm pro KRfb.
|
||||
Comment[da]=X11 XDamage/XShm-baseret framebuffer til KRfb.
|
||||
Comment[de]=X11 XDamage/XShm-basierter Framebuffer für KRfb.
|
||||
Comment[el]=Μνήμη εξόδου βίντεο καρέ με βάση το X11 XDamage/XShm για το KRfb.
|
||||
Comment[en_GB]=X11 XDamage/XShm based Framebuffer for KRfb.
|
||||
Comment[es]=Memoria intermedia de vídeo basada en X11 Damage/XShm para KRfb.
|
||||
Comment[et]=KRfb X11 XDamage/XShm põhine kaadripuhver
|
||||
Comment[eu]=X11 XDamage/XShm oinarritutako KRfb-ren irteerako bideoa.
|
||||
Comment[fi]=X11 XDamage/XShm-perustainen kehyspuskui KRfb:lle.
|
||||
Comment[fr]=Sortie vidéo basée sur X11 XDamage / XShm pour KRfb.
|
||||
Comment[fr]=Sortie vidéo fondée sur X11 « XDamage / XShm » pour Krfb.
|
||||
Comment[ga]=Maolán fráma le haghaidh KRfb, bunaithe ar X11 XDamage/XShm
|
||||
Comment[gl]=Framebuffer baseado en Xll XDamage/Xshm para XRfb.
|
||||
Comment[hr]=Međuspreminik okvira baziran na X11 XDamage/XShm za KRfb.
|
||||
Comment[hu]=X11 XDamage/XShm-alapú framebuffer a Krfb-hez.
|
||||
Comment[ia]=Framebuffer basate sur X11 XDamage/XShm per KRfb.
|
||||
Comment[it]=Framebuffer basato su XDamage/XShm di X11 per KRfb.
|
||||
Comment[kk]=X11 XDamage/XShm негіздеген KRfb кадр буфері.
|
||||
Comment[km]=X11 XDamage/XShm based Framebuffer សម្រាប់ KRfb ។
|
||||
Comment[ko]=KRfb를 위한 X11 XDamage/XShm 기반 프레임버퍼.
|
||||
Comment[lt]=X11 XDamage/XShm paremtas Framebuffer skirtas KRfb.
|
||||
Comment[lv]=X11 XDamage/XShm balstīts kadrbuferis priekš KRfb.
|
||||
Comment[nb]=Rammebuffer for KRfb basert på X11 XDamage/XShm.
|
||||
Comment[nds]=Op X11-XDamage/-XShm opbuut Bildpuffer för KRfb
|
||||
Comment[nl]=Op X11 XDamage/XShm gebaseerd framebuffer voor KRfb.
|
||||
Comment[nn]=X11 XDamage/XShm basert framebuffer for KRfb.
|
||||
Comment[pl]=Bufor ramki na podstawie X11 XDamage/XShm dla KRfb.
|
||||
Comment[pt]='Framebuffer' baseado no XDamage/XShm do X11 para o KRfb.
|
||||
Comment[pt_BR]=Framebuffer baseado no XDamage/XShm do X11 para o KRfb.
|
||||
Comment[ru]=Буфер экрана для KRfb на базе X11 XDamage/XShm
|
||||
Comment[si]=KRfb සඳහා වන රාමු බෆරය මත පදනම් වූ X11 XDamage/XShm.
|
||||
Comment[sk]=Framebuffer založený na X11 XDamage/XShm pre KRfb.
|
||||
Comment[sl]=Slikovni medpomnilnik za KRFB, ki temelji na X11 XDamage/XShm
|
||||
Comment[sr]=Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.
|
||||
@@ -41,32 +50,40 @@ Comment[zh_CN]=基于 X11 XDamage/XShm 扩展的 KRfb 帧缓冲机制。
|
||||
Comment[zh_TW]=KRfb 的 X11 XDamage/XShm based Framebuffer
|
||||
Name=X11 Framebuffer for KRfb
|
||||
Name[ast]=Buffer de X11 pa KRfb
|
||||
Name[bg]=X11 фреймбуфер за KRfb
|
||||
Name[bs]=X11 frame bafer za KRfb
|
||||
Name[ca]=«Framebuffer» de l'X11 per al KRfb.
|
||||
Name[ca@valencia]=«Framebuffer» de l'X11 per al KRfb.
|
||||
Name[cs]=X11 Framebuffer pro KRfb
|
||||
Name[da]=X11-framebuffer til KRfb
|
||||
Name[de]=X11-Framebuffer für KRfb
|
||||
Name[el]=X11 Framebuffer for KRfb
|
||||
Name[en_GB]=X11 Framebuffer for KRfb
|
||||
Name[es]=Memoria intermedia de vídeo X11 para KRfb
|
||||
Name[et]=KRfb X11 kaadripuhver
|
||||
Name[eu]=KRfb-ren X11-ko irteerako bideoa
|
||||
Name[fi]=X11-kehyspuskuri KRfb:lle
|
||||
Name[fr]=Sortie vidéo X11 pour KRfb
|
||||
Name[fr]=Sortie vidéo X11 pour Krfb
|
||||
Name[ga]=Maolán fráma X11 le haghaidh KRfb
|
||||
Name[gl]=Framebuffer de X11 para KRfb
|
||||
Name[hr]=Međuspremnik okvira X11 za KRfb
|
||||
Name[hu]=X11 framebuffer a Krfb-hez
|
||||
Name[ia]=Framebuffer X11 per KRfb
|
||||
Name[it]=Framebuffer X11 per KRfb
|
||||
Name[kk]=X11 KRfb кадр буфері
|
||||
Name[km]=X11 Framebuffer សម្រាប់ KRfb
|
||||
Name[ko]=KRfb를 위한 X11 프레임버퍼
|
||||
Name[lt]=X11 Framebuffer skirtas KRfb
|
||||
Name[lv]=X11 kadrbuferis priekš KRfb
|
||||
Name[nb]=X11 rammebuffer for KRfb
|
||||
Name[nds]=X11-Bildpuffer för KRfb
|
||||
Name[nl]=X11 framebuffer voor KRfb
|
||||
Name[nn]=X11-framebuffer for KRfb
|
||||
Name[pl]=Bufor ramki X11 dla KRfb
|
||||
Name[pt]='Framebuffer' do X11 para o KRfb
|
||||
Name[pt_BR]=Framebuffer do X11 para o KRfb
|
||||
Name[ru]=Буфер экрана X11 для KRfb
|
||||
Name[si]=KRfb සඳහා X11 රාමු බෆරය
|
||||
Name[sk]=X11 Framebuffer pre KRfb
|
||||
Name[sl]=Slikovni medpomnilnik X11 za KRFB
|
||||
Name[sr]=Икс11 кадробафер за КРФБ.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
include_directories(${CMAKE_BINARY_DIR}/krfb/krfb)
|
||||
|
||||
set(kcm_krfb_PART_SRCS kcm_krfb.cpp ${krfbconfig_SRCS})
|
||||
|
||||
kde4_add_ui3_files(kcm_krfb_PART_SRCS configurationwidget.ui)
|
||||
kde4_add_ui3_files(kcm_krfb_PART_SRCS
|
||||
${CMAKE_SOURCE_DIR}/krfb/krfb/manageinvitations.ui
|
||||
${CMAKE_SOURCE_DIR}/krfb/krfb/personalinvitewidget.ui
|
||||
${CMAKE_SOURCE_DIR}/krfb/krfb/invitewidget.ui)
|
||||
|
||||
kde4_add_plugin(kcm_krfb ${kcm_krfb_PART_SRCS})
|
||||
|
||||
target_link_libraries(kcm_krfb ${KDE4_KDECORE_LIBS} ${KDE4_KDE3SUPPORT_LIBS})
|
||||
|
||||
install(TARGETS kcm_krfb DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
|
||||
install( FILES kcmkrfb.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||
@@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
$EXTRACTRC *.ui >> rc.cpp
|
||||
$XGETTEXT *.cpp -o $podir/kcm_krfb.pot
|
||||
@@ -1,509 +0,0 @@
|
||||
<!DOCTYPE UI><UI version="3.1" 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="icon">
|
||||
<pixmap>image0</pixmap>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</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&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="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 invitations.</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 && &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 &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 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>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&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>Pass&word:</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>&Session</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>GroupBox4</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Session Preferences</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>disableBackgroundCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Always disable &background image</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Check this option to always disable the background image during a remote session. Otherwise the client decides whether the background will be enabled or disabled.</string>
|
||||
</property>
|
||||
</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 class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>tab</cstring>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>&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>Assi&gn 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>P&ort:</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="minimum">
|
||||
<number>1024</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<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>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KIntNumInput</class>
|
||||
<header location="global">knuminput.h</header>
|
||||
<container>0</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<includehints>
|
||||
<includehint>knuminput.h</includehint>
|
||||
<includehint>knuminput.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
||||
@@ -1,180 +0,0 @@
|
||||
|
||||
/***************************************************************************
|
||||
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 <qdatastream.h>
|
||||
#include <kdialog.h>
|
||||
#include <knuminput.h>
|
||||
#include <klocale.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kconfig.h>
|
||||
#include <kgenericfactory.h>
|
||||
#include <kdebug.h>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusReply>
|
||||
#define VERSION "0.7"
|
||||
|
||||
|
||||
typedef KGenericFactory<KcmKRfb, QWidget> KcmKRfbFactory;
|
||||
K_EXPORT_COMPONENT_FACTORY(krfb, KcmKRfbFactory("kcm_krfb"))
|
||||
|
||||
|
||||
|
||||
KcmKRfb::KcmKRfb(QWidget *p, const QStringList &) :
|
||||
KCModule(KcmKRfbFactory::componentData(), p),
|
||||
m_configuration(KRFB_CONFIGURATION_MODE)
|
||||
{
|
||||
|
||||
KGlobal::locale()->insertCatalog("krfb");
|
||||
m_confWidget = new ConfigurationWidget(this);
|
||||
|
||||
QVBoxLayout *l = new QVBoxLayout(this);
|
||||
l->setSpacing(KDialog::spacingHint());
|
||||
l->setMargin(0);
|
||||
l->add(m_confWidget);
|
||||
|
||||
setButtons(Default | Apply | Default);
|
||||
|
||||
KAboutData *about = new KAboutData("kcm_krfb", 0, ki18n("Desktop Sharing Control Module"),
|
||||
VERSION,
|
||||
ki18n("Configure desktop sharing"), KAboutData::License_GPL,
|
||||
ki18n("(c) 2002, Tim Jansen\n"),
|
||||
KLocalizedString(), "http://www.tjansen.de/krfb", "tim@tjansen.de");
|
||||
about->addAuthor(ki18n("Tim Jansen"), KLocalizedString(), "tim@tjansen.de");
|
||||
setAboutData(about);
|
||||
|
||||
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());
|
||||
connect(m_confWidget->disableBackgroundCB, SIGNAL(clicked()), SLOT(configChanged()));
|
||||
}
|
||||
|
||||
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", num));
|
||||
}
|
||||
}
|
||||
|
||||
void KcmKRfb::checkKInetd(bool &kinetdAvailable, bool &krfbAvailable)
|
||||
{
|
||||
kinetdAvailable = false;
|
||||
krfbAvailable = false;
|
||||
//TODO verify it when kinetd will port
|
||||
QDBusInterface kinetd("org.kde.kded", "/modules/kinetd", "org.kde.kinetd");
|
||||
QDBusReply<bool> reply = kinetd.call("isInstalled", "krfb");
|
||||
|
||||
if (!reply.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
krfbAvailable = reply;
|
||||
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);
|
||||
m_confWidget->disableBackgroundCB->setChecked(m_configuration.disableBackground());
|
||||
emit changed(false);
|
||||
}
|
||||
|
||||
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.setDisableBackground(m_confWidget->disableBackgroundCB->isChecked());
|
||||
m_configuration.save();
|
||||
#if 0
|
||||
kapp->dcopClient()->emitDCOPSignal("KRFB::ConfigChanged", "KRFB_ConfigChanged()", QByteArray());
|
||||
#endif
|
||||
emit changed(false);
|
||||
}
|
||||
|
||||
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);
|
||||
m_confWidget->disableBackgroundCB->setChecked(false);
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
QString KcmKRfb::quickHelp() const
|
||||
{
|
||||
return i18n("<h1>Desktop Sharing</h1> This module allows you to configure"
|
||||
" the KDE desktop sharing.");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
|
||||
/***************************************************************************
|
||||
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>
|
||||
#define KDE3_SUPPORT
|
||||
#include <kcmodule.h>
|
||||
#undef KDE3_SUPPORT
|
||||
#include "configurationwidget.h"
|
||||
#include "../krfb/configuration.h"
|
||||
|
||||
class KcmKRfb : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
Configuration m_configuration;
|
||||
ConfigurationWidget *m_confWidget;
|
||||
void checkKInetd(bool &, bool &);
|
||||
public:
|
||||
KcmKRfb(QWidget *p, const QStringList &);
|
||||
|
||||
void load();
|
||||
void save();
|
||||
void defaults();
|
||||
QString quickHelp() const;
|
||||
private slots:
|
||||
void setInvitationNum(int num);
|
||||
void configChanged();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,202 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Icon=krfb
|
||||
Exec=kcmshell4 kcmkrfb
|
||||
Type=Service
|
||||
X-DocPath=krfb/krfb-configuration.html
|
||||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
|
||||
X-KDE-Library=kcm_krfb
|
||||
X-KDE-Factoryname=krfb
|
||||
X-KDE-ParentApp=kcontrol
|
||||
|
||||
Name=Desktop Sharing
|
||||
Name[af]=Werkskerm Deeling
|
||||
Name[ar]=مشاركة سطح المكتب
|
||||
Name[ast]=Escritoriu compartiu
|
||||
Name[bg]=Споделяне на работното място
|
||||
Name[bn]=ডেস্কটপ ভাগাভাগি
|
||||
Name[br]=Rannañ ar vurev
|
||||
Name[bs]=Dijeljenje radne površine
|
||||
Name[ca]=Compartició de l'escriptori
|
||||
Name[ca@valencia]=Compartició de l'escriptori
|
||||
Name[cs]=Sdílení pracovní plochy
|
||||
Name[cy]=Rhannu Penbwrdd
|
||||
Name[da]=Desktopdeling
|
||||
Name[de]=Arbeitsflächen-Freigabe
|
||||
Name[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
Name[en_GB]=Desktop Sharing
|
||||
Name[eo]=Tabula komunigado
|
||||
Name[es]=Escritorio compartido
|
||||
Name[et]=Töölaua jagamine
|
||||
Name[eu]=Mahaigaina partekatzea
|
||||
Name[fa]=اشتراک رومیزی
|
||||
Name[fi]=Työpöydän jakaminen
|
||||
Name[fr]=Partage de bureau
|
||||
Name[ga]=Roinnt Deisce
|
||||
Name[gl]=Compartimento do escritorio
|
||||
Name[he]=שיתוף שולחנות עבודה
|
||||
Name[hi]=डेस्कटॉप साझेदारी
|
||||
Name[hne]=डेस्कटाप साझेदारी
|
||||
Name[hr]=Dijeljenje radne površine
|
||||
Name[hu]=Munkaasztal-megosztás
|
||||
Name[ia]=Compartir de scriptorio
|
||||
Name[is]=Skjáborðamiðlun
|
||||
Name[it]=Condivisione del desktop
|
||||
Name[ja]=デスクトップ共有
|
||||
Name[kk]=Үстелді ортақтастыру
|
||||
Name[km]=ការចែករំលែកផ្ទៃតុ
|
||||
Name[ko]=데스크톱 공유
|
||||
Name[lt]=Dalinimasis darbastaliu
|
||||
Name[lv]=Darbvirsmas koplietošana
|
||||
Name[mk]=Делење на работната површина
|
||||
Name[ml]=പണിയിടം പങ്കുവെക്കല്
|
||||
Name[ms]=Perkongsian Ruang Kerja
|
||||
Name[nb]=Delte skrivebord
|
||||
Name[nds]=Schriefdisch-Freegaav
|
||||
Name[ne]=डेस्कटप साझेदारी
|
||||
Name[nl]=Bureaublad delen
|
||||
Name[nn]=Skrivebordsdeling
|
||||
Name[pa]=ਡੈਸਕਟਾਪ ਸ਼ੇਅਰਿੰਗ
|
||||
Name[pl]=Współdzielenie pulpitu
|
||||
Name[pt]=Partilha do Ecrã
|
||||
Name[pt_BR]=Compartilhamento do área de trabalho
|
||||
Name[ro]=Partajare birou
|
||||
Name[ru]=Общий рабочий стол
|
||||
Name[se]=Čállinbeavdejuohkkin
|
||||
Name[sk]=Zdieľanie pracovnej plochy
|
||||
Name[sl]=Deljenje namizja
|
||||
Name[sr]=Дељење површи
|
||||
Name[sr@ijekavian]=Дијељење површи
|
||||
Name[sr@ijekavianlatin]=Dijeljenje površi
|
||||
Name[sr@latin]=Deljenje površi
|
||||
Name[sv]=Dela ut skrivbordet
|
||||
Name[ta]=பணிமேடை பகிர்வு
|
||||
Name[tg]=Истифодабарии муштараки Мизи корӣ
|
||||
Name[th]=ใช้งานพื้นที่ทำงานร่วมกัน
|
||||
Name[tr]=Masaüstü Paylaşımı
|
||||
Name[uk]=Спільні стільниці
|
||||
Name[vi]=Chia sẻ màn hình nền
|
||||
Name[xh]=Ukwehlulelana kwe Desktop
|
||||
Name[x-test]=xxDesktop Sharingxx
|
||||
Name[zh_CN]=桌面共享
|
||||
Name[zh_HK]=桌面分享
|
||||
Name[zh_TW]=桌面分享
|
||||
|
||||
Comment=Configure Desktop Sharing
|
||||
Comment[af]=Konfigureer Werkskerm Deeling
|
||||
Comment[ar]=تعديل مشاركة سطح المكتب
|
||||
Comment[ast]=Configura'l to escritoriu compartíu
|
||||
Comment[bg]=Настройване споделянето на работното място
|
||||
Comment[bn]=ডেস্কটপ ভাগাভাগি কনফিগার করুন
|
||||
Comment[br]=Kefluniañ rannañ ar vurev
|
||||
Comment[bs]=Podešavanje dijeljenja površine
|
||||
Comment[ca]=Lupa de l'escriptori
|
||||
Comment[ca@valencia]=Lupa de l'escriptori
|
||||
Comment[cs]=Nastavit sdílení pracovní plochy
|
||||
Comment[cy]=Ffurfweddu Rhannu Penbwrdd
|
||||
Comment[da]=Indstil desktopdeling
|
||||
Comment[de]=Freigabe der Arbeitsfläche einrichten
|
||||
Comment[el]=Ρύθμιση της κοινής χρήσης της επιφάνειας εργασίας
|
||||
Comment[en_GB]=Configure Desktop Sharing
|
||||
Comment[eo]=Agordi la tabulan komunigadon
|
||||
Comment[es]=Configure su escritorio compartido
|
||||
Comment[et]=Töölaua jagamise seadistamine
|
||||
Comment[eu]=Konfiguratu mahaigaina partekatzea
|
||||
Comment[fa]=پیکربندی اشتراک رومیزی
|
||||
Comment[fi]=Aseta työpöydän jakaminen
|
||||
Comment[fr]=Configuration du partage du bureau
|
||||
Comment[ga]=Cumraigh Roinnt Deisce
|
||||
Comment[gl]=Configurar o compartimento do escritorio
|
||||
Comment[he]=שינוי הגדרות שיתוף שולחנות העבודה
|
||||
Comment[hi]=डेस्कटॉप साझेदारी कॉन्फ़िगर करें
|
||||
Comment[hne]=डेस्कटाप साझेदारी कान्फिगर करव
|
||||
Comment[hr]=Podešavanje dijeljenja radne površine
|
||||
Comment[hu]=A munkaasztal-megosztás beállításai
|
||||
Comment[ia]=Configura le compartir de scriptorio
|
||||
Comment[is]=Stilla skjáborðsmiðlun
|
||||
Comment[it]=Configura condivisione del desktop
|
||||
Comment[ja]=デスクトップ共有の設定
|
||||
Comment[kk]=Үстелді ортақтастыруды баптау
|
||||
Comment[km]=កំណត់រចនាសម្ព័ន្ធការចែករំលែកផ្ទៃតុ
|
||||
Comment[ko]=데스크톱 공유 설정
|
||||
Comment[lt]=Konfigūruoti dalinimąsi darbastaliu
|
||||
Comment[lv]=Konfigurē darbvirsmas koplietošanu
|
||||
Comment[mk]=Конфигурирајте делење на површината
|
||||
Comment[ml]=പണിയിടം പങ്കുവെക്കല് ക്രമീകരിക്കാം
|
||||
Comment[ms]= Selaraskan Perkongsian Desktop
|
||||
Comment[nb]=Tilpass delte skrivebord
|
||||
Comment[nds]=Schriefdisch-Freegaav instellen
|
||||
Comment[ne]=डेस्कटप साझेदारी कन्फिगर गर्नुहोस्
|
||||
Comment[nl]=Bureaublad delen instellen
|
||||
Comment[nn]=Set opp skrivebordsdeling
|
||||
Comment[pa]=ਡੈਸਕਟਾਪ ਸ਼ੇਅਰਿੰਗ ਸੰਰਚਨਾ
|
||||
Comment[pl]=Konfiguracja współdzielenia pulpitu
|
||||
Comment[pt]=Configurar a Partilha do Ecrã
|
||||
Comment[pt_BR]=Configura o compartilhamento da área de trabalho
|
||||
Comment[ro]=Configurează partajarea biroului
|
||||
Comment[ru]=Параметры общего рабочего стола
|
||||
Comment[se]=Heivet čállinbeavdejuohkkima
|
||||
Comment[sk]=Nastavenie zdieľania pracovnej plochy
|
||||
Comment[sl]=Nastavi deljenje namizja
|
||||
Comment[sr]=Подешавање дељења површи
|
||||
Comment[sr@ijekavian]=Подешавање дијељења површи
|
||||
Comment[sr@ijekavianlatin]=Podešavanje dijeljenja površi
|
||||
Comment[sr@latin]=Podešavanje deljenja površi
|
||||
Comment[sv]=Anpassa utdelning av skrivbord
|
||||
Comment[ta]=பணிமேடை பகிர்வை உள்ளமை
|
||||
Comment[tg]=Батанзимдарории Истифодабарии муштараки Мизи корӣ
|
||||
Comment[th]=ปรับแต่งการแบ่งการใช้งานพื้นที่ทำงานร่วมกัน
|
||||
Comment[tr]=Masaüstü Paylaşımını Yapılandır
|
||||
Comment[uk]=Налаштувати спільні стільниці
|
||||
Comment[vi]=Cấu hình chia sẻ màn hình nền
|
||||
Comment[xh]=Qwalasela Ukusebenzisa ngokuhlangeneyo kwe Desktop
|
||||
Comment[x-test]=xxConfigure Desktop Sharingxx
|
||||
Comment[zh_CN]=配置桌面共享
|
||||
Comment[zh_HK]=設定桌面分享
|
||||
Comment[zh_TW]=設定桌面分享
|
||||
X-KDE-Keywords=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited
|
||||
X-KDE-Keywords[bg]=Keywords=споделяне, работно, място, десктоп, покана, връзка, desktop sharing, krfb, vnc, sharing, krdc, remote desktop connection, invitation, port, slp, uninvited
|
||||
X-KDE-Keywords[ca]=compartició de l'escriptori,krfb,vnc,compartir,krdc,connexió a l'escriptori remot,invitació,port,slp,no invitat
|
||||
X-KDE-Keywords[cs]=sdílení plochy,krfb,vnc,sdílení,rdp,krdc,připojení vzdálené plochy,pozvánka,port,slp
|
||||
X-KDE-Keywords[cy]=rhannu penbwrdd,krfb,vnc,rhannu,rdp,krdc,cysylltiad penbwrdd pell,gwahoddiad,porth,slp,heb wahoddiad
|
||||
X-KDE-Keywords[da]=desktopdeling,krfb,vnc,deling,krdc,ekstern desktopforbindelse,invitation,port,slp,ikke inviteret
|
||||
X-KDE-Keywords[de]=Arbeitsfläche freigeben,krfb,VNC,freigeben,krdc,Entfernte Arbeitsfläche,Einladung,Port,slp,uneingeladen,rdp,remote desktop
|
||||
X-KDE-Keywords[el]=κοινή χρήση επιφάνειας εργασίας,krfb,vnc,κοινή χρήση,krdc,σύνδεση σε απομακρυσμένη επιφάνεια εργασίας,πρόσκληση,θύρα,slp,απρόσκλητο
|
||||
X-KDE-Keywords[es]=escritorio compartido,krfb,vnc,compartir,rdp,krdc, conexión escritorio remoto,invitación,puerto,slp,no invitado
|
||||
X-KDE-Keywords[et]=töölaua jagamine,krfb,vnc,jagamine,rdp,krdc,kaugtöölaua ühendus,rdp,kutse,port,slp,kutsumata
|
||||
X-KDE-Keywords[eu]=mahaigain partekatzea,krfb,vnc,partekatzea,krdc,urruneko mahaigain konexioa,gonbidapena,ataka,slp,gonbidapen gabea
|
||||
X-KDE-Keywords[fa]=اشتراک رومیزی، krfb، vnc، اتصال رومیزی راه دور، دعوت، درگاه، slp، دعوتنشده
|
||||
X-KDE-Keywords[fi]=työpöydän jakaminen,krfb,vnc,jakaminen,krdc,etätyöpöytäyhteys, kutsu,portti,slp,kutsumaton, työpöytä
|
||||
X-KDE-Keywords[fr]=partage de bureau,krfb,vnc,partage,rdp,krdc,connexion à un bureau distant,invitation,port,slp,non invité
|
||||
X-KDE-Keywords[gl]=compartilla de escritorio, vnc, compartir, krdc, conexón ao escritorio remoto, invitación, porto, slt, convidado, compartillar
|
||||
X-KDE-Keywords[he]=שיתוף שולחן עבודה,שיתוף,חיבור לשולחן עבודה מרוחק,desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection, invitation, port, slp, uninvited
|
||||
X-KDE-Keywords[hu]=munkaasztal-megosztás,krfb,vnc,megosztás,krdc,csatlakozás távoli munkaasztalhoz,meghívás,port,slp,meghívás nélkül
|
||||
X-KDE-Keywords[is]=skjáborðsmiðlun,miðlun,krfb,vnc,rdp,krdc,fjarvinnsla,remote desktop connection,rdp
|
||||
X-KDE-Keywords[it]=condivisione desktop,krfb,vnc,condivisione,krdc,connessione desktop remoto,invito,porta,slp,non invitato
|
||||
X-KDE-Keywords[ja]=デスクトップ共有,krfb,vnc,共有,rdp,krdc,リモートデスクトップ接続,招待,ポート,slp,uninvited
|
||||
X-KDE-Keywords[km]=ការចែករំលែកផ្ទៃតុ,krfb,vnc,ការចែករំលែក,krdc,ការតភ្ជាប់ផ្ទៃតុពីចម្ងាយ,អញ្ជើញ,ច្រក,slp,មិនបានអញ្ជើញ
|
||||
X-KDE-Keywords[lt]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,dalinimasis darbastaliu,nutolusio darbastalio prijungimas,kvietimas,ryšys,nekviestas,jungtis,prievadas,dalintis,pasidalinti,jungimasis,prisijungti,kviesti
|
||||
X-KDE-Keywords[mk]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,делење на површината,krfb,vnc,делење,krdc,поврзување со оддалечена површина,покана,порта,slp,непоканет
|
||||
X-KDE-Keywords[ms]= perkongsian ruang kerja, sambungan, liang, desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited
|
||||
X-KDE-Keywords[nb]=skrivebordsdeling,krfb,vnc,deling,krdc,tilkobling til fjernt skrivebord,invitasjon,port,slp,ikke invitert
|
||||
X-KDE-Keywords[nds]=schriefdisch,freegeven,freegaav,krfb,vnc,delen,krdc,feern Schriefdisch,verbinnen,inladen,port,slp,nich inlaadt
|
||||
X-KDE-Keywords[ne]=डेस्कटप साझेदारी,krfb,vnc,साझेदारी,krdc, टाढाको डेस्कटप जडान,निमन्त्रणा,पोर्ट,slp,निमन्त्रणा नगरिएको
|
||||
X-KDE-Keywords[nl]=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,uitnodiging,slp,rdp,verbinding, bureaublad delen,bureaublad op afstand
|
||||
X-KDE-Keywords[nn]=skrivebordsdeling,krfb,vnc,deling,krdc,nettverksskrivebord,invitasjon,port,slp,ikkje invitert
|
||||
X-KDE-Keywords[pl]=współdzielenie pulpitu,krfb,vnc,współdzielenie,rdp,krdc,zdalne połączenie, zdalne biurko, zdalny pulpit, zaproszenie,port,slp
|
||||
X-KDE-Keywords[pt]=partilha do ecrã,krfb,vnc,partilha,krdc,ligação a um ecrã remoto,convite,porto,slp,sem convite
|
||||
X-KDE-Keywords[pt_BR]=compartilhamento de desktop,krfb,vnc,compartilhamento,krdc,conexão a desktop remoto,convite,porta,slp,não convidado
|
||||
X-KDE-Keywords[sl]=namizje,souporaba,krfb,vnc,krdc,povezava oddaljenega namizja, povabilo,port,slp,nepovabljen
|
||||
X-KDE-Keywords[sr]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,радна површина,дељење,позив,порт,непозван,удаљено
|
||||
X-KDE-Keywords[sr@latin]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,radna površina,deljenje,poziv,port,nepozvan,udaljeno
|
||||
X-KDE-Keywords[sv]=dela skrivbord,krfb,vnc,dela,krdc,fjärrskrivbordsanslutning,inbjudan,port,slp
|
||||
X-KDE-Keywords[ta]=பணிமேடை பகிர்வு,krfb,vnc,பகிர்வு,krdc,தொலை பணிமேடை இணைப்பு,அழைப்பிதழ், துறை, slp, uninvited
|
||||
X-KDE-Keywords[tr]=masaüstü paylaşımı,krfb,vnc,paylaşım,krdc,uzak masaüstü bağlantısı,davet,port,slp
|
||||
X-KDE-Keywords[uk]=спільні стільниці,krfb,vnc,спільний,rdp,krdc,з'єднання віддаленої стільниці,запрошення,rdp,slp,без запрошення
|
||||
X-KDE-Keywords[vi]=chia sẻ màn hình,krfb,vnc,chia sẻ,krdc,màn hình ở xa kết nối,mời kết nối,cổng,slp,không được mời
|
||||
X-KDE-Keywords[x-test]=xxdesktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvitedxx
|
||||
X-KDE-Keywords[zh_CN]=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited,桌面共享,共享,远程桌面连接,邀请,端口,未邀请
|
||||
X-KDE-Keywords[zh_TW]=desktop sharing,krfb,vnc,sharing,rdp,krdc,remote desktop connection,rdp,桌面分享,分享,遠端桌面連線,invitation,port,slp,uninvited
|
||||
|
||||
Categories=Qt;KDE;X-KDE-settings-network;Settings;
|
||||
@@ -1,20 +0,0 @@
|
||||
########### next target ###############
|
||||
|
||||
set(kded_kinetd_PART_SRCS kinetd.cpp)
|
||||
|
||||
message(STATUS "Port to krfb DBUS")
|
||||
# kde4_add_dcop_skels(kded_kinetd_PART_SRCS kinetd.h )
|
||||
|
||||
kde4_add_plugin(kded_kinetd ${kded_kinetd_PART_SRCS})
|
||||
|
||||
|
||||
target_link_libraries(kded_kinetd ${KDE4_KIO_LIBS} ${KDE4_KDNSSD_LIBS})
|
||||
|
||||
install(TARGETS kded_kinetd DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(FILES kinetd.notifyrc DESTINATION ${DATA_INSTALL_DIR}/krfb)
|
||||
install(FILES kinetdmodule.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
|
||||
install(FILES kinetd.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
|
||||
@@ -1,2 +0,0 @@
|
||||
#! /bin/sh
|
||||
$XGETTEXT *.cpp -o $podir/kinetd.pot
|
||||
@@ -1,13 +0,0 @@
|
||||
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).
|
||||
|
||||
@@ -1,781 +0,0 @@
|
||||
|
||||
/***************************************************************************
|
||||
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 "kinetinterface.h"
|
||||
#include "kuser.h"
|
||||
#include "uuid.h"
|
||||
#include <qregexp.h>
|
||||
#include <kservicetype.h>
|
||||
#include <kdebug.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kconfig.h>
|
||||
#include <KNotification>
|
||||
#include <ksocketaddress.h>
|
||||
#include <ksocketdevice.h>
|
||||
#include <klocale.h>
|
||||
#include <kglobal.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <kpluginfactory.h>
|
||||
#include <kpluginloader.h>
|
||||
|
||||
K_PLUGIN_FACTORY(KInetDFactory,
|
||||
registerPlugin<KInetD>();
|
||||
)
|
||||
K_EXPORT_PLUGIN(KInetDFactory("kinetd"))
|
||||
|
||||
PortListener::PortListener(KService::Ptr s,
|
||||
KConfig *config,
|
||||
KServiceRegistry *srvreg) :
|
||||
m_port(-1),
|
||||
m_serviceRegistered(false),
|
||||
m_socket(0),
|
||||
m_config(config),
|
||||
m_srvreg(srvreg),
|
||||
m_dnssdreg(0)
|
||||
{
|
||||
m_uuid = createUUID();
|
||||
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 KNetwork::KServerSocket(m_port, false);
|
||||
|
||||
while (!m_socket->bindAndListen()) {
|
||||
m_port++;
|
||||
|
||||
if (m_port >= (m_portBase + m_autoPortRange)) {
|
||||
kDebug() << "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 KNetwork::KServerSocket(m_port, false);
|
||||
}
|
||||
|
||||
connect(m_socket, SIGNAL(accepted(KSocket *)),
|
||||
SLOT(accepted(KSocket *)));
|
||||
|
||||
bool s = m_registerService;
|
||||
bool sd = m_dnssdRegister;
|
||||
setServiceRegistrationEnabledInternal(false);
|
||||
dnssdRegister(false);
|
||||
setServiceRegistrationEnabledInternal(s);
|
||||
dnssdRegister(sd);
|
||||
return true;
|
||||
}
|
||||
|
||||
void PortListener::freePort()
|
||||
{
|
||||
m_port = -1;
|
||||
delete m_socket;
|
||||
m_socket = 0;
|
||||
setServiceRegistrationEnabledInternal(m_registerService);
|
||||
dnssdRegister(false);
|
||||
}
|
||||
|
||||
void PortListener::loadConfig(KService::Ptr s)
|
||||
{
|
||||
m_valid = true;
|
||||
m_autoPortRange = 0;
|
||||
m_enabled = true;
|
||||
m_argument.clear();
|
||||
m_multiInstance = false;
|
||||
|
||||
QVariant vid, vport, vautoport, venabled, vargument, vmultiInstance, vurl,
|
||||
vsattributes, vslifetime, vdname, vdtype, vddata;
|
||||
|
||||
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");
|
||||
vslifetime = s->property("X-KDE-KINETD-serviceLifetime");
|
||||
vdname = s->property("X-KDE-KINETD-DNSSD-Name");
|
||||
vdtype = s->property("X-KDE-KINETD-DNSSD-Type");
|
||||
vddata = s->property("X-KDE-KINETD-DNSSD-Properties");
|
||||
|
||||
if (!vid.isValid()) {
|
||||
kDebug() << "Kinetd cannot load service " << m_serviceName
|
||||
<< ": no id set" << endl;
|
||||
m_valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!vport.isValid()) {
|
||||
kDebug() << "Kinetd cannot load service " << m_serviceName
|
||||
<< ": invalid port" << endl;
|
||||
m_valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_serviceName = vid.toString();
|
||||
m_serviceLifetime = vslifetime.toInt();
|
||||
|
||||
if (m_serviceLifetime < 120) { // never less than 120 s
|
||||
m_serviceLifetime = 120;
|
||||
}
|
||||
|
||||
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.clear();
|
||||
m_registerService = false;
|
||||
}
|
||||
|
||||
if (vsattributes.isValid()) {
|
||||
m_serviceAttributes = vsattributes.toString();
|
||||
} else {
|
||||
m_serviceAttributes = "";
|
||||
}
|
||||
|
||||
if (vddata.isValid()) {
|
||||
QStringList attrs = vddata.toStringList();
|
||||
|
||||
for (QStringList::iterator it = attrs.begin();
|
||||
it != attrs.end(); it++) {
|
||||
QString key = (*it).section('=', 0, 0);
|
||||
QString value = processServiceTemplate((*it).section('=', 1))[0];
|
||||
|
||||
if (!key.isEmpty()) {
|
||||
m_dnssdData[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vdname.isValid() && vdtype.isValid()) {
|
||||
m_dnssdName = processServiceTemplate(vdname.toString())[0];
|
||||
m_dnssdType = vdtype.toString();
|
||||
m_dnssdRegister = true;
|
||||
kDebug() << "DNS-SD register is enabled\n";
|
||||
} else {
|
||||
m_dnssdRegister = false;
|
||||
}
|
||||
|
||||
|
||||
m_slpLifetimeEnd = QDateTime::currentDateTime().addSecs(m_serviceLifetime);
|
||||
m_defaultPortBase = m_portBase;
|
||||
m_defaultAutoPortRange = m_autoPortRange;
|
||||
|
||||
m_config->setGroup("ListenerConfig");
|
||||
m_enabled = m_config->readEntry("enabled_" + m_serviceName,
|
||||
m_enabled);
|
||||
m_portBase = m_config->readEntry("port_base_" + m_serviceName,
|
||||
m_portBase);
|
||||
m_autoPortRange = m_config->readEntry("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->readEntry("enabled_srvreg_" + m_serviceName,
|
||||
m_registerService);
|
||||
}
|
||||
|
||||
void PortListener::accepted(KSocket *sock)
|
||||
{
|
||||
QString host, port;
|
||||
KSocketDevice device(sock->socket());
|
||||
KSocketAddress ksa = device->peerAddress();
|
||||
|
||||
if (ksa.address()) {
|
||||
delete sock;
|
||||
return;
|
||||
}
|
||||
|
||||
KExtendedSocket::resolve(ksa, host, port);
|
||||
KNotification::event("IncomingConnection",
|
||||
i18n("Connection from %1", host));
|
||||
delete ksa;
|
||||
|
||||
if ((!m_enabled) ||
|
||||
((!m_multiInstance) && m_process.isRunning())) {
|
||||
delete sock;
|
||||
return;
|
||||
}
|
||||
|
||||
// disable CLOEXEC flag, fixes #77412
|
||||
fcntl(sock->socket(), F_SETFD, fcntl(sock->socket(), F_GETFD) & ~FD_CLOEXEC);
|
||||
|
||||
m_process.clearArguments();
|
||||
m_process << m_execPath << m_argument << QString::number(sock->socket());
|
||||
|
||||
if (!m_process.start(K3Process::DontCare)) {
|
||||
KNotification::event("ProcessFailed",
|
||||
i18n("Call \"%1 %2 %3\" failed", m_execPath,
|
||||
m_argument,
|
||||
sock->socket()));
|
||||
}
|
||||
|
||||
delete sock;
|
||||
}
|
||||
|
||||
bool PortListener::isValid()
|
||||
{
|
||||
return m_valid;
|
||||
}
|
||||
|
||||
bool PortListener::isEnabled()
|
||||
{
|
||||
return m_enabled && m_valid;
|
||||
}
|
||||
|
||||
int PortListener::port()
|
||||
{
|
||||
return m_port;
|
||||
}
|
||||
|
||||
QStringList PortListener::processServiceTemplate(const QString &a)
|
||||
{
|
||||
QStringList l;
|
||||
QValueVector<KInetInterface> v = KInetInterface::getAllInterfaces(false);
|
||||
QValueVector<KInetInterface>::Iterator it = v.begin();
|
||||
|
||||
while (it != v.end()) {
|
||||
KInetSocketAddress *address = (*(it++)).address();
|
||||
|
||||
if (!address) {
|
||||
continue;
|
||||
}
|
||||
|
||||
QString hostName = address->nodeName();
|
||||
KUser u;
|
||||
QString x = a; // replace does not work in const QString. Why??
|
||||
l.append(x.replace(QString("%h"), KServiceRegistry::encodeAttributeValue(hostName))
|
||||
.replace(QString("%p"), QString::number(m_port))
|
||||
.replace(QString("%u"), KServiceRegistry::encodeAttributeValue(u.loginName()))
|
||||
.replace(QString("%i"), KServiceRegistry::encodeAttributeValue(m_uuid))
|
||||
.replace(QString("%f"), KServiceRegistry::encodeAttributeValue(u.fullName())));
|
||||
}
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
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);
|
||||
dnssdRegister(e && m_enabled);
|
||||
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_registeredServiceURLs = processServiceTemplate(m_serviceURL);
|
||||
QStringList attributes = processServiceTemplate(m_serviceAttributes);
|
||||
QStringList::Iterator it = m_registeredServiceURLs.begin();
|
||||
QStringList::Iterator it2 = attributes.begin();
|
||||
|
||||
while ((it != m_registeredServiceURLs.end()) &&
|
||||
(it2 != attributes.end())) {
|
||||
if (!m_srvreg->registerService(
|
||||
*(it++),
|
||||
*(it2++),
|
||||
m_serviceLifetime)) {
|
||||
kDebug(7021) << "Failure registering SLP service (no slpd running?)";
|
||||
}
|
||||
}
|
||||
|
||||
m_serviceRegistered = true;
|
||||
// make lifetime 30s shorter, because the timeout is not precise
|
||||
m_slpLifetimeEnd = QDateTime::currentDateTime().addSecs(m_serviceLifetime - 30);
|
||||
} else {
|
||||
QStringList::Iterator it = m_registeredServiceURLs.begin();
|
||||
|
||||
while (it != m_registeredServiceURLs.end()) {
|
||||
m_srvreg->unregisterService(*(it++));
|
||||
}
|
||||
|
||||
m_serviceRegistered = false;
|
||||
}
|
||||
}
|
||||
|
||||
void PortListener::dnssdRegister(bool e)
|
||||
{
|
||||
if (m_dnssdName.isNull() || m_dnssdType.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_dnssdRegistered == e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e) {
|
||||
m_dnssdRegistered = true;
|
||||
m_dnssdreg = new DNSSD::PublicService(m_dnssdName, m_dnssdType, m_port);
|
||||
m_dnssdreg->setTextData(m_dnssdData);
|
||||
m_dnssdreg->publishAsync();
|
||||
} else {
|
||||
m_dnssdRegistered = false;
|
||||
delete m_dnssdreg;
|
||||
m_dnssdreg = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void PortListener::refreshRegistration()
|
||||
{
|
||||
if (m_serviceRegistered && (m_slpLifetimeEnd.addSecs(-90) < QDateTime::currentDateTime())) {
|
||||
setServiceRegistrationEnabledInternal(false);
|
||||
setServiceRegistrationEnabledInternal(true);
|
||||
}
|
||||
}
|
||||
|
||||
QDateTime PortListener::expiration()
|
||||
{
|
||||
return m_expirationTime;
|
||||
}
|
||||
|
||||
QDateTime PortListener::serviceLifetimeEnd()
|
||||
{
|
||||
if (m_serviceRegistered) {
|
||||
return m_slpLifetimeEnd;
|
||||
} else {
|
||||
return QDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
QString PortListener::name()
|
||||
{
|
||||
return m_serviceName;
|
||||
}
|
||||
|
||||
PortListener::~PortListener()
|
||||
{
|
||||
setServiceRegistrationEnabledInternal(false);
|
||||
delete m_socket;
|
||||
}
|
||||
|
||||
|
||||
KInetD::KInetD(QObject *parent, const QList<QVariant>&) :
|
||||
KDEDModule(parent)
|
||||
{
|
||||
m_config = new KConfig("kinetdrc");
|
||||
m_srvreg = new KServiceRegistry();
|
||||
|
||||
if (!m_srvreg->available()) {
|
||||
kDebug(7021) << "SLP not available";
|
||||
delete m_srvreg;
|
||||
m_srvreg = 0;
|
||||
}
|
||||
|
||||
m_portListeners.setAutoDelete(true);
|
||||
connect(&m_expirationTimer, SIGNAL(timeout()), SLOT(setExpirationTimer()));
|
||||
connect(&m_portRetryTimer, SIGNAL(timeout()), SLOT(portRetryTimer()));
|
||||
connect(&m_reregistrationTimer, SIGNAL(timeout()), SLOT(reregistrationTimer()));
|
||||
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);
|
||||
} else {
|
||||
delete pl;
|
||||
}
|
||||
}
|
||||
|
||||
setExpirationTimer();
|
||||
setPortRetryTimer(true);
|
||||
setReregistrationTimer();
|
||||
}
|
||||
|
||||
void KInetD::expirationTimer()
|
||||
{
|
||||
setExpirationTimer();
|
||||
setReregistrationTimer();
|
||||
}
|
||||
|
||||
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);
|
||||
setReregistrationTimer();
|
||||
}
|
||||
|
||||
void KInetD::setReregistrationTimer()
|
||||
{
|
||||
QDateTime d;
|
||||
PortListener *pl = m_portListeners.first();
|
||||
|
||||
while (pl) {
|
||||
QDateTime d2 = pl->serviceLifetimeEnd();
|
||||
|
||||
if (!d2.isNull()) {
|
||||
if (d2 < QDateTime::currentDateTime()) {
|
||||
m_reregistrationTimer.start(0, true);
|
||||
return;
|
||||
} else if (d.isNull() || (d2 < d)) {
|
||||
d = d2;
|
||||
}
|
||||
}
|
||||
|
||||
pl = m_portListeners.next();
|
||||
}
|
||||
|
||||
if (!d.isNull()) {
|
||||
int s = QDateTime::currentDateTime().secsTo(d);
|
||||
|
||||
if (s < 30) {
|
||||
s = 30; // max frequency 30s
|
||||
}
|
||||
|
||||
m_reregistrationTimer.start(s * 1000, true);
|
||||
} else {
|
||||
m_reregistrationTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void KInetD::reregistrationTimer()
|
||||
{
|
||||
PortListener *pl = m_portListeners.first();
|
||||
|
||||
while (pl) {
|
||||
pl->refreshRegistration();
|
||||
pl = m_portListeners.next();
|
||||
}
|
||||
|
||||
setReregistrationTimer();
|
||||
}
|
||||
|
||||
void KInetD::setPortRetryTimer(bool retry)
|
||||
{
|
||||
int unmappedPorts = 0;
|
||||
|
||||
PortListener *pl = m_portListeners.first();
|
||||
|
||||
while (pl) {
|
||||
if (pl->isEnabled() && (pl->port() < 0))
|
||||
if (retry) {
|
||||
if (!pl->acquirePort()) {
|
||||
unmappedPorts++;
|
||||
}
|
||||
} else if (pl->port() < 0) {
|
||||
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);
|
||||
setReregistrationTimer();
|
||||
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();
|
||||
setReregistrationTimer();
|
||||
}
|
||||
|
||||
void KInetD::setEnabled(QString service, QDateTime expiration)
|
||||
{
|
||||
PortListener *pl = getListenerByName(service);
|
||||
|
||||
if (!pl) {
|
||||
return;
|
||||
}
|
||||
|
||||
pl->setEnabled(expiration);
|
||||
setExpirationTimer();
|
||||
setReregistrationTimer();
|
||||
}
|
||||
|
||||
void KInetD::setServiceRegistrationEnabled(QString service, bool enable)
|
||||
{
|
||||
PortListener *pl = getListenerByName(service);
|
||||
|
||||
if (!pl) {
|
||||
return;
|
||||
}
|
||||
|
||||
pl->setServiceRegistrationEnabled(enable);
|
||||
setReregistrationTimer();
|
||||
}
|
||||
|
||||
bool KInetD::isServiceRegistrationEnabled(QString service)
|
||||
{
|
||||
PortListener *pl = getListenerByName(service);
|
||||
|
||||
if (!pl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return pl->isServiceRegistrationEnabled();
|
||||
}
|
||||
|
||||
KInetD::~KInetD()
|
||||
{
|
||||
m_portListeners.clear();
|
||||
delete m_config;
|
||||
delete m_srvreg;
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=Service
|
||||
|
||||
X-KDE-ServiceTypes=KDEDModule
|
||||
X-KDE-ModuleType=Library
|
||||
X-KDE-Library=kinetd
|
||||
X-KDE-Kded-autoload=true
|
||||
|
||||
Name=KDE Internet Daemon
|
||||
Name[af]=Kde Internet Bediener
|
||||
Name[ar]=كيدي إنترنت مراقب
|
||||
Name[ast]=Degorriu d'Internet de KDE
|
||||
Name[bg]=Интернет демон
|
||||
Name[bn]=কে-ডি-ই ইন্টারনেট ডিমন
|
||||
Name[br]=Diaoul kenrouedad KDE
|
||||
Name[bs]=KDE-ov Internet Demon
|
||||
Name[ca]=Dimoni d'Internet per al KDE
|
||||
Name[ca@valencia]=Dimoni d'Internet per al KDE
|
||||
Name[cs]=KDE Internet démon
|
||||
Name[cy]=Daemon Rhyngrwyd KDE
|
||||
Name[da]=KDE Internet-dæmon
|
||||
Name[de]=Internet-Dienst
|
||||
Name[el]=Δαίμονας διαδικτύου για το KDE
|
||||
Name[en_GB]=KDE Internet Dæmon
|
||||
Name[eo]=KDE interreta demono
|
||||
Name[es]=Demonio de Internet de KDE
|
||||
Name[et]=KDE internetideemon
|
||||
Name[eu]=KDE interneteko daemona
|
||||
Name[fa]=شبح اینترنتی KDE
|
||||
Name[fi]=KDE:n Internet-palvelin
|
||||
Name[fr]=Démon Internet de KDE
|
||||
Name[ga]=Deamhan Idirlín KDE
|
||||
Name[gl]=Daemon de internet de KDE
|
||||
Name[he]=תהליך הרקע האינטרנטי של KDE
|
||||
Name[hi]=केडीई इंटरनेट डेमन
|
||||
Name[hne]=केडीई इंटरनेट डेमन
|
||||
Name[hr]=KDE Internet Daemon
|
||||
Name[hu]=KDE internetes szolgáltatás
|
||||
Name[ia]=Demone Internet de KDE
|
||||
Name[is]=KDE Internetþjónn
|
||||
Name[it]=Demone Internet di KDE
|
||||
Name[ja]=KDE インターネットデーモン
|
||||
Name[kk]=KDE Интернет қызметі
|
||||
Name[km]=ដេមិនអ៊ីនធឺណិតរបស់ KDE
|
||||
Name[ko]=KDE 인터넷 데몬
|
||||
Name[lt]=KDE interneto tarnyba
|
||||
Name[lv]=KDE Interneta dēmons
|
||||
Name[mk]=Даемон за Интернет на KDE
|
||||
Name[ml]=കെഡിഈ ഇന്റര്നെറ്റ് സഹായി
|
||||
Name[ms]=Daemon Internet KDE
|
||||
Name[nb]=KDEs Internett-nisse
|
||||
Name[nds]=KDE-Internetdämoon
|
||||
Name[ne]=केडीई इन्टरनेट डेइमोन
|
||||
Name[nl]=KDE Internet Daemon
|
||||
Name[nn]=KDE-Internett-teneste
|
||||
Name[pa]=KDE ਇੰਟਰਨੈੱਟ ਡੈਮਨ
|
||||
Name[pl]=Internet/sieć
|
||||
Name[pt]=Servidor de Internet do KDE
|
||||
Name[pt_BR]=Servidor de Internet do KDE
|
||||
Name[ro]=Demon de Internet KDE
|
||||
Name[ru]=Доступ к Интернету
|
||||
Name[se]=KDE-Interneahtta-duogášprográmma
|
||||
Name[sk]=KDE Internet démon
|
||||
Name[sl]=Internetni strežnik za KDE
|
||||
Name[sq]=KDE Internet Daemon
|
||||
Name[sr]=КДЕ‑ов интернет демон
|
||||
Name[sr@ijekavian]=КДЕ‑ов интернет демон
|
||||
Name[sr@ijekavianlatin]=KDE‑ov internet demon
|
||||
Name[sr@latin]=KDE‑ov internet demon
|
||||
Name[sv]=KDE:s Internetdemon
|
||||
Name[ta]=கேடிஇ இணைய டேமொன்
|
||||
Name[tg]=KDE Азозили Интернет
|
||||
Name[th]=ดีมอนอินเทอร์เน็ตของ KDE
|
||||
Name[tr]=KDE İnternet Programı
|
||||
Name[uk]=Фонова служба Інтернет KDE
|
||||
Name[uz]=KDE Internet demoni
|
||||
Name[uz@cyrillic]=KDE Интернет демони
|
||||
Name[vi]=Trình nền Mạng KDE
|
||||
Name[xh]=KDE Internet Daemon
|
||||
Name[x-test]=xxKDE Internet Daemonxx
|
||||
Name[zh_CN]=KDE Internet 守护进程
|
||||
Name[zh_HK]=KDE 互聯網系統程式
|
||||
Name[zh_TW]=KDE Internet 伺服程式
|
||||
Comment=An Internet daemon that starts network services on demand
|
||||
Comment[ar]=رقيب الإنترنت بدأ خدمة الشبكة على الرقيب
|
||||
Comment[ast]=Un degorriu d'Internet qu'entama los servicios de rede baxo demanda
|
||||
Comment[bg]=Интернет демон, който служи за стартиране на мрежови услуги при поискване
|
||||
Comment[bn]=একটি ইন্টারনেট ডিমন যে চাহিদা ভিত্তিক নেটওয়ার্ক সার্ভিস আরম্ভ করে
|
||||
Comment[bs]=Internet daemon koji pokreće mrežne servise po zahtijevu
|
||||
Comment[ca]=Un dimoni d'Internet que arrenca els serveis de xarxa sota demanda
|
||||
Comment[ca@valencia]=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[cy]=Daemon Rhyngrwyd sy'n cychwyn gwasanaethau rhwydwaith ar alw
|
||||
Comment[da]=En internet-dæmon der starter netværkstjenester efter forespørgsel
|
||||
Comment[de]=Startet Netzwerkdienste bei Bedarf
|
||||
Comment[el]=Ένας δαίμονας για το διαδίκτυο ο οποίος ξεκινάει τις υπηρεσίες δικτύου όταν απαιτείται
|
||||
Comment[en_GB]=An Internet dæmon that starts network services on demand
|
||||
Comment[eo]=Interreta demono 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[eu]=Sare zerbitzuak eskatzean abiarazten dituen Interneteko daemona
|
||||
Comment[fa]=یک شبح اینترنتی که خدمات شبکه را بر اساس تقاضا آغاز میکند
|
||||
Comment[fi]=Internet-palvelin, joka käynnistää verkkopalveluita
|
||||
Comment[fr]=Un démon Internet qui démarre le service réseau à la demande
|
||||
Comment[ga]=Deamhan Idirlín a thosaíonn seirbhísí líonra ar éileamh
|
||||
Comment[gl]=Un daemon de Internet que inicia servizos de rede baixo demanda
|
||||
Comment[he]=תהליך רקע של אינטרנט שמתחיל שירותי רשת לפי דרישה
|
||||
Comment[hi]=एक इंटरनेट डेमन जो मांग पर नेटवर्क सेवा प्रारंभ करता है
|
||||
Comment[hne]=एक इंटरनेट डेमन जऊन मांग मं नेटवर्क सेवा चालू करथे
|
||||
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[ia]=Un demone internet que starta servicios de rete sur requesta
|
||||
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[kk]=Талап етілгенде керек желі қызметтерді жегетін қызмет
|
||||
Comment[km]=ដេមិនអ៊ីនធឺណិតដែលចាប់ផ្ដើមសេវាបណ្ដាញនៅពេលត្រូវការ
|
||||
Comment[ko]=요청에 따라 네트워크 서비스를 시작하는 인터넷 데몬
|
||||
Comment[lt]=Interneto tarnyba, paleidžianti tinklo tarnybas esant poreikiui
|
||||
Comment[lv]=Interneta dēmons pēc vajadzības palaiž tīkla servisus
|
||||
Comment[mk]=Даемон за Интернет кој ги вклучува мрежните сервиси на барање
|
||||
Comment[ml]=ആവശ്യപ്പെടുമ്പോള് ശൃംഖലാസേവനം തുടങ്ങുന്ന ഒരു ഇന്റര്നെറ്റ് സഹായി
|
||||
Comment[ms]=Daemon Internet yang memulakan servis jaringan di atas permintaan
|
||||
Comment[nb]=Internett-nisse som starter nettverkstjenester ved behov
|
||||
Comment[nds]=En Internet-Dämoon, wat Nettwarkdeensten op Anfraag start
|
||||
Comment[ne]=एउटा इन्टरनेट डेइमोन जसले मागमा सञ्जाल सेवा सुरु गर्दछ
|
||||
Comment[nl]=Een internetdaemon die netwerkdiensten op afroep start
|
||||
Comment[nn]=Internett-teneste som startar nettverkstenester når dei trengst
|
||||
Comment[pa]=ਇੱਕ ਇੰਟਰਨੈੱਟ ਡੈਮਨ, ਜੋ ਕਿ ਲੋੜ ਪੈਣ ਉੱਤੇ ਨੈੱਟਵਰਕ ਸਰਵਿਸਾਂ ਸ਼ੁਰੂ ਕਰਦੀ ਹੈ।
|
||||
Comment[pl]=Uruchamianie usług na żądanie
|
||||
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 demon de Internet ce pornește serviciile de rețea la cerere
|
||||
Comment[ru]=Служба установления подключения при запросе сетевых ресурсов
|
||||
Comment[se]=Interneahtta-duogášprográmma mii álggaha fierpmádatbálvalusaid go dárbbašuvvo
|
||||
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[sr]=Интернет демон који покреће мрежне сервисе по захтеву
|
||||
Comment[sr@ijekavian]=Интернет демон који покреће мрежне сервисе по захтеву
|
||||
Comment[sr@ijekavianlatin]=Internet demon koji pokreće mrežne servise po zahtevu
|
||||
Comment[sr@latin]=Internet demon koji pokreće mrežne servise po zahtevu
|
||||
Comment[sv]=Internetdemon som startar nätverkstjänster vid behov
|
||||
Comment[ta]=ஒரு இணைய டேமொன், டேமொன் பிணைய சேவையை ஆரம்பிக்கிறது
|
||||
Comment[tg]=Азозили шабакавие, ки хидматрасони шабакавиро бо дархост сар медиҳад
|
||||
Comment[th]=ดมอนอินเทอร์เน็ตซึ่งจะเริ่มทำงานบริการเครือข่ายเมื่อมีความต้องการใช้
|
||||
Comment[tr]=Başlangıçta ağ servisleri tarafından istenen Internet hayalet programı
|
||||
Comment[uk]=Фонова служба Інтернет, що запускає служби мережі при запиті
|
||||
Comment[uz]=Talab qilinganda tarmoq xizmatlarini ishga tushuruvchi Internet demoni
|
||||
Comment[uz@cyrillic]=Талаб қилинганда тармоқ хизматларини ишга тушурувчи Интернет демони
|
||||
Comment[vi]=Một trình nền Mạng mà chạy các dịch vụ mạng theo nhu cầu
|
||||
Comment[xh]=Internet daemon eqala iinkonzo zomsebenzi wonatha xa zifunwa
|
||||
Comment[x-test]=xxAn Internet daemon that starts network services on demandxx
|
||||
Comment[zh_CN]=按需启动网络服务的守护进程
|
||||
Comment[zh_HK]=自動依需求起動網絡服務的互聯網系統程式
|
||||
Comment[zh_TW]=依要求起動網路服務的 Internet 伺服程式
|
||||
201
kinetd/kinetd.h
201
kinetd/kinetd.h
@@ -1,201 +0,0 @@
|
||||
|
||||
/***************************************************************************
|
||||
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 <k3process.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qstring.h>
|
||||
#include <qdatetime.h>
|
||||
#include <qtimer.h>
|
||||
#include <kserversocket.h>
|
||||
#include <dnssd/publicservice.h>
|
||||
#include <q3ptrlist.h>
|
||||
#include "kserviceregistry.h"
|
||||
|
||||
class PortListener : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
bool m_valid;
|
||||
QString m_serviceName;
|
||||
QString m_serviceURL, m_serviceAttributes;
|
||||
QStringList m_registeredServiceURLs;
|
||||
QString m_dnssdName, m_dnssdType;
|
||||
QMap<QString, QString> m_dnssdData;
|
||||
int m_serviceLifetime;
|
||||
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;
|
||||
bool m_dnssdRegister, m_dnssdRegistered;
|
||||
QDateTime m_expirationTime;
|
||||
QDateTime m_slpLifetimeEnd;
|
||||
QString m_uuid;
|
||||
|
||||
KNetwork::KServerSocket *m_socket;
|
||||
K3Process m_process;
|
||||
|
||||
KConfig *m_config;
|
||||
KServiceRegistry *m_srvreg;
|
||||
DNSSD::PublicService *m_dnssdreg;
|
||||
|
||||
void freePort();
|
||||
void loadConfig(KService::Ptr s);
|
||||
void setEnabledInternal(bool e, const QDateTime &ex);
|
||||
void dnssdRegister(bool enabled);
|
||||
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();
|
||||
QDateTime serviceLifetimeEnd();
|
||||
bool isEnabled();
|
||||
int port();
|
||||
QStringList processServiceTemplate(const QString &a);
|
||||
bool setPort(int port = -1, int autoProbeRange = 1);
|
||||
void refreshRegistration();
|
||||
|
||||
private slots:
|
||||
void accepted(KSocket *);
|
||||
};
|
||||
|
||||
class KInetD : public KDEDModule
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* 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 did not 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);
|
||||
void setReregistrationTimer();
|
||||
|
||||
KConfig *m_config;
|
||||
KServiceRegistry *m_srvreg;
|
||||
Q3PtrList<PortListener> m_portListeners;
|
||||
QTimer m_expirationTimer;
|
||||
QTimer m_portRetryTimer;
|
||||
QTimer m_reregistrationTimer;
|
||||
|
||||
private slots:
|
||||
void setExpirationTimer();
|
||||
void expirationTimer();
|
||||
void portRetryTimer();
|
||||
void reregistrationTimer();
|
||||
|
||||
public:
|
||||
KInetD(QObject *parent, const QList<QVariant>&);
|
||||
virtual ~KInetD();
|
||||
void loadServiceList();
|
||||
PortListener *getListenerByName(QString name);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,336 +0,0 @@
|
||||
[Global]
|
||||
IconName=kinetd
|
||||
Comment=KInetD
|
||||
Comment[ar]=KInetD
|
||||
Comment[ast]=KInetD
|
||||
Comment[bn]=কে-আইনেট-ডি
|
||||
Comment[br]=KInetD
|
||||
Comment[bs]=KInetD
|
||||
Comment[ca]=KInetD
|
||||
Comment[ca@valencia]=KInetD
|
||||
Comment[cs]=KInetD
|
||||
Comment[cy]=KInetD
|
||||
Comment[da]=KInetD
|
||||
Comment[de]=KInetD
|
||||
Comment[el]=KInetD
|
||||
Comment[en_GB]=KInetD
|
||||
Comment[eo]=KInetD
|
||||
Comment[es]=KInetD
|
||||
Comment[et]=KInetD
|
||||
Comment[eu]=KInetD
|
||||
Comment[fi]=KInetD
|
||||
Comment[fr]=KInetD
|
||||
Comment[ga]=KInetD
|
||||
Comment[gl]=KInetD
|
||||
Comment[he]=KInetD
|
||||
Comment[hi]=के-इनिट-डी
|
||||
Comment[hne]=के-इनिट-डी
|
||||
Comment[hr]=KInetD
|
||||
Comment[hu]=KInetD
|
||||
Comment[ia]=KInetD
|
||||
Comment[is]=KInetD
|
||||
Comment[it]=KInetD
|
||||
Comment[ja]=KInetD
|
||||
Comment[kk]=KInetD
|
||||
Comment[km]=KInetD
|
||||
Comment[ko]=KInetD
|
||||
Comment[lt]=KInetD
|
||||
Comment[lv]=KInetD
|
||||
Comment[mk]=KInetD
|
||||
Comment[ml]=കെഐനെറ്റ്ഡി
|
||||
Comment[ms]=KInetD
|
||||
Comment[nb]=KInetD
|
||||
Comment[nds]=KInetD
|
||||
Comment[nl]=KInetD
|
||||
Comment[nn]=KInetD
|
||||
Comment[pa]=KInetD
|
||||
Comment[pl]=KInetD
|
||||
Comment[pt]=KInetD
|
||||
Comment[pt_BR]=KInetD
|
||||
Comment[ro]=KInetD
|
||||
Comment[ru]=KInetD
|
||||
Comment[sk]=KInetD
|
||||
Comment[sl]=KInetD
|
||||
Comment[sq]=KInetD
|
||||
Comment[sr]=КинетД
|
||||
Comment[sr@ijekavian]=КинетД
|
||||
Comment[sr@ijekavianlatin]=KInetD
|
||||
Comment[sr@latin]=KInetD
|
||||
Comment[sv]=Kinetd
|
||||
Comment[ta]=KInetD
|
||||
Comment[tg]=KInetD
|
||||
Comment[tr]=KInetD
|
||||
Comment[uk]=KInetD
|
||||
Comment[wa]=KInetD
|
||||
Comment[xh]=KInetD
|
||||
Comment[x-test]=xxKInetDxx
|
||||
Comment[zh_CN]=KInetD
|
||||
Comment[zh_HK]=KInetD
|
||||
Comment[zh_TW]=KInetD
|
||||
|
||||
[Event/IncomingConnection]
|
||||
Name=IncomingConnection
|
||||
Name[ar]=اتصال وارد
|
||||
Name[ast]=Conexón entrante
|
||||
Name[bn]=অন্তর্মুখী সংযোগ
|
||||
Name[br]=Kevreadenn resev
|
||||
Name[bs]=Dolazna veza
|
||||
Name[ca]=Connexió entrant
|
||||
Name[ca@valencia]=Connexió entrant
|
||||
Name[cs]=Příchozí spojení
|
||||
Name[cy]=CysylltiadCyrraedd
|
||||
Name[da]=IndkommendeForbindelse
|
||||
Name[de]=Eingehende Verbindung
|
||||
Name[el]=Εισερχόμενη σύνδεση
|
||||
Name[en_GB]=IncomingConnection
|
||||
Name[eo]=Envenanta konekto
|
||||
Name[es]=Conexión entrante
|
||||
Name[et]=Sissetulev ühendus
|
||||
Name[eu]=Sarrerako konexioa
|
||||
Name[fi]=Saapuva yhteys
|
||||
Name[fr]=Connexion entrante
|
||||
Name[ga]=Ceangal Isteach
|
||||
Name[gl]=Conexión entrante
|
||||
Name[he]=חיבור נכנס
|
||||
Name[hi]=आवक-कनेक्शन
|
||||
Name[hne]=आवक-कनेक्सन
|
||||
Name[hr]=DolaznaVeza
|
||||
Name[hu]=Bejövő kapcsolat
|
||||
Name[ia]=Connexion in arrivata
|
||||
Name[is]=IncomingConnection
|
||||
Name[it]=Connessioni in entrata
|
||||
Name[ja]=外部からの接続
|
||||
Name[kk]=Кіріс қосылым
|
||||
Name[km]=ការតភ្ជាប់ចូល
|
||||
Name[ko]=IncomingConnection
|
||||
Name[lt]=Gautas kvietimas ryšiui
|
||||
Name[lv]=IenākošaisSavienojums
|
||||
Name[mk]=Дојдовно поврзување
|
||||
Name[ml]=ആഗമനബന്ധം
|
||||
Name[ms]=Sambungan Masuk
|
||||
Name[nb]=Innkommende tilkobling
|
||||
Name[nds]=RinkamenVerbinnen
|
||||
Name[nl]=Inkomende_verbinding
|
||||
Name[nn]=Innkommande tilkopling
|
||||
Name[pa]=ਆ ਰਹੇ ਕੁਨੈਕਸ਼ਨ
|
||||
Name[pl]=Połączenia przychodzące
|
||||
Name[pt]=IncomingConnection
|
||||
Name[pt_BR]=Conexões de entrada
|
||||
Name[ro]=ConexiuneDeIntrare
|
||||
Name[ru]=Входящее соединение
|
||||
Name[sk]=Prichádzajúce pripojenie
|
||||
Name[sl]=Prejeta povezava
|
||||
Name[sr]=Долазна веза
|
||||
Name[sr@ijekavian]=Долазна веза
|
||||
Name[sr@ijekavianlatin]=Dolazna veza
|
||||
Name[sr@latin]=Dolazna veza
|
||||
Name[sv]=Inkommande anslutning
|
||||
Name[ta]=உள்வரும் இணைப்புகள்
|
||||
Name[tg]=Пайвастшавии Воридшаванда
|
||||
Name[th]=มีการเชื่อมต่อเข้ามา
|
||||
Name[tr]=Gelen Bağlantı
|
||||
Name[uk]=IncomingConnection
|
||||
Name[xh]=Uxhumaniso Olungenayo
|
||||
Name[x-test]=xxIncomingConnectionxx
|
||||
Name[zh_CN]=进入的连接
|
||||
Name[zh_HK]=進入連線
|
||||
Name[zh_TW]=進來的連線
|
||||
Comment=Received incoming connection
|
||||
Comment[af]=Ontvang inkomende verbinding
|
||||
Comment[ar]=تلقي اتصال وارد
|
||||
Comment[ast]=Recibida conexón entrante
|
||||
Comment[bn]=অন্তর্মুখী সংযোগ গ্রহণ করল
|
||||
Comment[bs]=Primljena dolazeća veza
|
||||
Comment[ca]=Rebuda connexió entrant
|
||||
Comment[ca@valencia]=Rebuda connexió entrant
|
||||
Comment[cs]=Obdrženo příchozí spojení
|
||||
Comment[cy]=Derbynwyd cysylltiad a gyrhaeddodd
|
||||
Comment[da]=Modtog indkommende forbindelse
|
||||
Comment[de]=Verbindungsanfrage eingegangen
|
||||
Comment[el]=Λήφθηκε μια εισερχόμενη σύνδεση
|
||||
Comment[en_GB]=Received incoming connection
|
||||
Comment[eo]=Ricevis envenantan konekton
|
||||
Comment[es]=Recibida conexión entrante
|
||||
Comment[et]=Saadi sissetulev ühendus
|
||||
Comment[eu]=Sarrerako konexio bat jaso da
|
||||
Comment[fi]=Vastaanotettiin saapuva yhteys
|
||||
Comment[fr]=Reçu une connexion entrante
|
||||
Comment[ga]=Fuarthas ceangal isteach
|
||||
Comment[gl]=Recibiuse unha conexión entrante
|
||||
Comment[he]=נתקבל חיבור נכנס
|
||||
Comment[hi]=आवक कनेक्शन प्राप्त
|
||||
Comment[hne]=आवक कनेक्सन प्राप्त
|
||||
Comment[hr]=Primio dolaznu vezu
|
||||
Comment[hu]=Csatlakozási kérés érkezett
|
||||
Comment[ia]=Connexion in arrivata recipite
|
||||
Comment[is]=Tók á móti uppkalli
|
||||
Comment[it]=Ricevuta connessione in entrata
|
||||
Comment[ja]=外部からの接続がありました
|
||||
Comment[kk]=Кіріс қосылым ұсынылды
|
||||
Comment[km]=បានទទួលការតភ្ជាប់ចូល
|
||||
Comment[ko]=들어오는 연결을 받았습니다
|
||||
Comment[lt]=Gautas kvietimas ryšiui
|
||||
Comment[lv]=Saņemts ienākošs savienojums
|
||||
Comment[mk]=Примено е дојдовно поврзување
|
||||
Comment[ml]=ആഗമനബന്ധം ലഭിച്ചു
|
||||
Comment[ms]=Menerima sambungan masuk
|
||||
Comment[nb]=Mottok innkommende tilkobling
|
||||
Comment[nds]=Tokoppelanfraag kregen
|
||||
Comment[nl]=Inkomende verbinding ontvangen
|
||||
Comment[nn]=Fekk ei innkommande tilkopling
|
||||
Comment[pa]=ਮਿਲੇ ਆ ਰਹੇ ਕੁਨੈਕਸ਼ਨ
|
||||
Comment[pl]=Otrzymano połączenie 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é prichádzajúce pripojenie
|
||||
Comment[sl]=Prejeta je prihajajoča povezava
|
||||
Comment[sr]=Примљена је долазна веза
|
||||
Comment[sr@ijekavian]=Примљена је долазна веза
|
||||
Comment[sr@ijekavianlatin]=Primljena je dolazna veza
|
||||
Comment[sr@latin]=Primljena je dolazna veza
|
||||
Comment[sv]=Tar emot inkommande anslutning
|
||||
Comment[tg]=Пайвастшавии воридшаванда қабул гардид
|
||||
Comment[th]=ได้รับการเชื่อมต่อเข้ามา
|
||||
Comment[tr]=Gelen bağlantı alınıyor
|
||||
Comment[uk]=Отримано вхідне з’єднання
|
||||
Comment[xh]=Uxhulumano olungenayo olufunyenweyo
|
||||
Comment[x-test]=xxReceived incoming connectionxx
|
||||
Comment[zh_CN]=收到进入的连接
|
||||
Comment[zh_HK]=已接收的進入連線
|
||||
Comment[zh_TW]=接收到進來的連線
|
||||
Action=None
|
||||
|
||||
[Event/ProcessFailed]
|
||||
Name=ProcessFailed
|
||||
Name[ar]=فشلت العملية
|
||||
Name[ast]=Procesu fallíu
|
||||
Name[bn]=প্রসেস ব্যর্থ
|
||||
Name[bs]=Neuspio proces
|
||||
Name[ca]=Procés erroni
|
||||
Name[ca@valencia]=Procés erroni
|
||||
Name[cs]=Proces selhal
|
||||
Name[cy]=MethoddProses
|
||||
Name[da]=ProcesMislykkedes
|
||||
Name[de]=Prozess fehlgeschlagen
|
||||
Name[el]=Η διεργασία απέτυχε
|
||||
Name[en_GB]=ProcessFailed
|
||||
Name[eo]=Procezo fiaskis
|
||||
Name[es]=Proceso fallido
|
||||
Name[et]=Protsess nurjus
|
||||
Name[eu]=Prozesuak huts egin du
|
||||
Name[fi]=Prosessi epäonnistui
|
||||
Name[fr]=Échec du processus
|
||||
Name[ga]=PróiseasTeipthe
|
||||
Name[gl]=Fallou o proceso
|
||||
Name[he]=תהליך נכשל
|
||||
Name[hi]=प्रक्रिया-असफल
|
||||
Name[hne]=काम-फेल
|
||||
Name[hr]=ProcesNeuspješan
|
||||
Name[hu]=Hibás folyamat
|
||||
Name[ia]=Processo falleva
|
||||
Name[is]=ProcessFailed
|
||||
Name[it]=Processo non riuscito
|
||||
Name[ja]=プロセス失敗
|
||||
Name[kk]=Процес жаңылысы
|
||||
Name[km]=ដំណើរការបានបរាជ័យ
|
||||
Name[ko]=ProcessFailed
|
||||
Name[lt]=Procesas nepavyko
|
||||
Name[lv]=ProcessNeveiksmīgs
|
||||
Name[mk]=Процесот не успеа
|
||||
Name[ml]=പ്രക്രിയ പരാജയപ്പെട്ടു
|
||||
Name[ms]=Proses Gagal
|
||||
Name[nb]=Prosessen mislyktes
|
||||
Name[nds]=PerzessFehlslaan
|
||||
Name[nl]=Proces_mislukt
|
||||
Name[nn]=Prosessen feila
|
||||
Name[pa]=ਪਰੋਸੈਸ ਫੇਲ੍ਹ
|
||||
Name[pl]=Błąd procesu
|
||||
Name[pt]=ProcessFailed
|
||||
Name[pt_BR]=Falha de processo
|
||||
Name[ro]=ProcesEșuat
|
||||
Name[ru]=Ошибка процесса
|
||||
Name[sk]=Proces zlyhal
|
||||
Name[sl]=Proces ni uspel
|
||||
Name[sr]=Процес није успео
|
||||
Name[sr@ijekavian]=Процес није успео
|
||||
Name[sr@ijekavianlatin]=Proces nije uspeo
|
||||
Name[sr@latin]=Proces nije uspeo
|
||||
Name[sv]=Process misslyckades
|
||||
Name[ta]=செயல் தோல்வியுற்றது
|
||||
Name[tg]=Ҷараён бо Нокомӣ анҷомид
|
||||
Name[th]=โพรเซสล้มเหลว
|
||||
Name[tr]=Başarısız İşlemler
|
||||
Name[uk]=ProcessFailed
|
||||
Name[xh]=Inkqubo Yahlulekile
|
||||
Name[x-test]=xxProcessFailedxx
|
||||
Name[zh_CN]=处理失败
|
||||
Name[zh_HK]=程序失敗
|
||||
Name[zh_TW]=行程失敗
|
||||
Comment=Could not call process to handle connection
|
||||
Comment[af]=Kon nie roep proses na handvatsel verbinding
|
||||
Comment[ar]= لا يمكن نداء الإجراء إلى مؤشر الاتصال
|
||||
Comment[ast]=Nun puede llamase a un procesu pa remanar la conexón
|
||||
Comment[bn]=সংযোগ পরিচালনা করতে প্রসেস শুরু করতে পারল না
|
||||
Comment[bs]=Nisam mogao da pozovem proces da opsluži vezu
|
||||
Comment[ca]=No es pot cridar al procés per a manejar la connexió
|
||||
Comment[ca@valencia]=No es pot cridar al procés per a manejar la connexió
|
||||
Comment[cs]=Nelze spustit proces k obsluze spojení
|
||||
Comment[cy]=Methu galw proses i drin y cysylltiad
|
||||
Comment[da]=Kunne ikke kalde proces til at håndtere forbindelse
|
||||
Comment[de]=Der Prozess zur Bearbeitung der Verbindungsanfrage kann nicht gestartet werden
|
||||
Comment[el]=Αδύνατη η κλήση της διεργασίας για τη διαχείριση της σύνδεσης
|
||||
Comment[en_GB]=Could not call process to handle connection
|
||||
Comment[eo]=Ne eblis lanĉi la procezon por trakti la konekton
|
||||
Comment[es]=No se puede llamar un proceso para manejar la conexión
|
||||
Comment[et]=Ei suuda käivitada protsessi ühenduse käsitsemiseks
|
||||
Comment[eu]=Ezin izan da konexioa kudeatzeko prozesua deitu
|
||||
Comment[fi]=Ei voitu kutsua prosessia yhteyden hoitamiseksi
|
||||
Comment[fr]=Impossible d'appeler le processus pour gérer la connexion
|
||||
Comment[ga]=Níorbh fhéidir próiseas a thosú chun an ceangal a láimhseáil
|
||||
Comment[gl]=Non foi posíbel chamar ao proceso que xestiona a conexión
|
||||
Comment[he]=אין אפשרות לקרוא לתהליך על מנת לטפל בחיבור
|
||||
Comment[hi]=कनेक्शन हैंडल करने के लिए प्रक्रिया काल नहीं कर सका
|
||||
Comment[hne]=कनेक्सन हेंडल करे बर काम काल नइ कर सकिस
|
||||
Comment[hr]=Nisam mogao pozvati proces za kontrolu veze
|
||||
Comment[hu]=A kapcsolat kezelése nem sikerült
|
||||
Comment[ia]=Il non pote appellar processo pro manear connexion
|
||||
Comment[is]=Gat ekki kallað á forrit til að höndla tengingu
|
||||
Comment[it]=Impossibile richiamare il processo per gestire la connessione
|
||||
Comment[ja]=接続を扱うプロセスを呼び出せません
|
||||
Comment[kk]=Қосылыммен айналысатын процесс шақырылмады
|
||||
Comment[km]=មិនអាចហៅដំណើរការ ដើម្បីដោះស្រាយការតភ្ជាប់បានឡើយ
|
||||
Comment[ko]=연결을 처리하기 위한 프로세스를 부를 수 없습니다
|
||||
Comment[lt]=Nepavyko iškviesti proceso apdoroti prisijungimui
|
||||
Comment[lv]=Neizdevās izsaukt procesu savienojuma apstrādei
|
||||
Comment[mk]=Не може да се повика процесот за ракување со поврзувањето
|
||||
Comment[ml]=ബന്ധം കൈകാര്യം ചെയ്യാന് പ്രക്രിയയെ വിളിക്കാന് കഴിഞ്ഞില്ല
|
||||
Comment[ms]=Tidak dapat memanggil proses untuk mengendalikan sambungan
|
||||
Comment[nb]=Klarte ikke kalle på prosess for å håndtere tilkobling
|
||||
Comment[nds]=Perzess för't Verarbeiden vun Tokoppelanfragen lett sik nich opropen
|
||||
Comment[nl]=Kon geen proces aanroepen om de verbinding af te handelen
|
||||
Comment[nn]=Klarte ikkje kalla på prosessen som skulle handtera tilkoplinga
|
||||
Comment[pl]=Nie można było uruchomić procesu obsługi połączenia
|
||||
Comment[pt]=Não foi possível invocar o processo para lidar com as ligações
|
||||
Comment[pt_BR]=Não foi possível chamar o processo de controle da conexão
|
||||
Comment[ro]=Procesul ce manipulează conexiunea nu a putut fi apelat
|
||||
Comment[ru]=Не удаётся запустить процесс обработки соединения
|
||||
Comment[sk]=Nepodarilo sa spustiť proces na spracovanie pripojenia
|
||||
Comment[sl]=Ni možno poklicati procesa za upravljanje s povezavo
|
||||
Comment[sr]=Нисам могао да позовем процес да опслужи везу
|
||||
Comment[sr@ijekavian]=Нисам могао да позовем процес да опслужи везу
|
||||
Comment[sr@ijekavianlatin]=Nisam mogao da pozovem proces da opsluži vezu
|
||||
Comment[sr@latin]=Nisam mogao da pozovem proces da opsluži vezu
|
||||
Comment[sv]=Kunde inte anropa process för att hantera anslutning
|
||||
Comment[ta]=இணைப்பை கையாள செயற்பாட்டை அழைக்க முடியவில்லை
|
||||
Comment[tg]=Барои даскории пайвастшавӣ ҷараён бозхонда нашуд
|
||||
Comment[th]=ไม่สามารถเรียกโพรเซสเพื่อจัดการรับการเชื่อมต่อได้
|
||||
Comment[tr]=Elle bağlantıda başarısız çağrı işlemleri
|
||||
Comment[uk]=Не вдалося викликати процес для з’єднання
|
||||
Comment[xh]=Ayikwazanga ukubiza inkqubo ezakuphatha uxhulumano
|
||||
Comment[x-test]=xxCould not call process to handle connectionxx
|
||||
Comment[zh_CN]=无法调用进程处理连接
|
||||
Comment[zh_HK]=無法呼叫處理連線的程序
|
||||
Comment[zh_TW]=無法呼叫行程來處理此連線
|
||||
Action=None
|
||||
@@ -1,153 +0,0 @@
|
||||
# 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[ast]=Triba de módulu KInetD
|
||||
Name[bg]=Модул на KInetD
|
||||
Name[bn]=কে-আইনেট-ডি মডিউল ধরন
|
||||
Name[br]=Seurt ar mollad KInetD
|
||||
Name[bs]=Vrsta modula KInetD-a
|
||||
Name[ca]=Tipus de mòdul del KInetD
|
||||
Name[ca@valencia]=Tipus de mòdul del KInetD
|
||||
Name[cs]=Typ modulu KInetD
|
||||
Name[cy]=Math Modiwl KInetD
|
||||
Name[da]=KInetD-modultype
|
||||
Name[de]=KInetD-Modultyp
|
||||
Name[el]=Τύπος αρθρώματος KInetD
|
||||
Name[en_GB]=KInetD Module Type
|
||||
Name[eo]=KInetD modulotipo
|
||||
Name[es]=Tipo de módulo KInetD
|
||||
Name[et]=KInetD mooduli tüüp
|
||||
Name[eu]=KInetD modulu mota
|
||||
Name[fa]=نوع پیمانۀ KInetD
|
||||
Name[fi]=KInetD-moduulityyppi
|
||||
Name[fr]=Type de module de KInetD
|
||||
Name[ga]=Cineál Modúil KInetD
|
||||
Name[gl]=Tipo de módulo KInetD
|
||||
Name[he]=סוג מודול של KInetD
|
||||
Name[hi]=के-इनिट-डी मॉड्यूल प्रकार
|
||||
Name[hne]=के-इनिट-डी माड्यूल किसम
|
||||
Name[hr]=Tip KInetD Modula
|
||||
Name[hu]=KInetD modultípus
|
||||
Name[ia]=Typo de modulo KInetD
|
||||
Name[is]=KInetD Module tegund
|
||||
Name[it]=Tipo di modulo KInetD
|
||||
Name[ja]=KInetD モジュールタイプ
|
||||
Name[kk]=KInetD модулі
|
||||
Name[km]=ប្រភេទម៉ូលឌុល KInetD
|
||||
Name[ko]=KInetD 모듈 종류
|
||||
Name[lt]=KInetD modulio tipas
|
||||
Name[lv]=KInetD moduļa tips
|
||||
Name[mk]=Тип на модул за KInetD
|
||||
Name[ml]=കെഐനെറ്റ് ഘടക രീതി
|
||||
Name[ms]=Jenis Modul KInetD
|
||||
Name[nb]=KInetd-programtillegstype
|
||||
Name[nds]=KInetD-Moduultyp
|
||||
Name[ne]=KInetD मोड्युल प्रकार
|
||||
Name[nl]=KInetD-moduletype
|
||||
Name[nn]=KInetD-programtilleggstype
|
||||
Name[pa]=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[se]=KInetD-moduvlašládja
|
||||
Name[sk]=Typ modulu KInetD
|
||||
Name[sl]=Vrsta modula KInetD
|
||||
Name[sr]=Врста модула КинетД‑а
|
||||
Name[sr@ijekavian]=Врста модула КинетД‑а
|
||||
Name[sr@ijekavianlatin]=Vrsta modula KInetD‑a
|
||||
Name[sr@latin]=Vrsta modula KInetD‑a
|
||||
Name[sv]=Kinetd-modultyp
|
||||
Name[ta]=KInetD கூறு வகை
|
||||
Name[tg]=Навъи Модули KInetD
|
||||
Name[tr]=KInetD Modül Türü
|
||||
Name[uk]=Тип модулю KinetD
|
||||
Name[vi]=Kiểu môđun KInetD
|
||||
Name[xh]=Udidi Lomqongo womlinganiselo we KInetD
|
||||
Name[x-test]=xxKInetD Module Typexx
|
||||
Name[zh_CN]=KInetD 模块类型
|
||||
Name[zh_HK]=KInetD 模組類型
|
||||
Name[zh_TW]=KInetD 模組類型
|
||||
|
||||
# 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. It will register one URL for each IP address of the
|
||||
# host.
|
||||
# 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
|
||||
# %i with a UUID thats identical in all URLs of this service
|
||||
[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
|
||||
# %i with a UUID thats identical in all URLs of this service
|
||||
[PropertyDef::X-KDE-KINETD-serviceAttributes]
|
||||
Type=QString
|
||||
|
||||
# the lifetime of a service in seconds. kinets will renew the service
|
||||
# automatically. Max 65535, never use anything under 2 min. Something like
|
||||
# 5-20 minutes is a sane value for most desktop applications.
|
||||
[PropertyDef::X-KDE-KINETD-serviceLifetime]
|
||||
Type=int
|
||||
|
||||
# if set, kinetd will announce service with given name on local network while
|
||||
# the port is open.
|
||||
# The following strings will be substituted:
|
||||
# %h with the local IP address
|
||||
# %f with the user's full name
|
||||
# %p with the port number
|
||||
|
||||
[PropertyDef::X-KDE-KINETD-DNSSD-Name]
|
||||
Type=QString
|
||||
|
||||
# if kinetd announces service on network using DNS-SD, this string will be used as service
|
||||
# type. It must be in form _yourservice._udp or _yourservice._tcp
|
||||
# it uses the same substitution rules as X-KDE-KINETD-DNSSD-Name
|
||||
|
||||
[PropertyDef::X-KDE-KINETD-DNSSD-Type]
|
||||
Type=QString
|
||||
|
||||
# defines list of text properties for service announced via DNS-SD
|
||||
# it uses the same substitution rules as X-KDE-KINETD-DNSSD-Name
|
||||
[PropertyDef::X-KDE-KINETD-DNSSD-Properties]
|
||||
Type=QStringList
|
||||
|
||||
@@ -41,21 +41,22 @@ install (FILES
|
||||
# Second target: krfb - the app
|
||||
# itself.
|
||||
|
||||
if(BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
add_definitions(-DKRFB_WITH_TELEPATHY_TUBES)
|
||||
include_directories(${TELEPATHY_QT4_INCLUDE_DIR})
|
||||
endif(BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
if(KTP_FOUND)
|
||||
add_definitions(-DKRFB_WITH_KDE_TELEPATHY)
|
||||
include_directories(${KTP_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
set (krfb_SRCS
|
||||
connectiondialog.cpp
|
||||
events.cpp
|
||||
framebuffermanager.cpp
|
||||
invitation.cpp
|
||||
invitedialog.cpp
|
||||
invitationmanager.cpp
|
||||
main.cpp
|
||||
manageinvitationsdialog.cpp
|
||||
personalinvitedialog.cpp
|
||||
mainwindow.cpp
|
||||
sockethelpers.cpp
|
||||
trayicon.cpp
|
||||
rfbservermanager.cpp
|
||||
@@ -65,14 +66,13 @@ set (krfb_SRCS
|
||||
invitationsrfbclient.cpp
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
set (krfb_SRCS
|
||||
${krfb_SRCS}
|
||||
tubesrfbserver.cpp
|
||||
tubesrfbclient.cpp
|
||||
tubesclienthandler.cpp
|
||||
)
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
kde4_add_kcfg_files (krfb_SRCS
|
||||
krfbconfig.kcfgc
|
||||
@@ -82,14 +82,12 @@ kde4_add_ui_files (krfb_SRCS
|
||||
ui/configtcp.ui
|
||||
ui/configsecurity.ui
|
||||
ui/connectionwidget.ui
|
||||
ui/invitewidget.ui
|
||||
ui/manageinvitations.ui
|
||||
ui/personalinvitewidget.ui
|
||||
ui/mainwidget.ui
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
kde4_add_ui_files(krfb_SRCS ui/tubesconnectionwidget.ui)
|
||||
endif(BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
kde4_add_executable (krfb
|
||||
${krfb_SRCS}
|
||||
@@ -107,11 +105,19 @@ target_link_libraries (krfb
|
||||
${KDE4_KDEUI_LIBS}
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
target_link_libraries(krfb
|
||||
${TELEPATHY_QT4_LIBRARIES}
|
||||
)
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
if(KTP_FOUND)
|
||||
target_link_libraries(krfb
|
||||
${KTP_LIBRARIES}
|
||||
${KTP_MODELS_LIBRARIES}
|
||||
${KTP_WIDGETS_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (X11_XTest_FOUND)
|
||||
target_link_libraries (krfb
|
||||
@@ -123,14 +129,14 @@ install (TARGETS krfb
|
||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
if (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
if(TelepathyQt4_FOUND)
|
||||
configure_file(org.freedesktop.Telepathy.Client.krfb_rfb_handler.service.in
|
||||
org.freedesktop.Telepathy.Client.krfb_rfb_handler.service)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.krfb_rfb_handler.service
|
||||
DESTINATION ${DBUS_SERVICES_INSTALL_DIR})
|
||||
|
||||
install(FILES krfb_rfb_handler.client DESTINATION ${CMAKE_INSTALL_PREFIX}/share/telepathy/clients/)
|
||||
endif (BUILD_EXPERIMENTAL_TUBES_SUPPORT AND TELEPATHY_QT4_FOUND)
|
||||
endif()
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
/***************************************************************************
|
||||
Copyright 2002 Tim Jansen <tim@tjansen.de>
|
||||
Copyright 2002 Stefan Taferner <taferner@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. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "invitation.h"
|
||||
|
||||
#include <KConfigGroup>
|
||||
#include <KDebug>
|
||||
#include <KRandom>
|
||||
#include <KStringHandler>
|
||||
|
||||
// a random string that doesn't contain i, I, o, O, 1, 0
|
||||
// based on KRandom::randomString()
|
||||
static QString readableRandomString(int length)
|
||||
{
|
||||
QString str;
|
||||
|
||||
while (length) {
|
||||
int r = KRandom::random() % 62;
|
||||
r += 48;
|
||||
|
||||
if (r > 57) {
|
||||
r += 7;
|
||||
}
|
||||
|
||||
if (r > 90) {
|
||||
r += 6;
|
||||
}
|
||||
|
||||
char c = char(r);
|
||||
|
||||
if ((c == 'i') ||
|
||||
(c == 'I') ||
|
||||
(c == '1') ||
|
||||
(c == 'o') ||
|
||||
(c == 'O') ||
|
||||
(c == '0')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
str += c;
|
||||
length--;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
Invitation::Invitation()
|
||||
{
|
||||
m_password = readableRandomString(4) + '-' + readableRandomString(3);
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
Invitation::Invitation(const KConfigGroup &config)
|
||||
{
|
||||
m_password = KStringHandler::obscure(config.readEntry("password", QString()));
|
||||
kDebug() << "read: " << config.readEntry("password", QString()) << " = " << m_password;
|
||||
m_creationTime = config.readEntry("creation", QDateTime());
|
||||
m_expirationTime = config.readEntry("expiration", QDateTime());
|
||||
}
|
||||
|
||||
Invitation::~Invitation()
|
||||
{
|
||||
}
|
||||
|
||||
Invitation &Invitation::operator= (const Invitation &x)
|
||||
{
|
||||
m_password = x.m_password;
|
||||
m_creationTime = x.m_creationTime;
|
||||
m_expirationTime = x.m_expirationTime;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Invitation::save(KConfigGroup &config) const
|
||||
{
|
||||
config.writeEntry("password", KStringHandler::obscure(m_password));
|
||||
config.writeEntry("creation", m_creationTime);
|
||||
config.writeEntry("expiration", 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();
|
||||
}
|
||||
|
||||
bool Invitation::operator ==(const Invitation &ot)
|
||||
{
|
||||
return m_creationTime == ot.m_creationTime && m_password == ot.m_password;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/***************************************************************************
|
||||
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>
|
||||
#include <KConfig>
|
||||
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
const int INVITATION_DURATION = 60 * 60;
|
||||
|
||||
class Invitation
|
||||
{
|
||||
public:
|
||||
Invitation();
|
||||
~Invitation();
|
||||
Invitation(const KConfigGroup &config);
|
||||
Invitation(const Invitation &x);
|
||||
Invitation &operator= (const Invitation &x);
|
||||
|
||||
bool operator == (const Invitation &ot);
|
||||
|
||||
QString password() const;
|
||||
QDateTime expirationTime() const;
|
||||
QDateTime creationTime() const;
|
||||
bool isValid() const;
|
||||
|
||||
void save(KConfigGroup &config) const;
|
||||
private:
|
||||
QString m_password;
|
||||
QDateTime m_creationTime;
|
||||
QDateTime m_expirationTime;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,130 +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 "invitationmanager.h"
|
||||
#include "invitationmanager.moc"
|
||||
|
||||
#include <KConfigGroup>
|
||||
#include <KConfig>
|
||||
#include <KGlobal>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
class InvitationManagerPrivate
|
||||
{
|
||||
public:
|
||||
InvitationManager instance;
|
||||
};
|
||||
|
||||
K_GLOBAL_STATIC(InvitationManagerPrivate, invitationManagerPrivate)
|
||||
|
||||
InvitationManager *InvitationManager::self()
|
||||
{
|
||||
return &invitationManagerPrivate->instance;
|
||||
}
|
||||
|
||||
InvitationManager::InvitationManager()
|
||||
{
|
||||
loadInvitations();
|
||||
|
||||
QTimer *refreshTimer = new QTimer(this);
|
||||
connect(refreshTimer, SIGNAL(timeout()), SLOT(loadInvitations()));
|
||||
refreshTimer->start(1000 * 60);
|
||||
}
|
||||
|
||||
|
||||
InvitationManager::~InvitationManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void InvitationManager::invalidateOldInvitations()
|
||||
{
|
||||
int invNum = invitationList.size();
|
||||
|
||||
while (invNum--) {
|
||||
if (!invitationList[invNum].isValid()) {
|
||||
invitationList.removeAt(invNum);
|
||||
}
|
||||
}
|
||||
|
||||
saveInvitations();
|
||||
}
|
||||
|
||||
|
||||
void InvitationManager::loadInvitations()
|
||||
{
|
||||
int invNum = invitationList.size();
|
||||
|
||||
KSharedConfigPtr conf = KGlobal::config();
|
||||
KConfigGroup invitationConfig(conf, "Invitations");
|
||||
int numInv = invitationConfig.readEntry("invitation_num", 0);
|
||||
|
||||
invitationList.clear();
|
||||
|
||||
for (int i = 0; i < numInv; i++) {
|
||||
KConfigGroup ic(conf, QString("Invitation_%1").arg(i));
|
||||
invitationList.append(Invitation(ic));
|
||||
}
|
||||
|
||||
invalidateOldInvitations();
|
||||
|
||||
if (numInv != invNum) {
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Invitation InvitationManager::addInvitation()
|
||||
{
|
||||
Invitation i;
|
||||
invitationList.append(i);
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
saveInvitations();
|
||||
return i;
|
||||
}
|
||||
|
||||
const QList< Invitation > & InvitationManager::invitations()
|
||||
{
|
||||
return invitationList;
|
||||
}
|
||||
|
||||
void InvitationManager::saveInvitations()
|
||||
{
|
||||
KSharedConfigPtr conf = KGlobal::config();
|
||||
KConfigGroup invitationConfig(conf, "Invitations");
|
||||
int invNum = invitationList.size();
|
||||
invitationConfig.writeEntry("invitation_num", invNum);
|
||||
|
||||
for (int i = 0; i < invNum; i++) {
|
||||
KConfigGroup ic(conf, QString("Invitation_%1").arg(i));
|
||||
invitationList[i].save(ic);
|
||||
}
|
||||
|
||||
conf->sync();
|
||||
}
|
||||
|
||||
int InvitationManager::activeInvitations()
|
||||
{
|
||||
invalidateOldInvitations();
|
||||
return invitationList.size();
|
||||
}
|
||||
|
||||
void InvitationManager::removeInvitation(const Invitation &inv)
|
||||
{
|
||||
invitationList.removeAll(inv);
|
||||
saveInvitations();
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
}
|
||||
|
||||
void InvitationManager::removeAllInvitations()
|
||||
{
|
||||
invitationList.clear();
|
||||
saveInvitations();
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
}
|
||||
@@ -1,58 +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 INVITATIONMANAGER_H
|
||||
#define INVITATIONMANAGER_H
|
||||
|
||||
#include "invitation.h"
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
class InvitationManagerPrivate;
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class InvitationManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class InvitationManagerPrivate;
|
||||
public:
|
||||
static InvitationManager *self();
|
||||
|
||||
~InvitationManager();
|
||||
|
||||
Invitation addInvitation();
|
||||
|
||||
int activeInvitations();
|
||||
|
||||
void removeInvitation(const Invitation &inv);
|
||||
void removeAllInvitations();
|
||||
|
||||
const QList<Invitation> &invitations();
|
||||
|
||||
signals:
|
||||
void invitationNumChanged(int);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
void loadInvitations();
|
||||
void saveInvitations();
|
||||
|
||||
private:
|
||||
|
||||
void invalidateOldInvitations();
|
||||
InvitationManager();
|
||||
static InvitationManager *_self;
|
||||
|
||||
QList<Invitation> invitationList;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,72 +18,59 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "rfb.h"
|
||||
#include "invitationsrfbclient.h"
|
||||
#include "invitationmanager.h"
|
||||
#include "invitationsrfbserver.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "sockethelpers.h"
|
||||
#include "connectiondialog.h"
|
||||
#include <KNotification>
|
||||
#include <KLocale>
|
||||
#include <QtCore/QSocketNotifier>
|
||||
#include <poll.h>
|
||||
|
||||
bool InvitationsRfbClient::checkPassword(const QByteArray & encryptedPassword)
|
||||
struct PendingInvitationsRfbClient::Private
|
||||
{
|
||||
bool allowUninvited = KrfbConfig::allowUninvitedConnections();
|
||||
QByteArray password = KrfbConfig::uninvitedConnectionPassword().toLocal8Bit();
|
||||
Private(rfbClientPtr client) :
|
||||
client(client),
|
||||
askOnConnect(true)
|
||||
{}
|
||||
|
||||
bool authd = false;
|
||||
kDebug() << "about to start autentication";
|
||||
rfbClientPtr client;
|
||||
QSocketNotifier *notifier;
|
||||
bool askOnConnect;
|
||||
};
|
||||
|
||||
if (allowUninvited) {
|
||||
authd = vncAuthCheckPassword(password, encryptedPassword);
|
||||
}
|
||||
static void clientGoneHookNoop(rfbClientPtr cl) { Q_UNUSED(cl); }
|
||||
|
||||
if (!authd) {
|
||||
QList<Invitation> invlist = InvitationManager::self()->invitations();
|
||||
|
||||
foreach(const Invitation & it, invlist) {
|
||||
kDebug() << "checking password";
|
||||
|
||||
if (vncAuthCheckPassword(it.password().toLocal8Bit(), encryptedPassword)
|
||||
&& it.isValid())
|
||||
{
|
||||
authd = true;
|
||||
InvitationManager::self()->removeInvitation(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!authd) {
|
||||
if (InvitationManager::self()->invitations().size() > 0) {
|
||||
KNotification::event("InvalidPasswordInvitations",
|
||||
i18n("Failed login attempt from %1: wrong password", name()));
|
||||
} else {
|
||||
KNotification::event("InvalidPassword",
|
||||
i18n("Failed login attempt from %1: wrong password", name()));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
PendingInvitationsRfbClient::PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent) :
|
||||
PendingRfbClient(client, parent),
|
||||
d(new Private(client))
|
||||
{
|
||||
d->client->clientGoneHook = clientGoneHookNoop;
|
||||
d->notifier = new QSocketNotifier(client->sock, QSocketNotifier::Read, this);
|
||||
d->notifier->setEnabled(true);
|
||||
connect(d->notifier, SIGNAL(activated(int)),
|
||||
this, SLOT(onSocketActivated()));
|
||||
}
|
||||
|
||||
PendingInvitationsRfbClient::~PendingInvitationsRfbClient()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
void PendingInvitationsRfbClient::processNewClient()
|
||||
{
|
||||
QString host = peerAddress(m_rfbClient->sock) + ":" + QString::number(peerPort(m_rfbClient->sock));
|
||||
bool allowUninvited = KrfbConfig::allowUninvitedConnections();
|
||||
|
||||
if (!allowUninvited && InvitationManager::self()->activeInvitations() == 0) {
|
||||
KNotification::event("UnexpectedConnection",
|
||||
i18n("Refused uninvited connection attempt from %1", host));
|
||||
reject();
|
||||
} else if (!KrfbConfig::askOnConnect()) {
|
||||
if (d->askOnConnect == false) {
|
||||
|
||||
KNotification::event("NewConnectionAutoAccepted",
|
||||
i18n("Accepted connection from %1", host));
|
||||
accept(new InvitationsRfbClient(m_rfbClient, parent()));
|
||||
|
||||
} else {
|
||||
|
||||
KNotification::event("NewConnectionOnHold",
|
||||
i18n("Received connection from %1, on hold (waiting for confirmation)",
|
||||
host));
|
||||
@@ -99,6 +86,56 @@ void PendingInvitationsRfbClient::processNewClient()
|
||||
}
|
||||
}
|
||||
|
||||
void PendingInvitationsRfbClient::onSocketActivated()
|
||||
{
|
||||
//Process not only one, but all pending messages.
|
||||
//poll() idea/code copied from vino:
|
||||
// Copyright (C) 2003 Sun Microsystems, Inc.
|
||||
// License: GPL v2 or later
|
||||
struct pollfd pollfd = { d->client->sock, POLLIN|POLLPRI, 0 };
|
||||
|
||||
while(poll(&pollfd, 1, 0) == 1) {
|
||||
|
||||
if(d->client->state == rfbClientRec::RFB_INITIALISATION) {
|
||||
d->notifier->setEnabled(false);
|
||||
//Client is Authenticated
|
||||
processNewClient();
|
||||
break;
|
||||
}
|
||||
rfbProcessClientMessage(d->client);
|
||||
|
||||
//This is how we handle disconnection.
|
||||
//if rfbProcessClientMessage() finds out that it can't read the socket,
|
||||
//it closes it and sets it to -1. So, we just have to check this here
|
||||
//and call rfbClientConnectionGone() if necessary. This will call
|
||||
//the clientGoneHook which in turn will remove this RfbClient instance
|
||||
//from the server manager and will call deleteLater() to delete it
|
||||
if (d->client->sock == -1) {
|
||||
kDebug() << "disconnected from socket signal";
|
||||
d->notifier->setEnabled(false);
|
||||
rfbClientConnectionGone(d->client);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool PendingInvitationsRfbClient::checkPassword(const QByteArray & encryptedPassword)
|
||||
{
|
||||
QByteArray password ;
|
||||
kDebug() << "about to start autentication";
|
||||
|
||||
if(InvitationsRfbServer::instance->allowUnattendedAccess() && vncAuthCheckPassword(
|
||||
InvitationsRfbServer::instance->unattendedPassword().toLocal8Bit(),
|
||||
encryptedPassword) ) {
|
||||
d->askOnConnect = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return vncAuthCheckPassword(
|
||||
InvitationsRfbServer::instance->desktopPassword().toLocal8Bit(),
|
||||
encryptedPassword);
|
||||
}
|
||||
|
||||
void PendingInvitationsRfbClient::dialogAccepted()
|
||||
{
|
||||
InvitationsConnectionDialog *dialog = qobject_cast<InvitationsConnectionDialog *>(sender());
|
||||
|
||||
@@ -25,9 +25,6 @@ class InvitationsRfbClient : public RfbClient
|
||||
public:
|
||||
InvitationsRfbClient(rfbClientPtr client, QObject* parent = 0)
|
||||
: RfbClient(client, parent) {}
|
||||
|
||||
protected:
|
||||
virtual bool checkPassword(const QByteArray & encryptedPassword);
|
||||
};
|
||||
|
||||
|
||||
@@ -35,14 +32,20 @@ class PendingInvitationsRfbClient : public PendingRfbClient
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent = 0)
|
||||
: PendingRfbClient(client, parent) {}
|
||||
PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent = 0);
|
||||
virtual ~PendingInvitationsRfbClient();
|
||||
|
||||
protected Q_SLOTS:
|
||||
virtual void processNewClient();
|
||||
virtual void onSocketActivated();
|
||||
virtual bool checkPassword(const QByteArray & encryptedPassword);
|
||||
|
||||
private Q_SLOTS:
|
||||
void dialogAccepted();
|
||||
|
||||
private:
|
||||
struct Private;
|
||||
Private* const d;
|
||||
};
|
||||
|
||||
#endif // INVITATIONSRFBCLIENT_H
|
||||
|
||||
@@ -29,16 +29,118 @@
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KUser>
|
||||
#include <KRandom>
|
||||
#include <KStringHandler>
|
||||
#include <KWallet/Wallet>
|
||||
#include <DNSSD/PublicService>
|
||||
using KWallet::Wallet;
|
||||
|
||||
//static
|
||||
InvitationsRfbServer *InvitationsRfbServer::instance;
|
||||
|
||||
//static
|
||||
void InvitationsRfbServer::init()
|
||||
{
|
||||
InvitationsRfbServer *server;
|
||||
server = new InvitationsRfbServer;
|
||||
server->setListeningPort(KrfbConfig::port());
|
||||
server->setListeningAddress("0.0.0.0"); // Listen on all available network addresses
|
||||
server->setPasswordRequired(true);
|
||||
QTimer::singleShot(0, server, SLOT(startAndCheck()));
|
||||
instance = new InvitationsRfbServer;
|
||||
instance->m_publicService = new DNSSD::PublicService(
|
||||
i18n("%1@%2 (shared desktop)",
|
||||
KUser().loginName(),
|
||||
QHostInfo::localHostName()),
|
||||
"_rfb._tcp",
|
||||
KrfbConfig::port());
|
||||
instance->setListeningAddress("0.0.0.0");
|
||||
instance->setListeningPort(KrfbConfig::port());
|
||||
instance->setPasswordRequired(true);
|
||||
|
||||
instance->m_wallet = Wallet::openWallet(
|
||||
Wallet::NetworkWallet(), 0, Wallet::Asynchronous);
|
||||
if(instance->m_wallet) {
|
||||
connect(instance->m_wallet, SIGNAL(walletOpened(bool)),
|
||||
instance, SLOT(walletOpened(bool)));
|
||||
}
|
||||
}
|
||||
|
||||
const QString& InvitationsRfbServer::desktopPassword() const
|
||||
{
|
||||
return m_desktopPassword;
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::setDesktopPassword(const QString& password)
|
||||
{
|
||||
m_desktopPassword = password;
|
||||
}
|
||||
|
||||
const QString& InvitationsRfbServer::unattendedPassword() const
|
||||
{
|
||||
return m_unattendedPassword;
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::setUnattendedPassword(const QString& password)
|
||||
{
|
||||
m_unattendedPassword = password;
|
||||
}
|
||||
|
||||
bool InvitationsRfbServer::allowUnattendedAccess() const
|
||||
{
|
||||
return m_allowUnattendedAccess;
|
||||
}
|
||||
|
||||
bool InvitationsRfbServer::start()
|
||||
{
|
||||
if(RfbServer::start()) {
|
||||
if(KrfbConfig::publishService())
|
||||
m_publicService->publishAsync();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::stop(bool disconnectClients)
|
||||
{
|
||||
if(m_publicService->isPublished())
|
||||
m_publicService->stop();
|
||||
RfbServer::stop(disconnectClients);
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
|
||||
{
|
||||
m_allowUnattendedAccess = allow;
|
||||
}
|
||||
|
||||
InvitationsRfbServer::InvitationsRfbServer()
|
||||
{
|
||||
m_desktopPassword = readableRandomString(4)+"-"+readableRandomString(3);
|
||||
m_unattendedPassword = readableRandomString(4)+"-"+readableRandomString(3);
|
||||
KSharedConfigPtr config = KGlobal::config();
|
||||
KConfigGroup krfbConfig(config,"Security");
|
||||
m_allowUnattendedAccess = krfbConfig.readEntry(
|
||||
"allowUnattendedAccess", QVariant(false)).toBool();
|
||||
}
|
||||
|
||||
InvitationsRfbServer::~InvitationsRfbServer()
|
||||
{
|
||||
stop();
|
||||
KSharedConfigPtr config = KGlobal::config();
|
||||
KConfigGroup krfbConfig(config,"Security");
|
||||
krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);
|
||||
if(m_wallet && m_wallet->isOpen()) {
|
||||
|
||||
if( (m_wallet->currentFolder()=="krfb") ||
|
||||
((m_wallet->hasFolder("krfb") || m_wallet->createFolder("krfb")) &&
|
||||
m_wallet->setFolder("krfb")) ) {
|
||||
|
||||
m_wallet->writePassword("desktopSharingPassword",m_desktopPassword);
|
||||
m_wallet->writePassword("unattendedAccessPassword",m_unattendedPassword);
|
||||
}
|
||||
|
||||
} else {
|
||||
krfbConfig.writeEntry("desktopPassword",
|
||||
KStringHandler::obscure(m_desktopPassword));
|
||||
krfbConfig.writeEntry("unattendedPassword",
|
||||
KStringHandler::obscure(m_unattendedPassword));
|
||||
krfbConfig.writeEntry("allowUnattendedAccess",
|
||||
m_allowUnattendedAccess);
|
||||
}
|
||||
}
|
||||
|
||||
PendingRfbClient* InvitationsRfbServer::newClient(rfbClientPtr client)
|
||||
@@ -46,26 +148,76 @@ PendingRfbClient* InvitationsRfbServer::newClient(rfbClientPtr client)
|
||||
return new PendingInvitationsRfbClient(client, this);
|
||||
}
|
||||
|
||||
void InvitationsRfbServer::startAndCheck()
|
||||
void InvitationsRfbServer::walletOpened(bool opened)
|
||||
{
|
||||
if (!start()) {
|
||||
KMessageBox::error(0, i18n("Failed to start the krfb server. Invitation-based sharing "
|
||||
"will not work. Try setting another port in the settings and "
|
||||
"restart krfb."));
|
||||
} else {
|
||||
//publish service
|
||||
if (KrfbConfig::publishService()) {
|
||||
DNSSD::PublicService *service = new DNSSD::PublicService(i18n("%1@%2 (shared desktop)",
|
||||
KUser().loginName(),
|
||||
QHostInfo::localHostName()),
|
||||
"_rfb._tcp",
|
||||
listeningPort());
|
||||
service->publishAsync();
|
||||
QString desktopPassword;
|
||||
QString unattendedPassword;
|
||||
Q_ASSERT(m_wallet);
|
||||
if( opened &&
|
||||
( m_wallet->hasFolder("krfb") || m_wallet->createFolder("krfb") ) &&
|
||||
m_wallet->setFolder("krfb") ) {
|
||||
|
||||
if(m_wallet->readPassword("desktopSharingPassword", desktopPassword)==0 &&
|
||||
!desktopPassword.isEmpty()) {
|
||||
m_desktopPassword = desktopPassword;
|
||||
emit passwordChanged(m_desktopPassword);
|
||||
}
|
||||
|
||||
if(m_wallet->readPassword("unattendedAccessPassword", unattendedPassword)==0 &&
|
||||
!unattendedPassword.isEmpty()) {
|
||||
m_unattendedPassword = unattendedPassword;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
kDebug() << "Could not open KWallet, Falling back to config file";
|
||||
KSharedConfigPtr config = KGlobal::config();
|
||||
KConfigGroup krfbConfig(config,"Security");
|
||||
|
||||
desktopPassword = KStringHandler::obscure(krfbConfig.readEntry(
|
||||
"desktopPassword", QString()));
|
||||
if(!desktopPassword.isEmpty()) {
|
||||
m_desktopPassword = desktopPassword;
|
||||
emit passwordChanged(m_desktopPassword);
|
||||
}
|
||||
|
||||
unattendedPassword = KStringHandler::obscure(krfbConfig.readEntry(
|
||||
"unattendedPassword", QString()));
|
||||
if(!unattendedPassword.isEmpty()) {
|
||||
m_unattendedPassword = unattendedPassword;
|
||||
}
|
||||
|
||||
//disconnect when qApp quits
|
||||
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(stop()));
|
||||
}
|
||||
}
|
||||
|
||||
// a random string that doesn't contain i, I, o, O, 1, l, 0
|
||||
// based on KRandom::randomString()
|
||||
QString InvitationsRfbServer::readableRandomString(int length)
|
||||
{
|
||||
QString str;
|
||||
while (length) {
|
||||
int r = KRandom::random() % 62;
|
||||
r += 48;
|
||||
if (r > 57) {
|
||||
r += 7;
|
||||
}
|
||||
if (r > 90) {
|
||||
r += 6;
|
||||
}
|
||||
char c = char(r);
|
||||
if ((c == 'i') ||
|
||||
(c == 'I') ||
|
||||
(c == '1') ||
|
||||
(c == 'l') ||
|
||||
(c == 'o') ||
|
||||
(c == 'O') ||
|
||||
(c == '0')) {
|
||||
continue;
|
||||
}
|
||||
str += c;
|
||||
length--;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
#include "invitationsrfbserver.moc"
|
||||
|
||||
@@ -22,21 +22,51 @@
|
||||
|
||||
#include "rfbserver.h"
|
||||
|
||||
namespace KWallet {
|
||||
class Wallet;
|
||||
}
|
||||
|
||||
namespace DNSSD {
|
||||
class PublicService;
|
||||
}
|
||||
|
||||
class InvitationsRfbServer : public RfbServer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static InvitationsRfbServer *instance;
|
||||
static void init();
|
||||
|
||||
protected:
|
||||
InvitationsRfbServer() : RfbServer(0) {}
|
||||
const QString& desktopPassword() const;
|
||||
void setDesktopPassword(const QString&);
|
||||
const QString& unattendedPassword() const;
|
||||
void setUnattendedPassword(const QString&);
|
||||
bool allowUnattendedAccess() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void passwordChanged(const QString&);
|
||||
|
||||
public Q_SLOTS:
|
||||
bool start();
|
||||
void stop(bool disconnectClients=true);
|
||||
void toggleUnattendedAccess(bool allow=true);
|
||||
|
||||
protected:
|
||||
InvitationsRfbServer();
|
||||
virtual ~InvitationsRfbServer();
|
||||
virtual PendingRfbClient* newClient(rfbClientPtr client);
|
||||
|
||||
private Q_SLOTS:
|
||||
void startAndCheck();
|
||||
void walletOpened(bool);
|
||||
|
||||
private:
|
||||
DNSSD::PublicService *m_publicService;
|
||||
bool m_allowUnattendedAccess;
|
||||
QString m_desktopPassword;
|
||||
QString m_unattendedPassword;
|
||||
KWallet::Wallet *m_wallet;
|
||||
|
||||
QString readableRandomString(int);
|
||||
Q_DISABLE_COPY(InvitationsRfbServer)
|
||||
};
|
||||
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
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 "invitedialog.h"
|
||||
|
||||
#include <KIconLoader>
|
||||
#include <KLocale>
|
||||
#include <KStandardGuiItem>
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QToolTip>
|
||||
|
||||
InviteDialog::InviteDialog(QWidget *parent)
|
||||
: KDialog(parent)
|
||||
{
|
||||
setCaption(i18n("Invitation"));
|
||||
setButtons(User1 | Close | Help);
|
||||
setHelp(QString(), "krfb");
|
||||
setDefaultButton(NoDefault);
|
||||
|
||||
setMinimumSize(500, 300);
|
||||
|
||||
m_inviteWidget = new QWidget(this);
|
||||
setupUi(m_inviteWidget);
|
||||
|
||||
pixmapLabel->setPixmap(KIcon("krfb").pixmap(128));
|
||||
setMainWidget(m_inviteWidget);
|
||||
|
||||
setButtonGuiItem(User1, KStandardGuiItem::configure());
|
||||
|
||||
connect(btnCreateInvite, SIGNAL(clicked()),
|
||||
SIGNAL(createInviteClicked()));
|
||||
connect(btnEmailInvite, SIGNAL(clicked()),
|
||||
SIGNAL(emailInviteClicked()));
|
||||
connect(btnManageInvite, SIGNAL(clicked()),
|
||||
SIGNAL(manageInviteClicked()));
|
||||
connect(helpLabel, SIGNAL(linkActivated(QString)),
|
||||
SLOT(showWhatsthis()));
|
||||
}
|
||||
|
||||
void InviteDialog::slotUser1()
|
||||
{
|
||||
emit configureClicked();
|
||||
}
|
||||
|
||||
void InviteDialog::enableInviteButton(bool enable)
|
||||
{
|
||||
btnCreateInvite->setEnabled(enable);
|
||||
}
|
||||
|
||||
void InviteDialog::setInviteCount(int count)
|
||||
{
|
||||
btnManageInvite->setText(
|
||||
i18n("&Manage Invitations (%1)...", count));
|
||||
}
|
||||
|
||||
void InviteDialog::showWhatsthis()
|
||||
{
|
||||
QToolTip::showText(QCursor::pos(),
|
||||
i18n("An invitation creates a one-time password that allows the receiver to connect to your desktop.\n"
|
||||
"It is valid for only one successful connection and will expire after an hour if it has not been used. \n"
|
||||
"When somebody connects to your computer a dialog will appear and ask you for permission.\n "
|
||||
"The connection will not be established before you accept it. In this dialog you can also\n restrict "
|
||||
"the other person to view your desktop only, without the ability to move your\n mouse pointer or press "
|
||||
"keys.\nIf you want to create a permanent password for Desktop Sharing, allow 'Uninvited Connections' \n"
|
||||
"in the configuration."));
|
||||
}
|
||||
|
||||
#include "invitedialog.moc"
|
||||
@@ -1,57 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
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 INVITEDIALOG_H
|
||||
#define INVITEDIALOG_H
|
||||
|
||||
#include "ui_invitewidget.h"
|
||||
|
||||
#include <KDialog>
|
||||
|
||||
class QWidget;
|
||||
|
||||
class InviteDialog : public KDialog, public Ui::InviteWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
InviteDialog(QWidget *parent);
|
||||
~InviteDialog() {}
|
||||
|
||||
void enableInviteButton(bool enable);
|
||||
|
||||
public Q_SLOTS:
|
||||
void setInviteCount(int count);
|
||||
void showWhatsthis();
|
||||
|
||||
signals:
|
||||
void createInviteClicked();
|
||||
void emailInviteClicked();
|
||||
void manageInviteClicked();
|
||||
void configureClicked();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void slotUser1();
|
||||
|
||||
protected:
|
||||
QWidget *m_inviteWidget;
|
||||
};
|
||||
|
||||
#endif // INVITEDIALOG_H
|
||||
|
||||
@@ -4,34 +4,42 @@ X-KDE-ServiceType=krfb/framebuffer
|
||||
|
||||
Comment=Frame Buffer plugins for KRfb
|
||||
Comment[ast]=Complementu de buffer pa KRfb
|
||||
Comment[bg]=Приставки за фреймбуфер за KRfb
|
||||
Comment[bs]=Priključci framebafera za KRfb
|
||||
Comment[ca]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[ca@valencia]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[cs]=Moduly Frame bufferu pro KRfb
|
||||
Comment[da]=Framebuffer-plugins til KRfb
|
||||
Comment[de]=Framebuffer-Module für KRfb
|
||||
Comment[el]=Πρόσθετα μνήμης εξόδου βίντεο καρέ για το KRfb
|
||||
Comment[en_GB]=Frame Buffer plugins for KRfb
|
||||
Comment[es]=Complementos de memoria intermedia de vídeo para KRfb
|
||||
Comment[et]=KRfb kaadripuhvri plugin
|
||||
Comment[eu]=Irteerako bideoaren pluginak KRfb-rentzako
|
||||
Comment[fi]=Kehyspuskuriliitännäinen kohteelle KRfb
|
||||
Comment[fr]=Modules de sortie vidéo pour KRfb
|
||||
Comment[fr]=Modules externes de sortie vidéo pour Krfb
|
||||
Comment[ga]=Breiseáin Mhaoláin Fráma le haghaidh KRfb
|
||||
Comment[gl]=Engadido de frame buffer para KRfb
|
||||
Comment[hr]=Priključci za međuspremnike okvira za KRfb
|
||||
Comment[hu]=Framebuffer bővítmények a Krfb-hez
|
||||
Comment[ia]=Plug-ins de Frame Buffer per KRfb
|
||||
Comment[it]=Estensioni del framebuffer per KRfb
|
||||
Comment[ja]=KRfb の フレームバッファプラグイン
|
||||
Comment[kk]=KRfb кадр буфер плагині
|
||||
Comment[km]=កម្មវិធីជំនួយ Frame Buffer សម្រាប់ KRfb
|
||||
Comment[ko]=KRfb 프레임버퍼 플러그인
|
||||
Comment[lt]=Frame Buffer priedai skirti KRfb
|
||||
Comment[lv]=Kadru bufera sprudņi priekš KRfb
|
||||
Comment[nb]=Rammebuffer-programtillegg for KRfb
|
||||
Comment[nds]=Bildpuffer-Modulen för KRfb
|
||||
Comment[nl]=Framebuffer-plugins voor KRfb
|
||||
Comment[nn]=Framebuffer-tillegg KRfb
|
||||
Comment[pa]=KRfb ਲਈ ਫਰੇਮ ਬਫ਼ਰ ਪਲੱਗਇਨ
|
||||
Comment[pl]=Wtyczki buforów ramek dla KRfb
|
||||
Comment[pt]='Plugins' de 'framebuffers' para o KRfb
|
||||
Comment[pt_BR]=Plug-ins de framebuffers para o KRfb
|
||||
Comment[pt_BR]=Plugins de framebuffers para o KRfb
|
||||
Comment[ru]=Модуль буфера кадров для KRfb
|
||||
Comment[si]=KRfb සඳහා රාමු බෆර ප්ලගින
|
||||
Comment[sk]=Frame Buffer modul pre KRfb
|
||||
Comment[sl]=Vstavki slikovnih medpomnilnikov za KRFB
|
||||
Comment[sr]=Прикључци кадробафера за КРФБ
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# KDE Config File
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=krfb -caption "%c" %i
|
||||
Exec=krfb -caption %c %i
|
||||
Icon=krfb
|
||||
X-DBUS-StartupType=Unique
|
||||
X-DocPath=krfb/index.html
|
||||
Terminal=false
|
||||
Name=Krfb
|
||||
@@ -42,6 +43,7 @@ Name[ko]=Krfb
|
||||
Name[lt]=Krfb
|
||||
Name[lv]=Krfb
|
||||
Name[ml]=കെആര്എഫ്ബി
|
||||
Name[mr]=के-आर-एफ-बी
|
||||
Name[nb]=Krfb
|
||||
Name[nds]=KRfb
|
||||
Name[ne]=Krfb
|
||||
@@ -53,6 +55,7 @@ Name[pt]=Krfb
|
||||
Name[pt_BR]=Krfb
|
||||
Name[ro]=Krfb
|
||||
Name[ru]=Krfb
|
||||
Name[si]=Krfb
|
||||
Name[sk]=Krfb
|
||||
Name[sl]=Krfb
|
||||
Name[sq]=Krfb
|
||||
@@ -62,6 +65,7 @@ Name[sr@ijekavianlatin]=KRFB
|
||||
Name[sr@latin]=KRFB
|
||||
Name[sv]=Krfb
|
||||
Name[tr]=Krfb
|
||||
Name[ug]=Krfb
|
||||
Name[uk]=Krfb
|
||||
Name[uz]=Krfb
|
||||
Name[uz@cyrillic]=Krfb
|
||||
@@ -73,7 +77,7 @@ Name[zh_TW]=桌面分享_Krfb
|
||||
GenericName=Desktop Sharing
|
||||
GenericName[ar]=مشاركة سطح المكتب
|
||||
GenericName[ast]=Escritoriu compartíu
|
||||
GenericName[bg]=Споделяне на работното място
|
||||
GenericName[bg]=Споделяне на работния плот
|
||||
GenericName[bn]=ডেস্কটপ ভাগাভাগি
|
||||
GenericName[br]=Rannañ ar vurev
|
||||
GenericName[bs]=Dijeljenje radne površine
|
||||
@@ -81,7 +85,7 @@ GenericName[ca]=Compartició de l'escriptori
|
||||
GenericName[ca@valencia]=Compartició de l'escriptori
|
||||
GenericName[cs]=Sdílení pracovní plochy
|
||||
GenericName[cy]=Rhannu Penbwrdd
|
||||
GenericName[da]=Desktopdeling
|
||||
GenericName[da]=Skrivebordsdeling
|
||||
GenericName[de]=Arbeitsfläche freigeben
|
||||
GenericName[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
GenericName[en_GB]=Desktop Sharing
|
||||
@@ -91,7 +95,7 @@ GenericName[et]=Töölaua jagamine
|
||||
GenericName[eu]=Mahaigaina partekatzea
|
||||
GenericName[fa]=اشتراک رومیزی
|
||||
GenericName[fi]=Työpöydän jakaminen
|
||||
GenericName[fr]=Partage de bureau
|
||||
GenericName[fr]=Partage de bureaux
|
||||
GenericName[ga]=Roinnt Deisce
|
||||
GenericName[gl]=Compartimento de escritorio
|
||||
GenericName[he]=שיתוף שולחנות עבודה
|
||||
@@ -109,6 +113,7 @@ GenericName[ko]=데스크톱 공유
|
||||
GenericName[lt]=Dalinimasis darbastaliu
|
||||
GenericName[lv]=Darbvirsmas koplietošana
|
||||
GenericName[ml]=പണിയിടം പങ്കുവെക്കല്
|
||||
GenericName[mr]=डेस्कटॉप शेअरींग
|
||||
GenericName[nb]=Delte skrivebord
|
||||
GenericName[nds]=Schriefdisch-Freegaav
|
||||
GenericName[ne]=डेस्कटप साझेदारी
|
||||
@@ -120,8 +125,9 @@ GenericName[pt]=Partilha do Ecrã
|
||||
GenericName[pt_BR]=Compartilhamento de ambiente de trabalho
|
||||
GenericName[ro]=Partajare birou
|
||||
GenericName[ru]=Общий рабочий стол
|
||||
GenericName[si]=වැඩතල හවුල්
|
||||
GenericName[sk]=Zdieľanie pracovnej plochy
|
||||
GenericName[sl]=Deljenje namizja
|
||||
GenericName[sl]=Souporaba namizja
|
||||
GenericName[sr]=Дељење површи
|
||||
GenericName[sr@ijekavian]=Дијељење површи
|
||||
GenericName[sr@ijekavianlatin]=Dijeljenje površi
|
||||
@@ -129,6 +135,7 @@ GenericName[sr@latin]=Deljenje površi
|
||||
GenericName[sv]=Dela ut skrivbordet
|
||||
GenericName[th]=ใช้งานพื้นที่ทำงานร่วมกัน
|
||||
GenericName[tr]=Masaüstü Paylaşımı
|
||||
GenericName[ug]=ئۈستەلئۈستىنى ھەمبەھىرلەش
|
||||
GenericName[uk]=Спільні стільниці
|
||||
GenericName[uz]=Ish stoli bilan boʻlishish
|
||||
GenericName[uz@cyrillic]=Иш столи билан бўлишиш
|
||||
|
||||
@@ -22,15 +22,14 @@
|
||||
<label>Allow remote connections to manage the desktop.</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="askOnConnect" type="Bool">
|
||||
<label>Ask before allowing a remote connection.</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="allowUninvitedConnections" type="Bool">
|
||||
<entry name="allowUnattendedAccess" type="Bool">
|
||||
<label>Allow connections without an invitation.</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="uninvitedConnectionPassword" type="String">
|
||||
<entry name="unattendedAccessPassword" type="String">
|
||||
<label>Password for uninvited connections.</label>
|
||||
</entry>
|
||||
<entry name="desktopSharingPassword" type="String">
|
||||
<label>Password for uninvited connections.</label>
|
||||
</entry>
|
||||
</group>
|
||||
|
||||
@@ -4,6 +4,7 @@ Comment=Desktop Sharing
|
||||
Comment[af]=Werkskerm Deeling
|
||||
Comment[ar]=مشاركة سطح المكتب
|
||||
Comment[ast]=Escritoriu compartíu
|
||||
Comment[bg]=Споделяне на работния плот
|
||||
Comment[bn]=ডেস্কটপ ভাগাভাগি
|
||||
Comment[br]=Rannañ ar vurev
|
||||
Comment[bs]=Dijeljenje radne površine
|
||||
@@ -11,7 +12,7 @@ Comment[ca]=Compartició de l'escriptori
|
||||
Comment[ca@valencia]=Compartició de l'escriptori
|
||||
Comment[cs]=Sdílení pracovní plochy
|
||||
Comment[cy]=Rhannu Penbwrdd
|
||||
Comment[da]=Desktopdeling
|
||||
Comment[da]=Skrivebordsdeling
|
||||
Comment[de]=Arbeitsflächen-Freigabe
|
||||
Comment[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
Comment[en_GB]=Desktop Sharing
|
||||
@@ -20,7 +21,7 @@ Comment[es]=Escritorio compartido
|
||||
Comment[et]=Töölaua jagamine
|
||||
Comment[eu]=Mahaigaina partekatzea
|
||||
Comment[fi]=Työpöydän jakaminen
|
||||
Comment[fr]=Partage du bureau
|
||||
Comment[fr]=Partage de bureaux
|
||||
Comment[ga]=Roinnt Deisce
|
||||
Comment[gl]=Compartición do escritorio
|
||||
Comment[he]=שיתוף שולחנות עבודה
|
||||
@@ -39,6 +40,7 @@ Comment[lt]=Dalinimasis darbastaliu
|
||||
Comment[lv]=Darbvirsmas koplietošana
|
||||
Comment[mk]=Делење на работната површина
|
||||
Comment[ml]=പണിയിടം പങ്കുവെക്കല്
|
||||
Comment[mr]=डेस्कटॉप शेअरींग
|
||||
Comment[ms]=Perkongsian Ruang Kerja
|
||||
Comment[nb]=Delte skrivebord
|
||||
Comment[nds]=Schriefdisch-Freegaav
|
||||
@@ -50,8 +52,9 @@ Comment[pt]=Partilha do Ecrã
|
||||
Comment[pt_BR]=Compartilhamento do ambiente de trabalho
|
||||
Comment[ro]=Partajare birou
|
||||
Comment[ru]=Параметры общего рабочего стола
|
||||
Comment[si]=වැඩතල හවුල්
|
||||
Comment[sk]=Zdieľanie pracovnej plochy
|
||||
Comment[sl]=Deljenje namizja
|
||||
Comment[sl]=Souporaba namizja
|
||||
Comment[sr]=Дељење површи
|
||||
Comment[sr@ijekavian]=Дијељење површи
|
||||
Comment[sr@ijekavianlatin]=Dijeljenje površi
|
||||
@@ -61,6 +64,7 @@ Comment[ta]=பணிமேடை பகிர்வு
|
||||
Comment[tg]=Истифодаи Муштараки Мизи Корӣ
|
||||
Comment[th]=ใช้งานพื้นที่ทำงานร่วมกัน
|
||||
Comment[tr]=Masaüstü Paylaşımı
|
||||
Comment[ug]=ئۈستەلئۈستىنى ھەمبەھىرلەش
|
||||
Comment[uk]=Спільні стільниці
|
||||
Comment[xh]=Ulwahlulelano lwe Desktop
|
||||
Comment[x-test]=xxDesktop Sharingxx
|
||||
@@ -72,6 +76,7 @@ Comment[zh_TW]=桌面分享
|
||||
Name=User Accepts Connection
|
||||
Name[ar]=المستخدم يقبل الاتصال
|
||||
Name[ast]=L'usuariu aceuta la conexón
|
||||
Name[bg]=Потребителят приема връзката
|
||||
Name[bs]=Korisnik prihvata vezu
|
||||
Name[ca]=L'usuari accepta la connexió
|
||||
Name[ca@valencia]=L'usuari accepta la connexió
|
||||
@@ -102,6 +107,7 @@ Name[ko]=사용자가 연결을 수락함
|
||||
Name[lt]=Naudotojas priėmė kvietimą
|
||||
Name[lv]=Lietotājs atļauj savienojumu
|
||||
Name[ml]=ഉപയോക്താവ് ബന്ധം സ്വീകരിക്കുന്നു
|
||||
Name[mr]=वापरकर्ता जुळवणी स्वीकारतो
|
||||
Name[nb]=Bruker godtar tilkobling
|
||||
Name[nds]=Bruker lett tokoppeln to
|
||||
Name[nl]=Gebruiker accepteert de verbinding
|
||||
@@ -112,8 +118,9 @@ Name[pt]=O Utilizador Aceita a Ligação
|
||||
Name[pt_BR]=O usuário aceita a conexão
|
||||
Name[ro]=Utilizatorul acceptă conexiunea
|
||||
Name[ru]=Пользователь принимает соединения
|
||||
Name[si]=සබැඳිය පරිශීලකයා තහවුරු කරයි
|
||||
Name[sk]=Užívateľ akceptuje pripojenie
|
||||
Name[sl]=Uporabnik sprejel povezavo
|
||||
Name[sl]=Uporabnik sprejema povezavo
|
||||
Name[sr]=Корисник прихвата везу
|
||||
Name[sr@ijekavian]=Корисник прихвата везу
|
||||
Name[sr@ijekavianlatin]=Korisnik prihvata vezu
|
||||
@@ -121,6 +128,7 @@ Name[sr@latin]=Korisnik prihvata vezu
|
||||
Name[sv]=Användaren accepterar anslutning
|
||||
Name[th]=ผู้ใช้ยอมรับการเชื่อมต่อ
|
||||
Name[tr]=Kullanıcı Bağlantıyı Kabul Etti
|
||||
Name[ug]=ئىشلەتكۈچى باغلىنىشقا قوشۇلدى
|
||||
Name[uk]=Користувач приймає з’єднання
|
||||
Name[x-test]=xxUser Accepts Connectionxx
|
||||
Name[zh_CN]=用户接受连接
|
||||
@@ -129,6 +137,7 @@ Comment=User accepts connection
|
||||
Comment[af]=Gebruiker aanvaar verbinding
|
||||
Comment[ar]=المستخدم يقبل الاتصال
|
||||
Comment[ast]=L'usuariu aceuta la conexón
|
||||
Comment[bg]=Потребителят приема връзката
|
||||
Comment[bn]=ব্যবহারকারী সংযোগ গ্রহণ করে
|
||||
Comment[bs]=Korisnik prihvata vezu
|
||||
Comment[ca]=L'usuari accepta la connexió
|
||||
@@ -163,6 +172,7 @@ Comment[lt]=Naudotojas priėmė kvietimą
|
||||
Comment[lv]=Lietotājs atļauj savienojumu
|
||||
Comment[mk]=Корисникот прифаќа поврзување
|
||||
Comment[ml]=ഉപയോക്താവ് ബന്ധം സ്വീകരിക്കുന്നു
|
||||
Comment[mr]=वापरकर्ता जुळवणी स्वीकारतो
|
||||
Comment[ms]= Pengguna menerima sambungan
|
||||
Comment[nb]=Bruker godtar tilkobling
|
||||
Comment[nds]=Bruker nimmt Tokoppelanfraag an
|
||||
@@ -174,8 +184,9 @@ 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[si]=සබැඳිය පරිශීලකයා තහවුරු කරයි
|
||||
Comment[sk]=Užívateľ akceptuje pripojenie
|
||||
Comment[sl]=Uporabnik sprejel povezavo
|
||||
Comment[sl]=Uporabnik sprejema povezavo
|
||||
Comment[sr]=Корисник прихвата везу
|
||||
Comment[sr@ijekavian]=Корисник прихвата везу
|
||||
Comment[sr@ijekavianlatin]=Korisnik prihvata vezu
|
||||
@@ -185,6 +196,7 @@ Comment[ta]=பயனர் இணைப்பு ஏற்றுக்கொள
|
||||
Comment[tg]=Корванд пайвастшавиро қабул мекунад
|
||||
Comment[th]=ผู้ใช้ยอมรับการเชื่อมต่อ
|
||||
Comment[tr]=Kullanıcı bağlantıyı kabul etti
|
||||
Comment[ug]=ئىشلەتكۈچى باغلىنىشقا قوشۇلدى
|
||||
Comment[uk]=Користувач приймає з’єднання
|
||||
Comment[xh]=Umsebenzisi wamkela uxhulumaniso
|
||||
Comment[x-test]=xxUser accepts connectionxx
|
||||
@@ -197,6 +209,7 @@ Action=Popup
|
||||
Name=User Refuses Connection
|
||||
Name[ar]=المستخدم يرفض الاتصال
|
||||
Name[ast]=L'usuariu refuga la conexón
|
||||
Name[bg]=Потребителят отказва връзката
|
||||
Name[bs]=Korisnik odbija vezu
|
||||
Name[ca]=L'usuari refusa la connexió
|
||||
Name[ca@valencia]=L'usuari refusa la connexió
|
||||
@@ -227,6 +240,7 @@ Name[ko]=사용자가 연결을 거부함
|
||||
Name[lt]=Naudotojas atmetė kvietimą
|
||||
Name[lv]=Lietotājs noraida savienojumu
|
||||
Name[ml]=ഉപയോക്താവ് ബന്ധം തിരസ്കരിക്കുന്നു
|
||||
Name[mr]=वापरकर्ता जुळवणी अस्वीकारतो
|
||||
Name[nb]=Bruker nekter tilkobling
|
||||
Name[nds]=Bruker wiest tokoppeln af
|
||||
Name[nl]=Gebruiker weigert de verbinding
|
||||
@@ -237,8 +251,9 @@ Name[pt]=O Utilizador Recusa a Ligação
|
||||
Name[pt_BR]=O usuário rejeita a conexão
|
||||
Name[ro]=Utilizatorul refuză conexiunea
|
||||
Name[ru]=Пользователь отклоняет соединения
|
||||
Name[si]=සබැඳිය පරිශීලකයා තහවුරු නොකරයි
|
||||
Name[sk]=Užívateľ odmieta pripojenie
|
||||
Name[sl]=Uporabnik zavrnil povezavo
|
||||
Name[sl]=Uporabnik zavrača povezavo
|
||||
Name[sr]=Корисник одбија везу
|
||||
Name[sr@ijekavian]=Корисник одбија везу
|
||||
Name[sr@ijekavianlatin]=Korisnik odbija vezu
|
||||
@@ -246,6 +261,7 @@ Name[sr@latin]=Korisnik odbija vezu
|
||||
Name[sv]=Användaren vägrar anslutning
|
||||
Name[th]=ผู้ใช้ปฏิเสธการเชื่อมต่อ
|
||||
Name[tr]=Kullanıcı Bağlantıyı Reddetti
|
||||
Name[ug]=ئىشلەتكۈچى باغلىنىشنى رەت قىلدى
|
||||
Name[uk]=Користувач не приймає з’єднання
|
||||
Name[x-test]=xxUser Refuses Connectionxx
|
||||
Name[zh_CN]=用户拒绝连接
|
||||
@@ -254,6 +270,7 @@ Comment=User refuses connection
|
||||
Comment[af]=Gebruiker weier verbinding
|
||||
Comment[ar]=المستخدم يرفض الاتصال
|
||||
Comment[ast]=L'usuariu refuga la conexón
|
||||
Comment[bg]=Потребителят отказва връзката
|
||||
Comment[bn]=ব্যবহারকারী সংযোগ অস্বীকার করে
|
||||
Comment[bs]=Korisnik odbija vezu
|
||||
Comment[ca]=L'usuari refusa la connexió
|
||||
@@ -271,7 +288,7 @@ Comment[eu]=Erabiltzaileak konexioa ukatu du
|
||||
Comment[fi]=Käyttäjä hylkää yhteyden
|
||||
Comment[fr]=L'utilisateur refuse la connexion
|
||||
Comment[ga]=Diúltaíonn úsáideoir ceangal
|
||||
Comment[gl]=O usuario non acepta a conexión
|
||||
Comment[gl]=O usuario rexeita a conexión
|
||||
Comment[he]=המשתמש מסרב לחיבור
|
||||
Comment[hi]=उपयोक्ता ने कनेक्शन अस्वीकारा
|
||||
Comment[hne]=कमइया हर कनेक्सन अस्वीकारा
|
||||
@@ -288,6 +305,7 @@ Comment[lt]=Naudotojas atmetė kvietimą
|
||||
Comment[lv]=Lietotājs noraida savienojumu
|
||||
Comment[mk]=Корисникот одбива поврзување
|
||||
Comment[ml]=ഉപയോക്താവ് ബന്ധം തിരസ്കരിക്കുന്നു
|
||||
Comment[mr]=वापरकर्ता जुळवणी अस्वीकारतो
|
||||
Comment[ms]=Pengguna menolak sambungan
|
||||
Comment[nb]=Bruker nekter tilkobling
|
||||
Comment[nds]=Bruker wiest Tokoppelanfraag af
|
||||
@@ -299,8 +317,9 @@ 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[si]=සබැඳිය පරිශීලකයා තහවුරු නොකරයි
|
||||
Comment[sk]=Užívateľ odmieta pripojenie
|
||||
Comment[sl]=Uporabnik zavrnil povezavo
|
||||
Comment[sl]=Uporabnik zavrača povezavo
|
||||
Comment[sr]=Корисник одбија везу
|
||||
Comment[sr@ijekavian]=Корисник одбија везу
|
||||
Comment[sr@ijekavianlatin]=Korisnik odbija vezu
|
||||
@@ -310,6 +329,7 @@ Comment[ta]=பயனர் இணைப்பு ஏற்க மறுக்
|
||||
Comment[tg]=Корванд пайвастшавиро рад мекунад
|
||||
Comment[th]=ผู้ใช้ปฏิเสธการเชื่อมต่อ
|
||||
Comment[tr]=Kullanıcı bağlantıyı reddetti
|
||||
Comment[ug]=ئىشلەتكۈچى باغلىنىشنى رەت قىلدى
|
||||
Comment[uk]=Користувач не приймає з’єднання
|
||||
Comment[xh]=Umsebenzisi wala uxhulumaniso
|
||||
Comment[x-test]=xxUser refuses connectionxx
|
||||
@@ -322,6 +342,7 @@ Action=Popup
|
||||
Name=Connection Closed
|
||||
Name[ar]=الاتصال أغلق
|
||||
Name[ast]=Conexón zarrada
|
||||
Name[bg]=Връзката е прекъсната
|
||||
Name[bs]=Konekcija zatvorena
|
||||
Name[ca]=Connexió tancada
|
||||
Name[ca@valencia]=Connexió tancada
|
||||
@@ -353,6 +374,7 @@ Name[lt]=Ryšys baigtas
|
||||
Name[lv]=Savienojums slēgts
|
||||
Name[mai]=संबंधन बन्न भ' गेल
|
||||
Name[ml]=ബന്ധം അടച്ചു
|
||||
Name[mr]=जुळवणी बंद केली
|
||||
Name[nb]=Forbindelsen lukket
|
||||
Name[nds]=Afkoppelt
|
||||
Name[nl]=Verbinding gesloten
|
||||
@@ -363,6 +385,7 @@ Name[pt]=Ligação Fechada
|
||||
Name[pt_BR]=Conexão encerrada
|
||||
Name[ro]=Conexiune închisă
|
||||
Name[ru]=Соединение закрыто
|
||||
Name[si]=සබඳතාව වසා දැමිනි
|
||||
Name[sk]=Pripojenie bolo ukončené
|
||||
Name[sl]=Povezava zaprta
|
||||
Name[sq]=Lidhja u Mbyll
|
||||
@@ -373,6 +396,7 @@ Name[sr@latin]=Veza zatvorena
|
||||
Name[sv]=Anslutning stängd
|
||||
Name[th]=การเชื่อมต่อยุติ
|
||||
Name[tr]=Bağlantı Kapatıldı
|
||||
Name[ug]=باغلىنىش يېپىلدى
|
||||
Name[uk]=З'єднання закрито
|
||||
Name[x-test]=xxConnection Closedxx
|
||||
Name[zh_CN]=连接关闭
|
||||
@@ -381,6 +405,7 @@ Comment=Connection closed
|
||||
Comment[af]=Verbinding gesluit
|
||||
Comment[ar]=تمّ غلق الاتصال
|
||||
Comment[ast]=Conexón zarrada
|
||||
Comment[bg]=Връзката е прекъсната
|
||||
Comment[bn]=সংযোগ বন্ধ করা হল
|
||||
Comment[br]=Serret eo ar gevreadenn
|
||||
Comment[bs]=Veza je zatvorena
|
||||
@@ -397,7 +422,7 @@ Comment[es]=Conexión cerrada
|
||||
Comment[et]=Ühendus suletud
|
||||
Comment[eu]=Konexioa itxi da
|
||||
Comment[fi]=Yhteys suljettu
|
||||
Comment[fr]=Connexion coupée
|
||||
Comment[fr]=Connexion fermée
|
||||
Comment[ga]=Ceangal dúnta
|
||||
Comment[gl]=A conexión está fechada
|
||||
Comment[he]=החיבור נסגר
|
||||
@@ -409,17 +434,18 @@ Comment[ia]=Connexion claudite
|
||||
Comment[is]=Tengingu lokað
|
||||
Comment[it]=Connessione chiusa
|
||||
Comment[ja]=接続が閉じられました
|
||||
Comment[kk]=Қосылымдан жабылды
|
||||
Comment[kk]=Қосылым жабылды
|
||||
Comment[km]=បានបិទការតភ្ជាប់
|
||||
Comment[ko]=연결이 닫힘
|
||||
Comment[lt]=Ryšys baigtas
|
||||
Comment[lv]=Savienojums tika slēgts
|
||||
Comment[mk]=Поврзувањето е затворено
|
||||
Comment[ml]=ബന്ധം അടച്ചു
|
||||
Comment[mr]=जुळवणी बंद केली
|
||||
Comment[ms]=Sambungan ditutup
|
||||
Comment[nb]=Forbindelsen lukket
|
||||
Comment[nds]=Afkoppelt
|
||||
Comment[nl]=Verbinding verbroken
|
||||
Comment[nl]=Verbinding gesloten
|
||||
Comment[nn]=Tilkoplinga vart avslutta
|
||||
Comment[pa]=ਕੁਨੈਕਸ਼ਨ ਬੰਦ ਕੀਤਾ
|
||||
Comment[pl]=Połączenie zakończone
|
||||
@@ -427,6 +453,7 @@ Comment[pt]=A ligação foi encerrada
|
||||
Comment[pt_BR]=Conexão encerrada
|
||||
Comment[ro]=Conexiune închisă
|
||||
Comment[ru]=Соединение закрыто
|
||||
Comment[si]=සබඳතාව වසාදැමිනි
|
||||
Comment[sk]=Pripojenie bolo ukončené
|
||||
Comment[sl]=Povezava zaprta
|
||||
Comment[sq]=Lidhja u mbyll
|
||||
@@ -454,6 +481,7 @@ Action=Popup
|
||||
Name=Invalid Password
|
||||
Name[ar]=كلمة المرور غير صحيحة
|
||||
Name[ast]=Contraseña incorreuta
|
||||
Name[bg]=Неправилна парола
|
||||
Name[bs]=Neispravna šifra
|
||||
Name[ca]=Contrasenya no vàlida
|
||||
Name[ca@valencia]=Contrasenya no vàlida
|
||||
@@ -484,6 +512,7 @@ Name[ko]=잘못된 암호
|
||||
Name[lt]=Neteisingas slaptažodžis
|
||||
Name[lv]=Nederīga parole
|
||||
Name[ml]=അസാധുവായ അടയാളവാക്ക്
|
||||
Name[mr]=अवैध गुप्तशब्द
|
||||
Name[nb]=Ugyldig passord
|
||||
Name[nds]=Leeg Passwoort
|
||||
Name[nl]=Ongeldig wachtwoord
|
||||
@@ -494,6 +523,7 @@ Name[pt]=Senha Inválida
|
||||
Name[pt_BR]=Senha inválida
|
||||
Name[ro]=Parolă nevalidă
|
||||
Name[ru]=Неверный пароль
|
||||
Name[si]=වැරදි මුරපදය
|
||||
Name[sk]=Neplatné heslo
|
||||
Name[sl]=Neveljavno geslo
|
||||
Name[sq]=Fjalëkalim i Pavlefshëm
|
||||
@@ -514,6 +544,7 @@ Comment=Invalid password
|
||||
Comment[af]=Ongeldige wagwoord
|
||||
Comment[ar]=كلمة المرور غير صحيحة
|
||||
Comment[ast]=Contraseña incorreuta
|
||||
Comment[bg]=Неправилна парола
|
||||
Comment[bn]=অবৈধ পাসওয়ার্ড
|
||||
Comment[br]=Tremenger siek
|
||||
Comment[bs]=Neispravna šifra
|
||||
@@ -550,6 +581,7 @@ Comment[lv]=Parole nav derīga
|
||||
Comment[mai]=अवैध कूटशब्द
|
||||
Comment[mk]=Невалидна лозинка
|
||||
Comment[ml]=അസാധുവായ അടയാളവാക്ക്
|
||||
Comment[mr]=अवैध गुप्तशब्द
|
||||
Comment[ms]=Kata laluan tidak sah
|
||||
Comment[nb]=Ugyldig passord
|
||||
Comment[nds]=Leeg Passwoort
|
||||
@@ -562,6 +594,7 @@ Comment[pt]=A senha é inválida
|
||||
Comment[pt_BR]=Senha inválida
|
||||
Comment[ro]=Parolă nevalidă
|
||||
Comment[ru]=Неверный пароль
|
||||
Comment[si]=වැරදි මුරපදය
|
||||
Comment[sk]=Neplatné heslo
|
||||
Comment[sl]=Neveljavno geslo
|
||||
Comment[sq]=Fjalëkalim i pavlefshëm
|
||||
@@ -590,6 +623,7 @@ Action=Popup
|
||||
Name=Invalid Password Invitations
|
||||
Name[ar]=كلمة المرور الدعوات غير صحيحة
|
||||
Name[ast]=Contraseñas d'invitaciones incorreutes
|
||||
Name[bg]=Неправилна парола за покана
|
||||
Name[bs]=Neispravna šifra pozivnice
|
||||
Name[ca]=Contrasenya de les invitacions no vàlides
|
||||
Name[ca@valencia]=Contrasenya de les invitacions no vàlides
|
||||
@@ -601,9 +635,9 @@ Name[en_GB]=Invalid Password Invitations
|
||||
Name[eo]=Nevalidaj pasvortaj invitoj
|
||||
Name[es]=Contraseñas de invitaciones incorrectas
|
||||
Name[et]=Kutsutu vale parool
|
||||
Name[eu]=Baliogabeko pasahitz gonbidapena
|
||||
Name[eu]=Gonbitearen pasahitza baliogabea
|
||||
Name[fi]=Virheellinen salasana kutsuun
|
||||
Name[fr]=Invitations de mot de passe non valables
|
||||
Name[fr]=Invitations de mots de passe non valables
|
||||
Name[ga]=Cuirí Neamhbhailí Focal Faire
|
||||
Name[gl]=O contrasinal de convidado non válido
|
||||
Name[hi]=अवैध पासवर्ड निमंत्रण
|
||||
@@ -620,6 +654,7 @@ Name[ko]=잘못된 암호 초대장
|
||||
Name[lt]=Neteisingas kvietimo slaptažodis
|
||||
Name[lv]=Nepareiza parole ar ielūgumu
|
||||
Name[ml]=അസാധുവായ അടയാളവാക്ക് ക്ഷണങ്ങള്
|
||||
Name[mr]=अवैध गुप्तशब्द निमंत्रण
|
||||
Name[nb]=Ugyldig invitasjonspassord
|
||||
Name[nds]=Leeg Passwoort bi Inladen
|
||||
Name[nl]=Ongeldig wachtwoord uitnodiging
|
||||
@@ -630,6 +665,7 @@ Name[pt]=Convites de Senha Inválidos
|
||||
Name[pt_BR]=Avisos de senha inválida
|
||||
Name[ro]=Parolă nevalidă Invitații
|
||||
Name[ru]=Неверный пароль приглашения
|
||||
Name[si]=වැරදි මුරපද ආරාධනාවක්
|
||||
Name[sk]=Neplatné heslo pozvánky
|
||||
Name[sl]=Povabila z neveljavnimi gesli
|
||||
Name[sr]=Неисправна лозинка позивнице
|
||||
@@ -639,6 +675,7 @@ Name[sr@latin]=Neispravna lozinka pozivnice
|
||||
Name[sv]=Ogiltigt lösenord vid inbjudan
|
||||
Name[th]=รหัสผ่านของการเชื้อเชิญไม่ถูกต้อง
|
||||
Name[tr]=Geçersiz Parola Daveti
|
||||
Name[ug]=ئىناۋەتسىز ئىم تەكلىپلىرى
|
||||
Name[uk]=Запрошення з некоректними паролями
|
||||
Name[x-test]=xxInvalid Password Invitationsxx
|
||||
Name[zh_CN]=无效密码邀请
|
||||
@@ -647,6 +684,7 @@ Comment=The invited party sent an invalid password. Connection refused.
|
||||
Comment[af]=Die uitgenooi party gestuur 'n ongeldige wagwoord. Verbinding geweier.
|
||||
Comment[ar]=المدعو أرسل كلمة مرور غير صحيحة. رفض الإتصال.
|
||||
Comment[ast]=L'invitáu unvió una contraseña incorreuta. Conexón refugada.
|
||||
Comment[bg]=Поканената страна изпрати неправилна парола. Връзката е отказана.
|
||||
Comment[bn]=আমন্ত্রিত দল একটি অবৈধ পাসওয়ার্ড পাঠাল। সংযোগ অস্বীকার করা হল।
|
||||
Comment[bs]=Pozvana strana je poslala pogrešnu šifru. Veza je odbijena.
|
||||
Comment[ca]=La part invitada ha enviat una contrasenya no vàlida. Connexió refusada.
|
||||
@@ -660,7 +698,7 @@ Comment[en_GB]=The invited party sent an invalid password. Connection refused.
|
||||
Comment[eo]=La invitita kliento sendis nevalidan pasvorton. Konekto rifuzita.
|
||||
Comment[es]=El invitado envió una contraseña incorrecta. Conexión rechazada.
|
||||
Comment[et]=Kutsutu saatis vigase parooli. Ühendusest keelduti.
|
||||
Comment[eu]=Gonbidatutako parekoak baliogabeko pasahitza bidali du. Konexioa ukatu da.
|
||||
Comment[eu]=Gonbidatutako parekoak baliogabeko pasahitza bidali du. Konexioa ukatuta.
|
||||
Comment[fi]=Kutsuttu taho lähetti virheellisen salasanan. Yhteys hylättiin.
|
||||
Comment[fr]=La partie invitée a envoyé un mot de passe non valable. Connexion refusée.
|
||||
Comment[ga]=Sheol an duine le cuireadh focal faire neamhbhailí. Diúltaíodh an ceangal.
|
||||
@@ -691,6 +729,7 @@ Comment[pt]=O utilizador convidado enviou uma senha inválida. A ligação foi r
|
||||
Comment[pt_BR]=A parte "convidada" enviou uma senha inválida. Conexão recusada.
|
||||
Comment[ro]=Partea care invită a trimis o parolă nevalidă. Conexiune refuzată.
|
||||
Comment[ru]=Приглашённый пользователь ввёл неправильный пароль. Соединение отклонено.
|
||||
Comment[si]=ආරාධිත පාර්ශවය වැරදි මුරපදයක් එවන ලද බැවින් සබඳතාව ප්රතික්ෂේප විය.
|
||||
Comment[sk]=Pozvaná strana poslala neplatné heslo. Pripojenie bolo odmietnuté.
|
||||
Comment[sl]=Povabljena stranka je poslala neveljavno geslo. Povezava zavrnjena.
|
||||
Comment[sr]=Позвана страна је послала погрешну лозинку. Веза је одбијена.
|
||||
@@ -702,6 +741,7 @@ Comment[ta]=அழைத்த நபர் தவறான கடவுச்
|
||||
Comment[tg]=Корванди дурдаст гузарвожаи нодурустро фиристод. Пайвастшавӣ манъ шудааст.
|
||||
Comment[th]=ผู้เข้าร่วมการเชิญชวนส่งรหัสผ่านมาไม่ถูกต้อง ทำการปฏิเสธการเชื่อมต่อ
|
||||
Comment[tr]=Davet edilenden gönderilmiş geçersiz parola. Bağlantı reddedildi.
|
||||
Comment[ug]=تەكلىپ قىلغۇچى ئەۋەتكەن ئىم ئىناۋەتسىز. باغلىنىش رەت قىلىندى.
|
||||
Comment[uk]=Запрошений учасник надіслав некоректний пароль. У з’єднанні відмовлено.
|
||||
Comment[xh]=Umhlangano omenyiweyo uthumele igama lokugqitha elisebenzayo. Uxhulumano lwa liwe.
|
||||
Comment[x-test]=xxThe invited party sent an invalid password. Connection refused.xx
|
||||
@@ -714,6 +754,7 @@ Action=Popup
|
||||
Name=New Connection on Hold
|
||||
Name[ar]=اتصال جديد على التوقف
|
||||
Name[ast]=Conexón nueva a la espera
|
||||
Name[bg]=Изчакване на новата връзка
|
||||
Name[bs]=Nova veza je na čekanju
|
||||
Name[ca]=Nova connexió en espera
|
||||
Name[ca@valencia]=Nova connexió en espera
|
||||
@@ -744,6 +785,7 @@ Name[ko]=새 연결 대기 중
|
||||
Name[lt]=Naujas kvietimas ryšiui sulaikytas
|
||||
Name[lv]=Jauns savienojums gaida
|
||||
Name[ml]=പുതിയ ബന്ധം തത്കാലം നിര്ത്തിയിരിയ്ക്കുന്നു
|
||||
Name[mr]=नवीन जुळवणी थांबविलेली आहे
|
||||
Name[nb]=Ny tilkobling venter
|
||||
Name[nds]=Nieg Verbinnen töövt
|
||||
Name[nl]=Nieuwe verbinding in de wacht
|
||||
@@ -754,6 +796,7 @@ Name[pt]=Ligação Nova em Espera
|
||||
Name[pt_BR]=Nova conexão ativa
|
||||
Name[ro]=Conexiune nouă în așteptare
|
||||
Name[ru]=Новое соединение приостановлено
|
||||
Name[si]=නව සබඳතාවක් රඳවා ඇත
|
||||
Name[sk]=Nové pripojenie bolo pozdržané
|
||||
Name[sl]=Nova povezava na čakanju
|
||||
Name[sr]=Нова веза је на чекању
|
||||
@@ -771,6 +814,7 @@ Comment=Connection requested, user must accept
|
||||
Comment[af]=Verbinding versoekte, gebruiker moet aanvaar
|
||||
Comment[ar]=الاتصال طلب، يجب موافقة المستخدم
|
||||
Comment[ast]=Conexón solicitada, l'usuario tien d'aceutala
|
||||
Comment[bg]=Поискана е връзка, следва потребителят да приеме
|
||||
Comment[bn]=সংযোগ অনুরোধ করা হল, ব্যবহারকারীকে অবশ্যই স্বীকার করতে হবে
|
||||
Comment[bs]=Veza je zahtijevana, korinik mora da je prihvati
|
||||
Comment[ca]=Connexió sol·licitada, l'usuari ha d'acceptar-la
|
||||
@@ -784,9 +828,9 @@ Comment[en_GB]=Connection requested, user must accept
|
||||
Comment[eo]=Konekto pridemandita, la uzanto devas akcepti
|
||||
Comment[es]=Conexión solicitada, el usuario debe aceptarla
|
||||
Comment[et]=Nõutakse ühendust, kasutaja peab seda lubama
|
||||
Comment[eu]=Konexioa eskatu da, erabiltzaileak onartu behar du
|
||||
Comment[eu]=Konexioa eskatuta, erabiltzaileak onartu behar du
|
||||
Comment[fi]=Pyydettiin yhteyttä, käyttäjän tulee hyväksyä
|
||||
Comment[fr]=Connexion demandée, l'utilisateur doit accepter
|
||||
Comment[fr]=Connexion demandée. L'utilisateur doit accepter
|
||||
Comment[ga]=Ceangal iarrtha; ní mór don úsáideoir glacadh leis
|
||||
Comment[gl]=Pediuse a conexión; o usuario debe aceptar
|
||||
Comment[he]=נתבקש חיבור, על המשתמש לקבלו
|
||||
@@ -816,6 +860,7 @@ Comment[pt]=Foi pedida uma ligação que o utilizador deverá aceitar
|
||||
Comment[pt_BR]=Conexão requisitada; o usuário deve aceitar
|
||||
Comment[ro]=Conexiune cerută, utilizatorul trebuie să accepte
|
||||
Comment[ru]=Запрос на соединение, требуется подтверждение пользователя
|
||||
Comment[si]=සබඳතාව ඉල්ලා ඇත, පරිශීලක තහවුරු කල යුතුයි
|
||||
Comment[sk]=Vyžiadané pripojenie, užívateľ ho musí akceptovať
|
||||
Comment[sl]=Povezava zahtevana, uporabnik mora sprejeti
|
||||
Comment[sr]=Захтевана је веза, корисник мора да је прихвати
|
||||
@@ -827,6 +872,7 @@ Comment[ta]=இணைப்பு கோரப்பட்டது, பயன
|
||||
Comment[tg]=Пайвастшавӣ дархоста шудааст, корванд бояд қабул кунад
|
||||
Comment[th]=มีการร้องขอเชื่อมต่อมา ผู้ใช้ต้องทำการยอมรับก่อน
|
||||
Comment[tr]=Bağlantı isteği, kullanıcı kabul etmeli
|
||||
Comment[ug]=باغلىنىش ئىلتىماس قىلىندى، ئىشلەتكۈچى قوشۇلۇشى كېرەك
|
||||
Comment[uk]=Отримано запит на з’єднання, користувач має його прийняти
|
||||
Comment[xh]=Uxhulumaniso luceliwe, umsebenzisi kufanele amkele
|
||||
Comment[x-test]=xxConnection requested, user must acceptxx
|
||||
@@ -839,6 +885,7 @@ Action=Popup
|
||||
Name=New Connection Auto Accepted
|
||||
Name[ar]=اتصال جديد مقبول تلقائيا
|
||||
Name[ast]=Conexón nueva aceutada automáticamente
|
||||
Name[bg]=Автоматично приемане на новата връзка
|
||||
Name[bs]=Nova veza je automatski prihvaćena
|
||||
Name[ca]=Nova connexió acceptada automàticament
|
||||
Name[ca@valencia]=Nova connexió acceptada automàticament
|
||||
@@ -850,9 +897,9 @@ Name[en_GB]=New Connection Auto Accepted
|
||||
Name[eo]=Nova konekto aŭtomate akceptita
|
||||
Name[es]=Conexión nueva aceptada automáticamente
|
||||
Name[et]=Uue ühendusega automaatselt nõus
|
||||
Name[eu]=Konexio berria auto-onartu da
|
||||
Name[eu]=Konexio berria automatikoki onartuta
|
||||
Name[fi]=Uusi yhteys hyväksyttiin automaattisesti
|
||||
Name[fr]=Nouvelle connexion auto-acceptée
|
||||
Name[fr]=Nouvelle connexion acceptée automatiquement
|
||||
Name[ga]=Ceangal nua bunaithe go huathoibríoch
|
||||
Name[gl]=Nova conexión aceptada automaticamente
|
||||
Name[hi]=नय कनेक्शन स्वचालित स्वीकारा
|
||||
@@ -879,6 +926,7 @@ Name[pt]=Nova Ligação Aceite Automaticamente
|
||||
Name[pt_BR]=Nova conexão com aceitação automática
|
||||
Name[ro]=Conexiune nouă acceptată automat
|
||||
Name[ru]=Новое соединение принимается автоматически
|
||||
Name[si]=නව සබඳතාව ස්වයංක්රීයව පිළිගැණිනි
|
||||
Name[sk]=Nové pripojenie bolo automaticky akceptované
|
||||
Name[sl]=Nova povezava samodejno sprejeta
|
||||
Name[sr]=Нова веза је аутоматски прихваћена
|
||||
@@ -888,6 +936,7 @@ Name[sr@latin]=Nova veza je automatski prihvaćena
|
||||
Name[sv]=Ny anslutning accepterades automatiskt
|
||||
Name[th]=รับการเชื่อมต่อใหม่โดยอัตโนมัติ
|
||||
Name[tr]=Yeni Bağlantı Otomatik olarak Kabul Edildi
|
||||
Name[ug]=يېڭى باغلىنىش ئۆزلۈكىدىن قوشۇلدى
|
||||
Name[uk]=Нове з’єднання автоматично прийнято
|
||||
Name[x-test]=xxNew Connection Auto Acceptedxx
|
||||
Name[zh_CN]=新连接自动接受
|
||||
@@ -896,6 +945,7 @@ Comment=New connection automatically established
|
||||
Comment[af]=Nuwe verbinding automaties vasgestel
|
||||
Comment[ar]=اتصال جديد مفعل تلقائيا
|
||||
Comment[ast]=Conexón nueva afitada automáticamente
|
||||
Comment[bg]=Новата връзка е автоматично приета
|
||||
Comment[bn]=নতুন সংযোগ স্বয়ংক্রীয়ভাবে স্থাপন করা হল
|
||||
Comment[bs]=Nova veza je automatski uspostavljena
|
||||
Comment[ca]=Nova connexió establerta automàticament
|
||||
@@ -909,7 +959,7 @@ Comment[en_GB]=New connection automatically established
|
||||
Comment[eo]=Nova konekto aŭtomate establita
|
||||
Comment[es]=Conexión nueva establecida automáticamente
|
||||
Comment[et]=Uus ühendus automaatselt loodud
|
||||
Comment[eu]=Konexio berria automatikoki ezarri da
|
||||
Comment[eu]=Konexio berria automatikoki ezarrita
|
||||
Comment[fi]=Uusi yhteys muodostettiin automaattisesti
|
||||
Comment[fr]=Nouvelle connexion établie automatiquement
|
||||
Comment[ga]=Ceangal nua bunaithe go huathoibríoch
|
||||
@@ -941,6 +991,7 @@ Comment[pt]=Foi estabelecida automaticamente uma nova ligação
|
||||
Comment[pt_BR]=Nova conexão estabelecida automaticamente
|
||||
Comment[ro]=Conexiune nouă stabilită automat
|
||||
Comment[ru]=Новое соединение устанавливается автоматически
|
||||
Comment[si]=නව සබඳතාව ස්වයංක්රීයව සැකසිනි
|
||||
Comment[sk]=Nové pripojenie bolo automaticky nadviazané
|
||||
Comment[sl]=Nova povezava samodejno vzpostavljena
|
||||
Comment[sr]=Нова веза је аутоматски успостављена
|
||||
@@ -952,6 +1003,7 @@ Comment[ta]=இணைப்புகள் தானாக உருவாக்
|
||||
Comment[tg]=Пайвастшавии нав ба таври худкор барпо мегардад
|
||||
Comment[th]=การเชื่อมต่อใหม่จะถูกทำการเชื่อมต่อโดยอัตโนมัติ
|
||||
Comment[tr]=Yeni bağlantı otomatik olarak kuruldu
|
||||
Comment[ug]=يېڭى باغلىنىش ئۆزلۈكىدىن قۇرۇلدى
|
||||
Comment[uk]=Автоматично встановлено нове з’єднання
|
||||
Comment[xh]=Uxhulumaniso olutsha lufunyenwe ngokuzenzekelayo
|
||||
Comment[x-test]=xxNew connection automatically establishedxx
|
||||
@@ -964,6 +1016,7 @@ Action=Popup
|
||||
Name=Too Many Connections
|
||||
Name[ar]=اتصالات عديدة
|
||||
Name[ast]=Abondes conexones
|
||||
Name[bg]=Твърде много връзки
|
||||
Name[bs]=Previše veza
|
||||
Name[ca]=Massa connexions
|
||||
Name[ca@valencia]=Massa connexions
|
||||
@@ -1004,6 +1057,7 @@ Name[pt]=Demasiadas Ligações
|
||||
Name[pt_BR]=Conexões em excesso
|
||||
Name[ro]=Prea multe conexiuni
|
||||
Name[ru]=Слишком много соединений
|
||||
Name[si]=වඩා වැඩි සබඳතා ගණනක්
|
||||
Name[sk]=Príliš veľa pripojení
|
||||
Name[sl]=Preveč povezav
|
||||
Name[sr]=Исувише веза
|
||||
@@ -1013,6 +1067,7 @@ Name[sr@latin]=Isuviše veza
|
||||
Name[sv]=För många anslutningar
|
||||
Name[th]=มีการเชื่อมต่อมากเกินไป
|
||||
Name[tr]=Çok Fazla Bağlantı
|
||||
Name[ug]=باغلىنىش بەك كۆپ
|
||||
Name[uk]=Забагато з’єднань
|
||||
Name[x-test]=xxToo Many Connectionsxx
|
||||
Name[zh_CN]=连接过多
|
||||
@@ -1021,11 +1076,12 @@ Comment=Busy, connection refused
|
||||
Comment[af]=Besig, verbinding geweier
|
||||
Comment[ar]=مشغول، الإتصال رفض
|
||||
Comment[ast]=Ocupáu, conexón refugada
|
||||
Comment[bg]=Заето. Връзката е отказана.
|
||||
Comment[bn]=ব্যস্ত, সংযোগ অস্বীকার করল
|
||||
Comment[br]=Dalc'het, kevreadenn disteuleret
|
||||
Comment[bs]=Zauzeto, veza je odbijena
|
||||
Comment[ca]=Ocupat, connexió refusada
|
||||
Comment[ca@valencia]=Ocupat, connexió refusada
|
||||
Comment[ca]=Ocupat, connexió rebutjada
|
||||
Comment[ca@valencia]=Ocupat, connexió rebutjada
|
||||
Comment[cs]=Zaneprázdněn, spojení odmítnuto
|
||||
Comment[cy]=Prysur, gwrthodwyd y cysylltiad
|
||||
Comment[da]=Optaget, forbindelse afslået
|
||||
@@ -1037,7 +1093,7 @@ Comment[es]=Ocupado, conexión rechazada
|
||||
Comment[et]=Hõivatud, ühendusest keelduti
|
||||
Comment[eu]=Lanpetuta, konexioa ukatu da
|
||||
Comment[fi]=Varattu, yhteys hylättiin
|
||||
Comment[fr]=Occupé, connexion refusée
|
||||
Comment[fr]=Occupé. Connexion refusée
|
||||
Comment[ga]=Gnóthach; ceangal diúltaithe
|
||||
Comment[gl]=Ocupado; a conexión foi rexeitada
|
||||
Comment[he]=תפוס, החיבור נדחה
|
||||
@@ -1067,6 +1123,7 @@ Comment[pt]=Ocupado, pelo a ligação foi recusada
|
||||
Comment[pt_BR]=Ocupado; conexão recusada
|
||||
Comment[ro]=Ocupat, conexiune refuzată
|
||||
Comment[ru]=Занят, соединение отклонено
|
||||
Comment[si]=කාර්යබහුලයි, සබඳතාව නොපිළිගැණිනි
|
||||
Comment[sk]=Zaneprázdnený, pripojenie bolo odmietnuté
|
||||
Comment[sl]=Zaposlen, povezava zavrnjena
|
||||
Comment[sr]=Заузето, веза је одбијена
|
||||
@@ -1078,6 +1135,7 @@ Comment[ta]=வேலையில் உள்ளது, இணைப்பு
|
||||
Comment[tg]=Банд, пайвастшавӣ рад гардидааст
|
||||
Comment[th]=ยังไม่ว่าง ทำการปฏิเสธการเชื่อมต่อ
|
||||
Comment[tr]=Meşgul, bağlantı reddedildi
|
||||
Comment[ug]=ئالدىراش، باغلىنىش رەت قىلىندى
|
||||
Comment[uk]=Зайнято, у з’єднанні відмовлено
|
||||
Comment[uz]=Band, aloqa rad etildi
|
||||
Comment[uz@cyrillic]=Банд, алоқа рад этилди
|
||||
@@ -1092,6 +1150,7 @@ Action=Popup
|
||||
Name=Unexpected Connection
|
||||
Name[ar]=الاتصال غير متوقّع
|
||||
Name[ast]=Conexón inesperada
|
||||
Name[bg]=Неочаквана връзка
|
||||
Name[bs]=Neočekivana veza
|
||||
Name[ca]=Connexió inesperada
|
||||
Name[ca@valencia]=Connexió inesperada
|
||||
@@ -1132,6 +1191,7 @@ Name[pt]=Ligação Inesperada
|
||||
Name[pt_BR]=Conexão inesperada
|
||||
Name[ro]=Conexiune neașteptată
|
||||
Name[ru]=Неожиданное соединение
|
||||
Name[si]=බලාපොරොත්තු රහිත සබඳතාවක්
|
||||
Name[sk]=Neočakávané pripojenie
|
||||
Name[sl]=Nepričakovana povezava
|
||||
Name[sq]=Lidhje e Papritur
|
||||
@@ -1142,6 +1202,7 @@ Name[sr@latin]=Neočekivana veza
|
||||
Name[sv]=Oväntad anslutning
|
||||
Name[th]=เกิดการเชื่อมต่อที่ไม่คาดคิด
|
||||
Name[tr]=Beklenmeyen Bağlantı
|
||||
Name[ug]=كۈتۈلمىگەن باغلىنىش
|
||||
Name[uk]=Неочікуване з’єднання
|
||||
Name[x-test]=xxUnexpected Connectionxx
|
||||
Name[zh_CN]=未预料的连接
|
||||
@@ -1150,6 +1211,7 @@ Comment=Received unexpected connection, abort
|
||||
Comment[af]=Ontvang onverwagte verbinding, staak
|
||||
Comment[ar]=استقبال اتصال غير متوقع، إنهاء
|
||||
Comment[ast]=Recibióse conexón inesperada, albortando
|
||||
Comment[bg]=Получена е неочаквана връзка. Прекъсване.
|
||||
Comment[bn]=অপ্রত্যাশিত সংযোগ গ্রহণ করল, বাতিল করুন
|
||||
Comment[bs]=Primljena je neočekivana veza, prekini
|
||||
Comment[ca]=Rebuda una connexió inesperada, avortant
|
||||
@@ -1163,9 +1225,9 @@ Comment[en_GB]=Received unexpected connection, abort
|
||||
Comment[eo]=Ricevis neatenditan konekton, ĉesi
|
||||
Comment[es]=Recibida conexión inesperada, interrumpir
|
||||
Comment[et]=Saadi ootamatu ühendus, loobuti
|
||||
Comment[eu]=Ustegabeko konexioa jaso da, abortatzen
|
||||
Comment[eu]=Ustekabeko konexioa jaso da, abortatzen
|
||||
Comment[fi]=Vastaanotettiin odottamaton yhteys, lopeta
|
||||
Comment[fr]=Reçu une connexion inattendue, interruption
|
||||
Comment[fr]=Connexion inattendue reçue. Annulation
|
||||
Comment[ga]=Fuarthas ceangal gan choinne, á thobscor
|
||||
Comment[gl]=Recibiuse unha conexión non agardada; cancélase
|
||||
Comment[he]=נתקבל חיבור בלתי צפוי, בוטל
|
||||
@@ -1194,6 +1256,7 @@ Comment[pt]=Foi recebida uma ligação inesperada, pelo que foi interrompida
|
||||
Comment[pt_BR]=Conexão recebida inesperadamente; abortar
|
||||
Comment[ro]=Conexiune neașteptată recepționată, abandonare
|
||||
Comment[ru]=Получено неожиданное соединение. Отключение
|
||||
Comment[si]=බලාපොරොත්තු රහිත සබඳතාවක් ලැබිනි, පිටවෙමින්
|
||||
Comment[sk]=Prijaté neočakávané pripojenie, prerušené
|
||||
Comment[sl]=Prejeta nepričakovana povezava, prekinjeno
|
||||
Comment[sr]=Примљена је неочекивана веза, прекидам
|
||||
@@ -1205,6 +1268,7 @@ Comment[ta]=எதிர்பாராத இணைப்பு, நிறு
|
||||
Comment[tg]=Пайвастшавии ғайричашмдош қабул гардид, кандашавӣ
|
||||
Comment[th]=ได้รับการเชื่อมต่อมาอย่างไม่คาดคิด ทำการยกเลิก
|
||||
Comment[tr]=Beklenmeyen bir bağlantı alındı, vazgeçiliyor
|
||||
Comment[ug]=ئويلاشمىغان باغلىنىشنى تاپشۇرۇۋالدى، توختات
|
||||
Comment[uk]=Отримано з’єднання, яке не очікувалось, припиняється
|
||||
Comment[xh]=Ufumene uxhulumaniso olungalindelekanga, lahla
|
||||
Comment[x-test]=xxReceived unexpected connection, abortxx
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "manageinvitationsdialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "trayicon.h"
|
||||
#include "invitationsrfbserver.h"
|
||||
|
||||
#include <KAboutApplicationDialog>
|
||||
#include <KAboutData>
|
||||
#include <KAction>
|
||||
#include <KApplication>
|
||||
#include <KUniqueApplication>
|
||||
#include <KCmdLineArgs>
|
||||
#include <KDebug>
|
||||
#include <KLocale>
|
||||
@@ -33,8 +33,7 @@
|
||||
#include <QtGui/qwindowdefs.h>
|
||||
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
# include "tubesclienthandler.h"
|
||||
# include <TelepathyQt4/ClientRegistrar>
|
||||
# include "tubesrfbserver.h"
|
||||
#endif
|
||||
|
||||
#include <signal.h>
|
||||
@@ -94,7 +93,7 @@ int main(int argc, char *argv[])
|
||||
options.add("nodialog", ki18n("Do not show the invitations management dialog at startup"));
|
||||
KCmdLineArgs::addCmdLineOptions(options);
|
||||
|
||||
KApplication app;
|
||||
KUniqueApplication app;
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
if (!checkX11Capabilities()) {
|
||||
@@ -105,19 +104,17 @@ int main(int argc, char *argv[])
|
||||
InvitationsRfbServer::init();
|
||||
|
||||
#ifdef KRFB_WITH_TELEPATHY_TUBES
|
||||
Tp::ClientRegistrarPtr clientRegistrar = Tp::ClientRegistrar::create();
|
||||
clientRegistrar->registerClient(Tp::AbstractClientPtr(new TubesClientHandler),
|
||||
"krfb_rfb_handler");
|
||||
TubesRfbServer::init();
|
||||
#endif
|
||||
|
||||
//init the GUI
|
||||
ManageInvitationsDialog invitationsDialog;
|
||||
TrayIcon trayicon(&invitationsDialog);
|
||||
MainWindow mainWindow;
|
||||
TrayIcon trayicon(&mainWindow);
|
||||
|
||||
if (app.isSessionRestored() && KMainWindow::canBeRestored(1)) {
|
||||
invitationsDialog.restore(1, false);
|
||||
mainWindow.restore(1, false);
|
||||
} else if (KCmdLineArgs::parsedArgs()->isSet("dialog")) {
|
||||
invitationsDialog.show();
|
||||
mainWindow.show();
|
||||
}
|
||||
|
||||
sigset_t sigs;
|
||||
|
||||
264
krfb/mainwindow.cpp
Normal file
264
krfb/mainwindow.cpp
Normal file
@@ -0,0 +1,264 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
Copyright (C) 2013 Amandeep Singh <aman.dedman@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 "mainwindow.h"
|
||||
#include "invitationsrfbserver.h"
|
||||
|
||||
#include "krfbconfig.h"
|
||||
#include "ui_configtcp.h"
|
||||
#include "ui_configsecurity.h"
|
||||
|
||||
#include <KConfigDialog>
|
||||
#include <KIcon>
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KStandardGuiItem>
|
||||
#include <KSystemTimeZone>
|
||||
#include <KToolInvocation>
|
||||
#include <KStandardAction>
|
||||
#include <KActionCollection>
|
||||
#include <KLineEdit>
|
||||
#include <KNewPasswordDialog>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QSizePolicy>
|
||||
#include <QtNetwork/QNetworkInterface>
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
#include "tubesrfbserver.h"
|
||||
#include <TelepathyQt/PendingReady>
|
||||
#include <TelepathyQt/PendingChannelRequest>
|
||||
#include <KTp/actions.h>
|
||||
#include <KTp/Widgets/contact-view-widget.h>
|
||||
#include <KTp/Models/contacts-list-model.h>
|
||||
#include <KTp/Models/contacts-filter-model.h>
|
||||
#endif
|
||||
|
||||
class TCP: public QWidget, public Ui::TCP
|
||||
{
|
||||
public:
|
||||
TCP(QWidget *parent = 0) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
}
|
||||
};
|
||||
|
||||
class Security: public QWidget, public Ui::Security
|
||||
{
|
||||
public:
|
||||
Security(QWidget *parent = 0) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: KXmlGuiWindow(parent)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
|
||||
m_passwordEditable = false;
|
||||
m_passwordLineEdit = new KLineEdit(this);
|
||||
m_passwordLineEdit->setVisible(false);
|
||||
m_passwordLineEdit->setAlignment(Qt::AlignHCenter);
|
||||
|
||||
QWidget *mainWidget = new QWidget;
|
||||
m_ui.setupUi(mainWidget);
|
||||
m_ui.krfbIconLabel->setPixmap(KIcon("krfb").pixmap(128));
|
||||
m_ui.enableUnattendedCheckBox->setChecked(
|
||||
InvitationsRfbServer::instance->allowUnattendedAccess());
|
||||
|
||||
setCentralWidget(mainWidget);
|
||||
|
||||
connect(m_ui.passwordEditButton,SIGNAL(clicked()),
|
||||
this,SLOT(editPassword()));
|
||||
connect(m_ui.enableSharingCheckBox,SIGNAL(toggled(bool)),
|
||||
this, SLOT(toggleDesktopSharing(bool)));
|
||||
connect(m_ui.enableUnattendedCheckBox, SIGNAL(toggled(bool)),
|
||||
InvitationsRfbServer::instance, SLOT(toggleUnattendedAccess(bool)));
|
||||
connect(m_ui.unattendedPasswordButton, SIGNAL(clicked()),
|
||||
this, SLOT(editUnattendedPassword()));
|
||||
connect(m_ui.addressAboutButton, SIGNAL(clicked()),
|
||||
this, SLOT(aboutConnectionAddress()));
|
||||
connect(m_ui.unattendedAboutButton, SIGNAL(clicked()),
|
||||
this, SLOT(aboutUnattendedMode()));
|
||||
connect(InvitationsRfbServer::instance, SIGNAL(passwordChanged(const QString&)),
|
||||
this, SLOT(passwordChanged(const QString&)));
|
||||
|
||||
// Figure out the address
|
||||
int port = KrfbConfig::port();
|
||||
QList<QNetworkInterface> interfaceList = QNetworkInterface::allInterfaces();
|
||||
foreach(const QNetworkInterface & interface, interfaceList) {
|
||||
if(interface.flags() & QNetworkInterface::IsLoopBack)
|
||||
continue;
|
||||
|
||||
if(interface.flags() & QNetworkInterface::IsRunning &&
|
||||
!interface.addressEntries().isEmpty())
|
||||
m_ui.addressDisplayLabel->setText(QString("%1 : %2")
|
||||
.arg(interface.addressEntries().first().ip().toString())
|
||||
.arg(port));
|
||||
}
|
||||
|
||||
//Figure out the password
|
||||
m_ui.passwordDisplayLabel->setText(
|
||||
InvitationsRfbServer::instance->desktopPassword());
|
||||
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
|
||||
m_contactViewWidget = new KTp::ContactViewWidget(
|
||||
TubesRfbServer::instance->contactsListModel(), this);
|
||||
|
||||
m_contactViewWidget->setEnabled(false);
|
||||
connect(m_ui.enableSharingCheckBox, SIGNAL(toggled(bool)),
|
||||
m_contactViewWidget, SLOT(setEnabled(bool)));
|
||||
m_contactViewWidget->setIconSize(QSize(32,32));
|
||||
m_contactViewWidget->setMinimumWidth(120);
|
||||
m_contactViewWidget->setMaximumWidth(360);
|
||||
m_contactViewWidget->setMinimumHeight(300);
|
||||
m_contactViewWidget->contactFilterLineEdit()->setClickMessage(i18n("Search in Contacts..."));
|
||||
m_contactViewWidget->filter()->setPresenceTypeFilterFlags(KTp::ContactsFilterModel::ShowOnlyConnected);
|
||||
m_contactViewWidget->filter()->setTubesFilterStrings(QStringList("rfb"));
|
||||
m_contactViewWidget->filter()->setCapabilityFilterFlags(KTp::ContactsFilterModel::FilterByTubes);
|
||||
|
||||
m_contactViewWidget->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
|
||||
m_ui.tpContactsLayout->addWidget(m_contactViewWidget);
|
||||
connect(m_contactViewWidget, SIGNAL(contactDoubleClicked(const Tp::AccountPtr &, const KTp::ContactPtr &)),
|
||||
this, SLOT(onContactDoubleClicked(const Tp::AccountPtr &, const KTp::ContactPtr &)));
|
||||
#endif
|
||||
|
||||
|
||||
KStandardAction::quit(QCoreApplication::instance(), SLOT(quit()), actionCollection());
|
||||
KStandardAction::preferences(this, SLOT(showConfiguration()), actionCollection());
|
||||
|
||||
setupGUI();
|
||||
|
||||
setAutoSaveSettings();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void MainWindow::editPassword()
|
||||
{
|
||||
if(m_passwordEditable) {
|
||||
m_passwordEditable = false;
|
||||
m_ui.passwordEditButton->setIcon(KIcon("document-properties"));
|
||||
m_ui.passwordGridLayout->removeWidget(m_passwordLineEdit);
|
||||
InvitationsRfbServer::instance->setDesktopPassword(
|
||||
m_passwordLineEdit->text());
|
||||
m_ui.passwordDisplayLabel->setText(
|
||||
InvitationsRfbServer::instance->desktopPassword());
|
||||
m_passwordLineEdit->setVisible(false);
|
||||
} else {
|
||||
m_passwordEditable = true;
|
||||
m_ui.passwordEditButton->setIcon(KIcon("document-save"));
|
||||
m_ui.passwordGridLayout->addWidget(m_passwordLineEdit,0,0);
|
||||
m_passwordLineEdit->setText(
|
||||
InvitationsRfbServer::instance->desktopPassword());
|
||||
m_passwordLineEdit->setVisible(true);
|
||||
m_passwordLineEdit->setFocus(Qt::MouseFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::editUnattendedPassword()
|
||||
{
|
||||
KNewPasswordDialog dialog(this);
|
||||
dialog.setPrompt(i18n("Enter a new password for Unattended Access"));
|
||||
if(dialog.exec()) {
|
||||
InvitationsRfbServer::instance->setUnattendedPassword(dialog.password());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::toggleDesktopSharing(bool enable)
|
||||
{
|
||||
if(enable) {
|
||||
if(!InvitationsRfbServer::instance->start()) {
|
||||
KMessageBox::error(this,
|
||||
i18n("Failed to start the krfb server. Desktop sharing "
|
||||
"will not work. Try setting another port in the settings "
|
||||
"and restart krfb."));
|
||||
}
|
||||
} else {
|
||||
InvitationsRfbServer::instance->stop();
|
||||
if(m_passwordEditable) {
|
||||
m_passwordEditable = false;
|
||||
m_passwordLineEdit->setVisible(false);
|
||||
m_ui.passwordEditButton->setIcon(KIcon("document-properties"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::passwordChanged(const QString& password)
|
||||
{
|
||||
m_passwordLineEdit->setText(password);
|
||||
m_ui.passwordDisplayLabel->setText(password);
|
||||
}
|
||||
|
||||
void MainWindow::aboutConnectionAddress()
|
||||
{
|
||||
KMessageBox::about(this,
|
||||
i18n("This field contains the address of your computer and the port number, separated by a colon.\n\nThe address is just a hint - you can use any address that can reach your computer.\n\nDesktop Sharing tries to guess your address from your network configuration, but does not always succeed in doing so.\n\nIf your computer is behind a firewall it may have a different address or be unreachable for other computers."),
|
||||
i18n("KDE Desktop Sharing"));
|
||||
}
|
||||
|
||||
void MainWindow::aboutUnattendedMode()
|
||||
{
|
||||
KMessageBox::about(this,
|
||||
i18n("Any remote user with normal desktop sharing password will have to be authenticated.\n\nIf unattended access is on, and the remote user provides unattended mode password, desktop sharing access will be granted without explicit confirmation."),
|
||||
i18n("KDE Desktop Sharing"));
|
||||
}
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
|
||||
void MainWindow::onContactDoubleClicked(const Tp::AccountPtr &account, const KTp::ContactPtr &contact)
|
||||
{
|
||||
Tp::PendingOperation *op = KTp::Actions::startDesktopSharing(account, contact);
|
||||
connect(op, SIGNAL(finished(Tp::PendingOperation*)),
|
||||
this, SLOT(pendingDesktopShareFinished(Tp::PendingOperation*)));
|
||||
}
|
||||
|
||||
void MainWindow::pendingDesktopShareFinished(Tp::PendingOperation *operation)
|
||||
{
|
||||
if(operation->isError()) {
|
||||
KMessageBox::error(this,
|
||||
operation->errorName() + ": " + operation->errorMessage());
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void MainWindow::showConfiguration()
|
||||
{
|
||||
if (KConfigDialog::showDialog("settings")) {
|
||||
return;
|
||||
}
|
||||
|
||||
KConfigDialog *dialog = new KConfigDialog(this, "settings", KrfbConfig::self());
|
||||
dialog->addPage(new TCP, i18n("Network"), "network-workgroup");
|
||||
dialog->addPage(new Security, i18n("Security"), "security-high");
|
||||
dialog->setHelp(QString(), "krfb");
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void MainWindow::readProperties(const KConfigGroup& group)
|
||||
{
|
||||
if (group.readEntry("Visible", true)) {
|
||||
show();
|
||||
}
|
||||
KMainWindow::readProperties(group);
|
||||
}
|
||||
|
||||
void MainWindow::saveProperties(KConfigGroup& group)
|
||||
{
|
||||
group.writeEntry("Visible", isVisible());
|
||||
KMainWindow::saveProperties(group);
|
||||
}
|
||||
|
||||
#include "mainwindow.moc"
|
||||
68
krfb/mainwindow.h
Normal file
68
krfb/mainwindow.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
Copyright (C) 2013 Amandeep Singh <aman.dedman@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 MANAGEINVITATIONSDIALOG_H
|
||||
#define MANAGEINVITATIONSDIALOG_H
|
||||
|
||||
#include "ui_mainwidget.h"
|
||||
|
||||
#include <KXmlGuiWindow>
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
#include <KTp/contact.h>
|
||||
#include <TelepathyQt/PendingReady>
|
||||
namespace KTp {
|
||||
class ContactViewWidget;
|
||||
}
|
||||
namespace Tp {
|
||||
class PendingOperation;
|
||||
}
|
||||
#endif
|
||||
|
||||
class KLineEdit;
|
||||
|
||||
class MainWindow : public KXmlGuiWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
public Q_SLOTS:
|
||||
void showConfiguration();
|
||||
|
||||
protected:
|
||||
virtual void readProperties(const KConfigGroup & group);
|
||||
virtual void saveProperties(KConfigGroup & group);
|
||||
|
||||
private Q_SLOTS:
|
||||
void editPassword();
|
||||
void editUnattendedPassword();
|
||||
void toggleDesktopSharing(bool enable);
|
||||
void passwordChanged(const QString&);
|
||||
void aboutConnectionAddress();
|
||||
void aboutUnattendedMode();
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
void onContactDoubleClicked(const Tp::AccountPtr &, const KTp::ContactPtr &);
|
||||
void pendingDesktopShareFinished(Tp::PendingOperation*);
|
||||
#endif
|
||||
|
||||
private:
|
||||
Ui::MainWidget m_ui;
|
||||
bool m_passwordEditable;
|
||||
KLineEdit *m_passwordLineEdit;
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
KTp::ContactViewWidget *m_contactViewWidget;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,253 +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 "manageinvitationsdialog.h"
|
||||
|
||||
#include "invitationmanager.h"
|
||||
#include "invitation.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "personalinvitedialog.h"
|
||||
#include "ui_configtcp.h"
|
||||
#include "ui_configsecurity.h"
|
||||
|
||||
#include <KConfigDialog>
|
||||
#include <KGlobal>
|
||||
#include <KIconLoader>
|
||||
#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KStandardGuiItem>
|
||||
#include <KSystemTimeZone>
|
||||
#include <KToolInvocation>
|
||||
#include <KStandardAction>
|
||||
#include <KActionCollection>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QToolTip>
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtNetwork/QNetworkInterface>
|
||||
|
||||
class TCP: public QWidget, public Ui::TCP
|
||||
{
|
||||
public:
|
||||
TCP(QWidget *parent = 0) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
}
|
||||
};
|
||||
|
||||
class Security: public QWidget, public Ui::Security
|
||||
{
|
||||
public:
|
||||
Security(QWidget *parent = 0) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ManageInvitationsDialog::ManageInvitationsDialog(QWidget *parent)
|
||||
: KXmlGuiWindow(parent)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
|
||||
QWidget *mainWidget = new QWidget;
|
||||
m_ui.setupUi(mainWidget);
|
||||
m_ui.pixmapLabel->setPixmap(KIcon("krfb").pixmap(128));
|
||||
setCentralWidget(mainWidget);
|
||||
|
||||
connect(m_ui.helpLabel, SIGNAL(linkActivated(QString)), SLOT(showWhatsthis()));
|
||||
connect(m_ui.newPersonalInvitationButton, SIGNAL(clicked()), SLOT(inviteManually()));
|
||||
connect(m_ui.newEmailInvitationButton, SIGNAL(clicked()), SLOT(inviteByMail()));
|
||||
connect(InvitationManager::self(), SIGNAL(invitationNumChanged(int)), SLOT(reloadInvitations()));
|
||||
connect(m_ui.deleteAllButton, SIGNAL(clicked()), SLOT(deleteAll()));
|
||||
connect(m_ui.deleteOneButton, SIGNAL(clicked()), SLOT(deleteCurrent()));
|
||||
connect(m_ui.invitationWidget, SIGNAL(itemSelectionChanged()), SLOT(selectionChanged()));
|
||||
|
||||
KStandardAction::quit(QCoreApplication::instance(), SLOT(quit()), actionCollection());
|
||||
KStandardAction::preferences(this, SLOT(showConfiguration()), actionCollection());
|
||||
|
||||
setupGUI(QSize(550, 330));
|
||||
setAutoSaveSettings();
|
||||
|
||||
reloadInvitations();
|
||||
}
|
||||
|
||||
ManageInvitationsDialog::~ManageInvitationsDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::showWhatsthis()
|
||||
{
|
||||
QToolTip::showText(QCursor::pos(),
|
||||
i18n("An invitation creates a one-time password that allows the receiver to connect to your desktop.\n"
|
||||
"It is valid for only one successful connection and will expire after an hour if it has not been used. \n"
|
||||
"When somebody connects to your computer a dialog will appear and ask you for permission.\n"
|
||||
"The connection will not be established before you accept it. In this dialog you can also\nrestrict "
|
||||
"the other person to view your desktop only, without the ability to move your\nmouse pointer or press "
|
||||
"keys.\nIf you want to create a permanent password for Desktop Sharing, allow 'Uninvited Connections' \n"
|
||||
"in the configuration."));
|
||||
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::inviteManually()
|
||||
{
|
||||
Invitation inv = InvitationManager::self()->addInvitation();
|
||||
PersonalInviteDialog *pid = new PersonalInviteDialog(this);
|
||||
pid->setPassword(inv.password());
|
||||
pid->setExpiration(inv.expirationTime());
|
||||
pid->show();
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::inviteByMail()
|
||||
{
|
||||
int r = KMessageBox::warningContinueCancel(this,
|
||||
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, whichever 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"),
|
||||
KStandardGuiItem::cont(),
|
||||
KStandardGuiItem::cancel(),
|
||||
"showEmailInvitationWarning");
|
||||
|
||||
if (r == KMessageBox::Cancel) {
|
||||
return;
|
||||
}
|
||||
|
||||
QList<QNetworkInterface> ifl = QNetworkInterface::allInterfaces();
|
||||
QString host;
|
||||
int port = KrfbConfig::port();
|
||||
foreach(const QNetworkInterface & nif, ifl) {
|
||||
if (nif.flags() & QNetworkInterface::IsLoopBack) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nif.flags() & QNetworkInterface::IsRunning) {
|
||||
if (!nif.addressEntries().isEmpty()) {
|
||||
host = nif.addressEntries()[0].ip().toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Invitation inv = InvitationManager::self()->addInvitation();
|
||||
KUrl invUrl(QString("vnc://invitation:%1@%2:%3").arg(inv.password()).arg(host).arg(port));
|
||||
KToolInvocation::invokeMailer(QString(), QString(), QString(),
|
||||
i18n("Desktop Sharing (VNC) invitation"),
|
||||
ki18n("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"
|
||||
"%1\n\n"
|
||||
"Otherwise you can use any VNC client with the following parameters:\n\n"
|
||||
"Host: %2:%3\n"
|
||||
"Password: %4\n\n"
|
||||
"For security reasons this invitation will expire at %5 (%6).")
|
||||
.subs(invUrl.url())
|
||||
.subs(host)
|
||||
.subs(QString::number(port))
|
||||
.subs(inv.password())
|
||||
.subs(KGlobal::locale()->formatDateTime(inv.expirationTime()))
|
||||
.subs(KSystemTimeZones::local().name())
|
||||
.toString());
|
||||
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::reloadInvitations()
|
||||
{
|
||||
m_ui.invitationWidget->clear();
|
||||
KLocale *loc = KGlobal::locale();
|
||||
foreach(const Invitation & inv, InvitationManager::self()->invitations()) {
|
||||
QStringList strs;
|
||||
strs << loc->formatDateTime(inv.creationTime()) << loc->formatDateTime(inv.expirationTime());
|
||||
QTreeWidgetItem *it = new QTreeWidgetItem(strs);
|
||||
m_ui.invitationWidget->addTopLevelItem(it);
|
||||
it->setData(0, Qt::UserRole + 1, inv.creationTime());
|
||||
}
|
||||
m_ui.invitationWidget->resizeColumnToContents(0);
|
||||
m_ui.deleteAllButton->setEnabled(InvitationManager::self()->activeInvitations() > 0);
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::showConfiguration()
|
||||
{
|
||||
if (KConfigDialog::showDialog("settings")) {
|
||||
return;
|
||||
}
|
||||
|
||||
KConfigDialog *dialog = new KConfigDialog(this, "settings", KrfbConfig::self());
|
||||
dialog->addPage(new TCP, i18n("Network"), "network-workgroup");
|
||||
dialog->addPage(new Security, i18n("Security"), "security-high");
|
||||
dialog->setHelp(QString(), "krfb");
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::deleteAll()
|
||||
{
|
||||
if (KMessageBox::warningContinueCancel(this,
|
||||
i18n("<qt>Are you sure you want to delete all invitations?</qt>"),
|
||||
i18n("Confirm delete Invitations"),
|
||||
KStandardGuiItem::ok(),
|
||||
KStandardGuiItem::cancel(),
|
||||
QString("krfbdeleteallinv")) !=
|
||||
KMessageBox::Continue) {
|
||||
return;
|
||||
}
|
||||
|
||||
InvitationManager::self()->removeAllInvitations();
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::deleteCurrent()
|
||||
{
|
||||
if (KMessageBox::warningContinueCancel(this,
|
||||
i18n("<qt>Are you sure you want to delete this invitation?</qt>"),
|
||||
i18n("Confirm delete Invitations"),
|
||||
KStandardGuiItem::ok(),
|
||||
KStandardGuiItem::cancel(),
|
||||
QString("krfbdeleteoneinv")) !=
|
||||
KMessageBox::Continue) {
|
||||
return;
|
||||
}
|
||||
|
||||
// disable updates while deleting items, otherwise the list would invalidate itself
|
||||
disconnect(InvitationManager::self(), SIGNAL(invitationNumChanged(int)),
|
||||
this, SLOT(reloadInvitations()));
|
||||
|
||||
QList<QTreeWidgetItem *> itl = m_ui.invitationWidget->selectedItems();
|
||||
foreach(QTreeWidgetItem * itm, itl) {
|
||||
foreach(const Invitation & inv, InvitationManager::self()->invitations()) {
|
||||
if (inv.creationTime() == itm->data(0, Qt::UserRole + 1)) {
|
||||
InvitationManager::self()->removeInvitation(inv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update it manually
|
||||
reloadInvitations();
|
||||
|
||||
connect(InvitationManager::self(), SIGNAL(invitationNumChanged(int)),
|
||||
SLOT(reloadInvitations()));
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::selectionChanged()
|
||||
{
|
||||
m_ui.deleteOneButton->setEnabled(m_ui.invitationWidget->selectedItems().size() > 0);
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::readProperties(const KConfigGroup& group)
|
||||
{
|
||||
if (group.readEntry("Visible", true)) {
|
||||
show();
|
||||
}
|
||||
KMainWindow::readProperties(group);
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::saveProperties(KConfigGroup& group)
|
||||
{
|
||||
group.writeEntry("Visible", isVisible());
|
||||
KMainWindow::saveProperties(group);
|
||||
}
|
||||
|
||||
#include "manageinvitationsdialog.moc"
|
||||
|
||||
@@ -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 MANAGEINVITATIONSDIALOG_H
|
||||
#define MANAGEINVITATIONSDIALOG_H
|
||||
|
||||
#include "ui_manageinvitations.h"
|
||||
|
||||
#include <KXmlGuiWindow>
|
||||
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class ManageInvitationsDialog : public KXmlGuiWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ManageInvitationsDialog(QWidget *parent = 0);
|
||||
|
||||
~ManageInvitationsDialog();
|
||||
|
||||
public Q_SLOTS:
|
||||
void showWhatsthis();
|
||||
void inviteManually();
|
||||
void inviteByMail();
|
||||
void reloadInvitations();
|
||||
void showConfiguration();
|
||||
void deleteAll();
|
||||
void deleteCurrent();
|
||||
void selectionChanged();
|
||||
|
||||
protected:
|
||||
virtual void readProperties(const KConfigGroup & group);
|
||||
virtual void saveProperties(KConfigGroup & group);
|
||||
|
||||
private:
|
||||
Ui::ManageInvitationsDialog m_ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2010 Collabora Ltd. <info@collabora.co.uk>
|
||||
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
|
||||
|
||||
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 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 Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "pendingrfbclient.h"
|
||||
#include "connectiondialog.h"
|
||||
#include "krfbconfig.h"
|
||||
#include <KDebug>
|
||||
#include <KNotification>
|
||||
|
||||
PendingRfbClient::PendingRfbClient(rfbClientPtr client, QObject *parent)
|
||||
: QObject(parent), m_client(0), m_rfbClient(client)
|
||||
{
|
||||
QMetaObject::invokeMethod(this, "processNewClient", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void PendingRfbClient::accept()
|
||||
{
|
||||
kDebug() << "accepted connection";
|
||||
|
||||
Q_ASSERT(m_client);
|
||||
m_client->setOnHold(false);
|
||||
Q_EMIT finished(m_client);
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void PendingRfbClient::reject()
|
||||
{
|
||||
kDebug() << "refused connection";
|
||||
|
||||
rfbCloseClient(m_rfbClient);
|
||||
rfbClientConnectionGone(m_rfbClient);
|
||||
Q_EMIT finished(NULL);
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void PendingRfbClient::showUserConfirmationDialog()
|
||||
{
|
||||
kDebug();
|
||||
Q_ASSERT(m_client);
|
||||
|
||||
if (!KrfbConfig::askOnConnect()) {
|
||||
KNotification::event("NewConnectionAutoAccepted",
|
||||
i18n("Accepted connection from %1", m_client->name()));
|
||||
accept();
|
||||
} else {
|
||||
KNotification::event("NewConnectionOnHold",
|
||||
i18n("Received connection from %1, on hold (waiting for confirmation)",
|
||||
m_client->name()));
|
||||
|
||||
ConnectionDialog *dialog = new ConnectionDialog(0);
|
||||
dialog->setRemoteHost(m_client->name());
|
||||
dialog->setAllowRemoteControl(KrfbConfig::allowDesktopControl());
|
||||
|
||||
connect(dialog, SIGNAL(okClicked()), SLOT(dialogAccepted()));
|
||||
connect(dialog, SIGNAL(cancelClicked()), SLOT(dialogRejected()));
|
||||
|
||||
dialog->show();
|
||||
}
|
||||
}
|
||||
|
||||
void PendingRfbClient::dialogAccepted()
|
||||
{
|
||||
ConnectionDialog *dialog = qobject_cast<ConnectionDialog *>(sender());
|
||||
Q_ASSERT(dialog);
|
||||
m_client->setControlEnabled(dialog->cbAllowRemoteControl->isChecked());
|
||||
accept();
|
||||
}
|
||||
|
||||
void PendingRfbClient::dialogRejected()
|
||||
{
|
||||
reject();
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2010 Collabora Ltd. <info@collabora.co.uk>
|
||||
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
|
||||
|
||||
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 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 Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef PENDINGRFBCLIENT_H
|
||||
#define PENDINGRFBCLIENT_H
|
||||
|
||||
#include "rfbclient.h"
|
||||
#include <QtCore/QObject>
|
||||
|
||||
class PendingRfbClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PendingRfbClient(rfbClientPtr client, QObject* parent = 0);
|
||||
|
||||
Q_SIGNALS:
|
||||
void finished(RfbClient *client);
|
||||
|
||||
protected Q_SLOTS:
|
||||
virtual void processNewClient() = 0;
|
||||
|
||||
void showUserConfirmationDialog();
|
||||
|
||||
void accept();
|
||||
void reject();
|
||||
|
||||
protected:
|
||||
RfbClient *m_client;
|
||||
rfbClientPtr m_rfbClient;
|
||||
};
|
||||
|
||||
#endif // PENDINGRFBCLIENT_H
|
||||
@@ -1,105 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
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 "personalinvitedialog.h"
|
||||
|
||||
#include "krfbconfig.h"
|
||||
|
||||
#include <KIconLoader>
|
||||
#include <KLocale>
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QToolTip>
|
||||
|
||||
#include <QtNetwork/QNetworkInterface>
|
||||
|
||||
PersonalInviteDialog::PersonalInviteDialog(QWidget *parent)
|
||||
: KDialog(parent)
|
||||
{
|
||||
setCaption(i18n("Personal Invitation"));
|
||||
setButtons(Close);
|
||||
setDefaultButton(Close);
|
||||
setModal(true);
|
||||
|
||||
setMinimumSize(500, 250);
|
||||
|
||||
int port = KrfbConfig::port();
|
||||
|
||||
m_inviteWidget = new QWidget(this);
|
||||
setupUi(m_inviteWidget);
|
||||
pixmapLabel->setPixmap(KIcon("krfb").pixmap(128));
|
||||
|
||||
QList<QNetworkInterface> ifl = QNetworkInterface::allInterfaces();
|
||||
|
||||
foreach(const QNetworkInterface & nif, ifl) {
|
||||
if (nif.flags() & QNetworkInterface::IsLoopBack) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nif.flags() & QNetworkInterface::IsRunning && !nif.addressEntries().isEmpty()) {
|
||||
hostLabel->setText(QString("%1:%2").arg(nif.addressEntries().first().ip().toString()).arg(port));
|
||||
}
|
||||
}
|
||||
|
||||
connect(mainTextLabel, SIGNAL(linkActivated(QString)),
|
||||
SLOT(showWhatsthis(QString)));
|
||||
|
||||
connect(hostHelpLabel, SIGNAL(linkActivated(QString)),
|
||||
SLOT(showWhatsthis(QString)));
|
||||
|
||||
setMainWidget(m_inviteWidget);
|
||||
}
|
||||
|
||||
|
||||
void PersonalInviteDialog::setHost(const QString &host, uint port)
|
||||
{
|
||||
hostLabel->setText(QString("%1:%2")
|
||||
.arg(host).arg(port));
|
||||
}
|
||||
|
||||
void PersonalInviteDialog::setPassword(const QString &passwd)
|
||||
{
|
||||
passwordLabel->setText(passwd);
|
||||
}
|
||||
|
||||
void PersonalInviteDialog::setExpiration(const QDateTime &expire)
|
||||
{
|
||||
expirationLabel->setText(expire.toString(Qt::LocalDate));
|
||||
}
|
||||
|
||||
void PersonalInviteDialog::showWhatsthis(const QString &link)
|
||||
{
|
||||
if (link == "htc") {
|
||||
QToolTip::showText(QCursor::pos(),
|
||||
i18n("Desktop Sharing uses the VNC protocol. You can use any VNC client to connect. \n"
|
||||
"In KDE the client is called 'Remote Desktop Connection'. Enter the host information\n"
|
||||
"into the client and it will connect.."));
|
||||
} else if (link == "help") {
|
||||
QToolTip::showText(QCursor::pos(),
|
||||
i18n("This field contains the address of your computer and the display number, separated by a colon.\n"
|
||||
"The address is just a hint - you can use any address that can reach your computer. \n"
|
||||
"Desktop Sharing tries to guess your address from your network configuration, but does\n"
|
||||
"not always succeed in doing so. If your computer is behind a firewall it may have a\n"
|
||||
"different address or be unreachable for other computers."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "personalinvitedialog.moc"
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/* This file is part of the KDE project
|
||||
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 PERSONALINVITEDIALOG_H
|
||||
#define PERSONALINVITEDIALOG_H
|
||||
|
||||
#include "ui_personalinvitewidget.h"
|
||||
|
||||
#include <KDialog>
|
||||
|
||||
#include <QtCore/QDateTime>
|
||||
|
||||
class QWidget;
|
||||
class PersonalInviteDialog : public KDialog, public Ui::PersonalInviteWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PersonalInviteDialog(QWidget *parent);
|
||||
virtual ~PersonalInviteDialog() {}
|
||||
|
||||
void setHost(const QString &host, uint port);
|
||||
void setPassword(const QString &passwd);
|
||||
void setExpiration(const QDateTime &expire);
|
||||
|
||||
public Q_SLOTS:
|
||||
void showWhatsthis(const QString &);
|
||||
|
||||
protected:
|
||||
QWidget *m_inviteWidget;
|
||||
};
|
||||
|
||||
#endif // PERSONALINVITEDIALOG_H
|
||||
|
||||
@@ -103,6 +103,11 @@ void RfbClient::closeConnection()
|
||||
rfbClientConnectionGone(d->client);
|
||||
}
|
||||
|
||||
rfbClientPtr RfbClient::getRfbClientPtr()
|
||||
{
|
||||
return d->client;
|
||||
}
|
||||
|
||||
void RfbClient::handleKeyboardEvent(bool down, rfbKeySym keySym)
|
||||
{
|
||||
if (d->controlEnabled) {
|
||||
@@ -117,34 +122,6 @@ void RfbClient::handleMouseEvent(int buttonMask, int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
bool RfbClient::checkPassword(const QByteArray & encryptedPassword)
|
||||
{
|
||||
Q_UNUSED(encryptedPassword);
|
||||
|
||||
return d->client->screen->authPasswdData == (void*)0;
|
||||
}
|
||||
|
||||
bool RfbClient::vncAuthCheckPassword(const QByteArray& password, const QByteArray& encryptedPassword) const
|
||||
{
|
||||
if (password.isEmpty() && encryptedPassword.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char passwd[MAXPWLEN];
|
||||
unsigned char challenge[CHALLENGESIZE];
|
||||
|
||||
memcpy(challenge, d->client->authChallenge, CHALLENGESIZE);
|
||||
bzero(passwd, MAXPWLEN);
|
||||
|
||||
if (!password.isEmpty()) {
|
||||
strncpy(passwd, password,
|
||||
(MAXPWLEN <= password.size()) ? MAXPWLEN : password.size());
|
||||
}
|
||||
|
||||
rfbEncryptBytes(challenge, passwd);
|
||||
return memcmp(challenge, encryptedPassword, encryptedPassword.size()) == 0;
|
||||
}
|
||||
|
||||
void RfbClient::onSocketActivated()
|
||||
{
|
||||
//Process not only one, but all pending messages.
|
||||
@@ -193,14 +170,11 @@ void RfbClient::update()
|
||||
PendingRfbClient::PendingRfbClient(rfbClientPtr client, QObject *parent)
|
||||
: QObject(parent), m_rfbClient(client)
|
||||
{
|
||||
kDebug();
|
||||
QMetaObject::invokeMethod(this, "processNewClient", Qt::QueuedConnection);
|
||||
m_rfbClient->clientData = this;
|
||||
}
|
||||
|
||||
PendingRfbClient::~PendingRfbClient()
|
||||
{
|
||||
kDebug();
|
||||
}
|
||||
{}
|
||||
|
||||
void PendingRfbClient::accept(RfbClient *newClient)
|
||||
{
|
||||
@@ -228,5 +202,32 @@ void PendingRfbClient::reject()
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
bool PendingRfbClient::checkPassword(const QByteArray & encryptedPassword)
|
||||
{
|
||||
Q_UNUSED(encryptedPassword);
|
||||
|
||||
return m_rfbClient->screen->authPasswdData == (void*)0;
|
||||
}
|
||||
|
||||
bool PendingRfbClient::vncAuthCheckPassword(const QByteArray& password, const QByteArray& encryptedPassword) const
|
||||
{
|
||||
if (password.isEmpty() && encryptedPassword.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char passwd[MAXPWLEN];
|
||||
unsigned char challenge[CHALLENGESIZE];
|
||||
|
||||
memcpy(challenge, m_rfbClient->authChallenge, CHALLENGESIZE);
|
||||
bzero(passwd, MAXPWLEN);
|
||||
|
||||
if (!password.isEmpty()) {
|
||||
strncpy(passwd, password,
|
||||
(MAXPWLEN <= password.size()) ? MAXPWLEN : password.size());
|
||||
}
|
||||
|
||||
rfbEncryptBytes(challenge, passwd);
|
||||
return memcmp(challenge, encryptedPassword, encryptedPassword.size()) == 0;
|
||||
}
|
||||
|
||||
#include "rfbclient.moc"
|
||||
|
||||
@@ -51,23 +51,10 @@ Q_SIGNALS:
|
||||
protected:
|
||||
friend class RfbServer; //the following event handling methods are called by RfbServer
|
||||
|
||||
rfbClientPtr getRfbClientPtr();
|
||||
virtual void handleKeyboardEvent(bool down, rfbKeySym keySym);
|
||||
virtual void handleMouseEvent(int buttonMask, int x, int y);
|
||||
|
||||
/** This method is supposed to check if the provided \a encryptedPassword
|
||||
* matches the criteria for authenticating the client.
|
||||
* The default implementation returns false if a password is required.
|
||||
* Reimplement to do more useful stuff.
|
||||
*/
|
||||
virtual bool checkPassword(const QByteArray & encryptedPassword);
|
||||
|
||||
/** This method checks if the \a encryptedPassword that was sent from the remote
|
||||
* user matches the \a password that you have specified localy to be the password
|
||||
* for this connection. This assumes that the standard VNC authentication mechanism
|
||||
* is used. Returns true if the password matches or false otherwise.
|
||||
*/
|
||||
bool vncAuthCheckPassword(const QByteArray & password, const QByteArray & encryptedPassword) const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void onSocketActivated();
|
||||
|
||||
@@ -99,6 +86,23 @@ protected Q_SLOTS:
|
||||
void reject();
|
||||
|
||||
protected:
|
||||
|
||||
friend class RfbServer; //Following two methods are handled by RfbServer
|
||||
|
||||
/** This method is supposed to check if the provided \a encryptedPassword
|
||||
* matches the criteria for authenticating the client.
|
||||
* The default implementation returns false if a password is required.
|
||||
* Reimplement to do more useful stuff.
|
||||
*/
|
||||
virtual bool checkPassword(const QByteArray & encryptedPassword);
|
||||
|
||||
/** This method checks if the \a encryptedPassword that was sent from the remote
|
||||
* user matches the \a password that you have specified localy to be the password
|
||||
* for this connection. This assumes that the standard VNC authentication mechanism
|
||||
* is used. Returns true if the password matches or false otherwise.
|
||||
*/
|
||||
bool vncAuthCheckPassword(const QByteArray & password, const QByteArray & encryptedPassword) const;
|
||||
|
||||
rfbClientPtr m_rfbClient;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "rfbserver.h"
|
||||
#include "rfbservermanager.h"
|
||||
#include <QtCore/QSocketNotifier>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <KDebug>
|
||||
|
||||
struct RfbServer::Private
|
||||
@@ -45,7 +47,6 @@ RfbServer::RfbServer(QObject *parent)
|
||||
|
||||
RfbServer::~RfbServer()
|
||||
{
|
||||
stop();
|
||||
if (d->screen) {
|
||||
rfbScreenCleanup(d->screen);
|
||||
}
|
||||
@@ -136,6 +137,8 @@ bool RfbServer::start()
|
||||
d->notifier = new QSocketNotifier(d->screen->listenSock, QSocketNotifier::Read, this);
|
||||
d->notifier->setEnabled(true);
|
||||
connect(d->notifier, SIGNAL(activated(int)), this, SLOT(onListenSocketActivated()));
|
||||
connect(QApplication::clipboard(), SIGNAL(dataChanged()),
|
||||
this, SLOT(krfbSendServerCutText()));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -201,6 +204,15 @@ void RfbServer::updateCursorPosition(const QPoint & position)
|
||||
}
|
||||
}
|
||||
|
||||
void RfbServer::krfbSendServerCutText()
|
||||
{
|
||||
if(d->screen) {
|
||||
QString text = QApplication::clipboard()->text();
|
||||
rfbSendServerCutText(d->screen,
|
||||
text.toLocal8Bit().data(),text.length());
|
||||
}
|
||||
}
|
||||
|
||||
void RfbServer::onListenSocketActivated()
|
||||
{
|
||||
rfbProcessNewConnection(d->screen);
|
||||
@@ -211,6 +223,7 @@ void RfbServer::pendingClientFinished(RfbClient *client)
|
||||
kDebug();
|
||||
if (client) {
|
||||
RfbServerManager::instance()->addClient(client);
|
||||
client->getRfbClientPtr()->clientGoneHook = clientGoneHook;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +237,6 @@ rfbNewClientAction RfbServer::newClientHook(rfbClientPtr cl)
|
||||
connect(pendingClient, SIGNAL(finished(RfbClient*)),
|
||||
server, SLOT(pendingClientFinished(RfbClient*)));
|
||||
|
||||
cl->clientGoneHook = clientGoneHook;
|
||||
return RFB_CLIENT_ON_HOLD;
|
||||
}
|
||||
|
||||
@@ -241,7 +253,8 @@ void RfbServer::clientGoneHook(rfbClientPtr cl)
|
||||
//static
|
||||
rfbBool RfbServer::passwordCheck(rfbClientPtr cl, const char *encryptedPassword, int len)
|
||||
{
|
||||
RfbClient *client = static_cast<RfbClient*>(cl->clientData);
|
||||
PendingRfbClient *client = static_cast<PendingRfbClient*>(cl->clientData);
|
||||
Q_ASSERT(client);
|
||||
return client->checkPassword(QByteArray::fromRawData(encryptedPassword, len));
|
||||
}
|
||||
|
||||
@@ -262,7 +275,7 @@ void RfbServer::pointerHook(int bm, int x, int y, rfbClientPtr cl)
|
||||
//static
|
||||
void RfbServer::clipboardHook(char *str, int len, rfbClientPtr cl)
|
||||
{
|
||||
//TODO implement me
|
||||
QApplication::clipboard()->setText(QString::fromLocal8Bit(str,len));
|
||||
}
|
||||
|
||||
#include "rfbserver.moc"
|
||||
|
||||
@@ -40,13 +40,14 @@ public:
|
||||
void setPasswordRequired(bool passwordRequired);
|
||||
|
||||
public Q_SLOTS:
|
||||
bool start();
|
||||
void stop(bool disconnectClients = true);
|
||||
virtual bool start();
|
||||
virtual void stop(bool disconnectClients = true);
|
||||
|
||||
void updateScreen(const QList<QRect> & modifiedTiles);
|
||||
void updateCursorPosition(const QPoint & position);
|
||||
|
||||
private Q_SLOTS:
|
||||
void krfbSendServerCutText();
|
||||
void onListenSocketActivated();
|
||||
void pendingClientFinished(RfbClient *client);
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
*/
|
||||
#include "trayicon.h"
|
||||
|
||||
#include "invitedialog.h"
|
||||
#include "manageinvitationsdialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "rfbservermanager.h"
|
||||
#include "rfbclient.h"
|
||||
|
||||
|
||||
@@ -1,95 +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 "tubesclienthandler.h"
|
||||
#include "tubesrfbserver.h"
|
||||
|
||||
#include <TelepathyQt4/ChannelClassSpecList>
|
||||
#include <TelepathyQt4/Constants>
|
||||
#include <TelepathyQt4/Debug>
|
||||
|
||||
#include <KDebug>
|
||||
|
||||
using namespace Tp;
|
||||
|
||||
static inline Tp::ChannelClassSpecList channelClassSpecList()
|
||||
{
|
||||
Tp::ChannelClassSpec spec = Tp::ChannelClassSpec();
|
||||
spec.setChannelType(TP_QT4_IFACE_CHANNEL_TYPE_STREAM_TUBE);
|
||||
spec.setTargetHandleType(Tp::HandleTypeContact);
|
||||
spec.setRequested(true);
|
||||
spec.setProperty(QLatin1String(TP_QT4_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service"),QVariant("rfb"));
|
||||
return Tp::ChannelClassSpecList() << spec;
|
||||
}
|
||||
|
||||
TubesClientHandler::TubesClientHandler()
|
||||
: AbstractClientHandler(channelClassSpecList())
|
||||
{
|
||||
kDebug();
|
||||
|
||||
Tp::enableDebug(false);
|
||||
Tp::enableWarnings(true);
|
||||
|
||||
/* Registering telepathy types */
|
||||
registerTypes();
|
||||
}
|
||||
|
||||
TubesClientHandler::~TubesClientHandler()
|
||||
{
|
||||
kDebug();
|
||||
}
|
||||
|
||||
bool TubesClientHandler::bypassApproval() const
|
||||
{
|
||||
// Don't bypass approval of channels.
|
||||
return false;
|
||||
}
|
||||
|
||||
void TubesClientHandler::handleChannels(const Tp::MethodInvocationContextPtr<> &context,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ConnectionPtr &connection,
|
||||
const QList<Tp::ChannelPtr> &channels,
|
||||
const QList<Tp::ChannelRequestPtr> &requestsSatisfied,
|
||||
const QDateTime &userActionTime,
|
||||
const Tp::AbstractClientHandler::HandlerInfo &handlerInfo)
|
||||
{
|
||||
kDebug();
|
||||
|
||||
Q_UNUSED(account);
|
||||
Q_UNUSED(connection);
|
||||
Q_UNUSED(requestsSatisfied);
|
||||
Q_UNUSED(userActionTime);
|
||||
Q_UNUSED(handlerInfo);
|
||||
|
||||
foreach(const Tp::ChannelPtr &channel, channels) {
|
||||
kDebug() << "Incoming channel: " << channel;
|
||||
|
||||
QVariantMap properties = channel->immutableProperties();
|
||||
|
||||
if (properties[TELEPATHY_INTERFACE_CHANNEL ".ChannelType"] ==
|
||||
TELEPATHY_INTERFACE_CHANNEL_TYPE_STREAM_TUBE) {
|
||||
|
||||
kDebug() << "Channel is a stream tube. Handling: " << channel;
|
||||
new TubesRfbServer(channel);
|
||||
}
|
||||
}
|
||||
context->setFinished();
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_TUBESCLIENTHANDLER_H
|
||||
#define KRFB_TUBESCLIENTHANDLER_H
|
||||
|
||||
#include <TelepathyQt4/AbstractClientHandler>
|
||||
|
||||
class TubesClientHandler : public Tp::AbstractClientHandler
|
||||
{
|
||||
public:
|
||||
TubesClientHandler();
|
||||
virtual ~TubesClientHandler();
|
||||
|
||||
virtual bool bypassApproval() const;
|
||||
virtual void handleChannels(const Tp::MethodInvocationContextPtr<> &context,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ConnectionPtr &connection,
|
||||
const QList<Tp::ChannelPtr> &channels,
|
||||
const QList<Tp::ChannelRequestPtr> &requestsSatisfied,
|
||||
const QDateTime &userActionTime,
|
||||
const Tp::AbstractClientHandler::HandlerInfo &handlerInfo);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
@@ -27,6 +27,14 @@ QString TubesRfbClient::name() const
|
||||
return m_contact->alias();
|
||||
}
|
||||
|
||||
//********
|
||||
|
||||
PendingTubesRfbClient::PendingTubesRfbClient(rfbClientPtr client, QObject* parent) :
|
||||
PendingRfbClient(client, parent),
|
||||
m_processNewClientCalled(false)
|
||||
{
|
||||
processNewClient();
|
||||
}
|
||||
|
||||
void PendingTubesRfbClient::setContact(const Tp::ContactPtr & contact)
|
||||
{
|
||||
@@ -52,24 +60,18 @@ void PendingTubesRfbClient::showConfirmationDialog()
|
||||
{
|
||||
QString name = m_contact->alias();
|
||||
|
||||
if (!KrfbConfig::askOnConnect()) {
|
||||
KNotification::event("NewConnectionAutoAccepted",
|
||||
i18n("Accepted connection from %1", name));
|
||||
accept(new TubesRfbClient(m_rfbClient, m_contact, parent()));
|
||||
} else {
|
||||
KNotification::event("NewConnectionOnHold",
|
||||
i18n("Received connection from %1, on hold (waiting for confirmation)",
|
||||
name));
|
||||
KNotification::event("NewConnectionOnHold",
|
||||
i18n("Received connection from %1, on hold (waiting for confirmation)",
|
||||
name));
|
||||
|
||||
TubesConnectionDialog *dialog = new TubesConnectionDialog(0);
|
||||
dialog->setContactName(name);
|
||||
dialog->setAllowRemoteControl(KrfbConfig::allowDesktopControl());
|
||||
TubesConnectionDialog *dialog = new TubesConnectionDialog(0);
|
||||
dialog->setContactName(name);
|
||||
dialog->setAllowRemoteControl(KrfbConfig::allowDesktopControl());
|
||||
|
||||
connect(dialog, SIGNAL(okClicked()), SLOT(dialogAccepted()));
|
||||
connect(dialog, SIGNAL(cancelClicked()), SLOT(reject()));
|
||||
connect(dialog, SIGNAL(okClicked()), SLOT(dialogAccepted()));
|
||||
connect(dialog, SIGNAL(cancelClicked()), SLOT(reject()));
|
||||
|
||||
dialog->show();
|
||||
}
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void PendingTubesRfbClient::dialogAccepted()
|
||||
|
||||
@@ -19,13 +19,15 @@
|
||||
#define TUBESRFBCLIENT_H
|
||||
|
||||
#include "rfbclient.h"
|
||||
#include <TelepathyQt4/Contact>
|
||||
#include <TelepathyQt/Contact>
|
||||
|
||||
class TubesRfbClient : public RfbClient
|
||||
{
|
||||
public:
|
||||
TubesRfbClient(rfbClientPtr client, const Tp::ContactPtr & contact, QObject* parent = 0)
|
||||
: RfbClient(client, parent), m_contact(contact) {}
|
||||
TubesRfbClient(rfbClientPtr client,
|
||||
const Tp::ContactPtr &contact, QObject *parent=0)
|
||||
: RfbClient(client, parent), m_contact(contact)
|
||||
{}
|
||||
|
||||
virtual QString name() const;
|
||||
|
||||
@@ -33,13 +35,13 @@ private:
|
||||
Tp::ContactPtr m_contact;
|
||||
};
|
||||
|
||||
//*********
|
||||
|
||||
class PendingTubesRfbClient : public PendingRfbClient
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PendingTubesRfbClient(rfbClientPtr client, QObject* parent = 0)
|
||||
: PendingRfbClient(client, parent), m_processNewClientCalled(false) {}
|
||||
PendingTubesRfbClient(rfbClientPtr client, QObject* parent = 0);
|
||||
|
||||
void setContact(const Tp::ContactPtr & contact);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009-2010 Collabora Ltd. <info@collabora.co.uk>
|
||||
Copyright (C) 2009-2011 Collabora Ltd. <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
|
||||
|
||||
@@ -20,85 +20,228 @@
|
||||
#include "tubesrfbclient.h"
|
||||
#include "sockethelpers.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <KDebug>
|
||||
#include <KMessageBox>
|
||||
#include <KLocale>
|
||||
#include <KRandom>
|
||||
|
||||
#include <TelepathyQt4/Connection>
|
||||
#include <TelepathyQt4/Contact>
|
||||
#include <TelepathyQt4/ContactManager>
|
||||
#include <TelepathyQt4/PendingContacts>
|
||||
#include <TelepathyQt4/PendingOperation>
|
||||
#include <TelepathyQt4/PendingReady>
|
||||
#include <TelepathyQt/Debug>
|
||||
#include <TelepathyQt/Contact>
|
||||
#include <TelepathyQt/AccountFactory>
|
||||
#include <TelepathyQt/ConnectionFactory>
|
||||
#include <TelepathyQt/ContactFactory>
|
||||
#include <TelepathyQt/ChannelFactory>
|
||||
#include <TelepathyQt/OutgoingStreamTubeChannel>
|
||||
#include <TelepathyQt/StreamTubeServer>
|
||||
|
||||
/* workaround for QtDBus bug */
|
||||
struct StreamTubeAddress
|
||||
{
|
||||
QString address;
|
||||
uint port;
|
||||
};
|
||||
Q_DECLARE_METATYPE(StreamTubeAddress);
|
||||
|
||||
//Marshall the StreamTubeAddress data into a D-Bus argument
|
||||
QDBusArgument &operator<<(QDBusArgument &argument,
|
||||
const StreamTubeAddress &streamTubeAddress)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument << streamTubeAddress.address << streamTubeAddress.port;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
// Retrieve the StreamTubeAddress data from the D-Bus argument
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument,
|
||||
StreamTubeAddress &streamTubeAddress)
|
||||
{
|
||||
argument.beginStructure();
|
||||
argument >> streamTubeAddress.address >> streamTubeAddress.port;
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
//**************
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
#include <TelepathyQt/AccountSet>
|
||||
#include <TelepathyQt/AccountManager>
|
||||
#include <TelepathyQt/PendingReady>
|
||||
#include <KTp/Models/contacts-list-model.h>
|
||||
#include <KTp/contact-factory.h>
|
||||
#endif
|
||||
|
||||
struct TubesRfbServer::Private
|
||||
{
|
||||
Tp::ChannelPtr channel;
|
||||
QHash<int, Tp::ContactPtr> contactsPerPort;
|
||||
QHash<int, PendingTubesRfbClient*> clientsPerPort;
|
||||
Tp::StreamTubeServerPtr stubeServer;
|
||||
QHash<quint16, Tp::ContactPtr> contactsPerPort;
|
||||
QHash<quint16, PendingTubesRfbClient*> clientsPerPort;
|
||||
};
|
||||
|
||||
TubesRfbServer::TubesRfbServer(const Tp::ChannelPtr & channel, QObject *parent)
|
||||
//static
|
||||
TubesRfbServer *TubesRfbServer::instance;
|
||||
|
||||
//static
|
||||
void TubesRfbServer::init()
|
||||
{
|
||||
instance = new TubesRfbServer;
|
||||
//RfbServerManager takes care of deletion
|
||||
|
||||
instance->startAndCheck();
|
||||
}
|
||||
|
||||
TubesRfbServer::TubesRfbServer(QObject *parent)
|
||||
: RfbServer(parent), d(new Private)
|
||||
{
|
||||
kDebug() << "starting ";
|
||||
kDebug() << "starting";
|
||||
|
||||
/* Registering struct containing the tube address */
|
||||
qDBusRegisterMetaType<StreamTubeAddress>();
|
||||
Tp::enableDebug(true);
|
||||
Tp::enableWarnings(true);
|
||||
Tp::registerTypes();
|
||||
|
||||
d->channel = channel;
|
||||
connect(d->channel->becomeReady(),
|
||||
SIGNAL(finished(Tp::PendingOperation *)),
|
||||
SLOT(onChannelReady(Tp::PendingOperation *)));
|
||||
Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(
|
||||
QDBusConnection::sessionBus(),
|
||||
Tp::Features() << Tp::Account::FeatureCore
|
||||
<< Tp::Account::FeatureAvatar
|
||||
<< Tp::Account::FeatureCapabilities
|
||||
<< Tp::Account::FeatureProtocolInfo
|
||||
<< Tp::Account::FeatureProfile);
|
||||
|
||||
setListeningPort(6789);
|
||||
setListeningAddress("127.0.0.1"); // Listen only on the loopback network interface
|
||||
Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(
|
||||
QDBusConnection::sessionBus(),
|
||||
Tp::Features() << Tp::Connection::FeatureCore
|
||||
<< Tp::Connection::FeatureSelfContact);
|
||||
|
||||
Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(
|
||||
QDBusConnection::sessionBus());
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
Tp::ContactFactoryPtr contactFactory = KTp::ContactFactory::create(
|
||||
Tp::Features() << Tp::Contact::FeatureAlias
|
||||
<<Tp::Contact::FeatureAvatarToken
|
||||
<<Tp::Contact::FeatureAvatarData
|
||||
<<Tp::Contact::FeatureSimplePresence
|
||||
<<Tp::Contact::FeatureCapabilities
|
||||
<<Tp::Contact::FeatureClientTypes);
|
||||
|
||||
m_accountManager = Tp::AccountManager::create(
|
||||
QDBusConnection::sessionBus(),
|
||||
accountFactory,
|
||||
connectionFactory,
|
||||
channelFactory,
|
||||
contactFactory);
|
||||
|
||||
d->stubeServer = Tp::StreamTubeServer::create(
|
||||
m_accountManager,
|
||||
QStringList() << QLatin1String("rfb"),
|
||||
QStringList(),
|
||||
QLatin1String("krfb_rfb_handler"),
|
||||
true);
|
||||
|
||||
connect(m_accountManager->becomeReady(),
|
||||
SIGNAL(finished(Tp::PendingOperation*)),
|
||||
this,
|
||||
SLOT(onAccountManagerReady()));
|
||||
|
||||
m_contactsListModel = new KTp::ContactsListModel(this);
|
||||
#else
|
||||
Tp::ContactFactoryPtr contactFactory = Tp::ContactFactory::create(
|
||||
Tp::Contact::FeatureAlias);
|
||||
|
||||
d->stubeServer = Tp::StreamTubeServer::create(
|
||||
QStringList() << QLatin1String("rfb"),
|
||||
QStringList(),
|
||||
QLatin1String("krfb_rfb_handler"),
|
||||
true,
|
||||
accountFactory,
|
||||
connectionFactory,
|
||||
channelFactory,
|
||||
contactFactory);
|
||||
#endif //KRFB_WITH_KDE_TELEPATHY
|
||||
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(tubeRequested(Tp::AccountPtr,Tp::OutgoingStreamTubeChannelPtr,
|
||||
QDateTime,Tp::ChannelRequestHints)),
|
||||
SLOT(onTubeRequested()));
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(tubeClosed(Tp::AccountPtr,Tp::OutgoingStreamTubeChannelPtr,QString,QString)),
|
||||
SLOT(onTubeClosed()));
|
||||
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(newTcpConnection(QHostAddress,quint16,Tp::AccountPtr,
|
||||
Tp::ContactPtr,Tp::OutgoingStreamTubeChannelPtr)),
|
||||
SLOT(onNewTcpConnection(QHostAddress,quint16,Tp::AccountPtr,
|
||||
Tp::ContactPtr,Tp::OutgoingStreamTubeChannelPtr)));
|
||||
connect(d->stubeServer.data(),
|
||||
SIGNAL(tcpConnectionClosed(QHostAddress,quint16,Tp::AccountPtr,Tp::ContactPtr,
|
||||
QString,QString,Tp::OutgoingStreamTubeChannelPtr)),
|
||||
SLOT(onTcpConnectionClosed(QHostAddress,quint16,Tp::AccountPtr,Tp::ContactPtr,
|
||||
QString,QString,Tp::OutgoingStreamTubeChannelPtr)));
|
||||
|
||||
// Pick a random port in the private range (49152–65535)
|
||||
setListeningPort((KRandom::random() % 16383) + 49152);
|
||||
// Listen only on the loopback network interface
|
||||
setListeningAddress("127.0.0.1");
|
||||
setPasswordRequired(false);
|
||||
}
|
||||
|
||||
TubesRfbServer::~TubesRfbServer()
|
||||
{
|
||||
kDebug();
|
||||
stop();
|
||||
delete d;
|
||||
}
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
KTp::ContactsListModel *TubesRfbServer::contactsListModel()
|
||||
{
|
||||
return m_contactsListModel;
|
||||
}
|
||||
#endif
|
||||
|
||||
void TubesRfbServer::startAndCheck()
|
||||
{
|
||||
if (!start()) {
|
||||
//try a few times with different ports
|
||||
bool ok = false;
|
||||
for (int i=0; !ok && i<5; i++) {
|
||||
setListeningPort((KRandom::random() % 16383) + 49152);
|
||||
ok = start();
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
kError() << "Failed to start tubes rfb server";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO listeningAddress() should be a QHostAddress
|
||||
d->stubeServer->exportTcpSocket(QHostAddress(QString::fromAscii(listeningAddress())),
|
||||
listeningPort());
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTubeRequested()
|
||||
{
|
||||
kDebug() << "Got a tube";
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTubeClosed()
|
||||
{
|
||||
kDebug() << "tube closed";
|
||||
}
|
||||
|
||||
void TubesRfbServer::onNewTcpConnection(const QHostAddress & sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr & account,
|
||||
const Tp::ContactPtr & contact,
|
||||
const Tp::OutgoingStreamTubeChannelPtr & tube)
|
||||
{
|
||||
Q_UNUSED(account);
|
||||
Q_UNUSED(tube);
|
||||
|
||||
kDebug() << "CM signaled tube connection from" << sourceAddress << ":" << sourcePort;
|
||||
|
||||
d->contactsPerPort[sourcePort] = contact;
|
||||
if (d->clientsPerPort.contains(sourcePort)) {
|
||||
kDebug() << "client already exists";
|
||||
d->clientsPerPort[sourcePort]->setContact(contact);
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTcpConnectionClosed(const QHostAddress& sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr& account,
|
||||
const Tp::ContactPtr& contact,
|
||||
const QString& error,
|
||||
const QString& message,
|
||||
const Tp::OutgoingStreamTubeChannelPtr& tube)
|
||||
{
|
||||
Q_UNUSED(account);
|
||||
Q_UNUSED(contact);
|
||||
Q_UNUSED(tube);
|
||||
|
||||
kDebug() << "Connection from" << sourceAddress << ":" << sourcePort << "closed."
|
||||
<< error << message;
|
||||
|
||||
d->clientsPerPort.remove(sourcePort);
|
||||
d->contactsPerPort.remove(sourcePort);
|
||||
}
|
||||
|
||||
PendingRfbClient* TubesRfbServer::newClient(rfbClientPtr client)
|
||||
{
|
||||
kDebug() << "new tubes client";
|
||||
|
||||
PendingTubesRfbClient *c = new PendingTubesRfbClient(client, this);
|
||||
int port = peerPort(client->sock);
|
||||
quint16 port = peerPort(client->sock);
|
||||
|
||||
kDebug() << "new tube client on port" << port;
|
||||
|
||||
d->clientsPerPort[port] = c;
|
||||
if (d->contactsPerPort.contains(port)) {
|
||||
@@ -109,186 +252,11 @@ PendingRfbClient* TubesRfbServer::newClient(rfbClientPtr client)
|
||||
return c;
|
||||
}
|
||||
|
||||
/************************** TP TUBES CODE ************************************/
|
||||
|
||||
void TubesRfbServer::close()
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
void TubesRfbServer::onAccountManagerReady()
|
||||
{
|
||||
kDebug();
|
||||
d->channel->requestClose();
|
||||
}
|
||||
|
||||
void TubesRfbServer::cleanup()
|
||||
{
|
||||
kDebug();
|
||||
|
||||
d->clientsPerPort.clear();
|
||||
d->contactsPerPort.clear();
|
||||
|
||||
stop();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void TubesRfbServer::onChannelReady(Tp::PendingOperation *op)
|
||||
{
|
||||
kDebug();
|
||||
|
||||
if (op->isError()) {
|
||||
kWarning() << "Getting channel ready faied:" << op->errorName() << op->errorMessage();
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
Tp::Contacts contacts = d->channel->groupContacts();
|
||||
|
||||
Tp::ContactManagerPtr contactManager = d->channel->connection()->contactManager();
|
||||
|
||||
if (!contactManager) {
|
||||
kWarning() << "Invalid Contact Manager.";
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An unknown error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
Tp::Features features;
|
||||
features << Tp::Contact::FeatureAlias;
|
||||
|
||||
connect(contactManager->upgradeContacts(contacts.toList(), features),
|
||||
SIGNAL(finished(Tp::PendingOperation*)),
|
||||
SLOT(onContactsUpgraded(Tp::PendingOperation*)));
|
||||
}
|
||||
|
||||
void TubesRfbServer::onContactsUpgraded(Tp::PendingOperation *op)
|
||||
{
|
||||
kDebug();
|
||||
|
||||
if (op->isError()) {
|
||||
kWarning() << "Upgrading contacts failed:" << op->errorName() << op->errorMessage();
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An unknown error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
offerTube();
|
||||
}
|
||||
|
||||
void TubesRfbServer::offerTube()
|
||||
{
|
||||
kDebug() << "Channel is ready!";
|
||||
|
||||
//start the rfb server
|
||||
if (!start()) {
|
||||
kWarning() << "Could not start rfb server";
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("Failed to activate the rfb server."),
|
||||
i18n("Error"));
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
connect(d->channel.data(),
|
||||
SIGNAL(invalidated(Tp::DBusProxy*, const QString&, const QString&)),
|
||||
SLOT(onChannelInvalidated(Tp::DBusProxy*, const QString&,
|
||||
const QString&)));
|
||||
|
||||
/* Interface used to control the tube state */
|
||||
Tp::Client::ChannelInterfaceTubeInterface *tubeInterface = d->channel->interface<Tp::Client::ChannelInterfaceTubeInterface>();
|
||||
|
||||
/* Interface used to control stream tube */
|
||||
Tp::Client::ChannelTypeStreamTubeInterface *streamTubeInterface = d->channel->interface<Tp::Client::ChannelTypeStreamTubeInterface>();
|
||||
|
||||
if (streamTubeInterface && tubeInterface) {
|
||||
kDebug() << "Offering tube";
|
||||
|
||||
connect(tubeInterface,
|
||||
SIGNAL(TubeChannelStateChanged(uint)),
|
||||
SLOT(onTubeStateChanged(uint)));
|
||||
|
||||
// Offer the stream tube
|
||||
StreamTubeAddress streamTubeAddress;
|
||||
streamTubeAddress.address = listeningAddress();
|
||||
streamTubeAddress.port = listeningPort();
|
||||
|
||||
kDebug() << "Offering:" << streamTubeAddress.port << streamTubeAddress.address;
|
||||
|
||||
QDBusVariant address;
|
||||
address.setVariant(qVariantFromValue(streamTubeAddress));
|
||||
|
||||
QDBusPendingReply<> ret = streamTubeInterface->Offer(
|
||||
uint(Tp::SocketAddressTypeIPv4),
|
||||
address,
|
||||
uint(Tp::SocketAccessControlPort),
|
||||
QVariantMap());
|
||||
|
||||
connect(new QDBusPendingCallWatcher(ret, this), SIGNAL(finished(QDBusPendingCallWatcher*)),
|
||||
SLOT(onOfferTubeFinished(QDBusPendingCallWatcher*)));
|
||||
connect(streamTubeInterface,
|
||||
SIGNAL(NewRemoteConnection(uint, QDBusVariant, uint)),
|
||||
SLOT(onNewRemoteConnection(uint, QDBusVariant, uint)));
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onOfferTubeFinished(QDBusPendingCallWatcher *watcher)
|
||||
{
|
||||
QDBusPendingReply<void> reply = *watcher;
|
||||
if (reply.isError()) {
|
||||
kWarning() << "Offer tube failed:" << reply.error();
|
||||
|
||||
if (reply.error().name() == TELEPATHY_ERROR_NOT_AVAILABLE) {
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An error occurred sharing your desktop. The person you are "
|
||||
"trying to share your desktop with does not have the required "
|
||||
"software installed to access it."),
|
||||
i18n("Error"));
|
||||
} else {
|
||||
KMessageBox::error(QApplication::activeWindow(),
|
||||
i18n("An unknown error occurred sharing your desktop."),
|
||||
i18n("Error"));
|
||||
}
|
||||
} else {
|
||||
kDebug() << "Offer Tube succeeded.";
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onTubeStateChanged(uint state)
|
||||
{
|
||||
kDebug() << "Tube state changed:" << state;
|
||||
}
|
||||
|
||||
void TubesRfbServer::onNewRemoteConnection(uint handle, QDBusVariant connectionParam, uint connectionId)
|
||||
{
|
||||
Q_UNUSED(connectionId);
|
||||
|
||||
QVariant v = connectionParam.variant();
|
||||
kDebug() << "variant:" << v;
|
||||
StreamTubeAddress ipv4address = qdbus_cast<StreamTubeAddress>(v);
|
||||
|
||||
kDebug() << "NewRemoteConnection: port:" << ipv4address.port << ipv4address.address;
|
||||
|
||||
Q_FOREACH(const Tp::ContactPtr & c, d->channel->groupContacts()) {
|
||||
if (c->handle().value(0) == handle) {
|
||||
d->contactsPerPort[ipv4address.port] = c;
|
||||
if (d->clientsPerPort.contains(ipv4address.port)) {
|
||||
kDebug() << "client already exists";
|
||||
d->clientsPerPort[ipv4address.port]->setContact(c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TubesRfbServer::onChannelInvalidated(Tp::DBusProxy *proxy,
|
||||
const QString &errorName, const QString &errorMessage)
|
||||
{
|
||||
Q_UNUSED(proxy);
|
||||
kDebug() << "Tube channel invalidated:" << errorName << errorMessage;
|
||||
cleanup();
|
||||
m_contactsListModel->setAccountManager(m_accountManager);
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "tubesrfbserver.moc"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2009-2010 Collabora Ltd. <info@collabora.co.uk>
|
||||
Copyright (C) 2009-2011 Collabora Ltd. <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
|
||||
|
||||
@@ -20,33 +20,67 @@
|
||||
#define TUBESRFBSERVER_H
|
||||
|
||||
#include "rfbserver.h"
|
||||
#include <TelepathyQt4/Channel>
|
||||
#include <QtNetwork/QHostAddress>
|
||||
#include <TelepathyQt/Types>
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
namespace KTp {
|
||||
class ContactsListModel;
|
||||
}
|
||||
#endif
|
||||
|
||||
class TubesRfbServer : public RfbServer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TubesRfbServer(const Tp::ChannelPtr & channel, QObject* parent = 0);
|
||||
static TubesRfbServer *instance;
|
||||
static void init();
|
||||
|
||||
virtual ~TubesRfbServer();
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
KTp::ContactsListModel *contactsListModel();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
TubesRfbServer(QObject *parent = 0);
|
||||
|
||||
virtual PendingRfbClient* newClient(rfbClientPtr client);
|
||||
|
||||
private Q_SLOTS:
|
||||
void close();
|
||||
void cleanup();
|
||||
void onChannelReady(Tp::PendingOperation *op);
|
||||
void onContactsUpgraded(Tp::PendingOperation *op);
|
||||
void offerTube();
|
||||
void onOfferTubeFinished(QDBusPendingCallWatcher *watcher);
|
||||
void onTubeStateChanged(uint state);
|
||||
void onNewRemoteConnection(uint handle, QDBusVariant connectionParam, uint connectionId);
|
||||
void onChannelInvalidated(Tp::DBusProxy *proxy,
|
||||
const QString &errorName,
|
||||
const QString &errorMessage);
|
||||
void startAndCheck();
|
||||
|
||||
void onTubeRequested();
|
||||
void onTubeClosed();
|
||||
|
||||
void onNewTcpConnection(
|
||||
const QHostAddress &sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ContactPtr &contact,
|
||||
const Tp::OutgoingStreamTubeChannelPtr &tube);
|
||||
|
||||
void onTcpConnectionClosed(
|
||||
const QHostAddress &sourceAddress,
|
||||
quint16 sourcePort,
|
||||
const Tp::AccountPtr &account,
|
||||
const Tp::ContactPtr &contact,
|
||||
const QString &error,
|
||||
const QString &message,
|
||||
const Tp::OutgoingStreamTubeChannelPtr &tube);
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
void onAccountManagerReady();
|
||||
#endif
|
||||
|
||||
private:
|
||||
struct Private;
|
||||
Private *const d;
|
||||
|
||||
#ifdef KRFB_WITH_KDE_TELEPATHY
|
||||
KTp::ContactsListModel *m_contactsListModel;
|
||||
Tp::AccountManagerPtr m_accountManager;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#endif // TUBESRFBSERVER_H
|
||||
|
||||
@@ -11,19 +11,6 @@
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_askOnConnect">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ask before accepting connections</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_allowDesktopControl">
|
||||
<property name="text">
|
||||
@@ -34,36 +21,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_allowUninvitedConnections">
|
||||
<property name="text">
|
||||
<string>Allow uninvited connections</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Uninvited connections password:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>kcfg_uninvitedConnectionPassword</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="kcfg_uninvitedConnectionPassword">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
@@ -79,46 +36,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>klineedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>kcfg_allowUninvitedConnections</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>kcfg_uninvitedConnectionPassword</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>98</x>
|
||||
<y>21</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>192</x>
|
||||
<y>137</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>kcfg_allowUninvitedConnections</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>label</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>117</x>
|
||||
<y>20</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>120</x>
|
||||
<y>94</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
537
krfb/ui/mainwidget.ui
Normal file
537
krfb/ui/mainwidget.ui
Normal file
@@ -0,0 +1,537 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWidget</class>
|
||||
<widget class="QWidget" name="MainWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>340</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>340</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="krfbIconLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="rightLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="titleLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>KDE Desktop Sharing</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>KDE Desktop Sharing</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="aboutLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>KDE Desktop Sharing</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>KDE Desktop Sharing allows you to grant permission to someone at a remote location for viewing and possibly controlling your desktop.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="enableSharingCheckBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Starts/Stops Remote Desktop Sharing</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Enable Desktop Sharing</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="detailsGroupBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Connection Details</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="addressFormLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="formAlignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="addressLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Address</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>addressAboutButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="addressGridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="addressAboutButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>More about this address</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="help-about">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="addressDisplayLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Address required by remote users to connect to your desktop. Click about button on the right for more info.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>127.0.0.1 : 5900</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="passwordFormLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="formAlignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="passwordLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Password</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>passwordEditButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="passwordGridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="passwordEditButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Edit/Save Desktop Sharing Password</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="document-edit">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="passwordDisplayLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Password required by remote users to connect to your desktop. Click the edit button on the right to change password.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TemporaryPassword</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="unattendedGroupBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Unattended Access allows a remote user with the password to gain control to your desktop without your explicit confirmation.</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Unattended Access</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="unattendedDetailsLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="unattendedAboutLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Unattended Access allows a remote user with the password to gain control to your desktop without your explicit confirmation. Click "About" button on right to know more.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unattended Access allows a remote user with the password to gain control to your desktop without your explicit confirmation.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="unattendedAboutButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Know more about Unattended Access</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="help-about">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="unattendedSettingsLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="enableUnattendedCheckBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Starts/Stops unattended access to your desktop. Click on button on right to change password, and "About" button to know more.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable &Unattended Access</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="unattendedPasswordButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Change password for Unattended Access</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Change Unattended Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="tpContactsLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KPushButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>kpushbutton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>enableSharingCheckBox</tabstop>
|
||||
<tabstop>addressAboutButton</tabstop>
|
||||
<tabstop>passwordEditButton</tabstop>
|
||||
<tabstop>enableUnattendedCheckBox</tabstop>
|
||||
<tabstop>unattendedPasswordButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>enableSharingCheckBox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>detailsGroupBox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>382</x>
|
||||
<y>87</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>245</x>
|
||||
<y>140</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>enableSharingCheckBox</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>unattendedGroupBox</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>320</x>
|
||||
<y>76</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>325</x>
|
||||
<y>214</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,190 +0,0 @@
|
||||
<ui version="4.0" >
|
||||
<class>ManageInvitationsDialog</class>
|
||||
<widget class="QWidget" name="ManageInvitationsDialog" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>550</width>
|
||||
<height>337</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Manage Invitations - Desktop Sharing</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="1" colspan="2" >
|
||||
<widget class="QLabel" name="TextLabel2" >
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Welcome to KDE Desktop Sharing</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2" >
|
||||
<widget class="QLabel" name="helpLabel" >
|
||||
<property name="text" >
|
||||
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">KDE Desktop Sharing allows you to invite somebody at a remote location to watch and possibly control your desktop. <a href="whatsthis">More about invitations...</a></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat" >
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags" >
|
||||
<set>Qt::LinksAccessibleByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="3" row="2" column="0" >
|
||||
<widget class="QLabel" name="pixmapLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Maximum" hsizetype="Maximum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="5" row="2" column="1" >
|
||||
<widget class="QTreeWidget" name="invitationWidget" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<horstretch>2</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alternatingRowColors" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="rootIsDecorated" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Creation Time</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Expire Time</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>155</width>
|
||||
<height>62</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="2" >
|
||||
<widget class="QPushButton" name="newPersonalInvitationButton" >
|
||||
<property name="toolTip" >
|
||||
<string>Create a new personal invitation...</string>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click this button to create a new personal invitation.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>New &Personal Invitation...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" >
|
||||
<widget class="QPushButton" name="newEmailInvitationButton" >
|
||||
<property name="toolTip" >
|
||||
<string>Send a new invitation via email...</string>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click this button to send a new invitation via email.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&New Email Invitation...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2" >
|
||||
<widget class="QPushButton" name="deleteAllButton" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Delete all invitations</string>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Deletes all open invitations.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Delete All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2" >
|
||||
<widget class="QPushButton" name="deleteOneButton" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Delete the selected invitation</string>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Delete the selected invitation. The invited person will not be able to connect using this invitation anymore.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>invitationWidget</tabstop>
|
||||
<tabstop>newPersonalInvitationButton</tabstop>
|
||||
<tabstop>newEmailInvitationButton</tabstop>
|
||||
<tabstop>deleteAllButton</tabstop>
|
||||
<tabstop>deleteOneButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,205 +0,0 @@
|
||||
<ui version="4.0" >
|
||||
<class>PersonalInviteWidget</class>
|
||||
<widget class="QWidget" name="PersonalInviteWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>567</width>
|
||||
<height>324</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<widget class="QLabel" name="pixmapLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<item>
|
||||
<widget class="QLabel" name="mainTextLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy" >
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Personal Invitation</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Give the information below to the person that you want to invite (<a href="htc">how to connect</a>). Note that everybody who gets the password can connect, so be careful.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="kActiveLabel5" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string><b>Host:</b></string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QLabel" name="hostLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy" >
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="textInteractionFlags" >
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<widget class="QLabel" name="hostHelpLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="help">Help</a></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="kActiveLabel6" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string><b>Password:</b></string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QLabel" name="passwordLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy" >
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="textInteractionFlags" >
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="kActiveLabel7" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string><b>Expiration time:</b></string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QLabel" name="expirationLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy" >
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>65</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,4 +1,16 @@
|
||||
project(libvncserver)
|
||||
# Striped down version of libvncserver's original CMakeLists.txt
|
||||
|
||||
project(LibVNCServer)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckTypeSize)
|
||||
include(TestBigEndian)
|
||||
include(MacroBoolTo01)
|
||||
|
||||
set(FULL_PACKAGE_NAME "Krfb LibVNCServer")
|
||||
set(PACKAGE_VERSION "0.9.8-10-g17ce0c5")
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
macro_optional_find_package(ZLIB)
|
||||
macro_log_feature(ZLIB_FOUND "ZLib" "The Zlib compression library" "http://www.zlib.net" FALSE "" "Used by the vncserver library.")
|
||||
@@ -6,36 +18,61 @@ macro_log_feature(ZLIB_FOUND "ZLib" "The Zlib compression library" "http://www.z
|
||||
macro_optional_find_package(JPEG)
|
||||
macro_log_feature(JPEG_FOUND "LibJPEG" "The JPEG library" "" FALSE "" "Used by the vncserver library")
|
||||
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(TestBigEndian)
|
||||
|
||||
macro_bool_to_01(ZLIB_FOUND LIBVNCSERVER_HAVE_LIBZ)
|
||||
macro_bool_to_01(JPEG_FOUND LIBVNCSERVER_HAVE_LIBJPEG)
|
||||
option(LIBVNCSERVER_ALLOW24BPP "Allow 24 bpp" ON)
|
||||
# if(GNUTLS_FOUND)
|
||||
# set(LIBVNCSERVER_WITH_CLIENT_TLS 1)
|
||||
# endif(GNUTLS_FOUND)
|
||||
# if(LIBGCRYPT_LIBRARIES)
|
||||
# message(STATUS "Found libgcrypt: ${LIBGCRYPT_LIBRARIES}")
|
||||
# set(LIBVNCSERVER_WITH_CLIENT_GCRYPT 1)
|
||||
# endif(LIBGCRYPT_LIBRARIES)
|
||||
|
||||
check_include_files(fcntl.h LIBVNCSERVER_HAVE_FCNTL_H)
|
||||
check_include_files(unistd.h LIBVNCSERVER_HAVE_UNISTD_H)
|
||||
check_include_files(sys/socket.h LIBVNCSERVER_HAVE_SYS_SOCKET_H)
|
||||
check_include_files(sys/types.h LIBVNCSERVER_HAVE_SYS_TYPES_H)
|
||||
check_include_files(sys/stat.h LIBVNCSERVER_HAVE_SYS_STAT_H)
|
||||
check_include_files(sys/time.h LIBVNCSERVER_HAVE_SYS_TIME_H)
|
||||
check_include_files(netinet/in.h LIBVNCSERVER_HAVE_NETINET_IN_H)
|
||||
check_include_files(stdint.h LIBVNCSERVER_HAVE_STDINT_H)
|
||||
check_include_files(ifaddrs.h LIBVNCSERVER_HAVE_IFADDRS_H)
|
||||
|
||||
check_function_exists(gettimeofday LIBVNCSERVER_HAVE_GETTIMEOFDAY)
|
||||
check_include_file("fcntl.h" LIBVNCSERVER_HAVE_FCNTL_H)
|
||||
check_include_file("netinet/in.h" LIBVNCSERVER_HAVE_NETINET_IN_H)
|
||||
check_include_file("sys/socket.h" LIBVNCSERVER_HAVE_SYS_SOCKET_H)
|
||||
check_include_file("sys/stat.h" LIBVNCSERVER_HAVE_SYS_STAT_H)
|
||||
check_include_file("sys/time.h" LIBVNCSERVER_HAVE_SYS_TIME_H)
|
||||
check_include_file("sys/types.h" LIBVNCSERVER_HAVE_SYS_TYPES_H)
|
||||
check_include_file("sys/wait.h" LIBVNCSERVER_HAVE_SYS_WAIT_H)
|
||||
check_include_file("unistd.h" LIBVNCSERVER_HAVE_UNISTD_H)
|
||||
|
||||
# headers needed for check_type_size()
|
||||
check_include_file("arpa/inet.h" HAVE_ARPA_INET_H)
|
||||
check_include_file("stdint.h" HAVE_STDINT_H)
|
||||
check_include_file("stddef.h" HAVE_STDDEF_H)
|
||||
check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
|
||||
check_function_exists(gettimeofday LIBVNCSERVER_HAVE_GETTIMEOFDAY)
|
||||
|
||||
macro_bool_to_01(CMAKE_USE_PTHREADS_INIT LIBVNCSERVER_HAVE_LIBPTHREAD)
|
||||
if(LIBVNCSERVER_HAVE_SYS_SOCKET_H)
|
||||
# socklen_t
|
||||
list(APPEND CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
|
||||
endif(LIBVNCSERVER_HAVE_SYS_SOCKET_H)
|
||||
if(HAVE_ARPA_INET_H)
|
||||
# in_addr_t
|
||||
list(APPEND CMAKE_EXTRA_INCLUDE_FILES "arpa/inet.h")
|
||||
endif(HAVE_ARPA_INET_H)
|
||||
|
||||
check_type_size(pid_t LIBVNCSERVER_PID_T)
|
||||
check_type_size(size_t LIBVNCSERVER_SIZE_T)
|
||||
check_type_size(socklen_t LIBVNCSERVER_SOCKLEN_T)
|
||||
check_type_size(in_addr_t LIBVNCSERVER_IN_ADDR_T)
|
||||
if(NOT HAVE_LIBVNCSERVER_IN_ADDR_T)
|
||||
set(LIBVNCSERVER_NEED_INADDR_T 1)
|
||||
endif(NOT HAVE_LIBVNCSERVER_IN_ADDR_T)
|
||||
|
||||
test_big_endian(LIBVNCSERVER_WORDS_BIGENDIAN)
|
||||
|
||||
set(LIBVNCSERVER_PACKAGE_STRING "Krfb ${KDE_VERSION} - LibVNCServer 0.9.7")
|
||||
|
||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/libvncserver-config.h.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libvncserver-config.h
|
||||
)
|
||||
|
||||
|
||||
set(LIBVNCSERVER_SRCS
|
||||
set(LIBVNCSERVER_SOURCES
|
||||
main.c
|
||||
rfbserver.c
|
||||
rfbregion.c
|
||||
@@ -60,24 +97,36 @@ set(LIBVNCSERVER_SRCS
|
||||
scale.c
|
||||
)
|
||||
|
||||
if (ZLIB_FOUND)
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
set(LIBVNCSERVER_SRCS ${LIBVNCSERVER_SRCS} zlib.c zrle.c zrleoutstream.c zrlepalettehelper.c zywrletemplate.c)
|
||||
if(ZLIB_FOUND)
|
||||
add_definitions(-DLIBVNCSERVER_HAVE_LIBZ)
|
||||
include_directories(${ZLIB_INCLUDE_DIR})
|
||||
set(LIBVNCSERVER_SOURCES
|
||||
${LIBVNCSERVER_SOURCES}
|
||||
zlib.c
|
||||
zrle.c
|
||||
zrleoutstream.c
|
||||
zrlepalettehelper.c
|
||||
)
|
||||
endif(ZLIB_FOUND)
|
||||
|
||||
if (JPEG_FOUND)
|
||||
include_directories(${JPEG_INCLUDE_DIR})
|
||||
set(LIBVNCSERVER_SRCS ${LIBVNCSERVER_SRCS} tight.c)
|
||||
endif()
|
||||
endif()
|
||||
if(JPEG_FOUND)
|
||||
add_definitions(-DLIBVNCSERVER_HAVE_LIBJPEG)
|
||||
include_directories(${JPEG_INCLUDE_DIR})
|
||||
set(LIBVNCSERVER_SOURCES
|
||||
${LIBVNCSERVER_SOURCES}
|
||||
tight.c
|
||||
)
|
||||
endif(JPEG_FOUND)
|
||||
|
||||
|
||||
add_library(vncserver STATIC ${LIBVNCSERVER_SRCS})
|
||||
add_library(vncserver STATIC ${LIBVNCSERVER_SOURCES})
|
||||
|
||||
if(WIN32)
|
||||
set(ADDITIONAL_LIBS ws2_32)
|
||||
endif(WIN32)
|
||||
|
||||
if (ZLIB_FOUND)
|
||||
target_link_libraries(vncserver ${ZLIB_LIBRARIES})
|
||||
|
||||
if (JPEG_FOUND)
|
||||
target_link_libraries(vncserver ${JPEG_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(vncserver
|
||||
${ADDITIONAL_LIBS}
|
||||
${ZLIB_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
)
|
||||
|
||||
0
libvncserver/auth.c
Executable file → Normal file
0
libvncserver/auth.c
Executable file → Normal file
88
libvncserver/corre.c
Executable file → Normal file
88
libvncserver/corre.c
Executable file → Normal file
@@ -30,37 +30,19 @@
|
||||
#include "rfb/rfb.h"
|
||||
|
||||
/*
|
||||
* rreBeforeBuf contains pixel data in the client's format.
|
||||
* rreAfterBuf contains the RRE encoded version. If the RRE encoded version is
|
||||
* larger than the raw data or if it exceeds rreAfterBufSize then
|
||||
* cl->beforeEncBuf contains pixel data in the client's format.
|
||||
* cl->afterEncBuf contains the RRE encoded version. If the RRE encoded version is
|
||||
* larger than the raw data or if it exceeds cl->afterEncBufSize then
|
||||
* raw encoding is used instead.
|
||||
*/
|
||||
|
||||
static int rreBeforeBufSize = 0;
|
||||
static char *rreBeforeBuf = NULL;
|
||||
|
||||
static int rreAfterBufSize = 0;
|
||||
static char *rreAfterBuf = NULL;
|
||||
static int rreAfterBufLen = 0;
|
||||
|
||||
static int subrectEncode8(uint8_t *data, int w, int h);
|
||||
static int subrectEncode16(uint16_t *data, int w, int h);
|
||||
static int subrectEncode32(uint32_t *data, int w, int h);
|
||||
static int subrectEncode8(rfbClientPtr cl, uint8_t *data, int w, int h);
|
||||
static int subrectEncode16(rfbClientPtr cl, uint16_t *data, int w, int h);
|
||||
static int subrectEncode32(rfbClientPtr cl, uint32_t *data, int w, int h);
|
||||
static uint32_t getBgColour(char *data, int size, int bpp);
|
||||
static rfbBool rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y,
|
||||
int w, int h);
|
||||
|
||||
void rfbCoRRECleanup(rfbScreenInfoPtr screen)
|
||||
{
|
||||
if (rreBeforeBufSize) {
|
||||
free(rreBeforeBuf);
|
||||
rreBeforeBufSize=0;
|
||||
}
|
||||
if (rreAfterBufSize) {
|
||||
free(rreAfterBuf);
|
||||
rreAfterBufSize=0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* rfbSendRectEncodingCoRRE - send an arbitrary size rectangle using CoRRE
|
||||
@@ -114,35 +96,35 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
|
||||
int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height
|
||||
* (cl->format.bitsPerPixel / 8));
|
||||
|
||||
if (rreBeforeBufSize < maxRawSize) {
|
||||
rreBeforeBufSize = maxRawSize;
|
||||
if (rreBeforeBuf == NULL)
|
||||
rreBeforeBuf = (char *)malloc(rreBeforeBufSize);
|
||||
if (cl->beforeEncBufSize < maxRawSize) {
|
||||
cl->beforeEncBufSize = maxRawSize;
|
||||
if (cl->beforeEncBuf == NULL)
|
||||
cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
|
||||
else
|
||||
rreBeforeBuf = (char *)realloc(rreBeforeBuf, rreBeforeBufSize);
|
||||
cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
|
||||
}
|
||||
|
||||
if (rreAfterBufSize < maxRawSize) {
|
||||
rreAfterBufSize = maxRawSize;
|
||||
if (rreAfterBuf == NULL)
|
||||
rreAfterBuf = (char *)malloc(rreAfterBufSize);
|
||||
if (cl->afterEncBufSize < maxRawSize) {
|
||||
cl->afterEncBufSize = maxRawSize;
|
||||
if (cl->afterEncBuf == NULL)
|
||||
cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
|
||||
else
|
||||
rreAfterBuf = (char *)realloc(rreAfterBuf, rreAfterBufSize);
|
||||
cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
|
||||
}
|
||||
|
||||
(*cl->translateFn)(cl->translateLookupTable,&(cl->screen->serverFormat),
|
||||
&cl->format, fbptr, rreBeforeBuf,
|
||||
&cl->format, fbptr, cl->beforeEncBuf,
|
||||
cl->scaledScreen->paddedWidthInBytes, w, h);
|
||||
|
||||
switch (cl->format.bitsPerPixel) {
|
||||
case 8:
|
||||
nSubrects = subrectEncode8((uint8_t *)rreBeforeBuf, w, h);
|
||||
nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h);
|
||||
break;
|
||||
case 16:
|
||||
nSubrects = subrectEncode16((uint16_t *)rreBeforeBuf, w, h);
|
||||
nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h);
|
||||
break;
|
||||
case 32:
|
||||
nSubrects = subrectEncode32((uint32_t *)rreBeforeBuf, w, h);
|
||||
nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h);
|
||||
break;
|
||||
default:
|
||||
rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
|
||||
@@ -157,7 +139,7 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
|
||||
}
|
||||
|
||||
rfbStatRecordEncodingSent(cl,rfbEncodingCoRRE,
|
||||
sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + rreAfterBufLen,
|
||||
sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen,
|
||||
sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8));
|
||||
|
||||
if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
|
||||
@@ -182,15 +164,15 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
|
||||
memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader);
|
||||
cl->ublen += sz_rfbRREHeader;
|
||||
|
||||
for (i = 0; i < rreAfterBufLen;) {
|
||||
for (i = 0; i < cl->afterEncBufLen;) {
|
||||
|
||||
int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
|
||||
|
||||
if (i + bytesToCopy > rreAfterBufLen) {
|
||||
bytesToCopy = rreAfterBufLen - i;
|
||||
if (i + bytesToCopy > cl->afterEncBufLen) {
|
||||
bytesToCopy = cl->afterEncBufLen - i;
|
||||
}
|
||||
|
||||
memcpy(&cl->updateBuf[cl->ublen], &rreAfterBuf[i], bytesToCopy);
|
||||
memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
|
||||
|
||||
cl->ublen += bytesToCopy;
|
||||
i += bytesToCopy;
|
||||
@@ -210,7 +192,7 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
|
||||
* subrectEncode() encodes the given multicoloured rectangle as a background
|
||||
* colour overwritten by single-coloured rectangles. It returns the number
|
||||
* of subrectangles in the encoded buffer, or -1 if subrect encoding won't
|
||||
* fit in the buffer. It puts the encoded rectangles in rreAfterBuf. The
|
||||
* fit in the buffer. It puts the encoded rectangles in cl->afterEncBuf. The
|
||||
* single-colour rectangle partition is not optimal, but does find the biggest
|
||||
* horizontal or vertical rectangle top-left anchored to each consecutive
|
||||
* coordinate position.
|
||||
@@ -221,7 +203,7 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
|
||||
|
||||
#define DEFINE_SUBRECT_ENCODE(bpp) \
|
||||
static int \
|
||||
subrectEncode##bpp(uint##bpp##_t *data, int w, int h) { \
|
||||
subrectEncode##bpp(rfbClientPtr client, uint##bpp##_t *data, int w, int h) { \
|
||||
uint##bpp##_t cl; \
|
||||
rfbCoRRERectangle subrect; \
|
||||
int x,y; \
|
||||
@@ -236,9 +218,9 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) { \
|
||||
int newLen; \
|
||||
uint##bpp##_t bg = (uint##bpp##_t)getBgColour((char*)data,w*h,bpp); \
|
||||
\
|
||||
*((uint##bpp##_t*)rreAfterBuf) = bg; \
|
||||
*((uint##bpp##_t*)client->afterEncBuf) = bg; \
|
||||
\
|
||||
rreAfterBufLen = (bpp/8); \
|
||||
client->afterEncBufLen = (bpp/8); \
|
||||
\
|
||||
for (y=0; y<h; y++) { \
|
||||
line = data+(y*w); \
|
||||
@@ -283,15 +265,15 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) { \
|
||||
subrect.w = thew; \
|
||||
subrect.h = theh; \
|
||||
\
|
||||
newLen = rreAfterBufLen + (bpp/8) + sz_rfbCoRRERectangle; \
|
||||
if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize)) \
|
||||
newLen = client->afterEncBufLen + (bpp/8) + sz_rfbCoRRERectangle; \
|
||||
if ((newLen > (w * h * (bpp/8))) || (newLen > client->afterEncBufSize)) \
|
||||
return -1; \
|
||||
\
|
||||
numsubs += 1; \
|
||||
*((uint##bpp##_t*)(rreAfterBuf + rreAfterBufLen)) = cl; \
|
||||
rreAfterBufLen += (bpp/8); \
|
||||
memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle); \
|
||||
rreAfterBufLen += sz_rfbCoRRERectangle; \
|
||||
*((uint##bpp##_t*)(client->afterEncBuf + client->afterEncBufLen)) = cl; \
|
||||
client->afterEncBufLen += (bpp/8); \
|
||||
memcpy(&client->afterEncBuf[client->afterEncBufLen],&subrect,sz_rfbCoRRERectangle); \
|
||||
client->afterEncBufLen += sz_rfbCoRRERectangle; \
|
||||
\
|
||||
/* \
|
||||
* Now mark the subrect as done. \
|
||||
|
||||
@@ -410,7 +410,7 @@ void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor
|
||||
for(i=0,bit=0x80;i<cursor->width;i++,bit=(bit&1)?0x80:bit>>1) {
|
||||
if (interp) {
|
||||
int r = 0, g = 0, b = 0, grey;
|
||||
char *p = cursor->richSource+j*width+i*bpp;
|
||||
unsigned char *p = cursor->richSource+j*width+i*bpp;
|
||||
if (bpp == 1) {
|
||||
unsigned char* uc = (unsigned char*) p;
|
||||
SETRGB(uc);
|
||||
@@ -693,10 +693,13 @@ void rfbRedrawAfterHideCursor(rfbClientPtr cl,sraRegionPtr updateRegion)
|
||||
if(sraClipRect2(&x,&y,&x2,&y2,0,0,s->width,s->height)) {
|
||||
sraRegionPtr rect;
|
||||
rect = sraRgnCreateRect(x,y,x2,y2);
|
||||
if(updateRegion)
|
||||
if(updateRegion) {
|
||||
sraRgnOr(updateRegion,rect);
|
||||
else
|
||||
} else {
|
||||
LOCK(cl->updateMutex);
|
||||
sraRgnOr(cl->modifiedRegion,rect);
|
||||
UNLOCK(cl->updateMutex);
|
||||
}
|
||||
sraRgnDestroy(rect);
|
||||
}
|
||||
}
|
||||
|
||||
0
libvncserver/cutpaste.c
Executable file → Normal file
0
libvncserver/cutpaste.c
Executable file → Normal file
0
libvncserver/d3des.c
Executable file → Normal file
0
libvncserver/d3des.c
Executable file → Normal file
0
libvncserver/d3des.h
Executable file → Normal file
0
libvncserver/d3des.h
Executable file → Normal file
0
libvncserver/draw.c
Executable file → Normal file
0
libvncserver/draw.c
Executable file → Normal file
3
libvncserver/font.c
Executable file → Normal file
3
libvncserver/font.c
Executable file → Normal file
@@ -24,7 +24,8 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
|
||||
d=*data;
|
||||
data++;
|
||||
}
|
||||
if(d&0x80)
|
||||
if(d&0x80 && y+j >= 0 && y+j < rfbScreen->height &&
|
||||
x+i >= 0 && x+i < rfbScreen->width)
|
||||
memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,colour,bpp);
|
||||
d<<=1;
|
||||
}
|
||||
|
||||
0
libvncserver/hextile.c
Executable file → Normal file
0
libvncserver/hextile.c
Executable file → Normal file
28
libvncserver/httpd.c
Executable file → Normal file
28
libvncserver/httpd.c
Executable file → Normal file
@@ -181,7 +181,6 @@ rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
|
||||
}
|
||||
|
||||
if (FD_ISSET(rfbScreen->httpListenSock, &fds)) {
|
||||
int flags;
|
||||
if (rfbScreen->httpSock >= 0) close(rfbScreen->httpSock);
|
||||
|
||||
if ((rfbScreen->httpSock = accept(rfbScreen->httpListenSock,
|
||||
@@ -189,35 +188,21 @@ rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
|
||||
rfbLogPerror("httpCheckFds: accept");
|
||||
return;
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
rfbErr("O_NONBLOCK on MinGW32 NOT IMPLEMENTED");
|
||||
#else
|
||||
#ifdef USE_LIBWRAP
|
||||
if(!hosts_ctl("vnc",STRING_UNKNOWN,inet_ntoa(addr.sin_addr),
|
||||
STRING_UNKNOWN)) {
|
||||
rfbLog("Rejected HTTP connection from client %s\n",
|
||||
inet_ntoa(addr.sin_addr));
|
||||
#else
|
||||
flags = fcntl(rfbScreen->httpSock, F_GETFL);
|
||||
|
||||
if (flags < 0 || fcntl(rfbScreen->httpSock, F_SETFL, flags | O_NONBLOCK) == -1) {
|
||||
rfbLogPerror("httpCheckFds: fcntl");
|
||||
#endif
|
||||
close(rfbScreen->httpSock);
|
||||
rfbScreen->httpSock = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
flags=fcntl(rfbScreen->httpSock,F_GETFL);
|
||||
if(flags==-1 ||
|
||||
fcntl(rfbScreen->httpSock,F_SETFL,flags|O_NONBLOCK)==-1) {
|
||||
rfbLogPerror("httpCheckFds: fcntl");
|
||||
close(rfbScreen->httpSock);
|
||||
rfbScreen->httpSock=-1;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!rfbSetNonBlocking(rfbScreen->httpSock)) {
|
||||
close(rfbScreen->httpSock);
|
||||
rfbScreen->httpSock=-1;
|
||||
return;
|
||||
}
|
||||
/*AddEnabledDevice(httpSock);*/
|
||||
}
|
||||
}
|
||||
@@ -284,6 +269,9 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
|
||||
if (got == 0) {
|
||||
rfbErr("httpd: premature connection close\n");
|
||||
} else {
|
||||
#ifdef WIN32
|
||||
errno=WSAGetLastError();
|
||||
#endif
|
||||
if (errno == EAGAIN) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,95 @@
|
||||
#cmakedefine LIBVNCSERVER_HAVE_LIBZ
|
||||
#cmakedefine LIBVNCSERVER_HAVE_LIBJPEG
|
||||
#ifndef _RFB_RFBCONFIG_H
|
||||
#define _RFB_RFBCONFIG_H
|
||||
|
||||
#define LIBVNCSERVER_PACKAGE_STRING "@LIBVNCSERVER_PACKAGE_STRING@"
|
||||
/* rfb/rfbconfig.h. Generated automatically by cmake. */
|
||||
|
||||
#cmakedefine LIBVNCSERVER_HAVE_FCNTL_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_IFADDRS_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_NETINET_IN_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_STDINT_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_SOCKET_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_TIME_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_TYPES_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_STAT_H
|
||||
#cmakedefine LIBVNCSERVER_HAVE_UNISTD_H
|
||||
#cmakedefine LIBVNCSERVER_WORDS_BIGENDIAN
|
||||
/* Enable 24 bit per pixel in native framebuffer */
|
||||
#cmakedefine LIBVNCSERVER_ALLOW24BPP 1
|
||||
|
||||
#cmakedefine LIBVNCSERVER_HAVE_GETTIMEOFDAY
|
||||
/* work around when write() returns ENOENT but does not mean it */
|
||||
#cmakedefine LIBVNCSERVER_ENOENT_WORKAROUND 1
|
||||
|
||||
#define LIBVNCSERVER_ALLOW24BPP
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the `jpeg' library (-ljpeg). */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_LIBJPEG 1
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_LIBPTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_LIBZ 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine LIBVNCSERVER_HAVE_UNISTD_H 1
|
||||
|
||||
/* Need a typedef for in_addr_t */
|
||||
#cmakedefine LIBVNCSERVER_NEED_INADDR_T 1
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define LIBVNCSERVER_PACKAGE_STRING "@FULL_PACKAGE_NAME@ @PACKAGE_VERSION@"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define LIBVNCSERVER_PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||
|
||||
/* Define to 1 if libgcrypt is present */
|
||||
#cmakedefine LIBVNCSERVER_WITH_CLIENT_GCRYPT 1
|
||||
|
||||
/* Define to 1 if GnuTLS is present */
|
||||
#cmakedefine LIBVNCSERVER_WITH_CLIENT_TLS 1
|
||||
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#cmakedefine LIBVNCSERVER_WORDS_BIGENDIAN 1
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#cmakedefine const @CMAKE_CONST@
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
#cmakedefine inline @CMAKE_INLINE@
|
||||
#endif
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#cmakedefine HAVE_LIBVNCSERVER_PID_T 1
|
||||
#ifndef HAVE_LIBVNCSERVER_PID_T
|
||||
typedef int pid_t;
|
||||
#endif
|
||||
|
||||
/* The type for size_t */
|
||||
#cmakedefine HAVE_LIBVNCSERVER_SIZE_T 1
|
||||
#ifndef HAVE_LIBVNCSERVER_SIZE_T
|
||||
typedef int size_t;
|
||||
#endif
|
||||
|
||||
/* The type for socklen */
|
||||
#cmakedefine HAVE_LIBVNCSERVER_SOCKLEN_T 1
|
||||
#ifndef HAVE_LIBVNCSERVER_SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
/* once: _RFB_RFBCONFIG_H */
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
/* lzoconf.h -- configuration for the LZO real-time data compression library
|
||||
/* lzoconf.h -- configuration of the LZO data compression library
|
||||
|
||||
This file is part of the LZO real-time data compression library.
|
||||
|
||||
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
|
||||
All Rights Reserved.
|
||||
|
||||
The LZO library is free software; you can redistribute it and/or
|
||||
@@ -24,7 +18,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with the LZO library; see the file COPYING.
|
||||
If not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Markus F.X.J. Oberhumer
|
||||
<markus@oberhumer.com>
|
||||
@@ -32,22 +26,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __LZOCONF_H
|
||||
#define __LZOCONF_H
|
||||
#ifndef __LZOCONF_H_INCLUDED
|
||||
#define __LZOCONF_H_INCLUDED 1
|
||||
|
||||
#define LZO_VERSION 0x1080
|
||||
#define LZO_VERSION_STRING "1.08"
|
||||
#define LZO_VERSION_DATE "Jul 12 2002"
|
||||
#define LZO_VERSION 0x2070
|
||||
#define LZO_VERSION_STRING "2.07"
|
||||
#define LZO_VERSION_DATE "Jun 25 2014"
|
||||
|
||||
/* internal Autoconf configuration file - only used when building LZO */
|
||||
#if defined(LZO_HAVE_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
@@ -57,88 +48,38 @@ extern "C" {
|
||||
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
|
||||
# error "invalid CHAR_BIT"
|
||||
#endif
|
||||
#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
|
||||
#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
|
||||
# error "check your compiler installation"
|
||||
#endif
|
||||
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
|
||||
# error "your limits.h macros are broken"
|
||||
#endif
|
||||
|
||||
/* workaround a cpp bug under hpux 10.20 */
|
||||
#define LZO_0xffffffffL 4294967295ul
|
||||
/* get OS and architecture defines */
|
||||
#ifndef __LZODEFS_H_INCLUDED
|
||||
#include "lzodefs.h"
|
||||
#endif
|
||||
|
||||
#if !defined(LZO_UINT32_C)
|
||||
# if (UINT_MAX < LZO_0xffffffffL)
|
||||
# define LZO_UINT32_C(c) c ## UL
|
||||
# else
|
||||
# define LZO_UINT32_C(c) c ## U
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// architecture defines
|
||||
// some core defines
|
||||
************************************************************************/
|
||||
|
||||
#if !defined(__LZO_WIN) && !defined(__LZO_DOS) && !defined(__LZO_OS2)
|
||||
# if defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
|
||||
# define __LZO_WIN
|
||||
# elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
|
||||
# define __LZO_WIN
|
||||
# elif defined(__NT__) || defined(__NT_DLL__) || defined(__WINDOWS_386__)
|
||||
# define __LZO_WIN
|
||||
# elif defined(__DOS__) || defined(__MSDOS__) || defined(MSDOS)
|
||||
# define __LZO_DOS
|
||||
# elif defined(__OS2__) || defined(__OS2V2__) || defined(OS2)
|
||||
# define __LZO_OS2
|
||||
# elif defined(__palmos__)
|
||||
# define __LZO_PALMOS
|
||||
# elif defined(__TOS__) || defined(__atarist__)
|
||||
# define __LZO_TOS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (UINT_MAX < LZO_0xffffffffL)
|
||||
# if defined(__LZO_WIN)
|
||||
# define __LZO_WIN16
|
||||
# elif defined(__LZO_DOS)
|
||||
# define __LZO_DOS16
|
||||
# elif defined(__LZO_PALMOS)
|
||||
# define __LZO_PALMOS16
|
||||
# elif defined(__LZO_TOS)
|
||||
# define __LZO_TOS16
|
||||
# elif defined(__C166__)
|
||||
# else
|
||||
/* porting hint: for pure 16-bit architectures try compiling
|
||||
* everything with -D__LZO_STRICT_16BIT */
|
||||
# error "16-bit target not supported - contact me for porting hints"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(__LZO_i386)
|
||||
# if defined(__LZO_DOS) || defined(__LZO_WIN16)
|
||||
# define __LZO_i386
|
||||
# elif defined(__i386__) || defined(__386__) || defined(_M_IX86)
|
||||
# define __LZO_i386
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__LZO_STRICT_16BIT)
|
||||
# if (UINT_MAX < LZO_0xffffffffL)
|
||||
# include <lzo16bit.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* memory checkers */
|
||||
#if !defined(__LZO_CHECKER)
|
||||
# if defined(__BOUNDS_CHECKING_ON)
|
||||
# define __LZO_CHECKER
|
||||
# define __LZO_CHECKER 1
|
||||
# elif defined(__CHECKER__)
|
||||
# define __LZO_CHECKER
|
||||
# define __LZO_CHECKER 1
|
||||
# elif defined(__INSURE__)
|
||||
# define __LZO_CHECKER
|
||||
# define __LZO_CHECKER 1
|
||||
# elif defined(__PURIFY__)
|
||||
# define __LZO_CHECKER
|
||||
# define __LZO_CHECKER 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -147,36 +88,31 @@ extern "C" {
|
||||
// integral and pointer types
|
||||
************************************************************************/
|
||||
|
||||
/* Integral types with 32 bits or more */
|
||||
#if !defined(LZO_UINT32_MAX)
|
||||
# if (UINT_MAX >= LZO_0xffffffffL)
|
||||
typedef unsigned int lzo_uint32;
|
||||
typedef int lzo_int32;
|
||||
# define LZO_UINT32_MAX UINT_MAX
|
||||
# define LZO_INT32_MAX INT_MAX
|
||||
# define LZO_INT32_MIN INT_MIN
|
||||
# elif (ULONG_MAX >= LZO_0xffffffffL)
|
||||
typedef unsigned long lzo_uint32;
|
||||
typedef long lzo_int32;
|
||||
# define LZO_UINT32_MAX ULONG_MAX
|
||||
# define LZO_INT32_MAX LONG_MAX
|
||||
# define LZO_INT32_MIN LONG_MIN
|
||||
# else
|
||||
# error "lzo_uint32"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* lzo_uint is used like size_t */
|
||||
/* lzo_uint must match size_t */
|
||||
#if !defined(LZO_UINT_MAX)
|
||||
# if (UINT_MAX >= LZO_0xffffffffL)
|
||||
# if (LZO_ABI_LLP64)
|
||||
# if (LZO_OS_WIN64)
|
||||
typedef unsigned __int64 lzo_uint;
|
||||
typedef __int64 lzo_int;
|
||||
# else
|
||||
typedef lzo_ullong_t lzo_uint;
|
||||
typedef lzo_llong_t lzo_int;
|
||||
# endif
|
||||
# define LZO_SIZEOF_LZO_UINT 8
|
||||
# define LZO_UINT_MAX 0xffffffffffffffffull
|
||||
# define LZO_INT_MAX 9223372036854775807LL
|
||||
# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
|
||||
# elif (LZO_ABI_IP32L64) /* MIPS R5900 */
|
||||
typedef unsigned int lzo_uint;
|
||||
typedef int lzo_int;
|
||||
# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_INT
|
||||
# define LZO_UINT_MAX UINT_MAX
|
||||
# define LZO_INT_MAX INT_MAX
|
||||
# define LZO_INT_MIN INT_MIN
|
||||
# elif (ULONG_MAX >= LZO_0xffffffffL)
|
||||
typedef unsigned long lzo_uint;
|
||||
typedef long lzo_int;
|
||||
# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LONG
|
||||
# define LZO_UINT_MAX ULONG_MAX
|
||||
# define LZO_INT_MAX LONG_MAX
|
||||
# define LZO_INT_MIN LONG_MIN
|
||||
@@ -185,73 +121,83 @@ extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The larger type of lzo_uint and lzo_uint32_t. */
|
||||
#if (LZO_SIZEOF_LZO_UINT >= 4)
|
||||
# define lzo_xint lzo_uint
|
||||
#else
|
||||
# define lzo_xint lzo_uint32_t
|
||||
#endif
|
||||
|
||||
typedef int lzo_bool;
|
||||
|
||||
/* sanity checks */
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT)
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
|
||||
|
||||
/***********************************************************************
|
||||
// memory models
|
||||
************************************************************************/
|
||||
|
||||
/* Memory model for the public code segment. */
|
||||
#if !defined(__LZO_CMODEL)
|
||||
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
||||
# define __LZO_CMODEL __far
|
||||
# elif defined(__LZO_i386) && defined(__WATCOMC__)
|
||||
# define __LZO_CMODEL __near
|
||||
# else
|
||||
# define __LZO_CMODEL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Memory model for the public data segment. */
|
||||
#if !defined(__LZO_DMODEL)
|
||||
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
||||
# define __LZO_DMODEL __far
|
||||
# elif defined(__LZO_i386) && defined(__WATCOMC__)
|
||||
# define __LZO_DMODEL __near
|
||||
# else
|
||||
# define __LZO_DMODEL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Memory model that allows to access memory at offsets of lzo_uint. */
|
||||
#if !defined(__LZO_MMODEL)
|
||||
# if (LZO_UINT_MAX <= UINT_MAX)
|
||||
# define __LZO_MMODEL
|
||||
# elif defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
||||
# define __LZO_MMODEL __huge
|
||||
# define LZO_999_UNSUPPORTED
|
||||
# elif defined(__LZO_PALMOS16) || defined(__LZO_TOS16)
|
||||
# define __LZO_MMODEL
|
||||
# else
|
||||
# error "__LZO_MMODEL"
|
||||
# endif
|
||||
#ifndef __LZO_MMODEL
|
||||
#define __LZO_MMODEL /*empty*/
|
||||
#endif
|
||||
|
||||
/* no typedef here because of const-pointer issues */
|
||||
#define lzo_byte unsigned char __LZO_MMODEL
|
||||
#define lzo_bytep unsigned char __LZO_MMODEL *
|
||||
#define lzo_charp char __LZO_MMODEL *
|
||||
#define lzo_voidp void __LZO_MMODEL *
|
||||
#define lzo_shortp short __LZO_MMODEL *
|
||||
#define lzo_ushortp unsigned short __LZO_MMODEL *
|
||||
#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
|
||||
#define lzo_int32p lzo_int32 __LZO_MMODEL *
|
||||
#define lzo_uintp lzo_uint __LZO_MMODEL *
|
||||
#define lzo_intp lzo_int __LZO_MMODEL *
|
||||
#define lzo_uintp lzo_uint __LZO_MMODEL *
|
||||
#define lzo_xintp lzo_xint __LZO_MMODEL *
|
||||
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
|
||||
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
|
||||
|
||||
#ifndef lzo_sizeof_dict_t
|
||||
# define lzo_sizeof_dict_t sizeof(lzo_bytep)
|
||||
#define lzo_int8_tp lzo_int8_t __LZO_MMODEL *
|
||||
#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL *
|
||||
#define lzo_int16_tp lzo_int16_t __LZO_MMODEL *
|
||||
#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL *
|
||||
#define lzo_int32_tp lzo_int32_t __LZO_MMODEL *
|
||||
#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL *
|
||||
#if defined(lzo_int64_t)
|
||||
#define lzo_int64_tp lzo_int64_t __LZO_MMODEL *
|
||||
#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL *
|
||||
#endif
|
||||
|
||||
/* Older LZO versions used to support ancient systems and memory models
|
||||
* like 16-bit MSDOS with __huge pointers and Cray PVP, but these
|
||||
* obsolete configurations are not supported any longer.
|
||||
*/
|
||||
#if defined(__LZO_MMODEL_HUGE)
|
||||
#error "__LZO_MMODEL_HUGE is unsupported"
|
||||
#endif
|
||||
#if (LZO_MM_PVP)
|
||||
#error "LZO_MM_PVP is unsupported"
|
||||
#endif
|
||||
#if (LZO_SIZEOF_INT < 4)
|
||||
#error "LZO_SIZEOF_INT < 4 is unsupported"
|
||||
#endif
|
||||
#if (__LZO_UINTPTR_T_IS_POINTER)
|
||||
#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
|
||||
#endif
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4)
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4)
|
||||
/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should
|
||||
* work but have not received much testing lately, so be strict here.
|
||||
*/
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp))
|
||||
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep))
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// calling conventions and function types
|
||||
// function types
|
||||
************************************************************************/
|
||||
|
||||
/* linkage */
|
||||
/* name mangling */
|
||||
#if !defined(__LZO_EXTERN_C)
|
||||
# ifdef __cplusplus
|
||||
# define __LZO_EXTERN_C extern "C"
|
||||
@@ -262,115 +208,90 @@ typedef int lzo_bool;
|
||||
|
||||
/* calling convention */
|
||||
#if !defined(__LZO_CDECL)
|
||||
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
||||
# define __LZO_CDECL __LZO_CMODEL __cdecl
|
||||
# elif defined(__LZO_i386) && defined(_MSC_VER)
|
||||
# define __LZO_CDECL __LZO_CMODEL __cdecl
|
||||
# elif defined(__LZO_i386) && defined(__WATCOMC__)
|
||||
# define __LZO_CDECL __LZO_CMODEL __cdecl
|
||||
# else
|
||||
# define __LZO_CDECL __LZO_CMODEL
|
||||
# endif
|
||||
# define __LZO_CDECL __lzo_cdecl
|
||||
#endif
|
||||
#if !defined(__LZO_ENTRY)
|
||||
# define __LZO_ENTRY __LZO_CDECL
|
||||
#endif
|
||||
|
||||
/* C++ exception specification for extern "C" function types */
|
||||
#if !defined(__cplusplus)
|
||||
# undef LZO_NOTHROW
|
||||
# define LZO_NOTHROW
|
||||
#elif !defined(LZO_NOTHROW)
|
||||
# define LZO_NOTHROW
|
||||
#endif
|
||||
|
||||
|
||||
typedef int
|
||||
(__LZO_ENTRY *lzo_compress_t) ( const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_ENTRY *lzo_decompress_t) ( const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_ENTRY *lzo_optimize_t) ( lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_ENTRY *lzo_compress_dict_t)(const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem,
|
||||
const lzo_byte *dict, lzo_uint dict_len );
|
||||
|
||||
typedef int
|
||||
(__LZO_ENTRY *lzo_decompress_dict_t)(const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem,
|
||||
const lzo_byte *dict, lzo_uint dict_len );
|
||||
|
||||
|
||||
/* assembler versions always use __cdecl */
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_compress_asm_t)( const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_decompress_asm_t)( const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
|
||||
/* a progress indicator callback function */
|
||||
typedef void (__LZO_ENTRY *lzo_progress_callback_t) (lzo_uint, lzo_uint);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
// export information
|
||||
************************************************************************/
|
||||
|
||||
/* DLL export information */
|
||||
#if !defined(__LZO_EXPORT1)
|
||||
# define __LZO_EXPORT1
|
||||
# define __LZO_EXPORT1 /*empty*/
|
||||
#endif
|
||||
#if !defined(__LZO_EXPORT2)
|
||||
# define __LZO_EXPORT2
|
||||
# define __LZO_EXPORT2 /*empty*/
|
||||
#endif
|
||||
|
||||
/* exported calling convention for C functions */
|
||||
/* __cdecl calling convention for public C and assembly functions */
|
||||
#if !defined(LZO_PUBLIC)
|
||||
# define LZO_PUBLIC(_rettype) \
|
||||
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_ENTRY
|
||||
# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
|
||||
#endif
|
||||
#if !defined(LZO_EXTERN)
|
||||
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
|
||||
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
|
||||
#endif
|
||||
#if !defined(LZO_PRIVATE)
|
||||
# define LZO_PRIVATE(_rettype) static _rettype __LZO_ENTRY
|
||||
# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL
|
||||
#endif
|
||||
|
||||
/* exported __cdecl calling convention for assembler functions */
|
||||
#if !defined(LZO_PUBLIC_CDECL)
|
||||
# define LZO_PUBLIC_CDECL(_rettype) \
|
||||
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
|
||||
#endif
|
||||
#if !defined(LZO_EXTERN_CDECL)
|
||||
# define LZO_EXTERN_CDECL(_rettype) __LZO_EXTERN_C LZO_PUBLIC_CDECL(_rettype)
|
||||
#endif
|
||||
/* function types */
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
/* exported global variables (LZO currently uses no static variables and
|
||||
* is fully thread safe) */
|
||||
#if !defined(LZO_PUBLIC_VAR)
|
||||
# define LZO_PUBLIC_VAR(_type) \
|
||||
__LZO_EXPORT1 _type __LZO_EXPORT2 __LZO_DMODEL
|
||||
#endif
|
||||
#if !defined(LZO_EXTERN_VAR)
|
||||
# define LZO_EXTERN_VAR(_type) extern LZO_PUBLIC_VAR(_type)
|
||||
#endif
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem,
|
||||
const lzo_bytep dict, lzo_uint dict_len );
|
||||
|
||||
typedef int
|
||||
(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem,
|
||||
const lzo_bytep dict, lzo_uint dict_len );
|
||||
|
||||
|
||||
/* Callback interface. Currently only the progress indicator ("nprogress")
|
||||
* is used, but this may change in a future release. */
|
||||
|
||||
struct lzo_callback_t;
|
||||
typedef struct lzo_callback_t lzo_callback_t;
|
||||
#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
|
||||
|
||||
/* malloc & free function types */
|
||||
typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
|
||||
(lzo_callback_p self, lzo_uint items, lzo_uint size);
|
||||
typedef void (__LZO_CDECL *lzo_free_func_t)
|
||||
(lzo_callback_p self, lzo_voidp ptr);
|
||||
|
||||
/* a progress indicator callback function */
|
||||
typedef void (__LZO_CDECL *lzo_progress_func_t)
|
||||
(lzo_callback_p, lzo_uint, lzo_uint, int);
|
||||
|
||||
struct lzo_callback_t
|
||||
{
|
||||
/* custom allocators (set to 0 to disable) */
|
||||
lzo_alloc_func_t nalloc; /* [not used right now] */
|
||||
lzo_free_func_t nfree; /* [not used right now] */
|
||||
|
||||
/* a progress indicator callback function (set to 0 to disable) */
|
||||
lzo_progress_func_t nprogress;
|
||||
|
||||
/* INFO: the first parameter "self" of the nalloc/nfree/nprogress
|
||||
* callbacks points back to this struct, so you are free to store
|
||||
* some extra info in the following variables. */
|
||||
lzo_voidp user1;
|
||||
lzo_xint user2;
|
||||
lzo_xint user3;
|
||||
};
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
@@ -383,26 +304,35 @@ typedef void (__LZO_ENTRY *lzo_progress_callback_t) (lzo_uint, lzo_uint);
|
||||
*/
|
||||
#define LZO_E_OK 0
|
||||
#define LZO_E_ERROR (-1)
|
||||
#define LZO_E_OUT_OF_MEMORY (-2) /* not used right now */
|
||||
#define LZO_E_NOT_COMPRESSIBLE (-3) /* not used right now */
|
||||
#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */
|
||||
#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
|
||||
#define LZO_E_INPUT_OVERRUN (-4)
|
||||
#define LZO_E_OUTPUT_OVERRUN (-5)
|
||||
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
|
||||
#define LZO_E_EOF_NOT_FOUND (-7)
|
||||
#define LZO_E_INPUT_NOT_CONSUMED (-8)
|
||||
#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
|
||||
#define LZO_E_INVALID_ARGUMENT (-10)
|
||||
#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */
|
||||
#define LZO_E_OUTPUT_NOT_CONSUMED (-12)
|
||||
#define LZO_E_INTERNAL_ERROR (-99)
|
||||
|
||||
|
||||
#ifndef lzo_sizeof_dict_t
|
||||
# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
|
||||
#endif
|
||||
|
||||
/* lzo_init() should be the first function you call.
|
||||
* Check the return code !
|
||||
*
|
||||
* lzo_init() is a macro to allow checking that the library and the
|
||||
* compiler's view of various types are consistent.
|
||||
*/
|
||||
#define lzo_init() __lzo_init2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
|
||||
(int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
|
||||
#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
|
||||
(int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\
|
||||
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
|
||||
(int)sizeof(lzo_compress_t))
|
||||
LZO_EXTERN(int) __lzo_init2(unsigned,int,int,int,int,int,int,int,int,int);
|
||||
(int)sizeof(lzo_callback_t))
|
||||
LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
|
||||
|
||||
/* version functions (useful for shared libraries) */
|
||||
LZO_EXTERN(unsigned) lzo_version(void);
|
||||
@@ -413,34 +343,95 @@ LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
|
||||
|
||||
/* string functions */
|
||||
LZO_EXTERN(int)
|
||||
lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
|
||||
lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len);
|
||||
LZO_EXTERN(lzo_voidp)
|
||||
lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
|
||||
lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
|
||||
LZO_EXTERN(lzo_voidp)
|
||||
lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
|
||||
lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
|
||||
LZO_EXTERN(lzo_voidp)
|
||||
lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
|
||||
lzo_memset(lzo_voidp buf, int c, lzo_uint len);
|
||||
|
||||
/* checksum functions */
|
||||
LZO_EXTERN(lzo_uint32)
|
||||
lzo_adler32(lzo_uint32 _adler, const lzo_byte *_buf, lzo_uint _len);
|
||||
LZO_EXTERN(lzo_uint32)
|
||||
lzo_crc32(lzo_uint32 _c, const lzo_byte *_buf, lzo_uint _len);
|
||||
LZO_EXTERN(lzo_uint32_t)
|
||||
lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
|
||||
LZO_EXTERN(lzo_uint32_t)
|
||||
lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
|
||||
LZO_EXTERN(const lzo_uint32_tp)
|
||||
lzo_get_crc32_table(void);
|
||||
|
||||
/* misc. */
|
||||
LZO_EXTERN(lzo_bool) lzo_assert(int _expr);
|
||||
LZO_EXTERN(int) _lzo_config_check(void);
|
||||
typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
|
||||
typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
|
||||
typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
|
||||
typedef union {
|
||||
lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04;
|
||||
void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;
|
||||
#if defined(lzo_int64_t)
|
||||
lzo_uint64_t a10;
|
||||
#endif
|
||||
} lzo_align_t;
|
||||
|
||||
/* align a char pointer on a boundary that is a multiple of `size' */
|
||||
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
|
||||
#define LZO_PTR_ALIGN_UP(_ptr,_size) \
|
||||
((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
|
||||
/* align a char pointer on a boundary that is a multiple of 'size' */
|
||||
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
|
||||
#define LZO_PTR_ALIGN_UP(p,size) \
|
||||
((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size)))
|
||||
|
||||
/* deprecated - only for backward compatibility */
|
||||
#define LZO_ALIGN(_ptr,_size) LZO_PTR_ALIGN_UP(_ptr,_size)
|
||||
|
||||
/***********************************************************************
|
||||
// deprecated macros - only for backward compatibility
|
||||
************************************************************************/
|
||||
|
||||
/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
|
||||
#define lzo_byte unsigned char
|
||||
/* deprecated type names */
|
||||
#define lzo_int32 lzo_int32_t
|
||||
#define lzo_uint32 lzo_uint32_t
|
||||
#define lzo_int32p lzo_int32_t __LZO_MMODEL *
|
||||
#define lzo_uint32p lzo_uint32_t __LZO_MMODEL *
|
||||
#define LZO_INT32_MAX LZO_INT32_C(2147483647)
|
||||
#define LZO_UINT32_MAX LZO_UINT32_C(4294967295)
|
||||
#if defined(lzo_int64_t)
|
||||
#define lzo_int64 lzo_int64_t
|
||||
#define lzo_uint64 lzo_uint64_t
|
||||
#define lzo_int64p lzo_int64_t __LZO_MMODEL *
|
||||
#define lzo_uint64p lzo_uint64_t __LZO_MMODEL *
|
||||
#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807)
|
||||
#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615)
|
||||
#endif
|
||||
/* deprecated types */
|
||||
typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u;
|
||||
typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
|
||||
|
||||
#if defined(LZO_CFG_COMPAT)
|
||||
|
||||
#define __LZOCONF_H 1
|
||||
|
||||
#if defined(LZO_ARCH_I086)
|
||||
# define __LZO_i386 1
|
||||
#elif defined(LZO_ARCH_I386)
|
||||
# define __LZO_i386 1
|
||||
#endif
|
||||
|
||||
#if defined(LZO_OS_DOS16)
|
||||
# define __LZO_DOS 1
|
||||
# define __LZO_DOS16 1
|
||||
#elif defined(LZO_OS_DOS32)
|
||||
# define __LZO_DOS 1
|
||||
#elif defined(LZO_OS_WIN16)
|
||||
# define __LZO_WIN 1
|
||||
# define __LZO_WIN16 1
|
||||
#elif defined(LZO_OS_WIN32)
|
||||
# define __LZO_WIN 1
|
||||
#endif
|
||||
|
||||
#define __LZO_CMODEL /*empty*/
|
||||
#define __LZO_DMODEL /*empty*/
|
||||
#define __LZO_ENTRY __LZO_CDECL
|
||||
#define LZO_EXTERN_CDECL LZO_EXTERN
|
||||
#define LZO_ALIGN LZO_PTR_ALIGN_UP
|
||||
|
||||
#define lzo_compress_asm_t lzo_compress_t
|
||||
#define lzo_decompress_asm_t lzo_decompress_t
|
||||
|
||||
#endif /* LZO_CFG_COMPAT */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -449,3 +440,5 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
|
||||
|
||||
#endif /* already included */
|
||||
|
||||
|
||||
/* vim:set ts=4 et: */
|
||||
|
||||
2998
libvncserver/lzodefs.h
Normal file
2998
libvncserver/lzodefs.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,7 @@
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -145,6 +146,11 @@ rfbUnregisterProtocolExtension(rfbProtocolExtension* extension)
|
||||
|
||||
rfbProtocolExtension* rfbGetExtensionIterator()
|
||||
{
|
||||
if (! extMutex_initialized) {
|
||||
INIT_MUTEX(extMutex);
|
||||
extMutex_initialized = 1;
|
||||
}
|
||||
|
||||
LOCK(extMutex);
|
||||
return rfbExtensionHead;
|
||||
}
|
||||
@@ -444,22 +450,34 @@ clientOutput(void *data)
|
||||
while (1) {
|
||||
haveUpdate = false;
|
||||
while (!haveUpdate) {
|
||||
if (cl->sock == -1) {
|
||||
/* Client has disconnected. */
|
||||
return NULL;
|
||||
}
|
||||
LOCK(cl->updateMutex);
|
||||
haveUpdate = FB_UPDATE_PENDING(cl);
|
||||
if(!haveUpdate) {
|
||||
updateRegion = sraRgnCreateRgn(cl->modifiedRegion);
|
||||
haveUpdate = sraRgnAnd(updateRegion,cl->requestedRegion);
|
||||
sraRgnDestroy(updateRegion);
|
||||
}
|
||||
if (cl->sock == -1) {
|
||||
/* Client has disconnected. */
|
||||
return NULL;
|
||||
}
|
||||
if (cl->state != RFB_NORMAL || cl->onHold) {
|
||||
/* just sleep until things get normal */
|
||||
usleep(cl->screen->deferUpdateTime * 1000);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!haveUpdate) {
|
||||
WAIT(cl->updateCond, cl->updateMutex);
|
||||
}
|
||||
UNLOCK(cl->updateMutex);
|
||||
LOCK(cl->updateMutex);
|
||||
|
||||
if (sraRgnEmpty(cl->requestedRegion)) {
|
||||
; /* always require a FB Update Request (otherwise can crash.) */
|
||||
} else {
|
||||
haveUpdate = FB_UPDATE_PENDING(cl);
|
||||
if(!haveUpdate) {
|
||||
updateRegion = sraRgnCreateRgn(cl->modifiedRegion);
|
||||
haveUpdate = sraRgnAnd(updateRegion,cl->requestedRegion);
|
||||
sraRgnDestroy(updateRegion);
|
||||
}
|
||||
}
|
||||
|
||||
if (!haveUpdate) {
|
||||
WAIT(cl->updateCond, cl->updateMutex);
|
||||
}
|
||||
|
||||
UNLOCK(cl->updateMutex);
|
||||
}
|
||||
|
||||
/* OK, now, to save bandwidth, wait a little while for more
|
||||
@@ -476,7 +494,9 @@ clientOutput(void *data)
|
||||
|
||||
/* Now actually send the update. */
|
||||
rfbIncrClientRef(cl);
|
||||
LOCK(cl->sendMutex);
|
||||
rfbSendFramebufferUpdate(cl, updateRegion);
|
||||
UNLOCK(cl->sendMutex);
|
||||
rfbDecrClientRef(cl);
|
||||
|
||||
sraRgnDestroy(updateRegion);
|
||||
@@ -498,6 +518,11 @@ clientInput(void *data)
|
||||
struct timeval tv;
|
||||
int n;
|
||||
|
||||
if (cl->sock == -1) {
|
||||
/* Client has disconnected. */
|
||||
break;
|
||||
}
|
||||
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(cl->sock, &rfds);
|
||||
FD_ZERO(&efds);
|
||||
@@ -527,11 +552,6 @@ clientInput(void *data)
|
||||
|
||||
if (FD_ISSET(cl->sock, &rfds) || FD_ISSET(cl->sock, &efds))
|
||||
rfbProcessClientMessage(cl);
|
||||
|
||||
if (cl->sock == -1) {
|
||||
/* Client has disconnected. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get rid of the output thread. */
|
||||
@@ -880,7 +900,9 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
|
||||
screen->setTranslateFunction = rfbSetTranslateFunction;
|
||||
screen->newClientHook = rfbDefaultNewClientHook;
|
||||
screen->displayHook = NULL;
|
||||
screen->displayFinishedHook = NULL;
|
||||
screen->getKeyboardLedStateHook = NULL;
|
||||
screen->xvpHook = NULL;
|
||||
|
||||
/* initialize client list and iterator mutex */
|
||||
rfbClientListInit(screen);
|
||||
@@ -982,9 +1004,6 @@ void rfbScreenCleanup(rfbScreenInfoPtr screen)
|
||||
if(screen->cursor && screen->cursor->cleanup)
|
||||
rfbFreeCursor(screen->cursor);
|
||||
|
||||
rfbRRECleanup(screen);
|
||||
rfbCoRRECleanup(screen);
|
||||
rfbUltraCleanup(screen);
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBZ
|
||||
rfbZlibCleanup(screen);
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
|
||||
@@ -1023,10 +1042,13 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool disconnectClients) {
|
||||
if(disconnectClients) {
|
||||
rfbClientPtr cl;
|
||||
rfbClientIteratorPtr iter = rfbGetClientIterator(screen);
|
||||
while( (cl = rfbClientIteratorNext(iter)) )
|
||||
if (cl->sock > -1)
|
||||
/* we don't care about maxfd here, because the server goes away */
|
||||
rfbCloseClient(cl);
|
||||
while( (cl = rfbClientIteratorNext(iter)) ) {
|
||||
if (cl->sock > -1) {
|
||||
/* we don't care about maxfd here, because the server goes away */
|
||||
rfbCloseClient(cl);
|
||||
rfbClientConnectionGone(cl);
|
||||
}
|
||||
}
|
||||
rfbReleaseClientIterator(iter);
|
||||
}
|
||||
|
||||
@@ -1053,7 +1075,6 @@ rfbProcessEvents(rfbScreenInfoPtr screen,long usec)
|
||||
{
|
||||
rfbClientIteratorPtr i;
|
||||
rfbClientPtr cl,clPrev;
|
||||
struct timeval tv;
|
||||
rfbBool result=FALSE;
|
||||
extern rfbClientIteratorPtr
|
||||
rfbGetClientIteratorWithClosed(rfbScreenInfoPtr rfbScreen);
|
||||
@@ -1063,9 +1084,6 @@ rfbProcessEvents(rfbScreenInfoPtr screen,long usec)
|
||||
|
||||
rfbCheckFds(screen,usec);
|
||||
rfbHttpCheckFds(screen);
|
||||
#ifdef CORBA
|
||||
corbaCheckFds(screen);
|
||||
#endif
|
||||
|
||||
i = rfbGetClientIteratorWithClosed(screen);
|
||||
cl=rfbClientIteratorHead(i);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,13 +2,7 @@
|
||||
|
||||
This file is part of the LZO real-time data compression library.
|
||||
|
||||
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
||||
Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
|
||||
All Rights Reserved.
|
||||
|
||||
The LZO library is free software; you can redistribute it and/or
|
||||
@@ -24,7 +18,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with the LZO library; see the file COPYING.
|
||||
If not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Markus F.X.J. Oberhumer
|
||||
<markus@oberhumer.com>
|
||||
@@ -39,9 +33,9 @@
|
||||
|
||||
|
||||
#ifndef __MINILZO_H
|
||||
#define __MINILZO_H
|
||||
#define __MINILZO_H 1
|
||||
|
||||
#define MINILZO_VERSION 0x1080
|
||||
#define MINILZO_VERSION 0x2070
|
||||
|
||||
#ifdef __LZOCONF_H
|
||||
# error "you cannot use both LZO and miniLZO"
|
||||
@@ -69,26 +63,26 @@ extern "C" {
|
||||
*/
|
||||
|
||||
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
|
||||
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
|
||||
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
|
||||
#define LZO1X_MEM_DECOMPRESS (0)
|
||||
|
||||
|
||||
/* compression */
|
||||
LZO_EXTERN(int)
|
||||
lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem );
|
||||
|
||||
/* decompression */
|
||||
LZO_EXTERN(int)
|
||||
lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem /* NOT USED */ );
|
||||
|
||||
/* safe decompression with overrun testing */
|
||||
LZO_EXTERN(int)
|
||||
lzo1x_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
|
||||
lzo_byte *dst, lzo_uintp dst_len,
|
||||
lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
|
||||
lzo_bytep dst, lzo_uintp dst_len,
|
||||
lzo_voidp wrkmem /* NOT USED */ );
|
||||
|
||||
|
||||
|
||||
@@ -29,16 +29,7 @@ void rfbFreeZrleData(rfbClientPtr cl);
|
||||
|
||||
/* from ultra.c */
|
||||
|
||||
extern void rfbUltraCleanup(rfbScreenInfoPtr screen);
|
||||
extern void rfbFreeUltraData(rfbClientPtr cl);
|
||||
|
||||
/* from rre.c */
|
||||
|
||||
extern void rfbRRECleanup(rfbScreenInfoPtr screen);
|
||||
|
||||
/* from corre.c */
|
||||
|
||||
extern void rfbCoRRECleanup(rfbScreenInfoPtr screen);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
#ifndef RFB_H
|
||||
#define RFB_H
|
||||
/**
|
||||
* @defgroup libvncserver_api LibVNCServer API Reference
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*
|
||||
* rfb.h - header file for RFB DDX implementation.
|
||||
/**
|
||||
* @file rfb.h
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -29,7 +33,7 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#if (defined __cplusplus)
|
||||
#if(defined __cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
@@ -44,6 +48,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#undef SOCKET
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
@@ -135,34 +140,39 @@ typedef rfbBool (*rfbSetTranslateFunctionProcPtr)(struct _rfbClientRec* cl);
|
||||
typedef rfbBool (*rfbPasswordCheckProcPtr)(struct _rfbClientRec* cl,const char* encryptedPassWord,int len);
|
||||
typedef enum rfbNewClientAction (*rfbNewClientHookPtr)(struct _rfbClientRec* cl);
|
||||
typedef void (*rfbDisplayHookPtr)(struct _rfbClientRec* cl);
|
||||
/* support the capability to view the caps/num/scroll states of the X server */
|
||||
typedef void (*rfbDisplayFinishedHookPtr)(struct _rfbClientRec* cl, int result);
|
||||
/** support the capability to view the caps/num/scroll states of the X server */
|
||||
typedef int (*rfbGetKeyboardLedStateHookPtr)(struct _rfbScreenInfo* screen);
|
||||
/* If x==1 and y==1 then set the whole display
|
||||
typedef rfbBool (*rfbXvpHookPtr)(struct _rfbClientRec* cl, uint8_t, uint8_t);
|
||||
/**
|
||||
* If x==1 and y==1 then set the whole display
|
||||
* else find the window underneath x and y and set the framebuffer to the dimensions
|
||||
* of that window
|
||||
*/
|
||||
typedef void (*rfbSetSingleWindowProcPtr) (struct _rfbClientRec* cl, int x, int y);
|
||||
/* Status determines if the X11 server permits input from the local user
|
||||
/**
|
||||
* Status determines if the X11 server permits input from the local user
|
||||
* status==0 or 1
|
||||
*/
|
||||
typedef void (*rfbSetServerInputProcPtr) (struct _rfbClientRec* cl, int status);
|
||||
/* Permit the server to allow or deny filetransfers. This is defaulted to deny
|
||||
/**
|
||||
* Permit the server to allow or deny filetransfers. This is defaulted to deny
|
||||
* It is called when a client initiates a connection to determine if it is permitted.
|
||||
*/
|
||||
typedef int (*rfbFileTransferPermitted) (struct _rfbClientRec* cl);
|
||||
/* Handle the textchat messages */
|
||||
/** Handle the textchat messages */
|
||||
typedef void (*rfbSetTextChat) (struct _rfbClientRec* cl, int length, char *string);
|
||||
|
||||
typedef struct {
|
||||
uint32_t count;
|
||||
rfbBool is16; /* is the data format short? */
|
||||
rfbBool is16; /**< is the data format short? */
|
||||
union {
|
||||
uint8_t* bytes;
|
||||
uint16_t* shorts;
|
||||
} data; /* there have to be count*3 entries */
|
||||
} data; /**< there have to be count*3 entries */
|
||||
} rfbColourMap;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Security handling (RFB protocol version 3.7)
|
||||
*/
|
||||
|
||||
@@ -172,31 +182,31 @@ typedef struct _rfbSecurity {
|
||||
struct _rfbSecurity* next;
|
||||
} rfbSecurityHandler;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Protocol extension handling.
|
||||
*/
|
||||
|
||||
typedef struct _rfbProtocolExtension {
|
||||
/* returns FALSE if extension should be deactivated for client.
|
||||
/** returns FALSE if extension should be deactivated for client.
|
||||
if newClient == NULL, it is always deactivated. */
|
||||
rfbBool (*newClient)(struct _rfbClientRec* client, void** data);
|
||||
/* returns FALSE if extension should be deactivated for client.
|
||||
/** returns FALSE if extension should be deactivated for client.
|
||||
if init == NULL, it stays activated. */
|
||||
rfbBool (*init)(struct _rfbClientRec* client, void* data);
|
||||
/* if pseudoEncodings is not NULL, it contains a 0 terminated
|
||||
/** if pseudoEncodings is not NULL, it contains a 0 terminated
|
||||
list of the pseudo encodings handled by this extension. */
|
||||
int *pseudoEncodings;
|
||||
/* returns TRUE if that pseudo encoding is handled by the extension.
|
||||
/** returns TRUE if that pseudo encoding is handled by the extension.
|
||||
encodingNumber==0 means "reset encodings". */
|
||||
rfbBool (*enablePseudoEncoding)(struct _rfbClientRec* client,
|
||||
void** data, int encodingNumber);
|
||||
/* returns TRUE if message was handled */
|
||||
/** returns TRUE if message was handled */
|
||||
rfbBool (*handleMessage)(struct _rfbClientRec* client,
|
||||
void* data,
|
||||
const rfbClientToServerMsg* message);
|
||||
void (*close)(struct _rfbClientRec* client, void* data);
|
||||
void (*usage)(void);
|
||||
/* processArguments returns the number of handled arguments */
|
||||
/** processArguments returns the number of handled arguments */
|
||||
int (*processArgument)(int argc, char *argv[]);
|
||||
struct _rfbProtocolExtension* next;
|
||||
} rfbProtocolExtension;
|
||||
@@ -207,7 +217,7 @@ typedef struct _rfbExtensionData {
|
||||
struct _rfbExtensionData* next;
|
||||
} rfbExtensionData;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Per-screen (framebuffer) structure. There can be as many as you wish,
|
||||
* each serving different clients. However, you have to call
|
||||
* rfbProcessEvents for each of these.
|
||||
@@ -215,7 +225,7 @@ typedef struct _rfbExtensionData {
|
||||
|
||||
typedef struct _rfbScreenInfo
|
||||
{
|
||||
/* this structure has children that are scaled versions of this screen */
|
||||
/** this structure has children that are scaled versions of this screen */
|
||||
struct _rfbScreenInfo *scaledScreenNext;
|
||||
int scaledScreenRefCount;
|
||||
|
||||
@@ -229,16 +239,17 @@ typedef struct _rfbScreenInfo
|
||||
rfbPixel blackPixel;
|
||||
rfbPixel whitePixel;
|
||||
|
||||
/* some screen specific data can be put into a struct where screenData
|
||||
/**
|
||||
* some screen specific data can be put into a struct where screenData
|
||||
* points to. You need this if you have more than one screen at the
|
||||
* same time while using the same functions.
|
||||
*/
|
||||
void* screenData;
|
||||
|
||||
|
||||
/* additions by libvncserver */
|
||||
|
||||
rfbPixelFormat serverFormat;
|
||||
rfbColourMap colourMap; /* set this if rfbServerFormat.trueColour==FALSE */
|
||||
rfbColourMap colourMap; /**< set this if rfbServerFormat.trueColour==FALSE */
|
||||
const char* desktopName;
|
||||
char thisHost[255];
|
||||
|
||||
@@ -275,13 +286,13 @@ typedef struct _rfbScreenInfo
|
||||
|
||||
rfbPasswordCheckProcPtr passwordCheck;
|
||||
void* authPasswdData;
|
||||
/* If rfbAuthPasswdData is given a list, this is the first
|
||||
view only password. */
|
||||
/** If rfbAuthPasswdData is given a list, this is the first
|
||||
view only password. */
|
||||
int authPasswdFirstViewOnly;
|
||||
|
||||
/* send only this many rectangles in one update */
|
||||
/** send only this many rectangles in one update */
|
||||
int maxRectsPerUpdate;
|
||||
/* this is the amount of milliseconds to wait at least before sending
|
||||
/** this is the amount of milliseconds to wait at least before sending
|
||||
* an update. */
|
||||
int deferUpdateTime;
|
||||
#ifdef TODELETE
|
||||
@@ -291,7 +302,7 @@ typedef struct _rfbScreenInfo
|
||||
rfbBool neverShared;
|
||||
rfbBool dontDisconnect;
|
||||
struct _rfbClientRec* clientHead;
|
||||
struct _rfbClientRec* pointerClient; /* "Mutex" for pointer events */
|
||||
struct _rfbClientRec* pointerClient; /**< "Mutex" for pointer events */
|
||||
|
||||
|
||||
/* cursor */
|
||||
@@ -300,8 +311,9 @@ typedef struct _rfbScreenInfo
|
||||
rfbBool dontConvertRichCursorToXCursor;
|
||||
struct rfbCursor* cursor;
|
||||
|
||||
/* the frameBufferhas to be supplied by the serving process.
|
||||
* The buffer will not be freed by
|
||||
/**
|
||||
* the frameBuffer has to be supplied by the serving process.
|
||||
* The buffer will not be freed by
|
||||
*/
|
||||
char* frameBuffer;
|
||||
rfbKbdAddEventProcPtr kbdAddEvent;
|
||||
@@ -314,13 +326,13 @@ typedef struct _rfbScreenInfo
|
||||
rfbSetServerInputProcPtr setServerInput;
|
||||
rfbFileTransferPermitted getFileTransferPermission;
|
||||
rfbSetTextChat setTextChat;
|
||||
|
||||
/* newClientHook is called just after a new client is created */
|
||||
|
||||
/** newClientHook is called just after a new client is created */
|
||||
rfbNewClientHookPtr newClientHook;
|
||||
/* displayHook is called just before a frame buffer update */
|
||||
/** displayHook is called just before a frame buffer update */
|
||||
rfbDisplayHookPtr displayHook;
|
||||
|
||||
/* These hooks are called to pass keyboard state back to the client */
|
||||
/** These hooks are called to pass keyboard state back to the client */
|
||||
rfbGetKeyboardLedStateHookPtr getKeyboardLedStateHook;
|
||||
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
|
||||
@@ -328,10 +340,10 @@ typedef struct _rfbScreenInfo
|
||||
rfbBool backgroundLoop;
|
||||
#endif
|
||||
|
||||
/* if TRUE, an ignoring signal handler is installed for SIGPIPE */
|
||||
/** if TRUE, an ignoring signal handler is installed for SIGPIPE */
|
||||
rfbBool ignoreSIGPIPE;
|
||||
|
||||
/* if not zero, only a slice of this height is processed every time
|
||||
/** if not zero, only a slice of this height is processed every time
|
||||
* an update should be sent. This should make working on a slow
|
||||
* link more interactive. */
|
||||
int progressiveSliceHeight;
|
||||
@@ -339,22 +351,27 @@ typedef struct _rfbScreenInfo
|
||||
in_addr_t listenInterface;
|
||||
int deferPtrUpdateTime;
|
||||
|
||||
/* handle as many input events as possible (default off) */
|
||||
/** handle as many input events as possible (default off) */
|
||||
rfbBool handleEventsEagerly;
|
||||
|
||||
/* rfbEncodingServerIdentity */
|
||||
/** rfbEncodingServerIdentity */
|
||||
char *versionString;
|
||||
|
||||
/* What does the server tell the new clients which version it supports */
|
||||
/** What does the server tell the new clients which version it supports */
|
||||
int protocolMajorVersion;
|
||||
int protocolMinorVersion;
|
||||
|
||||
/* command line authorization of file transfers */
|
||||
/** command line authorization of file transfers */
|
||||
rfbBool permitFileTransfer;
|
||||
|
||||
/** displayFinishedHook is called just after a frame buffer update */
|
||||
rfbDisplayFinishedHookPtr displayFinishedHook;
|
||||
/** xvpHook is called to handle an xvp client message */
|
||||
rfbXvpHookPtr xvpHook;
|
||||
} rfbScreenInfo, *rfbScreenInfoPtr;
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* rfbTranslateFnType is the type of translation functions.
|
||||
*/
|
||||
|
||||
@@ -398,17 +415,17 @@ typedef struct _rfbStatList {
|
||||
} rfbStatList;
|
||||
|
||||
typedef struct _rfbClientRec {
|
||||
|
||||
/* back pointer to the screen */
|
||||
|
||||
/** back pointer to the screen */
|
||||
rfbScreenInfoPtr screen;
|
||||
|
||||
/* points to a scaled version of the screen buffer in cl->scaledScreenList */
|
||||
/** points to a scaled version of the screen buffer in cl->scaledScreenList */
|
||||
rfbScreenInfoPtr scaledScreen;
|
||||
/* how did the client tell us it wanted the screen changed? Ultra style or palm style? */
|
||||
/** how did the client tell us it wanted the screen changed? Ultra style or palm style? */
|
||||
rfbBool PalmVNC;
|
||||
|
||||
|
||||
/* private data. You should put any application client specific data
|
||||
|
||||
|
||||
/** private data. You should put any application client specific data
|
||||
* into a struct and let clientData point to it. Don't forget to
|
||||
* free the struct via clientGoneHook!
|
||||
*
|
||||
@@ -427,13 +444,13 @@ typedef struct _rfbClientRec {
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
|
||||
pthread_t client_thread;
|
||||
#endif
|
||||
/* Possible client states: */
|
||||
/** Possible client states: */
|
||||
enum {
|
||||
RFB_PROTOCOL_VERSION, /* establishing protocol version */
|
||||
RFB_SECURITY_TYPE, /* negotiating security (RFB v.3.7) */
|
||||
RFB_AUTHENTICATION, /* authenticating */
|
||||
RFB_INITIALISATION, /* sending initialisation messages */
|
||||
RFB_NORMAL /* normal protocol messages */
|
||||
RFB_PROTOCOL_VERSION, /**< establishing protocol version */
|
||||
RFB_SECURITY_TYPE, /**< negotiating security (RFB v.3.7) */
|
||||
RFB_AUTHENTICATION, /**< authenticating */
|
||||
RFB_INITIALISATION, /**< sending initialisation messages */
|
||||
RFB_NORMAL /**< normal protocol messages */
|
||||
} state;
|
||||
|
||||
rfbBool reverseConnection;
|
||||
@@ -471,19 +488,19 @@ typedef struct _rfbClientRec {
|
||||
the destination copyRegion. Just before an update is sent we remove
|
||||
from the copyRegion anything in the modifiedRegion. */
|
||||
|
||||
sraRegionPtr copyRegion; /* the destination region of the copy */
|
||||
int copyDX, copyDY; /* the translation by which the copy happens */
|
||||
sraRegionPtr copyRegion; /**< the destination region of the copy */
|
||||
int copyDX, copyDY; /**< the translation by which the copy happens */
|
||||
|
||||
sraRegionPtr modifiedRegion;
|
||||
|
||||
/* As part of the FramebufferUpdateRequest, a client can express interest
|
||||
/** As part of the FramebufferUpdateRequest, a client can express interest
|
||||
in a subrectangle of the whole framebuffer. This is stored in the
|
||||
requestedRegion member. In the normal case this is the whole
|
||||
framebuffer if the client is ready, empty if it's not. */
|
||||
|
||||
sraRegionPtr requestedRegion;
|
||||
|
||||
/* The following member represents the state of the "deferred update" timer
|
||||
/** The following member represents the state of the "deferred update" timer
|
||||
- when the framebuffer is modified and the client is ready, in most
|
||||
cases it is more efficient to defer sending the update by a few
|
||||
milliseconds so that several changes to the framebuffer can be combined
|
||||
@@ -495,14 +512,14 @@ typedef struct _rfbClientRec {
|
||||
int lastPtrY;
|
||||
int lastPtrButtons;
|
||||
|
||||
/* translateFn points to the translation function which is used to copy
|
||||
/** translateFn points to the translation function which is used to copy
|
||||
and translate a rectangle from the framebuffer to an output buffer. */
|
||||
|
||||
rfbTranslateFnType translateFn;
|
||||
char *translateLookupTable;
|
||||
rfbPixelFormat format;
|
||||
|
||||
/*
|
||||
/**
|
||||
* UPDATE_BUF_SIZE must be big enough to send at least one whole line of the
|
||||
* framebuffer. So for a max screen width of say 2K with 32-bit pixels this
|
||||
* means 8K minimum.
|
||||
@@ -518,14 +535,14 @@ typedef struct _rfbClientRec {
|
||||
struct _rfbStatList *statMsgList;
|
||||
int rawBytesEquivalent;
|
||||
int bytesSent;
|
||||
|
||||
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBZ
|
||||
/* zlib encoding -- necessary compression state info per client */
|
||||
|
||||
struct z_stream_s compStream;
|
||||
rfbBool compStreamInited;
|
||||
uint32_t zlibCompressLevel;
|
||||
/* the quality level is also used by ZYWRLE */
|
||||
/** the quality level is also used by ZYWRLE */
|
||||
int tightQualityLevel;
|
||||
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
|
||||
@@ -543,28 +560,28 @@ typedef struct _rfbClientRec {
|
||||
|
||||
rfbFileTransferData fileTransfer;
|
||||
|
||||
int lastKeyboardLedState; /* keep track of last value so we can send *change* events */
|
||||
rfbBool enableSupportedMessages; /* client supports SupportedMessages encoding */
|
||||
rfbBool enableSupportedEncodings; /* client supports SupportedEncodings encoding */
|
||||
rfbBool enableServerIdentity; /* client supports ServerIdentity encoding */
|
||||
rfbBool enableKeyboardLedState; /* client supports KeyboardState encoding */
|
||||
rfbBool enableLastRectEncoding; /* client supports LastRect encoding */
|
||||
rfbBool enableCursorShapeUpdates; /* client supports cursor shape updates */
|
||||
rfbBool enableCursorPosUpdates; /* client supports cursor position updates */
|
||||
rfbBool useRichCursorEncoding; /* rfbEncodingRichCursor is preferred */
|
||||
rfbBool cursorWasChanged; /* cursor shape update should be sent */
|
||||
rfbBool cursorWasMoved; /* cursor position update should be sent */
|
||||
int cursorX,cursorY; /* the coordinates of the cursor,
|
||||
int lastKeyboardLedState; /**< keep track of last value so we can send *change* events */
|
||||
rfbBool enableSupportedMessages; /**< client supports SupportedMessages encoding */
|
||||
rfbBool enableSupportedEncodings; /**< client supports SupportedEncodings encoding */
|
||||
rfbBool enableServerIdentity; /**< client supports ServerIdentity encoding */
|
||||
rfbBool enableKeyboardLedState; /**< client supports KeyboardState encoding */
|
||||
rfbBool enableLastRectEncoding; /**< client supports LastRect encoding */
|
||||
rfbBool enableCursorShapeUpdates; /**< client supports cursor shape updates */
|
||||
rfbBool enableCursorPosUpdates; /**< client supports cursor position updates */
|
||||
rfbBool useRichCursorEncoding; /**< rfbEncodingRichCursor is preferred */
|
||||
rfbBool cursorWasChanged; /**< cursor shape update should be sent */
|
||||
rfbBool cursorWasMoved; /**< cursor position update should be sent */
|
||||
int cursorX,cursorY; /**< the coordinates of the cursor,
|
||||
if enableCursorShapeUpdates = FALSE */
|
||||
|
||||
rfbBool useNewFBSize; /* client supports NewFBSize encoding */
|
||||
rfbBool newFBSizePending; /* framebuffer size was changed */
|
||||
rfbBool useNewFBSize; /**< client supports NewFBSize encoding */
|
||||
rfbBool newFBSizePending; /**< framebuffer size was changed */
|
||||
|
||||
struct _rfbClientRec *prev;
|
||||
struct _rfbClientRec *next;
|
||||
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
|
||||
/* whenever a client is referenced, the refCount has to be incremented
|
||||
/** whenever a client is referenced, the refCount has to be incremented
|
||||
and afterwards decremented, so that the client is not cleaned up
|
||||
while being referenced.
|
||||
Use the functions rfbIncrClientRef(cl) and rfbDecrClientRef(cl);
|
||||
@@ -584,14 +601,32 @@ typedef struct _rfbClientRec {
|
||||
int zywrleBuf[rfbZRLETileWidth * rfbZRLETileHeight];
|
||||
#endif
|
||||
|
||||
/* if progressive updating is on, this variable holds the current
|
||||
/** if progressive updating is on, this variable holds the current
|
||||
* y coordinate of the progressive slice. */
|
||||
int progressiveSliceY;
|
||||
|
||||
rfbExtensionData* extensions;
|
||||
|
||||
/** for threaded zrle */
|
||||
char *zrleBeforeBuf;
|
||||
void *paletteHelper;
|
||||
|
||||
/** for thread safety for rfbSendFBUpdate() */
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
|
||||
#define LIBVNCSERVER_SEND_MUTEX
|
||||
MUTEX(sendMutex);
|
||||
#endif
|
||||
|
||||
/* buffers to hold pixel data before and after encoding.
|
||||
per-client for thread safety */
|
||||
char *beforeEncBuf;
|
||||
int beforeEncBufSize;
|
||||
char *afterEncBuf;
|
||||
int afterEncBufSize;
|
||||
int afterEncBufLen;
|
||||
} rfbClientRec, *rfbClientPtr;
|
||||
|
||||
/*
|
||||
/**
|
||||
* This macro is used to test whether there is a framebuffer update needing to
|
||||
* be sent to the client.
|
||||
*/
|
||||
@@ -648,6 +683,7 @@ extern int rfbConnectToTcpAddr(char* host, int port);
|
||||
extern int rfbListenOnTCPPort(int port, in_addr_t iface);
|
||||
extern int rfbListenOnUDPPort(int port, in_addr_t iface);
|
||||
extern int rfbStringToAddr(char* string,in_addr_t* addr);
|
||||
extern rfbBool rfbSetNonBlocking(int sock);
|
||||
|
||||
/* rfbserver.c */
|
||||
|
||||
@@ -749,7 +785,7 @@ extern rfbBool rfbSendRectEncodingUltra(rfbClientPtr cl, int x,int y,int w,int h
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBZ
|
||||
/* zlib.c */
|
||||
|
||||
/* Minimum zlib rectangle size in bytes. Anything smaller will
|
||||
/** Minimum zlib rectangle size in bytes. Anything smaller will
|
||||
* not compress well due to overhead.
|
||||
*/
|
||||
#define VNC_ENCODE_ZLIB_MIN_COMP_SIZE (17)
|
||||
@@ -781,16 +817,16 @@ extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h
|
||||
/* cursor.c */
|
||||
|
||||
typedef struct rfbCursor {
|
||||
/* set this to true if LibVNCServer has to free this cursor */
|
||||
/** set this to true if LibVNCServer has to free this cursor */
|
||||
rfbBool cleanup, cleanupSource, cleanupMask, cleanupRichSource;
|
||||
unsigned char *source; /* points to bits */
|
||||
unsigned char *mask; /* points to bits */
|
||||
unsigned short width, height, xhot, yhot; /* metrics */
|
||||
unsigned short foreRed, foreGreen, foreBlue; /* device-independent colour */
|
||||
unsigned short backRed, backGreen, backBlue; /* device-independent colour */
|
||||
unsigned char *richSource; /* source bytes for a rich cursor */
|
||||
unsigned char *alphaSource; /* source for alpha blending info */
|
||||
rfbBool alphaPreMultiplied; /* if richSource already has alpha applied */
|
||||
unsigned char *source; /**< points to bits */
|
||||
unsigned char *mask; /**< points to bits */
|
||||
unsigned short width, height, xhot, yhot; /**< metrics */
|
||||
unsigned short foreRed, foreGreen, foreBlue; /**< device-independent colour */
|
||||
unsigned short backRed, backGreen, backBlue; /**< device-independent colour */
|
||||
unsigned char *richSource; /**< source bytes for a rich cursor */
|
||||
unsigned char *alphaSource; /**< source for alpha blending info */
|
||||
rfbBool alphaPreMultiplied; /**< if richSource already has alpha applied */
|
||||
} rfbCursor, *rfbCursorPtr;
|
||||
extern unsigned char rfbReverseByte[0x100];
|
||||
|
||||
@@ -805,7 +841,7 @@ extern void rfbMakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr
|
||||
extern void rfbFreeCursor(rfbCursorPtr cursor);
|
||||
extern void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c);
|
||||
|
||||
/* cursor handling for the pointer */
|
||||
/** cursor handling for the pointer */
|
||||
extern void rfbDefaultPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl);
|
||||
|
||||
/* zrle.c */
|
||||
@@ -822,7 +858,7 @@ extern void rfbPrintStats(rfbClientPtr cl);
|
||||
|
||||
typedef struct rfbFontData {
|
||||
unsigned char* data;
|
||||
/*
|
||||
/**
|
||||
metaData is a 256*5 array:
|
||||
for each character
|
||||
(offset,width,height,x,y)
|
||||
@@ -832,18 +868,18 @@ typedef struct rfbFontData {
|
||||
|
||||
int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,rfbPixel colour);
|
||||
void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,rfbPixel colour);
|
||||
/* if colour==backColour, background is transparent */
|
||||
/** if colour==backColour, background is transparent */
|
||||
int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour);
|
||||
void rfbDrawStringWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour);
|
||||
int rfbWidthOfString(rfbFontDataPtr font,const char* string);
|
||||
int rfbWidthOfChar(rfbFontDataPtr font,unsigned char c);
|
||||
void rfbFontBBox(rfbFontDataPtr font,unsigned char c,int* x1,int* y1,int* x2,int* y2);
|
||||
/* this returns the smallest box enclosing any character of font. */
|
||||
/** this returns the smallest box enclosing any character of font. */
|
||||
void rfbWholeFontBBox(rfbFontDataPtr font,int *x1, int *y1, int *x2, int *y2);
|
||||
|
||||
/* dynamically load a linux console font (4096 bytes, 256 glyphs a 8x16 */
|
||||
/** dynamically load a linux console font (4096 bytes, 256 glyphs a 8x16 */
|
||||
rfbFontDataPtr rfbLoadConsoleFont(char *filename);
|
||||
/* free a dynamically loaded font */
|
||||
/** free a dynamically loaded font */
|
||||
void rfbFreeFont(rfbFontDataPtr font);
|
||||
|
||||
/* draw.c */
|
||||
@@ -854,7 +890,7 @@ void rfbDrawLine(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col);
|
||||
|
||||
/* selbox.c */
|
||||
|
||||
/* this opens a modal select box. list is an array of strings, the end marked
|
||||
/** this opens a modal select box. list is an array of strings, the end marked
|
||||
with a NULL.
|
||||
It returns the index in the list or -1 if cancelled or something else
|
||||
wasn't kosher. */
|
||||
@@ -898,7 +934,7 @@ rfbBool rfbEnableExtension(rfbClientPtr cl, rfbProtocolExtension* extension,
|
||||
rfbBool rfbDisableExtension(rfbClientPtr cl, rfbProtocolExtension* extension);
|
||||
void* rfbGetExtensionClientData(rfbClientPtr cl, rfbProtocolExtension* extension);
|
||||
|
||||
/* to check against plain passwords */
|
||||
/** to check against plain passwords */
|
||||
rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len);
|
||||
|
||||
/* functions to make a vnc server */
|
||||
@@ -932,7 +968,7 @@ extern rfbBool rfbIsActive(rfbScreenInfoPtr screenInfo);
|
||||
|
||||
/* TightVNC file transfer extension */
|
||||
void rfbRegisterTightVNCFileTransferExtension();
|
||||
void rfbUnregisterTightVNCFileTransferExtension();
|
||||
void rfbUnregisterTightVNCFileTransferExtension();
|
||||
|
||||
/* Statistics */
|
||||
extern char *messageNameServer2Client(uint32_t type, char *buf, int len);
|
||||
@@ -960,10 +996,10 @@ extern int rfbStatGetMessageCountRcvd(rfbClientPtr cl, uint32_t type);
|
||||
extern int rfbStatGetEncodingCountSent(rfbClientPtr cl, uint32_t type);
|
||||
extern int rfbStatGetEncodingCountRcvd(rfbClientPtr cl, uint32_t type);
|
||||
|
||||
/* Set which version you want to advertise 3.3, 3.6, 3.7 and 3.8 are currently supported*/
|
||||
/** Set which version you want to advertise 3.3, 3.6, 3.7 and 3.8 are currently supported*/
|
||||
extern void rfbSetProtocolVersion(rfbScreenInfoPtr rfbScreen, int major_, int minor_);
|
||||
|
||||
/* send a TextChat message to a client */
|
||||
/** send a TextChat message to a client */
|
||||
extern rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer);
|
||||
|
||||
|
||||
@@ -975,9 +1011,178 @@ rfbBool rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen);
|
||||
rfbBool rfbUpdateClient(rfbClientPtr cl);
|
||||
|
||||
|
||||
#if (defined __cplusplus)
|
||||
#if(defined __cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
@page libvncserver_doc LibVNCServer Documentation
|
||||
@section create_server Creating a server instance
|
||||
To make a server, you just have to initialise a server structure using the
|
||||
function rfbGetScreen(), like
|
||||
@code
|
||||
rfbScreenInfoPtr screen =
|
||||
rfbGetScreen(argc,argv,screenwidth,screenheight,8,3,bpp);
|
||||
@endcode
|
||||
where byte per pixel should be 1, 2 or 4. If performance doesn't matter,
|
||||
you may try bpp=3 (internally one cannot use native data types in this
|
||||
case; if you want to use this, look at pnmshow24.c).
|
||||
|
||||
You then can set hooks and io functions (see @ref making_it_interactive) or other
|
||||
options (see @ref server_options).
|
||||
|
||||
And you allocate the frame buffer like this:
|
||||
@code
|
||||
screen->frameBuffer = (char*)malloc(screenwidth*screenheight*bpp);
|
||||
@endcode
|
||||
After that, you initialize the server, like
|
||||
@code
|
||||
rfbInitServer(screen);
|
||||
@endcode
|
||||
You can use a blocking event loop, a background (pthread based) event loop,
|
||||
or implement your own using the rfbProcessEvents() function.
|
||||
|
||||
@subsection server_options Optional Server Features
|
||||
|
||||
These options have to be set between rfbGetScreen() and rfbInitServer().
|
||||
|
||||
If you already have a socket to talk to, just set rfbScreenInfo::inetdSock
|
||||
(originally this is for inetd handling, but why not use it for your purpose?).
|
||||
|
||||
To also start an HTTP server (running on port 5800+display_number), you have
|
||||
to set rfbScreenInfo::httpDir to a directory containing vncviewer.jar and
|
||||
index.vnc (like the included "classes" directory).
|
||||
|
||||
@section making_it_interactive Making it interactive
|
||||
|
||||
Whenever you draw something, you have to call
|
||||
@code
|
||||
rfbMarkRectAsModified(screen,x1,y1,x2,y2).
|
||||
@endcode
|
||||
This tells LibVNCServer to send updates to all connected clients.
|
||||
|
||||
There exist the following IO functions as members of rfbScreen:
|
||||
rfbScreenInfo::kbdAddEvent(), rfbScreenInfo::kbdReleaseAllKeys(), rfbScreenInfo::ptrAddEvent() and rfbScreenInfo::setXCutText()
|
||||
|
||||
rfbScreenInfo::kbdAddEvent()
|
||||
is called when a key is pressed.
|
||||
rfbScreenInfo::kbdReleaseAllKeys()
|
||||
is not called at all (maybe in the future).
|
||||
rfbScreenInfo::ptrAddEvent()
|
||||
is called when the mouse moves or a button is pressed.
|
||||
WARNING: if you want to have proper cursor handling, call
|
||||
rfbDefaultPtrAddEvent()
|
||||
in your own function. This sets the coordinates of the cursor.
|
||||
rfbScreenInfo::setXCutText()
|
||||
is called when the selection changes.
|
||||
|
||||
There are only two hooks:
|
||||
rfbScreenInfo::newClientHook()
|
||||
is called when a new client has connected.
|
||||
rfbScreenInfo::displayHook()
|
||||
is called just before a frame buffer update is sent.
|
||||
|
||||
You can also override the following methods:
|
||||
rfbScreenInfo::getCursorPtr()
|
||||
This could be used to make an animated cursor (if you really want ...)
|
||||
rfbScreenInfo::setTranslateFunction()
|
||||
If you insist on colour maps or something more obscure, you have to
|
||||
implement this. Default is a trueColour mapping.
|
||||
|
||||
@section cursor_handling Cursor handling
|
||||
|
||||
The screen holds a pointer
|
||||
rfbScreenInfo::cursor
|
||||
to the current cursor. Whenever you set it, remember that any dynamically
|
||||
created cursor (like return value from rfbMakeXCursor()) is not free'd!
|
||||
|
||||
The rfbCursor structure consists mainly of a mask and a source. The rfbCursor::mask
|
||||
describes, which pixels are drawn for the cursor (a cursor needn't be
|
||||
rectangular). The rfbCursor::source describes, which colour those pixels should have.
|
||||
|
||||
The standard is an XCursor: a cursor with a foreground and a background
|
||||
colour (stored in backRed,backGreen,backBlue and the same for foreground
|
||||
in a range from 0-0xffff). Therefore, the arrays "mask" and "source"
|
||||
contain pixels as single bits stored in bytes in MSB order. The rows are
|
||||
padded, such that each row begins with a new byte (i.e. a 10x4
|
||||
cursor's mask has 2x4 bytes, because 2 bytes are needed to hold 10 bits).
|
||||
|
||||
It is however very easy to make a cursor like this:
|
||||
@code
|
||||
char* cur=" "
|
||||
" xx "
|
||||
" x "
|
||||
" ";
|
||||
char* mask="xxxx"
|
||||
"xxxx"
|
||||
"xxxx"
|
||||
"xxx ";
|
||||
rfbCursorPtr c=rfbMakeXCursor(4,4,cur,mask);
|
||||
@endcode
|
||||
You can even set rfbCursor::mask to NULL in this call and LibVNCServer will calculate
|
||||
a mask for you (dynamically, so you have to free it yourself).
|
||||
|
||||
There is also an array named rfbCursor::richSource for colourful cursors. They have
|
||||
the same format as the frameBuffer (i.e. if the server is 32 bit,
|
||||
a 10x4 cursor has 4x10x4 bytes).
|
||||
|
||||
@section screen_client_difference What is the difference between rfbScreenInfoPtr and rfbClientPtr?
|
||||
|
||||
The rfbScreenInfoPtr is a pointer to a rfbScreenInfo structure, which
|
||||
holds information about the server, like pixel format, io functions,
|
||||
frame buffer etc. The rfbClientPtr is a pointer to an rfbClientRec structure, which holds
|
||||
information about a client, like pixel format, socket of the
|
||||
connection, etc. A server can have several clients, but needn't have any. So, if you
|
||||
have a server and three clients are connected, you have one instance
|
||||
of a rfbScreenInfo and three instances of rfbClientRec's.
|
||||
|
||||
The rfbClientRec structure holds a member rfbClientRec::screen which points to the server.
|
||||
So, to access the server from the client structure, you use client->screen.
|
||||
|
||||
To access all clients from a server be sure to use the provided iterator
|
||||
rfbGetClientIterator()
|
||||
with
|
||||
rfbClientIteratorNext()
|
||||
and
|
||||
rfbReleaseClientIterator()
|
||||
to prevent thread clashes.
|
||||
|
||||
@section example_code Example Code
|
||||
|
||||
There are two documented examples included:
|
||||
- example.c, a shared scribble sheet
|
||||
- pnmshow.c, a program to show PNMs (pictures) over the net.
|
||||
|
||||
The examples are not too well documented, but easy straight forward and a
|
||||
good starting point.
|
||||
|
||||
Try example.c: it outputs on which port it listens (default: 5900), so it is
|
||||
display 0. To view, call @code vncviewer :0 @endcode
|
||||
You should see a sheet with a gradient and "Hello World!" written on it. Try
|
||||
to paint something. Note that everytime you click, there is some bigger blot,
|
||||
whereas when you drag the mouse while clicked you draw a line. The size of the
|
||||
blot depends on the mouse button you click. Open a second vncviewer with
|
||||
the same parameters and watch it as you paint in the other window. This also
|
||||
works over internet. You just have to know either the name or the IP of your
|
||||
machine. Then it is @code vncviewer machine.where.example.runs.com:0 @endcode
|
||||
or similar for the remote client. Now you are ready to type something. Be sure
|
||||
that your mouse sits still, because everytime the mouse moves, the cursor is
|
||||
reset to the position of the pointer! If you are done with that demo, press
|
||||
the down or up arrows. If your viewer supports it, then the dimensions of the
|
||||
sheet change. Just press Escape in the viewer. Note that the server still
|
||||
runs, even if you closed both windows. When you reconnect now, everything you
|
||||
painted and wrote is still there. You can press "Page Up" for a blank page.
|
||||
|
||||
The demo pnmshow.c is much simpler: you either provide a filename as argument
|
||||
or pipe a file through stdin. Note that the file has to be a raw pnm/ppm file,
|
||||
i.e. a truecolour graphics. Only the Escape key is implemented. This may be
|
||||
the best starting point if you want to learn how to use LibVNCServer. You
|
||||
are confronted with the fact that the bytes per pixel can only be 8, 16 or 32.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#ifndef RFBCLIENT_H
|
||||
#define RFBCLIENT_H
|
||||
|
||||
/**
|
||||
* @defgroup libvncclient_api LibVNCClient API Reference
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved.
|
||||
* Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
|
||||
@@ -22,8 +27,8 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* vncviewer.h
|
||||
/**
|
||||
* @file rfbclient.h
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -33,6 +38,9 @@
|
||||
#include <unistd.h>
|
||||
#include "rfbproto.h"
|
||||
#include "keysym.h"
|
||||
#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
|
||||
#include <gnutls/gnutls.h>
|
||||
#endif
|
||||
|
||||
#define rfbClientSwap16IfLE(s) \
|
||||
(*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
|
||||
@@ -43,6 +51,16 @@
|
||||
(((l) & 0x0000ff00) << 8) | \
|
||||
(((l) & 0x000000ff) << 24)) : (l))
|
||||
|
||||
#define rfbClientSwap64IfLE(l) \
|
||||
(*(char *)&client->endianTest ? ((((l) & 0xff00000000000000ULL) >> 56) | \
|
||||
(((l) & 0x00ff000000000000ULL) >> 40) | \
|
||||
(((l) & 0x0000ff0000000000ULL) >> 24) | \
|
||||
(((l) & 0x000000ff00000000ULL) >> 8) | \
|
||||
(((l) & 0x00000000ff000000ULL) << 8) | \
|
||||
(((l) & 0x0000000000ff0000ULL) << 24) | \
|
||||
(((l) & 0x000000000000ff00ULL) << 40) | \
|
||||
(((l) & 0x00000000000000ffULL) << 56)) : (l))
|
||||
|
||||
#define FLASH_PORT_OFFSET 5400
|
||||
#define LISTEN_PORT_OFFSET 5500
|
||||
#define TUNNEL_PORT_OFFSET 5500
|
||||
@@ -54,12 +72,12 @@
|
||||
#define DEFAULT_VIA_CMD \
|
||||
(DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20")
|
||||
|
||||
#if (defined __cplusplus)
|
||||
#if(defined __cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* vncrec */
|
||||
/** vncrec */
|
||||
|
||||
typedef struct {
|
||||
FILE* file;
|
||||
@@ -68,7 +86,7 @@ typedef struct {
|
||||
rfbBool doNotSleep;
|
||||
} rfbVNCRec;
|
||||
|
||||
/* client data */
|
||||
/** client data */
|
||||
|
||||
typedef struct rfbClientData {
|
||||
void* tag;
|
||||
@@ -76,7 +94,7 @@ typedef struct rfbClientData {
|
||||
struct rfbClientData* next;
|
||||
} rfbClientData;
|
||||
|
||||
/* app data (belongs into rfbClient?) */
|
||||
/** app data (belongs into rfbClient?) */
|
||||
|
||||
typedef struct {
|
||||
rfbBool shareDesktop;
|
||||
@@ -94,20 +112,44 @@ typedef struct {
|
||||
int qualityLevel;
|
||||
rfbBool enableJPEG;
|
||||
rfbBool useRemoteCursor;
|
||||
rfbBool palmVNC; /* use palmvnc specific SetScale (vs ultravnc) */
|
||||
int scaleSetting; /* 0 means no scale set, else 1/scaleSetting */
|
||||
rfbBool palmVNC; /**< use palmvnc specific SetScale (vs ultravnc) */
|
||||
int scaleSetting; /**< 0 means no scale set, else 1/scaleSetting */
|
||||
} AppData;
|
||||
|
||||
/** For GetCredentialProc callback function to return */
|
||||
typedef union _rfbCredential
|
||||
{
|
||||
/** X509 (VeNCrypt) */
|
||||
struct
|
||||
{
|
||||
char *x509CACertFile;
|
||||
char *x509CACrlFile;
|
||||
char *x509ClientCertFile;
|
||||
char *x509ClientKeyFile;
|
||||
} x509Credential;
|
||||
/** Plain (VeNCrypt), MSLogon (UltraVNC) */
|
||||
struct
|
||||
{
|
||||
char *username;
|
||||
char *password;
|
||||
} userCredential;
|
||||
} rfbCredential;
|
||||
|
||||
#define rfbCredentialTypeX509 1
|
||||
#define rfbCredentialTypeUser 2
|
||||
|
||||
struct _rfbClient;
|
||||
|
||||
typedef void (*HandleTextChatProc)(struct _rfbClient* client, int value, char *text);
|
||||
typedef void (*HandleXvpMsgProc)(struct _rfbClient* client, uint8_t version, uint8_t opcode);
|
||||
typedef void (*HandleKeyboardLedStateProc)(struct _rfbClient* client, int value, int pad);
|
||||
typedef rfbBool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y);
|
||||
typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h);
|
||||
typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client);
|
||||
typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h);
|
||||
typedef void (*FinishedFrameBufferUpdateProc)(struct _rfbClient* client);
|
||||
typedef char* (*GetPasswordProc)(struct _rfbClient* client);
|
||||
typedef rfbCredential* (*GetCredentialProc)(struct _rfbClient* client, int credentialType);
|
||||
typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client);
|
||||
typedef void (*GotXCutTextProc)(struct _rfbClient* client, const char *text, int textlen);
|
||||
typedef void (*BellProc)(struct _rfbClient* client);
|
||||
@@ -125,7 +167,7 @@ typedef struct _rfbClient {
|
||||
|
||||
const char* programName;
|
||||
char* serverHost;
|
||||
int serverPort; /* if -1, then use file recorded by vncrec */
|
||||
int serverPort; /**< if -1, then use file recorded by vncrec */
|
||||
rfbBool listenSpecified;
|
||||
int listenPort, flashPort;
|
||||
|
||||
@@ -133,7 +175,7 @@ typedef struct _rfbClient {
|
||||
int x, y, w, h;
|
||||
} updateRect;
|
||||
|
||||
/* Note that the CoRRE encoding uses this buffer and assumes it is big enough
|
||||
/** Note that the CoRRE encoding uses this buffer and assumes it is big enough
|
||||
to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes.
|
||||
Hextile also assumes it is big enough to hold 16 * 16 * 32 bits.
|
||||
Tight encoding assumes BUFFER_SIZE is at least 16384 bytes. */
|
||||
@@ -150,6 +192,9 @@ typedef struct _rfbClient {
|
||||
rfbPixelFormat format;
|
||||
rfbServerInitMsg si;
|
||||
|
||||
/* listen.c */
|
||||
int listenSock;
|
||||
|
||||
/* sockets.c */
|
||||
#define RFB_BUF_SIZE 8192
|
||||
char buf[RFB_BUF_SIZE];
|
||||
@@ -181,7 +226,7 @@ typedef struct _rfbClient {
|
||||
* Variables for the ``tight'' encoding implementation.
|
||||
*/
|
||||
|
||||
/* Separate buffer for compressed data. */
|
||||
/** Separate buffer for compressed data. */
|
||||
#define ZLIB_BUFFER_SIZE 30000
|
||||
char zlib_buffer[ZLIB_BUFFER_SIZE];
|
||||
|
||||
@@ -196,7 +241,7 @@ typedef struct _rfbClient {
|
||||
uint8_t tightPrevRow[2048*3*sizeof(uint16_t)];
|
||||
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
|
||||
/* JPEG decoder state. */
|
||||
/** JPEG decoder state. */
|
||||
rfbBool jpegError;
|
||||
|
||||
struct jpeg_source_mgr* jpegSrcManager;
|
||||
@@ -210,7 +255,7 @@ typedef struct _rfbClient {
|
||||
/* cursor.c */
|
||||
uint8_t *rcSource, *rcMask;
|
||||
|
||||
/* private data pointer */
|
||||
/** private data pointer */
|
||||
rfbClientData* clientData;
|
||||
|
||||
rfbVNCRec* vncRec;
|
||||
@@ -228,7 +273,8 @@ typedef struct _rfbClient {
|
||||
SoftCursorLockAreaProc SoftCursorLockArea;
|
||||
SoftCursorUnlockScreenProc SoftCursorUnlockScreen;
|
||||
GotFrameBufferUpdateProc GotFrameBufferUpdate;
|
||||
/* the pointer returned by GetPassword will be freed after use! */
|
||||
FinishedFrameBufferUpdateProc FinishedFrameBufferUpdate;
|
||||
/** the pointer returned by GetPassword will be freed after use! */
|
||||
GetPasswordProc GetPassword;
|
||||
MallocFrameBufferProc MallocFrameBuffer;
|
||||
GotXCutTextProc GotXCutText;
|
||||
@@ -237,7 +283,7 @@ typedef struct _rfbClient {
|
||||
GotCursorShapeProc GotCursorShape;
|
||||
GotCopyRectProc GotCopyRect;
|
||||
|
||||
/* Which messages are supported by the server
|
||||
/** Which messages are supported by the server
|
||||
* This is a *guess* for most servers.
|
||||
* (If we can even detect the type of server)
|
||||
*
|
||||
@@ -247,8 +293,38 @@ typedef struct _rfbClient {
|
||||
*/
|
||||
rfbSupportedMessages supportedMessages;
|
||||
|
||||
/* negotiated protocol version */
|
||||
/** negotiated protocol version */
|
||||
int major, minor;
|
||||
|
||||
/** The selected security types */
|
||||
uint32_t authScheme, subAuthScheme;
|
||||
|
||||
#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
|
||||
/** The TLS session for Anonymous TLS and VeNCrypt */
|
||||
gnutls_session_t tlsSession;
|
||||
#endif
|
||||
|
||||
/** To support security types that requires user input (except VNC password
|
||||
* authentication), for example VeNCrypt and MSLogon, this callback function
|
||||
* must be set before the authentication. Otherwise, it implicates that the
|
||||
* caller application does not support it and related security types should
|
||||
* be bypassed.
|
||||
*/
|
||||
GetCredentialProc GetCredential;
|
||||
|
||||
/** The 0-terminated security types supported by the client.
|
||||
* Set by function SetClientAuthSchemes() */
|
||||
uint32_t *clientAuthSchemes;
|
||||
|
||||
/** When the server is a repeater, this specifies the final destination */
|
||||
char *destHost;
|
||||
int destPort;
|
||||
|
||||
/** the QoS IP DSCP for this client */
|
||||
int QoS_DSCP;
|
||||
|
||||
/** hook to handle xvp server messages */
|
||||
HandleXvpMsgProc HandleXvpMsg;
|
||||
} rfbClient;
|
||||
|
||||
/* cursor.c */
|
||||
@@ -258,6 +334,7 @@ extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width
|
||||
/* listen.c */
|
||||
|
||||
extern void listenForIncomingConnections(rfbClient* viewer);
|
||||
extern int listenForIncomingConnectionsNoFork(rfbClient* viewer, int usec_timeout);
|
||||
|
||||
/* rfbproto.c */
|
||||
|
||||
@@ -265,6 +342,8 @@ extern rfbBool rfbEnableClientLogging;
|
||||
typedef void (*rfbClientLogProc)(const char *format, ...);
|
||||
extern rfbClientLogProc rfbClientLog,rfbClientErr;
|
||||
extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
|
||||
extern rfbBool ConnectToRFBRepeater(rfbClient* client,const char *repeaterHost, int repeaterPort, const char *destHost, int destPort);
|
||||
extern void SetClientAuthSchemes(rfbClient* client,const uint32_t *authSchemes, int size);
|
||||
extern rfbBool InitialiseRFBConnection(rfbClient* client);
|
||||
extern rfbBool SetFormatAndEncodings(rfbClient* client);
|
||||
extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client);
|
||||
@@ -282,9 +361,13 @@ extern rfbBool TextChatOpen(rfbClient* client);
|
||||
extern rfbBool TextChatClose(rfbClient* client);
|
||||
extern rfbBool TextChatFinish(rfbClient* client);
|
||||
extern rfbBool PermitServerInput(rfbClient* client, int enabled);
|
||||
extern rfbBool SendXvpMsg(rfbClient* client, uint8_t version, uint8_t code);
|
||||
|
||||
extern void PrintPixelFormat(rfbPixelFormat *format);
|
||||
|
||||
extern rfbBool SupportsClient2Server(rfbClient* client, int messageType);
|
||||
extern rfbBool SupportsServer2Client(rfbClient* client, int messageType);
|
||||
|
||||
/* client data */
|
||||
|
||||
void rfbClientSetClientData(rfbClient* client, void* tag, void* data);
|
||||
@@ -294,10 +377,10 @@ void* rfbClientGetClientData(rfbClient* client, void* tag);
|
||||
|
||||
typedef struct _rfbClientProtocolExtension {
|
||||
int* encodings;
|
||||
/* returns TRUE if the encoding was handled */
|
||||
/** returns TRUE if the encoding was handled */
|
||||
rfbBool (*handleEncoding)(rfbClient* cl,
|
||||
rfbFramebufferUpdateRectHeader* rect);
|
||||
/* returns TRUE if it handled the message */
|
||||
/** returns TRUE if it handled the message */
|
||||
rfbBool (*handleMessage)(rfbClient* cl,
|
||||
rfbServerToClientMsg* message);
|
||||
struct _rfbClientProtocolExtension* next;
|
||||
@@ -314,8 +397,11 @@ extern rfbBool WriteToRFBServer(rfbClient* client, char *buf, int n);
|
||||
extern int FindFreeTcpPort(void);
|
||||
extern int ListenAtTcpPort(int port);
|
||||
extern int ConnectClientToTcpAddr(unsigned int host, int port);
|
||||
extern int ConnectClientToTcpAddr6(const char *hostname, int port);
|
||||
extern int ConnectClientToUnixSock(const char *sockFile);
|
||||
extern int AcceptTcpConnection(int listenSock);
|
||||
extern rfbBool SetNonBlocking(int sock);
|
||||
extern rfbBool SetDSCP(int sock, int dscp);
|
||||
|
||||
extern rfbBool StringToIPAddr(const char *str, unsigned int *addr);
|
||||
extern rfbBool SameMachine(int sock);
|
||||
@@ -324,12 +410,21 @@ extern int WaitForMessage(rfbClient* client,unsigned int usecs);
|
||||
/* vncviewer.c */
|
||||
rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
|
||||
rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv);
|
||||
/* rfbClientCleanup() does not touch client->frameBuffer */
|
||||
/** rfbClientCleanup() does not touch client->frameBuffer */
|
||||
void rfbClientCleanup(rfbClient* client);
|
||||
|
||||
#if (defined __cplusplus)
|
||||
#if(defined __cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
@page libvncclient_doc LibVNCClient Documentation
|
||||
@section example_code Example Code
|
||||
See SDLvncviewer.c for a rather complete client example.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
#ifndef RFBPROTO_H
|
||||
#define RFBPROTO_H
|
||||
|
||||
/**
|
||||
@mainpage
|
||||
@li @ref libvncserver_api
|
||||
@li @ref libvncserver_doc
|
||||
|
||||
|
||||
@li @ref libvncclient_api
|
||||
@li @ref libvncclient_doc
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin
|
||||
* Copyright (C) 2000-2002 Constantin Kaplinsky. All Rights Reserved.
|
||||
@@ -68,6 +79,16 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* some autotool versions do not properly prefix
|
||||
WORDS_BIGENDIAN, so do that manually */
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define LIBVNCSERVER_WORDS_BIGENDIAN
|
||||
#endif
|
||||
|
||||
/* MS compilers don't have strncasecmp */
|
||||
#ifdef _MSC_VER
|
||||
#define strncasecmp _strnicmp
|
||||
#endif
|
||||
|
||||
#if !defined(WIN32) || defined(__MINGW32__)
|
||||
#define max(a,b) (((a)>(b))?(a):(b))
|
||||
@@ -96,7 +117,7 @@ typedef uint32_t in_addr_t;
|
||||
#define INADDR_NONE ((in_addr_t) 0xffffffff)
|
||||
#endif
|
||||
|
||||
#define MAX_ENCODINGS 20
|
||||
#define MAX_ENCODINGS 21
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
@@ -264,6 +285,19 @@ typedef char rfbProtocolVersionMsg[13]; /* allow extra byte for null */
|
||||
#define rfbTight 16
|
||||
#define rfbUltra 17
|
||||
#define rfbTLS 18
|
||||
#define rfbVeNCrypt 19
|
||||
#define rfbARD 30
|
||||
#define rfbMSLogon 0xfffffffa
|
||||
|
||||
#define rfbVeNCryptPlain 256
|
||||
#define rfbVeNCryptTLSNone 257
|
||||
#define rfbVeNCryptTLSVNC 258
|
||||
#define rfbVeNCryptTLSPlain 259
|
||||
#define rfbVeNCryptX509None 260
|
||||
#define rfbVeNCryptX509VNC 261
|
||||
#define rfbVeNCryptX509Plain 262
|
||||
#define rfbVeNCryptX509SASL 263
|
||||
#define rfbVeNCryptTLSSASL 264
|
||||
|
||||
/*
|
||||
* rfbConnFailed: For some reason the connection failed (e.g. the server
|
||||
@@ -357,7 +391,6 @@ typedef struct {
|
||||
#define rfbServerCutText 3
|
||||
/* Modif sf@2002 */
|
||||
#define rfbResizeFrameBuffer 4
|
||||
#define rfbKeyFrameUpdate 5
|
||||
#define rfbPalmVNCReSizeFrameBuffer 0xF
|
||||
|
||||
/* client -> server */
|
||||
@@ -380,9 +413,10 @@ typedef struct {
|
||||
/* Modif sf@2002 - TextChat - Bidirectionnal */
|
||||
#define rfbTextChat 11
|
||||
/* Modif cs@2005 */
|
||||
#define rfbKeyFrameRequest 12
|
||||
/* PalmVNC 1.4 & 2.0 SetScale Factor message */
|
||||
#define rfbPalmVNCSetScaleFactor 0xF
|
||||
/* Xvp message - bidirectional */
|
||||
#define rfbXvp 250
|
||||
|
||||
|
||||
|
||||
@@ -417,6 +451,9 @@ typedef struct {
|
||||
#define rfbEncodingSolMonoZip 0xFFFF0008
|
||||
#define rfbEncodingUltraZip 0xFFFF0009
|
||||
|
||||
/* Xvp pseudo-encoding */
|
||||
#define rfbEncodingXvp 0xFFFFFECB
|
||||
|
||||
/*
|
||||
* Special encoding numbers:
|
||||
* 0xFFFFFF00 .. 0xFFFFFF0F -- encoding-specific compression levels;
|
||||
@@ -489,18 +526,6 @@ typedef struct {
|
||||
|
||||
#define sz_rfbFramebufferUpdateMsg 4
|
||||
|
||||
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* KeyFrameUpdate - Acknowledgment of a key frame request, it tells the client
|
||||
* that the next update received will be a key frame.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
uint8_t type;
|
||||
} rfbKeyFrameUpdateMsg;
|
||||
|
||||
#define sz_rfbKeyFrameUpdateMsg 1
|
||||
|
||||
|
||||
/*
|
||||
* Each rectangle of pixel data consists of a header describing the position
|
||||
* and size of the rectangle and a type word describing the encoding of the
|
||||
@@ -1039,6 +1064,44 @@ typedef struct _rfbTextChatMsg {
|
||||
#define rfbTextChatFinished 0xFFFFFFFD
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Xvp Message
|
||||
* Bidirectional message
|
||||
* A server which supports the xvp extension declares this by sending a message
|
||||
* with an Xvp_INIT xvp-message-code when it receives a request from the client
|
||||
* to use the xvp Pseudo-encoding. The server must specify in this message the
|
||||
* highest xvp-extension-version it supports: the client may assume that the
|
||||
* server supports all versions from 1 up to this value. The client is then
|
||||
* free to use any supported version. Currently, only version 1 is defined.
|
||||
*
|
||||
* A server which subsequently receives an xvp Client Message requesting an
|
||||
* operation which it is unable to perform, informs the client of this by
|
||||
* sending a message with an Xvp_FAIL xvp-message-code, and the same
|
||||
* xvp-extension-version as included in the client's operation request.
|
||||
*
|
||||
* A client supporting the xvp extension sends this to request that the server
|
||||
* initiate a clean shutdown, clean reboot or abrupt reset of the system whose
|
||||
* framebuffer the client is displaying.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t type; /* always rfbXvp */
|
||||
uint8_t pad;
|
||||
uint8_t version; /* xvp extension version */
|
||||
uint8_t code; /* xvp message code */
|
||||
} rfbXvpMsg;
|
||||
|
||||
#define sz_rfbXvpMsg (4)
|
||||
|
||||
/* server message codes */
|
||||
#define rfbXvp_Fail 0
|
||||
#define rfbXvp_Init 1
|
||||
/* client message codes */
|
||||
#define rfbXvp_Shutdown 2
|
||||
#define rfbXvp_Reboot 3
|
||||
#define rfbXvp_Reset 4
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Modif sf@2002
|
||||
@@ -1093,6 +1156,7 @@ typedef union {
|
||||
rfbPalmVNCReSizeFrameBufferMsg prsfb;
|
||||
rfbFileTransferMsg ft;
|
||||
rfbTextChatMsg tc;
|
||||
rfbXvpMsg xvp;
|
||||
} rfbServerToClientMsg;
|
||||
|
||||
|
||||
@@ -1328,6 +1392,7 @@ typedef struct _rfbSetSWMsg {
|
||||
#define sz_rfbSetSWMsg 6
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Union of all client->server messages.
|
||||
*/
|
||||
@@ -1347,6 +1412,7 @@ typedef union {
|
||||
rfbFileTransferMsg ft;
|
||||
rfbSetSWMsg sw;
|
||||
rfbTextChatMsg tc;
|
||||
rfbXvpMsg xvp;
|
||||
} rfbClientToServerMsg;
|
||||
|
||||
/*
|
||||
|
||||
0
libvncserver/rfb/rfbregion.h
Executable file → Normal file
0
libvncserver/rfb/rfbregion.h
Executable file → Normal file
0
libvncserver/rfbregion.c
Executable file → Normal file
0
libvncserver/rfbregion.c
Executable file → Normal file
@@ -54,10 +54,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CORBA
|
||||
#include <vncserverctrl.h>
|
||||
#endif
|
||||
|
||||
#ifdef DEBUGPROTO
|
||||
#undef DEBUGPROTO
|
||||
#define DEBUGPROTO(x) x
|
||||
@@ -214,15 +210,11 @@ rfbNewClientConnection(rfbScreenInfoPtr rfbScreen,
|
||||
rfbClientPtr cl;
|
||||
|
||||
cl = rfbNewClient(rfbScreen,sock);
|
||||
#ifdef CORBA
|
||||
if(cl!=NULL)
|
||||
newConnection(cl, (KEYBOARD_DEVICE|POINTER_DEVICE),1,1,1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* rfbReverseConnection is called by the CORBA stuff to make an outward
|
||||
* rfbReverseConnection is called to make an outward
|
||||
* connection to a "listening" RFB client.
|
||||
*/
|
||||
|
||||
@@ -307,13 +299,10 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
|
||||
}
|
||||
rfbReleaseClientIterator(iterator);
|
||||
|
||||
#ifndef WIN32
|
||||
if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) {
|
||||
rfbLogPerror("fcntl failed");
|
||||
if(!rfbSetNonBlocking(sock)) {
|
||||
close(sock);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
|
||||
(char *)&one, sizeof(one)) < 0) {
|
||||
@@ -327,6 +316,7 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
|
||||
|
||||
INIT_MUTEX(cl->outputMutex);
|
||||
INIT_MUTEX(cl->refCountMutex);
|
||||
INIT_MUTEX(cl->sendMutex);
|
||||
INIT_COND(cl->deleteCond);
|
||||
|
||||
cl->state = RFB_PROTOCOL_VERSION;
|
||||
@@ -484,7 +474,7 @@ rfbClientConnectionGone(rfbClientPtr cl)
|
||||
if (cl->next)
|
||||
cl->next->prev = cl->prev;
|
||||
|
||||
if(cl->sock>0)
|
||||
if(cl->sock>=0)
|
||||
close(cl->sock);
|
||||
|
||||
if (cl->scaledScreen!=NULL)
|
||||
@@ -496,6 +486,10 @@ rfbClientConnectionGone(rfbClientPtr cl)
|
||||
|
||||
rfbFreeUltraData(cl);
|
||||
|
||||
/* free buffers holding pixel data before and after encoding */
|
||||
free(cl->beforeEncBuf);
|
||||
free(cl->afterEncBuf);
|
||||
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
|
||||
if(cl->screen->backgroundLoop != FALSE) {
|
||||
int i;
|
||||
@@ -550,9 +544,9 @@ rfbClientConnectionGone(rfbClientPtr cl)
|
||||
UNLOCK(cl->outputMutex);
|
||||
TINI_MUTEX(cl->outputMutex);
|
||||
|
||||
#ifdef CORBA
|
||||
destroyConnection(cl);
|
||||
#endif
|
||||
LOCK(cl->sendMutex);
|
||||
UNLOCK(cl->sendMutex);
|
||||
TINI_MUTEX(cl->sendMutex);
|
||||
|
||||
rfbPrintStats(cl);
|
||||
|
||||
@@ -609,14 +603,9 @@ rfbProcessClientProtocolVersion(rfbClientPtr cl)
|
||||
|
||||
pv[sz_rfbProtocolVersionMsg] = 0;
|
||||
if (sscanf(pv,rfbProtocolVersionFormat,&major_,&minor_) != 2) {
|
||||
char name[1024];
|
||||
if(sscanf(pv,"RFB %03d.%03d %1023s\n",&major_,&minor_,name) != 3) {
|
||||
rfbErr("rfbProcessClientProtocolVersion: not a valid RFB client: %s\n", pv);
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
free(cl->host);
|
||||
cl->host=strdup(name);
|
||||
rfbErr("rfbProcessClientProtocolVersion: not a valid RFB client: %s\n", pv);
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
rfbLog("Client Protocol Version %d.%d\n", major_, minor_);
|
||||
|
||||
@@ -882,16 +871,16 @@ rfbSendSupportedMessages(rfbClientPtr cl)
|
||||
/*rfbSetBit(msgs.client2server, rfbSetServerInput); */
|
||||
/*rfbSetBit(msgs.client2server, rfbSetSW); */
|
||||
/*rfbSetBit(msgs.client2server, rfbTextChat); */
|
||||
/*rfbSetBit(msgs.client2server, rfbKeyFrameRequest); */
|
||||
rfbSetBit(msgs.client2server, rfbPalmVNCSetScaleFactor);
|
||||
rfbSetBit(msgs.client2server, rfbXvp);
|
||||
|
||||
rfbSetBit(msgs.server2client, rfbFramebufferUpdate);
|
||||
rfbSetBit(msgs.server2client, rfbSetColourMapEntries);
|
||||
rfbSetBit(msgs.server2client, rfbBell);
|
||||
rfbSetBit(msgs.server2client, rfbServerCutText);
|
||||
rfbSetBit(msgs.server2client, rfbResizeFrameBuffer);
|
||||
/*rfbSetBit(msgs.server2client, rfbKeyFrameUpdate); */
|
||||
rfbSetBit(msgs.server2client, rfbPalmVNCReSizeFrameBuffer);
|
||||
rfbSetBit(msgs.server2client, rfbXvp);
|
||||
|
||||
memcpy(&cl->updateBuf[cl->ublen], (char *)&msgs, sz_rfbSupportedMessages);
|
||||
cl->ublen += sz_rfbSupportedMessages;
|
||||
@@ -1037,6 +1026,33 @@ rfbSendServerIdentity(rfbClientPtr cl)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send an xvp server message
|
||||
*/
|
||||
|
||||
rfbBool
|
||||
rfbSendXvp(rfbClientPtr cl, uint8_t version, uint8_t code)
|
||||
{
|
||||
rfbXvpMsg xvp;
|
||||
|
||||
xvp.type = rfbXvp;
|
||||
xvp.pad = 0;
|
||||
xvp.version = version;
|
||||
xvp.code = code;
|
||||
|
||||
LOCK(cl->sendMutex);
|
||||
if (rfbWriteExact(cl, (char *)&xvp, sz_rfbXvpMsg) < 0) {
|
||||
rfbLogPerror("rfbSendXvp: write");
|
||||
rfbCloseClient(cl);
|
||||
}
|
||||
UNLOCK(cl->sendMutex);
|
||||
|
||||
rfbStatRecordMessageSent(cl, rfbXvp, sz_rfbXvpMsg, sz_rfbXvpMsg);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer)
|
||||
{
|
||||
rfbTextChatMsg tc;
|
||||
@@ -1102,9 +1118,11 @@ rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t
|
||||
/*
|
||||
rfbLog("rfbSendFileTransferMessage( %dtype, %dparam, %dsize, %dlen, %p)\n", contentType, contentParam, size, length, buffer);
|
||||
*/
|
||||
LOCK(cl->sendMutex);
|
||||
if (rfbWriteExact(cl, (char *)&ft, sz_rfbFileTransferMsg) < 0) {
|
||||
rfbLogPerror("rfbSendFileTransferMessage: write");
|
||||
rfbCloseClient(cl);
|
||||
UNLOCK(cl->sendMutex);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1113,9 +1131,11 @@ rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t
|
||||
if (rfbWriteExact(cl, buffer, length) < 0) {
|
||||
rfbLogPerror("rfbSendFileTransferMessage: write");
|
||||
rfbCloseClient(cl);
|
||||
UNLOCK(cl->sendMutex);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
UNLOCK(cl->sendMutex);
|
||||
|
||||
rfbStatRecordMessageSent(cl, rfbFileTransfer, sz_rfbFileTransferMsg+length, sz_rfbFileTransferMsg+length);
|
||||
|
||||
@@ -1155,13 +1175,21 @@ typedef struct {
|
||||
#define RFB_FILE_ATTRIBUTE_TEMPORARY 0x100
|
||||
#define RFB_FILE_ATTRIBUTE_COMPRESSED 0x800
|
||||
|
||||
rfbBool rfbFilenameTranslate2UNIX(rfbClientPtr cl, char *path, char *unixPath)
|
||||
rfbBool rfbFilenameTranslate2UNIX(rfbClientPtr cl, char *path, char *unixPath, size_t unixPathMaxLen)
|
||||
{
|
||||
int x;
|
||||
char *home=NULL;
|
||||
|
||||
FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
|
||||
|
||||
/*
|
||||
* Do not use strncpy() - truncating the file name would probably have undesirable side effects
|
||||
* Instead check if destination buffer is big enough
|
||||
*/
|
||||
|
||||
if (strlen(path) >= unixPathMaxLen)
|
||||
return FALSE;
|
||||
|
||||
/* C: */
|
||||
if (path[0]=='C' && path[1]==':')
|
||||
strcpy(unixPath, &path[2]);
|
||||
@@ -1170,6 +1198,10 @@ rfbBool rfbFilenameTranslate2UNIX(rfbClientPtr cl, char *path, char *unixPath)
|
||||
home = getenv("HOME");
|
||||
if (home!=NULL)
|
||||
{
|
||||
/* Re-check buffer size */
|
||||
if ((strlen(path) + strlen(home) + 1) >= unixPathMaxLen)
|
||||
return FALSE;
|
||||
|
||||
strcpy(unixPath, home);
|
||||
strcat(unixPath,"/");
|
||||
strcat(unixPath, path);
|
||||
@@ -1207,7 +1239,9 @@ rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer)
|
||||
FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, FALSE);
|
||||
|
||||
/* Client thinks we are Winblows */
|
||||
rfbFilenameTranslate2UNIX(cl, buffer, path);
|
||||
if (!rfbFilenameTranslate2UNIX(cl, buffer, path, sizeof(path)))
|
||||
return FALSE;
|
||||
|
||||
|
||||
if (DB) rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: \"%s\"->\"%s\"\n",buffer, path);
|
||||
|
||||
@@ -1250,7 +1284,11 @@ rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer)
|
||||
/*
|
||||
rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: Sending \"%s\"\n", (char *)win32filename.cFileName);
|
||||
*/
|
||||
if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, nOptLen, (char *)&win32filename)==FALSE) return FALSE;
|
||||
if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, nOptLen, (char *)&win32filename)==FALSE)
|
||||
{
|
||||
closedir(dirp);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1326,6 +1364,9 @@ rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
|
||||
n = select(cl->sock + 1, NULL, &wfds, NULL, &tv);
|
||||
|
||||
if (n<0) {
|
||||
#ifdef WIN32
|
||||
errno=WSAGetLastError();
|
||||
#endif
|
||||
rfbLog("rfbSendFileTransferChunk() select failed: %s\n", strerror(errno));
|
||||
}
|
||||
/* We have space on the transmit queue */
|
||||
@@ -1345,6 +1386,9 @@ rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
|
||||
return retval;
|
||||
case -1:
|
||||
/* TODO : send an error msg to the client... */
|
||||
#ifdef WIN32
|
||||
errno=WSAGetLastError();
|
||||
#endif
|
||||
rfbLog("rfbSendFileTransferChunk(): %s\n",strerror(errno));
|
||||
retval = rfbSendFileTransferMessage(cl, rfbAbortFileTransfer, 0, 0, 0, NULL);
|
||||
close(cl->fileTransfer.fd);
|
||||
@@ -1474,7 +1518,12 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
/* add some space to the end of the buffer as we will be adding a timespec to it */
|
||||
if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
|
||||
/* The client requests a File */
|
||||
rfbFilenameTranslate2UNIX(cl, buffer, filename1);
|
||||
if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
|
||||
{
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
cl->fileTransfer.fd=open(filename1, O_RDONLY, 0744);
|
||||
|
||||
/*
|
||||
@@ -1525,12 +1574,15 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
|
||||
/* TODO: finish 64-bit file size support */
|
||||
sizeHtmp = 0;
|
||||
LOCK(cl->sendMutex);
|
||||
if (rfbWriteExact(cl, (char *)&sizeHtmp, 4) < 0) {
|
||||
rfbLogPerror("rfbProcessFileTransfer: write");
|
||||
rfbCloseClient(cl);
|
||||
UNLOCK(cl->sendMutex);
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
UNLOCK(cl->sendMutex);
|
||||
break;
|
||||
|
||||
case rfbFileHeader:
|
||||
@@ -1569,7 +1621,8 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
p = strrchr(buffer, ',');
|
||||
if (p!=NULL) {
|
||||
*p = '\0';
|
||||
strcpy(szFileTime, p+1);
|
||||
strncpy(szFileTime, p+1, sizeof(szFileTime));
|
||||
szFileTime[sizeof(szFileTime)-1] = '\x00'; /* ensure NULL terminating byte is present, even if copy overflowed */
|
||||
} else
|
||||
szFileTime[0]=0;
|
||||
|
||||
@@ -1586,7 +1639,12 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
}
|
||||
sizeHtmp = Swap32IfLE(sizeHtmp);
|
||||
|
||||
rfbFilenameTranslate2UNIX(cl, buffer, filename1);
|
||||
if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
|
||||
{
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* If the file exists... We can send a rfbFileChecksums back to the client before we send an rfbFileAcceptHeader */
|
||||
/* TODO: Delta Transfer */
|
||||
@@ -1624,7 +1682,7 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBZ
|
||||
/* compressed packet */
|
||||
nRet = uncompress(compBuff,&nRawBytes,(const unsigned char*)buffer, length);
|
||||
retval=write(cl->fileTransfer.fd, compBuff, nRawBytes);
|
||||
retval=write(cl->fileTransfer.fd, (char*)compBuff, nRawBytes);
|
||||
#else
|
||||
/* Write the file out as received... */
|
||||
retval=write(cl->fileTransfer.fd, buffer, length);
|
||||
@@ -1712,7 +1770,12 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
if ((buffer = rfbProcessFileTransferReadBuffer(cl, length))==NULL) return FALSE;
|
||||
switch (contentParam) {
|
||||
case rfbCDirCreate: /* Client requests the creation of a directory */
|
||||
rfbFilenameTranslate2UNIX(cl, buffer, filename1);
|
||||
if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
|
||||
{
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
retval = mkdir(filename1, 0755);
|
||||
if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCDirCreate(\"%s\"->\"%s\") %s\n", buffer, filename1, (retval==-1?"Failed":"Success"));
|
||||
/*
|
||||
@@ -1721,7 +1784,11 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return retval;
|
||||
case rfbCFileDelete: /* Client requests the deletion of a file */
|
||||
rfbFilenameTranslate2UNIX(cl, buffer, filename1);
|
||||
if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
|
||||
{
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
if (stat(filename1,&statbuf)==0)
|
||||
{
|
||||
if (S_ISDIR(statbuf.st_mode))
|
||||
@@ -1739,8 +1806,17 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
|
||||
{
|
||||
/* Split into 2 filenames ('*' is a seperator) */
|
||||
*p = '\0';
|
||||
rfbFilenameTranslate2UNIX(cl, buffer, filename1);
|
||||
rfbFilenameTranslate2UNIX(cl, p+1, filename2);
|
||||
if (!rfbFilenameTranslate2UNIX(cl, buffer, filename1, sizeof(filename1)))
|
||||
{
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!rfbFilenameTranslate2UNIX(cl, p+1, filename2, sizeof(filename2)))
|
||||
{
|
||||
if (buffer!=NULL) free(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
retval = rename(filename1,filename2);
|
||||
if (DB) rfbLog("rfbProcessFileTransfer() rfbCommand: rfbCFileRename(\"%s\"->\"%s\" -->> \"%s\"->\"%s\") %s\n", buffer, filename1, p+1, filename2, (retval==-1?"Failed":"Success"));
|
||||
/*
|
||||
@@ -1983,7 +2059,15 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
|
||||
"%s\n", cl->host);
|
||||
cl->enableServerIdentity = TRUE;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case rfbEncodingXvp:
|
||||
rfbLog("Enabling Xvp protocol extension for client "
|
||||
"%s\n", cl->host);
|
||||
if (!rfbSendXvp(cl, 1, rfbXvp_Init)) {
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
#ifdef LIBVNCSERVER_HAVE_LIBZ
|
||||
if ( enc >= (uint32_t)rfbEncodingCompressLevel0 &&
|
||||
@@ -2122,6 +2206,7 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
|
||||
if (!cl->format.trueColour) {
|
||||
if (!rfbSetClientColourMap(cl, 0, 0)) {
|
||||
sraRgnDestroy(tmpRegion);
|
||||
TSIGNAL(cl->updateCond);
|
||||
UNLOCK(cl->updateMutex);
|
||||
return;
|
||||
}
|
||||
@@ -2319,6 +2404,12 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
|
||||
|
||||
str = (char *)malloc(msg.cct.length);
|
||||
|
||||
if (str == NULL) {
|
||||
rfbLogPerror("rfbProcessClientNormalMessage: not enough memory");
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((n = rfbReadExact(cl, str, msg.cct.length)) <= 0) {
|
||||
if (n != 0)
|
||||
rfbLogPerror("rfbProcessClientNormalMessage: read");
|
||||
@@ -2343,6 +2434,11 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
if (msg.ssc.scale == 0) {
|
||||
rfbLogPerror("rfbProcessClientNormalMessage: will not accept a scale factor of zero");
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetScaleMsg, sz_rfbSetScaleMsg);
|
||||
rfbLog("rfbSetScale(%d)\n", msg.ssc.scale);
|
||||
rfbScalingSetup(cl,cl->screen->width/msg.ssc.scale, cl->screen->height/msg.ssc.scale);
|
||||
@@ -2359,6 +2455,11 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
if (msg.ssc.scale == 0) {
|
||||
rfbLogPerror("rfbProcessClientNormalMessage: will not accept a scale factor of zero");
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbSetScaleMsg, sz_rfbSetScaleMsg);
|
||||
rfbLog("rfbSetScale(%d)\n", msg.ssc.scale);
|
||||
rfbScalingSetup(cl,cl->screen->width/msg.ssc.scale, cl->screen->height/msg.ssc.scale);
|
||||
@@ -2366,6 +2467,28 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
|
||||
rfbSendNewScaleSize(cl);
|
||||
return;
|
||||
|
||||
case rfbXvp:
|
||||
|
||||
if ((n = rfbReadExact(cl, ((char *)&msg) + 1,
|
||||
sz_rfbXvpMsg - 1)) <= 0) {
|
||||
if (n != 0)
|
||||
rfbLogPerror("rfbProcessClientNormalMessage: read");
|
||||
rfbCloseClient(cl);
|
||||
return;
|
||||
}
|
||||
rfbStatRecordMessageRcvd(cl, msg.type, sz_rfbXvpMsg, sz_rfbXvpMsg);
|
||||
|
||||
/* only version when is defined, so echo back a fail */
|
||||
if(msg.xvp.version != 1) {
|
||||
rfbSendXvp(cl, msg.xvp.version, rfbXvp_Fail);
|
||||
}
|
||||
else {
|
||||
/* if the hook exists and fails, send a fail msg */
|
||||
if(cl->screen->xvpHook && !cl->screen->xvpHook(cl, msg.xvp.version, msg.xvp.code))
|
||||
rfbSendXvp(cl, 1, rfbXvp_Fail);
|
||||
}
|
||||
return;
|
||||
|
||||
default:
|
||||
{
|
||||
rfbExtensionData *e,*next;
|
||||
@@ -2433,9 +2556,14 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
|
||||
fu->nRects = Swap16IfLE(1);
|
||||
cl->ublen = sz_rfbFramebufferUpdateMsg;
|
||||
if (!rfbSendNewFBSize(cl, cl->scaledScreen->width, cl->scaledScreen->height)) {
|
||||
if(cl->screen->displayFinishedHook)
|
||||
cl->screen->displayFinishedHook(cl, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
return rfbSendUpdateBuf(cl);
|
||||
result = rfbSendUpdateBuf(cl);
|
||||
if(cl->screen->displayFinishedHook)
|
||||
cl->screen->displayFinishedHook(cl, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2551,6 +2679,8 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
|
||||
!sendSupportedMessages && !sendSupportedEncodings && !sendServerIdentity) {
|
||||
sraRgnDestroy(updateRegion);
|
||||
UNLOCK(cl->updateMutex);
|
||||
if(cl->screen->displayFinishedHook)
|
||||
cl->screen->displayFinishedHook(cl, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -2747,7 +2877,7 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
|
||||
if (!rfbSendServerIdentity(cl))
|
||||
goto updateFailed;
|
||||
}
|
||||
|
||||
|
||||
if (!sraRgnEmpty(updateCopyRegion)) {
|
||||
if (!rfbSendCopyRegion(cl,updateCopyRegion,dx,dy))
|
||||
goto updateFailed;
|
||||
@@ -2828,6 +2958,9 @@ updateFailed:
|
||||
sraRgnReleaseIterator(i);
|
||||
sraRgnDestroy(updateRegion);
|
||||
sraRgnDestroy(updateCopyRegion);
|
||||
|
||||
if(cl->screen->displayFinishedHook)
|
||||
cl->screen->displayFinishedHook(cl, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3103,12 +3236,15 @@ rfbSendSetColourMapEntries(rfbClientPtr cl,
|
||||
|
||||
len += nColours * 3 * 2;
|
||||
|
||||
LOCK(cl->sendMutex);
|
||||
if (rfbWriteExact(cl, wbuf, len) < 0) {
|
||||
rfbLogPerror("rfbSendSetColourMapEntries: write");
|
||||
rfbCloseClient(cl);
|
||||
if (wbuf != buf) free(wbuf);
|
||||
UNLOCK(cl->sendMutex);
|
||||
return FALSE;
|
||||
}
|
||||
UNLOCK(cl->sendMutex);
|
||||
|
||||
rfbStatRecordMessageSent(cl, rfbSetColourMapEntries, len, len);
|
||||
if (wbuf != buf) free(wbuf);
|
||||
@@ -3129,10 +3265,12 @@ rfbSendBell(rfbScreenInfoPtr rfbScreen)
|
||||
i = rfbGetClientIterator(rfbScreen);
|
||||
while((cl=rfbClientIteratorNext(i))) {
|
||||
b.type = rfbBell;
|
||||
LOCK(cl->sendMutex);
|
||||
if (rfbWriteExact(cl, (char *)&b, sz_rfbBellMsg) < 0) {
|
||||
rfbLogPerror("rfbSendBell: write");
|
||||
rfbCloseClient(cl);
|
||||
}
|
||||
UNLOCK(cl->sendMutex);
|
||||
}
|
||||
rfbStatRecordMessageSent(cl, rfbBell, sz_rfbBellMsg, sz_rfbBellMsg);
|
||||
rfbReleaseClientIterator(i);
|
||||
@@ -3154,16 +3292,19 @@ rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len)
|
||||
while ((cl = rfbClientIteratorNext(iterator)) != NULL) {
|
||||
sct.type = rfbServerCutText;
|
||||
sct.length = Swap32IfLE(len);
|
||||
LOCK(cl->sendMutex);
|
||||
if (rfbWriteExact(cl, (char *)&sct,
|
||||
sz_rfbServerCutTextMsg) < 0) {
|
||||
rfbLogPerror("rfbSendServerCutText: write");
|
||||
rfbCloseClient(cl);
|
||||
UNLOCK(cl->sendMutex);
|
||||
continue;
|
||||
}
|
||||
if (rfbWriteExact(cl, str, len) < 0) {
|
||||
rfbLogPerror("rfbSendServerCutText: write");
|
||||
rfbCloseClient(cl);
|
||||
}
|
||||
UNLOCK(cl->sendMutex);
|
||||
rfbStatRecordMessageSent(cl, rfbServerCutText, sz_rfbServerCutTextMsg+len, sz_rfbServerCutTextMsg+len);
|
||||
}
|
||||
rfbReleaseClientIterator(iterator);
|
||||
@@ -3183,7 +3324,7 @@ void
|
||||
rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,
|
||||
int sock)
|
||||
{
|
||||
if (write(sock, &ptrAcceleration, 1) < 0) {
|
||||
if (write(sock, (char*) &ptrAcceleration, 1) < 0) {
|
||||
rfbLogPerror("rfbNewUDPConnection: write");
|
||||
}
|
||||
}
|
||||
|
||||
90
libvncserver/rre.c
Executable file → Normal file
90
libvncserver/rre.c
Executable file → Normal file
@@ -29,38 +29,18 @@
|
||||
#include "rfb/rfb.h"
|
||||
|
||||
/*
|
||||
* rreBeforeBuf contains pixel data in the client's format.
|
||||
* rreAfterBuf contains the RRE encoded version. If the RRE encoded version is
|
||||
* larger than the raw data or if it exceeds rreAfterBufSize then
|
||||
* cl->beforeEncBuf contains pixel data in the client's format.
|
||||
* cl->afterEncBuf contains the RRE encoded version. If the RRE encoded version is
|
||||
* larger than the raw data or if it exceeds cl->afterEncBufSize then
|
||||
* raw encoding is used instead.
|
||||
*/
|
||||
|
||||
static int rreBeforeBufSize = 0;
|
||||
static char *rreBeforeBuf = NULL;
|
||||
|
||||
static int rreAfterBufSize = 0;
|
||||
static char *rreAfterBuf = NULL;
|
||||
static int rreAfterBufLen=0;
|
||||
|
||||
static int subrectEncode8(uint8_t *data, int w, int h);
|
||||
static int subrectEncode16(uint16_t *data, int w, int h);
|
||||
static int subrectEncode32(uint32_t *data, int w, int h);
|
||||
static int subrectEncode8(rfbClientPtr cl, uint8_t *data, int w, int h);
|
||||
static int subrectEncode16(rfbClientPtr cl, uint16_t *data, int w, int h);
|
||||
static int subrectEncode32(rfbClientPtr cl, uint32_t *data, int w, int h);
|
||||
static uint32_t getBgColour(char *data, int size, int bpp);
|
||||
|
||||
|
||||
void rfbRRECleanup(rfbScreenInfoPtr screen)
|
||||
{
|
||||
if (rreBeforeBufSize) {
|
||||
free(rreBeforeBuf);
|
||||
rreBeforeBufSize=0;
|
||||
}
|
||||
if (rreAfterBufSize) {
|
||||
free(rreAfterBuf);
|
||||
rreAfterBufSize=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* rfbSendRectEncodingRRE - send a given rectangle using RRE encoding.
|
||||
*/
|
||||
@@ -82,36 +62,36 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
|
||||
int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height
|
||||
* (cl->format.bitsPerPixel / 8));
|
||||
|
||||
if (rreBeforeBufSize < maxRawSize) {
|
||||
rreBeforeBufSize = maxRawSize;
|
||||
if (rreBeforeBuf == NULL)
|
||||
rreBeforeBuf = (char *)malloc(rreBeforeBufSize);
|
||||
if (cl->beforeEncBufSize < maxRawSize) {
|
||||
cl->beforeEncBufSize = maxRawSize;
|
||||
if (cl->beforeEncBuf == NULL)
|
||||
cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
|
||||
else
|
||||
rreBeforeBuf = (char *)realloc(rreBeforeBuf, rreBeforeBufSize);
|
||||
cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
|
||||
}
|
||||
|
||||
if (rreAfterBufSize < maxRawSize) {
|
||||
rreAfterBufSize = maxRawSize;
|
||||
if (rreAfterBuf == NULL)
|
||||
rreAfterBuf = (char *)malloc(rreAfterBufSize);
|
||||
if (cl->afterEncBufSize < maxRawSize) {
|
||||
cl->afterEncBufSize = maxRawSize;
|
||||
if (cl->afterEncBuf == NULL)
|
||||
cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
|
||||
else
|
||||
rreAfterBuf = (char *)realloc(rreAfterBuf, rreAfterBufSize);
|
||||
cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
|
||||
}
|
||||
|
||||
(*cl->translateFn)(cl->translateLookupTable,
|
||||
&(cl->screen->serverFormat),
|
||||
&cl->format, fbptr, rreBeforeBuf,
|
||||
&cl->format, fbptr, cl->beforeEncBuf,
|
||||
cl->scaledScreen->paddedWidthInBytes, w, h);
|
||||
|
||||
switch (cl->format.bitsPerPixel) {
|
||||
case 8:
|
||||
nSubrects = subrectEncode8((uint8_t *)rreBeforeBuf, w, h);
|
||||
nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h);
|
||||
break;
|
||||
case 16:
|
||||
nSubrects = subrectEncode16((uint16_t *)rreBeforeBuf, w, h);
|
||||
nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h);
|
||||
break;
|
||||
case 32:
|
||||
nSubrects = subrectEncode32((uint32_t *)rreBeforeBuf, w, h);
|
||||
nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h);
|
||||
break;
|
||||
default:
|
||||
rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
|
||||
@@ -126,7 +106,7 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
|
||||
}
|
||||
|
||||
rfbStatRecordEncodingSent(cl, rfbEncodingRRE,
|
||||
sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + rreAfterBufLen,
|
||||
sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen,
|
||||
sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8));
|
||||
|
||||
if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
|
||||
@@ -151,15 +131,15 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
|
||||
memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader);
|
||||
cl->ublen += sz_rfbRREHeader;
|
||||
|
||||
for (i = 0; i < rreAfterBufLen;) {
|
||||
for (i = 0; i < cl->afterEncBufLen;) {
|
||||
|
||||
int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
|
||||
|
||||
if (i + bytesToCopy > rreAfterBufLen) {
|
||||
bytesToCopy = rreAfterBufLen - i;
|
||||
if (i + bytesToCopy > cl->afterEncBufLen) {
|
||||
bytesToCopy = cl->afterEncBufLen - i;
|
||||
}
|
||||
|
||||
memcpy(&cl->updateBuf[cl->ublen], &rreAfterBuf[i], bytesToCopy);
|
||||
memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
|
||||
|
||||
cl->ublen += bytesToCopy;
|
||||
i += bytesToCopy;
|
||||
@@ -179,7 +159,7 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
|
||||
* subrectEncode() encodes the given multicoloured rectangle as a background
|
||||
* colour overwritten by single-coloured rectangles. It returns the number
|
||||
* of subrectangles in the encoded buffer, or -1 if subrect encoding won't
|
||||
* fit in the buffer. It puts the encoded rectangles in rreAfterBuf. The
|
||||
* fit in the buffer. It puts the encoded rectangles in cl->afterEncBuf. The
|
||||
* single-colour rectangle partition is not optimal, but does find the biggest
|
||||
* horizontal or vertical rectangle top-left anchored to each consecutive
|
||||
* coordinate position.
|
||||
@@ -190,7 +170,7 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
|
||||
|
||||
#define DEFINE_SUBRECT_ENCODE(bpp) \
|
||||
static int \
|
||||
subrectEncode##bpp(uint##bpp##_t *data, int w, int h) { \
|
||||
subrectEncode##bpp(rfbClientPtr client, uint##bpp##_t *data, int w, int h) { \
|
||||
uint##bpp##_t cl; \
|
||||
rfbRectangle subrect; \
|
||||
int x,y; \
|
||||
@@ -205,9 +185,9 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) { \
|
||||
int newLen; \
|
||||
uint##bpp##_t bg = (uint##bpp##_t)getBgColour((char*)data,w*h,bpp); \
|
||||
\
|
||||
*((uint##bpp##_t*)rreAfterBuf) = bg; \
|
||||
*((uint##bpp##_t*)client->afterEncBuf) = bg; \
|
||||
\
|
||||
rreAfterBufLen = (bpp/8); \
|
||||
client->afterEncBufLen = (bpp/8); \
|
||||
\
|
||||
for (y=0; y<h; y++) { \
|
||||
line = data+(y*w); \
|
||||
@@ -252,15 +232,15 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) { \
|
||||
subrect.w = Swap16IfLE(thew); \
|
||||
subrect.h = Swap16IfLE(theh); \
|
||||
\
|
||||
newLen = rreAfterBufLen + (bpp/8) + sz_rfbRectangle; \
|
||||
if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize)) \
|
||||
newLen = client->afterEncBufLen + (bpp/8) + sz_rfbRectangle; \
|
||||
if ((newLen > (w * h * (bpp/8))) || (newLen > client->afterEncBufSize)) \
|
||||
return -1; \
|
||||
\
|
||||
numsubs += 1; \
|
||||
*((uint##bpp##_t*)(rreAfterBuf + rreAfterBufLen)) = cl; \
|
||||
rreAfterBufLen += (bpp/8); \
|
||||
memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbRectangle); \
|
||||
rreAfterBufLen += sz_rfbRectangle; \
|
||||
*((uint##bpp##_t*)(client->afterEncBuf + client->afterEncBufLen)) = cl; \
|
||||
client->afterEncBufLen += (bpp/8); \
|
||||
memcpy(&client->afterEncBuf[client->afterEncBufLen],&subrect,sz_rfbRectangle); \
|
||||
client->afterEncBufLen += sz_rfbRectangle; \
|
||||
\
|
||||
/* \
|
||||
* Now mark the subrect as done. \
|
||||
|
||||
@@ -54,10 +54,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CORBA
|
||||
#include <vncserverctrl.h>
|
||||
#endif
|
||||
|
||||
#ifdef DEBUGPROTO
|
||||
#undef DEBUGPROTO
|
||||
#define DEBUGPROTO(x) x
|
||||
|
||||
0
libvncserver/selbox.c
Executable file → Normal file
0
libvncserver/selbox.c
Executable file → Normal file
89
libvncserver/sockets.c
Executable file → Normal file
89
libvncserver/sockets.c
Executable file → Normal file
@@ -108,20 +108,17 @@ rfbInitSockets(rfbScreenInfoPtr rfbScreen)
|
||||
{
|
||||
in_addr_t iface = rfbScreen->listenInterface;
|
||||
|
||||
if (rfbScreen->socketState!=RFB_SOCKET_INIT)
|
||||
return;
|
||||
if (rfbScreen->socketState == RFB_SOCKET_READY) {
|
||||
return;
|
||||
}
|
||||
|
||||
rfbScreen->socketState = RFB_SOCKET_READY;
|
||||
|
||||
if (rfbScreen->inetdSock != -1) {
|
||||
const int one = 1;
|
||||
|
||||
#ifndef WIN32
|
||||
if (fcntl(rfbScreen->inetdSock, F_SETFL, O_NONBLOCK) < 0) {
|
||||
rfbLogPerror("fcntl");
|
||||
if(!rfbSetNonBlocking(rfbScreen->inetdSock))
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (setsockopt(rfbScreen->inetdSock, IPPROTO_TCP, TCP_NODELAY,
|
||||
(char *)&one, sizeof(one)) < 0) {
|
||||
@@ -222,8 +219,6 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
|
||||
struct sockaddr_in addr;
|
||||
socklen_t addrlen = sizeof(addr);
|
||||
char buf[6];
|
||||
const int one = 1;
|
||||
int sock;
|
||||
rfbClientIteratorPtr i;
|
||||
rfbClientPtr cl;
|
||||
int result = 0;
|
||||
@@ -336,33 +331,30 @@ rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen)
|
||||
socklen_t addrlen = sizeof(addr);
|
||||
|
||||
if ((sock = accept(rfbScreen->listenSock,
|
||||
(struct sockaddr *)&addr, &addrlen)) < 0) {
|
||||
rfbLogPerror("rfbCheckFds: accept");
|
||||
return FALSE;
|
||||
(struct sockaddr *)&addr, &addrlen)) < 0) {
|
||||
rfbLogPerror("rfbCheckFds: accept");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) {
|
||||
rfbLogPerror("rfbCheckFds: fcntl");
|
||||
closesocket(sock);
|
||||
return FALSE;
|
||||
if(!rfbSetNonBlocking(sock)) {
|
||||
closesocket(sock);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
|
||||
(char *)&one, sizeof(one)) < 0) {
|
||||
rfbLogPerror("rfbCheckFds: setsockopt");
|
||||
closesocket(sock);
|
||||
return FALSE;
|
||||
(char *)&one, sizeof(one)) < 0) {
|
||||
rfbLogPerror("rfbCheckFds: setsockopt");
|
||||
closesocket(sock);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef USE_LIBWRAP
|
||||
if(!hosts_ctl("vnc",STRING_UNKNOWN,inet_ntoa(addr.sin_addr),
|
||||
STRING_UNKNOWN)) {
|
||||
rfbLog("Rejected connection from client %s\n",
|
||||
inet_ntoa(addr.sin_addr));
|
||||
closesocket(sock);
|
||||
return FALSE;
|
||||
STRING_UNKNOWN)) {
|
||||
rfbLog("Rejected connection from client %s\n",
|
||||
inet_ntoa(addr.sin_addr));
|
||||
closesocket(sock);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -432,13 +424,10 @@ rfbConnect(rfbScreenInfoPtr rfbScreen,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) {
|
||||
rfbLogPerror("fcntl failed");
|
||||
closesocket(sock);
|
||||
if(!rfbSetNonBlocking(sock)) {
|
||||
closesocket(sock);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
|
||||
(char *)&one, sizeof(one)) < 0) {
|
||||
@@ -522,7 +511,11 @@ rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout)
|
||||
|
||||
int rfbReadExact(rfbClientPtr cl,char* buf,int len)
|
||||
{
|
||||
return(rfbReadExactTimeout(cl,buf,len,rfbMaxClientWait));
|
||||
/* favor the per-screen value if set */
|
||||
if(cl->screen && cl->screen->maxClientWait)
|
||||
return(rfbReadExactTimeout(cl,buf,len,cl->screen->maxClientWait));
|
||||
else
|
||||
return(rfbReadExactTimeout(cl,buf,len,rfbMaxClientWait));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -541,6 +534,7 @@ rfbWriteExact(rfbClientPtr cl,
|
||||
fd_set fds;
|
||||
struct timeval tv;
|
||||
int totalTimeWaited = 0;
|
||||
const int timeout = (cl->screen && cl->screen->maxClientWait) ? cl->screen->maxClientWait : rfbMaxClientWait;
|
||||
|
||||
#undef DEBUG_WRITE_EXACT
|
||||
#ifdef DEBUG_WRITE_EXACT
|
||||
@@ -576,7 +570,7 @@ rfbWriteExact(rfbClientPtr cl,
|
||||
return n;
|
||||
}
|
||||
|
||||
/* Retry every 5 seconds until we exceed rfbMaxClientWait. We
|
||||
/* Retry every 5 seconds until we exceed timeout. We
|
||||
need to do this because select doesn't necessarily return
|
||||
immediately when the other end has gone away */
|
||||
|
||||
@@ -586,6 +580,9 @@ rfbWriteExact(rfbClientPtr cl,
|
||||
tv.tv_usec = 0;
|
||||
n = select(sock+1, NULL, &fds, NULL /* &fds */, &tv);
|
||||
if (n < 0) {
|
||||
#ifdef WIN32
|
||||
errno=WSAGetLastError();
|
||||
#endif
|
||||
if(errno==EINTR)
|
||||
continue;
|
||||
rfbLogPerror("WriteExact: select");
|
||||
@@ -594,7 +591,7 @@ rfbWriteExact(rfbClientPtr cl,
|
||||
}
|
||||
if (n == 0) {
|
||||
totalTimeWaited += 5000;
|
||||
if (totalTimeWaited >= rfbMaxClientWait) {
|
||||
if (totalTimeWaited >= timeout) {
|
||||
errno = ETIMEDOUT;
|
||||
UNLOCK(cl->outputMutex);
|
||||
return -1;
|
||||
@@ -652,7 +649,7 @@ rfbListenOnTCPPort(int port,
|
||||
closesocket(sock);
|
||||
return -1;
|
||||
}
|
||||
if (listen(sock, 5) < 0) {
|
||||
if (listen(sock, 32) < 0) {
|
||||
closesocket(sock);
|
||||
return -1;
|
||||
}
|
||||
@@ -719,3 +716,23 @@ rfbListenOnUDPPort(int port,
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
||||
/*
|
||||
* rfbSetNonBlocking sets a socket into non-blocking mode.
|
||||
*/
|
||||
rfbBool
|
||||
rfbSetNonBlocking(int sock)
|
||||
{
|
||||
#ifdef WIN32
|
||||
unsigned long block=1;
|
||||
if(ioctlsocket(sock, FIONBIO, &block) == SOCKET_ERROR) {
|
||||
errno=WSAGetLastError();
|
||||
#else
|
||||
int flags = fcntl(sock, F_GETFL);
|
||||
if(flags < 0 || fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0) {
|
||||
#endif
|
||||
rfbLogPerror("Setting socket to non-blocking failed");
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
4
libvncserver/stats.c
Executable file → Normal file
4
libvncserver/stats.c
Executable file → Normal file
@@ -51,10 +51,10 @@ char *messageNameServer2Client(uint32_t type, char *buf, int len) {
|
||||
case rfbBell: snprintf(buf, len, "Bell"); break;
|
||||
case rfbServerCutText: snprintf(buf, len, "ServerCutText"); break;
|
||||
case rfbResizeFrameBuffer: snprintf(buf, len, "ResizeFrameBuffer"); break;
|
||||
case rfbKeyFrameUpdate: snprintf(buf, len, "KeyFrameUpdate"); break;
|
||||
case rfbFileTransfer: snprintf(buf, len, "FileTransfer"); break;
|
||||
case rfbTextChat: snprintf(buf, len, "TextChat"); break;
|
||||
case rfbPalmVNCReSizeFrameBuffer: snprintf(buf, len, "PalmVNCReSize"); break;
|
||||
case rfbXvp: snprintf(buf, len, "XvpServerMessage"); break;
|
||||
default:
|
||||
snprintf(buf, len, "svr2cli-0x%08X", 0xFF);
|
||||
}
|
||||
@@ -76,8 +76,8 @@ char *messageNameClient2Server(uint32_t type, char *buf, int len) {
|
||||
case rfbSetServerInput: snprintf(buf, len, "SetServerInput"); break;
|
||||
case rfbSetSW: snprintf(buf, len, "SetSingleWindow"); break;
|
||||
case rfbTextChat: snprintf(buf, len, "TextChat"); break;
|
||||
case rfbKeyFrameRequest: snprintf(buf, len, "KeyFrameRequest"); break;
|
||||
case rfbPalmVNCSetScaleFactor: snprintf(buf, len, "PalmVNCSetScale"); break;
|
||||
case rfbXvp: snprintf(buf, len, "XvpClientMessage"); break;
|
||||
default:
|
||||
snprintf(buf, len, "cli2svr-0x%08X", type);
|
||||
|
||||
|
||||
0
libvncserver/tableinit24.c
Executable file → Normal file
0
libvncserver/tableinit24.c
Executable file → Normal file
0
libvncserver/tableinitcmtemplate.c
Executable file → Normal file
0
libvncserver/tableinitcmtemplate.c
Executable file → Normal file
0
libvncserver/tableinittctemplate.c
Executable file → Normal file
0
libvncserver/tableinittctemplate.c
Executable file → Normal file
0
libvncserver/tabletrans24template.c
Executable file → Normal file
0
libvncserver/tabletrans24template.c
Executable file → Normal file
0
libvncserver/tabletranstemplate.c
Executable file → Normal file
0
libvncserver/tabletranstemplate.c
Executable file → Normal file
@@ -34,6 +34,9 @@
|
||||
#define NEEDFAR_POINTERS
|
||||
#endif
|
||||
|
||||
#ifdef _RPCNDR_H /* This Windows header typedefs 'boolean', jpeglib has to know */
|
||||
#define HAVE_BOOLEAN
|
||||
#endif
|
||||
#include <jpeglib.h>
|
||||
|
||||
/* Note: The following constant should not be changed. */
|
||||
@@ -47,9 +50,20 @@
|
||||
/* May be set to TRUE with "-lazytight" Xvnc option. */
|
||||
rfbBool rfbTightDisableGradient = FALSE;
|
||||
|
||||
/* This variable is set on every rfbSendRectEncodingTight() call. */
|
||||
static rfbBool usePixelFormat24;
|
||||
/*
|
||||
* There is so much access of the Tight encoding static data buffers
|
||||
* that we resort to using thread local storage instead of having
|
||||
* per-client data.
|
||||
*/
|
||||
#if LIBVNCSERVER_HAVE_LIBPTHREAD && LIBVNCSERVER_HAVE_TLS && !defined(TLS) && defined(__linux__)
|
||||
#define TLS __thread
|
||||
#endif
|
||||
#ifndef TLS
|
||||
#define TLS
|
||||
#endif
|
||||
|
||||
/* This variable is set on every rfbSendRectEncodingTight() call. */
|
||||
static TLS rfbBool usePixelFormat24 = FALSE;
|
||||
|
||||
/* Compression level stuff. The following array contains various
|
||||
encoder parameters for each of 10 compression levels (0..9).
|
||||
@@ -77,8 +91,8 @@ static TIGHT_CONF tightConf[10] = {
|
||||
{ 65536, 2048, 32, 8192, 9, 9, 9, 6, 200, 500, 96, 80, 200, 500 }
|
||||
};
|
||||
|
||||
static int compressLevel;
|
||||
static int qualityLevel;
|
||||
static TLS int compressLevel = 0;
|
||||
static TLS int qualityLevel = 0;
|
||||
|
||||
/* Stuff dealing with palettes. */
|
||||
|
||||
@@ -100,31 +114,33 @@ typedef struct PALETTE_s {
|
||||
} PALETTE;
|
||||
|
||||
/* TODO: move into rfbScreen struct */
|
||||
static int paletteNumColors, paletteMaxColors;
|
||||
static uint32_t monoBackground, monoForeground;
|
||||
static PALETTE palette;
|
||||
static TLS int paletteNumColors = 0;
|
||||
static TLS int paletteMaxColors = 0;
|
||||
static TLS uint32_t monoBackground = 0;
|
||||
static TLS uint32_t monoForeground = 0;
|
||||
static TLS PALETTE palette;
|
||||
|
||||
/* Pointers to dynamically-allocated buffers. */
|
||||
|
||||
static int tightBeforeBufSize = 0;
|
||||
static char *tightBeforeBuf = NULL;
|
||||
static TLS int tightBeforeBufSize = 0;
|
||||
static TLS char *tightBeforeBuf = NULL;
|
||||
|
||||
static int tightAfterBufSize = 0;
|
||||
static char *tightAfterBuf = NULL;
|
||||
static TLS int tightAfterBufSize = 0;
|
||||
static TLS char *tightAfterBuf = NULL;
|
||||
|
||||
static int *prevRowBuf = NULL;
|
||||
static TLS int *prevRowBuf = NULL;
|
||||
|
||||
void rfbTightCleanup(rfbScreenInfoPtr screen)
|
||||
{
|
||||
if(tightBeforeBufSize) {
|
||||
free(tightBeforeBuf);
|
||||
tightBeforeBuf = NULL;
|
||||
tightBeforeBufSize=0;
|
||||
tightBeforeBuf = NULL;
|
||||
}
|
||||
if(tightAfterBufSize) {
|
||||
free(tightAfterBuf);
|
||||
tightAfterBuf = NULL;
|
||||
tightAfterBufSize=0;
|
||||
tightAfterBuf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1629,9 +1645,9 @@ DEFINE_DETECT_FUNCTION(32)
|
||||
* JPEG compression stuff.
|
||||
*/
|
||||
|
||||
static struct jpeg_destination_mgr jpegDstManager;
|
||||
static rfbBool jpegError;
|
||||
static int jpegDstDataLen;
|
||||
static TLS struct jpeg_destination_mgr jpegDstManager;
|
||||
static TLS rfbBool jpegError = FALSE;
|
||||
static TLS int jpegDstDataLen = 0;
|
||||
|
||||
static rfbBool
|
||||
SendJpegRect(rfbClientPtr cl, int x, int y, int w, int h, int quality)
|
||||
|
||||
2
libvncserver/translate.c
Executable file → Normal file
2
libvncserver/translate.c
Executable file → Normal file
@@ -423,6 +423,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
|
||||
}
|
||||
|
||||
if (cl->format.trueColour) {
|
||||
LOCK(cl->updateMutex);
|
||||
(*rfbInitColourMapSingleTableFns
|
||||
[BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable,
|
||||
&cl->screen->serverFormat, &cl->format,&cl->screen->colourMap);
|
||||
@@ -430,6 +431,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
|
||||
sraRgnDestroy(cl->modifiedRegion);
|
||||
cl->modifiedRegion =
|
||||
sraRgnCreateRect(0,0,cl->screen->width,cl->screen->height);
|
||||
UNLOCK(cl->updateMutex);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -11,19 +11,13 @@
|
||||
#include "minilzo.h"
|
||||
|
||||
/*
|
||||
* lzoBeforeBuf contains pixel data in the client's format.
|
||||
* lzoAfterBuf contains the lzo (deflated) encoding version.
|
||||
* cl->beforeEncBuf contains pixel data in the client's format.
|
||||
* cl->afterEncBuf contains the lzo (deflated) encoding version.
|
||||
* If the lzo compressed/encoded version is
|
||||
* larger than the raw data or if it exceeds lzoAfterBufSize then
|
||||
* larger than the raw data or if it exceeds cl->afterEncBufSize then
|
||||
* raw encoding is used instead.
|
||||
*/
|
||||
|
||||
static int lzoBeforeBufSize = 0;
|
||||
static char *lzoBeforeBuf = NULL;
|
||||
|
||||
static int lzoAfterBufSize = 0;
|
||||
static char *lzoAfterBuf = NULL;
|
||||
static int lzoAfterBufLen = 0;
|
||||
|
||||
/*
|
||||
* rfbSendOneRectEncodingZlib - send a given rectangle using one Zlib
|
||||
@@ -32,17 +26,6 @@ static int lzoAfterBufLen = 0;
|
||||
|
||||
#define MAX_WRKMEM ((LZO1X_1_MEM_COMPRESS) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t)
|
||||
|
||||
void rfbUltraCleanup(rfbScreenInfoPtr screen)
|
||||
{
|
||||
if (lzoBeforeBufSize) {
|
||||
free(lzoBeforeBuf);
|
||||
lzoBeforeBufSize=0;
|
||||
}
|
||||
if (lzoAfterBufSize) {
|
||||
free(lzoAfterBuf);
|
||||
lzoAfterBufSize=0;
|
||||
}
|
||||
}
|
||||
|
||||
void rfbFreeUltraData(rfbClientPtr cl) {
|
||||
if (cl->compStreamInitedLZO) {
|
||||
@@ -67,16 +50,16 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
|
||||
+ (x * (cl->scaledScreen->bitsPerPixel / 8)));
|
||||
|
||||
int maxRawSize;
|
||||
int maxCompSize;
|
||||
lzo_uint maxCompSize;
|
||||
|
||||
maxRawSize = (w * h * (cl->format.bitsPerPixel / 8));
|
||||
|
||||
if (lzoBeforeBufSize < maxRawSize) {
|
||||
lzoBeforeBufSize = maxRawSize;
|
||||
if (lzoBeforeBuf == NULL)
|
||||
lzoBeforeBuf = (char *)malloc(lzoBeforeBufSize);
|
||||
if (cl->beforeEncBufSize < maxRawSize) {
|
||||
cl->beforeEncBufSize = maxRawSize;
|
||||
if (cl->beforeEncBuf == NULL)
|
||||
cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
|
||||
else
|
||||
lzoBeforeBuf = (char *)realloc(lzoBeforeBuf, lzoBeforeBufSize);
|
||||
cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -85,19 +68,19 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
|
||||
*/
|
||||
maxCompSize = (maxRawSize + maxRawSize / 16 + 64 + 3);
|
||||
|
||||
if (lzoAfterBufSize < maxCompSize) {
|
||||
lzoAfterBufSize = maxCompSize;
|
||||
if (lzoAfterBuf == NULL)
|
||||
lzoAfterBuf = (char *)malloc(lzoAfterBufSize);
|
||||
if (cl->afterEncBufSize < (int)maxCompSize) {
|
||||
cl->afterEncBufSize = maxCompSize;
|
||||
if (cl->afterEncBuf == NULL)
|
||||
cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
|
||||
else
|
||||
lzoAfterBuf = (char *)realloc(lzoAfterBuf, lzoAfterBufSize);
|
||||
cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert pixel data to client format.
|
||||
*/
|
||||
(*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,
|
||||
&cl->format, fbptr, lzoBeforeBuf,
|
||||
&cl->format, fbptr, cl->beforeEncBuf,
|
||||
cl->scaledScreen->paddedWidthInBytes, w, h);
|
||||
|
||||
if ( cl->compStreamInitedLZO == FALSE ) {
|
||||
@@ -109,11 +92,11 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
|
||||
}
|
||||
|
||||
/* Perform the compression here. */
|
||||
deflateResult = lzo1x_1_compress((unsigned char *)lzoBeforeBuf, (lzo_uint)(w * h * (cl->format.bitsPerPixel / 8)), (unsigned char *)lzoAfterBuf, (lzo_uint *)&maxCompSize, cl->lzoWrkMem);
|
||||
deflateResult = lzo1x_1_compress((unsigned char *)cl->beforeEncBuf, (lzo_uint)(w * h * (cl->format.bitsPerPixel / 8)), (unsigned char *)cl->afterEncBuf, &maxCompSize, cl->lzoWrkMem);
|
||||
/* maxCompSize now contains the compressed size */
|
||||
|
||||
/* Find the total size of the resulting compressed data. */
|
||||
lzoAfterBufLen = maxCompSize;
|
||||
cl->afterEncBufLen = maxCompSize;
|
||||
|
||||
if ( deflateResult != LZO_E_OK ) {
|
||||
rfbErr("lzo deflation error: %d\n", deflateResult);
|
||||
@@ -121,7 +104,7 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
|
||||
}
|
||||
|
||||
/* Update statics */
|
||||
rfbStatRecordEncodingSent(cl, rfbEncodingUltra, sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader + lzoAfterBufLen, maxRawSize);
|
||||
rfbStatRecordEncodingSent(cl, rfbEncodingUltra, sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader + cl->afterEncBufLen, maxRawSize);
|
||||
|
||||
if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader
|
||||
> UPDATE_BUF_SIZE)
|
||||
@@ -140,21 +123,21 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
|
||||
sz_rfbFramebufferUpdateRectHeader);
|
||||
cl->ublen += sz_rfbFramebufferUpdateRectHeader;
|
||||
|
||||
hdr.nBytes = Swap32IfLE(lzoAfterBufLen);
|
||||
hdr.nBytes = Swap32IfLE(cl->afterEncBufLen);
|
||||
|
||||
memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbZlibHeader);
|
||||
cl->ublen += sz_rfbZlibHeader;
|
||||
|
||||
/* We might want to try sending the data directly... */
|
||||
for (i = 0; i < lzoAfterBufLen;) {
|
||||
for (i = 0; i < cl->afterEncBufLen;) {
|
||||
|
||||
int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
|
||||
|
||||
if (i + bytesToCopy > lzoAfterBufLen) {
|
||||
bytesToCopy = lzoAfterBufLen - i;
|
||||
if (i + bytesToCopy > cl->afterEncBufLen) {
|
||||
bytesToCopy = cl->afterEncBufLen - i;
|
||||
}
|
||||
|
||||
memcpy(&cl->updateBuf[cl->ublen], &lzoAfterBuf[i], bytesToCopy);
|
||||
memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
|
||||
|
||||
cl->ublen += bytesToCopy;
|
||||
i += bytesToCopy;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user