/[rdesktop]/sourceforge.net/trunk/rdesktop/orders.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/orders.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by matty, Tue Aug 15 12:01:01 2000 UTC revision 25 by matty, Sat Jan 6 03:47:04 2001 UTC
# Line 25  extern unsigned char *next_packet; Line 25  extern unsigned char *next_packet;
25  static RDP_ORDER_STATE order_state;  static RDP_ORDER_STATE order_state;
26    
27  /* Read field indicating which parameters are present */  /* Read field indicating which parameters are present */
28  static void rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)  static void
29    rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)
30  {  {
31          uint8 bits;          uint8 bits;
32          int i;          int i;
# Line 52  static void rdp_in_present(STREAM s, uin Line 53  static void rdp_in_present(STREAM s, uin
53  }  }
54    
55  /* Read a co-ordinate (16-bit, or 8-bit delta) */  /* Read a co-ordinate (16-bit, or 8-bit delta) */
56  static void rdp_in_coord(STREAM s, uint16 *coord, BOOL delta)  static void
57    rdp_in_coord(STREAM s, uint16 *coord, BOOL delta)
58  {  {
59          uint8 change;          uint8 change;
60    
61          if (delta)          if (delta)
62          {          {
63                  in_uint8(s, change);                  in_uint8(s, change);
64                  *coord += (char)change;                  *coord += (char) change;
65          }          }
66          else          else
67          {          {
# Line 68  static void rdp_in_coord(STREAM s, uint1 Line 70  static void rdp_in_coord(STREAM s, uint1
70  }  }
71    
72  /* Read a colour entry */  /* Read a colour entry */
73  static void rdp_in_colour(STREAM s, uint8 *colour)  static void
74    rdp_in_colour(STREAM s, uint8 *colour)
75  {  {
76          in_uint8(s, *colour);          in_uint8(s, *colour);
77          s->p += 2;          s->p += 2;
78  }  }
79    
80  /* Parse bounds information */  /* Parse bounds information */
81  static BOOL rdp_parse_bounds(STREAM s, BOUNDS *bounds)  static BOOL
82    rdp_parse_bounds(STREAM s, BOUNDS *bounds)
83  {  {
84          uint8 present;          uint8 present;
85    
# Line 105  static BOOL rdp_parse_bounds(STREAM s, B Line 109  static BOOL rdp_parse_bounds(STREAM s, B
109  }  }
110    
111  /* Parse a pen */  /* Parse a pen */
112  static BOOL rdp_parse_pen(STREAM s, PEN *pen, uint32 present)  static BOOL
113    rdp_parse_pen(STREAM s, PEN *pen, uint32 present)
114  {  {
115          if (present & 1)          if (present & 1)
116                  in_uint8(s, pen->style);                  in_uint8(s, pen->style);
# Line 120  static BOOL rdp_parse_pen(STREAM s, PEN Line 125  static BOOL rdp_parse_pen(STREAM s, PEN
125  }  }
126    
127  /* Parse a brush */  /* Parse a brush */
128  static BOOL rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present)  static BOOL
129    rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present)
130  {  {
131          if (present & 1)          if (present & 1)
132                  in_uint8(s, brush->xorigin);                  in_uint8(s, brush->xorigin);
# Line 141  static BOOL rdp_parse_brush(STREAM s, BR Line 147  static BOOL rdp_parse_brush(STREAM s, BR
147  }  }
148    
149  /* Process a destination blt order */  /* Process a destination blt order */
150  static void process_destblt(STREAM s, DESTBLT_ORDER *os,  static void
151                                  uint32 present, BOOL delta)  process_destblt(STREAM s, DESTBLT_ORDER *os, uint32 present, BOOL delta)
152  {  {
153          if (present & 0x01)          if (present & 0x01)
154                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 166  static void process_destblt(STREAM s, DE Line 172  static void process_destblt(STREAM s, DE
172  }  }
173    
174  /* Process a pattern blt order */  /* Process a pattern blt order */
175  static void process_patblt(STREAM s, PATBLT_ORDER *os,  static void
176                                  uint32 present, BOOL delta)  process_patblt(STREAM s, PATBLT_ORDER *os, uint32 present, BOOL delta)
177  {  {
178          if (present & 0x0001)          if (present & 0x0001)
179                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 197  static void process_patblt(STREAM s, PAT Line 203  static void process_patblt(STREAM s, PAT
203                os->brush.style, os->bgcolour, os->fgcolour);                os->brush.style, os->bgcolour, os->fgcolour);
204    
205          ui_patblt(ROP2_P(os->opcode), os->x, os->y, os->cx, os->cy,          ui_patblt(ROP2_P(os->opcode), os->x, os->y, os->cx, os->cy,
206                                  &os->brush, os->bgcolour, os->fgcolour);                    &os->brush, os->bgcolour, os->fgcolour);
207  }  }
208    
209  /* Process a screen blt order */  /* Process a screen blt order */
210  static void process_screenblt(STREAM s, SCREENBLT_ORDER *os,  static void
211                                          uint32 present, BOOL delta)  process_screenblt(STREAM s, SCREENBLT_ORDER *os, uint32 present, BOOL delta)
212  {  {
213          if (present & 0x0001)          if (present & 0x0001)
214                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 229  static void process_screenblt(STREAM s, Line 235  static void process_screenblt(STREAM s,
235                os->opcode, os->x, os->y, os->cx, os->cy, os->srcx, os->srcy);                os->opcode, os->x, os->y, os->cx, os->cy, os->srcx, os->srcy);
236    
237          ui_screenblt(ROP2_S(os->opcode), os->x, os->y, os->cx, os->cy,          ui_screenblt(ROP2_S(os->opcode), os->x, os->y, os->cx, os->cy,
238                                  os->srcx, os->srcy);                       os->srcx, os->srcy);
239  }  }
240    
241  /* Process a line order */  /* Process a line order */
242  static void process_line(STREAM s, LINE_ORDER *os, uint32 present, BOOL delta)  static void
243    process_line(STREAM s, LINE_ORDER *os, uint32 present, BOOL delta)
244  {  {
245          if (present & 0x0001)          if (present & 0x0001)
246                  in_uint16_le(s, os->mixmode);                  in_uint16_le(s, os->mixmode);
# Line 268  static void process_line(STREAM s, LINE_ Line 275  static void process_line(STREAM s, LINE_
275                  return;                  return;
276          }          }
277    
278          ui_line(os->opcode-1, os->startx, os->starty,          ui_line(os->opcode - 1, os->startx, os->starty,
279                          os->endx, os->endy, &os->pen);                  os->endx, os->endy, &os->pen);
280  }  }
281    
282  /* Process an opaque rectangle order */  /* Process an opaque rectangle order */
283  static void process_rect(STREAM s, RECT_ORDER *os, uint32 present, BOOL delta)  static void
284    process_rect(STREAM s, RECT_ORDER *os, uint32 present, BOOL delta)
285  {  {
286          if (present & 0x01)          if (present & 0x01)
287                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 297  static void process_rect(STREAM s, RECT_ Line 305  static void process_rect(STREAM s, RECT_
305  }  }
306    
307  /* Process a desktop save order */  /* Process a desktop save order */
308  static void process_desksave(STREAM s, DESKSAVE_ORDER *os,  static void
309                                  uint32 present, BOOL delta)  process_desksave(STREAM s, DESKSAVE_ORDER *os, uint32 present, BOOL delta)
310  {  {
311          int width, height;          int width, height;
312    
# Line 330  static void process_desksave(STREAM s, D Line 338  static void process_desksave(STREAM s, D
338          if (os->action == 0)          if (os->action == 0)
339                  ui_desktop_save(os->offset, os->left, os->top, width, height);                  ui_desktop_save(os->offset, os->left, os->top, width, height);
340          else          else
341                  ui_desktop_restore(os->offset, os->left, os->top, width, height);                  ui_desktop_restore(os->offset, os->left, os->top, width,
342                                       height);
343  }  }
344    
345  /* Process a memory blt order */  /* Process a memory blt order */
346  static void process_memblt(STREAM s, MEMBLT_ORDER *os,  static void
347                                  uint32 present, BOOL delta)  process_memblt(STREAM s, MEMBLT_ORDER *os, uint32 present, BOOL delta)
348  {  {
349          HBITMAP bitmap;          HBITMAP bitmap;
350    
# Line 378  static void process_memblt(STREAM s, MEM Line 387  static void process_memblt(STREAM s, MEM
387                  return;                  return;
388    
389          ui_memblt(ROP2_S(os->opcode), os->x, os->y, os->cx, os->cy,          ui_memblt(ROP2_S(os->opcode), os->x, os->y, os->cx, os->cy,
390                          bitmap, os->srcx, os->srcy);                    bitmap, os->srcx, os->srcy);
391  }  }
392    
393  /* Process a 3-way blt order */  /* Process a 3-way blt order */
394  static void process_triblt(STREAM s, TRIBLT_ORDER *os,  static void
395                                  uint32 present, BOOL delta)  process_triblt(STREAM s, TRIBLT_ORDER *os, uint32 present, BOOL delta)
396  {  {
397          HBITMAP bitmap;          HBITMAP bitmap;
398    
# Line 428  static void process_triblt(STREAM s, TRI Line 437  static void process_triblt(STREAM s, TRI
437          if (present & 0x010000)          if (present & 0x010000)
438                  in_uint16_le(s, os->unknown);                  in_uint16_le(s, os->unknown);
439    
440          DEBUG("TRIBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,id=%d,idx=%d,bs=%d,bg=0x%x,fg=0x%x)\n",          DEBUG
441                os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id,                  ("TRIBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,id=%d,idx=%d,bs=%d,bg=0x%x,fg=0x%x)\n",
442                os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour);                   os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id,
443                     os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour);
444    
445          bitmap = cache_get_bitmap(os->cache_id, os->cache_idx);          bitmap = cache_get_bitmap(os->cache_id, os->cache_idx);
446          if (bitmap == NULL)          if (bitmap == NULL)
447                  return;                  return;
448    
449          ui_triblt(os->opcode, os->x, os->y, os->cx, os->cy,          ui_triblt(os->opcode, os->x, os->y, os->cx, os->cy,
450                          bitmap, os->srcx, os->srcy,                    bitmap, os->srcx, os->srcy,
451                          &os->brush, os->bgcolour, os->fgcolour);                    &os->brush, os->bgcolour, os->fgcolour);
452    }
453    
454    /* Parse a delta co-ordinate in polyline order form */
455    static int
456    parse_delta(uint8 *buffer, int *offset)
457    {
458            int value = buffer[(*offset)++];
459            int two_byte = value & 0x80;
460    
461            if (value & 0x40)       /* sign bit */
462                    value |= ~0x3f;
463            else
464                    value &= 0x3f;
465    
466            if (two_byte)
467                    value = (value << 8) | buffer[(*offset)++];
468    
469            return value;
470    }
471    
472    /* Process a polyline order */
473    static void
474    process_polyline(STREAM s, POLYLINE_ORDER *os, uint32 present, BOOL delta)
475    {
476            int index, line, data;
477            int x, y, xfrom, yfrom;
478            uint8 flags = 0;
479            PEN pen;
480    
481            if (present & 0x01)
482                    rdp_in_coord(s, &os->x, delta);
483    
484            if (present & 0x02)
485                    rdp_in_coord(s, &os->y, delta);
486    
487            if (present & 0x04)
488                    in_uint8(s, os->flags);
489    
490            if (present & 0x10)
491                    rdp_in_colour(s, &os->fgcolour);
492    
493            if (present & 0x20)
494                    in_uint8(s, os->lines);
495    
496            if (present & 0x40)
497            {
498                    in_uint8(s, os->datasize);
499                    in_uint8a(s, os->data, os->datasize);
500            }
501    
502            DEBUG("POLYLINE(x=%d,y=%d,fl=0x%x,fg=0x%x,n=%d,sz=%d)\n",
503                  os->x, os->y, os->flags, os->fgcolour, os->lines, os->datasize);
504    
505            DEBUG("Data: ");
506    
507            for (index = 0; index < os->datasize; index++)
508                    DEBUG("%02x ", os->data[index]);
509    
510            DEBUG("\n");
511    
512            x = os->x;
513            y = os->y;
514            pen.style = pen.width = 0;
515            pen.colour = os->fgcolour;
516    
517            index = 0;
518            data = ((os->lines - 1) / 4) + 1;
519            for (line = 0; (line < os->lines) && (data < os->datasize); line++)
520            {
521                    xfrom = x;
522                    yfrom = y;
523    
524                    if (line % 4 == 0)
525                            flags = os->data[index++];
526    
527                    if ((flags & 0xc0) == 0)
528                            flags |= 0xc0;  /* none = both */
529    
530                    if (flags & 0x40)
531                            x += parse_delta(os->data, &data);
532    
533                    if (flags & 0x80)
534                            y += parse_delta(os->data, &data);
535    
536                    ui_line(ROP2_COPY, xfrom, yfrom, x, y, &pen);
537    
538                    flags <<= 2;
539            }
540  }  }
541    
542  /* Process a text order */  /* Process a text order */
543  static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta)  static void
544    process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta)
545  {  {
546          DATABLOB *entry;          DATABLOB *entry;
547          int i;          int i;
# Line 501  static void process_text2(STREAM s, TEXT Line 600  static void process_text2(STREAM s, TEXT
600                  in_uint8a(s, os->text, os->length);                  in_uint8a(s, os->text, os->length);
601          }          }
602    
603          DEBUG("TEXT2(x=%d,y=%d,cl=%d,ct=%d,cr=%d,cb=%d,bl=%d,bt=%d,bb=%d,br=%d,fg=0x%x,bg=0x%x,font=%d,fl=0x%x,mix=%d,unk=0x%x,n=%d)\n",          DEBUG
604                  os->x, os->y, os->clipleft, os->cliptop, os->clipright,                  ("TEXT2(x=%d,y=%d,cl=%d,ct=%d,cr=%d,cb=%d,bl=%d,bt=%d,bb=%d,br=%d,fg=0x%x,bg=0x%x,font=%d,fl=0x%x,mix=%d,unk=0x%x,n=%d)\n",
605                  os->clipbottom, os->boxleft, os->boxtop, os->boxright,                   os->x, os->y, os->clipleft, os->cliptop, os->clipright,
606                  os->boxbottom, os->fgcolour, os->bgcolour, os->font,                   os->clipbottom, os->boxleft, os->boxtop, os->boxright,
607                  os->flags, os->mixmode, os->unknown, os->length);                   os->boxbottom, os->fgcolour, os->bgcolour, os->font,
608                     os->flags, os->mixmode, os->unknown, os->length);
609    
610          DEBUG("Text: ");          DEBUG("Text: ");
611    
# Line 515  static void process_text2(STREAM s, TEXT Line 615  static void process_text2(STREAM s, TEXT
615          DEBUG("\n");          DEBUG("\n");
616    
617          /* Process special cache strings */          /* Process special cache strings */
618          if ((os->length == 2) && (os->text[0] == 0xfe))          if ((os->length >= 2) && (os->text[0] == 0xfe))
619          {          {
620                  entry = cache_get_text(os->text[1]);                  entry = cache_get_text(os->text[1]);
621    
622                  if (entry == NULL)                  if (entry == NULL)
623                          return;                          return;
624                    
625                  memcpy(os->text, entry->data, entry->size);                  memcpy(os->text, entry->data, entry->size);
626                  os->length = entry->size;                  os->length = entry->size;
627          }          }
628          else if ((os->length >= 3) && (os->text[os->length-3] == 0xff))          else if ((os->length >= 3) && (os->text[os->length - 3] == 0xff))
629          {          {
630                  os->length -= 3;                  os->length -= 3;
631                  cache_put_text(os->text[os->length+1], os->text, os->length);                  cache_put_text(os->text[os->length + 1], os->text,
632                                   os->length);
633          }          }
634    
635          ui_draw_text(os->font, os->flags, os->mixmode,          ui_draw_text(os->font, os->flags, os->mixmode, os->x, os->y,
636                          os->x, os->y, os->boxleft, os->boxtop,                       os->clipleft, os->cliptop,
637                          os->boxright - os->boxleft,                       os->clipright - os->clipleft,
638                          os->boxbottom - os->boxtop,                       os->clipbottom - os->cliptop,
639                          os->bgcolour, os->fgcolour, os->text, os->length);                       os->boxleft, os->boxtop,
640                         os->boxright - os->boxleft,
641                         os->boxbottom - os->boxtop,
642                         os->bgcolour, os->fgcolour, os->text, os->length);
643  }  }
644    
645  /* Process a raw bitmap cache order */  /* Process a raw bitmap cache order */
646  static void process_raw_bmpcache(STREAM s)  static void
647    process_raw_bmpcache(STREAM s)
648  {  {
649          HBITMAP bitmap;          HBITMAP bitmap;
650          uint16 cache_idx, bufsize;          uint16 cache_idx, bufsize;
# Line 547  static void process_raw_bmpcache(STREAM Line 652  static void process_raw_bmpcache(STREAM
652          uint8 *data;          uint8 *data;
653    
654          in_uint8(s, cache_id);          in_uint8(s, cache_id);
655          in_uint8s(s, 1); /* pad */          in_uint8s(s, 1);        /* pad */
656          in_uint8(s, width);          in_uint8(s, width);
657          in_uint8(s, height);          in_uint8(s, height);
658          in_uint8(s, bpp);          in_uint8(s, bpp);
# Line 563  static void process_raw_bmpcache(STREAM Line 668  static void process_raw_bmpcache(STREAM
668  }  }
669    
670  /* Process a bitmap cache order */  /* Process a bitmap cache order */
671  static void process_bmpcache(STREAM s)  static void
672    process_bmpcache(STREAM s)
673  {  {
674          HBITMAP bitmap;          HBITMAP bitmap;
675          uint16 cache_idx, size;          uint16 cache_idx, size;
# Line 571  static void process_bmpcache(STREAM s) Line 677  static void process_bmpcache(STREAM s)
677          uint8 *data, *bmpdata;          uint8 *data, *bmpdata;
678    
679          in_uint8(s, cache_id);          in_uint8(s, cache_id);
680          in_uint8s(s, 1); /* pad */          in_uint8s(s, 1);        /* pad */
681          in_uint8(s, width);          in_uint8(s, width);
682          in_uint8(s, height);          in_uint8(s, height);
683          in_uint8(s, bpp);          in_uint8(s, bpp);
684          in_uint8s(s, 2); /* bufsize */          in_uint8s(s, 2);        /* bufsize */
685          in_uint16_le(s, cache_idx);          in_uint16_le(s, cache_idx);
686          in_uint8s(s, 2); /* pad */          in_uint8s(s, 2);        /* pad */
687          in_uint16_le(s, size);          in_uint16_le(s, size);
688          in_uint8s(s, 4); /* row_size, final_size */          in_uint8s(s, 4);        /* row_size, final_size */
689          in_uint8p(s, data, size);          in_uint8p(s, data, size);
690    
691          DEBUG("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n",          DEBUG("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n",
# Line 597  static void process_bmpcache(STREAM s) Line 703  static void process_bmpcache(STREAM s)
703  }  }
704    
705  /* Process a colourmap cache order */  /* Process a colourmap cache order */
706  static void process_colcache(STREAM s)  static void
707    process_colcache(STREAM s)
708  {  {
709          COLOURENTRY *entry;          COLOURENTRY *entry;
710          COLOURMAP map;          COLOURMAP map;
# Line 616  static void process_colcache(STREAM s) Line 723  static void process_colcache(STREAM s)
723                  in_uint8(s, entry->blue);                  in_uint8(s, entry->blue);
724                  in_uint8(s, entry->green);                  in_uint8(s, entry->green);
725                  in_uint8(s, entry->red);                  in_uint8(s, entry->red);
726                  in_uint8s(s, 1); /* pad */                  in_uint8s(s, 1);        /* pad */
727          }          }
728    
729          DEBUG("COLCACHE(id=%d,n=%d)\n", cache_id, map.ncolours);          DEBUG("COLCACHE(id=%d,n=%d)\n", cache_id, map.ncolours);
# Line 628  static void process_colcache(STREAM s) Line 735  static void process_colcache(STREAM s)
735  }  }
736    
737  /* Process a font cache order */  /* Process a font cache order */
738  static void process_fontcache(STREAM s)  static void
739    process_fontcache(STREAM s)
740  {  {
741          HGLYPH bitmap;          HGLYPH bitmap;
742          uint8 font, nglyphs;          uint8 font, nglyphs;
743          uint16 character, baseline, width, height;          uint16 character, offset, baseline, width, height;
744          uint8 *data, *rev_data, in, out;          int i, datasize;
745          int i, j, datasize;          uint8 *data;
746    
747          in_uint8(s, font);          in_uint8(s, font);
748          in_uint8(s, nglyphs);          in_uint8(s, nglyphs);
# Line 644  static void process_fontcache(STREAM s) Line 752  static void process_fontcache(STREAM s)
752          for (i = 0; i < nglyphs; i++)          for (i = 0; i < nglyphs; i++)
753          {          {
754                  in_uint16_le(s, character);                  in_uint16_le(s, character);
755                  in_uint8s(s, 2); /* unknown */                  in_uint16_le(s, offset);
756                  in_uint16_le(s, baseline);                  in_uint16_le(s, baseline);
757                  in_uint16_le(s, width);                  in_uint16_le(s, width);
758                  in_uint16_le(s, height);                  in_uint16_le(s, height);
# Line 652  static void process_fontcache(STREAM s) Line 760  static void process_fontcache(STREAM s)
760                  datasize = (height * ((width + 7) / 8) + 3) & ~3;                  datasize = (height * ((width + 7) / 8) + 3) & ~3;
761                  in_uint8p(s, data, datasize);                  in_uint8p(s, data, datasize);
762    
763                  /* Need to reverse bit order */                  bitmap = ui_create_glyph(width, height, data);
764                  rev_data = xmalloc(datasize);                  cache_put_font(font, character, offset, baseline,
765                                   width, height, bitmap);
                 for (j = 0; j < datasize; j++)  
                 {  
                         in = data[j];  
                         out = 0;  
                         if (in & 1) out |= 128;  
                         if (in & 2) out |= 64;  
                         if (in & 4) out |= 32;  
                         if (in & 8) out |= 16;  
                         if (in & 16) out |= 8;  
                         if (in & 32) out |= 4;  
                         if (in & 64) out |= 2;  
                         if (in & 128) out |= 1;  
                         rev_data[j] = out;  
                 }  
   
                 bitmap = ui_create_glyph(width, height, rev_data);  
                 xfree(rev_data);  
   
                 cache_put_font(font, character, baseline, width, height, bitmap);  
766          }          }
767  }  }
768    
769  /* Process a secondary order */  /* Process a secondary order */
770  static void process_secondary_order(STREAM s)  static void
771    process_secondary_order(STREAM s)
772  {  {
773          uint16 length;          uint16 length;
774          uint8 type;          uint8 type;
775          uint8 *next_order;          uint8 *next_order;
776    
777          in_uint16_le(s, length);          in_uint16_le(s, length);
778          in_uint8s(s, 2); /* flags */          in_uint8s(s, 2);        /* flags */
779          in_uint8(s, type);          in_uint8(s, type);
780    
781          next_order = s->p + length + 7;          next_order = s->p + length + 7;
# Line 716  static void process_secondary_order(STRE Line 806  static void process_secondary_order(STRE
806  }  }
807    
808  /* Process an order PDU */  /* Process an order PDU */
809  void process_orders(STREAM s)  void
810    process_orders(STREAM s)
811  {  {
812          RDP_ORDER_STATE *os = &order_state;          RDP_ORDER_STATE *os = &order_state;
813          uint32 present;          uint32 present;
# Line 725  void process_orders(STREAM s) Line 816  void process_orders(STREAM s)
816          int size, processed = 0;          int size, processed = 0;
817          BOOL delta;          BOOL delta;
818    
819          in_uint8s(s, 2); /* pad */          in_uint8s(s, 2);        /* pad */
820          in_uint16_le(s, num_orders);          in_uint16_le(s, num_orders);
821          in_uint8s(s, 2); /* pad */          in_uint8s(s, 2);        /* pad */
822    
823          while (processed < num_orders)          while (processed < num_orders)
824          {          {
# Line 775  void process_orders(STREAM s) Line 866  void process_orders(STREAM s)
866                                          rdp_parse_bounds(s, &os->bounds);                                          rdp_parse_bounds(s, &os->bounds);
867    
868                                  ui_set_clip(os->bounds.left,                                  ui_set_clip(os->bounds.left,
869                                          os->bounds.top,                                              os->bounds.top,
870                                          os->bounds.right - os->bounds.left + 1,                                              os->bounds.right -
871                                          os->bounds.bottom - os->bounds.top + 1);                                              os->bounds.left + 1,
872                                                os->bounds.bottom -
873                                                os->bounds.top + 1);
874                          }                          }
875    
876                          delta = order_flags & RDP_ORDER_DELTA;                          delta = order_flags & RDP_ORDER_DELTA;
# Line 801  void process_orders(STREAM s) Line 894  void process_orders(STREAM s)
894    
895                                  case RDP_ORDER_LINE:                                  case RDP_ORDER_LINE:
896                                          process_line(s, &os->line,                                          process_line(s, &os->line,
897                                                          present, delta);                                                       present, delta);
898                                          break;                                          break;
899    
900                                  case RDP_ORDER_RECT:                                  case RDP_ORDER_RECT:
# Line 824  void process_orders(STREAM s) Line 917  void process_orders(STREAM s)
917                                                         present, delta);                                                         present, delta);
918                                          break;                                          break;
919    
920                                    case RDP_ORDER_POLYLINE:
921                                            process_polyline(s, &os->polyline,
922                                                             present, delta);
923                                            break;
924    
925                                  case RDP_ORDER_TEXT2:                                  case RDP_ORDER_TEXT2:
926                                          process_text2(s, &os->text2,                                          process_text2(s, &os->text2,
927                                                        present, delta);                                                        present, delta);
# Line 842  void process_orders(STREAM s) Line 940  void process_orders(STREAM s)
940          }          }
941    
942          if (s->p != next_packet)          if (s->p != next_packet)
943                  WARN("%d bytes remaining\n", (int)(next_packet - s->p));                  WARN("%d bytes remaining\n", (int) (next_packet - s->p));
944  }  }
945    
946  /* Reset order state */  /* Reset order state */
947  void reset_order_state()  void
948    reset_order_state()
949  {  {
950          memset(&order_state, 0, sizeof(order_state));          memset(&order_state, 0, sizeof(order_state));
951  }  }
   

Legend:
Removed from v.12  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26