diff --git a/CMakeLists.txt b/CMakeLists.txt index c14914af..0ee2d670 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,8 @@ project(deepin-camera VERSION 1.0.0) add_subdirectory(src) -if (CMAKE_BUILD_TYPE STREQUAL "Debug") - add_subdirectory(tests) -endif() +#if (CMAKE_BUILD_TYPE STREQUAL "Debug") +# add_subdirectory(tests) +#endif() diff --git a/debian/control b/debian/control index ba07a007..9b77f9cc 100644 --- a/debian/control +++ b/debian/control @@ -10,8 +10,6 @@ Build-Depends: libv4l-dev,libsdl2-dev,portaudio19-dev,libpng-dev,libasound2-dev,libpciaccess-dev, libusb-1.0-0-dev,zlib1g-dev,libudev-dev,libswscale-dev,libswresample-dev,libffmpegthumbnailer-dev, libx11-dev,libva-dev,libimageeditor-dev, - libdwayland-dev | libkf5wayland-dev, - libwayland-dev, libgstreamer1.0-dev,libgstreamer-plugins-base1.0-dev,gstreamer1.0-plugins-good Standards-Version: 4.1.2 Homepage: http://www.deepin.org @@ -24,8 +22,7 @@ Depends: libavcodec58 (>= 7:4.0) | libavcodec60, libavformat58 (>= 7:4.1) | libavformat60, libavutil56 (>= 7:4.0) | libavutil58, libswresample3 (>= 7:4.0) | libswresample4, libswscale5 (>= 7:4.0) | libswscale7, libdtkcore5, libdtkgui5, libdtkwidget5, libffmpegthumbnailer4v5, libgl1, libpng16-16 (>= 1.6.2-1), libportaudio2 (>= 19+svn20101113), libqt5concurrent5 (>= 5.0.2), libqt5core5a (>= 5.11.0~rc1), libqt5dbus5 (>= 5.0.2), libqt5gui5 (>= 5.8.0), libqt5network5 (>= 5.0.2), libqt5printsupport5 (>= 5.0.2), libqt5widgets5 (>= 5.2.0~alpha1), libqt5x11extras5 (>= 5.6.0), libasound2 (>= 1.0.16), - libqt5xml5 (>= 5.0.2), libsdl2-2.0-0 (>= 2.0.9), libstdc++6 (>= 7), libudev1 (>= 183), libusb-1.0-0 (>= 2:1.0.8), libv4l-0 (>= 0.5.0), zlib1g (>= 1:1.1.4), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0), dde-api, - libdwaylandclient5 | libkf5waylandclient5, libdwaylandserver5 | libkf5waylandserver5 + libqt5xml5 (>= 5.0.2), libsdl2-2.0-0 (>= 2.0.9), libstdc++6 (>= 7), libudev1 (>= 183), libusb-1.0-0 (>= 2:1.0.8), libv4l-0 (>= 0.5.0), zlib1g (>= 1:1.1.4), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0), dde-api Recommends: libimageeditor, uos-reporter, deepin-event-log Description:this package software for UOS deepin-camera is a tool to view camera, and also a smart take photo and video in life. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f2c7c24b..fa7dba51 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,15 +11,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) project(deepin-camera VERSION 1.0.0) set(CMD_NAME deepin-camera) set(TARGET_NAME deepin-camera) -find_package(DWayland) -find_package(KF5Wayland) -if (NOT DWayland_FOUND) - if (${KF5Wayland_VERSION} VERSION_GREATER 5.54.1) - option(USE_DEEPIN_WAYLAND "option for wayland support" ON) - endif() -else() - option(USE_DEEPIN_WAYLAND "option for wayland support" ON) -endif() + #option (__mips__ "Use UNITTEST" ON) # cube文件目录,libvisualresult在打包时,会自动将cube文件安装到share目录下 @@ -45,12 +37,6 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr) endif () -if (USE_DEEPIN_WAYLAND) - if(!USE_DEEPIN_V25) - add_definitions("-DUSE_DEEPIN_WAYLAND") - endif() -endif() - if(DEFINED LINGLONG_BUILD_ON) # 玲珑构建编译开关 add_definitions(-DLINGLONG_BUILD) @@ -100,15 +86,7 @@ find_package(Qt5 REQUIRED ${QtModule}) find_package(PkgConfig REQUIRED) include(FindPkgConfig) -if (USE_DEEPIN_WAYLAND) - if (DWayland_FOUND) - message("DWayland founded.") - add_definitions(-DDWAYLAND) - elseif(KF5Wayland_FOUND) - message("KF5Wayland founded.") - add_definitions(-DKF5WAYLAND) - endif() -endif() + file (GLOB_RECURSE CXXSOURCES ./src/*.cpp @@ -171,14 +149,6 @@ endif () # 设置不删除生成的文件夹内容文件 set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1) -if (USE_DEEPIN_WAYLAND) - if (DWayland_FOUND) - set(LIBS DWaylandClient DWaylandServer) - else() - message("KF5 environment") - set(LIBS KF5::WaylandClient KF5::WaylandServer) - endif() -endif() add_executable( ${TARGET_NAME} ${CXXSOURCES} ${CSOURCES} ${RESOURCES} ${QM} ) diff --git a/src/src/windowstatethread.cpp b/src/src/windowstatethread.cpp index 83d12670..6c360132 100644 --- a/src/src/windowstatethread.cpp +++ b/src/src/windowstatethread.cpp @@ -13,37 +13,11 @@ windowStateThread::windowStateThread(bool isWayland, QObject *parent /*= nullptr : QThread (parent) { setObjectName("windowStateThread"); -#ifdef USE_DEEPIN_WAYLAND - if (isWayland) { - qInfo() << __FUNCTION__ << __LINE__ << "KF5_WAYLAND_FLAGE_ON is open!!"; - //wayland自动识别窗口 - m_connectionThread = new QThread(this); - m_connectionThreadObject = new ConnectionThread(); - connect(m_connectionThreadObject, &ConnectionThread::connected, this, - [this] { - m_eventQueue = new EventQueue(this); - m_eventQueue->setup(m_connectionThreadObject); - - Registry *registry = new Registry(this); - setupRegistry(registry); - }, - Qt::QueuedConnection - ); - m_connectionThreadObject->moveToThread(m_connectionThread); - m_connectionThread->start(); - m_connectionThreadObject->initConnection(); - } -#endif } windowStateThread::~windowStateThread() { -#ifdef USE_DEEPIN_WAYLAND - if (m_connectionThread != nullptr) { - m_connectionThread->terminate(); - m_connectionThread->wait(); - } -#endif + } void windowStateThread::run() @@ -55,7 +29,8 @@ void windowStateThread::run() foreach(DForeignWindow *window, list) { if (window && window->windowState() == Qt::WindowState::WindowFullScreen) { - emit someWindowFullScreen(); + //去掉全屏的窗口信号处理 + //emit someWindowFullScreen(); } } //线程休眠1秒 @@ -101,67 +76,4 @@ QList windowStateThread::workspaceWindows() const return windowList; } -#ifdef USE_DEEPIN_WAYLAND -void windowStateThread::setupRegistry(Registry *registry) -{ - connect(registry, &Registry::compositorAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_compositor = registry->createCompositor(name, version, this); - } - ); - - connect(registry, &Registry::clientManagementAnnounced, this, - [this, registry](quint32 name, quint32 version) { - m_clientManagement = registry->createClientManagement(name, version, this); - connect(m_clientManagement, &ClientManagement::windowStatesChanged, this, - [this] { - m_windowStates = m_clientManagement->getWindowStates(); - this->waylandwindowinfo(m_windowStates); - } - ); - } - ); - - connect(registry, &Registry::interfacesAnnounced, this, - [this] { - Q_ASSERT(m_compositor); - Q_ASSERT(m_clientManagement); - m_windowStates = m_clientManagement->getWindowStates(); - this->waylandwindowinfo(m_windowStates); - } - ); - - registry->setEventQueue(m_eventQueue); - registry->create(m_connectionThreadObject); - registry->setup(); -} - -void windowStateThread::waylandwindowinfo(const QVector &windowStates) -{ - if (windowStates.count() == 0) { - return; - } - - bool aheandInCamera = false; - QRect rect; - for (int i = 0; i < windowStates.count(); ++i) { - if (QString(windowStates[i].resourceName) != "deepin-camera") { - if (!aheandInCamera) - continue; - else { - if (windowStates[i].isFullScreen) { - QRect fullscreenRect(windowStates[i].geometry.x, windowStates[i].geometry.y, - windowStates[i].geometry.width, windowStates[i].geometry.height); - if (fullscreenRect.contains(rect)) - emit someWindowFullScreen(); - } - } - } else { - aheandInCamera = true; - rect = QRect(windowStates[i].geometry.x, windowStates[i].geometry.y, - windowStates[i].geometry.width, windowStates[i].geometry.height); - } - } -} -#endif diff --git a/src/src/windowstatethread.h b/src/src/windowstatethread.h index bef73992..be0c97c2 100644 --- a/src/src/windowstatethread.h +++ b/src/src/windowstatethread.h @@ -13,21 +13,6 @@ #include #include -#ifdef USE_DEEPIN_WAYLAND -#ifdef DWAYLAND -#include -#include -#include -#include -#else -#include -#include -#include -#include -#endif - -using namespace KWayland::Client; -#endif // USE_DEEPIN_WAYLAND DGUI_USE_NAMESPACE @@ -44,37 +29,6 @@ class windowStateThread : public QThread signals: void someWindowFullScreen(); -private: -#ifdef USE_DEEPIN_WAYLAND - /** - * @brief wayland获取屏幕窗口信息的安装注册函数 - * @param registry - */ - void setupRegistry(Registry *registry); - - /** - * @brief wayland获取屏幕窗口信息 - * @param m_windowStates - */ - void waylandwindowinfo(const QVector &m_windowStates); -#endif - -private: -#ifdef USE_DEEPIN_WAYLAND - // 获取wayland窗口信息相关。 wayland获取窗口的方法对于x11有很大的区别 - QThread *m_connectionThread = nullptr; - EventQueue *m_eventQueue = nullptr; - ConnectionThread *m_connectionThreadObject; - Compositor *m_compositor = nullptr; - PlasmaWindowManagement *m_windowManagement = nullptr; - ClientManagement *m_clientManagement = nullptr; - QVector m_windowStates; - /** - * @brief mips平台创建缓存文件的路径 - */ - std::string m_tempPath; -#endif - }; #endif // WINDOWSTATETHREAD_H