void xf_rail_paint(xfInfo* xfi, rdpRail* rail, sint32 uleft, sint32 utop, uint32 uright, uint32 ubottom) { xfWindow* xfw; rdpWindow* window; tbool intersect; uint32 iwidth, iheight; sint32 ileft, itop; uint32 iright, ibottom; sint32 wleft, wtop; uint32 wright, wbottom; window_list_rewind(rail->list); while (window_list_has_next(rail->list)) { window = window_list_get_next(rail->list); xfw = (xfWindow*) window->extra; // RDP can have zero width or height windows. X cannot, so we ignore these. if (window->windowWidth == 0 || window->windowHeight == 0) { continue; } wleft = window->windowOffsetX; wtop = window->windowOffsetY; wright = window->windowOffsetX + window->windowWidth - 1; wbottom = window->windowOffsetY + window->windowHeight - 1; ileft = MAX(uleft, wleft); itop = MAX(utop, wtop); iright = MIN(uright, wright); ibottom = MIN(ubottom, wbottom); iwidth = iright - ileft + 1; iheight = ibottom - itop + 1; intersect = ((iright > ileft) && (ibottom > itop)) ? true : false; if (intersect) { xf_UpdateWindowArea(xfi, xfw, ileft - wleft, itop - wtop, iwidth, iheight); } } }
void xf_rail_paint(xfContext* xfc, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom) { xfWindow* xfw; rdpWindow* window; BOOL intersect; UINT32 iwidth, iheight; INT32 ileft, itop; UINT32 iright, ibottom; INT32 wleft, wtop; UINT32 wright, wbottom; window_list_rewind(rail->list); while (window_list_has_next(rail->list)) { window = window_list_get_next(rail->list); xfw = (xfWindow*) window->extra; /* RDP can have zero width or height windows. X cannot, so we ignore these. */ if ((window->windowWidth == 0) || (window->windowHeight == 0)) { continue; } wleft = window->visibleOffsetX; wtop = window->visibleOffsetY; wright = window->visibleOffsetX + window->windowWidth - 1; wbottom = window->visibleOffsetY + window->windowHeight - 1; ileft = MAX(uleft, wleft); itop = MAX(utop, wtop); iright = MIN(uright, wright); ibottom = MIN(ubottom, wbottom); iwidth = iright - ileft + 1; iheight = ibottom - itop + 1; intersect = ((iright > ileft) && (ibottom > itop)) ? TRUE : FALSE; if (intersect) { xf_UpdateWindowArea(xfc, xfw, ileft - wleft, itop - wtop, iwidth, iheight); } } }
void xf_rail_paint(xfInfo* xfi, rdpRail* rail, uint32 ileft, uint32 itop, uint32 iright, uint32 ibottom) { xfWindow* xfw; rdpWindow* window; boolean intersect; uint32 uwidth, uheight; uint32 uleft, utop, uright, ubottom; uint32 wleft, wtop, wright, wbottom; window_list_rewind(rail->list); while (window_list_has_next(rail->list)) { window = window_list_get_next(rail->list); xfw = (xfWindow*) window->extra; wleft = xfw->left; wtop = xfw->top; wright = xfw->right; wbottom = xfw->bottom; intersect = ((iright > wleft) && (ileft < wright) && (ibottom > wtop) && (itop < wbottom)) ? True : False; uleft = (ileft > wleft) ? ileft : wleft; utop = (itop > wtop) ? itop : wtop; uright = (iright < wright) ? iright : wright; ubottom = (ibottom < wbottom) ? ibottom : wbottom; uwidth = uright - uleft + 1; uheight = ubottom - utop + 1; if (intersect) { XPutImage(xfi->display, xfi->primary, xfw->gc, xfi->image, uleft, utop, uleft, utop, uwidth, uheight); XCopyArea(xfi->display, xfi->primary, xfw->handle, xfw->gc, uleft, utop, uwidth, uheight, uleft - xfw->left, utop - xfw->top); } } XFlush(xfi->display); }