pcb 4.1.1
An interactive printed circuit board layout editor.
|
Prototypes for undo routines. More...
#include "global.h"
Go to the source code of this file.
Defines | |
#define | DRAW_FLAGS |
Functions | |
int | Undo (bool) |
int | Redo (bool) |
Redo of any 'hard to recover' operation. | |
void | IncrementUndoSerialNumber (void) |
Increments the serial number of the undo list. | |
void | SaveUndoSerialNumber (void) |
Saves the serial number of the undo list. | |
void | RestoreUndoSerialNumber (void) |
Restores the serial number of the undo list. | |
void | ClearUndoList (bool) |
Releases memory of the undo- and remove list. | |
void | MoveObjectToRemoveUndoList (int, void *, void *, void *) |
Adds an object to the list of removed objects and removes it from the current PCB. | |
void | AddObjectToRemovePointUndoList (int, void *, void *, Cardinal) |
Adds an object to the list of removed polygon/... points. | |
void | AddObjectToInsertPointUndoList (int, void *, void *, void *) |
Adds an object to the list of inserted polygon/... points. | |
void | AddObjectToRemoveContourUndoList (int, LayerType *, PolygonType *) |
Adds an object to the list of removed contours. | |
void | AddObjectToInsertContourUndoList (int, LayerType *, PolygonType *) |
Adds an object to the list of insert contours. | |
void | AddObjectToMoveUndoList (int, void *, void *, void *, Coord, Coord) |
Adds an object to the list of moved objects. | |
void | AddObjectToChangeNameUndoList (int, void *, void *, void *, char *) |
Adds an object to the list of objects with changed names. | |
void | AddObjectToRotateUndoList (int, void *, void *, void *, Coord, Coord, BYTE) |
Adds an object to the list of rotated objects. | |
void | AddObjectToCreateUndoList (int, void *, void *, void *) |
Adds an object to the list of created objects. | |
void | AddObjectToMirrorUndoList (int, void *, void *, void *, Coord) |
Adds an object to the list of mirrored objects. | |
void | AddObjectToMoveToLayerUndoList (int, void *, void *, void *) |
Adds an object to the list of objects moved to another layer. | |
void | AddObjectToFlagUndoList (int, void *, void *, void *) |
Adds an object to the list of objects with flags changed. | |
void | AddObjectToSizeUndoList (int, void *, void *, void *) |
Adds an object to the list of objects with Size changes. | |
void | AddObjectTo2ndSizeUndoList (int, void *, void *, void *) |
Adds an object to the list of objects with 2ndSize changes. | |
void | AddObjectToClearSizeUndoList (int, void *, void *, void *) |
Adds an object to the list of objects with Size changes. | |
void | AddObjectToMaskSizeUndoList (int, void *, void *, void *) |
Adds an object to the list of objects with Size changes. | |
void | AddObjectToChangeAnglesUndoList (int, void *, void *, void *) |
Adds an object to the list of changed angles. | |
void | AddObjectToClearPolyUndoList (int, void *, void *, void *, bool) |
Adds an object to the list of clearpoly objects. | |
void | AddObjectToSetViaLayersUndoList (void *ptr1, void *ptr2, void *ptr3) |
void | AddLayerChangeToUndoList (int, int) |
Adds a layer change (new, delete, move) to the undo list. | |
void | AddNetlistLibToUndoList (LibraryType *) |
Adds a netlist change to the undo list. | |
void | LockUndo (void) |
void | UnlockUndo (void) |
Reset lock flag. | |
bool | Undoing (void) |
Return undo lock state. |
Prototypes for undo routines.
PCB, interactive printed circuit board design
Copyright (C) 1994,1995,1996 Thomas Nau
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact addresses for paper mail and Email:
Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
Definition in file undo.h.
#define DRAW_FLAGS |
(RATFLAG | SELECTEDFLAG | SQUAREFLAG | \ HIDENAMEFLAG | HOLEFLAG | OCTAGONFLAG | \ CONNECTEDFLAG | FOUNDFLAG | CLEARLINEFLAG)
Definition at line 40 of file undo.h.
Referenced by UndoFlag().
void AddLayerChangeToUndoList | ( | int | , |
int | |||
) |
Adds a layer change (new, delete, move) to the undo list.
Definition at line 1771 of file undo.c.
References UndoListType::Data, GetUndoSlot(), UndoListType::LayerChange, Locked, LayerChangeType::new_index, LayerChangeType::old_index, and UNDO_LAYERCHANGE.
Referenced by MoveLayer().
void AddNetlistLibToUndoList | ( | LibraryType * | ) |
Adds a netlist change to the undo list.
Definition at line 1787 of file undo.c.
References __FUNCTION__, LibraryEntryType::AllocatedMemory, UndoListType::Data, LibraryEntryType::Description, LibraryMenuType::directory, LibraryMenuType::Entry, LibraryMenuType::EntryMax, LibraryMenuType::EntryN, GetUndoSlot(), NetlistChangeType::lib, LibraryEntryType::ListEntry, Locked, malloc(), LibraryType::Menu, LibraryType::MenuMax, LibraryType::MenuN, LibraryMenuType::Name, UndoListType::NetlistChange, NetlistChangeType::old, LibraryEntryType::Package, LibraryMenuType::Style, LibraryEntryType::Template, UNDO_NETLISTCHANGE, and LibraryEntryType::Value.
Referenced by ActionRenumber().
void AddObjectTo2ndSizeUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of objects with 2ndSize changes.
Definition at line 1735 of file undo.c.
References UndoListType::Data, GetUndoSlot(), Locked, OBJECT_ID, UndoListType::Size, and UNDO_CHANGE2NDSIZE.
Referenced by ChangeElement2ndSize(), ChangePin2ndSize(), and ChangeVia2ndSize().
void AddObjectToChangeAnglesUndoList | ( | int | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
Adds an object to the list of changed angles.
Definition at line 1754 of file undo.c.
References UndoListType::Data, ArcType::Delta, MoveType::DX, MoveType::DY, GetUndoSlot(), Locked, UndoListType::Move, OBJECT_ID, ArcType::StartAngle, and UNDO_CHANGEANGLES.
Referenced by ChangeArcAngles().
void AddObjectToChangeNameUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | , | ||
char * | |||
) |
Adds an object to the list of objects with changed names.
Definition at line 1587 of file undo.c.
References UndoListType::ChangeName, UndoListType::Data, GetUndoSlot(), Locked, ChangeNameType::Name, OBJECT_ID, and UNDO_CHANGENAME.
Referenced by ActionChangePinName(), ActionRenumber(), QueryInputAndChangeObjectName(), and renumber_block().
void AddObjectToClearPolyUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | , | ||
bool | |||
) |
Adds an object to the list of clearpoly objects.
Definition at line 1405 of file undo.c.
References ClearPolyType::Clear, UndoListType::ClearPoly, UndoListType::Data, GetUndoSlot(), ClearPolyType::Layer, Locked, OBJECT_ID, and UNDO_CLEAR.
Referenced by ChangeArcJoin(), ChangeLineJoin(), ChangePadSquare(), ChangePinOctagon(), ChangePinSquare(), ChangePinThermal(), ChangePolyClear(), ChangeTextJoin(), ChangeViaOctagon(), ChangeViaThermal(), and IronDownAllUnfixedPaths().
void AddObjectToClearSizeUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of objects with Size changes.
Definition at line 1681 of file undo.c.
References UndoListType::Data, GetUndoSlot(), Locked, OBJECT_ID, UndoListType::Size, and UNDO_CHANGECLEARSIZE.
Referenced by ChangeArcClearSize(), ChangeLineClearSize(), ChangePadClearSize(), ChangePinClearSize(), and ChangeViaClearSize().
void AddObjectToCreateUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of created objects.
Definition at line 1619 of file undo.c.
References ClearFromPolygon(), PCBType::Data, GetUndoSlot(), Locked, OBJECT_ID, PCB, and UNDO_CREATE.
Referenced by check_line_callback(), CopyArc(), CopyAttachedPolygonToLayer(), CopyElement(), CopyLine(), CopyPolygon(), CopyText(), CopyVia(), create_arc(), create_line(), create_pcb_line(), DrawShortestRats(), escape(), export_pcb_drawarc(), export_pcb_drawline(), InsertPointIntoLine(), InsertPointIntoRat(), IronDownAllUnfixedPaths(), MorphPolygon(), moveline_callback(), MoveRatToLayer(), NotifyMode(), and PolyToPolygonsOnLayer().
void AddObjectToFlagUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of objects with flags changed.
Definition at line 1630 of file undo.c.
References UndoListType::Data, UndoListType::Flags, GetUndoSlot(), Locked, OBJECT_ID, and UNDO_FLAG.
Referenced by ActionAddRats(), ActionDisplay(), ActionToggleHideName(), add_object_to_list(), AutoRoute(), ChangeArcJoin(), ChangeHole(), ChangeLineJoin(), ChangePadSquare(), ChangePaste(), ChangePinOctagon(), ChangePinSquare(), ChangePinThermal(), ChangePolyClear(), ChangeTextJoin(), ChangeViaOctagon(), ChangeViaThermal(), ClearFlagOnLinesAndPolygons(), ClearFlagOnPinsViasAndPads(), drc_callback(), DRCAll(), IronDownAllUnfixedPaths(), mptl_pin_callback(), SelectBlock(), SelectBuriedVias(), SelectByFlag(), SelectedOperation(), selection_changed_cb(), SelectObject(), and toggle_pin_selected().
void AddObjectToInsertContourUndoList | ( | int | Type, |
LayerType * | Layer, | ||
PolygonType * | Polygon | ||
) |
Adds an object to the list of insert contours.
Actually just takes a copy of the whole polygon to restore.
Definition at line 1560 of file undo.c.
References CopyObjectToUndoList(), and UNDO_INSERT_CONTOUR.
void AddObjectToInsertPointUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of inserted polygon/... points.
Definition at line 1519 of file undo.c.
References GetUndoSlot(), Locked, OBJECT_ID, and UNDO_INSERT_POINT.
Referenced by InsertPointIntoPolygon().
void AddObjectToMaskSizeUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of objects with Size changes.
Definition at line 1711 of file undo.c.
References UndoListType::Data, GetUndoSlot(), Locked, OBJECT_ID, UndoListType::Size, and UNDO_CHANGEMASKSIZE.
Referenced by ChangeHole(), ChangePadMaskSize(), ChangePadSize(), ChangePinMaskSize(), ChangePinSize(), ChangeViaMaskSize(), and ChangeViaSize().
void AddObjectToMirrorUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | , | ||
Coord | |||
) |
Adds an object to the list of mirrored objects.
Definition at line 1422 of file undo.c.
References UndoListType::Data, MoveType::DY, GetUndoSlot(), Locked, UndoListType::Move, OBJECT_ID, and UNDO_MIRROR.
Referenced by ChangeElementSide().
void AddObjectToMoveToLayerUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of objects moved to another layer.
Definition at line 1603 of file undo.c.
References PCBType::Data, UndoListType::Data, GetLayerNumber(), GetUndoSlot(), Locked, UndoListType::MoveToLayer, OBJECT_ID, MoveToLayerType::OriginalLayer, PCB, and UNDO_MOVETOLAYER.
Referenced by MoveArcToLayer(), MoveLineToLayer(), MovePolygonToLayer(), and MoveTextToLayer().
Adds an object to the list of moved objects.
Definition at line 1570 of file undo.c.
References UndoListType::Data, MoveType::DX, MoveType::DY, GetUndoSlot(), Locked, UndoListType::Move, OBJECT_ID, and UNDO_MOVE.
Referenced by ActionDisperseElements(), InsertPointIntoLine(), MoveObject(), MoveObjectAndRubberband(), place(), and relocate().
void AddObjectToRemoveContourUndoList | ( | int | Type, |
LayerType * | Layer, | ||
PolygonType * | Polygon | ||
) |
Adds an object to the list of removed contours.
Actually just takes a copy of the whole polygon to restore.
Definition at line 1548 of file undo.c.
References CopyObjectToUndoList(), and UNDO_REMOVE_CONTOUR.
Referenced by RemovePolygonContour().
void AddObjectToRemovePointUndoList | ( | int | , |
void * | , | ||
void * | , | ||
Cardinal | |||
) |
Adds an object to the list of removed polygon/... points.
Definition at line 1474 of file undo.c.
References UndoListType::Data, GetUndoSlot(), polygon_st::HoleIndex, polygon_st::HoleIndexN, PointType::ID, RemovedPointType::ID, RemovedPointType::Index, RemovedPointType::last_in_contour, Locked, OBJECT_ID, polygon_st::PointN, polygon_st::Points, UndoListType::RemovedPoint, UNDO_REMOVE_POINT, PointType::X, RemovedPointType::X, PointType::Y, and RemovedPointType::Y.
Referenced by RemovePolygonPoint().
Adds an object to the list of rotated objects.
Definition at line 1438 of file undo.c.
References CenterX, RotateType::CenterX, CenterY, RotateType::CenterY, UndoListType::Data, GetUndoSlot(), Locked, OBJECT_ID, UndoListType::Rotate, RotateType::Steps, and UNDO_ROTATE.
Referenced by RotateObject().
void AddObjectToSetViaLayersUndoList | ( | void * | ptr1, |
void * | ptr2, | ||
void * | ptr3 | ||
) |
Definition at line 1879 of file undo.c.
References UndoListType::Data, SetViaLayersChangeType::from, GetUndoSlot(), Locked, OBJECT_ID, UndoListType::SetViaLayersChange, SetViaLayersChangeType::to, and UNDO_CHANGESETVIALAYERS.
Referenced by ChangeBuriedViasAfterLayerCreate(), ChangeBuriedViasAfterLayerDelete(), ChangeBuriedViasAfterLayerMove(), ChangeObjectViaLayers(), and ChangeSelectedViaLayers().
void AddObjectToSizeUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of objects with Size changes.
Definition at line 1645 of file undo.c.
References UndoListType::Data, GetUndoSlot(), Locked, OBJECT_ID, UndoListType::Scale, UndoListType::Size, and UNDO_CHANGESIZE.
Referenced by ChangeArcSize(), ChangeElement2ndSize(), ChangeElementNameSize(), ChangeElementSize(), ChangeLineSize(), ChangePadSize(), ChangePin2ndSize(), ChangePinSize(), ChangeTextSize(), ChangeVia2ndSize(), and ChangeViaSize().
void ClearUndoList | ( | bool | ) |
Releases memory of the undo- and remove list.
Definition at line 1371 of file undo.c.
References UndoListType::ChangeName, hid_st::confirm_dialog, UndoListType::Data, FreeDataMemory(), gui, ChangeNameType::Name, RedoN, Serial, UndoListType::Type, UNDO_CHANGENAME, UndoMax, and UndoN.
Referenced by ActionUndo(), and RemovePCB().
void IncrementUndoSerialNumber | ( | void | ) |
Increments the serial number of the undo list.
It's not done automatically because some operations perform more than one request with the same serial #.
Definition at line 1354 of file undo.c.
References between_increment_and_restore, Bumped, Locked, Serial, SetChangedFlag(), and UndoN.
Referenced by ActionAtomic(), ActionChangeHole(), ActionChangeName(), ActionChangePaste(), ActionChangePinName(), ActionConnection(), ActionDisperseElements(), ActionDisplay(), ActionDJopt(), ActionExecuteFile(), ActionFlip(), ActionMinClearGap(), ActionMinMaskGap(), ActionMorphPolygon(), ActionRenumber(), ActionRipUp(), ActionSelect(), ActionSetThermal(), ActionToggleHideName(), ActionUnselect(), AddAllRats(), apply_vendor_map(), AutoRoute(), ChangeObject2ndSize(), ChangeObjectClearSize(), ChangeObjectJoin(), ChangeObjectMaskSize(), ChangeObjectOctagon(), ChangeObjectSize(), ChangeObjectSquare(), ChangeObjectThermal(), ChangeObjectViaLayers(), ChangeSelected2ndSize(), ChangeSelectedClearSize(), ChangeSelectedElementSide(), ChangeSelectedHole(), ChangeSelectedJoin(), ChangeSelectedOctagon(), ChangeSelectedPaste(), ChangeSelectedSize(), ChangeSelectedSquare(), ChangeSelectedThermals(), ChangeSelectedViaLayers(), ClrObjectJoin(), ClrObjectOctagon(), ClrObjectSquare(), ClrSelectedJoin(), ClrSelectedOctagon(), ClrSelectedSquare(), CopyAttachedPolygonToLayer(), CopyObject(), CopyPastebufferToLayout(), DeleteRats(), drc_callback(), DRCAll(), DRCFind(), escape(), GlobalPuller(), InsertPointIntoObject(), LookupConnection(), LookupElementConnections(), LookupUnusedPins(), maybe_pull_1(), MorphPolygon(), MoveLayer(), MoveObjectAndRubberband(), MoveObjectToLayer(), nbcb_select_common(), netlist_select_cb(), node_selection_changed_cb(), NotifyMode(), Puller(), QueryInputAndChangeObjectName(), ReleaseMode(), relocate(), RemoveSelected(), renumber_block(), ReportAllNetLengths(), ReportNetLength(), ReportNetLengthByName(), RotateObject(), SelectBlock(), SelectedOperation(), selection_changed_cb(), SelectObject(), SetMode(), SetObjectJoin(), SetObjectOctagon(), SetObjectSquare(), SetSelectedJoin(), SetSelectedOctagon(), SetSelectedSquare(), smartdisperse(), teardrops(), and toporouter().
void LockUndo | ( | void | ) |
void MoveObjectToRemoveUndoList | ( | int | , |
void * | , | ||
void * | , | ||
void * | |||
) |
Adds an object to the list of removed objects and removes it from the current PCB.
Definition at line 1458 of file undo.c.
References CreateNewBuffer(), PCBType::Data, GetUndoSlot(), Locked, MoveObjectToBuffer(), OBJECT_ID, PCB, and UNDO_REMOVE.
Referenced by ActionChangeName(), ActionRipUp(), CreateDrawnLineOnLayer(), InsertPointIntoRat(), MoveRatToLayer(), NotifyMode(), RemoveArc(), RemoveElement(), RemoveLine(), RemovePolygon(), RemoveRat(), RemoveText(), and RemoveVia().
int Redo | ( | bool | draw | ) |
Redo of any 'hard to recover' operation.
Definition at line 1264 of file undo.c.
References _, andDraw, Draw(), LockUndo(), Message(), PerformUndo(), ptr, RedoN, Serial, UndoListType::Serial, UndoN, and UnlockUndo().
Referenced by ActionRedo(), and FinishStroke().
void RestoreUndoSerialNumber | ( | void | ) |
Restores the serial number of the undo list.
Definition at line 1326 of file undo.c.
References _, added_undo_between_increment_and_restore, between_increment_and_restore, Message(), SavedSerial, and Serial.
Referenced by ActionAtomic(), ActionChangeName(), ActionMinClearGap(), ActionMinMaskGap(), ActionRipUp(), ActionSelect(), AutoRoute(), NotifyMode(), ReleaseMode(), and toporouter().
void SaveUndoSerialNumber | ( | void | ) |
Saves the serial number of the undo list.
Definition at line 1339 of file undo.c.
References added_undo_between_increment_and_restore, between_increment_and_restore, Bumped, SavedSerial, and Serial.
Referenced by ActionAtomic(), ActionChangeName(), ActionMinClearGap(), ActionMinMaskGap(), ActionRipUp(), ActionSelect(), AutoRoute(), click_cb(), NotifyMode(), ReleaseMode(), and toporouter().
int Undo | ( | bool | ) |
Definition at line 1073 of file undo.c.
References _, andDraw, CLEAR_FLAG, Draw(), LockUndo(), Message(), PCB, PerformUndo(), ptr, RedoN, UndoListType::Serial, Serial, SET_FLAG, TEST_FLAG, UndoN, and UnlockUndo().
Referenced by ActionUndo(), drc_callback(), DRCAll(), DRCFind(), ReportAllNetLengths(), ReportNetLength(), and ReportNetLengthByName().
bool Undoing | ( | void | ) |
Return undo lock state.
Definition at line 1914 of file undo.c.
References Locked.
Referenced by MoveLayer(), and RemoveExcessPolygonPoints().