KiCad PCB EDA Suite
wildcards_and_files_ext.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 (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
30 
49 static wxString FormatWildcardExt( const wxString& aWildcard )
50 {
51  wxString wc;
52 #if defined( __WXGTK__ )
53 
54  for( auto ch : aWildcard )
55  {
56  if( wxIsalpha( ch ) )
57  wc += wxString::Format( "[%c%c]", wxTolower( ch ), wxToupper( ch ) );
58  else
59  wc += ch;
60  }
61 
62  return wc;
63 #else
64  wc = aWildcard;
65 
66  return wc;
67 #endif
68 }
69 
70 
71 const wxString SchematicSymbolFileExtension( "sym" );
72 const wxString SchematicLibraryFileExtension( "lib" );
73 const wxString SchematicBackupFileExtension( "bak" );
74 
75 const wxString VrmlFileExtension( "wrl" );
76 
77 const wxString ProjectFileExtension( "pro" );
78 const wxString SchematicFileExtension( "sch" );
79 const wxString NetlistFileExtension( "net" );
80 const wxString ComponentFileExtension( "cmp" );
81 const wxString GerberFileExtension( "gbr" );
82 const wxString GerberJobFileExtension( "gbrjob" );
83 const wxString HtmlFileExtension( wxT( "html" ) );
84 
85 const wxString LegacyPcbFileExtension( "brd" );
86 const wxString KiCadPcbFileExtension( "kicad_pcb" );
87 const wxString PageLayoutDescrFileExtension( "kicad_wks" );
88 
89 const wxString PdfFileExtension( "pdf" );
90 const wxString MacrosFileExtension( "mcr" );
91 const wxString DrillFileExtension( "drl" );
92 const wxString SVGFileExtension( "svg" );
93 const wxString ReportFileExtension( "rpt" );
94 const wxString FootprintPlaceFileExtension( "pos" );
95 const wxString KiCadLib3DShapesPathExtension( "3dshapes" );
96 
97 const wxString KiCadFootprintLibPathExtension( "pretty" );
98 const wxString LegacyFootprintLibPathExtension( "mod" );
99 const wxString EagleFootprintLibPathExtension( "lbr" );
100 
101 const wxString KiCadFootprintFileExtension( "kicad_mod" );
102 const wxString GedaPcbFootprintLibFileExtension( "fp" );
103 const wxString SpecctraDsnFileExtension( "dsn" );
104 const wxString IpcD356FileExtension( "d356" );
105 
106 
107 const wxString AllFilesWildcard( _( "All files (*)|*" ) );
108 
109 
111 {
112  return _( "KiCad drawing symbol files (*.sym)|*." ) + FormatWildcardExt( "sym" );
113 }
114 
115 
117 {
118  return _( "KiCad symbol library files (*.lib)|*." ) + FormatWildcardExt( "lib" );
119 }
120 
121 
123 {
124  return _( "KiCad project files (*.pro)|*." ) + FormatWildcardExt( "pro" );
125 }
126 
127 
129 {
130  return _( "KiCad schematic files (*.sch)|*." ) + FormatWildcardExt( "sch" );
131 }
132 
133 
135 {
136  return _( "Eagle XML schematic files (*.sch)|*." ) + FormatWildcardExt( "sch" );
137 }
138 
139 
141 {
142  return _( "Eagle XML files (*.sch *.brd)|*." ) +
143  FormatWildcardExt( "sch" ) + ";*." + FormatWildcardExt( "brd" );
144 }
145 
146 
148 {
149  return _( "KiCad netlist files (*.net)|*." ) + FormatWildcardExt( "net" );
150 }
151 
152 
154 {
155  return _( "Gerber files (*.pho)|*." ) + FormatWildcardExt( "pho" );
156 }
157 
158 
160 {
161  return _( "KiCad printed circuit board files (*.brd)|*." ) + FormatWildcardExt( "brd" );
162 }
163 
164 
166 {
167  return _( "Eagle ver. 6.x XML PCB files (*.brd)|*." ) + FormatWildcardExt( "brd" );
168 }
169 
170 
172 {
173  return _( "P-Cad 200x ASCII PCB files (*.pcb)|*." ) + FormatWildcardExt( "pcb" );
174 }
175 
176 
177 wxString PcbFileWildcard()
178 {
179  return _( "KiCad printed circuit board files (*.kicad_pcb)|*." ) +
180  FormatWildcardExt( "kicad_pcb" );
181 }
182 
183 
185 {
186  return _( "KiCad footprint files (*.kicad_mod)|*." ) + FormatWildcardExt( "kicad_mod" );
187 }
188 
189 
191 {
192  return _( "KiCad footprint library paths (*.pretty)|*." ) + FormatWildcardExt( "pretty" );
193 }
194 
195 
197 {
198  return _( "Legacy footprint library files (*.mod)|*." ) + FormatWildcardExt( "mod" );
199 }
200 
201 
203 {
204  return _( "Eagle ver. 6.x XML library files (*.lbr)|*." ) + FormatWildcardExt( "lbr" );
205 }
206 
207 
209 {
210  return _( "Geda PCB footprint library files (*.fp)|*." ) + FormatWildcardExt( "fp" );
211 }
212 
213 
215 {
216  return _( "Page layout design files (*.kicad_wks)|*." ) + FormatWildcardExt( "kicad_wks" );
217 }
218 
219 
220 // Wildcard for cvpcb component to footprint link file
222 {
223  return _( "KiCad symbol footprint link files (*.cmp)|*." ) + FormatWildcardExt( "cmp" );
224 }
225 
226 
227 // Wildcard for reports and fabrication documents
229 {
230  return _( "Drill files (*.drl)|*." ) + FormatWildcardExt( "drl" );
231 }
232 
233 
234 wxString SVGFileWildcard()
235 {
236  return _( "SVG files (*.svg)|*." ) + FormatWildcardExt( "svg" );
237 }
238 
239 
241 {
242  return _( "HTML files (*.html)|*." ) + FormatWildcardExt( "htm" ) + ";*.," +
243  FormatWildcardExt( "html" );
244 }
245 
246 
247 wxString CsvFileWildcard()
248 {
249  return _( "CSV Files (*.csv)|*." ) + FormatWildcardExt( "csv" );
250 }
251 
252 
253 wxString PdfFileWildcard()
254 {
255  return _( "Portable document format files (*.pdf)|*." ) + FormatWildcardExt( "pdf" );
256 }
257 
258 
259 wxString PSFileWildcard()
260 {
261  return _( "PostScript files (.ps)|*." ) + FormatWildcardExt( "ps" );
262 }
263 
264 
266 {
267  return _( "Report files (*.rpt)|*." ) + FormatWildcardExt( "rpt" );
268 }
269 
270 
272 {
273  return _( "Footprint place files (*.pos)|*." ) + FormatWildcardExt( "pos" );
274 }
275 
276 
278 {
279  return _( "VRML and X3D files (*.wrl *.x3d)|*." ) + FormatWildcardExt( "wrl" ) +
280  ";*." + FormatWildcardExt( "x3d" );
281 }
282 
283 
285 {
286  return _( "IDFv3 footprint files (*.idf)|*." ) + FormatWildcardExt( "idf" );
287 }
288 
289 
291 {
292  return _( "Text files (*.txt)|*." ) + FormatWildcardExt( "txt" );
293 }
294 
295 
297 {
298  return _( "Legacy footprint export files (*.emp)|*." ) + FormatWildcardExt( "emp" );
299 }
300 
301 
302 wxString ErcFileWildcard()
303 {
304  return _( "Electronic rule check file (.erc)|*." ) + FormatWildcardExt( "erc" );
305 }
306 
307 
309 {
310  return _( "Spice library file (*.lib)|*." ) + FormatWildcardExt( "lib" );
311 }
312 
313 
315 {
316  return _( "SPICE netlist file (.cir)|*." ) + FormatWildcardExt( "cir" );
317 }
318 
319 
321 {
322  return _( "CadStar netlist file (.frp)|*." ) + FormatWildcardExt( "frp" );
323 }
324 
325 
326 wxString EquFileWildcard()
327 {
328  return _( "Symbol footprint association files (*.equ)|*." ) + FormatWildcardExt( "equ" );
329 }
330 
331 
332 wxString ZipFileWildcard()
333 {
334  return _( "Zip file (*.zip)|*." ) + FormatWildcardExt( "zip" );
335 }
336 
337 
339 {
340  return _( "GenCAD 1.4 board files (.cad)|*." ) + FormatWildcardExt( "cad" );
341 }
342 
343 
344 wxString DxfFileWildcard()
345 {
346  return _( "DXF Files (*.dxf)|*." ) + FormatWildcardExt( "dxf" );
347 }
348 
349 
351 {
352  return _( "Gerber job file (*.gbrjob)|*." ) + FormatWildcardExt( "gbrjob" ) +
353  ";.gbrjob";
354 }
355 
356 
358 {
359  return _( "Specctra DSN file (*.dsn)|*." ) + FormatWildcardExt( "dsn" );
360 }
361 
362 
364 {
365  return _( "IPC-D-356 Test Files (.d356)|*." ) + FormatWildcardExt( "d356" );
366 }
367 
368 
370 {
371  return _( "Workbook file (*.wbk)|*." ) + FormatWildcardExt( "wbk" );
372 }
373 
374 
375 wxString PngFileWildcard()
376 {
377  return _( "PNG file (*.png)|*." ) + FormatWildcardExt( "png" );
378 }
wxString GerberFileWildcard()
wxString SchematicSymbolFileWildcard()
wxString PageLayoutDescrFileWildcard()
wxString SchematicFileWildcard()
wxString EaglePcbFileWildcard()
const wxString PdfFileExtension("pdf")
wxString EagleFootprintLibPathWildcard()
wxString SVGFileWildcard()
const wxString ComponentFileExtension("cmp")
wxString ComponentFileWildcard()
wxString SpiceNetlistFileWildcard()
wxString PdfFileWildcard()
const wxString EagleFootprintLibPathExtension("lbr")
const wxString KiCadLib3DShapesPathExtension("3dshapes")
3D shapes default libpath
const wxString GerberFileExtension("gbr")
wxString DxfFileWildcard()
wxString SchematicLibraryFileWildcard()
wxString ZipFileWildcard()
const wxString SVGFileExtension("svg")
wxString CsvFileWildcard()
const wxString AllFilesWildcard(_("All files (*)|*"))
const wxString GedaPcbFootprintLibFileExtension("fp")
const wxString KiCadPcbFileExtension("kicad_pcb")
const wxString DrillFileExtension("drl")
const wxString ReportFileExtension("rpt")
wxString LegacyFootprintLibPathWildcard()
wxString EquFileWildcard()
const wxString IpcD356FileExtension("d356")
wxString LegacyPcbFileWildcard()
wxString PSFileWildcard()
const wxString SchematicSymbolFileExtension("sym")
const wxString FootprintPlaceFileExtension("pos")
wxString GencadFileWildcard()
const wxString NetlistFileExtension("net")
const wxString SpecctraDsnFileExtension("dsn")
wxString ReportFileWildcard()
wxString NetlistFileWildcard()
wxString HtmlFileWildcard()
const wxString KiCadFootprintFileExtension("kicad_mod")
wxString ModLegacyExportFileWildcard()
The common library.
const wxString KiCadFootprintLibPathExtension("pretty")
KICAD PLUGIN libpath.
const wxString GerberJobFileExtension("gbrjob")
wxString DrillFileWildcard()
const wxString SchematicBackupFileExtension("bak")
wxString IpcD356FileWildcard()
wxString PngFileWildcard()
wxString ProjectFileWildcard()
const wxString VrmlFileExtension("wrl")
const wxString LegacyFootprintLibPathExtension("mod")
wxString ErcFileWildcard()
const wxString SchematicFileExtension("sch")
const wxString SchematicLibraryFileExtension("lib")
wxString KiCadFootprintLibPathWildcard()
wxString GerberJobFileWildcard()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
const wxString HtmlFileExtension(wxT("html"))
wxString EagleSchematicFileWildcard()
wxString FootprintPlaceFileWildcard()
wxString Shapes3DFileWildcard()
wxString SpiceLibraryFileWildcard()
const wxString PageLayoutDescrFileExtension("kicad_wks")
wxString PcbFileWildcard()
wxString TextFileWildcard()
const wxString MacrosFileExtension("mcr")
wxString SpecctraDsnFileWildcard()
wxString IDF3DFileWildcard()
wxString EagleFilesWildcard()
const wxString ProjectFileExtension("pro")
wxString WorkbookFileWildcard()
wxString PCadPcbFileWildcard()
const wxString LegacyPcbFileExtension("brd")
wxString KiCadFootprintLibFileWildcard()
wxString GedaPcbFootprintLibFileWildcard()
wxString CadstarNetlistFileWildcard()
static wxString FormatWildcardExt(const wxString &aWildcard)
Format wildcard extension to support case sensitive file dialogs.