KWindowSystem

kwindoweffects.cpp
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #include "kwindoweffects_p.h"
8 #include "pluginwrapper_p.h"
9 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 62)
10 #include <QWidget>
11 #endif
12 #include <QWindow>
13 
14 KWindowEffectsPrivate::KWindowEffectsPrivate()
15 {
16 }
17 
18 KWindowEffectsPrivate::~KWindowEffectsPrivate()
19 {
20 }
21 
22 KWindowEffectsPrivateV2::KWindowEffectsPrivateV2()
23  : KWindowEffectsPrivate()
24 {
25 }
26 
27 KWindowEffectsPrivateV2::~KWindowEffectsPrivateV2()
28 {
29 }
30 
31 namespace KWindowEffects
32 {
33 bool isEffectAvailable(Effect effect)
34 {
35  return KWindowSystemPluginWrapper::self().effects()->isEffectAvailable(effect);
36 }
37 
38 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82)
39 void enableBlurBehind(WId window, bool enable, const QRegion &region)
40 {
41  KWindowSystemPluginWrapper::self().effects()->enableBlurBehind(window, enable, region);
42 }
43 #endif
44 
45 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82)
46 void enableBackgroundContrast(WId window, bool enable, qreal contrast, qreal intensity, qreal saturation, const QRegion &region)
47 {
48  KWindowSystemPluginWrapper::self().effects()->enableBackgroundContrast(window, enable, contrast, intensity, saturation, region);
49 }
50 #endif
51 
52 void enableBlurBehind(QWindow *window, bool enable, const QRegion &region)
53 {
54  KWindowSystemPluginWrapper::self().effects()->enableBlurBehind(window->winId(), enable, region);
55 }
56 
57 void enableBackgroundContrast(QWindow *window, bool enable, qreal contrast, qreal intensity, qreal saturation, const QRegion &region)
58 {
59  KWindowSystemPluginWrapper::self().effects()->enableBackgroundContrast(window->winId(), enable, contrast, intensity, saturation, region);
60 }
61 
62 void setBackgroundFrost(QWindow *window, QColor frostColor, const QRegion &region)
63 {
64  auto effects = KWindowSystemPluginWrapper::self().effects();
65  if (auto effectsv2 = dynamic_cast<KWindowEffectsPrivateV2 *>(effects)) {
66  effectsv2->setBackgroundFrost(window, frostColor, region);
67  }
68 }
69 
70 void slideWindow(QWindow *window, SlideFromLocation location, int offset)
71 {
72  KWindowSystemPluginWrapper::self().effects()->slideWindow(window->winId(), location, offset);
73 }
74 
75 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82)
76 void highlightWindows(WId controller, const QList<WId> &ids)
77 {
78  KWindowSystemPluginWrapper::self().effects()->highlightWindows(controller, ids);
79 }
80 #endif
81 
82 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 67)
83 void markAsDashboard(WId window)
84 {
85  KWindowSystemPluginWrapper::self().effects()->markAsDashboard(window);
86 }
87 #endif
88 
89 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82)
90 void presentWindows(WId controller, const QList<WId> &ids)
91 {
92  KWindowSystemPluginWrapper::self().effects()->presentWindows(controller, ids);
93 }
94 #endif
95 
96 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82)
97 void presentWindows(WId controller, int desktop)
98 {
99  KWindowSystemPluginWrapper::self().effects()->presentWindows(controller, desktop);
100 }
101 #endif
102 
103 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82)
104 void slideWindow(WId id, SlideFromLocation location, int offset)
105 {
106  KWindowSystemPluginWrapper::self().effects()->slideWindow(id, location, offset);
107 }
108 #endif
109 
110 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 62)
111 void slideWindow(QWidget *widget, SlideFromLocation location)
112 {
113  slideWindow(widget->effectiveWinId(), location, -1);
114 }
115 #endif
116 
117 #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 81)
119 {
120  return KWindowSystemPluginWrapper::self().effects()->windowSizes(ids);
121 }
122 #endif
123 
124 }
void markAsDashboard(WId window)
Instructs the window manager to handle the given window as dashboard window as Dashboard windows shou...
QList< QSize > windowSizes(const QList< WId > &ids)
void enableBlurBehind(WId window, bool enable, const QRegion &region)
Instructs the window manager to blur the background in the specified region behind the given window...
bool isEffectAvailable(Effect effect)
int desktop() const
Returns the desktop for the startup notification.
void setBackgroundFrost(QWindow *window, QColor frostColor, const QRegion &region)
Instructs the window manager to modify the color of the background in the specified region behind the...
void slideWindow(QWindow *window, SlideFromLocation location, int offset)
Mark a window as sliding from screen edge.
void presentWindows(WId controller, const QList< WId > &ids)
Activate the Present Windows effect for the given groups of windows.
Namespace for common standardized window effects.
void highlightWindows(WId controller, const QList< WId > &ids)
Highlight the selected windows, making all the others translucent.
WId effectiveWinId() const const
WId winId() const const
void enableBackgroundContrast(WId window, bool enable, qreal contrast, qreal intensity, qreal saturation, const QRegion &region)
Instructs the window manager to modify the color of the background in the specified region behind the...
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Oct 15 2021 22:41:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.