Index: trunk/src/actions.c =================================================================== --- trunk/src/actions.c (revision 28038) +++ trunk/src/actions.c (revision 28039) @@ -595,7 +595,7 @@ return -1; } -static int pcb_cli_common(fgw_arg_t *args) +static int pcb_cli_common(pcb_hidlib_t *hl, fgw_arg_t *args) { const pcb_action_t *a; fgw_func_t *f; @@ -611,15 +611,15 @@ args[0].type = FGW_FUNC; args[0].val.argv0.func = f; - args[0].val.argv0.user_call_ctx = NULL; + args[0].val.argv0.user_call_ctx = hl; return 0; } -int pcb_cli_tab(void) +int pcb_cli_tab(pcb_hidlib_t *hl) { fgw_arg_t res, args[2]; - if (pcb_cli_common(args) != 0) + if (pcb_cli_common(hl, args) != 0) return -1; args[1].type = FGW_STR; @@ -631,11 +631,11 @@ return res.val.nat_int; } -int pcb_cli_edit(void) +int pcb_cli_edit(pcb_hidlib_t *hl) { fgw_arg_t res, args[2]; - if (pcb_cli_common(args) != 0) + if (pcb_cli_common(hl, args) != 0) return -1; args[1].type = FGW_STR; @@ -647,11 +647,11 @@ return res.val.nat_int; } -int pcb_cli_mouse(pcb_bool notify) +int pcb_cli_mouse(pcb_hidlib_t *hl, pcb_bool notify) { fgw_arg_t res, args[3]; - if (pcb_cli_common(args) != 0) + if (pcb_cli_common(hl, args) != 0) return -1; args[1].type = FGW_STR; Index: trunk/src/actions.h =================================================================== --- trunk/src/actions.h (revision 28038) +++ trunk/src/actions.h (revision 28039) @@ -115,15 +115,15 @@ int pcb_cli_leave(void); /* Request for tab completion */ -int pcb_cli_tab(void); +int pcb_cli_tab(pcb_hidlib_t *hl); /* Called on each key press so indication can be updated */ -int pcb_cli_edit(void); +int pcb_cli_edit(pcb_hidlib_t *hl); /* Mouse event while the command line is open; returns zero if normal event processing shall be inhibited; notify is true if called in notify mode, false if called in release mode */ -int pcb_cli_mouse(pcb_bool notify); +int pcb_cli_mouse(pcb_hidlib_t *hl, pcb_bool notify); /* Discard the cli mode stack */ void pcb_cli_uninit(void); Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 28038) +++ trunk/src/tool.c (revision 28039) @@ -415,7 +415,7 @@ /*** old helpers ***/ void pcb_release_mode(pcb_hidlib_t *hidlib) { - if (pcbhl_conf.temp.click_cmd_entry_active && (pcb_cli_mouse(0) == 0)) + if (pcbhl_conf.temp.click_cmd_entry_active && (pcb_cli_mouse(hidlib, 0) == 0)) return; pcb_grabbed.status = pcb_false; @@ -429,7 +429,7 @@ void pcb_notify_mode(pcb_hidlib_t *hidlib) { - if (pcbhl_conf.temp.click_cmd_entry_active && (pcb_cli_mouse(1) == 0)) + if (pcbhl_conf.temp.click_cmd_entry_active && (pcb_cli_mouse(hidlib, 1) == 0)) return; pcb_grabbed.X = pcb_crosshair.X; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 28038) +++ trunk/src_plugins/hid_lesstif/main.c (revision 28039) @@ -503,7 +503,7 @@ switch (e->type) { case KeyRelease: if (cmd_is_active) - pcb_cli_edit(); + pcb_cli_edit(ltf_hidlib); break; case KeyPress: @@ -530,7 +530,7 @@ XmTextSetString(w, XmStrCast("")); break; case XK_Tab: - pcb_cli_tab(); + pcb_cli_tab(ltf_hidlib); *cont = False; break; case XK_Escape: Index: trunk/src_plugins/lib_gtk_common/bu_command.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_command.c (revision 28038) +++ trunk/src_plugins/lib_gtk_common/bu_command.c (revision 28039) @@ -43,6 +43,7 @@ #include "crosshair.h" #include "actions.h" +#include "pcb_gtk.h" #include "hid_gtk_conf.h" #include "../src_plugins/lib_hid_common/cli_history.h" @@ -104,7 +105,7 @@ gint ksym = kev->keyval; if (ksym == PCB_GTK_KEY(Tab)) { - pcb_cli_tab(); + pcb_cli_tab(ghidgui->hidlib); return TRUE; } @@ -120,7 +121,7 @@ static pcb_bool command_keyrelease_cb(GtkWidget *widget, GdkEventKey *kev, pcb_gtk_command_t *ctx) { if (ctx->command_entry_status_line_active) - pcb_cli_edit(); + pcb_cli_edit(ghidgui->hidlib); return TRUE; }