419 |
|
|
420 |
switch (opcode) |
switch (opcode) |
421 |
{ |
{ |
422 |
|
case 0x69: /* PDSxxn */ |
423 |
|
ui_memblt(ROP2_XOR, x, y, cx, cy, src, srcx, srcy); |
424 |
|
ui_patblt(ROP2_NXOR, x, y, cx, cy, |
425 |
|
brush, bgcolour, fgcolour); |
426 |
|
break; |
427 |
|
|
428 |
case 0xb8: /* PSDPxax */ |
case 0xb8: /* PSDPxax */ |
429 |
ui_patblt(ROP2_XOR, x, y, cx, cy, |
ui_patblt(ROP2_XOR, x, y, cx, cy, |
430 |
brush, bgcolour, fgcolour); |
brush, bgcolour, fgcolour); |
431 |
ui_memblt(ROP2_AND, x, y, cx, cy, |
ui_memblt(ROP2_AND, x, y, cx, cy, src, srcx, srcy); |
|
src, srcx, srcy); |
|
432 |
ui_patblt(ROP2_XOR, x, y, cx, cy, |
ui_patblt(ROP2_XOR, x, y, cx, cy, |
433 |
brush, bgcolour, fgcolour); |
brush, bgcolour, fgcolour); |
434 |
break; |
break; |
435 |
|
|
436 |
default: |
default: |
437 |
NOTIMP("triblt 0x%x\n", opcode); |
NOTIMP("triblt 0x%x\n", opcode); |
438 |
ui_memblt(ROP2_COPY, x, y, cx, cy, |
ui_memblt(ROP2_COPY, x, y, cx, cy, src, srcx, srcy); |
|
brush, bgcolour, fgcolour); |
|
439 |
} |
} |
440 |
} |
} |
441 |
|
|
491 |
} |
} |
492 |
} |
} |
493 |
|
|
494 |
void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, |
void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, |
495 |
int y, int boxx, int boxy, int boxcx, int boxcy, |
int clipx, int clipy, int clipcx, int clipcy, |
496 |
|
int boxx, int boxy, int boxcx, int boxcy, |
497 |
int bgcolour, int fgcolour, uint8 *text, uint8 length) |
int bgcolour, int fgcolour, uint8 *text, uint8 length) |
498 |
{ |
{ |
499 |
FONTGLYPH *glyph; |
FONTGLYPH *glyph; |
503 |
{ |
{ |
504 |
ui_rect(boxx, boxy, boxcx, boxcy, bgcolour); |
ui_rect(boxx, boxy, boxcx, boxcy, bgcolour); |
505 |
} |
} |
506 |
|
else if (mixmode == MIX_OPAQUE) |
507 |
|
{ |
508 |
|
ui_rect(clipx, clipy, clipcx, clipcy, bgcolour); |
509 |
|
} |
510 |
|
|
511 |
/* Paint text, character by character */ |
/* Paint text, character by character */ |
512 |
for (i = 0; i < length; i++) |
for (i = 0; i < length; i++) |
513 |
{ |
{ |
514 |
glyph = cache_get_font(font, text[i]); |
glyph = cache_get_font(font, text[i]); |
515 |
|
|
516 |
|
if (!(flags & TEXT2_IMPLICIT_X)) |
517 |
|
x += text[++i]; |
518 |
|
|
519 |
if (glyph != NULL) |
if (glyph != NULL) |
520 |
{ |
{ |
521 |
ui_draw_glyph(mixmode, x, |
ui_draw_glyph(mixmode, x + (short)glyph->offset, |
522 |
y + (short)glyph->baseline, |
y + (short)glyph->baseline, |
523 |
glyph->width, glyph->height, |
glyph->width, glyph->height, |
524 |
glyph->pixmap, 0, 0, |
glyph->pixmap, 0, 0, |
526 |
|
|
527 |
if (flags & TEXT2_IMPLICIT_X) |
if (flags & TEXT2_IMPLICIT_X) |
528 |
x += glyph->width; |
x += glyph->width; |
|
else |
|
|
x += text[++i]; |
|
529 |
} |
} |
530 |
} |
} |
531 |
} |
} |
533 |
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy) |
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy) |
534 |
{ |
{ |
535 |
XImage *image; |
XImage *image; |
|
int scanline; |
|
536 |
|
|
|
scanline = (cx + 3) & ~3; |
|
|
DEBUG("XGetImage(%p,%x,%d,%d,%d,%d,%x,%d)\n", display, wnd, x, y, |
|
|
cx, cy, 0xffffffff, ZPixmap); |
|
537 |
image = XGetImage(display, wnd, x, y, cx, cy, 0xffffffff, ZPixmap); |
image = XGetImage(display, wnd, x, y, cx, cy, 0xffffffff, ZPixmap); |
538 |
cache_put_desktop(offset, scanline*cy, image->data); |
cache_put_desktop(offset, cx, cy, image->bytes_per_line, image->data); |
539 |
XFree(image->data); |
XFree(image->data); |
540 |
XFree(image); |
XFree(image); |
541 |
} |
} |
543 |
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy) |
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy) |
544 |
{ |
{ |
545 |
XImage *image; |
XImage *image; |
|
int scanline; |
|
546 |
uint8 *data; |
uint8 *data; |
547 |
|
|
548 |
scanline = (cx + 3) & ~3; |
data = cache_get_desktop(offset, cx, cy); |
|
data = cache_get_desktop(offset, scanline*cy); |
|
549 |
if (data == NULL) |
if (data == NULL) |
550 |
return; |
return; |
551 |
|
|
552 |
image = XCreateImage(display, visual, 8, ZPixmap, 0, |
image = XCreateImage(display, visual, 8, ZPixmap, 0, |
553 |
data, cx, cy, 32, scanline); |
data, cx, cy, 32, cx); |
554 |
XSetFunction(display, gc, GXcopy); |
XSetFunction(display, gc, GXcopy); |
555 |
XPutImage(display, wnd, gc, image, 0, 0, x, y, cx, cy); |
XPutImage(display, wnd, gc, image, 0, 0, x, y, cx, cy); |
556 |
XFree(image); |
XFree(image); |