Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 27378) +++ trunk/src/draw.c (revision 27379) @@ -753,12 +753,26 @@ info->xform = NULL; } +static void pcb_draw_info_setup(pcb_draw_info_t *info, pcb_board_t *pcb) +{ + info->pcb = pcb; + info->exporting = (pcb_gui->exporter || pcb_gui->printer); + info->export_name = pcb_gui->name; + if (info->exporting) { + strcpy(info->noexport_name, "noexport:"); + strncpy(info->noexport_name+9, info->export_name, sizeof(info->noexport_name)-10); + info->noexport_name[sizeof(info->noexport_name)-1] = '\0'; + } + else + *info->noexport_name = '\0'; +} + void pcb_draw_layer_noxform(pcb_board_t *pcb, const pcb_layer_t *Layer, const pcb_box_t *screen) { pcb_draw_info_t info; pcb_box_t scr2; - info.pcb = pcb; + pcb_draw_info_setup(&info, pcb); info.drawn_area = screen; info.xform_exporter = info.xform = NULL; @@ -796,7 +810,7 @@ scr2.Y2 = scr2.Y1+1; } - info.pcb = pcb; + pcb_draw_info_setup(&info, pcb); info.drawn_area = screen; info.xform_exporter = info.xform_caller = info.xform = NULL; @@ -1067,7 +1081,7 @@ pcb_xform_t xform_main_exp; expose_begin(&save, hid); - info.pcb = PCB; + pcb_draw_info_setup(&info, PCB); info.drawn_area = &ctx->view; info.xform_caller = xform_caller; info.xform = info.xform_exporter = NULL; Index: trunk/src/draw.h =================================================================== --- trunk/src/draw.h (revision 27378) +++ trunk/src/draw.h (revision 27379) @@ -52,6 +52,9 @@ /* Some low level draw callback depend on this in their void *cl */ typedef struct pcb_draw_info_s { pcb_board_t *pcb; + int exporting; /* 1 if doing an export, 0 if working to screen */ + const char *export_name; /* name of the export plugin */ + char noexport_name[64]; /* "noexport:" attribute name rendered for the current exporter */ const pcb_box_t *drawn_area; pcb_xform_t *xform_caller; /* the extra transformation the caller requested (the one who has initiated the rendering, e.g. throuh pcb_draw_everything()) */ pcb_xform_t *xform_exporter; /* the extra transformation the exporter requested (e.g. because of cam) */