Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 31259) +++ trunk/src/plug_io.c (revision 31260) @@ -272,8 +272,21 @@ /* try all plugins that said it could handle the file */ for(n = 0; n < len; n++) { + pcb_plug_fp_map_t *map = NULL, head; + int subfpname_reset = 0; if ((available[n].plug->parse_footprint == NULL) || (!accepts[n])) /* can't parse or doesn't want to parse this file */ continue; + + if ((fctx.subfpname == NULL) && (available[n].plug->multi_footprint)) { + subfpname_reset = 1; + rewind(f); + map = available[n].plug->map_footprint(available[n].plug, f, fctx.filename, &head, 0); + rewind(f); + fctx.subfpname = pcb_fp_map_choose(&PCB->hidlib, map); + if (fctx.subfpname == NULL) /* cancel */ + goto skip; + } + res = available[n].plug->parse_footprint(available[n].plug, Ptr, fctx.filename, fctx.subfpname); if (res == 0) { if (Ptr->loader == NULL) /* if the loader didn't set this (to some more fine grained, e.g. depending on file format version) */ @@ -280,6 +293,12 @@ Ptr->loader = available[n].plug; break; } + + skip:; + if (subfpname_reset) { + fctx.subfpname = NULL; + TODO("free map"); + } } /* remove selected/found flag when loading reusable footprints */ Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 31259) +++ trunk/src/plug_io.h (revision 31260) @@ -137,6 +137,8 @@ const char *mime_type; int save_preference_prio; /* all available save plugins are sorted by this before presenting them to the user to choose one */ + + unsigned multi_footprint:1; /* if a single footprint file may contain multiple footprints (footprint mapping needs to be called for direct load) */ }; extern pcb_plug_io_t *pcb_plug_io_chain; Index: trunk/src_plugins/io_bxl/io_bxl.c =================================================================== --- trunk/src_plugins/io_bxl/io_bxl.c (revision 31259) +++ trunk/src_plugins/io_bxl/io_bxl.c (revision 31260) @@ -82,6 +82,7 @@ io_bxl.default_extension = ".bxl"; io_bxl.fp_extension = ".bxl"; io_bxl.mime_type = "application/x-bxl"; + io_bxl.multi_footprint = 1; RND_HOOK_REGISTER(pcb_plug_io_t, pcb_plug_io_chain, &io_bxl);