2015-06-09 00:48:56 +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_SHELL_INTERFACE_H
|
|
|
|
#define WAYLAND_SERVER_PLASMA_SHELL_INTERFACE_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <KWayland/Server/kwaylandserver_export.h>
|
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
class QSize;
|
|
|
|
struct wl_resource;
|
|
|
|
|
|
|
|
namespace KWayland
|
|
|
|
{
|
|
|
|
namespace Server
|
|
|
|
{
|
|
|
|
|
|
|
|
class Display;
|
|
|
|
class SurfaceInterface;
|
|
|
|
class PlasmaShellSurfaceInterface;
|
|
|
|
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
class KWAYLANDSERVER_EXPORT PlasmaShellInterface : public Global
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
virtual ~PlasmaShellInterface();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* Emitted whenever a PlasmaShellSurfaceInterface got created.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
void surfaceCreated(KWayland::Server::PlasmaShellSurfaceInterface*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class Display;
|
|
|
|
explicit PlasmaShellInterface(Display *display, QObject *parent);
|
|
|
|
class Private;
|
|
|
|
};
|
|
|
|
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @brief Resource for the org_kde_plasma_shell_surface interface.
|
|
|
|
*
|
|
|
|
* PlasmaShellSurfaceInterface gets created by PlasmaShellInterface.
|
|
|
|
*
|
|
|
|
* @since 5.4
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
class KWAYLANDSERVER_EXPORT PlasmaShellSurfaceInterface : public Resource
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
virtual ~PlasmaShellSurfaceInterface();
|
|
|
|
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @returns the SurfaceInterface this PlasmaShellSurfaceInterface got created for
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
SurfaceInterface *surface() const;
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @returns The PlasmaShellInterface which created this PlasmaShellSurfaceInterface.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
PlasmaShellInterface *shell() const;
|
|
|
|
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @returns the requested position in global coordinates.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
QPoint position() const;
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @returns Whether a global position has been requested.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
bool isPositionSet() const;
|
|
|
|
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* Describes possible roles this PlasmaShellSurfaceInterface can have.
|
|
|
|
* The role can be used by the server to e.g. change the stacking order accordingly.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
enum class Role {
|
2015-09-10 11:36:42 +00:00
|
|
|
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
|
2015-06-09 00:48:56 +00:00
|
|
|
};
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @returns The requested role, default value is @c Role::Normal.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
Role role() const;
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* Describes how a PlasmaShellSurfaceInterface with role @c Role::Panel should behave.
|
|
|
|
**/
|
2015-06-19 21:25:54 +00:00
|
|
|
enum class PanelBehavior {
|
2015-09-10 11:36:42 +00:00
|
|
|
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
|
2015-06-19 21:25:54 +00:00
|
|
|
};
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @returns The PanelBehavior for a PlasmaShellSurfaceInterface with role @c Role::Panel
|
|
|
|
* @see role
|
|
|
|
**/
|
2015-06-19 21:25:54 +00:00
|
|
|
PanelBehavior panelBehavior() const;
|
2015-06-09 00:48:56 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* A change of global position has been requested.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
void positionChanged();
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* A change of the role has been requested.
|
|
|
|
**/
|
2015-06-09 00:48:56 +00:00
|
|
|
void roleChanged();
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* A change of the panel behavior has been requested.
|
|
|
|
**/
|
2015-06-19 21:25:54 +00:00
|
|
|
void panelBehaviorChanged();
|
2015-06-09 00:48:56 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class PlasmaShellInterface;
|
|
|
|
explicit PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource);
|
|
|
|
class Private;
|
|
|
|
Private *d_func() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|