Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 16057) +++ trunk/src/global_typedefs.h (revision 16058) @@ -60,6 +60,8 @@ typedef struct pcb_plug_io_s pcb_plug_io_t; +typedef struct pcb_hid_cfg_s pcb_hid_cfg_t; + typedef unsigned int pcb_cardinal_t; typedef unsigned char pcb_uint8_t; /* Don't use in new code. */ Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 16057) +++ trunk/src/hid.h (revision 16058) @@ -507,6 +507,10 @@ /* Removes a menu recursively */ int (*remove_menu)(const char *menu_path); + /* Pointer to the hid's configuration - useful for plugins and core wanting to install menus at anchors */ + pcb_hid_cfg_t *hid_cfg; + + /* Optional: print usage string (if accepts command line arguments) Subtopic: NULL print generic help Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 16057) +++ trunk/src_plugins/hid_lesstif/main.c (revision 16058) @@ -3726,6 +3726,8 @@ conf_hid_unreg(lesstif_cookie); } +extern pcb_hid_cfg_t *lesstif_cfg; + int pplg_init_hid_lesstif(void) { static conf_hid_callbacks_t ccb; @@ -3806,6 +3808,7 @@ lesstif_hid.create_menu = lesstif_create_menu; lesstif_hid.remove_menu = lesstif_remove_menu; + lesstif_hid.hid_cfg = lesstif_cfg; lesstif_hid.usage = lesstif_usage; pcb_event_bind(PCB_EVENT_BOARD_CHANGED, ev_pcb_changed, NULL, lesstif_cookie); Index: trunk/src_plugins/lib_gtk_hid/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 16057) +++ trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 16058) @@ -162,6 +162,9 @@ ghid_create_pcb_widgets(&ghidgui->topwin, gport->top_window); pcb_gtk_drcwin_init(&ghidgui->drcwin); /* DRC window is not built, yet */ + /* assume pcb_gui is us */ + pcb_gui->hid_cfg = ghidgui->topwin.ghid_cfg; + gport->mouse.drawing_area = ghidgui->topwin.drawing_area; gport->drawing_area = ghidgui->topwin.drawing_area; gport->mouse.top_window = ghidgui->common.top_window; @@ -197,6 +200,7 @@ gtkhid_end(); ghidgui->gui_is_up = 0; + pcb_gui->hid_cfg = NULL; } static void ghid_do_exit(pcb_hid_t * hid)