Plasma compile fixes for non-X11 platforms. Not sure if the X11 stuff even needs an implementation on other platforms or whether this is sufficient.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=763632
This commit is contained in:
Shane King 2008-01-19 23:30:14 +00:00
parent baf6fb0b13
commit 2d697cbfa9

View File

@ -26,13 +26,17 @@
#include <QPixmap> #include <QPixmap>
#include <QTimer> #include <QTimer>
#include <QGraphicsView> #include <QGraphicsView>
#ifdef Q_WS_X11
#include <QX11Info> #include <QX11Info>
#endif
#include <kglobal.h> #include <kglobal.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>
#ifdef Q_WS_X11
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <fixx11h.h> #include <fixx11h.h>
#endif
#include "plasma/plasma.h" #include "plasma/plasma.h"
@ -206,6 +210,7 @@ bool WindowPreview::previewsAvailable() const
if (!KWindowSystem::compositingActive()) { if (!KWindowSystem::compositingActive()) {
return false; return false;
} }
#ifdef Q_WS_X11
// hackish way to find out if KWin has the effect enabled, // hackish way to find out if KWin has the effect enabled,
// TODO provide proper support // TODO provide proper support
Display* dpy = QX11Info::display(); Display* dpy = QX11Info::display();
@ -217,6 +222,7 @@ bool WindowPreview::previewsAvailable() const
XFree(list); XFree(list);
return ret; return ret;
} }
#endif
return false; return false;
} }
@ -235,6 +241,7 @@ QSize WindowPreview::sizeHint() const
void WindowPreview::readWindowSize() const void WindowPreview::readWindowSize() const
{ {
#ifdef Q_WS_X11
Window r; Window r;
int x, y; int x, y;
unsigned int w, h, b, d; unsigned int w, h, b, d;
@ -243,10 +250,14 @@ void WindowPreview::readWindowSize() const
} else { } else {
windowSize = QSize(); windowSize = QSize();
} }
#else
windowSize = QSize();
#endif
} }
void WindowPreview::setInfo() void WindowPreview::setInfo()
{ {
#ifdef Q_WS_X11
Display *dpy = QX11Info::display(); Display *dpy = QX11Info::display();
Atom atom = XInternAtom(dpy, "_KDE_WINDOW_PREVIEW", False); Atom atom = XInternAtom(dpy, "_KDE_WINDOW_PREVIEW", False);
if (id == 0) { if (id == 0) {
@ -264,6 +275,7 @@ void WindowPreview::setInfo()
long data[] = { 1, 5, id, x(), y(), width(), height() }; long data[] = { 1, 5, id, x(), y(), width(), height() };
XChangeProperty(dpy, parentWidget()->winId(), atom, atom, 32, PropModeReplace, XChangeProperty(dpy, parentWidget()->winId(), atom, atom, 32, PropModeReplace,
reinterpret_cast< unsigned char* >( data ), sizeof( data ) / sizeof( data[ 0 ] )); reinterpret_cast< unsigned char* >( data ), sizeof( data ) / sizeof( data[ 0 ] ));
#endif
} }
void ToolTip::resizeEvent(QResizeEvent *) void ToolTip::resizeEvent(QResizeEvent *)