Index: trunk/src/draw.h =================================================================== --- trunk/src/draw.h (revision 19145) +++ trunk/src/draw.h (revision 19146) @@ -97,6 +97,10 @@ e.g. a subc only */ void pcb_draw_layer_under(pcb_layer_t *Layer, const pcb_box_t *screen, pcb_data_t *data); +/* Composite draw all layer groups matching lyt/purpi/purpose */ +void pcb_draw_groups(pcb_board_t *pcb, pcb_layer_type_t lyt, int purpi, char *purpose, const pcb_box_t *screen, const char *default_color, pcb_layer_type_t pstk_lyt_match, int thin_draw, int invert); + + void pcb_erase_obj(int, void *, void *); void pcb_draw_ppv(pcb_layergrp_id_t group, const pcb_box_t * drawn_area); void pcb_draw_pstk_names(pcb_layergrp_id_t group, const pcb_box_t *drawn_area); Index: trunk/src/draw_composite.c =================================================================== --- trunk/src/draw_composite.c (revision 19145) +++ trunk/src/draw_composite.c (revision 19146) @@ -176,3 +176,48 @@ comp_draw_layer_real(ctx, draw_auto, auto_data); } + +/******** generic group draws ********/ + +static void pcb_draw_groups_auto(comp_ctx_t *ctx, void *lym) +{ + pcb_layer_type_t *pstk_lyt_match = (pcb_layer_type_t *)lym; + if ((ctx->pcb->pstk_on) && (*pstk_lyt_match != 0)) + pcb_draw_pstks(ctx->gid, ctx->screen, 0, *pstk_lyt_match); +} + +void pcb_draw_groups(pcb_board_t *pcb, pcb_layer_type_t lyt, int purpi, char *purpose, const pcb_box_t *screen, const char *default_color, pcb_layer_type_t pstk_lyt_match, int thin_draw, int invert) +{ + pcb_layergrp_id_t gid; + pcb_layergrp_t *g; + comp_ctx_t cctx; + + for(gid = 0, g = pcb->LayerGroups.grp; gid < pcb->LayerGroups.len; gid++,g++) { + pcb_layer_t *ly = NULL; + + if ((g->type & lyt) != lyt) + continue; + + if ((purpi != -1) && (g->purpi != purpi)) + continue; + + if ((purpose != NULL) && (strcmp(g->purpose, purpose) != 0)) + continue; + + if (g->len > 0) + ly = pcb_get_layer(PCB->Data, g->lid[0]); + cctx.pcb = pcb; + cctx.grp = g; + cctx.screen = screen; + cctx.gid = gid; + cctx.color = ly != NULL ? ly->meta.real.color : default_color; + cctx.thin = thin_draw; + cctx.invert = invert; + + if (!cctx.invert) + pcb_draw_out.direct = 0; + + comp_draw_layer(&cctx, pcb_draw_groups_auto, &pstk_lyt_match); + comp_finish(&cctx); + } +}