pcb 4.1.1
An interactive printed circuit board layout editor.
|
Functions used to undo operations. More...
#include <assert.h>
#include <memory.h>
#include "global.h"
#include "buffer.h"
#include "change.h"
#include "create.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "insert.h"
#include "misc.h"
#include "mirror.h"
#include "move.h"
#include "mymem.h"
#include "polygon.h"
#include "remove.h"
#include "rotate.h"
#include "rtree.h"
#include "search.h"
#include "set.h"
#include "undo.h"
#include "strflags.h"
Go to the source code of this file.
Data Structures | |
struct | ChangeNameType |
Information about a change command. More... | |
struct | MoveType |
Information about a move command. More... | |
struct | RemovedPointType |
Information about removed polygon points. More... | |
struct | RotateType |
Information about rotation. More... | |
struct | MoveToLayerType |
Information about moves between layers. More... | |
struct | LayerChangeType |
Information about layer changes. More... | |
struct | SetViaLayersChangeType |
Information about layer changes. More... | |
struct | ClearPolyType |
Information about poly clear/restore. More... | |
struct | NetlistChangeType |
Information about netlist lib changes. More... | |
struct | UndoListType |
Holds information about an operation. More... | |
Functions | |
static UndoListType * | GetUndoSlot (int CommandType, int ID, int Kind) |
Adds a command plus some data to the undo list. | |
static void | DrawRecoveredObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Redraws the recovered object. | |
static bool | UndoRotate (UndoListType *Entry) |
Recovers an object from a 'rotate' operation. | |
static bool | UndoChangeName (UndoListType *Entry) |
Recovers an object from a 'change name' operation. | |
static bool | UndoCopyOrCreate (UndoListType *Entry) |
Recovers an object from a 'copy' or 'create' operation. | |
static bool | UndoMove (UndoListType *Entry) |
Recovers an object from a 'move' operation. | |
static bool | UndoRemove (UndoListType *Entry) |
Recovers an object from a 'remove' operation. | |
static bool | UndoRemovePoint (UndoListType *Entry) |
Recovers a removed polygon point. | |
static bool | UndoInsertPoint (UndoListType *Entry) |
Recovers an inserted polygon point. | |
static bool | UndoRemoveContour (UndoListType *Entry) |
Recovers an removed polygon point. | |
static bool | UndoInsertContour (UndoListType *Entry) |
Recovers an inserted polygon point. | |
static bool | UndoMoveToLayer (UndoListType *Entry) |
Recovers an object from a 'move to another layer' operation. | |
static bool | UndoFlag (UndoListType *Entry) |
Recovers an object from a FLAG change operation. | |
static bool | UndoMirror (UndoListType *Entry) |
Recovers an object from a mirror operation. | |
static bool | UndoChangeSize (UndoListType *Entry) |
Recovers an object from a Size change operation. | |
static bool | UndoChange2ndSize (UndoListType *Entry) |
Recovers an object from a 2ndSize change operation. | |
static bool | UndoChangeAngles (UndoListType *Entry) |
Recovers an object from a ChangeAngles change operation. | |
static bool | UndoChangeClearSize (UndoListType *Entry) |
Recovers an object from a clearance size change operation. | |
static bool | UndoChangeMaskSize (UndoListType *Entry) |
Recovers an object from a mask size change operation. | |
static bool | UndoClearPoly (UndoListType *Entry) |
Recovers an object from a clear/restore poly operation. | |
static bool | UndoSetViaLayers (UndoListType *) |
static int | PerformUndo (UndoListType *) |
static bool | UndoSwapCopiedObject (UndoListType *Entry) |
static bool | UndoLayerChange (UndoListType *Entry) |
Undo a layer change. | |
static bool | UndoNetlistChange (UndoListType *Entry) |
Undo a netlist change. | |
int | Undo (bool draw) |
int | Redo (bool draw) |
Redo of any 'hard to recover' operation. | |
void | RestoreUndoSerialNumber (void) |
Restores the serial number of the undo list. | |
void | SaveUndoSerialNumber (void) |
Saves the serial number of the undo list. | |
void | IncrementUndoSerialNumber (void) |
Increments the serial number of the undo list. | |
void | ClearUndoList (bool Force) |
Releases memory of the undo- and remove list. | |
void | AddObjectToClearPolyUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3, bool clear) |
Adds an object to the list of clearpoly objects. | |
void | AddObjectToMirrorUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord yoff) |
Adds an object to the list of mirrored objects. | |
void | AddObjectToRotateUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord CenterX, Coord CenterY, BYTE Steps) |
Adds an object to the list of rotated objects. | |
void | MoveObjectToRemoveUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Adds an object to the list of removed objects and removes it from the current PCB. | |
void | AddObjectToRemovePointUndoList (int Type, void *Ptr1, void *Ptr2, Cardinal index) |
Adds an object to the list of removed polygon/... points. | |
void | AddObjectToInsertPointUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Adds an object to the list of inserted polygon/... points. | |
static void | CopyObjectToUndoList (int undo_type, int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
void | AddObjectToRemoveContourUndoList (int Type, LayerType *Layer, PolygonType *Polygon) |
Adds an object to the list of removed contours. | |
void | AddObjectToInsertContourUndoList (int Type, LayerType *Layer, PolygonType *Polygon) |
Adds an object to the list of insert contours. | |
void | AddObjectToMoveUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) |
Adds an object to the list of moved objects. | |
void | AddObjectToChangeNameUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *OldName) |
Adds an object to the list of objects with changed names. | |
void | AddObjectToMoveToLayerUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Adds an object to the list of objects moved to another layer. | |
void | AddObjectToCreateUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Adds an object to the list of created objects. | |
void | AddObjectToFlagUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Adds an object to the list of objects with flags changed. | |
void | AddObjectToSizeUndoList (int Type, void *ptr1, void *ptr2, void *ptr3) |
Adds an object to the list of objects with Size changes. | |
void | AddObjectToClearSizeUndoList (int Type, void *ptr1, void *ptr2, void *ptr3) |
Adds an object to the list of objects with Size changes. | |
void | AddObjectToMaskSizeUndoList (int Type, void *ptr1, void *ptr2, void *ptr3) |
Adds an object to the list of objects with Size changes. | |
void | AddObjectTo2ndSizeUndoList (int Type, void *ptr1, void *ptr2, void *ptr3) |
Adds an object to the list of objects with 2ndSize changes. | |
void | AddObjectToChangeAnglesUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Adds an object to the list of changed angles. | |
void | AddLayerChangeToUndoList (int old_index, int new_index) |
Adds a layer change (new, delete, move) to the undo list. | |
void | AddNetlistLibToUndoList (LibraryType *lib) |
Adds a netlist change to the undo list. | |
void | AddObjectToSetViaLayersUndoList (void *ptr1, void *ptr2, void *ptr3) |
void | LockUndo (void) |
void | UnlockUndo (void) |
Reset lock flag. | |
bool | Undoing (void) |
Return undo lock state. | |
Variables | |
static bool | between_increment_and_restore = false |
static bool | added_undo_between_increment_and_restore = false |
static DataType * | RemoveList = NULL |
static UndoListType * | UndoList = NULL |
static int | Serial = 1 |
static int | SavedSerial |
static size_t | UndoN |
static size_t | RedoN |
static size_t | UndoMax |
static bool | Locked = false |
static bool | andDraw = true |
Functions used to undo operations.
Description:
There are two lists which hold:
Both lists are organized as first-in-last-out which means that the undo list can always use the last entry of the remove list.
A serial number is incremented whenever an operation is completed.
An operation itself may consist of several basic instructions.
E.g.: removing all selected objects is one operation with exactly one serial number even if the remove function is called several times.
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.c.
void AddLayerChangeToUndoList | ( | int | old_index, |
int | new_index | ||
) |
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 * | lib | ) |
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 | Type, |
void * | ptr1, | ||
void * | ptr2, | ||
void * | ptr3 | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3, | ||
char * | OldName | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3, | ||
bool | clear | ||
) |
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 | Type, |
void * | ptr1, | ||
void * | ptr2, | ||
void * | ptr3 | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
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 | Type, |
void * | ptr1, | ||
void * | ptr2, | ||
void * | ptr3 | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3, | ||
Coord | yoff | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
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().
void AddObjectToMoveUndoList | ( | int | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3, | ||
Coord | DX, | ||
Coord | DY | ||
) |
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
Cardinal | index | ||
) |
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().
void AddObjectToRotateUndoList | ( | int | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3, | ||
Coord | CenterX, | ||
Coord | CenterY, | ||
BYTE | Steps | ||
) |
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 | Type, |
void * | ptr1, | ||
void * | ptr2, | ||
void * | ptr3 | ||
) |
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 | Force | ) |
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().
static void CopyObjectToUndoList | ( | int | undo_type, |
int | Type, | ||
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) | [static] |
Definition at line 1526 of file undo.c.
References UndoListType::CopyID, CopyObjectToBuffer(), CreateNewBuffer(), UndoListType::Data, PCBType::Data, GetUndoSlot(), Locked, OBJECT_ID, and PCB.
Referenced by AddObjectToInsertContourUndoList(), and AddObjectToRemoveContourUndoList().
static void DrawRecoveredObject | ( | int | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) | [static] |
Redraws the recovered object.
Definition at line 318 of file undo.c.
References DrawObject(), GetLayerNumber(), layer, and LAYER_PTR.
Referenced by UndoRemove(), and UndoSwapCopiedObject().
static UndoListType * GetUndoSlot | ( | int | CommandType, |
int | ID, | ||
int | Kind | ||
) | [static] |
Adds a command plus some data to the undo list.
Definition at line 249 of file undo.c.
References _, added_undo_between_increment_and_restore, between_increment_and_restore, UndoListType::ChangeName, UndoListType::Data, PCBType::Data, DestroyObject(), ID, UndoListType::ID, UndoListType::Kind, Message(), ChangeNameType::Name, PCB, ptr, ptr1, ptr2, ptr3, realloc(), RedoN, SearchObjectByID(), Serial, UndoListType::Serial, STEP_REMOVELIST, STEP_UNDOLIST, UndoListType::Type, UNDO_CHANGENAME, UNDO_REMOVE, UNDO_WARNING_SIZE, UndoMax, and UndoN.
Referenced by AddLayerChangeToUndoList(), AddNetlistLibToUndoList(), AddObjectTo2ndSizeUndoList(), AddObjectToChangeAnglesUndoList(), AddObjectToChangeNameUndoList(), AddObjectToClearPolyUndoList(), AddObjectToClearSizeUndoList(), AddObjectToCreateUndoList(), AddObjectToFlagUndoList(), AddObjectToInsertPointUndoList(), AddObjectToMaskSizeUndoList(), AddObjectToMirrorUndoList(), AddObjectToMoveToLayerUndoList(), AddObjectToMoveUndoList(), AddObjectToRemovePointUndoList(), AddObjectToRotateUndoList(), AddObjectToSetViaLayersUndoList(), AddObjectToSizeUndoList(), CopyObjectToUndoList(), and MoveObjectToRemoveUndoList().
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 | Type, |
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
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().
static int PerformUndo | ( | UndoListType * | ptr | ) | [static] |
Definition at line 1146 of file undo.c.
References UndoListType::Type, UNDO_CHANGE2NDSIZE, UNDO_CHANGEANGLES, UNDO_CHANGECLEARSIZE, UNDO_CHANGEMASKSIZE, UNDO_CHANGENAME, UNDO_CHANGESETVIALAYERS, UNDO_CHANGESIZE, UNDO_CLEAR, UNDO_CREATE, UNDO_FLAG, UNDO_INSERT_CONTOUR, UNDO_INSERT_POINT, UNDO_LAYERCHANGE, UNDO_MIRROR, UNDO_MOVE, UNDO_MOVETOLAYER, UNDO_NETLISTCHANGE, UNDO_REMOVE, UNDO_REMOVE_CONTOUR, UNDO_REMOVE_POINT, UNDO_ROTATE, UndoChange2ndSize(), UndoChangeAngles(), UndoChangeClearSize(), UndoChangeMaskSize(), UndoChangeName(), UndoChangeSize(), UndoClearPoly(), UndoCopyOrCreate(), UndoFlag(), UndoInsertContour(), UndoInsertPoint(), UndoLayerChange(), UndoMirror(), UndoMove(), UndoMoveToLayer(), UndoNetlistChange(), UndoRemove(), UndoRemoveContour(), UndoRemovePoint(), UndoRotate(), and UndoSetViaLayers().
Referenced by Redo(), and Undo().
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 | draw | ) |
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().
static bool UndoChange2ndSize | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a 2ndSize change operation.
Definition at line 409 of file undo.c.
References andDraw, UndoListType::Data, PCBType::Data, DrawObject(), EraseObject(), UndoListType::ID, UndoListType::Kind, PCB, ptr1, ptr2, ptr3, SearchObjectByID(), and UndoListType::Size.
Referenced by PerformUndo().
static bool UndoChangeAngles | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a ChangeAngles change operation.
Definition at line 435 of file undo.c.
References andDraw, LayerType::arc_tree, UndoListType::Data, PCBType::Data, DrawObject(), MoveType::DX, MoveType::DY, EraseObject(), UndoListType::ID, UndoListType::Kind, Layer, UndoListType::Move, PCB, ptr1, ptr2, ptr3, r_delete_entry(), r_insert_entry(), SearchObjectByID(), and SetArcBoundingBox().
Referenced by PerformUndo().
static bool UndoChangeClearSize | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a clearance size change operation.
Definition at line 469 of file undo.c.
References andDraw, ClearFromPolygon(), UndoListType::Data, PCBType::Data, DrawObject(), EraseObject(), UndoListType::ID, UndoListType::Kind, PCB, ptr1, ptr2, ptr3, RestoreToPolygon(), SearchObjectByID(), and UndoListType::Size.
Referenced by PerformUndo().
static bool UndoChangeMaskSize | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a mask size change operation.
Definition at line 498 of file undo.c.
References andDraw, UndoListType::Data, PCBType::Data, DrawObject(), EraseObject(), UndoListType::ID, UndoListType::Kind, Mask, PCB, ptr1, ptr2, ptr3, SearchObjectByID(), and UndoListType::Size.
Referenced by PerformUndo().
static bool UndoChangeName | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a 'change name' operation.
Definition at line 387 of file undo.c.
References UndoListType::ChangeName, ChangeObjectName(), UndoListType::Data, PCBType::Data, UndoListType::ID, UndoListType::Kind, ChangeNameType::Name, PCB, ptr1, ptr2, ptr3, and SearchObjectByID().
Referenced by PerformUndo().
static bool UndoChangeSize | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a Size change operation.
Definition at line 531 of file undo.c.
References andDraw, ClearFromPolygon(), UndoListType::Data, PCBType::Data, DrawObject(), EraseObject(), UndoListType::ID, UndoListType::Kind, PCB, ptr1, ptr2, ptr3, RestoreToPolygon(), UndoListType::Scale, SearchObjectByID(), and UndoListType::Size.
Referenced by PerformUndo().
static bool UndoClearPoly | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a clear/restore poly operation.
Definition at line 362 of file undo.c.
References ClearPolyType::Clear, ClearFromPolygon(), UndoListType::ClearPoly, UndoListType::Data, PCBType::Data, UndoListType::ID, UndoListType::Kind, ClearPolyType::Layer, PCB, ptr1, ptr2, ptr3, RestoreToPolygon(), and SearchObjectByID().
Referenced by PerformUndo().
static bool UndoCopyOrCreate | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a 'copy' or 'create' operation.
Definition at line 687 of file undo.c.
References andDraw, CreateNewBuffer(), PCBType::Data, EraseObject(), UndoListType::ID, UndoListType::Kind, MoveObjectToBuffer(), PCB, ptr1, ptr2, ptr3, SearchObjectByID(), UndoListType::Type, and UNDO_REMOVE.
Referenced by PerformUndo().
static bool UndoFlag | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a FLAG change operation.
Definition at line 611 of file undo.c.
References andDraw, UndoListType::Data, PCBType::Data, DRAW_FLAGS, DrawObject(), EraseObject(), UndoListType::Flags, FLAGS_EQUAL, flags_to_string(), UndoListType::ID, UndoListType::Kind, MaskFlags(), Message(), PCB, pin, ptr1, ptr2, ptr3, and SearchObjectByID().
Referenced by PerformUndo().
bool Undoing | ( | void | ) |
Return undo lock state.
Definition at line 1914 of file undo.c.
References Locked.
Referenced by MoveLayer(), and RemoveExcessPolygonPoints().
static bool UndoInsertContour | ( | UndoListType * | Entry | ) | [static] |
Recovers an inserted polygon point.
Definition at line 948 of file undo.c.
References UndoListType::Kind, and UndoSwapCopiedObject().
Referenced by PerformUndo().
static bool UndoInsertPoint | ( | UndoListType * | Entry | ) | [static] |
Recovers an inserted polygon point.
Definition at line 838 of file undo.c.
References andDraw, UndoListType::Data, PCBType::Data, DestroyObject(), DrawPolygon(), ErasePolygon(), RemovedPointType::ID, UndoListType::ID, RemovedPointType::Index, UndoListType::Kind, RemovedPointType::last_in_contour, layer, PCB, polygon_point_idx(), UndoListType::RemovedPoint, SearchObjectByID(), UndoListType::Type, UNDO_REMOVE_POINT, RemovedPointType::X, and RemovedPointType::Y.
Referenced by PerformUndo().
static bool UndoLayerChange | ( | UndoListType * | Entry | ) | [static] |
Undo a layer change.
Definition at line 960 of file undo.c.
References UndoListType::Data, UndoListType::LayerChange, MoveLayer(), LayerChangeType::new_index, and LayerChangeType::old_index.
Referenced by PerformUndo().
static bool UndoMirror | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a mirror operation.
Definition at line 659 of file undo.c.
References andDraw, UndoListType::Data, PCBType::Data, DrawElement(), MoveType::DY, EraseElement(), UndoListType::ID, UndoListType::Kind, Message(), MirrorElementCoordinates(), UndoListType::Move, PCB, ptr1, ptr2, ptr3, and SearchObjectByID().
Referenced by PerformUndo().
static bool UndoMove | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a 'move' operation.
Definition at line 715 of file undo.c.
References UndoListType::Data, PCBType::Data, MoveType::DX, MoveType::DY, UndoListType::ID, UndoListType::Kind, UndoListType::Move, MoveObject(), PCB, ptr1, ptr2, ptr3, and SearchObjectByID().
Referenced by PerformUndo().
static bool UndoMoveToLayer | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a 'move to another layer' operation.
Definition at line 766 of file undo.c.
References UndoListType::Data, PCBType::Data, GetLayerNumber(), UndoListType::ID, UndoListType::Kind, LAYER_PTR, MoveObjectToLayer(), UndoListType::MoveToLayer, MoveToLayerType::OriginalLayer, PCB, ptr1, ptr2, ptr3, and SearchObjectByID().
Referenced by PerformUndo().
static bool UndoNetlistChange | ( | UndoListType * | Entry | ) | [static] |
Undo a netlist change.
Definition at line 981 of file undo.c.
References LibraryEntryType::AllocatedMemory, UndoListType::Data, LibraryEntryType::Description, LibraryMenuType::directory, LibraryMenuType::Entry, LibraryMenuType::EntryN, NetlistChangeType::lib, LibraryEntryType::ListEntry, LibraryType::Menu, LibraryType::MenuN, LibraryMenuType::Name, UndoListType::NetlistChange, NetlistChanged(), NetlistChangeType::old, LibraryEntryType::Package, LibraryMenuType::Style, LibraryEntryType::Template, and LibraryEntryType::Value.
Referenced by PerformUndo().
static bool UndoRemove | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a 'remove' operation.
Definition at line 740 of file undo.c.
References andDraw, PCBType::Data, DrawRecoveredObject(), UndoListType::ID, UndoListType::Kind, MoveObjectToBuffer(), PCB, ptr1, ptr2, ptr3, SearchObjectByID(), UndoListType::Type, and UNDO_CREATE.
Referenced by PerformUndo().
static bool UndoRemoveContour | ( | UndoListType * | Entry | ) | [static] |
Recovers an removed polygon point.
Definition at line 936 of file undo.c.
References UndoListType::Kind, and UndoSwapCopiedObject().
Referenced by PerformUndo().
static bool UndoRemovePoint | ( | UndoListType * | Entry | ) | [static] |
Recovers a removed polygon point.
Definition at line 792 of file undo.c.
References andDraw, UndoListType::Data, PCBType::Data, DrawPolygon(), ErasePolygon(), RemovedPointType::ID, UndoListType::ID, RemovedPointType::Index, InsertPointIntoObject(), UndoListType::Kind, RemovedPointType::last_in_contour, layer, PCB, ptr3, UndoListType::RemovedPoint, SearchObjectByID(), UndoListType::Type, UNDO_INSERT_POINT, RemovedPointType::X, and RemovedPointType::Y.
Referenced by PerformUndo().
static bool UndoRotate | ( | UndoListType * | Entry | ) | [static] |
Recovers an object from a 'rotate' operation.
Definition at line 337 of file undo.c.
References RotateType::CenterX, RotateType::CenterY, UndoListType::Data, PCBType::Data, UndoListType::ID, UndoListType::Kind, PCB, ptr1, ptr2, ptr3, UndoListType::Rotate, RotateObject(), SearchObjectByID(), and RotateType::Steps.
Referenced by PerformUndo().
static bool UndoSetViaLayers | ( | UndoListType * | Entry | ) | [static] |
Definition at line 1039 of file undo.c.
References andDraw, ClearFromPolygon(), UndoListType::Data, PCBType::Data, DrawObject(), EraseObject(), SetViaLayersChangeType::from, UndoListType::ID, UndoListType::Kind, PCB, ptr1, ptr2, ptr3, RestoreToPolygon(), SearchObjectByID(), UndoListType::SetViaLayersChange, and SetViaLayersChangeType::to.
Referenced by PerformUndo().
static bool UndoSwapCopiedObject | ( | UndoListType * | Entry | ) | [static] |
Definition at line 891 of file undo.c.
References andDraw, UndoListType::CopyID, PCBType::Data, UndoListType::Data, DrawRecoveredObject(), FALSE, UndoListType::ID, InitClip(), UndoListType::Kind, MoveObjectToBuffer(), PCB, ptr1, ptr2, ptr3, and SearchObjectByID().
Referenced by UndoInsertContour(), and UndoRemoveContour().
void UnlockUndo | ( | void | ) |
bool added_undo_between_increment_and_restore = false [static] |
Definition at line 87 of file undo.c.
Referenced by GetUndoSlot(), RestoreUndoSerialNumber(), and SaveUndoSerialNumber().
bool andDraw = true [static] |
Definition at line 215 of file undo.c.
Referenced by Redo(), Undo(), UndoChange2ndSize(), UndoChangeAngles(), UndoChangeClearSize(), UndoChangeMaskSize(), UndoChangeSize(), UndoCopyOrCreate(), UndoFlag(), UndoInsertPoint(), UndoMirror(), UndoRemove(), UndoRemovePoint(), UndoSetViaLayers(), and UndoSwapCopiedObject().
bool between_increment_and_restore = false [static] |
Definition at line 86 of file undo.c.
Referenced by GetUndoSlot(), IncrementUndoSerialNumber(), RestoreUndoSerialNumber(), and SaveUndoSerialNumber().
bool Locked = false [static] |
Do not add entries if.
Definition at line 214 of file undo.c.
Referenced by AddLayerChangeToUndoList(), AddNetlistLibToUndoList(), AddObjectTo2ndSizeUndoList(), AddObjectToChangeAnglesUndoList(), AddObjectToChangeNameUndoList(), AddObjectToClearPolyUndoList(), AddObjectToClearSizeUndoList(), AddObjectToCreateUndoList(), AddObjectToFlagUndoList(), AddObjectToInsertPointUndoList(), AddObjectToMaskSizeUndoList(), AddObjectToMirrorUndoList(), AddObjectToMoveToLayerUndoList(), AddObjectToMoveUndoList(), AddObjectToRemovePointUndoList(), AddObjectToRotateUndoList(), AddObjectToSetViaLayersUndoList(), AddObjectToSizeUndoList(), CopyObjectToUndoList(), IncrementUndoSerialNumber(), LockUndo(), MoveObjectToRemoveUndoList(), Undoing(), and UnlockUndo().
size_t RedoN [static] |
Number of entries.
Definition at line 212 of file undo.c.
Referenced by ClearUndoList(), GetUndoSlot(), Redo(), and Undo().
DataType* RemoveList = NULL [static] |
int SavedSerial [static] |
Definition at line 210 of file undo.c.
Referenced by RestoreUndoSerialNumber(), and SaveUndoSerialNumber().
int Serial = 1 [static] |
Serial number.
Definition at line 209 of file undo.c.
Referenced by ClearUndoList(), GetUndoSlot(), IncrementUndoSerialNumber(), Redo(), RestoreUndoSerialNumber(), SaveUndoSerialNumber(), and Undo().
UndoListType* UndoList = NULL [static] |
size_t UndoMax [static] |
Number of entries.
Definition at line 213 of file undo.c.
Referenced by ClearUndoList(), and GetUndoSlot().
size_t UndoN [static] |
Number of entries.
Definition at line 211 of file undo.c.
Referenced by ClearUndoList(), GetUndoSlot(), IncrementUndoSerialNumber(), Redo(), and Undo().