Skip to content

Commit

Permalink
v3.2.0
Browse files Browse the repository at this point in the history
1.增加WoVNCViewer客户端模块。
2.修复Format_RGB32格式下,苹果系统会出现透明的缺陷。
  • Loading branch information
getwingm committed Oct 6, 2022
1 parent 0d1fb7a commit 7da972a
Show file tree
Hide file tree
Showing 25 changed files with 880 additions and 21 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1)

project(wovncseverall)
project(wovncall)

SET(CMAKE_EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_EXECUTABLE_OUTPUT_PATH_DEBUG ${PROJECT_SOURCE_DIR}/bin)
Expand All @@ -17,20 +17,19 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)

set(CMAKE_DEBUG_POSTFIX "d")

set(SERVICE_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/qtservice)
set(LIBYUV_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/libyuv)
set(KXCAP_ROOT_DIR ${PROJECT_SOURCE_DIR}/kxcap)
set(KXUTIL_ROOT_DIR ${PROJECT_SOURCE_DIR}/kxutil)
set(KXFTP_ROOT_DIR ${PROJECT_SOURCE_DIR}/kxftp)
set(KXVNC_ROOT_DIR ${PROJECT_SOURCE_DIR}/kxvnc)

if(WIN32)
set(ZLIB_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/zlib/winx)
set(LIBOPENH264_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/openh264/winx)
set(LIBPORTAUDIO_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/portaudio/winx)
set(LIBOPUS_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/opus/winx)
set(LIBJPEG_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/jpeg/winx)
set(LIBQTSERVICE_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/qtservice/winx)
set(LIBJPEG_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/jpeg/winx)
set(LIBYUV_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/libyuv/winx)
set(LIBQTSERVICE_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/qtservice/winx)
file(GLOB MY_COPY_FILES ${LIBQTSERVICE_ROOT_DIR}/bin/qtserviced.*)
file(GLOB MY_COPY_FILES ${MY_COPY_FILES} ${LIBQTSERVICE_ROOT_DIR}/bin/qtservice.*)
else()
Expand All @@ -40,15 +39,18 @@ else()
set(LIBOPUS_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/opus/unix)
set(LIBJPEG_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/jpeg/unix)
set(LIBYUV_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/libyuv/unix)
set(LIBQTSERVICE_ROOT_DIR ${PROJECT_SOURCE_DIR}/third/qtservice/unix)
endif()
file(COPY ${MY_COPY_FILES} DESTINATION ${PROJECT_SOURCE_DIR}/bin)


message("copy file list:${MY_COPY_FILES}")
message("root path:${PROJECT_SOURCE_DIR}")

add_subdirectory(server)
add_subdirectory(kxftp)
add_subdirectory(kxutil)
add_subdirectory(kxcap)
add_subdirectory(kxvnc)
add_subdirectory(client)
add_subdirectory(server)

90 changes: 90 additions & 0 deletions client/CMakeLists.txt
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)

22 changes: 22 additions & 0 deletions client/main.cpp
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();
}
85 changes: 85 additions & 0 deletions client/qkxconnectiondialog.cpp
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);
}
40 changes: 40 additions & 0 deletions client/qkxconnectiondialog.h
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
Loading

0 comments on commit 7da972a

Please sign in to comment.