OSDN Git Service

kwin: get rid of Plasma cruft
authorIvailo Monev <xakepa10@laimg.moc>
Thu, 8 Sep 2016 19:49:32 +0000 (19:49 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Thu, 8 Sep 2016 19:49:32 +0000 (19:49 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
43 files changed:
kwin/CMakeLists.txt
kwin/clients/aurorae/src/aurorae.cpp
kwin/effects.cpp
kwin/effects.h
kwin/effects/dashboard/dashboard.cpp
kwin/effects/diminactive/diminactive.cpp
kwin/effects/dimscreen/dimscreen.cpp
kwin/effects/highlightwindow/highlightwindow.cpp
kwin/effects/kscreen/kscreen.cpp
kwin/effects/logout/logout.cpp
kwin/effects/magnifier/magnifier.cpp
kwin/effects/minimizeanimation/minimizeanimation.cpp
kwin/effects/mousemark/mousemark.cpp
kwin/effects/presentwindows/presentwindows.cpp
kwin/effects/resize/resize.cpp
kwin/effects/screenedge/CMakeLists.txt [deleted file]
kwin/effects/screenedge/screenedgeeffect.cpp [deleted file]
kwin/effects/screenedge/screenedgeeffect.desktop [deleted file]
kwin/effects/screenedge/screenedgeeffect.h [deleted file]
kwin/effects/showfps/showfps.cpp
kwin/effects/showpaint/showpaint.cpp
kwin/effects/slide/slide.cpp
kwin/effects/slideback/slideback.cpp
kwin/effects/slidingpopups/slidingpopups.cpp
kwin/effects/snaphelper/snaphelper.cpp
kwin/effects/taskbarthumbnail/taskbarthumbnail.cpp
kwin/effects/thumbnailaside/thumbnailaside.cpp
kwin/effects/trackmouse/trackmouse.cpp
kwin/effects/windowgeometry/windowgeometry.cpp
kwin/effects/zoom/zoom.cpp
kwin/geometry.cpp
kwin/kcmkwin/kwinoptions/oxsc-app-kcmkwm.svgz [deleted file]
kwin/kcmkwin/kwinscreenedges/CMakeLists.txt
kwin/libkwineffects/kwineffects.h
kwin/outline.cpp [deleted file]
kwin/outline.h [deleted file]
kwin/oxsc-app-kwin.svgz [deleted file]
kwin/scene.h
kwin/scene_xrender.cpp
kwin/scene_xrender.h
kwin/tabbox/declarative.cpp
kwin/tabbox/declarative.h
kwin/workspace.cpp

index 251ff8a..c5a76de 100644 (file)
@@ -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}
index 5fabd15..9778ebc 100644 (file)
@@ -20,10 +20,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "config-kwin.h"
 
 #include <QApplication>
-#include <QtDeclarative/QDeclarativeComponent>
-#include <QtDeclarative/QDeclarativeContext>
-#include <QtDeclarative/QDeclarativeEngine>
-#include <QtDeclarative/QDeclarativeItem>
+#include <QDeclarativeComponent>
+#include <QDeclarativeContext>
+#include <QDeclarativeEngine>
+#include <QDeclarativeItem>
 #include <QGraphicsView>
 #include <QPaintEngine>
 
@@ -33,7 +33,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <KPluginInfo>
 #include <KServiceTypeTrader>
 #include <KStandardDirs>
-#include <Plasma/FrameSvg>
 
 namespace Aurorae
 {
index 5554c62..8514957 100644 (file)
@@ -57,7 +57,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <KService>
 #include <KServiceTypeTrader>
 #include <KPluginInfo>
-#include <Plasma/Theme>
 
 #include <assert.h>
 #include "composite.h"
@@ -77,7 +76,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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
index 000d7ad..6f4ff6e 100644 (file)
@@ -29,7 +29,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <QStack>
 #include <QHash>
-#include <Plasma/FrameSvg>
 
 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;
 };
index c85a735..943f3e3 100644 (file)
@@ -26,7 +26,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 namespace KWin
 {
-KWIN_EFFECT(dashboard, DashboardEffect)
 
 DashboardEffect::DashboardEffect()
     : transformWindow(false)
index af86e7b..5849371 100644 (file)
@@ -28,8 +28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(diminactive, DimInactiveEffect)
-
 DimInactiveEffect::DimInactiveEffect()
 {
     reconfigure(ReconfigureAll);
index 1de5a97..0bae6b6 100644 (file)
@@ -22,8 +22,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(dimscreen, DimScreenEffect)
-
 DimScreenEffect::DimScreenEffect()
     : mActivated(false)
     , activateAnimation(false)
index 0153c4e..9b59998 100644 (file)
@@ -25,8 +25,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(highlightwindow, HighlightWindowEffect)
-
 HighlightWindowEffect::HighlightWindowEffect()
     : m_finishing(false)
     , m_fadeDuration(float(animationTime(150)))
index b11e47e..684a11b 100644 (file)
@@ -50,8 +50,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(kscreen, KscreenEffect)
-
 KscreenEffect::KscreenEffect()
     : Effect()
     , m_state(StateNormal)
index 6db7876..ae8f119 100644 (file)
@@ -35,10 +35,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(logout, LogoutEffect)
-
-#warning this effect is probably bogus
-
 LogoutEffect::LogoutEffect()
     : progress(0.0)
     , displayEffect(false)
index 1530cec..1471a7a 100644 (file)
@@ -38,8 +38,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(magnifier, MagnifierEffect)
-
 const int FRAME_WIDTH = 5;
 
 MagnifierEffect::MagnifierEffect()
index 6d4f388..4546cf8 100644 (file)
@@ -25,8 +25,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(minimizeanimation, MinimizeAnimationEffect)
-
 MinimizeAnimationEffect::MinimizeAnimationEffect()
 {
     mActiveAnimations = 0;
index 38e8c49..77abf07 100644 (file)
@@ -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);
index 172dcdb..6918230 100755 (executable)
@@ -50,8 +50,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 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()));
index 3487758..2f34c49 100644 (file)
@@ -35,8 +35,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 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 (file)
index d7ca0bd..0000000
+++ /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 (file)
index 4b36244..0000000
+++ /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 <mgraesslin@kde.org>
-
-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 <http://www.gnu.org/licenses/>.
-*********************************************************************/
-#include "config-kwin.h"
-
-#include "screenedgeeffect.h"
-// KWin
-#include <kwinxrenderutils.h>
-// KDE
-#include <Plasma/Svg>
-// Qt
-#include <QTimer>
-#include <QPainter>
-#include <QVector4D>
-// xcb
-#ifdef KWIN_BUILD_COMPOSITE
-#include <xcb/render.h>
-#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<ElectricBorder, Glow*>::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<ElectricBorder, Glow*>::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<ElectricBorder, Glow*>::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<ElectricBorder, Glow*>::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<XRenderPicture>(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<XRenderPicture>(border));
-        } else {
-            glow->pictureSize = geometry.size();
-            glow->picture.reset(createEdgeGlow<XRenderPicture>(border, geometry.size()));
-        }
-        if (glow->picture.isNull()) {
-            delete glow;
-            return NULL;
-        }
-#endif
-    }
-
-    return glow;
-}
-
-template <typename T>
-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 <typename T>
-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 (file)
index 513532e..0000000
+++ /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 (file)
index 2d97bf0..0000000
+++ /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 <mgraesslin@kde.org>
-
-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 <http://www.gnu.org/licenses/>.
-*********************************************************************/
-#ifndef KWIN_SCREEN_EDGE_EFFECT_H
-#define KWIN_SCREEN_EDGE_EFFECT_H
-
-#include "config-kwin.h"
-
-#include <kwineffects.h>
-
-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 <typename T>
-    T *createCornerGlow(ElectricBorder border);
-    template <typename T>
-    T *createEdgeGlow(ElectricBorder border, const QSize &size);
-    QSize cornerGlowSize(ElectricBorder border) const;
-    Plasma::Svg *m_glow;
-    QHash<ElectricBorder, Glow*> m_borders;
-    QTimer *m_cleanupTimer;
-};
-
-class Glow
-{
-public:
-#ifdef KWIN_BUILD_COMPOSITE
-    QScopedPointer<XRenderPicture> picture;
-    QSize pictureSize;
-#endif
-    qreal strength;
-    QRect geometry;
-    ElectricBorder border;
-};
-
-}
-
-#endif
index dedd91f..2962b3b 100644 (file)
@@ -38,15 +38,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 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;
index 91727da..87a0878 100644 (file)
@@ -34,8 +34,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(showpaint, ShowPaintEffect)
-
 static QColor colors[] = { Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta,
                            Qt::yellow, Qt::gray
                          };
