--- sourceforge.net/trunk/rdesktop/xwin.c 2000/08/15 12:01:01 12 +++ sourceforge.net/trunk/rdesktop/xwin.c 2000/10/16 07:37:52 20 @@ -419,19 +419,23 @@ switch (opcode) { + case 0x69: /* PDSxxn */ + ui_memblt(ROP2_XOR, x, y, cx, cy, src, srcx, srcy); + ui_patblt(ROP2_NXOR, x, y, cx, cy, + brush, bgcolour, fgcolour); + break; + case 0xb8: /* PSDPxax */ ui_patblt(ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour); - ui_memblt(ROP2_AND, x, y, cx, cy, - src, srcx, srcy); + ui_memblt(ROP2_AND, x, y, cx, cy, src, srcx, srcy); ui_patblt(ROP2_XOR, x, y, cx, cy, brush, bgcolour, fgcolour); break; default: NOTIMP("triblt 0x%x\n", opcode); - ui_memblt(ROP2_COPY, x, y, cx, cy, - brush, bgcolour, fgcolour); + ui_memblt(ROP2_COPY, x, y, cx, cy, src, srcx, srcy); } } @@ -487,8 +491,9 @@ } } -void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, - int y, int boxx, int boxy, int boxcx, int boxcy, +void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, + int clipx, int clipy, int clipcx, int clipcy, + int boxx, int boxy, int boxcx, int boxcy, int bgcolour, int fgcolour, uint8 *text, uint8 length) { FONTGLYPH *glyph; @@ -498,15 +503,22 @@ { ui_rect(boxx, boxy, boxcx, boxcy, bgcolour); } + else if (mixmode == MIX_OPAQUE) + { + ui_rect(clipx, clipy, clipcx, clipcy, bgcolour); + } /* Paint text, character by character */ for (i = 0; i < length; i++) { glyph = cache_get_font(font, text[i]); + if (!(flags & TEXT2_IMPLICIT_X)) + x += text[++i]; + if (glyph != NULL) { - ui_draw_glyph(mixmode, x, + ui_draw_glyph(mixmode, x + (short)glyph->offset, y + (short)glyph->baseline, glyph->width, glyph->height, glyph->pixmap, 0, 0, @@ -514,8 +526,6 @@ if (flags & TEXT2_IMPLICIT_X) x += glyph->width; - else - x += text[++i]; } } } @@ -523,13 +533,9 @@ void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy) { XImage *image; - int scanline; - scanline = (cx + 3) & ~3; - DEBUG("XGetImage(%p,%x,%d,%d,%d,%d,%x,%d)\n", display, wnd, x, y, - cx, cy, 0xffffffff, ZPixmap); image = XGetImage(display, wnd, x, y, cx, cy, 0xffffffff, ZPixmap); - cache_put_desktop(offset, scanline*cy, image->data); + cache_put_desktop(offset, cx, cy, image->bytes_per_line, image->data); XFree(image->data); XFree(image); } @@ -537,16 +543,14 @@ void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy) { XImage *image; - int scanline; uint8 *data; - scanline = (cx + 3) & ~3; - data = cache_get_desktop(offset, scanline*cy); + data = cache_get_desktop(offset, cx, cy); if (data == NULL) return; image = XCreateImage(display, visual, 8, ZPixmap, 0, - data, cx, cy, 32, scanline); + data, cx, cy, 32, cx); XSetFunction(display, gc, GXcopy); XPutImage(display, wnd, gc, image, 0, 0, x, y, cx, cy); XFree(image);