-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synchronize source files from linuxdeepin/dtkgui. Source-pull-request: linuxdeepin/dtkgui#262
- Loading branch information
1 parent
f267726
commit 7ef9e99
Showing
5 changed files
with
101 additions
and
3 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,54 @@ | ||
# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
cmake_minimum_required(VERSION 3.16) | ||
|
||
project(wayland_test) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
set(AUTOMOC_COMPILER_PREDEFINES ON) | ||
|
||
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui WaylandClient) | ||
if(${QT_VERSION_MAJOR} STREQUAL "5") | ||
find_package(Qt5 REQUIRED COMPONENTS XkbCommonSupport) | ||
endif() | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(WAYLAND_CLIENT REQUIRED wayland-client) | ||
|
||
find_package(TreeLandProtocols) | ||
set(TreeLandProtocols_FOUND ${TreeLandProtocols_FOUND}) | ||
|
||
add_executable(${PROJECT_NAME} main.cpp) | ||
|
||
if("${QT_VERSION_MAJOR}" STREQUAL "6") | ||
qt6_generate_wayland_protocol_client_sources(${PROJECT_NAME} FILES | ||
${TREELAND_PROTOCOLS_DATA_DIR}/treeland-personalization-manager-v1.xml | ||
) | ||
else() | ||
# ECM setup | ||
include(FeatureSummary) | ||
find_package(ECM REQUIRED NO_MODULE) | ||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${ECM_MODULE_PATH}") | ||
find_package(QtWaylandScanner) | ||
ecm_add_qtwayland_client_protocol(TABLET_SRCS | ||
PROTOCOL ${TREELAND_PROTOCOLS_DATA_DIR}/treeland-personalization-manager-v1.xml | ||
BASENAME treeland-personalization-manager-v1 | ||
) | ||
target_sources(${PROJECT_NAME} PRIVATE ${TABLET_SRCS}) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
Qt${QT_VERSION_MAJOR}::XkbCommonSupportPrivate | ||
) | ||
endif() | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
Qt${QT_VERSION_MAJOR}::Gui | ||
Qt${QT_VERSION_MAJOR}::GuiPrivate | ||
Qt${QT_VERSION_MAJOR}::CorePrivate | ||
Qt${QT_VERSION_MAJOR}::WaylandClientPrivate | ||
${WAYLAND_CLIENT_LIBRARIES} | ||
) |
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,36 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
#include <QGuiApplication> | ||
|
||
#include <QtWaylandClient/QWaylandClientExtension> | ||
#include <QtWaylandClient/private/qwaylandsurface_p.h> | ||
#include <QtWaylandClient/private/qwaylandwindow_p.h> | ||
|
||
#include <wayland-client-core.h> | ||
#include "qwayland-treeland-personalization-manager-v1.h" | ||
#include <qwaylandclientextension.h> | ||
|
||
#include <private/qguiapplication_p.h> | ||
#include <private/qwaylandintegration_p.h> | ||
#include <private/qwaylandwindow_p.h> | ||
#include <private/qwaylanddisplay_p.h> | ||
|
||
class PersonalizationWindowContext : public QWaylandClientExtensionTemplate<PersonalizationWindowContext>, | ||
public QtWayland::treeland_personalization_window_context_v1 | ||
{ | ||
public: | ||
PersonalizationWindowContext(struct ::treeland_personalization_window_context_v1 *context) | ||
: QWaylandClientExtensionTemplate<PersonalizationWindowContext>(1) | ||
, QtWayland::treeland_personalization_window_context_v1(context) | ||
{ | ||
set_titlebar(enable_mode::enable_mode_disable); | ||
} | ||
}; | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QGuiApplication app(argc, argv); | ||
return 0; | ||
} |
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