Commit 507602cb authored by David Edmundson's avatar David Edmundson Committed by Vlad Zahorodnii
Browse files

Import local copy of qtwaylandscanner

This is a copy of the code from Qt5.15 with some backported patches from
development branch of Qt.

One of the upcoming fixes introduces new API, which is why we can't rely
on distro packaging.

The cmake macro is mostly copied from ECM, but set to rebuild generated
code when the scanner changes.
parent 134426df
Pipeline #48661 passed with stage
in 6 minutes and 53 seconds
add_subdirectory(tools)
add_subdirectory(server)
ecm_qt_install_logging_categories(
......
......@@ -75,7 +75,7 @@ ecm_qt_declare_logging_category(SERVER_LIB_SRCS
EXPORT KWAYLAND
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${Wayland_DATADIR}/wayland.xml
BASENAME wayland
)
......@@ -90,17 +90,17 @@ ecm_add_wayland_server_protocol(SERVER_LIB_SRCS
BASENAME org_kde_kwin_outputdevice
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/plasma-shell.xml
BASENAME plasma-shell
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/plasma-virtual-desktop.xml
BASENAME org-kde-plasma-virtual-desktop
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/plasma-window-management.xml
BASENAME plasma-window-management
)
......@@ -110,116 +110,116 @@ ecm_add_wayland_server_protocol(SERVER_LIB_SRCS
BASENAME qt-surface-extension
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/idle.xml
BASENAME idle
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/fake-input.xml
BASENAME fake-input
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/shadow.xml
BASENAME shadow
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/dpms.xml
BASENAME dpms
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/blur.xml
BASENAME blur
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/contrast.xml
BASENAME contrast
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml
BASENAME relative-pointer-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/slide.xml
BASENAME slide
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/server-decoration.xml
BASENAME server-decoration
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml
BASENAME text-input-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/text-input-unstable-v2.xml
BASENAME text-input-unstable-v2
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml
BASENAME text-input-unstable-v3
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml
BASENAME pointer-gestures-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
BASENAME pointer-constraints-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml
BASENAME xdg-foreign-unstable-v2
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml
BASENAME idle-inhibit-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/appmenu.xml
BASENAME appmenu
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/server-decoration-palette.xml
BASENAME server-decoration-palette
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-output/xdg-output-unstable-v1.xml
BASENAME xdg-output-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml
BASENAME xdg-shell
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
BASENAME xdg-decoration-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/wayland-eglstream-controller.xml
BASENAME wl-eglstream-controller
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/keystate.xml
BASENAME keystate
)
......@@ -229,42 +229,42 @@ ecm_add_wayland_server_protocol(SERVER_LIB_SRCS
BASENAME linux-dmabuf-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml
BASENAME tablet-unstable-v2
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PROJECT_SOURCE_DIR}/src/protocols/wlr-data-control-unstable-v1.xml
BASENAME wlr-data-control-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${PROJECT_SOURCE_DIR}/src/protocols/wlr-layer-shell-unstable-v1.xml
BASENAME wlr-layer-shell-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml
BASENAME keyboard-shortcuts-inhibit-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml
BASENAME viewporter
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/primary-selection/primary-selection-unstable-v1.xml
BASENAME wp-primary-selection-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/screencast.xml
BASENAME zkde-screencast-unstable-v1
)
ecm_add_qtwayland_server_protocol(SERVER_LIB_SRCS
ecm_add_qtwayland_server_protocol_kde(SERVER_LIB_SRCS
PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml
BASENAME input-method-unstable-v1
)
......
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
add_executable(qtwaylandscanner_kde qtwaylandscanner.cpp)
target_link_libraries(qtwaylandscanner_kde Qt5::Core)
function(ecm_add_qtwayland_server_protocol_kde out_var)
# Parse arguments
set(oneValueArgs PROTOCOL BASENAME PREFIX)
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_add_qtwayland_server_protocol_kde(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
set(_prefix "${ARGS_PREFIX}")
find_package(WaylandScanner REQUIRED QUIET)
ecm_add_wayland_server_protocol(${out_var}
PROTOCOL ${ARGS_PROTOCOL}
BASENAME ${ARGS_BASENAME})
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
set(_header "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.h")
set(_code "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.cpp")
set_source_files_properties(${_header} ${_code} GENERATED)
add_custom_command(OUTPUT "${_header}"
COMMAND qtwaylandscanner_kde server-header ${_infile} "" ${_prefix} > ${_header}
DEPENDS ${_infile} qtwaylandscanner_kde VERBATIM)
add_custom_command(OUTPUT "${_code}"
COMMAND qtwaylandscanner_kde server-code ${_infile} "" ${_prefix} > ${_code}
DEPENDS ${_infile} ${_header} qtwaylandscanner_kde VERBATIM)
set_property(SOURCE ${_header} ${_code} PROPERTY SKIP_AUTOMOC ON)
list(APPEND ${out_var} "${_code}")
set(${out_var} ${${out_var}} PARENT_SCOPE)
endfunction()
QtWayland scanner;s home is inside QtWayland in Qt (https://code.qt.io/cgit/qt/qtwayland.git/tree/src/qtwaylandscanner)
We have a temporary fork to deliver some crucial fixes that are affecting our code that is not released in Qt5.15, including an API change which can't be relied upon via patching.
Patches should still go via upstream to Qt and be "cherry-picked" here.
This folder should be dropped in Plasma 6
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment