Index: trunk/src/actions.c =================================================================== --- trunk/src/actions.c (revision 28031) +++ trunk/src/actions.c (revision 28032) @@ -310,7 +310,7 @@ return ret; } -fgw_error_t pcb_actionv_bin(const char *name, fgw_arg_t *res, int argc, fgw_arg_t *argv) +fgw_error_t pcb_actionv_bin(pcb_hidlib_t *hl, const char *name, fgw_arg_t *res, int argc, fgw_arg_t *argv) { fgw_func_t *f = pcb_act_lookup(name); @@ -319,7 +319,7 @@ argv[0].type = FGW_FUNC; argv[0].val.argv0.func = f; - argv[0].val.argv0.user_call_ctx = NULL; + argv[0].val.argv0.user_call_ctx = hl; res->type = FGW_INVALID; return pcb_actionv_(f, res, argc, argv); Index: trunk/src/actions.h =================================================================== --- trunk/src/actions.h (revision 28031) +++ trunk/src/actions.h (revision 28032) @@ -86,7 +86,7 @@ /* Call an action by name, passing arguments and res in fungw binary format; Caller must leave argv[0] empty for the function designator. */ -fgw_error_t pcb_actionv_bin(const char *name, fgw_arg_t *res, int argc, fgw_arg_t *argv); +fgw_error_t pcb_actionv_bin(pcb_hidlib_t *hl, const char *name, fgw_arg_t *res, int argc, fgw_arg_t *argv); /* Parse the given command string into action calls, and call Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 28031) +++ trunk/src/buffer.c (revision 28032) @@ -383,7 +383,7 @@ PCB_ACT_IRES(0); if (angle_s == NULL) - angle_s = pcb_hid_prompt_for("Enter Rotation (degrees, CCW):", "0", "Rotation angle"); + angle_s = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Enter Rotation (degrees, CCW):", "0", "Rotation angle"); if ((angle_s == NULL) || (*angle_s == '\0')) { free(angle_s); @@ -427,7 +427,7 @@ PCB_ACT_MAY_CONVARG(1, FGW_STR, ScaleBuffer, sx = pcb_strdup(argv[1].val.str)); if (sx == NULL) - sx = pcb_hid_prompt_for("Enter scaling factor (unitless multiplier):", "1.0", "scaling factor"); + sx = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Enter scaling factor (unitless multiplier):", "1.0", "scaling factor"); if ((sx == NULL) || (*sx == '\0')) { free(sx); PCB_ACT_IRES(-1); @@ -902,7 +902,7 @@ if ((!force) && ((exist = pcb_fopen(&PCB->hidlib, name, "r")))) { fclose(exist); - if (pcb_hid_message_box("warning", "Buffer: overwrite file", "File exists! Ok to overwrite?", "cancel", 0, "yes", 1, NULL) == 1) + if (pcb_hid_message_box(&PCB->hidlib, "warning", "Buffer: overwrite file", "File exists! Ok to overwrite?", "cancel", 0, "yes", 1, NULL) == 1) pcb_save_buffer(name, fmt); } else Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 28031) +++ trunk/src/change.c (revision 28032) @@ -761,23 +761,23 @@ if ((parent_subc != NULL) && !PCB_FLAG_TEST(PCB_FLAG_FLOATER, obj) && !PCB_FLAG_TEST(PCB_FLAG_DYNTEXT, obj)) goto term_name; /* special case: dyntext floaters are rarely temrinals */ if ((parent_subc != NULL) && PCB_FLAG_TEST(PCB_FLAG_DYNTEXT, obj) && (strstr(((pcb_text_t *)obj)->TextString, "%a.parent.refdes%"))) { - if (pcb_hid_message_box("question", "Text edit: refdes or template?", "Text object seems to be a refdes text", "edit the text (template)", 0, "edit subcircuit refdes", 1, NULL) == 1) { + if (pcb_hid_message_box(&PCB->hidlib, "question", "Text edit: refdes or template?", "Text object seems to be a refdes text", "edit the text (template)", 0, "edit subcircuit refdes", 1, NULL) == 1) { obj = (pcb_any_obj_t *)parent_subc; goto subc_name; } } - name = pcb_hid_prompt_for("Enter text:", PCB_EMPTY(((pcb_text_t *)obj)->TextString), "Change text"); + name = pcb_hid_prompt_for(&PCB->hidlib, "Enter text:", PCB_EMPTY(((pcb_text_t *)obj)->TextString), "Change text"); break; case PCB_OBJ_SUBC: subc_name:; - name = pcb_hid_prompt_for("Subcircuit refdes:", PCB_EMPTY(((pcb_subc_t *)obj)->refdes), "Change refdes"); + name = pcb_hid_prompt_for(&PCB->hidlib, "Subcircuit refdes:", PCB_EMPTY(((pcb_subc_t *)obj)->refdes), "Change refdes"); break; default: term_name:; { - name = pcb_hid_prompt_for("Enter terminal ID:", PCB_EMPTY(obj->term), "Change terminal ID"); + name = pcb_hid_prompt_for(&PCB->hidlib, "Enter terminal ID:", PCB_EMPTY(obj->term), "Change terminal ID"); if (name != NULL) { pcb_term_undoable_rename(PCB, obj, name); pcb_draw(); Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 28031) +++ trunk/src/change_act.c (revision 28032) @@ -518,7 +518,7 @@ /* change the layout's name */ case F_Layout: - name = pcb_hid_prompt_for("Enter the layout name:", PCB_EMPTY(PCB->hidlib.name), "Layout name"); + name = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Enter the layout name:", PCB_EMPTY(PCB->hidlib.name), "Layout name"); /* NB: ChangeLayoutName takes ownership of the passed memory */ if (name && pcb_board_change_name(name)) pcb_board_set_changed_flag(pcb_true); @@ -526,7 +526,7 @@ /* change the name of the active layer */ case F_Layer: - name = pcb_hid_prompt_for("Enter the layer name:", PCB_EMPTY(CURRENT->name), "Layer name"); + name = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Enter the layer name:", PCB_EMPTY(CURRENT->name), "Layer name"); /* NB: pcb_layer_rename_ takes ownership of the passed memory */ if (name && (pcb_layer_rename_(CURRENT, name) == 0)) pcb_board_set_changed_flag(pcb_true); Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 28031) +++ trunk/src/data.c (revision 28032) @@ -723,7 +723,7 @@ ctx->inited = 1; } if (pcb_hid_progress(ctx->at, ctx->total, "Clipping polygons...") != 0) { - int rv = pcb_hid_message_box("warning", "Stop poly clipping", "The only way to cancel poly clipping is to quit pcb-rnd.\nAre you sure you want to quit?", "yes, quit pcb-rnd", 1, "no, continue clipping", 2, NULL); + int rv = pcb_hid_message_box(&PCB->hidlib, "warning", "Stop poly clipping", "The only way to cancel poly clipping is to quit pcb-rnd.\nAre you sure you want to quit?", "yes, quit pcb-rnd", 1, "no, continue clipping", 2, NULL); if (rv == 1) { exit(1); } Index: trunk/src/drc.c =================================================================== --- trunk/src/drc.c (revision 28031) +++ trunk/src/drc.c (revision 28032) @@ -60,7 +60,7 @@ if (pcb_strcasecmp(dlg_type, "list") == 0) { if (PCB_HAVE_GUI_ATTR_DLG) { args[1].val.str = "list"; - return pcb_actionv_bin(dlgact, res, 2, args); + return pcb_actionv_bin(argv[0].val.argv0.user_call_ctx, dlgact, res, 2, args); } dlg_type = "print"; } @@ -68,7 +68,7 @@ if (pcb_strcasecmp(dlg_type, "simple") == 0) { if (PCB_HAVE_GUI_ATTR_DLG) { args[1].val.str = "simple"; - return pcb_actionv_bin(dlgact, res, 2, args); + return pcb_actionv_bin(argv[0].val.argv0.user_call_ctx, dlgact, res, 2, args); } dlg_type = "print"; } Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 28031) +++ trunk/src/file_act.c (revision 28032) @@ -90,7 +90,7 @@ break; case F_Layout: - if (!PCB->Changed || pcb_hid_message_box("warning", "File overwrite", "OK to override layout data?", "cancel", 0, "ok", 1, NULL)) + if (!PCB->Changed || pcb_hid_message_box(&PCB->hidlib, "warning", "File overwrite", "OK to override layout data?", "cancel", 0, "ok", 1, NULL)) pcb_load_pcb(name, format, pcb_true, 0); break; @@ -110,7 +110,7 @@ break; case F_Revert: - if (PCB->hidlib.filename && (!PCB->Changed || (pcb_hid_message_box("warning", "Revert: lose data", "Really revert all modifications?", "no", 0, "yes", 1, NULL) == 1))) + if (PCB->hidlib.filename && (!PCB->Changed || (pcb_hid_message_box(&PCB->hidlib, "warning", "Revert: lose data", "Really revert all modifications?", "no", 0, "yes", 1, NULL) == 1))) pcb_revert_pcb(); break; @@ -134,11 +134,11 @@ PCB_ACT_MAY_CONVARG(1, FGW_STR, New, argument_name = argv[1].val.str); - if (!PCB->Changed || (pcb_hid_message_box("warning", "New pcb", "OK to clear layout data?", "cancel", 0, "yes", 1, NULL) == 1)) { + if (!PCB->Changed || (pcb_hid_message_box(argv[0].val.argv0.user_call_ctx, "warning", "New pcb", "OK to clear layout data?", "cancel", 0, "yes", 1, NULL) == 1)) { if (argument_name) name = pcb_strdup(argument_name); else - name = pcb_hid_prompt_for("Enter the layout name:", "", "Layout name"); + name = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Enter the layout name:", "", "Layout name"); if (!name) return 1; @@ -462,7 +462,7 @@ if ((force != NULL) && (pcb_strcasecmp(force, "force") == 0)) exit(0); - if (!PCB->Changed || (pcb_hid_message_box("warning", "Close: lose data", "OK to lose data?", "cancel", 0, "ok", 1, NULL) == 1)) + if (!PCB->Changed || (pcb_hid_message_box(argv[0].val.argv0.user_call_ctx, "warning", "Close: lose data", "OK to lose data?", "cancel", 0, "ok", 1, NULL) == 1)) pcb_quit_app(); PCB_ACT_IRES(-1); return 0; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 28031) +++ trunk/src/hid.h (revision 28032) @@ -597,13 +597,13 @@ value. "msg" is printed above the query. The optional title is the window title. Returns NULL on cancel. The caller needs to free the returned string */ -char *pcb_hid_prompt_for(const char *msg, const char *default_string, const char *title); +char *pcb_hid_prompt_for(pcb_hidlib_t *hl, const char *msg, const char *default_string, const char *title); /* Present a dialog box with a message and variable number of buttons. If icon is not NULL, attempt to draw the named icon on the left. The vararg part is one or more buttons, as a list of "char *label, int retval", terminated with NULL. */ -int pcb_hid_message_box(const char *icon, const char *title, const char *label, ...); +int pcb_hid_message_box(pcb_hidlib_t *hl, const char *icon, const char *title, const char *label, ...); /* Show modal progressbar to the user, offering cancel long running processes. Pass all zeros to flush display and remove the dialog. Index: trunk/src/hid_dlg.c =================================================================== --- trunk/src/hid_dlg.c (revision 28031) +++ trunk/src/hid_dlg.c (revision 28032) @@ -49,11 +49,11 @@ strcpy(tmp, "gui_"); strncpy(tmp+4, act_name, sizeof(tmp)-5); if (PCB_HAVE_GUI_ATTR_DLG && (fgw_func_lookup(&pcb_fgw, tmp) != NULL)) - return pcb_actionv_bin(tmp, res, argc, argv); + return pcb_actionv_bin(argv[0].val.argv0.user_call_ctx, tmp, res, argc, argv); tmp[0] = 'c'; tmp[1] = 'l'; if (fgw_func_lookup(&pcb_fgw, tmp) != NULL) - return pcb_actionv_bin(tmp, res, argc, argv); + return pcb_actionv_bin(argv[0].val.argv0.user_call_ctx, tmp, res, argc, argv); return FGW_ERR_NOT_FOUND; } @@ -66,7 +66,7 @@ return call_dialog("promptfor", res, argc, argv); } -char *pcb_hid_prompt_for(const char *msg, const char *default_string, const char *title) +char *pcb_hid_prompt_for(pcb_hidlib_t *hl, const char *msg, const char *default_string, const char *title) { fgw_arg_t res, argv[4]; @@ -74,7 +74,7 @@ argv[2].type = FGW_STR; argv[2].val.cstr = default_string; argv[3].type = FGW_STR; argv[3].val.cstr = title; - if (pcb_actionv_bin("PromptFor", &res, 4, argv) != 0) + if (pcb_actionv_bin(hl, "PromptFor", &res, 4, argv) != 0) return NULL; if (res.type == (FGW_STR | FGW_DYN)) @@ -92,7 +92,7 @@ return call_dialog("messagebox", res, argc, argv); } -int pcb_hid_message_box(const char *icon, const char *title, const char *label, ...) +int pcb_hid_message_box(pcb_hidlib_t *hl, const char *icon, const char *title, const char *label, ...) { fgw_arg_t res, argv[128]; int argc; @@ -116,7 +116,7 @@ } va_end(ap); - if (pcb_actionv_bin("MessageBox", &res, argc, argv) != 0) + if (pcb_actionv_bin(hl, "MessageBox", &res, argc, argv) != 0) return -1; if (fgw_arg_conv(&pcb_fgw, &res, FGW_INT) == 0) @@ -260,7 +260,7 @@ static fgw_error_t pcb_act_Print(fgw_arg_t *res, int argc, fgw_arg_t *argv) { if (PCB_HAVE_GUI_ATTR_DLG && (fgw_func_lookup(&pcb_fgw, "printgui") != NULL)) - return pcb_actionv_bin("printgui", res, argc, argv); + return pcb_actionv_bin(argv[0].val.argv0.user_call_ctx, "printgui", res, argc, argv); pcb_message(PCB_MSG_ERROR, "action Print() is available only under a GUI HID. Please use the lpr exporter instead.\n"); return FGW_ERR_NOT_FOUND; } Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 28031) +++ trunk/src/layer.c (revision 28032) @@ -650,12 +650,12 @@ } if (new_index == -1 && is_last_top_copper_layer(pcb, old_index)) { - pcb_hid_message_box("warning", "Layer delete", "You can't delete the last top-side layer\n", "cancel", 0, NULL); + pcb_hid_message_box(&pcb->hidlib, "warning", "Layer delete", "You can't delete the last top-side layer\n", "cancel", 0, NULL); return 1; } if (new_index == -1 && is_last_bottom_copper_layer(pcb, old_index)) { - pcb_hid_message_box("warning", "Layer delete", "You can't delete the last bottom-side layer\n", "cancel", 0, NULL); + pcb_hid_message_box(&pcb->hidlib, "warning", "Layer delete", "You can't delete the last bottom-side layer\n", "cancel", 0, NULL); return 1; } Index: trunk/src/netlist.c =================================================================== --- trunk/src/netlist.c (revision 28031) +++ trunk/src/netlist.c (revision 28032) @@ -858,7 +858,7 @@ sprintf(ratname_, "pcbrnd%ld", ++netname_cnt); } while(htsp_has(&pcb->netlist[PCB_NETLIST_EDITED], ratname_)); if (interactive) { - ratname = pcb_hid_prompt_for("Name of the new net", ratname_, "rat net name"); + ratname = pcb_hid_prompt_for(&pcb->hidlib, "Name of the new net", ratname_, "rat net name"); if (ratname == NULL) /* cancel */ return NULL; } Index: trunk/src/netlist_act.c =================================================================== --- trunk/src/netlist_act.c (revision 28031) +++ trunk/src/netlist_act.c (revision 28032) @@ -372,7 +372,7 @@ if (a1 == NULL) PCB_ACT_FAIL(Netlist); if (a2 == NULL) { - a2 = a2free = pcb_hid_prompt_for("New name of the network", NULL, "net rename"); + a2 = a2free = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "New name of the network", NULL, "net rename"); if (a2 == NULL) { PCB_ACT_IRES(1); return 0; @@ -385,7 +385,7 @@ if (a1 == NULL) PCB_ACT_FAIL(Netlist); if (a2 == NULL) { - a2 = a2free = pcb_hid_prompt_for("Network name to merge into", NULL, "net merge"); + a2 = a2free = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Network name to merge into", NULL, "net merge"); if (a2 == NULL) { PCB_ACT_IRES(1); return 0; @@ -584,7 +584,7 @@ } if (netname == NULL) { - free_netname = netname = pcb_hid_prompt_for("Name of the new network", NULL, "net name"); + free_netname = netname = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Name of the new network", NULL, "net name"); if (netname == NULL) { vtp0_uninit(&termlist); PCB_ACT_IRES(1); Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 28031) +++ trunk/src/rats_patch.c (revision 28032) @@ -381,7 +381,7 @@ const char *what, *what2; if (fpname == NULL) { - fpname = pcb_hid_prompt_for("Footprint name to use for replacement:", "", "Footprint"); + fpname = pcb_hid_prompt_for(&PCB->hidlib, "Footprint name to use for replacement:", "", "Footprint"); if (fpname == NULL) { pcb_message(PCB_MSG_ERROR, "No footprint name supplied\n"); return 1; Index: trunk/src/tool_text.c =================================================================== --- trunk/src/tool_text.c (revision 28031) +++ trunk/src/tool_text.c (revision 28032) @@ -49,7 +49,7 @@ { char *string; - if ((string = pcb_hid_prompt_for("Enter text:", "", "text")) != NULL) { + if ((string = pcb_hid_prompt_for(&PCB->hidlib, "Enter text:", "", "text")) != NULL) { if (strlen(string) > 0) { pcb_text_t *text; int flag = PCB_FLAG_CLEARLINE; Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 28031) +++ trunk/src/undo.c (revision 28032) @@ -219,7 +219,7 @@ */ void pcb_undo_clear_list(pcb_bool Force) { - if (pcb_uundo.num_undo && (Force || pcb_hid_message_box("warning", "clear undo buffer", "Do you reall want to clear 'undo' buffer?", "yes", 1, "no", 0, NULL) == 1)) { + if (pcb_uundo.num_undo && (Force || pcb_hid_message_box(&PCB->hidlib, "warning", "clear undo buffer", "Do you reall want to clear 'undo' buffer?", "yes", 1, "no", 0, NULL) == 1)) { uundo_list_clear(&pcb_uundo); pcb_event(&PCB->hidlib, PCB_EVENT_UNDO_POST, "i", PCB_UNDO_EV_CLEAR_LIST); } Index: trunk/src/view.c =================================================================== --- trunk/src/view.c (revision 28031) +++ trunk/src/view.c (revision 28032) @@ -100,6 +100,8 @@ return NULL; } +TODO("remove this when pcb_view_goto loses PCB->hidlib") +#include "board.h" void pcb_view_goto(pcb_view_t *item) { @@ -110,7 +112,7 @@ argv[2].type = FGW_COORD; fgw_coord(&argv[2]) = item->bbox.Y1; argv[3].type = FGW_COORD; fgw_coord(&argv[3]) = item->bbox.X2; argv[4].type = FGW_COORD; fgw_coord(&argv[4]) = item->bbox.Y2; - pcb_actionv_bin("zoom", &res, 5, argv); + pcb_actionv_bin(&PCB->hidlib, "zoom", &res, 5, argv); } } Index: trunk/src_plugins/autoplace/action.c =================================================================== --- trunk/src_plugins/autoplace/action.c (revision 28031) +++ trunk/src_plugins/autoplace/action.c (revision 28032) @@ -45,7 +45,7 @@ static fgw_error_t pcb_act_AutoPlaceSelected(fgw_arg_t *res, int argc, fgw_arg_t *argv) { pcb_hid_busy(PCB, 1); - if (pcb_hid_message_box("question", "Autoplace start", "Auto-placement can NOT be undone.\nDo you want to continue anyway?", "no", 0, "yes", 1, NULL) == 1) { + if (pcb_hid_message_box(argv[0].val.argv0.user_call_ctx, "question", "Autoplace start", "Auto-placement can NOT be undone.\nDo you want to continue anyway?", "no", 0, "yes", 1, NULL) == 1) { if (AutoPlaceSelected()) pcb_board_set_changed_flag(pcb_true); } Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 28031) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 28032) @@ -197,7 +197,7 @@ static void pref_conf_editval_edit(void *hid_ctx, confedit_ctx_t *ctx, pcb_hid_attribute_t *attr, pcb_hid_row_t *r) { - char *nv = pcb_hid_prompt_for("list item value:", r->cell[0], "Edit config list item"); + char *nv = pcb_hid_prompt_for(&PCB->hidlib, "list item value:", r->cell[0], "Edit config list item"); if (nv == NULL) return; Index: trunk/src_plugins/export_oldconn/oldconn.c =================================================================== --- trunk/src_plugins/export_oldconn/oldconn.c (revision 28031) +++ trunk/src_plugins/export_oldconn/oldconn.c (revision 28032) @@ -245,7 +245,7 @@ if (pcb_file_readable(Filename)) { sprintf(message, "File '%s' exists, use anyway?", Filename); - response = pcb_hid_message_box("warning", "Overwrite file", message, "cancel", 0, "ok", 1, NULL); + response = pcb_hid_message_box(&PCB->hidlib, "warning", "Overwrite file", message, "cancel", 0, "ok", 1, NULL); if (response != 1) return NULL; } Index: trunk/src_plugins/hid_lesstif/dlg_attr_misc.c =================================================================== --- trunk/src_plugins/hid_lesstif/dlg_attr_misc.c (revision 28031) +++ trunk/src_plugins/hid_lesstif/dlg_attr_misc.c (revision 28032) @@ -257,7 +257,7 @@ argv[0].type = FGW_VOID; argv[1].type = FGW_STR | FGW_DYN; argv[1].val.str = pcb_strdup_printf("#%02x%02x%02x", clr->r, clr->g, clr->b); - rs = pcb_actionv_bin(CPACT, &res, 2, argv); + rs = pcb_actionv_bin(ltf_hidlib, CPACT, &res, 2, argv); if (rs != 0) return; Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 28031) +++ trunk/src_plugins/import_sch/import_sch.c (revision 28032) @@ -86,7 +86,7 @@ if (!ds) { const char *as = pcb_attrib_get(PCB, "import::disperse"); - ds = pcb_hid_prompt_for("Enter dispersion:", as ? as : "0", "Import dispersion"); + ds = pcb_hid_prompt_for(argv[0].val.argv0.user_call_ctx, "Enter dispersion:", as ? as : "0", "Import dispersion"); ds_alloced = 1; } if (units) { Index: trunk/src_plugins/lib_gtk_common/bu_dwg_tooltip.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_dwg_tooltip.c (revision 28031) +++ trunk/src_plugins/lib_gtk_common/bu_dwg_tooltip.c (revision 28032) @@ -39,7 +39,7 @@ #define TOOLTIP_UPDATE_DELAY 200 static int tooltip_update_timeout_id = 0; -gboolean pcb_gtk_dwg_tooltip_check_object(GtkWidget *drawing_area, pcb_coord_t crosshairx, pcb_coord_t crosshairy) +gboolean pcb_gtk_dwg_tooltip_check_object(pcb_hidlib_t *hl, GtkWidget *drawing_area, pcb_coord_t crosshairx, pcb_coord_t crosshairy) { const char *description; fgw_arg_t res, argv[3]; @@ -54,7 +54,7 @@ argv[2].type = FGW_COORD_; fgw_coord(&argv[2]) = crosshairy; - if (pcb_actionv_bin("DescribeLocation", &res, 3, argv) != 0) + if (pcb_actionv_bin(hl, "DescribeLocation", &res, 3, argv) != 0) return FALSE; description = res.val.cstr; Index: trunk/src_plugins/lib_gtk_common/bu_dwg_tooltip.h =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_dwg_tooltip.h (revision 28031) +++ trunk/src_plugins/lib_gtk_common/bu_dwg_tooltip.h (revision 28032) @@ -1,5 +1,5 @@ #include -gboolean pcb_gtk_dwg_tooltip_check_object(GtkWidget *drawing_area, pcb_coord_t crosshairx, pcb_coord_t crosshairy); +gboolean pcb_gtk_dwg_tooltip_check_object(pcb_hidlib_t *hl, GtkWidget *drawing_area, pcb_coord_t crosshairx, pcb_coord_t crosshairy); void pcb_gtk_dwg_tooltip_cancel_update(void); void pcb_gtk_dwg_tooltip_queue(GtkWidget *drawing_area, GSourceFunc cb, void *ctx); Index: trunk/src_plugins/lib_gtk_common/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 28031) +++ trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 28032) @@ -75,9 +75,10 @@ return FALSE; } -static gboolean check_object_tooltips(pcb_gtk_port_t *out) +static gboolean check_object_tooltips(pcb_gtk_t *gctx) { - return pcb_gtk_dwg_tooltip_check_object(out->drawing_area, out->view.crosshair_x, out->view.crosshair_y); + pcb_gtk_port_t *out = &gctx->port; + return pcb_gtk_dwg_tooltip_check_object(gctx->hidlib, out->drawing_area, out->view.crosshair_x, out->view.crosshair_y); } static gint ghid_port_window_motion_cb(GtkWidget *widget, GdkEventMotion *ev, void *ctx_) @@ -101,7 +102,7 @@ x_prev = y_prev = -1; pcb_gtk_note_event_location((GdkEventButton *)ev); - pcb_gtk_dwg_tooltip_queue(out->drawing_area, (GSourceFunc)check_object_tooltips, out); + pcb_gtk_dwg_tooltip_queue(out->drawing_area, (GSourceFunc)check_object_tooltips, gctx); return FALSE; } Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 28031) +++ trunk/src_plugins/renumber/renumber.c (revision 28032) @@ -108,7 +108,7 @@ if ((out = pcb_fopen(&PCB->hidlib, name, "r"))) { fclose(out); - if (pcb_hid_message_box("warning", "Renumber: overwrite", "File exists! Ok to overwrite?", "cancel", 0, "overwrite", 1, NULL) != 1) { + if (pcb_hid_message_box(&PCB->hidlib, "warning", "Renumber: overwrite", "File exists! Ok to overwrite?", "cancel", 0, "overwrite", 1, NULL) != 1) { if (free_name && name) free((char*)name); PCB_ACT_IRES(1); Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 28031) +++ trunk/src_plugins/shand_cmd/command.c (revision 28032) @@ -77,7 +77,7 @@ PCB_ACT_CONVARG(1, FGW_STR, LoadLayout, filename = argv[1].val.str); PCB_ACT_MAY_CONVARG(2, FGW_STR, LoadLayout, format = argv[2].val.str); - if (!PCB->Changed || (pcb_hid_message_box("warning", "Load data lose", "OK to override layout data?", "cancel", 0, "ok", 1, NULL) == 1)) + if (!PCB->Changed || (pcb_hid_message_box(argv[0].val.argv0.user_call_ctx, "warning", "Load data lose", "OK to override layout data?", "cancel", 0, "ok", 1, NULL) == 1)) pcb_load_pcb(filename, format, pcb_true, 0); PCB_ACT_IRES(0); @@ -122,7 +122,7 @@ /* DOC: q.html */ static fgw_error_t pcb_act_Quit(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - if (!PCB->Changed || (pcb_hid_message_box("warning", "Close: lose data", "OK to lose data?", "cancel", 0, "ok", 1, NULL) == 1)) + if (!PCB->Changed || (pcb_hid_message_box(argv[0].val.argv0.user_call_ctx, "warning", "Close: lose data", "OK to lose data?", "cancel", 0, "ok", 1, NULL) == 1)) pcb_quit_app(); PCB_ACT_IRES(0); return 0;