Compare commits
250 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9801f0e7c1 | ||
|
|
344c10643f | ||
|
|
b02a0ce845 | ||
|
|
ac1305aee8 | ||
|
|
5ea5cc92af | ||
|
|
8c960301d4 | ||
|
|
8d97f0fa97 | ||
|
|
6fa080af19 | ||
|
|
ff86e80b6c | ||
|
|
e8584a39f1 | ||
|
|
7eb5aea35a | ||
|
|
ac35d646f9 | ||
|
|
f43432f309 | ||
|
|
7a43a5813a | ||
|
|
6ef5d8e1a8 | ||
|
|
c9091ee2bb | ||
|
|
c52b0f31b5 | ||
|
|
346456e683 | ||
|
|
48d986b0fe | ||
|
|
f500e055f1 | ||
|
|
e8fd5fe0c7 | ||
|
|
35b6b28c0a | ||
|
|
0389c8262e | ||
|
|
689df377e1 | ||
|
|
efdb74b025 | ||
|
|
4e47380ef5 | ||
|
|
db400bb3d0 | ||
|
|
e82c2ac46a | ||
|
|
009e6457a0 | ||
|
|
3b8c774b86 | ||
|
|
1bca95204b | ||
|
|
1f89d959e4 | ||
|
|
8fc303b572 | ||
|
|
f5f6b5eb15 | ||
|
|
6c81fc7fdf | ||
|
|
d885b64b2a | ||
|
|
037d1f6e3a | ||
|
|
343fc2638c | ||
|
|
00e32bca00 | ||
|
|
efcc0ed62c | ||
|
|
dbaa5dcdff | ||
|
|
fa0417140c | ||
|
|
0b04afe5c1 | ||
|
|
9b8eca676e | ||
|
|
8dfed7d523 | ||
|
|
e19ec55f31 | ||
|
|
c708cfbc16 | ||
|
|
70c18c5c2f | ||
|
|
327070588c | ||
|
|
90e352fb8f | ||
|
|
d61a7dbdbd | ||
|
|
3c60d88afb | ||
|
|
9c397fd8bb | ||
|
|
176cd16c3e | ||
|
|
238e12a35a | ||
|
|
cfb358a62f | ||
|
|
8d0debac72 | ||
|
|
31949c6bee | ||
|
|
28bf97c57f | ||
|
|
fcbfa9613e | ||
|
|
f3665ae765 | ||
|
|
8167b932f2 | ||
|
|
571a612efc | ||
|
|
604469ad27 | ||
|
|
c6d7427b5c | ||
|
|
a7a28dad55 | ||
|
|
3918e4304a | ||
|
|
b90e9eaf98 | ||
|
|
b663ca9294 | ||
|
|
b1101ff3cb | ||
|
|
4933c61d2a | ||
|
|
5f91e53004 | ||
|
|
e99a257a41 | ||
|
|
383e6cef4c | ||
|
|
03b494aa1a | ||
|
|
04e5768db5 | ||
|
|
173a43f3d2 | ||
|
|
366c99e7ec | ||
|
|
c540fa79a7 | ||
|
|
42d395da7d | ||
|
|
44a3596ade | ||
|
|
a7517c6444 | ||
|
|
be2e9e1671 | ||
|
|
9879f90714 | ||
|
|
199514dcb0 | ||
|
|
b874281010 | ||
|
|
7216c5e59c | ||
|
|
e3a3993b96 | ||
|
|
de016de12d | ||
|
|
55a40ee55a | ||
|
|
5ff4f3d0f9 | ||
|
|
b84107555e | ||
|
|
dc2c6f0db7 | ||
|
|
c7fda197fd | ||
|
|
9e372bc6b5 | ||
|
|
b3be22f5aa | ||
|
|
e76e391c4f | ||
|
|
1eb1b7a053 | ||
|
|
32769b41e5 | ||
|
|
d551495469 | ||
|
|
0e39f8c09e | ||
|
|
9befaf6f6a | ||
|
|
e5326e218f | ||
|
|
fe5e724bd1 | ||
|
|
74fe120ea8 | ||
|
|
80d794873c | ||
|
|
bef509ac05 | ||
|
|
b17a0b5815 | ||
|
|
2709312471 | ||
|
|
a6f727d990 | ||
|
|
d641dc702b | ||
|
|
ad824b9b80 | ||
|
|
35d083a674 | ||
|
|
d571aaf062 | ||
|
|
af216dabe1 | ||
|
|
ce4d5c60ee | ||
|
|
5a04b9ef09 | ||
|
|
073257304d | ||
|
|
01eab2a02f | ||
|
|
b77d07c08d | ||
|
|
0fb20dfff0 | ||
|
|
a9ff5ffc8b | ||
|
|
d30bdd7404 | ||
|
|
9cafe806a4 | ||
|
|
6fdad54a7a | ||
|
|
0432b60d4f | ||
|
|
9beb3ac122 | ||
|
|
aad4a17674 | ||
|
|
78fd984dd8 | ||
|
|
77dfcd28d8 | ||
|
|
9ba02362f7 | ||
|
|
376357337c | ||
|
|
a5be8fc33b | ||
|
|
2cbb930877 | ||
|
|
7e41e3c244 | ||
|
|
c021cd6d42 | ||
|
|
d2f1a0e3f8 | ||
|
|
2e13247d25 | ||
|
|
21d8285fb9 | ||
|
|
924a4af066 | ||
|
|
ad0d5f8a9f | ||
|
|
6061ed71fd | ||
|
|
24edd4302d | ||
|
|
d54df82b05 | ||
|
|
d045784353 | ||
|
|
279324047a | ||
|
|
f2fed6edcf | ||
|
|
cd6d5722ef | ||
|
|
b790fb3b93 | ||
|
|
394ca0ed8c | ||
|
|
9dd7c3ba49 | ||
|
|
0acc8b0a6b | ||
|
|
bf3dfe5887 | ||
|
|
51b7cc67ed | ||
|
|
47cc317131 | ||
|
|
f7b1527fb8 | ||
|
|
54f664ea8f | ||
|
|
ba0437cbea | ||
|
|
6c728b9633 | ||
|
|
7c6186ed2f | ||
|
|
3ff2c20690 | ||
|
|
043d610833 | ||
|
|
f7d1f89ea9 | ||
|
|
45cf2161b5 | ||
|
|
5571224cca | ||
|
|
882bb7dc0b | ||
|
|
379acfaec3 | ||
|
|
ddc5ef5d1d | ||
|
|
fdd4ea25f8 | ||
|
|
0e8fbe34ab | ||
|
|
d11198cbd4 | ||
|
|
4e3efb7760 | ||
|
|
0ca62a4705 | ||
|
|
ed7d58d8dc | ||
|
|
1b1a07fdc4 | ||
|
|
84160b9b6e | ||
|
|
a4b7c1d852 | ||
|
|
033e5453f2 | ||
|
|
956a22ae9c | ||
|
|
e55a29888e | ||
|
|
1404f0bf3c | ||
|
|
2f1c8fa8bd | ||
|
|
1e5cc5662f | ||
|
|
a9988c4a61 | ||
|
|
a1a2c1bb38 | ||
|
|
9a8d94d26b | ||
|
|
0ec1666748 | ||
|
|
616f5e2776 | ||
|
|
09c31cd387 | ||
|
|
345afdd423 | ||
|
|
3dddc13164 | ||
|
|
2f10504666 | ||
|
|
467d74df80 | ||
|
|
91513e82f5 | ||
|
|
3088d3f418 | ||
|
|
040f4de26a | ||
|
|
495e6e4df3 | ||
|
|
5d317a1a5e | ||
|
|
8373bed91d | ||
|
|
36967e26ae | ||
|
|
1499de61e8 | ||
|
|
f97cf472bf | ||
|
|
b0da7c0ce0 | ||
|
|
fed4fc82fa | ||
|
|
4cd8a24c14 | ||
|
|
c5a3a89721 | ||
|
|
a09868a7be | ||
|
|
f49be4ebf5 | ||
|
|
ac0a5e8240 | ||
|
|
4590552394 | ||
|
|
237de1114d | ||
|
|
64adae5bee | ||
|
|
7d9645c389 | ||
|
|
77dc9c5560 | ||
|
|
ed0efd6c64 | ||
|
|
949e814f55 | ||
|
|
f36b9aca9b | ||
|
|
fc4be7c478 | ||
|
|
a514fc0a63 | ||
|
|
6fd05b3a2a | ||
|
|
47c089f937 | ||
|
|
803f4b8c4d | ||
|
|
d825ad5c12 | ||
|
|
a7a7633438 | ||
|
|
0bc68de645 | ||
|
|
67cac2140a | ||
|
|
cb1280f2b7 | ||
|
|
379d4d2fc0 | ||
|
|
e21768e2f6 | ||
|
|
13b9f36d33 | ||
|
|
f048313d43 | ||
|
|
94d6110dcd | ||
|
|
358cc5ee54 | ||
|
|
cecfaa69b6 | ||
|
|
171ffcfc95 | ||
|
|
5cc6c452e8 | ||
|
|
fa6995f39f | ||
|
|
8d98087e83 | ||
|
|
001fac3e87 | ||
|
|
c1575a5074 | ||
|
|
dbaed9a9e3 | ||
|
|
f26a93f5a4 | ||
|
|
ea7be8ba0a | ||
|
|
48226e5c79 | ||
|
|
67684a17e9 | ||
|
|
3a85d368dd | ||
|
|
2fd67a450a | ||
|
|
c0612ab2e9 | ||
|
|
180b464a6d | ||
|
|
2cc331b03f |
162
CMakeLists.txt
@@ -1,45 +1,131 @@
|
||||
check_symbol_exists(getifaddrs "sys/socket.h;netdb.h;ifaddrs.h" HAVE_GETIFADDRS)
|
||||
project(krfb)
|
||||
|
||||
if(NOT INSIDE_KDENETWORK)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake/modules ${CMAKE_MODULE_PATH})
|
||||
find_package(KDE4 REQUIRED)
|
||||
|
||||
include(KDE4Defaults)
|
||||
include(MacroLibrary)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
find_package(LibVNCServer)
|
||||
macro_optional_find_package(LibVNCServer)
|
||||
|
||||
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE_PLATFORM_DEFINITIONS})
|
||||
|
||||
add_definitions(${QT_DEFINITIONS} ${QT_DBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
|
||||
endif(NOT INSIDE_KDENETWORK)
|
||||
|
||||
check_symbol_exists(rfbInitServer "rfb/rfb.h" HAVE_LIBVNCSERVER)
|
||||
macro_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE)
|
||||
macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-krfb.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-krfb.h )
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}) # for config-krfb.h
|
||||
|
||||
set(vncserver_SRCS
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/main.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/rfbserver.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/sraRegion.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/auth.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/sockets.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/stats.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/corre.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/hextile.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/rre.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/translate.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/cutpaste.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/zlib.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/tight.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/httpd.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/cursor.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/font.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/draw.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/selbox.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/d3des.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/vncauth.c
|
||||
${CMAKE_SOURCE_DIR}/krfb/libvncserver/cargs.c)
|
||||
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.")
|
||||
endif(NOT X11_XTest_FOUND)
|
||||
endif(Q_WS_X11)
|
||||
|
||||
set(srvloc_SRCS
|
||||
${CMAKE_SOURCE_DIR}/krfb/srvloc/kinetinterface.cpp
|
||||
${CMAKE_SOURCE_DIR}/krfb/srvloc/uuid.cpp
|
||||
${CMAKE_SOURCE_DIR}/krfb/srvloc/getifaddrs.cpp
|
||||
${CMAKE_SOURCE_DIR}/krfb/srvloc/kserviceregistry.cpp
|
||||
${CMAKE_SOURCE_DIR}/krfb/srvloc/kinetinterfacewatcher.cpp)
|
||||
#add_subdirectory(kinetd)
|
||||
#add_subdirectory(kcm_krfb)
|
||||
if (HAVE_LIBVNCSERVER)
|
||||
|
||||
set(krfbconfig_SRCS
|
||||
${CMAKE_SOURCE_DIR}/krfb/krfb/configuration.cc
|
||||
${CMAKE_SOURCE_DIR}/krfb/krfb/invitedialog.cc
|
||||
${CMAKE_SOURCE_DIR}/krfb/krfb/invitation.cc
|
||||
${CMAKE_SOURCE_DIR}/krfb/krfb/personalinvitedialog.cc)
|
||||
#####################################
|
||||
# First target: libkrfb - a library
|
||||
# for linking plugins against.
|
||||
|
||||
set (krfbprivate_SRCS
|
||||
framebuffer.cpp
|
||||
framebufferplugin.cpp
|
||||
)
|
||||
|
||||
# add_subdirectory(kinetd)
|
||||
add_subdirectory(kcm_krfb)
|
||||
add_subdirectory(krfb)
|
||||
add_subdirectory(krfb_httpd)
|
||||
kde4_add_library (krfbprivate
|
||||
SHARED
|
||||
${krfbprivate_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries (krfbprivate
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${X11_X11_LIB}
|
||||
${LIBVNCSERVER_LIBRARIES}
|
||||
)
|
||||
|
||||
set_target_properties (krfbprivate PROPERTIES
|
||||
VERSION ${GENERIC_LIB_VERSION}
|
||||
SOVERSION ${GENERIC_LIB_VERSION}
|
||||
)
|
||||
|
||||
install (TARGETS krfbprivate
|
||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
install (FILES
|
||||
krfb-framebuffer.desktop
|
||||
DESTINATION ${SERVICETYPES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
#####################################
|
||||
# Build the plugins
|
||||
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_subdirectory (framebuffers)
|
||||
|
||||
#####################################
|
||||
# Second target: krfb - the app
|
||||
# itself.
|
||||
|
||||
set(krfb_SRCS
|
||||
main.cpp
|
||||
trayicon.cpp
|
||||
krfbserver.cpp
|
||||
manageinvitationsdialog.cpp
|
||||
invitationmanager.cpp
|
||||
invitedialog.cpp
|
||||
invitation.cpp
|
||||
connectiondialog.cpp
|
||||
personalinvitedialog.cpp
|
||||
connectioncontroller.cpp
|
||||
events.cpp
|
||||
framebuffermanager.cpp
|
||||
)
|
||||
|
||||
kde4_add_kcfg_files(krfb_SRCS krfbconfig.kcfgc)
|
||||
|
||||
kde4_add_ui_files(krfb_SRCS connectionwidget.ui
|
||||
manageinvitations.ui
|
||||
personalinvitewidget.ui
|
||||
invitewidget.ui
|
||||
configtcp.ui
|
||||
configsecurity.ui
|
||||
)
|
||||
|
||||
kde4_add_executable(krfb ${krfb_SRCS})
|
||||
|
||||
target_link_libraries(krfb
|
||||
krfbprivate
|
||||
${JPEG_LIBRARIES}
|
||||
${LIBVNCSERVER_LIBRARIES}
|
||||
${X11_Xext_LIB}
|
||||
${X11_X11_LIB}
|
||||
${X11_Xdamage_LIB}
|
||||
${QT_QTNETWORK_LIBRARY}
|
||||
${KDE4_KDNSSD_LIBS}
|
||||
${KDE4_KDEUI_LIBS}
|
||||
)
|
||||
|
||||
if(X11_XTest_FOUND)
|
||||
target_link_libraries(krfb ${X11_XTest_LIB})
|
||||
endif(X11_XTest_FOUND)
|
||||
|
||||
install(TARGETS krfb ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(FILES krfb.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
|
||||
install(FILES krfb.notifyrc DESTINATION ${DATA_INSTALL_DIR}/krfb)
|
||||
|
||||
endif (HAVE_LIBVNCSERVER)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
DCOP Interfaces:
|
||||
|
||||
// Exits the application, disconnects clients
|
||||
void exit()
|
||||
// Set the desktop to be controlable from remote clients
|
||||
void setAllowDesktopControl(bool)
|
||||
|
||||
|
||||
|
||||
5
Mainpage.dox
Normal file
@@ -0,0 +1,5 @@
|
||||
/** @mainpage Krfb API Reference
|
||||
*
|
||||
* Krfb provides a VNC-compatible server to share KDE desktops.
|
||||
*
|
||||
*/
|
||||
2
Messages.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#! /bin/sh
|
||||
$XGETTEXT *.cpp -o $podir/krfb.pot
|
||||
@@ -3,3 +3,9 @@
|
||||
|
||||
/* Define if SLP is available */
|
||||
#cmakedefine HAVE_SLP 1
|
||||
|
||||
/* Define if XDamage is available */
|
||||
#cmakedefine HAVE_XDAMAGE 1
|
||||
|
||||
/* Define if XShm is available */
|
||||
#cmakedefine HAVE_XSHM 1
|
||||
|
||||
140
configsecurity.ui
Normal file
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Security</class>
|
||||
<widget class="QWidget" name="Security">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>507</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_allowUninvitedConnections">
|
||||
<property name="text">
|
||||
<string>Allow uninvited connections</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_allowDesktopControl">
|
||||
<property name="text">
|
||||
<string>Allow remote connections to control your desktop</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_askOnConnect">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ask before accepting connections</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</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">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</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_askOnConnect</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>22</x>
|
||||
<y>24</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>29</x>
|
||||
<y>80</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<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>
|
||||
</ui>
|
||||
94
configtcp.ui
Normal file
@@ -0,0 +1,94 @@
|
||||
<ui version="4.0" >
|
||||
<class>TCP</class>
|
||||
<widget class="QWidget" name="TCP" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>169</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_publishService" >
|
||||
<property name="text" >
|
||||
<string>Announce the service on the local network</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="kcfg_useDefaultPort" >
|
||||
<property name="text" >
|
||||
<string>Use default port</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string>Listening port:</string>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>kcfg_port</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="kcfg_port" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximum" >
|
||||
<number>65535</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>kcfg_useDefaultPort</tabstop>
|
||||
<tabstop>kcfg_port</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>kcfg_useDefaultPort</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>kcfg_port</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>120</x>
|
||||
<y>53</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>277</x>
|
||||
<y>122</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
253
connectioncontroller.cpp
Normal file
@@ -0,0 +1,253 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
(C) 2001-2003 by Tim Jansen <tim@tjansen.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
#include "connectioncontroller.h"
|
||||
#include "connectioncontroller.moc"
|
||||
|
||||
#include <QX11Info>
|
||||
#include <QHostInfo>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QTcpSocket>
|
||||
#include <QTimer>
|
||||
|
||||
#include <KConfig>
|
||||
#include <KGlobal>
|
||||
#include <KUser>
|
||||
#include <KNotification>
|
||||
#include <KLocale>
|
||||
#include <KDebug>
|
||||
|
||||
|
||||
#include "invitationmanager.h"
|
||||
#include "connectiondialog.h"
|
||||
#include "events.h"
|
||||
#include "krfbserver.h"
|
||||
|
||||
#include "krfbconfig.h"
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
|
||||
static QString peerAddress(int sock) {
|
||||
|
||||
const int ADDR_SIZE = 50;
|
||||
struct sockaddr sa;
|
||||
socklen_t salen = sizeof(struct sockaddr);
|
||||
if (getpeername(sock, &sa, &salen) == 0) {
|
||||
if (sa.sa_family == AF_INET) {
|
||||
struct sockaddr_in *si = (struct sockaddr_in *)&sa;
|
||||
return QString(inet_ntoa(si->sin_addr));
|
||||
}
|
||||
if (sa.sa_family == AF_INET6) {
|
||||
char inetbuf[ADDR_SIZE];
|
||||
inet_ntop(sa.sa_family, &sa, inetbuf, ADDR_SIZE);
|
||||
return QString(inetbuf);
|
||||
}
|
||||
return QString("not a network address");
|
||||
}
|
||||
return QString("unable to determine...");
|
||||
}
|
||||
|
||||
static void clientGoneHook(rfbClientPtr cl)
|
||||
{
|
||||
ConnectionController *cc = static_cast<ConnectionController *>(cl->clientData);
|
||||
cc->handleClientGone();
|
||||
}
|
||||
|
||||
|
||||
static bool checkPassword(const QString &p, unsigned char *ochallenge, const char *response, int len)
|
||||
{
|
||||
|
||||
if ((len == 0) && (p.length() == 0)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char passwd[MAXPWLEN];
|
||||
unsigned char challenge[CHALLENGESIZE];
|
||||
|
||||
memcpy(challenge, ochallenge, CHALLENGESIZE);
|
||||
bzero(passwd, MAXPWLEN);
|
||||
if (!p.isNull()) {
|
||||
strncpy(passwd, p.toLatin1(),
|
||||
(MAXPWLEN <= p.length()) ? MAXPWLEN : p.length());
|
||||
}
|
||||
|
||||
rfbEncryptBytes(challenge, passwd);
|
||||
return memcmp(challenge, response, len) == 0;
|
||||
}
|
||||
|
||||
|
||||
ConnectionController::ConnectionController(struct _rfbClientRec *_cl, KrfbServer * parent)
|
||||
: QObject(parent), cl(_cl)
|
||||
{
|
||||
cl->clientData = (void*)this;
|
||||
}
|
||||
|
||||
ConnectionController::~ConnectionController()
|
||||
{
|
||||
}
|
||||
|
||||
enum rfbNewClientAction ConnectionController::handleNewClient()
|
||||
{
|
||||
kDebug();
|
||||
|
||||
bool askOnConnect = KrfbConfig::askOnConnect();
|
||||
bool allowUninvited = KrfbConfig::allowUninvitedConnections();
|
||||
|
||||
remoteIp = peerAddress(cl->sock);
|
||||
|
||||
if (!allowUninvited && InvitationManager::self()->activeInvitations() == 0) {
|
||||
KNotification::event("UnexpectedConnection",
|
||||
i18n("Refused uninvited connection attempt from %1",
|
||||
remoteIp));
|
||||
return RFB_CLIENT_REFUSE;
|
||||
}
|
||||
|
||||
// In the remaining cases, the connection will be at least partially established, so we need
|
||||
// the clientGoneHook to be called when the connection ends.
|
||||
cl->clientGoneHook = clientGoneHook;
|
||||
|
||||
if (!askOnConnect) {
|
||||
KNotification::event("NewConnectionAutoAccepted",
|
||||
i18n("Accepted uninvited connection from %1",
|
||||
remoteIp));
|
||||
|
||||
emit sessionEstablished(remoteIp);
|
||||
return RFB_CLIENT_ACCEPT;
|
||||
}
|
||||
|
||||
KNotification::event("NewConnectionOnHold",
|
||||
i18n("Received connection from %1, on hold (waiting for confirmation)",
|
||||
remoteIp));
|
||||
|
||||
ConnectionDialog *dialog = new ConnectionDialog(0);
|
||||
dialog->setRemoteHost(remoteIp);
|
||||
dialog->setAllowRemoteControl(KrfbConfig::allowDesktopControl());
|
||||
|
||||
connect(dialog, SIGNAL(okClicked()), SLOT(dialogAccepted()));
|
||||
connect(dialog, SIGNAL(cancelClicked()), SLOT(dialogRejected()));
|
||||
|
||||
dialog->show();
|
||||
|
||||
return RFB_CLIENT_ON_HOLD;
|
||||
}
|
||||
|
||||
bool ConnectionController::handleCheckPassword(rfbClientPtr cl, const char *response, int len)
|
||||
{
|
||||
bool allowUninvited = KrfbConfig::allowUninvitedConnections();
|
||||
QString password = KrfbConfig::uninvitedConnectionPassword();
|
||||
|
||||
bool authd = false;
|
||||
kDebug() << "about to start autentication";
|
||||
|
||||
if (allowUninvited) {
|
||||
authd = checkPassword(password, cl->authChallenge, response, len);
|
||||
}
|
||||
|
||||
if (!authd) {
|
||||
QList<Invitation> invlist = InvitationManager::self()->invitations();
|
||||
|
||||
foreach(const Invitation &it, invlist) {
|
||||
kDebug() << "checking password";
|
||||
if (checkPassword(it.password(), cl->authChallenge, response, len) && 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",
|
||||
remoteIp));
|
||||
} else {
|
||||
KNotification::event("InvalidPassword",
|
||||
i18n("Failed login attempt from %1: wrong password",
|
||||
remoteIp));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ConnectionController::handleKeyEvent(bool down, rfbKeySym keySym)
|
||||
{
|
||||
if (controlEnabled) {
|
||||
KeyboardEvent ev(down, keySym);
|
||||
ev.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionController::handlePointerEvent(int bm, int x, int y)
|
||||
{
|
||||
if (controlEnabled) {
|
||||
PointerEvent ev(bm, x, y);
|
||||
ev.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionController::handleClientGone()
|
||||
{
|
||||
emit clientDisconnected(this);
|
||||
kDebug() << "client gone";
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void ConnectionController::clipboardToServer(const QString &s)
|
||||
{
|
||||
ClipboardEvent ev(this, s);
|
||||
ev.exec();
|
||||
}
|
||||
|
||||
void ConnectionController::dialogAccepted()
|
||||
{
|
||||
ConnectionDialog *dialog = qobject_cast<ConnectionDialog*>(sender());
|
||||
|
||||
if (!dialog) {
|
||||
kWarning() << "Wrong type of sender.";
|
||||
return;
|
||||
}
|
||||
// rfbStartOnHoldClient(cl);
|
||||
cl->onHold = false;
|
||||
setControlEnabled(dialog->cbAllowRemoteControl->isChecked());
|
||||
setControlCanBeEnabled(dialog->cbAllowRemoteControl->isChecked());
|
||||
emit sessionEstablished(remoteIp);
|
||||
}
|
||||
|
||||
void ConnectionController::dialogRejected()
|
||||
{
|
||||
kDebug() << "refused connection";
|
||||
rfbRefuseOnHoldClient(cl);
|
||||
}
|
||||
|
||||
void ConnectionController::setControlEnabled(bool enable)
|
||||
{
|
||||
controlEnabled = enable;
|
||||
}
|
||||
|
||||
void ConnectionController::setControlCanBeEnabled(bool canBeEnabled)
|
||||
{
|
||||
m_controlCanBeEnabled = canBeEnabled;
|
||||
}
|
||||
|
||||
bool ConnectionController::controlCanBeEnabled() const
|
||||
{
|
||||
return m_controlCanBeEnabled;
|
||||
}
|
||||
|
||||
|
||||
68
connectioncontroller.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* 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 CONNECTIONCONTROLLER_H
|
||||
#define CONNECTIONCONTROLLER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <rfb/rfb.h>
|
||||
|
||||
class KrfbServer;
|
||||
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class ConnectionController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConnectionController(struct _rfbClientRec *_cl, KrfbServer *parent);
|
||||
|
||||
~ConnectionController();
|
||||
|
||||
bool handleCheckPassword(rfbClientPtr cl, const char *response, int len);
|
||||
void handleNegotiationFinished(struct _rfbClientRec *cl);
|
||||
|
||||
void handleKeyEvent(bool down , rfbKeySym keySym );
|
||||
void handlePointerEvent( int bm, int x, int y);
|
||||
void handleClientGone();
|
||||
void clipboardToServer(const QString &);
|
||||
|
||||
enum rfbNewClientAction handleNewClient();
|
||||
|
||||
void setControlEnabled(bool enable);
|
||||
|
||||
void setControlCanBeEnabled(bool canBeEnabled);
|
||||
bool controlCanBeEnabled() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void sessionEstablished(QString);
|
||||
void notification(QString, QString);
|
||||
void clientDisconnected(ConnectionController *);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void dialogAccepted();
|
||||
void dialogRejected();
|
||||
|
||||
private:
|
||||
QString remoteIp;
|
||||
struct _rfbClientRec *cl;
|
||||
bool controlEnabled;
|
||||
bool m_controlCanBeEnabled;
|
||||
/*
|
||||
int fd;
|
||||
KrfbServer *server;
|
||||
rfbScreenInfoPtr screen;
|
||||
rfbClientPtr client;
|
||||
QTcpSocket *tcpConn;
|
||||
*/
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,13 +18,12 @@
|
||||
*/
|
||||
|
||||
#include "connectiondialog.h"
|
||||
#include "connectionwidget.h"
|
||||
|
||||
#include <qcheckbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
#include <KIconLoader>
|
||||
#include <KLocale>
|
||||
#include <KStandardGuiItem>
|
||||
|
||||
ConnectionDialog::ConnectionDialog( QWidget *parent )
|
||||
@@ -35,9 +34,12 @@ ConnectionDialog::ConnectionDialog( QWidget *parent )
|
||||
setDefaultButton(Cancel);
|
||||
setModal(true);
|
||||
|
||||
m_connectWidget = new ConnectionWidget( this, "ConnectWidget" );
|
||||
m_connectWidget->pixmapLabel->setPixmap(
|
||||
UserIcon( "connection-side-image.png" ) );
|
||||
setMinimumSize(500, 200);
|
||||
|
||||
m_connectWidget = new QWidget( this );
|
||||
setupUi(m_connectWidget);
|
||||
|
||||
pixmapLabel->setPixmap(KIcon("krfb").pixmap(128));
|
||||
|
||||
KGuiItem accept = KStandardGuiItem::ok();
|
||||
accept.setText( i18n( "Accept Connection" ) );
|
||||
@@ -52,17 +54,18 @@ ConnectionDialog::ConnectionDialog( QWidget *parent )
|
||||
|
||||
void ConnectionDialog::setRemoteHost( const QString &host )
|
||||
{
|
||||
m_connectWidget->remoteHost->setText( host );
|
||||
remoteHost->setText( host );
|
||||
}
|
||||
|
||||
void ConnectionDialog::setAllowRemoteControl( bool b )
|
||||
{
|
||||
m_connectWidget->cbAllowRemoteControl->setChecked( b );
|
||||
cbAllowRemoteControl->setChecked( b );
|
||||
cbAllowRemoteControl->setVisible(b);
|
||||
}
|
||||
|
||||
bool ConnectionDialog::allowRemoteControl()
|
||||
{
|
||||
return m_connectWidget->cbAllowRemoteControl->isChecked();
|
||||
return cbAllowRemoteControl->isChecked();
|
||||
}
|
||||
|
||||
#include "connectiondialog.moc"
|
||||
@@ -21,10 +21,11 @@
|
||||
#define CONNECTIONDIALOG_H
|
||||
|
||||
#include <KDialog>
|
||||
#include "ui_connectionwidget.h"
|
||||
|
||||
class ConnectionWidget;
|
||||
class QWidget;
|
||||
|
||||
class ConnectionDialog : public KDialog
|
||||
class ConnectionDialog : public KDialog, public Ui::ConnectionWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -37,7 +38,7 @@ class ConnectionDialog : public KDialog
|
||||
bool allowRemoteControl();
|
||||
|
||||
protected:
|
||||
ConnectionWidget *m_connectWidget;
|
||||
QWidget *m_connectWidget;
|
||||
};
|
||||
|
||||
#endif // CONNECTIONDIALOG_H
|
||||
149
connectionwidget.ui
Normal file
@@ -0,0 +1,149 @@
|
||||
<ui version="4.0" >
|
||||
<class>ConnectionWidget</class>
|
||||
<widget class="QWidget" name="ConnectionWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>212</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="TextLabel5" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font" >
|
||||
<font>
|
||||
<pointsize>13</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Attention</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="indent" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="mainTextLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineWidth" >
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="midLineWidth" >
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Somebody is requesting a connection to your computer. Granting this will allow the remote user to watch your desktop. </string>
|
||||
</property>
|
||||
<property name="textFormat" >
|
||||
<enum>Qt::AutoText</enum>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="indent" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabel1" >
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Remote system:</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="remoteHost" >
|
||||
<property name="font" >
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>123.234.123.234</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbAllowRemoteControl" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>If you turn this option on, the remote user can enter keystrokes and use your mouse pointer. This gives them full control over your computer, so be careful. When the option is disabled the remote user can only watch your screen.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Allow remote user to &control keyboard and mouse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,3 +1,2 @@
|
||||
########### install files ###############
|
||||
kde4_create_handbook(index.docbook)
|
||||
kde4_install_handbook()
|
||||
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en)
|
||||
|
||||
@@ -139,7 +139,7 @@ the frame-buffer level, which roughly corresponds to the rendered
|
||||
screen image, which means that it can be applied to all windowing
|
||||
systems (including X11, &MacOS; and &Microsoft; &Windows;). Remote
|
||||
Frame Buffer applications exist for many platforms, and can often be
|
||||
free re-distributed.
|
||||
freely re-distributed.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
197
events.cpp
Normal file
@@ -0,0 +1,197 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
(C) 2001-2003 by Tim Jansen <tim@tjansen.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include "events.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QX11Info>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
|
||||
|
||||
Display *KeyboardEvent::dpy;
|
||||
signed char KeyboardEvent::modifiers[0x100];
|
||||
KeyCode KeyboardEvent::keycodes[0x100];
|
||||
KeyCode KeyboardEvent::leftShiftCode;
|
||||
KeyCode KeyboardEvent::rightShiftCode;
|
||||
KeyCode KeyboardEvent::altGrCode;
|
||||
const int KeyboardEvent::LEFTSHIFT = 1;
|
||||
const int KeyboardEvent::RIGHTSHIFT = 2;
|
||||
const int KeyboardEvent::ALTGR = 4;
|
||||
char KeyboardEvent::ModifierState;
|
||||
bool KeyboardEvent::initDone = false;
|
||||
|
||||
|
||||
KeyboardEvent::KeyboardEvent(bool d, KeySym k)
|
||||
: down(d), keySym(k)
|
||||
{
|
||||
initKeycodes();
|
||||
}
|
||||
|
||||
void KeyboardEvent::initKeycodes()
|
||||
{
|
||||
if (initDone) return;
|
||||
initDone = true;
|
||||
KeySym key,*keymap;
|
||||
int i,j,minkey,maxkey,syms_per_keycode;
|
||||
|
||||
dpy = QX11Info::display();
|
||||
|
||||
memset(modifiers,-1,sizeof(modifiers));
|
||||
|
||||
XDisplayKeycodes(dpy,&minkey,&maxkey);
|
||||
Q_ASSERT(minkey >= 8);
|
||||
Q_ASSERT(maxkey < 256);
|
||||
keymap = (KeySym*) XGetKeyboardMapping(dpy, minkey,
|
||||
(maxkey - minkey + 1),
|
||||
&syms_per_keycode);
|
||||
Q_ASSERT(keymap);
|
||||
|
||||
for (i = minkey; i <= maxkey; i++) {
|
||||
for (j=0; j<syms_per_keycode; j++) {
|
||||
key = keymap[(i-minkey)*syms_per_keycode+j];
|
||||
if (key>=' ' && key<0x100 && i==XKeysymToKeycode(dpy,key)) {
|
||||
keycodes[key]=i;
|
||||
modifiers[key]=j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
leftShiftCode = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
rightShiftCode = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
altGrCode = XKeysymToKeycode(dpy, XK_Mode_switch);
|
||||
|
||||
XFree ((char *)keymap);
|
||||
}
|
||||
|
||||
/* this function adjusts the modifiers according to mod (as from modifiers) and ModifierState */
|
||||
void KeyboardEvent::tweakModifiers(signed char mod, bool down)
|
||||
{
|
||||
|
||||
bool isShift = ModifierState & (LEFTSHIFT|RIGHTSHIFT);
|
||||
if(mod < 0)
|
||||
return;
|
||||
|
||||
if(isShift && mod != 1) {
|
||||
if(ModifierState & LEFTSHIFT) {
|
||||
XTestFakeKeyEvent(dpy, leftShiftCode,
|
||||
!down, CurrentTime);
|
||||
}
|
||||
if(ModifierState & RIGHTSHIFT) {
|
||||
XTestFakeKeyEvent(dpy, rightShiftCode,
|
||||
!down, CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isShift && mod==1) {
|
||||
XTestFakeKeyEvent(dpy, leftShiftCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
|
||||
if((ModifierState&ALTGR) && mod != 2) {
|
||||
XTestFakeKeyEvent(dpy, altGrCode,
|
||||
!down, CurrentTime);
|
||||
}
|
||||
|
||||
if(!(ModifierState&ALTGR) && mod==2) {
|
||||
XTestFakeKeyEvent(dpy, altGrCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
void KeyboardEvent::exec() {
|
||||
#define ADJUSTMOD(sym,state) \
|
||||
if(keySym==sym) { if(down) ModifierState|=state; else ModifierState&=~state; }
|
||||
|
||||
ADJUSTMOD(XK_Shift_L,LEFTSHIFT);
|
||||
ADJUSTMOD(XK_Shift_R,RIGHTSHIFT);
|
||||
ADJUSTMOD(XK_Mode_switch,ALTGR);
|
||||
|
||||
if(keySym>=' ' && keySym<0x100) {
|
||||
KeyCode k;
|
||||
if (down) {
|
||||
tweakModifiers(modifiers[keySym],True);
|
||||
}
|
||||
k = keycodes[keySym];
|
||||
if (k != NoSymbol) {
|
||||
XTestFakeKeyEvent(dpy, k, down, CurrentTime);
|
||||
}
|
||||
if (down) {
|
||||
tweakModifiers(modifiers[keySym],False);
|
||||
}
|
||||
} else {
|
||||
KeyCode k = XKeysymToKeycode(dpy, keySym );
|
||||
if (k != NoSymbol) {
|
||||
XTestFakeKeyEvent(dpy, k, down, CurrentTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool PointerEvent::initialized = false;
|
||||
Display *PointerEvent::dpy;
|
||||
int PointerEvent::buttonMask = 0;
|
||||
|
||||
PointerEvent::PointerEvent(int b, int _x, int _y)
|
||||
: button_mask(b),x(_x),y(_y)
|
||||
{
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
dpy = QX11Info::display();
|
||||
buttonMask = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void PointerEvent::exec() {
|
||||
QDesktopWidget *desktopWidget = QApplication::desktop();
|
||||
|
||||
int screen = desktopWidget->screenNumber();
|
||||
if (screen < 0)
|
||||
screen = 0;
|
||||
XTestFakeMotionEvent(dpy, screen, x, y, CurrentTime);
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if ((buttonMask&(1<<i))!=(button_mask&(1<<i))) {
|
||||
XTestFakeButtonEvent(dpy,
|
||||
i+1,
|
||||
(button_mask&(1<<i))?True:False,
|
||||
CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
buttonMask = button_mask;
|
||||
}
|
||||
|
||||
|
||||
ClipboardEvent::ClipboardEvent(ConnectionController *c, const QString &ctext)
|
||||
:controller(c),text(ctext)
|
||||
{
|
||||
}
|
||||
|
||||
void ClipboardEvent::exec()
|
||||
{
|
||||
#if 0
|
||||
if ((controller->lastClipboardDirection == ConnectionController::LAST_SYNC_TO_CLIENT) &&
|
||||
(controller->lastClipboardText == text)) {
|
||||
return;
|
||||
}
|
||||
controller->lastClipboardDirection = ConnectionController::LAST_SYNC_TO_SERVER;
|
||||
controller->lastClipboardText = text;
|
||||
|
||||
controller->clipboard->setText(text, QClipboard::Clipboard);
|
||||
controller->clipboard->setText(text, QClipboard::Selection);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VNCEvent::~ VNCEvent()
|
||||
{
|
||||
}
|
||||
70
events.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
(C) 2001-2003 by Tim Jansen <tim@tjansen.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef EVENTS_H
|
||||
#define EVENTS_H
|
||||
|
||||
#include <QDesktopWidget>
|
||||
#include <QEvent>
|
||||
#include <QString>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
class ConnectionController;
|
||||
|
||||
class QCursor;
|
||||
|
||||
class VNCEvent {
|
||||
public:
|
||||
virtual void exec() = 0;
|
||||
virtual ~VNCEvent();
|
||||
};
|
||||
|
||||
class KeyboardEvent : public VNCEvent {
|
||||
bool down;
|
||||
KeySym keySym;
|
||||
|
||||
static Display *dpy;
|
||||
static signed char modifiers[0x100];
|
||||
static KeyCode keycodes[0x100], leftShiftCode, rightShiftCode, altGrCode;
|
||||
static const int LEFTSHIFT;
|
||||
static const int RIGHTSHIFT;
|
||||
static const int ALTGR;
|
||||
static char ModifierState;
|
||||
static bool initDone;
|
||||
|
||||
static void tweakModifiers(signed char mod, bool down);
|
||||
public:
|
||||
static void initKeycodes();
|
||||
|
||||
KeyboardEvent(bool d, KeySym k);
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
class PointerEvent : public VNCEvent {
|
||||
int button_mask, x, y;
|
||||
|
||||
static bool initialized;
|
||||
static Display *dpy;
|
||||
static int buttonMask;
|
||||
public:
|
||||
PointerEvent(int b, int _x, int _y);
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
class ClipboardEvent : public VNCEvent {
|
||||
ConnectionController *controller;
|
||||
QString text;
|
||||
public:
|
||||
ClipboardEvent(ConnectionController *c, const QString &text);
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
#endif
|
||||
71
framebuffer.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include "framebuffer.h"
|
||||
#include "framebuffer.moc"
|
||||
|
||||
#include <config-krfb.h>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
|
||||
FrameBuffer::FrameBuffer(WId id, QObject *parent)
|
||||
: QObject(parent), win(id)
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer::~FrameBuffer()
|
||||
{
|
||||
delete fb;
|
||||
}
|
||||
|
||||
char * FrameBuffer::data()
|
||||
{
|
||||
return fb;
|
||||
}
|
||||
|
||||
QList< QRect > FrameBuffer::modifiedTiles()
|
||||
{
|
||||
QList<QRect> ret = tiles;
|
||||
tiles.clear();
|
||||
return ret;
|
||||
}
|
||||
|
||||
int FrameBuffer::width()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int FrameBuffer::height()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FrameBuffer::getServerFormat(rfbPixelFormat &)
|
||||
{
|
||||
}
|
||||
|
||||
int FrameBuffer::depth()
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
int FrameBuffer::paddedWidth()
|
||||
{
|
||||
return width() * depth() / 8;
|
||||
}
|
||||
|
||||
void FrameBuffer::startMonitor()
|
||||
{
|
||||
}
|
||||
|
||||
void FrameBuffer::stopMonitor()
|
||||
{
|
||||
}
|
||||
|
||||
56
framebuffer.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef FRAMEBUFFER_H
|
||||
#define FRAMEBUFFER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QRect>
|
||||
#include <QList>
|
||||
#include <QWidget>
|
||||
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <rfb/rfb.h>
|
||||
|
||||
class FrameBuffer;
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class KDE_EXPORT FrameBuffer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FrameBuffer(WId id, QObject *parent = 0);
|
||||
|
||||
virtual ~FrameBuffer();
|
||||
|
||||
char * data();
|
||||
|
||||
virtual QList<QRect> modifiedTiles();
|
||||
virtual int paddedWidth();
|
||||
virtual int width();
|
||||
virtual int height();
|
||||
virtual int depth();
|
||||
virtual void startMonitor();
|
||||
virtual void stopMonitor();
|
||||
|
||||
virtual void getServerFormat(rfbPixelFormat &format);
|
||||
|
||||
protected:
|
||||
WId win;
|
||||
char *fb;
|
||||
QList<QRect> tiles;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(FrameBuffer)
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
132
framebuffermanager.cpp
Normal file
@@ -0,0 +1,132 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "framebuffermanager.h"
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
#include "krfbconfig.h"
|
||||
|
||||
#include <KDebug>
|
||||
#include <KGlobal>
|
||||
#include <KServiceTypeTrader>
|
||||
|
||||
#include <QtCore/QSharedPointer>
|
||||
|
||||
class FrameBufferManagerStatic
|
||||
{
|
||||
public:
|
||||
FrameBufferManager instance;
|
||||
};
|
||||
|
||||
K_GLOBAL_STATIC(FrameBufferManagerStatic, frameBufferManagerStatic)
|
||||
|
||||
FrameBufferManager::FrameBufferManager()
|
||||
{
|
||||
kDebug();
|
||||
|
||||
loadPlugins();
|
||||
}
|
||||
|
||||
FrameBufferManager::~FrameBufferManager()
|
||||
{
|
||||
kDebug();
|
||||
}
|
||||
|
||||
FrameBufferManager *FrameBufferManager::instance()
|
||||
{
|
||||
kDebug();
|
||||
|
||||
return &frameBufferManagerStatic->instance;
|
||||
}
|
||||
|
||||
void FrameBufferManager::loadPlugins()
|
||||
{
|
||||
kDebug();
|
||||
|
||||
// Load the all the plugin factories here, for use later.
|
||||
KService::List offers = KServiceTypeTrader::self()->query("krfb/framebuffer");
|
||||
|
||||
KService::List::const_iterator iter;
|
||||
for (iter = offers.constBegin(); iter < offers.constEnd(); ++iter) {
|
||||
QString error;
|
||||
KService::Ptr service = *iter;
|
||||
|
||||
KPluginFactory *factory = KPluginLoader(service->library()).factory();
|
||||
|
||||
if (!factory) {
|
||||
kWarning() << "KPluginFactory could not load the plugin:" << service->library();
|
||||
continue;
|
||||
}
|
||||
|
||||
FrameBufferPlugin *plugin = factory->create<FrameBufferPlugin>(this);
|
||||
|
||||
if (plugin) {
|
||||
kDebug() << "Loaded plugin:" << service->name();
|
||||
m_plugins.insert(service->library(), plugin);
|
||||
} else {
|
||||
kDebug() << error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
|
||||
{
|
||||
kDebug();
|
||||
|
||||
// See if there is still an existing framebuffer to this WId.
|
||||
if (m_frameBuffers.contains(id)) {
|
||||
QWeakPointer<FrameBuffer> weakFrameBuffer = m_frameBuffers.value(id);
|
||||
|
||||
if (weakFrameBuffer) {
|
||||
kDebug() << "Found cached frame buffer.";
|
||||
return weakFrameBuffer.toStrongRef();
|
||||
} else {
|
||||
kDebug() << "Found deleted cached frame buffer. Don't use.";
|
||||
m_frameBuffers.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
// We don't already have that frame buffer.
|
||||
QMap<QString, FrameBufferPlugin*>::const_iterator iter = m_plugins.constBegin();
|
||||
while (iter != m_plugins.constEnd()) {
|
||||
|
||||
if (iter.key() == KrfbConfig::preferredFrameBufferPlugin()) {
|
||||
kDebug() << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
|
||||
|
||||
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id));
|
||||
|
||||
if (frameBuffer) {
|
||||
m_frameBuffers.insert(id, frameBuffer.toWeakRef());
|
||||
|
||||
return frameBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
++iter;
|
||||
}
|
||||
|
||||
// No valid framebuffer plugin found.
|
||||
kDebug() << "No valid framebuffer found. returning null.";
|
||||
return QSharedPointer<FrameBuffer>();
|
||||
}
|
||||
|
||||
|
||||
#include "framebuffermanager.moc"
|
||||
|
||||
62
framebuffermanager.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_FRAMEBUFFERMANAGER_H
|
||||
#define KRFB_FRAMEBUFFERMANAGER_H
|
||||
|
||||
#include "framebuffer.h"
|
||||
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QWeakPointer>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBufferPlugin;
|
||||
class KPluginFactory;
|
||||
|
||||
class KDE_EXPORT FrameBufferManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class FrameBufferManagerStatic;
|
||||
|
||||
public:
|
||||
static FrameBufferManager *instance();
|
||||
|
||||
virtual ~FrameBufferManager();
|
||||
|
||||
QSharedPointer<FrameBuffer> frameBuffer(WId id);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(FrameBufferManager)
|
||||
|
||||
FrameBufferManager();
|
||||
|
||||
void loadPlugins();
|
||||
|
||||
QMap<QString, FrameBufferPlugin*> m_plugins;
|
||||
QMap<WId, QWeakPointer<FrameBuffer> > m_frameBuffers;
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
36
framebufferplugin.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
|
||||
#include "framebuffer.h"
|
||||
|
||||
FrameBufferPlugin::FrameBufferPlugin(QObject *parent, const QVariantList &)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
FrameBufferPlugin::~FrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#include "framebufferplugin.moc"
|
||||
|
||||
44
framebufferplugin.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef LIB_KRFB_FRAMEBUFFERPLUGIN_H
|
||||
#define LIB_KRFB_FRAMEBUFFERPLUGIN_H
|
||||
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QtCore/QVariantList>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBuffer;
|
||||
|
||||
class KDE_EXPORT FrameBufferPlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~FrameBufferPlugin();
|
||||
|
||||
virtual FrameBuffer *frameBuffer(WId id) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
3
framebuffers/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
add_subdirectory (qt)
|
||||
add_subdirectory (x11)
|
||||
|
||||
28
framebuffers/qt/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set (krfb_framebuffer_qt_SRCS
|
||||
qtframebuffer.cpp
|
||||
qtframebufferplugin.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin (krfb_framebuffer_qt
|
||||
${krfb_framebuffer_qt_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries (krfb_framebuffer_qt
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${KDE4_KDEUI_LIBS}
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_framebuffer_qt
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install (FILES krfb_framebuffer_qt.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
83
framebuffers/qt/krfb_framebuffer_qt.desktop
Normal file
@@ -0,0 +1,83 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Comment=Qt based Framebuffer for KRfb.
|
||||
Comment[ast]=Esquema Qt de buffer pa KRfb
|
||||
Comment[ca]=«Framebuffer» basat en Qt per al KRfb.
|
||||
Comment[ca@valencia]=«Framebuffer» basat en Qt per al KRfb.
|
||||
Comment[da]=Qt-baseret framebuffer til KRfb.
|
||||
Comment[de]=Qt-basierter Framebuffer für KRfb
|
||||
Comment[en_GB]=Qt based Framebuffer for KRfb.
|
||||
Comment[es]=Esquema Qt de buffer para KRfb
|
||||
Comment[et]=KRfb Qt põhine kaadripuhver
|
||||
Comment[fi]=QT-perustainen Kehyspuskuri KRfb:lle
|
||||
Comment[fr]=Sortie vidéo basée sur Qt pour KRfb.
|
||||
Comment[gl]=Framebuffer baseado en Qt para KRfb.
|
||||
Comment[hr]=Međuspremnik okvira baziran na Qt-u za KRfb.
|
||||
Comment[hu]=Qt-alapú keretpuffer a KRfb-hez.
|
||||
Comment[it]=Framebuffer basato su Qt per KRfb.
|
||||
Comment[km]=Framebuffer មានមូលដ្ឋានលើ Qt សម្រាប់ KRfb ។
|
||||
Comment[ko]=KRfb를 위한 Qt 기반 프레임버퍼.
|
||||
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[pt]='Framebuffer' baseado no Qt para o KRfb.
|
||||
Comment[pt_BR]=Framebuffer baseado no Qt para o KRfb.
|
||||
Comment[sk]=Framebuffer založený na Qt pre KRfb.
|
||||
Comment[sl]=Slikovni medpomnilnik za KRFB, ki temelji na Qt
|
||||
Comment[sr]=Кадробафер за КРФБ на основу КуТ‑у
|
||||
Comment[sr@ijekavian]=Кадробафер за КРФБ на основу КуТ‑у
|
||||
Comment[sr@ijekavianlatin]=Kadrobafer za KRFB na osnovu Qt‑u
|
||||
Comment[sr@latin]=Kadrobafer za KRFB na osnovu Qt‑u
|
||||
Comment[sv]=Qt-baserad rambuffert för Krfb.
|
||||
Comment[tr]=KRfb için Qt temelli Çerçeve tamponu.
|
||||
Comment[uk]=Заснований на Qt буфер кадрів для KRfb.
|
||||
Comment[x-test]=xxQt based Framebuffer for KRfb.xx
|
||||
Comment[zh_CN]=基于 Qt 的 KRfb 帧缓冲机制
|
||||
Comment[zh_TW]=KRfb 的 Qt-based Framebuffer
|
||||
Name=Qt Framebuffer for KRfb
|
||||
Name[ast]=Esquema Qt de buffer pa KRfb
|
||||
Name[ca]=«Framebuffer» Qt per al KRfb.
|
||||
Name[ca@valencia]=«Framebuffer» Qt per al KRfb.
|
||||
Name[da]=Qt-framebuffer til KRfb
|
||||
Name[de]=Qt-Framebuffer für KRfb
|
||||
Name[en_GB]=Qt Framebuffer for KRfb
|
||||
Name[es]=Esquema Qt de buffer para KRfb
|
||||
Name[et]=KRfb Qt kaadripuhver
|
||||
Name[fi]=QT-kehyspuskuri KRfb:lle
|
||||
Name[fr]=Sortie vidéo Qt pour KRfb
|
||||
Name[gl]=Framebuffer de Qt para KRfb
|
||||
Name[hr]=Qt Framebuffer za KRfb
|
||||
Name[hu]=Qt-alapú keretpuffer a KRfb-hez
|
||||
Name[it]=Framebuffer Qt per KRfb
|
||||
Name[km]=Qt Framebuffer សម្រាប់for KRfb
|
||||
Name[ko]=KRfb를 위한 Qt 프레임버퍼
|
||||
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[pt]='Framebuffer' do Qt para o KRfb
|
||||
Name[pt_BR]=Framebuffer do Qt para o KRfb
|
||||
Name[sk]=Qt Framebuffer pre KRfb
|
||||
Name[sl]=Slikovni medpomnilnik Qt za KRFB
|
||||
Name[sr]=КуТ‑ов кадробафер за КРФБ
|
||||
Name[sr@ijekavian]=КуТ‑ов кадробафер за КРФБ
|
||||
Name[sr@ijekavianlatin]=Qt‑ov kadrobafer za KRFB
|
||||
Name[sr@latin]=Qt‑ov kadrobafer za KRFB
|
||||
Name[sv]=Qt-rambuffert för Krfb
|
||||
Name[tr]=KRfb için Qt Çerçeve tamponu
|
||||
Name[uk]=Буфер кадрів на Qt для KRfb
|
||||
Name[x-test]=xxQt Framebuffer for KRfbxx
|
||||
Name[zh_CN]=KRfb 的 Qt 帧缓冲机制
|
||||
Name[zh_TW]=Krfb 的 Qt Framebuffer
|
||||
Type=Service
|
||||
ServiceTypes=krfb/framebuffer
|
||||
|
||||
X-KDE-Library=krfb_framebuffer_qt
|
||||
X-KDE-PluginInfo-Name=qt
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=http://www.kde.org
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
116
framebuffers/qt/qtframebuffer.cpp
Normal file
@@ -0,0 +1,116 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include "qtframebuffer.h"
|
||||
#include "qtframebuffer.moc"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QRegion>
|
||||
#include <QPixmap>
|
||||
#include <QBitmap>
|
||||
|
||||
|
||||
const int UPDATE_TIME = 500;
|
||||
|
||||
QtFrameBuffer::QtFrameBuffer(WId id, QObject *parent)
|
||||
: FrameBuffer(id, parent)
|
||||
{
|
||||
fbImage = QPixmap::grabWindow(win).toImage();
|
||||
fb = new char[fbImage.numBytes()];
|
||||
t = new QTimer(this);
|
||||
connect(t, SIGNAL(timeout()), SLOT(updateFrameBuffer()));
|
||||
}
|
||||
|
||||
|
||||
QtFrameBuffer::~QtFrameBuffer()
|
||||
{
|
||||
delete [] fb;
|
||||
fb = 0;
|
||||
}
|
||||
|
||||
int QtFrameBuffer::depth()
|
||||
{
|
||||
return fbImage.depth();
|
||||
}
|
||||
|
||||
int QtFrameBuffer::height()
|
||||
{
|
||||
return fbImage.height();
|
||||
}
|
||||
|
||||
int QtFrameBuffer::width()
|
||||
{
|
||||
return fbImage.width();
|
||||
}
|
||||
|
||||
void QtFrameBuffer::getServerFormat(rfbPixelFormat& format)
|
||||
{
|
||||
format.bitsPerPixel = 32;
|
||||
format.depth = 32;
|
||||
format.trueColour = true;
|
||||
|
||||
format.bigEndian = false;
|
||||
format.redShift = 16;
|
||||
format.greenShift = 8;
|
||||
format.blueShift = 0;
|
||||
format.redMax = 0xff;
|
||||
format.greenMax = 0xff;
|
||||
format.blueMax = 0xff;
|
||||
}
|
||||
|
||||
void QtFrameBuffer::updateFrameBuffer()
|
||||
{
|
||||
QImage img = QPixmap::grabWindow(win).toImage();
|
||||
QSize imgSize = img.size();
|
||||
|
||||
|
||||
// verify what part of the image need to be marked as changed
|
||||
// fbImage is the previous version of the image,
|
||||
// img is the current one
|
||||
|
||||
#if 0 // This is actually slower than updating the whole desktop...
|
||||
|
||||
QImage map(imgSize, QImage::Format_Mono);
|
||||
map.fill(0);
|
||||
|
||||
for (int x = 0; x < imgSize.width(); x++) {
|
||||
for (int y = 0; y < imgSize.height(); y++) {
|
||||
if (img.pixel(x,y) != fbImage.pixel(x,y)) {
|
||||
map.setPixel(x,y,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QRegion r(QBitmap::fromImage(map));
|
||||
tiles = tiles + r.rects();
|
||||
|
||||
#else
|
||||
tiles.append(img.rect());
|
||||
#endif
|
||||
|
||||
memcpy(fb, (const char*)img.bits(), img.numBytes());
|
||||
fbImage = img;
|
||||
|
||||
}
|
||||
|
||||
int QtFrameBuffer::paddedWidth()
|
||||
{
|
||||
return fbImage.width() * 4;
|
||||
}
|
||||
|
||||
void QtFrameBuffer::startMonitor()
|
||||
{
|
||||
t->start(UPDATE_TIME);
|
||||
}
|
||||
|
||||
void QtFrameBuffer::stopMonitor()
|
||||
{
|
||||
t->stop();
|
||||
}
|
||||
|
||||
44
framebuffers/qt/qtframebuffer.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_FRAMEBUFFER_QT_QTFRAMEBUFFER_H
|
||||
#define KRFB_FRAMEBUFFER_QT_QTFRAMEBUFFER_H
|
||||
|
||||
#include <QImage>
|
||||
#include "framebuffer.h"
|
||||
|
||||
class QTimer;
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class QtFrameBuffer : public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QtFrameBuffer(WId id, QObject *parent = 0);
|
||||
|
||||
~QtFrameBuffer();
|
||||
|
||||
virtual int depth();
|
||||
virtual int height();
|
||||
virtual int width();
|
||||
virtual int paddedWidth();
|
||||
virtual void getServerFormat(rfbPixelFormat& format);
|
||||
virtual void startMonitor();
|
||||
virtual void stopMonitor();
|
||||
|
||||
public Q_SLOTS:
|
||||
void updateFrameBuffer();
|
||||
|
||||
private:
|
||||
QImage fbImage;
|
||||
QTimer *t;
|
||||
};
|
||||
|
||||
#endif
|
||||
47
framebuffers/qt/qtframebufferplugin.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "qtframebufferplugin.h"
|
||||
|
||||
#include "qtframebuffer.h"
|
||||
|
||||
#include <KGenericFactory>
|
||||
|
||||
|
||||
QtFrameBufferPlugin::QtFrameBufferPlugin(QObject *parent, const QVariantList &args)
|
||||
: FrameBufferPlugin(parent, args)
|
||||
{
|
||||
}
|
||||
|
||||
QtFrameBufferPlugin::~QtFrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id)
|
||||
{
|
||||
return new QtFrameBuffer(id);
|
||||
}
|
||||
|
||||
K_PLUGIN_FACTORY(factory, registerPlugin<QtFrameBufferPlugin>();) \
|
||||
K_EXPORT_PLUGIN(factory("krfb_framebuffer_qt"))
|
||||
|
||||
|
||||
#include "qtframebufferplugin.moc"
|
||||
|
||||
48
framebuffers/qt/qtframebufferplugin.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_FRAMEBUFFER_QT_QTFRAMEBUFFERPLUGIN_H
|
||||
#define KRFB_FRAMEBUFFER_QT_QTFRAMEBUFFERPLUGIN_H
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBuffer;
|
||||
|
||||
class QtFrameBufferPlugin : public FrameBufferPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~QtFrameBufferPlugin();
|
||||
|
||||
virtual FrameBuffer *frameBuffer(WId id);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QtFrameBufferPlugin)
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
31
framebuffers/x11/CMakeLists.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set (krfb_framebuffer_x11_SRCS
|
||||
x11framebuffer.cpp
|
||||
x11framebufferplugin.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin (krfb_framebuffer_x11
|
||||
${krfb_framebuffer_x11_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries (krfb_framebuffer_x11
|
||||
${KDE4_KDEUI_LIBS}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${X11_X11_LIB}
|
||||
${X11_Xdamage_LIB}
|
||||
${X11_Xext_LIB}
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_framebuffer_x11
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install (FILES krfb_framebuffer_x11.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
83
framebuffers/x11/krfb_framebuffer_x11.desktop
Normal file
@@ -0,0 +1,83 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Comment=X11 XDamage/XShm based Framebuffer for KRfb.
|
||||
Comment[ast]=Esquema de buffer pa KRfb basáu en XDamage/XShm
|
||||
Comment[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[da]=X11 XDamage/XShm-baseret framebuffer til KRfb.
|
||||
Comment[de]=X11 XDamage/XShm-basierter Framebuffer für KRfb.
|
||||
Comment[en_GB]=X11 XDamage/XShm based Framebuffer for KRfb.
|
||||
Comment[es]=Esquema de buffer para KRfb basado en XDamage/XShm
|
||||
Comment[et]=KRfb X11 XDamage/XShm põhine kaadripuhver
|
||||
Comment[fi]=X11 XDamage/XShm-perustainen kehyspuskui KRfb:lle.
|
||||
Comment[fr]=Sortie vidéo basée sur X11 XDamage / XShm pour KRfb.
|
||||
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ú keretpuffer a KRfb-hez.
|
||||
Comment[it]=Framebuffer basato su XDamage/XShm di X11 per KRfb.
|
||||
Comment[km]=X11 XDamage/XShm based Framebuffer សម្រាប់ KRfb ។
|
||||
Comment[ko]=KRfb를 위한 X11 XDamage/XShm 기반 프레임버퍼.
|
||||
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[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[sk]=Framebuffer založený na X11 XDamage/XShm pre KRfb.
|
||||
Comment[sl]=Slikovni medpomnilnik za KRFB, ki temelji na X11 XDamage/XShm
|
||||
Comment[sr]=Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.
|
||||
Comment[sr@ijekavian]=Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.
|
||||
Comment[sr@ijekavianlatin]=Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.
|
||||
Comment[sr@latin]=Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.
|
||||
Comment[sv]=X11 XDamage/XShm-baserad rambuffert för Krfb.
|
||||
Comment[tr]=KRfb için X11 XDamage/XShm temelli Çerçeve Tamponu.
|
||||
Comment[uk]=Заснований на XDamage/XShm X11 буфер кадрів для KRfb.
|
||||
Comment[x-test]=xxX11 XDamage/XShm based Framebuffer for KRfb.xx
|
||||
Comment[zh_CN]=基于 X11 XDamage/XShm 扩展的 KRfb 帧缓冲机制。
|
||||
Comment[zh_TW]=KRfb 的 X11 XDamage/XShm based Framebuffer
|
||||
Name=X11 Framebuffer for KRfb
|
||||
Name[ast]=Buffer de X11 pa KRfb
|
||||
Name[ca]=«Framebuffer» de l'X11 per al KRfb.
|
||||
Name[ca@valencia]=«Framebuffer» de l'X11 per al KRfb.
|
||||
Name[da]=X11-framebuffer til KRfb
|
||||
Name[de]=X11-Framebuffer für KRfb
|
||||
Name[en_GB]=X11 Framebuffer for KRfb
|
||||
Name[es]=Buffer de X11 para KRfb
|
||||
Name[et]=KRfb X11 kaadripuhver
|
||||
Name[fi]=X11-kehyspuskuri KRfb:lle
|
||||
Name[fr]=Sortie vidéo X11 pour KRfb
|
||||
Name[gl]=Framebuffer de X11 para KRfb
|
||||
Name[hr]=Međuspremnik okvira X11 za KRfb
|
||||
Name[hu]=X11-alapú keretpuffer a KRfb-hez
|
||||
Name[it]=Framebuffer X11 per KRfb
|
||||
Name[km]=X11 Framebuffer សម្រាប់ KRfb
|
||||
Name[ko]=KRfb를 위한 X11 프레임버퍼
|
||||
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[pt]='Framebuffer' do X11 para o KRfb
|
||||
Name[pt_BR]=Framebuffer do X11 para o KRfb
|
||||
Name[sk]=X11 Framebuffer pre KRfb
|
||||
Name[sl]=Slikovni medpomnilnik X11 za KRFB
|
||||
Name[sr]=Икс11 кадробафер за КРФБ.
|
||||
Name[sr@ijekavian]=Икс11 кадробафер за КРФБ.
|
||||
Name[sr@ijekavianlatin]=X11 kadrobafer za KRFB.
|
||||
Name[sr@latin]=X11 kadrobafer za KRFB.
|
||||
Name[sv]=X11-rambuffert för Krfb
|
||||
Name[tr]=KRfb için X11 Çerçeve Tamponu
|
||||
Name[uk]=Буфер кадрів X11 для KRfb
|
||||
Name[x-test]=xxX11 Framebuffer for KRfbxx
|
||||
Name[zh_CN]=KRfb 的 X11 帧缓冲机制
|
||||
Name[zh_TW]=KRfb 的 X11 Framebuffer
|
||||
Type=Service
|
||||
ServiceTypes=krfb/framebuffer
|
||||
|
||||
X-KDE-Library=krfb_framebuffer_x11
|
||||
X-KDE-PluginInfo-Name=x11
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=http://www.kde.org
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
351
framebuffers/x11/x11framebuffer.cpp
Normal file
@@ -0,0 +1,351 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include "x11framebuffer.h"
|
||||
#include "x11framebuffer.moc"
|
||||
|
||||
#include <config-krfb.h>
|
||||
|
||||
#include <QX11Info>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include <KApplication>
|
||||
#include <KDebug>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#ifdef HAVE_XDAMAGE
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XSHM
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
#endif
|
||||
|
||||
class X11FrameBuffer::P {
|
||||
|
||||
public:
|
||||
#ifdef HAVE_XDAMAGE
|
||||
Damage damage;
|
||||
#endif
|
||||
#ifdef HAVE_XSHM
|
||||
XShmSegmentInfo shminfo;
|
||||
#endif
|
||||
|
||||
XImage *framebufferImage;
|
||||
XImage *updateTile;
|
||||
EvWidget *ev;
|
||||
bool useShm;
|
||||
int xdamageBaseEvent;
|
||||
bool running;
|
||||
};
|
||||
|
||||
X11FrameBuffer::X11FrameBuffer(WId id, QObject* parent)
|
||||
:FrameBuffer(id, parent), d(new X11FrameBuffer::P)
|
||||
{
|
||||
#ifdef HAVE_XSHM
|
||||
d->useShm = XShmQueryExtension(QX11Info::display());
|
||||
kDebug() << "shm: " << d->useShm;
|
||||
#else
|
||||
d->useShm = false;
|
||||
#endif
|
||||
d->running = false;
|
||||
d->framebufferImage = XGetImage(QX11Info::display(),
|
||||
id,
|
||||
0,
|
||||
0,
|
||||
QApplication::desktop()->width(), //arg, must get a widget ???
|
||||
QApplication::desktop()->height(),
|
||||
AllPlanes,
|
||||
ZPixmap);
|
||||
if (d->useShm) {
|
||||
#ifdef HAVE_XSHM
|
||||
d->updateTile = XShmCreateImage(QX11Info::display(),
|
||||
DefaultVisual( QX11Info::display(), 0 ),
|
||||
d->framebufferImage->bits_per_pixel,
|
||||
ZPixmap,
|
||||
NULL,
|
||||
&d->shminfo,
|
||||
32,
|
||||
32);
|
||||
d->shminfo.shmid = shmget(IPC_PRIVATE,
|
||||
d->updateTile->bytes_per_line * d->updateTile->height,
|
||||
IPC_CREAT | 0777);
|
||||
|
||||
d->shminfo.shmaddr = d->updateTile->data = (char *)
|
||||
shmat(d->shminfo.shmid, 0, 0);
|
||||
d->shminfo.readOnly = False;
|
||||
|
||||
XShmAttach(QX11Info::display(), &d->shminfo);
|
||||
#endif
|
||||
} else {
|
||||
;
|
||||
}
|
||||
kDebug() << "Got image. bpp: " << d->framebufferImage->bits_per_pixel
|
||||
<< ", depth: " << d->framebufferImage->depth
|
||||
<< ", padded width: " << d->framebufferImage->bytes_per_line
|
||||
<< " (sent: " << d->framebufferImage->width * 4 << ")"
|
||||
<< endl;
|
||||
|
||||
fb = d->framebufferImage->data;
|
||||
#ifdef HAVE_XDAMAGE
|
||||
d->ev = new EvWidget(this);
|
||||
kapp->installX11EventFilter(d->ev);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
X11FrameBuffer::~X11FrameBuffer()
|
||||
{
|
||||
XDestroyImage(d->framebufferImage);
|
||||
#ifdef HAVE_XDAMAGE
|
||||
kapp->removeX11EventFilter(d->ev);
|
||||
#endif
|
||||
#ifdef HAVE_XSHM
|
||||
XShmDetach(QX11Info::display(), &d->shminfo);
|
||||
XDestroyImage(d->updateTile);
|
||||
shmdt(d->shminfo.shmaddr);
|
||||
shmctl(d->shminfo.shmid, IPC_RMID, 0);
|
||||
#endif
|
||||
delete d;
|
||||
fb = 0; // already deleted by XDestroyImage
|
||||
}
|
||||
|
||||
|
||||
int X11FrameBuffer::depth()
|
||||
{
|
||||
return d->framebufferImage->depth;
|
||||
}
|
||||
|
||||
int X11FrameBuffer::height()
|
||||
{
|
||||
return d->framebufferImage->height;
|
||||
}
|
||||
|
||||
int X11FrameBuffer::width()
|
||||
{
|
||||
return d->framebufferImage->width;
|
||||
}
|
||||
|
||||
int X11FrameBuffer::paddedWidth()
|
||||
{
|
||||
return d->framebufferImage->bytes_per_line;
|
||||
}
|
||||
|
||||
void X11FrameBuffer::getServerFormat(rfbPixelFormat& format)
|
||||
{
|
||||
format.bitsPerPixel = d->framebufferImage->bits_per_pixel;
|
||||
format.depth = d->framebufferImage->depth;
|
||||
format.trueColour = true;
|
||||
format.bigEndian = ((d->framebufferImage->bitmap_bit_order == MSBFirst) ? true : false);
|
||||
|
||||
if ( format.bitsPerPixel == 8 ) {
|
||||
format.redShift = 0;
|
||||
format.greenShift = 3;
|
||||
format.blueShift = 6;
|
||||
format.redMax = 7;
|
||||
format.greenMax = 7;
|
||||
format.blueMax = 3;
|
||||
} else {
|
||||
format.redShift = 0;
|
||||
if ( d->framebufferImage->red_mask )
|
||||
while ( ! ( d->framebufferImage->red_mask & (1 << format.redShift) ) )
|
||||
format.redShift++;
|
||||
format.greenShift = 0;
|
||||
if ( d->framebufferImage->green_mask )
|
||||
while ( ! ( d->framebufferImage->green_mask & (1 << format.greenShift) ) )
|
||||
format.greenShift++;
|
||||
format.blueShift = 0;
|
||||
if ( d->framebufferImage->blue_mask )
|
||||
while ( ! ( d->framebufferImage->blue_mask & (1 << format.blueShift) ) )
|
||||
format.blueShift++;
|
||||
format.redMax = d->framebufferImage->red_mask >> format.redShift;
|
||||
format.greenMax = d->framebufferImage->green_mask >> format.greenShift;
|
||||
format.blueMax = d->framebufferImage->blue_mask >> format.blueShift;
|
||||
}
|
||||
}
|
||||
|
||||
void X11FrameBuffer::handleXDamage(XEvent * event)
|
||||
{
|
||||
#ifdef HAVE_XDAMAGE
|
||||
XDamageNotifyEvent *dev = (XDamageNotifyEvent *)event;
|
||||
QRect r(dev->area.x, dev->area.y, dev->area.width, dev->area.height);
|
||||
tiles.append(r);
|
||||
|
||||
/*if (!dev->more) {
|
||||
XDamageSubtract(QX11Info::display(),d->damage, None, None);
|
||||
}*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void X11FrameBuffer::cleanupRects() {
|
||||
|
||||
QList<QRect> cpy = tiles;
|
||||
bool inserted = false;
|
||||
tiles.clear();
|
||||
// kDebug() << "before cleanup: " << cpy.size();
|
||||
foreach (const QRect &r, cpy) {
|
||||
if (tiles.size() > 0) {
|
||||
for(int i = 0; i < tiles.size(); i++) {
|
||||
// kDebug() << r << tiles[i];
|
||||
if (r.intersects(tiles[i])) {
|
||||
tiles[i] |= r;
|
||||
inserted = true;
|
||||
break;
|
||||
// kDebug() << "merged into " << tiles[i];
|
||||
}
|
||||
}
|
||||
if (!inserted) {
|
||||
tiles.append(r);
|
||||
// kDebug() << "appended " << r;
|
||||
}
|
||||
} else {
|
||||
// kDebug() << "appended " << r;
|
||||
tiles.append(r);
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < tiles.size(); i++) {
|
||||
tiles[i].adjust(-30,-30,30,30);
|
||||
if (tiles[i].top() < 0){
|
||||
tiles[i].setTop(0);
|
||||
}
|
||||
if (tiles[i].left() < 0){
|
||||
tiles[i].setLeft(0);
|
||||
}
|
||||
if (tiles[i].bottom() > d->framebufferImage->height) {
|
||||
tiles[i].setBottom(d->framebufferImage->height);
|
||||
}
|
||||
if (tiles[i].right() > d->framebufferImage->width) {
|
||||
tiles[i].setRight(d->framebufferImage->width);
|
||||
}
|
||||
}
|
||||
// kDebug() << "after cleanup: " << tiles.size();
|
||||
}
|
||||
|
||||
void X11FrameBuffer::acquireEvents() {
|
||||
|
||||
XEvent ev;
|
||||
while (XCheckTypedEvent(QX11Info::display(), d->xdamageBaseEvent+XDamageNotify, &ev)) {
|
||||
handleXDamage(&ev);
|
||||
}
|
||||
XDamageSubtract(QX11Info::display(),d->damage, None, None);
|
||||
}
|
||||
|
||||
QList< QRect > X11FrameBuffer::modifiedTiles()
|
||||
{
|
||||
QList<QRect> ret;
|
||||
if (!d->running) return ret;
|
||||
kapp->processEvents(); // try to make sure every damage event goes trough;
|
||||
cleanupRects();
|
||||
QRect gl;
|
||||
//d->useShm = false;
|
||||
if (tiles.size() > 0) {
|
||||
if (d->useShm) {
|
||||
#ifdef HAVE_XSHM
|
||||
|
||||
foreach(const QRect &r, tiles) {
|
||||
// kDebug() << r;
|
||||
gl |= r;
|
||||
int y = r.y();
|
||||
int x = r.x();
|
||||
while (x < r.right() ) {
|
||||
while (y < r.bottom() ) {
|
||||
if (y+d->updateTile->height > d->framebufferImage->height) {
|
||||
y = d->framebufferImage->height - d->updateTile->height;
|
||||
}
|
||||
if (x+d->updateTile->width > d->framebufferImage->width) {
|
||||
x = d->framebufferImage->width - d->updateTile->width;
|
||||
}
|
||||
// kDebug() << "x: " << x << " (" << r.x() << ") y: " << y << " (" << r.y() << ") " << r;
|
||||
XShmGetImage(QX11Info::display(), win, d->updateTile, x, y, AllPlanes);
|
||||
int pxsize = d->framebufferImage->bits_per_pixel / 8;
|
||||
char *dest = fb + ((d->framebufferImage->bytes_per_line * y) + (x*pxsize));
|
||||
char *src = d->updateTile->data;
|
||||
for (int i = 0; i < d->updateTile->height; i++) {
|
||||
memcpy(dest, src, d->updateTile->bytes_per_line);
|
||||
dest += d->framebufferImage->bytes_per_line;
|
||||
src += d->updateTile->bytes_per_line;
|
||||
}
|
||||
y += d->updateTile->height;
|
||||
}
|
||||
x += d->updateTile->width;
|
||||
y = r.y();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
foreach(const QRect &r, tiles) {
|
||||
XGetSubImage(QX11Info::display(),
|
||||
win,
|
||||
r.left(),
|
||||
r.top(),
|
||||
r.width(),
|
||||
r.height(),
|
||||
AllPlanes,
|
||||
ZPixmap,
|
||||
d->framebufferImage,
|
||||
r.left(),
|
||||
r.top()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
// kDebug() << "tot: " << gl;
|
||||
// kDebug() << tiles.size();
|
||||
ret = tiles;
|
||||
tiles.clear();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void X11FrameBuffer::startMonitor()
|
||||
{
|
||||
d->running = true;
|
||||
#ifdef HAVE_XDAMAGE
|
||||
d->damage = XDamageCreate(QX11Info::display(), win, XDamageReportRawRectangles);
|
||||
XDamageSubtract(QX11Info::display(),d->damage, None, None);
|
||||
#endif
|
||||
}
|
||||
|
||||
void X11FrameBuffer::stopMonitor()
|
||||
{
|
||||
d->running = false;
|
||||
#ifdef HAVE_XDAMAGE
|
||||
XDamageDestroy(QX11Info::display(),d->damage);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
EvWidget::EvWidget(X11FrameBuffer * x11fb)
|
||||
:QWidget(0), fb(x11fb)
|
||||
{
|
||||
#ifdef HAVE_XDAMAGE
|
||||
int er;
|
||||
XDamageQueryExtension(QX11Info::display(), &xdamageBaseEvent, &er);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool EvWidget::x11Event(XEvent * event)
|
||||
{
|
||||
#ifdef HAVE_XDAMAGE
|
||||
if (event->type == xdamageBaseEvent+XDamageNotify) {
|
||||
fb->handleXDamage(event);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
61
framebuffers/x11/x11framebuffer.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFER_H
|
||||
#define KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFER_H
|
||||
|
||||
#include <framebuffer.h>
|
||||
#include <QWidget>
|
||||
|
||||
class X11FrameBuffer;
|
||||
|
||||
class EvWidget: public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EvWidget(X11FrameBuffer *x11fb);
|
||||
|
||||
protected:
|
||||
bool x11Event ( XEvent * event );
|
||||
|
||||
private:
|
||||
X11FrameBuffer *fb;
|
||||
int xdamageBaseEvent;
|
||||
};
|
||||
|
||||
/**
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class X11FrameBuffer : public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
X11FrameBuffer(WId id, QObject* parent = 0);
|
||||
|
||||
~X11FrameBuffer();
|
||||
|
||||
virtual QList<QRect> modifiedTiles();
|
||||
virtual int depth();
|
||||
virtual int height();
|
||||
virtual int width();
|
||||
virtual int paddedWidth();
|
||||
virtual void getServerFormat(rfbPixelFormat& format);
|
||||
virtual void startMonitor();
|
||||
virtual void stopMonitor();
|
||||
|
||||
|
||||
void handleXDamage( XEvent *event);
|
||||
private:
|
||||
void cleanupRects();
|
||||
void acquireEvents();
|
||||
|
||||
class P;
|
||||
P * const d;
|
||||
};
|
||||
|
||||
#endif
|
||||
47
framebuffers/x11/x11framebufferplugin.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/* 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 "x11framebufferplugin.h"
|
||||
|
||||
#include "x11framebuffer.h"
|
||||
|
||||
#include <KGenericFactory>
|
||||
|
||||
|
||||
X11FrameBufferPlugin::X11FrameBufferPlugin(QObject *parent, const QVariantList &args)
|
||||
: FrameBufferPlugin(parent, args)
|
||||
{
|
||||
}
|
||||
|
||||
X11FrameBufferPlugin::~X11FrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer *X11FrameBufferPlugin::frameBuffer(WId id)
|
||||
{
|
||||
return new X11FrameBuffer(id);
|
||||
}
|
||||
|
||||
K_PLUGIN_FACTORY(factory, registerPlugin<X11FrameBufferPlugin>();) \
|
||||
K_EXPORT_PLUGIN(factory("krfb_framebuffer_x11"))
|
||||
|
||||
|
||||
#include "x11framebufferplugin.moc"
|
||||
|
||||
48
framebuffers/x11/x11framebufferplugin.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
|
||||
@author George Goldberg <george.goldberg@collabora.co.uk>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFERPLUGIN_H
|
||||
#define KRFB_FRAMEBUFFER_X11_X11FRAMEBUFFERPLUGIN_H
|
||||
|
||||
#include "framebufferplugin.h"
|
||||
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
class FrameBuffer;
|
||||
|
||||
class X11FrameBufferPlugin : public FrameBufferPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
X11FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~X11FrameBufferPlugin();
|
||||
|
||||
virtual FrameBuffer *frameBuffer(WId id);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(X11FrameBufferPlugin)
|
||||
};
|
||||
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
@@ -13,18 +13,11 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "invitation.h"
|
||||
#include <krandom.h>
|
||||
/*
|
||||
* Function for (en/de)crypting strings for config file, taken from KMail
|
||||
* Author: Stefan Taferner <taferner@alpin.or.at>
|
||||
*/
|
||||
QString cryptStr(const QString &aStr) {
|
||||
QString result;
|
||||
for ( int i = 0; i < aStr.length(); i++)
|
||||
result += (aStr[i].unicode() < 0x20) ? aStr[i] :
|
||||
QChar(0x1001F - aStr[i].unicode());
|
||||
return result;
|
||||
}
|
||||
|
||||
#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()
|
||||
@@ -34,12 +27,12 @@ static QString readableRandomString(int length) {
|
||||
{
|
||||
int r = KRandom::random() % 62;
|
||||
r += 48;
|
||||
if (r > 57)
|
||||
if (r > 57)
|
||||
r += 7;
|
||||
if (r > 90)
|
||||
if (r > 90)
|
||||
r += 6;
|
||||
char c = char(r);
|
||||
if ((c == 'i') ||
|
||||
if ((c == 'i') ||
|
||||
(c == 'I') ||
|
||||
(c == '1') ||
|
||||
(c == 'o') ||
|
||||
@@ -52,46 +45,40 @@ static QString readableRandomString(int length) {
|
||||
return str;
|
||||
}
|
||||
|
||||
Invitation::Invitation() :
|
||||
m_viewItem(0) {
|
||||
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),
|
||||
m_viewItem(0) {
|
||||
Invitation::Invitation(const Invitation &x)
|
||||
: m_password(x.m_password), m_creationTime(x.m_creationTime), m_expirationTime(x.m_expirationTime)
|
||||
{
|
||||
}
|
||||
|
||||
Invitation::Invitation(KConfig* config, int num) {
|
||||
m_password = cryptStr(config->readEntry(QString("password%1").arg(num), QString()));
|
||||
m_creationTime = config->readDateTimeEntry(QString("creation%1").arg(num));
|
||||
m_expirationTime = config->readDateTimeEntry(QString("expiration%1").arg(num));
|
||||
m_viewItem = 0;
|
||||
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() {
|
||||
if (m_viewItem)
|
||||
delete m_viewItem;
|
||||
}
|
||||
|
||||
Invitation &Invitation::operator= (const Invitation&x) {
|
||||
m_password = x.m_password;
|
||||
m_creationTime = x.m_creationTime;
|
||||
m_expirationTime = x.m_expirationTime;
|
||||
if (m_viewItem)
|
||||
delete m_viewItem;
|
||||
m_viewItem = 0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Invitation::save(KConfig *config, int num) const {
|
||||
config->writeEntry(QString("password%1").arg(num), cryptStr(m_password));
|
||||
config->writeEntry(QString("creation%1").arg(num), m_creationTime);
|
||||
config->writeEntry(QString("expiration%1").arg(num), m_expirationTime);
|
||||
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 {
|
||||
@@ -110,12 +97,7 @@ bool Invitation::isValid() const {
|
||||
return m_expirationTime > QDateTime::currentDateTime();
|
||||
}
|
||||
|
||||
void Invitation::setViewItem(K3ListViewItem *i) {
|
||||
if (m_viewItem)
|
||||
delete m_viewItem;
|
||||
m_viewItem = i;
|
||||
}
|
||||
|
||||
K3ListViewItem *Invitation::getViewItem() const{
|
||||
return m_viewItem;
|
||||
bool Invitation::operator ==(const Invitation & ot)
|
||||
{
|
||||
return m_creationTime == ot.m_creationTime && m_password == ot.m_password;
|
||||
}
|
||||
@@ -18,40 +18,36 @@
|
||||
#ifndef INVITATION_H
|
||||
#define INVITATION_H
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <k3listview.h>
|
||||
#include <kconfig.h>
|
||||
#include <qobject.h>
|
||||
#include <qstring.h>
|
||||
#include <qdatetime.h>
|
||||
#include <KApplication>
|
||||
#include <KConfig>
|
||||
#include <QObject>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
|
||||
const int INVITATION_DURATION = 60*60;
|
||||
|
||||
QString cryptStr(const QString &aStr);
|
||||
|
||||
class Invitation {
|
||||
public:
|
||||
Invitation();
|
||||
~Invitation();
|
||||
Invitation(KConfig* config, int num);
|
||||
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 setViewItem(K3ListViewItem*);
|
||||
K3ListViewItem* getViewItem() const;
|
||||
void save(KConfig *config, int num) const;
|
||||
void save(KConfigGroup &config) const;
|
||||
private:
|
||||
QString m_password;
|
||||
QDateTime m_creationTime;
|
||||
QDateTime m_expirationTime;
|
||||
|
||||
K3ListViewItem *m_viewItem;
|
||||
};
|
||||
|
||||
#endif
|
||||
123
invitationmanager.cpp
Normal file
@@ -0,0 +1,123 @@
|
||||
/* 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 <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());
|
||||
}
|
||||
58
invitationmanager.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/* 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 <QObject>
|
||||
#include <QList>
|
||||
#include "invitation.h"
|
||||
|
||||
|
||||
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,36 +18,42 @@
|
||||
*/
|
||||
|
||||
#include "invitedialog.h"
|
||||
#include "invitewidget.h"
|
||||
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
#include <KStandardGuiItem>
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QToolTip>
|
||||
#include <QtGui/QCursor>
|
||||
|
||||
InviteDialog::InviteDialog( QWidget *parent )
|
||||
: KDialog( parent )
|
||||
{
|
||||
setCaption(i18n("Invitation"));
|
||||
setButtons(User1|Close|Help);
|
||||
setHelp(QString(), "krfb");
|
||||
setDefaultButton(NoDefault);
|
||||
setModal(true);
|
||||
|
||||
m_inviteWidget = new InviteWidget( this, "InviteWidget" );
|
||||
m_inviteWidget->pixmapLabel->setPixmap(
|
||||
UserIcon( "connection-side-image.png" ) );
|
||||
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( m_inviteWidget->btnCreateInvite, SIGNAL( clicked() ),
|
||||
connect( btnCreateInvite, SIGNAL( clicked() ),
|
||||
SIGNAL( createInviteClicked() ) );
|
||||
connect( m_inviteWidget->btnEmailInvite, SIGNAL( clicked() ),
|
||||
connect( btnEmailInvite, SIGNAL( clicked() ),
|
||||
SIGNAL( emailInviteClicked() ) );
|
||||
connect( m_inviteWidget->btnManageInvite, SIGNAL( clicked() ),
|
||||
connect( btnManageInvite, SIGNAL( clicked() ),
|
||||
SIGNAL( manageInviteClicked() ) );
|
||||
connect( helpLabel, SIGNAL( linkActivated ( QString ) ),
|
||||
SLOT( showWhatsthis() ));
|
||||
}
|
||||
|
||||
void InviteDialog::slotUser1()
|
||||
@@ -57,13 +63,25 @@ void InviteDialog::slotUser1()
|
||||
|
||||
void InviteDialog::enableInviteButton( bool enable )
|
||||
{
|
||||
m_inviteWidget->btnCreateInvite->setEnabled( enable );
|
||||
btnCreateInvite->setEnabled( enable );
|
||||
}
|
||||
|
||||
void InviteDialog::setInviteCount( int count )
|
||||
{
|
||||
m_inviteWidget->btnManageInvite->setText(
|
||||
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"
|
||||
@@ -20,11 +20,13 @@
|
||||
#ifndef INVITEDIALOG_H
|
||||
#define INVITEDIALOG_H
|
||||
|
||||
class InviteWidget;
|
||||
#include "ui_invitewidget.h"
|
||||
|
||||
#include <KDialog>
|
||||
|
||||
class InviteDialog : public KDialog
|
||||
class QWidget;
|
||||
|
||||
class InviteDialog : public KDialog, public Ui::InviteWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -34,8 +36,9 @@ class InviteDialog : public KDialog
|
||||
|
||||
void enableInviteButton( bool enable );
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setInviteCount( int count );
|
||||
void showWhatsthis();
|
||||
|
||||
signals:
|
||||
void createInviteClicked();
|
||||
@@ -43,11 +46,11 @@ class InviteDialog : public KDialog
|
||||
void manageInviteClicked();
|
||||
void configureClicked();
|
||||
|
||||
protected slots:
|
||||
protected Q_SLOTS:
|
||||
void slotUser1();
|
||||
|
||||
protected:
|
||||
InviteWidget *m_inviteWidget;
|
||||
QWidget *m_inviteWidget;
|
||||
};
|
||||
|
||||
#endif // INVITEDIALOG_H
|
||||
171
invitewidget.ui
Normal file
@@ -0,0 +1,171 @@
|
||||
<ui version="4.0" >
|
||||
<class>InviteWidget</class>
|
||||
<widget class="QWidget" name="InviteWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>603</width>
|
||||
<height>364</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="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>
|
||||
<widget class="QLabel" name="helpLabel" >
|
||||
<property name="text" >
|
||||
<string>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></string>
|
||||
</property>
|
||||
<property name="textFormat" >
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags" >
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>101</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>26</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCreateInvite" >
|
||||
<property name="toolTip" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Create a new invitation and display the connection data. Use this option if you want to invite somebody personally, for example, to give the connection data over the phone.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Create &Personal Invitation...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnEmailInvite" >
|
||||
<property name="whatsThis" >
|
||||
<string>This button will start your email application with a pre-configured text that explains to the recipient how to connect to your computer. </string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Invite via &Email...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnManageInvite" >
|
||||
<property name="text" >
|
||||
<string>&Manage Invitations (%1)...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>26</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -2,8 +2,6 @@ include_directories(${CMAKE_BINARY_DIR}/krfb/krfb/ ${CMAKE_SOURCE_DIR}/krfb/srvl
|
||||
|
||||
set(kcm_krfb_PART_SRCS kcm_krfb.cpp ${srvloc_SRCS} ${krfbconfig_SRCS})
|
||||
|
||||
kde4_automoc(${kcm_krfb_PART_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
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#! /bin/sh
|
||||
$XGETTEXT *.cpp *.h -o $podir/kcm_krfb.pot
|
||||
$XGETTEXT *.cpp -o $podir/kcm_krfb.pot
|
||||
|
||||
@@ -495,7 +495,6 @@ Most VNC clients use a display number instead of the actual port. This display n
|
||||
<tabstop>passwordInput</tabstop>
|
||||
<tabstop>portInput</tabstop>
|
||||
</tabstops>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KIntNumInput</class>
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <qlineedit.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qdatastream.h>
|
||||
#include <kapplication.h>
|
||||
#include <kdialog.h>
|
||||
#include <knuminput.h>
|
||||
#include <klocale.h>
|
||||
@@ -58,12 +57,12 @@ KcmKRfb::KcmKRfb(QWidget *p, const QStringList &) :
|
||||
|
||||
setButtons(Default|Apply|Default);
|
||||
|
||||
KAboutData* about = new KAboutData( "kcm_krfb", I18N_NOOP("Desktop Sharing Control Module"),
|
||||
KAboutData* about = new KAboutData( "kcm_krfb", 0, ki18n("Desktop Sharing Control Module"),
|
||||
VERSION,
|
||||
I18N_NOOP("Configure desktop sharing"), KAboutData::License_GPL,
|
||||
"(c) 2002, Tim Jansen\n",
|
||||
0, "http://www.tjansen.de/krfb", "tim@tjansen.de");
|
||||
about->addAuthor("Tim Jansen", 0, "tim@tjansen.de");
|
||||
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();
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qdatetime.h>
|
||||
#define KDE3_SUPPORT
|
||||
#include <kcmodule.h>
|
||||
#undef KDE3_SUPPORT
|
||||
#include "configurationwidget.h"
|
||||
#include "../krfb/configuration.h"
|
||||
|
||||
|
||||
@@ -1,28 +1,196 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Icon=krfb
|
||||
Exec=kcmshell kcmkrfb
|
||||
Exec=kcmshell4 kcmkrfb
|
||||
Type=Service
|
||||
DocPath=krfb/krfb-configuration.html
|
||||
ServiceTypes=KCModule
|
||||
X-DocPath=krfb/krfb-configuration.html
|
||||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
|
||||
X-KDE-Library=krfb
|
||||
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[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[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 Desktop
|
||||
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[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[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[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]=Configurar compartilhamento do Desktop
|
||||
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[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
|
||||
Keywords=desktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvited
|
||||
Keywords[el]=κοινή χρήση επιφάνειας εργασίας,krfb,vnc,κοινή χρήση,krdc,σύνδεση σε απομακρυσμένη επιφάνεια εργασίας,πρόσκληση,θύρα,slp,απρόσκλητο
|
||||
Keywords[fr]=partage de bureau,krfb,vnc,partage,rdp,krdc,connexion à un bureau distant,invitation,port,slp,non invité
|
||||
Keywords[x-test]=xxdesktop sharing,krfb,vnc,sharing,krdc,remote desktop connection,invitation,port,slp,uninvitedxx
|
||||
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;
|
||||
Categories=Qt;KDE;X-KDE-settings-network;Settings;
|
||||
|
||||
@@ -6,8 +6,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/krfb/srvloc )
|
||||
|
||||
set(kded_kinetd_PART_SRCS kinetd.cpp ${srvloc_SRCS})
|
||||
|
||||
kde4_automoc(${kded_kinetd_PART_SRCS})
|
||||
|
||||
message(STATUS "Port to krfb DBUS")
|
||||
# kde4_add_dcop_skels(kded_kinetd_PART_SRCS kinetd.h )
|
||||
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
#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) :
|
||||
@@ -222,7 +230,7 @@ void PortListener::accepted(KSocket *sock) {
|
||||
|
||||
m_process.clearArguments();
|
||||
m_process << m_execPath << m_argument << QString::number(sock->socket());
|
||||
if (!m_process.start(KProcess::DontCare)) {
|
||||
if (!m_process.start(K3Process::DontCare)) {
|
||||
KNotification::event("ProcessFailed",
|
||||
i18n("Call \"%1 %2 %3\" failed", m_execPath,
|
||||
m_argument,
|
||||
@@ -255,11 +263,11 @@ QStringList PortListener::processServiceTemplate(const QString &a) {
|
||||
QString hostName = address->nodeName();
|
||||
KUser u;
|
||||
QString x = a; // replace does not work in const QString. Why??
|
||||
l.append(x.replace(QRegExp("%h"), KServiceRegistry::encodeAttributeValue(hostName))
|
||||
.replace(QRegExp("%p"), QString::number(m_port))
|
||||
.replace(QRegExp("%u"), KServiceRegistry::encodeAttributeValue(u.loginName()))
|
||||
.replace(QRegExp("%i"), KServiceRegistry::encodeAttributeValue(m_uuid))
|
||||
.replace(QRegExp("%f"), KServiceRegistry::encodeAttributeValue(u.fullName())));
|
||||
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;
|
||||
}
|
||||
@@ -350,7 +358,7 @@ void PortListener::setServiceRegistrationEnabledInternal(bool e) {
|
||||
*(it++),
|
||||
*(it2++),
|
||||
m_serviceLifetime))
|
||||
kDebug(7021) << "Failure registering SLP service (no slpd running?)"<< endl;
|
||||
kDebug(7021) << "Failure registering SLP service (no slpd running?)";
|
||||
}
|
||||
m_serviceRegistered = true;
|
||||
// make lifetime 30s shorter, because the timeout is not precise
|
||||
@@ -408,13 +416,13 @@ PortListener::~PortListener() {
|
||||
}
|
||||
|
||||
|
||||
KInetD::KInetD() :
|
||||
KDEDModule()
|
||||
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"<< endl;
|
||||
kDebug(7021) << "SLP not available";
|
||||
delete m_srvreg;
|
||||
m_srvreg = 0;
|
||||
}
|
||||
@@ -645,12 +653,3 @@ KInetD::~KInetD() {
|
||||
delete m_config;
|
||||
delete m_srvreg;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
KDE_EXPORT KDEDModule *create_kinetd()
|
||||
{
|
||||
KGlobal::locale()->insertCatalog("kinetd");
|
||||
return new KInetD();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,148 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Service
|
||||
|
||||
ServiceTypes=KDEDModule
|
||||
X-KDE-ServiceTypes=KDEDModule
|
||||
X-KDE-ModuleType=Library
|
||||
X-KDE-Library=kinetd
|
||||
X-KDE-FactoryName=kinetd
|
||||
X-KDE-Kded-autoload=true
|
||||
|
||||
Name=KDE Internet Daemon
|
||||
Name[af]=Kde Internet Bediener
|
||||
Name[ar]=كيدي إنترنت مراقب
|
||||
Name[ast]=Degorriu d'Internet de KDE
|
||||
Name[bg]=Интернет демон
|
||||
Name[bn]=কে-ডি-ই ইন্টারনেট ডিমন
|
||||
Name[br]=Diaoul kenrouedad KDE
|
||||
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[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[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[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[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[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[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 伺服程式
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <kdedmodule.h>
|
||||
#include <kservice.h>
|
||||
#include <kprocess.h>
|
||||
#include <k3process.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qstring.h>
|
||||
#include <qdatetime.h>
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
QString m_uuid;
|
||||
|
||||
KNetwork::KServerSocket *m_socket;
|
||||
KProcess m_process;
|
||||
K3Process m_process;
|
||||
|
||||
KConfig *m_config;
|
||||
KServiceRegistry *m_srvreg;
|
||||
@@ -140,8 +140,8 @@ public slots:
|
||||
* @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.
|
||||
* @return true if a port could be found or service is disabled, false
|
||||
* otherwise.
|
||||
*/
|
||||
bool setPort(QString service, int port = -1, int autoPortRange = 1);
|
||||
|
||||
@@ -189,7 +189,7 @@ public slots:
|
||||
void reregistrationTimer();
|
||||
|
||||
public:
|
||||
KInetD();
|
||||
KInetD(QObject* parent, const QList<QVariant>&);
|
||||
virtual ~KInetD();
|
||||
void loadServiceList();
|
||||
PortListener *getListenerByName(QString name);
|
||||
|
||||
@@ -1,26 +1,315 @@
|
||||
[Global]
|
||||
IconName=kinetd
|
||||
Comment=KInetD
|
||||
Comment[ar]=KInetD
|
||||
Comment[ast]=KInetD
|
||||
Comment[bn]=কে-আইনেট-ডি
|
||||
Comment[br]=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[is]=KInetD
|
||||
Comment[it]=KInetD
|
||||
Comment[ja]=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[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[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[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[is]=IncomingConnection
|
||||
Name[it]=Connessioni in entrata
|
||||
Name[ja]=外部からの接続
|
||||
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[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[el]=Λήψη εισερχόμενης σύνδεσης
|
||||
Comment[af]=Ontvang inkomende verbinding
|
||||
Comment[ar]=تلقي اتصال وارد
|
||||
Comment[ast]=Recibida conexón entrante
|
||||
Comment[bn]=অন্তর্মুখী সংযোগ গ্রহণ করল
|
||||
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[is]=Tók á móti uppkalli
|
||||
Comment[it]=Ricevuta connessione in entrata
|
||||
Comment[ja]=外部からの接続がありました
|
||||
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[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[el]=Η επεξεργασία απέτυχε
|
||||
Name[ar]=فشلت العملية
|
||||
Name[ast]=Procesu fallíu
|
||||
Name[bn]=প্রসেস ব্যর্থ
|
||||
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[is]=ProcessFailed
|
||||
Name[it]=Processo non riuscito
|
||||
Name[ja]=プロセス失敗
|
||||
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[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[el]=Δεν ήταν δυνατή η κλήση της διεργασίας για τον έλεγχο της σύνδεσης
|
||||
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[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[is]=Gat ekki kallað á forrit til að höndla tengingu
|
||||
Comment[it]=Impossibile richiamare il processo per gestire la connessione
|
||||
Comment[ja]=接続を扱うプロセスを呼び出せません
|
||||
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[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
|
||||
|
||||
@@ -4,9 +4,73 @@
|
||||
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[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[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]=KDED 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]
|
||||
|
||||
42
krfb-framebuffer.desktop
Normal file
@@ -0,0 +1,42 @@
|
||||
[Desktop Entry]
|
||||
Type=ServiceType
|
||||
X-KDE-ServiceType=krfb/framebuffer
|
||||
|
||||
Comment=Frame Buffer plugins for KRfb
|
||||
Comment[ast]=Complementu de buffer pa KRfb
|
||||
Comment[ca]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[ca@valencia]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[da]=Framebuffer-plugins til KRfb
|
||||
Comment[de]=Framebuffer-Module für KRfb
|
||||
Comment[en_GB]=Frame Buffer plugins for KRfb
|
||||
Comment[es]=Complemento de buffer para KRfb
|
||||
Comment[et]=KRfb kaadripuhvri plugin
|
||||
Comment[fi]=Kehyspuskuriliitännäinen kohteelle KRfb
|
||||
Comment[fr]=Modules de sortie vidéo pour KRfb
|
||||
Comment[gl]=Engadido de frame buffer para KRfb
|
||||
Comment[hr]=Priključci za međuspremnike okvira za KRfb
|
||||
Comment[hu]=Keretpuffer-modulok a KRfb-hez
|
||||
Comment[it]=Estensioni del framebuffer per KRfb
|
||||
Comment[km]=កម្មវិធីជំនួយ Frame Buffer សម្រាប់ KRfb
|
||||
Comment[ko]=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[pt]='Plugins' de 'framebuffers' para o KRfb
|
||||
Comment[pt_BR]=Plug-ins de framebuffers para o KRfb
|
||||
Comment[ru]=Модуль буфера кадров для KRfb
|
||||
Comment[sk]=Frame Buffer modul pre KRfb
|
||||
Comment[sl]=Vstavki slikovnih medpomnilnikov za KRFB
|
||||
Comment[sr]=Прикључци кадробафера за КРФБ
|
||||
Comment[sr@ijekavian]=Прикључци кадробафера за КРФБ
|
||||
Comment[sr@ijekavianlatin]=Priključci kadrobafera za KRFB
|
||||
Comment[sr@latin]=Priključci kadrobafera za KRFB
|
||||
Comment[sv]=Insticksprogram med rambuffert för Krfb
|
||||
Comment[tr]=KRfb için Çerçeve Tamponu eklentileri
|
||||
Comment[uk]=Додатки буфера кадрів для KRfb
|
||||
Comment[x-test]=xxFrame Buffer plugins for KRfbxx
|
||||
Comment[zh_CN]=KRfb 帧缓冲插件
|
||||
Comment[zh_TW]=KRfb 的 Frame Buffer 外掛程式
|
||||
134
krfb.desktop
Normal file
@@ -0,0 +1,134 @@
|
||||
# KDE Config File
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=krfb -caption "%c" %i
|
||||
Icon=krfb
|
||||
X-DocPath=krfb/index.html
|
||||
Terminal=false
|
||||
Name=Krfb
|
||||
Name[ar]=Krfb
|
||||
Name[ast]=Krfb
|
||||
Name[bg]=Krfb
|
||||
Name[bn]=কে-আর-এফ-বি
|
||||
Name[br]=Krfb
|
||||
Name[ca]=Krfb
|
||||
Name[ca@valencia]=Krfb
|
||||
Name[cs]=Krfb
|
||||
Name[da]=Krfb
|
||||
Name[de]=Krfb
|
||||
Name[el]=Krfb
|
||||
Name[en_GB]=Krfb
|
||||
Name[eo]=Krfb
|
||||
Name[es]=Krfb
|
||||
Name[et]=Krfb
|
||||
Name[eu]=Krfb
|
||||
Name[fi]=Krfb
|
||||
Name[fr]=Krfb
|
||||
Name[ga]=Krfb
|
||||
Name[gl]=Krfb
|
||||
Name[he]=Krfb
|
||||
Name[hi]=केआरएफबी
|
||||
Name[hne]=केआरएफबी
|
||||
Name[hr]=Krfb
|
||||
Name[hu]=Krfb
|
||||
Name[is]=Krfb
|
||||
Name[it]=Krfb
|
||||
Name[ja]=Krfb
|
||||
Name[kk]=Krfb
|
||||
Name[km]=Krfb
|
||||
Name[ko]=Krfb
|
||||
Name[lt]=Krfb
|
||||
Name[lv]=Krfb
|
||||
Name[ml]=കെആര്എഫ്ബി
|
||||
Name[nb]=Krfb
|
||||
Name[nds]=KRfb
|
||||
Name[ne]=Krfb
|
||||
Name[nl]=Krfb
|
||||
Name[nn]=Krfb
|
||||
Name[pa]=Krfb
|
||||
Name[pl]=Krfb
|
||||
Name[pt]=Krfb
|
||||
Name[pt_BR]=Krfb
|
||||
Name[ro]=Krfb
|
||||
Name[ru]=Krfb
|
||||
Name[sk]=Krfb
|
||||
Name[sl]=Krfb
|
||||
Name[sr]=КРФБ
|
||||
Name[sr@ijekavian]=КРФБ
|
||||
Name[sr@ijekavianlatin]=KRFB
|
||||
Name[sr@latin]=KRFB
|
||||
Name[sv]=Krfb
|
||||
Name[tr]=Krfb
|
||||
Name[uk]=Krfb
|
||||
Name[uz]=Krfb
|
||||
Name[uz@cyrillic]=Krfb
|
||||
Name[vi]=Krfb
|
||||
Name[x-test]=xxKrfbxx
|
||||
Name[zh_CN]=Krfb
|
||||
Name[zh_HK]=Krfb
|
||||
Name[zh_TW]=Krfb 桌面分享
|
||||
GenericName=Desktop Sharing
|
||||
GenericName[ar]=مشاركة سطح المكتب
|
||||
GenericName[ast]=Escritoriu compartíu
|
||||
GenericName[bg]=Споделяне на работното място
|
||||
GenericName[bn]=ডেস্কটপ ভাগাভাগি
|
||||
GenericName[br]=Rannañ ar vurev
|
||||
GenericName[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[de]=Arbeitsfläche freigeben
|
||||
GenericName[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
GenericName[en_GB]=Desktop Sharing
|
||||
GenericName[eo]=Tabula komunigado
|
||||
GenericName[es]=Escritorio compartido
|
||||
GenericName[et]=Töölaua jagamine
|
||||
GenericName[eu]=Mahaigaina partekatzea
|
||||
GenericName[fa]=اشتراک رومیزی
|
||||
GenericName[fi]=Työpöydän jakaminen
|
||||
GenericName[fr]=Partage de bureau
|
||||
GenericName[ga]=Roinnt Deisce
|
||||
GenericName[gl]=Compartimento de escritorio
|
||||
GenericName[he]=שיתוף שולחנות עבודה
|
||||
GenericName[hi]=डेस्कटॉप साझेदारी
|
||||
GenericName[hne]=डेस्कटाप साझेदारी
|
||||
GenericName[hr]=Dijeljenje radne površine
|
||||
GenericName[hu]=Munkaasztal-megosztás
|
||||
GenericName[is]=Skjáborðsmiðlun
|
||||
GenericName[it]=Condivisione del desktop
|
||||
GenericName[ja]=デスクトップ共有
|
||||
GenericName[kk]=Үстелді ортақтастыру
|
||||
GenericName[km]=ការចែករំលែកផ្ទៃតុ
|
||||
GenericName[ko]=데스크톱 공유
|
||||
GenericName[lt]=Dalinimasis darbastaliu
|
||||
GenericName[lv]=Darbvirsmas koplietošana
|
||||
GenericName[ml]=പണിയിടം പങ്കുവെക്കല്
|
||||
GenericName[nb]=Delte skrivebord
|
||||
GenericName[nds]=Schriefdisch-Freegaav
|
||||
GenericName[ne]=डेस्कटप साझेदारी
|
||||
GenericName[nl]=Bureaublad delen
|
||||
GenericName[nn]=Skrivebordsdeling
|
||||
GenericName[pa]=ਡੈਸਕਟਾਪ ਸ਼ੇਅਰਿੰਗ
|
||||
GenericName[pl]=Współdzielenie pulpitu
|
||||
GenericName[pt]=Partilha do Ecrã
|
||||
GenericName[pt_BR]=Compartilhamento de ambiente de trabalho
|
||||
GenericName[ro]=Partajare birou
|
||||
GenericName[ru]=Общий рабочий стол
|
||||
GenericName[sk]=Zdieľanie pracovnej plochy
|
||||
GenericName[sl]=Deljenje namizja
|
||||
GenericName[sr]=Дељење површи
|
||||
GenericName[sr@ijekavian]=Дијељење површи
|
||||
GenericName[sr@ijekavianlatin]=Dijeljenje površi
|
||||
GenericName[sr@latin]=Deljenje površi
|
||||
GenericName[sv]=Dela ut skrivbordet
|
||||
GenericName[tr]=Masaüstü Paylaşımı
|
||||
GenericName[uk]=Спільні стільниці
|
||||
GenericName[uz]=Ish stoli bilan boʻlishish
|
||||
GenericName[uz@cyrillic]=Иш столи билан бўлишиш
|
||||
GenericName[vi]=Chia sẻ màn hình nền
|
||||
GenericName[x-test]=xxDesktop Sharingxx
|
||||
GenericName[zh_CN]=桌面共享
|
||||
GenericName[zh_HK]=桌面分享
|
||||
GenericName[zh_TW]=桌面分享
|
||||
Categories=Qt;KDE;System;Network;RemoteAccess;
|
||||
43
krfb.kcfg
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE kcfg SYSTEM
|
||||
"http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
|
||||
<kcfg>
|
||||
<kcfgfile />
|
||||
<group name="TCP">
|
||||
<entry name="useDefaultPort" type="Bool">
|
||||
<label>Use the default port for VNC (5900)</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="port" type="Int">
|
||||
<label>This is the port on which krfb will listen.</label>
|
||||
<default>5900</default>
|
||||
</entry>
|
||||
<entry name="publishService" type="Bool">
|
||||
<label>Announce the service on the local network</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
</group>
|
||||
<group name="Security">
|
||||
<entry name="allowDesktopControl" type="Bool">
|
||||
<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">
|
||||
<label>Allow connections without an invitation.</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="uninvitedConnectionPassword" type="String">
|
||||
<label>Password for uninvited connections.</label>
|
||||
</entry>
|
||||
</group>
|
||||
<group name="FrameBuffer">
|
||||
<entry name="preferredFrameBufferPlugin" type="String">
|
||||
<label>Preferred Frame Buffer Plugin</label>
|
||||
<default>krfb_framebuffer_x11</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
1129
krfb.notifyrc
Normal file
@@ -1,37 +0,0 @@
|
||||
project(krfb)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/krfb/libvncserver ${CMAKE_SOURCE_DIR}/krfb/srvloc)
|
||||
|
||||
|
||||
set(krfb_SRCS ${vncserver_SRCS} ${srvloc_SRCS} ${krfbconfig_SRCS}
|
||||
rfbcontroller.cc
|
||||
xupdatescanner.cc
|
||||
main.cpp
|
||||
krfbifaceimpl.cc
|
||||
trayicon.cpp
|
||||
connectiondialog.cc)
|
||||
|
||||
qt4_add_dbus_adaptor(krfb_SRCS org.kde.krfb.xml krfbifaceimpl.h KRfbIfaceImpl)
|
||||
|
||||
kde4_automoc(${krfb_SRCS})
|
||||
|
||||
kde4_add_ui3_files(krfb_SRCS connectionwidget.ui
|
||||
manageinvitations.ui
|
||||
personalinvitewidget.ui
|
||||
invitewidget.ui)
|
||||
|
||||
kde4_add_executable(krfb ${krfb_SRCS})
|
||||
|
||||
target_link_libraries(krfb ${KDE4_KIO_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${JPEG_LIBRARIES} ${SLP_LIBRARIES})
|
||||
|
||||
install(TARGETS krfb DESTINATION ${BIN_INSTALL_DIR})
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(FILES krfb.desktop DESTINATION ${XDG_APPS_DIR})
|
||||
install(FILES krfb.notifyrc DESTINATION ${DATA_INSTALL_DIR}/krfb)
|
||||
install(FILES eyes-open24.png eyes-closed24.png connection-side-image.png DESTINATION ${DATA_INSTALL_DIR}/krfb/pics)
|
||||
install(FILES kinetd_krfb.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||
install(FILES org.kde.krfb.xml DESTINATION ${DBUS_INTERFACES_DIR} )
|
||||
kde4_install_icons(${ICON_INSTALL_DIR})
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#! /bin/sh
|
||||
$XGETTEXT rc.cpp *.cpp *.cc -o $podir/krfb.pot
|
||||
@@ -1,492 +0,0 @@
|
||||
/***************************************************************************
|
||||
configuration.cpp
|
||||
-------------------
|
||||
begin : Tue Dec 11 2001
|
||||
copyright : (C) 2001-2003 by Tim Jansen
|
||||
email : tim@tjansen.de
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "configuration.h"
|
||||
#include "kinetinterface.h"
|
||||
|
||||
#include <kglobal.h>
|
||||
#include <klocale.h>
|
||||
#include <kapplication.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kprocess.h>
|
||||
#include <ksocketaddress.h>
|
||||
#include <k3activelabel.h>
|
||||
#include <ktoolinvocation.h>
|
||||
|
||||
#include <qdatastream.h>
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qcheckbox.h>
|
||||
|
||||
#include <krun.h>
|
||||
|
||||
/**
|
||||
* Note that this class is used and provides GUI in every mode:
|
||||
* - for the invitation dialogs
|
||||
* - for the kcontrol module
|
||||
* - for the running krfb instance
|
||||
*/
|
||||
Configuration::Configuration(krfb_mode mode) :
|
||||
m_mode(mode),
|
||||
invMngDlg(0, 0, true),
|
||||
invDlg(0),
|
||||
persInvDlg(0),
|
||||
portNum(-1)
|
||||
#ifdef __GNUC__
|
||||
#warning "Port to DBUS"
|
||||
#endif
|
||||
#if 0
|
||||
kinetdRef("kded", "kinetd")
|
||||
#endif
|
||||
{
|
||||
#if 0
|
||||
kinetdRef.setDCOPClient(KApplication::dcopClient());
|
||||
loadFromKConfig();
|
||||
saveToDialogs();
|
||||
doKinetdConf();
|
||||
|
||||
connectDCOPSignal( 0, "KRFB::ConfigChanged", "KRFB_ConfigChanged()",
|
||||
"updateKConfig()", false );
|
||||
#endif
|
||||
connect(invMngDlg.newPersonalInvitationButton, SIGNAL(clicked()),
|
||||
SLOT(showPersonalInvitationDialog()));
|
||||
connect(invMngDlg.newEmailInvitationButton, SIGNAL(clicked()), SLOT(inviteEmail()));
|
||||
connect(invMngDlg.deleteOneButton, SIGNAL(clicked()), SLOT(invMngDlgDeleteOnePressed()));
|
||||
connect(invMngDlg.deleteAllButton, SIGNAL(clicked()), SLOT(invMngDlgDeleteAllPressed()));
|
||||
invMngDlg.listView->setSelectionMode(Q3ListView::Extended);
|
||||
invMngDlg.listView->setMinimumSize(QSize(400, 100)); // QTs size is much to small
|
||||
|
||||
connect(&invDlg, SIGNAL(createInviteClicked()),
|
||||
SLOT(showPersonalInvitationDialog()));
|
||||
connect(&invDlg, SIGNAL(emailInviteClicked()),
|
||||
SLOT(inviteEmail()));
|
||||
connect(&invDlg, SIGNAL(manageInviteClicked()),
|
||||
SLOT(showManageInvitationsDialog()));
|
||||
connect(&invDlg, SIGNAL(configureClicked()),
|
||||
SLOT(showConfigurationModule()));
|
||||
connect(this, SIGNAL(invitationNumChanged(int)),
|
||||
&invDlg, SLOT(setInviteCount(int)));
|
||||
connect(this, SIGNAL(invitationNumChanged(int)),
|
||||
&invMngDlg, SLOT(listSizeChanged(int)));
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
|
||||
connect(&refreshTimer, SIGNAL(timeout()), SLOT(refreshTimeout()));
|
||||
refreshTimer.start(1000*60);
|
||||
}
|
||||
|
||||
Configuration::~Configuration() {
|
||||
save();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void Configuration::updateKConfig()
|
||||
{
|
||||
loadFromKConfig();
|
||||
}
|
||||
#endif
|
||||
|
||||
void Configuration::setKInetdEnabled(bool enabled) {
|
||||
#if 0
|
||||
kinetdRef.send("setEnabled", QString("krfb"), enabled);
|
||||
kinetdRef.send("setEnabled", QString("krfb_httpd"), enabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Configuration::setKInetdEnabled(const QDateTime &date) {
|
||||
#if 0
|
||||
kinetdRef.send("setEnabled", QString("krfb"), date);
|
||||
kinetdRef.send("setEnabled", QString("krfb_httpd"), date);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Configuration::setKInetdServiceRegistrationEnabled(bool enabled) {
|
||||
#if 0
|
||||
kinetdRef.send("setServiceRegistrationEnabled",
|
||||
QString("krfb"), enabled);
|
||||
kinetdRef.send("setServiceRegistrationEnabled",
|
||||
QString("krfb_httpd"), enabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Configuration::getPortFromKInetd() {
|
||||
#if 0
|
||||
DCOPReply r = kinetdRef.call("port", QString("krfb"));
|
||||
if (!r.isValid())
|
||||
return; // nice error msg here?
|
||||
r.get(portNum);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Configuration::setKInetdPort(int p) {
|
||||
#if 0
|
||||
DCOPReply r = kinetdRef.call("setPort",
|
||||
QString("krfb"), p, 1);
|
||||
// nice error msg here?
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void Configuration::removeInvitation(QList<Invitation>::iterator it) {
|
||||
invitationList.remove(it);
|
||||
save();
|
||||
}
|
||||
|
||||
void Configuration::doKinetdConf() {
|
||||
setKInetdPort(preferredPortNum);
|
||||
|
||||
if (allowUninvitedFlag) {
|
||||
setKInetdEnabled(true);
|
||||
setKInetdServiceRegistrationEnabled(enableSLPFlag);
|
||||
getPortFromKInetd();
|
||||
return;
|
||||
}
|
||||
|
||||
QDateTime lastExpiration;
|
||||
QList<Invitation>::iterator it = invitationList.begin();
|
||||
while (it != invitationList.end()) {
|
||||
Invitation &ix = (*it);
|
||||
QDateTime t = ix.expirationTime();
|
||||
if (t > lastExpiration)
|
||||
lastExpiration = t;
|
||||
it++;
|
||||
}
|
||||
if (lastExpiration.isNull() || (lastExpiration < QDateTime::currentDateTime())) {
|
||||
setKInetdEnabled(false);
|
||||
portNum = -1;
|
||||
}
|
||||
else {
|
||||
setKInetdServiceRegistrationEnabled(false);
|
||||
setKInetdEnabled(lastExpiration);
|
||||
getPortFromKInetd();
|
||||
}
|
||||
}
|
||||
|
||||
void Configuration::loadFromKConfig() {
|
||||
|
||||
KConfig c("krfbrc");
|
||||
allowUninvitedFlag = c.readEntry("allowUninvited", false);
|
||||
enableSLPFlag = c.readEntry("enableSLP", true);
|
||||
askOnConnectFlag = c.readEntry("confirmUninvitedConnection", true);
|
||||
allowDesktopControlFlag = c.readEntry("allowDesktopControl", false);
|
||||
preferredPortNum = c.readEntry("preferredPort", -1);
|
||||
disableBackgroundFlag = c.readEntry("disableBackground", false);
|
||||
disableXShmFlag = c.readEntry("disableXShm", false);
|
||||
if (c.hasKey("uninvitedPasswordCrypted"))
|
||||
passwordString = cryptStr(c.readEntry("uninvitedPasswordCrypted", ""));
|
||||
else
|
||||
passwordString = c.readEntry("uninvitedPassword", "");
|
||||
|
||||
unsigned int invNum = invitationList.size();
|
||||
invitationList.clear();
|
||||
c.setGroup("invitations");
|
||||
int num = c.readEntry("invitation_num", 0);
|
||||
for (int i = 0; i < num; i++)
|
||||
invitationList.push_back(Invitation(&c, i));
|
||||
|
||||
invalidateOldInvitations();
|
||||
if (invNum != invitationList.size())
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
|
||||
}
|
||||
|
||||
void Configuration::saveToKConfig() {
|
||||
|
||||
KConfig c("krfbrc");
|
||||
c.writeEntry("confirmUninvitedConnection", askOnConnectFlag);
|
||||
c.writeEntry("allowDesktopControl", allowDesktopControlFlag);
|
||||
c.writeEntry("allowUninvited", allowUninvitedFlag);
|
||||
c.writeEntry("enableSLP", enableSLPFlag);
|
||||
c.writeEntry("preferredPort", preferredPortNum);
|
||||
c.writeEntry("disableBackground", disableBackgroundFlag);
|
||||
c.writeEntry("disableXShm", disableXShmFlag);
|
||||
c.writeEntry("uninvitedPasswordCrypted", cryptStr(passwordString));
|
||||
c.deleteEntry("uninvitedPassword");
|
||||
|
||||
c.setGroup("invitations");
|
||||
int num = invitationList.count();
|
||||
c.writeEntry("invitation_num", num);
|
||||
int i = 0;
|
||||
while (i < num) {
|
||||
invitationList[i].save(&c, i);
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Configuration::saveToDialogs() {
|
||||
invalidateOldInvitations();
|
||||
QList<Invitation>::iterator it = invitationList.begin();
|
||||
while (it != invitationList.end()) {
|
||||
Invitation &inv = *(it++);
|
||||
if (!inv.getViewItem())
|
||||
inv.setViewItem(new K3ListViewItem(invMngDlg.listView,
|
||||
inv.creationTime().toString(Qt::LocalDate),
|
||||
inv.expirationTime().toString(Qt::LocalDate)));
|
||||
}
|
||||
invMngDlg.adjustSize();
|
||||
}
|
||||
|
||||
void Configuration::save() {
|
||||
saveToKConfig();
|
||||
saveToDialogs();
|
||||
doKinetdConf();
|
||||
}
|
||||
|
||||
void Configuration::update() {
|
||||
loadFromKConfig();
|
||||
saveToDialogs();
|
||||
}
|
||||
|
||||
Invitation Configuration::createInvitation() {
|
||||
Invitation inv;
|
||||
invitationList.push_back(inv);
|
||||
return inv;
|
||||
}
|
||||
|
||||
void Configuration::invalidateOldInvitations() {
|
||||
QList<Invitation>::iterator it = invitationList.begin();
|
||||
while (it != invitationList.end()) {
|
||||
if (!(*it).isValid())
|
||||
it = invitationList.remove(it);
|
||||
else
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
void Configuration::refreshTimeout() {
|
||||
unsigned int invNum = invitationList.size();
|
||||
loadFromKConfig();
|
||||
saveToDialogs();
|
||||
if (invNum != invitationList.size())
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
}
|
||||
|
||||
QString Configuration::hostname() const
|
||||
{
|
||||
KNetwork::KInetSocketAddress *a = KInetInterface::getPublicInetAddress();
|
||||
QString hostName;
|
||||
if (a) {
|
||||
hostName = a->nodeName();
|
||||
delete a;
|
||||
}
|
||||
else
|
||||
hostName = "localhost";
|
||||
return hostName;
|
||||
}
|
||||
|
||||
///////// properties ///////////////////////////
|
||||
|
||||
krfb_mode Configuration::mode() const {
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
bool Configuration::askOnConnect() const {
|
||||
return askOnConnectFlag;
|
||||
}
|
||||
|
||||
bool Configuration::allowDesktopControl() const {
|
||||
return allowDesktopControlFlag;
|
||||
}
|
||||
|
||||
bool Configuration::allowUninvitedConnections() const {
|
||||
return allowUninvitedFlag;
|
||||
}
|
||||
|
||||
bool Configuration::enableSLP() const {
|
||||
return enableSLPFlag;
|
||||
}
|
||||
|
||||
QString Configuration::password() const {
|
||||
return passwordString;
|
||||
}
|
||||
|
||||
QList<Invitation> &Configuration::invitations() {
|
||||
return invitationList;
|
||||
}
|
||||
|
||||
bool Configuration::disableBackground() const {
|
||||
return disableBackgroundFlag;
|
||||
}
|
||||
|
||||
bool Configuration::disableXShm() const {
|
||||
return disableXShmFlag;
|
||||
}
|
||||
|
||||
void Configuration::setAllowUninvited(bool allowUninvited) {
|
||||
allowUninvitedFlag = allowUninvited;
|
||||
}
|
||||
|
||||
void Configuration::setEnableSLP(bool e) {
|
||||
enableSLPFlag = e;
|
||||
}
|
||||
|
||||
void Configuration::setAskOnConnect(bool askOnConnect)
|
||||
{
|
||||
askOnConnectFlag = askOnConnect;
|
||||
}
|
||||
|
||||
void Configuration::setAllowDesktopControl(bool allowDesktopControl)
|
||||
{
|
||||
allowDesktopControlFlag = allowDesktopControl;
|
||||
}
|
||||
|
||||
void Configuration::setPassword(QString password)
|
||||
{
|
||||
passwordString = password;
|
||||
}
|
||||
|
||||
int Configuration::port() const
|
||||
{
|
||||
if ((portNum < 5900) || (portNum >= 6000))
|
||||
return portNum;
|
||||
else
|
||||
return portNum - 5900;
|
||||
}
|
||||
|
||||
// use p=-1 for defaults
|
||||
void Configuration::setPreferredPort(int p)
|
||||
{
|
||||
preferredPortNum = p;
|
||||
}
|
||||
|
||||
int Configuration::preferredPort() const
|
||||
{
|
||||
return preferredPortNum;
|
||||
}
|
||||
|
||||
void Configuration::setDisableBackground(bool disable) {
|
||||
disableBackgroundFlag = disable;
|
||||
}
|
||||
|
||||
void Configuration::setDisableXShm(bool disable) {
|
||||
disableXShmFlag = disable;
|
||||
}
|
||||
|
||||
////////////// invitation manage dialog //////////////////////////
|
||||
|
||||
void Configuration::showManageInvitationsDialog() {
|
||||
loadFromKConfig();
|
||||
saveToDialogs();
|
||||
invMngDlg.exec();
|
||||
}
|
||||
|
||||
void Configuration::invMngDlgDeleteOnePressed() {
|
||||
QList<Invitation>::iterator it = invitationList.begin();
|
||||
while (it != invitationList.end()) {
|
||||
Invitation &ix = (*it);
|
||||
K3ListViewItem *iv = ix.getViewItem();
|
||||
if (iv && iv->isSelected())
|
||||
it = invitationList.remove(it);
|
||||
else
|
||||
it++;
|
||||
}
|
||||
saveToKConfig();
|
||||
doKinetdConf();
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
}
|
||||
|
||||
void Configuration::invMngDlgDeleteAllPressed() {
|
||||
invitationList.clear();
|
||||
saveToKConfig();
|
||||
doKinetdConf();
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
}
|
||||
|
||||
////////////// invitation dialog //////////////////////////
|
||||
|
||||
void Configuration::showInvitationDialog() {
|
||||
invDlg.exec();
|
||||
emit invitationFinished();
|
||||
saveToKConfig();
|
||||
}
|
||||
|
||||
////////////// personal invitation dialog //////////////////////////
|
||||
|
||||
void Configuration::showPersonalInvitationDialog() {
|
||||
loadFromKConfig();
|
||||
Invitation inv = createInvitation();
|
||||
save();
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
|
||||
invDlg.enableInviteButton(false);
|
||||
invMngDlg.newPersonalInvitationButton->setEnabled(false);
|
||||
|
||||
persInvDlg.setHost(hostname(), port());
|
||||
persInvDlg.setPassword(inv.password());
|
||||
persInvDlg.setExpiration(inv.expirationTime());
|
||||
|
||||
persInvDlg.exec();
|
||||
invDlg.enableInviteButton(true);
|
||||
invMngDlg.newPersonalInvitationButton->setEnabled(true);
|
||||
}
|
||||
|
||||
////////////// invite email //////////////////////////
|
||||
|
||||
void Configuration::inviteEmail() {
|
||||
int r = KMessageBox::warningContinueCancel(0,
|
||||
i18n("When sending an invitation by email, note that everybody who reads this email "
|
||||
"will be able to connect to your computer for one hour, or until the first "
|
||||
"successful connection took place, 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(),
|
||||
"showEmailInvitationWarning");
|
||||
if (r == KMessageBox::Cancel)
|
||||
return;
|
||||
|
||||
loadFromKConfig();
|
||||
Invitation inv = createInvitation();
|
||||
save();
|
||||
emit invitationNumChanged(invitationList.size());
|
||||
|
||||
KToolInvocation::invokeMailer(QString::null, QString::null, QString::null,
|
||||
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"
|
||||
"vnc://invitation:%1@%2:%3\n\n"
|
||||
"Otherwise you can use any VNC client with the following parameters:\n\n"
|
||||
"Host: %4:%5\n"
|
||||
"Password: %6\n\n"
|
||||
"Alternatively you can click on the link below to start the VNC session\n"
|
||||
"within your web browser.\n"
|
||||
"\n"
|
||||
" http://%7:%8/\n"
|
||||
"\n"
|
||||
"For security reasons this invitation will expire at %9.")
|
||||
.subs(inv.password())
|
||||
.subs(hostname())
|
||||
.subs(port())
|
||||
.subs(hostname())
|
||||
.subs(port())
|
||||
.subs(inv.password())
|
||||
.subs(hostname())
|
||||
.subs(5800) // determine with dcop ... later ...
|
||||
.subs(KGlobal::locale()->formatDateTime(inv.expirationTime()))
|
||||
.toString());
|
||||
}
|
||||
|
||||
////////////// invoke kcontrol module //////////////////////////
|
||||
|
||||
void Configuration::showConfigurationModule() {
|
||||
KRun::run( "kcmshell kcmkrfb", KUrl::List() );
|
||||
}
|
||||
|
||||
|
||||
#include "configuration.moc"
|
||||
@@ -1,139 +0,0 @@
|
||||
/***************************************************************************
|
||||
configuration.h
|
||||
-------------------
|
||||
begin : Tue Dec 11 2001
|
||||
copyright : (C) 2001-2003 by Tim Jansen
|
||||
email : tim@tjansen.de
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CONFIGURATION_H
|
||||
#define CONFIGURATION_H
|
||||
|
||||
#include "invitation.h"
|
||||
|
||||
#include "manageinvitations.h"
|
||||
#include "personalinvitedialog.h"
|
||||
#include "invitedialog.h"
|
||||
|
||||
#include <kconfig.h>
|
||||
#include <qtimer.h>
|
||||
#include <qobject.h>
|
||||
#include <qvalidator.h>
|
||||
#include <qstring.h>
|
||||
|
||||
enum krfb_mode {
|
||||
KRFB_UNKNOWN_MODE = 0,
|
||||
KRFB_KINETD_MODE,
|
||||
KRFB_INVITATION_MODE,
|
||||
KRFB_CONFIGURATION_MODE
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* This class stores the app's configuration, manages the
|
||||
* standalone-config-dialog and all the invitation dialogs
|
||||
* @author Tim Jansen
|
||||
*/
|
||||
class Configuration : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
Configuration(krfb_mode mode);
|
||||
virtual ~Configuration();
|
||||
|
||||
krfb_mode mode() const;
|
||||
bool askOnConnect() const;
|
||||
bool allowDesktopControl() const;
|
||||
bool allowUninvitedConnections() const;
|
||||
bool enableSLP() const;
|
||||
QString password() const;
|
||||
QString hostname() const;
|
||||
int port() const;
|
||||
int preferredPort() const;
|
||||
bool disableBackground() const;
|
||||
bool disableXShm() const;
|
||||
|
||||
void setAllowUninvited(bool allowUninvited);
|
||||
void setEnableSLP(bool e);
|
||||
void setAskOnConnect(bool askOnConnect);
|
||||
void setPassword(QString password);
|
||||
void setPreferredPort(int p);
|
||||
void setDisableBackground(bool disable);
|
||||
void setDisableXShm(bool disable);
|
||||
void save();
|
||||
void update();
|
||||
|
||||
QList<Invitation> &invitations();
|
||||
void removeInvitation(QList<Invitation>::iterator it);
|
||||
signals:
|
||||
void invitationFinished();
|
||||
void invitationNumChanged(int num);
|
||||
|
||||
public slots:
|
||||
void setAllowDesktopControl(bool allowDesktopControl);
|
||||
void showManageInvitationsDialog();
|
||||
void showInvitationDialog();
|
||||
void showPersonalInvitationDialog();
|
||||
void showConfigurationModule();
|
||||
void inviteEmail();
|
||||
|
||||
private:
|
||||
void loadFromKConfig();
|
||||
void loadFromDialogs();
|
||||
void saveToKConfig();
|
||||
void saveToDialogs();
|
||||
Invitation createInvitation();
|
||||
void closeInvDlg();
|
||||
void invalidateOldInvitations();
|
||||
void setKInetdEnabled(const QDateTime &date);
|
||||
void setKInetdEnabled(bool enabled);
|
||||
void setKInetdServiceRegistrationEnabled(bool enabled);
|
||||
void getPortFromKInetd();
|
||||
void setKInetdPort(int port);
|
||||
void doKinetdConf();
|
||||
|
||||
krfb_mode m_mode;
|
||||
|
||||
ManageInvitationsDialog invMngDlg;
|
||||
InviteDialog invDlg;
|
||||
PersonalInviteDialog persInvDlg;
|
||||
QTimer refreshTimer;
|
||||
|
||||
bool askOnConnectFlag;
|
||||
bool allowDesktopControlFlag;
|
||||
bool allowUninvitedFlag;
|
||||
bool enableSLPFlag;
|
||||
|
||||
int portNum, preferredPortNum;
|
||||
|
||||
#if 0
|
||||
DCOPRef kinetdRef;
|
||||
#endif
|
||||
|
||||
QString passwordString;
|
||||
QList<Invitation> invitationList;
|
||||
|
||||
bool disableBackgroundFlag;
|
||||
bool disableXShmFlag;
|
||||
|
||||
#if 0
|
||||
k_dcop:
|
||||
// Connected to the DCOP signal
|
||||
void updateKConfig();
|
||||
#endif
|
||||
private slots:
|
||||
void refreshTimeout();
|
||||
|
||||
void invMngDlgDeleteOnePressed();
|
||||
void invMngDlgDeleteAllPressed();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Before Width: | Height: | Size: 39 KiB |
@@ -1,211 +0,0 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>ConnectionWidget</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>NewConnectWidget</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>521</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLabel" row="0" column="1" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>TextLabel5</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>13</pointsize>
|
||||
<bold>1</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Attention</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="1" column="1" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>mainTextLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Somebody is requesting a connection to your computer. Granting this will allow the remote user to watch your desktop. </string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::AutoText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignVCenter|Qt::AlignLeft</set>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="wordwrap" stdset="0">
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="0" column="0" rowspan="6" colspan="1">
|
||||
<property name="name">
|
||||
<cstring>pixmapLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>108</width>
|
||||
<height>318</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>108</width>
|
||||
<height>318</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>WinPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="3" column="2">
|
||||
<property name="name">
|
||||
<cstring>remoteHost</cstring>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>1</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>123.234.123.234</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" row="5" column="1" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>cbAllowRemoteControl</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Allow remote user to &control keyboard and mouse</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>If you turn this option on, the remote user can enter keystrokes and use your mouse pointer. This gives them full control over your computer, so be careful. When the option is disabled the remote user can only watch your screen.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="3" column="1">
|
||||
<property name="name">
|
||||
<cstring>TextLabel1</cstring>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>1</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remote system:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer row="4" column="1">
|
||||
<property name="name">
|
||||
<cstring>spacer23</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>84</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<spacer row="2" column="1">
|
||||
<property name="name">
|
||||
<cstring>spacer22</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</grid>
|
||||
</widget>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
||||
|
Before Width: | Height: | Size: 919 B |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,197 +0,0 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>InviteWidget</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>InviteWidget</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>521</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string></string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLabel" row="0" column="1" rowspan="1" colspan="3">
|
||||
<property name="name">
|
||||
<cstring>TextLabel2</cstring>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>1</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Welcome to KDE Desktop Sharing</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="K3ActiveLabel" row="1" column="1" rowspan="1" colspan="3">
|
||||
<property name="name">
|
||||
<cstring>kActiveLabel1</cstring>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string>KDE Desktop Sharing allows you to invite somebody at a remote location to watch and possibly control your desktop.
|
||||
<a href="whatsthis:<p>An invitation creates a one-time password that allows the receiver to connect to your desktop. It is valid for only one successful connection and will expire after an hour if it has not been used. When somebody connects to your computer a dialog will appear and ask you for permission. The connection will not be established before you accept it. In this dialog you can also restrict the other person to view your desktop only, without the ability to move your mouse pointer or press keys.</p><p>If you want to create a permanent password for Desktop Sharing, allow 'Uninvited Connections' in the configuration.</p>">More about invitations...</a></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="0" column="0" rowspan="7" colspan="1">
|
||||
<property name="name">
|
||||
<cstring>pixmapLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>108</width>
|
||||
<height>318</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>108</width>
|
||||
<height>318</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>WinPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer row="4" column="3">
|
||||
<property name="name">
|
||||
<cstring>spacer4</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="QPushButton" row="3" column="2">
|
||||
<property name="name">
|
||||
<cstring>btnCreateInvite</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create &Personal Invitation...</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string></string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Create a new invitation and display the connection data. Use this option if you want to invite somebody personally, for example, to give the connection data over the phone.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer row="6" column="2">
|
||||
<property name="name">
|
||||
<cstring>spacer5</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<spacer row="4" column="1">
|
||||
<property name="name">
|
||||
<cstring>spacer3</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="QPushButton" row="5" column="2">
|
||||
<property name="name">
|
||||
<cstring>btnManageInvite</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Manage Invitations (%1)...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" row="4" column="2">
|
||||
<property name="name">
|
||||
<cstring>btnEmailInvite</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Invite via &Email...</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>This button will start your email application with a pre-configured text that explains to the recipient how to connect to your computer. </string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer row="2" column="2">
|
||||
<property name="name">
|
||||
<cstring>spacer2</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>89</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</grid>
|
||||
</widget>
|
||||
<signals>
|
||||
<signal>createInviteClicked()</signal>
|
||||
<signal>emailInviteClicked()</signal>
|
||||
<signal>manageInviteClicked()</signal>
|
||||
</signals>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
|
||||
</UI>
|
||||
@@ -1,28 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Service
|
||||
|
||||
ServiceTypes=KInetDModule
|
||||
Exec=krfb
|
||||
X-KDE-FactoryName=kinetd
|
||||
X-KDE-KINETD-id=krfb
|
||||
X-KDE-KINETD-port=5900
|
||||
X-KDE-KINETD-autoPortRange=100
|
||||
X-KDE-KINETD-enabled=false
|
||||
X-KDE-KINETD-argument=--kinetd
|
||||
X-KDE-KINETD-multiInstance=false
|
||||
X-KDE-KINETD-serviceURL=service:remotedesktop.kde:vnc://%h:%p;(type=shared),(username=%u),(fullname=%f),(serviceid=%i)
|
||||
X-KDE-KINETD-serviceAttributes=(type=shared),(username=%u),(fullname=%f),(serviceid=%i)
|
||||
X-KDE-KINETD-serviceLifetime=1200
|
||||
X-KDE-KINETD-DNSSD-Name=Remote Desktop of %u
|
||||
X-KDE-KINETD-DNSSD-Type=_rfb._tcp
|
||||
X-KDE-KINETD-DNSSD-Properties=type=shared,u=%u,fullname=%f
|
||||
|
||||
Name=KRfb Desktop Sharing
|
||||
Name[el]=Κοινή χρήση επιφάνειας εργασίας KRfb
|
||||
Name[fr]=Partage de bureau KRfb
|
||||
Name[x-test]=xxKRfb Desktop Sharingxx
|
||||
Comment=A daemon that allows you to share your desktop
|
||||
Comment[el]=Ένας δαίμονας που σας επιτρέπει να μοιραστείτε την επιφάνεια εργασίας σας
|
||||
Comment[fr]=Un démon qui vous permet de partager votre bureau
|
||||
Comment[x-test]=xxA daemon that allows you to share your desktopxx
|
||||
@@ -1,15 +0,0 @@
|
||||
# KDE Config File
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
Exec=krfb -caption "%c"
|
||||
Icon=krfb
|
||||
DocPath=krfb/index.html
|
||||
Terminal=false
|
||||
Name=Krfb
|
||||
Name[x-test]=xxKrfbxx
|
||||
GenericName=Desktop Sharing
|
||||
GenericName[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
GenericName[fr]=Partage de bureau
|
||||
GenericName[x-test]=xxDesktop Sharingxx
|
||||
Categories=Qt;KDE;System;
|
||||
@@ -1,106 +0,0 @@
|
||||
[Global]
|
||||
IconName=krfb
|
||||
Comment=Desktop Sharing
|
||||
Comment[el]=Κοινή χρήση επιφάνειας εργασίας
|
||||
Comment[fr]=Partage du bureau
|
||||
Comment[x-test]=xxDesktop Sharingxx
|
||||
|
||||
[Event/UserAcceptsConnection]
|
||||
Name=UserAcceptsConnection
|
||||
Name[el]=Ο χρήστης αποδέχεται σύνδεση
|
||||
Name[fr]=L'utilisateur accepte les connexions
|
||||
Name[x-test]=xxUserAcceptsConnectionxx
|
||||
Comment=User accepts connection
|
||||
Comment[el]=Ο χρήστης αποδέχεται σύνδεση
|
||||
Comment[fr]=l'utilisateur accepte les connexions
|
||||
Comment[x-test]=xxUser accepts connectionxx
|
||||
Action=None
|
||||
|
||||
[Event/UserRefusesConnection]
|
||||
Name=UserRefusesConnection
|
||||
Name[el]=Ο χρήστης απορρίπτει σύνδεση
|
||||
Name[fr]=L'utilisateur refuse les connexions
|
||||
Name[x-test]=xxUserRefusesConnectionxx
|
||||
Comment=User refuses connection
|
||||
Comment[el]=Ο χρήστης απορρίπτει σύνδεση
|
||||
Comment[fr]=L'utilisateur refuse les connexions
|
||||
Comment[x-test]=xxUser refuses connectionxx
|
||||
Action=None
|
||||
|
||||
[Event/ConnectionClosed]
|
||||
Name=ConnectionClosed
|
||||
Name[el]=Η σύνδεση έκλεισε
|
||||
Name[fr]=Connexion fermée
|
||||
Name[x-test]=xxConnectionClosedxx
|
||||
Comment=Connection closed
|
||||
Comment[el]=Η σύνδεση έκλεισε
|
||||
Comment[fr]=Connexion coupée
|
||||
Comment[x-test]=xxConnection closedxx
|
||||
Action=None
|
||||
|
||||
[Event/InvalidPassword]
|
||||
Name=InvalidPassword
|
||||
Name[el]=Μη έγκυρος κωδικός πρόσβασης
|
||||
Name[fr]=Mots de passe non valable
|
||||
Name[x-test]=xxInvalidPasswordxx
|
||||
Comment=Invalid password
|
||||
Comment[el]=Μη έγκυρος κωδικός πρόσβασης
|
||||
Comment[fr]=Mot de passe non valable
|
||||
Comment[x-test]=xxInvalid passwordxx
|
||||
Action=None
|
||||
|
||||
[Event/InvalidPasswordInvitations]
|
||||
Name=InvalidPasswordInvitations
|
||||
Name[el]=Μη έγκυρες προσκλήσεις κωδικού πρόσβασης
|
||||
Name[fr]=Invitations de mot de passe non valable
|
||||
Name[x-test]=xxInvalidPasswordInvitationsxx
|
||||
Comment=The invited party sent an invalid password. Connection refused.
|
||||
Comment[el]=Η πλευρά που προσκλήθηκε έστειλε μη έγκυρο κωδικό πρόσβασης. Η σύνδεση απορρίφθηκε.
|
||||
Comment[fr]=La partie invitée a envoyé un mot de passe non valable. Connexion refusée.
|
||||
Comment[x-test]=xxThe invited party sent an invalid password. Connection refused.xx
|
||||
Action=Popup
|
||||
|
||||
[Event/NewConnectionOnHold]
|
||||
Name=NewConnectionOnHold
|
||||
Name[el]=Νέα σύνδεση σε αναμονή
|
||||
Name[fr]=Nouvelle connexion au raccroché
|
||||
Name[x-test]=xxNewConnectionOnHoldxx
|
||||
Comment=Connection requested, user must accept
|
||||
Comment[el]=Αιτήθηκε σύνδεση, ο χρήστης πρέπει να αποδεχθεί
|
||||
Comment[fr]=Connexion demandée, l'utilisateur doit accepter
|
||||
Comment[x-test]=xxConnection requested, user must acceptxx
|
||||
Action=None
|
||||
|
||||
[Event/NewConnectionAutoAccepted]
|
||||
Name=NewConnectionAutoAccepted
|
||||
Name[el]=Αυτόματη αποδοχή νέας σύνδεσης
|
||||
Name[fr]=Nouvelle connexion auto-acceptée
|
||||
Name[x-test]=xxNewConnectionAutoAcceptedxx
|
||||
Comment=New connection automatically established
|
||||
Comment[el]=Νέα σύνδεση αυτόματα αποκαταστάθηκε
|
||||
Comment[fr]=Nouvelle connexion établie automatiquement
|
||||
Comment[x-test]=xxNew connection automatically establishedxx
|
||||
Action=None
|
||||
|
||||
[Event/TooManyConnections]
|
||||
Name=TooManyConnections
|
||||
Name[el]=Πάρα πολλές συνδέσεις
|
||||
Name[fr]=Trop de connexions
|
||||
Name[x-test]=xxTooManyConnectionsxx
|
||||
Comment=Busy, connection refused
|
||||
Comment[el]=Απασχολημένο, η σύνδεση απορρίφθηκε
|
||||
Comment[fr]=Occupé, connexion refusée
|
||||
Comment[x-test]=xxBusy, connection refusedxx
|
||||
Action=None
|
||||
default_logfile=
|
||||
|
||||
[Event/UnexpectedConnection]
|
||||
Name=UnexpectedConnection
|
||||
Name[el]=Μη αναμενόμενη σύνδεση
|
||||
Name[fr]=Connexion inattendue
|
||||
Name[x-test]=xxUnexpectedConnectionxx
|
||||
Comment=Received unexpected connection, abort
|
||||
Comment[el]=Λήψη μη αναμενόμενης σύνδεσης, εγκατάλειψη
|
||||
Comment[fr]=Reçu une connexion inattendue, interruption
|
||||
Comment[x-test]=xxReceived unexpected connection, abortxx
|
||||
Action=None
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
Copyright 2002 Tim Jansen <tim@tjansen.de>
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "krfbifaceimpl.h"
|
||||
#include <krfbadaptor.h>
|
||||
|
||||
KRfbIfaceImpl::KRfbIfaceImpl(RFBController *c) :
|
||||
controller(c)
|
||||
{
|
||||
(void)new KrfbAdaptor(this);
|
||||
QDBusConnection::sessionBus().registerObject("/Krfb",this);
|
||||
}
|
||||
|
||||
void KRfbIfaceImpl::exit()
|
||||
{
|
||||
emit exitApp();
|
||||
}
|
||||
void KRfbIfaceImpl::setAllowDesktopControl(bool b)
|
||||
{
|
||||
controller->enableDesktopControl(b);
|
||||
}
|
||||
|
||||
#include "krfbifaceimpl.moc"
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
Copyright 2002 Tim Jansen <tim@tjansen.de>
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __KRFB_IFACE_IMPL_H
|
||||
#define __KRFB_IFACE_IMPL_H
|
||||
|
||||
#include <qobject.h>
|
||||
#include "rfbcontroller.h"
|
||||
|
||||
class KRfbIfaceImpl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
RFBController *controller;
|
||||
public:
|
||||
KRfbIfaceImpl(RFBController *c);
|
||||
signals:
|
||||
void exitApp();
|
||||
|
||||
public:
|
||||
void exit();
|
||||
void setAllowDesktopControl(bool);
|
||||
};
|
||||
#endif
|
||||
|
Before Width: | Height: | Size: 302 B |
|
Before Width: | Height: | Size: 485 B |
198
krfb/main.cpp
@@ -1,198 +0,0 @@
|
||||
/***************************************************************************
|
||||
main.cpp
|
||||
-------------------
|
||||
begin : Sat Dec 8 03:23:02 CET 2001
|
||||
copyright : (C) 2001-2003 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 "trayicon.h"
|
||||
#include "configuration.h"
|
||||
#ifdef __GNUC__
|
||||
#warning "Port to DBUS"
|
||||
#endif
|
||||
#include "krfbifaceimpl.h"
|
||||
#include "rfbcontroller.h"
|
||||
|
||||
#include <QPixmap>
|
||||
#include <kaction.h>
|
||||
#include <kdebug.h>
|
||||
#include <kapplication.h>
|
||||
#include <KNotification>
|
||||
#include <ksystemtrayicon.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kaboutapplicationdialog.h>
|
||||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <qobject.h>
|
||||
#include <qwindowdefs.h>
|
||||
#include <q3cstring.h>
|
||||
#include <qdatastream.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define VERSION "1.0"
|
||||
|
||||
static const char description[] = I18N_NOOP("VNC-compatible server to share "
|
||||
"KDE desktops");
|
||||
#define ARG_KINETD "kinetd"
|
||||
|
||||
|
||||
static KCmdLineOptions options[] =
|
||||
{
|
||||
{ ARG_KINETD " ", I18N_NOOP("Used for calling from kinetd"), 0},
|
||||
KCmdLineLastOption
|
||||
};
|
||||
|
||||
void checkKInetd(bool &kinetdAvailable, bool &krfbAvailable) {
|
||||
#if 0
|
||||
DCOPRef ref("kded", "kinetd");
|
||||
ref.setDCOPClient(KApplication::dcopClient());
|
||||
|
||||
DCOPReply r = ref.call("isInstalled", QString("krfb"));
|
||||
if (!r.isValid()) {
|
||||
kinetdAvailable = false;
|
||||
krfbAvailable = false;
|
||||
return;
|
||||
}
|
||||
|
||||
r.get(krfbAvailable);
|
||||
kinetdAvailable = true;
|
||||
#endif
|
||||
kinetdAvailable = false;
|
||||
krfbAvailable = false;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
KAboutData aboutData( "krfb", I18N_NOOP("Desktop Sharing"),
|
||||
VERSION, description, KAboutData::License_GPL,
|
||||
"(c) 2001-2003, Tim Jansen\n"
|
||||
"(c) 2001, Johannes E. Schindelin\n"
|
||||
"(c) 2000, heXoNet Support GmbH, D-66424 Homburg\n"
|
||||
"(c) 2000-2001, Const Kaplinsky\n"
|
||||
"(c) 2000, Tridia Corporation\n"
|
||||
"(c) 1999, AT&T Laboratories Cambridge\n",
|
||||
0, "", "tim@tjansen.de");
|
||||
aboutData.addAuthor("Tim Jansen", "", "tim@tjansen.de");
|
||||
aboutData.addAuthor("Ian Reinhart Geiser", "DCOP interface", "geiseri@kde.org");
|
||||
aboutData.addCredit("Johannes E. Schindelin",
|
||||
I18N_NOOP("libvncserver"));
|
||||
aboutData.addCredit("Const Kaplinsky",
|
||||
I18N_NOOP("TightVNC encoder"));
|
||||
aboutData.addCredit("Tridia Corporation",
|
||||
I18N_NOOP("ZLib encoder"));
|
||||
aboutData.addCredit("AT&T Laboratories Cambridge",
|
||||
I18N_NOOP("original VNC encoders and "
|
||||
"protocol design"));
|
||||
aboutData.addCredit("Jens Wagner (heXoNet Support GmbH)",
|
||||
I18N_NOOP("X11 update scanner, "
|
||||
"original code base"));
|
||||
aboutData.addCredit("Jason Spisak",
|
||||
I18N_NOOP("Connection side image"),
|
||||
"kovalid@yahoo.com");
|
||||
aboutData.addCredit("Karl Vogel",
|
||||
I18N_NOOP("KDesktop background deactivation"));
|
||||
KCmdLineArgs::init(argc, argv, &aboutData);
|
||||
KCmdLineArgs::addCmdLineOptions(options);
|
||||
|
||||
KApplication app;
|
||||
|
||||
Configuration *config;
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
QString fdString;
|
||||
if (!args->isSet(ARG_KINETD)) {
|
||||
bool kinetdA, krfbA;
|
||||
checkKInetd(kinetdA, krfbA);
|
||||
if (!kinetdA) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Cannot find KInetD. "
|
||||
"The KDE daemon (kded) may have crashed or has not been started at all, or the installation failed."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return 1;
|
||||
}
|
||||
if (!krfbA) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Cannot find KInetD service for Desktop Sharing (krfb). "
|
||||
"The installation is incomplete or failed."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
config = new Configuration(KRFB_INVITATION_MODE);
|
||||
config->showInvitationDialog();
|
||||
return 0;
|
||||
}
|
||||
fdString = args->getOption(ARG_KINETD);
|
||||
config = new Configuration(KRFB_KINETD_MODE);
|
||||
args->clear();
|
||||
|
||||
if ((!config->allowUninvitedConnections()) && (config->invitations().size() == 0)) {
|
||||
KNotification::event("UnexpectedConnection");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!RFBController::checkX11Capabilities())
|
||||
return 1;
|
||||
|
||||
TrayIcon trayicon(new KAboutApplicationDialog(&aboutData),
|
||||
config);
|
||||
RFBController controller(config);
|
||||
KRfbIfaceImpl dcopiface(&controller);
|
||||
|
||||
QObject::connect(&app, SIGNAL(lastWindowClosed()), // do not show passivepopup
|
||||
&trayicon, SLOT(prepareQuit()));
|
||||
QObject::connect(&app, SIGNAL(lastWindowClosed()),
|
||||
&controller, SLOT(closeConnection()));
|
||||
|
||||
QObject::connect(&trayicon, SIGNAL(showManageInvitations()),
|
||||
config, SLOT(showManageInvitationsDialog()));
|
||||
QObject::connect(&trayicon, SIGNAL(enableDesktopControl(bool)),
|
||||
&controller, SLOT(enableDesktopControl(bool)));
|
||||
QObject::connect(&trayicon, SIGNAL(diconnectedMessageDisplayed()),
|
||||
&app, SLOT(quit()));
|
||||
|
||||
#if 0
|
||||
QObject::connect(&dcopiface, SIGNAL(exitApp()),
|
||||
&controller, SLOT(closeConnection()));
|
||||
QObject::connect(&dcopiface, SIGNAL(exitApp()),
|
||||
&app, SLOT(quit()));
|
||||
#endif
|
||||
|
||||
QObject::connect(&controller, SIGNAL(sessionRefused()),
|
||||
&app, SLOT(quit()));
|
||||
QObject::connect(&controller, SIGNAL(sessionEstablished(QString)),
|
||||
&trayicon, SLOT(showConnectedMessage(QString)));
|
||||
QObject::connect(&controller, SIGNAL(sessionFinished()),
|
||||
&trayicon, SLOT(showDisconnectedMessage()));
|
||||
QObject::connect(&controller, SIGNAL(desktopControlSettingChanged(bool)),
|
||||
&trayicon, SLOT(setDesktopControlSetting(bool)));
|
||||
QObject::connect(&controller, SIGNAL(quitApp()),
|
||||
&app, SLOT(quit()));
|
||||
|
||||
sigset_t sigs;
|
||||
sigemptyset(&sigs);
|
||||
sigaddset(&sigs, SIGPIPE);
|
||||
sigprocmask(SIG_BLOCK, &sigs, 0);
|
||||
|
||||
bool ok;
|
||||
int fdNum = fdString.toInt(&ok);
|
||||
if (!ok) {
|
||||
kError() << "kinetd fd was not numeric." << endl;
|
||||
return 2;
|
||||
}
|
||||
controller.startServer(fdNum);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
|
||||
<class>ManageInvitationsDialog</class>
|
||||
<widget class="QDialog">
|
||||
<property name="name">
|
||||
<cstring>ManageInvitationsDialog</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>680</width>
|
||||
<height>350</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Manage Invitations - Desktop Sharing</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<pixmap>image0</pixmap>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<spacer row="7" column="0">
|
||||
<property name="name">
|
||||
<cstring>Spacer10</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<spacer row="0" column="1">
|
||||
<property name="name">
|
||||
<cstring>Spacer7</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="K3ListView" row="0" column="0" rowspan="5" colspan="1">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Created</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Expiration</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>listView</cstring>
|
||||
</property>
|
||||
<property name="hScrollBarMode">
|
||||
<enum>AlwaysOff</enum>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="fullWidth">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string></string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Displays the open invitations. Use the buttons on the right to delete them or create a new invitation.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" row="1" column="1">
|
||||
<property name="name">
|
||||
<cstring>newPersonalInvitationButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New &Personal Invitation...</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Create a new personal invitation...</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Click this button to create a new personal invitation.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" row="2" column="1">
|
||||
<property name="name">
|
||||
<cstring>newEmailInvitationButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&New Email Invitation...</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Send a new invitation via email...</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Click this button to send a new invitation via email.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" row="3" column="1">
|
||||
<property name="name">
|
||||
<cstring>deleteAllButton</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete All</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Delete all invitations</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Deletes all open invitations.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" row="4" column="1">
|
||||
<property name="name">
|
||||
<cstring>deleteOneButton</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Delete the selected invitation</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Delete the selected invitation. The invited person will not be able to connect using this invitation anymore.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" row="6" column="1" rowspan="2" colspan="1">
|
||||
<property name="name">
|
||||
<cstring>closeButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Closes this window.</string>
|
||||
</property>
|
||||
<property name="whatsThis" stdset="0">
|
||||
<string>Closes this window.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<images>
|
||||
<image name="image0">
|
||||
<data format="XPM.GZ" length="6958">789cdd9859531b490cc7dff914aee82db5a5784e7b6a6b1f38c219ee9bad7d98d30718830f8c9ddaefbe6a493d10e3002178b3b55118fae7eed1bf5b52f78cf9f4b172b6b75df9f869a13f8807adb49236e35ee56336ec74c67ffef5c7d7850f7ebd42ff1dcfadb81f7e5bf8b03fa8a4959dee756e00ae08a04aff6a09736eb9ee19c65ac9dc8fa1e5c8e7f159c929f3a5e598fbf1dc72227c5672c67c68390d984f4b96fe03cb19f7435ab2ccbf69390f79fc45c9dc8f27960bee878eb25fe3f5c1c4b2eaed5b56bdcfc28ece07162dabbfbeb0ab7ab02a1c44da7fcb5cafd6450f772cc71c2fdcb62ceb8742390d63e62f9625bec8ec98f948bcf6947d8d77ddb2c403968483a028981bcc75a71e88ff7dcb1a8fad92a51e362d6bbeaf95d3808b09ba865d5abf2ffe7acc915bf722e663cbbec3f35b2f59c6b72cebfc6e94534fc6af5956bd6d61cfe667201c3a723f8261cff1aa7aff96b22f0c27caaa8f3e73e4e97c715339558e0dfb8e5f95f9436259eb6b45d9d7fe53e5bacc17b97e2839566fd5b2ae676c59d7bfae9ceaf8c8b2f61f088781d6cbb270acf945ce6fe00655d55f560e546f47b816e8fed915ae47124fbc638e8348ea03772d6bfe374a967a5c52ce74fcd070e8864e28faf7ca8132d747188791d437562debfc27ca99d6ff9a701c6b3febd7bc9aa3fb69ac1c68fdee0947819e375c1fb5a416493d63a29c29733dd73d2a70f1776c59f55aca81f483c3fce0af2b5c8ff47c4c95336138128e023d1f797f46be9d2f16c29123f1c54be540e31d5bd6fc1f0a27a19c4731af274aed786c2bdbfce4ca99ea73bd53b9e97ce14cd8eac7a0ace331138e1d3d5f46ca8130f0f91ea736ff712c5cc62b52b67aae70b9debe302558f43acab930048613bfdccf8bc289abf9bd520e95f9fc48b224d6e7cbad722e0cf796f57ce4e7451ad8fd0255655bff4de1d4d5fd36520e953de6ccae1fee84d3589f17fcbccc02738232b785b350f33954ce95f9799be56eeacaf913081b63762cebf815e15c3946c37958c6eb48387775bd9c5f1aaefb095039d7f38cf3531485dd6f9e7221bc3f98affd9f3410e66ba5463c37b31a312698cec5128c4b8d14b3b9583aa59163f18e2b28c8df538d021bef988706f97baa919a0cbd9b953e9f6accae716cceb6efed89ff9606fbc9b0856dbca4e85e71555c61472bc6d83576f1e6a9de6b34749eb7747fce1a09f6c87797ae7da201b5867847bf5bd4eab3ca08afdfa47143f36ea9c63d5f8734f3312915e47fc8b59ee084567963d6f4231aec7d848b1497019f0009f99d50db5cc506fa8999c1907efab49ecb8798bd42e396fc7769de19fb3171e991cfa527d721f7f6e85ad03cda1cdb9b576a8c38d366a6e6c744fe8ebc4e5f87dcdbd331268a661f775fd6e0f57668dd63f6dda3eb32aeccb4cf94233be68eb506a4d6650fcf6bdc92f5b56e96e94468e02aaee1fa0c5ba39e86da1d6e908a5961ca1e9ed71891b5343e0ddcc42df2f505b77167cab6e9d335ea15dbd4188e295ac6c3f31a05d958e3d3a0f5ece21eeee3011e4ed9017dba47bd976c5d1a2bd11b53f693173436c8861a81091ee1319ee029f93cc3f34776469f9ce20556d141173d1a3729a3b644f6bcc626994f639b18d09d6ea9718e21d6d442a24356a963442a1e8d3ba2f14dd618e04b7565ec1efb80e801400c09a4460132c8a180065941ad4c54a0092d6893061bddd327ff26332f6be85dd0260f4df6750957d0816bd30bd7d4ba82cba71a6ced979f1fdfd5e840176e58e3865a9db968dc42cf3ee3a047f4abd66132dffa098dd7e4c35470fc4a8db1d655a931bbae20853e0c60a833baa3353cbc75bc74ee0236608401dcc39876c0a9a84cef0f98c0222cc132ac689452f1fecab31df8fda8813db8a79d7c317b9fc36758853552d07d0eeb3fa2c1634ce4d731850dd8842df8327d5ec136ecc02eec51ee8ca546e14def25e51b19ec4f9fbb7000877044275b39e68def3e0f1ac7d34f0f3881533a69e39fd598a5366deff79ef8a3f6eb35decd666bd8ef1f9b6ffecef1f2f70ff91ed5a593e41ae7f43d0acee01c2ea00a0e16e08247ed7338d3ef756d7e9728f4cefc51fbdbde6f3f7faae1430021d4a04e1a11a52624f675acbc5b9bb774d1e896edc7bd8fc7ccd488c1fc9196bc2798533ba2b61f838ecdf5ccc855232fdb8f7b1f8f99d6f0f91d791eb684febffab78c796afcfdfbc23fde05c197</data>
|
||||
</image>
|
||||
</images>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>listView</sender>
|
||||
<signal>selectionChanged()</signal>
|
||||
<receiver>ManageInvitationsDialog</receiver>
|
||||
<slot>listSelectionChanged()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>closeButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>ManageInvitationsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<includes>
|
||||
<include location="global" impldecl="in declaration">k3listview.h</include>
|
||||
<include location="local" impldecl="in implementation">manageinvitations.ui.h</include>
|
||||
</includes>
|
||||
<slots>
|
||||
<slot>listSizeChanged( int i )</slot>
|
||||
<slot>listSelectionChanged()</slot>
|
||||
</slots>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>k3listview.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
Copyright 2002 Tim Jansen <tim@tjansen.de>
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
void ManageInvitationsDialog::listSizeChanged(int i) {
|
||||
deleteAllButton->setEnabled(i);
|
||||
}
|
||||
|
||||
void ManageInvitationsDialog::listSelectionChanged() {
|
||||
Q3ListViewItem *i = listView->firstChild();
|
||||
while(i) {
|
||||
if (i->isSelected()) {
|
||||
deleteOneButton->setEnabled(true);
|
||||
return;
|
||||
}
|
||||
i = i->nextSibling();
|
||||
}
|
||||
deleteOneButton->setEnabled(false);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="org.kde.krfb">
|
||||
<method name="setAllowDesktopControl">
|
||||
<arg name="a" type="b" direction="in"/>
|
||||
</method>
|
||||
<method name="exit"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -1,58 +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 "personalinvitewidget.h"
|
||||
|
||||
#include <qlabel.h>
|
||||
|
||||
#include <k3activelabel.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klocale.h>
|
||||
|
||||
PersonalInviteDialog::PersonalInviteDialog( QWidget *parent )
|
||||
: KDialog( parent )
|
||||
{
|
||||
setCaption(i18n("Personal Invitation"));
|
||||
setButtons(Close);
|
||||
setDefaultButton(Close);
|
||||
setModal(true);
|
||||
|
||||
m_inviteWidget = new PersonalInviteWidget( this, "PersonalInviteWidget" );
|
||||
m_inviteWidget->pixmapLabel->setPixmap(
|
||||
UserIcon( "connection-side-image.png" ) );
|
||||
|
||||
setMainWidget( m_inviteWidget );
|
||||
}
|
||||
|
||||
void PersonalInviteDialog::setHost( const QString &host, uint port )
|
||||
{
|
||||
m_inviteWidget->hostLabel->setText( QString( "%1:%2" )
|
||||
.arg( host ).arg( port ) );
|
||||
}
|
||||
|
||||
void PersonalInviteDialog::setPassword( const QString &passwd )
|
||||
{
|
||||
m_inviteWidget->passwordLabel->setText( passwd );
|
||||
}
|
||||
|
||||
void PersonalInviteDialog::setExpiration( const QDateTime &expire )
|
||||
{
|
||||
m_inviteWidget->expirationLabel->setText( expire.toString( Qt::LocalDate ) );
|
||||
}
|
||||
@@ -1,241 +0,0 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>PersonalInviteWidget</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>Form1</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>519</width>
|
||||
<height>328</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string></string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>Fixed</enum>
|
||||
</property>
|
||||
<widget class="K3ActiveLabel" row="0" column="1" rowspan="1" colspan="3">
|
||||
<property name="name">
|
||||
<cstring>mainTextLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><h2>Personal Invitation</h2>
|
||||
Give the information below to the person that you want to invite (<a href="whatsthis:Desktop Sharing uses the VNC protocol. You can use any VNC client to connect. In KDE the client is called 'Remote Desktop Connection'. Enter the host information into the client and it will connect..">how to connect</a>). Note that everybody who gets the password can connect, so be careful.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer row="1" column="2">
|
||||
<property name="name">
|
||||
<cstring>spacer9</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="QLabel" row="0" column="0" rowspan="6" colspan="1">
|
||||
<property name="name">
|
||||
<cstring>pixmapLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>108</width>
|
||||
<height>318</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>108</width>
|
||||
<height>318</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>WinPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer row="5" column="2">
|
||||
<property name="name">
|
||||
<cstring>spacer10</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="K3ActiveLabel" row="2" column="2">
|
||||
<property name="name">
|
||||
<cstring>hostLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>cookie.tjansen.de:0</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="3" column="1">
|
||||
<property name="name">
|
||||
<cstring>kActiveLabel6</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><b>Password:</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="4" column="1">
|
||||
<property name="name">
|
||||
<cstring>kActiveLabel7</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><b>Expiration time:</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="K3ActiveLabel" row="3" column="2">
|
||||
<property name="name">
|
||||
<cstring>passwordLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>12345</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="K3ActiveLabel" row="4" column="2">
|
||||
<property name="name">
|
||||
<cstring>expirationLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>17:12</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="2" column="1">
|
||||
<property name="name">
|
||||
<cstring>kActiveLabel5</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><b>Host:</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="K3ActiveLabel" row="2" column="3">
|
||||
<property name="name">
|
||||
<cstring>hostHelpLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>(<a href="whatsthis:This field contains the address of your computer and the display number, separated by a colon. The address is just a hint - you can use any address that can reach your computer. Desktop Sharing tries to guess your address from your network configuration, but does not always succeed in doing so. If your computer is behind a firewall it may have a different address or be unreachable for other computers.">Help</a>)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
|
||||
</UI>
|
||||
@@ -1,912 +0,0 @@
|
||||
/***************************************************************************
|
||||
rfbcontroller.cpp
|
||||
-------------------
|
||||
begin : Sun Dec 9 2001
|
||||
copyright : (C) 2001-2003 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. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* Contains keyboard & pointer handling from libvncserver's x11vnc.c
|
||||
*/
|
||||
|
||||
#include "rfbcontroller.h"
|
||||
#include "kuser.h"
|
||||
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef USE_SOLARIS
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <kdefakes.h> // gethostname
|
||||
#include <kapplication.h>
|
||||
#include <KNotification>
|
||||
#include <kdebug.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <klocale.h>
|
||||
#include <qstring.h>
|
||||
#include <qcursor.h>
|
||||
#include <qwindowdefs.h>
|
||||
#include <qtimer.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qglobal.h>
|
||||
#include <qlabel.h>
|
||||
#include <qmutex.h>
|
||||
#include <qclipboard.h>
|
||||
#include <qdesktopwidget.h>
|
||||
//Added by qt3to4:
|
||||
#include <Q3CString>
|
||||
#include <Q3PtrList>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
#include <QX11Info>
|
||||
|
||||
#ifndef ASSERT
|
||||
#define ASSERT(x) Q_ASSERT(x)
|
||||
#endif
|
||||
|
||||
#define IDLE_PAUSE (1000/50)
|
||||
#define MAX_SELECTION_LENGTH (4096)
|
||||
|
||||
static XTestDisabler disabler;
|
||||
|
||||
static const char* cur=
|
||||
" "
|
||||
" x "
|
||||
" xx "
|
||||
" xxx "
|
||||
" xxxx "
|
||||
" xxxxx "
|
||||
" xxxxxx "
|
||||
" xxxxxxx "
|
||||
" xxxxxxxx "
|
||||
" xxxxxxxxx "
|
||||
" xxxxxxxxxx "
|
||||
" xxxxx "
|
||||
" xx xxx "
|
||||
" x xxx "
|
||||
" xxx "
|
||||
" xxx "
|
||||
" xxx "
|
||||
" xxx "
|
||||
" ";
|
||||
|
||||
static const char* mask=
|
||||
"xx "
|
||||
"xxx "
|
||||
"xxxx "
|
||||
"xxxxx "
|
||||
"xxxxxx "
|
||||
"xxxxxxx "
|
||||
"xxxxxxxx "
|
||||
"xxxxxxxxx "
|
||||
"xxxxxxxxxx "
|
||||
"xxxxxxxxxxx "
|
||||
"xxxxxxxxxxxx "
|
||||
"xxxxxxxxxx "
|
||||
"xxxxxxxx "
|
||||
"xxxxxxxx "
|
||||
"xx xxxxx "
|
||||
" xxxxx "
|
||||
" xxxxx "
|
||||
" xxxxx "
|
||||
" xxx ";
|
||||
|
||||
static rfbCursorPtr myCursor;
|
||||
|
||||
// only one controller exists, so we can do this workaround for functions:
|
||||
static RFBController *self;
|
||||
|
||||
class AppLocker
|
||||
{
|
||||
public:
|
||||
AppLocker() {
|
||||
KApplication::kApplication()->lock();
|
||||
}
|
||||
|
||||
~AppLocker() {
|
||||
KApplication::kApplication()->unlock();
|
||||
}
|
||||
};
|
||||
|
||||
static enum rfbNewClientAction newClientHook(struct _rfbClientRec *cl)
|
||||
{
|
||||
AppLocker a;
|
||||
return self->handleNewClient(cl);
|
||||
}
|
||||
|
||||
static Bool passwordCheck(rfbClientPtr cl,
|
||||
const char* encryptedPassword,
|
||||
int len)
|
||||
{
|
||||
AppLocker a;
|
||||
return self->handleCheckPassword(cl, encryptedPassword, len);
|
||||
}
|
||||
|
||||
static void keyboardHook(Bool down, KeySym keySym, rfbClientPtr)
|
||||
{
|
||||
self->handleKeyEvent(down ? true : false, keySym);
|
||||
}
|
||||
|
||||
static void pointerHook(int bm, int x, int y, rfbClientPtr)
|
||||
{
|
||||
self->handlePointerEvent(bm, x, y);
|
||||
}
|
||||
|
||||
static void clientGoneHook(rfbClientPtr)
|
||||
{
|
||||
self->handleClientGone();
|
||||
}
|
||||
|
||||
static void negotiationFinishedHook(rfbClientPtr cl)
|
||||
{
|
||||
self->handleNegotiationFinished(cl);
|
||||
}
|
||||
|
||||
static void inetdDisconnectHook()
|
||||
{
|
||||
self->handleClientGone();
|
||||
}
|
||||
|
||||
static void clipboardHook(char* str,int len, rfbClientPtr)
|
||||
{
|
||||
self->clipboardToServer(QString::fromUtf8(str, len));
|
||||
}
|
||||
|
||||
VNCEvent::~VNCEvent() {
|
||||
}
|
||||
|
||||
Display *KeyboardEvent::dpy;
|
||||
signed char KeyboardEvent::modifiers[0x100];
|
||||
KeyCode KeyboardEvent::keycodes[0x100];
|
||||
KeyCode KeyboardEvent::leftShiftCode;
|
||||
KeyCode KeyboardEvent::rightShiftCode;
|
||||
KeyCode KeyboardEvent::altGrCode;
|
||||
const int KeyboardEvent::LEFTSHIFT = 1;
|
||||
const int KeyboardEvent::RIGHTSHIFT = 2;
|
||||
const int KeyboardEvent::ALTGR = 4;
|
||||
char KeyboardEvent::ModifierState;
|
||||
|
||||
KeyboardEvent::KeyboardEvent(bool d, KeySym k) :
|
||||
down(d),
|
||||
keySym(k) {
|
||||
}
|
||||
|
||||
void KeyboardEvent::initKeycodes() {
|
||||
KeySym key,*keymap;
|
||||
int i,j,minkey,maxkey,syms_per_keycode;
|
||||
|
||||
dpy = QX11Info::display();
|
||||
|
||||
memset(modifiers,-1,sizeof(modifiers));
|
||||
|
||||
XDisplayKeycodes(dpy,&minkey,&maxkey);
|
||||
ASSERT(minkey >= 8);
|
||||
ASSERT(maxkey < 256);
|
||||
keymap = (KeySym*) XGetKeyboardMapping(dpy, minkey,
|
||||
(maxkey - minkey + 1),
|
||||
&syms_per_keycode);
|
||||
ASSERT(keymap);
|
||||
|
||||
for (i = minkey; i <= maxkey; i++)
|
||||
for (j=0; j<syms_per_keycode; j++) {
|
||||
key = keymap[(i-minkey)*syms_per_keycode+j];
|
||||
if (key>=' ' && key<0x100 && i==XKeysymToKeycode(dpy,key)) {
|
||||
keycodes[key]=i;
|
||||
modifiers[key]=j;
|
||||
}
|
||||
}
|
||||
|
||||
leftShiftCode = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
rightShiftCode = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
altGrCode = XKeysymToKeycode(dpy, XK_Mode_switch);
|
||||
|
||||
XFree ((char *)keymap);
|
||||
}
|
||||
|
||||
/* this function adjusts the modifiers according to mod (as from modifiers) and ModifierState */
|
||||
void KeyboardEvent::tweakModifiers(signed char mod, bool down) {
|
||||
|
||||
bool isShift = ModifierState & (LEFTSHIFT|RIGHTSHIFT);
|
||||
if(mod < 0)
|
||||
return;
|
||||
|
||||
if(isShift && mod != 1) {
|
||||
if(ModifierState & LEFTSHIFT)
|
||||
XTestFakeKeyEvent(dpy, leftShiftCode,
|
||||
!down, CurrentTime);
|
||||
if(ModifierState & RIGHTSHIFT)
|
||||
XTestFakeKeyEvent(dpy, rightShiftCode,
|
||||
!down, CurrentTime);
|
||||
}
|
||||
|
||||
if(!isShift && mod==1)
|
||||
XTestFakeKeyEvent(dpy, leftShiftCode,
|
||||
down, CurrentTime);
|
||||
|
||||
if((ModifierState&ALTGR) && mod != 2)
|
||||
XTestFakeKeyEvent(dpy, altGrCode,
|
||||
!down, CurrentTime);
|
||||
if(!(ModifierState&ALTGR) && mod==2)
|
||||
XTestFakeKeyEvent(dpy, altGrCode,
|
||||
down, CurrentTime);
|
||||
}
|
||||
|
||||
void KeyboardEvent::exec() {
|
||||
#define ADJUSTMOD(sym,state) \
|
||||
if(keySym==sym) { if(down) ModifierState|=state; else ModifierState&=~state; }
|
||||
|
||||
ADJUSTMOD(XK_Shift_L,LEFTSHIFT);
|
||||
ADJUSTMOD(XK_Shift_R,RIGHTSHIFT);
|
||||
ADJUSTMOD(XK_Mode_switch,ALTGR);
|
||||
|
||||
if(keySym>=' ' && keySym<0x100) {
|
||||
KeyCode k;
|
||||
if (down)
|
||||
tweakModifiers(modifiers[keySym],True);
|
||||
k = keycodes[keySym];
|
||||
if (k != NoSymbol)
|
||||
XTestFakeKeyEvent(dpy, k, down, CurrentTime);
|
||||
|
||||
if (down)
|
||||
tweakModifiers(modifiers[keySym],False);
|
||||
} else {
|
||||
KeyCode k = XKeysymToKeycode(dpy, keySym );
|
||||
if (k != NoSymbol)
|
||||
XTestFakeKeyEvent(dpy, k, down, CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
bool PointerEvent::initialized = false;
|
||||
Display *PointerEvent::dpy;
|
||||
int PointerEvent::buttonMask = 0;
|
||||
|
||||
PointerEvent::PointerEvent(int b, int _x, int _y) :
|
||||
button_mask(b),
|
||||
x(_x),
|
||||
y(_y) {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
dpy = QX11Info::display();
|
||||
buttonMask = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void PointerEvent::exec() {
|
||||
QDesktopWidget *desktopWidget = QApplication::desktop();
|
||||
|
||||
int screen = desktopWidget->screenNumber();
|
||||
if (screen < 0)
|
||||
screen = 0;
|
||||
XTestFakeMotionEvent(dpy, screen, x, y, CurrentTime);
|
||||
for(int i = 0; i < 5; i++)
|
||||
if ((buttonMask&(1<<i))!=(button_mask&(1<<i)))
|
||||
XTestFakeButtonEvent(dpy,
|
||||
i+1,
|
||||
(button_mask&(1<<i))?True:False,
|
||||
CurrentTime);
|
||||
|
||||
buttonMask = button_mask;
|
||||
}
|
||||
|
||||
|
||||
ClipboardEvent::ClipboardEvent(RFBController *c, const QString &ctext) :
|
||||
controller(c),
|
||||
text(ctext) {
|
||||
}
|
||||
|
||||
void ClipboardEvent::exec() {
|
||||
if ((controller->lastClipboardDirection == RFBController::LAST_SYNC_TO_CLIENT) &&
|
||||
(controller->lastClipboardText == text)) {
|
||||
return;
|
||||
}
|
||||
controller->lastClipboardDirection = RFBController::LAST_SYNC_TO_SERVER;
|
||||
controller->lastClipboardText = text;
|
||||
|
||||
controller->clipboard->setText(text, QClipboard::Clipboard);
|
||||
controller->clipboard->setText(text, QClipboard::Selection);
|
||||
}
|
||||
|
||||
|
||||
KNotifyEvent::KNotifyEvent(const QString &n, const QString &d) :
|
||||
name(n),
|
||||
desc(d) {
|
||||
}
|
||||
|
||||
KNotifyEvent::~KNotifyEvent() {
|
||||
}
|
||||
|
||||
void KNotifyEvent::exec() {
|
||||
KNotification::event(name, desc);
|
||||
}
|
||||
|
||||
SessionEstablishedEvent::SessionEstablishedEvent(RFBController *c) :
|
||||
controller(c)
|
||||
{ }
|
||||
|
||||
void SessionEstablishedEvent::exec() {
|
||||
controller->sendSessionEstablished();
|
||||
}
|
||||
|
||||
RFBController::RFBController(Configuration *c) :
|
||||
allowDesktopControl(false),
|
||||
lastClipboardDirection(LAST_SYNC_TO_SERVER),
|
||||
configuration(c),
|
||||
dialog(0),
|
||||
disableBackgroundPending(false),
|
||||
disableBackgroundState(false),
|
||||
closePending(false),
|
||||
forcedClose(false)
|
||||
{
|
||||
self = this;
|
||||
connect(&dialog, SIGNAL(okClicked()), SLOT(dialogAccepted()));
|
||||
connect(&dialog, SIGNAL(cancelClicked()), SLOT(dialogRefused()));
|
||||
connect(&initIdleTimer, SIGNAL(timeout()), SLOT(checkAsyncEvents()));
|
||||
connect(&idleTimer, SIGNAL(timeout()), SLOT(idleSlot()));
|
||||
|
||||
clipboard = QApplication::clipboard();
|
||||
connect(clipboard, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
|
||||
connect(clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardChanged()));
|
||||
|
||||
asyncQueue.setAutoDelete(true);
|
||||
|
||||
KeyboardEvent::initKeycodes();
|
||||
|
||||
char hostname[256];
|
||||
if (gethostname(hostname, 255))
|
||||
hostname[0] = 0;
|
||||
hostname[255] = 0;
|
||||
desktopName = i18n("%1@%2 (shared desktop)", KUser().loginName(), hostname);
|
||||
}
|
||||
|
||||
RFBController::~RFBController()
|
||||
{
|
||||
stopServer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RFBController::startServer(int inetdFd, bool xtestGrab)
|
||||
{
|
||||
framebufferImage = XGetImage(QX11Info::display(),
|
||||
QApplication::desktop()->winId(),
|
||||
0,
|
||||
0,
|
||||
QApplication::desktop()->width(),
|
||||
QApplication::desktop()->height(),
|
||||
AllPlanes,
|
||||
ZPixmap);
|
||||
|
||||
int w = framebufferImage->width;
|
||||
int h = framebufferImage->height;
|
||||
char *fb = framebufferImage->data;
|
||||
|
||||
rfbLogEnable(0);
|
||||
server = rfbGetScreen(0, 0, w, h,
|
||||
framebufferImage->bits_per_pixel,
|
||||
8,
|
||||
framebufferImage->bits_per_pixel/8);
|
||||
|
||||
server->paddedWidthInBytes = framebufferImage->bytes_per_line;
|
||||
|
||||
server->rfbServerFormat.bitsPerPixel = framebufferImage->bits_per_pixel;
|
||||
server->rfbServerFormat.depth = framebufferImage->depth;
|
||||
server->rfbServerFormat.trueColour = (CARD8) TRUE;
|
||||
server->rfbServerFormat.bigEndian = (CARD8) ((framebufferImage->bitmap_bit_order == MSBFirst) ? TRUE : FALSE);
|
||||
|
||||
if ( server->rfbServerFormat.bitsPerPixel == 8 ) {
|
||||
server->rfbServerFormat.redShift = 0;
|
||||
server->rfbServerFormat.greenShift = 3;
|
||||
server->rfbServerFormat.blueShift = 6;
|
||||
server->rfbServerFormat.redMax = 7;
|
||||
server->rfbServerFormat.greenMax = 7;
|
||||
server->rfbServerFormat.blueMax = 3;
|
||||
} else {
|
||||
server->rfbServerFormat.redShift = 0;
|
||||
if ( framebufferImage->red_mask )
|
||||
while ( ! ( framebufferImage->red_mask & (1 << server->rfbServerFormat.redShift) ) )
|
||||
server->rfbServerFormat.redShift++;
|
||||
server->rfbServerFormat.greenShift = 0;
|
||||
if ( framebufferImage->green_mask )
|
||||
while ( ! ( framebufferImage->green_mask & (1 << server->rfbServerFormat.greenShift) ) )
|
||||
server->rfbServerFormat.greenShift++;
|
||||
server->rfbServerFormat.blueShift = 0;
|
||||
if ( framebufferImage->blue_mask )
|
||||
while ( ! ( framebufferImage->blue_mask & (1 << server->rfbServerFormat.blueShift) ) )
|
||||
server->rfbServerFormat.blueShift++;
|
||||
server->rfbServerFormat.redMax = framebufferImage->red_mask >> server->rfbServerFormat.redShift;
|
||||
server->rfbServerFormat.greenMax = framebufferImage->green_mask >> server->rfbServerFormat.greenShift;
|
||||
server->rfbServerFormat.blueMax = framebufferImage->blue_mask >> server->rfbServerFormat.blueShift;
|
||||
}
|
||||
|
||||
server->frameBuffer = fb;
|
||||
server->autoPort = TRUE;
|
||||
server->inetdSock = inetdFd;
|
||||
|
||||
server->kbdAddEvent = keyboardHook;
|
||||
server->ptrAddEvent = pointerHook;
|
||||
server->newClientHook = newClientHook;
|
||||
server->inetdDisconnectHook = inetdDisconnectHook;
|
||||
server->passwordCheck = passwordCheck;
|
||||
server->setXCutText = clipboardHook;
|
||||
|
||||
server->desktopName = desktopName.latin1();
|
||||
|
||||
if (!myCursor)
|
||||
myCursor = rfbMakeXCursor(19, 19, (char*) cur, (char*) mask);
|
||||
server->cursor = myCursor;
|
||||
|
||||
passwordChanged();
|
||||
|
||||
scanner = new XUpdateScanner(QX11Info::display(),
|
||||
QApplication::desktop()->winId(),
|
||||
(unsigned char*)fb, w, h,
|
||||
server->rfbServerFormat.bitsPerPixel,
|
||||
server->paddedWidthInBytes,
|
||||
!configuration->disableXShm());
|
||||
#ifdef __GNUC__
|
||||
#warning "FIXME (linking problem)"
|
||||
#endif
|
||||
#if 0
|
||||
rfbInitServer(server);
|
||||
#endif
|
||||
state = RFB_WAITING;
|
||||
|
||||
if (xtestGrab) {
|
||||
disabler.disable = false;
|
||||
XTestGrabControl(QX11Info::display(), true);
|
||||
}
|
||||
|
||||
rfbRunEventLoop(server, -1, TRUE);
|
||||
initIdleTimer.start(IDLE_PAUSE);
|
||||
}
|
||||
|
||||
void RFBController::stopServer(bool xtestUngrab)
|
||||
{
|
||||
rfbScreenCleanup(server);
|
||||
state = RFB_STOPPED;
|
||||
delete scanner;
|
||||
|
||||
XDestroyImage(framebufferImage);
|
||||
|
||||
if (xtestUngrab) {
|
||||
disabler.disable = true;
|
||||
QTimer::singleShot(0, &disabler, SLOT(exec()));
|
||||
}
|
||||
}
|
||||
|
||||
void RFBController::connectionAccepted(bool aRC)
|
||||
{
|
||||
if (state != RFB_CONNECTING)
|
||||
return;
|
||||
|
||||
allowDesktopControl = aRC;
|
||||
emit desktopControlSettingChanged(aRC);
|
||||
initIdleTimer.stop();
|
||||
idleTimer.start(IDLE_PAUSE);
|
||||
|
||||
server->rfbClientHead->clientGoneHook = clientGoneHook;
|
||||
state = RFB_CONNECTED;
|
||||
if (!server->rfbAuthPasswdData)
|
||||
emit sessionEstablished(remoteIp);
|
||||
}
|
||||
|
||||
void RFBController::acceptConnection(bool aRemoteControl)
|
||||
{
|
||||
KNotification::event("UserAcceptsConnection",
|
||||
i18n("User accepts connection from %1",
|
||||
remoteIp));
|
||||
|
||||
if (state != RFB_CONNECTING)
|
||||
return;
|
||||
|
||||
connectionAccepted(aRemoteControl);
|
||||
rfbStartOnHoldClient(server->rfbClientHead);
|
||||
}
|
||||
|
||||
void RFBController::refuseConnection()
|
||||
{
|
||||
KNotification::event("UserRefusesConnection",
|
||||
i18n("User refuses connection from %1",
|
||||
remoteIp));
|
||||
|
||||
if (state != RFB_CONNECTING)
|
||||
return;
|
||||
rfbRefuseOnHoldClient(server->rfbClientHead);
|
||||
state = RFB_WAITING;
|
||||
}
|
||||
|
||||
// checks async events, returns true if client disconnected
|
||||
bool RFBController::checkAsyncEvents()
|
||||
{
|
||||
bool closed = false;
|
||||
bool backgroundActionRequired = false;
|
||||
asyncMutex.lock();
|
||||
VNCEvent *e;
|
||||
for (e = asyncQueue.first(); e; e = asyncQueue.next())
|
||||
e->exec();
|
||||
asyncQueue.clear();
|
||||
if (closePending) {
|
||||
connectionClosed();
|
||||
closed = true;
|
||||
closePending = false;
|
||||
}
|
||||
if (disableBackgroundPending != disableBackgroundState)
|
||||
backgroundActionRequired = true;
|
||||
asyncMutex.unlock();
|
||||
|
||||
if (backgroundActionRequired && (!closed) && !configuration->disableBackground())
|
||||
disableBackground(disableBackgroundPending);
|
||||
|
||||
return closed;
|
||||
}
|
||||
|
||||
void RFBController::disableBackground(bool state) {
|
||||
if (disableBackgroundState == state)
|
||||
return;
|
||||
|
||||
disableBackgroundState = state;
|
||||
#if 0
|
||||
DCOPRef ref("kdesktop", "KBackgroundIface");
|
||||
ref.setDCOPClient(KApplication::dcopClient());
|
||||
|
||||
ref.send("setBackgroundEnabled(bool)", bool(!state));
|
||||
#endif
|
||||
}
|
||||
|
||||
void RFBController::connectionClosed()
|
||||
{
|
||||
KNotification::event("ConnectionClosed",
|
||||
i18n("Closed connection: %1.",
|
||||
remoteIp));
|
||||
|
||||
idleTimer.stop();
|
||||
initIdleTimer.stop();
|
||||
disableBackground(false);
|
||||
state = RFB_WAITING;
|
||||
if (forcedClose)
|
||||
emit quitApp();
|
||||
else
|
||||
emit sessionFinished();
|
||||
}
|
||||
|
||||
void RFBController::closeConnection()
|
||||
{
|
||||
forcedClose = true;
|
||||
if (state == RFB_CONNECTED) {
|
||||
disableBackground(false);
|
||||
|
||||
if (!checkAsyncEvents()) {
|
||||
asyncMutex.lock();
|
||||
if (!closePending)
|
||||
rfbCloseClient(server->rfbClientHead);
|
||||
asyncMutex.unlock();
|
||||
}
|
||||
}
|
||||
else if (state == RFB_CONNECTING)
|
||||
refuseConnection();
|
||||
}
|
||||
|
||||
void RFBController::enableDesktopControl(bool b) {
|
||||
if (b != allowDesktopControl)
|
||||
emit desktopControlSettingChanged(b);
|
||||
allowDesktopControl = b;
|
||||
}
|
||||
|
||||
void RFBController::idleSlot()
|
||||
{
|
||||
if (state != RFB_CONNECTED)
|
||||
return;
|
||||
if (checkAsyncEvents() || forcedClose)
|
||||
return;
|
||||
|
||||
rfbUndrawCursor(server);
|
||||
|
||||
Q3PtrList<Hint> v;
|
||||
v.setAutoDelete(true);
|
||||
QPoint p = QCursor::pos();
|
||||
scanner->searchUpdates(v, p.y());
|
||||
|
||||
Hint *h;
|
||||
|
||||
for (h = v.first(); h != 0; h = v.next())
|
||||
rfbMarkRectAsModified(server, h->left(),
|
||||
h->top(),
|
||||
h->right(),
|
||||
h->bottom());
|
||||
|
||||
asyncMutex.lock();
|
||||
if (!closePending)
|
||||
defaultPtrAddEvent(0, p.x(),p.y(), server->rfbClientHead);
|
||||
asyncMutex.unlock();
|
||||
|
||||
checkAsyncEvents(); // check 2nd time (see 3rd line)
|
||||
}
|
||||
|
||||
void RFBController::dialogAccepted()
|
||||
{
|
||||
dialog.hide();
|
||||
acceptConnection(dialog.allowRemoteControl());
|
||||
}
|
||||
|
||||
void RFBController::dialogRefused()
|
||||
{
|
||||
refuseConnection();
|
||||
dialog.hide();
|
||||
emit sessionRefused();
|
||||
}
|
||||
|
||||
bool checkPassword(const QString &p,
|
||||
unsigned char *ochallenge,
|
||||
const char *response,
|
||||
int len) {
|
||||
|
||||
if ((len == 0) && (p.length() == 0))
|
||||
return true;
|
||||
|
||||
char passwd[MAXPWLEN];
|
||||
unsigned char challenge[CHALLENGESIZE];
|
||||
|
||||
memcpy(challenge, ochallenge, CHALLENGESIZE);
|
||||
bzero(passwd, MAXPWLEN);
|
||||
if (!p.isNull())
|
||||
strncpy(passwd, p.latin1(),
|
||||
(MAXPWLEN <= p.length()) ? MAXPWLEN : p.length());
|
||||
|
||||
vncEncryptBytes(challenge, passwd);
|
||||
return memcmp(challenge, response, len) == 0;
|
||||
}
|
||||
|
||||
bool RFBController::handleCheckPassword(rfbClientPtr cl,
|
||||
const char *response,
|
||||
int len)
|
||||
{
|
||||
|
||||
bool authd = false;
|
||||
|
||||
if (configuration->allowUninvitedConnections())
|
||||
authd = checkPassword(configuration->password(),
|
||||
cl->authChallenge, response, len);
|
||||
|
||||
if (!authd) {
|
||||
QList<Invitation>::iterator it =
|
||||
configuration->invitations().begin();
|
||||
while (it != configuration->invitations().end()) {
|
||||
if (checkPassword((*it).password(),
|
||||
cl->authChallenge, response, len) &&
|
||||
(*it).isValid()) {
|
||||
authd = true;
|
||||
configuration->removeInvitation(it);
|
||||
break;
|
||||
}
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!authd) {
|
||||
if (configuration->invitations().size() > 0) {
|
||||
sendKNotifyEvent("InvalidPasswordInvitations",
|
||||
i18n("Failed login attempt from %1: wrong password",
|
||||
remoteIp));
|
||||
}
|
||||
else
|
||||
sendKNotifyEvent("InvalidPassword",
|
||||
i18n("Failed login attempt from %1: wrong password",
|
||||
remoteIp));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
asyncMutex.lock();
|
||||
asyncQueue.append(new SessionEstablishedEvent(this));
|
||||
asyncMutex.unlock();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
enum rfbNewClientAction RFBController::handleNewClient(rfbClientPtr cl)
|
||||
{
|
||||
int socket = cl->sock;
|
||||
cl->negotiationFinishedHook = negotiationFinishedHook;
|
||||
|
||||
QString host, port;
|
||||
#ifdef __GNUC__
|
||||
#warning "FIXME (port KSocketAddress)"
|
||||
#endif
|
||||
#if 0
|
||||
KSocketAddress *ksa = KExtendedSocket::peerAddress(socket);
|
||||
if (ksa) {
|
||||
hostent *he = 0;
|
||||
KInetSocketAddress *kisa = (KInetSocketAddress*) ksa;
|
||||
in_addr ia4 = kisa->hostV4();
|
||||
he = gethostbyaddr((const char*)&ia4,
|
||||
sizeof(ia4),
|
||||
AF_INET);
|
||||
|
||||
if (he && he->h_name)
|
||||
host = QString(he->h_name);
|
||||
else
|
||||
host = ksa->nodeName();
|
||||
delete ksa;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (state != RFB_WAITING) {
|
||||
sendKNotifyEvent("TooManyConnections",
|
||||
i18n("Connection refused from %1, already connected.",
|
||||
host));
|
||||
return RFB_CLIENT_REFUSE;
|
||||
}
|
||||
remoteIp = host;
|
||||
state = RFB_CONNECTING;
|
||||
|
||||
if ((!configuration->askOnConnect()) &&
|
||||
(configuration->invitations().size() == 0)) {
|
||||
sendKNotifyEvent("NewConnectionAutoAccepted",
|
||||
i18n("Accepted uninvited connection from %1",
|
||||
remoteIp));
|
||||
|
||||
connectionAccepted(configuration->allowDesktopControl());
|
||||
return RFB_CLIENT_ACCEPT;
|
||||
}
|
||||
|
||||
sendKNotifyEvent("NewConnectionOnHold",
|
||||
i18n("Received connection from %1, on hold (waiting for confirmation)",
|
||||
remoteIp));
|
||||
|
||||
dialog.setRemoteHost(remoteIp);
|
||||
dialog.setAllowRemoteControl( true );
|
||||
dialog.setFixedSize(dialog.sizeHint());
|
||||
dialog.show();
|
||||
return RFB_CLIENT_ON_HOLD;
|
||||
}
|
||||
|
||||
void RFBController::handleClientGone()
|
||||
{
|
||||
asyncMutex.lock();
|
||||
closePending = true;
|
||||
asyncMutex.unlock();
|
||||
}
|
||||
|
||||
void RFBController::handleNegotiationFinished(rfbClientPtr cl)
|
||||
{
|
||||
asyncMutex.lock();
|
||||
disableBackgroundPending = cl->disableBackground;
|
||||
asyncMutex.unlock();
|
||||
}
|
||||
|
||||
void RFBController::handleKeyEvent(bool down, KeySym keySym) {
|
||||
if (!allowDesktopControl)
|
||||
return;
|
||||
|
||||
asyncMutex.lock();
|
||||
asyncQueue.append(new KeyboardEvent(down, keySym));
|
||||
asyncMutex.unlock();
|
||||
}
|
||||
|
||||
void RFBController::handlePointerEvent(int button_mask, int x, int y) {
|
||||
if (!allowDesktopControl)
|
||||
return;
|
||||
|
||||
asyncMutex.lock();
|
||||
asyncQueue.append(new PointerEvent(button_mask, x, y));
|
||||
asyncMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
void RFBController::clipboardToServer(const QString &ctext) {
|
||||
if (!allowDesktopControl)
|
||||
return;
|
||||
|
||||
asyncMutex.lock();
|
||||
asyncQueue.append(new ClipboardEvent(this, ctext));
|
||||
asyncMutex.unlock();
|
||||
}
|
||||
|
||||
void RFBController::clipboardChanged() {
|
||||
if (state != RFB_CONNECTED)
|
||||
return;
|
||||
if (clipboard->ownsClipboard())
|
||||
return;
|
||||
|
||||
QString text = clipboard->text(QClipboard::Clipboard);
|
||||
|
||||
// avoid ping-pong between client&server
|
||||
if ((lastClipboardDirection == LAST_SYNC_TO_SERVER) &&
|
||||
(lastClipboardText == text))
|
||||
return;
|
||||
if ((text.length() > MAX_SELECTION_LENGTH) || text.isNull())
|
||||
return;
|
||||
|
||||
lastClipboardDirection = LAST_SYNC_TO_CLIENT;
|
||||
lastClipboardText = text;
|
||||
Q3CString ctext = text.utf8();
|
||||
rfbSendServerCutText(server, ctext.data(), ctext.length());
|
||||
}
|
||||
|
||||
void RFBController::selectionChanged() {
|
||||
if (state != RFB_CONNECTED)
|
||||
return;
|
||||
if (clipboard->ownsSelection())
|
||||
return;
|
||||
|
||||
QString text = clipboard->text(QClipboard::Selection);
|
||||
// avoid ping-pong between client&server
|
||||
if ((lastClipboardDirection == LAST_SYNC_TO_SERVER) &&
|
||||
(lastClipboardText == text))
|
||||
return;
|
||||
if ((text.length() > MAX_SELECTION_LENGTH) || text.isNull())
|
||||
return;
|
||||
|
||||
lastClipboardDirection = LAST_SYNC_TO_CLIENT;
|
||||
lastClipboardText = text;
|
||||
Q3CString ctext = text.utf8();
|
||||
rfbSendServerCutText(server, ctext.data(), ctext.length());
|
||||
}
|
||||
|
||||
void RFBController::passwordChanged() {
|
||||
bool authRequired = (!configuration->allowUninvitedConnections()) ||
|
||||
(configuration->password().length() != 0) ||
|
||||
(configuration->invitations().count() > 0);
|
||||
|
||||
server->rfbAuthPasswdData = (void*) (authRequired ? 1 : 0);
|
||||
}
|
||||
|
||||
void RFBController::sendKNotifyEvent(const QString &n, const QString &d)
|
||||
{
|
||||
asyncMutex.lock();
|
||||
asyncQueue.append(new KNotifyEvent(n, d));
|
||||
asyncMutex.unlock();
|
||||
}
|
||||
|
||||
void RFBController::sendSessionEstablished()
|
||||
{
|
||||
if (configuration->disableBackground())
|
||||
disableBackground(true);
|
||||
emit sessionEstablished(remoteIp);
|
||||
}
|
||||
|
||||
#ifdef __osf__
|
||||
extern "C" Bool XShmQueryExtension(Display*);
|
||||
#endif
|
||||
|
||||
bool RFBController::checkX11Capabilities() {
|
||||
int bp1, bp2, majorv, minorv;
|
||||
Bool r = XTestQueryExtension(QX11Info::display(), &bp1, &bp2,
|
||||
&majorv, &minorv);
|
||||
if ((!r) || (((majorv*1000)+minorv) < 2002)) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Your X11 Server does not support the required XTest extension version 2.2. Sharing your desktop is not possible."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
XTestDisabler::XTestDisabler() :
|
||||
disable(false) {
|
||||
}
|
||||
|
||||
void XTestDisabler::exec() {
|
||||
if (disable)
|
||||
XTestDiscard(QX11Info::display());
|
||||
}
|
||||
|
||||
#include "rfbcontroller.moc"
|
||||
@@ -1,222 +0,0 @@
|
||||
/***************************************************************************
|
||||
rfbcontroller.h
|
||||
-------------------
|
||||
begin : Sun Dec 9 2001
|
||||
copyright : (C) 2001 by Tim Jansen
|
||||
email : tim@tjansen.de
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Contains portions & concept from rfb's x0rfbserver.cc
|
||||
* Copyright (C) 2000 heXoNet Support GmbH, D-66424 Homburg.
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* 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 RFBCONTROLLER_H
|
||||
#define RFBCONTROLLER_H
|
||||
|
||||
#include "configuration.h"
|
||||
#include "connectiondialog.h"
|
||||
#include "xupdatescanner.h"
|
||||
#include <qobject.h>
|
||||
#include <qtimer.h>
|
||||
#include <qmutex.h>
|
||||
#include <QCloseEvent>
|
||||
#include <Q3PtrList>
|
||||
|
||||
#define HAVE_PTHREADS
|
||||
#include "rfb.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
|
||||
|
||||
class QCloseEvent;
|
||||
class QClipboard;
|
||||
class RFBController;
|
||||
|
||||
typedef enum {
|
||||
RFB_STOPPED,
|
||||
RFB_WAITING,
|
||||
RFB_CONNECTING,
|
||||
RFB_CONNECTED
|
||||
} RFBState;
|
||||
|
||||
class VNCEvent {
|
||||
public:
|
||||
virtual void exec() = 0;
|
||||
virtual ~VNCEvent();
|
||||
};
|
||||
|
||||
|
||||
class KeyboardEvent : public VNCEvent {
|
||||
bool down;
|
||||
KeySym keySym;
|
||||
|
||||
static Display *dpy;
|
||||
static signed char modifiers[0x100];
|
||||
static KeyCode keycodes[0x100], leftShiftCode, rightShiftCode, altGrCode;
|
||||
static const int LEFTSHIFT;
|
||||
static const int RIGHTSHIFT;
|
||||
static const int ALTGR;
|
||||
static char ModifierState;
|
||||
|
||||
static void tweakModifiers(signed char mod, bool down);
|
||||
public:
|
||||
static void initKeycodes();
|
||||
|
||||
KeyboardEvent(bool d, KeySym k);
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
class PointerEvent : public VNCEvent {
|
||||
int button_mask, x, y;
|
||||
|
||||
static bool initialized;
|
||||
static Display *dpy;
|
||||
static int buttonMask;
|
||||
public:
|
||||
PointerEvent(int b, int _x, int _y);
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
class ClipboardEvent : public VNCEvent {
|
||||
RFBController *controller;
|
||||
QString text;
|
||||
public:
|
||||
ClipboardEvent(RFBController *c, const QString &text);
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
class KNotifyEvent : public VNCEvent {
|
||||
QString name;
|
||||
QString desc;
|
||||
public:
|
||||
KNotifyEvent(const QString &n, const QString &d);
|
||||
virtual ~KNotifyEvent();
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
class SessionEstablishedEvent : public VNCEvent {
|
||||
RFBController *controller;
|
||||
public:
|
||||
SessionEstablishedEvent(RFBController *c);
|
||||
virtual void exec();
|
||||
};
|
||||
|
||||
/**
|
||||
* Manages sockets, drives the RGBConnection and triggers the connection
|
||||
* dialog.
|
||||
* The controller has three states: 'waiting for connection',
|
||||
* 'waiting for confirmation' and 'connected'. In the first state socket and
|
||||
* connection are null, in the second socket is set and in the last both are
|
||||
* set.
|
||||
* @author Tim Jansen
|
||||
*/
|
||||
class RFBController : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
friend class SessionEstablishedEvent;
|
||||
friend class ClipboardEvent;
|
||||
public:
|
||||
RFBController(Configuration *c);
|
||||
virtual ~RFBController();
|
||||
|
||||
RFBState state;
|
||||
|
||||
void acceptConnection(bool allowRemoteConnection);
|
||||
void connectionAccepted(bool allowRemoteConnection);
|
||||
void refuseConnection();
|
||||
void connectionClosed();
|
||||
bool handleCheckPassword(rfbClientPtr, const char *, int);
|
||||
void handleKeyEvent(bool down, KeySym keySym);
|
||||
void handlePointerEvent(int button_mask, int x, int y);
|
||||
enum rfbNewClientAction handleNewClient(rfbClientPtr cl);
|
||||
void clipboardToServer(const QString &text);
|
||||
void handleClientGone();
|
||||
void handleNegotiationFinished(rfbClientPtr cl);
|
||||
int getPort();
|
||||
void startServer(int inetdFd = -1, bool xtestGrab = true);
|
||||
|
||||
static bool checkX11Capabilities();
|
||||
|
||||
public slots:
|
||||
void passwordChanged();
|
||||
void closeConnection();
|
||||
void enableDesktopControl(bool c);
|
||||
|
||||
signals:
|
||||
void sessionEstablished(QString host);
|
||||
void sessionFinished();
|
||||
void sessionRefused();
|
||||
void quitApp();
|
||||
void desktopControlSettingChanged(bool);
|
||||
|
||||
private:
|
||||
void stopServer(bool xtestUngrab = true);
|
||||
void sendKNotifyEvent(const QString &name, const QString &desc);
|
||||
void sendSessionEstablished();
|
||||
void disableBackground(bool state);
|
||||
|
||||
QString remoteIp;
|
||||
volatile bool allowDesktopControl;
|
||||
|
||||
QTimer initIdleTimer;
|
||||
QTimer idleTimer;
|
||||
|
||||
enum {
|
||||
LAST_SYNC_TO_SERVER,
|
||||
LAST_SYNC_TO_CLIENT
|
||||
} lastClipboardDirection;
|
||||
QString lastClipboardText;
|
||||
QClipboard *clipboard;
|
||||
|
||||
Configuration *configuration;
|
||||
XUpdateScanner *scanner;
|
||||
ConnectionDialog dialog;
|
||||
|
||||
QString desktopName;
|
||||
|
||||
rfbScreenInfoPtr server;
|
||||
|
||||
XImage *framebufferImage;
|
||||
|
||||
QMutex asyncMutex;
|
||||
Q3PtrList<VNCEvent> asyncQueue;
|
||||
|
||||
bool disableBackgroundPending; // background, as desired by libvncserver
|
||||
bool disableBackgroundState; // real background state
|
||||
bool closePending; // set when libvncserver detected close
|
||||
bool forcedClose; // set when user closed connection
|
||||
private slots:
|
||||
bool checkAsyncEvents();
|
||||
void idleSlot();
|
||||
void dialogAccepted();
|
||||
void dialogRefused();
|
||||
void selectionChanged();
|
||||
void clipboardChanged();
|
||||
};
|
||||
|
||||
/*
|
||||
* Class to call XTestDiscard at idle time (because otherwise
|
||||
* it will not work with QT)
|
||||
*/
|
||||
class XTestDisabler : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
XTestDisabler();
|
||||
bool disable;
|
||||
Display *dpy;
|
||||
public slots:
|
||||
void exec();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,141 +0,0 @@
|
||||
/***************************************************************************
|
||||
trayicon.cpp
|
||||
-------------------
|
||||
begin : Tue Dec 11 2001
|
||||
copyright : (C) 2001-2002 by Tim Jansen
|
||||
email : tim@tjansen.de
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "trayicon.h"
|
||||
#include <qtooltip.h>
|
||||
//Added by qt3to4:
|
||||
#include <QHideEvent>
|
||||
#include <QPixmap>
|
||||
#include <QMouseEvent>
|
||||
#include <kstandardaction.h>
|
||||
#include <kapplication.h>
|
||||
#include <klocale.h>
|
||||
#include <kdialog.h>
|
||||
#include <kglobal.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kmenu.h>
|
||||
|
||||
KPassivePopup2::KPassivePopup2(QWidget *parent) :
|
||||
KPassivePopup(parent){
|
||||
}
|
||||
|
||||
void KPassivePopup2::hideEvent( QHideEvent *e )
|
||||
{
|
||||
KPassivePopup::hideEvent(e);
|
||||
emit hidden();
|
||||
}
|
||||
|
||||
KPassivePopup2 *KPassivePopup2::message( const QString &caption, const QString &text,
|
||||
const QPixmap &icon,
|
||||
QWidget *parent)
|
||||
{
|
||||
KPassivePopup2 *pop = new KPassivePopup2( parent);
|
||||
pop->setView( caption, text, icon );
|
||||
pop->show();
|
||||
|
||||
return pop;
|
||||
}
|
||||
|
||||
|
||||
TrayIcon::TrayIcon(KDialog *d, Configuration *c) :
|
||||
KSystemTrayIcon(),
|
||||
configuration(c),
|
||||
aboutDialog(d),
|
||||
actionCollection(this),
|
||||
quitting(false)
|
||||
{
|
||||
KIconLoader *loader = KIconLoader::global();
|
||||
trayIconOpen = loader->loadIcon("eyes-open24", K3Icon::User);
|
||||
trayIconClosed = loader->loadIcon("eyes-closed24", K3Icon::User);
|
||||
setIcon(trayIconClosed);
|
||||
setToolTip(i18n("Desktop Sharing - connecting"));
|
||||
|
||||
manageInvitationsAction = new KAction(i18n("Manage &Invitations"), &actionCollection);
|
||||
actionCollection.addAction("manage_invitations", manageInvitationsAction);
|
||||
connect(manageInvitationsAction, SIGNAL(toggled()), SIGNAL(showManageInvitations()));
|
||||
contextMenu()->addAction(actionCollection.action("manage_invitations"));
|
||||
|
||||
contextMenu()->addSeparator();
|
||||
|
||||
enableControlAction = new KToggleAction(i18n("Enable Remote Control"), &actionCollection);
|
||||
enableControlAction->setCheckedState(KGuiItem(i18n("Disable Remote Control")));
|
||||
enableControlAction->setEnabled(false);
|
||||
actionCollection.addAction("enable_control", enableControlAction);
|
||||
connect(enableControlAction, SIGNAL(toggled(bool)), SIGNAL(enableDesktopControl(bool)));
|
||||
contextMenu()->addAction("enable_control");
|
||||
|
||||
contextMenu()->addSeparator();
|
||||
|
||||
aboutAction = KStandardAction::aboutApp(this, SLOT(showAbout()), &actionCollection);
|
||||
actionCollection.addAction("about", aboutAction);
|
||||
contextMenu()->addAction("about");
|
||||
|
||||
show();
|
||||
}
|
||||
|
||||
TrayIcon::~TrayIcon(){
|
||||
}
|
||||
|
||||
void TrayIcon::showAbout() {
|
||||
aboutDialog->show();
|
||||
}
|
||||
|
||||
void TrayIcon::prepareQuit() {
|
||||
quitting = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TrayIcon::showConnectedMessage(QString host) {
|
||||
|
||||
setIcon(trayIconOpen);
|
||||
KPassivePopup2::message(i18n("Desktop Sharing"),
|
||||
i18n("The remote user has been authenticated and is now connected."),
|
||||
trayIconOpen,
|
||||
(QWidget*)this);
|
||||
setToolTip(i18n("Desktop Sharing - connected with %1", host));
|
||||
}
|
||||
|
||||
void TrayIcon::showDisconnectedMessage() {
|
||||
if (quitting)
|
||||
return;
|
||||
|
||||
setToolTip(i18n("Desktop Sharing - disconnected"));
|
||||
setIcon(trayIconClosed);
|
||||
KPassivePopup2 *p = KPassivePopup2::message(i18n("Desktop Sharing"),
|
||||
i18n("The remote user has closed the connection."),
|
||||
trayIconClosed,
|
||||
(QWidget*)this);
|
||||
connect(p, SIGNAL(hidden()), this, SIGNAL(diconnectedMessageDisplayed()));
|
||||
}
|
||||
|
||||
void TrayIcon::setDesktopControlSetting(bool b) {
|
||||
enableControlAction->setEnabled(true);
|
||||
enableControlAction->setChecked(b);
|
||||
}
|
||||
|
||||
void TrayIcon::activated(QSystemTrayIcon::ActivationReason reason)
|
||||
{
|
||||
if (reason == QSystemTrayIcon::Trigger)
|
||||
{
|
||||
contextMenu()->popup(QCursor::pos());
|
||||
}
|
||||
else
|
||||
KSystemTrayIcon::activated(reason);
|
||||
}
|
||||
|
||||
#include "trayicon.moc"
|
||||
@@ -1,483 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000 heXoNet Support GmbH, D-66424 Homburg.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
/*
|
||||
* December 15th 2001: removed coments, mouse pointer options and some
|
||||
* other stuff
|
||||
* January 10th 2002: improved hint creation (join adjacent hints)
|
||||
* February 20th: use only partial tiles
|
||||
* January 21st 2003: remember last modified scanlines, and scan them and
|
||||
* in every cycle, reduce scanlines to every 35th
|
||||
* January 21st 2003: scan lines around the cursor in every cycle
|
||||
*
|
||||
* Tim Jansen <tim@tjansen.de>
|
||||
*/
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "xupdatescanner.h"
|
||||
//Added by qt3to4:
|
||||
#include <Q3PtrList>
|
||||
|
||||
/* ../../krfb/libvncserver/rfb.h */
|
||||
#ifdef Bool
|
||||
#undef Bool
|
||||
#endif
|
||||
#define Bool int
|
||||
|
||||
|
||||
#define SCANLINES 35
|
||||
unsigned int scanlines[SCANLINES] = { 0, 16, 8, 24,
|
||||
33, 4, 20, 12, 28,
|
||||
10, 26, 18, 34, 2,
|
||||
22, 6, 30, 14,
|
||||
1, 17, 32, 9, 25,
|
||||
7, 23, 15, 31,
|
||||
19, 3, 27, 11,
|
||||
29, 13, 5, 21 };
|
||||
#define MAX_ADJ_TOLERANCE 8
|
||||
|
||||
#define MAX_RECENT_HITS 12
|
||||
unsigned int recentHitScanlines[MAX_RECENT_HITS];
|
||||
|
||||
#define CURSOR_SCANLINES 5
|
||||
int cursorScanlines[CURSOR_SCANLINES] = {
|
||||
-10, -4, 0, 4, 10
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
XUpdateScanner::XUpdateScanner(Display *_dpy,
|
||||
Window _window,
|
||||
unsigned char *_fb,
|
||||
int _width,
|
||||
int _height,
|
||||
int _bitsPerPixel,
|
||||
int _bytesPerLine,
|
||||
bool useXShm) :
|
||||
dpy(_dpy),
|
||||
window(_window),
|
||||
fb(_fb),
|
||||
width(_width),
|
||||
height(_height),
|
||||
bitsPerPixel(_bitsPerPixel),
|
||||
bytesPerLine(_bytesPerLine),
|
||||
tileWidth(32),
|
||||
tileHeight(32),
|
||||
count (0),
|
||||
scanline(NULL),
|
||||
tile(NULL)
|
||||
{
|
||||
useShm = useXShm && XShmQueryExtension(dpy);
|
||||
if (useShm) {
|
||||
int major, minor;
|
||||
Bool pixmaps;
|
||||
if ((!XShmQueryVersion(dpy, &major, &minor, &pixmaps)) || !pixmaps)
|
||||
useShm = false;
|
||||
}
|
||||
|
||||
if (useShm) {
|
||||
tile = XShmCreateImage(dpy,
|
||||
DefaultVisual( dpy, 0 ),
|
||||
bitsPerPixel,
|
||||
ZPixmap,
|
||||
NULL,
|
||||
&shminfo_tile,
|
||||
tileWidth,
|
||||
tileHeight);
|
||||
|
||||
shminfo_tile.shmid = shmget(IPC_PRIVATE,
|
||||
tile->bytes_per_line * tile->height,
|
||||
IPC_CREAT | 0777);
|
||||
shminfo_tile.shmaddr = tile->data = (char *)
|
||||
shmat(shminfo_tile.shmid, 0, 0);
|
||||
shminfo_tile.readOnly = False;
|
||||
|
||||
XShmAttach(dpy, &shminfo_tile);
|
||||
}
|
||||
else {
|
||||
int tlen = tileWidth*(bitsPerPixel/8);
|
||||
void *data = malloc(tlen*tileHeight);
|
||||
|
||||
tile = XCreateImage(dpy,
|
||||
DefaultVisual(dpy, 0),
|
||||
bitsPerPixel,
|
||||
ZPixmap,
|
||||
0,
|
||||
(char*)data,
|
||||
tileWidth,
|
||||
tileHeight,
|
||||
8,
|
||||
tlen);
|
||||
}
|
||||
|
||||
tilesX = (width + tileWidth - 1) / tileWidth;
|
||||
tilesY = (height + tileHeight - 1) / tileHeight;
|
||||
tileMap = new bool[tilesX * tilesY];
|
||||
tileRegionMap = new struct TileChangeRegion[tilesX * tilesY];
|
||||
|
||||
unsigned int i;
|
||||
for (i = 0; i < tilesX * tilesY; i++)
|
||||
tileMap[i] = false;
|
||||
|
||||
if (useShm) {
|
||||
scanline = XShmCreateImage(dpy,
|
||||
DefaultVisual(dpy, 0),
|
||||
bitsPerPixel,
|
||||
ZPixmap,
|
||||
NULL,
|
||||
&shminfo_scanline,
|
||||
width,
|
||||
1);
|
||||
|
||||
shminfo_scanline.shmid = shmget(IPC_PRIVATE,
|
||||
scanline->bytes_per_line,
|
||||
IPC_CREAT | 0777);
|
||||
shminfo_scanline.shmaddr = scanline->data = (char *)
|
||||
shmat( shminfo_scanline.shmid, 0, 0 );
|
||||
shminfo_scanline.readOnly = False;
|
||||
|
||||
XShmAttach(dpy, &shminfo_scanline);
|
||||
}
|
||||
else {
|
||||
int slen = width*(bitsPerPixel/8);
|
||||
void *data = malloc(slen);
|
||||
scanline = XCreateImage(dpy,
|
||||
DefaultVisual(dpy, 0),
|
||||
bitsPerPixel,
|
||||
ZPixmap,
|
||||
0,
|
||||
(char*)data,
|
||||
width,
|
||||
1,
|
||||
8,
|
||||
slen);
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_RECENT_HITS; i++)
|
||||
recentHitScanlines[i] = i;
|
||||
}
|
||||
|
||||
|
||||
XUpdateScanner::~XUpdateScanner()
|
||||
{
|
||||
if (useShm) {
|
||||
XShmDetach(dpy, &shminfo_scanline);
|
||||
XDestroyImage(scanline);
|
||||
shmdt(shminfo_scanline.shmaddr);
|
||||
shmctl(shminfo_scanline.shmid, IPC_RMID, 0);
|
||||
XShmDetach(dpy, &shminfo_tile);
|
||||
XDestroyImage(tile);
|
||||
shmdt(shminfo_tile.shmaddr);
|
||||
shmctl(shminfo_tile.shmid, IPC_RMID, 0);
|
||||
}
|
||||
else {
|
||||
free(tile->data);
|
||||
free(scanline->data);
|
||||
XDestroyImage(scanline);
|
||||
XDestroyImage(tile);
|
||||
}
|
||||
delete tileMap;
|
||||
delete tileRegionMap;
|
||||
}
|
||||
|
||||
|
||||
// returns true if last line changed. this is used to re-scan the tile under
|
||||
// this one because it is likely to be modified but missed by the probe
|
||||
bool XUpdateScanner::copyTile(int x, int y, int tx, int ty)
|
||||
{
|
||||
unsigned int maxWidth = width - x;
|
||||
unsigned int maxHeight = height - y;
|
||||
if (maxWidth > tileWidth)
|
||||
maxWidth = tileWidth;
|
||||
if (maxHeight > tileHeight)
|
||||
maxHeight = tileHeight;
|
||||
|
||||
if (useShm) {
|
||||
if ((maxWidth == tileWidth) && (maxHeight == tileHeight)) {
|
||||
XShmGetImage(dpy, window, tile, x, y, AllPlanes);
|
||||
} else {
|
||||
XGetSubImage(dpy, window, x, y, maxWidth, maxHeight,
|
||||
AllPlanes, ZPixmap, tile, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
XGetSubImage(dpy, window, x, y, maxWidth, maxHeight,
|
||||
AllPlanes, ZPixmap, tile, 0, 0);
|
||||
|
||||
unsigned int line;
|
||||
int pixelsize = bitsPerPixel >> 3;
|
||||
unsigned char *src = (unsigned char*) tile->data;
|
||||
unsigned char *dest = fb + y * bytesPerLine + x * pixelsize;
|
||||
|
||||
unsigned char *ssrc = src;
|
||||
unsigned char *sdest = dest;
|
||||
int firstLine = maxHeight;
|
||||
|
||||
for (line = 0; line < maxHeight; line++) {
|
||||
if (memcmp(sdest, ssrc, maxWidth * pixelsize)) {
|
||||
firstLine = line;
|
||||
break;
|
||||
}
|
||||
ssrc += tile->bytes_per_line;
|
||||
sdest += bytesPerLine;
|
||||
}
|
||||
|
||||
if (firstLine == maxHeight) {
|
||||
tileMap[tx + ty * tilesX] = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned char *msrc = src + (tile->bytes_per_line * maxHeight);
|
||||
unsigned char *mdest = dest + (bytesPerLine * maxHeight);
|
||||
int lastLine = firstLine;
|
||||
|
||||
for (line = maxHeight-1; line > firstLine; line--) {
|
||||
msrc -= tile->bytes_per_line;
|
||||
mdest -= bytesPerLine;
|
||||
if (memcmp(mdest, msrc, maxWidth * pixelsize)) {
|
||||
lastLine = line;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (line = firstLine; line <= lastLine; line++) {
|
||||
memcpy(sdest, ssrc, maxWidth * pixelsize );
|
||||
ssrc += tile->bytes_per_line;
|
||||
sdest += bytesPerLine;
|
||||
}
|
||||
|
||||
struct TileChangeRegion *r = &tileRegionMap[tx + (ty * tilesX)];
|
||||
r->firstLine = firstLine;
|
||||
r->lastLine = lastLine;
|
||||
|
||||
return lastLine == (maxHeight-1);
|
||||
}
|
||||
|
||||
void XUpdateScanner::copyAllTiles()
|
||||
{
|
||||
for (unsigned int y = 0; y < tilesY; y++) {
|
||||
for (unsigned int x = 0; x < tilesX; x++) {
|
||||
if (tileMap[x + y * tilesX])
|
||||
if (copyTile(x*tileWidth, y*tileHeight, x, y) &&
|
||||
((y+1) < tilesY))
|
||||
tileMap[x + (y+1) * tilesX] = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void XUpdateScanner::createHintFromTile(int x, int y, int th, Hint &hint)
|
||||
{
|
||||
unsigned int w = width - x;
|
||||
unsigned int h = height - y;
|
||||
if (w > tileWidth)
|
||||
w = tileWidth;
|
||||
if (h > th)
|
||||
h = th;
|
||||
|
||||
hint.x = x;
|
||||
hint.y = y;
|
||||
hint.w = w;
|
||||
hint.h = h;
|
||||
}
|
||||
|
||||
void XUpdateScanner::addTileToHint(int x, int y, int th, Hint &hint)
|
||||
{
|
||||
unsigned int w = width - x;
|
||||
unsigned int h = height - y;
|
||||
if (w > tileWidth)
|
||||
w = tileWidth;
|
||||
if (h > th)
|
||||
h = th;
|
||||
|
||||
if (hint.x > x) {
|
||||
hint.w += hint.x - x;
|
||||
hint.x = x;
|
||||
}
|
||||
|
||||
if (hint.y > y) {
|
||||
hint.h += hint.y - y;
|
||||
hint.y = y;
|
||||
}
|
||||
|
||||
if ((hint.x+hint.w) < (x+w)) {
|
||||
hint.w = (x+w) - hint.x;
|
||||
}
|
||||
|
||||
if ((hint.y+hint.h) < (y+h)) {
|
||||
hint.h = (y+h) - hint.y;
|
||||
}
|
||||
}
|
||||
|
||||
static void printStatistics(Hint &hint) {
|
||||
static int snum = 0;
|
||||
static float ssum = 0.0;
|
||||
|
||||
int oX0 = hint.x & 0xffffffe0;
|
||||
int oY0 = hint.y & 0xffffffe0;
|
||||
int oX2 = (hint.x+hint.w) & 0x1f;
|
||||
int oY2 = (hint.y+hint.h) & 0x1f;
|
||||
int oX3 = (((hint.x+hint.w) | 0x1f) + ((oX2 == 0) ? 0 : 1)) & 0xffffffe0;
|
||||
int oY3 = (((hint.y+hint.h) | 0x1f) + ((oY2 == 0) ? 0 : 1)) & 0xffffffe0;
|
||||
float s0 = hint.w*hint.h;
|
||||
float s1 = (oX3-oX0)*(oY3-oY0);
|
||||
float p = (100*s0/s1);
|
||||
ssum += p;
|
||||
snum++;
|
||||
float avg = ssum / snum;
|
||||
kDebug() << "avg size: "<< avg <<"%"<<endl;
|
||||
}
|
||||
|
||||
void XUpdateScanner::flushHint(int x, int y, int &x0,
|
||||
Hint &hint, Q3PtrList<Hint> &hintList)
|
||||
{
|
||||
if (x0 < 0)
|
||||
return;
|
||||
|
||||
x0 = -1;
|
||||
|
||||
assert (hint.w > 0);
|
||||
assert (hint.h > 0);
|
||||
|
||||
//printStatistics(hint);
|
||||
|
||||
hintList.append(new Hint(hint));
|
||||
}
|
||||
|
||||
void XUpdateScanner::createHints(Q3PtrList<Hint> &hintList)
|
||||
{
|
||||
Hint hint;
|
||||
int x0 = -1;
|
||||
|
||||
for (int y = 0; y < tilesY; y++) {
|
||||
int x;
|
||||
for (x = 0; x < tilesX; x++) {
|
||||
int idx = x + y * tilesX;
|
||||
if (tileMap[idx]) {
|
||||
int ty = tileRegionMap[idx].firstLine;
|
||||
int th = tileRegionMap[idx].lastLine - ty +1;
|
||||
if (x0 < 0) {
|
||||
createHintFromTile(x * tileWidth,
|
||||
(y * tileHeight) + ty,
|
||||
th,
|
||||
hint);
|
||||
x0 = x;
|
||||
|
||||
} else {
|
||||
addTileToHint(x * tileWidth,
|
||||
(y * tileHeight) + ty,
|
||||
th,
|
||||
hint);
|
||||
}
|
||||
}
|
||||
else
|
||||
flushHint(x, y, x0, hint, hintList);
|
||||
}
|
||||
flushHint(x, y, x0, hint, hintList);
|
||||
}
|
||||
}
|
||||
|
||||
void XUpdateScanner::testScanline(int y, bool rememberHits) {
|
||||
if (y < 0)
|
||||
return;
|
||||
if (y >= (int)height)
|
||||
return;
|
||||
|
||||
int x = 0;
|
||||
bool hit = false;
|
||||
if (useShm)
|
||||
XShmGetImage(dpy, window, scanline, 0, y, AllPlanes);
|
||||
else
|
||||
XGetSubImage(dpy, window, 0, y, width, 1,
|
||||
AllPlanes, ZPixmap, scanline, 0, 0);
|
||||
|
||||
while (x < width) {
|
||||
int pixelsize = bitsPerPixel >> 3;
|
||||
unsigned char *src = (unsigned char*) scanline->data +
|
||||
x * pixelsize;
|
||||
unsigned char *dest = fb +
|
||||
y * bytesPerLine + x * pixelsize;
|
||||
int w = (x + 32) > width ? (width-x) : 32;
|
||||
if (memcmp(dest, src, w * pixelsize)) {
|
||||
hit = true;
|
||||
tileMap[(x / tileWidth) +
|
||||
(y / tileHeight) * tilesX] = true;
|
||||
}
|
||||
x += 32;
|
||||
}
|
||||
|
||||
if (!rememberHits)
|
||||
return;
|
||||
|
||||
for (int i = 1; i < MAX_RECENT_HITS; i++)
|
||||
recentHitScanlines[i-1] = recentHitScanlines[i];
|
||||
recentHitScanlines[MAX_RECENT_HITS-1] = y;
|
||||
}
|
||||
|
||||
void XUpdateScanner::searchUpdates(Q3PtrList<Hint> &hintList, int ptrY)
|
||||
{
|
||||
count++;
|
||||
count %= SCANLINES;
|
||||
|
||||
unsigned int i;
|
||||
unsigned int y;
|
||||
|
||||
for (i = 0; i < (tilesX * tilesY); i++) {
|
||||
tileMap[i] = false;
|
||||
}
|
||||
|
||||
// test last scanlines with hits
|
||||
for (i = 0; i < MAX_RECENT_HITS; i++)
|
||||
testScanline(recentHitScanlines[i], true);
|
||||
|
||||
// test scanlines around the cursor
|
||||
for (i = 0; i < CURSOR_SCANLINES; i++)
|
||||
testScanline(ptrY+cursorScanlines[i], false);
|
||||
// test last/first line of the tiles around the cursor
|
||||
// (assumes tileHeight = 32)
|
||||
testScanline((ptrY&0xffe0)-1, false);
|
||||
testScanline((ptrY|0x1f)+1, false);
|
||||
|
||||
// test every SCANLINESth scanline
|
||||
y = scanlines[count];
|
||||
while (y < (int)height) {
|
||||
testScanline(y, true);
|
||||
y += SCANLINES;
|
||||
}
|
||||
|
||||
copyAllTiles();
|
||||
|
||||
createHints(hintList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2000 heXoNet Support GmbH, D-66424 Homburg.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef _hexonet_rfb_XUpdateScanner_h_
|
||||
#define _hexonet_rfb_XUpdateScanner_h_
|
||||
|
||||
#include <q3ptrlist.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
|
||||
|
||||
class Hint {
|
||||
public:
|
||||
int x, y, w, h;
|
||||
|
||||
Hint() :
|
||||
x(0),
|
||||
y(0),
|
||||
w(0),
|
||||
h(0)
|
||||
{}
|
||||
Hint(Hint &h) :
|
||||
x(h.x),
|
||||
y(h.y),
|
||||
w(h.w),
|
||||
h(h.h)
|
||||
{
|
||||
}
|
||||
int left() {
|
||||
return x;
|
||||
}
|
||||
int right() {
|
||||
return x+w;
|
||||
}
|
||||
int top() {
|
||||
return y;
|
||||
}
|
||||
int bottom() {
|
||||
return y+h;
|
||||
}
|
||||
};
|
||||
|
||||
struct TileChangeRegion {
|
||||
short firstLine, lastLine;
|
||||
};
|
||||
|
||||
|
||||
class XUpdateScanner
|
||||
{
|
||||
public:
|
||||
XUpdateScanner( Display *_dpy,
|
||||
Window _window,
|
||||
unsigned char *_fb,
|
||||
int _width, int _height,
|
||||
int _bitsPerPixel, int _bytesPerLine,
|
||||
bool useXShm);
|
||||
|
||||
~XUpdateScanner();
|
||||
|
||||
// hitList: returns list of changes
|
||||
// ptrY: ptrY: position of the cursor
|
||||
void searchUpdates( Q3PtrList<Hint> &hintList, int ptrY);
|
||||
|
||||
private:
|
||||
void testScanline(int y, bool rememberHits);
|
||||
bool copyTile(int x, int y, int tx, int ty);
|
||||
void copyAllTiles();
|
||||
void flushHint(int x, int y, int &x0, Hint &hint,
|
||||
Q3PtrList<Hint> &hintList);
|
||||
void createHints(Q3PtrList<Hint> &hintList);
|
||||
void addTileToHint(int x, int y, int th, Hint &hint);
|
||||
void createHintFromTile(int x, int y, int th, Hint &hint);
|
||||
|
||||
Display *dpy;
|
||||
Window window;
|
||||
unsigned char *fb;
|
||||
int width, height;
|
||||
int bitsPerPixel, bytesPerLine;
|
||||
unsigned int tileWidth, tileHeight;
|
||||
unsigned int count;
|
||||
bool useShm;
|
||||
|
||||
XImage *scanline;
|
||||
XShmSegmentInfo shminfo_scanline;
|
||||
|
||||
XImage *tile;
|
||||
XShmSegmentInfo shminfo_tile;
|
||||
|
||||
unsigned int tilesX, tilesY;
|
||||
bool *tileMap;
|
||||
struct TileChangeRegion *tileRegionMap;
|
||||
};
|
||||
|
||||
|
||||
#endif // _hexonet_rfb_XUpdateScanner_h_
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
install( FILES kinetd_krfb_httpd.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||
install(PROGRAMS krfb_httpd DESTINATION ${BIN_INSTALL_DIR})
|
||||
@@ -1,22 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Service
|
||||
|
||||
ServiceTypes=KInetDModule
|
||||
Exec=krfb_httpd
|
||||
X-KDE-FactoryName=kinetd
|
||||
X-KDE-KINETD-id=krfb_httpd
|
||||
X-KDE-KINETD-port=5800
|
||||
X-KDE-KINETD-autoPortRange=10
|
||||
X-KDE-KINETD-enabled=false
|
||||
X-KDE-KINETD-argument=--kinetd
|
||||
X-KDE-KINETD-multiInstance=false
|
||||
X-KDE-KINETD-serviceLifetime=1200
|
||||
|
||||
Name=KRfb Micro Httpd
|
||||
Name[fr]=Micro serveur httpd de KRfb
|
||||
Name[x-test]=xxKRfb Micro Httpdxx
|
||||
Comment=A micro http daemon for krfb that serves the VNC viewer applet.
|
||||
Comment[el]=Ένας μικρός δαίμονας http για το krfb που εξυπηρετεί το εφαρμογίδιο προβολής VNC.
|
||||
Comment[fr]=Un mini serveur http pour KRfb dédié à l'applet d'affichage de bureaux VNC.
|
||||
Comment[x-test]=xxA micro http daemon for krfb that serves the VNC viewer applet.xx
|
||||
@@ -1 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
3
krfbconfig.kcfgc
Normal file
@@ -0,0 +1,3 @@
|
||||
File=krfb.kcfg
|
||||
ClassName=KrfbConfig
|
||||
Singleton=true
|
||||
322
krfbserver.cpp
Normal file
@@ -0,0 +1,322 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
|
||||
(C) 2001-2003 by Tim Jansen <tim@tjansen.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
|
||||
#include "krfbserver.h"
|
||||
#include "krfbserver.moc"
|
||||
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
#include <QTimer>
|
||||
#include <QHostInfo>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QPointer>
|
||||
|
||||
#include <KGlobal>
|
||||
#include <KUser>
|
||||
#include <KLocale>
|
||||
#include <KDebug>
|
||||
#include <KMessageBox>
|
||||
#include <dnssd/publicservice.h>
|
||||
|
||||
#include "connectioncontroller.h"
|
||||
#include "framebuffer.h"
|
||||
#include "framebuffermanager.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "invitationmanager.h"
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
|
||||
|
||||
static const char* cur=
|
||||
" "
|
||||
" x "
|
||||
" xx "
|
||||
" xxx "
|
||||
" xxxx "
|
||||
" xxxxx "
|
||||
" xxxxxx "
|
||||
" xxxxxxx "
|
||||
" xxxxxxxx "
|
||||
" xxxxxxxxx "
|
||||
" xxxxxxxxxx "
|
||||
" xxxxx "
|
||||
" xx xxx "
|
||||
" x xxx "
|
||||
" xxx "
|
||||
" xxx "
|
||||
" xxx "
|
||||
" xxx "
|
||||
" ";
|
||||
|
||||
static const char* mask=
|
||||
"xx "
|
||||
"xxx "
|
||||
"xxxx "
|
||||
"xxxxx "
|
||||
"xxxxxx "
|
||||
"xxxxxxx "
|
||||
"xxxxxxxx "
|
||||
"xxxxxxxxx "
|
||||
"xxxxxxxxxx "
|
||||
"xxxxxxxxxxx "
|
||||
"xxxxxxxxxxxx "
|
||||
"xxxxxxxxxx "
|
||||
"xxxxxxxx "
|
||||
"xxxxxxxx "
|
||||
"xx xxxxx "
|
||||
" xxxxx "
|
||||
" xxxxx "
|
||||
" xxxxx "
|
||||
" xxx ";
|
||||
|
||||
static rfbCursorPtr myCursor;
|
||||
|
||||
|
||||
static enum rfbNewClientAction newClientHook(struct _rfbClientRec *cl)
|
||||
{
|
||||
KrfbServer *server = KrfbServer::self();
|
||||
return server->handleNewClient(cl);
|
||||
}
|
||||
|
||||
static rfbBool passwordCheck(rfbClientPtr cl,
|
||||
const char* encryptedPassword,
|
||||
int len)
|
||||
{
|
||||
ConnectionController *cc = static_cast<ConnectionController *>(cl->clientData);
|
||||
return cc->handleCheckPassword(cl, encryptedPassword, len);
|
||||
}
|
||||
|
||||
static void keyboardHook(rfbBool down, rfbKeySym keySym, rfbClientPtr cl)
|
||||
{
|
||||
ConnectionController *cc = static_cast<ConnectionController *>(cl->clientData);
|
||||
cc->handleKeyEvent(down ? true : false, keySym);
|
||||
}
|
||||
|
||||
static void pointerHook(int bm, int x, int y, rfbClientPtr cl)
|
||||
{
|
||||
ConnectionController *cc = static_cast<ConnectionController *>(cl->clientData);
|
||||
cc->handlePointerEvent(bm, x, y);
|
||||
}
|
||||
|
||||
static void clipboardHook(char* str,int len, rfbClientPtr cl)
|
||||
{
|
||||
ConnectionController *cc = static_cast<ConnectionController *>(cl->clientData);
|
||||
cc->clipboardToServer(QString::fromUtf8(str, len));
|
||||
}
|
||||
|
||||
|
||||
class KrfbServer::KrfbServerP {
|
||||
|
||||
public:
|
||||
KrfbServerP() : screen(0), numClients(0) {};
|
||||
|
||||
QSharedPointer<FrameBuffer> fb;
|
||||
QList< QPointer<ConnectionController> > controllers;
|
||||
rfbScreenInfoPtr screen;
|
||||
int numClients;
|
||||
QByteArray desktopName;
|
||||
QTimer rfbProcessEventTimer;
|
||||
};
|
||||
|
||||
class KrfbServerPrivate
|
||||
{
|
||||
public:
|
||||
KrfbServer instance;
|
||||
};
|
||||
|
||||
K_GLOBAL_STATIC(KrfbServerPrivate, krfbServerPrivate)
|
||||
|
||||
KrfbServer * KrfbServer::self() {
|
||||
return &krfbServerPrivate->instance;
|
||||
}
|
||||
|
||||
|
||||
KrfbServer::KrfbServer()
|
||||
:d(new KrfbServerP)
|
||||
{
|
||||
kDebug() << "starting ";
|
||||
d->fb = FrameBufferManager::instance()->frameBuffer(QApplication::desktop()->winId());
|
||||
QTimer::singleShot(0, this, SLOT(startListening()));
|
||||
connect(InvitationManager::self(), SIGNAL(invitationNumChanged(int)),SLOT(updatePassword()));
|
||||
}
|
||||
|
||||
KrfbServer::~KrfbServer()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
||||
void KrfbServer::startListening()
|
||||
{
|
||||
rfbScreenInfoPtr screen;
|
||||
|
||||
int port = KrfbConfig::port();
|
||||
|
||||
int w = d->fb->width();
|
||||
int h = d->fb->height();
|
||||
int depth = d->fb->depth();
|
||||
|
||||
int bpp = depth >> 3;
|
||||
if (bpp != 1 && bpp != 2 && bpp != 4) bpp = 4;
|
||||
kDebug() << "bpp: " << bpp;
|
||||
|
||||
rfbLogEnable(0);
|
||||
screen = rfbGetScreen(0, 0, w, h, 8, 3, bpp);
|
||||
|
||||
screen->paddedWidthInBytes = d->fb->paddedWidth();
|
||||
|
||||
d->fb->getServerFormat(screen->serverFormat);
|
||||
|
||||
screen->frameBuffer = d->fb->data();
|
||||
d->screen = screen;
|
||||
screen->autoPort = 0;
|
||||
screen->port = port;
|
||||
|
||||
// server hooks
|
||||
screen->newClientHook = newClientHook;
|
||||
|
||||
screen->kbdAddEvent = keyboardHook;
|
||||
screen->ptrAddEvent = pointerHook;
|
||||
screen->newClientHook = newClientHook;
|
||||
screen->passwordCheck = passwordCheck;
|
||||
screen->setXCutText = clipboardHook;
|
||||
|
||||
d->desktopName = i18n("%1@%2 (shared desktop)", KUser().loginName(), QHostInfo::localHostName()).toLatin1();
|
||||
screen->desktopName = d->desktopName.constData();
|
||||
|
||||
if (!myCursor) {
|
||||
myCursor = rfbMakeXCursor(19, 19, (char*) cur, (char*) mask);
|
||||
}
|
||||
screen->cursor = myCursor;
|
||||
|
||||
// configure passwords and desktop control here
|
||||
updateSettings();
|
||||
|
||||
rfbInitServer(screen);
|
||||
if (!rfbIsActive(screen)) {
|
||||
KMessageBox::error(0,i18n("Address already in use"),"krfb");
|
||||
shutdown();
|
||||
qApp->quit();
|
||||
return;
|
||||
};
|
||||
|
||||
if (KrfbConfig::publishService()) {
|
||||
DNSSD::PublicService *service = new DNSSD::PublicService(i18n("%1@%2 (shared desktop)", KUser().loginName(), QHostInfo::localHostName()),"_rfb._tcp",port);
|
||||
service->publishAsync();
|
||||
}
|
||||
|
||||
/* Integrate the rfb event mechanism with qt's event loop.
|
||||
* Call processRfbEvents() every time the qt event loop is run,
|
||||
* so that it also processes and delivers rfb events and call
|
||||
* shutdown() when QApplication exits to shutdown the rfb server
|
||||
* before the X11 connection goes down.
|
||||
*/
|
||||
connect(&d->rfbProcessEventTimer, SIGNAL(timeout()), SLOT(processRfbEvents()));
|
||||
connect(qApp, SIGNAL(aboutToQuit()), SLOT(shutdown()));
|
||||
d->rfbProcessEventTimer.start(0);
|
||||
}
|
||||
|
||||
void KrfbServer::processRfbEvents()
|
||||
{
|
||||
foreach(const QRect &r, d->fb->modifiedTiles()) {
|
||||
rfbMarkRectAsModified(d->screen, r.x(), r.y(), r.right(), r.bottom());
|
||||
}
|
||||
rfbProcessEvents(d->screen, 100);
|
||||
}
|
||||
|
||||
void KrfbServer::shutdown()
|
||||
{
|
||||
rfbShutdownServer(d->screen, true);
|
||||
// framebuffer has to be deleted before X11 connection goes down
|
||||
d->fb.clear();
|
||||
}
|
||||
|
||||
|
||||
void KrfbServer::enableDesktopControl(bool enable)
|
||||
{
|
||||
foreach (QPointer<ConnectionController> ptr, d->controllers) {
|
||||
if (ptr) {
|
||||
if (ptr->controlCanBeEnabled()) {
|
||||
ptr->setControlEnabled(enable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum rfbNewClientAction KrfbServer::handleNewClient(struct _rfbClientRec * cl)
|
||||
{
|
||||
ConnectionController *cc = new ConnectionController(cl, this);
|
||||
if (d->numClients++ == 0)
|
||||
d->fb->startMonitor();
|
||||
|
||||
d->controllers.append(cc);
|
||||
cc->setControlEnabled(KrfbConfig::allowDesktopControl());
|
||||
cc->setControlCanBeEnabled(KrfbConfig::allowDesktopControl());
|
||||
|
||||
connect(cc, SIGNAL(sessionEstablished(QString)), SIGNAL(sessionEstablished(QString)));
|
||||
connect(cc, SIGNAL(clientDisconnected(ConnectionController *)),SLOT(clientDisconnected(ConnectionController *)));
|
||||
|
||||
return cc->handleNewClient();
|
||||
}
|
||||
|
||||
void KrfbServer::updateSettings()
|
||||
{
|
||||
enableDesktopControl(KrfbConfig::allowDesktopControl());
|
||||
updatePassword();
|
||||
}
|
||||
|
||||
void KrfbServer::updatePassword()
|
||||
{
|
||||
|
||||
if (!d->screen) return;
|
||||
QString pw = KrfbConfig::uninvitedConnectionPassword();
|
||||
kDebug() << "password: " << pw << " allow " <<
|
||||
KrfbConfig::allowUninvitedConnections() <<
|
||||
" invitations " << InvitationManager::self()->activeInvitations() << endl;
|
||||
|
||||
if (pw.isEmpty() && InvitationManager::self()->activeInvitations() == 0) {
|
||||
kDebug() << "no password from now on";
|
||||
d->screen->authPasswdData = (void *)0;
|
||||
} else {
|
||||
kDebug() << "Ask for password to accept connections";
|
||||
d->screen->authPasswdData = (void *)1;
|
||||
}
|
||||
}
|
||||
|
||||
bool KrfbServer::checkX11Capabilities() {
|
||||
int bp1, bp2, majorv, minorv;
|
||||
Bool r = XTestQueryExtension(QX11Info::display(), &bp1, &bp2,
|
||||
&majorv, &minorv);
|
||||
if ((!r) || (((majorv*1000)+minorv) < 2002)) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Your X11 Server does not support the required XTest extension version 2.2. Sharing your desktop is not possible."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void KrfbServer::clientDisconnected(ConnectionController *cc)
|
||||
{
|
||||
kDebug() << "clients--: " << d->numClients;
|
||||
if (!--d->numClients) {
|
||||
d->fb->stopMonitor();
|
||||
kDebug() << "stopMonitor: d->numClients = " << d->numClients;
|
||||
}
|
||||
disconnect(cc, SIGNAL(clientDisconnected(ConnectionController*)),this, SLOT(clientDisconnected(ConnectionController*)));
|
||||
|
||||
Q_EMIT sessionFinished();
|
||||
}
|
||||
|
||||
|
||||
59
krfbserver.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* 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 KRFBSERVER_H
|
||||
#define KRFBSERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <rfb/rfb.h>
|
||||
|
||||
class ConnectionController;
|
||||
/**
|
||||
This class implements the listening server for the RFB protocol.
|
||||
|
||||
@author Alessandro Praduroux <pradu@pradu.it>
|
||||
*/
|
||||
class KrfbServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class KrfbServerPrivate;
|
||||
public:
|
||||
|
||||
static KrfbServer *self();
|
||||
|
||||
~KrfbServer();
|
||||
|
||||
enum rfbNewClientAction handleNewClient(struct _rfbClientRec *cl);
|
||||
bool checkX11Capabilities();
|
||||
|
||||
signals:
|
||||
void sessionEstablished(QString);
|
||||
void sessionFinished();
|
||||
void desktopControlSettingChanged(bool);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
void startListening();
|
||||
void processRfbEvents();
|
||||
void shutdown();
|
||||
void enableDesktopControl(bool);
|
||||
void updateSettings();
|
||||
void updatePassword();
|
||||
void clientDisconnected(ConnectionController *);
|
||||
|
||||
private:
|
||||
KrfbServer();
|
||||
static KrfbServer *_self;
|
||||
|
||||
class KrfbServerP;
|
||||
KrfbServerP * const d;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,141 +0,0 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct {
|
||||
char* filename; /* this file is the pipe (set by user) */
|
||||
char is_server; /* this is set by open_control_file */
|
||||
int fd; /* this is set by open_control_file */
|
||||
} single_instance_struct;
|
||||
|
||||
/* returns fd, is_server is set to -1 if server, 0 if client */
|
||||
int open_control_file(single_instance_struct* str)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if(stat(str->filename,&buf)) {
|
||||
mkfifo(str->filename,128|256);
|
||||
str->is_server=-1;
|
||||
str->fd=open(str->filename,O_NONBLOCK|O_RDONLY);
|
||||
} else {
|
||||
str->fd=open(str->filename,O_NONBLOCK|O_WRONLY);
|
||||
if(errno==ENXIO) {
|
||||
str->is_server=-1;
|
||||
str->fd=open(str->filename,O_NONBLOCK|O_RDONLY);
|
||||
} else
|
||||
str->is_server=0;
|
||||
}
|
||||
|
||||
return(str->fd);
|
||||
}
|
||||
|
||||
void delete_control_file(single_instance_struct* str)
|
||||
{
|
||||
remove(str->filename);
|
||||
}
|
||||
|
||||
void close_control_file(single_instance_struct* str)
|
||||
{
|
||||
close(str->fd);
|
||||
}
|
||||
|
||||
typedef void (*event_dispatcher)(char* message);
|
||||
|
||||
int get_next_message(char* buffer,int len,single_instance_struct* str,int usecs)
|
||||
{
|
||||
struct timeval tv;
|
||||
fd_set fdset;
|
||||
int num_fds;
|
||||
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(str->fd,&fdset);
|
||||
tv.tv_sec=0;
|
||||
tv.tv_usec=usecs;
|
||||
|
||||
num_fds=select(str->fd+1,&fdset,NULL,NULL,&tv);
|
||||
if(num_fds) {
|
||||
int reallen;
|
||||
|
||||
reallen=read(str->fd,buffer,len);
|
||||
if(reallen==0) {
|
||||
close(str->fd);
|
||||
str->fd=open(str->filename,O_NONBLOCK|O_RDONLY);
|
||||
num_fds--;
|
||||
}
|
||||
buffer[reallen]=0;
|
||||
#ifdef DEBUG_1INSTANCE
|
||||
if(reallen!=0) fprintf(stderr,"message received: %s.\n",buffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
return(num_fds);
|
||||
}
|
||||
|
||||
int dispatch_event(single_instance_struct* str,event_dispatcher dispatcher,int usecs)
|
||||
{
|
||||
char buffer[1024];
|
||||
int num_fds;
|
||||
|
||||
if((num_fds=get_next_message(buffer,1024,str,usecs)) && buffer[0])
|
||||
dispatcher(buffer);
|
||||
|
||||
return(num_fds);
|
||||
}
|
||||
|
||||
int loop_if_server(single_instance_struct* str,event_dispatcher dispatcher)
|
||||
{
|
||||
open_control_file(str);
|
||||
if(str->is_server) {
|
||||
while(1)
|
||||
dispatch_event(str,dispatcher,50);
|
||||
}
|
||||
|
||||
return(str->fd);
|
||||
}
|
||||
|
||||
void send_message(single_instance_struct* str,char* message)
|
||||
{
|
||||
#ifdef DEBUG_1INSTANCE
|
||||
int i=
|
||||
#endif
|
||||
write(str->fd,message,strlen(message));
|
||||
#ifdef DEBUG_1INSTANCE
|
||||
fprintf(stderr,"send: %s => %d(%d)\n",message,i,strlen(message));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MAIN
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
single_instance_struct str1 = { "/tmp/1instance" };
|
||||
|
||||
void my_dispatcher(char* message)
|
||||
{
|
||||
#ifdef DEBUG_1INSTANCE
|
||||
fprintf(stderr,"Message arrived: %s.\n",message);
|
||||
#endif
|
||||
if(!strcmp(message,"quit")) {
|
||||
delete_control_file(str1);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
loop_if_server(str1,my_dispatcher);
|
||||
|
||||
for(i=1;i<argc;i++)
|
||||
send_event(str1,argv[i]);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,75 +0,0 @@
|
||||
memory leaks squashed (localtime pseudo leak is still there :-)
|
||||
small improvements for OSXvnc (still not working correctly)
|
||||
synced with TightVNC 1.2.3
|
||||
solaris compile cleanups
|
||||
many x11vnc improvements
|
||||
added backchannel, an encoding which needs special clients to pass
|
||||
arbitrary data to the client
|
||||
changes from Tim Jansen regarding multi threading and client blocking
|
||||
as well as C++ compliancy
|
||||
x11vnc can be controlled by starting again with special options if compiling
|
||||
with LOCAL_CONTROL defined
|
||||
0.3
|
||||
added x11vnc, a x0rfbserver clone
|
||||
regard deferUpdateTime in processEvents, if usec<0
|
||||
initialize deferUpdateTime (memory "leak"!)
|
||||
changed command line handling (arguments are parsed and then removed)
|
||||
added very simple example: zippy
|
||||
added rfbDrawLine, rfbDrawPixel
|
||||
0.2
|
||||
inserted a deferUpdate mechanism (X11 independent).
|
||||
removed deletion of requestedRegion
|
||||
added rfbLoadConsoleFont
|
||||
fixed font colour handling.
|
||||
added rfbSelectBox
|
||||
added rfbDrawCharWithClip to allow for clipping and a background colour.
|
||||
fixed font colours
|
||||
added rfbFillRect
|
||||
added IO function to check password.
|
||||
rfbNewClient now sets the socket in the fd_set (for the select() call)
|
||||
when compiling the library with HAVE_PTHREADS and an application
|
||||
which includes "rfb.h" without, the structures got mixed up.
|
||||
So, the pthreads section is now always at the end, and also
|
||||
you get a linker error for rfbInitServer when using two different
|
||||
pthread setups.
|
||||
fixed two deadlocks: when setting a cursor and when using CopyRect
|
||||
fixed CopyRect when copying modified regions (they lost the modified
|
||||
property)
|
||||
WIN32 target compiles and works for example :-)
|
||||
fixed CopyRect (was using the wrong order of rectangles...)
|
||||
should also work with pthreads, because copyrects are
|
||||
always sent immediately (so that two consecutive copy rects
|
||||
cannot conflict).
|
||||
changed rfbUndrawCursor(rfbClientPtr) to (rfbScreenInfoPtr), because
|
||||
this makes more sense!
|
||||
flag backgroundLoop in rfbScreenInfo (if having pthreads)
|
||||
CopyRect & CopyRegion were implemented.
|
||||
if you use a rfbDoCopyR* function, it copies the data in the
|
||||
framebuffer. If you prefer to do that yourself, use rfbScheduleCopyR*
|
||||
instead; this doesn't modify the frameBuffer.
|
||||
added flag to optionally not send XCursor updates, but only RichCursor,
|
||||
or if that is not possible, fall back to server side cursor.
|
||||
This is useful if your cursor has many nice colours.
|
||||
fixed java viewer on server side:
|
||||
SendCursorUpdate would send data even before the client pixel format
|
||||
was set, but the java applet doesn't like the server's format.
|
||||
fixed two pthread issues:
|
||||
rfbSendFramebuffer was sent by a ProcessClientMessage function
|
||||
(unprotected by updateMutex).
|
||||
cursor coordinates were set without protection by cursorMutex
|
||||
source is now equivalent to TridiaVNC 1.2.1
|
||||
pthreads now work (use iterators!)
|
||||
cursors are supported (rfbSetCursor automatically undraws cursor)
|
||||
support for 3 bytes/pixel (slow!)
|
||||
server side colourmap support
|
||||
fixed rfbCloseClient not to close the connection (pthreads!)
|
||||
this is done lazily (and with proper signalling).
|
||||
cleaned up mac.c (from original OSXvnc); now compiles (untested!)
|
||||
compiles cleanly on Linux, IRIX, BSD, Apple (Darwin)
|
||||
fixed prototypes
|
||||
0.1
|
||||
rewrote API to use pseudo-methods instead of required functions.
|
||||
lots of clean up.
|
||||
Example can show symbols now.
|
||||
All encodings
|
||||
HTTP
|
||||
@@ -1,340 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Steet, 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
|
||||
|
||||
Appendix: 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 Steet, 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.
|
||||
@@ -1,417 +0,0 @@
|
||||
LibVNCServer: a library for easy implementation of a RDP/VNC server.
|
||||
Copyright (C) 2001 Johannes E. Schindelin
|
||||
|
||||
What is it?
|
||||
-----------
|
||||
|
||||
VNC is a set of programs using the RFB (Remote Frame Buffer) protocol. They
|
||||
are designed to "export" a frame buffer via net (if you don't know VNC, I
|
||||
suggest you read "Basics" below). It is already in wide use for
|
||||
administration, but it is not that easy to program a server yourself.
|
||||
|
||||
This has been changed by LibVNCServer.
|
||||
|
||||
There are two examples included:
|
||||
- example, a shared scribble sheet
|
||||
- pnmshow, 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: it outputs on which port it listens (default: 5900), so it is
|
||||
display 0. To view, call
|
||||
vncviewer :0
|
||||
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.
|
||||
The size 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
|
||||
vncviewer machine.where.example.runs.com:0
|
||||
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! If you are done with that demo, 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. So you press
|
||||
"Page Up" for a blank page.
|
||||
|
||||
The demo pnmshow 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.
|
||||
|
||||
How to use
|
||||
----------
|
||||
|
||||
To make a server, you just have to initialise a server structure using the
|
||||
function rfbDefaultScreenInit, like
|
||||
rfbScreenInfoPtr rfbScreen =
|
||||
rfbGetScreen(argc,argv,width,height,8,3,bpp);
|
||||
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).
|
||||
|
||||
|
||||
You then can set hooks and io functions (see below) or other
|
||||
options (see below).
|
||||
|
||||
And you allocate the frame buffer like this:
|
||||
rfbScreen->frameBuffer = (char*)malloc(width*height*bpp);
|
||||
|
||||
After that, you initialize the server, like
|
||||
rfbInitServer(rfbScreen);
|
||||
|
||||
You can use a blocking event loop, a background (pthread based) event loop,
|
||||
or implement your own using the rfbProcessEvents function.
|
||||
|
||||
Making it interactive
|
||||
---------------------
|
||||
|
||||
Input is handled by IO functions (see below).
|
||||
|
||||
Whenever you change something in the frame buffer, call rfbMarkRectAsModified.
|
||||
You should make sure that the cursor is not drawn before drawing yourself
|
||||
by calling rfbUndrawCursor. You can also draw the cursor using rfbDrawCursor,
|
||||
but it hardly seems necessary. For cursor details, see below.
|
||||
|
||||
Utility functions
|
||||
-----------------
|
||||
|
||||
Whenever you draw something, you have to call
|
||||
rfbMarkRectAsModified(screen,x1,y1,x2,y2).
|
||||
This tells LibVNCServer to send updates to all connected clients.
|
||||
|
||||
Before you draw something, be sure to call
|
||||
rfbUndrawCursor(screen).
|
||||
This tells LibVNCServer to hide the cursor.
|
||||
Remark: There are vncviewers out there, which know a cursor encoding, so
|
||||
that network traffic is low, and also the cursor doesn't need to be
|
||||
drawn the cursor everytime an update is sent. LibVNCServer handles
|
||||
all the details. Just set the cursor and don't bother any more.
|
||||
|
||||
To set the mouse coordinates (or emulate mouse clicks), call
|
||||
defaultPtrAddEvent(buttonMask,x,y,cl);
|
||||
However, this works only if your client doesn't do local cursor drawing. There
|
||||
is no way (to my knowledge) to set the pointer of a client via RFB protocol.
|
||||
IMPORTANT: do this at the end of your function, because this actually draws
|
||||
the cursor if no cursor encoding is active.
|
||||
|
||||
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
|
||||
rfbScreenInfoPtr screen
|
||||
which points to the server and a member
|
||||
rfbClientPtr next
|
||||
to the next client.
|
||||
|
||||
The rfbScreenInfo structure holds a member
|
||||
rfbClientPtr rfbClientHead
|
||||
which points to the first client.
|
||||
|
||||
So, to access the server from the client structure, you use client->screen.
|
||||
To access all clients from a server, get screen->rfbClientHead and
|
||||
iterate using client->next.
|
||||
|
||||
If you change client settings, be sure to use the provided iterator
|
||||
rfbGetClientIterator(rfbScreen)
|
||||
with
|
||||
rfbClientIteratorNext(iterator)
|
||||
and
|
||||
rfbReleaseClientIterator
|
||||
to prevent thread clashes.
|
||||
|
||||
Other options
|
||||
-------------
|
||||
|
||||
These options have to be set between rfbGetScreen and rfbInitServer.
|
||||
|
||||
If you already have a socket to talk to, just set rfbScreen->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 rfbScreen->httpdDir to a directory containing vncviewer.jar and
|
||||
index.vnc (like the included "classes" directory).
|
||||
|
||||
Hooks and IO functions
|
||||
----------------------
|
||||
|
||||
There exist the following IO functions as members of rfbScreen:
|
||||
kbdAddEvent, kbdReleaseAllKeys, ptrAddEvent and setXCutText
|
||||
|
||||
kbdAddEvent(Bool down,KeySym key,rfbClientPtr cl)
|
||||
is called when a key is pressed.
|
||||
kbdReleaseAllKeys(rfbClientPtr cl)
|
||||
is not called at all (maybe in the future).
|
||||
ptrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl)
|
||||
is called when the mouse moves or a button is pressed.
|
||||
WARNING: if you want to have proper cursor handling, call
|
||||
defaultPtrAddEvent(buttonMask,x,y,cl)
|
||||
in your own function. This sets the coordinates of the cursor.
|
||||
setXCutText(char* str,int len,rfbClientPtr cl)
|
||||
is called when the selection changes.
|
||||
|
||||
There are only two hooks:
|
||||
newClientHook(rfbClientPtr cl)
|
||||
is called when a new client has connected.
|
||||
displayHook
|
||||
is called just before a frame buffer update is sent.
|
||||
|
||||
You can also override the following methods:
|
||||
getCursorPtr(rfbClientPtr cl)
|
||||
This could be used to make an animated cursor (if you really want ...)
|
||||
setTranslateFunction(rfbClientPtr cl)
|
||||
If you insist on colour maps or something more obscure, you have to
|
||||
implement this. Default is a trueColour mapping.
|
||||
|
||||
Cursor handling
|
||||
---------------
|
||||
|
||||
The screen holds a pointer
|
||||
rfbCursorPtr 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 mask
|
||||
describes, which pixels are drawn for the cursor (a cursor needn't be
|
||||
rectangular). The 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:
|
||||
|
||||
char* cur=" "
|
||||
" xx "
|
||||
" x "
|
||||
" ";
|
||||
char* mask="xxxx"
|
||||
"xxxx"
|
||||
"xxxx"
|
||||
"xxx ";
|
||||
rfbCursorPtr c=rfbMakeXCursor(4,4,cur,mask);
|
||||
|
||||
You can even set "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 "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).
|
||||
|
||||
History
|
||||
-------
|
||||
|
||||
LibVNCServer is based on Tridia VNC and OSXvnc, which in turn are based on
|
||||
the original code from ORL/AT&T.
|
||||
|
||||
When I began hacking with computers, my first interest was speed. So, when I
|
||||
got around assembler, I programmed the floppy to do much of the work, because
|
||||
it's clock rate was higher than that of my C64. This was my first experience
|
||||
with client/server techniques.
|
||||
|
||||
When I came around Xwindows (much later), I was at once intrigued by the
|
||||
elegance of such connectedness between the different computers. I used it
|
||||
a lot - not the least priority lay on games. However, when I tried it over
|
||||
modem from home, it was no longer that much fun.
|
||||
|
||||
When I started working with ASP (Application Service Provider) programs, I
|
||||
tumbled across Tarantella and Citrix. Being a security fanatic, the idea of
|
||||
running a server on windows didn't appeal to me, so Citrix went down the
|
||||
basket. However, Tarantella has it's own problems (security as well as the
|
||||
high price). But at the same time somebody told me about this "great little
|
||||
administrator's tool" named VNC. Being used to windows programs' sizes, the
|
||||
surprise was reciprocal inverse to the size of VNC!
|
||||
|
||||
At the same time, the program "rdesktop" (a native Linux client for the
|
||||
Terminal Services of Windows servers) came to my attention. There where even
|
||||
works under way to make a protocol converter "rdp2vnc" out of this. However,
|
||||
my primary goal was a slow connection and rdp2vnc could only speak RRE
|
||||
encoding, which is not that funny with just 5kB/s. Tim Edmonds, the original
|
||||
author of rdp2vnc, suggested that I adapt it to Hextile Encoding, which is
|
||||
better. I first tried that, but had no success at all (crunchy pictures).
|
||||
|
||||
Also, I liked the idea of an HTTP server included and possibly other
|
||||
encodings like the Tight Encodings from Const Kaplinsky. So I started looking
|
||||
for libraries implementing a VNC server where I could steal what I can't make.
|
||||
I found some programs based on the demo server from AT&T, which was also the
|
||||
basis for rdp2vnc (can only speak Raw and RRE encoding). There were some
|
||||
rumors that GGI has a VNC backend, but I didn't find any code, so probably
|
||||
there wasn't a working version anyway.
|
||||
|
||||
All of a sudden, everything changed: I read on freshmeat that "OSXvnc" was
|
||||
released. I looked at the code and it was not much of a problem to work out
|
||||
a simple server - using every functionality there is in Xvnc. It became clear
|
||||
to me that I *had* to build a library out of it, so everybody can use it.
|
||||
Every change, every new feature can propagate to every user of it.
|
||||
|
||||
It also makes everything easier:
|
||||
You don't care about the cursor, once set (or use the standard cursor).
|
||||
You don't care about those sockets. You don't care about encodings.
|
||||
You just change your frame buffer and inform the library about it. Every once
|
||||
in a while you call rfbProcessEvents and that's it.
|
||||
|
||||
Basics
|
||||
------
|
||||
|
||||
VNC (Virtual network computing) works like this: You set up a server and can
|
||||
connect to it via vncviewers. The communication uses a protocol named RFB
|
||||
(Remote Frame Buffer). If the server supports HTTP, you can also connect
|
||||
using a java enabled browser. In this case, the server sends back a
|
||||
vncviewer applet with the correct settings.
|
||||
|
||||
There exist several encodings for VNC, which are used to compress the regions
|
||||
which have changed before they are sent to the client. A client need not be
|
||||
able to understand every encoding, but at least Raw encoding. Which encoding
|
||||
it understands is negotiated by the RFB protocol.
|
||||
|
||||
The following encodings are known to me:
|
||||
Raw, RRE, CoRRE, Hextile, CopyRect from the original AT&T code and
|
||||
Tight, ZLib, LastRect, XCursor, RichCursor from Const Kaplinsky et al.
|
||||
|
||||
If you are using a modem, you want to try the "new" encodings. Especially
|
||||
with my 56k modem I like ZLib or Tight with Quality 0. In my tests, it even
|
||||
beats Tarantella.
|
||||
|
||||
There is the possibility to set a password, which is also negotiated by the
|
||||
RFB protocol, but IT IS NOT SECURE. Anybody sniffing your net can get the
|
||||
password. You really should tunnel through SSH.
|
||||
|
||||
Windows or: why do you do that to me?
|
||||
--------------------------------------------
|
||||
|
||||
If you love products from Redmod, you better skip this paragraph.
|
||||
I am always amazed how people react whenever Microsoft(tm) puts in some
|
||||
features into their products which were around for a long time. Especially
|
||||
reporters seem to not know dick about what they are reporting about! But
|
||||
what is everytime annoying again, is that they don't do it right. Every
|
||||
concept has it's new name (remember what enumerators used to be until
|
||||
Mickeysoft(tm) claimed that enumerators are what we thought were iterators.
|
||||
Yeah right, enumerators are also containers. They are not separate. Muddy.)
|
||||
|
||||
There are three packages you want to get hold of: zlib, jpeg and pthreads.
|
||||
The latter is not strictly necessary, but when you put something like this
|
||||
into your source:
|
||||
|
||||
#define MUTEX(s)
|
||||
struct {
|
||||
int something;
|
||||
MUTEX(latex);
|
||||
}
|
||||
|
||||
Microsoft's C++ compiler doesn't do it. It complains that this is an error.
|
||||
|
||||
You can find the packages at
|
||||
http://www.gimp.org/win32/extralibs-dev-20001007.zip
|
||||
|
||||
Thanks go to all the GIMP team!
|
||||
|
||||
What are those other targets in the Makefile?
|
||||
---------------------------------------------
|
||||
|
||||
OSXvnc-server is the original OSXvnc adapted to use the library, which was in
|
||||
turn adapted from OSXvnc. As you easily can see, the OSX dependend part is
|
||||
minimal.
|
||||
|
||||
storepasswd is the original program to save a vnc style password in a file.
|
||||
Unfortunately, authentication as every vncviewer speaks it means the server
|
||||
has to know the plain password. You really should tunnel via ssh or use
|
||||
your own PasswordCheck to build a PIN/TAN system.
|
||||
|
||||
sratest is a test unit. Run it to assert correct behaviour of sraRegion. I
|
||||
wrote this to test my iterator implementation.
|
||||
|
||||
blooptest is a test of pthreads. It is just the example, but with a background
|
||||
loop to hunt down thread lockups.
|
||||
|
||||
pnmshow24 is like pnmshow, but it uses 3 bytes/pixel internally, which is not
|
||||
as efficient as 4 bytes/pixel for translation, because there is no native data
|
||||
type of that size, so you have to memcpy pixels and be real cautious with
|
||||
endianness. Anyway, it works.
|
||||
|
||||
fontsel is a test for rfbSelectBox and rfbLoadConsoleFont. If you have Linux
|
||||
console fonts, you can browse them via VNC. Directory browsing not implemented
|
||||
yet :-(
|
||||
|
||||
Why I don't feel bad about GPL
|
||||
------------------------------
|
||||
|
||||
At the beginning of this projects I would have liked to make it a BSD
|
||||
license. However, it is based on plenty of GPL'ed code, so it has to be
|
||||
a GPL. I hear BeeGee complaining: "but that's invasive, every derivative
|
||||
work, even just linking, makes my software GPL!"
|
||||
|
||||
Yeah. That's right. It is because there are nasty jarheads out there who
|
||||
would take anybody's work and claim it their own, selling it for much too
|
||||
much money, stealing freedom and innovation from others, saying they were
|
||||
the maintainers of innovation, lying, making money with that.
|
||||
|
||||
The people at AT&T worked really well to produce something as clean and lean
|
||||
as VNC. The managers decided that for their fame, they would release the
|
||||
program for free. But not only that! They realized that by releasing also
|
||||
the code for free, VNC would become an evolving little child, conquering
|
||||
new worlds, making it's parents very proud. As well they can be! To protect
|
||||
this innovation, they decided to make it GPL, not BSD. The principal
|
||||
difference is: You can make closed source programs deriving from BSD, not
|
||||
from GPL. You have to give proper credit with both.
|
||||
|
||||
Now, why not BSD? Well, imagine your child being some famous actor. Along
|
||||
comes a manager who exploits your child exclusively, that is: nobody else
|
||||
can profit from the child, it itself included. Got it?
|
||||
|
||||
What reason do you have now to use this library commercially?
|
||||
|
||||
Several: You don't have to give away your product. Then you have effectively
|
||||
circumvented the GPL, because you have the benefits of other's work and you
|
||||
don't give back anything and you will be in hell for that. In fact, this
|
||||
library, as my other projects, is a payback for all the free software I can
|
||||
use (and sometimes, make better). For example, just now, I am using XEmacs
|
||||
on top X11, all running under Linux.
|
||||
|
||||
Better: Use a concept like MySQL. This is free software, however, they make
|
||||
money with it. If you want something implemented, you have the choice:
|
||||
Ask them to do it (and pay a fair price), or do it yourself, normally giving
|
||||
back your enhancements to the free world of computing.
|
||||
|
||||
Learn from it: If you like the style this is written, learn how to imitate
|
||||
it. If you don't like the style, learn how to avoid those things you don't
|
||||
like. I learnt so much, just from looking at code like Linux, XEmacs,
|
||||
LilyPond, STL, etc.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
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 Steet, Fifth Floor, Boston, MA 02110-1301, USA.dfdf
|
||||
|
||||
Contact
|
||||
-------
|
||||
|
||||
To contact me, mail me: Johannes dot Schindelin at gmx dot de
|
||||