/usr/include/KF5/KWayland/Client/plasmashell.h is in libkf5wayland-dev 4:5.44.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | /********************************************************************
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_PLASMASHELL_H
#define WAYLAND_PLASMASHELL_H
#include <QObject>
#include <QSize>
#include <KWayland/Client/kwaylandclient_export.h>
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.
*
* This method is automatically invoked when the Registry which created this
* PlasmaShell gets destroyed.
*
* 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<Private> 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.
*
* 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}.
*
* @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<Private> d;
};
}
}
Q_DECLARE_METATYPE(KWayland::Client::PlasmaShellSurface::Role)
Q_DECLARE_METATYPE(KWayland::Client::PlasmaShellSurface::PanelBehavior)
#endif
|