![]() |
KiCad PCB EDA Suite
|
#include <wx/ffile.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <confirm.h>
#include <kicad_string.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <dialog_helpers.h>
#include <filter_reader.h>
#include <fp_lib_table.h>
#include <validators.h>
#include <dialogs/dialog_text_entry.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <board.h>
#include <footprint.h>
#include <board_commit.h>
#include <footprint_edit_frame.h>
#include <wildcards_and_files_ext.h>
#include <plugins/kicad/kicad_plugin.h>
#include <plugins/legacy/legacy_plugin.h>
#include <env_paths.h>
#include <paths.h>
#include <settings/settings_manager.h>
#include <footprint_editor_settings.h>
#include "footprint_viewer_frame.h"
Go to the source code of this file.
Functions | |
static const wxString | INFO_LEGACY_LIB_WARN_EDIT (_("Writing/modifying legacy libraries (.mod files) is not allowed\n" "Please save the current library to the new .pretty format\n" "and update your footprint lib table\n" "to save your footprint (a .kicad_mod file) in the .pretty library folder")) |
static const wxString | INFO_LEGACY_LIB_WARN_DELETE (_("Modifying legacy libraries (.mod files) is not allowed\n" "Please save the current library under the new .pretty format\n" "and update your footprint lib table\n" "before deleting a footprint")) |
static wxFileName | getFootprintFilenameFromUser (wxWindow *aParent, const wxString &aLastPath) |
Prompt the user for a footprint file to open. More... | |
static IO_MGR::PCB_FILE_T | detect_file_type (FILE *aFile, const wxFileName &aFileName, wxString *aName) |
Read a file to detect the type. More... | |
static FOOTPRINT * | parse_footprint_with_plugin (const wxFileName &aFileName, IO_MGR::PCB_FILE_T aFileType, const wxString &aName) |
Parse a footprint using a PLUGIN. More... | |
static FOOTPRINT * | parse_footprint_kicad (const wxFileName &aFileName) |
Parse a KICAD footprint. More... | |
FOOTPRINT * | try_load_footprint (const wxFileName &aFileName, IO_MGR::PCB_FILE_T aFileType, const wxString &aName) |
Try to load a footprint, returning nullptr if the file couldn't be accessed. More... | |
|
static |
Read a file to detect the type.
aFile | - open file to be read. File pointer will be closed. |
aFileName | - file name to be read |
aName | - wxString to receive the footprint name iff type is LEGACY |
Definition at line 103 of file footprint_libraries_utils.cpp.
References IO_MGR::FILE_TYPE_NONE, FOOTPRINT_LIBRARY_HEADER, FOOTPRINT_LIBRARY_HEADER_CNT, FROM_UTF8(), IO_MGR::GEDA_PCB, IO_MGR::KICAD_SEXP, IO_MGR::LEGACY, and StrPurge().
Referenced by FOOTPRINT_EDIT_FRAME::ImportFootprint().
|
static |
Prompt the user for a footprint file to open.
aParent | - parent window for the dialog |
aLastPath | - last opened path |
Definition at line 73 of file footprint_libraries_utils.cpp.
References _, AllFilesWildcard(), GedaPcbFootprintLibFileWildcard(), KiCadFootprintLibFileWildcard(), and ModLegacyExportFileWildcard().
Referenced by FOOTPRINT_EDIT_FRAME::ImportFootprint().
|
static |
Referenced by FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary().
|
static |
Referenced by FOOTPRINT_EDIT_FRAME::SaveFootprint(), and FOOTPRINT_EDIT_FRAME::SaveFootprintAs().
|
static |
Parse a KICAD footprint.
aFileName | - file name to parse |
Definition at line 179 of file footprint_libraries_utils.cpp.
References PCB_IO::Parse().
Referenced by try_load_footprint().
|
static |
Parse a footprint using a PLUGIN.
aFileName | - file name to parse |
aFileType | - type of the file |
aName | - name of the footprint |
Definition at line 156 of file footprint_libraries_utils.cpp.
References IO_MGR::GEDA_PCB, IO_MGR::LEGACY, path, and IO_MGR::PluginFind().
Referenced by try_load_footprint().
FOOTPRINT* try_load_footprint | ( | const wxFileName & | aFileName, |
IO_MGR::PCB_FILE_T | aFileType, | ||
const wxString & | aName | ||
) |
Try to load a footprint, returning nullptr if the file couldn't be accessed.
aFileName | - file name to load |
aFileType | - type of the file to load |
aName | - footprint name |
Definition at line 200 of file footprint_libraries_utils.cpp.
References IO_MGR::GEDA_PCB, IO_MGR::KICAD_SEXP, IO_MGR::LEGACY, parse_footprint_kicad(), and parse_footprint_with_plugin().
Referenced by FOOTPRINT_EDIT_FRAME::ImportFootprint().