File indexing completed on 2024-04-28 16:48:55

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 #include "main.h"
0011 
0012 namespace KWin
0013 {
0014 
0015 class KWinSelectionOwner;
0016 
0017 class ApplicationX11 : public Application
0018 {
0019     Q_OBJECT
0020 public:
0021     ApplicationX11(int &argc, char **argv);
0022     ~ApplicationX11() override;
0023 
0024     void setReplace(bool replace);
0025 
0026     std::unique_ptr<Edge> createScreenEdge(ScreenEdges *parent) override;
0027     void createPlatformCursor(QObject *parent = nullptr) override;
0028     std::unique_ptr<OutlineVisual> createOutline(Outline *outline) override;
0029     void createEffectsHandler(Compositor *compositor, WorkspaceScene *scene) override;
0030     void startInteractiveWindowSelection(std::function<void(KWin::Window *)> callback, const QByteArray &cursorName = QByteArray()) override;
0031     void startInteractivePositionSelection(std::function<void(const QPoint &)> callback) override;
0032     PlatformCursorImage cursorImage() const override;
0033 
0034 protected:
0035     void performStartup() override;
0036 
0037 private Q_SLOTS:
0038     void lostSelection();
0039 
0040 private:
0041     void crashChecking();
0042     void setupCrashHandler();
0043     void notifyKSplash();
0044 
0045     static void crashHandler(int signal);
0046 
0047     std::unique_ptr<KWinSelectionOwner> owner;
0048     bool m_replace;
0049 };
0050 
0051 }