Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 32950) +++ trunk/scconfig/Rev.h (revision 32951) @@ -1 +1 @@ -static const int myrev = 32946; +static const int myrev = 32951; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 32950) +++ trunk/scconfig/Rev.tab (revision 32951) @@ -1,4 +1,4 @@ -32946 configure new plugin: ch_editpoint draw edit points of objects +32951 configure new plugin: ch_editpoint draw edit points of objects 32934 configure moving onpoint from core to plugin 32857 configure menu item for import_ttf 32739 configure export_test plugin removed in favor of the loghid plugin Index: trunk/src_plugins/ch_editpoint/Plug.tmpasm =================================================================== --- trunk/src_plugins/ch_editpoint/Plug.tmpasm (revision 32950) +++ trunk/src_plugins/ch_editpoint/Plug.tmpasm (revision 32951) @@ -1,4 +1,7 @@ put /local/pcb/mod {ch_editpoint} +put /local/pcb/mod/CONF {$(PLUGDIR)/ch_editpoint/ch_editpoint_conf.h} +put /local/pcb/mod/CONFFILE {ch_editpoint.conf} +put /local/pcb/mod/CONFVAR {ch_editpoint_conf_internal} put /local/pcb/mod/OBJS [@ $(PLUGDIR)/ch_editpoint/ch_editpoint.o @] Index: trunk/src_plugins/ch_editpoint/ch_editpoint.c =================================================================== --- trunk/src_plugins/ch_editpoint/ch_editpoint.c (revision 32950) +++ trunk/src_plugins/ch_editpoint/ch_editpoint.c (revision 32951) @@ -44,8 +44,13 @@ #include "event.h" #include "polygon.h" #include "search.h" +#include "../src_plugins/ch_editpoint/ch_editpoint_conf.h" +#include "../src_plugins/ch_editpoint/conf_internal.c" +conf_ch_editpoint_t conf_ch_editpoint; +#define CH_EDITPOINT_CONF_FN "ch_editpoint.conf" + static const char pcb_ch_editpoint_cookie[] = "ch_editpoint plugin"; static vtp0_t editpoint_raw[2]; @@ -139,7 +144,7 @@ static void pcb_ch_editpoint(rnd_hidlib_t *hidlib, void *user_data, int argc, rnd_event_arg_t argv[]) { pcb_crosshair_t *ch = argv[1].d.p; - if (conf_core.editor.highlight_on_point) + if (conf_ch_editpoint.plugins.ch_editpoint.enable) editpoint_work(ch, ch->X, ch->Y); } @@ -150,6 +155,9 @@ rnd_event_unbind_allcookie(pcb_ch_editpoint_cookie); vtp0_uninit(editpoint_objs); vtp0_uninit(old_editpoint_objs); + + rnd_conf_unreg_file(CH_EDITPOINT_CONF_FN, ch_editpoint_conf_internal); + rnd_conf_unreg_fields("plugins/ch_editpoint/"); } int pplg_init_ch_editpoint(void) @@ -156,6 +164,11 @@ { RND_API_CHK_VER; + rnd_conf_reg_file(CH_EDITPOINT_CONF_FN, ch_editpoint_conf_internal); +#define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ + rnd_conf_reg_field(conf_ch_editpoint, field,isarray,type_name,cpath,cname,desc,flags); +#include "ch_editpoint_conf_fields.h" + rnd_event_bind(PCB_EVENT_CROSSHAIR_NEW_POS, pcb_ch_editpoint, NULL, pcb_ch_editpoint_cookie); return 0; Index: trunk/src_plugins/ch_editpoint/ch_editpoint.conf =================================================================== --- trunk/src_plugins/ch_editpoint/ch_editpoint.conf (nonexistent) +++ trunk/src_plugins/ch_editpoint/ch_editpoint.conf (revision 32951) @@ -0,0 +1,9 @@ +li:pcb-rnd-conf-v1 { + ha:append { + ha:plugins { + ha:ch_editpoint { + enable = 0 + } + } + } +} Index: trunk/src_plugins/ch_editpoint/ch_editpoint_conf.h =================================================================== --- trunk/src_plugins/ch_editpoint/ch_editpoint_conf.h (nonexistent) +++ trunk/src_plugins/ch_editpoint/ch_editpoint_conf.h (revision 32951) @@ -0,0 +1,14 @@ +#ifndef PCB_CH_EDITPOINT_CONF_H +#define PCB_CH_EDITPOINT_CONF_H + +#include + +typedef struct { + const struct { + const struct { + RND_CFT_BOOLEAN enable; /* indicate edit points when the cursor is over an object */ + } ch_editpoint; + } plugins; +} conf_ch_editpoint_t; + +#endif