Show invite menu in wlm chat window immediately
[kdenetwork.git] / krfb / framebuffer.cpp
blobd7805d5ce10adb41e1f093a14b3136ec004fe568
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8 */
10 #include "framebuffer.h"
11 #include "framebuffer.moc"
13 #include <config-krfb.h>
15 #include <QX11Info>
17 #include "qtframebuffer.h"
18 #include "x11framebuffer.h"
20 #include <X11/Xutil.h>
22 #ifdef HAVE_XDAMAGE
23 #include <X11/extensions/Xdamage.h>
24 #endif
27 FrameBuffer::FrameBuffer(WId id, QObject *parent)
28 : QObject(parent), win(id)
30 //TODO: implement reference counting to avoid update the screen
31 // while no client is connected.
35 FrameBuffer::~FrameBuffer()
37 delete fb;
40 char * FrameBuffer::data()
42 return fb;
45 QList< QRect > FrameBuffer::modifiedTiles()
47 QList<QRect> ret = tiles;
48 tiles.clear();
49 return ret;
52 int FrameBuffer::width()
54 return 0;
57 int FrameBuffer::height()
59 return 0;
62 void FrameBuffer::getServerFormat(rfbPixelFormat &)
66 int FrameBuffer::depth()
68 return 32;
71 FrameBuffer * FrameBuffer::getFrameBuffer(WId id, QObject * parent)
73 #ifdef HAVE_XDAMAGE
74 int tmp, er;
75 if (XDamageQueryExtension(QX11Info::display(), &tmp, &er)) {
76 return new X11FrameBuffer(id, parent);
78 #endif
79 return new QtFrameBuffer(id, parent);
83 int FrameBuffer::paddedWidth()
85 return width() * depth() / 8;
88 void FrameBuffer::startMonitor()
92 void FrameBuffer::stopMonitor()