/[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 55 by jsorg71, Fri Jul 12 03:45:20 2002 UTC revision 64 by astrand, Thu Jul 18 16:38:31 2002 UTC
# Line 26  static RDP_ORDER_STATE order_state; Line 26  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  static void
29  rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)  rdp_in_present(STREAM s, uint32 * present, uint8 flags, int size)
30  {  {
31          uint8 bits;          uint8 bits;
32          int i;          int i;
# Line 54  rdp_in_present(STREAM s, uint32 *present Line 54  rdp_in_present(STREAM s, uint32 *present
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  static void
57  rdp_in_coord(STREAM s, uint16 *coord, BOOL delta)  rdp_in_coord(STREAM s, uint16 * coord, BOOL delta)
58  {  {
59          uint8 change;          uint8 change;
60    
# Line 71  rdp_in_coord(STREAM s, uint16 *coord, BO Line 71  rdp_in_coord(STREAM s, uint16 *coord, BO
71    
72  /* Read a colour entry */  /* Read a colour entry */
73  static void  static void
74  rdp_in_colour(STREAM s, uint8 *colour)  rdp_in_colour(STREAM s, uint8 * colour)
75  {  {
76          in_uint8(s, *colour);          in_uint8(s, *colour);
77          s->p += 2;          s->p += 2;
# Line 79  rdp_in_colour(STREAM s, uint8 *colour) Line 79  rdp_in_colour(STREAM s, uint8 *colour)
79    
80  /* Parse bounds information */  /* Parse bounds information */
81  static BOOL  static BOOL
82  rdp_parse_bounds(STREAM s, BOUNDS *bounds)  rdp_parse_bounds(STREAM s, BOUNDS * bounds)
83  {  {
84          uint8 present;          uint8 present;
85    
# Line 110  rdp_parse_bounds(STREAM s, BOUNDS *bound Line 110  rdp_parse_bounds(STREAM s, BOUNDS *bound
110    
111  /* Parse a pen */  /* Parse a pen */
112  static BOOL  static BOOL
113  rdp_parse_pen(STREAM s, PEN *pen, uint32 present)  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 126  rdp_parse_pen(STREAM s, PEN *pen, uint32 Line 126  rdp_parse_pen(STREAM s, PEN *pen, uint32
126    
127  /* Parse a brush */  /* Parse a brush */
128  static BOOL  static BOOL
129  rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present)  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 148  rdp_parse_brush(STREAM s, BRUSH *brush, Line 148  rdp_parse_brush(STREAM s, BRUSH *brush,
148    
149  /* Process a destination blt order */  /* Process a destination blt order */
150  static void  static void
151  process_destblt(STREAM s, DESTBLT_ORDER *os, 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 173  process_destblt(STREAM s, DESTBLT_ORDER Line 173  process_destblt(STREAM s, DESTBLT_ORDER
173    
174  /* Process a pattern blt order */  /* Process a pattern blt order */
175  static void  static void
176  process_patblt(STREAM s, PATBLT_ORDER *os, 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 198  process_patblt(STREAM s, PATBLT_ORDER *o Line 198  process_patblt(STREAM s, PATBLT_ORDER *o
198    
199          rdp_parse_brush(s, &os->brush, present >> 7);          rdp_parse_brush(s, &os->brush, present >> 7);
200    
201          DEBUG(("PATBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,bs=%d,bg=0x%x,fg=0x%x)\n",          DEBUG(("PATBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,bs=%d,bg=0x%x,fg=0x%x)\n", os->opcode, os->x, os->y, os->cx, os->cy, os->brush.style, os->bgcolour, os->fgcolour));
                os->opcode, os->x, os->y, os->cx, os->cy,  
                os->brush.style, os->bgcolour, os->fgcolour));  
202    
203          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,
204                    &os->brush, os->bgcolour, os->fgcolour);                    &os->brush, os->bgcolour, os->fgcolour);
# Line 208  process_patblt(STREAM s, PATBLT_ORDER *o Line 206  process_patblt(STREAM s, PATBLT_ORDER *o
206    
207  /* Process a screen blt order */  /* Process a screen blt order */
208  static void  static void
209  process_screenblt(STREAM s, SCREENBLT_ORDER *os, uint32 present, BOOL delta)  process_screenblt(STREAM s, SCREENBLT_ORDER * os, uint32 present, BOOL delta)
210  {  {
211          if (present & 0x0001)          if (present & 0x0001)
212                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 240  process_screenblt(STREAM s, SCREENBLT_OR Line 238  process_screenblt(STREAM s, SCREENBLT_OR
238    
239  /* Process a line order */  /* Process a line order */
240  static void  static void
241  process_line(STREAM s, LINE_ORDER *os, uint32 present, BOOL delta)  process_line(STREAM s, LINE_ORDER * os, uint32 present, BOOL delta)
242  {  {
243          if (present & 0x0001)          if (present & 0x0001)
244                  in_uint16_le(s, os->mixmode);                  in_uint16_le(s, os->mixmode);
# Line 281  process_line(STREAM s, LINE_ORDER *os, u Line 279  process_line(STREAM s, LINE_ORDER *os, u
279    
280  /* Process an opaque rectangle order */  /* Process an opaque rectangle order */
281  static void  static void
282  process_rect(STREAM s, RECT_ORDER *os, uint32 present, BOOL delta)  process_rect(STREAM s, RECT_ORDER * os, uint32 present, BOOL delta)
283  {  {
284          if (present & 0x01)          if (present & 0x01)
285                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 306  process_rect(STREAM s, RECT_ORDER *os, u Line 304  process_rect(STREAM s, RECT_ORDER *os, u
304    
305  /* Process a desktop save order */  /* Process a desktop save order */
306  static void  static void
307  process_desksave(STREAM s, DESKSAVE_ORDER *os, uint32 present, BOOL delta)  process_desksave(STREAM s, DESKSAVE_ORDER * os, uint32 present, BOOL delta)
308  {  {
309          int width, height;          int width, height;
310    
# Line 344  process_desksave(STREAM s, DESKSAVE_ORDE Line 342  process_desksave(STREAM s, DESKSAVE_ORDE
342    
343  /* Process a memory blt order */  /* Process a memory blt order */
344  static void  static void
345  process_memblt(STREAM s, MEMBLT_ORDER *os, uint32 present, BOOL delta)  process_memblt(STREAM s, MEMBLT_ORDER * os, uint32 present, BOOL delta)
346  {  {
347          HBITMAP bitmap;          HBITMAP bitmap;
348    
# Line 392  process_memblt(STREAM s, MEMBLT_ORDER *o Line 390  process_memblt(STREAM s, MEMBLT_ORDER *o
390    
391  /* Process a 3-way blt order */  /* Process a 3-way blt order */
392  static void  static void
393  process_triblt(STREAM s, TRIBLT_ORDER *os, uint32 present, BOOL delta)  process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, BOOL delta)
394  {  {
395          HBITMAP bitmap;          HBITMAP bitmap;
396    
# Line 437  process_triblt(STREAM s, TRIBLT_ORDER *o Line 435  process_triblt(STREAM s, TRIBLT_ORDER *o
435          if (present & 0x010000)          if (present & 0x010000)
436                  in_uint16_le(s, os->unknown);                  in_uint16_le(s, os->unknown);
437    
438          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(("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", os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id, os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour));
                os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id,  
                os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour));  
439    
440          bitmap = cache_get_bitmap(os->cache_id, os->cache_idx);          bitmap = cache_get_bitmap(os->cache_id, os->cache_idx);
441          if (bitmap == NULL)          if (bitmap == NULL)
# Line 452  process_triblt(STREAM s, TRIBLT_ORDER *o Line 448  process_triblt(STREAM s, TRIBLT_ORDER *o
448    
449  /* Parse a delta co-ordinate in polyline order form */  /* Parse a delta co-ordinate in polyline order form */
450  static int  static int
451  parse_delta(uint8 *buffer, int *offset)  parse_delta(uint8 * buffer, int *offset)
452  {  {
453          int value = buffer[(*offset)++];          int value = buffer[(*offset)++];
454          int two_byte = value & 0x80;          int two_byte = value & 0x80;
# Line 470  parse_delta(uint8 *buffer, int *offset) Line 466  parse_delta(uint8 *buffer, int *offset)
466    
467  /* Process a polyline order */  /* Process a polyline order */
468  static void  static void
469  process_polyline(STREAM s, POLYLINE_ORDER *os, uint32 present, BOOL delta)  process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta)
470  {  {
471          int index, line, data;          int index, line, data;
472          int x, y, xfrom, yfrom;          int x, y, xfrom, yfrom;
# Line 504  process_polyline(STREAM s, POLYLINE_ORDE Line 500  process_polyline(STREAM s, POLYLINE_ORDE
500                  opcode = ROP2_NXOR;                  opcode = ROP2_NXOR;
501    
502          DEBUG(("POLYLINE(x=%d,y=%d,fl=0x%x,fg=0x%x,n=%d,sz=%d)\n",          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));                 os->x, os->y, os->flags, os->fgcolour, os->lines,
504                   os->datasize));
505    
506          DEBUG(("Data: "));          DEBUG(("Data: "));
507    
# Line 545  process_polyline(STREAM s, POLYLINE_ORDE Line 542  process_polyline(STREAM s, POLYLINE_ORDE
542    
543  /* Process a text order */  /* Process a text order */
544  static void  static void
545  process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta)  process_text2(STREAM s, TEXT2_ORDER * os, uint32 present, BOOL delta)
546  {  {
547          int i;          int i;
548    
# Line 603  process_text2(STREAM s, TEXT2_ORDER *os, Line 600  process_text2(STREAM s, TEXT2_ORDER *os,
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(("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", os->x, os->y, os->clipleft, os->cliptop, os->clipright, os->clipbottom, os->boxleft, os->boxtop, os->boxright, os->boxbottom, os->fgcolour, os->bgcolour, os->font, os->flags, os->mixmode, os->unknown, os->length));
                os->x, os->y, os->clipleft, os->cliptop, os->clipright,  
                os->clipbottom, os->boxleft, os->boxtop, os->boxright,  
                os->boxbottom, os->fgcolour, os->bgcolour, os->font,  
                os->flags, os->mixmode, os->unknown, os->length));  
604    
605          DEBUG(("Text: "));          DEBUG(("Text: "));
606    

Legend:
Removed from v.55  
changed lines
  Added in v.64

  ViewVC Help
Powered by ViewVC 1.1.26