summaryrefslogtreecommitdiffstats
path: root/common/rfb/VNCSConnectionST.cxx
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2007-04-05 08:43:25 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2007-04-05 08:43:25 +0000
commitdafbb01146a5cc69add5ec510fa73a867f0962bb (patch)
treeb64c999de91af23cbbd8da43d556f0d577c8128e /common/rfb/VNCSConnectionST.cxx
parentb50b29ed2f5b0a61504b832a030acac51f73434a (diff)
downloadtigervnc-dafbb01146a5cc69add5ec510fa73a867f0962bb.tar.gz
tigervnc-dafbb01146a5cc69add5ec510fa73a867f0962bb.zip
Initial implementation of continuous updates in the server code. This code does not handle framebuffer size changes properly yet. Also, the server does not send the client EndOfContinuousUpdates message yet (documented in doc/rfbproto.tex).
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2251 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/VNCSConnectionST.cxx')
-rw-r--r--common/rfb/VNCSConnectionST.cxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx
index fe60e431..bd067be2 100644
--- a/common/rfb/VNCSConnectionST.cxx
+++ b/common/rfb/VNCSConnectionST.cxx
@@ -35,6 +35,7 @@ VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s,
: SConnection(server_->securityFactory, reverse), sock(s), server(server_),
updates(false), image_getter(server->useEconomicTranslate),
drawRenderedCursor(false), removeRenderedCursor(false),
+ autoUpdatesActive(false),
pointerEventTime(0), accessRights(AccessDefault),
startTime(time(0)), m_pFileTransfer(0)
{
@@ -480,6 +481,35 @@ void VNCSConnectionST::framebufferUpdateRequest(const Rect& r,bool incremental)
writeFramebufferUpdate();
}
+void VNCSConnectionST::enableContinuousUpdates(const Rect& r)
+{
+ // TightVNC-specific EnableContinuousUpdates message is very much like
+ // incremental FramebufferUpdateRequest. So here we copy some code from
+ // VNCSConnectionST::framebufferUpdateRequest().
+
+ if (!(accessRights & AccessView)) return;
+
+ SConnection::framebufferUpdateRequest(r, true);
+
+ autoUpdatesActive = true;
+ autoUpdatedRect = r;
+
+ Region reqRgn(autoUpdatedRect);
+ requested.assign_union(reqRgn);
+
+ writeFramebufferUpdate();
+}
+
+void VNCSConnectionST::disableContinuousUpdates()
+{
+ autoUpdatesActive = false;
+ autoUpdatedRect.clear();
+
+ writeFramebufferUpdate();
+
+ // FIXME: Send EndOfContinuousUpdates message.
+}
+
void VNCSConnectionST::setInitialColourMap()
{
setColourMapEntries(0, 0);
@@ -615,6 +645,15 @@ void VNCSConnectionST::writeFramebufferUpdate()
if (drawRenderedCursor)
writeRenderedCursorRect();
writer()->writeFramebufferUpdateEnd();
+ resetRequestedRegion();
+ }
+}
+
+void VNCSConnectionST::resetRequestedRegion()
+{
+ if (autoUpdatesActive) {
+ requested.reset(autoUpdatedRect);
+ } else {
requested.clear();
}
}