From 03f35f16673f58eb4101446bb76c6f599f036923 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 19 Feb 2012 13:41:26 +0100 Subject: [PATCH] use libkwindowsystem --- CMakeLists.txt | 6 ++++-- dialog.cpp | 32 ++++++++++++++++---------------- private/tooltip.cpp | 10 +++++----- private/windowpreview.cpp | 22 +++++++++++----------- theme.cpp | 4 ++-- 5 files changed, 38 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea65a90d1..1494bf3d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/tier1/threadweaver/ ${CMAKE_BINARY_DIR}/tier1/threadweaver/ ${CMAKE_BINARY_DIR}/tier1/threadweaver/Weaver + ${CMAKE_SOURCE_DIR}/staging/kwindowsystem/ + ${CMAKE_BINARY_DIR}/staging/kwindowsystem/ ${CMAKE_SOURCE_DIR}/plasma/remote ${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/qtjolie ${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch @@ -273,7 +275,7 @@ kde4_add_library(plasmaqgv ${LIBRARY_TYPE} ${plasmaqgv_LIB_SRCS}) target_link_libraries(plasma ${QT_QTUITOOLS_LIBRARY} ${QT_QTWEBKIT_LIBRARY} ${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSQL_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} - ${KDE4_KDEUI_LIBS} kdnssd threadweaver kdeclarative kauth ${PLASMA_EXTRA_LIBS} kcoreaddons) + ${KDE4_KDEUI_LIBS} kdnssd threadweaver kdeclarative kauth kwindowsystem ${PLASMA_EXTRA_LIBS} kcoreaddons) #FIXME gpgme++ is in kdepimlibs, neeeds to be elsewhere target_link_libraries(plasma ${KDEPIMLIBS_GPGMEPP_LIBS} karchive) @@ -297,7 +299,7 @@ if(DL_LIBRARY) target_link_libraries(plasma ${DL_LIBRARY}) endif(DL_LIBRARY) -target_link_libraries(plasma LINK_INTERFACE_LIBRARIES kdeui kdecore ${QT_QTGUI_LIBRARY}) +target_link_libraries(plasma LINK_INTERFACE_LIBRARIES kdeui kdecore kwindowsystem ${QT_QTGUI_LIBRARY}) #do NOT use GENERIC versioning -- the plasma team will take care of versioning set_target_properties(plasma PROPERTIES diff --git a/dialog.cpp b/dialog.cpp index 5e45a54a6..6d6090d65 100644 --- a/dialog.cpp +++ b/dialog.cpp @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -52,7 +53,6 @@ #include "plasma/framesvg.h" #include "plasma/theme.h" #include "plasma/widgets/scrollwidget.h" -#include "plasma/windoweffects.h" #include "plasma/private/windowshadows_p.h" #ifdef Q_WS_X11 @@ -110,7 +110,7 @@ void DialogPrivate::themeChanged() void DialogPrivate::updateMask() { const bool translucency = Plasma::Theme::defaultTheme()->windowTranslucencyEnabled(); - WindowEffects::enableBlurBehind(q->winId(), translucency, + KWindowEffects::enableBlurBehind(q->winId(), translucency, translucency ? background->mask() : QRegion()); if (translucency) { q->clearMask(); @@ -380,7 +380,7 @@ Dialog::Dialog(QWidget *parent, Qt::WindowFlags f) QPalette pal = palette(); pal.setColor(backgroundRole(), Qt::transparent); setPalette(pal); - WindowEffects::overrideShadow(winId(), true); + KWindowEffects::overrideShadow(winId(), true); d->adjustViewTimer = new QTimer(this); d->adjustViewTimer->setSingleShot(true); @@ -708,7 +708,7 @@ void Dialog::showEvent(QShowEvent * event) } emit dialogVisible(true); - WindowEffects::overrideShadow(winId(), true); + KWindowEffects::overrideShadow(winId(), true); } void Dialog::focusInEvent(QFocusEvent *event) @@ -788,25 +788,25 @@ void Dialog::animatedHide(Plasma::Direction direction) return; } - Location location = Desktop; + KWindowEffects::SlideFromLocation location = KWindowEffects::NoEdge; switch (direction) { case Down: - location = BottomEdge; + location = KWindowEffects::BottomEdge; break; case Right: - location = RightEdge; + location = KWindowEffects::RightEdge; break; case Left: - location = LeftEdge; + location = KWindowEffects::LeftEdge; break; case Up: - location = TopEdge; + location = KWindowEffects::TopEdge; break; default: break; } - Plasma::WindowEffects::slideWindow(this, location); + KWindowEffects::slideWindow(this, location); hide(); } @@ -818,26 +818,26 @@ void Dialog::animatedShow(Plasma::Direction direction) } //copied to not add new api - Location location = Desktop; + KWindowEffects::SlideFromLocation location = KWindowEffects::NoEdge; switch (direction) { case Up: - location = BottomEdge; + location = KWindowEffects::BottomEdge; break; case Left: - location = RightEdge; + location = KWindowEffects::RightEdge; break; case Right: - location = LeftEdge; + location = KWindowEffects::LeftEdge; break; case Down: - location = TopEdge; + location = KWindowEffects::TopEdge; break; default: break; } if (Plasma::Theme::defaultTheme()->windowTranslucencyEnabled()) { - Plasma::WindowEffects::slideWindow(this, location); + KWindowEffects::slideWindow(this, location); } show(); diff --git a/private/tooltip.cpp b/private/tooltip.cpp index 4e1266cd0..fe4e7183e 100644 --- a/private/tooltip.cpp +++ b/private/tooltip.cpp @@ -39,12 +39,12 @@ #include #include #include +#include #include #include #include #include -#include namespace Plasma { @@ -208,7 +208,7 @@ void ToolTip::showEvent(QShowEvent *e) checkSize(); QWidget::showEvent(e); d->preview->setInfo(); - WindowEffects::overrideShadow(winId(), true); + KWindowEffects::overrideShadow(winId(), true); } void ToolTip::hideEvent(QHideEvent *e) @@ -221,7 +221,7 @@ void ToolTip::hideEvent(QHideEvent *e) QMetaObject::invokeMethod(source, "toolTipHidden"); } - WindowEffects::highlightWindows(winId(), QList()); + KWindowEffects::highlightWindows(winId(), QList()); } void ToolTip::mouseReleaseEvent(QMouseEvent *event) @@ -300,7 +300,7 @@ void ToolTip::setContent(QObject *tipper, const ToolTipContent &data) } if (data.highlightWindows() && !data.windowsToPreview().isEmpty()) { - WindowEffects::highlightWindows(winId(), QList() << winId() << data.windowsToPreview()); + KWindowEffects::highlightWindows(winId(), QList() << winId() << data.windowsToPreview()); } d->preview->setWindowIds(data.windowsToPreview()); @@ -345,7 +345,7 @@ void ToolTip::resizeEvent(QResizeEvent *e) QWidget::resizeEvent(e); d->background->resizeFrame(size()); if (Plasma::Theme::defaultTheme()->windowTranslucencyEnabled()) { - WindowEffects::enableBlurBehind(winId(), true, d->background->mask()); + KWindowEffects::enableBlurBehind(winId(), true, d->background->mask()); clearMask(); } else { setMask(d->background->mask()); diff --git a/private/windowpreview.cpp b/private/windowpreview.cpp index d11bb8a44..3471f537f 100644 --- a/private/windowpreview.cpp +++ b/private/windowpreview.cpp @@ -24,11 +24,11 @@ #include #include +#include #include #include #include -#include #ifdef Q_WS_X11 #include @@ -51,7 +51,7 @@ WindowPreview::WindowPreview(QWidget *parent) void WindowPreview::setWindowIds(const QList wids) { - if (!WindowEffects::isEffectAvailable(WindowEffects::WindowPreview)) { + if (!KWindowEffects::isEffectAvailable(KWindowEffects::WindowPreview)) { setMinimumSize(0,0); setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); ids.clear(); @@ -65,7 +65,7 @@ void WindowPreview::setWindowIds(const QList wids) ids = wids.mid(0, 4); } - windowSizes = WindowEffects::windowSizes(ids); + windowSizes = KWindowEffects::windowSizes(ids); QSize s(sizeHint()); if (s.isValid()) { setFixedSize(sizeHint()); @@ -84,7 +84,7 @@ QSize WindowPreview::sizeHint() const } if (!windowSizes.size() == 0) { - windowSizes = WindowEffects::windowSizes(ids); + windowSizes = KWindowEffects::windowSizes(ids); } int maxHeight = 0; @@ -135,16 +135,16 @@ void WindowPreview::setInfo() { QWidget *w = parentWidget(); if (isEmpty()) { - WindowEffects::showWindowThumbnails(w->winId()); + KWindowEffects::showWindowThumbnails(w->winId()); return; } if (windowSizes.size() == 0) { - windowSizes = WindowEffects::windowSizes(ids); + windowSizes = KWindowEffects::windowSizes(ids); } if (windowSizes.size() == 0) { - WindowEffects::showWindowThumbnails(w->winId()); + KWindowEffects::showWindowThumbnails(w->winId()); return; } @@ -173,7 +173,7 @@ void WindowPreview::setInfo() x += s.width() + WINDOW_MARGIN; } - WindowEffects::showWindowThumbnails(w->winId(), ids, inParentCoords); + KWindowEffects::showWindowThumbnails(w->winId(), ids, inParentCoords); } void WindowPreview::paintEvent(QPaintEvent *e) @@ -212,12 +212,12 @@ void WindowPreview::mouseMoveEvent(QMouseEvent *event) for (int i = 0; i < m_thumbnailRects.size(); ++i) { if (m_thumbnailRects[i].contains(event->pos())) { - WindowEffects::highlightWindows(effectiveWinId(), QList() << effectiveWinId() << ids[i]); + KWindowEffects::highlightWindows(effectiveWinId(), QList() << effectiveWinId() << ids[i]); return; } } - WindowEffects::highlightWindows(effectiveWinId(), QList()); + KWindowEffects::highlightWindows(effectiveWinId(), QList()); } void WindowPreview::leaveEvent(QEvent *event) @@ -226,7 +226,7 @@ void WindowPreview::leaveEvent(QEvent *event) if (!m_highlightWindows) { return; } - WindowEffects::highlightWindows(effectiveWinId(), QList()); + KWindowEffects::highlightWindows(effectiveWinId(), QList()); } } // namespace Plasma diff --git a/theme.cpp b/theme.cpp index 583887648..1e3771fca 100644 --- a/theme.cpp +++ b/theme.cpp @@ -42,12 +42,12 @@ #include #include #include +#include #include #include "libplasma-theme-global.h" #include "private/packages_p.h" -#include "windoweffects.h" namespace Plasma { @@ -258,7 +258,7 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo } else if (!compositingActive) { search = QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/opaque/") % image; search = KStandardDirs::locate("data", search); - } else if (WindowEffects::isEffectAvailable(WindowEffects::BlurBehind)) { + } else if (KWindowEffects::isEffectAvailable(KWindowEffects::BlurBehind)) { search = QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/translucent/") % image; search = KStandardDirs::locate("data", search); }