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.
10 #include "framebuffer.h"
11 #include "framebuffer.moc"
13 #include <config-krfb.h>
17 #include "qtframebuffer.h"
18 #include "x11framebuffer.h"
20 #include <X11/Xutil.h>
23 #include <X11/extensions/Xdamage.h>
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()
40 char * FrameBuffer::data()
45 QList
< QRect
> FrameBuffer::modifiedTiles()
47 QList
<QRect
> ret
= tiles
;
52 int FrameBuffer::width()
57 int FrameBuffer::height()
62 void FrameBuffer::getServerFormat(rfbPixelFormat
&)
66 int FrameBuffer::depth()
71 FrameBuffer
* FrameBuffer::getFrameBuffer(WId id
, QObject
* parent
)
75 if (XDamageQueryExtension(QX11Info::display(), &tmp
, &er
)) {
76 return new X11FrameBuffer(id
, parent
);
79 return new QtFrameBuffer(id
, parent
);
83 int FrameBuffer::paddedWidth()
85 return width() * depth() / 8;
88 void FrameBuffer::startMonitor()
92 void FrameBuffer::stopMonitor()