krfb
framebuffer.cpp
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2007 Alessandro Praduroux <pradu@pradu.it> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 */ 00009 00010 #include "framebuffer.h" 00011 #include "framebuffer.moc" 00012 00013 #include <config-krfb.h> 00014 00015 #include <QX11Info> 00016 00017 #include "qtframebuffer.h" 00018 #include "x11framebuffer.h" 00019 00020 #include <X11/Xutil.h> 00021 00022 #ifdef HAVE_XDAMAGE 00023 #include <X11/extensions/Xdamage.h> 00024 #endif 00025 00026 00027 FrameBuffer::FrameBuffer(WId id, QObject *parent) 00028 : QObject(parent), win(id) 00029 { 00030 //TODO: implement reference counting to avoid update the screen 00031 // while no client is connected. 00032 } 00033 00034 00035 FrameBuffer::~FrameBuffer() 00036 { 00037 delete fb; 00038 } 00039 00040 char * FrameBuffer::data() 00041 { 00042 return fb; 00043 } 00044 00045 QList< QRect > FrameBuffer::modifiedTiles() 00046 { 00047 QList<QRect> ret = tiles; 00048 tiles.clear(); 00049 return ret; 00050 } 00051 00052 int FrameBuffer::width() 00053 { 00054 return 0; 00055 } 00056 00057 int FrameBuffer::height() 00058 { 00059 return 0; 00060 } 00061 00062 void FrameBuffer::getServerFormat(rfbPixelFormat &) 00063 { 00064 } 00065 00066 int FrameBuffer::depth() 00067 { 00068 return 32; 00069 } 00070 00071 FrameBuffer * FrameBuffer::getFrameBuffer(WId id, QObject * parent) 00072 { 00073 #ifdef HAVE_XDAMAGE 00074 int tmp, er; 00075 if (XDamageQueryExtension(QX11Info::display(), &tmp, &er)) { 00076 return new X11FrameBuffer(id, parent); 00077 } 00078 #endif 00079 return new QtFrameBuffer(id, parent); 00080 00081 } 00082 00083 int FrameBuffer::paddedWidth() 00084 { 00085 return width() * depth() / 8; 00086 } 00087 00088 void FrameBuffer::startMonitor() 00089 { 00090 } 00091 00092 void FrameBuffer::stopMonitor() 00093 { 00094 } 00095 00096
KDE 4.0 API Reference