Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 5021) +++ trunk/doc-rnd/hacking/renames (revision 5022) @@ -865,3 +865,12 @@ stub_DrawFab -> pcb_stub_draw_fab stub_rat_found_short -> pcb_stub_rat_found_short stub_rat_proc_shorts -> pcb_stub_rat_proc_shorts +Undo -> pcb_undo +Redo -> pcb_redo +IncrementUndoSerialNumber -> pcb_undo_inc_serial +SaveUndoSerialNumber -> pcb_undo_save_serial +RestoreUndoSerialNumber -> pcb_undo_restore_serial +ClearUndoList -> pcb_undo_clear_list +LockUndo -> pcb_undo_lock +UnlockUndo -> pcb_undo_unlock +Undoing -> pcb_undoing Index: trunk/src/action_act.c =================================================================== --- trunk/src/action_act.c (revision 5021) +++ trunk/src/action_act.c (revision 5022) @@ -94,7 +94,7 @@ defer_updates = 0; if (defer_needs_update) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); gui->invalidate_all(); } fclose(fp); Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 5021) +++ trunk/src/action_helper.c (revision 5022) @@ -304,7 +304,7 @@ pcb_buffer_set_number(MAX_BUFFER - 1); pcb_buffer_clear(PCB_PASTEBUFFER); pcb_buffer_add_selected(PCB_PASTEBUFFER, Note.X, Note.Y, pcb_true); - SaveUndoSerialNumber(); + pcb_undo_save_serial(); pcb_remove_selected(); pcb_crosshair_save_mode(); saved_mode = pcb_true; @@ -340,7 +340,7 @@ Note.Hit = 0; Note.Moving = pcb_false; - SaveUndoSerialNumber(); + pcb_undo_save_serial(); box.X1 = -MAX_COORD; box.Y1 = -MAX_COORD; box.X2 = MAX_COORD; @@ -369,7 +369,7 @@ box.Y2 = MAX_COORD; Note.Click = pcb_false; /* inhibit timer action */ - SaveUndoSerialNumber(); + pcb_undo_save_serial(); /* unselect first if shift key not down */ if (!gui->shift_is_pressed()) { if (pcb_select_block(&box, pcb_false)) @@ -382,16 +382,16 @@ } /* Restore the SN so that if we select something the deselect/select combo gets the same SN. */ - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); if (pcb_select_object()) pcb_board_set_changed_flag(pcb_true); else - IncrementUndoSerialNumber(); /* We didn't select anything new, so, the deselection should get its own SN. */ + pcb_undo_inc_serial(); /* We didn't select anything new, so, the deselection should get its own SN. */ Note.Hit = 0; Note.Moving = 0; } else if (Note.Moving) { - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); pcb_notify_mode(); pcb_buffer_clear(PCB_PASTEBUFFER); pcb_buffer_set_number(Note.Buffer); @@ -408,11 +408,11 @@ box.X2 = Crosshair.AttachedBox.Point2.X; box.Y2 = Crosshair.AttachedBox.Point2.Y; - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); if (pcb_select_block(&box, pcb_true)) pcb_board_set_changed_flag(pcb_true); else if (Bumped) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); Crosshair.AttachedBox.State = STATE_FIRST; } if (saved_mode) @@ -604,7 +604,7 @@ AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via); if (gui->shift_is_pressed()) pcb_chg_obj_thermal(PCB_TYPE_VIA, via, via, via, PCB->ThermStyle); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); DrawVia(via); pcb_draw(); } @@ -666,7 +666,7 @@ Crosshair.AttachedBox.Point1.X = Crosshair.AttachedBox.Point2.X = bx->X2; Crosshair.AttachedBox.Point1.Y = Crosshair.AttachedBox.Point2.Y = bx->Y2; AddObjectToCreateUndoList(PCB_TYPE_ARC, CURRENT, arc, arc); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); addedLines++; DrawArc(CURRENT, arc); pcb_draw(); @@ -759,7 +759,7 @@ if ((line = pcb_rat_add_net())) { addedLines++; AddObjectToCreateUndoList(PCB_TYPE_RATLINE, line, line, line); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); DrawRat(line); Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X; Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y; @@ -831,7 +831,7 @@ /* copy the coordinates */ Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X; Crosshair.AttachedLine.Point1.Y = Crosshair.AttachedLine.Point2.Y; - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); lastLayer = CURRENT; } if (conf_core.editor.line_refraction && (Note.X != Crosshair.AttachedLine.Point2.X || Note.Y != Crosshair.AttachedLine.Point2.Y) @@ -846,7 +846,7 @@ (conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) != NULL) { addedLines++; AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, line, line); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); DrawLine(CURRENT, line); /* move to new start point */ Crosshair.AttachedLine.Point1.X = Note.X; @@ -889,7 +889,7 @@ Crosshair.AttachedBox.Point2.X, Crosshair.AttachedBox.Point2.Y, pcb_flag_make(flags))) != NULL) { AddObjectToCreateUndoList(PCB_TYPE_POLYGON, CURRENT, polygon, polygon); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); DrawPolygon(CURRENT, polygon); pcb_draw(); } @@ -913,7 +913,7 @@ if ((text = pcb_text_new(CURRENT, &PCB->Font, Note.X, Note.Y, 0, conf_core.design.text_scale, string, pcb_flag_make(flag))) != NULL) { AddObjectToCreateUndoList(PCB_TYPE_TEXT, CURRENT, text, text); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); DrawText(CURRENT, text); pcb_draw(); } @@ -1018,13 +1018,13 @@ /* Convert the resulting polygon(s) into a new set of nodes * and place them on the page. Delete the original polygon. */ - SaveUndoSerialNumber(); + pcb_undo_save_serial(); Flags = ((pcb_polygon_t *) Crosshair.AttachedObject.Ptr2)->Flags; pcb_poly_to_polygons_on_layer(PCB->Data, (pcb_layer_t *) Crosshair.AttachedObject.Ptr1, result, Flags); pcb_remove_object(PCB_TYPE_POLYGON, Crosshair.AttachedObject.Ptr1, Crosshair.AttachedObject.Ptr2, Crosshair.AttachedObject.Ptr3); - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); pcb_draw(); /* reset state of attached line */ @@ -1124,7 +1124,7 @@ } } pcb_remove_object(type, ptr1, ptr2, ptr3); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_board_set_changed_flag(pcb_true); } break; Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 5021) +++ trunk/src/board.c (revision 5022) @@ -249,7 +249,7 @@ void pcb_board_remove(pcb_board_t *Ptr) { - ClearUndoList(pcb_true); + pcb_undo_clear_list(pcb_true); pcb_board_free(Ptr); free(Ptr); } Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 5021) +++ trunk/src/buffer.c (revision 5022) @@ -687,7 +687,7 @@ if (changed) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } #ifdef DEBUG Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 5021) +++ trunk/src/change.c (revision 5022) @@ -363,7 +363,7 @@ change = pcb_selected_operation(&ChangeThermalFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -385,7 +385,7 @@ change = pcb_selected_operation(&ChangeSizeFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -410,7 +410,7 @@ change = pcb_selected_operation(&ChangeClearSizeFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -432,7 +432,7 @@ change = pcb_selected_operation(&Change2ndSizeFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -451,7 +451,7 @@ change = pcb_selected_operation(&ChangeJoinFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -470,7 +470,7 @@ change = pcb_selected_operation(&SetJoinFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -489,7 +489,7 @@ change = pcb_selected_operation(&ClrJoinFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -508,7 +508,7 @@ change = pcb_selected_operation(&ChangeNonetlistFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -528,7 +528,7 @@ change = pcb_selected_operation(&SetNonetlistFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -547,7 +547,7 @@ change = pcb_selected_operation(&ClrNonetlistFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -567,7 +567,7 @@ change = pcb_selected_operation(&ChangeSquareFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -589,7 +589,7 @@ change = pcb_selected_operation(&ChangeAngleFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -611,7 +611,7 @@ change = pcb_selected_operation(&ChangeRadiusFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -631,7 +631,7 @@ change = pcb_selected_operation(&SetSquareFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -650,7 +650,7 @@ change = pcb_selected_operation(&ClrSquareFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -669,7 +669,7 @@ change = pcb_selected_operation(&ChangeOctagonFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -688,7 +688,7 @@ change = pcb_selected_operation(&SetOctagonFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -707,7 +707,7 @@ change = pcb_selected_operation(&ClrOctagonFunctions, &ctx, pcb_false, types); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -729,7 +729,7 @@ END_LOOP; if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -750,7 +750,7 @@ ENDALL_LOOP; if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -773,7 +773,7 @@ change = (pcb_object_operation(&ChangeSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -795,7 +795,7 @@ change = (pcb_object_operation(&Change1stSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -817,7 +817,7 @@ change = (pcb_object_operation(&ChangeRadiusFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -839,7 +839,7 @@ change = (pcb_object_operation(&ChangeAngleFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -865,7 +865,7 @@ change = (pcb_object_operation(&ChangeClearSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -886,7 +886,7 @@ change = (pcb_object_operation(&ChangeThermalFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -909,7 +909,7 @@ if (change) { pcb_draw(); if (incundo) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -931,7 +931,7 @@ change = (pcb_object_operation(&ChangeMaskSizeFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL); if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } @@ -988,7 +988,7 @@ if (pcb_object_operation(&ChangeJoinFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1006,7 +1006,7 @@ if (pcb_object_operation(&SetJoinFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1024,7 +1024,7 @@ if (pcb_object_operation(&ClrJoinFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1042,7 +1042,7 @@ if (pcb_object_operation(&ChangeNonetlistFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1061,7 +1061,7 @@ if (pcb_object_operation(&ChangeSquareFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1079,7 +1079,7 @@ if (pcb_object_operation(&SetSquareFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1097,7 +1097,7 @@ if (pcb_object_operation(&ClrSquareFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1115,7 +1115,7 @@ if (pcb_object_operation(&ChangeOctagonFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1133,7 +1133,7 @@ if (pcb_object_operation(&SetOctagonFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1151,7 +1151,7 @@ if (pcb_object_operation(&ClrOctagonFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3) != NULL) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (pcb_true); } return (pcb_false); @@ -1220,7 +1220,7 @@ AddObjectToChangePinnumUndoList(Type, Ptr1, Ptr2, Ptr3, old); else AddObjectToChangeNameUndoList(Type, Ptr1, Ptr2, Ptr3, old); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } pcb_draw(); return (Ptr3); Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 5021) +++ trunk/src/change_act.c (revision 5022) @@ -272,7 +272,7 @@ gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && pcb_pin_change_hole((pcb_pin_t *) ptr3)) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); break; } @@ -314,7 +314,7 @@ gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, PCB_TYPE_PAD, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE && pcb_pad_change_paste((pcb_pad_t *) ptr3)) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); break; } @@ -348,14 +348,14 @@ static int ActionChangeSizes(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int a, b, c; - SaveUndoSerialNumber(); + pcb_undo_save_serial(); a = ActionChangeSize(argc, argv, x, y); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); b = ActionChange2ndSize(argc, argv, x, y); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); c = ActionChangeClearSize(argc, argv, x, y); - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); return !(!a || !b || !c); } @@ -611,7 +611,7 @@ if (defer_updates) defer_needs_update = 1; else { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); gui->invalidate_all(); } } @@ -659,7 +659,7 @@ gui->get_coords(_("Select an Object"), &x, &y); if ((type = pcb_search_screen(x, y, CHANGENAME_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { - SaveUndoSerialNumber(); + pcb_undo_save_serial(); if ((pinnums != NULL) && (strcasecmp(pinnums, "Number") == 0)) pinnum = 1; else @@ -670,7 +670,7 @@ pcb_rubberband_t *ptr; int i; - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); Crosshair.AttachedObject.RubberbandN = 0; pcb_rubber_band_lookup_rat_lines(type, ptr1, ptr2, ptr3); ptr = Crosshair.AttachedObject.Rubberband; @@ -679,7 +679,7 @@ EraseRat((pcb_rat_t *) ptr->Line); MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, ptr->Line, ptr->Line, ptr->Line); } - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } } @@ -1188,7 +1188,7 @@ case F_Object: if ((type = pcb_search_screen(Crosshair.X, Crosshair.Y, CHANGETHERMAL_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, kind); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } break; Index: trunk/src/copy.c =================================================================== --- trunk/src/copy.c (revision 5021) +++ trunk/src/copy.c (revision 5022) @@ -73,6 +73,6 @@ /* the subroutines add the objects to the undo-list */ ptr = pcb_object_operation(&CopyFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (ptr); } Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 5021) +++ trunk/src/crosshair.c (revision 5022) @@ -1335,7 +1335,7 @@ Crosshair.AttachedLine.State = STATE_FIRST; if (Mode == PCB_MODE_LINE && conf_core.editor.auto_drc) { if (pcb_reset_conns(pcb_true)) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } } Index: trunk/src/find_drc.c =================================================================== --- trunk/src/find_drc.c (revision 5021) +++ trunk/src/find_drc.c (revision 5022) @@ -308,8 +308,8 @@ IsBad = pcb_true; return R_DIR_FOUND_CONTINUE; } - IncrementUndoSerialNumber(); - Undo(pcb_true); + pcb_undo_inc_serial(); + pcb_undo(pcb_true); return R_DIR_NOT_FOUND; } @@ -341,7 +341,7 @@ TheFlag = PCB_FLAG_FOUND | PCB_FLAG_DRC | PCB_FLAG_SELECTED; if (pcb_reset_conns(pcb_true)) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } @@ -419,8 +419,8 @@ IsBad = pcb_true; break; } - IncrementUndoSerialNumber(); - Undo(pcb_false); + pcb_undo_inc_serial(); + pcb_undo(pcb_false); } } ENDALL_LOOP; @@ -450,8 +450,8 @@ IsBad = pcb_true; break; } - IncrementUndoSerialNumber(); - Undo(pcb_false); + pcb_undo_inc_serial(); + pcb_undo(pcb_false); } } ENDALL_LOOP; @@ -482,8 +482,8 @@ IsBad = pcb_true; break; } - IncrementUndoSerialNumber(); - Undo(pcb_false); + pcb_undo_inc_serial(); + pcb_undo(pcb_false); } if (pin->DrillingHole < PCB->minDrill) { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); @@ -504,8 +504,8 @@ IsBad = pcb_true; break; } - IncrementUndoSerialNumber(); - Undo(pcb_false); + pcb_undo_inc_serial(); + pcb_undo(pcb_false); } } ENDALL_LOOP; @@ -535,8 +535,8 @@ IsBad = pcb_true; break; } - IncrementUndoSerialNumber(); - Undo(pcb_false); + pcb_undo_inc_serial(); + pcb_undo(pcb_false); } } ENDALL_LOOP; @@ -567,8 +567,8 @@ IsBad = pcb_true; break; } - IncrementUndoSerialNumber(); - Undo(pcb_false); + pcb_undo_inc_serial(); + pcb_undo(pcb_false); } if (via->DrillingHole < PCB->minDrill) { AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via); @@ -589,8 +589,8 @@ IsBad = pcb_true; break; } - IncrementUndoSerialNumber(); - Undo(pcb_false); + pcb_undo_inc_serial(); + pcb_undo(pcb_false); } } END_LOOP; @@ -685,7 +685,7 @@ if (IsBad) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } @@ -758,8 +758,8 @@ if (!throw_drc_dialog()) return (pcb_true); - IncrementUndoSerialNumber(); - Undo(pcb_true); + pcb_undo_inc_serial(); + pcb_undo(pcb_true); } DumpList(); } @@ -803,8 +803,8 @@ drc = pcb_false; if (!throw_drc_dialog()) return (pcb_true); - IncrementUndoSerialNumber(); - Undo(pcb_true); + pcb_undo_inc_serial(); + pcb_undo(pcb_true); /* highlight the rest of the encroaching net so it's not reported again */ TheFlag |= PCB_FLAG_SELECTED; Bloat = 0; Index: trunk/src/find_misc.c =================================================================== --- trunk/src/find_misc.c (revision 5021) +++ trunk/src/find_misc.c (revision 5022) @@ -253,7 +253,7 @@ ListStart(type, ptr1, ptr2, ptr3); DoIt(pcb_true, AndDraw); if (User) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); User = pcb_false; /* we are done */ Index: trunk/src/find_print.c =================================================================== --- trunk/src/find_print.c (revision 5021) +++ trunk/src/find_print.c (revision 5022) @@ -233,7 +233,7 @@ if (conf_core.editor.beep_when_finished) gui->beep(); pcb_conn_lookup_uninit(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); User = pcb_false; pcb_draw(); } @@ -253,7 +253,7 @@ if (conf_core.editor.beep_when_finished) gui->beep(); pcb_conn_lookup_uninit(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); User = pcb_false; pcb_draw(); } Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 5021) +++ trunk/src/gui_act.c (revision 5022) @@ -378,7 +378,7 @@ conf_toggle_editor(auto_drc); if (conf_core.editor.auto_drc && conf_core.editor.mode == PCB_MODE_LINE) { if (pcb_reset_conns(pcb_true)) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } if (Crosshair.AttachedLine.State != STATE_FIRST) @@ -479,7 +479,7 @@ } END_LOOP; pcb_board_set_changed_flag(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); break; @@ -491,7 +491,7 @@ AddObjectToFlagUndoList(PCB_TYPE_PIN, ptr1, ptr2, ptr3); PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, (pcb_pin_t *) ptr2); pcb_board_set_changed_flag(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); break; @@ -503,7 +503,7 @@ AddObjectToFlagUndoList(PCB_TYPE_PAD, ptr1, ptr2, ptr3); PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, (pcb_pad_t *) ptr2); pcb_board_set_changed_flag(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); break; case PCB_TYPE_VIA: @@ -514,7 +514,7 @@ AddObjectToFlagUndoList(PCB_TYPE_VIA, ptr1, ptr2, ptr3); PCB_FLAG_TOGGLE(PCB_FLAG_DISPLAYNAME, (pcb_pin_t *) ptr2); pcb_board_set_changed_flag(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); break; } @@ -922,7 +922,7 @@ PCB_FLAG_TOGGLE(PCB_FLAG_HIDENAME, (pcb_element_t *) ptr2); DrawElementName((pcb_element_t *) ptr2); pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } break; } @@ -944,7 +944,7 @@ END_LOOP; if (changed) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } } } Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 5021) +++ trunk/src/insert.c (revision 5022) @@ -76,7 +76,7 @@ /* the operation insert the points to the undo-list */ ptr = pcb_object_operation(&InsertFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3); if (ptr != NULL) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (ptr); } Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 5021) +++ trunk/src/layer.c (revision 5022) @@ -929,7 +929,7 @@ int saved_group; AddLayerChangeToUndoList(old_index, new_index); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); if (old_index < -1 || old_index >= max_copper_layer) { pcb_message(PCB_MSG_DEFAULT, "Invalid old layer %d for move: must be -1..%d\n", old_index, max_copper_layer - 1); Index: trunk/src/move.c =================================================================== --- trunk/src/move.c (revision 5021) +++ trunk/src/move.c (revision 5022) @@ -119,7 +119,7 @@ AddObjectToMoveUndoList(Type, Ptr1, Ptr2, Ptr3, DX, DY); ptr2 = pcb_object_operation(&MoveFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw_inhibit_dec(); pcb_draw(); @@ -141,7 +141,7 @@ ctx.move.more_to_come = enmasse; result = pcb_object_operation(&MoveToLayerFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (result); } Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 5021) +++ trunk/src/obj_elem.c (revision 5022) @@ -475,7 +475,7 @@ END_LOOP; if (change) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (change); } Index: trunk/src/obj_rat.c =================================================================== --- trunk/src/obj_rat.c (revision 5021) +++ trunk/src/obj_rat.c (revision 5022) @@ -116,7 +116,7 @@ END_LOOP; if (changed) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (changed); } Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 5021) +++ trunk/src/object_act.c (revision 5022) @@ -291,7 +291,7 @@ END_LOOP; /* done with our action so increment the undo # */ - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_redraw(); pcb_board_set_changed_flag(pcb_true); @@ -330,7 +330,7 @@ if ((pcb_search_screen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) { element = (pcb_element_t *) ptrtmp; pcb_element_change_side(element, 2 * Crosshair.Y - PCB->MaxHeight); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } break; @@ -756,7 +756,7 @@ END_LOOP; if (changed) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_board_set_changed_flag(pcb_true); } break; @@ -781,7 +781,7 @@ } END_LOOP; if (changed) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_board_set_changed_flag(pcb_true); } break; @@ -797,10 +797,10 @@ pcb_element_smash_buffer(PCB_PASTEBUFFER); PCB_PASTEBUFFER->X = 0; PCB_PASTEBUFFER->Y = 0; - SaveUndoSerialNumber(); + pcb_undo_save_serial(); pcb_erase_obj(PCB_TYPE_ELEMENT, ptr1, ptr1); MoveObjectToRemoveUndoList(PCB_TYPE_ELEMENT, ptr1, ptr2, ptr3); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); pcb_buffer_copy_to_layout(0, 0); pcb_buffer_set_number(Note.Buffer); pcb_board_set_changed_flag(pcb_true); @@ -846,7 +846,7 @@ } value = 2 * pcb_get_value(delta, units, &absolute, NULL); - SaveUndoSerialNumber(); + pcb_undo_save_serial(); PCB_ELEMENT_LOOP(PCB->Data); { PCB_PIN_LOOP(element); @@ -855,7 +855,7 @@ continue; if (pin->Mask < pin->Thickness + value) { pcb_chg_obj_mask_size(PCB_TYPE_PIN, element, pin, 0, pin->Thickness + value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } END_LOOP; @@ -865,7 +865,7 @@ continue; if (pad->Mask < pad->Thickness + value) { pcb_chg_obj_mask_size(PCB_TYPE_PAD, element, pad, 0, pad->Thickness + value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } END_LOOP; @@ -877,12 +877,12 @@ continue; if (via->Mask && via->Mask < via->Thickness + value) { pcb_chg_obj_mask_size(PCB_TYPE_VIA, via, 0, 0, via->Thickness + value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } END_LOOP; - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); return 0; } @@ -920,7 +920,7 @@ } value = 2 * pcb_get_value(delta, units, &absolute, NULL); - SaveUndoSerialNumber(); + pcb_undo_save_serial(); PCB_ELEMENT_LOOP(PCB->Data); { PCB_PIN_LOOP(element); @@ -929,7 +929,7 @@ continue; if (pin->Clearance < value) { pcb_chg_obj_clear_size(PCB_TYPE_PIN, element, pin, 0, value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } END_LOOP; @@ -939,7 +939,7 @@ continue; if (pad->Clearance < value) { pcb_chg_obj_clear_size(PCB_TYPE_PAD, element, pad, 0, value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } END_LOOP; @@ -951,7 +951,7 @@ continue; if (via->Clearance < value) { pcb_chg_obj_clear_size(PCB_TYPE_VIA, via, 0, 0, value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } END_LOOP; @@ -961,7 +961,7 @@ continue; if (line->Clearance < value) { pcb_chg_obj_clear_size(PCB_TYPE_LINE, layer, line, 0, value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } ENDALL_LOOP; @@ -971,12 +971,12 @@ continue; if (arc->Clearance < value) { pcb_chg_obj_clear_size(PCB_TYPE_ARC, layer, arc, 0, value, 1); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); } } ENDALL_LOOP; - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); return 0; } Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 5021) +++ trunk/src/polygon.c (revision 5022) @@ -1200,7 +1200,7 @@ pcb_line_t line; pcb_bool changed = pcb_false; - if (Undoing()) + if (pcb_undoing()) return (pcb_false); for (n = 0; n < Polygon->PointN; n++) { @@ -1357,7 +1357,7 @@ /* add to undo list */ AddObjectToCreateUndoList(PCB_TYPE_POLYGON, CURRENT, polygon, polygon); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } /* find polygon holes in range, then call the callback function for @@ -1745,7 +1745,7 @@ } while (p != start); inhibit = pcb_false; - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return many; } Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 5021) +++ trunk/src/polygon_act.c (revision 5022) @@ -71,7 +71,7 @@ if ((type = pcb_search_screen(x, y, PCB_TYPE_POLYGON, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { pcb_poly_morph((pcb_layer_t *) ptr1, (pcb_polygon_t *) ptr3); pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } break; } @@ -84,7 +84,7 @@ } ENDALL_LOOP; pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); break; } } Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 5021) +++ trunk/src/rats.c (revision 5022) @@ -712,7 +712,7 @@ conf_core.temp.rat_warn = pcb_true; if (changed) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); if (ratlist_length(&PCB->Data->Rat) > 0) { pcb_message(PCB_MSG_DEFAULT, "%d rat line%s remaining\n", ratlist_length(&PCB->Data->Rat), ratlist_length(&PCB->Data->Rat) > 1 ? "s" : ""); } Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 5021) +++ trunk/src/rats_act.c (revision 5022) @@ -157,7 +157,7 @@ case F_ResetLinesAndPolygons: if (pcb_reset_found_lines_polys(pcb_true)) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } break; @@ -164,7 +164,7 @@ case F_ResetPinsViasAndPads: if (pcb_reset_found_pins_vias_pads(pcb_true)) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } break; @@ -171,7 +171,7 @@ case F_Reset: if (pcb_reset_conns(pcb_true)) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } break; Index: trunk/src/remove.c =================================================================== --- trunk/src/remove.c (revision 5021) +++ trunk/src/remove.c (revision 5022) @@ -82,7 +82,7 @@ ctx.remove.destroy_target = NULL; if (pcb_selected_operation(&RemoveFunctions, &ctx, pcb_false, PCB_TYPEMASK_ALL)) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); return (pcb_true); } Index: trunk/src/rotate.c =================================================================== --- trunk/src/rotate.c (revision 5021) +++ trunk/src/rotate.c (revision 5022) @@ -123,7 +123,7 @@ changed |= (ptr2 != NULL); if (changed) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } return (ptr2); } Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 5021) +++ trunk/src/select.c (revision 5022) @@ -201,7 +201,7 @@ break; } pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (changed); } @@ -446,7 +446,7 @@ if (changed) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } if (len == NULL) { @@ -713,7 +713,7 @@ } END_LOOP; if (Reset && changed) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return (changed); } @@ -1002,7 +1002,7 @@ re_sei_free(regex); if (changed) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } if (pat != NULL) Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 5021) +++ trunk/src/select_act.c (revision 5022) @@ -210,7 +210,7 @@ case F_Connection: if (pcb_select_connection(pcb_true)) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_board_set_changed_flag(pcb_true); } break; @@ -225,10 +225,10 @@ x = pcb_grid_fit(x, PCB->Grid, PCB->GridOffsetX); y = pcb_grid_fit(y, PCB->Grid, PCB->GridOffsetY); pcb_buffer_add_selected(PCB_PASTEBUFFER, x, y, pcb_true); - SaveUndoSerialNumber(); + pcb_undo_save_serial(); pcb_remove_selected(); pcb_element_convert_from_buffer(PCB_PASTEBUFFER); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); pcb_buffer_copy_to_layout(x, y); pcb_buffer_set_number(Note.Buffer); } @@ -362,7 +362,7 @@ case F_Connection: if (pcb_select_connection(pcb_false)) { pcb_draw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_board_set_changed_flag(pcb_true); } break; Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 5021) +++ trunk/src/undo.c (revision 5022) @@ -867,7 +867,7 @@ * * returns the bitfield for the types of operations that were undone */ -int Undo(pcb_bool draw) +int pcb_undo(pcb_bool draw) { UndoListTypePtr ptr; int Types = 0; @@ -880,7 +880,7 @@ andDraw = draw; if (Serial == 0) { - pcb_message(PCB_MSG_DEFAULT, _("ERROR: Attempt to Undo() with Serial == 0\n" " Please save your work and report this bug.\n")); + pcb_message(PCB_MSG_DEFAULT, _("ERROR: Attempt to pcb_undo() with Serial == 0\n" " Please save your work and report this bug.\n")); return 0; } @@ -898,7 +898,7 @@ " Please save your work and report this bug.\n"), ptr->Serial, Serial); /* It is likely that the serial number got corrupted through some bad - * use of the SaveUndoSerialNumber() / RestoreUndoSerialNumber() APIs. + * use of the pcb_undo_save_serial() / pcb_undo_restore_serial() APIs. * * Reset the serial number to be consistent with that of the last * operation on the undo stack in the hope that this might clear @@ -908,7 +908,7 @@ return 0; } - LockUndo(); /* lock undo module to prevent from loops */ + pcb_undo_lock(); /* lock undo module to prevent from loops */ /* Loop over all entries with the correct serial number */ for (; UndoN && ptr->Serial == Serial; ptr--, UndoN--, RedoN++) { @@ -918,7 +918,7 @@ Types |= undid; } - UnlockUndo(); + pcb_undo_unlock(); if (error_undoing) pcb_message(PCB_MSG_DEFAULT, _("ERROR: Failed to undo some operations\n")); @@ -1053,7 +1053,7 @@ * * returns the number of operations redone */ -int Redo(pcb_bool draw) +int pcb_redo(pcb_bool draw) { UndoListTypePtr ptr; int Types = 0; @@ -1073,7 +1073,7 @@ " Please save your work and report this bug.\n"), ptr->Serial, Serial); /* It is likely that the serial number got corrupted through some bad - * use of the SaveUndoSerialNumber() / RestoreUndoSerialNumber() APIs. + * use of the pcb_undo_save_serial() / pcb_undo_restore_serial() APIs. * * Reset the serial number to be consistent with that of the first * operation on the redo stack in the hope that this might clear @@ -1083,7 +1083,7 @@ return 0; } - LockUndo(); /* lock undo module to prevent from loops */ + pcb_undo_lock(); /* lock undo module to prevent from loops */ /* and loop over all entries with the correct serial number */ for (; RedoN && ptr->Serial == Serial; ptr++, UndoN++, RedoN--) { @@ -1096,7 +1096,7 @@ /* Make next serial number current */ Serial++; - UnlockUndo(); + pcb_undo_unlock(); if (error_undoing) pcb_message(PCB_MSG_DEFAULT, _("ERROR: Failed to redo some operations\n")); @@ -1110,7 +1110,7 @@ /* --------------------------------------------------------------------------- * restores the serial number of the undo list */ -void RestoreUndoSerialNumber(void) +void pcb_undo_restore_serial(void) { if (added_undo_between_increment_and_restore) pcb_message(PCB_MSG_DEFAULT, _("ERROR: Operations were added to the Undo stack with an incorrect serial number\n")); @@ -1122,7 +1122,7 @@ /* --------------------------------------------------------------------------- * saves the serial number of the undo list */ -void SaveUndoSerialNumber(void) +void pcb_undo_save_serial(void) { Bumped = pcb_false; between_increment_and_restore = pcb_false; @@ -1135,7 +1135,7 @@ * it's not done automatically because some operations perform more * than one request with the same serial # */ -void IncrementUndoSerialNumber(void) +void pcb_undo_inc_serial(void) { if (!Locked) { /* Set the changed flag if anything was added prior to this bump */ @@ -1150,7 +1150,7 @@ /* --------------------------------------------------------------------------- * releases memory of the undo- and remove list */ -void ClearUndoList(pcb_bool Force) +void pcb_undo_clear_list(pcb_bool Force) { UndoListTypePtr undo; @@ -1599,7 +1599,7 @@ /* --------------------------------------------------------------------------- * set lock flag */ -void LockUndo(void) +void pcb_undo_lock(void) { Locked = pcb_true; } @@ -1607,7 +1607,7 @@ /* --------------------------------------------------------------------------- * reset lock flag */ -void UnlockUndo(void) +void pcb_undo_unlock(void) { Locked = pcb_false; } @@ -1615,7 +1615,7 @@ /* --------------------------------------------------------------------------- * return undo lock state */ -pcb_bool Undoing(void) +pcb_bool pcb_undoing(void) { return (Locked); } Index: trunk/src/undo.h =================================================================== --- trunk/src/undo.h (revision 5021) +++ trunk/src/undo.h (revision 5022) @@ -34,14 +34,15 @@ #define DRAW_FLAGS (PCB_FLAG_RAT | PCB_FLAG_SELECTED \ | PCB_FLAG_HIDENAME | PCB_FLAG_HOLE | PCB_FLAG_OCTAGON | PCB_FLAG_FOUND | PCB_FLAG_CLEARLINE) - /* different layers */ +/* different layers */ -int Undo(pcb_bool); -int Redo(pcb_bool); -void IncrementUndoSerialNumber(void); -void SaveUndoSerialNumber(void); -void RestoreUndoSerialNumber(void); -void ClearUndoList(pcb_bool); +int pcb_undo(pcb_bool); +int pcb_redo(pcb_bool); +void pcb_undo_inc_serial(void); +void pcb_undo_save_serial(void); +void pcb_undo_restore_serial(void); +void pcb_undo_clear_list(pcb_bool); + void MoveObjectToRemoveUndoList(int, void *, void *, void *); void AddObjectToRemovePointUndoList(int, void *, void *, pcb_cardinal_t); void AddObjectToInsertPointUndoList(int, void *, void *, void *); @@ -64,10 +65,11 @@ void AddObjectToClearPolyUndoList(int, void *, void *, void *, pcb_bool); void AddLayerChangeToUndoList(int, int); void AddNetlistLibToUndoList(pcb_lib_t *); -void LockUndo(void); -void UnlockUndo(void); -pcb_bool Undoing(void); +void pcb_undo_lock(void); +void pcb_undo_unlock(void); +pcb_bool pcb_undoing(void); + /* Publish actions - these may be useful for other actions */ int ActionUndo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); int ActionRedo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 5021) +++ trunk/src/undo_act.c (revision 5022) @@ -84,19 +84,19 @@ switch (pcb_funchash_get(argv[0], NULL)) { case F_Save: - SaveUndoSerialNumber(); + pcb_undo_save_serial(); break; case F_Restore: - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); break; case F_Close: - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); break; case F_Block: - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); if (Bumped) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); break; } return 0; @@ -104,7 +104,7 @@ /* --------------------------------------------------------------------------- */ -static const char undo_syntax[] = "Undo()\n" "Undo(ClearList)"; +static const char undo_syntax[] = "pcb_undo()\n" "pcb_undo(ClearList)"; static const char undo_help[] = "Undo recent changes."; @@ -112,7 +112,7 @@ The unlimited undo feature of @code{Pcb} allows you to recover from most operations that materially affect you work. Calling -@code{Undo()} without any parameter recovers from the last (non-undo) +@code{pcb_undo()} without any parameter recovers from the last (non-undo) operation. @code{ClearList} is used to release the allocated memory. @code{ClearList} is called whenever a new layout is started or loaded. See also @code{Redo} and @code{Atomic}. @@ -144,7 +144,7 @@ if (conf_core.editor.mode == PCB_MODE_LINE) { if (Crosshair.AttachedLine.State == STATE_SECOND) { if (conf_core.editor.auto_drc) - Undo(pcb_true); /* undo the connection find */ + pcb_undo(pcb_true); /* undo the connection find */ Crosshair.AttachedLine.State = STATE_FIRST; pcb_crosshair_set_local_ref(0, 0, pcb_false); pcb_notify_crosshair_change(pcb_true); @@ -162,7 +162,7 @@ /* save both ends of line */ Crosshair.AttachedLine.Point2.X = ptr2->Point1.X; Crosshair.AttachedLine.Point2.Y = ptr2->Point1.Y; - if ((type = Undo(pcb_true))) + if ((type = pcb_undo(pcb_true))) pcb_board_set_changed_flag(pcb_true); /* check that the undo was of the right type */ if ((type & UNDO_CREATE) == 0) { @@ -227,7 +227,7 @@ } } /* undo the last destructive operation */ - if (Undo(pcb_true)) + if (pcb_undo(pcb_true)) pcb_board_set_changed_flag(pcb_true); } else if (function) { @@ -234,7 +234,7 @@ switch (pcb_funchash_get(function, NULL)) { /* clear 'undo objects' list */ case F_ClearList: - ClearUndoList(pcb_false); + pcb_undo_clear_list(pcb_false); break; } } @@ -244,7 +244,7 @@ /* --------------------------------------------------------------------------- */ -static const char redo_syntax[] = "Redo()"; +static const char redo_syntax[] = "pcb_redo()"; static const char redo_help[] = "Redo recent \"undo\" operations."; @@ -269,7 +269,7 @@ conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) && Crosshair.AttachedPolygon.PointN) || Crosshair.AttachedLine.State == STATE_SECOND) return 1; pcb_notify_crosshair_change(pcb_false); - if (Redo(pcb_true)) { + if (pcb_redo(pcb_true)) { pcb_board_set_changed_flag(pcb_true); if (conf_core.editor.mode == PCB_MODE_LINE && Crosshair.AttachedLine.State != STATE_FIRST) { pcb_line_t *line = linelist_last(&CURRENT->Line); Index: trunk/src_plugins/autocrop/autocrop.c =================================================================== --- trunk/src_plugins/autocrop/autocrop.c (revision 5021) +++ trunk/src_plugins/autocrop/autocrop.c (revision 5022) @@ -219,7 +219,7 @@ PCB->MaxWidth = box->X2; PCB->MaxHeight = box->Y2; MoveAll(dx, dy); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_redraw(); pcb_board_set_changed_flag(1); return 0; Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 5021) +++ trunk/src_plugins/autoroute/autoroute.c (revision 5022) @@ -4702,15 +4702,15 @@ pcb_message(PCB_MSG_DEFAULT, "Total added wire length = %$mS, %d vias added\n", (pcb_coord_t) total_wire_length, total_via_count); DestroyRouteData(&rd); if (changed) { - SaveUndoSerialNumber(); + pcb_undo_save_serial(); /* optimize rats, we've changed connectivity a lot. */ pcb_rats_destroy(pcb_false /*all rats */ ); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); pcb_rat_add_all(pcb_false /*all rats */ , NULL); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_redraw(); } Index: trunk/src_plugins/distalign/distalign.c =================================================================== --- trunk/src_plugins/distalign/distalign.c (revision 5021) +++ trunk/src_plugins/distalign/distalign.c (revision 5022) @@ -437,7 +437,7 @@ } END_LOOP; if (changed) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_redraw(); pcb_board_set_changed_flag(1); } @@ -609,7 +609,7 @@ } } if (changed) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_redraw(); pcb_board_set_changed_flag(1); } Index: trunk/src_plugins/distaligntext/distaligntext.c =================================================================== --- trunk/src_plugins/distaligntext/distaligntext.c (revision 5021) +++ trunk/src_plugins/distaligntext/distaligntext.c (revision 5022) @@ -353,7 +353,7 @@ default: PCB_AFAIL(aligntext); } - SaveUndoSerialNumber(); + pcb_undo_save_serial(); /* find the final alignment coordinate using the above options */ q = reference_coord(K_aligntext, Crosshair.X, Crosshair.Y, dir, point, reference); /* move all selected elements to the new coordinate */ @@ -414,8 +414,8 @@ } ENDALL_LOOP; if (changed) { - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); pcb_redraw(); pcb_board_set_changed_flag(pcb_true); } @@ -529,7 +529,7 @@ default: PCB_AFAIL(distributetext); } - SaveUndoSerialNumber(); + pcb_undo_save_serial(); /* build list of texts in orthogonal axis order */ sort_texts_by_pos(K_distributetext, dir, point); /* find the endpoints given the above options */ @@ -605,8 +605,8 @@ } } if (changed) { - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); pcb_redraw(); pcb_board_set_changed_flag(pcb_true); } Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 5021) +++ trunk/src_plugins/djopt/djopt.c (revision 5022) @@ -2603,7 +2603,7 @@ if (PCB_NSTRCMP(arg, "splitlines") == 0) { if (canonicalize_lines()) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return 0; } @@ -2673,7 +2673,7 @@ check(0, 0); if (saved) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return 0; } Index: trunk/src_plugins/hid_gtk/gui-drc-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-drc-window.c (revision 5021) +++ trunk/src_plugins/hid_gtk/gui-drc-window.c (revision 5022) @@ -167,7 +167,7 @@ if (change) { pcb_board_set_changed_flag(pcb_true); if (AndDraw) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } } @@ -219,7 +219,7 @@ pcb_draw_obj(object_type, ptr1, ptr2); } pcb_board_set_changed_flag(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } Index: trunk/src_plugins/hid_gtk/gui-netlist-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 5021) +++ trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 5022) @@ -259,7 +259,7 @@ /* Now just toggle a select of the node on the layout */ toggle_pin_selected(node); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); /* And lead the user to the location */ if (pcb_rat_seek_pad(node, &conn, pcb_false)) @@ -509,7 +509,7 @@ pcb_select_connection(select_flag); pcb_reset_conns(pcb_false); pcb_conn_lookup_uninit(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } Index: trunk/src_plugins/hid_lesstif/netlist.c =================================================================== --- trunk/src_plugins/hid_lesstif/netlist.c (revision 5021) +++ trunk/src_plugins/hid_lesstif/netlist.c (revision 5022) @@ -125,7 +125,7 @@ pcb_select_connection(select_flag); pcb_reset_conns(pcb_false); pcb_conn_lookup_uninit(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); } Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 5021) +++ trunk/src_plugins/jostle/jostle.c (revision 5022) @@ -536,7 +536,7 @@ } } while (found); pcb_board_set_changed_flag(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return 0; } Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 5021) +++ trunk/src_plugins/polycombine/polycombine.c (revision 5022) @@ -314,7 +314,7 @@ /* Now perform a traversal of the tree, computing a polygon */ res = compute_polygon_recursive(root, NULL); - SaveUndoSerialNumber(); + pcb_undo_save_serial(); /* Second pass to remove the input polygons */ PCB_POLY_VISIBLE_LOOP(PCB->Data); @@ -332,8 +332,8 @@ /* Now de-construct the resulting polygon into raw PCB polygons */ pcb_poly_to_polygons_on_layer(PCB->Data, Layer, res, pcb_strflg_board_s2f("clearpoly", NULL)); - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); pcb_draw(); return 0; Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 5021) +++ trunk/src_plugins/propedit/propsel.c (revision 5022) @@ -214,7 +214,7 @@ #define set_chk_skip(ctx, obj) \ if (!PCB_FLAG_TEST(PCB_FLAG_SELECTED, obj)) return; -#define DONE { st->set_cnt++; RestoreUndoSerialNumber(); return; } +#define DONE { st->set_cnt++; pcb_undo_restore_serial(); return; } static void set_line_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line) { @@ -449,7 +449,7 @@ ctx.d_absolute = ((*start != '-') && (*start != '+')); ctx.set_cnt = 0; - SaveUndoSerialNumber(); + pcb_undo_save_serial(); pcb_loop_all(&ctx, NULL, @@ -465,7 +465,7 @@ MAYBE_PROP(0, "p/pad/", set_epad_cb), MAYBE_PROP(0, "p/via/", set_via_cb) ); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return ctx.set_cnt; } Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 5021) +++ trunk/src_plugins/puller/puller.c (revision 5022) @@ -474,7 +474,7 @@ pcb_move_obj(PCB_TYPE_LINE_POINT, CURRENT, the_line, &(the_line->Point2), x - the_line->Point2.X, y - the_line->Point2.Y); gui->invalidate_all(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return 1; } @@ -2176,7 +2176,7 @@ return; } printf("\n\033[33mRECURSING\033[0m\n\n"); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); #endif maybe_pull_1(new_line); } @@ -2329,7 +2329,7 @@ maybe_pull(line, e); #if TRACE0 if (did_something != old_did_something) { - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); old_did_something = did_something; if (gui->confirm_dialog("more?", 0) == 0) { did_something = 0; @@ -2369,7 +2369,7 @@ g_hash_table_unref(lines); g_hash_table_unref(arcs); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return 0; } Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 5021) +++ trunk/src_plugins/renumber/renumber.c (revision 5022) @@ -342,7 +342,7 @@ } pcb_netlist_changed(0); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_board_set_changed_flag(pcb_true); } Index: trunk/src_plugins/renumber/renumberblock.c =================================================================== --- trunk/src_plugins/renumber/renumberblock.c (revision 5021) +++ trunk/src_plugins/renumber/renumberblock.c (revision 5022) @@ -75,7 +75,7 @@ pcb_chg_obj_name(PCB_TYPE_ELEMENT, element, NULL, NULL, new_ref); } END_LOOP; - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return 0; } Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 5021) +++ trunk/src_plugins/report/report.c (revision 5022) @@ -555,12 +555,12 @@ * to the state the board was in when we started this function. * * After this, we don't add any changes to the undo system, but - * ensure we get back to a point where we can Undo() our changes + * ensure we get back to a point where we can pcb_undo() our changes * by resetting the connections with pcb_reset_conns() before - * calling Undo() at the end of the procedure. + * calling pcb_undo() at the end of the procedure. */ pcb_reset_conns(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); for (ni = 0; ni < PCB->NetlistLib[NETLIST_EDITED].MenuN; ni++) { const char *netname = PCB->NetlistLib[NETLIST_EDITED].Menu[ni].Name + 2; @@ -624,7 +624,7 @@ } pcb_reset_conns(pcb_false); - Undo(pcb_true); + pcb_undo(pcb_true); return 0; } @@ -640,18 +640,18 @@ * to the state the board was in when we started this function. * * After this, we don't add any changes to the undo system, but - * ensure we get back to a point where we can Undo() our changes + * ensure we get back to a point where we can pcb_undo() our changes * by resetting the connections with pcb_reset_conns() before - * calling Undo() at the end of the procedure. + * calling pcb_undo() at the end of the procedure. */ pcb_reset_conns(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); length = XYtoNetLength(x, y, &found); if (!found) { pcb_reset_conns(pcb_false); - Undo(pcb_true); + pcb_undo(pcb_true); gui->log("No net under cursor.\n"); return 1; } @@ -705,7 +705,7 @@ got_net_name: pcb_reset_conns(pcb_false); - Undo(pcb_true); + pcb_undo(pcb_true); { char buf[50]; @@ -794,18 +794,18 @@ * to the state the board was in when we started. * * After this, we don't add any changes to the undo system, but - * ensure we get back to a point where we can Undo() our changes + * ensure we get back to a point where we can pcb_undo() our changes * by resetting the connections with pcb_reset_conns() before - * calling Undo() when we are finished. + * calling pcb_undo() when we are finished. */ pcb_reset_conns(pcb_true); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); length = XYtoNetLength(x, y, &found); netname = net->Name + 2; pcb_reset_conns(pcb_false); - Undo(pcb_true); + pcb_undo(pcb_true); if (!found) { if (net_found) Index: trunk/src_plugins/smartdisperse/smartdisperse.c =================================================================== --- trunk/src_plugins/smartdisperse/smartdisperse.c (revision 5021) +++ trunk/src_plugins/smartdisperse/smartdisperse.c (revision 5022) @@ -255,7 +255,7 @@ htpi_uninit(&visited); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_redraw(); pcb_board_set_changed_flag(1); Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 5021) +++ trunk/src_plugins/stroke/stroke.c (revision 5022) @@ -86,7 +86,7 @@ case 147423: case 147523: case 1474123: - Redo(pcb_true); + pcb_redo(pcb_true); break; case 148963: case 147863: Index: trunk/src_plugins/teardrops/teardrops.c =================================================================== --- trunk/src_plugins/teardrops/teardrops.c (revision 5021) +++ trunk/src_plugins/teardrops/teardrops.c (revision 5022) @@ -303,7 +303,7 @@ gui->invalidate_all(); if (new_arcs) - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); return 0; } Index: trunk/src_plugins/toporouter/toporouter.c =================================================================== --- trunk/src_plugins/toporouter/toporouter.c (revision 5021) +++ trunk/src_plugins/toporouter/toporouter.c (revision 5022) @@ -8123,12 +8123,12 @@ toporouter_export(r); toporouter_free(r); - SaveUndoSerialNumber(); + pcb_undo_save_serial(); pcb_rats_destroy(pcb_false); - RestoreUndoSerialNumber(); + pcb_undo_restore_serial(); pcb_rat_add_all(pcb_false, NULL); - RestoreUndoSerialNumber(); - IncrementUndoSerialNumber(); + pcb_undo_restore_serial(); + pcb_undo_inc_serial(); pcb_redraw(); return 0; @@ -8220,7 +8220,7 @@ END_LOOP; END_LOOP; - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); pcb_draw(); return 0; } Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 5021) +++ trunk/src_plugins/vendordrill/vendor.c (revision 5022) @@ -409,7 +409,7 @@ if (changed) { pcb_board_set_changed_flag(pcb_true); pcb_redraw(); - IncrementUndoSerialNumber(); + pcb_undo_inc_serial(); } }