File indexing completed on 2024-07-14 14:38:32

0001 /*
0002     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 #ifndef KWINDOWSYSTEM_P_H
0007 #define KWINDOWSYSTEM_P_H
0008 
0009 #include "netwm_def.h"
0010 #include <QStringList>
0011 #include <QWidgetList> //For WId
0012 #include <kwindowsystem_export.h>
0013 
0014 class NETWinInfo;
0015 
0016 class KWINDOWSYSTEM_EXPORT KWindowSystemPrivate : public NET
0017 {
0018 public:
0019     virtual ~KWindowSystemPrivate();
0020     virtual QList<WId> windows() = 0;
0021     virtual QList<WId> stackingOrder() = 0;
0022     virtual WId activeWindow() = 0;
0023     virtual void activateWindow(WId win, long time = 0) = 0;
0024     virtual void forceActiveWindow(WId win, long time = 0) = 0;
0025 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 101)
0026     virtual void demandAttention(WId win, bool set) = 0;
0027 #endif
0028     virtual bool compositingActive() = 0;
0029     virtual int currentDesktop() = 0;
0030     virtual int numberOfDesktops() = 0;
0031     virtual void setCurrentDesktop(int desktop) = 0;
0032     virtual void setOnAllDesktops(WId win, bool b) = 0;
0033     virtual void setOnDesktop(WId win, int desktop) = 0;
0034     virtual void setOnActivities(WId win, const QStringList &activities) = 0;
0035 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 0)
0036     virtual WId transientFor(WId window) = 0;
0037     virtual WId groupLeader(WId window) = 0;
0038 #endif
0039     virtual QPixmap icon(WId win, int width, int height, bool scale, int flags) = 0;
0040     virtual QPixmap iconFromNetWinInfo(int width, int height, bool scale, int flags, NETWinInfo *info);
0041 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 101)
0042     virtual void setIcons(WId win, const QPixmap &icon, const QPixmap &miniIcon) = 0;
0043 #endif
0044     virtual void setType(WId win, NET::WindowType windowType) = 0;
0045     virtual void setState(WId win, NET::States state) = 0;
0046     virtual void clearState(WId win, NET::States state) = 0;
0047     virtual void minimizeWindow(WId win) = 0;
0048     virtual void unminimizeWindow(WId win) = 0;
0049     virtual void raiseWindow(WId win) = 0;
0050     virtual void lowerWindow(WId win) = 0;
0051     virtual bool icccmCompliantMappingState() = 0;
0052     virtual QRect workArea(int desktop) = 0;
0053     virtual QRect workArea(const QList<WId> &excludes, int desktop) = 0;
0054     virtual QString desktopName(int desktop) = 0;
0055     virtual void setDesktopName(int desktop, const QString &name) = 0;
0056     virtual bool showingDesktop() = 0;
0057     virtual void setShowingDesktop(bool showing) = 0;
0058     virtual void setUserTime(WId win, long time) = 0;
0059     virtual void setExtendedStrut(WId win,
0060                                   int left_width,
0061                                   int left_start,
0062                                   int left_end,
0063                                   int right_width,
0064                                   int right_start,
0065                                   int right_end,
0066                                   int top_width,
0067                                   int top_start,
0068                                   int top_end,
0069                                   int bottom_width,
0070                                   int bottom_start,
0071                                   int bottom_end) = 0;
0072     virtual void setStrut(WId win, int left, int right, int top, int bottom) = 0;
0073     virtual bool allowedActionsSupported() = 0;
0074     virtual QString readNameProperty(WId window, unsigned long atom) = 0;
0075     virtual void allowExternalProcessWindowActivation(int pid) = 0;
0076     virtual void setBlockingCompositing(WId window, bool active) = 0;
0077     virtual bool mapViewport() = 0;
0078     virtual int viewportToDesktop(const QPoint &pos) = 0;
0079     virtual int viewportWindowToDesktop(const QRect &r) = 0;
0080     virtual QPoint desktopToViewport(int desktop, bool absolute) = 0;
0081     virtual QPoint constrainViewportRelativePosition(const QPoint &pos) = 0;
0082 
0083     virtual void connectNotify(const QMetaMethod &signal) = 0;
0084 };
0085 
0086 class KWINDOWSYSTEM_EXPORT KWindowSystemPrivateV2 : public KWindowSystemPrivate
0087 {
0088 public:
0089     virtual void requestToken(QWindow *win, uint32_t serial, const QString &app_id) = 0;
0090     virtual void setCurrentToken(const QString &token) = 0;
0091     virtual quint32 lastInputSerial(QWindow *window) = 0;
0092 };
0093 
0094 #endif