index 45a3d69..43e40f6 100644 (file)
@@ -26,8 +26,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(slide, SlideEffect)
-
 SlideEffect::SlideEffect()
     : slide(false)
 {
index f280e03..003ae29 100644 (file)
@@ -23,8 +23,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(slideback, SlideBackEffect)
-
 SlideBackEffect::SlideBackEffect()
 {
     m_tabboxActive = 0;
index 0e7da51..7631249 100644 (file)
@@ -27,8 +27,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(slidingpopups, SlidingPopupsEffect)
-
 SlidingPopupsEffect::SlidingPopupsEffect()
 {
     mAtom = effects->announceSupportProperty("_KDE_SLIDE", this);
index 9a68c44..a10d392 100644 (file)
@@ -28,8 +28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(snaphelper, SnapHelperEffect)
-
 SnapHelperEffect::SnapHelperEffect()
     : m_active(false)
     , m_window(NULL)
index 818768f..7f8c416 100644 (file)
@@ -30,8 +30,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(taskbarthumbnail, TaskbarThumbnailEffect)
-
 TaskbarThumbnailEffect::TaskbarThumbnailEffect()
 {
     atom = effects->announceSupportProperty("_KDE_WINDOW_PREVIEW", this);
index 25ed3c3..ac16484 100644 (file)
@@ -30,8 +30,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(thumbnailaside, ThumbnailAsideEffect)
-
 ThumbnailAsideEffect::ThumbnailAsideEffect()
 {
     KActionCollection* actionCollection = new KActionCollection(this);
index f3de2de..ddbb962 100644 (file)
@@ -44,8 +44,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(trackmouse, TrackMouseEffect)
-
 TrackMouseEffect::TrackMouseEffect()
     : m_active(false)
     , m_angle(0)
index ca649c8..1ded803 100644 (file)
@@ -33,8 +33,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 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);
index ad2c1d8..359b8ff 100644 (file)
@@ -47,8 +47,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 namespace KWin
 {
 
-KWIN_EFFECT(zoom, ZoomEffect)
-
 ZoomEffect::ZoomEffect()
     : Effect()
     , zoom(1)
index 822f3a1..03d92b0 100644 (file)
@@ -51,7 +51,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <QtGui/qx11info_x11.h>
 
 #include <KGlobalSettings>
-#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 (file)
index 9377668..0000000
Binary files a/kwin/kcmkwin/kwinoptions/oxsc-app-kcmkwm.svgz and /dev/null differ
index b460584..5a08157 100644 (file)
@@ -1,13 +1,11 @@
-include_directories( ${CMAKE_SOURCE_DIR}/kwin )
+include_directories(${CMAKE_SOURCE_DIR}/kwin)
 
-set(
-    kcm_kwinscreenedges_PART_SRCS
+set(kcm_kwinscreenedges_SRCS
     main.cpp
     monitor.cpp
-    main.ui
 )
-kde4_add_plugin( kcm_kwinscreenedges ${kcm_kwinscreenedges_PART_SRCS} )
-target_link_libraries( kcm_kwinscreenedges ${X11_LIBRARIES} kworkspace ${KDE4_PLASMA_LIBS})
-install( TARGETS kcm_kwinscreenedges  DESTINATION ${PLUGIN_INSTALL_DIR} )
+kde4_add_plugin(kcm_kwinscreenedges ${kcm_kwinscreenedges_SRCS})
+target_link_libraries(kcm_kwinscreenedges ${X11_LIBRARIES} kworkspace ${KDE4_PLASMA_LIBS})
+install(TARGETS kcm_kwinscreenedges DESTINATION ${PLUGIN_INSTALL_DIR})
 
-install( FILES kwinscreenedges.desktop  DESTINATION  ${SERVICES_INSTALL_DIR} )
+install(FILES kwinscreenedges.desktop DESTINATION ${SERVICES_INSTALL_DIR})
index 3194d69..219a2fd 100644 (file)
@@ -206,16 +206,6 @@ enum DataRole {
 };
 
 /**
- * Style types used by @ref EffectFrame.
- * @since 4.6
- */
-enum EffectFrameStyle {
-    EffectFrameNone, ///< Displays no frame around the contents.
-    EffectFrameUnstyled, ///< Displays a basic box around the contents.
-    EffectFrameStyled ///< Displays a Plasma-styled frame around the contents.
-};
-
-/**
  * Infinite region (i.e. a special region type saying that everything needs to be painted).
  */
 KWIN_EXPORT inline
@@ -874,8 +864,9 @@ public:
      * EffectFrame.
      * @since 4.6
      */
-    virtual EffectFrame* effectFrame(EffectFrameStyle style, bool staticSize = true,
-                                     const QPoint& position = QPoint(-1, -1), Qt::Alignment alignment = Qt::AlignCenter) const = 0;
+    virtual EffectFrame* effectFrame(bool staticSize = true,
+                                     const QPoint& position = QPoint(-1, -1),
+                                     Qt::Alignment alignment = Qt::AlignCenter) const = 0;
 
     /**
      * Allows an effect to trigger a reload of itself.
@@ -2549,18 +2540,6 @@ public:
     virtual const QSize& iconSize() const = 0;
 
     /**
-     * Sets the geometry of a selection.
-     * To remove the selection set a null rect.
-     * @param selection The geometry of the selection in screen coordinates.
-     **/
-    virtual void setSelection(const QRect& selection) = 0;
-
-    /**
-     * @returns The style of this EffectFrame.
-     **/
-    virtual EffectFrameStyle style() const = 0;
-
-    /**
      * If @p enable is @c true cross fading between icons and text is enabled
      * By default disabled. Use setCrossFadeProgress to cross fade.
      * Cross Fading is currently only available if OpenGL is used.
diff --git a/kwin/outline.cpp b/kwin/outline.cpp
deleted file mode 100644 (file)
index df073fb..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-/********************************************************************
- KWin - the KDE window manager
- This file is part of the KDE project.
-
-Copyright (C) 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de>
-Copyright (C) 2013 Martin Gräßlin <mgraesslin@kde.org>
-
-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 <http://www.gnu.org/licenses/>.
-*********************************************************************/
-// own
-#include "outline.h"
-// KWin
-#include "composite.h"
-// KWin libs
-#include <kwinxrenderutils.h>
-#include "workspace.h"
-// Plasma
-#include <Plasma/FrameSvg>
-// Qt
-#include <QPainter>
-// xcb
-#include <xcb/render.h>
-
-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 (file)
index a342454..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/********************************************************************
- KWin - the KDE window manager
- This file is part of the KDE project.
-
-Copyright (C) 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de>
-
-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 <http://www.gnu.org/licenses/>.
-*********************************************************************/
-
-#ifndef KWIN_OUTLINE_H
-#define KWIN_OUTLINE_H
-#include "xcbutils.h"
-#include <kwinglobals.h>
-#include <QRect>
-#include <QWidget>
-
-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<OutlineVisual> 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 <typename T>
-    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 <typename T>
-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 (file)
index 5248264..0000000
Binary files a/kwin/oxsc-app-kwin.svgz and /dev/null differ
index f2c666f..eddf33d 100644 (file)
@@ -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;
 
index cfc9cae..7b57ac2 100644 (file)
@@ -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);
index 0bf50db..38d25a2 100644 (file)
@@ -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;
 };
 
index a55bdaf..7f0cd90 100644 (file)
@@ -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<EffectsHandlerImpl*>(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);
index 00e1998..4721bb4 100644 (file)
@@ -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;
index 00d84f3..a1e6ccd 100644 (file)
@@ -38,7 +38,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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();