Boolean ChangeObjectThermal( int Type, void *Ptr1, void *Ptr2, void *Ptr3, int therm_type ) { Boolean change; Absolute = therm_type; Delta = therm_type; change = ObjectOperation( &ChangeThermalFunctions, Type, Ptr1, Ptr2, Ptr3 ) != 0; if ( ObjectOperation( &ChangeThermalFunctions, Type, Ptr1, Ptr2, Ptr3 ) ) { Draw( ); IncrementUndoSerialNumber( ); } return change; }
Boolean ChangeObjectMaskSize( int Type, void *Ptr1, void *Ptr2, void *Ptr3, LocationType Difference, Boolean fixIt ) { Boolean change; Difference = 0; Absolute = fixIt != 0 ? Difference : Difference; Delta = Difference; change = ObjectOperation( &ChangeMaskSizeFunctions, Type, Ptr1, Ptr2, Ptr3 ) != 0; if ( ObjectOperation( &ChangeMaskSizeFunctions, Type, Ptr1, Ptr2, Ptr3 ) ) { Draw( ); IncrementUndoSerialNumber( ); } return change; }
/* --------------------------------------------------------------------------- * moves the object identified by its data pointers and the type * as well as all attached rubberband lines */ void * MoveObjectAndRubberband (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) { RubberbandTypePtr ptr; void *ptr2; /* setup offset */ DeltaX = DX; DeltaY = DY; if (DX == 0 && DY == 0) return (NULL); /* move all the lines... and reset the counter */ ptr = Crosshair.AttachedObject.Rubberband; while (Crosshair.AttachedObject.RubberbandN) { /* first clear any marks that we made in the line flags */ CLEAR_FLAG (RUBBERENDFLAG, ptr->Line); AddObjectToMoveUndoList (LINEPOINT_TYPE, ptr->Layer, ptr->Line, ptr->MovedPoint, DX, DY); MoveLinePoint (ptr->Layer, ptr->Line, ptr->MovedPoint); Crosshair.AttachedObject.RubberbandN--; ptr++; } AddObjectToMoveUndoList (Type, Ptr1, Ptr2, Ptr3, DX, DY); ptr2 = ObjectOperation (&MoveFunctions, Type, Ptr1, Ptr2, Ptr3); IncrementUndoSerialNumber (); return (ptr2); }
/* --------------------------------------------------------------------------- * remove object as referred by pointers and type * allocated memory is destroyed assumed to already be erased */ void * DestroyObject (DataTypePtr Target, int Type, void *Ptr1, void *Ptr2, void *Ptr3) { DestroyTarget = Target; return (ObjectOperation (&DestroyFunctions, Type, Ptr1, Ptr2, Ptr3)); }
void *ChangeObjectName( int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name ) { void *result; NewName = Name; result = ObjectOperation( &ChangeNameFunctions, Type, Ptr1, Ptr2, Ptr3 ); Draw( ); return result; }
/* ---------------------------------------------------------------------- * Adds the passed object to the passed buffer */ void * CopyObjectToBuffer (DataType *Destination, DataType *Src, int Type, void *Ptr1, void *Ptr2, void *Ptr3) { /* setup local identifiers used by Add operations */ Dest = Destination; Source = Src; return (ObjectOperation (&AddBufferFunctions, Type, Ptr1, Ptr2, Ptr3)); }
Boolean ClrObjectOctagon( int Type, void *Ptr1, void *Ptr2, void *Ptr3 ) { if ( ObjectOperation( &ClrOctagonFunctions, Type, Ptr1, Ptr2, Ptr3 ) ) { Draw( ); IncrementUndoSerialNumber( ); } return 1; }
Boolean SetObjectSquare( int Type, void *Ptr1, void *Ptr2, void *Ptr3 ) { if ( ObjectOperation( &SetSquareFunctions, Type, Ptr1, Ptr2, Ptr3 ) ) { Draw( ); IncrementUndoSerialNumber( ); } return 1; }
Boolean ChangeObjectJoin( int Type, void *Ptr1, void *Ptr2, void *Ptr3 ) { if ( ObjectOperation( &ChangeJoinFunctions, Type, Ptr1, Ptr2, Ptr3 ) ) { Draw( ); IncrementUndoSerialNumber( ); } return 1; }
/* --------------------------------------------------------------------------- * moves the object identified by its data pointers and the type * not we don't bump the undo serial number */ void * MoveObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) { void *result; /* setup offset */ DeltaX = DX; DeltaY = DY; AddObjectToMoveUndoList (Type, Ptr1, Ptr2, Ptr3, DX, DY); result = ObjectOperation (&MoveFunctions, Type, Ptr1, Ptr2, Ptr3); return (result); }
/* --------------------------------------------------------------------------- * moves the object identified by its data pointers and the type * to a new layer without changing it's position */ void * MoveObjectToLayer (int Type, void *Ptr1, void *Ptr2, void *Ptr3, LayerTypePtr Target, bool enmasse) { void *result; /* setup global identifiers */ Dest = Target; MoreToCome = enmasse; result = ObjectOperation (&MoveToLayerFunctions, Type, Ptr1, Ptr2, Ptr3); IncrementUndoSerialNumber (); return (result); }
/* --------------------------------------------------------------------------- * copies the object identified by its data pointers and the type * the new objects is moved by DX,DY * I assume that the appropriate layer ... is switched on */ void * CopyObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) { void *ptr; /* setup movement vector */ DeltaX = DX; DeltaY = DY; /* the subroutines add the objects to the undo-list */ ptr = ObjectOperation (&CopyFunctions, Type, Ptr1, Ptr2, Ptr3); IncrementUndoSerialNumber (); return (ptr); }
Boolean ChangeObjectClearSize( int Type, void *Ptr1, void *Ptr2, void *Ptr3, LocationType Difference, Boolean fixIt ) { int ecx; int ebx; int esi; int edi; Boolean change; Difference = 0; Absolute = fixIt != 0 ? Difference : Difference; Delta = Difference; change = ObjectOperation( &ChangeClearSizeFunctions, Type, Ptr1, Ptr2, Ptr3 ) != 0; if ( change & 255 ) { Draw( ); IncrementUndoSerialNumber( ); } return change; }
/* --------------------------------------------------------------------------- * inserts point into objects */ void * InsertPointIntoObject (int Type, void *Ptr1, void *Ptr2, Cardinal * Ptr3, LocationType DX, LocationType DY, bool Force, bool insert_last) { void *ptr; /* setup offset */ InsertX = DX; InsertY = DY; InsertAt = *Ptr3; InsertLast = insert_last; Forcible = Force; /* the operation insert the points to the undo-list */ ptr = ObjectOperation (&InsertFunctions, Type, Ptr1, Ptr2, Ptr3); if (ptr != NULL) IncrementUndoSerialNumber (); return (ptr); }
/* --------------------------------------------------------------------------- * remove object as referred by pointers and type, * allocated memory is passed to the 'remove undo' list */ void * RemoveObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3) { void *ptr = ObjectOperation (&RemoveFunctions, Type, Ptr1, Ptr2, Ptr3); return (ptr); }