441 |
&os->brush, os->bgcolour, os->fgcolour); |
&os->brush, os->bgcolour, os->fgcolour); |
442 |
} |
} |
443 |
|
|
444 |
|
/* Parse a delta co-ordinate in polyline order form */ |
445 |
|
static int parse_delta(uint8 *buffer, int *offset) |
446 |
|
{ |
447 |
|
int value = buffer[(*offset)++]; |
448 |
|
int two_byte = value & 0x80; |
449 |
|
|
450 |
|
if (value & 0x40) /* sign bit */ |
451 |
|
value |= ~0x3f; |
452 |
|
else |
453 |
|
value &= 0x3f; |
454 |
|
|
455 |
|
if (two_byte) |
456 |
|
value = (value << 8) | buffer[(*offset)++]; |
457 |
|
|
458 |
|
return value; |
459 |
|
} |
460 |
|
|
461 |
|
/* Process a polyline order */ |
462 |
|
static void process_polyline(STREAM s, POLYLINE_ORDER *os, |
463 |
|
uint32 present, BOOL delta) |
464 |
|
{ |
465 |
|
int index, line, data; |
466 |
|
int x, y, xfrom, yfrom; |
467 |
|
uint8 flags = 0; |
468 |
|
PEN pen; |
469 |
|
|
470 |
|
if (present & 0x01) |
471 |
|
rdp_in_coord(s, &os->x, delta); |
472 |
|
|
473 |
|
if (present & 0x02) |
474 |
|
rdp_in_coord(s, &os->y, delta); |
475 |
|
|
476 |
|
if (present & 0x04) |
477 |
|
in_uint8(s, os->flags); |
478 |
|
|
479 |
|
if (present & 0x10) |
480 |
|
rdp_in_colour(s, &os->fgcolour); |
481 |
|
|
482 |
|
if (present & 0x20) |
483 |
|
in_uint8(s, os->lines); |
484 |
|
|
485 |
|
if (present & 0x40) |
486 |
|
{ |
487 |
|
in_uint8(s, os->datasize); |
488 |
|
in_uint8a(s, os->data, os->datasize); |
489 |
|
} |
490 |
|
|
491 |
|
DEBUG("POLYLINE(x=%d,y=%d,fl=0x%x,fg=0x%x,n=%d,sz=%d)\n", |
492 |
|
os->x, os->y, os->flags, os->fgcolour, os->lines, os->datasize); |
493 |
|
|
494 |
|
DEBUG("Data: "); |
495 |
|
|
496 |
|
for (index = 0; index < os->datasize; index++) |
497 |
|
DEBUG("%02x ", os->data[index]); |
498 |
|
|
499 |
|
DEBUG("\n"); |
500 |
|
|
501 |
|
x = os->x; |
502 |
|
y = os->y; |
503 |
|
pen.style = pen.width = 0; |
504 |
|
pen.colour = os->fgcolour; |
505 |
|
|
506 |
|
index = 0; |
507 |
|
data = ((os->lines - 1) / 4) + 1; |
508 |
|
for (line = 0; (line < os->lines) && (data < os->datasize); line++) |
509 |
|
{ |
510 |
|
xfrom = x; |
511 |
|
yfrom = y; |
512 |
|
|
513 |
|
if (line % 4 == 0) |
514 |
|
flags = os->data[index++]; |
515 |
|
|
516 |
|
if ((flags & 0xc0) == 0) |
517 |
|
flags |= 0xc0; /* none = both */ |
518 |
|
|
519 |
|
if (flags & 0x40) |
520 |
|
x += parse_delta(os->data, &data); |
521 |
|
|
522 |
|
if (flags & 0x80) |
523 |
|
y += parse_delta(os->data, &data); |
524 |
|
|
525 |
|
ui_line(ROP2_COPY, xfrom, yfrom, x, y, &pen); |
526 |
|
|
527 |
|
flags <<= 2; |
528 |
|
} |
529 |
|
} |
530 |
|
|
531 |
/* Process a text order */ |
/* Process a text order */ |
532 |
static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta) |
static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta) |
533 |
{ |
{ |
602 |
DEBUG("\n"); |
DEBUG("\n"); |
603 |
|
|
604 |
/* Process special cache strings */ |
/* Process special cache strings */ |
605 |
if ((os->length == 2) && (os->text[0] == 0xfe)) |
if ((os->length >= 2) && (os->text[0] == 0xfe)) |
606 |
{ |
{ |
607 |
entry = cache_get_text(os->text[1]); |
entry = cache_get_text(os->text[1]); |
608 |
|
|
911 |
present, delta); |
present, delta); |
912 |
break; |
break; |
913 |
|
|
914 |
|
case RDP_ORDER_POLYLINE: |
915 |
|
process_polyline(s, &os->polyline, |
916 |
|
present, delta); |
917 |
|
break; |
918 |
|
|
919 |
case RDP_ORDER_TEXT2: |
case RDP_ORDER_TEXT2: |
920 |
process_text2(s, &os->text2, |
process_text2(s, &os->text2, |
921 |
present, delta); |
present, delta); |