/[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 24 by matty, Sat Jan 6 03:12:10 2001 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    
# 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 201  static void process_patblt(STREAM s, PAT Line 207  static void process_patblt(STREAM s, PAT
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 233  static void process_screenblt(STREAM s, Line 239  static void process_screenblt(STREAM s,
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 273  static void process_line(STREAM s, LINE_ Line 280  static void process_line(STREAM s, LINE_
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 335  static void process_desksave(STREAM s, D Line 343  static void process_desksave(STREAM s, D
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 383  static void process_memblt(STREAM s, MEM Line 391  static void process_memblt(STREAM s, MEM
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 444  static void process_triblt(STREAM s, TRI Line 452  static void process_triblt(STREAM s, TRI
452  }  }
453    
454  /* Parse a delta co-ordinate in polyline order form */  /* Parse a delta co-ordinate in polyline order form */
455  static int parse_delta(uint8 *buffer, int *offset)  static int
456    parse_delta(uint8 *buffer, int *offset)
457  {  {
458          int value = buffer[(*offset)++];          int value = buffer[(*offset)++];
459          int two_byte = value & 0x80;          int two_byte = value & 0x80;
# Line 461  static int parse_delta(uint8 *buffer, in Line 470  static int parse_delta(uint8 *buffer, in
470  }  }
471    
472  /* Process a polyline order */  /* Process a polyline order */
473  static void process_polyline(STREAM s, POLYLINE_ORDER *os,  static void
474                               uint32 present, BOOL delta)  process_polyline(STREAM s, POLYLINE_ORDER *os, uint32 present, BOOL delta)
475  {  {
476          int index, line, data;          int index, line, data;
477          int x, y, xfrom, yfrom;          int x, y, xfrom, yfrom;
# Line 531  static void process_polyline(STREAM s, P Line 540  static void process_polyline(STREAM s, P
540  }  }
541    
542  /* Process a text order */  /* Process a text order */
543  static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present,  static void
544                            BOOL delta)  process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta)
545  {  {
546          DATABLOB *entry;          DATABLOB *entry;
547          int i;          int i;
# Line 634  static void process_text2(STREAM s, TEXT Line 643  static void process_text2(STREAM s, TEXT
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 658  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 692  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 723  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;
# Line 754  static void process_fontcache(STREAM s) Line 767  static void process_fontcache(STREAM s)
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;
# Line 792  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 929  void process_orders(STREAM s) Line 944  void process_orders(STREAM s)
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.24  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26