pcb 4.1.1
An interactive printed circuit board layout editor.

copy.c File Reference

Functions used to copy pins, elements ... More...

#include <stdlib.h>
#include "global.h"
#include "copy.h"
#include "create.h"
#include "data.h"
#include "draw.h"
#include "mymem.h"
#include "mirror.h"
#include "misc.h"
#include "move.h"
#include "polygon.h"
#include "rats.h"
#include "rtree.h"
#include "select.h"
#include "undo.h"
Include dependency graph for copy.c:

Go to the source code of this file.

Functions

static void * CopyVia (PinType *Via)
 Copies a via.
static void * CopyLine (LayerType *Layer, LineType *Line)
 Copies a line.
static void * CopyArc (LayerType *Layer, ArcType *Arc)
 Copies an arc.
static void * CopyText (LayerType *Layer, TextType *Text)
 Copies a text.
static void * CopyPolygon (LayerType *Layer, PolygonType *Polygon)
 Copies a polygon.
static void * CopyElement (ElementType *Element)
 Copies an element onto the PCB, then does a draw.
PolygonTypeCopyPolygonLowLevel (PolygonType *Dest, PolygonType *Src)
 Copies data from one polygon to another.
ElementTypeCopyElementLowLevel (DataType *Data, ElementType *Src, bool uniqueName, Coord dx, Coord dy, int mask_flags)
 Copies data from one element to another and creates the destination if necessary.
bool CopyPastebufferToLayout (Coord X, Coord Y)
 Pastes the contents of the buffer to the layout.
void * CopyObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
 Copies the object identified by its data pointers and the type the new objects is moved by DX,DY.

Variables

static Coord DeltaX
static Coord DeltaY
static ObjectFunctionType CopyFunctions

Detailed Description

Functions used to copy pins, elements ...

It's necessary to copy data by calling create... since the base pointer may change cause of dynamic memory allocation.


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 copy.c.


Function Documentation

static void * CopyArc ( LayerType Layer,
ArcType Arc 
) [static]
static void * CopyElement ( ElementType Element) [static]
static void * CopyLine ( LayerType Layer,
LineType Line 
) [static]

Copies a line.

Definition at line 208 of file copy.c.

References AddObjectToCreateUndoList(), CreateDrawnLineOnLayer(), DeltaX, DeltaY, DrawLine(), line, MaskFlags(), and LineType::Number.

Referenced by CopyPastebufferToLayout().

Here is the call graph for this function:

void* CopyObject ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3,
Coord  DX,
Coord  DY 
)

Copies the object identified by its data pointers and the type the new objects is moved by DX,DY.

Note:
I assume that the appropriate layer ... is switched on.

Definition at line 418 of file copy.c.

References DeltaX, DeltaY, IncrementUndoSerialNumber(), ObjectOperation(), and ptr.

Referenced by NotifyMode().

Here is the call graph for this function:

bool CopyPastebufferToLayout ( Coord  X,
Coord  Y 
)
static void * CopyPolygon ( LayerType Layer,
PolygonType Polygon 
) [static]
PolygonType* CopyPolygonLowLevel ( PolygonType Dest,
PolygonType Src 
)

Copies data from one polygon to another.

'Dest' has to exist.

Definition at line 97 of file copy.c.

References CLEAR_FLAG, CreateNewHoleInPolygon(), CreateNewPointInPolygon(), polygon_st::HoleIndex, n, polygon_st::PointN, polygon_st::Points, SetPolygonBoundingBox(), PointType::X, and PointType::Y.

Referenced by AddPolygonToBuffer(), and CopyPolygon().

Here is the call graph for this function:

static void * CopyText ( LayerType Layer,
TextType Text 
) [static]

Copies a text.

Definition at line 250 of file copy.c.

References AddObjectToCreateUndoList(), CreateNewText(), DeltaX, DeltaY, TextType::Direction, DrawText(), PCBType::Font, MaskFlags(), PCB, TextType::Scale, TextType::TextString, TextType::X, and TextType::Y.

Referenced by CopyPastebufferToLayout().

Here is the call graph for this function:

static void * CopyVia ( PinType Via) [static]

Variable Documentation

Initial value:
 {
  CopyLine,
  CopyText,
  CopyPolygon,
  CopyVia,
  CopyElement,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  CopyArc,
  NULL
}

Definition at line 76 of file copy.c.