Changeset View
Changeset View
Standalone View
Standalone View
src/BackendPlugins/WaylandKWinScreenshotPlugin.h
- This file was added.
1 | /* This file is part of Spectacle, the KDE screenshot utility | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 Leon De Andrade <leondeandrade@hotmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Lesser General Public License as published by | ||||
6 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU Lesser General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
17 | * Boston, MA 02110-1301, USA. | ||||
18 | * | ||||
19 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||||
20 | */ | ||||
21 | | ||||
22 | | ||||
23 | #ifndef WAYLAND_KWIN_SCREENSHOT_PLUGIN_H | ||||
24 | #define WAYLAND_KWIN_SCREENSHOT_PLUGIN_H | ||||
25 | | ||||
26 | #include "BackendInterfaces/ScreenshotInterface.h" | ||||
27 | | ||||
28 | class WaylandKWinScreenshotPlugin : public ScreenshotInterface { | ||||
29 | Q_OBJECT | ||||
30 | Q_PLUGIN_METADATA(IID "org.kde.spectacle.WaylandKWinScreenshotPlugin" FILE "WaylandScreenshotPlugin.json") | ||||
31 | Q_INTERFACES(ScreenshotInterface) | ||||
32 | | ||||
33 | public: | ||||
34 | explicit WaylandKWinScreenshotPlugin(QObject *parent = nullptr); | ||||
35 | virtual ~WaylandKWinScreenshotPlugin() = default; | ||||
36 | | ||||
37 | //Meta Data | ||||
38 | virtual QString name() const override; | ||||
39 | virtual Platform platform() const override; | ||||
40 | virtual CaptureModes supportedCaptureModes() const override; | ||||
41 | virtual ShutterModes supportedShutterModes() const override; | ||||
42 | | ||||
43 | virtual bool requirementsComplied() const override; | ||||
44 | | ||||
45 | virtual void doGrab(ShutterMode theShutterMode, CaptureMode theCaptureMode, bool theIncludePointer, bool theIncludeDecorations) override; | ||||
46 | | ||||
47 | private: | ||||
48 | void startReadImage(int theReadPipe); | ||||
49 | | ||||
50 | template <typename ArgType> | ||||
51 | void doGrabHelper(const QString &theGrabMethod, ArgType theArgument); | ||||
52 | | ||||
53 | template <typename ArgType> | ||||
54 | void callDBus(const QString &theGrabMethod, ArgType theArgument, int theWriteFile); | ||||
55 | }; | ||||
56 | | ||||
57 | #endif //WAYLAND_SCREENSHOT_PLUGIN_H | ||||
58 | No newline at end of file |