mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-14 11:04:20 -04:00
Compare commits
7 Commits
work/qdoc-
...
v6.1.5
Author | SHA1 | Date | |
---|---|---|---|
9ace3c834d | |||
2851951f97 | |||
5a6d22d792 | |||
cac5b2eebb | |||
21fd8ca8af | |||
da9fe6c72e | |||
f1a7f99a4a |
@ -4,13 +4,13 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(layershellqt)
|
project(layershellqt)
|
||||||
set(PROJECT_VERSION "6.1.90")
|
set(PROJECT_VERSION "6.1.5")
|
||||||
set(PROJECT_VERSION_MAJOR 6)
|
set(PROJECT_VERSION_MAJOR 6)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
set(QT_MIN_VERSION "6.7.0")
|
set(QT_MIN_VERSION "6.6.0")
|
||||||
set(KF6_MIN_VERSION "6.5.0")
|
set(KF6_MIN_VERSION "6.2.0")
|
||||||
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
|
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
@ -32,7 +32,6 @@ include(KDEClangFormat)
|
|||||||
include(ECMQtDeclareLoggingCategory)
|
include(ECMQtDeclareLoggingCategory)
|
||||||
include(ECMQmlModule)
|
include(ECMQmlModule)
|
||||||
include(KDEGitCommitHooks)
|
include(KDEGitCommitHooks)
|
||||||
include(ECMGenerateQDoc)
|
|
||||||
|
|
||||||
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
|
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
|
||||||
find_package(WaylandScanner REQUIRED)
|
find_package(WaylandScanner REQUIRED)
|
||||||
|
@ -4,16 +4,10 @@
|
|||||||
remove_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
|
remove_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
|
||||||
|
|
||||||
add_library(LayerShellQtInterface)
|
add_library(LayerShellQtInterface)
|
||||||
|
qt6_generate_wayland_protocol_client_sources(LayerShellQtInterface FILES
|
||||||
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.8.0")
|
${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml
|
||||||
set(private_code_option "PRIVATE_CODE")
|
${WaylandProtocols_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/wlr-layer-shell-unstable-v1.xml
|
||||||
qt6_generate_wayland_protocol_client_sources(LayerShellQtInterface
|
|
||||||
${private_code_option}
|
|
||||||
FILES
|
|
||||||
${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml
|
|
||||||
${WaylandProtocols_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/wlr-layer-shell-unstable-v1.xml
|
|
||||||
)
|
)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(LayerShellQtInterface
|
ecm_qt_declare_logging_category(LayerShellQtInterface
|
||||||
@ -68,8 +62,6 @@ generate_export_header(LayerShellQtInterface
|
|||||||
EXPORT_FILE_NAME LayerShellQt/layershellqt_export.h
|
EXPORT_FILE_NAME LayerShellQt/layershellqt_export.h
|
||||||
)
|
)
|
||||||
|
|
||||||
ecm_generate_qdoc(LayerShellQtInterface layershellqt.qdocconf)
|
|
||||||
|
|
||||||
install(TARGETS layer-shell
|
install(TARGETS layer-shell
|
||||||
LIBRARY DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/wayland-shell-integration)
|
LIBRARY DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/wayland-shell-integration)
|
||||||
|
|
||||||
|
@ -13,18 +13,12 @@
|
|||||||
|
|
||||||
namespace LayerShellQt
|
namespace LayerShellQt
|
||||||
{
|
{
|
||||||
/*!
|
/**
|
||||||
* \class LayerShellQt::Shell
|
* Sets the right environment so the shells created from now on use wlr-layer-shell.
|
||||||
* \inmodule LayerShellQt
|
|
||||||
* \inheaderfile LayerShellQt/Shell
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class LAYERSHELLQT_EXPORT Shell
|
class LAYERSHELLQT_EXPORT Shell
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*!
|
|
||||||
* Sets the right environment so the shells created from now on use wlr-layer-shell.
|
|
||||||
*/
|
|
||||||
static void useLayerShell();
|
static void useLayerShell();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,18 +18,10 @@ namespace LayerShellQt
|
|||||||
{
|
{
|
||||||
class WindowPrivate;
|
class WindowPrivate;
|
||||||
|
|
||||||
/*!
|
|
||||||
* \class LayerShellQt::Window
|
|
||||||
* \inmodule LayerShellQt
|
|
||||||
* \inheaderfile LayerShellQt/Window
|
|
||||||
*
|
|
||||||
* \brief A window.
|
|
||||||
*/
|
|
||||||
class LAYERSHELLQT_EXPORT Window : public QObject
|
class LAYERSHELLQT_EXPORT Window : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged)
|
Q_PROPERTY(Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged)
|
||||||
/*! \property LayerShellQt::Window::scope */
|
|
||||||
Q_PROPERTY(QString scope READ scope WRITE setScope)
|
Q_PROPERTY(QString scope READ scope WRITE setScope)
|
||||||
Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged)
|
Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged)
|
||||||
Q_PROPERTY(qint32 exclusionZone READ exclusionZone WRITE setExclusiveZone NOTIFY exclusionZoneChanged)
|
Q_PROPERTY(qint32 exclusionZone READ exclusionZone WRITE setExclusiveZone NOTIFY exclusionZoneChanged)
|
||||||
@ -40,24 +32,17 @@ class LAYERSHELLQT_EXPORT Window : public QObject
|
|||||||
public:
|
public:
|
||||||
~Window() override;
|
~Window() override;
|
||||||
|
|
||||||
/*!
|
|
||||||
* \value AnchorNone
|
|
||||||
* \value AnchorTop The top edge of the anchor rectangle
|
|
||||||
* \value AnchorBottom The bottom edge of the anchor rectangle
|
|
||||||
* \value AnchorLeft The left edge of the anchor rectangle
|
|
||||||
* \value AnchorRight The right edge of the anchor rectangle
|
|
||||||
*/
|
|
||||||
enum Anchor {
|
enum Anchor {
|
||||||
AnchorNone = 0,
|
AnchorNone = 0,
|
||||||
AnchorTop = 1,
|
AnchorTop = 1, ///< The top edge of the anchor rectangle
|
||||||
AnchorBottom = 2,
|
AnchorBottom = 2, ///< The bottom edge of the anchor rectangle
|
||||||
AnchorLeft = 4,
|
AnchorLeft = 4, ///< The left edge of the anchor rectangle
|
||||||
AnchorRight = 8,
|
AnchorRight = 8, ///< The right edge of the anchor rectangle
|
||||||
};
|
};
|
||||||
Q_ENUM(Anchor);
|
Q_ENUM(Anchor);
|
||||||
Q_DECLARE_FLAGS(Anchors, Anchor)
|
Q_DECLARE_FLAGS(Anchors, Anchor)
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* This enum type is used to specify the layer where a surface can be put in.
|
* This enum type is used to specify the layer where a surface can be put in.
|
||||||
*/
|
*/
|
||||||
enum Layer {
|
enum Layer {
|
||||||
@ -68,7 +53,7 @@ public:
|
|||||||
};
|
};
|
||||||
Q_ENUM(Layer)
|
Q_ENUM(Layer)
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* This enum type is used to specify how the layer surface handles keyboard focus.
|
* This enum type is used to specify how the layer surface handles keyboard focus.
|
||||||
*/
|
*/
|
||||||
enum KeyboardInteractivity {
|
enum KeyboardInteractivity {
|
||||||
@ -78,7 +63,7 @@ public:
|
|||||||
};
|
};
|
||||||
Q_ENUM(KeyboardInteractivity)
|
Q_ENUM(KeyboardInteractivity)
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* This enum type is used to specify which screen to place the surface on.
|
* This enum type is used to specify which screen to place the surface on.
|
||||||
* ScreenFromQWindow (the default) reads QWindow::screen() while ScreenFromCompositor
|
* ScreenFromQWindow (the default) reads QWindow::screen() while ScreenFromCompositor
|
||||||
* passes nil and lets the compositor decide.
|
* passes nil and lets the compositor decide.
|
||||||
@ -110,7 +95,7 @@ public:
|
|||||||
void setScreenConfiguration(ScreenConfiguration screenConfiguration);
|
void setScreenConfiguration(ScreenConfiguration screenConfiguration);
|
||||||
ScreenConfiguration screenConfiguration() const;
|
ScreenConfiguration screenConfiguration() const;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* Sets a string based identifier for this window.
|
* Sets a string based identifier for this window.
|
||||||
* This may be used by a compositor to determine stacking
|
* This may be used by a compositor to determine stacking
|
||||||
* order within a given layer.
|
* order within a given layer.
|
||||||
@ -118,17 +103,9 @@ public:
|
|||||||
* May also be referred to as a role
|
* May also be referred to as a role
|
||||||
*/
|
*/
|
||||||
void setScope(const QString &scope);
|
void setScope(const QString &scope);
|
||||||
|
|
||||||
/*!
|
|
||||||
* A string based identifier for this window.
|
|
||||||
* This may be used by a compositor to determine stacking
|
|
||||||
* order within a given layer.
|
|
||||||
*
|
|
||||||
* May also be referred to as a role
|
|
||||||
*/
|
|
||||||
QString scope() const;
|
QString scope() const;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* Whether the QWindow should be closed when the layer surface is dismissed by the compositor.
|
* Whether the QWindow should be closed when the layer surface is dismissed by the compositor.
|
||||||
* For example, if the associated screen has been removed.
|
* For example, if the associated screen has been removed.
|
||||||
*
|
*
|
||||||
@ -137,7 +114,7 @@ public:
|
|||||||
void setCloseOnDismissed(bool close);
|
void setCloseOnDismissed(bool close);
|
||||||
bool closeOnDismissed() const;
|
bool closeOnDismissed() const;
|
||||||
|
|
||||||
/*!
|
/**
|
||||||
* Gets the LayerShell Window for a given Qt Window
|
* Gets the LayerShell Window for a given Qt Window
|
||||||
* Ownership is not transferred
|
* Ownership is not transferred
|
||||||
*/
|
*/
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
/*!
|
|
||||||
\module LayerShellQt
|
|
||||||
\title LayerShellQt C++ Classes
|
|
||||||
|
|
||||||
\cmakepackage LayerShellQt
|
|
||||||
\cmaketargetitem LayerShellQt::Interface
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\namespace LayerShellQt
|
|
||||||
\inmodule LayerShellQt
|
|
||||||
|
|
||||||
Stuff
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\qmlmodule org.kde.layershell
|
|
||||||
\title LayerShellQt QML Types
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\qmltype Window
|
|
||||||
\inqmlmodule org.kde.layershell
|
|
||||||
|
|
||||||
\nativetype LayerShellQt::Window
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\qmlproperty string Window::scope
|
|
||||||
|
|
||||||
A scope.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\qmlproperty int Window::margins.top
|
|
||||||
\qmlproperty int Window::margins.bottom
|
|
||||||
\qmlproperty int Window::margins.left
|
|
||||||
\qmlproperty int Window::margins.right
|
|
||||||
|
|
||||||
Margins
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\qmlproperty int Window::exclusionZone
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\page layershellqt-index.html
|
|
||||||
\title LayerShellQt
|
|
||||||
|
|
||||||
Layer Shell
|
|
||||||
|
|
||||||
\section1 Using the Module
|
|
||||||
|
|
||||||
\include {module-use.qdocinc} {using the c++ api}
|
|
||||||
|
|
||||||
\section2 Building with CMake
|
|
||||||
|
|
||||||
\include {module-use.qdocinc} {building with cmake} {Widgets}
|
|
||||||
|
|
||||||
\section1 API Reference
|
|
||||||
|
|
||||||
\list
|
|
||||||
\li \l{LayerShellQt C++ Classes}
|
|
||||||
\li \l{LayerShellQt QML Types}
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
\section1 Licenses
|
|
||||||
|
|
||||||
TODO
|
|
||||||
*/
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
include($KDE_DOCS/global/qt-module-defaults.qdocconf)
|
|
||||||
|
|
||||||
project = LayerShellQt
|
|
||||||
description = Qt component to allow applications to make use of the Wayland wl-layer-shell protocol
|
|
||||||
|
|
||||||
documentationinheaders = true
|
|
||||||
|
|
||||||
headerdirs = .
|
|
||||||
|
|
||||||
headers.fileextensions = "*.qdoc *.h"
|
|
||||||
|
|
||||||
outputdir = doc/html
|
|
||||||
outputformats = HTML
|
|
||||||
|
|
||||||
depends += \
|
|
||||||
qtcore
|
|
||||||
|
|
||||||
qhp.projects = LayerShellQt
|
|
||||||
|
|
||||||
qhp.LayerShellQt.file = layershellqt.qhp
|
|
||||||
qhp.LayerShellQt.namespace = org.kde.layershellqt.$QT_VERSION_TAG
|
|
||||||
qhp.LayerShellQt.virtualFolder = layershellqt
|
|
||||||
qhp.LayerShellQt.indexTitle = LayerShellQt
|
|
||||||
qhp.LayerShellQt.indexRoot =
|
|
||||||
|
|
||||||
qhp.LayerShellQt.subprojects = classes
|
|
||||||
qhp.LayerShellQt.subprojects.classes.title = C++ Classes
|
|
||||||
qhp.LayerShellQt.subprojects.classes.indexTitle = LayerShellQt C++ Classes
|
|
||||||
qhp.LayerShellQt.subprojects.classes.selectors = class fake:headerfile
|
|
||||||
qhp.LayerShellQt.subprojects.classes.sortPages = true
|
|
@ -110,13 +110,9 @@ void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *po
|
|||||||
|
|
||||||
void QWaylandLayerSurface::applyConfigure()
|
void QWaylandLayerSurface::applyConfigure()
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
m_configuring = true;
|
m_configuring = true;
|
||||||
#endif
|
|
||||||
window()->resizeFromApplyConfigure(m_pendingSize);
|
window()->resizeFromApplyConfigure(m_pendingSize);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
m_configuring = false;
|
m_configuring = false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandLayerSurface::setDesiredSize(const QSize &size)
|
void QWaylandLayerSurface::setDesiredSize(const QSize &size)
|
||||||
@ -167,7 +163,6 @@ void QWaylandLayerSurface::setLayer(uint32_t layer)
|
|||||||
set_layer(layer);
|
set_layer(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
|
void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
|
||||||
{
|
{
|
||||||
if (m_configuring) {
|
if (m_configuring) {
|
||||||
@ -176,12 +171,6 @@ void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
|
|||||||
|
|
||||||
setDesiredSize(geometry.size());
|
setDesiredSize(geometry.size());
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
void QWaylandLayerSurface::setWindowSize(const QSize &size)
|
|
||||||
{
|
|
||||||
setDesiredSize(size);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool QWaylandLayerSurface::requestActivate()
|
bool QWaylandLayerSurface::requestActivate()
|
||||||
{
|
{
|
||||||
@ -231,10 +220,8 @@ void QWaylandLayerSurface::sendExpose()
|
|||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||||
window()->handleExpose(QRect(QPoint(), m_pendingSize));
|
window()->handleExpose(QRect(QPoint(), m_pendingSize));
|
||||||
#elif QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
window()->sendRecursiveExposeEvent();
|
|
||||||
#else
|
#else
|
||||||
window()->updateExposure();
|
window()->sendRecursiveExposeEvent();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,11 +43,7 @@ public:
|
|||||||
void setLayer(uint32_t layer);
|
void setLayer(uint32_t layer);
|
||||||
|
|
||||||
void applyConfigure() override;
|
void applyConfigure() override;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
void setWindowGeometry(const QRect &geometry) override;
|
void setWindowGeometry(const QRect &geometry) override;
|
||||||
#else
|
|
||||||
void setWindowSize(const QSize &size) override;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool requestActivate() override;
|
bool requestActivate() override;
|
||||||
void setXdgActivationToken(const QString &token) override;
|
void setXdgActivationToken(const QString &token) override;
|
||||||
@ -65,9 +61,7 @@ private:
|
|||||||
QString m_activationToken;
|
QString m_activationToken;
|
||||||
|
|
||||||
bool m_configured = false;
|
bool m_configured = false;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
bool m_configuring = false;
|
bool m_configuring = false;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user