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 std::string SchematicSymbolFileExtension( "sym" );
72 const std::string SchematicLibraryFileExtension( "lib" );
73 const std::string SchematicBackupFileExtension( "bak" );
74 
75 const std::string VrmlFileExtension( "wrl" );
76 
77 const std::string ProjectFileExtension( "pro" );
78 const std::string SchematicFileExtension( "sch" );
79 const std::string NetlistFileExtension( "net" );
80 const std::string ComponentFileExtension( "cmp" );
81 const std::string GerberFileExtension( "gbr" );
82 const std::string GerberJobFileExtension( "gbrjob" );
83 const std::string HtmlFileExtension( "html" );
84 
85 const std::string LegacyPcbFileExtension( "brd" );
86 const std::string KiCadPcbFileExtension( "kicad_pcb" );
87 const std::string PageLayoutDescrFileExtension( "kicad_wks" );
88 
89 const std::string PdfFileExtension( "pdf" );
90 const std::string MacrosFileExtension( "mcr" );
91 const std::string DrillFileExtension( "drl" );
92 const std::string SVGFileExtension( "svg" );
93 const std::string ReportFileExtension( "rpt" );
94 const std::string FootprintPlaceFileExtension( "pos" );
95 const std::string KiCadLib3DShapesPathExtension( "3dshapes" );
96 
97 const std::string KiCadFootprintLibPathExtension( "pretty" );
98 const std::string LegacyFootprintLibPathExtension( "mod" );
99 const std::string EagleFootprintLibPathExtension( "lbr" );
100 
101 const std::string KiCadFootprintFileExtension( "kicad_mod" );
102 const std::string GedaPcbFootprintLibFileExtension( "fp" );
103 const std::string SpecctraDsnFileExtension( "dsn" );
104 const std::string 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()
const std::string GerberFileExtension("gbr")
wxString PageLayoutDescrFileWildcard()
const std::string ComponentFileExtension("cmp")
const std::string KiCadFootprintFileExtension("kicad_mod")
wxString SchematicFileWildcard()
wxString EaglePcbFileWildcard()
wxString EagleFootprintLibPathWildcard()
wxString SVGFileWildcard()
wxString ComponentFileWildcard()
wxString SpiceNetlistFileWildcard()
wxString PdfFileWildcard()
wxString DxfFileWildcard()
const std::string KiCadPcbFileExtension("kicad_pcb")
wxString SchematicLibraryFileWildcard()
wxString ZipFileWildcard()
wxString CsvFileWildcard()
const wxString AllFilesWildcard(_("All files (*)|*"))
wxString LegacyFootprintLibPathWildcard()
wxString EquFileWildcard()
const std::string LegacyFootprintLibPathExtension("mod")
const std::string KiCadLib3DShapesPathExtension("3dshapes")
3D shapes default libpath
const std::string SchematicLibraryFileExtension("lib")
wxString LegacyPcbFileWildcard()
const std::string IpcD356FileExtension("d356")
wxString PSFileWildcard()
const std::string SVGFileExtension("svg")
const std::string PageLayoutDescrFileExtension("kicad_wks")
wxString GencadFileWildcard()
wxString ReportFileWildcard()
const std::string SchematicSymbolFileExtension("sym")
const std::string HtmlFileExtension("html")
wxString NetlistFileWildcard()
wxString HtmlFileWildcard()
const std::string DrillFileExtension("drl")
wxString ModLegacyExportFileWildcard()
The common library.
const std::string VrmlFileExtension("wrl")
const std::string LegacyPcbFileExtension("brd")
const std::string MacrosFileExtension("mcr")
wxString DrillFileWildcard()
wxString IpcD356FileWildcard()
wxString PngFileWildcard()
const std::string KiCadFootprintLibPathExtension("pretty")
KICAD PLUGIN libpath.
const std::string ReportFileExtension("rpt")
wxString ProjectFileWildcard()
const std::string GerberJobFileExtension("gbrjob")
const std::string GedaPcbFootprintLibFileExtension("fp")
wxString ErcFileWildcard()
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
wxString EagleSchematicFileWildcard()
const std::string SchematicBackupFileExtension("bak")
wxString FootprintPlaceFileWildcard()
const std::string SchematicFileExtension("sch")
wxString Shapes3DFileWildcard()
wxString SpiceLibraryFileWildcard()
const std::string PdfFileExtension("pdf")
wxString PcbFileWildcard()
const std::string SpecctraDsnFileExtension("dsn")
wxString TextFileWildcard()
wxString SpecctraDsnFileWildcard()
wxString IDF3DFileWildcard()
const std::string NetlistFileExtension("net")
wxString EagleFilesWildcard()
wxString WorkbookFileWildcard()
const std::string ProjectFileExtension("pro")
wxString PCadPcbFileWildcard()
const std::string EagleFootprintLibPathExtension("lbr")
wxString KiCadFootprintLibFileWildcard()
wxString GedaPcbFootprintLibFileWildcard()
wxString CadstarNetlistFileWildcard()
static wxString FormatWildcardExt(const wxString &aWildcard)
Format wildcard extension to support case sensitive file dialogs.
const std::string FootprintPlaceFileExtension("pos")