CVS: rdesktop orders.c,1.44,1.45 proto.h,1.72,1.73 xwin.c,1.187,1.188

Jeroen Meijer <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30003

Modified Files:
	orders.c proto.h xwin.c 
Log Message:
do polyline in a single ui operation: ui_polyline

Index: orders.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/orders.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** orders.c	10 Mar 2005 22:40:07 -0000	1.44
--- orders.c	10 Mar 2005 22:48:15 -0000	1.45
***************
*** 649,657 ****
  process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta)
  {
! 	int index, line, data;
! 	int x, y, xfrom, yfrom;
  	uint8 flags = 0;
  	PEN pen;
! 	uint8 opcode;
  
  	if (present & 0x01)
--- 649,656 ----
  process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta)
  {
! 	int index, next, data;
  	uint8 flags = 0;
  	PEN pen;
! 	POINT *points;
  
  	if (present & 0x01)
***************
*** 692,724 ****
  	}
  
! 	opcode = os->opcode - 1;
! 	x = os->x;
! 	y = os->y;
! 	pen.style = pen.width = 0;
! 	pen.colour = os->fgcolour;
  
  	index = 0;
  	data = ((os->lines - 1) / 4) + 1;
! 	for (line = 0; (line < os->lines) && (data < os->datasize); line++)
  	{
! 		xfrom = x;
! 		yfrom = y;
! 
! 		if (line % 4 == 0)
  			flags = os->data[index++];
  
! 		if ((flags & 0xc0) == 0)
! 			flags |= 0xc0;	/* none = both */
! 
! 		if (flags & 0x40)
! 			x += parse_delta(os->data, &data);
! 
! 		if (flags & 0x80)
! 			y += parse_delta(os->data, &data);
  
! 		ui_line(opcode, xfrom, yfrom, x, y, &pen);
  
  		flags <<= 2;
  	}
  }
  
--- 691,720 ----
  	}
  
! 	points = (POINT *) xmalloc((os->lines + 1) * sizeof(POINT));
! 	memset(points, 0, (os->lines + 1) * sizeof(POINT));
! 
! 	points[0].x = os->x;
! 	points[0].y = os->y;
  
  	index = 0;
  	data = ((os->lines - 1) / 4) + 1;
! 	for (next = 1; (next < os->lines) && (data < os->datasize); next++)
  	{
! 		if ((next - 1) % 4 == 0)
  			flags = os->data[index++];
  
! 		if (~flags & 0x80)
! 			points[next].x = parse_delta(os->data, &data);
  
! 		if (~flags & 0x40)
! 			points[next].y = parse_delta(os->data, &data);
  
  		flags <<= 2;
  	}
+ 
+ 	if (next - 1 == os->lines)
+ 		ui_polyline(os->opcode - 1, points, os->lines + 1, &pen);
+ 	else
+ 		error("polyline parse error\n");
  }
  

Index: proto.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/proto.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** proto.h	10 Mar 2005 22:40:20 -0000	1.72
--- proto.h	10 Mar 2005 22:48:15 -0000	1.73
***************
*** 214,217 ****
--- 214,218 ----
  void ui_polygon(uint8 opcode, uint8 fillmode, POINT * point, int npoints, BRUSH * brush,
  		int bgcolour, int fgcolour);
+ void ui_polyline(uint8 opcode, POINT * point, int npoints, PEN * pen);
  void ui_ellipse(uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH * brush,
  		int bgcolour, int fgcolour);

Index: xwin.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xwin.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -C2 -d -r1.187 -r1.188
*** xwin.c	10 Mar 2005 22:40:20 -0000	1.187
--- xwin.c	10 Mar 2005 22:48:15 -0000	1.188
***************
*** 2264,2267 ****
--- 2264,2282 ----
  
  void
+ ui_polyline(uint8 opcode,
+ 	    /* dest */ POINT * points, int npoints,
+ 	    /* pen */ PEN * pen)
+ {
+ 	/* TODO: set join style */
+ 	SET_FUNCTION(opcode);
+ 	SET_FOREGROUND(pen->colour);
+ 	XDrawLines(g_display, g_wnd, g_gc, (XPoint *) points, npoints, CoordModePrevious);
+ 	if (g_ownbackstore)
+ 		XDrawLines(g_display, g_backstore, g_gc, (XPoint *) points, npoints,
+ 			   CoordModePrevious);
+ 	RESET_FUNCTION(opcode);
+ }
+ 
+ void
  ui_ellipse(uint8 opcode,
  	   /* mode */ uint8 fillmode,



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.