diff --git a/src/client/connection_thread.h b/src/client/connection_thread.h index cf7d86b..7c8d33f 100644 --- a/src/client/connection_thread.h +++ b/src/client/connection_thread.h @@ -1,263 +1,263 @@ /******************************************************************** Copyright 2014 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_CONNECTION_THREAD_H #define WAYLAND_CONNECTION_THREAD_H #include #include struct wl_display; namespace KWayland { /** * @short KWayland Client. * * This namespace groups all classes related to the Client module. * * The main entry point into the KWayland::Client API is the ConnectionThread class. * It allows to create a Wayland client connection either in a native way or wrap a * connection created by the QtWayland QPA plugin. * * KWayland::Client provides one the one hand a low-level API to interact with the * Wayland API, on the other hand an easy to use convenience API. Each class directly * relates to a low-level Wayland type and allows direct casting into the type. * * On the convenience side KWayland::Client allows easy creation of objects, signals * emitted for Wayland events and easy conversion from Qt to Wayland types. * * Once one has a ConnectionThread created, it's possible to setup a Registry to * get a listing of all registered globals. For each global the Registry provides a convenience * method to create the resource. * * @see ConnectionThread * @see Registry **/ namespace Client { /** * @short Creates and manages the connection to a Wayland server. * * The purpose of this class is to create the connection to a Wayland server * and to manage it. As the name suggests it's intended to move instances of * this class into a dedicated thread. This also means that this class doesn't * inherit QThread. In order to use it in a threaded way one needs to create a * QThread and move the object there: * * @code * ConnectionThread *connection = new ConnectionThread; * QThread *thread = new QThread; * connection->moveToThread(thread); * thread->start(); * @endcode * * To finalize the initialization of the connection one needs to call @link ::initConnection @endlink. * This starts an asynchronous connection initialization. In case the initialization * succeeds the signal @link ::connected @endlink will be emitted, otherwise @link ::failed @endlink will * be emitted: * * @code * connect(connection, &ConnectionThread::connected, [connection] { * qDebug() << "Successfully connected to Wayland server at socket:" << connection->socketName(); * }); * connect(connection, &ConnectionThread::failed, [connection] { * qDebug() << "Failed to connect to Wayland server at socket:" << connection->socketName(); * }); * connection->initConnection(); * @endcode * * This class is also responsible for dispatching events. Whenever new data is available on * the Wayland socket, it will be dispatched and the signal @link ::eventsRead @endlink is emitted. * This allows further event queues in other threads to also dispatch their events. * * Furthermore this class flushes the Wayland connection whenever the QAbstractEventDispatcher * is about to block. * * To disconnect the connection to the Wayland server one should delete the instance of this * class and quit the dedicated thread: * * @code * connection->deleteLater(); * thread->quit(); * thread->wait(); * @endcode * * In addition the ConnectionThread provides integration with QtWayland QPA plugin. For that * it provides a static factory method: * * @code * auto connection = ConnectionThread::fromApplication(); * @endcode * * The semantics of the ConnectionThread are slightly changed if it's integrated with QtWayland. * The ConnectionThread does not hold the connection, does not emit connected or released signals * (one can safely assume that the connection is valid when integrating with the Qt application), * does not dispatch events. Given that the use case of the ConnectionThread is rather limited to * a convenient API around wl_display to allow easily setup an own Registry in a QtWayland powered * application. Also moving the ConnectionThread to a different thread is not necessarily recommended * in that case as QtWayland holds it's connection in an own thread anyway. * **/ class KWAYLANDCLIENT_EXPORT ConnectionThread : public QObject { Q_OBJECT public: explicit ConnectionThread(QObject *parent = nullptr); virtual ~ConnectionThread(); /** * Creates a ConnectionThread for the used QGuiApplication. * This is an integration feature for QtWayland. On non-wayland platforms this method returns * @c nullptr. * * The returned ConnectionThread will be fully setup, which means it manages a wl_display. * There is no need to initConnection and the connected or failed signals won't be emitted. * When the created ConnectionThread gets destroyed the managed wl_display won't be disconnected * as that's managed by Qt. * * The returned ConnectionThread is not able to detect (protocol) error. The signal - * @link{errorOccurred} won't be emitted, @link{hasError} will return @c false, even if the + * {@link errorOccurred} won't be emitted, {@link hasError} will return @c false, even if the * actual connection held by QtWayland is on error. The behavior of QtWayland is to exit the * application on error. * * @since 5.4 **/ static ConnectionThread *fromApplication(QObject *parent = nullptr); /** * The display this ConnectionThread is connected to. * As long as there is no connection this method returns @c null. * @see initConnection **/ wl_display *display(); /** * @returns the name of the socket it connects to. **/ QString socketName() const; /** * Sets the @p socketName to connect to. * Only applies if called before calling initConnection. * The default socket name is derived from environment variable WAYLAND_DISPLAY * and if not set is hard coded to "wayland-0". * * The socket name will be ignored if a file descriptor has been set through @link setSocketFd @endlink. * * @see setSocketFd **/ void setSocketName(const QString &socketName); /** * Sets the socket @p fd to connect to. * Only applies if called before calling initConnection. * If this method is invoked, the connection will be created on the file descriptor * and not on the socket name passed through @link setSocketName @endlink or through the * default environment variable WAYLAND_DISPLAY. * @see setSocketName **/ void setSocketFd(int fd); /** * Trigger a blocking roundtrip to the Wayland server. Ensures that all events are processed * before returning to the event loop. * * @since 5.4 **/ void roundtrip(); /** * @returns whether the Wayland connection experienced an error * @see errorCode * @see errorOccurred * @since 5.23 **/ bool hasError() const; /** * @returns the error code of the last occurred error or @c 0 if the connection doesn't have an error * @see hasError * @see errorOccurred * @since 5.23 **/ int errorCode() const; public Q_SLOTS: /** * Initializes the connection in an asynchronous way. * In case the connection gets established the signal @link ::connected @endlink will be * emitted, on failure the signal @link ::failed @endlink will be emitted. * * @see connected * @see failed **/ void initConnection(); /** * Explicitly flush the Wayland display. * @since 5.3 **/ void flush(); Q_SIGNALS: /** * Emitted once a connection to a Wayland server is established. * Normally emitted after invoking initConnection(), but might also be * emitted after re-connecting to another server. **/ void connected(); /** * Emitted if connecting to a Wayland server failed. **/ void failed(); /** * Emitted whenever new events are ready to be read. **/ void eventsRead(); /** * Emitted if the Wayland server connection dies. * If the socket reappears, it is tried to reconnect. **/ void connectionDied(); /** * The Wayland connection experienced a fatal error. * The ConnectionThread is no longer valid, no requests may be sent. - * This has the same effects as @link{connectionDied}. + * This has the same effects as {@link connectionDied}. * * @see hasError * @see errorCode * @since 5.23 **/ void errorOccurred(); private Q_SLOTS: /** * @internal **/ void doInitConnection(); private: class Private; QScopedPointer d; }; } } #endif diff --git a/src/client/idle.h b/src/client/idle.h index af07bb1..64baa23 100644 --- a/src/client/idle.h +++ b/src/client/idle.h @@ -1,241 +1,241 @@ /******************************************************************** Copyright 2015 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef KWAYLAND_IDLE_H #define KWAYLAND_IDLE_H #include #include struct org_kde_kwin_idle; struct org_kde_kwin_idle_timeout; namespace KWayland { namespace Client { class EventQueue; class IdleTimeout; class Seat; /** * @short Wrapper for the org_kde_kwin_idle interface. * * With the help of Idle it is possible to get notified when a Seat is not being * used. E.g. a chat application which wants to set the user automatically to away * if the user did not interact with the Seat for 5 minutes can create an IdleTimeout * to get notified when the Seat has been idle for the given amount of time. * * This class provides a convenient wrapper for the org_kde_kwin_idle interface. * * To use this class one needs to interact with the Registry. There are two * possible ways to create the Idle interface: * @code * Idle *m = registry->createIdle(name, version); * @endcode * * This creates the Idle and sets it up directly. As an alternative this * can also be done in a more low level way: * @code * Idle *m = new Idle; * m->setup(registry->bindIdle(name, version)); * @endcode * * The Idle can be used as a drop-in replacement for any org_kde_kwin_idle * pointer as it provides matching cast operators. * * @see Registry **/ class KWAYLANDCLIENT_EXPORT Idle : public QObject { Q_OBJECT public: /** * Creates a new Idle. * Note: after constructing the Idle it is not yet valid and one needs * to call setup. In order to get a ready to use Idle prefer using * Registry::createIdle. **/ explicit Idle(QObject *parent = nullptr); virtual ~Idle(); /** * @returns @c true if managing a org_kde_kwin_idle. **/ bool isValid() const; /** * Setup this Idle to manage the @p manager. * When using Registry::createIdle there is no need to call this * method. **/ void setup(org_kde_kwin_idle *manager); /** * Releases the org_kde_kwin_idle interface. * After the interface has been released the Idle instance is no * longer valid and can be setup with another org_kde_kwin_idle interface. **/ void release(); /** * Destroys the data held by this Idle. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new org_kde_kwin_idle interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, manager, &Idle::destroy); * @endcode * * @see release **/ void destroy(); /** * Sets the @p queue to use for creating a IdleTimeout. **/ void setEventQueue(EventQueue *queue); /** * @returns The event queue to use for creating a IdleTimeout. **/ EventQueue *eventQueue(); /** * Creates a new IdleTimeout for the @p seat. If the @p seat has been idle, * that is none of the connected input devices got used for @p msec, the - * IdleTimeout will emit the @link{IdleTimeout::idle} signal. + * IdleTimeout will emit the {@link IdleTimeout::idle} signal. * * It is not guaranteed that the signal will be emitted exactly at the given * timeout. A Wayland server might for example have a minimum timeout which is * larger than @p msec. * * @param msec The duration in milli seconds after which an idle timeout should fire * @param seat The Seat on which the user acitivity should be monitored. **/ IdleTimeout *getTimeout(quint32 msecs, Seat *seat, QObject *parent = nullptr); operator org_kde_kwin_idle*(); operator org_kde_kwin_idle*() const; Q_SIGNALS: /** * The corresponding global for this interface on the Registry got removed. * * This signal gets only emitted if the Compositor got created by * Registry::createIdle * * @since 5.5 **/ void removed(); private: class Private; QScopedPointer d; }; /** * @short Wrapper for the org_kde_kwin_idle_timeout interface. * * This class is a convenient wrapper for the org_kde_kwin_idle_timeout interface. * To create a IdleTimeout call IdleTimeoutManager::getIdleTimeout. * * @see IdleTimeoutManager **/ class KWAYLANDCLIENT_EXPORT IdleTimeout : public QObject { Q_OBJECT public: /** - * To create an IdleTimeout prefer using @link{Idle::getTimeout} which sets up the + * To create an IdleTimeout prefer using {@link Idle::getTimeout} which sets up the * IdleTimeout to be fully functional. **/ explicit IdleTimeout(QObject *parent = nullptr); virtual ~IdleTimeout(); /** * Setup this IdleTimeout to manage the @p timeout. * When using IdleTimeoutManager::createIdleTimeout there is no need to call this * method. **/ void setup(org_kde_kwin_idle_timeout *timeout); /** * Releases the org_kde_kwin_idle_timeout interface. * After the interface has been released the IdleTimeout instance is no * longer valid and can be setup with another org_kde_kwin_idle_timeout interface. **/ void release(); /** * Destroys the data held by this IdleTimeout. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new org_kde_kwin_idle_timeout interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, source, &IdleTimeout::destroy); * @endcode * * @see release **/ void destroy(); /** * @returns @c true if managing a org_kde_kwin_idle_timeout. **/ bool isValid() const; operator org_kde_kwin_idle_timeout*(); operator org_kde_kwin_idle_timeout*() const; /** * Simulates user activity. If the IdleTimeout is in idle state this will trigger the - * @link{resumeFromIdle} signal. The current idle duration is reset, so the @link{idle} + * {@link resumeFromIdle} signal. The current idle duration is reset, so the {@link idle} * will only be emitted after a complete idle duration as requested for this IdleTimeout. */ void simulateUserActivity(); Q_SIGNALS: /** * Emitted when this IdleTimeout triggered. This means the system has been idle for * the duration specified when creating the IdleTimeout. * @see Idle::getTimeout. * @see resumeFromIdle **/ void idle(); /** * Emitted when the system shows activity again after the idle state was reached. * @see idle **/ void resumeFromIdle(); private: class Private; QScopedPointer d; }; } } #endif diff --git a/src/client/plasmashell.h b/src/client/plasmashell.h index 79d1bbf..5f2c655 100644 --- a/src/client/plasmashell.h +++ b/src/client/plasmashell.h @@ -1,362 +1,362 @@ /******************************************************************** Copyright 2015 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_PLASMASHELL_H #define WAYLAND_PLASMASHELL_H #include #include #include struct wl_surface; struct org_kde_plasma_shell; struct org_kde_plasma_surface; namespace KWayland { namespace Client { class EventQueue; class Surface; class PlasmaShellSurface; /** * @short Wrapper for the org_kde_plasma_shell interface. * * This class provides a convenient wrapper for the org_kde_plasma_shell interface. * It's main purpose is to create a PlasmaShellSurface. * * To use this class one needs to interact with the Registry. There are two * possible ways to create the Shell interface: * @code * PlasmaShell *s = registry->createPlasmaShell(name, version); * @endcode * * This creates the PlasmaShell and sets it up directly. As an alternative this * can also be done in a more low level way: * @code * PlasmaShell *s = new PlasmaShell; * s->setup(registry->bindPlasmaShell(name, version)); * @endcode * * The PlasmaShell can be used as a drop-in replacement for any org_kde_plasma_shell * pointer as it provides matching cast operators. * * @see Registry * @see PlasmaShellSurface **/ class KWAYLANDCLIENT_EXPORT PlasmaShell : public QObject { Q_OBJECT public: explicit PlasmaShell(QObject *parent = nullptr); virtual ~PlasmaShell(); /** * @returns @c true if managing a org_kde_plasma_shell. **/ bool isValid() const; /** * Releases the org_kde_plasma_shell interface. * After the interface has been released the PlasmaShell instance is no * longer valid and can be setup with another org_kde_plasma_shell interface. * * Right before the interface is released the signal interfaceAboutToBeReleased is emitted. * @see interfaceAboutToBeReleased **/ void release(); /** * Destroys the data held by this PlasmaShell. * This method is supposed to be used when the connection to the Wayland * server goes away. Once the connection becomes invalid, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new org_kde_plasma_shell interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, shell, &PlasmaShell::destroy); * @endcode * * Right before the data is destroyed, the signal interfaceAboutToBeDestroyed is emitted. * * @see release * @see interfaceAboutToBeDestroyed **/ void destroy(); /** * Setup this Shell to manage the @p shell. * When using Registry::createShell there is no need to call this * method. **/ void setup(org_kde_plasma_shell *shell); /** * Sets the @p queue to use for creating a Surface. **/ void setEventQueue(EventQueue *queue); /** * @returns The event queue to use for creating a Surface. **/ EventQueue *eventQueue(); /** * Creates a PlasmaShellSurface for the given @p surface and sets it up. * * If a PlasmaShellSurface for the given @p surface has already been created * a pointer to the existing one is returned instead of creating a new surface. * * @param surface The native surface to create the PlasmaShellSurface for * @param parent The parent to use for the PlasmaShellSurface * @returns created PlasmaShellSurface **/ PlasmaShellSurface *createSurface(wl_surface *surface, QObject *parent = nullptr); /** * Creates a PlasmaShellSurface for the given @p surface and sets it up. * * If a PlasmaShellSurface for the given @p surface has already been created * a pointer to the existing one is returned instead of creating a new surface. * * @param surface The Surface to create the PlasmaShellSurface for * @param parent The parent to use for the PlasmaShellSurface * @returns created PlasmaShellSurface **/ PlasmaShellSurface *createSurface(Surface *surface, QObject *parent = nullptr); operator org_kde_plasma_shell*(); operator org_kde_plasma_shell*() const; Q_SIGNALS: /** * This signal is emitted right before the interface is released. **/ void interfaceAboutToBeReleased(); /** * This signal is emitted right before the data is destroyed. **/ void interfaceAboutToBeDestroyed(); /** * The corresponding global for this interface on the Registry got removed. * * This signal gets only emitted if the Compositor got created by * Registry::createPlasmaShell * * @since 5.5 **/ void removed(); private: class Private; QScopedPointer d; }; /** * @short Wrapper for the org_kde_plasma_surface interface. * * This class is a convenient wrapper for the org_kde_plasma_surface interface. * * To create an instance use PlasmaShell::createSurface. * * A PlasmaShellSurface is a privileged Surface which can add further hints to the * Wayland server about it's position and the usage role. The Wayland server is allowed * to ignore all requests. * * Even if a PlasmaShellSurface is created for a Surface a normal ShellSurface (or similar) * needs to be created to have the Surface mapped as a window by the Wayland server. * * @see PlasmaShell * @see Surface **/ class KWAYLANDCLIENT_EXPORT PlasmaShellSurface : public QObject { Q_OBJECT public: explicit PlasmaShellSurface(QObject *parent); virtual ~PlasmaShellSurface(); /** * Releases the org_kde_plasma_surface interface. * After the interface has been released the PlasmaShellSurface instance is no * longer valid and can be setup with another org_kde_plasma_surface interface. * * This method is automatically invoked when the PlasmaShell which created this * PlasmaShellSurface gets released. **/ void release(); /** * Destroys the data held by this PlasmaShellSurface. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new org_kde_plasma_surface interface * once there is a new connection available. * * This method is automatically invoked when the PlasmaShell which created this * PlasmaShellSurface gets destroyed. * * @see release **/ void destroy(); /** * Setup this PlasmaShellSurface to manage the @p surface. * There is normally no need to call this method as it's invoked by * PlasmaShell::createSurface. **/ void setup(org_kde_plasma_surface *surface); /** * @returns the PlasmaShellSurface * associated with surface, * if any, nullptr if not found. * @since 5.6 */ static PlasmaShellSurface *get(Surface *surf); /** * @returns @c true if managing a org_kde_plasma_surface. **/ bool isValid() const; operator org_kde_plasma_surface*(); operator org_kde_plasma_surface*() const; /** * Describes possible roles this PlasmaShellSurface can have. * The role can be used by the Wayland server to e.g. change the stacking order accordingly. **/ enum class Role { Normal, ///< A normal Surface Desktop, ///< The Surface represents a desktop, normally stacked below all other surfaces Panel, ///< The Surface represents a panel (dock), normally stacked above normal surfaces OnScreenDisplay, ///< The Surface represents an on screen display, like a volume changed notification Notification, ///< The Surface represents a notification @since 5.24 ToolTip ///< The Surface represents a tooltip @since 5.24 }; /** * Changes the requested Role to @p role. * @see role **/ void setRole(Role role); /** * @returns The requested Role, default value is @c Role::Normal. * @see setRole **/ Role role() const; /** * Requests to position this PlasmaShellSurface at @p point in global coordinates. **/ void setPosition(const QPoint &point); /** * Describes how a PlasmaShellSurface with role @c Role::Panel should behave. * @see Role **/ enum class PanelBehavior { AlwaysVisible, AutoHide, WindowsCanCover, WindowsGoBelow }; /** * Sets the PanelBehavior for a PlasmaShellSurface with Role @c Role::Panel * @see setRole **/ void setPanelBehavior(PanelBehavior behavior); /** * Setting this bit to the window, will make it say it prefers * to not be listed in the taskbar. Taskbar implementations * may or may not follow this hint. * @since 5.5 */ void setSkipTaskbar(bool skip); /** * Requests to hide a surface with Role Panel and PanelBahvior AutoHide. * - * Once the compositor has hidden the panel the signal @link{autoHidePanelHidden} gets - * emitted. Once it is shown again the signal @link{autoHidePanelShown} gets emitted. + * Once the compositor has hidden the panel the signal {@link autoHidePanelHidden} gets + * emitted. Once it is shown again the signal {@link autoHidePanelShown} gets emitted. * - * To show the surface again from client side use @link{requestShowAutoHidingPanel}. + * To show the surface again from client side use {@link requestShowAutoHidingPanel}. * * @see autoHidePanelHidden * @see autoHidePanelShown * @see requestShowAutoHidingPanel * @since 5.28 **/ void requestHideAutoHidingPanel(); /** * Requests to show a surface with Role Panel and PanelBahvior AutoHide. * * This request allows the client to show a surface which it previously - * requested to be hidden with @link{requestHideAutoHidingPanel}. + * requested to be hidden with {@link requestHideAutoHidingPanel}. * * @see autoHidePanelHidden * @see autoHidePanelShown * @see requestHideAutoHidingPanel * @since 5.28 **/ void requestShowAutoHidingPanel(); /** * Set whether a PlasmaShellSurface with Role Panel should get focus or not. * * By default a Panel does not take focus. With this request the compositor * can be instructed to also pass focus to a panel * * @param takesFocus Set to @c true if the Panel should gain focus. * @since 5.28 **/ void setPanelTakesFocus(bool takesFocus); Q_SIGNALS: /** * Emitted when the compositor hided an auto hiding panel. * @see requestHideAutoHidingPanel * @see autoHidePanelShown * @see requestShowAutoHidingPanel * @since 5.28 **/ void autoHidePanelHidden(); /** * Emitted when the compositor showed an auto hiding panel. * @see requestHideAutoHidingPanel * @see autoHidePanelHidden * @see requestShowAutoHidingPanel * @since 5.28 **/ void autoHidePanelShown(); private: friend class PlasmaShell; class Private; QScopedPointer d; }; } } Q_DECLARE_METATYPE(KWayland::Client::PlasmaShellSurface::Role) Q_DECLARE_METATYPE(KWayland::Client::PlasmaShellSurface::PanelBehavior) #endif diff --git a/src/client/plasmawindowmanagement.h b/src/client/plasmawindowmanagement.h index 59693e6..fa00456 100644 --- a/src/client/plasmawindowmanagement.h +++ b/src/client/plasmawindowmanagement.h @@ -1,627 +1,627 @@ /******************************************************************** Copyright 2015 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_PLASMAWINDOWMANAGEMENT_H #define WAYLAND_PLASMAWINDOWMANAGEMENT_H #include #include #include #include struct org_kde_plasma_window_management; struct org_kde_plasma_window; namespace KWayland { namespace Client { class EventQueue; class PlasmaWindow; class PlasmaWindowModel; class Surface; /** * @short Wrapper for the org_kde_plasma_window_management interface. * * PlasmaWindowManagement is a privileged interface. A Wayland compositor is allowed to ignore * any requests. The PlasmaWindowManagement allows to get information about the overall windowing * system. It allows to see which windows are currently available and thus is the base to implement * e.g. a task manager. * * This class provides a convenient wrapper for the org_kde_plasma_window_management interface. * It's main purpose is to create a PlasmaWindowManagementSurface. * * To use this class one needs to interact with the Registry. There are two * possible ways to create the Shell interface: * @code * PlasmaWindowManagement *s = registry->createPlasmaWindowManagement(name, version); * @endcode * * This creates the PlasmaWindowManagement and sets it up directly. As an alternative this * can also be done in a more low level way: * @code * PlasmaWindowManagement *s = new PlasmaWindowManagement; * s->setup(registry->bindPlasmaWindowManagement(name, version)); * @endcode * * The PlasmaWindowManagement can be used as a drop-in replacement for any org_kde_plasma_window_management * pointer as it provides matching cast operators. * * @see Registry * @see PlasmaWindowManagementSurface **/ class KWAYLANDCLIENT_EXPORT PlasmaWindowManagement : public QObject { Q_OBJECT public: explicit PlasmaWindowManagement(QObject *parent = nullptr); virtual ~PlasmaWindowManagement(); /** * @returns @c true if managing a org_kde_plasma_window_management. **/ bool isValid() const; /** * Releases the org_kde_plasma_window_management interface. * After the interface has been released the PlasmaWindowManagement instance is no * longer valid and can be setup with another org_kde_plasma_window_management interface. * * Right before the interface is released the signal interfaceAboutToBeReleased is emitted. * @see interfaceAboutToBeReleased **/ void release(); /** * Destroys the data held by this PlasmaWindowManagement. * This method is supposed to be used when the connection to the Wayland * server goes away. Once the connection becomes invalid, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new org_kde_plasma_window_management interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, shell, &PlasmaWindowManagement::destroy); * @endcode * * Right before the data is destroyed, the signal interfaceAboutToBeDestroyed is emitted. * * @see release * @see interfaceAboutToBeDestroyed **/ void destroy(); /** * Setup this Shell to manage the @p shell. * When using Registry::createShell there is no need to call this * method. **/ void setup(org_kde_plasma_window_management *shell); /** * Sets the @p queue to use for creating a Surface. **/ void setEventQueue(EventQueue *queue); /** * @returns The event queue to use for creating a Surface. **/ EventQueue *eventQueue(); operator org_kde_plasma_window_management*(); operator org_kde_plasma_window_management*() const; /** * Whether the system is currently showing the desktop. * This means that the system focuses on the desktop and hides other windows. * @see setShowingDesktop * @see showDesktop * @see hideDesktop * @see showingDesktopChanged **/ bool isShowingDesktop() const; /** * Requests to change the showing desktop state to @p show. * @see isShowingDesktop * @see showDesktop * @see hideDesktop **/ void setShowingDesktop(bool show); /** * Same as calling setShowingDesktop with @c true. * @see setShowingDesktop **/ void showDesktop(); /** * Same as calling setShowingDesktop with @c false. * @see setShowingDesktop **/ void hideDesktop(); /** * @returns All windows currently known to the PlasmaWindowManagement * @see windowCreated **/ QList windows() const; /** * @returns The currently active PlasmaWindow, the PlasmaWindow which - * returns @c true in @link{PlasmaWindow::isActive} or @c nullptr in case + * returns @c true in {@link PlasmaWindow::isActive} or @c nullptr in case * there is no active window. **/ PlasmaWindow *activeWindow() const; /** * Factory method to create a PlasmaWindowModel. * @returns a new created PlasmaWindowModel **/ PlasmaWindowModel *createWindowModel(); Q_SIGNALS: /** * This signal is emitted right before the interface is released. **/ void interfaceAboutToBeReleased(); /** * This signal is emitted right before the data is destroyed. **/ void interfaceAboutToBeDestroyed(); /** * The showing desktop state changed. * @see isShowingDesktop **/ void showingDesktopChanged(bool); /** * A new @p window got created. * @see windows **/ void windowCreated(KWayland::Client::PlasmaWindow *window); /** * The active window changed. * @see activeWindow **/ void activeWindowChanged(); /** * The corresponding global for this interface on the Registry got removed. * * This signal gets only emitted if the Compositor got created by * Registry::createPlasmaWindowManagement * * @since 5.5 **/ void removed(); private: class Private; QScopedPointer d; }; /** * @short Wrapper for the org_kde_plasma_window interface. * * A PlasmaWindow gets created by the PlasmaWindowManagement and announced through - * the @link{PlasmaWindowManagement::windowCreated} signal. The PlasmaWindow encapsulates + * the {@link PlasmaWindowManagement::windowCreated} signal. The PlasmaWindow encapsulates * state about a window managed by the Wayland server and allows to request state changes. * * The PlasmaWindow will be automatically deleted when the PlasmaWindow gets unmapped. * * This class is a convenient wrapper for the org_kde_plasma_window interface. * The PlasmaWindow gets created by PlasmaWindowManagement. * * @see PlasmaWindowManager **/ class KWAYLANDCLIENT_EXPORT PlasmaWindow : public QObject { Q_OBJECT public: virtual ~PlasmaWindow(); /** * Releases the org_kde_plasma_window interface. * After the interface has been released the PlasmaWindow instance is no * longer valid and can be setup with another org_kde_plasma_window interface. **/ void release(); /** * Destroys the data held by this PlasmaWindow. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new org_kde_plasma_window interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, source, &PlasmaWindow::destroy); * @endcode * * @see release **/ void destroy(); /** * @returns @c true if managing a org_kde_plasma_window. **/ bool isValid() const; operator org_kde_plasma_window*(); operator org_kde_plasma_window*() const; /** * @returns the window title. * @see titleChanged **/ QString title() const; /** * @returns the application id which should reflect the name of a desktop file. * @see appIdChanged **/ QString appId() const; /** * @returns the id of the virtual desktop this PlasmaWindow is on * @see virtualDesktopChanged **/ quint32 virtualDesktop() const; /** * @returns Whether the window is currently the active Window. * @see activeChanged **/ bool isActive() const; /** * @returns Whether the window is fullscreen * @see fullscreenChanged **/ bool isFullscreen() const; /** * @returns Whether the window is kept above other windows. * @see keepAboveChanged **/ bool isKeepAbove() const; /** * @returns Whether the window is kept below other window * @see keepBelowChanged **/ bool isKeepBelow() const; /** * @returns Whether the window is currently minimized * @see minimizedChanged **/ bool isMinimized() const; /** * @returns Whether the window is maximized. * @see maximizedChanged **/ bool isMaximized() const; /** * @returns Whether the window is shown on all desktops. * @see virtualDesktop * @see onAllDesktopsChanged **/ bool isOnAllDesktops() const; /** * @returns Whether the window is demanding attention. * @see demandsAttentionChanged **/ bool isDemandingAttention() const; /** * @returns Whether the window can be closed. * @see closeableChanged **/ bool isCloseable() const; /** * @returns Whether the window can be maximized. * @see maximizeableChanged **/ bool isMaximizeable() const; /** * @returns Whether the window can be minimized. * @see minimizeableChanged **/ bool isMinimizeable() const; /** * @returns Whether the window can be set to fullscreen. * @see fullscreenableChanged **/ bool isFullscreenable() const; /** * @returns Whether the window should be ignored by a task bar. * @see skipTaskbarChanged **/ bool skipTaskbar() const; /** * @returns The icon of the window. * @see iconChanged **/ QIcon icon() const; /** * @returns Whether the window can be set to the shaded state. * @see isShaded * @see shadeableChanged * @since 5.22 */ bool isShadeable() const; /** * @returns Whether the window is shaded, that is reduced to the window decoration * @see shadedChanged * @since 5.22 */ bool isShaded() const; /** * @returns Whether the window can be moved. * @see movableChanged * @since 5.22 */ bool isMovable() const; /** * @returns Whether the window can be resized. * @see resizableChanged * @since 5.22 */ bool isResizable() const; /** * @returns Whether the virtual desktop can be changed. * @see virtualDesktopChangeableChanged * @since 5.22 */ bool isVirtualDesktopChangeable() const; /** * @returns The process id this window belongs to. * or 0 if unset * @since 5.35 */ quint32 pid() const; /** * Requests to activate the window. **/ void requestActivate(); /** * Requests to close the window. **/ void requestClose(); /** * Requests to start an interactive window move operation. * @since 5.22 */ void requestMove(); /** * Requests to start an interactive resize operation. * @since 5.22 */ void requestResize(); /** * Requests to send the window to virtual @p desktop. **/ void requestVirtualDesktop(quint32 desktop); /** * Requests the window at this model row index have its keep above state toggled. * @since 5.35 */ void requestToggleKeepAbove(); /** * Requests the window at this model row index have its keep below state toggled. * @since 5.35 */ void requestToggleKeepBelow(); /** * Requests the window at this model row index have its minimized state toggled. */ void requestToggleMinimized(); /** * Requests the window at this model row index have its maximized state toggled. */ void requestToggleMaximized(); /** * Sets the geometry of the taskbar entry for this window * relative to a panel in particular * @since 5.5 */ void setMinimizedGeometry(Surface *panel, const QRect &geom); /** * Remove the task geometry information for a particular panel * @since 5.5 */ void unsetMinimizedGeometry(Surface *panel); /** * Requests the window at this model row index have its shaded state toggled. * @since 5.22 */ void requestToggleShaded(); /** * An internal window identifier. * This is not a global window identifier. * This identifier does not correspond to QWindow::winId in any way. **/ quint32 internalId() const; /** * The parent window of this PlasmaWindow. * * If there is a parent window, this window is a transient window for the * parent window. If this method returns a null PlasmaWindow it means this * window is a top level window and is not a transient window. * * @see parentWindowChanged * @since 5.24 **/ QPointer parentWindow() const; /** * @returns The window geometry in absolute coordinates. * @see geometryChanged * @since 5.25 **/ QRect geometry() const; Q_SIGNALS: /** * The window title changed. * @see title **/ void titleChanged(); /** * The application id changed. * @see appId **/ void appIdChanged(); /** * The virtual desktop changed. * @see virtualDesktop **/ void virtualDesktopChanged(); /** * The window became active or inactive. * @see isActive **/ void activeChanged(); /** * The fullscreen state changed. * @see isFullscreen **/ void fullscreenChanged(); /** * The keep above state changed. * @see isKeepAbove **/ void keepAboveChanged(); /** * The keep below state changed. * @see isKeepBelow **/ void keepBelowChanged(); /** * The minimized state changed. * @see isMinimized **/ void minimizedChanged(); /** * The maximized state changed. * @see isMaximized **/ void maximizedChanged(); /** * The on all desktops state changed. * @see isOnAllDesktops **/ void onAllDesktopsChanged(); /** * The demands attention state changed. * @see isDemandingAttention **/ void demandsAttentionChanged(); /** * The closeable state changed. * @see isCloseable **/ void closeableChanged(); /** * The minimizeable state changed. * @see isMinimizeable **/ void minimizeableChanged(); /** * The maximizeable state changed. * @see isMaximizeable **/ void maximizeableChanged(); /** * The fullscreenable state changed. * @see isFullscreenable **/ void fullscreenableChanged(); /** * The skip taskbar state changed. * @see skipTaskbar **/ void skipTaskbarChanged(); /** * The window icon changed. * @see icon **/ void iconChanged(); /** * The shadeable state changed. * @see isShadeable * @since 5.22 */ void shadeableChanged(); /** * The shaded state changed. * @see isShaded * @since 5.22 */ void shadedChanged(); /** * The movable state changed. * @see isMovable * @since 5.22 */ void movableChanged(); /** * The resizable state changed. * @see isResizable * @since 5.22 */ void resizableChanged(); /** * The virtual desktop changeable state changed. * @see virtualDesktopChangeable * @since 5.22 */ void virtualDesktopChangeableChanged(); /** * The window got unmapped and is no longer available to the Wayland server. * This instance will be automatically deleted and one should connect to this * signal to perform cleanup. **/ void unmapped(); /** * This signal is emitted whenever the parent window changes. * @see parentWindow * @since 5.24 **/ void parentWindowChanged(); /** * This signal is emitted whenever the window geometry changes. * @see geometry * @since 5.25 **/ void geometryChanged(); private: friend class PlasmaWindowManagement; explicit PlasmaWindow(PlasmaWindowManagement *parent, org_kde_plasma_window *dataOffer, quint32 internalId); class Private; QScopedPointer d; }; } } Q_DECLARE_METATYPE(KWayland::Client::PlasmaWindow*) #endif diff --git a/src/client/pointerconstraints.h b/src/client/pointerconstraints.h index 3d149e5..13bfc06 100644 --- a/src/client/pointerconstraints.h +++ b/src/client/pointerconstraints.h @@ -1,473 +1,473 @@ /**************************************************************************** Copyright 2016 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . ****************************************************************************/ #ifndef KWAYLAND_CLIENT_POINTERCONSTRAINTS_H #define KWAYLAND_CLIENT_POINTERCONSTRAINTS_H #include #include struct zwp_pointer_constraints_v1; struct zwp_locked_pointer_v1; struct zwp_confined_pointer_v1; class QPointF; namespace KWayland { namespace Client { class EventQueue; class LockedPointer; class Surface; class Region; class ConfinedPointer; class Pointer; /** * @short Wrapper for the zwp_pointer_constraints_v1 interface. * * This class provides a convenient wrapper for the zwp_pointer_constraints_v1 interface. * * To use this class one needs to interact with the Registry. There are two * possible ways to create the PointerConstraints interface: * @code * PointerConstraints *c = registry->createPointerConstraints(name, version); * @endcode * * This creates the PointerConstraints and sets it up directly. As an alternative this * can also be done in a more low level way: * @code * PointerConstraints *c = new PointerConstraints; * c->setup(registry->bindPointerConstraints(name, version)); * @endcode * * The PointerConstraints can be used as a drop-in replacement for any zwp_pointer_constraints_v1 * pointer as it provides matching cast operators. * * @see Registry * @since 5.29 **/ class KWAYLANDCLIENT_EXPORT PointerConstraints : public QObject { Q_OBJECT public: /** * Creates a new PointerConstraints. * Note: after constructing the PointerConstraints it is not yet valid and one needs * to call setup. In order to get a ready to use PointerConstraints prefer using * Registry::createPointerConstraints. **/ explicit PointerConstraints(QObject *parent = nullptr); virtual ~PointerConstraints(); /** * Setup this PointerConstraints to manage the @p pointerconstraints. * When using Registry::createPointerConstraints there is no need to call this * method. **/ void setup(zwp_pointer_constraints_v1 *pointerconstraints); /** * @returns @c true if managing a zwp_pointer_constraints_v1. **/ bool isValid() const; /** * Releases the zwp_pointer_constraints_v1 interface. * After the interface has been released the PointerConstraints instance is no * longer valid and can be setup with another zwp_pointer_constraints_v1 interface. **/ void release(); /** * Destroys the data held by this PointerConstraints. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new zwp_pointer_constraints_v1 interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, pointerconstraints, &PointerConstraints::destroy); * @endcode * * @see release **/ void destroy(); /** * Sets the @p queue to use for creating objects with this PointerConstraints. **/ void setEventQueue(EventQueue *queue); /** * @returns The event queue to use for creating objects with this PointerConstraints. **/ EventQueue *eventQueue(); /** * These values represent different lifetime semantics. They are passed * as arguments to the factory requests to specify how the constraint * lifetimes should be managed. * @see lockPointer * @see confinePointer **/ enum class LifeTime { /** * A OneShot pointer constraint will never reactivate once it has been * deactivated. **/ OneShot, /** * A persistent pointer constraint may again reactivate once it has * been deactivated. **/ Persistent }; /** * This factory method creates a LockedPointer. * * A LockedPointer lets the client request to disable movements of * the virtual pointer (i.e. the cursor), effectively locking the pointer * to a position. * * Creating a LockedPointer does not lock the pointer immediately; in the * future, when the compositor deems implementation-specific constraints * are satisfied, the pointer lock will be activated and the compositor - * sends a locked event, reported by @link{LockedPointer::locked}. + * sends a locked event, reported by {@link LockedPointer::locked}. * * The protocol provides no guarantee that the constraints are ever * satisfied, and does not require the compositor to send an error if the * constraints cannot ever be satisfied. It is thus possible to request a * lock that will never activate. * * There may not be another pointer constraint of any kind requested or * active on the @p surface for any of the Pointer objects of the Seat of * the passed @p pointer when requesting a lock. If there is, an error will be * raised. * * The intersection of the @p region passed with this request and the input * region of the @p surface is used to determine where the pointer must be * in order for the lock to activate. It is up to the compositor whether to * warp the pointer or require some kind of user interaction for the lock * to activate. If the @p region is null the surface input region is used. * * A Surface may receive pointer focus without the lock being activated. * * Note that while a pointer is locked, the Pointer objects of the - * corresponding seat will not emit any @link{Pointer::motion} signals, but - * relative motion events will still be emitted via @link{RelativePointer::relativeMotion}. + * corresponding seat will not emit any {@link Pointer::motion} signals, but + * relative motion events will still be emitted via {@link RelativePointer::relativeMotion}. * Pointer axis and button events are unaffected. * * @param surface The Surface which should be constrained in pointer motion * @param pointer The Pointer object for which this LockedPointer should be created * @param region Region where to lock the pointer, if @c null the input region of the Surface is used * @param lifetime Whether the LockedPointer becomes invalid on unlocked * @param parent The parent object for the LockedPointer * @returns The factored LockedPointer **/ LockedPointer *lockPointer(Surface *surface, Pointer *pointer, Region *region, LifeTime lifetime, QObject *parent = nullptr); /** * This factory method creates a ConfinedPointer. * * A ConfinedPointer lets the client request to confine the * pointer cursor to a given @p region. Creating a ConfinedPointer * does not take effect immediately; in the future, when the compositor * deems implementation-specific constraints are satisfied, the pointer * confinement will be activated and the compositor sends a confined event, - * which is reported through the @link{ConfinedPointer::confined} signal. + * which is reported through the {@link ConfinedPointer::confined} signal. * * The intersection of the @p region passed and the input region of the * @p surface is used to determine where the pointer must be * in order for the confinement to activate. It is up to the compositor * whether to warp the pointer or require some kind of user interaction for * the confinement to activate. If the @p region is @c null the @p surface input * region is used. * * @param surface The Surface which should be constrained in pointer motion * @param pointer The Pointer object for which this LockedPointer should be created * @param region Region where to confine the pointer, if @c null the input region of the Surface is used * @param lifetime Whether the ConfinedPointer becomes invalid on unconfined * @param parent The parent object for the ConfinedPointer * @returns The factored ConfinedPointer **/ ConfinedPointer *confinePointer(Surface *surface, Pointer *pointer, Region *region, LifeTime lifetime, QObject *parent = nullptr); operator zwp_pointer_constraints_v1*(); operator zwp_pointer_constraints_v1*() const; Q_SIGNALS: /** * The corresponding global for this interface on the Registry got removed. * * This signal gets only emitted if the PointerConstraints got created by * Registry::createPointerConstraints **/ void removed(); private: class Private; QScopedPointer d; }; /** * @short Wrapper for the zwp_locked_pointer_v1 interface. * * The LockedPointer represents a locked pointer state. * * While the lock of this object is active, the Pointer objects of the - * associated seat will not emit any @link{Pointer::motion} events. + * associated seat will not emit any {@link Pointer::motion} events. * * This object will send the signal locked when the lock is activated. * Whenever the lock is activated, it is guaranteed that the locked surface * will already have received pointer focus and that the pointer will be * within the region passed to the request creating this object. * * To unlock the pointer, delete the object. * * If the compositor decides to unlock the pointer the unlocked signal is * emitted. * * When unlocking, the compositor may warp the cursor position to the set * cursor position hint. If it does, it will not result in any relative - * motion events emitted via @link{RelativePointer::relativeMotion}. + * motion events emitted via {@link RelativePointer::relativeMotion}. * * If the Surface the lock was requested on is destroyed and the lock is not * yet activated, the LockedPointer object is now defunct and must be * deleted. * * @see PointerConstraints::lockedPointer * @since 5.29 **/ class KWAYLANDCLIENT_EXPORT LockedPointer : public QObject { Q_OBJECT public: virtual ~LockedPointer(); /** * Setup this LockedPointer to manage the @p lockedpointer. * When using PointerConstraints::createLockedPointer there is no need to call this * method. **/ void setup(zwp_locked_pointer_v1 *lockedpointer); /** * @returns @c true if managing a zwp_locked_pointer_v1. **/ bool isValid() const; /** * Releases the zwp_locked_pointer_v1 interface. * After the interface has been released the LockedPointer instance is no * longer valid and can be setup with another zwp_locked_pointer_v1 interface. **/ void release(); /** * Destroys the data held by this LockedPointer. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new zwp_locked_pointer_v1 interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, lockedpointer, &LockedPointer::destroy); * @endcode * * @see release **/ void destroy(); /** * Set the cursor position hint relative to the top left corner of the Surface. * * If the client is drawing its own cursor, it should update the position * hint to the position of its own cursor. A compositor may use this * information to warp the pointer upon unlock in order to avoid pointer * jumps. * * The cursor position hint is double buffered. The new hint will only take * effect when the associated surface gets it pending state applied. - * See @link{Surface::commit} for details. + * See {@link Surface::commit} for details. * * @param surfaceLocal The new position hint in surface local coordinates * @see Surface::commit **/ void setCursorPositionHint(const QPointF &surfaceLocal); /** * Set a new region used to lock the pointer. * * The new lock region is double-buffered. The new lock region will * only take effect when the associated Surface gets its pending state - * applied. See @link{Surface::commit} for details. + * applied. See {@link Surface::commit} for details. * * @param region The new lock region. * @see Surface::commit * @see PointerConstraints::lockPointer **/ void setRegion(Region *region); operator zwp_locked_pointer_v1*(); operator zwp_locked_pointer_v1*() const; Q_SIGNALS: /** * Notification that the pointer lock of the seat's pointer is activated. * @see unlocked **/ void locked(); /** * Notification that the pointer lock of the seat's pointer is no longer * active. If this is a oneshot pointer lock (see * wp_pointer_constraints.lifetime) this object is now defunct and should * be destroyed. If this is a persistent pointer lock (see * wp_pointer_constraints.lifetime) this pointer lock may again * reactivate in the future. * @see locked **/ void unlocked(); private: friend class PointerConstraints; explicit LockedPointer(QObject *parent = nullptr); class Private; QScopedPointer d; }; /** * @short Wrapper for zwp_confined_pointer_v1 protocol * The confine pointer interface represents a confined pointer state. * * This object will send the signal 'confined' when the confinement is * activated. Whenever the confinement is activated, it is guaranteed that * the surface the pointer is confined to will already have received pointer * focus and that the pointer will be within the region passed to the request * creating this object. It is up to the compositor to decide whether this * requires some user interaction and if the pointer will warp to within the * passed region if outside. * * To unconfine the pointer, delete the object. * * If the compositor decides to unconfine the pointer the unconfined signal is * emitted. The ConfinedPointer object is at this point defunct and should * be deleted. * @see PointerConstraints::confinePointer * @since 5.29 **/ class KWAYLANDCLIENT_EXPORT ConfinedPointer : public QObject { Q_OBJECT public: virtual ~ConfinedPointer(); /** * Setup this ConfinedPointer to manage the @p confinedpointer. * When using PointerConstraints::createConfinedPointer there is no need to call this * method. **/ void setup(zwp_confined_pointer_v1 *confinedpointer); /** * @returns @c true if managing a zwp_confined_pointer_v1. **/ bool isValid() const; /** * Releases the zwp_confined_pointer_v1 interface. * After the interface has been released the ConfinedPointer instance is no * longer valid and can be setup with another zwp_confined_pointer_v1 interface. **/ void release(); /** * Destroys the data held by this ConfinedPointer. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new zwp_confined_pointer_v1 interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, confinedpointer, &ConfinedPointer::destroy); * @endcode * * @see release **/ void destroy(); /** * Set a new region used to confine the pointer. * * The new confine region is double-buffered. The new confine region will * only take effect when the associated Surface gets its pending state - * applied. See @link{Surface::commit} for details. + * applied. See {@link Surface::commit} for details. * * If the confinement is active when the new confinement region is applied * and the pointer ends up outside of newly applied region, the pointer may * warped to a position within the new confinement region. If warped, a - * @link{Pointer::motion} signal will be emitted, but no - * @link{RelativePointer::relativeMotion} signal. + * {@link Pointer::motion} signal will be emitted, but no + * {@link RelativePointer::relativeMotion} signal. * * The compositor may also, instead of using the new region, unconfine the * pointer. * * @param region The new confine region. * @see Surface::commit * @see PointerConstraints::confinePointer **/ void setRegion(Region *region); operator zwp_confined_pointer_v1*(); operator zwp_confined_pointer_v1*() const; Q_SIGNALS: /** * Notification that the pointer confinement of the seat's pointer is activated. * @see unconfined **/ void confined(); /** * Notification that the pointer confinement of the seat's pointer is no * longer active. If this is a oneshot pointer confinement (see * wp_pointer_constraints.lifetime) this object is now defunct and should * be destroyed. If this is a persistent pointer confinement (see * wp_pointer_constraints.lifetime) this pointer confinement may again * reactivate in the future. * @see confined **/ void unconfined(); private: friend class PointerConstraints; explicit ConfinedPointer(QObject *parent = nullptr); class Private; QScopedPointer d; }; } } #endif diff --git a/src/client/shell.h b/src/client/shell.h index 6caffdf..aa20519 100644 --- a/src/client/shell.h +++ b/src/client/shell.h @@ -1,351 +1,351 @@ /******************************************************************** Copyright 2014 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_SHELL_H #define WAYLAND_SHELL_H #include #include #include #include #include struct wl_surface; struct wl_shell; struct wl_shell_surface; namespace KWayland { namespace Client { class EventQueue; class ShellSurface; class Output; class Seat; class Surface; /** * @short Wrapper for the wl_shell interface. * * This class provides a convenient wrapper for the wl_shell interface. * It's main purpose is to create a ShellSurface. * * To use this class one needs to interact with the Registry. There are two * possible ways to create the Shell interface: * @code * Shell *s = registry->createShell(name, version); * @endcode * * This creates the Shell and sets it up directly. As an alternative this * can also be done in a more low level way: * @code * Shell *s = new Shell; * s->setup(registry->bindShell(name, version)); * @endcode * * The Shell can be used as a drop-in replacement for any wl_shell * pointer as it provides matching cast operators. * * @see Registry * @see ShellSurface **/ class KWAYLANDCLIENT_EXPORT Shell : public QObject { Q_OBJECT public: explicit Shell(QObject *parent = nullptr); virtual ~Shell(); /** * @returns @c true if managing a wl_shell. **/ bool isValid() const; /** * Releases the wl_shell interface. * After the interface has been released the Shell instance is no * longer valid and can be setup with another wl_shell interface. * * Right before the interface is released the signal interfaceAboutToBeReleased is emitted. * @see interfaceAboutToBeReleased **/ void release(); /** * Destroys the data held by this Shell. * This method is supposed to be used when the connection to the Wayland * server goes away. Once the connection becomes invalid, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new wl_shell interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, shell, &Shell::destroy); * @endcode * * Right before the data is destroyed, the signal interfaceAboutToBeDestroyed is emitted. * * @see release * @see interfaceAboutToBeDestroyed **/ void destroy(); /** * Setup this Shell to manage the @p shell. * When using Registry::createShell there is no need to call this * method. **/ void setup(wl_shell *shell); /** * Sets the @p queue to use for creating a Surface. **/ void setEventQueue(EventQueue *queue); /** * @returns The event queue to use for creating a Surface. **/ EventQueue *eventQueue(); /** * Creates a ShellSurface for the given @p surface and sets it up. * * @param surface The native surface to create the ShellSurface for * @param parent The parent to use for the ShellSurface * @returns created ShellSurface **/ ShellSurface *createSurface(wl_surface *surface, QObject *parent = nullptr); /** * Creates a ShellSurface for the given @p surface and sets it up. * * @param surface The Surface to create the ShellSurface for * @param parent The parent to use for the ShellSurface * @returns created ShellSurface **/ ShellSurface *createSurface(Surface *surface, QObject *parent = nullptr); operator wl_shell*(); operator wl_shell*() const; Q_SIGNALS: /** * This signal is emitted right before the interface is released. **/ void interfaceAboutToBeReleased(); /** * This signal is emitted right before the data is destroyed. **/ void interfaceAboutToBeDestroyed(); /** * The corresponding global for this interface on the Registry got removed. * * This signal gets only emitted if the Compositor got created by * Registry::createShell * * @since 5.5 **/ void removed(); private: class Private; QScopedPointer d; }; /** * @short Wrapper for the wl_shell_surface interface. * * This class is a convenient wrapper for the wl_shell_surface interface. * * To create an instance use Shell::createSurface. * * @see Shell * @see Surface **/ class KWAYLANDCLIENT_EXPORT ShellSurface : public QObject { Q_OBJECT /** * The size of the ShellSurface. **/ Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY sizeChanged) public: explicit ShellSurface(QObject *parent); virtual ~ShellSurface(); /** * Releases the wl_shell_surface interface. * After the interface has been released the ShellSurface instance is no * longer valid and can be setup with another wl_shell_surface interface. * * This method is automatically invoked when the Shell which created this * ShellSurface gets released. **/ void release(); /** * Destroys the data held by this ShellSurface. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new wl_shell_surface interface * once there is a new connection available. * * This method is automatically invoked when the Shell which created this * ShellSurface gets destroyed. * * @see release **/ void destroy(); /** * Setup this ShellSurface to manage the @p surface. * There is normally no need to call this method as it's invoked by * Shell::createSurface. **/ void setup(wl_shell_surface *surface); QSize size() const; void setSize(const QSize &size); /** * Sets the ShellSurface fullscreen on @p output. **/ void setFullscreen(Output *output = nullptr); void setMaximized(Output *output = nullptr); void setToplevel(); /** * Flags which can be passed to a transient surface. * @see setTransient * @since 5.5 **/ enum class TransientFlag { Default = 0x0, ///< Default: transient surface accepts keyboard focus NoFocus = 0x1 ///< Transient surface does not accept keyboard focus }; Q_DECLARE_FLAGS(TransientFlags, TransientFlag) /** * Sets this Surface as a transient for @p parent. * * @param parent The parent Surface of this surface * @param offset The offset of this Surface in the parent coordinate system * @param flags The flags for the transient * @since 5.5 **/ void setTransient(Surface *parent, const QPoint &offset = QPoint(), TransientFlags flags = TransientFlag::Default); /** * Sets this Surface as a popup transient for @p parent. * * A popup is a transient with an added pointer grab on the @p grabbedSeat. * * The popup grab can be created if the client has an implicit grab (e.g. button press) * on the @p grabbedSeat. It needs to pass the @p grabSerial indicating the implicit grab * to the request for setting the surface. The implicit grab is turned into a popup grab * which will persist after the implicit grab ends. The popup grab ends when the ShellSurface - * gets destroyed or when the compositor breaks the grab through the @link{popupDone} signal. + * gets destroyed or when the compositor breaks the grab through the {@link popupDone} signal. * * @param parent The parent Surface of this ShellSurface * @param grabbedSeat The Seat on which an implicit grab exists * @param grabSerial The serial of the implicit grab * @param offset The offset of this Surface in the parent coordinate system * @param flags The flags for the transient * @since 5.33 **/ void setTransientPopup(Surface *parent, Seat *grabbedSeat, quint32 grabSerial, const QPoint &offset = QPoint(), TransientFlags flags = TransientFlag::Default); bool isValid() const; /** * Requests a move on the given @p seat after the pointer button press with the given @p serial. * * @param seat The seat on which to move the window * @param serial The serial of the pointer button press which should trigger the move * @since 5.5 **/ void requestMove(Seat *seat, quint32 serial); /** * Requests a resize on the given @p seat after the pointer button press with the given @p serial. * * @param seat The seat on which to resize the window * @param serial The serial of the pointer button press which should trigger the resize * @param edges A hint for the compositor to set e.g. an appropriate cursor image * @since 5.5 **/ void requestResize(Seat *seat, quint32 serial, Qt::Edges edges); /** * Creates a ShellSurface for the given @p window. * This is an integration feature for QtWayland. On non-wayland platforms this method returns * @c nullptr as well as for not created QWindows. * * The returned ShellSurface will be fully setup, but won't be released. It gets automatically * destroyed together with the @p window. * @since 5.28 **/ static ShellSurface *fromWindow(QWindow *window); /** * Creates a ShellSurface for the given @p winId. * This is an integration feature for QtWayland. On non-wayland platforms this method returns * @c nullptr as well as for not created QWindows. * * The returned ShellSurface will be fully setup, but won't be released. It gets automatically * destroyed together with the QWindow corresponding * the @p wid. * @since 5.28 **/ static ShellSurface *fromQtWinId(WId wid); /** * @returns The Surface referencing the @p native wl_surface or @c null if there is no such Surface. * @since 5.28 **/ static ShellSurface *get(wl_shell_surface *native); operator wl_shell_surface*(); operator wl_shell_surface*() const; Q_SIGNALS: /** * Signal is emitted when the ShellSurface received a ping request. * The ShellSurface automatically responds to the ping. **/ void pinged(); void sizeChanged(const QSize &); /** * The popupDone signal is sent out when a popup grab is broken, that is, * when the user clicks a surface that doesn't belong to the client owning * the popup surface. * @see setTransientPopup * @since 5.33 **/ void popupDone(); private: class Private; QScopedPointer d; }; } } Q_DECLARE_METATYPE(KWayland::Client::ShellSurface::TransientFlag) Q_DECLARE_METATYPE(KWayland::Client::ShellSurface::TransientFlags) #endif diff --git a/src/client/textinput.h b/src/client/textinput.h index 9e3ea83..fbf2960 100644 --- a/src/client/textinput.h +++ b/src/client/textinput.h @@ -1,536 +1,536 @@ /**************************************************************************** Copyright 2016 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . ****************************************************************************/ #ifndef KWAYLAND_CLIENT_TEXTINPUT_H #define KWAYLAND_CLIENT_TEXTINPUT_H #include #include struct wl_text_input; struct wl_text_input_manager; struct zwp_text_input_manager_v2; namespace KWayland { namespace Client { class EventQueue; class TextInputUnstableV0; class Surface; class Seat; /** * @brief TextInput represents a Wayland interface for text input. * * The TextInput allows to have text composed by the Compositor and be sent to * the client. * * Depending on the interface the TextInputManager got created for this class * encapsulates one of the following interfaces: * @li wl_text_input * @li zwp_text_input_v2 * * @since 5.23 **/ class KWAYLANDCLIENT_EXPORT TextInput : public QObject { Q_OBJECT public: virtual ~TextInput(); /** * @returns @c true if managing a resource. **/ bool isValid() const; /** * @returns The Surface which has the text input focus on this TextInput. * @see entered * @see left **/ Surface *enteredSurface() const; void setEventQueue(EventQueue *queue); EventQueue *eventQueue() const; /** * @returns whether the input panel (virtual keyboard) is currently visible on the screen * @see inputPanelStateChanged **/ bool isInputPanelVisible() const; /** * Enable text input in a @p surface (usually when a text entry inside of it has focus). * * This can be called before or after a surface gets text (or keyboard) focus via the * enter event. Text input to a surface is only active when it has the current * text (or keyboard) focus and is enabled. * @see deactivate **/ void enable(Surface *surface); /** * Disable text input in a @p surface (typically when there is no focus on any * text entry inside the surface). * @see enable **/ void disable(Surface *surface); /** * Requests input panels (virtual keyboard) to show. * @see hideInputPanel **/ void showInputPanel(); /** * Requests input panels (virtual keyboard) to hide. * @see showInputPanel **/ void hideInputPanel(); /** * Should be called by an editor widget when the input state should be * reset, for example after the text was changed outside of the normal * input method flow. **/ void reset(); /** * Sets the plain surrounding text around the input position. * * @param text The text surrounding the cursor position * @param cursor Index in the text describing the cursor position * @param anchor Index of the selection anchor, if no selection same as cursor **/ void setSurroundingText(const QString &text, quint32 cursor, quint32 anchor); /** * The possible states for a keyEvent. * @see keyEvent **/ enum class KeyState { Pressed, Released }; /** * ContentHint allows to modify the behavior of the text input. **/ enum class ContentHint : uint32_t { /** * no special behaviour */ None = 0, /** * suggest word completions */ AutoCompletion = 1 << 0, /** * suggest word corrections */ AutoCorrection = 1 << 1, /** * switch to uppercase letters at the start of a sentence */ AutoCapitalization = 1 << 2, /** * prefer lowercase letters */ LowerCase = 1 << 3, /** * prefer uppercase letters */ UpperCase = 1 << 4, /** * prefer casing for titles and headings (can be language dependent) */ TitleCase = 1 << 5, /** * characters should be hidden */ HiddenText = 1 << 6, /** * typed text should not be stored */ SensitiveData = 1 << 7, /** * just latin characters should be entered */ Latin = 1 << 8, /** * the text input is multi line */ MultiLine = 1 << 9 }; Q_DECLARE_FLAGS(ContentHints, ContentHint) /** * The ContentPurpose allows to specify the primary purpose of a text input. * * This allows an input method to show special purpose input panels with * extra characters or to disallow some characters. */ enum class ContentPurpose : uint32_t { /** * default input, allowing all characters */ Normal, /** * allow only alphabetic characters **/ Alpha, /** * allow only digits */ Digits, /** * input a number (including decimal separator and sign) */ Number, /** * input a phone number */ Phone, /** * input an URL */ Url, /** * input an email address **/ Email, /** * input a name of a person */ Name, /** * input a password */ Password, /** * input a date */ Date, /** * input a time */ Time, /** * input a date and time */ DateTime, /** * input for a terminal */ Terminal }; /** * Sets the content @p purpose and content @p hints. * While the @p purpose is the basic purpose of an input field, the @p hints flags allow * to modify some of the behavior. **/ void setContentType(ContentHints hints, ContentPurpose purpose); /** * Sets the cursor outline @p rect in surface local coordinates. * * Allows the compositor to e.g. put a window with word suggestions * near the cursor. **/ void setCursorRectangle(const QRect &rect); /** * Sets a specific @p language. * * This allows for example a virtual keyboard to show a language specific layout. * The @p language argument is a RFC-3066 format language tag. **/ void setPreferredLanguage(const QString &language); /** * The text direction of input text. * * It is mainly needed for showing input cursor on correct side of the * editor when there is no input yet done and making sure neutral * direction text is laid out properly. * @see textDirectionChnaged **/ Qt::LayoutDirection textDirection() const; /** * The language of the input text. * * As long as the server has not emitted the language, the code will be empty. * * @returns a RFC-3066 format language tag in utf-8. * @see languageChanged **/ QByteArray language() const; /** - * The cursor position inside the @link{composingText} (as byte offset) relative - * to the start of the @link{composingText}. + * The cursor position inside the {@link composingText} (as byte offset) relative + * to the start of the {@link composingText}. * If index is a negative number no cursor is shown. * @see composingText * @see composingTextChanged **/ qint32 composingTextCursorPosition() const; /** - * The currently being composed text around the @link{composingTextCursorPosition}. + * The currently being composed text around the {@link composingTextCursorPosition}. * @see composingTextCursorPosition * @see composingTextChanged **/ QByteArray composingText() const; /** - * The fallback text can be used to replace the @link{composingText} in some cases + * The fallback text can be used to replace the {@link composingText} in some cases * (for example when losing focus). * * @see composingText * @see composingTextChanged **/ QByteArray composingFallbackText() const; /** * The commit text to be inserted. * * The commit text might be empty if only text should be deleted or the cursor be moved. * @see cursorPosition * @see anchorPosition * @see deleteSurroundingText * @see committed **/ QByteArray commitText() const; /** - * The cursor position in bytes at which the @link{commitText} should be inserted. + * The cursor position in bytes at which the {@link commitText} should be inserted. * @see committed **/ qint32 cursorPosition() const; /** - * The text between anchorPosition and @link(cursorPosition} should be selected. + * The text between anchorPosition and {@link cursorPosition} should be selected. * @see cursorPosition * @see committed **/ qint32 anchorPosition() const; /** * Holds the length before and after the cursor position to be deleted. **/ struct DeleteSurroundingText { quint32 beforeLength; quint32 afterLength; }; /** * @returns The lenght in bytes which should be deleted around the cursor position * @see committed **/ DeleteSurroundingText deleteSurroundingText() const; Q_SIGNALS: /** * Emitted whenever a Surface is focused on this TextInput. * @see enteredSurface * @see left **/ void entered(); /** * Emitted whenever a Surface loses the focus on this TextInput. * @see enteredSurface * @see entered **/ void left(); /** * Emitted whenever the state of the input panel (virtual keyboard changes). * @see isInputPanelVisible **/ void inputPanelStateChanged(); /** * Emitted whenver the text direction changes. * @see textDirection **/ void textDirectionChanged(); /** * Emitted whenever the language changes. * @see language **/ void languageChanged(); /** * Emitted when a key event was sent. * Key events are not used for normal text input operations, but for specific key symbols * which are not composable through text. * * @param xkbKeySym The XKB key symbol, not a key code * @param state Whether the event represents a press or release event * @param modifiers The hold modifiers on this event * @param time Timestamp of this event **/ void keyEvent(quint32 xkbKeySym, KWayland::Client::TextInput::KeyState state, Qt::KeyboardModifiers modifiers, quint32 time); /** * Emitted whenever the composing text and related states changed. * @see composingText * @see composingTextCursorPosition * @see composingFallbackText **/ void composingTextChanged(); /** * Emitted when the currently composing text got committed. - * The @link{commitText} should get inserted at the @link{cursorPosition} and - * the text around @link{deleteSurroundingText} should be deleted. + * The {@link commitText} should get inserted at the {@link cursorPosition} and + * the text around {@link deleteSurroundingText} should be deleted. * * @see commitText * @see cursorPosition * @see anchorPosition * @see deleteSurroundingText **/ void committed(); protected: class Private; QScopedPointer d; explicit TextInput(Private *p, QObject *parent = nullptr); }; /** * @brief Manager class for the TextInputManager interfaces. * * The TextInputManager supports multiple interfaces: * @li wl_text_input_manager * @li zwp_text_input_manager_v2 * * Due to that it is different to other manager classes. It can only be created through * the corresponding factory method in Registry. A manual setup is not directly possible. * * The only task of a TextInputManager is to create TextInput for a given Seat. * * @since 5.23 **/ class KWAYLANDCLIENT_EXPORT TextInputManager : public QObject { Q_OBJECT public: virtual ~TextInputManager(); /** * Setup this TextInputManager to manage the @p textinputmanagerunstablev0. * When using Registry::createTextInputManager there is no need to call this * method. **/ void setup(wl_text_input_manager *textinputmanagerunstablev0); /** * Setup this TextInputManager to manage the @p textinputmanagerunstablev0. * When using Registry::createTextInputManager there is no need to call this * method. **/ void setup(zwp_text_input_manager_v2 *textinputmanagerunstablev2); /** * @returns @c true if managing a resource. **/ bool isValid() const; /** * Releases the interface. * After the interface has been released the TextInputManager instance is no * longer valid and can be setup with another interface. **/ void release(); /** * Destroys the data held by this TextInputManager. * This method is supposed to be used when the connection to the Wayland * server goes away. If the connection is not valid anymore, it's not * possible to call release anymore as that calls into the Wayland * connection and the call would fail. This method cleans up the data, so * that the instance can be deleted or set up to a new interface * once there is a new connection available. * * It is suggested to connect this method to ConnectionThread::connectionDied: * @code * connect(connection, &ConnectionThread::connectionDied, textinputmanager, &TextInputManager::destroy); * @endcode * * @see release **/ void destroy(); /** * Sets the @p queue to use for creating objects with this TextInputManager. **/ void setEventQueue(EventQueue *queue); /** * @returns The event queue to use for creating objects with this TextInputManager. **/ EventQueue *eventQueue(); /** * Creates a TextInput for the @p seat. * * @param seat The Seat to create the TextInput for * @param parent The parent to use for the TextInput **/ TextInput *createTextInput(Seat *seat, QObject *parent = nullptr); /** * @returns @c null if not for a wl_text_input_manager **/ operator wl_text_input_manager*(); /** * @returns @c null if not for a wl_text_input_manager **/ operator wl_text_input_manager*() const; /** * @returns @c null if not for a zwp_text_input_manager_v2 **/ operator zwp_text_input_manager_v2*(); /** * @returns @c null if not for a zwp_text_input_manager_v2 **/ operator zwp_text_input_manager_v2*() const; Q_SIGNALS: /** * The corresponding global for this interface on the Registry got removed. * * This signal gets only emitted if the TextInputManager got created by * Registry::createTextInputManager **/ void removed(); protected: class Private; explicit TextInputManager(Private *p, QObject *parent = nullptr); QScopedPointer d; }; } } Q_DECLARE_METATYPE(KWayland::Client::TextInput::KeyState) Q_DECLARE_METATYPE(KWayland::Client::TextInput::ContentHint) Q_DECLARE_METATYPE(KWayland::Client::TextInput::ContentPurpose) Q_DECLARE_METATYPE(KWayland::Client::TextInput::ContentHints) Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::TextInput::ContentHints) #endif diff --git a/src/server/plasmashell_interface.h b/src/server/plasmashell_interface.h index 3a8a6ae..dbc26af 100644 --- a/src/server/plasmashell_interface.h +++ b/src/server/plasmashell_interface.h @@ -1,238 +1,238 @@ /******************************************************************** Copyright 2015 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_SERVER_PLASMA_SHELL_INTERFACE_H #define WAYLAND_SERVER_PLASMA_SHELL_INTERFACE_H #include #include #include "global.h" #include "resource.h" class QSize; struct wl_resource; namespace KWayland { namespace Server { class Display; class SurfaceInterface; class PlasmaShellSurfaceInterface; /** * @brief Global for the org_kde_plasma_shell interface. * * The PlasmaShellInterface allows to add additional information to a SurfaceInterface. * It goes beyond what a ShellSurfaceInterface provides and is adjusted toward the needs * of the Plasma desktop. * * A server providing this interface should think about how to restrict access to it as * it allows to perform absolute window positioning. * * @since 5.4 **/ class KWAYLANDSERVER_EXPORT PlasmaShellInterface : public Global { Q_OBJECT public: virtual ~PlasmaShellInterface(); Q_SIGNALS: /** * Emitted whenever a PlasmaShellSurfaceInterface got created. **/ void surfaceCreated(KWayland::Server::PlasmaShellSurfaceInterface*); private: friend class Display; explicit PlasmaShellInterface(Display *display, QObject *parent); class Private; }; /** * @brief Resource for the org_kde_plasma_shell_surface interface. * * PlasmaShellSurfaceInterface gets created by PlasmaShellInterface. * * @since 5.4 **/ class KWAYLANDSERVER_EXPORT PlasmaShellSurfaceInterface : public Resource { Q_OBJECT public: virtual ~PlasmaShellSurfaceInterface(); /** * @returns the SurfaceInterface this PlasmaShellSurfaceInterface got created for **/ SurfaceInterface *surface() const; /** * @returns The PlasmaShellInterface which created this PlasmaShellSurfaceInterface. **/ PlasmaShellInterface *shell() const; /** * @returns the requested position in global coordinates. **/ QPoint position() const; /** * @returns Whether a global position has been requested. **/ bool isPositionSet() const; /** * Describes possible roles this PlasmaShellSurfaceInterface can have. * The role can be used by the server to e.g. change the stacking order accordingly. **/ enum class Role { Normal, ///< A normal surface Desktop, ///< The surface represents a desktop, normally stacked below all other surfaces Panel, ///< The surface represents a panel (dock), normally stacked above normal surfaces OnScreenDisplay, ///< The surface represents an on screen display, like a volume changed notification Notification, ///< The surface represents a notification @since 5.24 ToolTip ///< The surface represents a tooltip @since 5.24 }; /** * @returns The requested role, default value is @c Role::Normal. **/ Role role() const; /** * Describes how a PlasmaShellSurfaceInterface with role @c Role::Panel should behave. **/ enum class PanelBehavior { AlwaysVisible, ///< The panel should be always visible AutoHide, ///< The panel auto hides at a screen edge and returns on mouse press against edge WindowsCanCover, ///< Windows are allowed to go above the panel, it raises on mouse press against screen edge WindowsGoBelow ///< Window are allowed to go below the panel }; /** * @returns The PanelBehavior for a PlasmaShellSurfaceInterface with role @c Role::Panel * @see role **/ PanelBehavior panelBehavior() const; /** * @returns true if this window doesn't want to be listed * in the taskbar * @since 5.5 */ bool skipTaskbar() const; /** * Informs the PlasmaShellSurfaceInterface that the auto-hiding panel got hidden. - * Once it is shown again the method @link{showAutoHidingPanel} should be used. + * Once it is shown again the method {@link showAutoHidingPanel} should be used. * * @see showAutoHidingPanel * @see panelAutoHideHideRequested * @see panelAutoHideShowRequested * @since 5.28 **/ void hideAutoHidingPanel(); /** * Informs the PlasmaShellSurfaceInterface that the auto-hiding panel got shown again. * * @see hideAutoHidingPanel * @see panelAutoHideHideRequested * @see panelAutoHideShowRequested * @see 5.28 **/ void showAutoHidingPanel(); /** * Whether a PlasmaShellSurfaceInterface with Role Panel wants to have focus. * * By default a Panel does not get focus, but the PlasmaShellSurfaceInterface can * request that it wants to have focus. The compositor can use this information to * pass focus to the panel. * @since 5.28 **/ bool panelTakesFocus() const; /** * @returns The PlasmaShellSurfaceInterface for the @p native resource. * @since 5.5 **/ static PlasmaShellSurfaceInterface *get(wl_resource *native); Q_SIGNALS: /** * A change of global position has been requested. **/ void positionChanged(); /** * A change of the role has been requested. **/ void roleChanged(); /** * A change of the panel behavior has been requested. **/ void panelBehaviorChanged(); /** * A change in the skip taskbar property has been requested */ void skipTaskbarChanged(); /** * A surface with Role Panel and PanelBehavior AutoHide requested to be hidden. * * The compositor should inform the PlasmaShellSurfaceInterface about the actual change. - * Once the surface is hidden it should invoke @link{hideAutoHidingPanel}. If the compositor + * Once the surface is hidden it should invoke {@link hideAutoHidingPanel}. If the compositor * cannot hide the surface (e.g. because it doesn't border a screen edge) it should inform - * the surface through invoking @link{showAutoHidingPanel}. This method should also be invoked + * the surface through invoking {@link showAutoHidingPanel}. This method should also be invoked * whenever the surface gets shown again due to triggering the screen edge. * * @see hideAutoHidingPanel * @see showAutoHidingPanel * @see panelAutoHideShowRequested * @since 5.28 **/ void panelAutoHideHideRequested(); /** * A surface with Role Panel and PanelBehavior AutoHide requested to be shown. * * The compositor should inform the PlasmaShellSurfaceInterface about the actual change. - * Once the surface is shown it should invoke @link{showAutoHidingPanel}. + * Once the surface is shown it should invoke {@link showAutoHidingPanel}. * * @see hideAutoHidingPanel * @see showAutoHidingPanel * @see panelAutoHideHideRequested * @since 5.28 **/ void panelAutoHideShowRequested(); private: friend class PlasmaShellInterface; explicit PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource); class Private; Private *d_func() const; }; } } Q_DECLARE_METATYPE(KWayland::Server::PlasmaShellSurfaceInterface::Role) Q_DECLARE_METATYPE(KWayland::Server::PlasmaShellSurfaceInterface::PanelBehavior) #endif diff --git a/src/server/plasmawindowmanagement_interface.h b/src/server/plasmawindowmanagement_interface.h index 99512e7..8dc0686 100644 --- a/src/server/plasmawindowmanagement_interface.h +++ b/src/server/plasmawindowmanagement_interface.h @@ -1,236 +1,236 @@ /******************************************************************** Copyright 2015 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H #define WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H #include #include #include "global.h" #include "resource.h" class QSize; namespace KWayland { namespace Server { class Display; class PlasmaWindowInterface; class SurfaceInterface; class KWAYLANDSERVER_EXPORT PlasmaWindowManagementInterface : public Global { Q_OBJECT public: virtual ~PlasmaWindowManagementInterface(); enum class ShowingDesktopState { Disabled, Enabled }; void setShowingDesktopState(ShowingDesktopState state); PlasmaWindowInterface *createWindow(QObject *parent); QList windows() const; /** - * Unmaps the @p window previously created with @link{createWindow}. - * The window will be unmapped and removed from the list of @link{windows}. + * Unmaps the @p window previously created with {@link createWindow}. + * The window will be unmapped and removed from the list of {@link windows}. * * Unmapping a @p window indicates to the client that it should destroy the * resource created for the window. Once all resources for the @p window are * destroyed, the @p window will get deleted automatically. There is no need * to manually delete the @p window. A manual delete will trigger the unmap * and resource destroy at the same time and can result in protocol errors on * client side if it still accesses the resource before receiving the unmap event. * * @see createWindow * @see windows * @since 5.23 **/ void unmapWindow(PlasmaWindowInterface *window); Q_SIGNALS: void requestChangeShowingDesktop(ShowingDesktopState requestedState); private: friend class Display; explicit PlasmaWindowManagementInterface(Display *display, QObject *parent); class Private; Private *d_func() const; }; class KWAYLANDSERVER_EXPORT PlasmaWindowInterface : public QObject { Q_OBJECT public: virtual ~PlasmaWindowInterface(); void setTitle(const QString &title); void setAppId(const QString &appId); void setPid(quint32 pid); void setVirtualDesktop(quint32 desktop); void setActive(bool set); void setMinimized(bool set); void setMaximized(bool set); void setFullscreen(bool set); void setKeepAbove(bool set); void setKeepBelow(bool set); void setOnAllDesktops(bool set); void setDemandsAttention(bool set); void setCloseable(bool set); void setMinimizeable(bool set); void setMaximizeable(bool set); void setFullscreenable(bool set); void setSkipTaskbar(bool skip); /** * @deprecated since 5.28 use setIcon * @see setIcon **/ #ifndef KWAYLANDSERVER_NO_DEPRECATED void KWAYLANDSERVER_DEPRECATED setThemedIconName(const QString &iconName); #endif /** * @since 5.22 */ void setShadeable(bool set); /** * @since 5.22 */ void setShaded(bool set); /** * @since 5.22 */ void setMovable(bool set); /** * @since 5.22 */ void setResizable(bool set); /** * @since 5.22 */ void setVirtualDesktopChangeable(bool set); /** * This method removes the Window and the Client is supposed to release the resource * bound for this Window. Once all resources are released the Window gets deleted. * - * Prefer using @link{PlasmaWindowManagementInterface::unmapWindow}. + * Prefer using {@link PlasmaWindowManagementInterface::unmapWindow}. * @see PlasmaWindowManagementInterface::unmapWindow **/ void unmap(); /** * @returns Geometries of the taskbar entries, indicized by the * surface of the panels * @since 5.5 */ QHash minimizedGeometries() const; /** * Sets this PlasmaWindowInterface as a transient window to @p parentWindow. * If @p parentWindow is @c nullptr, the PlasmaWindowInterface is a toplevel * window and does not have a parent window. * @since 5.24 **/ void setParentWindow(PlasmaWindowInterface *parentWindow); /** * Sets the window @p geometry of this PlasmaWindow. * * @param geometry The geometry in absolute coordinates * @since 5.25 **/ void setGeometry(const QRect &geometry); /** * Set the icon of the PlasmaWindowInterface. * * In case the icon has a themed name, only the name is sent to the client. * Otherwise the client is only informed that there is an icon and the client * can request the icon in an asynchronous way by passing a file descriptor * into which the icon will be serialized. * * @param icon The new icon * @since 5.28 **/ void setIcon(const QIcon &icon); Q_SIGNALS: void closeRequested(); /** * @since 5.22 */ void moveRequested(); /** * @since 5.22 */ void resizeRequested(); void virtualDesktopRequested(quint32 desktop); void activeRequested(bool set); void minimizedRequested(bool set); void maximizedRequested(bool set); void fullscreenRequested(bool set); void keepAboveRequested(bool set); void keepBelowRequested(bool set); void demandsAttentionRequested(bool set); void closeableRequested(bool set); void minimizeableRequested(bool set); void maximizeableRequested(bool set); void fullscreenableRequested(bool set); void skipTaskbarRequested(bool set); QRect minimizedGeometriesChanged(); /** * @since 5.22 */ void shadeableRequested(bool set); /** * @since 5.22 */ void shadedRequested(bool set); /** * @since 5.22 */ void movableRequested(bool set); /** * @since 5.22 */ void resizableRequested(bool set); /** * @since 5.22 */ void virtualDesktopChangeableRequested(bool set); private: friend class PlasmaWindowManagementInterface; explicit PlasmaWindowInterface(PlasmaWindowManagementInterface *wm, QObject *parent); class Private; const QScopedPointer d; }; } } Q_DECLARE_METATYPE(KWayland::Server::PlasmaWindowManagementInterface::ShowingDesktopState) #endif diff --git a/src/server/pointerconstraints_interface.h b/src/server/pointerconstraints_interface.h index 0e9cce0..18b8e24 100644 --- a/src/server/pointerconstraints_interface.h +++ b/src/server/pointerconstraints_interface.h @@ -1,268 +1,268 @@ /**************************************************************************** Copyright 2016 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . ****************************************************************************/ #ifndef KWAYLAND_SERVER_POINTERCONSTRAINTS_H #define KWAYLAND_SERVER_POINTERCONSTRAINTS_H #include "global.h" #include "resource.h" #include #include namespace KWayland { namespace Server { class Display; class SurfaceInterface; /** * Enum describing the interface versions the PointerConstraintsInterface can support. * * @since 5.29 **/ enum class PointerConstraintsInterfaceVersion { /** * zwp_pointer_constraints_v1 **/ UnstableV1 }; /** * Manager object to create pointer constraints. * - * To create this manager use @link{Display::createPointerConstraints} + * To create this manager use {@link Display::createPointerConstraints} * * @see ConfinedPointerInterface * @see LockedPointerInterface * @see Display::createPointerConstraints * @since 5.29 **/ class KWAYLANDSERVER_EXPORT PointerConstraintsInterface : public Global { Q_OBJECT public: virtual ~PointerConstraintsInterface(); /** * @returns The interface version used by this PointerConstraintsInterface **/ PointerConstraintsInterfaceVersion interfaceVersion() const; protected: class Private; explicit PointerConstraintsInterface(Private *d, QObject *parent = nullptr); private: Private *d_func() const; }; /** * The LockedPointerInterface lets the client request to disable movements of * the virtual pointer (i.e. the cursor), effectively locking the pointer * to a position. * * It is up to the compositor whether the lock gets activated. - * To activate it needs to use @link{LockedPointerInterface::setLocked}. + * To activate it needs to use {@link LockedPointerInterface::setLocked}. * The compositor needs to ensure that the SurfaceInterface has pointer focus - * and that the pointer is inside the @link{LockedPointerInterface::region} when + * and that the pointer is inside the {@link LockedPointerInterface::region} when * it activates the lock. * * While the lock is active the PointerInterface does no longer emit pointer motion * events, but still emits relative pointer motion events. * * @since 5.29 **/ class KWAYLANDSERVER_EXPORT LockedPointerInterface : public Resource { Q_OBJECT public: virtual ~LockedPointerInterface(); /** * @returns The interface version used by this LockedPointerInterface **/ PointerConstraintsInterfaceVersion interfaceVersion() const; enum class LifeTime { OneShot, Persistent }; LifeTime lifeTime() const; /** * The intersection of this region and the input region of the SurfaceInterface is used * to determine where the pointer must be in order for the lock to activate. * It is up to the compositor whether to warp the pointer or require some kind of * user interaction for the lock to activate. * * If the region is empty the SurfaceInterface input region is used. * * @see regionChanged * @see SurfaceInterface::input **/ QRegion region() const; /** * Whether the Compositor set this pointer lock to be active. * @see setLocked * @see lockedChanged **/ bool isLocked() const; /** * Activates or deactivates the lock. * * A pointer lock can only be activated if the SurfaceInterface * this LockedPointerInterface was created for has pointer focus - * and the pointer is inside the @link{region}. + * and the pointer is inside the {@link region}. * * @param locked Whether the lock should be active * @see isLocked * @see lockedChanged **/ void setLocked(bool locked); Q_SIGNALS: /** * Emitted whenever the region changes. * This happens when the parent SurfaceInterface gets committed * @see region **/ void regionChanged(); /** - * Emitted whenever the @link{isLocked} state changes. + * Emitted whenever the {@link isLocked} state changes. * @see isLocked * @see setLocked **/ void lockedChanged(); protected: class Private; explicit LockedPointerInterface(Private *p, QObject *parent = nullptr); private: Private *d_func() const; friend class SurfaceInterface; }; /** * * The ConfinedPointerInterface gets installed on a SurfaceInterface. * The confinement indicates that the SurfaceInterface wants to confine the * pointer to a region of the SurfaceInterface. * * It is up to the compositor whether the confinement gets activated. - * To activate it needs to use @link{ConfinedPointerInterface::setConfined}. + * To activate it needs to use {@link ConfinedPointerInterface::setConfined}. * The compositor needs to ensure that the SurfaceInterface has pointer focus - * and that the pointer is inside the @link{ConfinedPointerInterface::region} when + * and that the pointer is inside the {@link ConfinedPointerInterface::region} when * it activates the confinement. * * From client side the confinement gets deactivated by destroying the ConfinedPointerInterface. * From compositor side the confinement can be deactivated by setting - * @link{ConfinedPointerInterface::setConfined} to @c false. + * {@link ConfinedPointerInterface::setConfined} to @c false. * * @since 5.29 **/ class KWAYLANDSERVER_EXPORT ConfinedPointerInterface : public Resource { Q_OBJECT public: virtual ~ConfinedPointerInterface(); /** * @returns The interface version used by this ConfinedPointerInterface **/ PointerConstraintsInterfaceVersion interfaceVersion() const; enum class LifeTime { OneShot, Persistent }; LifeTime lifeTime() const; /** * The intersection of this region and the input region of the SurfaceInterface is used * to determine where the pointer must be in order for the confinement to activate. * It is up to the compositor whether to warp the pointer or require some kind of * user interaction for the confinement to activate. * * If the region is empty the SurfaceInterface input region is used. * * @see regionChanged * @see SurfaceInterface::input **/ QRegion region() const; /** * Whether the Compositor set this pointer confinement to be active. * @see setConfined * @see confinedChanged **/ bool isConfined() const; /** * Activates or deactivates the confinement. * * A pointer confinement can only be activated if the SurfaceInterface * this ConfinedPointerInterface was created for has pointer focus - * and the pointer is inside the @link{region}. + * and the pointer is inside the {@link region}. * * @param confined Whether the confinement should be active * @see isConfined * @see confinedChanged **/ void setConfined(bool confined); Q_SIGNALS: /** * Emitted whenever the region changes. * This happens when the parent SurfaceInterface gets committed * @see region **/ void regionChanged(); /** - * Emitted whenever the @link{isConfined} state changes. + * Emitted whenever the {@link isConfined} state changes. * @see isConfined * @see setConfined **/ void confinedChanged(); protected: class Private; explicit ConfinedPointerInterface(Private *p, QObject *parent = nullptr); private: Private *d_func() const; friend class SurfaceInterface; }; } } #endif diff --git a/src/server/seat_interface.h b/src/server/seat_interface.h index b6d92c3..bf11680 100644 --- a/src/server/seat_interface.h +++ b/src/server/seat_interface.h @@ -1,719 +1,719 @@ /******************************************************************** Copyright 2014 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_SERVER_SEAT_INTERFACE_H #define WAYLAND_SERVER_SEAT_INTERFACE_H #include #include #include #include #include "global.h" #include "keyboard_interface.h" #include "pointer_interface.h" #include "touch_interface.h" struct wl_client; struct wl_resource; namespace KWayland { namespace Server { class DataDeviceInterface; class Display; class SurfaceInterface; class TextInputInterface; /** * @brief Represents a Seat on the Wayland Display. * * A Seat is a set of input devices (e.g. Keyboard, Pointer and Touch) the client can connect * to. The server needs to announce which input devices are supported and passes dedicated input * focus to a SurfaceInterface. Only the focused surface receives input events. * * The SeatInterface internally handles enter and release events when setting a focused surface. * Also it handles input translation from global to the local coordination, removing the need from * the user of the API to track the focused surfaces and can just interact with this class. * * To create a SeatInterface use @link Display::createSeat @endlink. Then one can set up what is * supported. Last but not least create needs to be called. * * @code * SeatInterface *seat = display->createSeat(); * // set up * seat->setName(QStringLiteral("seat0")); * seat->setHasPointer(true); * seat->setHasKeyboard(true); * seat->setHasTouch(false); * // now fully create * seat->create(); * @endcode * * To forward input events one needs to set the focused surface, update time stamp and then * forward the actual events: * * @code * // example for pointer * seat->setFocusedPointerSurface(surface, QPointF(100, 200)); // surface at it's global position * seat->setTimestamp(100); * seat->setPointerPos(QPointF(350, 210)); // global pos, local pos in surface: 250,10 * seat->setTimestamp(110); * seat->pointerButtonPressed(Qt::LeftButton); * seat->setTimestamp(120); * seat->pointerButtonReleased(Qt::LeftButton); * @endcode * * @see KeyboardInterface * @see PointerInterface * @see TouchInterface * @see SurfaceInterface **/ class KWAYLANDSERVER_EXPORT SeatInterface : public Global { Q_OBJECT /** * The name of the Seat **/ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) /** * Whether the SeatInterface supports a pointer device. **/ Q_PROPERTY(bool pointer READ hasPointer WRITE setHasPointer NOTIFY hasPointerChanged) /** * Whether the SeatInterface supports a keyboard device. **/ Q_PROPERTY(bool keyboard READ hasKeyboard WRITE setHasKeyboard NOTIFY hasKeyboardChanged) /** * Whether the SeatInterface supports a touch device. * @deprecated use touch **/ Q_PROPERTY(bool tourch READ hasTouch WRITE setHasTouch NOTIFY hasTouchChanged) /** * Whether the SeatInterface supports a touch device. **/ Q_PROPERTY(bool touch READ hasTouch WRITE setHasTouch NOTIFY hasTouchChanged) /** * The global pointer position. **/ Q_PROPERTY(QPointF pointerPos READ pointerPos WRITE setPointerPos NOTIFY pointerPosChanged) /** * The current timestamp passed to the input events. **/ Q_PROPERTY(quint32 timestamp READ timestamp WRITE setTimestamp NOTIFY timestampChanged) public: virtual ~SeatInterface(); QString name() const; bool hasPointer() const; bool hasKeyboard() const; bool hasTouch() const; void setName(const QString &name); void setHasPointer(bool has); void setHasKeyboard(bool has); void setHasTouch(bool has); void setTimestamp(quint32 time); quint32 timestamp() const; /** * @name Drag'n'Drop related methods **/ ///@{ /** * @returns whether there is currently a drag'n'drop going on. * @since 5.6 * @see isDragPointer * @see isDragTouch * @see dragStarted * @see dragEnded **/ bool isDrag() const; /** * @returns whether the drag'n'drop is operated through the pointer device * @since 5.6 * @see isDrag * @see isDragTouch **/ bool isDragPointer() const; /** * @returns whether the drag'n'drop is operated through the touch device * @since 5.6 * @see isDrag * @see isDragPointer **/ bool isDragTouch() const; /** * @returns The transformation applied to go from global to local coordinates for drag motion events. * @see dragSurfaceTransformation * @since 5.6 **/ QMatrix4x4 dragSurfaceTransformation() const; /** * @returns The currently focused Surface for drag motion events. * @since 5.6 * @see dragSurfaceTransformation * @see dragSurfaceChanged **/ SurfaceInterface *dragSurface() const; /** * @returns The PointerInterface which triggered the drag operation * @since 5.6 * @see isDragPointer **/ PointerInterface *dragPointer() const; /** * @returns The DataDeviceInterface which started the drag and drop operation. * @see isDrag * @since 5.6 **/ DataDeviceInterface *dragSource() const; /** * Sets the current drag target to @p surface. * * Sends a drag leave event to the current target and an enter event to @p surface. * The enter position is derived from @p globalPosition and transformed by @p inputTransformation. * @since 5.6 **/ void setDragTarget(SurfaceInterface *surface, const QPointF &globalPosition, const QMatrix4x4 &inputTransformation); /** * Sets the current drag target to @p surface. * * Sends a drag leave event to the current target and an enter event to @p surface. * The enter position is derived from current global position and transformed by @p inputTransformation. * @since 5.6 **/ void setDragTarget(SurfaceInterface *surface, const QMatrix4x4 &inputTransformation = QMatrix4x4()); ///@} /** * @name Pointer related methods **/ ///@{ /** * Updates the global pointer @p pos. * * Sends a pointer motion event to the focused pointer surface. **/ void setPointerPos(const QPointF &pos); /** * @returns the global pointer position **/ QPointF pointerPos() const; /** * Sets the focused pointer @p surface. * All pointer events will be sent to the @p surface till a new focused pointer surface gets * installed. When the focus pointer surface changes a leave event is sent to the previous * focused surface. * * To unset the focused pointer surface pass @c nullptr as @p surface. * * Pointer motion events are adjusted to the local position based on the @p surfacePosition. * If the surface changes it's position in the global coordinate system * use setFocusedPointerSurfacePosition to update. * The surface position is used to create the base transformation matrix to go from global * to surface local coordinates. The default generated matrix is a translation with * negative @p surfacePosition. * * @param surface The surface which should become the new focused pointer surface. * @param surfacePosition The position of the surface in the global coordinate system * * @see setPointerPos * @see focucedPointerSurface * @see focusedPointer * @see setFocusedPointerSurfacePosition * @see focusedPointerSurfacePosition * @see setFocusedPointerSurfaceTransformation * @see focusedPointerSurfaceTransformation **/ void setFocusedPointerSurface(SurfaceInterface *surface, const QPointF &surfacePosition = QPoint()); /** * Sets the focused pointer @p surface. * All pointer events will be sent to the @p surface till a new focused pointer surface gets * installed. When the focus pointer surface changes a leave event is sent to the previous * focused surface. * * To unset the focused pointer surface pass @c nullptr as @p surface. * * Pointer motion events are adjusted to the local position based on the @p transformation. * If the surface changes it's position in the global coordinate system * use setFocusedPointerSurfaceTransformation to update. * * @param surface The surface which should become the new focused pointer surface. * @param transformation The transformation to transform global into local coordinates * * @see setPointerPos * @see focucedPointerSurface * @see focusedPointer * @see setFocusedPointerSurfacePosition * @see focusedPointerSurfacePosition * @see setFocusedPointerSurfaceTransformation * @see focusedPointerSurfaceTransformation * @since 5.6 **/ void setFocusedPointerSurface(SurfaceInterface *surface, const QMatrix4x4 &transformation); /** * @returns The currently focused pointer surface, that is the surface receiving pointer events. * @see setFocusedPointerSurface **/ SurfaceInterface *focusedPointerSurface() const; /** * @returns The PointerInterface belonging to the focused pointer surface, if any. * @see setFocusedPointerSurface **/ PointerInterface *focusedPointer() const; /** * Updates the global position of the currently focused pointer surface. * * Updating the focused surface position also generates a new transformation matrix. * The default generated matrix is a translation with negative @p surfacePosition. * If a different transformation is required a dedicated call to * @link setFocusedPointerSurfaceTransformation is required. * * @param surfacePosition The new global position of the focused pointer surface * @see focusedPointerSurface * @see setFocusedPointerSurface * @see focusedPointerSurfaceTransformation * @see setFocusedPointerSurfaceTransformation **/ void setFocusedPointerSurfacePosition(const QPointF &surfacePosition); /** * @returns The position of the focused pointer surface in global coordinates. * @see setFocusedPointerSurfacePosition * @see setFocusedPointerSurface * @see focusedPointerSurfaceTransformation **/ QPointF focusedPointerSurfacePosition() const; /** * Sets the @p transformation for going from global to local coordinates. * * The default transformation gets generated from the surface position and reset whenever * the surface position changes. * * @see focusedPointerSurfaceTransformation * @see focusedPointerSurfacePosition * @see setFocusedPointerSurfacePosition * @since 5.6 **/ void setFocusedPointerSurfaceTransformation(const QMatrix4x4 &transformation); /** * @returns The transformation applied to pointer position to go from global to local coordinates. * @see setFocusedPointerSurfaceTransformation * @since 5.6 **/ QMatrix4x4 focusedPointerSurfaceTransformation() const; /** * Marks the @p button as pressed. * * If there is a focused pointer surface a button pressed event is sent to it. * * @param button The Linux button code **/ void pointerButtonPressed(quint32 button); /** * @overload **/ void pointerButtonPressed(Qt::MouseButton button); /** * Marks the @p button as released. * * If there is a focused pointer surface a button release event is sent to it. * * @param button The Linux button code **/ void pointerButtonReleased(quint32 button); /** * @overload **/ void pointerButtonReleased(Qt::MouseButton button); /** * @returns whether the @p button is pressed **/ bool isPointerButtonPressed(quint32 button) const; /** * @returns whether the @p button is pressed **/ bool isPointerButtonPressed(Qt::MouseButton button) const; /** * @returns the last serial for @p button. **/ quint32 pointerButtonSerial(quint32 button) const; /** * @returns the last serial for @p button. **/ quint32 pointerButtonSerial(Qt::MouseButton button) const; void pointerAxis(Qt::Orientation orientation, quint32 delta); /** * @returns true if there is a pressed button with the given @p serial * @since 5.6 **/ bool hasImplicitPointerGrab(quint32 serial) const; /** * A relative motion is in the same dimension as regular motion events, * except they do not represent an absolute position. For example, * moving a pointer from (x, y) to (x', y') would have the equivalent * relative motion (x' - x, y' - y). If a pointer motion caused the * absolute pointer position to be clipped by for example the edge of the * monitor, the relative motion is unaffected by the clipping and will * represent the unclipped motion. * * This method also contains non-accelerated motion deltas (@p deltaNonAccelerated). * The non-accelerated delta is, when applicable, the regular pointer motion * delta as it was before having applied motion acceleration and other * transformations such as normalization. * * Note that the non-accelerated delta does not represent 'raw' events as * they were read from some device. Pointer motion acceleration is device- * and configuration-specific and non-accelerated deltas and accelerated * deltas may have the same value on some devices. * - * Relative motions are not coupled to wl_pointer.motion events (see @link{setPointerPos}, + * Relative motions are not coupled to wl_pointer.motion events (see {@link setPointerPos}, * and can be sent in combination with such events, but also independently. There may * also be scenarios where wl_pointer.motion is sent, but there is no * relative motion. The order of an absolute and relative motion event * originating from the same physical motion is not guaranteed. * * Sending relative pointer events only makes sense if the RelativePointerManagerInterface * is created on the Display. * * @param delta Motion vector * @param deltaNonAccelerated non-accelerated motion vector * @param microseconds timestamp with microseconds granularity * @see setPointerPos * @since 5.28 **/ void relativePointerMotion(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 microseconds); /** * Starts a multi-finger swipe gesture for the currently focused pointer surface. * * Such gestures are normally reported through dedicated input devices such as touchpads. * * The gesture is usually initiated by multiple fingers moving in the * same direction but once initiated the direction may change. * The precise conditions of when such a gesture is detected are * implementation-dependent. * * Only one gesture (either swipe or pinch) can be active at a given time. * * @param fingerCount The number of fingers involved in this multi-finger touchpad gesture * * @see PointerGesturesInterface * @see focusedPointerSurface * @see updatePointerSwipeGesture * @see endPointerSwipeGesture * @see cancelPointerSwipeGesture * @see startPointerPinchGesture * @since 5.29 **/ void startPointerSwipeGesture(quint32 fingerCount); /** * The position of the logical center of the currently active multi-finger swipe gesture changes. * * @param delta coordinates are relative coordinates of the logical center of the gesture compared to the previous event. * @see startPointerSwipeGesture * @see endPointerSwipeGesture * @see cancelPointerSwipeGesture * @since 5.29 **/ void updatePointerSwipeGesture(const QSizeF &delta); /** * The multi-finger swipe gesture ended. This may happen when one or more fingers are lifted. * @see startPointerSwipeGesture * @see updatePointerSwipeGesture * @see cancelPointerSwipeGesture * @see 5.29 **/ void endPointerSwipeGesture(); /** * The multi-finger swipe gestures ended and got cancelled by the Wayland compositor. * @see startPointerSwipeGesture * @see updatePointerSwipeGesture * @see endPointerSwipeGesture * @since 5.29 **/ void cancelPointerSwipeGesture(); /** * Starts a multi-finch pinch gesture for the currently focused pointer surface. * * Such gestures are normally reported through dedicated input devices such as touchpads. * * The gesture is usually initiated by multiple fingers moving towards * each other or away from each other, or by two or more fingers rotating * around a logical center of gravity. The precise conditions of when * such a gesture is detected are implementation-dependent. * * Only one gesture (either swipe or pinch) can be active at a given time. * * @param fingerCount The number of fingers involved in this multi-touch touchpad gesture * * @see PointerGesturesInterface * @see focusedPointerSurface * @see updatePointerPinchGesture * @see endPointerPinchGesture * @see cancelPointerPinchGesture * @see startPointerSwipeGesture * @since 5.29 **/ void startPointerPinchGesture(quint32 fingerCount); /** * The position of the logical center, the rotation or the relative scale of this * multi-finger pinch gesture changes. * * @param delta coordinates are relative coordinates of the logical center of the gesture compared to the previous event. * @param scale an absolute scale compared to the gesture start * @param rotation relative angle in degrees clockwise compared to the previous start of update * @see startPointerPinchGesture * @see endPointerPinchGesture * @see cancelPointerPinchGesture * @since 5.29 **/ void updatePointerPinchGesture(const QSizeF &delta, qreal scale, qreal rotation); /** * * @see startPointerPinchGesture * @see updatePointerPinchGesture * @see cancelPointerPinchGesture * @since 5.29 **/ void endPointerPinchGesture(); /** * * @see startPointerPinchGesture * @see updatePointerPinchGesture * @see endPointerPinchGesture * @since 5.29 **/ void cancelPointerPinchGesture(); ///@} /** * @name keyboard related methods **/ ///@{ void setKeymap(int fd, quint32 size); void keyPressed(quint32 key); void keyReleased(quint32 key); void updateKeyboardModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group); /** * Sets the key repeat information to be forwarded to all bound keyboards. * * To disable key repeat set a @p charactersPerSecond of @c 0. * * Requires wl_seat version 4. * * @param charactersPerSecond The characters per second rate, value of @c 0 disables key repeating * @param delay The delay on key press before starting repeating keys * * @since 5.5 ***/ void setKeyRepeatInfo(qint32 charactersPerSecond, qint32 delay); quint32 depressedModifiers() const; quint32 latchedModifiers() const; quint32 lockedModifiers() const; quint32 groupModifiers() const; quint32 lastModifiersSerial() const; int keymapFileDescriptor() const; quint32 keymapSize() const; bool isKeymapXkbCompatible() const; QVector pressedKeys() const; /** * @returns The key repeat in character per second * @since 5.5 * @see setKeyRepeatInfo * @see keyRepeatDelay **/ qint32 keyRepeatRate() const; /** * @returns The delay on key press before starting repeating keys * @since 5.5 * @see keyRepeatRate * @see setKeyRepeatInfo **/ qint32 keyRepeatDelay() const; /** * Passes keyboard focus to @p surface. * * If the SeatInterface has the keyboard capability, also the focused * text input surface will be set to @p surface. * * @see focusedKeyboardSurface * @see hasKeyboard * @see setFocusedTextInputSurface **/ void setFocusedKeyboardSurface(SurfaceInterface *surface); SurfaceInterface *focusedKeyboardSurface() const; KeyboardInterface *focusedKeyboard() const; ///@} /** * @name touch related methods **/ ///@{ void setFocusedTouchSurface(SurfaceInterface *surface, const QPointF &surfacePosition = QPointF()); SurfaceInterface *focusedTouchSurface() const; TouchInterface *focusedTouch() const; void setFocusedTouchSurfacePosition(const QPointF &surfacePosition); QPointF focusedTouchSurfacePosition() const; qint32 touchDown(const QPointF &globalPosition); void touchUp(qint32 id); void touchMove(qint32 id, const QPointF &globalPosition); void touchFrame(); void cancelTouchSequence(); bool isTouchSequence() const; ///@} /** * @name Text input related methods. **/ ///@{ /** * Passes text input focus to @p surface. * * If the SeatInterface has the keyboard capability this method will * be invoked automatically when setting the focused keyboard surface. * * In case there is a TextInputInterface for the @p surface, the enter * event will be triggered on the TextInputInterface for @p surface. * The focusedTextInput will be set to that TextInputInterface. If there * is no TextInputInterface for that @p surface, it might get updated later on. * In both cases the signal focusedTextInputChanged will be emitted. * * @see focusedTextInputSurface * @see focusedTextInput * @see focusedTextInputChanged * @see setFocusedKeyboardSurface * @since 5.23 **/ void setFocusedTextInputSurface(SurfaceInterface *surface); /** * @returns The SurfaceInterface which is currently focused for text input. * @see setFocusedTextInputSurface * @since 5.23 **/ SurfaceInterface *focusedTextInputSurface() const; /** * The currently focused text input, may be @c null even if there is a * focused text input surface set. * - * The focused text input might not be enabled for the @link{focusedTextInputSurface}. + * The focused text input might not be enabled for the {@link focusedTextInputSurface}. * It is recommended to check the enabled state before interacting with the * TextInputInterface. * * @see focusedTextInputChanged * @see focusedTextInputSurface * @since 5.23 **/ TextInputInterface *focusedTextInput() const; ///@} /** * @returns The DataDeviceInterface holding the current clipboard selection. * @since 5.24 * @see setSelection **/ DataDeviceInterface *selection() const; /** * This method allows to manually set the @p dataDevice for the current clipboard selection. * The clipboard selection is handled automatically in SeatInterface. * If a DataDeviceInterface belonging to the current focused KeyboardInterface * sets a selection, the current clipboard selection will be updated automatically. * With this method it's possible to override the automatic clipboard update for * e.g. the case of a clipboard manager. * * @param dataDevice Sets the current clipboard selection. * @see selection * @since 5.24 **/ void setSelection(DataDeviceInterface *dataDevice); static SeatInterface *get(wl_resource *native); Q_SIGNALS: void nameChanged(const QString&); void hasPointerChanged(bool); void hasKeyboardChanged(bool); void hasTouchChanged(bool); void pointerPosChanged(const QPointF &pos); void timestampChanged(quint32); void pointerCreated(KWayland::Server::PointerInterface*); void keyboardCreated(KWayland::Server::KeyboardInterface*); void touchCreated(KWayland::Server::TouchInterface*); /** * Emitted whenever the focused pointer changes * @since 5.6 **/ void focusedPointerChanged(KWayland::Server::PointerInterface*); /** * Emitted when a drag'n'drop operation is started * @since 5.6 * @see dragEnded **/ void dragStarted(); /** * Emitted when a drag'n'drop operation ended, either by dropping or canceling. * @since 5.6 * @see dragStarted **/ void dragEnded(); /** * Emitted whenever the drag surface for motion events changed. * @since 5.6 * @see dragSurface **/ void dragSurfaceChanged(); /** * Emitted whenever the focused text input changed. * @see focusedTextInput * @since 5.23 **/ void focusedTextInputChanged(); private: friend class Display; friend class DataDeviceManagerInterface; friend class TextInputManagerUnstableV0Interface; friend class TextInputManagerUnstableV2Interface; explicit SeatInterface(Display *display, QObject *parent); class Private; Private *d_func() const; }; } } Q_DECLARE_METATYPE(KWayland::Server::SeatInterface*) #endif diff --git a/src/server/subcompositor_interface.h b/src/server/subcompositor_interface.h index 4857ff5..0547526 100644 --- a/src/server/subcompositor_interface.h +++ b/src/server/subcompositor_interface.h @@ -1,124 +1,124 @@ /******************************************************************** Copyright 2014 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_SERVER_SUBCOMPOSITOR_INTERFACE_H #define WAYLAND_SERVER_SUBCOMPOSITOR_INTERFACE_H #include #include #include #include "global.h" #include "resource.h" struct wl_resource; namespace KWayland { namespace Server { class Display; class SurfaceInterface; class SubSurfaceInterface; class KWAYLANDSERVER_EXPORT SubCompositorInterface : public Global { Q_OBJECT public: virtual ~SubCompositorInterface(); Q_SIGNALS: void subSurfaceCreated(KWayland::Server::SubSurfaceInterface*); private: explicit SubCompositorInterface(Display *display, QObject *parent = nullptr); friend class Display; class Private; }; class KWAYLANDSERVER_EXPORT SubSurfaceInterface : public Resource { Q_OBJECT Q_PROPERTY(QPoint position READ position NOTIFY positionChanged) Q_PROPERTY(KWayland::Server::SubSurfaceInterface::Mode mode READ mode NOTIFY modeChanged) public: virtual ~SubSurfaceInterface(); QPoint position() const; enum class Mode { Synchronized, Desynchronized }; Mode mode() const; /** * Whether this SubSurfaceInterface is in synchronized mode. - * A SubSurface is in synchronized mode if either @link mode is + * A SubSurface is in synchronized mode if either {@link mode} is * @c Mode::Synchronized or if the parent surface is in synchronized * mode. If a SubSurfaceInterface is in synchronized mode all child * SubSurfaceInterfaces are also in synchronized mode ignoring the actual mode. * @returns Whether this SubSurfaceInterface is in synchronized mode. * @see mode * @since 5.22 **/ bool isSynchronized() const; // TODO: remove with ABI break (KF6) QPointer surface(); /** * @returns The surface this SubSurfaceInterface was created on. * @since 5.22 **/ QPointer surface() const; // TODO: remove with ABI break (KF6) QPointer parentSurface(); /** * @returns The parent surface for which this SubSurfaceInterface is a child * @since 5.22 **/ QPointer parentSurface() const; /** * @returns the main surface for the sub-surface tree, that is the first surface without a parent * @since 5.22 **/ QPointer mainSurface() const; Q_SIGNALS: void positionChanged(const QPoint&); void modeChanged(KWayland::Server::SubSurfaceInterface::Mode); private: friend class SubCompositorInterface; friend class SurfaceInterface; explicit SubSurfaceInterface(SubCompositorInterface *parent, wl_resource *parentResource); class Private; Private *d_func() const; }; } } Q_DECLARE_METATYPE(KWayland::Server::SubSurfaceInterface::Mode) #endif diff --git a/src/server/surface_interface.h b/src/server/surface_interface.h index 509e536..c7f2fc6 100644 --- a/src/server/surface_interface.h +++ b/src/server/surface_interface.h @@ -1,330 +1,330 @@ /******************************************************************** Copyright 2014 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . *********************************************************************/ #ifndef WAYLAND_SERVER_SURFACE_INTERFACE_H #define WAYLAND_SERVER_SURFACE_INTERFACE_H #include "resource.h" #include "output_interface.h" #include #include #include #include namespace KWayland { namespace Server { class BlurManagerInterface; class BlurInterface; class BufferInterface; class ConfinedPointerInterface; class ContrastInterface; class ContrastManagerInterface; class CompositorInterface; class LockedPointerInterface; class PointerConstraintsUnstableV1Interface; class ShadowManagerInterface; class ShadowInterface; class SlideInterface; class SubSurfaceInterface; /** * @brief Resource representing a wl_surface. * * The SurfaceInterface gets created by the CompositorInterface. A SurfaceInterface normally * takes up a role by being "attached" to either a ShellSurfaceInterface, a SubSurfaceInterface * or a Cursor. * * The implementation of the SurfaceInterface does not only wrap the features exposed by wl_surface, * but goes further by integrating the information added to a SurfaceInterface by other interfaces. * This should make interacting from the server easier, it only needs to monitor the SurfaceInterface * and does not need to track each specific interface. * * The SurfaceInterface takes care of reference/unreferencing the BufferInterface attached to it. * As long as a BufferInterface is attached, the released signal won't be sent. If the BufferInterface * is no longer needed by the SurfaceInterface, it will get unreferenced and might be automatically * deleted (if it's no longer referenced). * * @see CompositorInterface * @see BufferInterface * @see SubSurfaceInterface * @see BlurInterface * @see ContrastInterface * @see ShadowInterface * @see SlideInterface **/ class KWAYLANDSERVER_EXPORT SurfaceInterface : public Resource { Q_OBJECT /** * The current damage region. **/ Q_PROPERTY(QRegion damage READ damage NOTIFY damaged) /** * The opaque region for a translucent buffer. **/ Q_PROPERTY(QRegion opaque READ opaque NOTIFY opaqueChanged) /** * The current input region. **/ Q_PROPERTY(QRegion input READ input NOTIFY inputChanged) Q_PROPERTY(qint32 scale READ scale NOTIFY scaleChanged) Q_PROPERTY(KWayland::Server::OutputInterface::Transform transform READ transform NOTIFY transformChanged) Q_PROPERTY(QSize size READ size NOTIFY sizeChanged) public: virtual ~SurfaceInterface(); void frameRendered(quint32 msec); QRegion damage() const; QRegion opaque() const; QRegion input() const; /** * Use Surface::inputIsInfinite instead. * @deprecated * @see inputIsInfinite */ bool inputIsInfitine() const; /** * Replaces Surface::inputIsInfitine instead. * @since 5.5 */ bool inputIsInfinite() const; qint32 scale() const; OutputInterface::Transform transform() const; /** * @returns the current BufferInterface, might be @c nullptr. **/ BufferInterface *buffer(); QPoint offset() const; /** * The size of the Surface in global compositor space. * @see For buffer size use BufferInterface::size * from SurfaceInterface::buffer * @since 5.3 **/ QSize size() const; /** * @returns The SubSurface for this Surface in case there is one. **/ QPointer subSurface() const; /** * @returns Children in stacking order from bottom (first) to top (last). **/ QList> childSubSurfaces() const; /** * @returns The Shadow for this Surface. * @since 5.4 **/ QPointer shadow() const; /** * @returns The Blur for this Surface. * @since 5.5 **/ QPointer blur() const; /** * @returns The Slide for this Surface. * @since 5.5 **/ QPointer slideOnShowHide() const; /** * @returns The Contrast for this Surface. * @since 5.5 **/ QPointer contrast() const; /** * Whether the SurfaceInterface is currently considered to be mapped. * A SurfaceInterface is mapped if it has a non-null BufferInterface attached. * If the SurfaceInterface references a SubSurfaceInterface it is only considered * mapped if it has a BufferInterface attached and the parent SurfaceInterface is mapped. * * @returns Whether the SurfaceInterface is currently mapped * @since 5.22 **/ bool isMapped() const; /** - * Returns the tracked damage since the last call to @link resetTrackedDamage. - * In contrast to @link damage this method does not reset the damage when + * Returns the tracked damage since the last call to {@link resetTrackedDamage}. + * In contrast to {@link damage} this method does not reset the damage when * a new BufferInterface gets committed. This allows a compositor to properly * track the damage over multiple commits even if it didn't render each new * BufferInterface. * - * The damage gets reset whenever @link resetTrackedDamage is called. + * The damage gets reset whenever {@link resetTrackedDamage} is called. * This allows a compositor to properly track the change in its rendering scene * for this SurfaceInterface. After it updates its internal state (e.g. by creating - * an OpenGL texture from the BufferInterface) it can invoke @link resetTrackedDamage + * an OpenGL texture from the BufferInterface) it can invoke {@link resetTrackedDamage} * and the damage tracker will start to track further damage changes. * * @returns Combined damage since last call to resetTrackedDamage * @see damage * @see resetTrackedDamage * @since 5.22 **/ QRegion trackedDamage() const; /** * Reset the damage tracking. The compositor should invoke this method once it updated * it's internal state and processed the current damage. * @see trackedDamage * @since 5.22 **/ void resetTrackedDamage(); /** * Finds the SurfaceInterface at the given @p position in surface-local coordinates. * This can be either a descendant SurfaceInterface honoring the stacking order or * the SurfaceInterface itself if its geometry contains the given @p position. * * If no such SurfaceInterface is found, e.g. because the SurfaceInterface is unmapped, * @c nullptr is returned. * * @param position The position in surface-local coordinates * @returns Child surface at the given @p position or surface itself at the position, might be @c nullptr * @since 5.22 **/ SurfaceInterface *surfaceAt(const QPointF &position); /** * Sets the @p outputs this SurfaceInterface overlaps with, may be empty. * * The compositor should update whenever the SurfaceInterface becomes visible on * an OutputInterface by e.g. getting (un)mapped, resized, moved, etc. * * @see outputs * @since 5.27 **/ void setOutputs(const QVector &outputs); /** * @returns All OutputInterfaces the SurfaceInterface is on. * @see setOutputs * @since 5.27 **/ QVector outputs() const; /** * Pointer confinement installed on this SurfaceInterface. * @see pointerConstraintsChanged * @since 5.29 **/ QPointer confinedPointer() const; /** * Pointer lock installed on this SurfaceInterface. * @see pointerConstraintsChanged * @since 5.29 **/ QPointer lockedPointer() const; /** * @returns The SurfaceInterface for the @p native resource. **/ static SurfaceInterface *get(wl_resource *native); /** * @returns The SurfaceInterface with given @p id for @p client, if it exists, otherwise @c nullptr. * @since 5.3 **/ static SurfaceInterface *get(quint32 id, const ClientConnection *client); Q_SIGNALS: /** * Emitted whenever the SurfaceInterface got damaged. * The signal is only emitted during the commit of state. * A damage means that a new BufferInterface got attached. * * @see buffer * @see damage **/ void damaged(const QRegion&); void opaqueChanged(const QRegion&); void inputChanged(const QRegion&); void scaleChanged(qint32); void transformChanged(KWayland::Server::OutputInterface::Transform); /** * Emitted when the Surface removes its content **/ void unmapped(); /** * @since 5.3 **/ void sizeChanged(); /** * @since 5.4 **/ void shadowChanged(); /** * @since 5.5 **/ void blurChanged(); /** * @since 5.5 **/ void slideOnShowHideChanged(); /** * @since 5.5 **/ void contrastChanged(); /** * Emitted whenever the tree of sub-surfaces changes in a way which requires a repaint. * @since 5.22 **/ void subSurfaceTreeChanged(); /** * Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface. * * The pointer constraint does not get activated, the compositor needs to activate * the lock/confinement. * * @see confinedPointer * @see lockedPointer * @since 5.29 **/ void pointerConstraintsChanged(); private: friend class CompositorInterface; friend class SubSurfaceInterface; friend class ShadowManagerInterface; friend class BlurManagerInterface; friend class SlideManagerInterface; friend class ContrastManagerInterface; friend class PointerConstraintsUnstableV1Interface; explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource); class Private; Private *d_func() const; }; } } Q_DECLARE_METATYPE(KWayland::Server::SurfaceInterface*) #endif diff --git a/src/server/textinput_interface.h b/src/server/textinput_interface.h index a0f8c02..c2ed07a 100644 --- a/src/server/textinput_interface.h +++ b/src/server/textinput_interface.h @@ -1,439 +1,439 @@ /**************************************************************************** Copyright 2016 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . ****************************************************************************/ #ifndef KWAYLAND_SERVER_TEXTINPUT_INTERFACE_H #define KWAYLAND_SERVER_TEXTINPUT_INTERFACE_H #include "global.h" #include "resource.h" #include namespace KWayland { namespace Server { class Display; class SeatInterface; class SurfaceInterface; class TextInputInterface; /** * Enum describing the different InterfaceVersion encapsulated in this implementation * * @since 5.23 **/ enum class TextInputInterfaceVersion { /** * wl_text_input as the non-standardized version **/ UnstableV0, /** * not supported version **/ UnstableV1, /** * zwp_text_input_v2 as used by Qt 5.7 **/ UnstableV2 }; /** * @brief Represent the Global for the interface. * * The class can represent different interfaces. Which concrete interface is represented - * can be determined through @link{interfaceVersion}. + * can be determined through {@link interfaceVersion}. * - * To create a TextInputManagerInterface use @link{Display::createTextInputManager} + * To create a TextInputManagerInterface use {@link Display::createTextInputManager} * * @since 5.23 **/ class KWAYLANDSERVER_EXPORT TextInputManagerInterface : public Global { Q_OBJECT public: virtual ~TextInputManagerInterface(); /** * @returns The interface version used by this TextInputManagerInterface **/ TextInputInterfaceVersion interfaceVersion() const; protected: class Private; explicit TextInputManagerInterface(Private *d, QObject *parent = nullptr); private: Private *d_func() const; }; /** * @brief Represents a generic Resource for a text input object. * * This class does not directly correspond to a Wayland resource, but is a generic contract * for any interface which implements a text input, e.g. the unstable wl_text_input interface. * * It does not expose the actual interface to cover up the fact that the interface is unstable - * and might change. If one needs to know the actual used protocol, use the method @link{interfaceVersion}. + * and might change. If one needs to know the actual used protocol, use the method {@link interfaceVersion}. * - * A TextInputInterface gets created by the @link{TextInputManagerInterface}. The individual + * A TextInputInterface gets created by the {@link TextInputManagerInterface}. The individual * instances are not exposed directly. The SeatInterface provides access to the currently active * TextInputInterface. This is evaluated automatically based on which SurfaceInterface has * keyboard focus. * * @see TextInputManagerInterface * @see SeatInterface * @since 5.23 **/ class KWAYLANDSERVER_EXPORT TextInputInterface : public Resource { Q_OBJECT public: virtual ~TextInputInterface(); /** * ContentHint allows to modify the behavior of the text input. **/ enum class ContentHint : uint32_t { /** * no special behaviour */ None = 0, /** * suggest word completions */ AutoCompletion = 1 << 0, /** * suggest word corrections */ AutoCorrection = 1 << 1, /** * switch to uppercase letters at the start of a sentence */ AutoCapitalization = 1 << 2, /** * prefer lowercase letters */ LowerCase = 1 << 3, /** * prefer uppercase letters */ UpperCase = 1 << 4, /** * prefer casing for titles and headings (can be language dependent) */ TitleCase = 1 << 5, /** * characters should be hidden */ HiddenText = 1 << 6, /** * typed text should not be stored */ SensitiveData = 1 << 7, /** * just latin characters should be entered */ Latin = 1 << 8, /** * the text input is multi line */ MultiLine = 1 << 9 }; Q_DECLARE_FLAGS(ContentHints, ContentHint) /** * The ContentPurpose allows to specify the primary purpose of a text input. * * This allows an input method to show special purpose input panels with * extra characters or to disallow some characters. */ enum class ContentPurpose : uint32_t { /** * default input, allowing all characters */ Normal, /** * allow only alphabetic characters **/ Alpha, /** * allow only digits */ Digits, /** * input a number (including decimal separator and sign) */ Number, /** * input a phone number */ Phone, /** * input an URL */ Url, /** * input an email address **/ Email, /** * input a name of a person */ Name, /** * input a password */ Password, /** * input a date */ Date, /** * input a time */ Time, /** * input a date and time */ DateTime, /** * input for a terminal */ Terminal }; /** * @returns The interface version used by this TextInputInterface **/ TextInputInterfaceVersion interfaceVersion() const; /** * The preferred language as a RFC-3066 format language tag. * * This can be used by the server to show a language specific virtual keyboard layout. * @see preferredLanguageChanged **/ QByteArray preferredLanguage() const; /** * @see cursorRectangleChanged **/ QRect cursorRectangle() const; /** * @see contentTypeChanged **/ ContentPurpose contentPurpose() const; /** *@see contentTypeChanged **/ ContentHints contentHints() const; /** * @returns The plain surrounding text around the input position. * @see surroundingTextChanged * @see surroundingTextCursorPosition * @see surroundingTextSelectionAnchor **/ QByteArray surroundingText() const; /** - * @returns The byte offset of current cursor position within the @link {surroundingText} + * @returns The byte offset of current cursor position within the {@link surroundingText} * @see surroundingText * @see surroundingTextChanged **/ qint32 surroundingTextCursorPosition() const; /** - * The byte offset of the selection anchor within the @link{surroundingText}. + * The byte offset of the selection anchor within the {@link surroundingText}. * * If there is no selected text this is the same as cursor. * @return The byte offset of the selection anchor * @see surroundingText * @see surroundingTextChanged **/ qint32 surroundingTextSelectionAnchor() const; /** * @return The surface the TextInputInterface is enabled on * @see isEnabled * @see enabledChanged **/ QPointer surface() const; /** * @return Whether the TextInputInterface is currently enabled for a SurfaceInterface. * @see surface * @see enabledChanged **/ bool isEnabled() const; /** * Notify when a new composing @p text (pre-edit) should be set around the * current cursor position. Any previously set composing text should * be removed. * * The @p commitText can be used to replace the preedit text on reset * (for example on unfocus). * * @param text The new utf8-encoded pre-edit text * @param commitText Utf8-encoded text to replace preedit text on reset * @see commit * @see preEditCursor **/ void preEdit(const QByteArray &text, const QByteArray &commitText); /** * Notify when @p text should be inserted into the editor widget. * The text to commit could be either just a single character after a key press or the - * result of some composing (@link{preEdit}). It could be also an empty text - * when some text should be removed (see @link{deleteSurroundingText}) or when - * the input cursor should be moved (see @link{cursorPosition}). + * result of some composing ({@link preEdit}). It could be also an empty text + * when some text should be removed (see {@link deleteSurroundingText}) or when + * the input cursor should be moved (see {@link cursorPosition}). * * Any previously set composing text should be removed. * @param text The utf8-encoded text to be inserted into the editor widget * @see preEdit * @see deleteSurroundingText **/ void commit(const QByteArray &text); /** * Sets the cursor position inside the composing text (as byte offset) relative to the * start of the composing text. When @p index is a negative number no cursor is shown. * - * The Client applies the @p index together with @link{preEdit}. + * The Client applies the @p index together with {@link preEdit}. * @param index The cursor position relative to the start of the composing text * @see preEdit **/ void setPreEditCursor(qint32 index); /** * Notify when the text around the current cursor position should be deleted. * * The Client processes this event together with the commit string * * @param beforeLength length of text before current cursor positon. * @param afterLength length of text after current cursor positon. * @see commit **/ void deleteSurroundingText(quint32 beforeLength, quint32 afterLength); /** * Notify when the cursor @p index or @p anchor position should be modified. * * The Client applies this together with the commit string. **/ void setCursorPosition(qint32 index, qint32 anchor); /** * Sets the text @p direction of input text. **/ void setTextDirection(Qt::LayoutDirection direction); void keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers = Qt::NoModifier); void keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers = Qt::NoModifier); /** * Informs the client about changes in the visibility of the input panel (virtual keyboard). * * The @p overlappedSurfaceArea defines the area overlapped by the input panel (virtual keyboard) * on the SurfaceInterface having the text focus in surface local coordinates. * * @param visible Whether the input panel is currently visible * @param overlappedSurfaceArea The overlapping area in surface local coordinates **/ void setInputPanelState(bool visible, const QRect &overlappedSurfaceArea); /** * Sets the language of the input text. The @p languageTag is a RFC-3066 format language tag. **/ void setLanguage(const QByteArray &languageTag); Q_SIGNALS: /** * Requests input panels (virtual keyboard) to show. * @see requestHideInputPanel **/ void requestShowInputPanel(); /** * Requests input panels (virtual keyboard) to hide. * @see requestShowInputPanel **/ void requestHideInputPanel(); /** * Invoked by the client when the input state should be * reset, for example after the text was changed outside of the normal * input method flow. **/ void requestReset(); /** * Emitted whenever the preffered @p language changes. * @see preferredLanguage **/ void preferredLanguageChanged(const QByteArray &language); /** * @see cursorRectangle **/ void cursorRectangleChanged(const QRect &rect); /** - * Emitted when the @link{contentPurpose} and/or @link{contentHints} changes. + * Emitted when the {@link contentPurpose} and/or {@link contentHints} changes. * @see contentPurpose * @see contentHints **/ void contentTypeChanged(); /** - * Emitted when the @link{surroundingText}, @link{surroundingTextCursorPosition} - * and/or @link{surroundingTextSelectionAnchor} changed. + * Emitted when the {@link surroundingText}, {@link surroundingTextCursorPosition} + * and/or {@link surroundingTextSelectionAnchor} changed. * @see surroundingText * @see surroundingTextCursorPosition * @see surroundingTextSelectionAnchor **/ void surroundingTextChanged(); /** * Emitted whenever this TextInputInterface gets enabled or disabled for a SurfaceInterface. * @see isEnabled * @see surface **/ void enabledChanged(); protected: class Private; explicit TextInputInterface(Private *p, QObject *parent = nullptr); private: friend class TextInputManagerUnstableV0Interface; friend class TextInputManagerUnstableV2Interface; friend class SeatInterface; Private *d_func() const; }; } } Q_DECLARE_METATYPE(KWayland::Server::TextInputInterfaceVersion) Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface *) Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface::ContentHint) Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface::ContentHints) Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Server::TextInputInterface::ContentHints) Q_DECLARE_METATYPE(KWayland::Server::TextInputInterface::ContentPurpose) #endif diff --git a/src/server/xdgshell_interface.h b/src/server/xdgshell_interface.h index 90518db..c147fc9 100644 --- a/src/server/xdgshell_interface.h +++ b/src/server/xdgshell_interface.h @@ -1,304 +1,304 @@ /**************************************************************************** Copyright 2016 Martin Gräßlin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . ****************************************************************************/ #ifndef KWAYLAND_SERVER_XDGSHELL_INTERFACE_H #define KWAYLAND_SERVER_XDGSHELL_INTERFACE_H #include "global.h" #include "resource.h" #include #include namespace KWayland { namespace Server { class OutputInterface; class SeatInterface; class SurfaceInterface; class XdgShellPopupInterface; class XdgShellSurfaceInterface; template class GenericShellSurface; /** * Enum describing the different InterfaceVersion encapsulated in this implementation. * * @since 5.25 **/ enum class XdgShellInterfaceVersion { /** * xdg_shell (unstable v5) **/ UnstableV5 }; /** * * @since 5.25 **/ class KWAYLANDSERVER_EXPORT XdgShellInterface : public Global { Q_OBJECT public: virtual ~XdgShellInterface(); /** * @returns The interface version used by this XdgShellInterface **/ XdgShellInterfaceVersion interfaceVersion() const; /** * @returns The XdgShellSurfaceInterface for the @p native resource. **/ XdgShellSurfaceInterface *getSurface(wl_resource *native); Q_SIGNALS: void surfaceCreated(KWayland::Server::XdgShellSurfaceInterface *surface); /** * Emitted whenever a new popup got created. * * A popup only gets created in response to an action on the @p seat. * * @param surface The popup xdg shell surface which got created * @param seat The seat on which an action triggered the popup * @param serial The serial of the action on the seat **/ void popupCreated(KWayland::Server::XdgShellPopupInterface *surface, KWayland::Server::SeatInterface *seat, quint32 serial); protected: class Private; explicit XdgShellInterface(Private *d, QObject *parent = nullptr); private: Private *d_func() const; }; /** * * @since 5.25 **/ class KWAYLANDSERVER_EXPORT XdgShellSurfaceInterface : public Resource { Q_OBJECT public: virtual ~XdgShellSurfaceInterface(); /** * @returns The interface version used by this XdgShellSurfaceInterface **/ XdgShellInterfaceVersion interfaceVersion() const; /** * States the Surface can be in **/ enum class State { /** * The Surface is maximized. **/ Maximized = 1 << 0, /** * The Surface is fullscreen. **/ Fullscreen = 1 << 1, /** * The Surface is currently being resized by the Compositor. **/ Resizing = 1 << 2, /** * The Surface is considered active. Does not imply keyboard focus. **/ Activated = 1 << 3 }; Q_DECLARE_FLAGS(States, State) /** * Sends a configure event to the Surface. * This tells the Surface the current @p states it is in and the @p size it should have. * If @p size has width and height at @c 0, the Surface can choose the size. * - * The Surface acknowledges the configure event with @link{configureAcknowledged}. + * The Surface acknowledges the configure event with {@link configureAcknowledged}. * * @param states The states the surface is in * @param size The requested size * @returns The serial of the configure event * @see configureAcknowledged * @see isConfigurePending **/ quint32 configure(States states, const QSize &size = QSize(0, 0)); /** * @returns @c true if there is a not yet acknowledged configure event. * @see configure * @see configureAcknowledged **/ bool isConfigurePending() const; /** * @return The SurfaceInterface this XdgSurfaceV5Interface got created for. **/ SurfaceInterface *surface() const; /** * @returns The title of this surface. * @see titleChanged **/ QString title() const; QByteArray windowClass() const; /** * @returns Whether this Surface is a transient for another Surface, that is it has a parent. * @see transientFor **/ bool isTransient() const; /** * @returns the parent surface if the surface is a transient for another surface * @see isTransient **/ QPointer transientFor() const; /** * Request the client to close the window. **/ void close(); Q_SIGNALS: /** * Emitted whenever the title changes. * * @see title **/ void titleChanged(const QString&); /** * Emitted whenever the window class changes. * * @see windowClass **/ void windowClassChanged(const QByteArray&); /** * The surface requested a window move. * * @param seat The SeatInterface on which the surface requested the move * @param serial The serial of the implicit mouse grab which triggered the move **/ void moveRequested(KWayland::Server::SeatInterface *seat, quint32 serial); /** * The surface requested a window resize. * * @param seat The SeatInterface on which the surface requested the resize * @param serial The serial of the implicit mouse grab which triggered the resize * @param edges A hint which edges are involved in the resize **/ void resizeRequested(KWayland::Server::SeatInterface *seat, quint32 serial, Qt::Edges edges); void windowMenuRequested(KWayland::Server::SeatInterface *seat, quint32 serial, const QPoint &surfacePos); /** * The surface requested a change of maximized state. * @param maximized Whether the window wants to be maximized **/ void maximizedChanged(bool maximized); /** * The surface requested a change of fullscreen state * @param fullscreen Whether the window wants to be fullscreen * @param output An optional output hint on which the window wants to be fullscreen **/ void fullscreenChanged(bool fullscreen, KWayland::Server::OutputInterface *output); /** * The surface requested to be minimized. **/ void minimizeRequested(); /** * A configure event with @p serial got acknowledged. * @see configure **/ void configureAcknowledged(quint32 serial); /** * Emitted whenever the parent surface changes. * @see isTransient * @see transientFor **/ void transientForChanged(); protected: class Private; explicit XdgShellSurfaceInterface(Private *p); private: Private *d_func() const; friend class GenericShellSurface; }; /** * * @since 5.25 **/ class KWAYLANDSERVER_EXPORT XdgShellPopupInterface : public Resource { Q_OBJECT public: virtual ~XdgShellPopupInterface(); /** * @return The SurfaceInterface this XdgShellPopupInterface got created for. **/ SurfaceInterface *surface() const; /** * @returns the parent surface. * @see transientOffset **/ QPointer transientFor() const; /** * The offset of the Surface in the coordinate system of the SurfaceInterface this surface is a transient for. * * @returns offset in parent coordinate system. * @see transientFor **/ QPoint transientOffset() const; /** * Dismiss this popup. This indicates to the client that it should destroy this popup. * The Compositor can invoke this method when e.g. the user clicked outside the popup * to dismiss it. **/ void popupDone(); protected: class Private; explicit XdgShellPopupInterface(Private *p); private: friend class GenericShellSurface; Private *d_func() const; }; } } Q_DECLARE_METATYPE(KWayland::Server::XdgShellSurfaceInterface *) Q_DECLARE_METATYPE(KWayland::Server::XdgShellPopupInterface *) Q_DECLARE_METATYPE(KWayland::Server::XdgShellSurfaceInterface::State) Q_DECLARE_METATYPE(KWayland::Server::XdgShellSurfaceInterface::States) #endif