summaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/x0vncserver.cxx
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2008-06-04 03:10:05 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2008-06-04 03:10:05 +0000
commite0c80c566649a80697556b767cd014a9625e913f (patch)
treea51a59c25addf25fe5423ea572c5350afb1c7573 /unix/x0vncserver/x0vncserver.cxx
parent1d2967f9063d2afeb80086630d4bb933e8e73f80 (diff)
downloadtigervnc-e0c80c566649a80697556b767cd014a9625e913f.tar.gz
tigervnc-e0c80c566649a80697556b767cd014a9625e913f.zip
Code refactoring: maintaining the Image object representing the framebuffer
in XPixelBuffer instead of XDesktop. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2572 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/x0vncserver.cxx')
-rw-r--r--unix/x0vncserver/x0vncserver.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx
index 9331cf56..f2ff4306 100644
--- a/unix/x0vncserver/x0vncserver.cxx
+++ b/unix/x0vncserver/x0vncserver.cxx
@@ -138,7 +138,7 @@ class XDesktop : public SDesktop, public ColourMap
{
public:
XDesktop(Display* dpy_, Geometry *geometry_)
- : dpy(dpy_), geometry(geometry_), pb(0), server(0), image(0), pollmgr(0),
+ : dpy(dpy_), geometry(geometry_), pb(0), server(0), pollmgr(0),
oldButtonMask(0), haveXtest(false), maxButtons(0), running(false)
{
#ifdef HAVE_XTEST
@@ -175,15 +175,17 @@ public:
vlog.info("Enabling %d button%s of X pointer device",
maxButtons, (maxButtons != 1) ? "s" : "");
- // Create an image for maintaining framebuffer data.
+ // Create an ImageFactory instance for producing Image objects.
ImageFactory factory((bool)useShm, (bool)useOverlay);
- image = factory.newImage(dpy, geometry->width(), geometry->height());
- vlog.info("Allocated %s", image->classDesc());
// Provide pixel buffer to the server object.
- pb = new XPixelBuffer(dpy, image,
+ // FIXME: Pass coordinates in a structure?
+ pb = new XPixelBuffer(dpy, factory,
geometry->offsetLeft(), geometry->offsetTop(),
+ geometry->width(), geometry->height(),
this);
+ vlog.info("Allocated %s", pb->getImage()->classDesc());
+
server = vs;
server->setPixelBuffer(pb);
@@ -199,11 +201,9 @@ public:
delete pb;
delete pollmgr;
- delete image;
pb = 0;
pollmgr = 0;
- image = 0;
}
inline bool isRunning() {
@@ -273,7 +273,6 @@ protected:
Geometry* geometry;
XPixelBuffer* pb;
VNCServer* server;
- Image* image;
PollingManager* pollmgr;
int oldButtonMask;
bool haveXtest;