use libkwindowsystem

This commit is contained in:
Aaron Seigo 2012-02-19 13:41:26 +01:00
parent d758c96faf
commit 03f35f1667
5 changed files with 38 additions and 36 deletions

View File

@ -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

View File

@ -42,6 +42,7 @@
#include <QGraphicsLayout>
#include <kdebug.h>
#include <kwindoweffects.h>
#include <kwindowsystem.h>
#include <netwm.h>
@ -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();

View File

@ -39,12 +39,12 @@
#include <kdebug.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kwindoweffects.h>
#include <plasma/plasma.h>
#include <plasma/paintutils.h>
#include <plasma/theme.h>
#include <plasma/framesvg.h>
#include <plasma/windoweffects.h>
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<WId>());
KWindowEffects::highlightWindows(winId(), QList<WId>());
}
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<WId>() << winId() << data.windowsToPreview());
KWindowEffects::highlightWindows(winId(), QList<WId>() << 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());

View File

@ -24,11 +24,11 @@
#include <QVarLengthArray>
#include <QMouseEvent>
#include <kwindoweffects.h>
#include <kwindowsystem.h>
#include <kdebug.h>
#include <plasma/framesvg.h>
#include <plasma/windoweffects.h>
#ifdef Q_WS_X11
#include <QX11Info>
@ -51,7 +51,7 @@ WindowPreview::WindowPreview(QWidget *parent)
void WindowPreview::setWindowIds(const QList<WId> 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<WId> 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<WId>() << effectiveWinId() << ids[i]);
KWindowEffects::highlightWindows(effectiveWinId(), QList<WId>() << effectiveWinId() << ids[i]);
return;
}
}
WindowEffects::highlightWindows(effectiveWinId(), QList<WId>());
KWindowEffects::highlightWindows(effectiveWinId(), QList<WId>());
}
void WindowPreview::leaveEvent(QEvent *event)
@ -226,7 +226,7 @@ void WindowPreview::leaveEvent(QEvent *event)
if (!m_highlightWindows) {
return;
}
WindowEffects::highlightWindows(effectiveWinId(), QList<WId>());
KWindowEffects::highlightWindows(effectiveWinId(), QList<WId>());
}
} // namespace Plasma

View File

@ -42,12 +42,12 @@
#include <kimagecache.h>
#include <ksharedconfig.h>
#include <kstandarddirs.h>
#include <kwindoweffects.h>
#include <kwindowsystem.h>
#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);
}