> I've made some progress with this.
> Almost working.
> The documentation is wrong.

This patch should work.
If you can validate it, I can push it.

Jay
diff --git a/libfreerdp/capabilities.c b/libfreerdp/capabilities.c
index 8150a7b..2d45cbb 100644
--- a/libfreerdp/capabilities.c
+++ b/libfreerdp/capabilities.c
@@ -191,7 +191,7 @@ rdp_out_order_capset(rdpRdp * rdp, STREAM s)
 	// orderSupport[NEG_MULTIPATBLT_INDEX] = 1;
 	// orderSupport[NEG_MULTISCRBLT_INDEX] = 1;
 	// orderSupport[NEG_MULTIOPAQUERECT_INDEX] = 1;
-	// orderSupport[NEG_FAST_INDEX_INDEX] = 1;
+	orderSupport[NEG_FAST_INDEX_INDEX] = 1;
 	orderSupport[NEG_POLYGON_SC_INDEX] = (rdp->settings->polygon_ellipse_orders ? 1 : 0);
 	orderSupport[NEG_POLYGON_CB_INDEX] = (rdp->settings->polygon_ellipse_orders ? 1 : 0);
 	orderSupport[NEG_POLYLINE_INDEX] = 1;
diff --git a/libfreerdp/orders.c b/libfreerdp/orders.c
index 8eb1525..3278466 100644
--- a/libfreerdp/orders.c
+++ b/libfreerdp/orders.c
@@ -1089,6 +1089,131 @@ process_glyph_index(rdpOrders * orders, STREAM s, GLYPH_INDEX_ORDER * os, uint32
 		  &brush, os->bgcolor, os->fgcolor, os->text, os->length);
 }
 
