pcb 4.1.1
An interactive printed circuit board layout editor.
|
Prototypes for create routines. More...
#include "global.h"
Go to the source code of this file.
Functions | |
void | CreateBeLenient (bool) |
Set the lenience mode. | |
DataType * | CreateNewBuffer (void) |
Creates a new paste buffer. | |
void | pcb_colors_from_settings (PCBType *) |
Perhaps PCB should internally just use the Settings colors? | |
PCBType * | CreateNewPCB () |
Creates a new PCB. | |
int | CreateNewPCBPost (PCBType *, int) |
This post-processing step adds the top and bottom silk layers to a pre-existing PCB. | |
PinType * | CreateNewVia (DataType *, Coord, Coord, Coord, Coord, Coord, Coord, char *, FlagType) |
Creates a new via. | |
PinType * | CreateNewViaEx (DataType *, Coord, Coord, Coord, Coord, Coord, Coord, char *, FlagType, Cardinal buried_from, Cardinal buried_to) |
Creates a new via with buried info. | |
LineType * | CreateDrawnLineOnLayer (LayerType *, Coord, Coord, Coord, Coord, Coord, Coord, FlagType) |
Creates a new line on a layer and checks for overlap and extension. | |
LineType * | CreateNewLineOnLayer (LayerType *, Coord, Coord, Coord, Coord, Coord, Coord, FlagType) |
RatType * | CreateNewRat (DataType *, Coord, Coord, Coord, Coord, Cardinal, Cardinal, Coord, FlagType) |
Creates a new rat-line. | |
ArcType * | CreateNewArcOnLayer (LayerType *, Coord, Coord, Coord, Coord, Angle, Angle, Coord, Coord, FlagType) |
Creates a new arc on a layer. | |
PolygonType * | CreateNewPolygonFromRectangle (LayerType *, Coord, Coord, Coord, Coord, FlagType) |
Creates a new polygon from the old formats rectangle data. | |
TextType * | CreateNewText (LayerType *, FontType *, Coord, Coord, unsigned, int, char *, FlagType) |
Creates a new text on a layer. | |
PolygonType * | CreateNewPolygon (LayerType *, FlagType) |
Creates a new polygon on a layer. | |
PointType * | CreateNewPointInPolygon (PolygonType *, Coord, Coord) |
Creates a new point in a polygon. | |
PolygonType * | CreateNewHoleInPolygon (PolygonType *polygon) |
Creates a new hole in a polygon. | |
ElementType * | CreateNewElement (DataType *, FontType *, FlagType, char *, char *, char *, Coord, Coord, BYTE, int, FlagType, bool) |
Creates an new element. | |
LineType * | CreateNewLineInElement (ElementType *, Coord, Coord, Coord, Coord, Coord) |
Creates a new line for an element. | |
ArcType * | CreateNewArcInElement (ElementType *, Coord, Coord, Coord, Coord, Angle, Angle, Coord) |
Creates a new arc in an element. | |
PinType * | CreateNewPin (ElementType *, Coord, Coord, Coord, Coord, Coord, Coord, char *, char *, FlagType) |
Creates a new pin in an element. | |
PadType * | CreateNewPad (ElementType *, Coord, Coord, Coord, Coord, Coord, Coord, Coord, char *, char *, FlagType) |
Creates a new pad in an element. | |
LineType * | CreateNewLineInSymbol (SymbolType *, Coord, Coord, Coord, Coord, Coord) |
Creates a new line in a symbol. | |
void | CreateDefaultFont (PCBType *) |
Parses a file with font information and installs it into the provided PCB. | |
RubberbandType * | CreateNewRubberbandEntry (LayerType *, LineType *, PointType *) |
Adds a new line to the rubberband list of 'Crosshair.AttachedObject'. | |
LibraryMenuType * | CreateNewNet (LibraryType *, char *, char *) |
Add a new net to the netlist menu. | |
LibraryEntryType * | CreateNewConnection (LibraryMenuType *, char *) |
Add a connection to the net. | |
AttributeType * | CreateNewAttribute (AttributeListType *list, char *name, char *value) |
Add an attribute to a list.. |
Prototypes for create 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 create.h.
void CreateBeLenient | ( | bool | v | ) |
Set the lenience mode.
TRUE
during file loads, for example to allow overlapping vias.
FALSE
otherwise, to stop the user from doing normally dangerous things.
Definition at line 86 of file create.c.
References be_lenient.
Referenced by Parse().
void CreateDefaultFont | ( | PCBType * | pcb | ) |
Parses a file with font information and installs it into the provided PCB.
Checks directories given as colon separated list by resource fontPath if the fonts filename doesn't contain a directory component.
Definition at line 999 of file create.c.
References _, PCBType::Font, SettingType::FontFile, Message(), ParseFont(), and Settings.
Referenced by CreateNewPCB().
LineType* CreateDrawnLineOnLayer | ( | LayerType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
FlagType | |||
) |
Creates a new line on a layer and checks for overlap and extension.
Definition at line 460 of file create.c.
References line_info::ans, line_info::Clearance, CreateNewLineOnLayer(), line_info::env, line_info::Flags, line_callback(), LayerType::line_tree, MAX, MIN, MoveObjectToRemoveUndoList(), NoFlags, r_search(), line_info::test, line_info::Thickness, line_info::X1, BoxType::X1, line_info::X2, line_info::Y1, and line_info::Y2.
Referenced by CopyLine(), escape(), export_pcb_drawline(), FontEdit(), InsertPointIntoLine(), InsertPointIntoRat(), IronDownAllUnfixedPaths(), and NotifyMode().
ArcType* CreateNewArcInElement | ( | ElementType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Angle | , | ||
Angle | , | ||
Coord | |||
) |
Creates a new arc in an element.
Definition at line 769 of file create.c.
References ElementType::Arc, ElementType::ArcN, ArcType::Delta, ArcType::Height, ID, NormalizeAngle(), ArcType::StartAngle, line_info::Thickness, ArcType::Thickness, ArcType::Width, X, ArcType::X, Y, and ArcType::Y.
Referenced by ConvertBufferToElement(), and CopyElementLowLevel().
ArcType* CreateNewArcOnLayer | ( | LayerType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Angle | , | ||
Angle | , | ||
Coord | , | ||
Coord | , | ||
FlagType | |||
) |
Creates a new arc on a layer.
Definition at line 580 of file create.c.
References ARC_LOOP, LayerType::arc_tree, line_info::Clearance, ArcType::Clearance, ArcType::Delta, END_LOOP, line_info::Flags, GetArcMemory(), ArcType::Height, ID, NormalizeAngle(), r_create_tree(), r_insert_entry(), SetArcBoundingBox(), ArcType::StartAngle, line_info::Thickness, ArcType::Thickness, ArcType::Width, ArcType::X, line_info::X1, ArcType::Y, and line_info::Y1.
Referenced by AddArcToBuffer(), check_line_callback(), CopyArc(), create_arc(), export_pcb_drawarc(), NotifyMode(), and SmashBufferElement().
AttributeType* CreateNewAttribute | ( | AttributeListType * | list, |
char * | name, | ||
char * | value | ||
) |
Add an attribute to a list..
Definition at line 1062 of file create.c.
References AttributeListType::List, AttributeListType::Max, AttributeType::name, AttributeListType::Number, realloc(), STRDUP, and AttributeType::value.
Referenced by ActionElementSetAttr(), and CopyElementLowLevel().
DataType* CreateNewBuffer | ( | void | ) |
Creates a new paste buffer.
Definition at line 95 of file create.c.
References PCB, and DataType::pcb.
Referenced by CopyObjectToUndoList(), CreateNewPCB(), InitBuffers(), MoveObjectToRemoveUndoList(), and UndoCopyOrCreate().
LibraryEntryType* CreateNewConnection | ( | LibraryMenuType * | , |
char * | |||
) |
Add a connection to the net.
Definition at line 1050 of file create.c.
References GetLibraryEntryMemory(), LibraryEntryType::ListEntry, and STRDUP.
Referenced by netlist_add().
ElementType* CreateNewElement | ( | DataType * | Data, |
FontType * | PCBFont, | ||
FlagType | Flags, | ||
char * | Description, | ||
char * | NameOnPCB, | ||
char * | Value, | ||
Coord | TextX, | ||
Coord | TextY, | ||
BYTE | Direction, | ||
int | TextScale, | ||
FlagType | TextFlags, | ||
bool | uniqueName | ||
) |
Creates an new element.
Definition at line 729 of file create.c.
References AddTextToElement(), DESCRIPTION_TEXT, line_info::Flags, GetElementMemory(), ID, MAX, NAMEONPCB_TEXT, UniqueElementName(), and VALUE_TEXT.
Referenced by ConvertBufferToElement(), and CopyElementLowLevel().
PolygonType* CreateNewHoleInPolygon | ( | PolygonType * | polygon | ) |
Creates a new hole in a polygon.
Definition at line 716 of file create.c.
References GetHoleIndexMemoryInPolygon(), polygon_st::PointN, and Polygon.
Referenced by CopyPolygonLowLevel(), and PolyToPolygonsOnLayer().
Creates a new line for an element.
Definition at line 807 of file create.c.
References ID, ElementType::Line, line, ElementType::LineN, NoFlags, line_info::Thickness, line_info::X1, line_info::X2, line_info::Y1, and line_info::Y2.
Referenced by ConvertBufferToElement(), and CopyElementLowLevel().
Creates a new line in a symbol.
Definition at line 966 of file create.c.
References SymbolType::Line, line, SymbolType::LineMax, SymbolType::LineN, realloc(), STEP_SYMBOLLINE, line_info::Thickness, line_info::X1, line_info::X2, line_info::Y1, and line_info::Y2.
Referenced by FontSave().
LineType* CreateNewLineOnLayer | ( | LayerType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
FlagType | |||
) |
Definition at line 515 of file create.c.
References CLEAR_FLAG, line_info::Clearance, line_info::Flags, GetLineMemory(), ID, line_info::Line, LayerType::line_tree, r_create_tree(), r_insert_entry(), SetLineBoundingBox(), line_info::Thickness, line_info::X1, line_info::X2, line_info::Y1, and line_info::Y2.
Referenced by AddLineToBuffer(), create_line(), create_pcb_line(), CreateDrawnLineOnLayer(), MoveRatToLayer(), RD_DrawLine(), and SmashBufferElement().
LibraryMenuType* CreateNewNet | ( | LibraryType * | , |
char * | , | ||
char * | |||
) |
Add a new net to the netlist menu.
Definition at line 1030 of file create.c.
References LibraryMenuType::flag, GetLibraryMenuMemory(), LibraryMenuType::Name, NSTRCMP, and LibraryMenuType::Style.
Referenced by netlist_add().
PadType* CreateNewPad | ( | ElementType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
char * | , | ||
char * | , | ||
FlagType | |||
) |
Creates a new pad in an element.
Definition at line 905 of file create.c.
References CLEAR_FLAG, line_info::Clearance, pad_st::Element, line_info::Flags, GetPadMemory(), ID, Mask, pad_st::Mask, pad_st::Name, pad_st::Number, STRDUP, line_info::Thickness, line_info::X1, line_info::X2, line_info::Y1, and line_info::Y2.
Referenced by ConvertBufferToElement(), and CopyElementLowLevel().
PCBType* CreateNewPCB | ( | ) |
Creates a new PCB.
Definition at line 151 of file create.c.
References SettingType::AllDirectionLines, SettingType::AutoBuriedVias, SettingType::AutoDRC, SettingType::Bloat, PCBType::Bloat, SettingType::ClearLine, PCBType::Clipping, CreateDefaultFont(), CreateNewBuffer(), PCBType::Data, SettingType::DefaultLayerName, END_LOOP, SettingType::FullPoly, SettingType::Grid, PCBType::Grid, ID, PCBType::ID, RouteStyleType::index, PCBType::IsleArea, DataType::Layer, SettingType::LayerGroups, PCBType::LayerGroups, SettingType::liveRouting, SettingType::MaxHeight, PCBType::MaxHeight, SettingType::MaxWidth, PCBType::MaxWidth, SettingType::minDrill, PCBType::minDrill, SettingType::minRing, PCBType::minRing, SettingType::minSlk, PCBType::minSlk, SettingType::minWid, PCBType::minWid, n, LayerType::Name, SettingType::OrthogonalMoves, DataType::pcb, DataType::polyClip, ptr, PCBType::RatDraw, SettingType::RouteStyle, SettingType::RubberBandMode, SET_FLAG, Settings, SettingType::ShowDRC, SettingType::ShowNumber, SettingType::Shrink, PCBType::Shrink, PCBType::SilkActive, SettingType::SnapPin, style, STYLE_LOOP, SettingType::SwapStartDirection, PCBType::ThermScale, PCBType::ThermStyle, and SettingType::UniqueNames.
Referenced by ActionNew(), LoadLayoutToBuffer(), main(), and real_load_pcb().
int CreateNewPCBPost | ( | PCBType * | pcb, |
int | use_defaults | ||
) |
This post-processing step adds the top and bottom silk layers to a pre-existing PCB.
Called after PCB->Data->LayerN is set.
Definition at line 231 of file create.c.
References bottom_silk_layer, PCBType::Data, SettingType::Groups, DataType::Layer, PCBType::LayerGroups, DataType::LayerN, LT_SILK, LayerType::Name, ParseGroupString(), pcb_colors_from_settings(), Settings, top_silk_layer, and LayerType::Type.
Referenced by ActionNew(), main(), and real_load_pcb().
PinType* CreateNewPin | ( | ElementType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
char * | , | ||
char * | , | ||
FlagType | |||
) |
Creates a new pin in an element.
Definition at line 836 of file create.c.
References _, unit::allow, CLEAR_FLAG, line_info::Clearance, pin_st::Clearance, pin_st::DrillingHole, pin_st::Element, line_info::Flags, GetPinMemory(), SettingType::grid_unit, ID, Mask, pin_st::Mask, Message(), pin_st::Name, pin_st::Number, pin, SET_FLAG, Settings, STRDUP, TEST_FLAG, line_info::Thickness, pin_st::Thickness, UNKNOWN, vendorDrillMap(), vendorIsElementMappable(), X, pin_st::X, Y, and pin_st::Y.
Referenced by ConvertBufferToElement(), and CopyElementLowLevel().
PointType* CreateNewPointInPolygon | ( | PolygonType * | , |
Coord | , | ||
Coord | |||
) |
Creates a new point in a polygon.
Definition at line 701 of file create.c.
References GetPointMemoryInPolygon(), ID, PointType::ID, X, PointType::X, Y, and PointType::Y.
Referenced by CopyPolygonLowLevel(), CreateNewPolygonFromRectangle(), InsertPointIntoPolygon(), MorphPolygon(), NotifyMode(), and PolyToPolygonsOnLayer().
PolygonType* CreateNewPolygon | ( | LayerType * | , |
FlagType | |||
) |
Creates a new polygon on a layer.
Definition at line 684 of file create.c.
References polygon_st::Clipped, line_info::Flags, GetPolygonMemory(), ID, polygon_st::NoHoles, and polygon_st::NoHolesValid.
Referenced by AddPolygonToBuffer(), CopyAttachedPolygonToLayer(), CopyPolygon(), CreateNewPolygonFromRectangle(), MorphPolygon(), and PolyToPolygonsOnLayer().
PolygonType* CreateNewPolygonFromRectangle | ( | LayerType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
FlagType | |||
) |
Creates a new polygon from the old formats rectangle data.
Definition at line 624 of file create.c.
References CreateNewPointInPolygon(), CreateNewPolygon(), LayerType::polygon_tree, r_create_tree(), r_insert_entry(), and SetPolygonBoundingBox().
Referenced by NotifyMode().
RatType* CreateNewRat | ( | DataType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Cardinal | , | ||
Cardinal | , | ||
Coord | , | ||
FlagType | |||
) |
Creates a new rat-line.
Definition at line 548 of file create.c.
References line_info::Flags, GetRatMemory(), RatType::group1, RatType::group2, ID, line_info::Line, r_create_tree(), r_insert_entry(), DataType::rat_tree, SET_FLAG, SetLineBoundingBox(), line_info::Thickness, line_info::X1, line_info::X2, line_info::Y1, and line_info::Y2.
Referenced by AddNet(), AddRatToBuffer(), and DrawShortestRats().
RubberbandType* CreateNewRubberbandEntry | ( | LayerType * | Layer, |
LineType * | Line, | ||
PointType * | MovedPoint | ||
) |
Adds a new line to the rubberband list of 'Crosshair.AttachedObject'.
If Layer == 0 it is a rat line.
Definition at line 1012 of file create.c.
References GetRubberbandMemory(), Layer, RubberbandType::Layer, line_info::Line, RubberbandType::Line, RubberbandType::MovedPoint, ptr, and TOGGLE_FLAG.
Referenced by CheckPolygonForRubberbandConnection(), rat_callback(), and rubber_callback().
TextType* CreateNewText | ( | LayerType * | , |
FontType * | , | ||
Coord | , | ||
Coord | , | ||
unsigned | , | ||
int | , | ||
char * | , | ||
FlagType | |||
) |
Creates a new text on a layer.
Definition at line 648 of file create.c.
References TextType::Direction, line_info::Flags, GetTextMemory(), ID, r_create_tree(), r_insert_entry(), TextType::Scale, SetTextBoundingBox(), LayerType::text_tree, TextType::TextString, X, TextType::X, Y, and TextType::Y.
Referenced by AddTextToBuffer(), CopyText(), and NotifyMode().
PinType* CreateNewVia | ( | DataType * | , |
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
Coord | , | ||
char * | , | ||
FlagType | |||
) |
Creates a new via.
Definition at line 254 of file create.c.
References _, unit::allow, be_lenient, pin_st::BuriedFrom, pin_st::BuriedTo, CLEAR_FLAG, pin_st::Clearance, Distance(), pin_st::DrillingHole, END_LOOP, GetViaMemory(), SettingType::grid_unit, ID, Mask, pin_st::Mask, Message(), pin_st::Name, r_create_tree(), r_insert_entry(), SET_FLAG, SetPinBoundingBox(), Settings, STRDUP, TEST_FLAG, pin_st::Thickness, vendorDrillMap(), VIA_LOOP, DataType::via_tree, X, pin_st::X, Y, and pin_st::Y.
Referenced by CreateNewViaEx(), escape(), IronDownAllUnfixedPaths(), NotifyMode(), RD_DrawVia(), and SmashBufferElement().
PinType* CreateNewViaEx | ( | DataType * | Data, |
Coord | X, | ||
Coord | Y, | ||
Coord | Thickness, | ||
Coord | Clearance, | ||
Coord | Mask, | ||
Coord | DrillingHole, | ||
char * | Name, | ||
FlagType | Flags, | ||
Cardinal | buried_from, | ||
Cardinal | buried_to | ||
) |
Creates a new via with buried info.
*
Definition at line 325 of file create.c.
References pin_st::BuriedFrom, pin_st::BuriedTo, and CreateNewVia().
Referenced by AddViaToBuffer(), CopyVia(), moveline_callback(), and NotifyMode().
void pcb_colors_from_settings | ( | PCBType * | ptr | ) |
Perhaps PCB should internally just use the Settings colors?
For now, use this to set PCB colors so the config can reassign PCB colors.
Definition at line 110 of file create.c.
References bottom_silk_layer, LayerType::Color, SettingType::ConnectedColor, PCBType::ConnectedColor, PCBType::Data, SettingType::ElementColor, PCBType::ElementColor, SettingType::ElementSelectedColor, PCBType::ElementSelectedColor, SettingType::FoundColor, PCBType::FoundColor, SettingType::InvisibleMarkColor, PCBType::InvisibleMarkColor, SettingType::InvisibleObjectsColor, PCBType::InvisibleObjectsColor, DataType::Layer, SettingType::LayerColor, SettingType::LayerSelectedColor, SettingType::MaskColor, PCBType::MaskColor, SettingType::PinColor, PCBType::PinColor, SettingType::PinNameColor, PCBType::PinNameColor, SettingType::PinSelectedColor, PCBType::PinSelectedColor, SettingType::RatColor, PCBType::RatColor, SettingType::RatSelectedColor, PCBType::RatSelectedColor, LayerType::SelectedColor, Settings, SettingType::ShowBottomSide, top_silk_layer, SettingType::ViaColor, PCBType::ViaColor, SettingType::ViaSelectedColor, PCBType::ViaSelectedColor, SettingType::WarnColor, and PCBType::WarnColor.
Referenced by CreateNewPCBPost(), ghid_layer_buttons_color_update(), and LayersChanged().