pcb 4.1.1
An interactive printed circuit board layout editor.

undo.h File Reference

Prototypes for undo routines. More...

#include "global.h"
Include dependency graph for undo.h:
This graph shows which files directly or indirectly include this file:

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.

Detailed Description

Prototypes for undo routines.


Copyright.


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

Thomas.Nau@rz.uni-ulm.de

Definition in file undo.h.


Define Documentation

#define DRAW_FLAGS
Value:
(RATFLAG | SELECTEDFLAG | SQUAREFLAG |    \
                     HIDENAMEFLAG | HOLEFLAG | OCTAGONFLAG |  \
                     CONNECTEDFLAG | FOUNDFLAG | CLEARLINEFLAG)

Definition at line 40 of file undo.h.

Referenced by UndoFlag().


Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void AddObjectToChangeAnglesUndoList ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3 
)

Adds an object to the list of changed angles.

Note:
You must call this before changing the angles, passing the new start/delta.

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void AddObjectToClearPolyUndoList ( int  ,
void *  ,
void *  ,
void *  ,
bool   
)
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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void AddObjectToMoveUndoList ( int  ,
void *  ,
void *  ,
void *  ,
Coord  ,
Coord   
)

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void AddObjectToRemovePointUndoList ( int  ,
void *  ,
void *  ,
Cardinal   
)
void AddObjectToRotateUndoList ( int  ,
void *  ,
void *  ,
void *  ,
Coord  ,
Coord  ,
BYTE   
)

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().

Here is the call graph for this function:

void AddObjectToSetViaLayersUndoList ( void *  ptr1,
void *  ptr2,
void *  ptr3 
)
void AddObjectToSizeUndoList ( int  ,
void *  ,
void *  ,
void *   
)
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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void LockUndo ( void  )

Definition at line 1896 of file undo.c.

References Locked.

Referenced by Redo(), and Undo().

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().

Here is the call graph for this function:

int Redo ( bool  draw)

Redo of any 'hard to recover' operation.

Returns:
The number of operations redone.

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void SaveUndoSerialNumber ( void  )
int Undo ( bool  )
bool Undoing ( void  )

Return undo lock state.

Definition at line 1914 of file undo.c.

References Locked.

Referenced by MoveLayer(), and RemoveExcessPolygonPoints().

void UnlockUndo ( void  )

Reset lock flag.

Definition at line 1905 of file undo.c.

References Locked.

Referenced by Redo(), and Undo().