├── Makefile ├── README.md ├── libvncview.pro ├── remoteview.cpp ├── remoteview.h ├── rfb ├── keysym.h ├── rfb.h ├── rfbclient.h ├── rfbconfig.h ├── rfbint.h ├── rfbproto.h └── rfbregion.h ├── vncclientthread.cpp ├── vncclientthread.h ├── vncview.cpp ├── vncview.h ├── vncview.pro.user └── vncview_global.h /Makefile: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Makefile for building: libvncview.so.1.0.0 3 | # Generated by qmake (3.0) (Qt 5.1.1) on: Sat Nov 2 15:41:04 2013 4 | # Project: libvncview.pro 5 | # Template: lib 6 | # Command: /usr/lib/qt/bin/qmake -o Makefile libvncview.pro 7 | ############################################################################# 8 | 9 | MAKEFILE = Makefile 10 | 11 | ####### Compiler, tools and options 12 | 13 | CC = gcc 14 | CXX = g++ 15 | DEFINES = -DQTONLY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB 16 | CFLAGS = -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wall -W -D_REENTRANT -fPIC $(DEFINES) 17 | CXXFLAGS = -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wall -W -D_REENTRANT -fPIC $(DEFINES) 18 | INCPATH = -I/usr/lib/qt/mkspecs/linux-g++ -I. -I. -Irfb -I/usr/include/qt -I/usr/include/qt/QtGui -I/usr/include/qt/QtCore -I. 19 | LINK = g++ 20 | LFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1 -shared -Wl,-soname,libvncview.so.1 21 | LIBS = $(SUBLIBS) -lvncclient -lQt5Gui -lQt5Core -lGL -lpthread 22 | AR = ar cqs 23 | RANLIB = 24 | QMAKE = /usr/lib/qt/bin/qmake 25 | TAR = tar -cf 26 | COMPRESS = gzip -9f 27 | COPY = cp -f 28 | SED = sed 29 | COPY_FILE = cp -f 30 | COPY_DIR = cp -f -R 31 | STRIP = strip 32 | INSTALL_FILE = install -m 644 -p 33 | INSTALL_DIR = $(COPY_DIR) 34 | INSTALL_PROGRAM = install -m 755 -p 35 | DEL_FILE = rm -f 36 | SYMLINK = ln -f -s 37 | DEL_DIR = rmdir 38 | MOVE = mv -f 39 | CHK_DIR_EXISTS= test -d 40 | MKDIR = mkdir -p 41 | 42 | ####### Output directory 43 | 44 | OBJECTS_DIR = ./ 45 | 46 | ####### Files 47 | 48 | SOURCES = remoteview.cpp \ 49 | vncclientthread.cpp \ 50 | vncview.cpp 51 | OBJECTS = remoteview.o \ 52 | vncclientthread.o \ 53 | vncview.o 54 | DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \ 55 | /usr/lib/qt/mkspecs/common/shell-unix.conf \ 56 | /usr/lib/qt/mkspecs/common/unix.conf \ 57 | /usr/lib/qt/mkspecs/common/linux.conf \ 58 | /usr/lib/qt/mkspecs/common/gcc-base.conf \ 59 | /usr/lib/qt/mkspecs/common/gcc-base-unix.conf \ 60 | /usr/lib/qt/mkspecs/common/g++-base.conf \ 61 | /usr/lib/qt/mkspecs/common/g++-unix.conf \ 62 | /usr/lib/qt/mkspecs/qconfig.pri \ 63 | /usr/lib/qt/mkspecs/modules/qt_lib_bootstrap.pri \ 64 | /usr/lib/qt/mkspecs/modules/qt_lib_clucene.pri \ 65 | /usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri \ 66 | /usr/lib/qt/mkspecs/modules/qt_lib_core.pri \ 67 | /usr/lib/qt/mkspecs/modules/qt_lib_dbus.pri \ 68 | /usr/lib/qt/mkspecs/modules/qt_lib_declarative.pri \ 69 | /usr/lib/qt/mkspecs/modules/qt_lib_designer.pri \ 70 | /usr/lib/qt/mkspecs/modules/qt_lib_designercomponents.pri \ 71 | /usr/lib/qt/mkspecs/modules/qt_lib_gui.pri \ 72 | /usr/lib/qt/mkspecs/modules/qt_lib_help.pri \ 73 | /usr/lib/qt/mkspecs/modules/qt_lib_multimedia.pri \ 74 | /usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets.pri \ 75 | /usr/lib/qt/mkspecs/modules/qt_lib_network.pri \ 76 | /usr/lib/qt/mkspecs/modules/qt_lib_opengl.pri \ 77 | /usr/lib/qt/mkspecs/modules/qt_lib_openglextensions.pri \ 78 | /usr/lib/qt/mkspecs/modules/qt_lib_platformsupport.pri \ 79 | /usr/lib/qt/mkspecs/modules/qt_lib_printsupport.pri \ 80 | /usr/lib/qt/mkspecs/modules/qt_lib_qml.pri \ 81 | /usr/lib/qt/mkspecs/modules/qt_lib_qmldevtools.pri \ 82 | /usr/lib/qt/mkspecs/modules/qt_lib_qmltest.pri \ 83 | /usr/lib/qt/mkspecs/modules/qt_lib_qtmultimediaquicktools.pri \ 84 | /usr/lib/qt/mkspecs/modules/qt_lib_quick.pri \ 85 | /usr/lib/qt/mkspecs/modules/qt_lib_quickparticles.pri \ 86 | /usr/lib/qt/mkspecs/modules/qt_lib_script.pri \ 87 | /usr/lib/qt/mkspecs/modules/qt_lib_scripttools.pri \ 88 | /usr/lib/qt/mkspecs/modules/qt_lib_sensors.pri \ 89 | /usr/lib/qt/mkspecs/modules/qt_lib_sql.pri \ 90 | /usr/lib/qt/mkspecs/modules/qt_lib_svg.pri \ 91 | /usr/lib/qt/mkspecs/modules/qt_lib_testlib.pri \ 92 | /usr/lib/qt/mkspecs/modules/qt_lib_uitools.pri \ 93 | /usr/lib/qt/mkspecs/modules/qt_lib_v8.pri \ 94 | /usr/lib/qt/mkspecs/modules/qt_lib_webkit.pri \ 95 | /usr/lib/qt/mkspecs/modules/qt_lib_webkitwidgets.pri \ 96 | /usr/lib/qt/mkspecs/modules/qt_lib_widgets.pri \ 97 | /usr/lib/qt/mkspecs/modules/qt_lib_xml.pri \ 98 | /usr/lib/qt/mkspecs/modules/qt_lib_xmlpatterns.pri \ 99 | /usr/lib/qt/mkspecs/features/qt_functions.prf \ 100 | /usr/lib/qt/mkspecs/features/qt_config.prf \ 101 | /usr/lib/qt/mkspecs/linux-g++/qmake.conf \ 102 | /usr/lib/qt/mkspecs/features/spec_post.prf \ 103 | /usr/lib/qt/mkspecs/features/exclusive_builds.prf \ 104 | /usr/lib/qt/mkspecs/features/default_pre.prf \ 105 | /usr/lib/qt/mkspecs/features/unix/default_pre.prf \ 106 | /usr/lib/qt/mkspecs/features/resolve_config.prf \ 107 | /usr/lib/qt/mkspecs/features/default_post.prf \ 108 | /usr/lib/qt/mkspecs/features/unix/gdb_dwarf_index.prf \ 109 | /usr/lib/qt/mkspecs/features/warn_on.prf \ 110 | /usr/lib/qt/mkspecs/features/qt.prf \ 111 | /usr/lib/qt/mkspecs/features/resources.prf \ 112 | /usr/lib/qt/mkspecs/features/moc.prf \ 113 | /usr/lib/qt/mkspecs/features/unix/opengl.prf \ 114 | /usr/lib/qt/mkspecs/features/unix/thread.prf \ 115 | /usr/lib/qt/mkspecs/features/wayland-scanner.prf \ 116 | /usr/lib/qt/mkspecs/features/testcase_targets.prf \ 117 | /usr/lib/qt/mkspecs/features/exceptions.prf \ 118 | /usr/lib/qt/mkspecs/features/yacc.prf \ 119 | /usr/lib/qt/mkspecs/features/lex.prf \ 120 | libvncview.pro \ 121 | libvncview.pro 122 | QMAKE_TARGET = vncview 123 | DESTDIR = #avoid trailing-slash linebreak 124 | TARGET = libvncview.so.1.0.0 125 | TARGETA = libvncview.a 126 | TARGETD = libvncview.so.1.0.0 127 | TARGET0 = libvncview.so 128 | TARGET1 = libvncview.so.1 129 | TARGET2 = libvncview.so.1.0 130 | 131 | 132 | first: all 133 | ####### Implicit rules 134 | 135 | .SUFFIXES: .o .c .cpp .cc .cxx .C 136 | 137 | .cpp.o: 138 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 139 | 140 | .cc.o: 141 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 142 | 143 | .cxx.o: 144 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 145 | 146 | .C.o: 147 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 148 | 149 | .c.o: 150 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" 151 | 152 | ####### Build rules 153 | 154 | all: Makefile $(TARGET) 155 | 156 | $(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP) 157 | -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) 158 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP) 159 | -ln -s $(TARGET) $(TARGET0) 160 | -ln -s $(TARGET) $(TARGET1) 161 | -ln -s $(TARGET) $(TARGET2) 162 | 163 | 164 | 165 | staticlib: $(TARGETA) 166 | 167 | $(TARGETA): $(OBJECTS) $(OBJCOMP) 168 | -$(DEL_FILE) $(TARGETA) 169 | $(AR) $(TARGETA) $(OBJECTS) 170 | 171 | Makefile: libvncview.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspecs/features/spec_pre.prf \ 172 | /usr/lib/qt/mkspecs/common/shell-unix.conf \ 173 | /usr/lib/qt/mkspecs/common/unix.conf \ 174 | /usr/lib/qt/mkspecs/common/linux.conf \ 175 | /usr/lib/qt/mkspecs/common/gcc-base.conf \ 176 | /usr/lib/qt/mkspecs/common/gcc-base-unix.conf \ 177 | /usr/lib/qt/mkspecs/common/g++-base.conf \ 178 | /usr/lib/qt/mkspecs/common/g++-unix.conf \ 179 | /usr/lib/qt/mkspecs/qconfig.pri \ 180 | /usr/lib/qt/mkspecs/modules/qt_lib_bootstrap.pri \ 181 | /usr/lib/qt/mkspecs/modules/qt_lib_clucene.pri \ 182 | /usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri \ 183 | /usr/lib/qt/mkspecs/modules/qt_lib_core.pri \ 184 | /usr/lib/qt/mkspecs/modules/qt_lib_dbus.pri \ 185 | /usr/lib/qt/mkspecs/modules/qt_lib_declarative.pri \ 186 | /usr/lib/qt/mkspecs/modules/qt_lib_designer.pri \ 187 | /usr/lib/qt/mkspecs/modules/qt_lib_designercomponents.pri \ 188 | /usr/lib/qt/mkspecs/modules/qt_lib_gui.pri \ 189 | /usr/lib/qt/mkspecs/modules/qt_lib_help.pri \ 190 | /usr/lib/qt/mkspecs/modules/qt_lib_multimedia.pri \ 191 | /usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets.pri \ 192 | /usr/lib/qt/mkspecs/modules/qt_lib_network.pri \ 193 | /usr/lib/qt/mkspecs/modules/qt_lib_opengl.pri \ 194 | /usr/lib/qt/mkspecs/modules/qt_lib_openglextensions.pri \ 195 | /usr/lib/qt/mkspecs/modules/qt_lib_platformsupport.pri \ 196 | /usr/lib/qt/mkspecs/modules/qt_lib_printsupport.pri \ 197 | /usr/lib/qt/mkspecs/modules/qt_lib_qml.pri \ 198 | /usr/lib/qt/mkspecs/modules/qt_lib_qmldevtools.pri \ 199 | /usr/lib/qt/mkspecs/modules/qt_lib_qmltest.pri \ 200 | /usr/lib/qt/mkspecs/modules/qt_lib_qtmultimediaquicktools.pri \ 201 | /usr/lib/qt/mkspecs/modules/qt_lib_quick.pri \ 202 | /usr/lib/qt/mkspecs/modules/qt_lib_quickparticles.pri \ 203 | /usr/lib/qt/mkspecs/modules/qt_lib_script.pri \ 204 | /usr/lib/qt/mkspecs/modules/qt_lib_scripttools.pri \ 205 | /usr/lib/qt/mkspecs/modules/qt_lib_sensors.pri \ 206 | /usr/lib/qt/mkspecs/modules/qt_lib_sql.pri \ 207 | /usr/lib/qt/mkspecs/modules/qt_lib_svg.pri \ 208 | /usr/lib/qt/mkspecs/modules/qt_lib_testlib.pri \ 209 | /usr/lib/qt/mkspecs/modules/qt_lib_uitools.pri \ 210 | /usr/lib/qt/mkspecs/modules/qt_lib_v8.pri \ 211 | /usr/lib/qt/mkspecs/modules/qt_lib_webkit.pri \ 212 | /usr/lib/qt/mkspecs/modules/qt_lib_webkitwidgets.pri \ 213 | /usr/lib/qt/mkspecs/modules/qt_lib_widgets.pri \ 214 | /usr/lib/qt/mkspecs/modules/qt_lib_xml.pri \ 215 | /usr/lib/qt/mkspecs/modules/qt_lib_xmlpatterns.pri \ 216 | /usr/lib/qt/mkspecs/features/qt_functions.prf \ 217 | /usr/lib/qt/mkspecs/features/qt_config.prf \ 218 | /usr/lib/qt/mkspecs/linux-g++/qmake.conf \ 219 | /usr/lib/qt/mkspecs/features/spec_post.prf \ 220 | /usr/lib/qt/mkspecs/features/exclusive_builds.prf \ 221 | /usr/lib/qt/mkspecs/features/default_pre.prf \ 222 | /usr/lib/qt/mkspecs/features/unix/default_pre.prf \ 223 | /usr/lib/qt/mkspecs/features/resolve_config.prf \ 224 | /usr/lib/qt/mkspecs/features/default_post.prf \ 225 | /usr/lib/qt/mkspecs/features/unix/gdb_dwarf_index.prf \ 226 | /usr/lib/qt/mkspecs/features/warn_on.prf \ 227 | /usr/lib/qt/mkspecs/features/qt.prf \ 228 | /usr/lib/qt/mkspecs/features/resources.prf \ 229 | /usr/lib/qt/mkspecs/features/moc.prf \ 230 | /usr/lib/qt/mkspecs/features/unix/opengl.prf \ 231 | /usr/lib/qt/mkspecs/features/unix/thread.prf \ 232 | /usr/lib/qt/mkspecs/features/wayland-scanner.prf \ 233 | /usr/lib/qt/mkspecs/features/testcase_targets.prf \ 234 | /usr/lib/qt/mkspecs/features/exceptions.prf \ 235 | /usr/lib/qt/mkspecs/features/yacc.prf \ 236 | /usr/lib/qt/mkspecs/features/lex.prf \ 237 | libvncview.pro \ 238 | /usr/lib/libQt5Gui.prl \ 239 | /usr/lib/libQt5Core.prl 240 | $(QMAKE) -o Makefile libvncview.pro 241 | /usr/lib/qt/mkspecs/features/spec_pre.prf: 242 | /usr/lib/qt/mkspecs/common/shell-unix.conf: 243 | /usr/lib/qt/mkspecs/common/unix.conf: 244 | /usr/lib/qt/mkspecs/common/linux.conf: 245 | /usr/lib/qt/mkspecs/common/gcc-base.conf: 246 | /usr/lib/qt/mkspecs/common/gcc-base-unix.conf: 247 | /usr/lib/qt/mkspecs/common/g++-base.conf: 248 | /usr/lib/qt/mkspecs/common/g++-unix.conf: 249 | /usr/lib/qt/mkspecs/qconfig.pri: 250 | /usr/lib/qt/mkspecs/modules/qt_lib_bootstrap.pri: 251 | /usr/lib/qt/mkspecs/modules/qt_lib_clucene.pri: 252 | /usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri: 253 | /usr/lib/qt/mkspecs/modules/qt_lib_core.pri: 254 | /usr/lib/qt/mkspecs/modules/qt_lib_dbus.pri: 255 | /usr/lib/qt/mkspecs/modules/qt_lib_declarative.pri: 256 | /usr/lib/qt/mkspecs/modules/qt_lib_designer.pri: 257 | /usr/lib/qt/mkspecs/modules/qt_lib_designercomponents.pri: 258 | /usr/lib/qt/mkspecs/modules/qt_lib_gui.pri: 259 | /usr/lib/qt/mkspecs/modules/qt_lib_help.pri: 260 | /usr/lib/qt/mkspecs/modules/qt_lib_multimedia.pri: 261 | /usr/lib/qt/mkspecs/modules/qt_lib_multimediawidgets.pri: 262 | /usr/lib/qt/mkspecs/modules/qt_lib_network.pri: 263 | /usr/lib/qt/mkspecs/modules/qt_lib_opengl.pri: 264 | /usr/lib/qt/mkspecs/modules/qt_lib_openglextensions.pri: 265 | /usr/lib/qt/mkspecs/modules/qt_lib_platformsupport.pri: 266 | /usr/lib/qt/mkspecs/modules/qt_lib_printsupport.pri: 267 | /usr/lib/qt/mkspecs/modules/qt_lib_qml.pri: 268 | /usr/lib/qt/mkspecs/modules/qt_lib_qmldevtools.pri: 269 | /usr/lib/qt/mkspecs/modules/qt_lib_qmltest.pri: 270 | /usr/lib/qt/mkspecs/modules/qt_lib_qtmultimediaquicktools.pri: 271 | /usr/lib/qt/mkspecs/modules/qt_lib_quick.pri: 272 | /usr/lib/qt/mkspecs/modules/qt_lib_quickparticles.pri: 273 | /usr/lib/qt/mkspecs/modules/qt_lib_script.pri: 274 | /usr/lib/qt/mkspecs/modules/qt_lib_scripttools.pri: 275 | /usr/lib/qt/mkspecs/modules/qt_lib_sensors.pri: 276 | /usr/lib/qt/mkspecs/modules/qt_lib_sql.pri: 277 | /usr/lib/qt/mkspecs/modules/qt_lib_svg.pri: 278 | /usr/lib/qt/mkspecs/modules/qt_lib_testlib.pri: 279 | /usr/lib/qt/mkspecs/modules/qt_lib_uitools.pri: 280 | /usr/lib/qt/mkspecs/modules/qt_lib_v8.pri: 281 | /usr/lib/qt/mkspecs/modules/qt_lib_webkit.pri: 282 | /usr/lib/qt/mkspecs/modules/qt_lib_webkitwidgets.pri: 283 | /usr/lib/qt/mkspecs/modules/qt_lib_widgets.pri: 284 | /usr/lib/qt/mkspecs/modules/qt_lib_xml.pri: 285 | /usr/lib/qt/mkspecs/modules/qt_lib_xmlpatterns.pri: 286 | /usr/lib/qt/mkspecs/features/qt_functions.prf: 287 | /usr/lib/qt/mkspecs/features/qt_config.prf: 288 | /usr/lib/qt/mkspecs/linux-g++/qmake.conf: 289 | /usr/lib/qt/mkspecs/features/spec_post.prf: 290 | /usr/lib/qt/mkspecs/features/exclusive_builds.prf: 291 | /usr/lib/qt/mkspecs/features/default_pre.prf: 292 | /usr/lib/qt/mkspecs/features/unix/default_pre.prf: 293 | /usr/lib/qt/mkspecs/features/resolve_config.prf: 294 | /usr/lib/qt/mkspecs/features/default_post.prf: 295 | /usr/lib/qt/mkspecs/features/unix/gdb_dwarf_index.prf: 296 | /usr/lib/qt/mkspecs/features/warn_on.prf: 297 | /usr/lib/qt/mkspecs/features/qt.prf: 298 | /usr/lib/qt/mkspecs/features/resources.prf: 299 | /usr/lib/qt/mkspecs/features/moc.prf: 300 | /usr/lib/qt/mkspecs/features/unix/opengl.prf: 301 | /usr/lib/qt/mkspecs/features/unix/thread.prf: 302 | /usr/lib/qt/mkspecs/features/wayland-scanner.prf: 303 | /usr/lib/qt/mkspecs/features/testcase_targets.prf: 304 | /usr/lib/qt/mkspecs/features/exceptions.prf: 305 | /usr/lib/qt/mkspecs/features/yacc.prf: 306 | /usr/lib/qt/mkspecs/features/lex.prf: 307 | libvncview.pro: 308 | /usr/lib/libQt5Gui.prl: 309 | /usr/lib/libQt5Core.prl: 310 | qmake: FORCE 311 | @$(QMAKE) -o Makefile libvncview.pro 312 | 313 | qmake_all: FORCE 314 | 315 | dist: 316 | @test -d .tmp/vncview1.0.0 || mkdir -p .tmp/vncview1.0.0 317 | $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/vncview1.0.0/ && $(COPY_FILE) --parents remoteview.h vncclientthread.h vncview.h vncview_global.h rfb/keysym.h rfb/rfb.h rfb/rfbclient.h rfb/rfbconfig.h rfb/rfbint.h rfb/rfbproto.h rfb/rfbregion.h .tmp/vncview1.0.0/ && $(COPY_FILE) --parents remoteview.cpp vncclientthread.cpp vncview.cpp .tmp/vncview1.0.0/ && (cd `dirname .tmp/vncview1.0.0` && $(TAR) vncview1.0.0.tar vncview1.0.0 && $(COMPRESS) vncview1.0.0.tar) && $(MOVE) `dirname .tmp/vncview1.0.0`/vncview1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/vncview1.0.0 318 | 319 | 320 | clean:compiler_clean 321 | -$(DEL_FILE) $(OBJECTS) 322 | -$(DEL_FILE) *~ core *.core 323 | 324 | 325 | ####### Sub-libraries 326 | 327 | distclean: clean 328 | -$(DEL_FILE) $(TARGET) 329 | -$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA) 330 | -$(DEL_FILE) Makefile 331 | 332 | 333 | mocclean: compiler_moc_header_clean compiler_moc_source_clean 334 | 335 | mocables: compiler_moc_header_make_all compiler_moc_source_make_all 336 | 337 | check: first 338 | 339 | compiler_rcc_make_all: 340 | compiler_rcc_clean: 341 | compiler_wayland_server_header_make_all: 342 | compiler_wayland_server_header_clean: 343 | compiler_wayland_client_header_make_all: 344 | compiler_wayland_client_header_clean: 345 | compiler_qtwayland_client_header_make_all: 346 | compiler_qtwayland_client_header_clean: 347 | compiler_qtwayland_server_header_make_all: 348 | compiler_qtwayland_server_header_clean: 349 | compiler_moc_header_make_all: moc_remoteview.cpp moc_vncclientthread.cpp moc_vncview.cpp 350 | compiler_moc_header_clean: 351 | -$(DEL_FILE) moc_remoteview.cpp moc_vncclientthread.cpp moc_vncview.cpp 352 | moc_remoteview.cpp: /usr/include/qt/QtCore/QUrl \ 353 | /usr/include/qt/QtCore/qurl.h \ 354 | /usr/include/qt/QtCore/qbytearray.h \ 355 | /usr/include/qt/QtCore/qrefcount.h \ 356 | /usr/include/qt/QtCore/qatomic.h \ 357 | /usr/include/qt/QtCore/qglobal.h \ 358 | /usr/include/qt/QtCore/qconfig.h \ 359 | /usr/include/qt/QtCore/qfeatures.h \ 360 | /usr/include/qt/QtCore/qsystemdetection.h \ 361 | /usr/include/qt/QtCore/qcompilerdetection.h \ 362 | /usr/include/qt/QtCore/qprocessordetection.h \ 363 | /usr/include/qt/QtCore/qglobalstatic.h \ 364 | /usr/include/qt/QtCore/qmutex.h \ 365 | /usr/include/qt/QtCore/qlogging.h \ 366 | /usr/include/qt/QtCore/qflags.h \ 367 | /usr/include/qt/QtCore/qtypeinfo.h \ 368 | /usr/include/qt/QtCore/qtypetraits.h \ 369 | /usr/include/qt/QtCore/qsysinfo.h \ 370 | /usr/include/qt/QtCore/qbasicatomic.h \ 371 | /usr/include/qt/QtCore/qatomic_bootstrap.h \ 372 | /usr/include/qt/QtCore/qgenericatomic.h \ 373 | /usr/include/qt/QtCore/qatomic_msvc.h \ 374 | /usr/include/qt/QtCore/qatomic_integrity.h \ 375 | /usr/include/qt/QtCore/qoldbasicatomic.h \ 376 | /usr/include/qt/QtCore/qatomic_vxworks.h \ 377 | /usr/include/qt/QtCore/qatomic_power.h \ 378 | /usr/include/qt/QtCore/qatomic_alpha.h \ 379 | /usr/include/qt/QtCore/qatomic_armv7.h \ 380 | /usr/include/qt/QtCore/qatomic_armv6.h \ 381 | /usr/include/qt/QtCore/qatomic_armv5.h \ 382 | /usr/include/qt/QtCore/qatomic_bfin.h \ 383 | /usr/include/qt/QtCore/qatomic_ia64.h \ 384 | /usr/include/qt/QtCore/qatomic_mips.h \ 385 | /usr/include/qt/QtCore/qatomic_s390.h \ 386 | /usr/include/qt/QtCore/qatomic_sh4a.h \ 387 | /usr/include/qt/QtCore/qatomic_sparc.h \ 388 | /usr/include/qt/QtCore/qatomic_x86.h \ 389 | /usr/include/qt/QtCore/qatomic_cxx11.h \ 390 | /usr/include/qt/QtCore/qatomic_gcc.h \ 391 | /usr/include/qt/QtCore/qatomic_unix.h \ 392 | /usr/include/qt/QtCore/qnamespace.h \ 393 | /usr/include/qt/QtCore/qarraydata.h \ 394 | /usr/include/qt/QtCore/qstring.h \ 395 | /usr/include/qt/QtCore/qchar.h \ 396 | /usr/include/qt/QtCore/qstringbuilder.h \ 397 | /usr/include/qt/QtCore/qobjectdefs.h \ 398 | /usr/include/qt/QtCore/qobjectdefs_impl.h \ 399 | /usr/include/qt/QtCore/qlist.h \ 400 | /usr/include/qt/QtCore/qalgorithms.h \ 401 | /usr/include/qt/QtCore/qiterator.h \ 402 | /usr/include/qt/QtCore/qpair.h \ 403 | /usr/include/qt/QtCore/qurlquery.h \ 404 | /usr/include/qt/QtCore/qshareddata.h \ 405 | /usr/include/qt/QtCore/qstringlist.h \ 406 | /usr/include/qt/QtCore/qdatastream.h \ 407 | /usr/include/qt/QtCore/qscopedpointer.h \ 408 | /usr/include/qt/QtCore/qiodevice.h \ 409 | /usr/include/qt/QtCore/qobject.h \ 410 | /usr/include/qt/QtCore/qcoreevent.h \ 411 | /usr/include/qt/QtCore/qmetatype.h \ 412 | /usr/include/qt/QtCore/qvarlengtharray.h \ 413 | /usr/include/qt/QtCore/qcontainerfwd.h \ 414 | /usr/include/qt/QtCore/qisenum.h \ 415 | /usr/include/qt/QtCore/qobject_impl.h \ 416 | /usr/include/qt/QtCore/qregexp.h \ 417 | /usr/include/qt/QtCore/qstringmatcher.h \ 418 | vncview_global.h \ 419 | /usr/include/qt/QtWidgets/QWidget \ 420 | /usr/include/qt/QtWidgets/qwidget.h \ 421 | /usr/include/qt/QtGui/qwindowdefs.h \ 422 | /usr/include/qt/QtGui/qwindowdefs_win.h \ 423 | /usr/include/qt/QtCore/qmargins.h \ 424 | /usr/include/qt/QtCore/qrect.h \ 425 | /usr/include/qt/QtCore/qsize.h \ 426 | /usr/include/qt/QtCore/qpoint.h \ 427 | /usr/include/qt/QtGui/qpaintdevice.h \ 428 | /usr/include/qt/QtGui/qpalette.h \ 429 | /usr/include/qt/QtGui/qcolor.h \ 430 | /usr/include/qt/QtGui/qrgb.h \ 431 | /usr/include/qt/QtGui/qbrush.h \ 432 | /usr/include/qt/QtCore/qvector.h \ 433 | /usr/include/qt/QtGui/qmatrix.h \ 434 | /usr/include/qt/QtGui/qpolygon.h \ 435 | /usr/include/qt/QtGui/qregion.h \ 436 | /usr/include/qt/QtCore/qline.h \ 437 | /usr/include/qt/QtGui/qtransform.h \ 438 | /usr/include/qt/QtGui/qpainterpath.h \ 439 | /usr/include/qt/QtGui/qimage.h \ 440 | /usr/include/qt/QtGui/qpixmap.h \ 441 | /usr/include/qt/QtCore/qsharedpointer.h \ 442 | /usr/include/qt/QtCore/qsharedpointer_impl.h \ 443 | /usr/include/qt/QtCore/qhash.h \ 444 | /usr/include/qt/QtGui/qfont.h \ 445 | /usr/include/qt/QtGui/qfontmetrics.h \ 446 | /usr/include/qt/QtGui/qfontinfo.h \ 447 | /usr/include/qt/QtWidgets/qsizepolicy.h \ 448 | /usr/include/qt/QtGui/qcursor.h \ 449 | /usr/include/qt/QtGui/qkeysequence.h \ 450 | /usr/include/qt/QtGui/qevent.h \ 451 | /usr/include/qt/QtCore/qvariant.h \ 452 | /usr/include/qt/QtCore/qmap.h \ 453 | /usr/include/qt/QtCore/qdebug.h \ 454 | /usr/include/qt/QtCore/qtextstream.h \ 455 | /usr/include/qt/QtCore/qlocale.h \ 456 | /usr/include/qt/QtCore/qset.h \ 457 | /usr/include/qt/QtCore/qcontiguouscache.h \ 458 | /usr/include/qt/QtCore/qfile.h \ 459 | /usr/include/qt/QtCore/qfiledevice.h \ 460 | /usr/include/qt/QtGui/qvector2d.h \ 461 | /usr/include/qt/QtGui/qtouchdevice.h \ 462 | remoteview.h 463 | /usr/lib/qt/bin/moc $(DEFINES) $(INCPATH) -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2 -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/x86_64-unknown-linux-gnu -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/backward -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include -I/usr/local/include -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed -I/usr/include remoteview.h -o moc_remoteview.cpp 464 | 465 | moc_vncclientthread.cpp: /usr/include/qt/QtCore/QDebug \ 466 | /usr/include/qt/QtCore/qdebug.h \ 467 | /usr/include/qt/QtCore/qalgorithms.h \ 468 | /usr/include/qt/QtCore/qglobal.h \ 469 | /usr/include/qt/QtCore/qconfig.h \ 470 | /usr/include/qt/QtCore/qfeatures.h \ 471 | /usr/include/qt/QtCore/qsystemdetection.h \ 472 | /usr/include/qt/QtCore/qcompilerdetection.h \ 473 | /usr/include/qt/QtCore/qprocessordetection.h \ 474 | /usr/include/qt/QtCore/qglobalstatic.h \ 475 | /usr/include/qt/QtCore/qatomic.h \ 476 | /usr/include/qt/QtCore/qbasicatomic.h \ 477 | /usr/include/qt/QtCore/qatomic_bootstrap.h \ 478 | /usr/include/qt/QtCore/qgenericatomic.h \ 479 | /usr/include/qt/QtCore/qatomic_msvc.h \ 480 | /usr/include/qt/QtCore/qatomic_integrity.h \ 481 | /usr/include/qt/QtCore/qoldbasicatomic.h \ 482 | /usr/include/qt/QtCore/qatomic_vxworks.h \ 483 | /usr/include/qt/QtCore/qatomic_power.h \ 484 | /usr/include/qt/QtCore/qatomic_alpha.h \ 485 | /usr/include/qt/QtCore/qatomic_armv7.h \ 486 | /usr/include/qt/QtCore/qatomic_armv6.h \ 487 | /usr/include/qt/QtCore/qatomic_armv5.h \ 488 | /usr/include/qt/QtCore/qatomic_bfin.h \ 489 | /usr/include/qt/QtCore/qatomic_ia64.h \ 490 | /usr/include/qt/QtCore/qatomic_mips.h \ 491 | /usr/include/qt/QtCore/qatomic_s390.h \ 492 | /usr/include/qt/QtCore/qatomic_sh4a.h \ 493 | /usr/include/qt/QtCore/qatomic_sparc.h \ 494 | /usr/include/qt/QtCore/qatomic_x86.h \ 495 | /usr/include/qt/QtCore/qatomic_cxx11.h \ 496 | /usr/include/qt/QtCore/qatomic_gcc.h \ 497 | /usr/include/qt/QtCore/qatomic_unix.h \ 498 | /usr/include/qt/QtCore/qmutex.h \ 499 | /usr/include/qt/QtCore/qlogging.h \ 500 | /usr/include/qt/QtCore/qflags.h \ 501 | /usr/include/qt/QtCore/qtypeinfo.h \ 502 | /usr/include/qt/QtCore/qtypetraits.h \ 503 | /usr/include/qt/QtCore/qsysinfo.h \ 504 | /usr/include/qt/QtCore/qhash.h \ 505 | /usr/include/qt/QtCore/qchar.h \ 506 | /usr/include/qt/QtCore/qiterator.h \ 507 | /usr/include/qt/QtCore/qlist.h \ 508 | /usr/include/qt/QtCore/qrefcount.h \ 509 | /usr/include/qt/QtCore/qpair.h \ 510 | /usr/include/qt/QtCore/qmap.h \ 511 | /usr/include/qt/QtCore/qtextstream.h \ 512 | /usr/include/qt/QtCore/qiodevice.h \ 513 | /usr/include/qt/QtCore/qobject.h \ 514 | /usr/include/qt/QtCore/qobjectdefs.h \ 515 | /usr/include/qt/QtCore/qnamespace.h \ 516 | /usr/include/qt/QtCore/qobjectdefs_impl.h \ 517 | /usr/include/qt/QtCore/qstring.h \ 518 | /usr/include/qt/QtCore/qbytearray.h \ 519 | /usr/include/qt/QtCore/qarraydata.h \ 520 | /usr/include/qt/QtCore/qstringbuilder.h \ 521 | /usr/include/qt/QtCore/qcoreevent.h \ 522 | /usr/include/qt/QtCore/qscopedpointer.h \ 523 | /usr/include/qt/QtCore/qmetatype.h \ 524 | /usr/include/qt/QtCore/qvarlengtharray.h \ 525 | /usr/include/qt/QtCore/qcontainerfwd.h \ 526 | /usr/include/qt/QtCore/qisenum.h \ 527 | /usr/include/qt/QtCore/qobject_impl.h \ 528 | /usr/include/qt/QtCore/qlocale.h \ 529 | /usr/include/qt/QtCore/qvariant.h \ 530 | /usr/include/qt/QtCore/qshareddata.h \ 531 | /usr/include/qt/QtCore/qvector.h \ 532 | /usr/include/qt/QtCore/qpoint.h \ 533 | /usr/include/qt/QtCore/qset.h \ 534 | /usr/include/qt/QtCore/qcontiguouscache.h \ 535 | remoteview.h \ 536 | /usr/include/qt/QtCore/QUrl \ 537 | /usr/include/qt/QtCore/qurl.h \ 538 | /usr/include/qt/QtCore/qurlquery.h \ 539 | /usr/include/qt/QtCore/qstringlist.h \ 540 | /usr/include/qt/QtCore/qdatastream.h \ 541 | /usr/include/qt/QtCore/qregexp.h \ 542 | /usr/include/qt/QtCore/qstringmatcher.h \ 543 | vncview_global.h \ 544 | /usr/include/qt/QtWidgets/QWidget \ 545 | /usr/include/qt/QtWidgets/qwidget.h \ 546 | /usr/include/qt/QtGui/qwindowdefs.h \ 547 | /usr/include/qt/QtGui/qwindowdefs_win.h \ 548 | /usr/include/qt/QtCore/qmargins.h \ 549 | /usr/include/qt/QtCore/qrect.h \ 550 | /usr/include/qt/QtCore/qsize.h \ 551 | /usr/include/qt/QtGui/qpaintdevice.h \ 552 | /usr/include/qt/QtGui/qpalette.h \ 553 | /usr/include/qt/QtGui/qcolor.h \ 554 | /usr/include/qt/QtGui/qrgb.h \ 555 | /usr/include/qt/QtGui/qbrush.h \ 556 | /usr/include/qt/QtGui/qmatrix.h \ 557 | /usr/include/qt/QtGui/qpolygon.h \ 558 | /usr/include/qt/QtGui/qregion.h \ 559 | /usr/include/qt/QtCore/qline.h \ 560 | /usr/include/qt/QtGui/qtransform.h \ 561 | /usr/include/qt/QtGui/qpainterpath.h \ 562 | /usr/include/qt/QtGui/qimage.h \ 563 | /usr/include/qt/QtGui/qpixmap.h \ 564 | /usr/include/qt/QtCore/qsharedpointer.h \ 565 | /usr/include/qt/QtCore/qsharedpointer_impl.h \ 566 | /usr/include/qt/QtGui/qfont.h \ 567 | /usr/include/qt/QtGui/qfontmetrics.h \ 568 | /usr/include/qt/QtGui/qfontinfo.h \ 569 | /usr/include/qt/QtWidgets/qsizepolicy.h \ 570 | /usr/include/qt/QtGui/qcursor.h \ 571 | /usr/include/qt/QtGui/qkeysequence.h \ 572 | /usr/include/qt/QtGui/qevent.h \ 573 | /usr/include/qt/QtCore/qfile.h \ 574 | /usr/include/qt/QtCore/qfiledevice.h \ 575 | /usr/include/qt/QtGui/qvector2d.h \ 576 | /usr/include/qt/QtGui/qtouchdevice.h \ 577 | /usr/include/qt/QtCore/QQueue \ 578 | /usr/include/qt/QtCore/qqueue.h \ 579 | /usr/include/qt/QtCore/QThread \ 580 | /usr/include/qt/QtCore/qthread.h \ 581 | /usr/include/qt/QtGui/QImage \ 582 | /usr/include/qt/QtCore/QMutex \ 583 | rfb/rfbclient.h \ 584 | rfb/rfbproto.h \ 585 | rfb/rfbconfig.h \ 586 | rfb/rfbint.h \ 587 | rfb/keysym.h \ 588 | vncclientthread.h 589 | /usr/lib/qt/bin/moc $(DEFINES) $(INCPATH) -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2 -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/x86_64-unknown-linux-gnu -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/backward -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include -I/usr/local/include -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed -I/usr/include vncclientthread.h -o moc_vncclientthread.cpp 590 | 591 | moc_vncview.cpp: vncview_global.h \ 592 | /usr/include/qt/QtCore/qglobal.h \ 593 | /usr/include/qt/QtCore/qconfig.h \ 594 | /usr/include/qt/QtCore/qfeatures.h \ 595 | /usr/include/qt/QtCore/qsystemdetection.h \ 596 | /usr/include/qt/QtCore/qcompilerdetection.h \ 597 | /usr/include/qt/QtCore/qprocessordetection.h \ 598 | /usr/include/qt/QtCore/qglobalstatic.h \ 599 | /usr/include/qt/QtCore/qatomic.h \ 600 | /usr/include/qt/QtCore/qbasicatomic.h \ 601 | /usr/include/qt/QtCore/qatomic_bootstrap.h \ 602 | /usr/include/qt/QtCore/qgenericatomic.h \ 603 | /usr/include/qt/QtCore/qatomic_msvc.h \ 604 | /usr/include/qt/QtCore/qatomic_integrity.h \ 605 | /usr/include/qt/QtCore/qoldbasicatomic.h \ 606 | /usr/include/qt/QtCore/qatomic_vxworks.h \ 607 | /usr/include/qt/QtCore/qatomic_power.h \ 608 | /usr/include/qt/QtCore/qatomic_alpha.h \ 609 | /usr/include/qt/QtCore/qatomic_armv7.h \ 610 | /usr/include/qt/QtCore/qatomic_armv6.h \ 611 | /usr/include/qt/QtCore/qatomic_armv5.h \ 612 | /usr/include/qt/QtCore/qatomic_bfin.h \ 613 | /usr/include/qt/QtCore/qatomic_ia64.h \ 614 | /usr/include/qt/QtCore/qatomic_mips.h \ 615 | /usr/include/qt/QtCore/qatomic_s390.h \ 616 | /usr/include/qt/QtCore/qatomic_sh4a.h \ 617 | /usr/include/qt/QtCore/qatomic_sparc.h \ 618 | /usr/include/qt/QtCore/qatomic_x86.h \ 619 | /usr/include/qt/QtCore/qatomic_cxx11.h \ 620 | /usr/include/qt/QtCore/qatomic_gcc.h \ 621 | /usr/include/qt/QtCore/qatomic_unix.h \ 622 | /usr/include/qt/QtCore/qmutex.h \ 623 | /usr/include/qt/QtCore/qlogging.h \ 624 | /usr/include/qt/QtCore/qflags.h \ 625 | /usr/include/qt/QtCore/qtypeinfo.h \ 626 | /usr/include/qt/QtCore/qtypetraits.h \ 627 | /usr/include/qt/QtCore/qsysinfo.h \ 628 | remoteview.h \ 629 | /usr/include/qt/QtCore/QUrl \ 630 | /usr/include/qt/QtCore/qurl.h \ 631 | /usr/include/qt/QtCore/qbytearray.h \ 632 | /usr/include/qt/QtCore/qrefcount.h \ 633 | /usr/include/qt/QtCore/qnamespace.h \ 634 | /usr/include/qt/QtCore/qarraydata.h \ 635 | /usr/include/qt/QtCore/qstring.h \ 636 | /usr/include/qt/QtCore/qchar.h \ 637 | /usr/include/qt/QtCore/qstringbuilder.h \ 638 | /usr/include/qt/QtCore/qobjectdefs.h \ 639 | /usr/include/qt/QtCore/qobjectdefs_impl.h \ 640 | /usr/include/qt/QtCore/qlist.h \ 641 | /usr/include/qt/QtCore/qalgorithms.h \ 642 | /usr/include/qt/QtCore/qiterator.h \ 643 | /usr/include/qt/QtCore/qpair.h \ 644 | /usr/include/qt/QtCore/qurlquery.h \ 645 | /usr/include/qt/QtCore/qshareddata.h \ 646 | /usr/include/qt/QtCore/qstringlist.h \ 647 | /usr/include/qt/QtCore/qdatastream.h \ 648 | /usr/include/qt/QtCore/qscopedpointer.h \ 649 | /usr/include/qt/QtCore/qiodevice.h \ 650 | /usr/include/qt/QtCore/qobject.h \ 651 | /usr/include/qt/QtCore/qcoreevent.h \ 652 | /usr/include/qt/QtCore/qmetatype.h \ 653 | /usr/include/qt/QtCore/qvarlengtharray.h \ 654 | /usr/include/qt/QtCore/qcontainerfwd.h \ 655 | /usr/include/qt/QtCore/qisenum.h \ 656 | /usr/include/qt/QtCore/qobject_impl.h \ 657 | /usr/include/qt/QtCore/qregexp.h \ 658 | /usr/include/qt/QtCore/qstringmatcher.h \ 659 | /usr/include/qt/QtWidgets/QWidget \ 660 | /usr/include/qt/QtWidgets/qwidget.h \ 661 | /usr/include/qt/QtGui/qwindowdefs.h \ 662 | /usr/include/qt/QtGui/qwindowdefs_win.h \ 663 | /usr/include/qt/QtCore/qmargins.h \ 664 | /usr/include/qt/QtCore/qrect.h \ 665 | /usr/include/qt/QtCore/qsize.h \ 666 | /usr/include/qt/QtCore/qpoint.h \ 667 | /usr/include/qt/QtGui/qpaintdevice.h \ 668 | /usr/include/qt/QtGui/qpalette.h \ 669 | /usr/include/qt/QtGui/qcolor.h \ 670 | /usr/include/qt/QtGui/qrgb.h \ 671 | /usr/include/qt/QtGui/qbrush.h \ 672 | /usr/include/qt/QtCore/qvector.h \ 673 | /usr/include/qt/QtGui/qmatrix.h \ 674 | /usr/include/qt/QtGui/qpolygon.h \ 675 | /usr/include/qt/QtGui/qregion.h \ 676 | /usr/include/qt/QtCore/qline.h \ 677 | /usr/include/qt/QtGui/qtransform.h \ 678 | /usr/include/qt/QtGui/qpainterpath.h \ 679 | /usr/include/qt/QtGui/qimage.h \ 680 | /usr/include/qt/QtGui/qpixmap.h \ 681 | /usr/include/qt/QtCore/qsharedpointer.h \ 682 | /usr/include/qt/QtCore/qsharedpointer_impl.h \ 683 | /usr/include/qt/QtCore/qhash.h \ 684 | /usr/include/qt/QtGui/qfont.h \ 685 | /usr/include/qt/QtGui/qfontmetrics.h \ 686 | /usr/include/qt/QtGui/qfontinfo.h \ 687 | /usr/include/qt/QtWidgets/qsizepolicy.h \ 688 | /usr/include/qt/QtGui/qcursor.h \ 689 | /usr/include/qt/QtGui/qkeysequence.h \ 690 | /usr/include/qt/QtGui/qevent.h \ 691 | /usr/include/qt/QtCore/qvariant.h \ 692 | /usr/include/qt/QtCore/qmap.h \ 693 | /usr/include/qt/QtCore/qdebug.h \ 694 | /usr/include/qt/QtCore/qtextstream.h \ 695 | /usr/include/qt/QtCore/qlocale.h \ 696 | /usr/include/qt/QtCore/qset.h \ 697 | /usr/include/qt/QtCore/qcontiguouscache.h \ 698 | /usr/include/qt/QtCore/qfile.h \ 699 | /usr/include/qt/QtCore/qfiledevice.h \ 700 | /usr/include/qt/QtGui/qvector2d.h \ 701 | /usr/include/qt/QtGui/qtouchdevice.h \ 702 | vncclientthread.h \ 703 | /usr/include/qt/QtCore/QDebug \ 704 | /usr/include/qt/QtCore/QQueue \ 705 | /usr/include/qt/QtCore/qqueue.h \ 706 | /usr/include/qt/QtCore/QThread \ 707 | /usr/include/qt/QtCore/qthread.h \ 708 | /usr/include/qt/QtGui/QImage \ 709 | /usr/include/qt/QtCore/QMutex \ 710 | rfb/rfbclient.h \ 711 | rfb/rfbproto.h \ 712 | rfb/rfbconfig.h \ 713 | rfb/rfbint.h \ 714 | rfb/keysym.h \ 715 | /usr/include/qt/QtGui/QClipboard \ 716 | /usr/include/qt/QtGui/qclipboard.h \ 717 | vncview.h 718 | /usr/lib/qt/bin/moc $(DEFINES) $(INCPATH) -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2 -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/x86_64-unknown-linux-gnu -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/backward -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include -I/usr/local/include -I/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed -I/usr/include vncview.h -o moc_vncview.cpp 719 | 720 | compiler_wayland_code_make_all: 721 | compiler_wayland_code_clean: 722 | compiler_qtwayland_client_code_make_all: 723 | compiler_qtwayland_client_code_clean: 724 | compiler_qtwayland_server_code_make_all: 725 | compiler_qtwayland_server_code_clean: 726 | compiler_moc_source_make_all: 727 | compiler_moc_source_clean: 728 | compiler_yacc_decl_make_all: 729 | compiler_yacc_decl_clean: 730 | compiler_yacc_impl_make_all: 731 | compiler_yacc_impl_clean: 732 | compiler_lex_make_all: 733 | compiler_lex_clean: 734 | compiler_clean: compiler_moc_header_clean 735 | 736 | ####### Compile 737 | 738 | remoteview.o: remoteview.cpp remoteview.h \ 739 | /usr/include/qt/QtCore/QUrl \ 740 | /usr/include/qt/QtCore/qurl.h \ 741 | /usr/include/qt/QtCore/qbytearray.h \ 742 | /usr/include/qt/QtCore/qrefcount.h \ 743 | /usr/include/qt/QtCore/qatomic.h \ 744 | /usr/include/qt/QtCore/qglobal.h \ 745 | /usr/include/qt/QtCore/qconfig.h \ 746 | /usr/include/qt/QtCore/qfeatures.h \ 747 | /usr/include/qt/QtCore/qsystemdetection.h \ 748 | /usr/include/qt/QtCore/qcompilerdetection.h \ 749 | /usr/include/qt/QtCore/qprocessordetection.h \ 750 | /usr/include/qt/QtCore/qglobalstatic.h \ 751 | /usr/include/qt/QtCore/qmutex.h \ 752 | /usr/include/qt/QtCore/qlogging.h \ 753 | /usr/include/qt/QtCore/qflags.h \ 754 | /usr/include/qt/QtCore/qtypeinfo.h \ 755 | /usr/include/qt/QtCore/qtypetraits.h \ 756 | /usr/include/qt/QtCore/qsysinfo.h \ 757 | /usr/include/qt/QtCore/qbasicatomic.h \ 758 | /usr/include/qt/QtCore/qatomic_bootstrap.h \ 759 | /usr/include/qt/QtCore/qgenericatomic.h \ 760 | /usr/include/qt/QtCore/qatomic_msvc.h \ 761 | /usr/include/qt/QtCore/qatomic_integrity.h \ 762 | /usr/include/qt/QtCore/qoldbasicatomic.h \ 763 | /usr/include/qt/QtCore/qatomic_vxworks.h \ 764 | /usr/include/qt/QtCore/qatomic_power.h \ 765 | /usr/include/qt/QtCore/qatomic_alpha.h \ 766 | /usr/include/qt/QtCore/qatomic_armv7.h \ 767 | /usr/include/qt/QtCore/qatomic_armv6.h \ 768 | /usr/include/qt/QtCore/qatomic_armv5.h \ 769 | /usr/include/qt/QtCore/qatomic_bfin.h \ 770 | /usr/include/qt/QtCore/qatomic_ia64.h \ 771 | /usr/include/qt/QtCore/qatomic_mips.h \ 772 | /usr/include/qt/QtCore/qatomic_s390.h \ 773 | /usr/include/qt/QtCore/qatomic_sh4a.h \ 774 | /usr/include/qt/QtCore/qatomic_sparc.h \ 775 | /usr/include/qt/QtCore/qatomic_x86.h \ 776 | /usr/include/qt/QtCore/qatomic_cxx11.h \ 777 | /usr/include/qt/QtCore/qatomic_gcc.h \ 778 | /usr/include/qt/QtCore/qatomic_unix.h \ 779 | /usr/include/qt/QtCore/qnamespace.h \ 780 | /usr/include/qt/QtCore/qarraydata.h \ 781 | /usr/include/qt/QtCore/qstring.h \ 782 | /usr/include/qt/QtCore/qchar.h \ 783 | /usr/include/qt/QtCore/qstringbuilder.h \ 784 | /usr/include/qt/QtCore/qobjectdefs.h \ 785 | /usr/include/qt/QtCore/qobjectdefs_impl.h \ 786 | /usr/include/qt/QtCore/qlist.h \ 787 | /usr/include/qt/QtCore/qalgorithms.h \ 788 | /usr/include/qt/QtCore/qiterator.h \ 789 | /usr/include/qt/QtCore/qpair.h \ 790 | /usr/include/qt/QtCore/qurlquery.h \ 791 | /usr/include/qt/QtCore/qshareddata.h \ 792 | /usr/include/qt/QtCore/qstringlist.h \ 793 | /usr/include/qt/QtCore/qdatastream.h \ 794 | /usr/include/qt/QtCore/qscopedpointer.h \ 795 | /usr/include/qt/QtCore/qiodevice.h \ 796 | /usr/include/qt/QtCore/qobject.h \ 797 | /usr/include/qt/QtCore/qcoreevent.h \ 798 | /usr/include/qt/QtCore/qmetatype.h \ 799 | /usr/include/qt/QtCore/qvarlengtharray.h \ 800 | /usr/include/qt/QtCore/qcontainerfwd.h \ 801 | /usr/include/qt/QtCore/qisenum.h \ 802 | /usr/include/qt/QtCore/qobject_impl.h \ 803 | /usr/include/qt/QtCore/qregexp.h \ 804 | /usr/include/qt/QtCore/qstringmatcher.h \ 805 | vncview_global.h \ 806 | /usr/include/qt/QtWidgets/QWidget \ 807 | /usr/include/qt/QtWidgets/qwidget.h \ 808 | /usr/include/qt/QtGui/qwindowdefs.h \ 809 | /usr/include/qt/QtGui/qwindowdefs_win.h \ 810 | /usr/include/qt/QtCore/qmargins.h \ 811 | /usr/include/qt/QtCore/qrect.h \ 812 | /usr/include/qt/QtCore/qsize.h \ 813 | /usr/include/qt/QtCore/qpoint.h \ 814 | /usr/include/qt/QtGui/qpaintdevice.h \ 815 | /usr/include/qt/QtGui/qpalette.h \ 816 | /usr/include/qt/QtGui/qcolor.h \ 817 | /usr/include/qt/QtGui/qrgb.h \ 818 | /usr/include/qt/QtGui/qbrush.h \ 819 | /usr/include/qt/QtCore/qvector.h \ 820 | /usr/include/qt/QtGui/qmatrix.h \ 821 | /usr/include/qt/QtGui/qpolygon.h \ 822 | /usr/include/qt/QtGui/qregion.h \ 823 | /usr/include/qt/QtCore/qline.h \ 824 | /usr/include/qt/QtGui/qtransform.h \ 825 | /usr/include/qt/QtGui/qpainterpath.h \ 826 | /usr/include/qt/QtGui/qimage.h \ 827 | /usr/include/qt/QtGui/qpixmap.h \ 828 | /usr/include/qt/QtCore/qsharedpointer.h \ 829 | /usr/include/qt/QtCore/qsharedpointer_impl.h \ 830 | /usr/include/qt/QtCore/qhash.h \ 831 | /usr/include/qt/QtGui/qfont.h \ 832 | /usr/include/qt/QtGui/qfontmetrics.h \ 833 | /usr/include/qt/QtGui/qfontinfo.h \ 834 | /usr/include/qt/QtWidgets/qsizepolicy.h \ 835 | /usr/include/qt/QtGui/qcursor.h \ 836 | /usr/include/qt/QtGui/qkeysequence.h \ 837 | /usr/include/qt/QtGui/qevent.h \ 838 | /usr/include/qt/QtCore/qvariant.h \ 839 | /usr/include/qt/QtCore/qmap.h \ 840 | /usr/include/qt/QtCore/qdebug.h \ 841 | /usr/include/qt/QtCore/qtextstream.h \ 842 | /usr/include/qt/QtCore/qlocale.h \ 843 | /usr/include/qt/QtCore/qset.h \ 844 | /usr/include/qt/QtCore/qcontiguouscache.h \ 845 | /usr/include/qt/QtCore/qfile.h \ 846 | /usr/include/qt/QtCore/qfiledevice.h \ 847 | /usr/include/qt/QtGui/qvector2d.h \ 848 | /usr/include/qt/QtGui/qtouchdevice.h \ 849 | /usr/include/qt/QtGui/QBitmap \ 850 | /usr/include/qt/QtGui/qbitmap.h \ 851 | moc_remoteview.cpp 852 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o remoteview.o remoteview.cpp 853 | 854 | vncclientthread.o: vncclientthread.cpp vncclientthread.h \ 855 | /usr/include/qt/QtCore/QDebug \ 856 | /usr/include/qt/QtCore/qdebug.h \ 857 | /usr/include/qt/QtCore/qalgorithms.h \ 858 | /usr/include/qt/QtCore/qglobal.h \ 859 | /usr/include/qt/QtCore/qconfig.h \ 860 | /usr/include/qt/QtCore/qfeatures.h \ 861 | /usr/include/qt/QtCore/qsystemdetection.h \ 862 | /usr/include/qt/QtCore/qcompilerdetection.h \ 863 | /usr/include/qt/QtCore/qprocessordetection.h \ 864 | /usr/include/qt/QtCore/qglobalstatic.h \ 865 | /usr/include/qt/QtCore/qatomic.h \ 866 | /usr/include/qt/QtCore/qbasicatomic.h \ 867 | /usr/include/qt/QtCore/qatomic_bootstrap.h \ 868 | /usr/include/qt/QtCore/qgenericatomic.h \ 869 | /usr/include/qt/QtCore/qatomic_msvc.h \ 870 | /usr/include/qt/QtCore/qatomic_integrity.h \ 871 | /usr/include/qt/QtCore/qoldbasicatomic.h \ 872 | /usr/include/qt/QtCore/qatomic_vxworks.h \ 873 | /usr/include/qt/QtCore/qatomic_power.h \ 874 | /usr/include/qt/QtCore/qatomic_alpha.h \ 875 | /usr/include/qt/QtCore/qatomic_armv7.h \ 876 | /usr/include/qt/QtCore/qatomic_armv6.h \ 877 | /usr/include/qt/QtCore/qatomic_armv5.h \ 878 | /usr/include/qt/QtCore/qatomic_bfin.h \ 879 | /usr/include/qt/QtCore/qatomic_ia64.h \ 880 | /usr/include/qt/QtCore/qatomic_mips.h \ 881 | /usr/include/qt/QtCore/qatomic_s390.h \ 882 | /usr/include/qt/QtCore/qatomic_sh4a.h \ 883 | /usr/include/qt/QtCore/qatomic_sparc.h \ 884 | /usr/include/qt/QtCore/qatomic_x86.h \ 885 | /usr/include/qt/QtCore/qatomic_cxx11.h \ 886 | /usr/include/qt/QtCore/qatomic_gcc.h \ 887 | /usr/include/qt/QtCore/qatomic_unix.h \ 888 | /usr/include/qt/QtCore/qmutex.h \ 889 | /usr/include/qt/QtCore/qlogging.h \ 890 | /usr/include/qt/QtCore/qflags.h \ 891 | /usr/include/qt/QtCore/qtypeinfo.h \ 892 | /usr/include/qt/QtCore/qtypetraits.h \ 893 | /usr/include/qt/QtCore/qsysinfo.h \ 894 | /usr/include/qt/QtCore/qhash.h \ 895 | /usr/include/qt/QtCore/qchar.h \ 896 | /usr/include/qt/QtCore/qiterator.h \ 897 | /usr/include/qt/QtCore/qlist.h \ 898 | /usr/include/qt/QtCore/qrefcount.h \ 899 | /usr/include/qt/QtCore/qpair.h \ 900 | /usr/include/qt/QtCore/qmap.h \ 901 | /usr/include/qt/QtCore/qtextstream.h \ 902 | /usr/include/qt/QtCore/qiodevice.h \ 903 | /usr/include/qt/QtCore/qobject.h \ 904 | /usr/include/qt/QtCore/qobjectdefs.h \ 905 | /usr/include/qt/QtCore/qnamespace.h \ 906 | /usr/include/qt/QtCore/qobjectdefs_impl.h \ 907 | /usr/include/qt/QtCore/qstring.h \ 908 | /usr/include/qt/QtCore/qbytearray.h \ 909 | /usr/include/qt/QtCore/qarraydata.h \ 910 | /usr/include/qt/QtCore/qstringbuilder.h \ 911 | /usr/include/qt/QtCore/qcoreevent.h \ 912 | /usr/include/qt/QtCore/qscopedpointer.h \ 913 | /usr/include/qt/QtCore/qmetatype.h \ 914 | /usr/include/qt/QtCore/qvarlengtharray.h \ 915 | /usr/include/qt/QtCore/qcontainerfwd.h \ 916 | /usr/include/qt/QtCore/qisenum.h \ 917 | /usr/include/qt/QtCore/qobject_impl.h \ 918 | /usr/include/qt/QtCore/qlocale.h \ 919 | /usr/include/qt/QtCore/qvariant.h \ 920 | /usr/include/qt/QtCore/qshareddata.h \ 921 | /usr/include/qt/QtCore/qvector.h \ 922 | /usr/include/qt/QtCore/qpoint.h \ 923 | /usr/include/qt/QtCore/qset.h \ 924 | /usr/include/qt/QtCore/qcontiguouscache.h \ 925 | remoteview.h \ 926 | /usr/include/qt/QtCore/QUrl \ 927 | /usr/include/qt/QtCore/qurl.h \ 928 | /usr/include/qt/QtCore/qurlquery.h \ 929 | /usr/include/qt/QtCore/qstringlist.h \ 930 | /usr/include/qt/QtCore/qdatastream.h \ 931 | /usr/include/qt/QtCore/qregexp.h \ 932 | /usr/include/qt/QtCore/qstringmatcher.h \ 933 | vncview_global.h \ 934 | /usr/include/qt/QtWidgets/QWidget \ 935 | /usr/include/qt/QtWidgets/qwidget.h \ 936 | /usr/include/qt/QtGui/qwindowdefs.h \ 937 | /usr/include/qt/QtGui/qwindowdefs_win.h \ 938 | /usr/include/qt/QtCore/qmargins.h \ 939 | /usr/include/qt/QtCore/qrect.h \ 940 | /usr/include/qt/QtCore/qsize.h \ 941 | /usr/include/qt/QtGui/qpaintdevice.h \ 942 | /usr/include/qt/QtGui/qpalette.h \ 943 | /usr/include/qt/QtGui/qcolor.h \ 944 | /usr/include/qt/QtGui/qrgb.h \ 945 | /usr/include/qt/QtGui/qbrush.h \ 946 | /usr/include/qt/QtGui/qmatrix.h \ 947 | /usr/include/qt/QtGui/qpolygon.h \ 948 | /usr/include/qt/QtGui/qregion.h \ 949 | /usr/include/qt/QtCore/qline.h \ 950 | /usr/include/qt/QtGui/qtransform.h \ 951 | /usr/include/qt/QtGui/qpainterpath.h \ 952 | /usr/include/qt/QtGui/qimage.h \ 953 | /usr/include/qt/QtGui/qpixmap.h \ 954 | /usr/include/qt/QtCore/qsharedpointer.h \ 955 | /usr/include/qt/QtCore/qsharedpointer_impl.h \ 956 | /usr/include/qt/QtGui/qfont.h \ 957 | /usr/include/qt/QtGui/qfontmetrics.h \ 958 | /usr/include/qt/QtGui/qfontinfo.h \ 959 | /usr/include/qt/QtWidgets/qsizepolicy.h \ 960 | /usr/include/qt/QtGui/qcursor.h \ 961 | /usr/include/qt/QtGui/qkeysequence.h \ 962 | /usr/include/qt/QtGui/qevent.h \ 963 | /usr/include/qt/QtCore/qfile.h \ 964 | /usr/include/qt/QtCore/qfiledevice.h \ 965 | /usr/include/qt/QtGui/qvector2d.h \ 966 | /usr/include/qt/QtGui/qtouchdevice.h \ 967 | /usr/include/qt/QtCore/QQueue \ 968 | /usr/include/qt/QtCore/qqueue.h \ 969 | /usr/include/qt/QtCore/QThread \ 970 | /usr/include/qt/QtCore/qthread.h \ 971 | /usr/include/qt/QtGui/QImage \ 972 | /usr/include/qt/QtCore/QMutex \ 973 | rfb/rfbclient.h \ 974 | rfb/rfbproto.h \ 975 | rfb/rfbconfig.h \ 976 | rfb/rfbint.h \ 977 | rfb/keysym.h \ 978 | /usr/include/qt/QtCore/QMutexLocker \ 979 | /usr/include/qt/QtCore/QTimer \ 980 | /usr/include/qt/QtCore/qtimer.h \ 981 | /usr/include/qt/QtCore/qbasictimer.h \ 982 | moc_vncclientthread.cpp 983 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o vncclientthread.o vncclientthread.cpp 984 | 985 | vncview.o: vncview.cpp vncview.h \ 986 | vncview_global.h \ 987 | /usr/include/qt/QtCore/qglobal.h \ 988 | /usr/include/qt/QtCore/qconfig.h \ 989 | /usr/include/qt/QtCore/qfeatures.h \ 990 | /usr/include/qt/QtCore/qsystemdetection.h \ 991 | /usr/include/qt/QtCore/qcompilerdetection.h \ 992 | /usr/include/qt/QtCore/qprocessordetection.h \ 993 | /usr/include/qt/QtCore/qglobalstatic.h \ 994 | /usr/include/qt/QtCore/qatomic.h \ 995 | /usr/include/qt/QtCore/qbasicatomic.h \ 996 | /usr/include/qt/QtCore/qatomic_bootstrap.h \ 997 | /usr/include/qt/QtCore/qgenericatomic.h \ 998 | /usr/include/qt/QtCore/qatomic_msvc.h \ 999 | /usr/include/qt/QtCore/qatomic_integrity.h \ 1000 | /usr/include/qt/QtCore/qoldbasicatomic.h \ 1001 | /usr/include/qt/QtCore/qatomic_vxworks.h \ 1002 | /usr/include/qt/QtCore/qatomic_power.h \ 1003 | /usr/include/qt/QtCore/qatomic_alpha.h \ 1004 | /usr/include/qt/QtCore/qatomic_armv7.h \ 1005 | /usr/include/qt/QtCore/qatomic_armv6.h \ 1006 | /usr/include/qt/QtCore/qatomic_armv5.h \ 1007 | /usr/include/qt/QtCore/qatomic_bfin.h \ 1008 | /usr/include/qt/QtCore/qatomic_ia64.h \ 1009 | /usr/include/qt/QtCore/qatomic_mips.h \ 1010 | /usr/include/qt/QtCore/qatomic_s390.h \ 1011 | /usr/include/qt/QtCore/qatomic_sh4a.h \ 1012 | /usr/include/qt/QtCore/qatomic_sparc.h \ 1013 | /usr/include/qt/QtCore/qatomic_x86.h \ 1014 | /usr/include/qt/QtCore/qatomic_cxx11.h \ 1015 | /usr/include/qt/QtCore/qatomic_gcc.h \ 1016 | /usr/include/qt/QtCore/qatomic_unix.h \ 1017 | /usr/include/qt/QtCore/qmutex.h \ 1018 | /usr/include/qt/QtCore/qlogging.h \ 1019 | /usr/include/qt/QtCore/qflags.h \ 1020 | /usr/include/qt/QtCore/qtypeinfo.h \ 1021 | /usr/include/qt/QtCore/qtypetraits.h \ 1022 | /usr/include/qt/QtCore/qsysinfo.h \ 1023 | remoteview.h \ 1024 | /usr/include/qt/QtCore/QUrl \ 1025 | /usr/include/qt/QtCore/qurl.h \ 1026 | /usr/include/qt/QtCore/qbytearray.h \ 1027 | /usr/include/qt/QtCore/qrefcount.h \ 1028 | /usr/include/qt/QtCore/qnamespace.h \ 1029 | /usr/include/qt/QtCore/qarraydata.h \ 1030 | /usr/include/qt/QtCore/qstring.h \ 1031 | /usr/include/qt/QtCore/qchar.h \ 1032 | /usr/include/qt/QtCore/qstringbuilder.h \ 1033 | /usr/include/qt/QtCore/qobjectdefs.h \ 1034 | /usr/include/qt/QtCore/qobjectdefs_impl.h \ 1035 | /usr/include/qt/QtCore/qlist.h \ 1036 | /usr/include/qt/QtCore/qalgorithms.h \ 1037 | /usr/include/qt/QtCore/qiterator.h \ 1038 | /usr/include/qt/QtCore/qpair.h \ 1039 | /usr/include/qt/QtCore/qurlquery.h \ 1040 | /usr/include/qt/QtCore/qshareddata.h \ 1041 | /usr/include/qt/QtCore/qstringlist.h \ 1042 | /usr/include/qt/QtCore/qdatastream.h \ 1043 | /usr/include/qt/QtCore/qscopedpointer.h \ 1044 | /usr/include/qt/QtCore/qiodevice.h \ 1045 | /usr/include/qt/QtCore/qobject.h \ 1046 | /usr/include/qt/QtCore/qcoreevent.h \ 1047 | /usr/include/qt/QtCore/qmetatype.h \ 1048 | /usr/include/qt/QtCore/qvarlengtharray.h \ 1049 | /usr/include/qt/QtCore/qcontainerfwd.h \ 1050 | /usr/include/qt/QtCore/qisenum.h \ 1051 | /usr/include/qt/QtCore/qobject_impl.h \ 1052 | /usr/include/qt/QtCore/qregexp.h \ 1053 | /usr/include/qt/QtCore/qstringmatcher.h \ 1054 | /usr/include/qt/QtWidgets/QWidget \ 1055 | /usr/include/qt/QtWidgets/qwidget.h \ 1056 | /usr/include/qt/QtGui/qwindowdefs.h \ 1057 | /usr/include/qt/QtGui/qwindowdefs_win.h \ 1058 | /usr/include/qt/QtCore/qmargins.h \ 1059 | /usr/include/qt/QtCore/qrect.h \ 1060 | /usr/include/qt/QtCore/qsize.h \ 1061 | /usr/include/qt/QtCore/qpoint.h \ 1062 | /usr/include/qt/QtGui/qpaintdevice.h \ 1063 | /usr/include/qt/QtGui/qpalette.h \ 1064 | /usr/include/qt/QtGui/qcolor.h \ 1065 | /usr/include/qt/QtGui/qrgb.h \ 1066 | /usr/include/qt/QtGui/qbrush.h \ 1067 | /usr/include/qt/QtCore/qvector.h \ 1068 | /usr/include/qt/QtGui/qmatrix.h \ 1069 | /usr/include/qt/QtGui/qpolygon.h \ 1070 | /usr/include/qt/QtGui/qregion.h \ 1071 | /usr/include/qt/QtCore/qline.h \ 1072 | /usr/include/qt/QtGui/qtransform.h \ 1073 | /usr/include/qt/QtGui/qpainterpath.h \ 1074 | /usr/include/qt/QtGui/qimage.h \ 1075 | /usr/include/qt/QtGui/qpixmap.h \ 1076 | /usr/include/qt/QtCore/qsharedpointer.h \ 1077 | /usr/include/qt/QtCore/qsharedpointer_impl.h \ 1078 | /usr/include/qt/QtCore/qhash.h \ 1079 | /usr/include/qt/QtGui/qfont.h \ 1080 | /usr/include/qt/QtGui/qfontmetrics.h \ 1081 | /usr/include/qt/QtGui/qfontinfo.h \ 1082 | /usr/include/qt/QtWidgets/qsizepolicy.h \ 1083 | /usr/include/qt/QtGui/qcursor.h \ 1084 | /usr/include/qt/QtGui/qkeysequence.h \ 1085 | /usr/include/qt/QtGui/qevent.h \ 1086 | /usr/include/qt/QtCore/qvariant.h \ 1087 | /usr/include/qt/QtCore/qmap.h \ 1088 | /usr/include/qt/QtCore/qdebug.h \ 1089 | /usr/include/qt/QtCore/qtextstream.h \ 1090 | /usr/include/qt/QtCore/qlocale.h \ 1091 | /usr/include/qt/QtCore/qset.h \ 1092 | /usr/include/qt/QtCore/qcontiguouscache.h \ 1093 | /usr/include/qt/QtCore/qfile.h \ 1094 | /usr/include/qt/QtCore/qfiledevice.h \ 1095 | /usr/include/qt/QtGui/qvector2d.h \ 1096 | /usr/include/qt/QtGui/qtouchdevice.h \ 1097 | vncclientthread.h \ 1098 | /usr/include/qt/QtCore/QDebug \ 1099 | /usr/include/qt/QtCore/QQueue \ 1100 | /usr/include/qt/QtCore/qqueue.h \ 1101 | /usr/include/qt/QtCore/QThread \ 1102 | /usr/include/qt/QtCore/qthread.h \ 1103 | /usr/include/qt/QtGui/QImage \ 1104 | /usr/include/qt/QtCore/QMutex \ 1105 | rfb/rfbclient.h \ 1106 | rfb/rfbproto.h \ 1107 | rfb/rfbconfig.h \ 1108 | rfb/rfbint.h \ 1109 | rfb/keysym.h \ 1110 | /usr/include/qt/QtGui/QClipboard \ 1111 | /usr/include/qt/QtGui/qclipboard.h \ 1112 | /usr/include/qt/QtWidgets/QApplication \ 1113 | /usr/include/qt/QtWidgets/qapplication.h \ 1114 | /usr/include/qt/QtCore/qcoreapplication.h \ 1115 | /usr/include/qt/QtCore/qeventloop.h \ 1116 | /usr/include/qt/QtWidgets/qdesktopwidget.h \ 1117 | /usr/include/qt/QtGui/qguiapplication.h \ 1118 | /usr/include/qt/QtGui/qinputmethod.h \ 1119 | /usr/include/qt/QtGui/QPainter \ 1120 | /usr/include/qt/QtGui/qpainter.h \ 1121 | /usr/include/qt/QtGui/qtextoption.h \ 1122 | /usr/include/qt/QtGui/qpen.h \ 1123 | /usr/include/qt/QtGui/QMouseEvent \ 1124 | /usr/include/qt/QtWidgets/QMessageBox \ 1125 | /usr/include/qt/QtWidgets/qmessagebox.h \ 1126 | /usr/include/qt/QtWidgets/qdialog.h \ 1127 | /usr/include/qt/QtWidgets/QInputDialog \ 1128 | /usr/include/qt/QtWidgets/qinputdialog.h \ 1129 | /usr/include/qt/QtWidgets/qlineedit.h \ 1130 | /usr/include/qt/QtWidgets/qframe.h \ 1131 | /usr/include/qt/QtGui/qtextcursor.h \ 1132 | /usr/include/qt/QtGui/qtextformat.h \ 1133 | moc_vncview.cpp 1134 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o vncview.o vncview.cpp 1135 | 1136 | ####### Install 1137 | 1138 | install: FORCE 1139 | 1140 | uninstall: FORCE 1141 | 1142 | FORCE: 1143 | 1144 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | libvncview 2 | ========== 3 | 4 | 基于Qt的vnc客户端库(提取自KRDC项目) 5 | 6 | 几点说明: 7 | - qt版本为5.x 8 | -------------------------------------------------------------------------------- /libvncview.pro: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Automatically generated by qmake (3.0) Thu Oct 3 11:59:11 2013 3 | ###################################################################### 4 | 5 | TEMPLATE = lib 6 | TARGET = vncview 7 | INCLUDEPATH += . rfb 8 | DEFINES += QTONLY 9 | LIBS += -lvncclient 10 | 11 | # Input 12 | HEADERS += remoteview.h \ 13 | vncclientthread.h \ 14 | vncview.h \ 15 | vncview_global.h \ 16 | rfb/keysym.h \ 17 | rfb/rfb.h \ 18 | rfb/rfbclient.h \ 19 | rfb/rfbconfig.h \ 20 | rfb/rfbint.h \ 21 | rfb/rfbproto.h \ 22 | rfb/rfbregion.h 23 | SOURCES += remoteview.cpp vncclientthread.cpp vncview.cpp 24 | -------------------------------------------------------------------------------- /remoteview.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2002-2003 Tim Jansen 4 | ** Copyright (C) 2007-2008 Urs Wolfer 5 | ** 6 | ** This file is part of KDE. 7 | ** 8 | ** This program is free software; you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation; either version 2 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** This program is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with this program; see the file COPYING. If not, write to 20 | ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | ** Boston, MA 02110-1301, USA. 22 | ** 23 | ****************************************************************************/ 24 | 25 | #include "remoteview.h" 26 | 27 | #ifndef QTONLY 28 | #include 29 | #include 30 | #endif 31 | 32 | #include 33 | 34 | RemoteView::RemoteView(QWidget *parent) 35 | : QWidget(parent), 36 | m_status(Disconnected), 37 | m_host(QString()), 38 | m_port(0), 39 | m_viewOnly(false), 40 | m_grabAllKeys(false), 41 | m_scale(false), 42 | m_keyboardIsGrabbed(false), 43 | #ifndef QTONLY 44 | m_wallet(0), 45 | #endif 46 | m_dotCursorState(CursorOff) 47 | { 48 | } 49 | 50 | RemoteView::~RemoteView() 51 | { 52 | #ifndef QTONLY 53 | delete m_wallet; 54 | #endif 55 | } 56 | 57 | RemoteView::RemoteStatus RemoteView::status() 58 | { 59 | return m_status; 60 | } 61 | 62 | void RemoteView::setStatus(RemoteView::RemoteStatus s) 63 | { 64 | if (m_status == s) 65 | return; 66 | 67 | if (((1+ m_status) != s) && (s != Disconnected)) { 68 | // follow state transition rules 69 | 70 | if (s == Disconnecting) { 71 | if (m_status == Disconnected) 72 | return; 73 | } else { 74 | Q_ASSERT(((int) s) >= 0); 75 | if (m_status > s) { 76 | m_status = Disconnected; 77 | emit statusChanged(Disconnected); 78 | } 79 | // smooth state transition 80 | RemoteStatus origState = m_status; 81 | for (int i = origState; i < s; ++i) { 82 | m_status = (RemoteStatus) i; 83 | emit statusChanged((RemoteStatus) i); 84 | } 85 | } 86 | } 87 | m_status = s; 88 | emit statusChanged(m_status); 89 | } 90 | 91 | bool RemoteView::supportsScaling() const 92 | { 93 | return false; 94 | } 95 | 96 | bool RemoteView::supportsLocalCursor() const 97 | { 98 | return false; 99 | } 100 | 101 | QString RemoteView::host() 102 | { 103 | return m_host; 104 | } 105 | 106 | QSize RemoteView::framebufferSize() 107 | { 108 | return QSize(0, 0); 109 | } 110 | 111 | void RemoteView::startQuitting() 112 | { 113 | } 114 | 115 | bool RemoteView::isQuitting() 116 | { 117 | return false; 118 | } 119 | 120 | int RemoteView::port() 121 | { 122 | return m_port; 123 | } 124 | 125 | void RemoteView::updateConfiguration() 126 | { 127 | } 128 | 129 | void RemoteView::keyEvent(QKeyEvent *) 130 | { 131 | } 132 | 133 | bool RemoteView::viewOnly() 134 | { 135 | return m_viewOnly; 136 | } 137 | 138 | void RemoteView::setViewOnly(bool viewOnly) 139 | { 140 | m_viewOnly = viewOnly; 141 | } 142 | 143 | bool RemoteView::grabAllKeys() 144 | { 145 | return m_grabAllKeys; 146 | } 147 | 148 | void RemoteView::setGrabAllKeys(bool grabAllKeys) 149 | { 150 | m_grabAllKeys = grabAllKeys; 151 | 152 | if (grabAllKeys) { 153 | m_keyboardIsGrabbed = true; 154 | grabKeyboard(); 155 | } else if (m_keyboardIsGrabbed) { 156 | releaseKeyboard(); 157 | } 158 | } 159 | 160 | QPixmap RemoteView::takeScreenshot() 161 | { 162 | return QPixmap::grabWidget(this); 163 | } 164 | 165 | void RemoteView::showDotCursor(DotCursorState state) 166 | { 167 | m_dotCursorState = state; 168 | } 169 | 170 | RemoteView::DotCursorState RemoteView::dotCursorState() const 171 | { 172 | return m_dotCursorState; 173 | } 174 | 175 | bool RemoteView::scaling() const 176 | { 177 | return m_scale; 178 | } 179 | 180 | void RemoteView::enableScaling(bool scale) 181 | { 182 | m_scale = scale; 183 | } 184 | 185 | void RemoteView::switchFullscreen(bool) 186 | { 187 | } 188 | 189 | void RemoteView::scaleResize(int, int) 190 | { 191 | } 192 | 193 | KUrl RemoteView::url() 194 | { 195 | return m_url; 196 | } 197 | 198 | #ifndef QTONLY 199 | QString RemoteView::readWalletPassword(bool fromUserNameOnly) 200 | { 201 | const QString KRDCFOLDER = "KRDC"; 202 | 203 | window()->setDisabled(true); // WORKAROUND: disable inputs so users cannot close the current tab (see #181230) 204 | m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), window()->winId()); 205 | window()->setDisabled(false); 206 | 207 | if (m_wallet) { 208 | bool walletOK = m_wallet->hasFolder(KRDCFOLDER); 209 | if (!walletOK) { 210 | walletOK = m_wallet->createFolder(KRDCFOLDER); 211 | kDebug(5010) << "Wallet folder created"; 212 | } 213 | if (walletOK) { 214 | kDebug(5010) << "Wallet OK"; 215 | m_wallet->setFolder(KRDCFOLDER); 216 | QString password; 217 | 218 | QString key; 219 | if (fromUserNameOnly) 220 | key = m_url.userName(); 221 | else 222 | key = m_url.prettyUrl(KUrl::RemoveTrailingSlash); 223 | 224 | if (m_wallet->hasEntry(key) && 225 | !m_wallet->readPassword(key, password)) { 226 | kDebug(5010) << "Password read OK"; 227 | 228 | return password; 229 | } 230 | } 231 | } 232 | return QString(); 233 | } 234 | 235 | void RemoteView::saveWalletPassword(const QString &password, bool fromUserNameOnly) 236 | { 237 | QString key; 238 | if (fromUserNameOnly) 239 | key = m_url.userName(); 240 | else 241 | key = m_url.prettyUrl(KUrl::RemoveTrailingSlash); 242 | 243 | if (m_wallet && m_wallet->isOpen()) { 244 | kDebug(5010) << "Write wallet password"; 245 | m_wallet->writePassword(key, password); 246 | } 247 | } 248 | #endif 249 | 250 | QCursor RemoteView::localDotCursor() const 251 | { 252 | #ifdef QTONLY 253 | return QCursor(); //TODO 254 | #else 255 | QBitmap cursorBitmap(KGlobal::dirs()->findResource("appdata", 256 | "pics/pointcursor.png")); 257 | QBitmap cursorMask(KGlobal::dirs()->findResource("appdata", 258 | "pics/pointcursormask.png")); 259 | return QCursor(cursorBitmap, cursorMask); 260 | #endif 261 | } 262 | 263 | void RemoteView::focusInEvent(QFocusEvent *event) 264 | { 265 | if (m_grabAllKeys) { 266 | m_keyboardIsGrabbed = true; 267 | grabKeyboard(); 268 | } 269 | 270 | QWidget::focusInEvent(event); 271 | } 272 | 273 | void RemoteView::focusOutEvent(QFocusEvent *event) 274 | { 275 | if (m_grabAllKeys || m_keyboardIsGrabbed) { 276 | m_keyboardIsGrabbed = false; 277 | releaseKeyboard(); 278 | } 279 | 280 | QWidget::focusOutEvent(event); 281 | } 282 | 283 | #include "moc_remoteview.cpp" 284 | -------------------------------------------------------------------------------- /remoteview.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2002-2003 Tim Jansen 4 | ** Copyright (C) 2007-2008 Urs Wolfer 5 | ** 6 | ** This file is part of KDE. 7 | ** 8 | ** This program is free software; you can redistribute it and/or modify 9 | ** it under the terms of the GNU General Public License as published by 10 | ** the Free Software Foundation; either version 2 of the License, or 11 | ** (at your option) any later version. 12 | ** 13 | ** This program is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU General Public License 19 | ** along with this program; see the file COPYING. If not, write to 20 | ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | ** Boston, MA 02110-1301, USA. 22 | ** 23 | ****************************************************************************/ 24 | 25 | #ifndef REMOTEVIEW_H 26 | #define REMOTEVIEW_H 27 | 28 | #ifdef QTONLY 29 | #include 30 | #define KUrl QUrl 31 | #include "vncview_global.h" 32 | #define KRDCCORE_EXPORT VNCVIEWSHARED_EXPORT 33 | #else 34 | #include 35 | #include 36 | #include 37 | #endif 38 | 39 | #include 40 | 41 | class HostPreferences; 42 | 43 | /** 44 | * Generic widget that displays a remote framebuffer. 45 | * Implement this if you want to add another backend. 46 | * 47 | * Things to take care of: 48 | * @li The RemoteView is responsible for its size. In 49 | * non-scaling mode, set the fixed size of the widget 50 | * to the remote resolution. In scaling mode, set the 51 | * maximum size to the remote size and minimum size to the 52 | * smallest resolution that your scaler can handle. 53 | * @li if you override mouseMoveEvent() 54 | * you must ignore the QEvent, because the KRDC widget will 55 | * need it for stuff like toolbar auto-hide and bump 56 | * scrolling. If you use x11Event(), make sure that 57 | * MotionNotify events will be forwarded. 58 | * 59 | */ 60 | class KRDCCORE_EXPORT RemoteView : public QWidget 61 | { 62 | Q_OBJECT 63 | 64 | public: 65 | 66 | Q_ENUMS(Quality) 67 | 68 | enum Quality { 69 | Unknown, 70 | High, 71 | Medium, 72 | Low 73 | }; 74 | 75 | /** 76 | * Describes the state of a local cursor, if there is such a concept in the backend. 77 | * With local cursors, there are two cursors: the cursor on the local machine (client), 78 | * and the cursor on the remote machine (server). Because there is usually some lag, 79 | * some backends show both cursors simultanously. In the VNC backend the local cursor 80 | * is a dot and the remote cursor is the 'real' cursor, usually an arrow. 81 | */ 82 | 83 | Q_ENUMS(DotCursorState) 84 | 85 | enum DotCursorState { 86 | CursorOn, ///< Always show local cursor (and the remote one). 87 | CursorOff, ///< Never show local cursor, only the remote one. 88 | /// Try to measure the lag and enable the local cursor if the latency is too high. 89 | CursorAuto 90 | }; 91 | 92 | /** 93 | * State of the connection. The state of the connection is returned 94 | * by @ref RemoteView::status(). 95 | * 96 | * Not every state transition is allowed. You are only allowed to transition 97 | * a state to the following state, with three exceptions: 98 | * @li You can move from every state directly to Disconnected 99 | * @li You can move from every state except Disconnected to 100 | * Disconnecting 101 | * @li You can move from Disconnected to Connecting 102 | * 103 | * @ref RemoteView::setStatus() will follow this rules for you. 104 | * (If you add/remove a state here, you must adapt it) 105 | */ 106 | 107 | Q_ENUMS(RemoteStatus) 108 | 109 | enum RemoteStatus { 110 | Connecting = 0, 111 | Authenticating = 1, 112 | Preparing = 2, 113 | Connected = 3, 114 | Disconnecting = -1, 115 | Disconnected = -2 116 | }; 117 | 118 | Q_ENUMS(ErrorCode) 119 | 120 | enum ErrorCode { 121 | None = 0, 122 | Internal, 123 | Connection, 124 | Protocol, 125 | IO, 126 | Name, 127 | NoServer, 128 | ServerBlocked, 129 | Authentication 130 | }; 131 | 132 | virtual ~RemoteView(); 133 | 134 | /** 135 | * Checks whether the backend supports scaling. The 136 | * default implementation returns false. 137 | * @return true if scaling is supported 138 | * @see scaling() 139 | */ 140 | virtual bool supportsScaling() const; 141 | 142 | /** 143 | * Checks whether the widget is in scale mode. The 144 | * default implementation always returns false. 145 | * @return true if scaling is activated. Must always be 146 | * false if @ref supportsScaling() returns false 147 | * @see supportsScaling() 148 | */ 149 | virtual bool scaling() const; 150 | 151 | /** 152 | * Checks whether the backend supports the concept of local cursors. The 153 | * default implementation returns false. 154 | * @return true if local cursors are supported/known 155 | * @see DotCursorState 156 | * @see showDotCursor() 157 | * @see dotCursorState() 158 | */ 159 | virtual bool supportsLocalCursor() const; 160 | 161 | /** 162 | * Sets the state of the dot cursor, if supported by the backend. 163 | * The default implementation does nothing. 164 | * @param state the new state (CursorOn, CursorOff or 165 | * CursorAuto) 166 | * @see dotCursorState() 167 | * @see supportsLocalCursor() 168 | */ 169 | virtual void showDotCursor(DotCursorState state); 170 | 171 | /** 172 | * Returns the state of the local cursor. The default implementation returns 173 | * always CursorOff. 174 | * @return true if local cursors are supported/known 175 | * @see showDotCursor() 176 | * @see supportsLocalCursor() 177 | */ 178 | virtual DotCursorState dotCursorState() const; 179 | 180 | /** 181 | * Checks whether the view is in view-only mode. This means 182 | * that all input is ignored. 183 | */ 184 | virtual bool viewOnly(); 185 | 186 | /** 187 | * Checks whether grabbing all possible keys is enabled. 188 | */ 189 | virtual bool grabAllKeys(); 190 | 191 | /** 192 | * Returns the resolution of the remote framebuffer. 193 | * It should return a null @ref QSize when the size 194 | * is not known. 195 | * The backend must also emit a @ref framebufferSizeChanged() 196 | * when the size of the framebuffer becomes available 197 | * for the first time or the size changed. 198 | * @return the remote framebuffer size, a null QSize 199 | * if unknown 200 | */ 201 | virtual QSize framebufferSize(); 202 | 203 | /** 204 | * Initiate the disconnection. This doesn't need to happen 205 | * immediately. The call must not block. 206 | * @see isQuitting() 207 | */ 208 | virtual void startQuitting(); 209 | 210 | /** 211 | * Checks whether the view is currently quitting. 212 | * @return true if it is quitting 213 | * @see startQuitting() 214 | * @see setStatus() 215 | */ 216 | virtual bool isQuitting(); 217 | 218 | /** 219 | * @return the host the view is connected to 220 | */ 221 | virtual QString host(); 222 | 223 | /** 224 | * @return the port the view is connected to 225 | */ 226 | virtual int port(); 227 | 228 | /** 229 | * Initialize the view (for example by showing configuration 230 | * dialogs to the user) and start connecting. Should not block 231 | * without running the event loop (so displaying a dialog is ok). 232 | * When the view starts connecting the application must call 233 | * @ref setStatus() with the status Connecting. 234 | * @return true if successful (so far), false 235 | * otherwise 236 | * @see connected() 237 | * @see disconnected() 238 | * @see disconnectedError() 239 | * @see statusChanged() 240 | */ 241 | virtual bool start() = 0; 242 | 243 | /** 244 | * Called when the configuration is changed. 245 | * The default implementation does nothing. 246 | */ 247 | virtual void updateConfiguration(); 248 | 249 | /** 250 | * @return screenshot of the view 251 | */ 252 | virtual QPixmap takeScreenshot(); 253 | 254 | #ifndef QTONLY 255 | /** 256 | * Returns the current host preferences of this view. 257 | */ 258 | virtual HostPreferences* hostPreferences() = 0; 259 | #endif 260 | 261 | /** 262 | * Returns the current status of the connection. 263 | * @return the status of the connection 264 | * @see setStatus() 265 | */ 266 | RemoteStatus status(); 267 | 268 | /** 269 | * @return the current url 270 | */ 271 | KUrl url(); 272 | 273 | public slots: 274 | /** 275 | * Called to enable or disable scaling. 276 | * Ignored if @ref supportsScaling() is false. 277 | * The default implementation does nothing. 278 | * @param s true to enable, false to disable. 279 | * @see supportsScaling() 280 | * @see scaling() 281 | */ 282 | virtual void enableScaling(bool scale); 283 | 284 | /** 285 | * Enables/disables the view-only mode. 286 | * Ignored if @ref supportsScaling() is false. 287 | * The default implementation does nothing. 288 | * @param viewOnly true to enable, false to disable. 289 | * @see supportsScaling() 290 | * @see viewOnly() 291 | */ 292 | virtual void setViewOnly(bool viewOnly); 293 | 294 | /** 295 | * Enables/disables grabbing all possible keys. 296 | * @param grabAllKeys true to enable, false to disable. 297 | * Default is false. 298 | * @see grabAllKeys() 299 | */ 300 | virtual void setGrabAllKeys(bool grabAllKeys); 301 | 302 | /** 303 | * Called to let the backend know it when 304 | * we switch from/to fullscreen. 305 | * @param on true when switching to fullscreen, 306 | * false when switching from fullscreen. 307 | */ 308 | virtual void switchFullscreen(bool on); 309 | 310 | /** 311 | * Sends a QKeyEvent to the remote server. 312 | * @param event the key to send 313 | */ 314 | virtual void keyEvent(QKeyEvent *event); 315 | 316 | /** 317 | * Called when the visible place changed so remote 318 | * view can resize itself. 319 | */ 320 | virtual void scaleResize(int w, int h); 321 | 322 | Q_SIGNALS: 323 | /** 324 | * Emitted when the size of the remote screen changes. Also 325 | * called when the size is known for the first time. 326 | * @param x the width of the screen 327 | * @param y the height of the screen 328 | */ 329 | void framebufferSizeChanged(int w, int h); 330 | 331 | /** 332 | * Emitted when the view connected successfully. 333 | */ 334 | void connected(); 335 | 336 | /** 337 | * Emitted when the view disconnected without error. 338 | */ 339 | void disconnected(); 340 | 341 | /** 342 | * Emitted when the view disconnected with error. 343 | */ 344 | void disconnectedError(); 345 | 346 | /** 347 | * Emitted when the view has a specific error. 348 | */ 349 | void errorMessage(const QString &title, const QString &message); 350 | 351 | /** 352 | * Emitted when the status of the view changed. 353 | * @param s the new status 354 | */ 355 | void statusChanged(RemoteView::RemoteStatus s); 356 | 357 | /** 358 | * Emitted when the password dialog is shown or hidden. 359 | * @param b true when the dialog is shown, false when it has been hidden 360 | */ 361 | void showingPasswordDialog(bool b); 362 | 363 | /** 364 | * Emitted when the mouse on the remote side has been moved. 365 | * @param x the new x coordinate 366 | * @param y the new y coordinate 367 | * @param buttonMask the mask of mouse buttons (bit 0 for first mouse 368 | * button, 1 for second button etc)a 369 | */ 370 | void mouseStateChanged(int x, int y, int buttonMask); 371 | 372 | protected: 373 | RemoteView(QWidget *parent = 0); 374 | 375 | void focusInEvent(QFocusEvent *event); 376 | void focusOutEvent(QFocusEvent *event); 377 | 378 | /** 379 | * The status of the remote view. 380 | */ 381 | RemoteStatus m_status; 382 | 383 | /** 384 | * Set the status of the connection. 385 | * Emits a statusChanged() signal. 386 | * Note that the states need to be set in a certain order, 387 | * see @ref Status. setStatus() will try to do this 388 | * transition automatically, so if you are in Connecting 389 | * and call setStatus(Preparing), setStatus() will 390 | * emit a Authenticating and then Preparing. 391 | * If you transition backwards, it will emit a 392 | * Disconnected before doing the transition. 393 | * @param s the new status 394 | */ 395 | virtual void setStatus(RemoteStatus s); 396 | 397 | QCursor localDotCursor() const; 398 | 399 | QString m_host; 400 | int m_port; 401 | bool m_viewOnly; 402 | bool m_grabAllKeys; 403 | bool m_scale; 404 | bool m_keyboardIsGrabbed; 405 | KUrl m_url; 406 | 407 | #ifndef QTONLY 408 | QString readWalletPassword(bool fromUserNameOnly = false); 409 | void saveWalletPassword(const QString &password, bool fromUserNameOnly = false); 410 | KWallet::Wallet *m_wallet; 411 | #endif 412 | 413 | DotCursorState m_dotCursorState; 414 | }; 415 | 416 | #endif 417 | -------------------------------------------------------------------------------- /rfb/rfbclient.h: -------------------------------------------------------------------------------- 1 | #ifndef RFBCLIENT_H 2 | #define RFBCLIENT_H 3 | 4 | /** 5 | * @defgroup libvncclient_api LibVNCClient API Reference 6 | * @{ 7 | */ 8 | 9 | /* 10 | * Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved. 11 | * Copyright (C) 2000 Tridia Corporation. All Rights Reserved. 12 | * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. 13 | * 14 | * This is free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | * 19 | * This software is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * You should have received a copy of the GNU General Public License 25 | * along with this software; if not, write to the Free Software 26 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 27 | * USA. 28 | */ 29 | 30 | /** 31 | * @file rfbclient.h 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #define rfbClientSwap16IfLE(s) \ 43 | (*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) 44 | 45 | #define rfbClientSwap32IfLE(l) \ 46 | (*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \ 47 | (((l) & 0x00ff0000) >> 8) | \ 48 | (((l) & 0x0000ff00) << 8) | \ 49 | (((l) & 0x000000ff) << 24)) : (l)) 50 | 51 | #define rfbClientSwap64IfLE(l) \ 52 | (*(char *)&client->endianTest ? ((((l) & 0xff00000000000000ULL) >> 56) | \ 53 | (((l) & 0x00ff000000000000ULL) >> 40) | \ 54 | (((l) & 0x0000ff0000000000ULL) >> 24) | \ 55 | (((l) & 0x000000ff00000000ULL) >> 8) | \ 56 | (((l) & 0x00000000ff000000ULL) << 8) | \ 57 | (((l) & 0x0000000000ff0000ULL) << 24) | \ 58 | (((l) & 0x000000000000ff00ULL) << 40) | \ 59 | (((l) & 0x00000000000000ffULL) << 56)) : (l)) 60 | 61 | #define FLASH_PORT_OFFSET 5400 62 | #define LISTEN_PORT_OFFSET 5500 63 | #define TUNNEL_PORT_OFFSET 5500 64 | #define SERVER_PORT_OFFSET 5900 65 | 66 | #define DEFAULT_SSH_CMD "/usr/bin/ssh" 67 | #define DEFAULT_TUNNEL_CMD \ 68 | (DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20") 69 | #define DEFAULT_VIA_CMD \ 70 | (DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20") 71 | 72 | #if(defined __cplusplus) 73 | extern "C" 74 | { 75 | #endif 76 | 77 | /** vncrec */ 78 | 79 | typedef struct { 80 | FILE* file; 81 | struct timeval tv; 82 | rfbBool readTimestamp; 83 | rfbBool doNotSleep; 84 | } rfbVNCRec; 85 | 86 | /** client data */ 87 | 88 | typedef struct rfbClientData { 89 | void* tag; 90 | void* data; 91 | struct rfbClientData* next; 92 | } rfbClientData; 93 | 94 | /** app data (belongs into rfbClient?) */ 95 | 96 | typedef struct { 97 | rfbBool shareDesktop; 98 | rfbBool viewOnly; 99 | 100 | const char* encodingsString; 101 | 102 | rfbBool useBGR233; 103 | int nColours; 104 | rfbBool forceOwnCmap; 105 | rfbBool forceTrueColour; 106 | int requestedDepth; 107 | 108 | int compressLevel; 109 | int qualityLevel; 110 | rfbBool enableJPEG; 111 | rfbBool useRemoteCursor; 112 | rfbBool palmVNC; /**< use palmvnc specific SetScale (vs ultravnc) */ 113 | int scaleSetting; /**< 0 means no scale set, else 1/scaleSetting */ 114 | } AppData; 115 | 116 | /** For GetCredentialProc callback function to return */ 117 | typedef union _rfbCredential 118 | { 119 | /** X509 (VeNCrypt) */ 120 | struct 121 | { 122 | char *x509CACertFile; 123 | char *x509CACrlFile; 124 | char *x509ClientCertFile; 125 | char *x509ClientKeyFile; 126 | } x509Credential; 127 | /** Plain (VeNCrypt), MSLogon (UltraVNC) */ 128 | struct 129 | { 130 | char *username; 131 | char *password; 132 | } userCredential; 133 | } rfbCredential; 134 | 135 | #define rfbCredentialTypeX509 1 136 | #define rfbCredentialTypeUser 2 137 | 138 | struct _rfbClient; 139 | 140 | /** 141 | * Handles a text chat message. If your application should accept text messages 142 | * from the server, define a function with this prototype and set 143 | * client->HandleTextChat to a pointer to that function subsequent to your 144 | * rfbGetClient() call. 145 | * @param client The client which called the text chat handler 146 | * @param value text length if text != NULL, or one of rfbTextChatOpen, 147 | * rfbTextChatClose, rfbTextChatFinished if text == NULL 148 | * @param text The text message from the server 149 | */ 150 | typedef void (*HandleTextChatProc)(struct _rfbClient* client, int value, char *text); 151 | /** 152 | * Handles XVP server messages. If your application sends XVP messages to the 153 | * server, you'll want to handle the server's XVP_FAIL and XVP_INIT responses. 154 | * Define a function with this prototype and set client->HandleXvpMsg to a 155 | * pointer to that function subsequent to your rfbGetClient() call. 156 | * @param client The client which called the XVP message handler 157 | * @param version The highest XVP extension version that the server supports 158 | * @param opcode The opcode. 0 is XVP_FAIL, 1 is XVP_INIT 159 | */ 160 | typedef void (*HandleXvpMsgProc)(struct _rfbClient* client, uint8_t version, uint8_t opcode); 161 | typedef void (*HandleKeyboardLedStateProc)(struct _rfbClient* client, int value, int pad); 162 | typedef rfbBool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y); 163 | typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h); 164 | typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client); 165 | typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h); 166 | typedef void (*FinishedFrameBufferUpdateProc)(struct _rfbClient* client); 167 | typedef char* (*GetPasswordProc)(struct _rfbClient* client); 168 | typedef rfbCredential* (*GetCredentialProc)(struct _rfbClient* client, int credentialType); 169 | typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client); 170 | typedef void (*GotXCutTextProc)(struct _rfbClient* client, const char *text, int textlen); 171 | typedef void (*BellProc)(struct _rfbClient* client); 172 | 173 | typedef void (*GotCursorShapeProc)(struct _rfbClient* client, int xhot, int yhot, int width, int height, int bytesPerPixel); 174 | typedef void (*GotCopyRectProc)(struct _rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y); 175 | 176 | typedef struct _rfbClient { 177 | uint8_t* frameBuffer; 178 | int width, height; 179 | 180 | int endianTest; 181 | 182 | AppData appData; 183 | 184 | const char* programName; 185 | char* serverHost; 186 | int serverPort; /**< if -1, then use file recorded by vncrec */ 187 | rfbBool listenSpecified; 188 | int listenPort, flashPort; 189 | 190 | struct { 191 | int x, y, w, h; 192 | } updateRect; 193 | 194 | /** Note that the CoRRE encoding uses this buffer and assumes it is big enough 195 | to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes. 196 | Hextile also assumes it is big enough to hold 16 * 16 * 32 bits. 197 | Tight encoding assumes BUFFER_SIZE is at least 16384 bytes. */ 198 | 199 | #define RFB_BUFFER_SIZE (640*480) 200 | char buffer[RFB_BUFFER_SIZE]; 201 | 202 | /* rfbproto.c */ 203 | 204 | int sock; 205 | rfbBool canUseCoRRE; 206 | rfbBool canUseHextile; 207 | char *desktopName; 208 | rfbPixelFormat format; 209 | rfbServerInitMsg si; 210 | 211 | /* sockets.c */ 212 | #define RFB_BUF_SIZE 8192 213 | char buf[RFB_BUF_SIZE]; 214 | char *bufoutptr; 215 | int buffered; 216 | 217 | /* The zlib encoding requires expansion/decompression/deflation of the 218 | compressed data in the "buffer" above into another, result buffer. 219 | However, the size of the result buffer can be determined precisely 220 | based on the bitsPerPixel, height and width of the rectangle. We 221 | allocate this buffer one time to be the full size of the buffer. */ 222 | 223 | /* Ultra Encoding uses this buffer too */ 224 | 225 | int ultra_buffer_size; 226 | char *ultra_buffer; 227 | 228 | int raw_buffer_size; 229 | char *raw_buffer; 230 | 231 | #ifdef LIBVNCSERVER_HAVE_LIBZ 232 | z_stream decompStream; 233 | rfbBool decompStreamInited; 234 | #endif 235 | 236 | 237 | #ifdef LIBVNCSERVER_HAVE_LIBZ 238 | /* 239 | * Variables for the ``tight'' encoding implementation. 240 | */ 241 | 242 | /** Separate buffer for compressed data. */ 243 | #define ZLIB_BUFFER_SIZE 30000 244 | char zlib_buffer[ZLIB_BUFFER_SIZE]; 245 | 246 | /* Four independent compression streams for zlib library. */ 247 | z_stream zlibStream[4]; 248 | rfbBool zlibStreamActive[4]; 249 | 250 | /* Filter stuff. Should be initialized by filter initialization code. */ 251 | rfbBool cutZeros; 252 | int rectWidth, rectColors; 253 | char tightPalette[256*4]; 254 | uint8_t tightPrevRow[2048*3*sizeof(uint16_t)]; 255 | 256 | #ifdef LIBVNCSERVER_HAVE_LIBJPEG 257 | /** JPEG decoder state. */ 258 | rfbBool jpegError; 259 | 260 | struct jpeg_source_mgr* jpegSrcManager; 261 | void* jpegBufferPtr; 262 | size_t jpegBufferLen; 263 | 264 | #endif 265 | #endif 266 | 267 | 268 | /* cursor.c */ 269 | uint8_t *rcSource, *rcMask; 270 | 271 | /** private data pointer */ 272 | rfbClientData* clientData; 273 | 274 | rfbVNCRec* vncRec; 275 | 276 | /* Keyboard State support (is 'Caps Lock' set on the remote display???) */ 277 | int KeyboardLedStateEnabled; 278 | int CurrentKeyboardLedState; 279 | 280 | int canHandleNewFBSize; 281 | 282 | /* hooks */ 283 | HandleTextChatProc HandleTextChat; 284 | HandleKeyboardLedStateProc HandleKeyboardLedState; 285 | HandleCursorPosProc HandleCursorPos; 286 | SoftCursorLockAreaProc SoftCursorLockArea; 287 | SoftCursorUnlockScreenProc SoftCursorUnlockScreen; 288 | GotFrameBufferUpdateProc GotFrameBufferUpdate; 289 | /** the pointer returned by GetPassword will be freed after use! */ 290 | GetPasswordProc GetPassword; 291 | MallocFrameBufferProc MallocFrameBuffer; 292 | GotXCutTextProc GotXCutText; 293 | BellProc Bell; 294 | 295 | GotCursorShapeProc GotCursorShape; 296 | GotCopyRectProc GotCopyRect; 297 | 298 | /** Which messages are supported by the server 299 | * This is a *guess* for most servers. 300 | * (If we can even detect the type of server) 301 | * 302 | * If the server supports the "rfbEncodingSupportedMessages" 303 | * then this will be updated when the encoding is received to 304 | * accurately reflect the servers capabilities. 305 | */ 306 | rfbSupportedMessages supportedMessages; 307 | 308 | /** negotiated protocol version */ 309 | int major, minor; 310 | 311 | /** The selected security types */ 312 | uint32_t authScheme, subAuthScheme; 313 | 314 | /** The TLS session for Anonymous TLS and VeNCrypt */ 315 | void* tlsSession; 316 | 317 | /** To support security types that requires user input (except VNC password 318 | * authentication), for example VeNCrypt and MSLogon, this callback function 319 | * must be set before the authentication. Otherwise, it implicates that the 320 | * caller application does not support it and related security types should 321 | * be bypassed. 322 | */ 323 | GetCredentialProc GetCredential; 324 | 325 | /** The 0-terminated security types supported by the client. 326 | * Set by function SetClientAuthSchemes() */ 327 | uint32_t *clientAuthSchemes; 328 | 329 | /** When the server is a repeater, this specifies the final destination */ 330 | char *destHost; 331 | int destPort; 332 | 333 | /** the QoS IP DSCP for this client */ 334 | int QoS_DSCP; 335 | 336 | /** hook to handle xvp server messages */ 337 | HandleXvpMsgProc HandleXvpMsg; 338 | 339 | /* listen.c */ 340 | int listenSock; 341 | 342 | FinishedFrameBufferUpdateProc FinishedFrameBufferUpdate; 343 | 344 | char *listenAddress; 345 | /* IPv6 listen socket, address and port*/ 346 | int listen6Sock; 347 | char* listen6Address; 348 | int listen6Port; 349 | } rfbClient; 350 | 351 | /* cursor.c */ 352 | 353 | extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc); 354 | 355 | /* listen.c */ 356 | 357 | extern void listenForIncomingConnections(rfbClient* viewer); 358 | extern int listenForIncomingConnectionsNoFork(rfbClient* viewer, int usec_timeout); 359 | 360 | /* rfbproto.c */ 361 | 362 | extern rfbBool rfbEnableClientLogging; 363 | typedef void (*rfbClientLogProc)(const char *format, ...); 364 | extern rfbClientLogProc rfbClientLog,rfbClientErr; 365 | extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port); 366 | extern rfbBool ConnectToRFBRepeater(rfbClient* client,const char *repeaterHost, int repeaterPort, const char *destHost, int destPort); 367 | extern void SetClientAuthSchemes(rfbClient* client,const uint32_t *authSchemes, int size); 368 | extern rfbBool InitialiseRFBConnection(rfbClient* client); 369 | /** 370 | * Sends format and encoding parameters to the server. Your application can 371 | * modify the 'client' data structure directly. However some changes to this 372 | * structure must be communicated back to the server. For instance, if you 373 | * change the encoding to hextile, the server needs to know that it should send 374 | * framebuffer updates in hextile format. Likewise if you change the pixel 375 | * format of the framebuffer, the server must be notified about this as well. 376 | * Call this function to propagate your changes of the local 'client' structure 377 | * over to the server. 378 | * @li Encoding type 379 | * @li RFB protocol extensions announced via pseudo-encodings 380 | * @li Framebuffer pixel format (like RGB vs ARGB) 381 | * @li Remote cursor support 382 | * @param client The client in which the format or encodings have been changed 383 | * @return true if the format or encodings were sent to the server successfully, 384 | * false otherwise 385 | */ 386 | extern rfbBool SetFormatAndEncodings(rfbClient* client); 387 | extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client); 388 | /** 389 | * Sends a framebuffer update request to the server. A VNC client may request an 390 | * update from the server at any time. You can also specify which portions of 391 | * the screen you want updated. This can be handy if a pointer is at certain 392 | * location and the user pressed a mouse button, for instance. Then you can 393 | * immediately request an update of the region around the pointer from the 394 | * server. 395 | * @note The coordinate system is a left-handed Cartesian coordinate system with 396 | * the Z axis (unused) pointing out of the screen. Alternately you can think of 397 | * it as a right-handed Cartesian coordinate system with the Z axis pointing 398 | * into the screen. The origin is at the upper left corner of the framebuffer. 399 | * @param client The client through which to send the request 400 | * @param x The horizontal position of the update request rectangle 401 | * @param y The vertical position of the update request rectangle 402 | * @param w The width of the update request rectangle 403 | * @param h The height of the update request rectangle 404 | * @param incremental false: server sends rectangle even if nothing changed. 405 | * true: server only sends changed parts of rectangle. 406 | * @return true if the update request was sent successfully, false otherwise 407 | */ 408 | extern rfbBool SendFramebufferUpdateRequest(rfbClient* client, 409 | int x, int y, int w, int h, 410 | rfbBool incremental); 411 | extern rfbBool SendScaleSetting(rfbClient* client,int scaleSetting); 412 | /** 413 | * Sends a pointer event to the server. A pointer event includes a cursor 414 | * location and a button mask. The button mask indicates which buttons on the 415 | * pointing device are pressed. Each button is represented by a bit in the 416 | * button mask. A 1 indicates the button is pressed while a 0 indicates that it 417 | * is not pressed. You may use these pre-defined button masks by ORing them 418 | * together: rfbButton1Mask, rfbButton2Mask, rfbButton3Mask, rfbButton4Mask 419 | * rfbButton5Mask 420 | * @note The cursor location is relative to the client's framebuffer, not the 421 | * client's screen itself. 422 | * @note The coordinate system is a left-handed Cartesian coordinate system with 423 | * the Z axis (unused) pointing out of the screen. Alternately you can think of 424 | * it as a right-handed Cartesian coordinate system with the Z axis pointing 425 | * into the screen. The origin is at the upper left corner of the screen. 426 | * @param client The client through which to send the pointer event 427 | * @param x the horizontal location of the cursor 428 | * @param y the vertical location of the cursor 429 | * @param buttonMask the button mask indicating which buttons are pressed 430 | * @return true if the pointer event was sent successfully, false otherwise 431 | */ 432 | extern rfbBool SendPointerEvent(rfbClient* client,int x, int y, int buttonMask); 433 | /** 434 | * Sends a key event to the server. If your application is not merely a VNC 435 | * viewer (i.e. it controls the server), you'll want to send the keys that the 436 | * user presses to the server. Use this function to do that. 437 | * @param client The client through which to send the key event 438 | * @param key An rfbKeySym defined in rfb/keysym.h 439 | * @param down true if this was a key down event, false otherwise 440 | * @return true if the key event was send successfully, false otherwise 441 | */ 442 | extern rfbBool SendKeyEvent(rfbClient* client,uint32_t key, rfbBool down); 443 | /** 444 | * Places a string on the server's clipboard. Use this function if you want to 445 | * be able to copy and paste between the server and your application. For 446 | * instance, when your application is notified that the user copied some text 447 | * onto the clipboard, you would call this function to synchronize the server's 448 | * clipboard with your local clipboard. 449 | * @param client The client structure through which to send the client cut text 450 | * message 451 | * @param str The string to send (doesn't need to be NULL terminated) 452 | * @param len The length of the string 453 | * @return true if the client cut message was sent successfully, false otherwise 454 | */ 455 | extern rfbBool SendClientCutText(rfbClient* client,char *str, int len); 456 | /** 457 | * Handles messages from the RFB server. You must call this function 458 | * intermittently so LibVNCClient can parse messages from the server. For 459 | * example, if your app has a draw loop, you could place a call to this 460 | * function within that draw loop. 461 | * @note You must call WaitForMessage() before you call this function. 462 | * @param client The client which will handle the RFB server messages 463 | * @return true if the client was able to handle the RFB server messages, false 464 | * otherwise 465 | */ 466 | extern rfbBool HandleRFBServerMessage(rfbClient* client); 467 | 468 | /** 469 | * Sends a text chat message to the server. 470 | * @param client The client through which to send the message 471 | * @param text The text to send 472 | * @return true if the text was sent successfully, false otherwise 473 | */ 474 | extern rfbBool TextChatSend(rfbClient* client, char *text); 475 | /** 476 | * Opens a text chat window on the server. 477 | * @param client The client through which to send the message 478 | * @return true if the window was opened successfully, false otherwise 479 | */ 480 | extern rfbBool TextChatOpen(rfbClient* client); 481 | /** 482 | * Closes the text chat window on the server. 483 | * @param client The client through which to send the message 484 | * @return true if the window was closed successfully, false otherwise 485 | */ 486 | extern rfbBool TextChatClose(rfbClient* client); 487 | extern rfbBool TextChatFinish(rfbClient* client); 488 | extern rfbBool PermitServerInput(rfbClient* client, int enabled); 489 | extern rfbBool SendXvpMsg(rfbClient* client, uint8_t version, uint8_t code); 490 | 491 | extern void PrintPixelFormat(rfbPixelFormat *format); 492 | 493 | extern rfbBool SupportsClient2Server(rfbClient* client, int messageType); 494 | extern rfbBool SupportsServer2Client(rfbClient* client, int messageType); 495 | 496 | /* client data */ 497 | 498 | /** 499 | * Associates a client data tag with the given pointer. LibVNCClient has 500 | * several events to which you can associate your own handlers. These handlers 501 | * have the client structure as one of their parameters. Sometimes, you may want 502 | * to make data from elsewhere in your application available to these handlers 503 | * without using a global variable. To do this, you call 504 | * rfbClientSetClientData() and associate the data with a tag. Then, your 505 | * handler can call rfbClientGetClientData() and get the a pointer to the data 506 | * associated with that tag. 507 | * @param client The client in which to set the client data 508 | * @param tag A unique tag which identifies the data 509 | * @param data A pointer to the data to associate with the tag 510 | */ 511 | void rfbClientSetClientData(rfbClient* client, void* tag, void* data); 512 | /** 513 | * Returns a pointer to the client data associated with the given tag. See the 514 | * the documentation for rfbClientSetClientData() for a discussion of how you 515 | * can use client data. 516 | * @param client The client from which to get the client data 517 | * @param tag The tag which identifies the client data 518 | * @return a pointer to the client data 519 | */ 520 | void* rfbClientGetClientData(rfbClient* client, void* tag); 521 | 522 | /* protocol extensions */ 523 | 524 | typedef struct _rfbClientProtocolExtension { 525 | int* encodings; 526 | /** returns TRUE if the encoding was handled */ 527 | rfbBool (*handleEncoding)(rfbClient* cl, 528 | rfbFramebufferUpdateRectHeader* rect); 529 | /** returns TRUE if it handled the message */ 530 | rfbBool (*handleMessage)(rfbClient* cl, 531 | rfbServerToClientMsg* message); 532 | struct _rfbClientProtocolExtension* next; 533 | } rfbClientProtocolExtension; 534 | 535 | void rfbClientRegisterExtension(rfbClientProtocolExtension* e); 536 | 537 | /* sockets.c */ 538 | 539 | extern rfbBool errorMessageOnReadFailure; 540 | 541 | extern rfbBool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n); 542 | extern rfbBool WriteToRFBServer(rfbClient* client, char *buf, int n); 543 | extern int FindFreeTcpPort(void); 544 | extern int ListenAtTcpPort(int port); 545 | extern int ListenAtTcpPortAndAddress(int port, const char *address); 546 | extern int ConnectClientToTcpAddr(unsigned int host, int port); 547 | extern int ConnectClientToTcpAddr6(const char *hostname, int port); 548 | extern int ConnectClientToUnixSock(const char *sockFile); 549 | extern int AcceptTcpConnection(int listenSock); 550 | extern rfbBool SetNonBlocking(int sock); 551 | extern rfbBool SetDSCP(int sock, int dscp); 552 | 553 | extern rfbBool StringToIPAddr(const char *str, unsigned int *addr); 554 | extern rfbBool SameMachine(int sock); 555 | /** 556 | * Waits for an RFB message to arrive from the server. Before handling a message 557 | * with HandleRFBServerMessage(), you must wait for your client to receive one. 558 | * This function blocks until a message is received. You may specify a timeout 559 | * in microseconds. Once this number of microseconds have elapsed, the function 560 | * will return. 561 | * @param client The client to cause to wait until a message is received 562 | * @param usecs The timeout in microseconds 563 | * @return the return value of the underlying select() call 564 | */ 565 | extern int WaitForMessage(rfbClient* client,unsigned int usecs); 566 | 567 | /* vncviewer.c */ 568 | /** 569 | * Allocates and returns a pointer to an rfbClient structure. This will probably 570 | * be the first LibVNCClient function your client code calls. Most libVNCClient 571 | * functions operate on an rfbClient structure, and this function allocates 572 | * memory for that structure. When you're done with the rfbClient structure 573 | * pointer this function returns, you should free the memory rfbGetClient() 574 | * allocated by calling rfbClientCleanup(). 575 | * 576 | * A pixel is one dot on the screen. The number of bytes in a pixel will depend 577 | * on the number of samples in that pixel and the number of bits in each sample. 578 | * A sample represents one of the primary colors in a color model. The RGB 579 | * color model uses red, green, and blue samples respectively. Suppose you 580 | * wanted to use 16-bit RGB color: You would have three samples per pixel (one 581 | * for each primary color), five bits per sample (the quotient of 16 RGB bits 582 | * divided by three samples), and two bytes per pixel (the smallest multiple of 583 | * eight bits in which the 16-bit pixel will fit). If you wanted 32-bit RGB 584 | * color, you would have three samples per pixel again, eight bits per sample 585 | * (since that's how 32-bit color is defined), and four bytes per pixel (the 586 | * smallest multiple of eight bits in which the 32-bit pixel will fit. 587 | * @param bitsPerSample The number of bits in a sample 588 | * @param samplesPerPixel The number of samples in a pixel 589 | * @param bytesPerPixel The number of bytes in a pixel 590 | * @return a pointer to the allocated rfbClient structure 591 | */ 592 | rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel); 593 | /** 594 | * Initializes the client. The format is {PROGRAM_NAME, [OPTIONS]..., HOST}. This 595 | * function does not initialize the program name if the rfbClient's program 596 | * name is set already. The options are as follows: 597 | * 598 | * 599 | * 600 | * 602 | * 603 | * 605 | * 608 | * 610 | * 613 | * 615 | *
OptionDescription
-listenListen for incoming connections.
-listennoforkListen for incoming connections without forking. 601 | *
-playSet this client to replay a previously recorded session.
-encodingsSet the encodings to use. The next item in the 604 | * argv array is the encodings string, consisting of comma separated encodings like 'tight,ultra,raw'.
-compressSet the compression level. The next item in the 606 | * argv array is the compression level as an integer. Ranges from 0 (lowest) to 9 (highest). 607 | *
-scaleSet the scaling level. The next item in the 609 | * argv array is the scaling level as an integer. The screen will be scaled down by this factor.
-qosdscpSet the Quality of Service Differentiated Services 611 | * Code Point (QoS DSCP). The next item in the argv array is the code point as 612 | * an integer.
-repeaterdestSet a VNC repeater address. The next item in the argv array is 614 | * the repeater's address as a string.
616 | * 617 | * The host may include a port number (delimited by a ':'). 618 | * @param client The client to initialize 619 | * @param argc The number of arguments to the initializer 620 | * @param argv The arguments to the initializer as an array of NULL terminated 621 | * strings 622 | * @return true if the client was initialized successfully, false otherwise. 623 | */ 624 | rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv); 625 | /** 626 | * Cleans up the client structure and releases the memory allocated for it. You 627 | * should call this when you're done with the rfbClient structure that you 628 | * allocated with rfbGetClient(). 629 | * @note rfbClientCleanup() does not touch client->frameBuffer. 630 | * @param client The client to clean up 631 | */ 632 | void rfbClientCleanup(rfbClient* client); 633 | 634 | #if(defined __cplusplus) 635 | } 636 | #endif 637 | 638 | /** 639 | * @} 640 | */ 641 | 642 | /** 643 | @page libvncclient_doc LibVNCClient Documentation 644 | @section example_code Example Code 645 | See SDLvncviewer.c for a rather complete client example. 646 | */ 647 | 648 | #endif 649 | -------------------------------------------------------------------------------- /rfb/rfbconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _RFB_RFBCONFIG_H 2 | #define _RFB_RFBCONFIG_H 1 3 | 4 | /* rfb/rfbconfig.h. Generated automatically at end of configure. */ 5 | /* rfbconfig.h. Generated from rfbconfig.h.in by configure. */ 6 | /* rfbconfig.h.in. Generated from configure.ac by autoheader. */ 7 | 8 | /* Define if building universal (internal helper macro) */ 9 | /* #undef LIBVNCSERVER_AC_APPLE_UNIVERSAL_BUILD */ 10 | 11 | /* Enable 24 bit per pixel in native framebuffer */ 12 | #ifndef LIBVNCSERVER_ALLOW24BPP 13 | #define LIBVNCSERVER_ALLOW24BPP 1 14 | #endif 15 | 16 | /* work around when write() returns ENOENT but does not mean it */ 17 | /* #undef LIBVNCSERVER_ENOENT_WORKAROUND */ 18 | 19 | /* Use ffmpeg (for vnc2mpg) */ 20 | /* #undef LIBVNCSERVER_FFMPEG */ 21 | 22 | /* Android host system detected */ 23 | /* #undef LIBVNCSERVER_HAVE_ANDROID */ 24 | 25 | /* Define to 1 if you have the header file. */ 26 | /* #undef LIBVNCSERVER_HAVE_ARPA_INET_H */ 27 | 28 | /* Avahi/mDNS client build environment present */ 29 | /* #undef LIBVNCSERVER_HAVE_AVAHI */ 30 | 31 | /* Define to 1 if you have the `crypt' function. */ 32 | /* #undef LIBVNCSERVER_HAVE_CRYPT */ 33 | 34 | /* Define to 1 if you have the header file. */ 35 | /* #undef LIBVNCSERVER_HAVE_DLFCN_H */ 36 | 37 | /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ 38 | /* #undef LIBVNCSERVER_HAVE_DOPRNT */ 39 | 40 | /* DPMS extension build environment present */ 41 | /* #undef LIBVNCSERVER_HAVE_DPMS */ 42 | 43 | /* FBPM extension build environment present */ 44 | /* #undef LIBVNCSERVER_HAVE_FBPM */ 45 | 46 | /* Define to 1 if you have the header file. */ 47 | #ifndef LIBVNCSERVER_HAVE_FCNTL_H 48 | #define LIBVNCSERVER_HAVE_FCNTL_H 1 49 | #endif 50 | 51 | /* Define to 1 if you have the `fork' function. */ 52 | /* #undef LIBVNCSERVER_HAVE_FORK */ 53 | 54 | /* Define to 1 if you have the `ftime' function. */ 55 | /* #undef LIBVNCSERVER_HAVE_FTIME */ 56 | 57 | /* Define to 1 if you have the `geteuid' function. */ 58 | /* #undef LIBVNCSERVER_HAVE_GETEUID */ 59 | 60 | /* Define to 1 if you have the `gethostbyname' function. */ 61 | /* #undef LIBVNCSERVER_HAVE_GETHOSTBYNAME */ 62 | 63 | /* Define to 1 if you have the `gethostname' function. */ 64 | /* #undef LIBVNCSERVER_HAVE_GETHOSTNAME */ 65 | 66 | /* Define to 1 if you have the `getpwnam' function. */ 67 | /* #undef LIBVNCSERVER_HAVE_GETPWNAM */ 68 | 69 | /* Define to 1 if you have the `getpwuid' function. */ 70 | /* #undef LIBVNCSERVER_HAVE_GETPWUID */ 71 | 72 | /* Define to 1 if you have the `getspnam' function. */ 73 | /* #undef LIBVNCSERVER_HAVE_GETSPNAM */ 74 | 75 | /* Define to 1 if you have the `gettimeofday' function. */ 76 | /* #undef LIBVNCSERVER_HAVE_GETTIMEOFDAY */ 77 | 78 | /* Define to 1 if you have the `getuid' function. */ 79 | /* #undef LIBVNCSERVER_HAVE_GETUID */ 80 | 81 | /* GnuTLS library present */ 82 | /* #undef LIBVNCSERVER_HAVE_GNUTLS */ 83 | 84 | /* Define to 1 if you have the `grantpt' function. */ 85 | /* #undef LIBVNCSERVER_HAVE_GRANTPT */ 86 | 87 | /* Define to 1 if you have the `inet_ntoa' function. */ 88 | /* #undef LIBVNCSERVER_HAVE_INET_NTOA */ 89 | 90 | /* Define to 1 if you have the `initgroups' function. */ 91 | /* #undef LIBVNCSERVER_HAVE_INITGROUPS */ 92 | 93 | /* Define to 1 if you have the header file. */ 94 | #ifndef LIBVNCSERVER_HAVE_INTTYPES_H 95 | #define LIBVNCSERVER_HAVE_INTTYPES_H 1 96 | #endif 97 | 98 | /* IRIX XReadDisplay available */ 99 | /* #undef LIBVNCSERVER_HAVE_IRIX_XREADDISPLAY */ 100 | 101 | /* libcrypt library present */ 102 | /* #undef LIBVNCSERVER_HAVE_LIBCRYPT */ 103 | 104 | /* openssl libcrypto library present */ 105 | /* #undef LIBVNCSERVER_HAVE_LIBCRYPTO */ 106 | 107 | /* Define to 1 if you have the `cygipc' library (-lcygipc). */ 108 | /* #undef LIBVNCSERVER_HAVE_LIBCYGIPC */ 109 | 110 | /* libjpeg support enabled */ 111 | /* #undef LIBVNCSERVER_HAVE_LIBJPEG */ 112 | 113 | /* Define to 1 if you have the `nsl' library (-lnsl). */ 114 | /* #undef LIBVNCSERVER_HAVE_LIBNSL */ 115 | 116 | /* Define to 1 if you have the `png' library (-lpng). */ 117 | /* #undef LIBVNCSERVER_HAVE_LIBPNG */ 118 | 119 | /* Define to 1 if you have the `pthread' library (-lpthread). */ 120 | #ifndef LIBVNCSERVER_HAVE_LIBPTHREAD 121 | #define LIBVNCSERVER_HAVE_LIBPTHREAD 1 122 | #endif 123 | 124 | /* Define to 1 if you have the `socket' library (-lsocket). */ 125 | /* #undef LIBVNCSERVER_HAVE_LIBSOCKET */ 126 | 127 | /* openssl libssl library present */ 128 | /* #undef LIBVNCSERVER_HAVE_LIBSSL */ 129 | 130 | /* XDAMAGE extension build environment present */ 131 | /* #undef LIBVNCSERVER_HAVE_LIBXDAMAGE */ 132 | 133 | /* XFIXES extension build environment present */ 134 | /* #undef LIBVNCSERVER_HAVE_LIBXFIXES */ 135 | 136 | /* XINERAMA extension build environment present */ 137 | /* #undef LIBVNCSERVER_HAVE_LIBXINERAMA */ 138 | 139 | /* XRANDR extension build environment present */ 140 | /* #undef LIBVNCSERVER_HAVE_LIBXRANDR */ 141 | 142 | /* DEC-XTRAP extension build environment present */ 143 | /* #undef LIBVNCSERVER_HAVE_LIBXTRAP */ 144 | 145 | /* Define to 1 if you have the `z' library (-lz). */ 146 | /* #undef LIBVNCSERVER_HAVE_LIBZ */ 147 | 148 | /* linux fb device build environment present */ 149 | /* #undef LIBVNCSERVER_HAVE_LINUX_FB_H */ 150 | 151 | /* linux/input.h present */ 152 | /* #undef LIBVNCSERVER_HAVE_LINUX_INPUT_H */ 153 | 154 | /* linux uinput device build environment present */ 155 | /* #undef LIBVNCSERVER_HAVE_LINUX_UINPUT_H */ 156 | 157 | /* video4linux build environment present */ 158 | /* #undef LIBVNCSERVER_HAVE_LINUX_VIDEODEV_H */ 159 | 160 | /* build MacOS X native display support */ 161 | /* #undef LIBVNCSERVER_HAVE_MACOSX_NATIVE_DISPLAY */ 162 | 163 | /* MacOS X OpenGL present */ 164 | /* #undef LIBVNCSERVER_HAVE_MACOSX_OPENGL_H */ 165 | 166 | /* Define to 1 if you have the `memmove' function. */ 167 | /* #undef LIBVNCSERVER_HAVE_MEMMOVE */ 168 | 169 | /* Define to 1 if you have the header file. */ 170 | #ifndef LIBVNCSERVER_HAVE_MEMORY_H 171 | #define LIBVNCSERVER_HAVE_MEMORY_H 1 172 | #endif 173 | 174 | /* Define to 1 if you have the `memset' function. */ 175 | /* #undef LIBVNCSERVER_HAVE_MEMSET */ 176 | 177 | /* Define to 1 if you have the `mkfifo' function. */ 178 | /* #undef LIBVNCSERVER_HAVE_MKFIFO */ 179 | 180 | /* Define to 1 if you have the `mmap' function. */ 181 | /* #undef LIBVNCSERVER_HAVE_MMAP */ 182 | 183 | /* Define to 1 if you have the header file. */ 184 | /* #undef LIBVNCSERVER_HAVE_NETDB_H */ 185 | 186 | /* Define to 1 if you have the header file. */ 187 | /* #undef LIBVNCSERVER_HAVE_NETINET_IN_H */ 188 | 189 | /* Define to 1 if you have the header file. */ 190 | /* #undef LIBVNCSERVER_HAVE_PWD_H */ 191 | 192 | /* RECORD extension build environment present */ 193 | /* #undef LIBVNCSERVER_HAVE_RECORD */ 194 | 195 | /* Define to 1 if you have the `select' function. */ 196 | /* #undef LIBVNCSERVER_HAVE_SELECT */ 197 | 198 | /* Define to 1 if you have the `setegid' function. */ 199 | /* #undef LIBVNCSERVER_HAVE_SETEGID */ 200 | 201 | /* Define to 1 if you have the `seteuid' function. */ 202 | /* #undef LIBVNCSERVER_HAVE_SETEUID */ 203 | 204 | /* Define to 1 if you have the `setgid' function. */ 205 | /* #undef LIBVNCSERVER_HAVE_SETGID */ 206 | 207 | /* Define to 1 if you have the `setpgrp' function. */ 208 | /* #undef LIBVNCSERVER_HAVE_SETPGRP */ 209 | 210 | /* Define to 1 if you have the `setsid' function. */ 211 | /* #undef LIBVNCSERVER_HAVE_SETSID */ 212 | 213 | /* Define to 1 if you have the `setuid' function. */ 214 | /* #undef LIBVNCSERVER_HAVE_SETUID */ 215 | 216 | /* Define to 1 if you have the `setutxent' function. */ 217 | /* #undef LIBVNCSERVER_HAVE_SETUTXENT */ 218 | 219 | /* Define to 1 if you have the `shmat' function. */ 220 | /* #undef LIBVNCSERVER_HAVE_SHMAT */ 221 | 222 | /* Define to 1 if you have the `socket' function. */ 223 | /* #undef LIBVNCSERVER_HAVE_SOCKET */ 224 | 225 | /* Solaris XReadScreen available */ 226 | /* #undef LIBVNCSERVER_HAVE_SOLARIS_XREADSCREEN */ 227 | 228 | /* Define to 1 if `stat' has the bug that it succeeds when given the 229 | zero-length file name argument. */ 230 | #ifndef LIBVNCSERVER_HAVE_STAT_EMPTY_STRING_BUG 231 | #define LIBVNCSERVER_HAVE_STAT_EMPTY_STRING_BUG 1 232 | #endif 233 | 234 | /* Define to 1 if you have the header file. */ 235 | #ifndef LIBVNCSERVER_HAVE_STDINT_H 236 | #define LIBVNCSERVER_HAVE_STDINT_H 1 237 | #endif 238 | 239 | /* Define to 1 if you have the header file. */ 240 | #ifndef LIBVNCSERVER_HAVE_STDLIB_H 241 | #define LIBVNCSERVER_HAVE_STDLIB_H 1 242 | #endif 243 | 244 | /* Define to 1 if you have the `strchr' function. */ 245 | /* #undef LIBVNCSERVER_HAVE_STRCHR */ 246 | 247 | /* Define to 1 if you have the `strcspn' function. */ 248 | /* #undef LIBVNCSERVER_HAVE_STRCSPN */ 249 | 250 | /* Define to 1 if you have the `strdup' function. */ 251 | /* #undef LIBVNCSERVER_HAVE_STRDUP */ 252 | 253 | /* Define to 1 if you have the `strerror' function. */ 254 | /* #undef LIBVNCSERVER_HAVE_STRERROR */ 255 | 256 | /* Define to 1 if you have the `strftime' function. */ 257 | /* #undef LIBVNCSERVER_HAVE_STRFTIME */ 258 | 259 | /* Define to 1 if you have the header file. */ 260 | #ifndef LIBVNCSERVER_HAVE_STRINGS_H 261 | #define LIBVNCSERVER_HAVE_STRINGS_H 1 262 | #endif 263 | 264 | /* Define to 1 if you have the header file. */ 265 | #ifndef LIBVNCSERVER_HAVE_STRING_H 266 | #define LIBVNCSERVER_HAVE_STRING_H 1 267 | #endif 268 | 269 | /* Define to 1 if you have the `strstr' function. */ 270 | /* #undef LIBVNCSERVER_HAVE_STRSTR */ 271 | 272 | /* Define to 1 if you have the header file. */ 273 | /* #undef LIBVNCSERVER_HAVE_SYSLOG_H */ 274 | 275 | /* Use the system libvncserver build environment for x11vnc. */ 276 | /* #undef LIBVNCSERVER_HAVE_SYSTEM_LIBVNCSERVER */ 277 | 278 | /* Define to 1 if you have the header file. */ 279 | /* #undef LIBVNCSERVER_HAVE_SYS_IOCTL_H */ 280 | 281 | /* Define to 1 if you have the header file. */ 282 | /* #undef LIBVNCSERVER_HAVE_SYS_SOCKET_H */ 283 | 284 | /* Define to 1 if you have the header file. */ 285 | #ifndef LIBVNCSERVER_HAVE_SYS_STAT_H 286 | #define LIBVNCSERVER_HAVE_SYS_STAT_H 1 287 | #endif 288 | 289 | /* Define to 1 if you have the header file. */ 290 | /* #undef LIBVNCSERVER_HAVE_SYS_STROPTS_H */ 291 | 292 | /* Define to 1 if you have the header file. */ 293 | #ifndef LIBVNCSERVER_HAVE_SYS_TIMEB_H 294 | #define LIBVNCSERVER_HAVE_SYS_TIMEB_H 1 295 | #endif 296 | 297 | /* Define to 1 if you have the header file. */ 298 | #ifndef LIBVNCSERVER_HAVE_SYS_TIME_H 299 | #define LIBVNCSERVER_HAVE_SYS_TIME_H 1 300 | #endif 301 | 302 | /* Define to 1 if you have the header file. */ 303 | #ifndef LIBVNCSERVER_HAVE_SYS_TYPES_H 304 | #define LIBVNCSERVER_HAVE_SYS_TYPES_H 1 305 | #endif 306 | 307 | /* Define to 1 if you have that is POSIX.1 compatible. */ 308 | /* #undef LIBVNCSERVER_HAVE_SYS_WAIT_H */ 309 | 310 | /* Define to 1 if you have the header file. */ 311 | /* #undef LIBVNCSERVER_HAVE_TERMIOS_H */ 312 | 313 | /* Define to 1 if compiler supports __thread */ 314 | #ifndef LIBVNCSERVER_HAVE_TLS 315 | #define LIBVNCSERVER_HAVE_TLS 1 316 | #endif 317 | 318 | /* Define to 1 if you have the header file. */ 319 | #ifndef LIBVNCSERVER_HAVE_UNISTD_H 320 | #define LIBVNCSERVER_HAVE_UNISTD_H 1 321 | #endif 322 | 323 | /* Define to 1 if you have the header file. */ 324 | /* #undef LIBVNCSERVER_HAVE_UTMPX_H */ 325 | 326 | /* Define to 1 if you have the `vfork' function. */ 327 | /* #undef LIBVNCSERVER_HAVE_VFORK */ 328 | 329 | /* Define to 1 if you have the header file. */ 330 | /* #undef LIBVNCSERVER_HAVE_VFORK_H */ 331 | 332 | /* Define to 1 if you have the `vprintf' function. */ 333 | /* #undef LIBVNCSERVER_HAVE_VPRINTF */ 334 | 335 | /* Define to 1 if you have the `waitpid' function. */ 336 | /* #undef LIBVNCSERVER_HAVE_WAITPID */ 337 | 338 | /* Define to 1 if `fork' works. */ 339 | /* #undef LIBVNCSERVER_HAVE_WORKING_FORK */ 340 | 341 | /* Define to 1 if `vfork' works. */ 342 | /* #undef LIBVNCSERVER_HAVE_WORKING_VFORK */ 343 | 344 | /* Define to 1 if you have the header file. */ 345 | #ifndef LIBVNCSERVER_HAVE_WS2TCPIP_H 346 | #define LIBVNCSERVER_HAVE_WS2TCPIP_H 1 347 | #endif 348 | 349 | /* X11 build environment present */ 350 | /* #undef LIBVNCSERVER_HAVE_X11 */ 351 | 352 | /* open ssl X509_print_ex_fp available */ 353 | /* #undef LIBVNCSERVER_HAVE_X509_PRINT_EX_FP */ 354 | 355 | /* XKEYBOARD extension build environment present */ 356 | /* #undef LIBVNCSERVER_HAVE_XKEYBOARD */ 357 | 358 | /* MIT-SHM extension build environment present */ 359 | /* #undef LIBVNCSERVER_HAVE_XSHM */ 360 | 361 | /* XTEST extension build environment present */ 362 | /* #undef LIBVNCSERVER_HAVE_XTEST */ 363 | 364 | /* XTEST extension has XTestGrabControl */ 365 | /* #undef LIBVNCSERVER_HAVE_XTESTGRABCONTROL */ 366 | 367 | /* Enable IPv6 support */ 368 | /* #undef LIBVNCSERVER_IPv6 */ 369 | 370 | /* Define to 1 if `lstat' dereferences a symlink specified with a trailing 371 | slash. */ 372 | /* #undef LIBVNCSERVER_LSTAT_FOLLOWS_SLASHED_SYMLINK */ 373 | 374 | /* Need a typedef for in_addr_t */ 375 | #ifndef LIBVNCSERVER_NEED_INADDR_T 376 | #define LIBVNCSERVER_NEED_INADDR_T 1 377 | #endif 378 | 379 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 380 | /* #undef LIBVNCSERVER_NO_MINUS_C_MINUS_O */ 381 | 382 | /* Name of package */ 383 | #ifndef LIBVNCSERVER_PACKAGE 384 | #define LIBVNCSERVER_PACKAGE "LibVNCServer" 385 | #endif 386 | 387 | /* Define to the address where bug reports for this package should be sent. */ 388 | #ifndef LIBVNCSERVER_PACKAGE_BUGREPORT 389 | #define LIBVNCSERVER_PACKAGE_BUGREPORT "http://sourceforge.net/projects/libvncserver" 390 | #endif 391 | 392 | /* Define to the full name of this package. */ 393 | #ifndef LIBVNCSERVER_PACKAGE_NAME 394 | #define LIBVNCSERVER_PACKAGE_NAME "LibVNCServer" 395 | #endif 396 | 397 | /* Define to the full name and version of this package. */ 398 | #ifndef LIBVNCSERVER_PACKAGE_STRING 399 | #define LIBVNCSERVER_PACKAGE_STRING "LibVNCServer 0.9.9" 400 | #endif 401 | 402 | /* Define to the one symbol short name of this package. */ 403 | #ifndef LIBVNCSERVER_PACKAGE_TARNAME 404 | #define LIBVNCSERVER_PACKAGE_TARNAME "libvncserver" 405 | #endif 406 | 407 | /* Define to the home page for this package. */ 408 | #ifndef LIBVNCSERVER_PACKAGE_URL 409 | #define LIBVNCSERVER_PACKAGE_URL "" 410 | #endif 411 | 412 | /* Define to the version of this package. */ 413 | #ifndef LIBVNCSERVER_PACKAGE_VERSION 414 | #define LIBVNCSERVER_PACKAGE_VERSION "0.9.9" 415 | #endif 416 | 417 | /* The number of bytes in type char */ 418 | /* #undef LIBVNCSERVER_SIZEOF_CHAR */ 419 | 420 | /* The number of bytes in type int */ 421 | /* #undef LIBVNCSERVER_SIZEOF_INT */ 422 | 423 | /* The number of bytes in type long */ 424 | /* #undef LIBVNCSERVER_SIZEOF_LONG */ 425 | 426 | /* The number of bytes in type short */ 427 | /* #undef LIBVNCSERVER_SIZEOF_SHORT */ 428 | 429 | /* The number of bytes in type void* */ 430 | /* #undef LIBVNCSERVER_SIZEOF_VOIDP */ 431 | 432 | /* Define to 1 if you have the ANSI C header files. */ 433 | #ifndef LIBVNCSERVER_STDC_HEADERS 434 | #define LIBVNCSERVER_STDC_HEADERS 1 435 | #endif 436 | 437 | /* Define to 1 if you can safely include both and . */ 438 | #ifndef LIBVNCSERVER_TIME_WITH_SYS_TIME 439 | #define LIBVNCSERVER_TIME_WITH_SYS_TIME 1 440 | #endif 441 | 442 | /* Version number of package */ 443 | #ifndef LIBVNCSERVER_VERSION 444 | #define LIBVNCSERVER_VERSION "0.9.9" 445 | #endif 446 | 447 | /* Enable support for libgcrypt in libvncclient */ 448 | /* #undef LIBVNCSERVER_WITH_CLIENT_GCRYPT */ 449 | 450 | /* Disable TightVNCFileTransfer protocol */ 451 | #ifndef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER 452 | #define LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER 1 453 | #endif 454 | 455 | /* Disable WebSockets support */ 456 | /* #undef LIBVNCSERVER_WITH_WEBSOCKETS */ 457 | 458 | /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most 459 | significant byte first (like Motorola and SPARC, unlike Intel). */ 460 | #if defined AC_APPLE_UNIVERSAL_BUILD 461 | # if defined __BIG_ENDIAN__ 462 | # define WORDS_BIGENDIAN 1 463 | # endif 464 | #else 465 | # ifndef WORDS_BIGENDIAN 466 | /* # undef WORDS_BIGENDIAN */ 467 | # endif 468 | #endif 469 | 470 | /* Define to 1 if the X Window System is missing or not being used. */ 471 | #ifndef LIBVNCSERVER_X_DISPLAY_MISSING 472 | #define LIBVNCSERVER_X_DISPLAY_MISSING 1 473 | #endif 474 | 475 | /* Define to empty if `const' does not conform to ANSI C. */ 476 | /* #undef const */ 477 | 478 | /* Define to `__inline__' or `__inline' if that's what the C compiler 479 | calls it, or to nothing if 'inline' is not supported under any name. */ 480 | #ifndef __cplusplus 481 | /* #undef inline */ 482 | #endif 483 | 484 | /* Define to `int' if does not define. */ 485 | /* #undef pid_t */ 486 | 487 | /* Define to `unsigned int' if does not define. */ 488 | /* #undef size_t */ 489 | 490 | /* The type for socklen */ 491 | #define socklen_t int 492 | 493 | /* Define as `fork' if `vfork' does not work. */ 494 | #define vfork fork 495 | 496 | /* once: _RFB_RFBCONFIG_H */ 497 | #endif 498 | -------------------------------------------------------------------------------- /rfb/rfbint.h: -------------------------------------------------------------------------------- 1 | #ifndef _RFB_RFBINT_H 2 | #define _RFB_RFBINT_H 1 3 | #ifndef _GENERATED_STDINT_H 4 | #define _GENERATED_STDINT_H "LibVNCServer 0.9.9" 5 | /* generated using a gnu compiler version gcc.exe (GCC) 4.6.2 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ 6 | 7 | #include 8 | 9 | 10 | /* system headers have good uint64_t */ 11 | #ifndef _HAVE_UINT64_T 12 | #define _HAVE_UINT64_T 13 | #endif 14 | 15 | /* once */ 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /rfb/rfbregion.h: -------------------------------------------------------------------------------- 1 | #ifndef SRAREGION_H 2 | #define SRAREGION_H 3 | 4 | /* -=- SRA - Simple Region Algorithm 5 | * A simple rectangular region implementation. 6 | * Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin 7 | */ 8 | 9 | /* -=- sraRect */ 10 | 11 | typedef struct _rect { 12 | int x1; 13 | int y1; 14 | int x2; 15 | int y2; 16 | } sraRect; 17 | 18 | typedef struct sraRegion sraRegion; 19 | 20 | /* -=- Region manipulation functions */ 21 | 22 | extern sraRegion *sraRgnCreate(); 23 | extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2); 24 | extern sraRegion *sraRgnCreateRgn(const sraRegion *src); 25 | 26 | extern void sraRgnDestroy(sraRegion *rgn); 27 | extern void sraRgnMakeEmpty(sraRegion *rgn); 28 | extern rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src); 29 | extern void sraRgnOr(sraRegion *dst, const sraRegion *src); 30 | extern rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src); 31 | 32 | extern void sraRgnOffset(sraRegion *dst, int dx, int dy); 33 | 34 | extern rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect, 35 | unsigned long flags); 36 | 37 | extern unsigned long sraRgnCountRects(const sraRegion *rgn); 38 | extern rfbBool sraRgnEmpty(const sraRegion *rgn); 39 | 40 | extern sraRegion *sraRgnBBox(const sraRegion *src); 41 | 42 | /* -=- rectangle iterator */ 43 | 44 | typedef struct sraRectangleIterator { 45 | rfbBool reverseX,reverseY; 46 | int ptrSize,ptrPos; 47 | struct sraSpan** sPtrs; 48 | } sraRectangleIterator; 49 | 50 | extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s); 51 | extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,rfbBool reverseX,rfbBool reverseY); 52 | extern rfbBool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r); 53 | extern void sraRgnReleaseIterator(sraRectangleIterator *i); 54 | 55 | void sraRgnPrint(const sraRegion *s); 56 | 57 | /* -=- Rectangle clipper (for speed) */ 58 | 59 | extern rfbBool sraClipRect(int *x, int *y, int *w, int *h, 60 | int cx, int cy, int cw, int ch); 61 | 62 | extern rfbBool sraClipRect2(int *x, int *y, int *x2, int *y2, 63 | int cx, int cy, int cx2, int cy2); 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /vncclientthread.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2007 - 2013 Urs Wolfer 4 | ** 5 | ** This file is part of KDE. 6 | ** 7 | ** This program is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** This program is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with this program; see the file COPYING. If not, write to 19 | ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | ** Boston, MA 02110-1301, USA. 21 | ** 22 | ****************************************************************************/ 23 | 24 | #include "vncclientthread.h" 25 | 26 | #include 27 | #include 28 | 29 | //for detecting intel AMT KVM vnc server 30 | static const QString INTEL_AMT_KVM_STRING= "Intel(r) AMT KVM"; 31 | static QString outputErrorMessageString; 32 | 33 | QVector VncClientThread::m_colorTable; 34 | 35 | void VncClientThread::setClientColorDepth(rfbClient* cl, VncClientThread::ColorDepth cd) 36 | { 37 | switch(cd) { 38 | case bpp8: 39 | if (m_colorTable.isEmpty()) { 40 | m_colorTable.resize(256); 41 | int r,g,b; 42 | for (int i = 0; i < 256; ++i) { 43 | //pick out the red (3 bits), green (3 bits) and blue (2 bits) bits and make them maximum significant in 8bits 44 | //this gives a colortable for 8bit true colors 45 | r= (i & 0x07) << 5; 46 | g= (i & 0x38) << 2; 47 | b= i & 0xc0; 48 | m_colorTable[i] = qRgb(r, g, b); 49 | } 50 | } 51 | cl->format.depth = 8; 52 | cl->format.bitsPerPixel = 8; 53 | cl->format.redShift = 0; 54 | cl->format.greenShift = 3; 55 | cl->format.blueShift = 6; 56 | cl->format.redMax = 7; 57 | cl->format.greenMax = 7; 58 | cl->format.blueMax = 3; 59 | break; 60 | case bpp16: 61 | cl->format.depth = 16; 62 | cl->format.bitsPerPixel = 16; 63 | cl->format.redShift = 11; 64 | cl->format.greenShift = 5; 65 | cl->format.blueShift = 0; 66 | cl->format.redMax = 0x1f; 67 | cl->format.greenMax = 0x3f; 68 | cl->format.blueMax = 0x1f; 69 | break; 70 | case bpp32: 71 | default: 72 | cl->format.depth = 24; 73 | cl->format.bitsPerPixel = 32; 74 | cl->format.redShift = 16; 75 | cl->format.greenShift = 8; 76 | cl->format.blueShift = 0; 77 | cl->format.redMax = 0xff; 78 | cl->format.greenMax = 0xff; 79 | cl->format.blueMax = 0xff; 80 | } 81 | } 82 | 83 | rfbBool VncClientThread::newclient(rfbClient *cl) 84 | { 85 | VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); 86 | Q_ASSERT(t); 87 | 88 | //8bit color hack for Intel(r) AMT KVM "classic vnc" = vnc server built in in Intel Vpro chipsets. 89 | if (INTEL_AMT_KVM_STRING == cl->desktopName) { 90 | kDebug(5011) << "Intel(R) AMT KVM: switching to 8 bit color depth (workaround, recent libvncserver needed)"; 91 | t->setColorDepth(bpp8); 92 | } 93 | setClientColorDepth(cl, t->colorDepth()); 94 | 95 | const int width = cl->width, height = cl->height, depth = cl->format.bitsPerPixel; 96 | const int size = width * height * (depth / 8); 97 | if (t->frameBuffer) 98 | delete [] t->frameBuffer; // do not leak if we get a new framebuffer size 99 | t->frameBuffer = new uint8_t[size]; 100 | cl->frameBuffer = t->frameBuffer; 101 | memset(cl->frameBuffer, '\0', size); 102 | 103 | switch (t->quality()) { 104 | case RemoteView::High: 105 | cl->appData.encodingsString = "copyrect zlib hextile raw"; 106 | cl->appData.compressLevel = 0; 107 | cl->appData.qualityLevel = 9; 108 | break; 109 | case RemoteView::Medium: 110 | cl->appData.encodingsString = "copyrect tight zrle ultra zlib hextile corre rre raw"; 111 | cl->appData.compressLevel = 5; 112 | cl->appData.qualityLevel = 7; 113 | break; 114 | case RemoteView::Low: 115 | case RemoteView::Unknown: 116 | default: 117 | cl->appData.encodingsString = "copyrect tight zrle ultra zlib hextile corre rre raw"; 118 | cl->appData.compressLevel = 9; 119 | cl->appData.qualityLevel = 1; 120 | } 121 | 122 | SetFormatAndEncodings(cl); 123 | kDebug(5011) << "Client created"; 124 | return true; 125 | } 126 | 127 | void VncClientThread::updatefb(rfbClient* cl, int x, int y, int w, int h) 128 | { 129 | // kDebug(5011) << "updated client: x: " << x << ", y: " << y << ", w: " << w << ", h: " << h; 130 | VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); 131 | Q_ASSERT(t); 132 | 133 | const int width = cl->width, height = cl->height; 134 | QImage img; 135 | switch(t->colorDepth()) { 136 | case bpp8: 137 | img = QImage(cl->frameBuffer, width, height, QImage::Format_Indexed8); 138 | img.setColorTable(m_colorTable); 139 | break; 140 | case bpp16: 141 | img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB16); 142 | break; 143 | case bpp32: 144 | img = QImage(cl->frameBuffer, width, height, QImage::Format_RGB32); 145 | break; 146 | } 147 | 148 | if (img.isNull()) { 149 | kDebug(5011) << "image not loaded"; 150 | } 151 | 152 | if (t->m_stopped) { 153 | return; // sending data to a stopped thread is not a good idea 154 | } 155 | 156 | t->setImage(img); 157 | 158 | t->emitUpdated(x, y, w, h); 159 | } 160 | 161 | void VncClientThread::cuttext(rfbClient* cl, const char *text, int textlen) 162 | { 163 | const QString cutText = QString::fromUtf8(text, textlen); 164 | kDebug(5011) << cutText; 165 | 166 | if (!cutText.isEmpty()) { 167 | VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); 168 | Q_ASSERT(t); 169 | 170 | t->emitGotCut(cutText); 171 | } 172 | } 173 | 174 | char *VncClientThread::passwdHandler(rfbClient *cl) 175 | { 176 | kDebug(5011) << "password request"; 177 | 178 | VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); 179 | Q_ASSERT(t); 180 | 181 | t->passwordRequest(); 182 | t->m_passwordError = true; 183 | 184 | return strdup(t->password().toUtf8()); 185 | } 186 | 187 | rfbCredential *VncClientThread::credentialHandler(rfbClient *cl, int credentialType) 188 | { 189 | kDebug(5011) << "credential request" << credentialType; 190 | 191 | VncClientThread *t = (VncClientThread*)rfbClientGetClientData(cl, 0); 192 | Q_ASSERT(t); 193 | 194 | rfbCredential *cred = 0; 195 | 196 | switch (credentialType) { 197 | case rfbCredentialTypeUser: 198 | t->passwordRequest(true); 199 | t->m_passwordError = true; 200 | 201 | cred = new rfbCredential; 202 | cred->userCredential.username = strdup(t->username().toUtf8()); 203 | cred->userCredential.password = strdup(t->password().toUtf8()); 204 | break; 205 | default: 206 | kError(5011) << "credential request failed, unspported credentialType:" << credentialType; 207 | t->outputErrorMessage(i18n("VNC authentication type is not supported.")); 208 | break; 209 | } 210 | return cred; 211 | } 212 | 213 | void VncClientThread::outputHandler(const char *format, ...) 214 | { 215 | va_list args; 216 | va_start(args, format); 217 | 218 | QString message; 219 | message.vsprintf(format, args); 220 | 221 | va_end(args); 222 | 223 | message = message.trimmed(); 224 | 225 | kDebug(5011) << message; 226 | 227 | if ((message.contains("Couldn't convert ")) || 228 | (message.contains("Unable to connect to VNC server"))) 229 | outputErrorMessageString = i18n("Server not found."); 230 | 231 | if ((message.contains("VNC connection failed: Authentication failed, too many tries")) || 232 | (message.contains("VNC connection failed: Too many authentication failures"))) 233 | outputErrorMessageString = i18n("VNC authentication failed because of too many authentication tries."); 234 | 235 | if (message.contains("VNC connection failed: Authentication failed")) 236 | outputErrorMessageString = i18n("VNC authentication failed."); 237 | 238 | if (message.contains("VNC server closed connection")) 239 | outputErrorMessageString = i18n("VNC server closed connection."); 240 | 241 | // internal messages, not displayed to user 242 | if (message.contains("VNC server supports protocol version 3.889")) // see http://bugs.kde.org/162640 243 | outputErrorMessageString = "INTERNAL:APPLE_VNC_COMPATIBILTY"; 244 | } 245 | 246 | VncClientThread::VncClientThread(QObject *parent) 247 | : QThread(parent) 248 | , frameBuffer(0) 249 | , cl(0) 250 | , m_stopped(false) 251 | { 252 | outputErrorMessageString.clear(); //don't deliver error messages of old instances... 253 | QMutexLocker locker(&mutex); 254 | 255 | QTimer *outputErrorMessagesCheckTimer = new QTimer(this); 256 | outputErrorMessagesCheckTimer->setInterval(500); 257 | connect(outputErrorMessagesCheckTimer, SIGNAL(timeout()), this, SLOT(checkOutputErrorMessage())); 258 | outputErrorMessagesCheckTimer->start(); 259 | } 260 | 261 | VncClientThread::~VncClientThread() 262 | { 263 | if(isRunning()) { 264 | stop(); 265 | terminate(); 266 | const bool quitSuccess = wait(1000); 267 | kDebug(5011) << "Attempting to stop in deconstructor, will crash if this fails:" << quitSuccess; 268 | } 269 | 270 | if (cl) { 271 | // Disconnect from vnc server & cleanup allocated resources 272 | rfbClientCleanup(cl); 273 | } 274 | 275 | delete [] frameBuffer; 276 | } 277 | 278 | void VncClientThread::checkOutputErrorMessage() 279 | { 280 | if (!outputErrorMessageString.isEmpty()) { 281 | kDebug(5011) << outputErrorMessageString; 282 | QString errorMessage = outputErrorMessageString; 283 | outputErrorMessageString.clear(); 284 | // show authentication failure error only after the 3rd unsuccessful try 285 | if ((errorMessage != i18n("VNC authentication failed.")) || m_passwordError) 286 | outputErrorMessage(errorMessage); 287 | } 288 | } 289 | 290 | void VncClientThread::setHost(const QString &host) 291 | { 292 | QMutexLocker locker(&mutex); 293 | m_host = host; 294 | } 295 | 296 | void VncClientThread::setPort(int port) 297 | { 298 | QMutexLocker locker(&mutex); 299 | m_port = port; 300 | } 301 | 302 | void VncClientThread::setQuality(RemoteView::Quality quality) 303 | { 304 | m_quality = quality; 305 | //set color depth dependent on quality 306 | switch(quality) { 307 | case RemoteView::Low: 308 | setColorDepth(bpp8); 309 | break; 310 | case RemoteView::High: 311 | setColorDepth(bpp32); 312 | break; 313 | case RemoteView::Medium: 314 | default: 315 | setColorDepth(bpp16); 316 | } 317 | } 318 | 319 | void VncClientThread::setColorDepth(ColorDepth colorDepth) 320 | { 321 | m_colorDepth= colorDepth; 322 | } 323 | 324 | RemoteView::Quality VncClientThread::quality() const 325 | { 326 | return m_quality; 327 | } 328 | 329 | VncClientThread::ColorDepth VncClientThread::colorDepth() const 330 | { 331 | return m_colorDepth; 332 | } 333 | 334 | void VncClientThread::setImage(const QImage &img) 335 | { 336 | QMutexLocker locker(&mutex); 337 | m_image = img; 338 | } 339 | 340 | const QImage VncClientThread::image(int x, int y, int w, int h) 341 | { 342 | QMutexLocker locker(&mutex); 343 | 344 | if (w == 0) // full image requested 345 | return m_image; 346 | else 347 | return m_image.copy(x, y, w, h); 348 | } 349 | 350 | void VncClientThread::emitUpdated(int x, int y, int w, int h) 351 | { 352 | emit imageUpdated(x, y, w, h); 353 | } 354 | 355 | void VncClientThread::emitGotCut(const QString &text) 356 | { 357 | emit gotCut(text); 358 | } 359 | 360 | void VncClientThread::stop() 361 | { 362 | QMutexLocker locker(&mutex); 363 | m_stopped = true; 364 | } 365 | 366 | void VncClientThread::run() 367 | { 368 | QMutexLocker locker(&mutex); 369 | 370 | while (!m_stopped) { // try to connect as long as the server allows 371 | locker.relock(); 372 | m_passwordError = false; 373 | locker.unlock(); 374 | 375 | rfbClientLog = outputHandler; 376 | rfbClientErr = outputHandler; 377 | //24bit color dept in 32 bits per pixel = default. Will change colordepth and bpp later if needed 378 | cl = rfbGetClient(8, 3, 4); 379 | setClientColorDepth(cl, this->colorDepth()); 380 | cl->MallocFrameBuffer = newclient; 381 | cl->canHandleNewFBSize = true; 382 | cl->GetPassword = passwdHandler; 383 | cl->GetCredential = credentialHandler; 384 | cl->GotFrameBufferUpdate = updatefb; 385 | cl->GotXCutText = cuttext; 386 | rfbClientSetClientData(cl, 0, this); 387 | 388 | locker.relock(); 389 | cl->serverHost = strdup(m_host.toUtf8().constData()); 390 | 391 | if (m_port < 0 || !m_port) // port is invalid or empty... 392 | m_port = 5900; // fallback: try an often used VNC port 393 | 394 | if (m_port >= 0 && m_port < 100) // the user most likely used the short form (e.g. :1) 395 | m_port += 5900; 396 | cl->serverPort = m_port; 397 | locker.unlock(); 398 | 399 | kDebug(5011) << "--------------------- trying init ---------------------"; 400 | 401 | if (rfbInitClient(cl, 0, 0)) 402 | break; 403 | else 404 | cl = 0; 405 | 406 | locker.relock(); 407 | if (m_passwordError) 408 | continue; 409 | 410 | return; 411 | } 412 | 413 | locker.relock(); 414 | kDebug(5011) << "--------------------- Starting main VNC event loop ---------------------"; 415 | while (!m_stopped) { 416 | locker.unlock(); 417 | const int i = WaitForMessage(cl, 500); 418 | if (m_stopped || i < 0) { 419 | break; 420 | } 421 | if (i) { 422 | if (!HandleRFBServerMessage(cl)) { 423 | break; 424 | } 425 | } 426 | 427 | locker.relock(); 428 | while (!m_eventQueue.isEmpty()) { 429 | ClientEvent* clientEvent = m_eventQueue.dequeue(); 430 | locker.unlock(); 431 | clientEvent->fire(cl); 432 | delete clientEvent; 433 | locker.relock(); 434 | } 435 | } 436 | 437 | m_stopped = true; 438 | } 439 | 440 | ClientEvent::~ClientEvent() 441 | { 442 | } 443 | 444 | void PointerClientEvent::fire(rfbClient* cl) 445 | { 446 | SendPointerEvent(cl, m_x, m_y, m_buttonMask); 447 | } 448 | 449 | void KeyClientEvent::fire(rfbClient* cl) 450 | { 451 | SendKeyEvent(cl, m_key, m_pressed); 452 | } 453 | 454 | void ClientCutEvent::fire(rfbClient* cl) 455 | { 456 | SendClientCutText(cl, text.toUtf8().data(), text.size()); 457 | } 458 | 459 | void VncClientThread::mouseEvent(int x, int y, int buttonMask) 460 | { 461 | QMutexLocker lock(&mutex); 462 | if (m_stopped) 463 | return; 464 | 465 | m_eventQueue.enqueue(new PointerClientEvent(x, y, buttonMask)); 466 | } 467 | 468 | void VncClientThread::keyEvent(int key, bool pressed) 469 | { 470 | QMutexLocker lock(&mutex); 471 | if (m_stopped) 472 | return; 473 | 474 | m_eventQueue.enqueue(new KeyClientEvent(key, pressed)); 475 | } 476 | 477 | void VncClientThread::clientCut(const QString &text) 478 | { 479 | QMutexLocker lock(&mutex); 480 | if (m_stopped) 481 | return; 482 | 483 | m_eventQueue.enqueue(new ClientCutEvent(text)); 484 | } 485 | 486 | #include "moc_vncclientthread.cpp" 487 | -------------------------------------------------------------------------------- /vncclientthread.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2007 - 2013 Urs Wolfer 4 | ** 5 | ** This file is part of KDE. 6 | ** 7 | ** This program is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** This program is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with this program; see the file COPYING. If not, write to 19 | ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | ** Boston, MA 02110-1301, USA. 21 | ** 22 | ****************************************************************************/ 23 | 24 | #ifndef VNCCLIENTTHREAD_H 25 | #define VNCCLIENTTHREAD_H 26 | 27 | #ifdef QTONLY 28 | #include 29 | #define kDebug(n) qDebug() 30 | #define kError(n) qDebug() 31 | #define kBacktrace() "" 32 | #define i18n tr 33 | #else 34 | #include 35 | #include 36 | #endif 37 | 38 | #include "remoteview.h" 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | extern "C" { 46 | #include 47 | } 48 | 49 | class ClientEvent 50 | { 51 | public: 52 | virtual ~ClientEvent(); 53 | 54 | virtual void fire(rfbClient*) = 0; 55 | }; 56 | 57 | class KeyClientEvent : public ClientEvent 58 | { 59 | public: 60 | KeyClientEvent(int key, int pressed) 61 | : m_key(key), m_pressed(pressed) {} 62 | 63 | void fire(rfbClient*); 64 | 65 | private: 66 | int m_key; 67 | int m_pressed; 68 | }; 69 | 70 | class PointerClientEvent : public ClientEvent 71 | { 72 | public: 73 | PointerClientEvent(int x, int y, int buttonMask) 74 | : m_x(x), m_y(y), m_buttonMask(buttonMask) {} 75 | 76 | void fire(rfbClient*); 77 | 78 | private: 79 | int m_x; 80 | int m_y; 81 | int m_buttonMask; 82 | }; 83 | 84 | class ClientCutEvent : public ClientEvent 85 | { 86 | public: 87 | explicit ClientCutEvent(const QString &text) 88 | : text(text) {} 89 | 90 | void fire(rfbClient*); 91 | 92 | private: 93 | QString text; 94 | }; 95 | 96 | class VncClientThread: public QThread 97 | { 98 | Q_OBJECT 99 | 100 | public: 101 | Q_ENUMS(ColorDepth) 102 | 103 | enum ColorDepth { 104 | bpp32, 105 | bpp16, 106 | bpp8 107 | }; 108 | 109 | explicit VncClientThread(QObject *parent = 0); 110 | ~VncClientThread(); 111 | const QImage image(int x = 0, int y = 0, int w = 0, int h = 0); 112 | void setImage(const QImage &img); 113 | void emitUpdated(int x, int y, int w, int h); 114 | void emitGotCut(const QString &text); 115 | void stop(); 116 | void setHost(const QString &host); 117 | void setPort(int port); 118 | void setQuality(RemoteView::Quality quality); 119 | void setPassword(const QString &password) { 120 | m_password = password; 121 | } 122 | const QString password() const { 123 | return m_password; 124 | } 125 | void setUsername(const QString &username) { 126 | m_username = username; 127 | } 128 | const QString username() const { 129 | return m_username; 130 | } 131 | 132 | RemoteView::Quality quality() const; 133 | ColorDepth colorDepth() const; 134 | uint8_t *frameBuffer; 135 | 136 | signals: 137 | void imageUpdated(int x, int y, int w, int h); 138 | void gotCut(const QString &text); 139 | void passwordRequest(bool includingUsername = false); 140 | void outputErrorMessage(const QString &message); 141 | 142 | public slots: 143 | void mouseEvent(int x, int y, int buttonMask); 144 | void keyEvent(int key, bool pressed); 145 | void clientCut(const QString &text); 146 | 147 | protected: 148 | void run(); 149 | 150 | private: 151 | static void setClientColorDepth(rfbClient *cl, ColorDepth cd); 152 | void setColorDepth(ColorDepth colorDepth); 153 | //these static methods are callback functions for libvncclient 154 | static rfbBool newclient(rfbClient *cl); 155 | static void updatefb(rfbClient *cl, int x, int y, int w, int h); 156 | static void cuttext(rfbClient *cl, const char *text, int textlen); 157 | static char* passwdHandler(rfbClient *cl); 158 | static rfbCredential* credentialHandler(rfbClient *cl, int credentialType); 159 | static void outputHandler(const char *format, ...); 160 | 161 | QImage m_image; 162 | rfbClient *cl; 163 | QString m_host; 164 | QString m_password; 165 | QString m_username; 166 | int m_port; 167 | QMutex mutex; 168 | RemoteView::Quality m_quality; 169 | ColorDepth m_colorDepth; 170 | QQueue m_eventQueue; 171 | //color table for 8bit indexed colors 172 | static QVector m_colorTable; 173 | 174 | volatile bool m_stopped; 175 | volatile bool m_passwordError; 176 | 177 | private slots: 178 | void checkOutputErrorMessage(); 179 | }; 180 | 181 | #endif 182 | -------------------------------------------------------------------------------- /vncview.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2007 - 2013 Urs Wolfer 4 | ** 5 | ** This file is part of KDE. 6 | ** 7 | ** This program is free software; you can redistribute it and/or modify 8 | ** it under the terms of the GNU General Public License as published by 9 | ** the Free Software Foundation; either version 2 of the License, or 10 | ** (at your option) any later version. 11 | ** 12 | ** This program is distributed in the hope that it will be useful, 13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ** GNU General Public License for more details. 16 | ** 17 | ** You should have received a copy of the GNU General Public License 18 | ** along with this program; see the file COPYING. If not, write to 19 | ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | ** Boston, MA 02110-1301, USA. 21 | ** 22 | ****************************************************************************/ 23 | 24 | #include "vncview.h" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef QTONLY 32 | #include 33 | #include 34 | #define KMessageBox QMessageBox 35 | #define error(parent, message, caption) \ 36 | critical(parent, caption, message) 37 | #else 38 | #include "settings.h" 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #endif 45 | 46 | // Definition of key modifier mask constants 47 | #define KMOD_Alt_R 0x01 48 | #define KMOD_Alt_L 0x02 49 | #define KMOD_Meta_L 0x04 50 | #define KMOD_Control_L 0x08 51 | #define KMOD_Shift_L 0x10 52 | 53 | VncView::VncView(QWidget *parent, const KUrl &url, const QString &password) 54 | : RemoteView(parent), 55 | m_initDone(false), 56 | m_buttonMask(0), 57 | m_repaint(false), 58 | m_quitFlag(false), 59 | m_firstPasswordTry(true), 60 | m_dontSendClipboard(false), 61 | m_horizontalFactor(1.0), 62 | m_verticalFactor(1.0), 63 | m_password(password), 64 | m_forceLocalCursor(false) 65 | { 66 | m_url = url; 67 | m_host = url.host(); 68 | m_port = url.port(); 69 | 70 | // BlockingQueuedConnection can cause deadlocks when exiting, handled in startQuitting() 71 | connect(&vncThread, SIGNAL(imageUpdated(int,int,int,int)), this, SLOT(updateImage(int,int,int,int)), Qt::BlockingQueuedConnection); 72 | connect(&vncThread, SIGNAL(gotCut(QString)), this, SLOT(setCut(QString)), Qt::BlockingQueuedConnection); 73 | connect(&vncThread, SIGNAL(passwordRequest(bool)), this, SLOT(requestPassword(bool)), Qt::BlockingQueuedConnection); 74 | connect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString))); 75 | 76 | m_clipboard = QApplication::clipboard(); 77 | connect(m_clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged())); 78 | 79 | } 80 | 81 | VncView::~VncView() 82 | { 83 | if (!m_quitFlag) startQuitting(); 84 | } 85 | 86 | bool VncView::eventFilter(QObject *obj, QEvent *event) 87 | { 88 | if (m_viewOnly) { 89 | if (event->type() == QEvent::KeyPress || 90 | event->type() == QEvent::KeyRelease || 91 | event->type() == QEvent::MouseButtonDblClick || 92 | event->type() == QEvent::MouseButtonPress || 93 | event->type() == QEvent::MouseButtonRelease || 94 | event->type() == QEvent::Wheel || 95 | event->type() == QEvent::MouseMove) 96 | return true; 97 | } 98 | 99 | return RemoteView::eventFilter(obj, event); 100 | } 101 | 102 | QSize VncView::framebufferSize() 103 | { 104 | return m_frame.size(); 105 | } 106 | 107 | QSize VncView::sizeHint() const 108 | { 109 | return size(); 110 | } 111 | 112 | QSize VncView::minimumSizeHint() const 113 | { 114 | return size(); 115 | } 116 | 117 | void VncView::scaleResize(int w, int h) 118 | { 119 | RemoteView::scaleResize(w, h); 120 | 121 | kDebug(5011) << w << h; 122 | if (m_scale) { 123 | m_verticalFactor = (qreal) h / m_frame.height(); 124 | m_horizontalFactor = (qreal) w / m_frame.width(); 125 | 126 | #ifndef QTONLY 127 | if (Settings::keepAspectRatio()) { 128 | m_verticalFactor = m_horizontalFactor = qMin(m_verticalFactor, m_horizontalFactor); 129 | } 130 | #else 131 | m_verticalFactor = m_horizontalFactor = qMin(m_verticalFactor, m_horizontalFactor); 132 | #endif 133 | 134 | const qreal newW = m_frame.width() * m_horizontalFactor; 135 | const qreal newH = m_frame.height() * m_verticalFactor; 136 | setMaximumSize(newW, newH); //This is a hack to force Qt to center the view in the scroll area 137 | resize(newW, newH); 138 | } 139 | } 140 | 141 | void VncView::updateConfiguration() 142 | { 143 | RemoteView::updateConfiguration(); 144 | 145 | // Update the scaling mode in case KeepAspectRatio changed 146 | scaleResize(parentWidget()->width(), parentWidget()->height()); 147 | } 148 | 149 | void VncView::startQuitting() 150 | { 151 | kDebug(5011) << "about to quit"; 152 | 153 | setStatus(Disconnecting); 154 | 155 | m_quitFlag = true; 156 | 157 | vncThread.stop(); 158 | 159 | unpressModifiers(); 160 | 161 | // Disconnect all signals so that we don't get any more callbacks from the client thread 162 | vncThread.disconnect(); 163 | 164 | vncThread.quit(); 165 | 166 | const bool quitSuccess = vncThread.wait(500); 167 | if (!quitSuccess) { 168 | // happens when vncThread wants to call a slot via BlockingQueuedConnection, 169 | // needs an event loop in this thread so execution continues after 'emit' 170 | QEventLoop loop; 171 | if (!loop.processEvents()) { 172 | kDebug(5011) << "BUG: deadlocked, but no events to deliver?"; 173 | } 174 | vncThread.wait(500); 175 | } 176 | 177 | kDebug(5011) << "Quit VNC thread success:" << quitSuccess; 178 | 179 | setStatus(Disconnected); 180 | } 181 | 182 | bool VncView::isQuitting() 183 | { 184 | return m_quitFlag; 185 | } 186 | 187 | bool VncView::start() 188 | { 189 | vncThread.setHost(m_host); 190 | vncThread.setPort(m_port); 191 | RemoteView::Quality quality; 192 | #ifdef QTONLY 193 | quality = (RemoteView::Quality)((QCoreApplication::arguments().count() > 2) ? 194 | QCoreApplication::arguments().at(2).toInt() : 2); 195 | #else 196 | quality = m_hostPreferences->quality(); 197 | #endif 198 | 199 | vncThread.setQuality(quality); 200 | 201 | // set local cursor on by default because low quality mostly means slow internet connection 202 | if (quality == RemoteView::Low) { 203 | showDotCursor(RemoteView::CursorOn); 204 | #ifndef QTONLY 205 | // KRDC does always just have one main window, so at(0) is safe 206 | KXMLGUIClient *mainWindow = dynamic_cast(KMainWindow::memberList().at(0)); 207 | if (mainWindow) 208 | mainWindow->actionCollection()->action("show_local_cursor")->setChecked(true); 209 | #endif 210 | } 211 | 212 | setStatus(Connecting); 213 | 214 | vncThread.start(); 215 | return true; 216 | } 217 | 218 | bool VncView::supportsScaling() const 219 | { 220 | return true; 221 | } 222 | 223 | bool VncView::supportsLocalCursor() const 224 | { 225 | return true; 226 | } 227 | 228 | void VncView::requestPassword(bool includingUsername) 229 | { 230 | kDebug(5011) << "request password"; 231 | 232 | setStatus(Authenticating); 233 | 234 | if (m_firstPasswordTry && !m_url.userName().isNull()) { 235 | vncThread.setUsername(m_url.userName()); 236 | } 237 | 238 | #ifndef QTONLY 239 | // just try to get the passwort from the wallet the first time, otherwise it will loop (see issue #226283) 240 | if (m_firstPasswordTry && m_hostPreferences->walletSupport()) { 241 | QString walletPassword = readWalletPassword(); 242 | 243 | if (!walletPassword.isNull()) { 244 | vncThread.setPassword(walletPassword); 245 | m_firstPasswordTry = false; 246 | return; 247 | } 248 | } 249 | #endif 250 | 251 | if (m_firstPasswordTry && !m_url.password().isNull()) { 252 | vncThread.setPassword(m_url.password()); 253 | m_firstPasswordTry = false; 254 | return; 255 | } 256 | 257 | #ifdef QTONLY 258 | bool ok; 259 | if (includingUsername) { 260 | QString username = QInputDialog::getText(this, //krazy:exclude=qclasses (code not used in kde build) 261 | tr("Username required"), 262 | tr("Please enter the username for the remote desktop:"), 263 | QLineEdit::Normal, m_url.userName(), &ok); //krazy:exclude=qclasses 264 | if (ok) 265 | vncThread.setUsername(username); 266 | else 267 | startQuitting(); 268 | } 269 | 270 | /* 271 | QString password = QInputDialog::getText(this, //krazy:exclude=qclasses 272 | tr("Password required"), 273 | tr("Please enter the password for the remote desktop:"), 274 | QLineEdit::Password, QString(), &ok); //krazy:exclude=qclasses 275 | */ 276 | 277 | //replace the dialog to request password 278 | QString password = m_password; 279 | ok = true; 280 | 281 | m_firstPasswordTry = false; 282 | if (ok) 283 | vncThread.setPassword(password); 284 | else 285 | startQuitting(); 286 | #else 287 | KPasswordDialog dialog(this, includingUsername ? KPasswordDialog::ShowUsernameLine : KPasswordDialog::NoFlags); 288 | dialog.setPrompt(m_firstPasswordTry ? i18n("Access to the system requires a password.") 289 | : i18n("Authentication failed. Please try again.")); 290 | if (includingUsername) dialog.setUsername(m_url.userName()); 291 | if (dialog.exec() == KPasswordDialog::Accepted) { 292 | m_firstPasswordTry = false; 293 | vncThread.setPassword(dialog.password()); 294 | if (includingUsername) vncThread.setUsername(dialog.username()); 295 | } else { 296 | kDebug(5011) << "password dialog not accepted"; 297 | startQuitting(); 298 | } 299 | #endif 300 | } 301 | 302 | void VncView::outputErrorMessage(const QString &message) 303 | { 304 | kDebug(5011) << message; 305 | 306 | if (message == "INTERNAL:APPLE_VNC_COMPATIBILTY") { 307 | setCursor(localDotCursor()); 308 | m_forceLocalCursor = true; 309 | return; 310 | } 311 | 312 | startQuitting(); 313 | 314 | KMessageBox::error(this, message, i18n("VNC failure")); 315 | 316 | emit errorMessage(i18n("VNC failure"), message); 317 | } 318 | 319 | #ifndef QTONLY 320 | HostPreferences* VncView::hostPreferences() 321 | { 322 | return m_hostPreferences; 323 | } 324 | #endif 325 | 326 | void VncView::updateImage(int x, int y, int w, int h) 327 | { 328 | // kDebug(5011) << "got update" << width() << height(); 329 | 330 | m_x = x; 331 | m_y = y; 332 | m_w = w; 333 | m_h = h; 334 | 335 | if (m_horizontalFactor != 1.0 || m_verticalFactor != 1.0) { 336 | // If the view is scaled, grow the update rectangle to avoid artifacts 337 | m_x-=1; 338 | m_y-=1; 339 | m_w+=2; 340 | m_h+=2; 341 | } 342 | 343 | m_frame = vncThread.image(); 344 | 345 | if (!m_initDone) { 346 | if (!vncThread.username().isEmpty()) { 347 | m_url.setUserName(vncThread.username()); 348 | } 349 | setAttribute(Qt::WA_StaticContents); 350 | setAttribute(Qt::WA_OpaquePaintEvent); 351 | installEventFilter(this); 352 | 353 | setCursor(((m_dotCursorState == CursorOn) || m_forceLocalCursor) ? localDotCursor() : Qt::BlankCursor); 354 | 355 | setMouseTracking(true); // get mouse events even when there is no mousebutton pressed 356 | setFocusPolicy(Qt::WheelFocus); 357 | setStatus(Connected); 358 | emit connected(); 359 | 360 | if (m_scale) { 361 | #ifndef QTONLY 362 | kDebug(5011) << "Setting initial size w:" <width() << " h:" << m_hostPreferences->height(); 363 | emit framebufferSizeChanged(m_hostPreferences->width(), m_hostPreferences->height()); 364 | scaleResize(m_hostPreferences->width(), m_hostPreferences->height()); 365 | kDebug() << "m_frame.size():" << m_frame.size() << "size()" << size(); 366 | #else 367 | //TODO: qtonly alternative 368 | #endif 369 | } 370 | 371 | m_initDone = true; 372 | 373 | #ifndef QTONLY 374 | if (m_hostPreferences->walletSupport()) { 375 | saveWalletPassword(vncThread.password()); 376 | } 377 | #endif 378 | } 379 | 380 | if ((y == 0 && x == 0) && (m_frame.size() != size())) { 381 | kDebug(5011) << "Updating framebuffer size"; 382 | if (m_scale) { 383 | setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); 384 | if (parentWidget()) 385 | scaleResize(parentWidget()->width(), parentWidget()->height()); 386 | } else { 387 | kDebug(5011) << "Resizing: " << m_frame.width() << m_frame.height(); 388 | resize(m_frame.width(), m_frame.height()); 389 | setMaximumSize(m_frame.width(), m_frame.height()); //This is a hack to force Qt to center the view in the scroll area 390 | setMinimumSize(m_frame.width(), m_frame.height()); 391 | emit framebufferSizeChanged(m_frame.width(), m_frame.height()); 392 | } 393 | } 394 | 395 | m_repaint = true; 396 | repaint(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor)); 397 | m_repaint = false; 398 | } 399 | 400 | void VncView::setViewOnly(bool viewOnly) 401 | { 402 | RemoteView::setViewOnly(viewOnly); 403 | 404 | m_dontSendClipboard = viewOnly; 405 | 406 | if (viewOnly) 407 | setCursor(Qt::ArrowCursor); 408 | else 409 | setCursor(m_dotCursorState == CursorOn ? localDotCursor() : Qt::BlankCursor); 410 | } 411 | 412 | void VncView::showDotCursor(DotCursorState state) 413 | { 414 | RemoteView::showDotCursor(state); 415 | 416 | setCursor(state == CursorOn ? localDotCursor() : Qt::BlankCursor); 417 | } 418 | 419 | void VncView::enableScaling(bool scale) 420 | { 421 | RemoteView::enableScaling(scale); 422 | 423 | if (scale) { 424 | setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); 425 | setMinimumSize(1, 1); 426 | if (parentWidget()) 427 | scaleResize(parentWidget()->width(), parentWidget()->height()); 428 | } else { 429 | m_verticalFactor = 1.0; 430 | m_horizontalFactor = 1.0; 431 | 432 | setMaximumSize(m_frame.width(), m_frame.height()); //This is a hack to force Qt to center the view in the scroll area 433 | setMinimumSize(m_frame.width(), m_frame.height()); 434 | resize(m_frame.width(), m_frame.height()); 435 | } 436 | } 437 | 438 | void VncView::setCut(const QString &text) 439 | { 440 | m_dontSendClipboard = true; 441 | m_clipboard->setText(text, QClipboard::Clipboard); 442 | m_dontSendClipboard = false; 443 | } 444 | 445 | void VncView::paintEvent(QPaintEvent *event) 446 | { 447 | // kDebug(5011) << "paint event: x: " << m_x << ", y: " << m_y << ", w: " << m_w << ", h: " << m_h; 448 | if (m_frame.isNull() || m_frame.format() == QImage::Format_Invalid) { 449 | kDebug(5011) << "no valid image to paint"; 450 | RemoteView::paintEvent(event); 451 | return; 452 | } 453 | 454 | event->accept(); 455 | 456 | QPainter painter(this); 457 | 458 | if (m_repaint) { 459 | // kDebug(5011) << "normal repaint"; 460 | painter.drawImage(QRect(qRound(m_x*m_horizontalFactor), qRound(m_y*m_verticalFactor), 461 | qRound(m_w*m_horizontalFactor), qRound(m_h*m_verticalFactor)), 462 | m_frame.copy(m_x, m_y, m_w, m_h).scaled(qRound(m_w*m_horizontalFactor), 463 | qRound(m_h*m_verticalFactor), 464 | Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); 465 | } else { 466 | // kDebug(5011) << "resize repaint"; 467 | QRect rect = event->rect(); 468 | if (rect.width() != width() || rect.height() != height()) { 469 | // kDebug(5011) << "Partial repaint"; 470 | const int sx = rect.x()/m_horizontalFactor; 471 | const int sy = rect.y()/m_verticalFactor; 472 | const int sw = rect.width()/m_horizontalFactor; 473 | const int sh = rect.height()/m_verticalFactor; 474 | painter.drawImage(rect, 475 | m_frame.copy(sx, sy, sw, sh).scaled(rect.width(), rect.height(), 476 | Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); 477 | } else { 478 | // kDebug(5011) << "Full repaint" << width() << height() << m_frame.width() << m_frame.height(); 479 | painter.drawImage(QRect(0, 0, width(), height()), 480 | m_frame.scaled(m_frame.width() * m_horizontalFactor, m_frame.height() * m_verticalFactor, 481 | Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); 482 | } 483 | } 484 | 485 | RemoteView::paintEvent(event); 486 | } 487 | 488 | void VncView::resizeEvent(QResizeEvent *event) 489 | { 490 | RemoteView::resizeEvent(event); 491 | update(); 492 | } 493 | 494 | bool VncView::event(QEvent *event) 495 | { 496 | switch (event->type()) { 497 | case QEvent::KeyPress: 498 | case QEvent::KeyRelease: 499 | // kDebug(5011) << "keyEvent"; 500 | keyEventHandler(static_cast(event)); 501 | return true; 502 | break; 503 | case QEvent::MouseButtonDblClick: 504 | case QEvent::MouseButtonPress: 505 | case QEvent::MouseButtonRelease: 506 | case QEvent::MouseMove: 507 | // kDebug(5011) << "mouseEvent"; 508 | mouseEventHandler(static_cast(event)); 509 | return true; 510 | break; 511 | case QEvent::Wheel: 512 | // kDebug(5011) << "wheelEvent"; 513 | wheelEventHandler(static_cast(event)); 514 | return true; 515 | break; 516 | default: 517 | return RemoteView::event(event); 518 | } 519 | } 520 | 521 | void VncView::mouseEventHandler(QMouseEvent *e) 522 | { 523 | if (e->type() != QEvent::MouseMove) { 524 | if ((e->type() == QEvent::MouseButtonPress) || 525 | (e->type() == QEvent::MouseButtonDblClick)) { 526 | if (e->button() & Qt::LeftButton) 527 | m_buttonMask |= 0x01; 528 | if (e->button() & Qt::MidButton) 529 | m_buttonMask |= 0x02; 530 | if (e->button() & Qt::RightButton) 531 | m_buttonMask |= 0x04; 532 | } else if (e->type() == QEvent::MouseButtonRelease) { 533 | if (e->button() & Qt::LeftButton) 534 | m_buttonMask &= 0xfe; 535 | if (e->button() & Qt::MidButton) 536 | m_buttonMask &= 0xfd; 537 | if (e->button() & Qt::RightButton) 538 | m_buttonMask &= 0xfb; 539 | } 540 | } 541 | 542 | vncThread.mouseEvent(qRound(e->x() / m_horizontalFactor), qRound(e->y() / m_verticalFactor), m_buttonMask); 543 | } 544 | 545 | void VncView::wheelEventHandler(QWheelEvent *event) 546 | { 547 | int eb = 0; 548 | if (event->delta() < 0) 549 | eb |= 0x10; 550 | else 551 | eb |= 0x8; 552 | 553 | const int x = qRound(event->x() / m_horizontalFactor); 554 | const int y = qRound(event->y() / m_verticalFactor); 555 | 556 | vncThread.mouseEvent(x, y, eb | m_buttonMask); 557 | vncThread.mouseEvent(x, y, m_buttonMask); 558 | } 559 | 560 | void VncView::keyEventHandler(QKeyEvent *e) 561 | { 562 | // strip away autorepeating KeyRelease; see bug #206598 563 | if (e->isAutoRepeat() && (e->type() == QEvent::KeyRelease)) 564 | return; 565 | 566 | // parts of this code are based on http://italc.sourcearchive.com/documentation/1.0.9.1/vncview_8cpp-source.html 567 | rfbKeySym k = e->nativeVirtualKey(); 568 | 569 | // we do not handle Key_Backtab separately as the Shift-modifier 570 | // is already enabled 571 | if (e->key() == Qt::Key_Backtab) { 572 | k = XK_Tab; 573 | } 574 | 575 | const bool pressed = (e->type() == QEvent::KeyPress); 576 | 577 | // handle modifiers 578 | if (k == XK_Shift_L || k == XK_Control_L || k == XK_Meta_L || k == XK_Alt_L) { 579 | if (pressed) { 580 | m_mods[k] = true; 581 | } else if (m_mods.contains(k)) { 582 | m_mods.remove(k); 583 | } else { 584 | unpressModifiers(); 585 | } 586 | } 587 | 588 | if (k) { 589 | vncThread.keyEvent(k, pressed); 590 | } 591 | } 592 | 593 | void VncView::unpressModifiers() 594 | { 595 | const QList keys = m_mods.keys(); 596 | QList::const_iterator it = keys.constBegin(); 597 | while (it != keys.end()) { 598 | vncThread.keyEvent(*it, false); 599 | it++; 600 | } 601 | m_mods.clear(); 602 | } 603 | 604 | void VncView::clipboardDataChanged() 605 | { 606 | kDebug(5011); 607 | 608 | if (m_status != Connected) 609 | return; 610 | 611 | if (m_clipboard->ownsClipboard() || m_dontSendClipboard) 612 | return; 613 | 614 | const QString text = m_clipboard->text(QClipboard::Clipboard); 615 | 616 | vncThread.clientCut(text); 617 | } 618 | 619 | #include "moc_vncview.cpp" 620 | -------------------------------------------------------------------------------- /vncview.h: -------------------------------------------------------------------------------- 1 | #ifndef VNCVIEW_H 2 | #define VNCVIEW_H 3 | 4 | #include "vncview_global.h" 5 | 6 | #include "remoteview.h" 7 | #include "vncclientthread.h" 8 | 9 | #ifdef QTONLY 10 | class KConfigGroup{}; 11 | #else 12 | #include "vnchostpreferences.h" 13 | #endif 14 | 15 | #include 16 | 17 | extern "C" { 18 | #include 19 | } 20 | 21 | class VNCVIEWSHARED_EXPORT VncView : public RemoteView 22 | { 23 | 24 | Q_OBJECT 25 | 26 | public: 27 | explicit VncView(QWidget *parent = 0, const KUrl &url = KUrl(), const QString &password = QString()); 28 | 29 | ~VncView(); 30 | 31 | QSize framebufferSize(); 32 | QSize sizeHint() const; 33 | QSize minimumSizeHint() const; 34 | void startQuitting(); 35 | bool isQuitting(); 36 | bool start(); 37 | bool supportsScaling() const; 38 | bool supportsLocalCursor() const; 39 | 40 | #ifndef QTONLY 41 | HostPreferences* hostPreferences(); 42 | #endif 43 | 44 | void setViewOnly(bool viewOnly); 45 | void showDotCursor(DotCursorState state); 46 | void enableScaling(bool scale); 47 | 48 | virtual void updateConfiguration(); 49 | 50 | public slots: 51 | void scaleResize(int w, int h); 52 | 53 | protected: 54 | void paintEvent(QPaintEvent *event); 55 | bool event(QEvent *event); 56 | void resizeEvent(QResizeEvent *event); 57 | bool eventFilter(QObject *obj, QEvent *event); 58 | 59 | private: 60 | VncClientThread vncThread; 61 | QClipboard *m_clipboard; 62 | bool m_initDone; 63 | int m_buttonMask; 64 | QMap m_mods; 65 | int m_x, m_y, m_w, m_h; 66 | bool m_repaint; 67 | bool m_quitFlag; 68 | bool m_firstPasswordTry; 69 | bool m_dontSendClipboard; 70 | qreal m_horizontalFactor; 71 | qreal m_verticalFactor; 72 | QString m_password; 73 | #ifndef QTONLY 74 | VncHostPreferences *m_hostPreferences; 75 | #endif 76 | QImage m_frame; 77 | bool m_forceLocalCursor; 78 | 79 | void keyEventHandler(QKeyEvent *e); 80 | void unpressModifiers(); 81 | void wheelEventHandler(QWheelEvent *event); 82 | void mouseEventHandler(QMouseEvent *event); 83 | 84 | private slots: 85 | void updateImage(int x, int y, int w, int h); 86 | void setCut(const QString &text); 87 | void requestPassword(bool includingUsername); 88 | void outputErrorMessage(const QString &message); 89 | void clipboardDataChanged(); 90 | }; 91 | 92 | #endif // VNCVIEW_H 93 | -------------------------------------------------------------------------------- /vncview.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ProjectExplorer.Project.ActiveTarget 7 | 0 8 | 9 | 10 | ProjectExplorer.Project.EditorSettings 11 | 12 | true 13 | false 14 | true 15 | 16 | Cpp 17 | 18 | CppGlobal 19 | 20 | 21 | 22 | QmlJS 23 | 24 | QmlJSGlobal 25 | 26 | 27 | 2 28 | UTF-8 29 | false 30 | 4 31 | false 32 | true 33 | 1 34 | true 35 | 0 36 | true 37 | 0 38 | 8 39 | true 40 | 1 41 | true 42 | true 43 | true 44 | false 45 | 46 | 47 | 48 | ProjectExplorer.Project.PluginSettings 49 | 50 | 51 | 52 | ProjectExplorer.Project.Target.0 53 | 54 | Desktop Qt5 55 | Desktop Qt5 56 | {716e77dc-fd1b-4964-8f42-cf2bf2321c1d} 57 | 0 58 | 0 59 | 0 60 | 61 | 62 | 63 | true 64 | qmake 65 | 66 | QtProjectManager.QMakeBuildStep 67 | false 68 | true 69 | 70 | false 71 | 72 | 73 | true 74 | Make 75 | 76 | Qt4ProjectManager.MakeStep 77 | 78 | -w 79 | -r 80 | 81 | false 82 | 83 | 84 | 85 | 2 86 | Build 87 | 88 | ProjectExplorer.BuildSteps.Build 89 | 90 | 91 | 92 | true 93 | Make 94 | 95 | Qt4ProjectManager.MakeStep 96 | 97 | -w 98 | -r 99 | 100 | true 101 | clean 102 | 103 | 104 | 1 105 | Clean 106 | 107 | ProjectExplorer.BuildSteps.Clean 108 | 109 | 2 110 | false 111 | 112 | Debug 113 | 114 | Qt4ProjectManager.Qt4BuildConfiguration 115 | 2 116 | /home/lg/Sources/build-vncview-Desktop_Qt5-Debug 117 | true 118 | 119 | 120 | 121 | 122 | true 123 | qmake 124 | 125 | QtProjectManager.QMakeBuildStep 126 | false 127 | true 128 | 129 | false 130 | 131 | 132 | true 133 | Make 134 | 135 | Qt4ProjectManager.MakeStep 136 | 137 | -w 138 | -r 139 | 140 | false 141 | 142 | 143 | 144 | 2 145 | Build 146 | 147 | ProjectExplorer.BuildSteps.Build 148 | 149 | 150 | 151 | true 152 | Make 153 | 154 | Qt4ProjectManager.MakeStep 155 | 156 | -w 157 | -r 158 | 159 | true 160 | clean 161 | 162 | 163 | 1 164 | Clean 165 | 166 | ProjectExplorer.BuildSteps.Clean 167 | 168 | 2 169 | false 170 | 171 | Release 172 | 173 | Qt4ProjectManager.Qt4BuildConfiguration 174 | 0 175 | /home/lg/Sources/build-vncview-Desktop_Qt5-Release 176 | true 177 | 178 | 2 179 | 180 | 181 | 0 182 | Deploy 183 | 184 | ProjectExplorer.BuildSteps.Deploy 185 | 186 | 1 187 | Deploy locally 188 | 189 | ProjectExplorer.DefaultDeployConfiguration 190 | 191 | 1 192 | 193 | 194 | true 195 | 196 | false 197 | false 198 | false 199 | false 200 | true 201 | 0.01 202 | 10 203 | true 204 | 25 205 | 206 | true 207 | valgrind 208 | 209 | 0 210 | 1 211 | 2 212 | 3 213 | 4 214 | 5 215 | 6 216 | 7 217 | 8 218 | 9 219 | 10 220 | 11 221 | 12 222 | 13 223 | 14 224 | 225 | 2 226 | 227 | 228 | 229 | false 230 | %{buildDir} 231 | Custom Executable 232 | 233 | ProjectExplorer.CustomExecutableRunConfiguration 234 | 3768 235 | true 236 | false 237 | false 238 | false 239 | true 240 | 241 | 1 242 | 243 | 244 | 245 | ProjectExplorer.Project.TargetCount 246 | 1 247 | 248 | 249 | ProjectExplorer.Project.Updater.EnvironmentId 250 | {0c48906f-9377-4b6d-b574-7f2e023f37c3} 251 | 252 | 253 | ProjectExplorer.Project.Updater.FileVersion 254 | 14 255 | 256 | 257 | -------------------------------------------------------------------------------- /vncview_global.h: -------------------------------------------------------------------------------- 1 | #ifndef VNCVIEW_GLOBAL_H 2 | #define VNCVIEW_GLOBAL_H 3 | 4 | #include 5 | 6 | #if defined(VNCVIEW_LIBRARY) 7 | # define VNCVIEWSHARED_EXPORT Q_DECL_EXPORT 8 | #else 9 | # define VNCVIEWSHARED_EXPORT Q_DECL_IMPORT 10 | #endif 11 | 12 | #endif // VNCVIEW_GLOBAL_H 13 | --------------------------------------------------------------------------------