pcb 4.1.1
An interactive printed circuit board layout editor.
|
Prototypes for buffer handling routines. More...
#include "global.h"
Go to the source code of this file.
Functions | |
void | SetBufferBoundingBox (BufferType *) |
Calculates the bounding box of the buffer. | |
void | ClearBuffer (BufferType *) |
Clears the contents of the paste buffer. | |
void | AddSelectedToBuffer (BufferType *, Coord, Coord, bool) |
Copies all selected and visible objects to the paste buffer. | |
bool | LoadElementToBuffer (BufferType *, char *, bool) |
Loads element data from file/library into buffer. | |
bool | ConvertBufferToElement (BufferType *) |
Convert buffer contents into an element. | |
bool | SmashBufferElement (BufferType *) |
Break buffer element into pieces. | |
bool | LoadLayoutToBuffer (BufferType *, char *) |
Load PCB into buffer. | |
void | RotateBuffer (BufferType *, BYTE) |
Rotates the contents of the pastebuffer. | |
void | SelectPasteBuffer (int) |
void | SwapBuffers (void) |
void | MirrorBuffer (BufferType *) |
void | InitBuffers (void) |
Initializes the buffers by allocating memory. | |
void | UninitBuffers (void) |
void * | MoveObjectToBuffer (DataType *, DataType *, int, void *, void *, void *) |
Moves the passed object to the passed buffer and removes it from its original place. | |
void * | CopyObjectToBuffer (DataType *, DataType *, int, void *, void *, void *) |
Adds the passed object to the passed buffer. | |
int | LoadFootprint (int argc, char **argv, Coord x, Coord y) |
This action is called from ActionElementAddIf(). |
Prototypes for buffer handling routines.
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 buffer.h.
void AddSelectedToBuffer | ( | BufferType * | Buffer, |
Coord | X, | ||
Coord | Y, | ||
bool | LeaveSelected | ||
) |
Copies all selected and visible objects to the paste buffer.
Definition at line 443 of file buffer.c.
References Crosshair, BufferType::Data, PCBType::Data, ExtraFlag, notify_crosshair_change(), PCB, SelectedOperation(), CrosshairType::X, X, BufferType::X, CrosshairType::Y, Y, and BufferType::Y.
Referenced by ActionPasteBuffer(), ActionSelect(), and click_cb().
void ClearBuffer | ( | BufferType * | ) |
Clears the contents of the paste buffer.
Definition at line 428 of file buffer.c.
References BufferType::Data, FreeDataMemory(), PCB, and DataType::pcb.
Referenced by ActionPasteBuffer(), ActionRipUp(), ActionSelect(), click_cb(), ConvertBufferToElement(), LoadElementToBuffer(), LoadLayoutToBuffer(), ReleaseMode(), SmashBufferElement(), and UninitBuffers().
bool ConvertBufferToElement | ( | BufferType * | ) |
Convert buffer contents into an element.
Definition at line 973 of file buffer.c.
References _, ARC_LOOP, BOTTOM_SIDE, ClearBuffer(), CreateNewArcInElement(), CreateNewElement(), CreateNewLineInElement(), CreateNewPad(), CreateNewPin(), PCBType::Data, BufferType::Data, DestroyObject(), END_LOOP, PCBType::Font, GetLayerGroupNumberBySide(), GROUP_LOOP, SettingType::Keepaway, layer, line, LINE_LOOP, MakeFlags(), ElementType::MarkX, ElementType::MarkY, MaskFlags(), MAYBE_WARN, Message(), MoveObjectToBuffer(), ElementType::Name, NAMEONPCB_NAME, NoFlags, LineType::Number, PASTEBUFFER, PCB, DataType::pcb, polygon_is_rectangle(), POLYGON_LOOP, SET_FLAG, SetBufferBoundingBox(), SetElementBoundingBox(), Settings, SWAP_IDENT, TOP_SIDE, VIA_LOOP, BufferType::X, and BufferType::Y.
Referenced by ActionPasteBuffer(), and ActionSelect().
Adds the passed object to the passed buffer.
Definition at line 1639 of file buffer.c.
References ObjectOperation().
Referenced by ActionRipUp(), and CopyObjectToUndoList().
void InitBuffers | ( | void | ) |
Initializes the buffers by allocating memory.
Definition at line 1400 of file buffer.c.
References Buffers, and CreateNewBuffer().
Referenced by main().
bool LoadElementToBuffer | ( | BufferType * | Buffer, |
char * | Name, | ||
bool | FromFile | ||
) |
Loads element data from file/library into buffer.
Parse the file with disabled 'PCB mode' (see parser).
Definition at line 479 of file buffer.c.
References ClearBuffer(), BufferType::Data, DataType::Element, DataType::ElementN, PCBType::Font, ElementType::MarkX, ElementType::MarkY, MirrorElementCoordinates(), ParseElementFile(), ParseLibraryEntry(), PCB, SetBufferBoundingBox(), SetElementBoundingBox(), Settings, SettingType::ShowBottomSide, SwapBuffer(), BufferType::X, and BufferType::Y.
Referenced by ActionLoadFrom(), libnode_select(), library_window_callback_tree_selection_changed(), and LoadFootprintByName().
This action is called from ActionElementAddIf().
Definition at line 813 of file buffer.c.
References _, AFAIL, ARG, LoadFootprintByName(), Message(), ElementType::Name, PASTEBUFFER, and TextType::TextString.
Referenced by ActionElementList().
bool LoadLayoutToBuffer | ( | BufferType * | Buffer, |
char * | Filename | ||
) |
Load PCB into buffer.
Parse the file with enabled 'PCB mode' (see parser). If successful, update some other stuff.
Definition at line 1142 of file buffer.c.
References ClearBuffer(), CreateNewPCB(), PCBType::CursorX, PCBType::CursorY, PCBType::Data, BufferType::Data, ParsePCB(), PCB, DataType::pcb, RemovePCB(), BufferType::X, and BufferType::Y.
Referenced by ActionLoadFrom().
void MirrorBuffer | ( | BufferType * | ) |
Definition at line 1431 of file buffer.c.
References _, ALLARC_LOOP, ALLLINE_LOOP, ALLPOLYGON_LOOP, crosshair_update_range(), BufferType::Data, DataType::ElementN, END_LOOP, ENDALL_LOOP, DataType::Layer, layer, line, max_copper_layer, Message(), POLYGONPOINT_LOOP, r_delete_entry(), r_insert_entry(), SetArcBoundingBox(), SetBufferBoundingBox(), SetPolygonBoundingBox(), SILK_LAYER, SWAP_ANGLE, SWAP_DELTA, SWAP_X, SWAP_Y, LayerType::TextN, VIA_LOOP, BufferType::X, and BufferType::Y.
Referenced by ActionPasteBuffer().
Moves the passed object to the passed buffer and removes it from its original place.
Definition at line 1626 of file buffer.c.
References MoveBufferFunctions, and ObjectOperation().
Referenced by ConvertBufferToElement(), MoveObjectToRemoveUndoList(), UndoCopyOrCreate(), UndoRemove(), and UndoSwapCopiedObject().
void RotateBuffer | ( | BufferType * | , |
BYTE | |||
) |
Rotates the contents of the pastebuffer.
Definition at line 1171 of file buffer.c.
References ALLARC_LOOP, ALLLINE_LOOP, ALLPOLYGON_LOOP, ALLTEXT_LOOP, BufferType::BoundingBox, crosshair_update_range(), BufferType::Data, ELEMENT_LOOP, END_LOOP, ENDALL_LOOP, layer, line, r_delete_entry(), r_insert_entry(), ROTATE, ROTATE_VIA_LOWLEVEL, RotateArcLowLevel(), RotateBoxLowLevel(), RotateElementLowLevel(), RotateLineLowLevel(), RotatePolygonLowLevel(), RotateTextLowLevel(), SetPinBoundingBox(), VIA_LOOP, DataType::via_tree, BufferType::X, and BufferType::Y.
Referenced by ActionPasteBuffer().
void SelectPasteBuffer | ( | int | ) |
void SetBufferBoundingBox | ( | BufferType * | ) |
Calculates the bounding box of the buffer.
Definition at line 416 of file buffer.c.
References BufferType::BoundingBox, box, BufferType::Data, and GetDataBoundingBox().
Referenced by ConvertBufferToElement(), crosshair_update_range(), FreeRotateBuffer(), LoadElementToBuffer(), MirrorBuffer(), and SwapBuffer().
bool SmashBufferElement | ( | BufferType * | ) |
Break buffer element into pieces.
Definition at line 858 of file buffer.c.
References _, AddFlags(), ARC_LOOP, BOTTOM_SIDE, pin_st::Clearance, ClearBuffer(), CreateNewArcOnLayer(), CreateNewLineOnLayer(), CreateNewVia(), BufferType::Data, pin_st::DrillingHole, DataType::Element, ELEMENTLINE_LOOP, DataType::ElementN, END_LOOP, LayerGroupType::Entries, f, FreeElementMemory(), GetLayerGroupNumberBySide(), DataType::Layer, PCBType::LayerGroups, line, pin_st::Mask, Message(), NAMEONPCB_NAME, NoFlags, pin_st::Number, LineType::Number, PAD_LOOP, PCB, pin, PIN_LOOP, STRDUP, SWAP_IDENT, TEST_FLAG, pin_st::Thickness, TOP_SIDE, pin_st::X, and pin_st::Y.
Referenced by ActionPasteBuffer(), and ActionRipUp().
void SwapBuffers | ( | void | ) |
Definition at line 1421 of file buffer.c.
References Buffers, crosshair_update_range(), and SwapBuffer().
Referenced by SaveBufferElements().
void UninitBuffers | ( | void | ) |
Definition at line 1409 of file buffer.c.
References Buffers, and ClearBuffer().
Referenced by pcb_main_uninit().