Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 26780) +++ trunk/src/crosshair.c (revision 26781) @@ -371,8 +371,8 @@ line->Thickness, line->Clearance, line->Flags, - pcb_gui->shift_is_pressed(), - pcb_gui->control_is_pressed() ); + pcb_gui->shift_is_pressed(pcb_gui), + pcb_gui->control_is_pressed(pcb_gui) ); pcb_route_draw(&route,pcb_crosshair.GC); if (conf_core.editor.show_drc) pcb_route_draw_drc(&route,pcb_crosshair.GC); @@ -763,7 +763,7 @@ } sq_dist = crosshair_sq_dist(snap_data->crosshair, x, y); - if (sq_dist < snap_data->nearest_sq_dist || (prefer_to_grid && snap_data->nearest_is_grid && !pcb_gui->shift_is_pressed())) { + if (sq_dist < snap_data->nearest_sq_dist || (prefer_to_grid && snap_data->nearest_is_grid && !pcb_gui->shift_is_pressed(pcb_gui))) { snap_data->x = x; snap_data->y = y; snap_data->nearest_sq_dist = sq_dist; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 26780) +++ trunk/src/hid.h (revision 26781) @@ -327,9 +327,9 @@ HIDs. */ /* Temporary */ - int (*shift_is_pressed)(void); - int (*control_is_pressed)(void); - int (*mod1_is_pressed)(void); + int (*shift_is_pressed)(pcb_hid_t *hid); + int (*control_is_pressed)(pcb_hid_t *hid); + int (*mod1_is_pressed)(pcb_hid_t *hid); void (*get_coords)(const char *msg, pcb_coord_t *x, pcb_coord_t *y, int force); Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 26780) +++ trunk/src/hid_nogui.c (revision 26781) @@ -169,19 +169,19 @@ CRASH("calibrate"); } -static int nogui_shift_is_pressed(void) +static int nogui_shift_is_pressed(pcb_hid_t *hid) { /* This is called from pcb_crosshair_grid_fit() when the board is loaded. */ return 0; } -static int nogui_control_is_pressed(void) +static int nogui_control_is_pressed(pcb_hid_t *hid) { CRASH("control_is_pressed"); return 0; } -static int nogui_mod1_is_pressed(void) +static int nogui_mod1_is_pressed(pcb_hid_t *hid) { CRASH("mod1_is_pressed"); return 0; Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 26780) +++ trunk/src/insert.c (revision 26781) @@ -85,7 +85,7 @@ if (pcb_crosshair.AttachedObject.State == PCB_CH_STATE_FIRST) return NULL; pcb_crosshair.AttachedObject.Ptr3 = &InsertedPoint; - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_attached_line_t myline; /* only force 45 degree for nearest point */ if (pcb_distance(pcb_crosshair.X, pcb_crosshair.Y, line->Point1.X, line->Point1.Y) < Index: trunk/src/obj_arc_ui.c =================================================================== --- trunk/src/obj_arc_ui.c (revision 26780) +++ trunk/src/obj_arc_ui.c (revision 26781) @@ -121,7 +121,7 @@ void pcb_arc_ui_move_or_copy(pcb_crosshair_t *ch) { - if (pcb_gui->shift_is_pressed() || (ch->AttachedObject.radius != 0)) + if (pcb_gui->shift_is_pressed(pcb_gui) || (ch->AttachedObject.radius != 0)) pcb_arc_ui_move_or_copy_endp(ch); else pcb_arc_ui_move_or_copy_angle(ch); Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 26780) +++ trunk/src/obj_line.c (revision 26781) @@ -650,8 +650,8 @@ Line->Thickness, Line->Clearance, Line->Flags, - pcb_gui->shift_is_pressed(), - pcb_gui->control_is_pressed() ); + pcb_gui->shift_is_pressed(pcb_gui), + pcb_gui->control_is_pressed(pcb_gui) ); pcb_route_apply_to_line(&route,Layer,Line); pcb_route_destroy(&route); } Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 26780) +++ trunk/src/obj_line_drcenf.c (revision 26781) @@ -59,8 +59,8 @@ &pcb_crosshair.Route, &line->Point1, &line->Point2, pcb_layer_id(PCB->Data, CURRENT), conf_core.design.line_thickness, conf_core.design.clearance * 2, - pcb_flag_make(flags), pcb_gui->shift_is_pressed(), - pcb_gui->control_is_pressed()); + pcb_flag_make(flags), pcb_gui->shift_is_pressed(pcb_gui), + pcb_gui->control_is_pressed(pcb_gui)); } /* directions: @@ -148,7 +148,7 @@ return; /* don't draw outline when ctrl key is pressed */ - if (pcb_gui->control_is_pressed()) { + if (pcb_gui->control_is_pressed(pcb_gui)) { line->draw = pcb_false; return; } @@ -162,7 +162,7 @@ } /* swap the modes if shift is held down */ - if (pcb_gui->shift_is_pressed()) + if (pcb_gui->shift_is_pressed(pcb_gui)) way = !way; dx = pcb_crosshair.X - line->Point1.X; @@ -468,7 +468,7 @@ /* Silence a bogus compiler warning by storing this in a variable */ pcb_layer_id_t layer_idx = INDEXOFCURRENT; - if (pcb_gui->mod1_is_pressed() || pcb_gui->control_is_pressed() || PCB->RatDraw) + if (pcb_gui->mod1_is_pressed(pcb_gui) || pcb_gui->control_is_pressed(pcb_gui) || PCB->RatDraw) return; if (!(pcb_layer_flags(PCB, layer_idx) & PCB_LYT_COPPER)) @@ -493,7 +493,7 @@ #undef sqr } /* shift forces the line lookahead path to refract the alternate way */ - shift = pcb_gui->shift_is_pressed(); + shift = pcb_gui->shift_is_pressed(pcb_gui); if (PCB_XOR(r1 > r2, shift)) { if (conf_core.editor.line_refraction != 0) { Index: trunk/src/tool_arc.c =================================================================== --- trunk/src/tool_arc.c (revision 26780) +++ trunk/src/tool_arc.c (revision 26781) @@ -132,7 +132,7 @@ void pcb_tool_arc_adjust_attached_objects(void) { - pcb_crosshair.AttachedBox.otherway = pcb_gui->shift_is_pressed(); + pcb_crosshair.AttachedBox.otherway = pcb_gui->shift_is_pressed(pcb_gui); } void pcb_tool_arc_draw_attached(void) Index: trunk/src/tool_arrow.c =================================================================== --- trunk/src/tool_arrow.c (revision 26780) +++ trunk/src/tool_arrow.c (revision 26781) @@ -65,7 +65,7 @@ if (pcb_tool_note.Click) { pcb_notify_crosshair_change(pcb_false); pcb_tool_note.Click = pcb_false; - if (pcb_tool_note.Moving && !pcb_gui->shift_is_pressed()) { + if (pcb_tool_note.Moving && !pcb_gui->shift_is_pressed(pcb_gui)) { pcb_tool_note.Buffer = conf_core.editor.buffer_number; pcb_buffer_set_number(PCB_MAX_BUFFER - 1); pcb_buffer_clear(PCB, PCB_PASTEBUFFER); @@ -76,12 +76,12 @@ pcb_tool_is_saved = pcb_true; pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); } - else if (pcb_tool_note.Hit && !pcb_gui->shift_is_pressed()) { + else if (pcb_tool_note.Hit && !pcb_gui->shift_is_pressed(pcb_gui)) { pcb_box_t box; pcb_tool_save(&PCB->hidlib); pcb_tool_is_saved = pcb_true; - pcb_tool_select_by_id(&PCB->hidlib, pcb_gui->control_is_pressed()? PCB_MODE_COPY : PCB_MODE_MOVE); + pcb_tool_select_by_id(&PCB->hidlib, pcb_gui->control_is_pressed(pcb_gui)? PCB_MODE_COPY : PCB_MODE_MOVE); pcb_crosshair.AttachedObject.Ptr1 = pcb_tool_note.ptr1; pcb_crosshair.AttachedObject.Ptr2 = pcb_tool_note.ptr2; pcb_crosshair.AttachedObject.Ptr3 = pcb_tool_note.ptr3; @@ -112,7 +112,7 @@ box.X2 = PCB_MAX_COORD; box.Y2 = PCB_MAX_COORD; /* unselect first if shift key not down */ - if (!pcb_gui->shift_is_pressed() && pcb_select_block(PCB, &box, pcb_false, pcb_false, pcb_false)) + if (!pcb_gui->shift_is_pressed(pcb_gui) && pcb_select_block(PCB, &box, pcb_false, pcb_false, pcb_false)) pcb_board_set_changed_flag(pcb_true); pcb_tool_notify_block(); pcb_crosshair.AttachedBox.Point1.X = pcb_tool_note.X; @@ -174,7 +174,7 @@ pcb_tool_note.Click = pcb_false; /* inhibit timer action */ pcb_undo_save_serial(); /* unselect first if shift key not down */ - if (!pcb_gui->shift_is_pressed()) { + if (!pcb_gui->shift_is_pressed(pcb_gui)) { if (pcb_select_block(PCB, &box, pcb_false, pcb_false, pcb_false)) pcb_board_set_changed_flag(pcb_true); if (pcb_tool_note.Moving) { Index: trunk/src/tool_buffer.c =================================================================== --- trunk/src/tool_buffer.c (revision 26780) +++ trunk/src/tool_buffer.c (revision 26781) @@ -57,7 +57,7 @@ void pcb_tool_buffer_notify_mode(void) { - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_actionl("ReplaceFootprint", "object", "@buffer", "dumb", NULL); return; } Index: trunk/src/tool_line.c =================================================================== --- trunk/src/tool_line.c (revision 26780) +++ trunk/src/tool_line.c (revision 26781) @@ -335,7 +335,7 @@ void pcb_tool_line_adjust_attached_objects(void) { /* don't draw outline when ctrl key is pressed */ - if (pcb_gui->control_is_pressed()) { + if (pcb_gui->control_is_pressed(pcb_gui)) { pcb_crosshair.AttachedLine.draw = pcb_false; } else { Index: trunk/src/tool_poly.c =================================================================== --- trunk/src/tool_poly.c (revision 26780) +++ trunk/src/tool_poly.c (revision 26781) @@ -97,7 +97,7 @@ { pcb_attached_line_t *line = &pcb_crosshair.AttachedLine; - if (pcb_gui->control_is_pressed()) { + if (pcb_gui->control_is_pressed(pcb_gui)) { line->draw = pcb_false; return; } Index: trunk/src/tool_polyhole.c =================================================================== --- trunk/src/tool_polyhole.c (revision 26780) +++ trunk/src/tool_polyhole.c (revision 26781) @@ -126,7 +126,7 @@ { pcb_attached_line_t *line = &pcb_crosshair.AttachedLine; - if (pcb_gui->control_is_pressed()) { + if (pcb_gui->control_is_pressed(pcb_gui)) { line->draw = pcb_false; return; } Index: trunk/src/tool_rotate.c =================================================================== --- trunk/src/tool_rotate.c (revision 26780) +++ trunk/src/tool_rotate.c (revision 26781) @@ -43,7 +43,7 @@ void pcb_tool_rotate_notify_mode(void) { - pcb_screen_obj_rotate90(pcb_tool_note.X, pcb_tool_note.Y, pcb_gui->shift_is_pressed()? (conf_core.editor.show_solder_side ? 1 : 3) + pcb_screen_obj_rotate90(pcb_tool_note.X, pcb_tool_note.Y, pcb_gui->shift_is_pressed(pcb_gui)? (conf_core.editor.show_solder_side ? 1 : 3) : (conf_core.editor.show_solder_side ? 3 : 1)); pcb_subc_as_board_update(PCB); } Index: trunk/src/tool_thermal.c =================================================================== --- trunk/src/tool_thermal.c (revision 26780) +++ trunk/src/tool_thermal.c (revision 26781) @@ -57,7 +57,7 @@ int cycles = sizeof(cycle) / sizeof(cycle[0]); th = pcb_pstk_get_thermal(ps, lid, 1); - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { int n, curr = -1; /* cycle through the variants to find the current one */ for(n = 0; n < cycles; n++) { Index: trunk/src/tool_via.c =================================================================== --- trunk/src/tool_via.c (revision 26780) +++ trunk/src/tool_via.c (revision 26781) @@ -75,7 +75,7 @@ pcb_obj_add_attribs(ps, PCB->pen_attr); pcb_undo_add_obj_to_create(PCB_OBJ_PSTK, ps, ps, ps); - if (pcb_gui->shift_is_pressed()) + if (pcb_gui->shift_is_pressed(pcb_gui)) pcb_tool_thermal_on_pstk(ps, INDEXOFCURRENT); pcb_undo_inc_serial(); Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 26780) +++ trunk/src_plugins/hid_batch/batch.c (revision 26781) @@ -232,17 +232,17 @@ { } -static int batch_shift_is_pressed(void) +static int batch_shift_is_pressed(pcb_hid_t *hid) { return 0; } -static int batch_control_is_pressed(void) +static int batch_control_is_pressed(pcb_hid_t *hid) { return 0; } -static int batch_mod1_is_pressed(void) +static int batch_mod1_is_pressed(pcb_hid_t *hid) { return 0; } Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 26780) +++ trunk/src_plugins/hid_lesstif/main.c (revision 26781) @@ -2662,17 +2662,17 @@ CRASH("lesstif_calibrate"); } -static int lesstif_shift_is_pressed(void) +static int lesstif_shift_is_pressed(pcb_hid_t *hid) { return shift_pressed; } -static int lesstif_control_is_pressed(void) +static int lesstif_control_is_pressed(pcb_hid_t *hid) { return ctrl_pressed; } -static int lesstif_mod1_is_pressed(void) +static int lesstif_mod1_is_pressed(pcb_hid_t *hid) { return alt_pressed; } Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 26780) +++ trunk/src_plugins/hid_remote/remote.c (revision 26781) @@ -303,17 +303,17 @@ { } -static int remote_shift_is_pressed(void) +static int remote_shift_is_pressed(pcb_hid_t *hid) { return 0; } -static int remote_control_is_pressed(void) +static int remote_control_is_pressed(pcb_hid_t *hid) { return 0; } -static int remote_mod1_is_pressed(void) +static int remote_mod1_is_pressed(pcb_hid_t *hid) { return 0; } Index: trunk/src_plugins/lib_gtk_common/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 26780) +++ trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 26781) @@ -548,7 +548,7 @@ ghid_restore_cursor(ghidgui); } -static int ghid_shift_is_pressed() +static int ghid_shift_is_pressed(pcb_hid_t *hid) { GdkModifierType mask; pcb_gtk_port_t *out = &ghidgui->port; @@ -566,7 +566,7 @@ #endif } -static int ghid_control_is_pressed() +static int ghid_control_is_pressed(pcb_hid_t *hid) { GdkModifierType mask; pcb_gtk_port_t *out = &ghidgui->port; @@ -584,7 +584,7 @@ #endif } -static int ghid_mod1_is_pressed() +static int ghid_mod1_is_pressed(pcb_hid_t *hid) { GdkModifierType mask; pcb_gtk_port_t *out = &ghidgui->port; Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 26780) +++ trunk/src_plugins/report/report.c (revision 26781) @@ -198,7 +198,7 @@ gds_t tmp; #ifndef NDEBUG - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_r_dump_tree(PCB->Data->padstack_tree, 0); PCB_ACT_IRES(0); return 0; @@ -225,7 +225,7 @@ { pcb_line_t *line; #ifndef NDEBUG - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->line_tree, 0); PCB_ACT_IRES(0); @@ -253,7 +253,7 @@ { pcb_rat_t *line; #ifndef NDEBUG - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_r_dump_tree(PCB->Data->rat_tree, 0); PCB_ACT_IRES(0); return 0; @@ -275,7 +275,7 @@ pcb_arc_t *Arc; pcb_box_t box; #ifndef NDEBUG - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->arc_tree, 0); return 0; @@ -311,7 +311,7 @@ double area, u; #ifndef NDEBUG - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->polygon_tree, 0); PCB_ACT_IRES(0); @@ -352,7 +352,7 @@ { pcb_subc_t *subc; #ifndef NDEBUG - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_r_dump_tree(PCB->Data->subc_tree, 0); PCB_ACT_IRES(0); return 0; @@ -372,7 +372,7 @@ } case PCB_OBJ_TEXT: #ifndef NDEBUG - if (pcb_gui->shift_is_pressed()) { + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_layer_t *layer = (pcb_layer_t *) ptr1; pcb_r_dump_tree(layer->text_tree, 0); PCB_ACT_IRES(0); Index: trunk/src_plugins/rubberband_orig/rubberband.c =================================================================== --- trunk/src_plugins/rubberband_orig/rubberband.c (revision 26780) +++ trunk/src_plugins/rubberband_orig/rubberband.c (revision 26781) @@ -1041,7 +1041,7 @@ point2.Y += argv[argi2 + 1].d.i; pcb_route_init(&route); - pcb_route_calculate(PCB, &route, &point1, &point2, pcb_layer_id(PCB->Data, ptr->Layer), ptr->Line->Thickness, ptr->Line->Clearance, ptr->Line->Flags, pcb_gui->shift_is_pressed(), pcb_gui->control_is_pressed()); + pcb_route_calculate(PCB, &route, &point1, &point2, pcb_layer_id(PCB->Data, ptr->Layer), ptr->Line->Thickness, ptr->Line->Clearance, ptr->Line->Flags, pcb_gui->shift_is_pressed(pcb_gui), pcb_gui->control_is_pressed(pcb_gui)); pcb_route_apply_to_line(&route, ptr->Layer, ptr->Line); pcb_route_destroy(&route); } @@ -1180,7 +1180,7 @@ pcb_route_calculate(PCB, &route, ptr->delta_index[0] < 0 ? &point1 : &point2, - ptr->delta_index[0] < 0 ? &point2 : &point1, pcb_layer_id(PCB->Data, ptr->Layer), ptr->Line->Thickness, ptr->Line->Clearance, ptr->Line->Flags, pcb_gui->shift_is_pressed(), pcb_gui->control_is_pressed()); + ptr->delta_index[0] < 0 ? &point2 : &point1, pcb_layer_id(PCB->Data, ptr->Layer), ptr->Line->Thickness, ptr->Line->Clearance, ptr->Line->Flags, pcb_gui->shift_is_pressed(pcb_gui), pcb_gui->control_is_pressed(pcb_gui)); pcb_route_draw(&route, pcb_crosshair.GC); if (conf_core.editor.show_drc) pcb_route_draw_drc(&route, pcb_crosshair.GC); @@ -1404,7 +1404,7 @@ pcb_route_add_arc(route, ¢er, arc.StartAngle, arc.Delta, arc.Width, layerid); if ((dx != 0) || (dy != 0)) - pcb_route_calculate_to(route, &endpoint, pcb_gui->shift_is_pressed(), pcb_gui->control_is_pressed()); + pcb_route_calculate_to(route, &endpoint, pcb_gui->shift_is_pressed(pcb_gui), pcb_gui->control_is_pressed(pcb_gui)); }