Index: plug_footprint.c =================================================================== --- plug_footprint.c (revision 31250) +++ plug_footprint.c (revision 31251) @@ -34,7 +34,10 @@ #include #include #include "conf_core.h" +#include "actions_pcb.h" +#include "plug_io.h" #include +#include #include #include "event.h" @@ -481,3 +484,24 @@ } return -1; } + +const char *pcb_fp_map_choose(rnd_hidlib_t *hidlib, const pcb_plug_fp_map_t *map) +{ + if (RND_HAVE_GUI_ATTR_DLG) { + fgw_arg_t res; + fgw_arg_t args[2]; + + fgw_ptr_reg(&rnd_fgw, &args[1], PCB_PTR_DOMAIN_FPMAP, FGW_PTR | FGW_STRUCT, (void *)map); + rnd_actionv_bin(hidlib, "gui_fpmap_choose", &res, 2, args); + fgw_ptr_unreg(&rnd_fgw, &args[1], PCB_PTR_DOMAIN_FPMAP); + + if (res.type & FGW_STR) + return res.val.str; + } + else { + rnd_message(RND_MSG_ERROR, "No gui available, automatically choosing the first footprint from the available footprints.\n"); + return map->name; + } + + return NULL; +}