Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 26779) +++ trunk/src/hid.h (revision 26780) @@ -320,7 +320,7 @@ calibrating your printer. After calibrating, nonzero xval_ and yval_ are passed according to the instructions. Metric is nonzero if the user prefers metric units, else inches are used. */ - void (*calibrate)(double xval, double yval); + void (*calibrate)(pcb_hid_t *hid, double xval, double yval); /* GUI layout functions. Not used or defined for print/export Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 26779) +++ trunk/src/hid_nogui.c (revision 26780) @@ -164,7 +164,7 @@ CRASH("fill_rect"); } -static void nogui_calibrate(double xval, double yval) +static void nogui_calibrate(pcb_hid_t *hid, double xval, double yval) { CRASH("calibrate"); } Index: trunk/src_plugins/dialogs/dlg_printcalib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_printcalib.c (revision 26779) +++ trunk/src_plugins/dialogs/dlg_printcalib.c (revision 26780) @@ -51,11 +51,11 @@ PCB_ACT_IRES(1); return 0; } - printer->calibrate(0.0, 0.0); + printer->calibrate(printer, 0.0, 0.0); if (pcb_attribute_dialog("printer_calibrate", printer_calibrate_attrs, 3, printer_calibrate_values, "Printer Calibration Values", NULL)) return 1; - printer->calibrate(printer_calibrate_values[1].real_value, printer_calibrate_values[2].real_value); + printer->calibrate(printer, printer_calibrate_values[1].real_value, printer_calibrate_values[2].real_value); PCB_ACT_IRES(0); return 0; } Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 26779) +++ trunk/src_plugins/export_bboard/bboard.c (revision 26780) @@ -585,7 +585,7 @@ } -static void bboard_calibrate(double xval, double yval) +static void bboard_calibrate(pcb_hid_t *hid, double xval, double yval) { fprintf(stderr, "HID error: pcb called unimplemented breaboard function bboard_calibrate.\n"); abort(); Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 26779) +++ trunk/src_plugins/export_dxf/dxf.c (revision 26780) @@ -501,7 +501,7 @@ fix_rect_coords(); } -static void dxf_calibrate(double xval, double yval) +static void dxf_calibrate(pcb_hid_t *hid, double xval, double yval) { pcb_message(PCB_MSG_ERROR, "dxf_calibrate() not implemented"); return; Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 26779) +++ trunk/src_plugins/export_excellon/excellon.c (revision 26780) @@ -440,7 +440,7 @@ excellon_fill_polygon(gc, 0, NULL, NULL); } -static void excellon_calibrate(double xval, double yval) +static void excellon_calibrate(pcb_hid_t *hid, double xval, double yval) { pcb_message(PCB_MSG_ERROR, "Excellon internal error: can not calibrate()\n"); } Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 26779) +++ trunk/src_plugins/export_gcode/gcode.c (revision 26780) @@ -865,7 +865,7 @@ } -static void gcode_calibrate(double xval, double yval) +static void gcode_calibrate(pcb_hid_t *hid, double xval, double yval) { CRASH("gcode_calibrate"); } Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 26779) +++ trunk/src_plugins/export_gerber/gerber.c (revision 26780) @@ -67,7 +67,7 @@ static void gerber_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); static void gerber_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); static void gerber_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); -static void gerber_calibrate(double xval, double yval); +static void gerber_calibrate(pcb_hid_t *hid, double xval, double yval); static void gerber_set_crosshair(pcb_coord_t x, pcb_coord_t y, int action); static void gerber_fill_polygon_offs(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y, pcb_coord_t dx, pcb_coord_t dy); static void gerber_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y); @@ -1333,7 +1333,7 @@ gerber_fill_polygon(gc, 5, x, y); } -static void gerber_calibrate(double xval, double yval) +static void gerber_calibrate(pcb_hid_t *hid, double xval, double yval) { CRASH("gerber_calibrate"); } Index: trunk/src_plugins/export_lpr/lpr.c =================================================================== --- trunk/src_plugins/export_lpr/lpr.c (revision 26779) +++ trunk/src_plugins/export_lpr/lpr.c (revision 26780) @@ -100,9 +100,9 @@ return pcb_hid_parse_command_line(argc, argv); } -static void lpr_calibrate(double xval, double yval) +static void lpr_calibrate(pcb_hid_t *hid, double xval, double yval) { - ps_calibrate_1(xval, yval, 1); + ps_calibrate_1(hid, xval, yval, 1); } static pcb_hid_t lpr_hid; Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 26779) +++ trunk/src_plugins/export_openems/export_openems.c (revision 26780) @@ -806,7 +806,7 @@ } -static void openems_calibrate(double xval, double yval) +static void openems_calibrate(pcb_hid_t *hid, double xval, double yval) { pcb_message(PCB_MSG_ERROR, "openems_calibrate() not implemented"); return; Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 26779) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 26780) @@ -573,7 +573,7 @@ openscad_fill_polygon_offs(gc, n_coords, x, y, 0, 0); } -static void openscad_calibrate(double xval, double yval) +static void openscad_calibrate(pcb_hid_t *hid, double xval, double yval) { pcb_message(PCB_MSG_ERROR, "openscad_calibrate() not implemented"); return; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 26779) +++ trunk/src_plugins/export_png/png.c (revision 26780) @@ -1895,7 +1895,7 @@ } -static void png_calibrate(double xval, double yval) +static void png_calibrate(pcb_hid_t *hid, double xval, double yval) { CRASH("png_calibrate"); } Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 26779) +++ trunk/src_plugins/export_ps/eps.c (revision 26780) @@ -47,7 +47,7 @@ static void eps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); static void eps_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y); static void eps_fill_polygon_offs(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y, pcb_coord_t dx, pcb_coord_t dy); -static void eps_calibrate(double xval, double yval); +static void eps_calibrate(pcb_hid_t *hid, double xval, double yval); static void eps_set_crosshair(pcb_coord_t x, pcb_coord_t y, int action); /*----------------------------------------------------------------------------*/ @@ -661,7 +661,7 @@ pcb_fprintf(f, "%mi %mi %mi %mi r\n", x1, y1, x2, y2); } -static void eps_calibrate(double xval, double yval) +static void eps_calibrate(pcb_hid_t *hid, double xval, double yval) { CRASH("eps_calibrate"); } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 26779) +++ trunk/src_plugins/export_ps/ps.c (revision 26780) @@ -1329,7 +1329,7 @@ return 1; } -void ps_calibrate_1(double xval, double yval, int use_command) +void ps_calibrate_1(pcb_hid_t *hid, double xval, double yval, int use_command) { pcb_hid_attr_val_t vals[3]; FILE *ps_cal_file; @@ -1396,9 +1396,9 @@ fclose(ps_cal_file); } -static void ps_calibrate(double xval, double yval) +static void ps_calibrate(pcb_hid_t *hid, double xval, double yval) { - ps_calibrate_1(xval, yval, 0); + ps_calibrate_1(hid, xval, yval, 0); } static void ps_set_crosshair(pcb_coord_t x, pcb_coord_t y, int action) @@ -1405,9 +1405,11 @@ { } +pcb_hid_t ps_hid; + static fgw_error_t pcb_act_PSCalib(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - ps_calibrate(0.0, 0.0); + ps_calibrate(&ps_hid, 0.0, 0.0); return 0; } @@ -1420,7 +1422,6 @@ #include "dolists.h" -pcb_hid_t ps_hid; static int ps_inited = 0; void ps_ps_init(pcb_hid_t * hid) { Index: trunk/src_plugins/export_ps/ps.h =================================================================== --- trunk/src_plugins/export_ps/ps.h (revision 26779) +++ trunk/src_plugins/export_ps/ps.h (revision 26780) @@ -2,6 +2,6 @@ extern pcb_hid_t ps_hid; extern void ps_hid_export_to_file(FILE *, pcb_hid_attr_val_t *); extern void ps_start_file(FILE *); -extern void ps_calibrate_1(double, double, int); +extern void ps_calibrate_1(pcb_hid_t *hid, double, double, int); extern void hid_eps_init(); void ps_ps_init(pcb_hid_t * hid); Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 26779) +++ trunk/src_plugins/export_svg/svg.c (revision 26780) @@ -847,7 +847,7 @@ } -static void svg_calibrate(double xval, double yval) +static void svg_calibrate(pcb_hid_t *hid, double xval, double yval) { pcb_message(PCB_MSG_ERROR, "svg_calibrate() not implemented"); return; Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 26779) +++ trunk/src_plugins/hid_batch/batch.c (revision 26780) @@ -228,7 +228,7 @@ { } -static void batch_calibrate(double xval, double yval) +static void batch_calibrate(pcb_hid_t *hid, double xval, double yval) { } Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 26779) +++ trunk/src_plugins/hid_lesstif/main.c (revision 26780) @@ -2657,7 +2657,7 @@ XFillRectangle(display, mask_bitmap, mask_gc, x1, y1, x2 - x1 + 1, y2 - y1 + 1); } -static void lesstif_calibrate(double xval, double yval) +static void lesstif_calibrate(pcb_hid_t *hid, double xval, double yval) { CRASH("lesstif_calibrate"); } Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 26779) +++ trunk/src_plugins/hid_remote/remote.c (revision 26780) @@ -299,7 +299,7 @@ proto_send_draw_rect(idx, x1, y1, x2, y2, 1); } -static void remote_calibrate(double xval, double yval) +static void remote_calibrate(pcb_hid_t *hid, double xval, double yval) { } Index: trunk/src_plugins/lib_gtk_common/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 26779) +++ trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 26780) @@ -256,7 +256,7 @@ return 0; } -static void ghid_calibrate(double xval, double yval) +static void ghid_calibrate(pcb_hid_t *hid, double xval, double yval) { printf("ghid_calibrate() -- not implemented\n"); }