Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleDBusAdapter.cpp
Show All 14 Lines | |||||
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 | * | 18 | * | ||
19 | * SPDX-License-Identifier: LGPL-2.0-or-later | 19 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "SpectacleDBusAdapter.h" | 22 | #include "SpectacleDBusAdapter.h" | ||
23 | #include "SpectacleCommon.h" | | |||
24 | 23 | | |||
25 | SpectacleDBusAdapter::SpectacleDBusAdapter(SpectacleCore *parent) | 24 | SpectacleDBusAdapter::SpectacleDBusAdapter(SpectacleCore *parent) | ||
26 | : QDBusAbstractAdaptor(parent) | 25 | : QDBusAbstractAdaptor(parent) | ||
27 | { | 26 | { | ||
28 | setAutoRelaySignals(false); | 27 | setAutoRelaySignals(false); | ||
29 | } | 28 | } | ||
30 | 29 | | |||
31 | inline SpectacleCore *SpectacleDBusAdapter::parent() const | 30 | inline SpectacleCore *SpectacleDBusAdapter::parent() const | ||
32 | { | 31 | { | ||
33 | return static_cast<SpectacleCore *>(QObject::parent()); | 32 | return static_cast<SpectacleCore *>(QObject::parent()); | ||
34 | } | 33 | } | ||
35 | 34 | | |||
36 | Q_NOREPLY void SpectacleDBusAdapter::StartAgent() | 35 | Q_NOREPLY void SpectacleDBusAdapter::StartAgent() | ||
37 | { | 36 | { | ||
38 | parent()->dbusStartAgent(); | 37 | parent()->dbusStartAgent(); | ||
39 | } | 38 | } | ||
40 | 39 | | |||
41 | Q_NOREPLY void SpectacleDBusAdapter::FullScreen(bool includeMousePointer) | 40 | Q_NOREPLY void SpectacleDBusAdapter::FullScreen(bool includeMousePointer) | ||
42 | { | 41 | { | ||
43 | parent()->takeNewScreenshot(Spectacle::CaptureMode::AllScreens, 0, includeMousePointer, true); | 42 | parent()->takeNewScreenshot(CaptureMode::AllScreens, 0, includeMousePointer, true); | ||
44 | } | 43 | } | ||
45 | 44 | | |||
46 | Q_NOREPLY void SpectacleDBusAdapter::CurrentScreen(bool includeMousePointer) | 45 | Q_NOREPLY void SpectacleDBusAdapter::CurrentScreen(bool includeMousePointer) | ||
47 | { | 46 | { | ||
48 | parent()->takeNewScreenshot(Spectacle::CaptureMode::CurrentScreen, 0, includeMousePointer, true); | 47 | parent()->takeNewScreenshot(CaptureMode::CurrentScreen, 0, includeMousePointer, true); | ||
49 | } | 48 | } | ||
50 | 49 | | |||
51 | Q_NOREPLY void SpectacleDBusAdapter::ActiveWindow(bool includeWindowDecorations, bool includeMousePointer) | 50 | Q_NOREPLY void SpectacleDBusAdapter::ActiveWindow(bool includeWindowDecorations, bool includeMousePointer) | ||
52 | { | 51 | { | ||
53 | parent()->takeNewScreenshot(Spectacle::CaptureMode::ActiveWindow, 0, includeMousePointer, includeWindowDecorations); | 52 | parent()->takeNewScreenshot(CaptureMode::ActiveWindow, 0, includeMousePointer, includeWindowDecorations); | ||
54 | } | 53 | } | ||
55 | 54 | | |||
56 | Q_NOREPLY void SpectacleDBusAdapter::WindowUnderCursor(bool includeWindowDecorations, bool includeMousePointer) | 55 | Q_NOREPLY void SpectacleDBusAdapter::WindowUnderCursor(bool includeWindowDecorations, bool includeMousePointer) | ||
57 | { | 56 | { | ||
58 | parent()->takeNewScreenshot(Spectacle::CaptureMode::WindowUnderCursor, 0, includeMousePointer, includeWindowDecorations); | 57 | parent()->takeNewScreenshot(CaptureMode::WindowUnderCursor, 0, includeMousePointer, includeWindowDecorations); | ||
59 | } | 58 | } | ||
60 | 59 | | |||
61 | Q_NOREPLY void SpectacleDBusAdapter::RectangularRegion(bool includeMousePointer) | 60 | Q_NOREPLY void SpectacleDBusAdapter::RectangularRegion(bool includeMousePointer) | ||
62 | { | 61 | { | ||
63 | parent()->takeNewScreenshot(Spectacle::CaptureMode::RectangularRegion, 0, includeMousePointer, false); | 62 | parent()->takeNewScreenshot(CaptureMode::RectangularRegion, 0, includeMousePointer, false); | ||
64 | } | 63 | } |