Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 28088) +++ trunk/src/tool.c (revision 28089) @@ -116,6 +116,7 @@ int pcb_tool_select_by_id(pcb_hidlib_t *hidlib, pcb_toolid_t id) { + pcb_board_t *pcb = (pcb_board_t *)hidlib; char id_s[32]; static pcb_bool recursing = pcb_false; @@ -130,7 +131,7 @@ return -1; recursing = pcb_true; - if (PCB->RatDraw && !pcb_tool_get(id)->allow_when_drawing_ratlines) { + if (pcb->RatDraw && !pcb_tool_get(id)->allow_when_drawing_ratlines) { pcb_message(PCB_MSG_WARNING, "That mode is NOT allowed when drawing ratlines!\n"); id = PCB_MODE_ARROW; } @@ -429,6 +430,8 @@ void pcb_notify_mode(pcb_hidlib_t *hidlib) { + pcb_board_t *pcb = (pcb_board_t *)hidlib; + if (pcbhl_conf.temp.click_cmd_entry_active && (pcb_cli_mouse(hidlib, 1) == 0)) return; @@ -436,7 +439,7 @@ pcb_grabbed.Y = pcb_crosshair.Y; if (conf_core.temp.rat_warn) { - if (pcb_data_clear_flag(PCB->Data, PCB_FLAG_WARN, 1, 0) > 0) + if (pcb_data_clear_flag(pcb->Data, PCB_FLAG_WARN, 1, 0) > 0) pcb_board_set_changed_flag(pcb_true); } pcb_tool_notify_mode(hidlib); Index: trunk/src/tool_buffer.c =================================================================== --- trunk/src/tool_buffer.c (revision 28088) +++ trunk/src/tool_buffer.c (revision 28089) @@ -57,12 +57,14 @@ void pcb_tool_buffer_notify_mode(pcb_hidlib_t *hl) { + pcb_board_t *pcb = (pcb_board_t *)hl; + if (pcb_gui->shift_is_pressed(pcb_gui)) { pcb_actionva(hl, "ReplaceFootprint", "object", "@buffer", "dumb", NULL); return; } - if (pcb_buffer_copy_to_layout(PCB, pcb_crosshair.AttachedObject.tx, pcb_crosshair.AttachedObject.ty)) { + if (pcb_buffer_copy_to_layout(pcb, pcb_crosshair.AttachedObject.tx, pcb_crosshair.AttachedObject.ty)) { pcb_board_set_changed_flag(pcb_true); pcb_gui->invalidate_all(pcb_gui); } @@ -70,10 +72,12 @@ void pcb_tool_buffer_release_mode(pcb_hidlib_t *hl) { + pcb_board_t *pcb = (pcb_board_t *)hl; + if (pcb_tool_note.Moving) { pcb_undo_restore_serial(); pcb_tool_buffer_notify_mode(hl); - pcb_buffer_clear(PCB, PCB_PASTEBUFFER); + pcb_buffer_clear(pcb, PCB_PASTEBUFFER); pcb_buffer_set_number(pcb_tool_note.Buffer); pcb_tool_note.Moving = pcb_false; pcb_tool_note.Hit = 0; Index: trunk/src/tool_copy.c =================================================================== --- trunk/src/tool_copy.c (revision 28088) +++ trunk/src/tool_copy.c (revision 28089) @@ -50,6 +50,8 @@ void pcb_tool_copy_notify_mode(pcb_hidlib_t *hl) { + pcb_board_t *pcb = (pcb_board_t *)hl; + switch (pcb_crosshair.AttachedObject.State) { /* first notify, lookup object */ case PCB_CH_STATE_FIRST: @@ -68,7 +70,7 @@ /* second notify, move or copy object */ case PCB_CH_STATE_SECOND: - if ((PCB->is_footprint) && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_SUBC)) { + if ((pcb->is_footprint) && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_SUBC)) { pcb_message(PCB_MSG_WARNING, "Can not copy subcircuit in the footprint edit mode\n"); } else { Index: trunk/src/tool_line.c =================================================================== --- trunk/src/tool_line.c (revision 28088) +++ trunk/src/tool_line.c (revision 28089) @@ -107,7 +107,7 @@ switch (pcb_crosshair.AttachedLine.State) { case PCB_CH_STATE_FIRST: /* first point */ TODO("subc: this should work on heavy terminals too!") - if (PCB->RatDraw && pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_PSTK | PCB_OBJ_SUBC_PART, &ptr1, &ptr1, &ptr1) == PCB_OBJ_VOID) { + if (pcb->RatDraw && pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_PSTK | PCB_OBJ_SUBC_PART, &ptr1, &ptr1, &ptr1) == PCB_OBJ_VOID) { pcb_gui->beep(pcb_gui); break; } @@ -117,7 +117,7 @@ memset(&fctx, 0, sizeof(fctx)); fctx.flag_set = PCB_FLAG_FOUND; fctx.flag_chg_undoable = 1; - pcb_find_from_xy(&fctx, PCB->Data, pcb_crosshair.X, pcb_crosshair.Y); + pcb_find_from_xy(&fctx, pcb->Data, pcb_crosshair.X, pcb_crosshair.Y); pcb_find_free(&fctx); } if (type == PCB_OBJ_PSTK) { @@ -162,7 +162,7 @@ } if (pcb->RatDraw) { - pcb_rat_t *line = pcb_net_create_by_rat_coords(PCB, pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y, 1); + pcb_rat_t *line = pcb_net_create_by_rat_coords(pcb, pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y, 1); if (line != NULL) { pcb_added_lines++; @@ -257,7 +257,7 @@ if ((pcb_crosshair.AttachedLine.Point1.X != pcb_crosshair.AttachedLine.Point2.X || pcb_crosshair.AttachedLine.Point1.Y != pcb_crosshair.AttachedLine.Point2.Y) && (line = - pcb_line_new_merge(pcb_loose_subc_layer(PCB, PCB_CURRLAYER(pcb), pcb_true), + pcb_line_new_merge(pcb_loose_subc_layer(pcb, PCB_CURRLAYER(pcb), pcb_true), pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, pcb_crosshair.AttachedLine.Point2.X, @@ -303,7 +303,7 @@ } if (conf_core.editor.line_refraction && (pcb_tool_note.X != pcb_crosshair.AttachedLine.Point2.X || pcb_tool_note.Y != pcb_crosshair.AttachedLine.Point2.Y) && (line = - pcb_line_new_merge(pcb_loose_subc_layer(PCB, PCB_CURRLAYER(pcb), pcb_true), + pcb_line_new_merge(pcb_loose_subc_layer(pcb, PCB_CURRLAYER(pcb), pcb_true), pcb_crosshair.AttachedLine.Point2.X, pcb_crosshair.AttachedLine.Point2.Y, pcb_tool_note.X, pcb_tool_note.Y, Index: trunk/src/tool_lock.c =================================================================== --- trunk/src/tool_lock.c (revision 28088) +++ trunk/src/tool_lock.c (revision 28089) @@ -47,6 +47,7 @@ void pcb_tool_lock_notify_mode(pcb_hidlib_t *hl) { + pcb_board_t *pcb = (pcb_board_t *)hl; void *ptr1, *ptr2, *ptr3; int type; @@ -54,7 +55,7 @@ if (type == PCB_OBJ_SUBC) { pcb_subc_t *subc = (pcb_subc_t *)ptr2; - pcb_flag_change(PCB, PCB_CHGFLG_TOGGLE, PCB_FLAG_LOCK, PCB_OBJ_SUBC, ptr1, ptr2, ptr3); + pcb_flag_change(pcb, PCB_CHGFLG_TOGGLE, PCB_FLAG_LOCK, PCB_OBJ_SUBC, ptr1, ptr2, ptr3); DrawSubc(subc); pcb_draw(); Index: trunk/src/tool_remove.c =================================================================== --- trunk/src/tool_remove.c (revision 28088) +++ trunk/src/tool_remove.c (revision 28089) @@ -46,6 +46,7 @@ void pcb_tool_remove_notify_mode(pcb_hidlib_t *hl) { + pcb_board_t *pcb = (pcb_board_t *)hl; void *ptr1, *ptr2, *ptr3; pcb_any_obj_t *obj; int type; @@ -58,7 +59,7 @@ } if (type == PCB_OBJ_SUBC) { - if(PCB->is_footprint) { + if(pcb->is_footprint) { pcb_message(PCB_MSG_WARNING, "Can not remove the subcircuit being edited in the footprint edit mode\n"); return; } @@ -65,7 +66,7 @@ } obj = ptr2; - pcb_rat_update_obj_removed(PCB, obj); + pcb_rat_update_obj_removed(pcb, obj); /* preserve original parent over the board layer pcb_search_screen operated on - this is essential for undo: it needs to put back the object to the original