-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.增加WoVNCViewer客户端模块。 2.修复Format_RGB32格式下,苹果系统会出现透明的缺陷。
- Loading branch information
Showing
25 changed files
with
880 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
project(wovncviewer LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
add_definitions(-DUNICODE -D_UNICODE) | ||
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED) | ||
|
||
set(SOURCE_FILES | ||
main.cpp | ||
qkxvncviewer.cpp | ||
qkxconnectiondialog.cpp | ||
) | ||
|
||
set(HEADER_FILES | ||
version.h | ||
qkxvncviewer.h | ||
qkxconnectiondialog.h | ||
) | ||
|
||
set(OTHER_FILES | ||
vncviewer.qrc | ||
qkxvncviewer.ui | ||
qkxconnectiondialog.ui | ||
) | ||
|
||
if(WIN32) | ||
set(OTHER_FILES ${OTHER_FILES} | ||
) | ||
elseif(APPLE) | ||
message("APPLE Here") | ||
else() | ||
|
||
endif() | ||
|
||
include_directories( | ||
${KXVNC_ROOT_DIR} | ||
${KXUTIL_ROOT_DIR} | ||
${ZLIB_ROOT_DIR}/include | ||
) | ||
|
||
link_directories(${ZLIB_ROOT_DIR}/lib | ||
) | ||
|
||
if(WIN32) | ||
message("window system.") | ||
link_libraries(ws2_32 crypt32 kxutil kxvnc) | ||
set(BUILD_VERSION_MAJOR 0) | ||
set(BUILD_VERSION_MINOR 0) | ||
set(BUILD_VERSION_PATCH 0) | ||
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/version.h BUILD_VERSION) | ||
message("buildVersion:${BUILD_VERSION}") | ||
string(REGEX MATCHALL "WOVNCVIEWER_VERSION.*\\(\"(.*)\"\\)" BUILD_VERSION ${BUILD_VERSION}) | ||
set(BUILD_VERSION ${CMAKE_MATCH_1}) | ||
message("versionContent:${BUILD_VERSION}") | ||
string(REPLACE "." ";" VERSION_LIST ${BUILD_VERSION}) | ||
message("versionList:${VERSION_LIST}") | ||
list(LENGTH VERSION_LIST len) | ||
list(GET VERSION_LIST 0 BUILD_VERSION_MAJOR) | ||
list(GET VERSION_LIST 1 BUILD_VERSION_MINOR) | ||
if( ${len} EQUAL 3) | ||
list(GET VERSION_LIST 2 BUILD_VERSION_PATCH) | ||
endif() | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/versioninfo.rc.in versioninfo.rc @ONLY) | ||
add_executable(${PROJECT_NAME} WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${OTHER_FILES}) | ||
target_sources(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc") | ||
elseif(APPLE) | ||
message("linux system.") | ||
link_libraries(kxutil kxvnc) | ||
add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${OTHER_FILES}) | ||
|
||
add_custom_command(TARGET ${PROJECT_NAME} | ||
POST_BUILD | ||
COMMAND cp -f "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/wovncviewer" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/wovncserver.app/Contents/MacOS/" | ||
) | ||
else() | ||
message("linux system.") | ||
link_libraries(kxutil kxvnc) | ||
add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${OTHER_FILES}) | ||
endif() | ||
|
||
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>) | ||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Network) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/******************************************************************************************* | ||
* | ||
* Copyright (C) 2022 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved. | ||
* | ||
* Contact: http://www.aoyiduo.com | ||
* | ||
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3] | ||
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* | ||
*******************************************************************************************/ | ||
|
||
#include "qkxvncviewer.h" | ||
|
||
#include <QApplication> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication a(argc, argv); | ||
QKxVNCViewer w; | ||
w.show(); | ||
return a.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/******************************************************************************************* | ||
* | ||
* Copyright (C) 2022 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved. | ||
* | ||
* Contact: http://www.aoyiduo.com | ||
* | ||
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3] | ||
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* | ||
*******************************************************************************************/ | ||
|
||
#include "qkxconnectiondialog.h" | ||
#include "ui_qkxconnectiondialog.h" | ||
|
||
#include <QIntValidator> | ||
#include <QMessageBox> | ||
#include <QTimer> | ||
|
||
QKxConnectionDialog::QKxConnectionDialog(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::QKxConnectionDialog) | ||
{ | ||
ui->setupUi(this); | ||
Qt::WindowFlags flags = windowFlags(); | ||
setWindowFlags(flags &~Qt::WindowContextHelpButtonHint); | ||
setWindowTitle(tr("New Connection")); | ||
ui->port->setValidator(new QIntValidator(1024, 65535, this)); | ||
QObject::connect(ui->connect, SIGNAL(clicked()), this, SLOT(onButtonConnectClicked())); | ||
QTimer::singleShot(10, this, SLOT(onAdjustSize())); | ||
ui->err->setVisible(false); | ||
} | ||
|
||
QKxConnectionDialog::~QKxConnectionDialog() | ||
{ | ||
delete ui; | ||
} | ||
|
||
QString QKxConnectionDialog::serverName() const | ||
{ | ||
return ui->server->text(); | ||
} | ||
|
||
int QKxConnectionDialog::port() const | ||
{ | ||
QString txt = ui->port->text(); | ||
return txt.toInt(); | ||
} | ||
|
||
QString QKxConnectionDialog::password() const | ||
{ | ||
return ui->password->text(); | ||
} | ||
|
||
void QKxConnectionDialog::setErrorMessage(const QString &msg) | ||
{ | ||
ui->err->setText(msg); | ||
ui->err->setVisible(!msg.isEmpty()); | ||
} | ||
|
||
void QKxConnectionDialog::onButtonConnectClicked() | ||
{ | ||
QString server=ui->server->text(); | ||
QString pass = ui->password->text(); | ||
QString port = ui->port->text(); | ||
if(server.isEmpty()) { | ||
QMessageBox::information(this, tr("Bad Parameter"), tr("please fill the server address")); | ||
return; | ||
} | ||
if(pass.isEmpty()) { | ||
QMessageBox::information(this, tr("Bad Parameter"), tr("please fill the password")); | ||
return; | ||
} | ||
if(port.isEmpty()) { | ||
QMessageBox::information(this, tr("Bad Parameter"), tr("please fill the port")); | ||
return; | ||
} | ||
done(Accepted); | ||
} | ||
|
||
void QKxConnectionDialog::onAdjustSize() | ||
{ | ||
//adjustSize(); | ||
QSize sz = minimumSize(); | ||
resize(sz); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/******************************************************************************************* | ||
* | ||
* Copyright (C) 2022 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved. | ||
* | ||
* Contact: http://www.aoyiduo.com | ||
* | ||
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3] | ||
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* | ||
*******************************************************************************************/ | ||
|
||
#ifndef QKXCONNECTIONDIALOG_H | ||
#define QKXCONNECTIONDIALOG_H | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class QKxConnectionDialog; | ||
} | ||
|
||
class QKxConnectionDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit QKxConnectionDialog(QWidget *parent = nullptr); | ||
~QKxConnectionDialog(); | ||
QString serverName() const; | ||
int port() const; | ||
QString password() const; | ||
|
||
void setErrorMessage(const QString& msg); | ||
private slots: | ||
void onButtonConnectClicked(); | ||
void onAdjustSize(); | ||
private: | ||
Ui::QKxConnectionDialog *ui; | ||
}; | ||
|
||
#endif // QKXCONNECTIONDIALOG_H |
Oops, something went wrong.