![]() |
KiCad PCB EDA Suite
|
#include <kicad_clipboard.h>
Public Member Functions | |
CLIPBOARD_IO () | |
~CLIPBOARD_IO () | |
void | Save (const wxString &aFileName, BOARD *aBoard, const PROPERTIES *aProperties=nullptr) override |
Write aBoard to a storage file in a format that this PLUGIN implementation knows about or it can be used to write a portion of aBoard to a special kind of export file. More... | |
void | SaveSelection (const PCB_SELECTION &selected, bool isFootprintEditor) |
BOARD_ITEM * | Parse () |
BOARD * | Load (const wxString &aFileName, BOARD *aAppendToMe, const PROPERTIES *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override |
Load information from some input file format that this PLUGIN implementation knows about into either a new BOARD or an existing one. More... | |
void | SetBoard (BOARD *aBoard) |
const wxString | PluginName () const override |
Return a brief hard coded name for this PLUGIN. More... | |
const wxString | GetFileExtension () const override |
Returns the file extension for the PLUGIN. More... | |
BOARD * | DoLoad (LINE_READER &aReader, BOARD *aAppendToMe, const PROPERTIES *aProperties, PROGRESS_REPORTER *aProgressReporter, unsigned aLineCount) |
void | FootprintEnumerate (wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const PROPERTIES *aProperties=nullptr) override |
Return a list of footprint names contained within the library at aLibraryPath. More... | |
const FOOTPRINT * | GetEnumeratedFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=nullptr) override |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management. More... | |
bool | FootprintExists (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=nullptr) override |
Check for the existence of a footprint. More... | |
FOOTPRINT * | FootprintLoad (const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const PROPERTIES *aProperties=nullptr) override |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN knows about. More... | |
void | FootprintSave (const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const PROPERTIES *aProperties=nullptr) override |
Write aFootprint to an existing library located at aLibraryPath. More... | |
void | FootprintDelete (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=nullptr) override |
Delete aFootprintName from the library at aLibraryPath. More... | |
long long | GetLibraryTimestamp (const wxString &aLibraryPath) const override |
Generate a timestamp representing all the files in the library (including the library directory). More... | |
void | FootprintLibCreate (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override |
Create a new empty footprint library at aLibraryPath empty. More... | |
bool | FootprintLibDelete (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override |
Delete an existing footprint library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason. More... | |
bool | IsFootprintLibWritable (const wxString &aLibraryPath) override |
Return true if the library at aLibraryPath is writable. More... | |
void | Format (const BOARD_ITEM *aItem, int aNestLevel=0) const |
Output aItem to aFormatter in s-expression format. More... | |
std::string | GetStringOutput (bool doClear) |
void | SetOutputFormatter (OUTPUTFORMATTER *aFormatter) |
BOARD_ITEM * | Parse (const wxString &aClipboardSourceInput) |
virtual std::vector< FOOTPRINT * > | GetImportedCachedLibraryFootprints () |
Return a container with the cached library footprints generated in the last call to Load. More... | |
virtual void | PrefetchLib (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) |
If possible, prefetches the specified library (e.g. More... | |
virtual void | FootprintLibOptions (PROPERTIES *aListToAppendTo) const |
Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions. More... | |
Protected Member Functions | |
void | validateCache (const wxString &aLibraryPath, bool checkModified=true) |
const FOOTPRINT * | getFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties, bool checkModified) |
void | init (const PROPERTIES *aProperties) |
void | formatSetup (const BOARD *aBoard, int aNestLevel=0) const |
formats the board setup information More... | |
void | formatGeneral (const BOARD *aBoard, int aNestLevel=0) const |
formats the General section of the file More... | |
void | formatBoardLayers (const BOARD *aBoard, int aNestLevel=0) const |
formats the board layer information More... | |
void | formatNetInformation (const BOARD *aBoard, int aNestLevel=0) const |
formats the Nets and Netclasses More... | |
void | formatProperties (const BOARD *aBoard, int aNestLevel=0) const |
formats the Nets and Netclasses More... | |
void | formatHeader (const BOARD *aBoard, int aNestLevel=0) const |
writes everything that comes before the board_items, like settings and layers etc More... | |
Protected Attributes | |
wxString | m_error |
for throwing exceptions More... | |
BOARD * | m_board |
which BOARD, no ownership here More... | |
const PROPERTIES * | m_props |
passed via Save() or Load(), no ownership, may be NULL. More... | |
FP_CACHE * | m_cache |
Footprint library cache. More... | |
LINE_READER * | m_reader |
no ownership here. More... | |
wxString | m_filename |
for saves only, name is in m_reader for loads More... | |
STRING_FORMATTER | m_sf |
OUTPUTFORMATTER * | m_out |
output any Format()s to this, no ownership More... | |
int | m_ctl |
PCB_PARSER * | m_parser |
NETINFO_MAPPING * | m_mapping |
mapping for net codes, so only not empty net codes are stored with consecutive integers as net codes More... | |
Private Attributes | |
STRING_FORMATTER | m_formatter |
Definition at line 41 of file kicad_clipboard.h.
CLIPBOARD_IO::CLIPBOARD_IO | ( | ) |
Definition at line 44 of file kicad_clipboard.cpp.
References m_formatter, and PCB_PLUGIN::m_out.
CLIPBOARD_IO::~CLIPBOARD_IO | ( | ) |
Definition at line 52 of file kicad_clipboard.cpp.
|
inherited |
Definition at line 2320 of file pcb_plugin.cpp.
References _, PCB_PARSER::GetRequiredVersion(), PCB_PLUGIN::init(), PCB_PARSER::IsTooRecent(), PCB_PLUGIN::m_parser, PCB_PARSER::Parse(), PCB_PARSER::SetBoard(), PCB_PARSER::SetLineReader(), PCB_PARSER::SetProgressReporter(), and THROW_PARSE_ERROR.
Referenced by PANEL_PCBNEW_COLOR_SETTINGS::createPreviewItems(), and PCB_PLUGIN::Load().
|
overridevirtualinherited |
Delete aFootprintName from the library at aLibraryPath.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprintName | is the name of a footprint to delete from the specified library. |
aProperties | is an associative array that can be used to tell the library delete function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem finding the footprint or the library, or deleting it. |
Reimplemented from PLUGIN.
Definition at line 2578 of file pcb_plugin.cpp.
References _, Format(), PCB_PLUGIN::init(), FP_CACHE::IsWritable(), PCB_PLUGIN::m_cache, FP_CACHE::Remove(), THROW_IO_ERROR, and PCB_PLUGIN::validateCache().
|
overridevirtualinherited |
Return a list of footprint names contained within the library at aLibraryPath.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aProperties | is an associative array that can be used to tell the plugin anything needed about how to perform with respect to aLibraryPath. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
aFootprintNames | is the array of available footprint names inside a library. |
aBestEfforts | if true, don't throw on errors, just return an empty list. |
IO_ERROR | if the library cannot be found, or footprint cannot be loaded. |
Reimplemented from PLUGIN.
Definition at line 2379 of file pcb_plugin.cpp.
References FP_CACHE::GetFootprints(), PCB_PLUGIN::init(), PCB_PLUGIN::m_cache, THROW_IO_ERROR, PCB_PLUGIN::validateCache(), and IO_ERROR::What().
|
overridevirtualinherited |
Check for the existence of a footprint.
Reimplemented from PLUGIN.
Definition at line 2444 of file pcb_plugin.cpp.
References KiCadFootprintFileExtension.
|
overridevirtualinherited |
Create a new empty footprint library at aLibraryPath empty.
It is an error to attempt to create an existing library or to attempt to create on a "read only" location.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aProperties | is an associative array that can be used to tell the library create function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem finding the library, or creating it. |
Reimplemented from PLUGIN.
Definition at line 2604 of file pcb_plugin.cpp.
References _, Format(), PCB_PLUGIN::FP_CACHE, PCB_PLUGIN::init(), PCB_PLUGIN::m_cache, FP_CACHE::Save(), and THROW_IO_ERROR.
|
overridevirtualinherited |
Delete an existing footprint library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason.
aLibraryPath | is a locator for the "library", usually a directory or file which will contain footprints. |
aProperties | is an associative array that can be used to tell the library delete implementation function anything special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem deleting an existing library. |
Reimplemented from PLUGIN.
Definition at line 2622 of file pcb_plugin.cpp.
References _, Format(), FP_CACHE::IsPath(), KiCadFootprintFileExtension, PCB_PLUGIN::m_cache, THROW_IO_ERROR, and traceKicadPcbPlugin.
|
virtualinherited |
Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions.
Options are typically appended so that a derived PLUGIN can call its base class function by the same name first, thus inheriting options declared there. Some base class options could pertain to all Footprint*() functions in all derived PLUGINs.
aListToAppendTo | holds a tuple of
In the future perhaps aListToAppendTo evolves to something capable of also holding a wxValidator for the cells in said dialog: http://forums.wxwidgets.org/viewtopic.php?t=23277&p=104180. This would require a 3 column list, and introducing wx GUI knowledge to PLUGIN, which has been avoided to date. |
Reimplemented in EAGLE_PLUGIN.
Definition at line 147 of file plugin.cpp.
References _.
Referenced by EAGLE_PLUGIN::FootprintLibOptions().
|
overridevirtualinherited |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN knows about.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprintName | is the name of the footprint to load. |
aProperties | is an associative array that can be used to tell the loader implementation to do something special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
aKeepUUID | = true to keep initial items UUID, false to set new UUID normally true if loaded in the footprint editor, false if loaded in the board editor. Make sense only in kicad_plugin |
IO_ERROR | if the library cannot be found or read. No exception is thrown in the case where aFootprintName cannot be found. |
Reimplemented from PLUGIN.
Definition at line 2460 of file pcb_plugin.cpp.
References FOOTPRINT::Clone(), copy, FOOTPRINT::Duplicate(), and PCB_PLUGIN::getFootprint().
|
overridevirtualinherited |
Write aFootprint to an existing library located at aLibraryPath.
If a footprint by the same name already exists, it is replaced.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprint | is what to store in the library. The caller continues to own the footprint after this call. |
aProperties | is an associative array that can be used to tell the saver how to save the footprint, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem saving. |
Reimplemented from PLUGIN.
Definition at line 2484 of file pcb_plugin.cpp.
References _, FOOTPRINT::Clone(), CTL_FOR_LIBRARY, FP_CACHE::Exists(), F_Cu, FOOTPRINT::Flip(), Format(), FP_CACHE::GetFootprints(), FOOTPRINT::GetFPID(), BOARD_ITEM::GetLayer(), LIB_ID::GetLibItemName(), FOOTPRINT::GetPosition(), PCB_PLUGIN::init(), FP_CACHE::IsWritable(), KiCadFootprintFileExtension, Kiface(), PCB_PLUGIN::m_cache, PCB_PLUGIN::m_ctl, PCBNEW_SETTINGS::m_FlipLeftRight, WX_FILENAME::ResolvePossibleSymlinks(), FP_CACHE::Save(), FOOTPRINT::SetOrientation(), EDA_ITEM::SetParent(), THROW_IO_ERROR, traceKicadPcbPlugin, and PCB_PLUGIN::validateCache().
|
inherited |
Output aItem to aFormatter in s-expression format.
aItem | A pointer the an BOARD_ITEM object to format. |
aNestLevel | The indentation nest level. |
IO_ERROR | on write error. |
Definition at line 400 of file pcb_plugin.cpp.
References PCB_PLUGIN::format(), EDA_ITEM::GetClass(), PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_PAD_T, PCB_SHAPE_T, PCB_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, and EDA_ITEM::Type().
Referenced by FOOTPRINT_EDIT_FRAME::ExportFootprint(), PCB_PLUGIN::format(), Save(), FP_CACHE::Save(), PCB_PLUGIN::Save(), and SaveSelection().
|
protectedinherited |
formats the board layer information
Definition at line 542 of file pcb_plugin.cpp.
References arrayDim(), B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, LSET::CuStack(), Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, BOARD::GetEnabledLayers(), BOARD::GetLayerName(), BOARD::GetLayerType(), PCB_PLUGIN::m_board, PCB_PLUGIN::m_out, Margin, LSET::Name(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), LSET::Seq(), LAYER::ShowType(), User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.
Referenced by PCB_PLUGIN::formatHeader(), and SaveSelection().
|
protectedinherited |
formats the General section of the file
Definition at line 526 of file pcb_plugin.cpp.
References TITLE_BLOCK::Format(), PAGE_INFO::Format(), FormatInternalUnits(), BOARD_DESIGN_SETTINGS::GetBoardThickness(), BOARD::GetDesignSettings(), BOARD::GetPageSettings(), BOARD::GetTitleBlock(), PCB_PLUGIN::m_ctl, PCB_PLUGIN::m_out, and OUTPUTFORMATTER::Print().
Referenced by PCB_PLUGIN::formatHeader().
|
protectedinherited |
writes everything that comes before the board_items, like settings and layers etc
Definition at line 642 of file pcb_plugin.cpp.
References PCB_PLUGIN::formatBoardLayers(), PCB_PLUGIN::formatGeneral(), PCB_PLUGIN::formatNetInformation(), PCB_PLUGIN::formatProperties(), and PCB_PLUGIN::formatSetup().
Referenced by PCB_PLUGIN::format().
|
protectedinherited |
formats the Nets and Netclasses
Definition at line 612 of file pcb_plugin.cpp.
References PCB_PLUGIN::m_mapping, PCB_PLUGIN::m_out, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and NETINFO_MAPPING::Translate().
Referenced by PCB_PLUGIN::formatHeader(), and SaveSelection().
|
protectedinherited |
formats the Nets and Netclasses
Definition at line 628 of file pcb_plugin.cpp.
References BOARD::GetProperties(), PCB_PLUGIN::m_out, OUTPUTFORMATTER::Print(), and OUTPUTFORMATTER::Quotew().
Referenced by PCB_PLUGIN::formatHeader().
|
protectedinherited |
formats the board setup information
Definition at line 474 of file pcb_plugin.cpp.
References Double2Str(), PCB_PLOT_PARAMS::Format(), BOARD_STACKUP::FormatBoardStackup(), FormatInternalUnits(), BOARD_DESIGN_SETTINGS::GetAuxOrigin(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetGridOrigin(), BOARD::GetPlotOptions(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), BOARD_DESIGN_SETTINGS::m_HasStackup, PCB_PLUGIN::m_out, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, BOARD_DESIGN_SETTINGS::m_SolderPasteMargin, BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio, and OUTPUTFORMATTER::Print().
Referenced by PCB_PLUGIN::formatHeader().
|
overridevirtualinherited |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
Reimplemented from PLUGIN.
Definition at line 2436 of file pcb_plugin.cpp.
References PCB_PLUGIN::getFootprint().
|
inlineoverridevirtualinherited |
Returns the file extension for the PLUGIN.
Implements PLUGIN.
Definition at line 149 of file pcb_plugin.h.
|
protectedinherited |
Definition at line 2408 of file pcb_plugin.cpp.
References FP_CACHE::GetFootprints(), PCB_PLUGIN::init(), PCB_PLUGIN::m_cache, and PCB_PLUGIN::validateCache().
Referenced by PCB_PLUGIN::FootprintLoad(), and PCB_PLUGIN::GetEnumeratedFootprint().
|
virtualinherited |
Return a container with the cached library footprints generated in the last call to Load.
This function is intended to be used ONLY by the non-KiCad board importers for the purpose of obtaining the footprint library of the design and creating a project-specific library.
Reimplemented in EAGLE_PLUGIN, and CADSTAR_PCB_ARCHIVE_PLUGIN.
Definition at line 54 of file plugin.cpp.
References not_implemented().
Referenced by PCB_EDIT_FRAME::OpenProjectFiles().
|
overridevirtualinherited |
Generate a timestamp representing all the files in the library (including the library directory).
Timestamps should not be considered ordered, they either match or they don't.
Implements PLUGIN.
Definition at line 2598 of file pcb_plugin.cpp.
References FP_CACHE::GetTimestamp().
|
inlineinherited |
Definition at line 211 of file pcb_plugin.h.
References STRING_FORMATTER::Clear(), STRING_FORMATTER::GetString(), and PCB_PLUGIN::m_sf.
Referenced by FOOTPRINT_EDIT_FRAME::ExportFootprint().
|
protectedinherited |
Definition at line 2359 of file pcb_plugin.cpp.
References PCB_PLUGIN::m_board, PCB_PLUGIN::m_props, and PCB_PLUGIN::m_reader.
Referenced by PCB_PLUGIN::DoLoad(), PCB_PLUGIN::FootprintDelete(), PCB_PLUGIN::FootprintEnumerate(), PCB_PLUGIN::FootprintLibCreate(), PCB_PLUGIN::FootprintSave(), PCB_PLUGIN::getFootprint(), PCB_PLUGIN::IsFootprintLibWritable(), Load(), PCB_PLUGIN::PCB_PLUGIN(), Save(), and PCB_PLUGIN::Save().
|
overridevirtualinherited |
Return true if the library at aLibraryPath is writable.
The system libraries are typically read only because of where they are installed..
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
IO_ERROR | if no library at aLibraryPath exists. |
Reimplemented from PLUGIN.
Definition at line 2699 of file pcb_plugin.cpp.
References PCB_PLUGIN::init(), FP_CACHE::IsWritable(), PCB_PLUGIN::m_cache, and PCB_PLUGIN::validateCache().
|
overridevirtual |
Load information from some input file format that this PLUGIN implementation knows about into either a new BOARD or an existing one.
This may be used to load an entire new BOARD, or to augment an existing one if aAppendToMe is not NULL.
aFileName | is the name of the file to use as input and may be foreign in nature or native in nature. |
aAppendToMe | is an existing BOARD to append to, but if NULL then this means "do not append, rather load anew". |
aProperties | is an associative array that can be used to tell the loader how to load the file, because it can take any number of additional named arguments that the plugin is known to support. These are tuning parameters for the import or load. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
aProject | is the optional PROJECT object primarily used by third party importers. |
aProgressReporter | an optional progress reporter |
aLineCount | a line count (necessary if a progress reporter is supplied) |
IO_ERROR | if there is a problem loading, and its contents should say what went wrong, using line number and character offsets of the input file if possible. |
Reimplemented from PLUGIN.
Definition at line 382 of file kicad_clipboard.cpp.
References _, PCB_PARSER::GetRequiredVersion(), PCB_PLUGIN::init(), PCB_PARSER::IsTooRecent(), PCB_PLUGIN::m_parser, PCB_PARSER::Parse(), PCB_T, PCB_PARSER::SetBoard(), BOARD::SetFileName(), PCB_PARSER::SetLineReader(), THROW_PARSE_ERROR, and EDA_ITEM::Type().
BOARD_ITEM * CLIPBOARD_IO::Parse | ( | ) |
Definition at line 304 of file kicad_clipboard.cpp.
References PCB_PLUGIN::Parse().
Referenced by PCB_CONTROL::Paste().
|
inherited |
Definition at line 378 of file pcb_plugin.cpp.
References PCB_PARSER::GetRequiredVersion(), PCB_PARSER::IsTooRecent(), PCB_PLUGIN::m_parser, PCB_PARSER::Parse(), PCB_PARSER::SetLineReader(), and TO_UTF8.
Referenced by Parse(), and parse_footprint_kicad().
|
inlineoverridevirtualinherited |
Return a brief hard coded name for this PLUGIN.
Implements PLUGIN.
Definition at line 144 of file pcb_plugin.h.
|
virtualinherited |
If possible, prefetches the specified library (e.g.
performing downloads). Does not parse. Threadsafe.
This is a no-op for libraries that cannot be prefetched. Plugins that cannot prefetch need not override this; a default no-op is provided.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aProperties | is an associative array that can be used to tell the plugin anything needed about how to perform with respect to aLibraryPath. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is an error prefetching the library. |
Definition at line 75 of file plugin.cpp.
|
overridevirtual |
Write aBoard to a storage file in a format that this PLUGIN implementation knows about or it can be used to write a portion of aBoard to a special kind of export file.
aFileName | is the name of a file to save to on disk. |
aBoard | is the class BOARD in memory document tree from which to extract information when writing to aFileName. The caller continues to own the BOARD, and the plugin should refrain from modifying the BOARD if possible. |
aProperties | is an associative array that can be used to tell the saver how to save the file, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it) and plugins should expect it to be optionally NULL. |
IO_ERROR | if there is a problem saving or exporting. |
Reimplemented from PCB_PLUGIN.
Definition at line 337 of file kicad_clipboard.cpp.
References PCB_PLUGIN::Format(), STRING_FORMATTER::GetString(), ignore_unused(), PCB_PLUGIN::init(), PCB_PLUGIN::m_board, m_formatter, PCB_PLUGIN::m_mapping, PCB_PLUGIN::m_out, OUTPUTFORMATTER::Print(), NETINFO_MAPPING::SetBoard(), and SEXPR_BOARD_FILE_VERSION.
void CLIPBOARD_IO::SaveSelection | ( | const PCB_SELECTION & | selected, |
bool | isFootprintEditor | ||
) |
Definition at line 63 of file kicad_clipboard.cpp.
References FOOTPRINT::Add(), EDA_ITEM::Clone(), copy, EDA_TEXT::CopyText(), dummy(), SELECTION::Empty(), BOARD::Footprints(), PCB_PLUGIN::Format(), PCB_PLUGIN::formatBoardLayers(), PCB_PLUGIN::formatNetInformation(), SELECTION::Front(), BOARD_ITEM::GetLayer(), BOARD_ITEM::GetParent(), FOOTPRINT::GetPosition(), FOOTPRINT::GetReference(), SELECTION::GetReferencePoint(), STRING_FORMATTER::GetString(), FOOTPRINT::GetValue(), group, SELECTION::HasReferencePoint(), ignore_unused(), ZONE::InitDataFromSrcInCopyCtor(), PCB_PLUGIN::m_board, m_formatter, PCB_PLUGIN::m_mapping, FOOTPRINT::MoveAnchorPosition(), pad, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_PAD_T, OUTPUTFORMATTER::Print(), NETINFO_MAPPING::SetBoard(), EDA_TEXT::SetEffects(), FOOTPRINT::SetFPID(), BOARD_ITEM::SetLayer(), FOOTPRINT::SetPosition(), EDA_TEXT::SetText(), SEXPR_BOARD_FILE_VERSION, SELECTION::Size(), text, FP_TEXT::TEXT_is_DIVERS, EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by EDIT_TOOL::copyToClipboard().
void CLIPBOARD_IO::SetBoard | ( | BOARD * | aBoard | ) |
Definition at line 57 of file kicad_clipboard.cpp.
References PCB_PLUGIN::m_board.
Referenced by EDIT_TOOL::copyToClipboard().
|
inlineinherited |
Definition at line 221 of file pcb_plugin.h.
References PCB_PLUGIN::m_out.
Referenced by FP_CACHE::Save().
|
protectedinherited |
Definition at line 2367 of file pcb_plugin.cpp.
References PCB_PLUGIN::FP_CACHE, FP_CACHE::IsModified(), FP_CACHE::IsPath(), FP_CACHE::Load(), and PCB_PLUGIN::m_cache.
Referenced by PCB_PLUGIN::FootprintDelete(), PCB_PLUGIN::FootprintEnumerate(), PCB_PLUGIN::FootprintSave(), PCB_PLUGIN::getFootprint(), and PCB_PLUGIN::IsFootprintLibWritable().
|
protectedinherited |
which BOARD, no ownership here
Definition at line 284 of file pcb_plugin.h.
Referenced by PCB_PLUGIN::formatBoardLayers(), PCB_PLUGIN::init(), Save(), PCB_PLUGIN::Save(), SaveSelection(), and SetBoard().
|
protectedinherited |
Footprint library cache.
Definition at line 288 of file pcb_plugin.h.
Referenced by PCB_PLUGIN::FootprintDelete(), PCB_PLUGIN::FootprintEnumerate(), PCB_PLUGIN::FootprintLibCreate(), PCB_PLUGIN::FootprintLibDelete(), PCB_PLUGIN::FootprintSave(), PCB_PLUGIN::getFootprint(), PCB_PLUGIN::IsFootprintLibWritable(), PCB_PLUGIN::validateCache(), and PCB_PLUGIN::~PCB_PLUGIN().
|
protectedinherited |
Definition at line 295 of file pcb_plugin.h.
Referenced by PCB_PLUGIN::FootprintSave(), PCB_PLUGIN::format(), and PCB_PLUGIN::formatGeneral().
|
protectedinherited |
for throwing exceptions
Definition at line 283 of file pcb_plugin.h.
|
protectedinherited |
for saves only, name is in m_reader for loads
Definition at line 291 of file pcb_plugin.h.
|
private |
Definition at line 68 of file kicad_clipboard.h.
Referenced by CLIPBOARD_IO(), Save(), and SaveSelection().
|
protectedinherited |
mapping for net codes, so only not empty net codes are stored with consecutive integers as net codes
Definition at line 297 of file pcb_plugin.h.
Referenced by PCB_PLUGIN::format(), PCB_PLUGIN::formatNetInformation(), Save(), PCB_PLUGIN::Save(), SaveSelection(), and PCB_PLUGIN::~PCB_PLUGIN().
|
protectedinherited |
output any Format()s to this, no ownership
Definition at line 294 of file pcb_plugin.h.
Referenced by CLIPBOARD_IO(), PCB_PLUGIN::format(), PCB_PLUGIN::formatBoardLayers(), PCB_PLUGIN::formatGeneral(), PCB_PLUGIN::formatLayer(), PCB_PLUGIN::formatLayers(), PCB_PLUGIN::formatNetInformation(), PCB_PLUGIN::formatProperties(), PCB_PLUGIN::formatSetup(), PCB_PLUGIN::PCB_PLUGIN(), Save(), PCB_PLUGIN::Save(), and PCB_PLUGIN::SetOutputFormatter().
|
protectedinherited |
Definition at line 296 of file pcb_plugin.h.
Referenced by PCB_PLUGIN::DoLoad(), Load(), FP_CACHE::Load(), PCB_PLUGIN::Parse(), and PCB_PLUGIN::~PCB_PLUGIN().
|
protectedinherited |
passed via Save() or Load(), no ownership, may be NULL.
Definition at line 287 of file pcb_plugin.h.
Referenced by PCB_PLUGIN::init().
|
protectedinherited |
|
protectedinherited |
Definition at line 293 of file pcb_plugin.h.
Referenced by PCB_PLUGIN::GetStringOutput(), and PCB_PLUGIN::PCB_PLUGIN().