KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_clipboard.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
5 * @author Kristoffer Ödmark
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#include <wx/clipbrd.h>
22#include <wx/log.h>
23
24#include <board.h>
25#include <build_version.h>
26#include <core/ignore.h>
27#include <footprint.h>
28#include <font/fontconfig.h>
29#include <pad.h>
30#include <pcb_group.h>
31#include <pcb_generator.h>
32#include <pcb_text.h>
33#include <pcb_table.h>
34#include <zone.h>
35#include <locale_io.h>
38#include <kicad_clipboard.h>
39#include <kidialog.h>
41
50
51
55
56
58{
59 m_board = aBoard;
60}
61
62
63void CLIPBOARD_IO::clipboardWriter( const wxString& aData )
64{
65 wxLogNull doNotLog; // disable logging of failed clipboard actions
66 auto clipboard = wxTheClipboard;
67 wxClipboardLocker clipboardLock( clipboard );
68
69 if( !clipboardLock || !clipboard->IsOpened() )
70 return;
71
72 clipboard->SetData( new wxTextDataObject( aData ) );
73
74 clipboard->Flush();
75
76#ifndef __WXOSX__
77 // This section exists to return the clipboard data, ensuring it has fully
78 // been processed by the system clipboard. This appears to be needed for
79 // extremely large clipboard copies on asynchronous linux clipboard managers
80 // such as KDE's Klipper. However, a read back of the data on OSX before the
81 // clipboard is closed seems to cause an ASAN error (heap-buffer-overflow)
82 // since it uses the cached version of the clipboard data and not the system
83 // clipboard data.
84 if( clipboard->IsSupported( wxDF_TEXT ) || clipboard->IsSupported( wxDF_UNICODETEXT ) )
85 {
86 wxTextDataObject data;
87 clipboard->GetData( data );
88 ignore_unused( data.GetText() );
89 }
90#endif
91}
92
93
95{
96 wxLogNull doNotLog; // disable logging of failed clipboard actions
97
98 auto clipboard = wxTheClipboard;
99 wxClipboardLocker clipboardLock( clipboard );
100
101 if( !clipboardLock )
102 return wxEmptyString;
103
104 if( clipboard->IsSupported( wxDF_TEXT ) || clipboard->IsSupported( wxDF_UNICODETEXT ) )
105 {
106 wxTextDataObject data;
107 clipboard->GetData( data );
108 return data.GetText();
109 }
110
111 return wxEmptyString;
112}
113
114
115void CLIPBOARD_IO::SaveSelection( const PCB_SELECTION& aSelected, bool isFootprintEditor )
116{
117 VECTOR2I refPoint( 0, 0 );
118
119 // dont even start if the selection is empty
120 if( aSelected.Empty() )
121 return;
122
123 if( aSelected.HasReferencePoint() )
124 refPoint = aSelected.GetReferencePoint();
125
126 auto deleteUnselectedCells =
127 []( PCB_TABLE* aTable )
128 {
129 int minCol = aTable->GetColCount();
130 int maxCol = -1;
131 int minRow = aTable->GetRowCount();
132 int maxRow = -1;
133
134 for( int row = 0; row < aTable->GetRowCount(); ++row )
135 {
136 for( int col = 0; col < aTable->GetColCount(); ++col )
137 {
138 PCB_TABLECELL* cell = aTable->GetCell( row, col );
139
140 if( cell->IsSelected() )
141 {
142 minRow = std::min( minRow, row );
143 maxRow = std::max( maxRow, row );
144 minCol = std::min( minCol, col );
145 maxCol = std::max( maxCol, col );
146 }
147 else
148 {
149 cell->SetFlags( STRUCT_DELETED );
150 }
151 }
152 }
153
154 wxCHECK_MSG( maxCol >= minCol && maxRow >= minRow, /*void*/,
155 wxT( "No selected cells!" ) );
156
157 // aTable is always a clone in the clipboard case
158 int destRow = 0;
159
160 for( int row = minRow; row <= maxRow; row++ )
161 aTable->SetRowHeight( destRow++, aTable->GetRowHeight( row ) );
162
163 int destCol = 0;
164
165 for( int col = minCol; col <= maxCol; col++ )
166 aTable->SetColWidth( destCol++, aTable->GetColWidth( col ) );
167
168 aTable->DeleteMarkedCells();
169 aTable->SetColCount( ( maxCol - minCol ) + 1 );
170 aTable->Normalize();
171 };
172
173 std::set<PCB_TABLE*> promotedTables;
174
175 auto parentIsPromoted =
176 [&]( PCB_TABLECELL* cell ) -> bool
177 {
178 for( PCB_TABLE* table : promotedTables )
179 {
180 if( table->m_Uuid == cell->GetParent()->m_Uuid )
181 return true;
182 }
183
184 return false;
185 };
186
187 if( aSelected.Size() == 1 && aSelected.Front()->Type() == PCB_FOOTPRINT_T )
188 {
189 // make the footprint safe to transfer to other pcbs
190 const FOOTPRINT* footprint = static_cast<FOOTPRINT*>( aSelected.Front() );
191 // Do not modify existing board
192 FOOTPRINT newFootprint( *footprint );
193
194 for( PAD* pad : newFootprint.Pads() )
195 pad->SetNetCode( 0 );
196
197 // locked means "locked in place"; copied items therefore can't be locked
198 newFootprint.SetLocked( false );
199
200 // locate the reference point at (0, 0) in the copied items
201 newFootprint.Move( VECTOR2I( -refPoint.x, -refPoint.y ) );
202
203 Format( static_cast<BOARD_ITEM*>( &newFootprint ) );
204
205 newFootprint.SetParent( nullptr );
206 newFootprint.SetParentGroup( nullptr );
207 }
208 else if( isFootprintEditor )
209 {
210 FOOTPRINT partialFootprint( m_board );
211
212 // Useful to copy the selection to the board editor (if any), and provides
213 // a dummy lib id.
214 // Perhaps not a good Id, but better than a empty id
215 KIID dummy;
216 LIB_ID id( "clipboard", dummy.AsString() );
217 partialFootprint.SetFPID( id );
218
219 for( EDA_ITEM* item : aSelected )
220 {
221 if( !item->IsBOARD_ITEM() )
222 continue;
223
224 BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
225 BOARD_ITEM* copy = nullptr;
226
227 if( PCB_FIELD* field = dynamic_cast<PCB_FIELD*>( item ) )
228 {
229 if( field->IsMandatory() )
230 continue;
231 }
232
233 if( boardItem->Type() == PCB_GROUP_T )
234 {
235 copy = static_cast<PCB_GROUP*>( boardItem )->DeepClone();
236 }
237 else if( boardItem->Type() == PCB_GENERATOR_T )
238 {
239 copy = static_cast<PCB_GENERATOR*>( boardItem )->DeepClone();
240 }
241 else if( item->Type() == PCB_TABLECELL_T )
242 {
243 if( parentIsPromoted( static_cast<PCB_TABLECELL*>( item ) ) )
244 continue;
245
246 copy = static_cast<BOARD_ITEM*>( item->GetParent()->Clone() );
247 promotedTables.insert( static_cast<PCB_TABLE*>( copy ) );
248 }
249 else
250 {
251 copy = static_cast<BOARD_ITEM*>( boardItem->Clone() );
252 }
253
254 // If it is only a footprint, clear the nets from the pads
255 if( PAD* pad = dynamic_cast<PAD*>( copy ) )
256 pad->SetNetCode( 0 );
257
258 // Don't copy group membership information for the 1st level objects being copied
259 // since the group they belong to isn't being copied.
260 copy->SetParentGroup( nullptr );
261
262 // Add the pad to the new footprint before moving to ensure the local coords are
263 // correct
264 partialFootprint.Add( copy );
265
266 // A list of not added items, when adding items to the footprint
267 // some PCB_TEXT (reference and value) cannot be added to the footprint
268 std::vector<BOARD_ITEM*> skipped_items;
269
270 // Will catch at least PCB_GROUP_T and PCB_GENERATOR_T
271 if( PCB_GROUP* group = dynamic_cast<PCB_GROUP*>( copy ) )
272 {
273 group->RunOnChildren(
274 [&]( BOARD_ITEM* descendant )
275 {
276 // One cannot add an additional mandatory field to a given footprint:
277 // only one is allowed. So add only non-mandatory fields.
278 bool can_add = true;
279
280 if( const PCB_FIELD* field = dynamic_cast<const PCB_FIELD*>( item ) )
281 {
282 if( field->IsMandatory() )
283 can_add = false;
284 }
285
286 if( can_add )
287 partialFootprint.Add( descendant );
288 else
289 skipped_items.push_back( descendant );
290 },
292 }
293
294 // locate the reference point at (0, 0) in the copied items
295 copy->Move( -refPoint );
296
297 // Now delete items, duplicated but not added:
298 for( BOARD_ITEM* skipped_item : skipped_items )
299 {
300 static_cast<PCB_GROUP*>( copy )->RemoveItem( skipped_item );
301 skipped_item->SetParentGroup( nullptr );
302 delete skipped_item;
303 }
304 }
305
306 // Set the new relative internal local coordinates of copied items
307 FOOTPRINT* editedFootprint = m_board->Footprints().front();
308 VECTOR2I moveVector = partialFootprint.GetPosition() + editedFootprint->GetPosition();
309
310 partialFootprint.MoveAnchorPosition( moveVector );
311
312 for( PCB_TABLE* table : promotedTables )
313 deleteUnselectedCells( table );
314
315 Format( &partialFootprint );
316
317 partialFootprint.SetParent( nullptr );
318 }
319 else
320 {
321 // we will fake being a .kicad_pcb to get the full parser kicking
322 // This means we also need layers and nets
323 LOCALE_IO io;
324
325 m_formatter.Print( "(kicad_pcb (version %d) (generator \"pcbnew\") (generator_version %s)",
327 m_formatter.Quotew( GetMajorMinorVersion() ).c_str() );
328
330
331 for( EDA_ITEM* item : aSelected )
332 {
333 if( !item->IsBOARD_ITEM() )
334 continue;
335
336 BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
337 BOARD_ITEM* copy = nullptr;
338
339 wxCHECK2( boardItem, continue );
340
341 if( boardItem->Type() == PCB_FIELD_T )
342 {
343 PCB_FIELD* field = static_cast<PCB_FIELD*>( boardItem );
344 copy = new PCB_TEXT( m_board );
345
346 PCB_TEXT* textItem = static_cast<PCB_TEXT*>( copy );
347 textItem->SetPosition( field->GetPosition() );
348 textItem->SetLayer( field->GetLayer() );
349 textItem->SetHyperlink( field->GetHyperlink() );
350 textItem->SetText( field->GetText() );
351 textItem->SetAttributes( field->GetAttributes() );
352 textItem->SetTextAngle( field->GetDrawRotation() );
353
354 if ( textItem->GetText() == wxT( "${VALUE}" ) )
355 textItem->SetText( boardItem->GetParentFootprint()->GetValue() );
356 else if ( textItem->GetText() == wxT( "${REFERENCE}" ) )
357 textItem->SetText( boardItem->GetParentFootprint()->GetReference() );
358
359 }
360 else if( boardItem->Type() == PCB_TEXT_T )
361 {
362 copy = static_cast<BOARD_ITEM*>( boardItem->Clone() );
363
364 PCB_TEXT* textItem = static_cast<PCB_TEXT*>( copy );
365
366 if( textItem->GetText() == wxT( "${VALUE}" ) )
367 textItem->SetText( boardItem->GetParentFootprint()->GetValue() );
368 else if( textItem->GetText() == wxT( "${REFERENCE}" ) )
369 textItem->SetText( boardItem->GetParentFootprint()->GetReference() );
370 }
371 else if( boardItem->Type() == PCB_GROUP_T )
372 {
373 copy = static_cast<PCB_GROUP*>( boardItem )->DeepClone();
374 }
375 else if( boardItem->Type() == PCB_GENERATOR_T )
376 {
377 copy = static_cast<PCB_GENERATOR*>( boardItem )->DeepClone();
378 }
379 else if( item->Type() == PCB_TABLECELL_T )
380 {
381 if( parentIsPromoted( static_cast<PCB_TABLECELL*>( item ) ) )
382 continue;
383
384 copy = static_cast<BOARD_ITEM*>( item->GetParent()->Clone() );
385 promotedTables.insert( static_cast<PCB_TABLE*>( copy ) );
386 }
387 else
388 {
389 copy = static_cast<BOARD_ITEM*>( boardItem->Clone() );
390 }
391
392 if( copy )
393 {
394 if( copy->Type() == PCB_FIELD_T || copy->Type() == PCB_PAD_T )
395 {
396 // Create a parent footprint to own the copied item
397 FOOTPRINT* footprint = new FOOTPRINT( m_board );
398
399 footprint->SetPosition( copy->GetPosition() );
400 footprint->Add( copy );
401
402 // Convert any mandatory fields to user fields. The destination footprint
403 // will already have its own mandatory fields.
404 if( PCB_FIELD* field = dynamic_cast<PCB_FIELD*>( copy ) )
405 {
406 if( field->IsMandatory() )
407 field->SetOrdinal( footprint->GetNextFieldOrdinal() );
408 }
409
410 copy = footprint;
411 }
412
413 copy->SetLocked( false );
414 copy->SetParent( m_board );
415 copy->SetParentGroup( nullptr );
416
417 // locate the reference point at (0, 0) in the copied items
418 copy->Move( -refPoint );
419
420 if( copy->Type() == PCB_TABLE_T )
421 {
422 PCB_TABLE* table = static_cast<PCB_TABLE*>( copy );
423
424 if( promotedTables.count( table ) )
425 deleteUnselectedCells( table );
426 }
427
428 Format( copy );
429
430 if( copy->Type() == PCB_GROUP_T || copy->Type() == PCB_GENERATOR_T )
431 {
432 copy->RunOnChildren(
433 [&]( BOARD_ITEM* descendant )
434 {
435 descendant->SetLocked( false );
436 Format( descendant );
437 },
439 }
440
441 delete copy;
442 }
443 }
444
445 m_formatter.Print( ")" );
446 }
447
448 std::string prettyData = m_formatter.GetString();
449 KICAD_FORMAT::Prettify( prettyData, KICAD_FORMAT::FORMAT_MODE::COMPACT_TEXT_PROPERTIES );
450
451 // These are placed at the end to minimize the open time of the clipboard
452 m_writer( wxString( prettyData.c_str(), wxConvUTF8 ) );
453}
454
455
457{
458 BOARD_ITEM* item;
459 wxString result = m_reader();
460
461 try
462 {
464 }
465 catch (...)
466 {
467 item = nullptr;
468 }
469
470 return item;
471}
472
473
474void CLIPBOARD_IO::SaveBoard( const wxString& aFileName, BOARD* aBoard,
475 const std::map<std::string, UTF8>* aProperties )
476{
477 init( aProperties );
478
479 m_board = aBoard; // after init()
480
481 m_formatter.Print( "(kicad_pcb (version %d) (generator \"pcbnew\") (generator_version %s)",
483 m_formatter.Quotew( GetMajorMinorVersion() ).c_str() );
484
485 Format( aBoard );
486
487 m_formatter.Print( ")" );
488
489 std::string prettyData = m_formatter.GetString();
490 KICAD_FORMAT::Prettify( prettyData, KICAD_FORMAT::FORMAT_MODE::COMPACT_TEXT_PROPERTIES );
491
492 m_writer( wxString( prettyData.c_str(), wxConvUTF8 ) );
493}
494
495
496BOARD* CLIPBOARD_IO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
497 const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
498{
499 std::string result( m_reader().mb_str() );
500
501 std::function<bool( wxString, int, wxString, wxString )> queryUser =
502 [&]( wxString aTitle, int aIcon, wxString aMessage, wxString aAction ) -> bool
503 {
504 KIDIALOG dlg( nullptr, aMessage, aTitle, wxOK | wxCANCEL | aIcon );
505
506 if( !aAction.IsEmpty() )
507 dlg.SetOKLabel( aAction );
508
509 dlg.DoNotShowCheckbox( aMessage, 0 );
510
511 return dlg.ShowModal() == wxID_OK;
512 };
513
514 STRING_LINE_READER reader( result, wxT( "clipboard" ) );
515 PCB_IO_KICAD_SEXPR_PARSER parser( &reader, aAppendToMe, queryUser );
516
517 init( aProperties );
518
519 BOARD_ITEM* item;
520 BOARD* board;
521
522 try
523 {
524 item = parser.Parse();
525 }
526 catch( const FUTURE_FORMAT_ERROR& )
527 {
528 // Don't wrap a FUTURE_FORMAT_ERROR in another
529 throw;
530 }
531 catch( const PARSE_ERROR& parse_error )
532 {
533 if( parser.IsTooRecent() )
534 throw FUTURE_FORMAT_ERROR( parse_error, parser.GetRequiredVersion() );
535 else
536 throw;
537 }
538
539 if( item->Type() != PCB_T )
540 {
541 // The parser loaded something that was valid, but wasn't a board.
542 THROW_PARSE_ERROR( _( "Clipboard content is not KiCad compatible" ), parser.CurSource(),
543 parser.CurLine(), parser.CurLineNumber(), parser.CurOffset() );
544 }
545 else
546 {
547 board = dynamic_cast<BOARD*>( item );
548 }
549
550 // Give the filename to the board if it's new
551 if( board && !aAppendToMe )
552 board->SetFileName( aFileName );
553
554 return board;
555}
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition board_item.h:265
void SetLocked(bool aLocked) override
Definition board_item.h:356
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition board_item.h:313
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
void SetFileName(const wxString &aFileName)
Definition board.h:407
void SaveSelection(const PCB_SELECTION &selected, bool isFootprintEditor)
STRING_FORMATTER m_formatter
BOARD_ITEM * Parse()
void SaveBoard(const wxString &aFileName, BOARD *aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
static void clipboardWriter(const wxString &aData)
static wxString clipboardReader()
void SetBoard(BOARD *aBoard)
std::function< wxString()> m_reader
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
std::function< void(const wxString &)> m_writer
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition eda_item.h:152
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
virtual void SetParentGroup(EDA_GROUP *aGroup)
Definition eda_item.h:113
bool IsSelected() const
Definition eda_item.h:132
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition eda_item.cpp:143
virtual void SetParent(EDA_ITEM *aParent)
Definition eda_item.cpp:89
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:110
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
Definition eda_text.cpp:428
wxString GetHyperlink() const
Definition eda_text.h:424
const TEXT_ATTRIBUTES & GetAttributes() const
Definition eda_text.h:252
void SetHyperlink(wxString aLink)
Definition eda_text.h:425
virtual void SetText(const wxString &aText)
Definition eda_text.cpp:265
void SetPosition(const VECTOR2I &aPos) override
void SetFPID(const LIB_ID &aFPID)
Definition footprint.h:442
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition footprint.h:644
int GetNextFieldOrdinal() const
Return the next ordinal for a user field for this footprint.
void MoveAnchorPosition(const VECTOR2I &aMoveVector)
Move the reference point of the footprint.
std::deque< PAD * > & Pads()
Definition footprint.h:375
void Move(const VECTOR2I &aMoveVector) override
Move this object.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
const wxString & GetValue() const
Definition footprint.h:863
const wxString & GetReference() const
Definition footprint.h:841
VECTOR2I GetPosition() const override
Definition footprint.h:403
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition kidialog.h:38
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox.
Definition kidialog.cpp:51
int ShowModal() override
Definition kidialog.cpp:89
Definition kiid.h:44
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition locale_io.h:37
Definition pad.h:61
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:49
Read a Pcbnew s-expression formatted LINE_READER object and returns the appropriate BOARD_ITEM object...
bool IsTooRecent()
Return whether a version number, if any was parsed, was too recent.
wxString GetRequiredVersion()
Return a string representing the version of KiCad required to open this file.
void formatBoardLayers(const BOARD *aBoard) const
formats the board layer information
BOARD_ITEM * Parse(const wxString &aClipboardSourceInput)
void init(const std::map< std::string, UTF8 > *aProperties)
void Format(const BOARD_ITEM *aItem) const
Output aItem to aFormatter in s-expression format.
PCB_IO_KICAD_SEXPR(int aControlFlags=CTL_FOR_BOARD)
OUTPUTFORMATTER * m_out
output any Format()s to this, no ownership
BOARD * m_board
The board BOARD being worked on, no ownership here.
Definition pcb_io.h:349
virtual VECTOR2I GetPosition() const override
Definition pcb_text.h:93
virtual void SetPosition(const VECTOR2I &aPos) override
Definition pcb_text.h:95
EDA_ANGLE GetDrawRotation() const override
Definition pcb_text.cpp:203
void SetTextAngle(const EDA_ANGLE &aAngle) override
Definition pcb_text.cpp:552
Container for project specific data.
Definition project.h:62
VECTOR2I GetReferencePoint() const
EDA_ITEM * Front() const
Definition selection.h:173
int Size() const
Returns the number of selected parts.
Definition selection.h:117
bool Empty() const
Checks if there is anything selected.
Definition selection.h:111
bool HasReferencePoint() const
Definition selection.h:212
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
Definition richio.h:222
#define _(s)
@ RECURSE
Definition eda_item.h:49
#define STRUCT_DELETED
flag indication structures to be erased
void ignore_unused(const T &)
Definition ignore.h:20
#define THROW_PARSE_ERROR(aProblem, aSource, aInputLine, aLineNumber, aByteIndex)
void Prettify(std::string &aSource, FORMAT_MODE aMode)
Pretty-prints s-expression text according to KiCad format rules.
Class to handle a set of BOARD_ITEMs.
#define CTL_FOR_CLIPBOARD
Format output for the clipboard instead of footprint library or BOARD.
#define SEXPR_BOARD_FILE_VERSION
Current s-expression file format version. 2 was the last legacy format version.
Pcbnew s-expression file format parser definition.
std::vector< FAB_LAYER_COLOR > dummy
Variant of PARSE_ERROR indicating that a syntax or related error was likely caused by a file generate...
A filename or source description, a problem input line, a line number, a byte offset,...
std::vector< std::vector< std::string > > table
wxString result
Test unit parsing edge cases and error handling.
@ PCB_T
Definition typeinfo.h:75
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition typeinfo.h:84
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition typeinfo.h:104
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition typeinfo.h:85
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition typeinfo.h:83
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
Definition typeinfo.h:88
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:79
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition typeinfo.h:80
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition typeinfo.h:87
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683