/* ---------------------------------------------------------------------- * copies all selected and visible objects to the paste buffer * returns true if any objects have been removed */ void AddSelectedToBuffer (BufferType *Buffer, Coord X, Coord Y, bool LeaveSelected) { /* switch crosshair off because adding objects to the pastebuffer * may change the 'valid' area for the cursor */ if (!LeaveSelected) ExtraFlag = SELECTEDFLAG; notify_crosshair_change (false); Source = PCB->Data; Dest = Buffer->Data; SelectedOperation (&AddBufferFunctions, false, ALL_TYPES); /* set origin to passed or current position */ if (X || Y) { Buffer->X = X; Buffer->Y = Y; } else { Buffer->X = Crosshair.X; Buffer->Y = Crosshair.Y; } notify_crosshair_change (true); ExtraFlag = 0; }
Boolean ClrSelectedOctagon( int types ) { Boolean change; if ( change & 255 ) { Draw( ); IncrementUndoSerialNumber( ); return change; } return SelectedOperation( &ClrOctagonFunctions, 0, types ); }
Boolean SetSelectedSquare( int types ) { Boolean change; if ( change & 255 ) { Draw( ); IncrementUndoSerialNumber( ); return change; } return SelectedOperation( &SetSquareFunctions, 0, types ); }
/* --------------------------------------------------------------------------- * moves the selected objects to a new layer without changing their * positions */ bool MoveSelectedObjectsToLayer (LayerTypePtr Target) { bool changed; /* setup global identifiers */ Dest = Target; MoreToCome = true; changed = SelectedOperation (&MoveToLayerFunctions, true, ALL_TYPES); /* passing true to above operation causes Undoserial to auto-increment */ return (changed); }
Boolean ChangeSelectedThermals( int types, int therm_style ) { Boolean change; Delta = therm_style; if ( change & 255 ) { Draw( ); IncrementUndoSerialNumber( ); return change; } return SelectedOperation( &ChangeThermalFunctions, 0, types ); }
/* ---------------------------------------------------------------------- * removes all selected and visible objects * returns true if any objects have been removed */ bool RemoveSelected (void) { Bulk = true; if (SelectedOperation (&RemoveFunctions, false, ALL_TYPES)) { IncrementUndoSerialNumber (); Draw (); Bulk = false; return (true); } Bulk = false; return (false); }
Boolean ChangeSelected2ndSize( int types, LocationType Difference, Boolean fixIt ) { Boolean change; Difference = 0; Absolute = fixIt != 0 ? Difference : Difference; Delta = Difference; if ( change & 255 ) { Draw( ); IncrementUndoSerialNumber( ); return change; } return SelectedOperation( &Change2ndSizeFunctions, 0, types ); }