pcb 4.1.1
An interactive printed circuit board layout editor.
|
Functions used by paste- and move/copy buffer. More...
#include <stdlib.h>
#include <memory.h>
#include <math.h>
#include "global.h"
#include "buffer.h"
#include "copy.h"
#include "create.h"
#include "crosshair.h"
#include "data.h"
#include "error.h"
#include "mymem.h"
#include "mirror.h"
#include "misc.h"
#include "parse_l.h"
#include "polygon.h"
#include "rats.h"
#include "rotate.h"
#include "remove.h"
#include "rtree.h"
#include "search.h"
#include "select.h"
#include "set.h"
Go to the source code of this file.
Data Structures | |
struct | FootprintHashEntry |
Defines | |
#define | ARG(n) (argc > (n) ? argv[n] : 0) |
#define | MAYBE_WARN() |
Functions | |
static void * | AddViaToBuffer (PinType *Via) |
Copies a via to paste buffer. | |
static void * | AddLineToBuffer (LayerType *Layer, LineType *Line) |
Copies a line to buffer. | |
static void * | AddArcToBuffer (LayerType *Layer, ArcType *Arc) |
Copies an arc to buffer. | |
static void * | AddRatToBuffer (RatType *Rat) |
Copies a rat-line to paste buffer. | |
static void * | AddTextToBuffer (LayerType *Layer, TextType *Text) |
Copies a text to buffer. | |
static void * | AddPolygonToBuffer (LayerType *Layer, PolygonType *Polygon) |
Copies a polygon to buffer. | |
static void * | AddElementToBuffer (ElementType *Element) |
Copies a element to buffer. | |
static void * | MoveViaToBuffer (PinType *via) |
Moves a via to paste buffer without allocating memory for the name. | |
static void * | MoveLineToBuffer (LayerType *layer, LineType *line) |
Moves a line to buffer. | |
static void * | MoveArcToBuffer (LayerType *layer, ArcType *arc) |
Moves an arc to buffer. | |
static void * | MoveRatToBuffer (RatType *rat) |
Moves a rat-line to paste buffer. | |
static void * | MoveTextToBuffer (LayerType *layer, TextType *text) |
Moves a text to buffer without allocating memory for the name. | |
static void * | MovePolygonToBuffer (LayerType *layer, PolygonType *polygon) |
Moves a polygon to buffer. | |
static void * | MoveElementToBuffer (ElementType *element) |
Moves a element to buffer without allocating memory for pins/names. | |
static void | SwapBuffer (BufferType *Buffer) |
Flip components/tracks from one side to the other. | |
void | SetBufferBoundingBox (BufferType *Buffer) |
Calculates the bounding box of the buffer. | |
void | ClearBuffer (BufferType *Buffer) |
Clears the contents of the paste buffer. | |
void | AddSelectedToBuffer (BufferType *Buffer, Coord X, Coord Y, bool LeaveSelected) |
Copies all selected and visible objects to the paste buffer. | |
bool | LoadElementToBuffer (BufferType *Buffer, char *Name, bool FromFile) |
Loads element data from file/library into buffer. | |
void | clear_footprint_hash () |
static int | footprint_hash_cmp (const void *va, const void *vb) |
Used to sort footprint pointer entries. | |
void | make_footprint_hash () |
FootprintHashEntry * | search_footprint_hash (const char *footprint) |
Searches for the given element by "footprint" name, and loads it into the buffer. | |
int | LoadFootprintByName (BufferType *Buffer, char *Footprint) |
| |
int | LoadFootprint (int argc, char **argv, Coord x, Coord y) |
This action is called from ActionElementAddIf(). | |
bool | SmashBufferElement (BufferType *Buffer) |
Break buffer element into pieces. | |
static int | polygon_is_rectangle (PolygonType *poly) |
See if a polygon is a rectangle. | |
bool | ConvertBufferToElement (BufferType *Buffer) |
Convert buffer contents into an element. | |
bool | LoadLayoutToBuffer (BufferType *Buffer, char *Filename) |
Load PCB into buffer. | |
void | RotateBuffer (BufferType *Buffer, BYTE Number) |
Rotates the contents of the pastebuffer. | |
static void | free_rotate (Coord *x, Coord *y, Coord cx, Coord cy, double cosa, double sina) |
void | FreeRotateElementLowLevel (DataType *Data, ElementType *Element, Coord X, Coord Y, double cosa, double sina, Angle angle) |
void | FreeRotateBuffer (BufferType *Buffer, Angle angle) |
int | ActionFreeRotateBuffer (int argc, char **argv, Coord x, Coord y) |
void | InitBuffers (void) |
Initializes the buffers by allocating memory. | |
void | UninitBuffers (void) |
void | SwapBuffers (void) |
void | MirrorBuffer (BufferType *Buffer) |
void * | MoveObjectToBuffer (DataType *Destination, DataType *Src, int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Moves the passed object to the passed buffer and removes it from its original place. | |
void * | CopyObjectToBuffer (DataType *Destination, DataType *Src, int Type, void *Ptr1, void *Ptr2, void *Ptr3) |
Adds the passed object to the passed buffer. | |
Variables | |
static DataType * | Dest |
static DataType * | Source |
static ObjectFunctionType | AddBufferFunctions |
static ObjectFunctionType | MoveBufferFunctions |
static int | ExtraFlag = 0 |
static FootprintHashEntry * | footprint_hash = 0 |
int | footprint_hash_size = 0 |
static const char | loadfootprint_syntax [] |
static const char | loadfootprint_help [] |
static const char | freerotatebuffer_syntax [] |
static const char | freerotatebuffer_help [] |
HID_Action | rotate_action_list [] |
Functions used by paste- and move/copy buffer.
PCB, interactive printed circuit board design
Copyright (C) 1994,1995,1996, 2005 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.c.
Definition at line 86 of file buffer.c.
Referenced by ActionAddRats(), ActionAttributes(), ActionAutoRoute(), ActionChange2ndSize(), ActionChangeClearSize(), ActionChangeFlag(), ActionChangeHole(), ActionChangeJoin(), ActionChangeName(), ActionChangeOctagon(), ActionChangePaste(), ActionChangeSize(), ActionChangeSquare(), ActionClearOctagon(), ActionClearSquare(), ActionClrFlag(), ActionConnection(), ActionDelete(), ActionDeleteRats(), ActionDisperseElements(), ActionDisplay(), ActionElementList(), ActionElementSetAttr(), ActionExecCommand(), ActionFlip(), ActionImport(), ActionMarkCrosshair(), ActionMinClearGap(), ActionMinMaskGap(), ActionMode(), ActionMorphPolygon(), ActionMoveObject(), ActionMoveToCurrentLayer(), ActionNew(), ActionPasteBuffer(), ActionPolygon(), ActionQuit(), ActionRipUp(), ActionRouteStyle(), ActionSaveTo(), ActionSelect(), ActionSetFlag(), ActionSetOctagon(), ActionSetSquare(), ActionSetThermal(), ActionSetValue(), ActionSetViaLayers(), ActionToggleHideName(), ActionUndo(), ActionUnselect(), LoadFootprint(), and Netlist().
#define MAYBE_WARN | ( | ) |
if (onsolder && !hasParts && !warned) \ { \ warned = true; \ Message \ (_("Warning: All of the pads are on the opposite\n" \ "side from the component - that's probably not what\n" \ "you wanted\n")); \ } \
Referenced by ConvertBufferToElement().
Definition at line 1381 of file buffer.c.
References _, FreeRotateBuffer(), gui, notify_crosshair_change(), PASTEBUFFER, and hid_st::prompt_for.
Copies an arc to buffer.
Definition at line 164 of file buffer.c.
References ArcType::Clearance, CreateNewArcOnLayer(), ArcType::Delta, ExtraFlag, GetLayerNumber(), ArcType::Height, DataType::Layer, layer, MaskFlags(), ArcType::StartAngle, ArcType::Thickness, ArcType::Width, ArcType::X, and ArcType::Y.
static void * AddElementToBuffer | ( | ElementType * | Element | ) | [static] |
Copies a element to buffer.
Definition at line 216 of file buffer.c.
References CopyElementLowLevel(), and ExtraFlag.
Copies a line to buffer.
Definition at line 145 of file buffer.c.
References CreateNewLineOnLayer(), ExtraFlag, GetLayerNumber(), DataType::Layer, layer, line, MaskFlags(), and LineType::Number.
static void * AddPolygonToBuffer | ( | LayerType * | Layer, |
PolygonType * | Polygon | ||
) | [static] |
Copies a polygon to buffer.
Definition at line 192 of file buffer.c.
References CLEAR_FLAG, CopyPolygonLowLevel(), CreateNewPolygon(), ExtraFlag, GetLayerNumber(), DataType::Layer, layer, LayerType::polygon_tree, r_create_tree(), and r_insert_entry().
static void * AddRatToBuffer | ( | RatType * | Rat | ) | [static] |
Copies a rat-line to paste buffer.
Definition at line 133 of file buffer.c.
References CreateNewRat(), ExtraFlag, RatType::group1, RatType::group2, and MaskFlags().
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().
Copies a text to buffer.
Definition at line 179 of file buffer.c.
References CreateNewText(), TextType::Direction, ExtraFlag, PCBType::Font, GetLayerNumber(), DataType::Layer, layer, MaskFlags(), PCB, TextType::Scale, TextType::TextString, TextType::X, and TextType::Y.
static void * AddViaToBuffer | ( | PinType * | Via | ) | [static] |
Copies a via to paste buffer.
Definition at line 122 of file buffer.c.
References pin_st::BuriedFrom, pin_st::BuriedTo, pin_st::Clearance, CreateNewViaEx(), pin_st::DrillingHole, ExtraFlag, pin_st::Mask, MaskFlags(), pin_st::Name, pin_st::Thickness, pin_st::X, and pin_st::Y.
void clear_footprint_hash | ( | ) |
Definition at line 541 of file buffer.c.
References footprint_hash_size.
Referenced by make_footprint_hash().
void ClearBuffer | ( | BufferType * | Buffer | ) |
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 * | Buffer | ) |
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().
void* CopyObjectToBuffer | ( | DataType * | Destination, |
DataType * | Src, | ||
int | Type, | ||
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
Adds the passed object to the passed buffer.
Definition at line 1639 of file buffer.c.
References ObjectOperation().
Referenced by ActionRipUp(), and CopyObjectToUndoList().
static int footprint_hash_cmp | ( | const void * | va, |
const void * | vb | ||
) | [static] |
Used to sort footprint pointer entries.
Definition at line 561 of file buffer.c.
References FootprintHashEntry::entry_idx, FootprintHashEntry::footprint, and FootprintHashEntry::menu_idx.
Referenced by make_footprint_hash().
static void free_rotate | ( | Coord * | x, |
Coord * | y, | ||
Coord | cx, | ||
Coord | cy, | ||
double | cosa, | ||
double | sina | ||
) | [static] |
Definition at line 1228 of file buffer.c.
References cx, cy, px, and py.
Referenced by FreeRotateBuffer(), and FreeRotateElementLowLevel().
void FreeRotateBuffer | ( | BufferType * | Buffer, |
Angle | angle | ||
) |
Definition at line 1301 of file buffer.c.
References ALLARC_LOOP, ALLLINE_LOOP, ALLPOLYGON_LOOP, crosshair_update_range(), BufferType::Data, ELEMENT_LOOP, END_LOOP, ENDALL_LOOP, free_rotate(), FreeRotateElementLowLevel(), layer, line, M_PI, NormalizeAngle(), POLYGONPOINT_LOOP, r_delete_entry(), r_insert_entry(), SetBufferBoundingBox(), SetLineBoundingBox(), SetPinBoundingBox(), SetPolygonBoundingBox(), VIA_LOOP, DataType::via_tree, BufferType::X, and BufferType::Y.
Referenced by ActionFreeRotateBuffer().
void FreeRotateElementLowLevel | ( | DataType * | Data, |
ElementType * | Element, | ||
Coord | X, | ||
Coord | Y, | ||
double | cosa, | ||
double | sina, | ||
Angle | angle | ||
) |
Definition at line 1242 of file buffer.c.
References ARC_LOOP, ClearFromPolygon(), ELEMENTLINE_LOOP, ELEMENTTEXT_LOOP, END_LOOP, PCBType::Font, free_rotate(), line, ElementType::MarkX, ElementType::MarkY, n, DataType::name_tree, NormalizeAngle(), Number, PAD_LOOP, DataType::pad_tree, PCB, pin, PIN_LOOP, DataType::pin_tree, r_delete_entry(), RestoreToPolygon(), RotateTextLowLevel(), SetElementBoundingBox(), SetLineBoundingBox(), and SetPinBoundingBox().
Referenced by FreeRotateBuffer().
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().
int LoadFootprintByName | ( | BufferType * | Buffer, |
char * | Footprint | ||
) |
Definition at line 713 of file buffer.c.
References _, LibraryEntryType::AllocatedMemory, args, Concat(), LibraryEntryType::Description, LibraryMenuType::directory, EMPTY, LibraryMenuType::Entry, FootprintHashEntry::entry_idx, LibraryMenuType::EntryN, Library, SettingType::LibraryPath, SettingType::LibraryTree, LibraryEntryType::ListEntry, LoadElementToBuffer(), make_footprint_hash(), LibraryType::Menu, FootprintHashEntry::menu_idx, LibraryType::MenuN, Message(), LibraryMenuType::Name, LibraryEntryType::Package, search_footprint_hash(), Settings, LibraryMenuType::Style, LibraryEntryType::Template, and LibraryEntryType::Value.
Referenced by LoadFootprint().
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 make_footprint_hash | ( | ) |
Definition at line 576 of file buffer.c.
References LibraryEntryType::AllocatedMemory, clear_footprint_hash(), LibraryEntryType::Description, LibraryMenuType::directory, LibraryMenuType::Entry, FootprintHashEntry::entry_idx, LibraryMenuType::EntryN, FootprintHashEntry::footprint, FootprintHashEntry::footprint_allocated, footprint_hash_cmp(), footprint_hash_size, fp, Library, malloc(), LibraryType::Menu, FootprintHashEntry::menu_idx, LibraryType::MenuN, and LibraryEntryType::Template.
Referenced by LoadFootprintByName().
void MirrorBuffer | ( | BufferType * | Buffer | ) |
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 an arc to buffer.
Definition at line 295 of file buffer.c.
References LayerType::Arc, LayerType::arc_tree, LayerType::ArcN, CLEAR_FLAG, ClearFromPolygon(), GetLayerNumber(), DataType::Layer, r_create_tree(), r_delete_entry(), r_insert_entry(), and RestoreToPolygon().
static void * MoveElementToBuffer | ( | ElementType * | element | ) | [static] |
Moves a element to buffer without allocating memory for pins/names.
Definition at line 369 of file buffer.c.
References CLEAR_FLAG, ClearFromPolygon(), DataType::Element, DataType::ElementN, END_LOOP, PCBType::Font, PAD_LOOP, PCB, pin, PIN_LOOP, r_delete_element(), RestoreToPolygon(), and SetElementBoundingBox().
Moves a line to buffer.
Definition at line 270 of file buffer.c.
References CLEAR_FLAG, ClearFromPolygon(), GetLayerNumber(), DataType::Layer, LayerType::Line, LayerType::line_tree, LayerType::LineN, r_create_tree(), r_delete_entry(), r_insert_entry(), and RestoreToPolygon().
void* MoveObjectToBuffer | ( | DataType * | Destination, |
DataType * | Src, | ||
int | Type, | ||
void * | Ptr1, | ||
void * | Ptr2, | ||
void * | Ptr3 | ||
) |
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().
static void * MovePolygonToBuffer | ( | LayerType * | layer, |
PolygonType * | polygon | ||
) | [static] |
Moves a polygon to buffer.
Doesn't allocate memory for the points.
Definition at line 345 of file buffer.c.
References CLEAR_FLAG, GetLayerNumber(), DataType::Layer, LayerType::Polygon, LayerType::polygon_tree, LayerType::PolygonN, r_create_tree(), r_delete_entry(), and r_insert_entry().
static void * MoveRatToBuffer | ( | RatType * | rat | ) | [static] |
Moves a rat-line to paste buffer.
Definition at line 249 of file buffer.c.
References CLEAR_FLAG, r_create_tree(), r_delete_entry(), r_insert_entry(), DataType::Rat, DataType::rat_tree, and DataType::RatN.
Moves a text to buffer without allocating memory for the name.
Definition at line 320 of file buffer.c.
References ClearFromPolygon(), GetLayerNumber(), DataType::Layer, r_create_tree(), r_delete_entry(), r_insert_entry(), RestoreToPolygon(), LayerType::Text, LayerType::text_tree, and LayerType::TextN.
static void * MoveViaToBuffer | ( | PinType * | via | ) | [static] |
Moves a via to paste buffer without allocating memory for the name.
Definition at line 226 of file buffer.c.
References CLEAR_FLAG, ClearFromPolygon(), r_create_tree(), r_delete_entry(), r_insert_entry(), RestoreToPolygon(), DataType::Via, DataType::via_tree, and DataType::ViaN.
static int polygon_is_rectangle | ( | PolygonType * | poly | ) | [static] |
See if a polygon is a rectangle.
If so, canonicalize it.
Definition at line 938 of file buffer.c.
References polygon_st::HoleIndexN, polygon_st::PointN, polygon_st::Points, X, PointType::X, and PointType::Y.
Referenced by ConvertBufferToElement().
void RotateBuffer | ( | BufferType * | Buffer, |
BYTE | Number | ||
) |
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().
FootprintHashEntry* search_footprint_hash | ( | const char * | footprint | ) |
Searches for the given element by "footprint" name, and loads it into the buffer.
Figuring out which library entry is the one we want is a little tricky. For file-based footprints, it's just a matter of finding the first match in the search list. For m4-based footprints you need to know what magic to pass to the m4 functions. Fortunately, the footprint needed is determined when we build the m4 libraries and stored as a comment in the description, so we can search for that to find the magic we need. We use a hash to store the corresponding footprints and pointers to the library tree so we can quickly find the various bits we need to load a given footprint.
Definition at line 678 of file buffer.c.
References c, footprint_hash_size, max, and min.
Referenced by LoadFootprintByName().
void SetBufferBoundingBox | ( | BufferType * | Buffer | ) |
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 * | Buffer | ) |
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().
static void SwapBuffer | ( | BufferType * | Buffer | ) | [static] |
Flip components/tracks from one side to the other.
Definition at line 1499 of file buffer.c.
References ALLARC_LOOP, ALLLINE_LOOP, ALLPIN_LOOP, ALLPOLYGON_LOOP, ALLTEXT_LOOP, ASSIGN_THERM, bottom_group, BOTTOM_SIDE, bottom_silk_layer, crosshair_update_range(), BufferType::Data, ELEMENT_LOOP, END_LOOP, ENDALL_LOOP, LayerGroupType::Entries, PCBType::Font, GetLayerGroupNumberBySide(), DataType::Layer, layer, PCBType::LayerGroups, line, max_copper_layer, MirrorElementCoordinates(), LayerGroupType::Number, PCB, pin, POLYGONPOINT_LOOP, r_delete_element(), r_delete_entry(), r_insert_entry(), SetArcBoundingBox(), SetBufferBoundingBox(), SetLineBoundingBox(), SetPinBoundingBox(), SetPolygonBoundingBox(), SetTextBoundingBox(), SWAP_ANGLE, SWAP_DELTA, SWAP_X, SWAP_Y, TEST_THERM, TOGGLE_FLAG, top_group, TOP_SIDE, top_silk_layer, VIA_LOOP, DataType::via_tree, BufferType::X, and BufferType::Y.
Referenced by LoadElementToBuffer(), and SwapBuffers().
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().
ObjectFunctionType AddBufferFunctions [static] |
{ AddLineToBuffer, AddTextToBuffer, AddPolygonToBuffer, AddViaToBuffer, AddElementToBuffer, NULL, NULL, NULL, NULL, NULL, AddArcToBuffer, AddRatToBuffer }
Definition at line 91 of file buffer.c.
Referenced by CopyElementLowLevel().
int ExtraFlag = 0 [static] |
Definition at line 116 of file buffer.c.
Referenced by AddArcToBuffer(), AddElementToBuffer(), AddLineToBuffer(), AddPolygonToBuffer(), AddRatToBuffer(), AddSelectedToBuffer(), AddTextToBuffer(), and AddViaToBuffer().
FootprintHashEntry* footprint_hash = 0 [static] |
int footprint_hash_size = 0 |
Definition at line 538 of file buffer.c.
Referenced by clear_footprint_hash(), make_footprint_hash(), and search_footprint_hash().
const char freerotatebuffer_help[] [static] |
const char freerotatebuffer_syntax[] [static] |
const char loadfootprint_help[] [static] |
const char loadfootprint_syntax[] [static] |
{ MoveLineToBuffer, MoveTextToBuffer, MovePolygonToBuffer, MoveViaToBuffer, MoveElementToBuffer, NULL, NULL, NULL, NULL, NULL, MoveArcToBuffer, MoveRatToBuffer}
Definition at line 106 of file buffer.c.
Referenced by MoveObjectToBuffer().
{ {"FreeRotateBuffer", 0, ActionFreeRotateBuffer, freerotatebuffer_syntax, freerotatebuffer_help}, {"LoadFootprint", 0, LoadFootprint, loadfootprint_syntax, loadfootprint_help} }