+static void
+process_fast_index(rdpOrders * orders, STREAM s, FAST_INDEX_ORDER * os, uint32 present, RD_BOOL delta)
+{
+	int x;
+	int y;
+	int clipx1;
+	int clipy1;
+	int clipx2;
+	int clipy2;
+	int boxx1;
+	int boxy1;
+	int boxx2;
+	int boxy2;
+
+	printf("%s %x %d\n", __PRETTY_FUNCTION__, present, delta);
+	hexdump(s->p, MIN(s->end - s->p, 32));
+
+	/* cacheId */
+	if (present & 0x000001)
+		in_uint8(s, os->font);
+	/* fDrawing */
+	if (present & 0x000002)
+	{
+		in_uint8(s, os->opcode);
+		in_uint8(s, os->flags);
+	}
+	/* BackColor */
+	if (present & 0x000004)
+		rdp_in_color(s, &os->fgcolor);
+	/* ForeColor */
+	if (present & 0x000008)
+		rdp_in_color(s, &os->bgcolor);
+	/* BkLeft */
+	if (present & 0x000010)
+		rdp_in_coord(s, &os->clipleft, delta);
+	/* BkTop */
+	if (present & 0x000020)
+		rdp_in_coord(s, &os->cliptop, delta);
+	/* BkRight */
+	if (present & 0x000040)
+		rdp_in_coord(s, &os->clipright, delta);
+	/* BkBottom */
+	if (present & 0x000080)
+		rdp_in_coord(s, &os->clipbottom, delta);
+	/* OpLeft */
+	if (present & 0x000100)
+		rdp_in_coord(s, &os->boxleft, delta);
+	/* OpTop */
+	if (present & 0x000200)
+		rdp_in_coord(s, &os->boxtop, delta);
+	/* OpRight */
+	if (present & 0x000400)
+		rdp_in_coord(s, &os->boxright, delta);
+	/* OpBottom */
+	if (present & 0x000800)
+		rdp_in_coord(s, &os->boxbottom, delta);
+	/* x */
+	if (present & 0x001000)
+		rdp_in_coord(s, &os->x, delta);
+	/* y */
+	if (present & 0x002000)
+		rdp_in_coord(s, &os->y, delta);
+	/* VariableBytes */
+	if (present & 0x004000)
+	{
+		in_uint8(s, os->length);
+		in_uint8a(s, os->text, os->length);
+	}
+
+	printf("FAST_INDEX(x=%d,y=%d,cl=%d,ct=%d,cr=%d,cb=%d,bl=%d,bt=%d,br=%d,bb=%d,bg=0x%x,fg=0x%x,font=%d,fl=0x%x,op=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->bgcolor, os->fgcolor, os->font, os->flags, os->opcode, os->length);
+
+	x = os->x == -32768 ? os->clipleft : os->x;
+	y = os->y == -32768 ? os->cliptop : os->y;
+	clipx1 = os->clipleft;
+	clipy1 = os->cliptop;
+	clipx2 = os->clipright;
+	clipy2 = os->clipbottom;
+	boxx1 = os->boxleft;
+	boxy1 = os->boxtop;
+	boxx2 = os->boxright;
+	boxy2 = os->boxbottom;
+	if (os->boxleft == 0)
+	{
+		boxx1 = clipx1;
+	}
+	if (os->boxright == 0)
+	{
+		boxx2 = clipx2;
+	}
+	if (os->boxbottom == -32768)
+	{
+		if (os->boxtop & 0x01)
+		{
+			boxy2 = clipy2;
+		}
+		if (os->boxtop & 0x02)
+		{
+			boxx2 = clipx2;
+		}
+		if (os->boxtop & 0x04)
+		{
+			boxy1 = clipy1;
+		}
+		if (os->boxtop & 0x08)
+		{
+			boxx1 = clipx1;
+		}
+	}
+	if ((boxx2 > boxx1) && (boxy2 > boxy1))
+	{
+	}
+	else
+	{
+		boxx1 = 0;
+		boxy1 = 0;
+		boxx2 = 0;
+		boxy2 = 0;
+	}
+	draw_text(orders, os->font, os->flags, os->opcode,
+		MIX_TRANSPARENT, x, y,
+		clipx1, clipy1, clipx2 - clipx1, clipy2 - clipy1,
+		boxx1, boxy1, boxx2 - boxx1, boxy2 - boxy1,
+		&os->brush, os->bgcolor, os->fgcolor, os->text, os->length);
+}
+
 /* Process a raw bitmap cache order */
 static void
 process_cache_bitmap_uncompressed(rdpOrders * orders, STREAM s)
@@ -1621,6 +1746,7 @@ process_orders(rdpOrders * orders, STREAM s, uint16 num_orders)
 				case RDP_ORDER_MEMBLT:
 				case RDP_ORDER_LINETO:
 				case RDP_ORDER_POLYGON_CB:
+				case RDP_ORDER_FAST_INDEX:
 				case RDP_ORDER_ELLIPSE_CB:
 					size = 2;
 					break;
@@ -1703,6 +1829,10 @@ process_orders(rdpOrders * orders, STREAM s, uint16 num_orders)
 					process_glyph_index(orders, s, &os->glyph_index, present, delta);
 					break;
 
+				case RDP_ORDER_FAST_INDEX:
+					process_fast_index(orders, s, &os->fast_index, present, delta);
+					break;
+
 				default:
 					ui_unimpl(orders->rdp->inst, "order %d\n", os->order_type);
 					return;
diff --git a/libfreerdp/orderstypes.h b/libfreerdp/orderstypes.h
index 52e95ca..fe00ce3 100644
--- a/libfreerdp/orderstypes.h
+++ b/libfreerdp/orderstypes.h
@@ -48,7 +48,7 @@ enum RDP_ORDER_TYPE
 	RDP_ORDER_MULTIPATBLT = 16,
 	RDP_ORDER_MULTISCRBLT = 17,
 	RDP_ORDER_MULTIOPAQUERECT = 18,
-	RDP_ORDER_FAST_GLYPH_INDEX = 19,
+	RDP_ORDER_FAST_INDEX = 19,
 	RDP_ORDER_POLYGON_SC = 20,
 	RDP_ORDER_POLYGON_CB = 21,
 	RDP_ORDER_POLYLINE = 22,
@@ -300,6 +300,29 @@ typedef struct _GLYPH_INDEX_ORDER
 }
 GLYPH_INDEX_ORDER;
 
+typedef struct _FAST_INDEX_ORDER
+{
+	uint8 font;
+	uint8 flags;
+	uint8 opcode;
+	uint32 bgcolor;
+	uint32 fgcolor;
+	sint16 clipleft;
+	sint16 cliptop;
+	sint16 clipright;
+	sint16 clipbottom;
+	sint16 boxleft;
+	sint16 boxtop;
+	sint16 boxright;
+	sint16 boxbottom;
+	RD_BRUSH brush;
+	sint16 x;
+	sint16 y;
+	uint8 length;
+	uint8 text[MAX_TEXT];
+}
+FAST_INDEX_ORDER;
+
 typedef struct _RDP_ORDER_STATE
 {
 	uint8 order_type;
@@ -319,6 +342,7 @@ typedef struct _RDP_ORDER_STATE
 	ELLIPSE_SC_ORDER ellipse_sc;
 	ELLIPSE_CB_ORDER ellipse_cb;
 	GLYPH_INDEX_ORDER glyph_index;
+	FAST_INDEX_ORDER fast_index;
 }
 RDP_ORDER_STATE;
 
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Freerdp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to