From: Constantin Kaplinsky Date: Mon, 3 Sep 2007 10:17:19 +0000 (+0000) Subject: Extended Image::get() methods with a version that can write pixel data at a given... X-Git-Tag: v0.0.90~384^2~133 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cffb691c486f3a075d5d7ee5afcd02846e0a1f8f;p=tigervnc.git Extended Image::get() methods with a version that can write pixel data at a given offset in the destination image. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2333 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/unix/x0vncserver/Image.cxx b/unix/x0vncserver/Image.cxx index fc66c5a9..12da5495 100644 --- a/unix/x0vncserver/Image.cxx +++ b/unix/x0vncserver/Image.cxx @@ -100,9 +100,10 @@ void Image::get(Window wnd, int x, int y) get(wnd, x, y, xim->width, xim->height); } -void Image::get(Window wnd, int x, int y, int w, int h) +void Image::get(Window wnd, int x, int y, int w, int h, + int dst_x, int dst_y) { - XGetSubImage(dpy, wnd, x, y, w, h, AllPlanes, ZPixmap, xim, 0, 0); + XGetSubImage(dpy, wnd, x, y, w, h, AllPlanes, ZPixmap, xim, dst_x, dst_y); } // @@ -314,10 +315,11 @@ void ShmImage::get(Window wnd, int x, int y) XShmGetImage(dpy, wnd, xim, x, y, AllPlanes); } -void ShmImage::get(Window wnd, int x, int y, int w, int h) +void ShmImage::get(Window wnd, int x, int y, int w, int h, + int dst_x, int dst_y) { // FIXME: Use SHM for this as well? - XGetSubImage(dpy, wnd, x, y, w, h, AllPlanes, ZPixmap, xim, 0, 0); + XGetSubImage(dpy, wnd, x, y, w, h, AllPlanes, ZPixmap, xim, dst_x, dst_y); } #ifdef HAVE_READDISPLAY @@ -408,7 +410,8 @@ void IrixOverlayShmImage::get(Window wnd, int x, int y) get(wnd, x, y, xim->width, xim->height); } -void IrixOverlayShmImage::get(Window wnd, int x, int y, int w, int h) +void IrixOverlayShmImage::get(Window wnd, int x, int y, int w, int h, + int dst_x, int dst_y) { XRectangle rect; unsigned long hints = XRD_TRANSPARENT | XRD_READ_POINTER; @@ -419,7 +422,8 @@ void IrixOverlayShmImage::get(Window wnd, int x, int y, int w, int h) rect.height = h; XShmReadDisplayRects(dpy, wnd, - &rect, 1, readDisplayBuf, -x, -y, + &rect, 1, readDisplayBuf, + dst_x - x, dst_y - y, hints, &hints); } @@ -464,13 +468,14 @@ void SolarisOverlayImage::get(Window wnd, int x, int y) get(wnd, x, y, xim->width, xim->height); } -void SolarisOverlayImage::get(Window wnd, int x, int y, int w, int h) +void SolarisOverlayImage::get(Window wnd, int x, int y, int w, int h, + int dst_x, int dst_y) { XImage *tmp_xim = XReadScreen(dpy, wnd, x, y, w, h, True); if (tmp_xim == NULL) return; - updateRect(tmp_xim, 0, 0); + updateRect(tmp_xim, dst_x, dst_y); XDestroyImage(tmp_xim); } diff --git a/unix/x0vncserver/Image.h b/unix/x0vncserver/Image.h index 535cee6a..43c0b0b5 100644 --- a/unix/x0vncserver/Image.h +++ b/unix/x0vncserver/Image.h @@ -48,9 +48,10 @@ public: } virtual void get(Window wnd, int x = 0, int y = 0); - virtual void get(Window wnd, int x, int y, int w, int h); + virtual void get(Window wnd, int x, int y, int w, int h, + int dst_x = 0, int dst_y = 0); -// Copying pixels from one image to another. + // Copying pixels from one image to another. virtual void updateRect(XImage *src, int dst_x = 0, int dst_y = 0); virtual void updateRect(Image *src, int dst_x = 0, int dst_y = 0); virtual void updateRect(XImage *src, int dst_x, int dst_y, int w, int h); @@ -104,7 +105,8 @@ public: } virtual void get(Window wnd, int x = 0, int y = 0); - virtual void get(Window wnd, int x, int y, int w, int h); + virtual void get(Window wnd, int x, int y, int w, int h, + int dst_x = 0, int dst_y = 0); protected: @@ -140,7 +142,8 @@ public: } virtual void get(Window wnd, int x = 0, int y = 0); - virtual void get(Window wnd, int x, int y, int w, int h); + virtual void get(Window wnd, int x, int y, int w, int h, + int dst_x = 0, int dst_y = 0); protected: @@ -185,7 +188,8 @@ public: } virtual void get(Window wnd, int x = 0, int y = 0); - virtual void get(Window wnd, int x, int y, int w, int h); + virtual void get(Window wnd, int x, int y, int w, int h, + int dst_x = 0, int dst_y = 0); protected: