Index: trunk/src_3rd/libuhpgl/examples/dump_hpgl.c =================================================================== --- trunk/src_3rd/libuhpgl/examples/dump_hpgl.c (revision 11215) +++ trunk/src_3rd/libuhpgl/examples/dump_hpgl.c (revision 11216) @@ -28,13 +28,13 @@ static int dump_line(uhpgl_ctx_t *ctx, uhpgl_line_t *line) { - printf("line: %ld;%ld %ld;%ld\n", line->p1.x, line->p1.y, line->p2.x, line->p2.y); + printf("line {%d}: %ld;%ld %ld;%ld\n", line->pen, line->p1.x, line->p1.y, line->p2.x, line->p2.y); return 0; } static void dump_arc_(uhpgl_ctx_t *ctx, uhpgl_arc_t *arc, const char *type) { - printf("%s: %ld;%ld;%ld %f->%f (%f) (%ld;%ld->%ld;%ld)\n", type, + printf("%s {%d}: %ld;%ld;%ld %f->%f (%f) (%ld;%ld->%ld;%ld)\n", type, arc->pen, arc->center.x, arc->center.y, arc->r, arc->starta, arc->enda, arc->deltaa, arc->startp.x, arc->startp.y, arc->endp.x, arc->endp.y); @@ -49,7 +49,7 @@ static int dump_circ(uhpgl_ctx_t *ctx, uhpgl_arc_t *circ) { - printf("circ: %ld;%ld;%ld\n", + printf("circ {%d}: %ld;%ld;%ld\n", circ->pen, circ->center.x, circ->center.y, circ->r); return 0; } @@ -68,7 +68,7 @@ static int dump_rect(uhpgl_ctx_t *ctx, uhpgl_rect_t *rect) { - printf("line: %ld;%ld %ld;%ld\n", rect->p1.x, rect->p1.y, rect->p2.x, rect->p2.y); + printf("rect {%d}: %ld;%ld %ld;%ld\n", rect->pen, rect->p1.x, rect->p1.y, rect->p2.x, rect->p2.y); return 0; } Index: trunk/src_3rd/libuhpgl/examples/rect.hpgl =================================================================== --- trunk/src_3rd/libuhpgl/examples/rect.hpgl (revision 11215) +++ trunk/src_3rd/libuhpgl/examples/rect.hpgl (revision 11216) @@ -1,5 +1,7 @@ IN; +SP1; + PA0,0; PD; Index: trunk/src_3rd/libuhpgl/libuhpgl.h =================================================================== --- trunk/src_3rd/libuhpgl/libuhpgl.h (revision 11215) +++ trunk/src_3rd/libuhpgl/libuhpgl.h (revision 11216) @@ -59,10 +59,12 @@ /*** drawing objects ***/ typedef struct uhpgl_line_s { + int pen; uhpgl_point_t p1, p2; } uhpgl_line_t; typedef struct uhpgl_arc_s { + int pen; uhpgl_point_t center; uhpgl_coord_t r; uhpgl_point_t startp, endp; @@ -70,16 +72,19 @@ } uhpgl_arc_t; typedef struct uhpgl_wedge_s { + int pen; uhpgl_arc_t arc; uhpgl_fill_stroke_t fill_stroke; } uhpgl_wedge_t; typedef struct uhpgl_rect_s { + int pen; uhpgl_point_t p1, p2; /* p1 is the minimal x;y and p2 is the maximal x;y */ uhpgl_fill_stroke_t fill_stroke; } uhpgl_rect_t; typedef struct uhpgl_poly_s { + int pen; uhpgl_point_t bb1, bb2; /* bounding box; bb1 is the minimal x;y and bb2 is the maximal x;y */ uhpgl_obj_t *outline; /* outer contour (linked list of non-poly objects) */ int num_holes; Index: trunk/src_3rd/libuhpgl/parse.c =================================================================== --- trunk/src_3rd/libuhpgl/parse.c (revision 11215) +++ trunk/src_3rd/libuhpgl/parse.c (revision 11216) @@ -134,6 +134,7 @@ int draw_line(uhpgl_ctx_t *ctx, uhpgl_coord_t x1, uhpgl_coord_t y1, uhpgl_coord_t x2, uhpgl_coord_t y2) { uhpgl_line_t line; + line.pen = ctx->state.pen; line.p1.x = x1; line.p1.y = y1; line.p2.x = x2;