Browse Source
Schematic plugins refactoring, fixes for PCB plugins.
Schematic plugins refactoring, fixes for PCB plugins.
- Move PLUGIN_FILE_DESC to common. - SCH_PLUGIN: rename Load -> LoadSchematicFile, Save -> SaveSchematicFile. - Use PLUGIN_FILE_DESC and CanRead* in schematic plugins. - Return none/unknown types from Find/GuessPluginType functions. - Iterate over file types for file wildcards. - Clean-up header checking in IO plugins. - Use PCB plugin list in IO_MGR::GuessPluginTypeFromLibPath.newinvert
43 changed files with 694 additions and 538 deletions
-
1common/CMakeLists.txt
-
32common/plugin_file_desc.cpp
-
62common/wildcards_and_files_ext.cpp
-
2eeschema/dialogs/dialog_sheet_properties.cpp
-
76eeschema/dialogs/panel_sym_lib_table.cpp
-
2eeschema/eeschema.cpp
-
2eeschema/eeschema_helpers.cpp
-
65eeschema/files-io.cpp
-
121eeschema/sch_io_mgr.cpp
-
86eeschema/sch_io_mgr.h
-
141eeschema/sch_plugin.cpp
-
25eeschema/sch_plugins/altium/sch_altium_plugin.cpp
-
20eeschema/sch_plugins/altium/sch_altium_plugin.h
-
28eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.cpp
-
21eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.h
-
7eeschema/sch_plugins/database/sch_database_plugin.cpp
-
15eeschema/sch_plugins/database/sch_database_plugin.h
-
63eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp
-
25eeschema/sch_plugins/eagle/sch_eagle_plugin.h
-
25eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp
-
28eeschema/sch_plugins/kicad/sch_sexpr_plugin.h
-
31eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp
-
36eeschema/sch_plugins/legacy/sch_legacy_plugin.h
-
23eeschema/sch_plugins/ltspice/ltspice_sch_plugin.cpp
-
18eeschema/sch_plugins/ltspice/ltspice_sch_plugin.h
-
9eeschema/sheet.cpp
-
3eeschema/symbol_editor/symbol_editor.cpp
-
48eeschema/symbol_editor/symbol_editor_import_export.cpp
-
4eeschema/symbol_lib_table.cpp
-
4eeschema/symbol_library_manager.cpp
-
59include/plugin_file_desc.h
-
13include/wildcards_and_files_ext.h
-
3pcbnew/files.cpp
-
4pcbnew/footprint_libraries_utils.cpp
-
54pcbnew/io_mgr.cpp
-
36pcbnew/io_mgr.h
-
21pcbnew/load_select_footprint.cpp
-
1pcbnew/plugin.cpp
-
2pcbnew/plugins/eagle/eagle_plugin.cpp
-
6pcbnew/tools/pcb_control.cpp
-
2qa/schematic_utils/eeschema_test_utils.cpp
-
2qa/schematic_utils/schematic_file_util.cpp
-
6qa/tests/eeschema/test_sch_sheet_list.cpp
@ -0,0 +1,32 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* 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, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <plugin_file_desc.h>
|
|||
#include <wildcards_and_files_ext.h>
|
|||
#include <wx/translation.h>
|
|||
|
|||
|
|||
wxString PLUGIN_FILE_DESC::FileFilter() const |
|||
{ |
|||
return wxGetTranslation( m_Description ) + AddFileExtListToFilter( m_FileExtensions ); |
|||
} |
@ -0,0 +1,59 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* 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, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef PLUGIN_FILE_DESC_H_ |
|||
#define PLUGIN_FILE_DESC_H_ |
|||
|
|||
#include <vector> |
|||
#include <string> |
|||
#include <wx/string.h> |
|||
|
|||
/** |
|||
* Container that describes file type info |
|||
*/ |
|||
struct PLUGIN_FILE_DESC |
|||
{ |
|||
wxString m_Description; ///< Description shown in the file picker dialog |
|||
std::vector<std::string> m_FileExtensions; ///< Filter used for file pickers if m_IsFile is true |
|||
std::vector<std::string> m_ExtensionsInDir; ///< In case of folders: extensions of files inside |
|||
bool m_IsFile; ///< Whether the library is a folder or a file |
|||
|
|||
PLUGIN_FILE_DESC( const wxString& aDescription, const std::vector<std::string>& aFileExtensions, |
|||
const std::vector<std::string>& aExtsInFolder = {}, bool aIsFile = true ) : |
|||
m_Description( aDescription ), |
|||
m_FileExtensions( aFileExtensions ), m_ExtensionsInDir( aExtsInFolder ), |
|||
m_IsFile( aIsFile ) |
|||
{ |
|||
} |
|||
|
|||
PLUGIN_FILE_DESC() : PLUGIN_FILE_DESC( wxEmptyString, {} ) {} |
|||
|
|||
/** |
|||
* @return translated description + wildcards string for file dialogs. |
|||
*/ |
|||
wxString FileFilter() const; |
|||
|
|||
operator bool() const { return !m_Description.empty(); } |
|||
}; |
|||
|
|||
#endif // PLUGIN_FILE_DESC_H_ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue