2015-06-12 01:05:14 +00:00
|
|
|
/********************************************************************
|
|
|
|
Copyright 2015 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
|
|
|
|
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 <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
#ifndef WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H
|
|
|
|
#define WAYLAND_SERVER_PLASMA_WINDOW_MANAGEMENT_INTERFACE_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <KWayland/Server/kwaylandserver_export.h>
|
|
|
|
|
|
|
|
#include "global.h"
|
2015-06-15 19:42:38 +00:00
|
|
|
#include "resource.h"
|
2015-06-12 01:05:14 +00:00
|
|
|
|
|
|
|
class QSize;
|
|
|
|
|
|
|
|
namespace KWayland
|
|
|
|
{
|
|
|
|
namespace Server
|
|
|
|
{
|
|
|
|
|
|
|
|
class Display;
|
2015-06-15 19:42:38 +00:00
|
|
|
class PlasmaWindowInterface;
|
2015-10-30 11:26:12 +00:00
|
|
|
class SurfaceInterface;
|
2015-06-12 01:05:14 +00:00
|
|
|
|
|
|
|
class KWAYLANDSERVER_EXPORT PlasmaWindowManagementInterface : public Global
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
virtual ~PlasmaWindowManagementInterface();
|
|
|
|
enum class ShowingDesktopState {
|
|
|
|
Disabled,
|
|
|
|
Enabled
|
|
|
|
};
|
|
|
|
void setShowingDesktopState(ShowingDesktopState state);
|
|
|
|
|
2015-06-15 19:42:38 +00:00
|
|
|
PlasmaWindowInterface *createWindow(QObject *parent);
|
|
|
|
QList<PlasmaWindowInterface*> windows() const;
|
|
|
|
|
2016-05-12 05:40:27 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2015-06-12 01:05:14 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void requestChangeShowingDesktop(ShowingDesktopState requestedState);
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class Display;
|
|
|
|
explicit PlasmaWindowManagementInterface(Display *display, QObject *parent);
|
|
|
|
class Private;
|
|
|
|
Private *d_func() const;
|
|
|
|
};
|
|
|
|
|
2015-06-15 19:42:38 +00:00
|
|
|
class KWAYLANDSERVER_EXPORT PlasmaWindowInterface : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
virtual ~PlasmaWindowInterface();
|
|
|
|
|
|
|
|
void setTitle(const QString &title);
|
|
|
|
void setAppId(const QString &appId);
|
2017-05-12 17:42:01 +00:00
|
|
|
void setPid(quint32 pid);
|
2015-06-15 19:42:38 +00:00
|
|
|
void setVirtualDesktop(quint32 desktop);
|
2015-06-18 19:13:58 +00:00
|
|
|
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);
|
2015-09-29 18:23:18 +00:00
|
|
|
void setSkipTaskbar(bool skip);
|
2016-10-13 11:39:27 +00:00
|
|
|
/**
|
|
|
|
* @deprecated since 5.28 use setIcon
|
|
|
|
* @see setIcon
|
|
|
|
**/
|
|
|
|
#ifndef KWAYLANDSERVER_NO_DEPRECATED
|
|
|
|
void KWAYLANDSERVER_DEPRECATED setThemedIconName(const QString &iconName);
|
|
|
|
#endif
|
2016-04-15 11:34:53 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-15 11:34:53 +00:00
|
|
|
*/
|
2016-04-19 09:40:57 +00:00
|
|
|
void setShadeable(bool set);
|
2016-04-15 11:34:53 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-15 11:34:53 +00:00
|
|
|
*/
|
|
|
|
void setShaded(bool set);
|
2016-04-17 09:19:39 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-17 09:19:39 +00:00
|
|
|
*/
|
|
|
|
void setMovable(bool set);
|
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-17 09:19:39 +00:00
|
|
|
*/
|
|
|
|
void setResizable(bool set);
|
2016-04-19 16:13:08 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-19 16:13:08 +00:00
|
|
|
*/
|
|
|
|
void setVirtualDesktopChangeable(bool set);
|
2015-06-15 19:42:38 +00:00
|
|
|
|
2016-05-12 05:40:27 +00:00
|
|
|
/**
|
|
|
|
* 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}.
|
|
|
|
* @see PlasmaWindowManagementInterface::unmapWindow
|
|
|
|
**/
|
2015-06-17 22:10:52 +00:00
|
|
|
void unmap();
|
|
|
|
|
2015-10-30 11:26:12 +00:00
|
|
|
/**
|
|
|
|
* @returns Geometries of the taskbar entries, indicized by the
|
|
|
|
* surface of the panels
|
|
|
|
* @since 5.5
|
|
|
|
*/
|
|
|
|
QHash<SurfaceInterface*, QRect> minimizedGeometries() const;
|
|
|
|
|
2016-06-06 13:06:33 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2016-07-15 11:31:12 +00:00
|
|
|
/**
|
|
|
|
* Sets the window @p geometry of this PlasmaWindow.
|
|
|
|
*
|
|
|
|
* @param geometry The geometry in absolute coordinates
|
|
|
|
* @since 5.25
|
|
|
|
**/
|
|
|
|
void setGeometry(const QRect &geometry);
|
|
|
|
|
2016-10-13 11:39:27 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2015-06-18 23:43:58 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void closeRequested();
|
2016-04-17 09:19:39 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-17 09:19:39 +00:00
|
|
|
*/
|
|
|
|
void moveRequested();
|
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-17 09:19:39 +00:00
|
|
|
*/
|
|
|
|
void resizeRequested();
|
2015-06-19 02:34:50 +00:00
|
|
|
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);
|
2015-09-29 18:23:18 +00:00
|
|
|
void skipTaskbarRequested(bool set);
|
2015-10-30 11:26:12 +00:00
|
|
|
QRect minimizedGeometriesChanged();
|
2016-04-15 12:10:37 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-15 12:10:37 +00:00
|
|
|
*/
|
2016-04-19 09:40:57 +00:00
|
|
|
void shadeableRequested(bool set);
|
2016-04-15 12:10:37 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-15 12:10:37 +00:00
|
|
|
*/
|
2016-04-15 11:34:53 +00:00
|
|
|
void shadedRequested(bool set);
|
2016-04-17 09:19:39 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-17 09:19:39 +00:00
|
|
|
*/
|
|
|
|
void movableRequested(bool set);
|
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-17 09:19:39 +00:00
|
|
|
*/
|
|
|
|
void resizableRequested(bool set);
|
2016-04-19 16:13:08 +00:00
|
|
|
/**
|
2016-04-27 05:43:43 +00:00
|
|
|
* @since 5.22
|
2016-04-19 16:13:08 +00:00
|
|
|
*/
|
|
|
|
void virtualDesktopChangeableRequested(bool set);
|
2015-06-18 23:43:58 +00:00
|
|
|
|
2015-06-15 19:42:38 +00:00
|
|
|
private:
|
|
|
|
friend class PlasmaWindowManagementInterface;
|
|
|
|
explicit PlasmaWindowInterface(PlasmaWindowManagementInterface *wm, QObject *parent);
|
|
|
|
|
|
|
|
class Private;
|
|
|
|
const QScopedPointer<Private> d;
|
|
|
|
};
|
|
|
|
|
2015-06-12 01:05:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-25 19:04:48 +00:00
|
|
|
Q_DECLARE_METATYPE(KWayland::Server::PlasmaWindowManagementInterface::ShowingDesktopState)
|
|
|
|
|
2015-06-12 01:05:14 +00:00
|
|
|
#endif
|