pcb 4.1.1
An interactive printed circuit board layout editor.

buffer.h File Reference

Prototypes for buffer handling routines. More...

#include "global.h"
Include dependency graph for buffer.h:
This graph shows which files directly or indirectly include this file:

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

Detailed Description

Prototypes for buffer handling routines.


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 buffer.h.


Function Documentation

void AddSelectedToBuffer ( BufferType Buffer,
Coord  X,
Coord  Y,
bool  LeaveSelected 
)

Copies all selected and visible objects to the paste buffer.

Returns:
true if any objects have been removed.

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

Here is the call graph for this function:

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

Here is the call graph for this function:

void* CopyObjectToBuffer ( DataType ,
DataType ,
int  ,
void *  ,
void *  ,
void *   
)

Adds the passed object to the passed buffer.

Definition at line 1639 of file buffer.c.

References ObjectOperation().

Referenced by ActionRipUp(), and CopyObjectToUndoList().

Here is the call graph for this function:

void InitBuffers ( void  )

Initializes the buffers by allocating memory.

Definition at line 1400 of file buffer.c.

References Buffers, and CreateNewBuffer().

Referenced by main().

Here is the call graph for this function:

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

Returns:
false on error, if successful, update some other stuff and reposition the pastebuffer.

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

Here is the call graph for this function:

int LoadFootprint ( int  argc,
char **  argv,
Coord  x,
Coord  y 
)

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

Here is the call graph for this function:

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

Here is the call graph for this function:

void* MoveObjectToBuffer ( DataType ,
DataType ,
int  ,
void *  ,
void *  ,
void *   
)

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

Here is the call graph for this function:

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

Here is the call graph for this function:

void SwapBuffers ( void  )

Definition at line 1421 of file buffer.c.

References Buffers, crosshair_update_range(), and SwapBuffer().

Referenced by SaveBufferElements().

Here is the call graph for this function:

void UninitBuffers ( void  )

Definition at line 1409 of file buffer.c.

References Buffers, and ClearBuffer().

Referenced by pcb_main_uninit().

Here is the call graph for this function: