Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 33488) +++ trunk/scconfig/Rev.h (revision 33489) @@ -1 +1 @@ -static const int myrev = 33485; +static const int myrev = 33489; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 33488) +++ trunk/scconfig/Rev.tab (revision 33489) @@ -1,4 +1,4 @@ -33485 configure new plugin: show_netnames +33489 configure new plugin: show_netnames 33460 configure local dialogs plugin configuration 33403 distclean move script plugin to librnd 33376 distclean scripting support cleanup Index: trunk/src_plugins/show_netnames/Plug.tmpasm =================================================================== --- trunk/src_plugins/show_netnames/Plug.tmpasm (revision 33488) +++ trunk/src_plugins/show_netnames/Plug.tmpasm (revision 33489) @@ -1,4 +1,7 @@ put /local/pcb/mod {show_netnames} +put /local/pcb/mod/CONF {$(PLUGDIR)/show_netnames/show_netnames_conf.h} +put /local/pcb/mod/CONFFILE {show_netnames.conf} +put /local/pcb/mod/CONFVAR {show_netnames_conf_internal} put /local/pcb/mod/MENUFILE {show_netnames-menu.lht} put /local/pcb/mod/MENUVAR {show_netnames_menu} append /local/pcb/mod/OBJS [@ Index: trunk/src_plugins/show_netnames/show_netnames.c =================================================================== --- trunk/src_plugins/show_netnames/show_netnames.c (revision 33488) +++ trunk/src_plugins/show_netnames/show_netnames.c (revision 33489) @@ -33,8 +33,11 @@ #include "event.h" #include #include "menu_internal.c" +#include "show_netnames_conf.h" const char *pcb_show_netnames_cookie = "show_netnames plugin"; +#define SHOW_NETNAMES_CONF_FN "show_netnames.conf" +conf_show_netnames_t conf_show_netnames; static void show_netnames_brd_chg(rnd_hidlib_t *hidlib, void *user_data, int argc, rnd_event_arg_t argv[]) { @@ -50,9 +53,11 @@ void pplg_uninit_show_netnames(void) { + rnd_conf_unreg_file(SHOW_NETNAMES_CONF_FN, show_netnames_conf_internal); rnd_hid_menu_unload(rnd_gui, pcb_show_netnames_cookie); rnd_event_unbind_allcookie(pcb_show_netnames_cookie); rnd_remove_actions_by_cookie(pcb_show_netnames_cookie); + rnd_conf_unreg_fields("plugins/show_netnames/"); } int pplg_init_show_netnames(void) @@ -59,6 +64,12 @@ { RND_API_CHK_VER; + rnd_conf_reg_file(SHOW_NETNAMES_CONF_FN, show_netnames_conf_internal); + +#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ + rnd_conf_reg_field(conf_show_netnames, field,isarray,type_name,cpath,cname,desc,flags); +#include "show_netnames_conf_fields.h" + rnd_event_bind(PCB_EVENT_BOARD_EDITED, show_netnames_brd_chg, NULL, pcb_show_netnames_cookie); rnd_event_bind(RND_EVENT_BOARD_CHANGED, show_netnames_brd_chg, NULL, pcb_show_netnames_cookie); rnd_event_bind(RND_EVENT_GUI_DRAW_OVERLAY_XOR, show_netnames_render, NULL, pcb_show_netnames_cookie); Index: trunk/src_plugins/show_netnames/show_netnames_conf.h =================================================================== --- trunk/src_plugins/show_netnames/show_netnames_conf.h (nonexistent) +++ trunk/src_plugins/show_netnames/show_netnames_conf.h (revision 33489) @@ -0,0 +1,15 @@ +#ifndef PCB_SHOW_NETNAMES_CONF_H +#define PCB_SHOW_NETNAMES_CONF_H + +#include + +typedef struct { + const struct { + const struct { + RND_CFT_BOOLEAN enable; /* Enable displaying netnames */ + RND_CFT_REAL zoom_level; /* Display netnames only if current zoom coords_per_pixel is smaller than this value */ + } show_netnames; + } plugins; +} conf_show_netnames_t; + +#endif