Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleDBusAdapter.cpp
1 | /* | 1 | /* This file is part of Spectacle, the KDE screenshot utility | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2015 Boudhayan Gupta <bgupta@kde.org> | 2 | * Copyright (C) 2015 Boudhayan Gupta <bgupta@kde.org> | ||
3 | * | 3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 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 | 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 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | 7 | * (at your option) any later version. | ||
8 | * | 8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public License | 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 | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | * | ||||
19 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||||
18 | */ | 20 | */ | ||
19 | 21 | | |||
20 | #include "SpectacleDBusAdapter.h" | 22 | #include "SpectacleDBusAdapter.h" | ||
23 | #include "SpectacleCommon.h" | ||||
21 | 24 | | |||
22 | SpectacleDBusAdapter::SpectacleDBusAdapter(SpectacleCore *parent) | 25 | SpectacleDBusAdapter::SpectacleDBusAdapter(SpectacleCore *parent) | ||
23 | : QDBusAbstractAdaptor(parent) | 26 | : QDBusAbstractAdaptor(parent) | ||
Context not available. | |||||
25 | setAutoRelaySignals(false); | 28 | setAutoRelaySignals(false); | ||
26 | } | 29 | } | ||
27 | 30 | | |||
28 | SpectacleDBusAdapter::~SpectacleDBusAdapter() | | |||
29 | {} | | |||
30 | | ||||
31 | inline SpectacleCore *SpectacleDBusAdapter::parent() const | 31 | inline SpectacleCore *SpectacleDBusAdapter::parent() const | ||
32 | { | 32 | { | ||
33 | return static_cast<SpectacleCore *>(QObject::parent()); | 33 | return static_cast<SpectacleCore *>(QObject::parent()); | ||
Context not available. | |||||
40 | 40 | | |||
41 | Q_NOREPLY void SpectacleDBusAdapter::FullScreen(bool includeMousePointer) | 41 | Q_NOREPLY void SpectacleDBusAdapter::FullScreen(bool includeMousePointer) | ||
42 | { | 42 | { | ||
43 | parent()->takeNewScreenshot(ImageGrabber::FullScreen, 0, includeMousePointer, true); | 43 | parent()->takeNewScreenshot(Spectacle::CaptureMode::AllScreens, 0, includeMousePointer, true); | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | Q_NOREPLY void SpectacleDBusAdapter::CurrentScreen(bool includeMousePointer) | 46 | Q_NOREPLY void SpectacleDBusAdapter::CurrentScreen(bool includeMousePointer) | ||
47 | { | 47 | { | ||
48 | parent()->takeNewScreenshot(ImageGrabber::CurrentScreen, 0, includeMousePointer, true); | 48 | parent()->takeNewScreenshot(Spectacle::CaptureMode::CurrentScreen, 0, includeMousePointer, true); | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | Q_NOREPLY void SpectacleDBusAdapter::ActiveWindow(bool includeWindowDecorations, bool includeMousePointer) | 51 | Q_NOREPLY void SpectacleDBusAdapter::ActiveWindow(bool includeWindowDecorations, bool includeMousePointer) | ||
52 | { | 52 | { | ||
53 | parent()->takeNewScreenshot(ImageGrabber::ActiveWindow, 0, includeMousePointer, includeWindowDecorations); | 53 | parent()->takeNewScreenshot(Spectacle::CaptureMode::ActiveWindow, 0, includeMousePointer, includeWindowDecorations); | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | Q_NOREPLY void SpectacleDBusAdapter::WindowUnderCursor(bool includeWindowDecorations, bool includeMousePointer) | 56 | Q_NOREPLY void SpectacleDBusAdapter::WindowUnderCursor(bool includeWindowDecorations, bool includeMousePointer) | ||
57 | { | 57 | { | ||
58 | parent()->takeNewScreenshot(ImageGrabber::WindowUnderCursor, 0, includeMousePointer, includeWindowDecorations); | 58 | parent()->takeNewScreenshot(Spectacle::CaptureMode::WindowUnderCursor, 0, includeMousePointer, includeWindowDecorations); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | Q_NOREPLY void SpectacleDBusAdapter::RectangularRegion(bool includeMousePointer) | 61 | Q_NOREPLY void SpectacleDBusAdapter::RectangularRegion(bool includeMousePointer) | ||
62 | { | 62 | { | ||
63 | parent()->takeNewScreenshot(ImageGrabber::RectangularRegion, 0, includeMousePointer, false); | 63 | parent()->takeNewScreenshot(Spectacle::CaptureMode::RectangularRegion, 0, includeMousePointer, false); | ||
64 | } | 64 | } | ||
Context not available. |