pcb 4.1.1
An interactive printed circuit board layout editor.

undo.c File Reference

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"
Include dependency graph for undo.c:

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 UndoListTypeGetUndoSlot (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 DataTypeRemoveList = NULL
static UndoListTypeUndoList = 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

Detailed Description

Functions used to undo operations.

Description:

There are two lists which hold:

  • information about a command
  • data of removed objects

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.

Note:
A lock flag ensures that no infinite loops occur.

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.c.


Function Documentation

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

void AddObjectToClearPolyUndoList ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3,
bool  clear 
)
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().

Here is the call graph for this function:

void AddObjectToCreateUndoList ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3 
)
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  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().

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

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  Type,
void *  Ptr1,
void *  Ptr2,
Cardinal  index 
)
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().

Here is the call graph for this function:

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

Here is the call graph for this function:

static void CopyObjectToUndoList ( int  undo_type,
int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3 
) [static]
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().

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

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

static bool UndoChangeName ( UndoListType Entry) [static]

Recovers an object from a 'change name' operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

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

Here is the call graph for this function:

static bool UndoClearPoly ( UndoListType Entry) [static]

Recovers an object from a clear/restore poly operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

static bool UndoCopyOrCreate ( UndoListType Entry) [static]

Recovers an object from a 'copy' or 'create' operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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.

Returns:
true on success.

Definition at line 948 of file undo.c.

References UndoListType::Kind, and UndoSwapCopiedObject().

Referenced by PerformUndo().

Here is the call graph for this function:

static bool UndoInsertPoint ( UndoListType Entry) [static]
static bool UndoLayerChange ( UndoListType Entry) [static]

Undo a layer change.

Returns:
true on success.

Definition at line 960 of file undo.c.

References UndoListType::Data, UndoListType::LayerChange, MoveLayer(), LayerChangeType::new_index, and LayerChangeType::old_index.

Referenced by PerformUndo().

Here is the call graph for this function:

static bool UndoMirror ( UndoListType Entry) [static]

Recovers an object from a mirror operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

static bool UndoMove ( UndoListType Entry) [static]

Recovers an object from a 'move' operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

static bool UndoMoveToLayer ( UndoListType Entry) [static]

Recovers an object from a 'move to another layer' operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

static bool UndoRemove ( UndoListType Entry) [static]

Recovers an object from a 'remove' operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

static bool UndoRemoveContour ( UndoListType Entry) [static]

Recovers an removed polygon point.

Returns:
true on success.

Definition at line 936 of file undo.c.

References UndoListType::Kind, and UndoSwapCopiedObject().

Referenced by PerformUndo().

Here is the call graph for this function:

static bool UndoRemovePoint ( UndoListType Entry) [static]
static bool UndoRotate ( UndoListType Entry) [static]

Recovers an object from a 'rotate' operation.

Returns:
true if anything has been recovered.

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

Here is the call graph for this function:

static bool UndoSwapCopiedObject ( UndoListType Entry) [static]
void UnlockUndo ( void  )

Reset lock flag.

Definition at line 1905 of file undo.c.

References Locked.

Referenced by Redo(), and Undo().


Variable Documentation

Definition at line 87 of file undo.c.

Referenced by GetUndoSlot(), RestoreUndoSerialNumber(), and SaveUndoSerialNumber().

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]

List of removed objects.

Definition at line 207 of file undo.c.

int SavedSerial [static]

Definition at line 210 of file undo.c.

Referenced by RestoreUndoSerialNumber(), and SaveUndoSerialNumber().

int Serial = 1 [static]
UndoListType* UndoList = NULL [static]

List of operations.

Definition at line 208 of file undo.c.

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