QDoc port

This commit is contained in:
Nicolas Fella 2024-09-14 16:01:51 +02:00
parent 2dbd1d6eb7
commit 33b30114a4
6 changed files with 146 additions and 12 deletions

View File

@ -32,6 +32,7 @@ include(KDEClangFormat)
include(ECMQtDeclareLoggingCategory)
include(ECMQmlModule)
include(KDEGitCommitHooks)
include(ECMGenerateQDoc)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
find_package(WaylandScanner REQUIRED)

View File

@ -68,6 +68,8 @@ generate_export_header(LayerShellQtInterface
EXPORT_FILE_NAME LayerShellQt/layershellqt_export.h
)
ecm_generate_qdoc(LayerShellQtInterface layershellqt.qdocconf)
install(TARGETS layer-shell
LIBRARY DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/wayland-shell-integration)

View File

@ -13,12 +13,18 @@
namespace LayerShellQt
{
/**
* Sets the right environment so the shells created from now on use wlr-layer-shell.
/*!
* \class LayerShellQt::Shell
* \inmodule LayerShellQt
* \inheaderfile LayerShellQt/Shell
*
*/
class LAYERSHELLQT_EXPORT Shell
{
public:
/*!
* Sets the right environment so the shells created from now on use wlr-layer-shell.
*/
static void useLayerShell();
};

View File

@ -18,10 +18,18 @@ namespace LayerShellQt
{
class WindowPrivate;
/*!
* \class LayerShellQt::Window
* \inmodule LayerShellQt
* \inheaderfile LayerShellQt/Window
*
* \brief A window.
*/
class LAYERSHELLQT_EXPORT Window : public QObject
{
Q_OBJECT
Q_PROPERTY(Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged)
/*! \property LayerShellQt::Window::scope */
Q_PROPERTY(QString scope READ scope WRITE setScope)
Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged)
Q_PROPERTY(qint32 exclusionZone READ exclusionZone WRITE setExclusiveZone NOTIFY exclusionZoneChanged)
@ -32,17 +40,24 @@ class LAYERSHELLQT_EXPORT Window : public QObject
public:
~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 {
AnchorNone = 0,
AnchorTop = 1, ///< The top edge of the anchor rectangle
AnchorBottom = 2, ///< The bottom edge of the anchor rectangle
AnchorLeft = 4, ///< The left edge of the anchor rectangle
AnchorRight = 8, ///< The right edge of the anchor rectangle
AnchorTop = 1,
AnchorBottom = 2,
AnchorLeft = 4,
AnchorRight = 8,
};
Q_ENUM(Anchor);
Q_DECLARE_FLAGS(Anchors, Anchor)
/**
/*!
* This enum type is used to specify the layer where a surface can be put in.
*/
enum Layer {
@ -53,7 +68,7 @@ public:
};
Q_ENUM(Layer)
/**
/*!
* This enum type is used to specify how the layer surface handles keyboard focus.
*/
enum KeyboardInteractivity {
@ -63,7 +78,7 @@ public:
};
Q_ENUM(KeyboardInteractivity)
/**
/*!
* This enum type is used to specify which screen to place the surface on.
* ScreenFromQWindow (the default) reads QWindow::screen() while ScreenFromCompositor
* passes nil and lets the compositor decide.
@ -95,7 +110,7 @@ public:
void setScreenConfiguration(ScreenConfiguration screenConfiguration);
ScreenConfiguration screenConfiguration() const;
/**
/*!
* Sets a string based identifier for this window.
* This may be used by a compositor to determine stacking
* order within a given layer.
@ -103,9 +118,17 @@ public:
* May also be referred to as a role
*/
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;
/**
/*!
* Whether the QWindow should be closed when the layer surface is dismissed by the compositor.
* For example, if the associated screen has been removed.
*
@ -114,7 +137,7 @@ public:
void setCloseOnDismissed(bool close);
bool closeOnDismissed() const;
/**
/*!
* Gets the LayerShell Window for a given Qt Window
* Ownership is not transferred
*/

72
src/layershellqt.qdoc Normal file
View File

@ -0,0 +1,72 @@
/*!
\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
*/

30
src/layershellqt.qdocconf Normal file
View File

@ -0,0 +1,30 @@
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