Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 19142) +++ trunk/src_plugins/export_bboard/bboard.c (revision 19143) @@ -182,7 +182,7 @@ static int bboard_validate_layer(unsigned long flags, int purpi, int group, int skipsolder) { - if ((flags & PCB_LYT_INVIS) || PCB_LAYER_IS_ASSY(flags, purpi) || (flags & PCB_LYT_OUTLINE)) + if ((flags & PCB_LYT_INVIS) || PCB_LAYER_IS_ASSY(flags, purpi) || PCB_LAYER_IS_ROUTE(flags, purpi)) return 0; if (group_data[group].solder && skipsolder) Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 19142) +++ trunk/src_plugins/export_dxf/dxf.c (revision 19143) @@ -356,7 +356,7 @@ dxf_ctx.force_thin = 0; - if (flags & PCB_LYT_OUTLINE) { + if (PCB_LAYER_IS_ROUTE(flags, purpi)) { dxf_ctx.layer_name = "outline"; dxf_ctx.force_thin = 1; return 1; Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 19142) +++ trunk/src_plugins/export_gcode/gcode.c (revision 19143) @@ -273,6 +273,7 @@ if (!pcb_layer_is_empty_(PCB, layer)) { /* layer isn't empty */ + int purpi = pcb_layer_purpose(PCB, n, NULL); /* * is this check necessary? It seems that special @@ -279,7 +280,7 @@ * layers have negative indexes? */ - if ((flags & PCB_LYT_COPPER) || (flags & PCB_LYT_OUTLINE)) { + if ((flags & PCB_LYT_COPPER) || PCB_LAYER_IS_ROUTE(flags, purpi)) { m = pcb_layer_get_group(PCB, n); /* the export layer */ Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 19142) +++ trunk/src_plugins/export_gerber/gerber.c (revision 19143) @@ -430,7 +430,7 @@ suff = "ast"; else if (fmatch(flags, PCB_LYT_BOTTOM) && PCB_LAYER_IS_ASSY(flags, purpi)) suff = "asb"; - else if (fmatch(flags, PCB_LYT_OUTLINE)) + else if (PCB_LAYER_IS_ROUTE(flags, purpi)) suff = "oln"; else { static char buf[20]; @@ -475,7 +475,7 @@ suff = "ast"; else if (fmatch(flags, PCB_LYT_BOTTOM) && PCB_LAYER_IS_ASSY(flags, purpi)) suff = "asb"; - else if (fmatch(flags, PCB_LYT_OUTLINE)) + else if (PCB_LAYER_IS_ROUTE(flags, purpi)) suff = "gm1"; else { static char buf[20]; @@ -521,7 +521,7 @@ suff = "ast"; else if (fmatch(flags, PCB_LYT_BOTTOM) && PCB_LAYER_IS_ASSY(flags, purpi)) suff = "asb"; - else if (fmatch(flags, PCB_LYT_OUTLINE)) + else if (PCB_LAYER_IS_ROUTE(flags, purpi)) suff = "gko"; else { static char buf[20]; @@ -746,7 +746,7 @@ group_name = ""; flash_drills = 0; - if (flags & PCB_LYT_OUTLINE) + if (PCB_LAYER_IS_ROUTE(flags, purpi)) flash_drills = 1; if (is_drill && n_pending_drills) { @@ -881,7 +881,7 @@ if (copy_outline_mode == COPY_OUTLINE_ALL && ((flags & PCB_LYT_SILK) || (flags & PCB_LYT_MASK) || PCB_LAYER_IS_FAB(flags, purpi) || PCB_LAYER_IS_ASSY(flags, purpi))) want_outline = 1; - if (want_outline && !(flags & PCB_LYT_OUTLINE)) { + if (want_outline && !(PCB_LAYER_IS_ROUTE(flags, purpi))) { if (outline_layer && outline_layer != PCB->Data->Layer + layer) pcb_draw_layer(outline_layer, ®ion); else if (!outline_layer) { Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 19142) +++ trunk/src_plugins/export_nelma/nelma.c (revision 19143) @@ -505,7 +505,7 @@ if (!pcb_layer_is_empty_(PCB, layer)) { /* layer isn't empty */ - if ((flags & PCB_LYT_COPPER) || (flags & PCB_LYT_OUTLINE)) { + if ((flags & PCB_LYT_COPPER) || PCB_LAYER_IS_ROUTE(flags, pcb_layer_purpose_(layer, NULL))) { /* layer is a copper layer */ m = pcb_layer_get_group(PCB, n); Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 19142) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 19143) @@ -365,7 +365,7 @@ if (flags & PCB_LYT_INVIS) return 0; - if (flags & PCB_LYT_OUTLINE) { + if (PCB_LAYER_IS_ROUTE(flags, purpi)) { return 0; } Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 19142) +++ trunk/src_plugins/export_png/png.c (revision 19143) @@ -1219,7 +1219,7 @@ photo_im = &photo_drill; } else { - if (flags & PCB_LYT_OUTLINE) { + if (PCB_LAYER_IS_ROUTE(flags, purpi)) { doing_outline = 1; have_outline = 0; photo_im = &photo_outline; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 19142) +++ trunk/src_plugins/export_ps/eps.c (revision 19143) @@ -378,7 +378,7 @@ if (PCB_LAYER_IS_ASSY(flags, purpi) || PCB_LAYER_IS_FAB(flags, purpi) || PCB_LAYER_IS_CSECT(flags, purpi) || (flags & PCB_LYT_INVIS)) return 0; - if ((group >= 0) && pcb_layergrp_is_empty(PCB, group) && (flags & PCB_LYT_OUTLINE)) + if ((group >= 0) && pcb_layergrp_is_empty(PCB, group) && PCB_LAYER_IS_ROUTE(flags, purpi)) return 0; } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 19142) +++ trunk/src_plugins/export_ps/ps.c (revision 19143) @@ -1001,7 +1001,7 @@ if (global.outline && global.outline_layer != NULL && global.outline_layer != pcb_get_layer(PCB->Data, layer) && - !(flags & PCB_LYT_OUTLINE)) { + !(PCB_LAYER_IS_ROUTE(flags, purpi))) { int save_drill = global.is_drill; global.is_drill = 0; pcb_draw_layer(global.outline_layer, &global.exps.view); Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 19142) +++ trunk/src_plugins/export_svg/svg.c (revision 19143) @@ -377,7 +377,7 @@ default:; } - if (!(flags & PCB_LYT_COPPER) && (!is_our_silk) && (!is_our_mask) && !(PCB_LAYER_IS_DRILL(flags, purpi)) && !(flags & PCB_LYT_OUTLINE)) + if (!(flags & PCB_LYT_COPPER) && (!is_our_silk) && (!is_our_mask) && !(PCB_LAYER_IS_DRILL(flags, purpi)) && !(PCB_LAYER_IS_ROUTE(flags, purpi))) return 0; while(group_open) { Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 19142) +++ trunk/src_plugins/io_pcb/file.c (revision 19143) @@ -67,6 +67,7 @@ #include "thermal.h" #include "event.h" #include "macro.h" +#include "funchash_core.h" #include "src_plugins/lib_compat_help/layer_compat.h" #include "src_plugins/lib_compat_help/pstk_compat.h" @@ -536,9 +537,10 @@ static const char *layer_name_hack(pcb_layer_t *layer, const char *name) { unsigned long lflg = pcb_layer_flags_(layer); + int purpi = pcb_layer_purpose_(layer, NULL); /* The old PCB format encodes some properties in layer names - have to alter the real layer name before save to get the same effect */ - if (lflg & PCB_LYT_OUTLINE) { + if (PCB_LAYER_IS_UROUTE(lflg, purpi)) { if (pcb_strcasecmp(name, "outline") == 0) return name; return "Outline"; @@ -644,7 +646,8 @@ for (i = 0; i < data->LayerN; i++) { pcb_layer_t *ly = &(data->Layer[i]); pcb_layer_type_t lyt = pcb_layer_flags_(ly); - if (!(lyt & (PCB_LYT_COPPER | PCB_LYT_SILK | PCB_LYT_OUTLINE))) { + int purpi = pcb_layer_purpose_(ly, NULL); + if ((!(lyt & (PCB_LYT_COPPER | PCB_LYT_SILK))) && (!PCB_LAYER_IS_ROUTE(lyt, purpi))) { if (!pcb_layer_is_pure_empty(ly)) { char *desc = pcb_strdup_printf("Layer %s can be exported only as a copper layer\n", ly->name); pcb_io_incompat_save(data, NULL, desc, NULL);