From 2baeda5fa5889a86b6873e12effd8646fe360ca5 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 8 Sep 2016 19:49:32 +0000 Subject: [PATCH] kwin: get rid of Plasma cruft Signed-off-by: Ivailo Monev --- kwin/CMakeLists.txt | 3 - kwin/clients/aurorae/src/aurorae.cpp | 9 +- kwin/effects.cpp | 50 +--- kwin/effects.h | 31 +-- kwin/effects/dashboard/dashboard.cpp | 1 - kwin/effects/diminactive/diminactive.cpp | 2 - kwin/effects/dimscreen/dimscreen.cpp | 2 - kwin/effects/highlightwindow/highlightwindow.cpp | 2 - kwin/effects/kscreen/kscreen.cpp | 2 - kwin/effects/logout/logout.cpp | 4 - kwin/effects/magnifier/magnifier.cpp | 2 - .../minimizeanimation/minimizeanimation.cpp | 2 - kwin/effects/mousemark/mousemark.cpp | 2 - kwin/effects/presentwindows/presentwindows.cpp | 14 +- kwin/effects/resize/resize.cpp | 2 - kwin/effects/screenedge/CMakeLists.txt | 11 - kwin/effects/screenedge/screenedgeeffect.cpp | 268 ------------------ kwin/effects/screenedge/screenedgeeffect.desktop | 95 ------- kwin/effects/screenedge/screenedgeeffect.h | 73 ----- kwin/effects/showfps/showfps.cpp | 4 +- kwin/effects/showpaint/showpaint.cpp | 2 - kwin/effects/slide/slide.cpp | 2 - kwin/effects/slideback/slideback.cpp | 2 - kwin/effects/slidingpopups/slidingpopups.cpp | 2 - kwin/effects/snaphelper/snaphelper.cpp | 2 - kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp | 2 - kwin/effects/thumbnailaside/thumbnailaside.cpp | 2 - kwin/effects/trackmouse/trackmouse.cpp | 2 - kwin/effects/windowgeometry/windowgeometry.cpp | 4 +- kwin/effects/zoom/zoom.cpp | 2 - kwin/geometry.cpp | 6 - kwin/kcmkwin/kwinoptions/oxsc-app-kcmkwm.svgz | Bin 2352 -> 0 bytes kwin/kcmkwin/kwinscreenedges/CMakeLists.txt | 14 +- kwin/libkwineffects/kwineffects.h | 27 +- kwin/outline.cpp | 306 --------------------- kwin/outline.h | 176 ------------ kwin/oxsc-app-kwin.svgz | Bin 3106 -> 0 bytes kwin/scene.h | 1 - kwin/scene_xrender.cpp | 52 +--- kwin/scene_xrender.h | 2 - kwin/tabbox/declarative.cpp | 40 --- kwin/tabbox/declarative.h | 5 - kwin/workspace.cpp | 3 - 43 files changed, 29 insertions(+), 1204 deletions(-) delete mode 100644 kwin/effects/screenedge/CMakeLists.txt delete mode 100644 kwin/effects/screenedge/screenedgeeffect.cpp delete mode 100644 kwin/effects/screenedge/screenedgeeffect.desktop delete mode 100644 kwin/effects/screenedge/screenedgeeffect.h delete mode 100644 kwin/kcmkwin/kwinoptions/oxsc-app-kcmkwm.svgz delete mode 100644 kwin/outline.cpp delete mode 100644 kwin/outline.h delete mode 100644 kwin/oxsc-app-kwin.svgz diff --git a/kwin/CMakeLists.txt b/kwin/CMakeLists.txt index 251ff8a5..c5a76de7 100644 --- a/kwin/CMakeLists.txt +++ b/kwin/CMakeLists.txt @@ -44,7 +44,6 @@ set(kwin4_effect_include_directories) include( effects/kscreen/CMakeLists.txt ) include( effects/presentwindows/CMakeLists.txt ) -include( effects/screenedge/CMakeLists.txt ) include( effects/slidingpopups/CMakeLists.txt ) include( effects/taskbarthumbnail/CMakeLists.txt ) include( effects/dashboard/CMakeLists.txt ) @@ -87,7 +86,6 @@ set(kwin_SRCS layers.cpp main.cpp options.cpp - outline.cpp decorations.cpp events.cpp killwindow.cpp @@ -169,7 +167,6 @@ add_executable(kwin ${kwin_SRCS} ${kwin4_effect_builtins_sources}) target_link_libraries(kwin ${KDE4_KDEUI_LIBS} - ${KDE4_PLASMA_LIBS} ${KDE4_KDECLARATIVE_LIBS} ${X11_X11_LIB} ${X11_Xext_LIB} diff --git a/kwin/clients/aurorae/src/aurorae.cpp b/kwin/clients/aurorae/src/aurorae.cpp index 5fabd152..9778ebcc 100644 --- a/kwin/clients/aurorae/src/aurorae.cpp +++ b/kwin/clients/aurorae/src/aurorae.cpp @@ -20,10 +20,10 @@ along with this program. If not, see . #include "config-kwin.h" #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -33,7 +33,6 @@ along with this program. If not, see . #include #include #include -#include namespace Aurorae { diff --git a/kwin/effects.cpp b/kwin/effects.cpp index 5554c622..85149573 100644 --- a/kwin/effects.cpp +++ b/kwin/effects.cpp @@ -57,7 +57,6 @@ along with this program. If not, see . #include #include #include -#include #include #include "composite.h" @@ -77,7 +76,6 @@ along with this program. If not, see . #include "effects/mousemark/mousemark.h" #include "effects/presentwindows/presentwindows.h" #include "effects/resize/resize.h" -#include "effects/screenedge/screenedgeeffect.h" #include "effects/showfps/showfps.h" #include "effects/showpaint/showpaint.h" #include "effects/slide/slide.h" @@ -1381,8 +1379,6 @@ bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault) effect = new KscreenEffect(); } else if (internalname == "kwin4_effect_presentwindows") { effect = new PresentWindowsEffect(); - } else if (internalname == "kwin4_effect_screenedge") { - effect = new ScreenEdgeEffect(); } else if (internalname == "kwin4_effect_slidingpopups") { effect = new SlidingPopupsEffect(); } else if (internalname == "kwin4_effect_taskbarthumbnail") { @@ -1612,9 +1608,9 @@ QStringList EffectsHandlerImpl::activeEffects() const return ret; } -EffectFrame* EffectsHandlerImpl::effectFrame(EffectFrameStyle style, bool staticSize, const QPoint& position, Qt::Alignment alignment) const +EffectFrame* EffectsHandlerImpl::effectFrame(bool staticSize, const QPoint& position, Qt::Alignment alignment) const { - return new EffectFrameImpl(style, staticSize, position, alignment); + return new EffectFrameImpl(staticSize, position, alignment); } @@ -1898,24 +1894,13 @@ EffectWindowList EffectWindowGroupImpl::members() const // EffectFrameImpl //**************************************** -EffectFrameImpl::EffectFrameImpl(EffectFrameStyle style, bool staticSize, QPoint position, Qt::Alignment alignment) +EffectFrameImpl::EffectFrameImpl(bool staticSize, QPoint position, Qt::Alignment alignment) : QObject(0) , EffectFrame() - , m_style(style) , m_static(staticSize) , m_point(position) , m_alignment(alignment) { - if (m_style == EffectFrameStyled) { - m_frame.setImagePath("widgets/background"); - m_frame.setCacheAllRenderedFrames(true); - connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(plasmaThemeChanged())); - } - m_selection.setImagePath("widgets/viewitem"); - m_selection.setElementPrefix("hover"); - m_selection.setCacheAllRenderedFrames(true); - m_selection.setEnabledBorders(Plasma::FrameSvg::AllBorders); - if (effects->compositingType() == XRenderCompositing) { #ifdef KWIN_BUILD_COMPOSITE m_sceneFrame = new SceneXrender::EffectFrame(this); @@ -1975,12 +1960,6 @@ void EffectFrameImpl::setGeometry(const QRect& geometry, bool force) return; } - if (m_style == EffectFrameStyled) { - qreal left, top, right, bottom; - m_frame.getMargins(left, top, right, bottom); // m_geometry is the inner geometry - m_frame.resizeFrame(m_geometry.adjusted(-left, -top, right, bottom).size()); - } - free(); } @@ -2016,11 +1995,6 @@ void EffectFrameImpl::setIconSize(const QSize& size) m_sceneFrame->freeIconFrame(); } -void EffectFrameImpl::plasmaThemeChanged() -{ - free(); -} - void EffectFrameImpl::render(QRegion region, double opacity, double frameOpacity) { if (m_geometry.isEmpty()) { @@ -2097,19 +2071,6 @@ void EffectFrameImpl::setText(const QString& text) } } -void EffectFrameImpl::setSelection(const QRect& selection) -{ - if (selection == m_selectionGeometry) { - return; - } - m_selectionGeometry = selection; - if (m_selectionGeometry.size() != m_selection.frameSize().toSize()) { - m_selection.resizeFrame(m_selectionGeometry.size()); - } - // TODO; optimize to only recreate when resizing - m_sceneFrame->freeSelection(); -} - void EffectFrameImpl::autoResize() { if (m_static) @@ -2131,9 +2092,4 @@ void EffectFrameImpl::autoResize() setGeometry(geometry); } -QColor EffectFrameImpl::styledTextColor() -{ - return Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor); -} - } // namespace diff --git a/kwin/effects.h b/kwin/effects.h index 000d7adc..6f4ff6e6 100644 --- a/kwin/effects.h +++ b/kwin/effects.h @@ -29,7 +29,6 @@ along with this program. If not, see . #include #include -#include class QDBusPendingCallWatcher; class QDBusServiceWatcher; @@ -166,7 +165,7 @@ public: virtual bool decorationSupportsBlurBehind() const; - virtual EffectFrame* effectFrame(EffectFrameStyle style, bool staticSize, const QPoint& position, Qt::Alignment alignment) const; + virtual EffectFrame* effectFrame(bool staticSize, const QPoint& position, Qt::Alignment alignment) const; virtual QVariant kwinOption(KWinOption kwopt); virtual bool isScreenLocked() const; @@ -349,7 +348,7 @@ class EffectFrameImpl { Q_OBJECT public: - explicit EffectFrameImpl(EffectFrameStyle style, bool staticSize = true, QPoint position = QPoint(-1, -1), + explicit EffectFrameImpl(bool staticSize = true, QPoint position = QPoint(-1, -1), Qt::Alignment alignment = Qt::AlignCenter); virtual ~EffectFrameImpl(); @@ -368,40 +367,15 @@ public: virtual void setPosition(const QPoint& point); virtual const QString& text() const; virtual void setText(const QString& text); - virtual EffectFrameStyle style() const { - return m_style; - }; - Plasma::FrameSvg& frame() { - return m_frame; - } bool isStatic() const { return m_static; }; void finalRender(QRegion region, double opacity, double frameOpacity) const; - virtual void setSelection(const QRect& selection); - const QRect& selection() const { - return m_selectionGeometry; - } - Plasma::FrameSvg& selectionFrame() { - return m_selection; - } - /** - * The foreground text color as specified by the default Plasma theme. - */ - static QColor styledTextColor(); - -private Q_SLOTS: - void plasmaThemeChanged(); - private: Q_DISABLE_COPY(EffectFrameImpl) // As we need to use Qt slots we cannot copy this class void align(QRect &geometry); // positions geometry around m_point respecting m_alignment void autoResize(); // Auto-resize if not a static size - EffectFrameStyle m_style; - Plasma::FrameSvg m_frame; // TODO: share between all EffectFrames - Plasma::FrameSvg m_selection; - // Position bool m_static; QPoint m_point; @@ -413,7 +387,6 @@ private: QFont m_font; QPixmap m_icon; QSize m_iconSize; - QRect m_selectionGeometry; Scene::EffectFrame* m_sceneFrame; }; diff --git a/kwin/effects/dashboard/dashboard.cpp b/kwin/effects/dashboard/dashboard.cpp index c85a7351..943f3e3c 100644 --- a/kwin/effects/dashboard/dashboard.cpp +++ b/kwin/effects/dashboard/dashboard.cpp @@ -26,7 +26,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(dashboard, DashboardEffect) DashboardEffect::DashboardEffect() : transformWindow(false) diff --git a/kwin/effects/diminactive/diminactive.cpp b/kwin/effects/diminactive/diminactive.cpp index af86e7be..58493717 100644 --- a/kwin/effects/diminactive/diminactive.cpp +++ b/kwin/effects/diminactive/diminactive.cpp @@ -28,8 +28,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(diminactive, DimInactiveEffect) - DimInactiveEffect::DimInactiveEffect() { reconfigure(ReconfigureAll); diff --git a/kwin/effects/dimscreen/dimscreen.cpp b/kwin/effects/dimscreen/dimscreen.cpp index 1de5a970..0bae6b66 100644 --- a/kwin/effects/dimscreen/dimscreen.cpp +++ b/kwin/effects/dimscreen/dimscreen.cpp @@ -22,8 +22,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(dimscreen, DimScreenEffect) - DimScreenEffect::DimScreenEffect() : mActivated(false) , activateAnimation(false) diff --git a/kwin/effects/highlightwindow/highlightwindow.cpp b/kwin/effects/highlightwindow/highlightwindow.cpp index 0153c4ec..9b599984 100644 --- a/kwin/effects/highlightwindow/highlightwindow.cpp +++ b/kwin/effects/highlightwindow/highlightwindow.cpp @@ -25,8 +25,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(highlightwindow, HighlightWindowEffect) - HighlightWindowEffect::HighlightWindowEffect() : m_finishing(false) , m_fadeDuration(float(animationTime(150))) diff --git a/kwin/effects/kscreen/kscreen.cpp b/kwin/effects/kscreen/kscreen.cpp index b11e47e5..684a11b1 100644 --- a/kwin/effects/kscreen/kscreen.cpp +++ b/kwin/effects/kscreen/kscreen.cpp @@ -50,8 +50,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(kscreen, KscreenEffect) - KscreenEffect::KscreenEffect() : Effect() , m_state(StateNormal) diff --git a/kwin/effects/logout/logout.cpp b/kwin/effects/logout/logout.cpp index 6db78767..ae8f119b 100644 --- a/kwin/effects/logout/logout.cpp +++ b/kwin/effects/logout/logout.cpp @@ -35,10 +35,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(logout, LogoutEffect) - -#warning this effect is probably bogus - LogoutEffect::LogoutEffect() : progress(0.0) , displayEffect(false) diff --git a/kwin/effects/magnifier/magnifier.cpp b/kwin/effects/magnifier/magnifier.cpp index 1530cec6..1471a7a8 100644 --- a/kwin/effects/magnifier/magnifier.cpp +++ b/kwin/effects/magnifier/magnifier.cpp @@ -38,8 +38,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(magnifier, MagnifierEffect) - const int FRAME_WIDTH = 5; MagnifierEffect::MagnifierEffect() diff --git a/kwin/effects/minimizeanimation/minimizeanimation.cpp b/kwin/effects/minimizeanimation/minimizeanimation.cpp index 6d4f3882..4546cf88 100644 --- a/kwin/effects/minimizeanimation/minimizeanimation.cpp +++ b/kwin/effects/minimizeanimation/minimizeanimation.cpp @@ -25,8 +25,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(minimizeanimation, MinimizeAnimationEffect) - MinimizeAnimationEffect::MinimizeAnimationEffect() { mActiveAnimations = 0; diff --git a/kwin/effects/mousemark/mousemark.cpp b/kwin/effects/mousemark/mousemark.cpp index 38e8c499..77abf07a 100644 --- a/kwin/effects/mousemark/mousemark.cpp +++ b/kwin/effects/mousemark/mousemark.cpp @@ -43,8 +43,6 @@ namespace KWin #define NULL_POINT (QPoint( -1, -1 )) // null point is (0,0), which is valid :-/ -KWIN_EFFECT(mousemark, MouseMarkEffect) - MouseMarkEffect::MouseMarkEffect() { KActionCollection* actionCollection = new KActionCollection(this); diff --git a/kwin/effects/presentwindows/presentwindows.cpp b/kwin/effects/presentwindows/presentwindows.cpp index 172dcdb0..6918230d 100755 --- a/kwin/effects/presentwindows/presentwindows.cpp +++ b/kwin/effects/presentwindows/presentwindows.cpp @@ -50,8 +50,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(presentwindows, PresentWindowsEffect) - PresentWindowsEffect::PresentWindowsEffect() : m_proxy(this) , m_activated(false) @@ -407,12 +405,12 @@ void PresentWindowsEffect::slotWindowAdded(EffectWindow *w) winData->visible = isVisibleWindow(w); winData->opacity = 0.0; winData->highlight = 0.0; - winData->textFrame = effects->effectFrame(EffectFrameUnstyled, false); + winData->textFrame = effects->effectFrame(false); QFont font; font.setBold(true); font.setPointSize(12); winData->textFrame->setFont(font); - winData->iconFrame = effects->effectFrame(EffectFrameUnstyled, false); + winData->iconFrame = effects->effectFrame(false); winData->iconFrame->setAlignment(Qt::AlignRight | Qt::AlignBottom); winData->iconFrame->setIcon(w->icon()); if (isSelectableWindow(w)) { @@ -1498,12 +1496,12 @@ void PresentWindowsEffect::setActive(bool active) if (w->isOnCurrentDesktop() && !w->isMinimized()) winData->opacity = 1.0; winData->highlight = 1.0; - winData->textFrame = effects->effectFrame(EffectFrameUnstyled, false); + winData->textFrame = effects->effectFrame(false); QFont font; font.setBold(true); font.setPointSize(12); winData->textFrame->setFont(font); - winData->iconFrame = effects->effectFrame(EffectFrameUnstyled, false); + winData->iconFrame = effects->effectFrame(false); winData->iconFrame->setAlignment(Qt::AlignRight | Qt::AlignBottom); winData->iconFrame->setIcon(w->icon()); } @@ -1600,7 +1598,7 @@ void PresentWindowsEffect::updateFilterFrame() { QRect area = effects->clientArea(ScreenArea, effects->activeScreen(), effects->currentDesktop()); if (!m_filterFrame) { - m_filterFrame = effects->effectFrame(EffectFrameStyled, false); + m_filterFrame = effects->effectFrame(false); QFont font; font.setPointSize(font.pointSize() * 2); font.setBold(true); @@ -1925,7 +1923,7 @@ void PresentWindowsEffect::screenCountChanged() m_gridSizes.append(GridSize()); if (m_dragToClose) { const QRect screenRect = effects->clientArea(FullScreenArea, i, 1); - EffectFrame *frame = effects->effectFrame(EffectFrameNone, false); + EffectFrame *frame = effects->effectFrame(false); KIcon icon("user-trash"); frame->setIcon(icon.pixmap(QSize(128, 128))); frame->setPosition(QPoint(screenRect.x() + screenRect.width(), screenRect.y())); diff --git a/kwin/effects/resize/resize.cpp b/kwin/effects/resize/resize.cpp index 3487758f..2f34c492 100644 --- a/kwin/effects/resize/resize.cpp +++ b/kwin/effects/resize/resize.cpp @@ -35,8 +35,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(resize, ResizeEffect) - ResizeEffect::ResizeEffect() : AnimationEffect() , m_active(false) diff --git a/kwin/effects/screenedge/CMakeLists.txt b/kwin/effects/screenedge/CMakeLists.txt deleted file mode 100644 index d7ca0bd0..00000000 --- a/kwin/effects/screenedge/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -####################################### -# Effect - -# Source files -set(kwin4_effect_builtins_sources - ${kwin4_effect_builtins_sources} - effects/screenedge/screenedgeeffect.cpp -) - -# .desktop files -install(FILES effects/screenedge/screenedgeeffect.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kwin) diff --git a/kwin/effects/screenedge/screenedgeeffect.cpp b/kwin/effects/screenedge/screenedgeeffect.cpp deleted file mode 100644 index 4b362444..00000000 --- a/kwin/effects/screenedge/screenedgeeffect.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2013 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ -#include "config-kwin.h" - -#include "screenedgeeffect.h" -// KWin -#include -// KDE -#include -// Qt -#include -#include -#include -// xcb -#ifdef KWIN_BUILD_COMPOSITE -#include -#endif - -namespace KWin { - -KWIN_EFFECT(screenedge, ScreenEdgeEffect) - -ScreenEdgeEffect::ScreenEdgeEffect() - : Effect() - , m_glow(new Plasma::Svg(this)) - , m_cleanupTimer(new QTimer(this)) -{ - m_glow->setImagePath("widgets/glowbar"); - connect(effects, SIGNAL(screenEdgeApproaching(ElectricBorder,qreal,QRect)), SLOT(edgeApproaching(ElectricBorder,qreal,QRect))); - m_cleanupTimer->setInterval(5000); - m_cleanupTimer->setSingleShot(true); - connect(m_cleanupTimer, SIGNAL(timeout()), SLOT(cleanup())); -} - -ScreenEdgeEffect::~ScreenEdgeEffect() -{ - cleanup(); -} - -void ScreenEdgeEffect::cleanup() -{ - for (QHash::iterator it = m_borders.begin(); - it != m_borders.end(); - ++it) { - effects->addRepaint((*it)->geometry); - } - qDeleteAll(m_borders); - m_borders.clear(); -} - -void ScreenEdgeEffect::prePaintScreen(ScreenPrePaintData &data, int time) -{ - effects->prePaintScreen(data, time); - for (QHash::iterator it = m_borders.begin(); - it != m_borders.end(); - ++it) { - if ((*it)->strength == 0.0) { - continue; - } - data.paint += (*it)->geometry; - } -} - -void ScreenEdgeEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) -{ - effects->paintScreen(mask, region, data); - for (QHash::iterator it = m_borders.begin(); - it != m_borders.end(); - ++it) { - const qreal opacity = (*it)->strength; - if (opacity == 0.0) { - continue; - } - if (effects->compositingType() == XRenderCompositing) { -#ifdef KWIN_BUILD_COMPOSITE - const QRect &rect = (*it)->geometry; - const QSize &size = (*it)->pictureSize; - int x = rect.x(); - int y = rect.y(); - int width = rect.width(); - int height = rect.height(); - switch ((*it)->border) { - case ElectricTopRight: - x = rect.x() + rect.width() - size.width(); - break; - case ElectricBottomRight: - x = rect.x() + rect.width() - size.width(); - y = rect.y() + rect.height() - size.height(); - break; - case ElectricBottomLeft: - y = rect.y() + rect.height() - size.height(); - break; - default: - // nothing - break; - } - xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, *(*it)->picture.data(), - xRenderBlendPicture(opacity), effects->xrenderBufferPicture(), - 0, 0, 0, 0, x, y, width, height); -#endif - } - } -} - -void ScreenEdgeEffect::edgeApproaching(ElectricBorder border, qreal factor, const QRect &geometry) -{ - QHash::iterator it = m_borders.find(border); - if (it != m_borders.end()) { - // need to update - effects->addRepaint((*it)->geometry); - (*it)->strength = factor; - if ((*it)->geometry != geometry) { - (*it)->geometry = geometry; - effects->addRepaint((*it)->geometry); - if (border == ElectricLeft || border == ElectricRight || border == ElectricTop || border == ElectricBottom) { - if (effects->compositingType() == XRenderCompositing) { -#ifdef KWIN_BUILD_COMPOSITE - (*it)->picture.reset(createEdgeGlow(border, geometry.size())); -#endif - } - } - } - if (factor == 0.0) { - m_cleanupTimer->start(); - } else { - m_cleanupTimer->stop(); - } - } else if (factor != 0.0) { - // need to generate new Glow - Glow *glow = createGlow(border, factor, geometry); - if (glow) { - m_borders.insert(border, glow); - effects->addRepaint(glow->geometry); - } - } -} - -Glow *ScreenEdgeEffect::createGlow(ElectricBorder border, qreal factor, const QRect &geometry) -{ - Glow *glow = new Glow(); - glow->border = border; - glow->strength = factor; - glow->geometry = geometry; - - // render the glow image - if (effects->compositingType() == XRenderCompositing) { -#ifdef KWIN_BUILD_COMPOSITE - if (border == ElectricTopLeft || border == ElectricTopRight || border == ElectricBottomRight || border == ElectricBottomLeft) { - glow->pictureSize = cornerGlowSize(border); - glow->picture.reset(createCornerGlow(border)); - } else { - glow->pictureSize = geometry.size(); - glow->picture.reset(createEdgeGlow(border, geometry.size())); - } - if (glow->picture.isNull()) { - delete glow; - return NULL; - } -#endif - } - - return glow; -} - -template -T *ScreenEdgeEffect::createCornerGlow(ElectricBorder border) -{ - switch (border) { - case ElectricTopLeft: - return new T(m_glow->pixmap("bottomright")); - case ElectricTopRight: - return new T(m_glow->pixmap("bottomleft")); - case ElectricBottomRight: - return new T(m_glow->pixmap("topleft")); - case ElectricBottomLeft: - return new T(m_glow->pixmap("topright")); - default: - return NULL; - } -} - -QSize ScreenEdgeEffect::cornerGlowSize(ElectricBorder border) const -{ - switch (border) { - case ElectricTopLeft: - return m_glow->elementSize("bottomright"); - case ElectricTopRight: - return m_glow->elementSize("bottomleft"); - case ElectricBottomRight: - return m_glow->elementSize("topleft"); - case ElectricBottomLeft: - return m_glow->elementSize("topright"); - default: - return QSize(); - } -} - -template -T *ScreenEdgeEffect::createEdgeGlow(ElectricBorder border, const QSize &size) -{ - QPoint pixmapPosition(0, 0); - QPixmap l, r, c; - switch (border) { - case ElectricTop: - l = m_glow->pixmap("bottomleft"); - r = m_glow->pixmap("bottomright"); - c = m_glow->pixmap("bottom"); - break; - case ElectricBottom: - l = m_glow->pixmap("topleft"); - r = m_glow->pixmap("topright"); - c = m_glow->pixmap("top"); - pixmapPosition = QPoint(0, size.height() - c.height()); - break; - case ElectricLeft: - l = m_glow->pixmap("topright"); - r = m_glow->pixmap("bottomright"); - c = m_glow->pixmap("right"); - break; - case ElectricRight: - l = m_glow->pixmap("topleft"); - r = m_glow->pixmap("bottomleft"); - c = m_glow->pixmap("left"); - pixmapPosition = QPoint(size.width() - c.width(), 0); - break; - default: - return NULL; - } - QPixmap image(size); - image.fill(Qt::transparent); - QPainter p; - p.begin(&image); - if (border == ElectricBottom || border == ElectricTop) { - p.drawPixmap(pixmapPosition, l); - p.drawTiledPixmap(QRect(l.width(), pixmapPosition.y(), size.width() - l.width() - r.width(), c.height()), c); - p.drawPixmap(QPoint(size.width() - r.width(), pixmapPosition.y()), r); - } else { - p.drawPixmap(pixmapPosition, l); - p.drawTiledPixmap(QRect(pixmapPosition.x(), l.height(), c.width(), size.height() - l.height() - r.height()), c); - p.drawPixmap(QPoint(pixmapPosition.x(), size.height() - r.height()), r); - } - p.end(); - return new T(image); -} - -bool ScreenEdgeEffect::isActive() const -{ - return !m_borders.isEmpty(); -} - -} // namespace diff --git a/kwin/effects/screenedge/screenedgeeffect.desktop b/kwin/effects/screenedge/screenedgeeffect.desktop deleted file mode 100644 index 513532e9..00000000 --- a/kwin/effects/screenedge/screenedgeeffect.desktop +++ /dev/null @@ -1,95 +0,0 @@ -[Desktop Entry] -Name=Screen Edge -Name[bs]=Ivice ekrana -Name[ca]=Vora de la pantalla -Name[ca@valencia]=Vora de la pantalla -Name[cs]=Hrana obrazovky -Name[da]=Skærmkant -Name[de]=Bildschirmkante -Name[el]=Άκρο οθόνης -Name[en_GB]=Screen Edge -Name[es]=Borde de la pantalla -Name[et]=Ekraani serv -Name[eu]=Pantailaren ertza -Name[fi]=Näytön reuna -Name[gl]=Beira da pantalla -Name[hu]=Képernyőszél -Name[ia]=Margines de schermo -Name[kk]=Экран жиегі -Name[ko]=화면 경계 -Name[lt]=Ekrano kraštas -Name[mr]=स्क्रीन किनारा -Name[nb]=Skjermkant -Name[nds]=Schirmkant -Name[nl]=Schermrand -Name[pa]=ਸਕਰੀਨ ਕੋਨਾ -Name[pl]=Krawędź ekranu -Name[pt]=Extremo do Ecrã -Name[pt_BR]=Borda da tela -Name[ro]=Muchia ecranului -Name[ru]=Край экрана -Name[sk]=Hrana obrazovky -Name[sl]=Rob zaslona -Name[sr]=Ивица екрана -Name[sr@ijekavian]=Ивица екрана -Name[sr@ijekavianlatin]=Ivica ekrana -Name[sr@latin]=Ivica ekrana -Name[sv]=Skärmkant -Name[tr]=Ekran Kenarı -Name[uk]=Край екрана -Name[x-test]=xxScreen Edgexx -Name[zh_CN]=屏幕边缘 -Name[zh_TW]=螢幕邊緣 -Icon=preferences-system-windows-effect-screenedge -Comment=Highlights a screen edge when approaching -Comment[bs]=Označava ivicu ekrana pri približavanju -Comment[ca]=Ressalta la vora de la pantalla en aproximar-se -Comment[ca@valencia]=Ressalta la vora de la pantalla en aproximar-se -Comment[cs]=Zvýrazní hranu obrazovky při přiblížení k ní -Comment[da]=Fremhæver en skærmkant når den nærmer sig -Comment[de]=Bildschirmkante bei Annäherung hervorheben -Comment[el]=Εμφανίζει τονισμένο το άκρο της οθόνης όταν το πλησιάζετε -Comment[en_GB]=Highlights a screen edge when approaching -Comment[es]=Resalta el borde de la pantalla al aproximarse a él -Comment[et]=Ekraani serva esiletõstmine sellele lähenemisel -Comment[eu]=Pantailaren ertz bat nabarmentzen du hurbiltzerakoan -Comment[fi]=Korostaa näytön reunan sitä lähestyttäessä -Comment[gl]=Realza unha beira da pantalla cando se aproxima -Comment[hu]=Kiemeli a képernyő szélét megközelítéskor -Comment[ia]=Evidentia un margine de schermo quando on approxima se -Comment[kk]=Экран жиегіне жақындағанда оны бояп белгілеу -Comment[ko]=화면 경계에 도달할 때 강조하기 -Comment[lt]=Paryškina ekrano kraštą kai priartėjama -Comment[mr]=पोहोचताना स्क्रीन किनारे ठळक करतो -Comment[nb]=Fremhever en skjermkant når den kommer nær -Comment[nds]=Markeert en Schirmkant, wenn een ehr neger kummt -Comment[nl]=Accentueert een schermrand bij nadering -Comment[pl]=Podświetlenie krawędzi ekranu przy zbliżaniu się do niej -Comment[pt]=Realça um extremo do ecrã ao aproximar-se -Comment[pt_BR]=Destaca a borda da tela quando se aproxima -Comment[ro]=Evidențiază o muchie a ecranului la apropiere -Comment[ru]=Выделяет край экрана при приближении к нему -Comment[sk]=Zvýrazní okraj obrazovky pri priblížení -Comment[sl]=Poudari rob zaslona, ko se mu približate -Comment[sr]=Истиче ивицу екрана при приближавању -Comment[sr@ijekavian]=Истиче ивицу екрана при приближавању -Comment[sr@ijekavianlatin]=Ističe ivicu ekrana pri približavanju -Comment[sr@latin]=Ističe ivicu ekrana pri približavanju -Comment[sv]=Markerar en skärmkant när man närmar sig den -Comment[tr]=Yaklaşıldığında bir ekran kenarını vurgular -Comment[uk]=Підсвічує край екрана у разі наближення вказівника -Comment[x-test]=xxHighlights a screen edge when approachingxx -Comment[zh_CN]=接近屏幕边缘时高亮显示 -Comment[zh_TW]=接近時突顯螢幕邊緣 - -Type=Service -X-KDE-ServiceTypes=KWin/Effect -X-KDE-PluginInfo-Author=Martin Gräßlin -X-KDE-PluginInfo-Email=mgraesslin@kde.org -X-KDE-PluginInfo-Name=kwin4_effect_screenedge -X-KDE-PluginInfo-Version=0.1.0 -X-KDE-PluginInfo-Category=Appearance -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-Ordering=90 diff --git a/kwin/effects/screenedge/screenedgeeffect.h b/kwin/effects/screenedge/screenedgeeffect.h deleted file mode 100644 index 2d97bf04..00000000 --- a/kwin/effects/screenedge/screenedgeeffect.h +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2013 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ -#ifndef KWIN_SCREEN_EDGE_EFFECT_H -#define KWIN_SCREEN_EDGE_EFFECT_H - -#include "config-kwin.h" - -#include - -class QTimer; -namespace Plasma { - class Svg; -} - -namespace KWin { -class Glow; - -class ScreenEdgeEffect : public Effect -{ - Q_OBJECT -public: - ScreenEdgeEffect(); - virtual ~ScreenEdgeEffect(); - virtual void prePaintScreen(ScreenPrePaintData &data, int time); - virtual void paintScreen(int mask, QRegion region, ScreenPaintData &data); - virtual bool isActive() const; -private Q_SLOTS: - void edgeApproaching(ElectricBorder border, qreal factor, const QRect &geometry); - void cleanup(); -private: - Glow *createGlow(ElectricBorder border, qreal factor, const QRect &geometry); - template - T *createCornerGlow(ElectricBorder border); - template - T *createEdgeGlow(ElectricBorder border, const QSize &size); - QSize cornerGlowSize(ElectricBorder border) const; - Plasma::Svg *m_glow; - QHash m_borders; - QTimer *m_cleanupTimer; -}; - -class Glow -{ -public: -#ifdef KWIN_BUILD_COMPOSITE - QScopedPointer picture; - QSize pictureSize; -#endif - qreal strength; - QRect geometry; - ElectricBorder border; -}; - -} - -#endif diff --git a/kwin/effects/showfps/showfps.cpp b/kwin/effects/showfps/showfps.cpp index dedd91f1..2962b3b1 100644 --- a/kwin/effects/showfps/showfps.cpp +++ b/kwin/effects/showfps/showfps.cpp @@ -38,15 +38,13 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(showfps, ShowFpsEffect) - const int FPS_WIDTH = 10; const int MAX_TIME = 100; ShowFpsEffect::ShowFpsEffect() : paints_pos(0) , frames_pos(0) - , m_noBenchmark(effects->effectFrame(EffectFrameUnstyled, false)) + , m_noBenchmark(effects->effectFrame(false)) { for (int i = 0; i < NUM_PAINTS; diff --git a/kwin/effects/showpaint/showpaint.cpp b/kwin/effects/showpaint/showpaint.cpp index 91727dab..87a0878f 100644 --- a/kwin/effects/showpaint/showpaint.cpp +++ b/kwin/effects/showpaint/showpaint.cpp @@ -34,8 +34,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(showpaint, ShowPaintEffect) - static QColor colors[] = { Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta, Qt::yellow, Qt::gray }; diff --git a/kwin/effects/slide/slide.cpp b/kwin/effects/slide/slide.cpp index 45a3d695..43e40f60 100644 --- a/kwin/effects/slide/slide.cpp +++ b/kwin/effects/slide/slide.cpp @@ -26,8 +26,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(slide, SlideEffect) - SlideEffect::SlideEffect() : slide(false) { diff --git a/kwin/effects/slideback/slideback.cpp b/kwin/effects/slideback/slideback.cpp index f280e034..003ae29c 100644 --- a/kwin/effects/slideback/slideback.cpp +++ b/kwin/effects/slideback/slideback.cpp @@ -23,8 +23,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(slideback, SlideBackEffect) - SlideBackEffect::SlideBackEffect() { m_tabboxActive = 0; diff --git a/kwin/effects/slidingpopups/slidingpopups.cpp b/kwin/effects/slidingpopups/slidingpopups.cpp index 0e7da519..7631249b 100644 --- a/kwin/effects/slidingpopups/slidingpopups.cpp +++ b/kwin/effects/slidingpopups/slidingpopups.cpp @@ -27,8 +27,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(slidingpopups, SlidingPopupsEffect) - SlidingPopupsEffect::SlidingPopupsEffect() { mAtom = effects->announceSupportProperty("_KDE_SLIDE", this); diff --git a/kwin/effects/snaphelper/snaphelper.cpp b/kwin/effects/snaphelper/snaphelper.cpp index 9a68c444..a10d3921 100644 --- a/kwin/effects/snaphelper/snaphelper.cpp +++ b/kwin/effects/snaphelper/snaphelper.cpp @@ -28,8 +28,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(snaphelper, SnapHelperEffect) - SnapHelperEffect::SnapHelperEffect() : m_active(false) , m_window(NULL) diff --git a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp b/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp index 818768f1..7f8c416f 100644 --- a/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp +++ b/kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp @@ -30,8 +30,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(taskbarthumbnail, TaskbarThumbnailEffect) - TaskbarThumbnailEffect::TaskbarThumbnailEffect() { atom = effects->announceSupportProperty("_KDE_WINDOW_PREVIEW", this); diff --git a/kwin/effects/thumbnailaside/thumbnailaside.cpp b/kwin/effects/thumbnailaside/thumbnailaside.cpp index 25ed3c3b..ac16484c 100644 --- a/kwin/effects/thumbnailaside/thumbnailaside.cpp +++ b/kwin/effects/thumbnailaside/thumbnailaside.cpp @@ -30,8 +30,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(thumbnailaside, ThumbnailAsideEffect) - ThumbnailAsideEffect::ThumbnailAsideEffect() { KActionCollection* actionCollection = new KActionCollection(this); diff --git a/kwin/effects/trackmouse/trackmouse.cpp b/kwin/effects/trackmouse/trackmouse.cpp index f3de2dee..ddbb9626 100644 --- a/kwin/effects/trackmouse/trackmouse.cpp +++ b/kwin/effects/trackmouse/trackmouse.cpp @@ -44,8 +44,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(trackmouse, TrackMouseEffect) - TrackMouseEffect::TrackMouseEffect() : m_active(false) , m_angle(0) diff --git a/kwin/effects/windowgeometry/windowgeometry.cpp b/kwin/effects/windowgeometry/windowgeometry.cpp index ca649c86..1ded8035 100644 --- a/kwin/effects/windowgeometry/windowgeometry.cpp +++ b/kwin/effects/windowgeometry/windowgeometry.cpp @@ -33,8 +33,6 @@ along with this program. If not, see . using namespace KWin; -KWIN_EFFECT(windowgeometry, WindowGeometryEffect) - WindowGeometryEffect::WindowGeometryEffect() { iAmActivated = true; @@ -52,7 +50,7 @@ WindowGeometryEffect::WindowGeometryEffect() reconfigure(ReconfigureAll); QFont fnt; fnt.setBold(true); fnt.setPointSize(12); for (int i = 0; i < 3; ++i) { - myMeasure[i] = effects->effectFrame(EffectFrameUnstyled, false); + myMeasure[i] = effects->effectFrame(false); myMeasure[i]->setFont(fnt); } myMeasure[0]->setAlignment(Qt::AlignLeft | Qt::AlignTop); diff --git a/kwin/effects/zoom/zoom.cpp b/kwin/effects/zoom/zoom.cpp index ad2c1d87..359b8ff0 100644 --- a/kwin/effects/zoom/zoom.cpp +++ b/kwin/effects/zoom/zoom.cpp @@ -47,8 +47,6 @@ along with this program. If not, see . namespace KWin { -KWIN_EFFECT(zoom, ZoomEffect) - ZoomEffect::ZoomEffect() : Effect() , zoom(1) diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp index 822f3a16..03d92b0a 100644 --- a/kwin/geometry.cpp +++ b/kwin/geometry.cpp @@ -51,7 +51,6 @@ along with this program. If not, see . #include #include -#include "outline.h" namespace KWin { @@ -2657,7 +2656,6 @@ void Client::finishMoveResize(bool cancel) if (isElectricBorderMaximizing()) { setQuickTileMode(electricMode); electricMaximizing = false; - outline()->hide(); elevate(false); } else if (!cancel) { if (!(maximizeMode() & MaximizeHorizontal)) { @@ -3116,10 +3114,6 @@ bool Client::isElectricBorderMaximizing() const void Client::setElectricBorderMaximizing(bool maximizing) { electricMaximizing = maximizing; - if (maximizing) - outline()->show(electricBorderMaximizeGeometry(cursorPos(), desktop())); - else - outline()->hide(); elevate(maximizing); } diff --git a/kwin/kcmkwin/kwinoptions/oxsc-app-kcmkwm.svgz b/kwin/kcmkwin/kwinoptions/oxsc-app-kcmkwm.svgz deleted file mode 100644 index 93776685561b12f3f292612b0c3e1a8f47461640..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2352 zcmV-03D5Q)iwFo7D6T;O18ZY#Yj`%lO*{=%#!5v{b}^uKYxihrHnc%ljPOk<0tV&*R7{Xa&>h@t^}!@W%B-A z;$@O|uVxcan2ZYELIRcdnSc0j z4*yo^3c{_+MVqB%o}}w_n_LyuqQ07BFe&qnfYDwtOuq+iPU6krdK?sslh_B;Pg*F? z8vahVij)Yxk*hwoU_K9*B;D0o)Y&Gu{c!dK&(anIlZ$$lCyTVIZj!6I`IwxSX_r8{ z$*QjE#AleE4N3MUps7`RvR`puZt5$GQqwF$!TgLgd0SsLS>B6hSrSN&$?X^(!Cv0y z)vnVlZ<7%Z^vA@u`XfL#F3-V4PO7}~{ogK5HY7kZ&Eot}YRoy8P@Zr;0f|X_Q+4U} zq-viAste3@ec6<~-Xcr#GGFCY*CvdxFyZSGvbfV%zZ$;)@#AgFd;u1piu?-Dfi}K{ z@n*VCmw8r~b#oFwJ@0>pg|oU@wysk*!*BUKSv{{miMwJM#?Rj zmTZ`JO%0A4bSgC@E8d9y#J1m)6mqqm)7UcTho`vX&Zp#2`Lt zh1kJ35z1Lfqj`WzP9!(Ng3S;W1Tb$C{Yc+ZX#~ZH5CfYEbc`|*(LPQvU=3Fxsx)C> z(V`#3!ieUG2GP$D#XQju)&nC7u=&Ay0!N|dcXG{AZ45oYHE^$#Qw$KPh2Py1h)qi? z#WP_2m+5A{0o?>)TzSC<(2X1CjBgl`mKh*#e|$M7q11?OsRfuKifN~IFb!4X)^cBR zL>VQ3@qlhabD6fB(ZCNA{&bXzVnm2-=mr{&Av(~FQDY^dNGiQEk!q9}br093PX~cpC!K(T8O6T-3BJ$s zT~0z}p&MHJ2d!p8anpCpUo*HCeGdh5O4I09k8&HwYIwhYQAf^)Rrss<*K85yF+5^Ghz0T~fSO0k1M!Qpqm{Sj51NU693n;|L* z)65zg_)&@|DJ-WL5n^DIaZ3!e6j5)J3F@C$p*~=cDu|*V#KMT?hz8Nm5XC&v57q-C z3b6U1dOm#nPZSt~+QCQ=ZKR|2UiL})-_O2p_n^?6?ms9PXJYR`VT3_Hh+#zE?BF;~ zmUmvgnD~FYdNEBDmI`CFKET46+p4IgVY=ukw#CRj2~7!jf{(%dr*{U8=ZG)FXu zeugOKiGHvi7*T-D57qOlu3itiYBA`slU5!@33}JntI4y@arSugdc1jk zK}FU5yrz$dRAX{CvhJ(s(2YDMjfx!6s=TUc&N3YAYi{4~)70v3h1bP)P{Neq@W%TlL8F7CtnhG|RG=j3rXU9oz zC2+OK+pH1Ws8BE4Y|C}zzDar!K>_!eH%L3;pS{BUh z`1c(G{UD%Za2-JF%d@g*FY@Mgl-mVPcjJ7y%qz_4V8_r(FU&_89Bkcw`#9grqqh@g zvJEc)vnEfwdM}d!=HkJ5$gj*p#V=0%w=JTVz`6=)^`*pyXalJ6|FPZP&T4~l^WdcH zS0?5DLQpedn z6EY6r@!KkgzSaSMR)yC|e(Q>|eB(Xt23ZzaUbTCE23V*syXqTWe9E(WwW_PO_d2My z$^4hM^Mn(YV3UIK9V+0hGiWpwhMQK)%XGOH?}!WFlyB@X2i4J*KZ9Y`kKqU(hRx!9 zx_`b)iRXKkO?QuYuX6V>FI5~;C7XVU1yb*^V5_lfgM_3msfb(E z#|(gyDDJehky1m*0E*#-FM?nfV%S4xz9h!$vn|S_F -Copyright (C) 2013 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ -// own -#include "outline.h" -// KWin -#include "composite.h" -// KWin libs -#include -#include "workspace.h" -// Plasma -#include -// Qt -#include -// xcb -#include - -namespace KWin { - -KWIN_SINGLETON_FACTORY(Outline) - -Outline::Outline(QObject *parent) - : QObject(parent) - , m_active(false) -{ - connect(Compositor::self(), SIGNAL(compositingToggled(bool)), SLOT(compositingChanged())); -} - -Outline::~Outline() -{ -} - -void Outline::show() -{ - m_active = true; - if (m_visual.isNull()) { - createHelper(); - } - if (m_visual.isNull()) { - // something went wrong - return; - } - m_visual->show(); -} - -void Outline::hide() -{ - if (!m_active) { - return; - } - m_active = false; - if (m_visual.isNull()) { - return; - } - m_visual->hide(); -} - -void Outline::show(const QRect& outlineGeometry) -{ - setGeometry(outlineGeometry); - show(); -} - -void Outline::setGeometry(const QRect& outlineGeometry) -{ - m_outlineGeometry = outlineGeometry; -} - -void Outline::createHelper() -{ - if (!m_visual.isNull()) { - return; - } - if (Compositor::compositing()) { - m_visual.reset(new CompositedOutlineVisual(this)); - } else { - m_visual.reset(new NonCompositedOutlineVisual(this)); - } -} - -void Outline::compositingChanged() -{ - m_visual.reset(); - if (m_active) { - show(); - } -} - -OutlineVisual::OutlineVisual(Outline *outline) - : m_outline(outline) -{ -} - -OutlineVisual::~OutlineVisual() -{ -} - -CompositedOutlineVisual::CompositedOutlineVisual(Outline *outline) - : QWidget(NULL, Qt::X11BypassWindowManagerHint) - , OutlineVisual(outline) - , m_background(new Plasma::FrameSvg(this)) -{ - setAttribute(Qt::WA_TranslucentBackground); - QPalette pal = palette(); - pal.setColor(backgroundRole(), Qt::transparent); - setPalette(pal); - m_background->setImagePath("widgets/translucentbackground"); - m_background->setCacheAllRenderedFrames(true); - m_background->setEnabledBorders(Plasma::FrameSvg::AllBorders); -} - -CompositedOutlineVisual::~CompositedOutlineVisual() -{ -} - -void CompositedOutlineVisual::hide() -{ - QWidget::hide(); -} - -void CompositedOutlineVisual::show() -{ - const QRect &outlineGeometry = outline()->geometry(); - m_background->resizeFrame(outlineGeometry.size()); - setGeometry(outlineGeometry); - - // check which borders to enable - bool left, right, top, bottom; - left = right = top = bottom = false; - const QRect maximizedArea = Workspace::self()->clientArea(MaximizeArea, outlineGeometry.center(), 1); - if (outlineGeometry.x() == maximizedArea.x()) { - left = true; - } - if (outlineGeometry.y() == maximizedArea.y()) { - top = true; - } - if (outlineGeometry.right() == maximizedArea.right()) { - right = true; - } - if (outlineGeometry.bottom() == maximizedArea.bottom()) { - bottom = true; - } - Plasma::FrameSvg::EnabledBorders borders = Plasma::FrameSvg::AllBorders; - if (left) { - borders = borders & ~Plasma::FrameSvg::LeftBorder; - } - if (right) { - borders = borders & ~Plasma::FrameSvg::RightBorder; - } - if (top) { - borders = borders & ~Plasma::FrameSvg::TopBorder; - } - if (bottom) { - borders = borders & ~Plasma::FrameSvg::BottomBorder; - } - if (left && right && bottom && top) { - borders = Plasma::FrameSvg::AllBorders; - } - m_background->setEnabledBorders(borders); - QWidget::show(); -} - -void CompositedOutlineVisual::paintEvent(QPaintEvent *) -{ - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); - m_background->paintFrame(&painter); -} - -NonCompositedOutlineVisual::NonCompositedOutlineVisual(Outline *outline) - : OutlineVisual(outline) - , m_initialized(false) -{ -} - -NonCompositedOutlineVisual::~NonCompositedOutlineVisual() -{ -} - -void NonCompositedOutlineVisual::show() -{ - if (!m_initialized) { - const QRect geo(0, 0, 1, 1); - const uint32_t values[] = {true}; - // TODO: use template variant - m_leftOutline.create(geo, XCB_CW_OVERRIDE_REDIRECT, values); - m_rightOutline.create(geo, XCB_CW_OVERRIDE_REDIRECT, values); - m_topOutline.create(geo, XCB_CW_OVERRIDE_REDIRECT, values); - m_bottomOutline.create(geo, XCB_CW_OVERRIDE_REDIRECT, values); - m_initialized = true; - } - - const int defaultDepth = Xcb::defaultDepth(); - - const QRect &outlineGeometry = outline()->geometry(); - // left/right parts are between top/bottom, they don't reach as far as the corners - const uint16_t verticalWidth = 5; - const uint16_t verticalHeight = outlineGeometry.height() - 10; - const uint16_t horizontalWidth = outlineGeometry.width(); - const uint horizontalHeight = 5; - m_leftOutline.setGeometry(outlineGeometry.x(), outlineGeometry.y() + 5, verticalWidth, verticalHeight); - m_rightOutline.setGeometry(outlineGeometry.x() + outlineGeometry.width() - 5, outlineGeometry.y() + 5, verticalWidth, verticalHeight); - m_topOutline.setGeometry(outlineGeometry.x(), outlineGeometry.y(), horizontalWidth, horizontalHeight); - m_bottomOutline.setGeometry(outlineGeometry.x(), outlineGeometry.y() + outlineGeometry.height() - 5, horizontalWidth, horizontalHeight); - - const xcb_render_color_t white = {0xffff, 0xffff, 0xffff, 0xffff}; - QColor qGray(Qt::gray); - const xcb_render_color_t gray = { - uint16_t(0xffff * qGray.redF()), - uint16_t(0xffff * qGray.greenF()), - uint16_t(0xffff * qGray.blueF()), - 0xffff - }; - const xcb_render_color_t black = {0, 0, 0, 0xffff}; - { - xcb_pixmap_t xpix = xcb_generate_id(connection()); - xcb_create_pixmap(connection(), defaultDepth, xpix, rootWindow(), verticalWidth, verticalHeight); - XRenderPicture pic(xpix, defaultDepth); - - xcb_rectangle_t rect = {0, 0, 5, verticalHeight}; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, white, 1, &rect); - rect.x = 1; - rect.width = 3; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, gray, 1, &rect); - rect.x = 2; - rect.width = 1; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, black, 1, &rect); - - m_leftOutline.setBackgroundPixmap(xpix); - m_rightOutline.setBackgroundPixmap(xpix); - // According to the XSetWindowBackgroundPixmap documentation the pixmap can be freed. - xcb_free_pixmap(connection(), xpix); - } - { - xcb_pixmap_t xpix = xcb_generate_id(connection()); - xcb_create_pixmap(connection(), defaultDepth, xpix, rootWindow(), horizontalWidth, horizontalHeight); - XRenderPicture pic(xpix, defaultDepth); - - xcb_rectangle_t rect = {0, 0, horizontalWidth, horizontalHeight}; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, white, 1, &rect); - xcb_rectangle_t grayRects[] = { - {1, 1, uint16_t(horizontalWidth -2), 3}, - {1, 4, 3, 1}, - {int16_t(horizontalWidth - 4), 4, 3, 1} - }; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, gray, 3, grayRects); - xcb_rectangle_t blackRects[] = { - {2, 2, uint16_t(horizontalWidth -4), 1}, - {2, 3, 1, 2}, - {int16_t(horizontalWidth - 3), 3, 1, 2} - }; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, black, 3, blackRects); - m_topOutline.setBackgroundPixmap(xpix); - // According to the XSetWindowBackgroundPixmap documentation the pixmap can be freed. - xcb_free_pixmap(connection(), xpix); - } - { - xcb_pixmap_t xpix = xcb_generate_id(connection()); - xcb_create_pixmap(connection(), defaultDepth, xpix, rootWindow(), outlineGeometry.width(), 5); - XRenderPicture pic(xpix, defaultDepth); - - xcb_rectangle_t rect = {0, 0, horizontalWidth, horizontalHeight}; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, white, 1, &rect); - xcb_rectangle_t grayRects[] = { - {1, 1, uint16_t(horizontalWidth -2), 3}, - {1, 0, 3, 1}, - {int16_t(horizontalWidth - 4), 0, 3, 1} - }; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, gray, 3, grayRects); - xcb_rectangle_t blackRects[] = { - {2, 2, uint16_t(horizontalWidth -4), 1}, - {2, 0, 1, 2}, - {int16_t(horizontalWidth - 3), 0, 1, 2} - }; - xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, pic, black, 3, blackRects); - m_bottomOutline.setBackgroundPixmap(xpix); - // According to the XSetWindowBackgroundPixmap documentation the pixmap can be freed. - xcb_free_pixmap(connection(), xpix); - } - forEachWindow(&Xcb::Window::clear); - forEachWindow(&Xcb::Window::map); -} - -void NonCompositedOutlineVisual::hide() -{ - forEachWindow(&Xcb::Window::unmap); -} - -} // namespace diff --git a/kwin/outline.h b/kwin/outline.h deleted file mode 100644 index a3424549..00000000 --- a/kwin/outline.h +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2011 Arthur Arlt - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -#ifndef KWIN_OUTLINE_H -#define KWIN_OUTLINE_H -#include "xcbutils.h" -#include -#include -#include - -namespace Plasma { -class FrameSvg; -} - -namespace KWin { -class OutlineVisual; - -/** - * @short This class is used to show the outline of a given geometry. - * - * The class renders an outline by using four windows. One for each border of - * the geometry. It is possible to replace the outline with an effect. If an - * effect is available the effect will be used, otherwise the outline will be - * rendered by using the X implementation. - * - * @author Arthur Arlt - * @since 4.7 - */ -class Outline : public QObject { - Q_OBJECT -public: - ~Outline(); - - /** - * Set the outline geometry. - * To show the outline use @link showOutline. - * @param outlineGeometry The geometry of the outline to be shown - * @see showOutline - */ - void setGeometry(const QRect &outlineGeometry); - - /** - * Shows the outline of a window using either an effect or the X implementation. - * To stop the outline process use @link hideOutline. - * @see hideOutline - */ - void show(); - - /** - * Shows the outline for the given @p outlineGeometry. - * This is the same as setOutlineGeometry followed by showOutline directly. - * To stop the outline process use @link hideOutline. - * @param outlineGeometry The geometry of the outline to be shown - * @see hideOutline - */ - void show(const QRect &outlineGeometry); - - /** - * Hides shown outline. - * @see showOutline - */ - void hide(); - - const QRect &geometry() const; - -private Q_SLOTS: - void compositingChanged(); - -private: - void createHelper(); - QScopedPointer m_visual; - QRect m_outlineGeometry; - bool m_active; - KWIN_SINGLETON(Outline) -}; - -class OutlineVisual -{ -public: - OutlineVisual(Outline *outline); - virtual ~OutlineVisual(); - virtual void show() = 0; - virtual void hide() = 0; -protected: - Outline *outline(); - const Outline *outline() const; -private: - Outline *m_outline; -}; - -class CompositedOutlineVisual : public QWidget, public OutlineVisual -{ -public: - CompositedOutlineVisual(Outline *outline); - virtual ~CompositedOutlineVisual(); - virtual void show(); - virtual void hide(); -protected: - virtual void paintEvent(QPaintEvent *); -private: - Plasma::FrameSvg *m_background; -}; - -class NonCompositedOutlineVisual : public OutlineVisual -{ -public: - NonCompositedOutlineVisual(Outline *outline); - virtual ~NonCompositedOutlineVisual(); - virtual void show(); - virtual void hide(); - -private: - // TODO: variadic template arguments for adding method arguments - template - void forEachWindow(T method); - bool m_initialized; - Xcb::Window m_topOutline; - Xcb::Window m_rightOutline; - Xcb::Window m_bottomOutline; - Xcb::Window m_leftOutline; -}; - -inline -const QRect &Outline::geometry() const -{ - return m_outlineGeometry; -} - -inline -Outline *OutlineVisual::outline() -{ - return m_outline; -} - -inline -const Outline *OutlineVisual::outline() const -{ - return m_outline; -} - -template -inline -void NonCompositedOutlineVisual::forEachWindow(T method) -{ - (m_topOutline.*method)(); - (m_rightOutline.*method)(); - (m_bottomOutline.*method)(); - (m_leftOutline.*method)(); -} - -inline -Outline *outline() -{ - return Outline::self(); -} - -} - -#endif diff --git a/kwin/oxsc-app-kwin.svgz b/kwin/oxsc-app-kwin.svgz deleted file mode 100644 index 5248264d2a60620e92918c0e81ac0175856abb08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3106 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 diff --git a/kwin/scene.h b/kwin/scene.h index f2c666f6..eddf33de 100644 --- a/kwin/scene.h +++ b/kwin/scene.h @@ -366,7 +366,6 @@ public: virtual void free() = 0; virtual void freeIconFrame() = 0; virtual void freeTextFrame() = 0; - virtual void freeSelection() = 0; virtual void crossFadeIcon() = 0; virtual void crossFadeText() = 0; diff --git a/kwin/scene_xrender.cpp b/kwin/scene_xrender.cpp index cfc9caee..7b57ac23 100644 --- a/kwin/scene_xrender.cpp +++ b/kwin/scene_xrender.cpp @@ -801,7 +801,6 @@ SceneXrender::EffectFrame::EffectFrame(EffectFrameImpl* frame) m_picture = NULL; m_textPicture = NULL; m_iconPicture = NULL; - m_selectionPicture = NULL; } SceneXrender::EffectFrame::~EffectFrame() @@ -809,7 +808,6 @@ SceneXrender::EffectFrame::~EffectFrame() delete m_picture; delete m_textPicture; delete m_iconPicture; - delete m_selectionPicture; } void SceneXrender::EffectFrame::cleanup() @@ -826,8 +824,6 @@ void SceneXrender::EffectFrame::free() m_textPicture = NULL; delete m_iconPicture; m_iconPicture = NULL; - delete m_selectionPicture; - m_selectionPicture = NULL; } void SceneXrender::EffectFrame::freeIconFrame() @@ -842,12 +838,6 @@ void SceneXrender::EffectFrame::freeTextFrame() m_textPicture = NULL; } -void SceneXrender::EffectFrame::freeSelection() -{ - delete m_selectionPicture; - m_selectionPicture = NULL; -} - void SceneXrender::EffectFrame::crossFadeIcon() { // TODO: implement me @@ -866,34 +856,7 @@ void SceneXrender::EffectFrame::render(QRegion region, double opacity, double fr } // Render the actual frame - if (m_effectFrame->style() == EffectFrameUnstyled) { - renderUnstyled(effects->xrenderBufferPicture(), m_effectFrame->geometry(), opacity * frameOpacity); - } else if (m_effectFrame->style() == EffectFrameStyled) { - if (!m_picture) { // Lazy creation - updatePicture(); - } - if (m_picture) { - qreal left, top, right, bottom; - m_effectFrame->frame().getMargins(left, top, right, bottom); // m_geometry is the inner geometry - QRect geom = m_effectFrame->geometry().adjusted(-left, -top, right, bottom); - xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, *m_picture, - XCB_RENDER_PICTURE_NONE, effects->xrenderBufferPicture(), - 0, 0, 0, 0, geom.x(), geom.y(), geom.width(), geom.height()); - } - } - if (!m_effectFrame->selection().isNull()) { - if (!m_selectionPicture) { // Lazy creation - const QPixmap pix = m_effectFrame->selectionFrame().framePixmap(); - if (!pix.isNull()) // don't try if there's no content - m_selectionPicture = new XRenderPicture(m_effectFrame->selectionFrame().framePixmap()); - } - if (m_selectionPicture) { - const QRect geom = m_effectFrame->selection(); - xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, *m_selectionPicture, - XCB_RENDER_PICTURE_NONE, effects->xrenderBufferPicture(), - 0, 0, 0, 0, geom.x(), geom.y(), geom.width(), geom.height()); - } - } + renderUnstyled(effects->xrenderBufferPicture(), m_effectFrame->geometry(), opacity * frameOpacity); XRenderPicture fill = xRenderBlendPicture(opacity); @@ -1012,11 +975,6 @@ void SceneXrender::EffectFrame::updatePicture() { delete m_picture; m_picture = 0L; - if (m_effectFrame->style() == EffectFrameStyled) { - const QPixmap pix = m_effectFrame->frame().framePixmap(); - if (!pix.isNull()) - m_picture = new XRenderPicture(pix); - } } void SceneXrender::EffectFrame::updateTextPicture() @@ -1045,12 +1003,8 @@ void SceneXrender::EffectFrame::updateTextPicture() pixmap.fill(Qt::transparent); QPainter p(&pixmap); p.setFont(m_effectFrame->font()); - if (m_effectFrame->style() == EffectFrameStyled) { - p.setPen(m_effectFrame->styledTextColor()); - } else { - // TODO: What about no frame? Custom color setting required - p.setPen(Qt::white); - } + // TODO: What about no frame? Custom color setting required + p.setPen(Qt::white); p.drawText(rect, m_effectFrame->alignment(), text); p.end(); m_textPicture = new XRenderPicture(pixmap); diff --git a/kwin/scene_xrender.h b/kwin/scene_xrender.h index 0bf50db6..38d25a23 100644 --- a/kwin/scene_xrender.h +++ b/kwin/scene_xrender.h @@ -120,7 +120,6 @@ public: virtual void free(); virtual void freeIconFrame(); virtual void freeTextFrame(); - virtual void freeSelection(); virtual void crossFadeIcon(); virtual void crossFadeText(); virtual void render(QRegion region, double opacity, double frameOpacity); @@ -134,7 +133,6 @@ private: XRenderPicture* m_picture; XRenderPicture* m_textPicture; XRenderPicture* m_iconPicture; - XRenderPicture* m_selectionPicture; static XRenderPicture* s_effectFrameCircle; }; diff --git a/kwin/tabbox/declarative.cpp b/kwin/tabbox/declarative.cpp index a55bdaf9..7f0cd90a 100644 --- a/kwin/tabbox/declarative.cpp +++ b/kwin/tabbox/declarative.cpp @@ -118,7 +118,6 @@ DeclarativeView::DeclarativeView(QAbstractItemModel *model, TabBoxConfig::TabBox , m_model(model) , m_mode(mode) , m_currentScreenGeometry() - , m_frame(new Plasma::FrameSvg(this)) , m_currentLayout() , m_cachedWidth(0) , m_cachedHeight(0) @@ -150,11 +149,6 @@ DeclarativeView::DeclarativeView(QAbstractItemModel *model, TabBoxConfig::TabBox } setSource(QUrl(KStandardDirs::locate("data", QLatin1String("kwin/tabbox/tabbox.qml")))); - // FrameSvg - m_frame->setImagePath("dialogs/background"); - m_frame->setCacheAllRenderedFrames(true); - m_frame->setEnabledBorders(Plasma::FrameSvg::AllBorders); - connect(tabBox, SIGNAL(configChanged()), SLOT(updateQmlSource())); if (m_mode == TabBoxConfig::ClientTabBox) { connect(tabBox, SIGNAL(embeddedChanged(bool)), SLOT(slotEmbeddedChanged(bool))); @@ -191,40 +185,6 @@ void DeclarativeView::showEvent(QShowEvent *event) QGraphicsView::showEvent(event); } -void DeclarativeView::resizeEvent(QResizeEvent *event) -{ - if (tabBox->embedded()) { - Plasma::WindowEffects::enableBlurBehind(winId(), false); - } else { - const QString maskImagePath = rootObject()->property("maskImagePath").toString(); - if (maskImagePath.isEmpty()) { - clearMask(); - Plasma::WindowEffects::enableBlurBehind(winId(), false); - } else { - const double maskWidth = rootObject()->property("maskWidth").toDouble(); - const double maskHeight = rootObject()->property("maskHeight").toDouble(); - const int maskTopMargin = rootObject()->property("maskTopMargin").toInt(); - const int maskLeftMargin = rootObject()->property("maskLeftMargin").toInt(); - m_frame->setImagePath(maskImagePath); - m_frame->resizeFrame(QSizeF(maskWidth, maskHeight)); - QRegion mask = m_frame->mask().translated(maskLeftMargin, maskTopMargin); -#ifndef TABBOX_KCM - // notice: this covers an issue with plasma detecting the compositing state. see plasmaThemeVariant() - if (Workspace::self()->compositing() && effects) { - // blur background?! - Plasma::WindowEffects::enableBlurBehind(winId(), static_cast(effects)->provides(Effect::Blur), mask); - clearMask(); - } else -#endif - { - // do not trim to mask with compositing enabled, otherwise shadows are cropped - setMask(mask); - } - } - } - QDeclarativeView::resizeEvent(event); -} - void DeclarativeView::hideEvent(QHideEvent *event) { QWidget::hideEvent(event); diff --git a/kwin/tabbox/declarative.h b/kwin/tabbox/declarative.h index 00e19989..4721bb49 100644 --- a/kwin/tabbox/declarative.h +++ b/kwin/tabbox/declarative.h @@ -56,7 +56,6 @@ class DeclarativeView : public QDeclarativeView public: DeclarativeView(QAbstractItemModel *model, TabBoxConfig::TabBoxMode mode, QWidget *parent = NULL); virtual void showEvent(QShowEvent *event); - virtual void resizeEvent(QResizeEvent *event); void setCurrentIndex(const QModelIndex &index, bool disableAnimation = false); bool sendKeyEvent(QKeyEvent *event); @@ -79,10 +78,6 @@ private: QAbstractItemModel *m_model; TabBoxConfig::TabBoxMode m_mode; QRect m_currentScreenGeometry; - /** - * Background Frame required for setting the blur mask - */ - Plasma::FrameSvg* m_frame; QString m_currentLayout; int m_cachedWidth; int m_cachedHeight; diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp index 00d84f3b..a1e6ccd9 100644 --- a/kwin/workspace.cpp +++ b/kwin/workspace.cpp @@ -38,7 +38,6 @@ along with this program. If not, see . #include "group.h" #include "killwindow.h" #include "netinfo.h" -#include "outline.h" #include "placement.h" #include "rules.h" #ifdef KWIN_BUILD_SCREENEDGES @@ -222,8 +221,6 @@ Workspace::Workspace(bool restore) client_keys = new KActionCollection(this); - Outline::create(this); - initShortcuts(); init(); -- 2.11.0