KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pgm_kicad.h
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) 2014 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
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#ifndef PGM_KICAD_H_
22#define PGM_KICAD_H_
23
24#include <pgm_base.h>
28#include <bin_mod.h>
29
36class PGM_KICAD : public PGM_BASE
37{
38public:
40 m_bm( "kicad" ) // indicates a "$HOME/.kicad wxConfig like" config file.
41 {}
42
43 ~PGM_KICAD() throw()
44 {
45 Destroy();
46 }
47
48 bool OnPgmInit();
49 void OnPgmExit();
50 int OnPgmRun();
51
52 void MacOpenFile( const wxString& aFileName ) override;
53
54 APP_SETTINGS_BASE* PgmSettings() { return m_bm.m_config; }
55
56 SEARCH_STACK& SysSearch() { return m_bm.m_search; }
57
58 wxString GetHelpFileName() { return m_bm.m_help_file; }
59
60 // The PGM_* classes can have difficulties at termination if they
61 // are not destroyed soon enough. Relying on a static destructor can be
62 // too late for the objects they contain.
63 void Destroy();
64
65protected:
66
68
69 // In PGM_SINGLE_TOP because PGM_BASE is in kicommon, and this can't be in the DLL
70 // because it depends on things like EDA_TEXT and EDA_SHAPE that aren't in the DLL
71 std::unique_ptr<API_HANDLER_COMMON> m_api_common_handler;
72 std::unique_ptr<API_HANDLER_LIBRARIES> m_api_libraries_handler;
73};
74
75
76extern PGM_KICAD& PgmTop();
77
78
79#endif // PGM_KICAD_H_
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
PGM_KICAD extends PGM_BASE to bring in FileHistory() and PdfBrowser() which were moved from EDA_APP i...
Definition pgm_kicad.h:37
wxString GetHelpFileName()
Definition pgm_kicad.h:58
bool OnPgmInit()
Definition kicad.cpp:99
void Destroy()
Definition kicad.cpp:526
SEARCH_STACK & SysSearch()
Definition pgm_kicad.h:56
std::unique_ptr< API_HANDLER_COMMON > m_api_common_handler
Definition pgm_kicad.h:71
void MacOpenFile(const wxString &aFileName) override
Specific to MacOSX (not used under Linux or Windows).
Definition kicad.cpp:513
void OnPgmExit()
Definition kicad.cpp:484
APP_SETTINGS_BASE * PgmSettings()
Definition pgm_kicad.h:54
std::unique_ptr< API_HANDLER_LIBRARIES > m_api_libraries_handler
Definition pgm_kicad.h:72
int OnPgmRun()
Definition kicad.cpp:478
BIN_MOD m_bm
Definition pgm_kicad.h:67
Look for files in a number of paths.
see class PGM_BASE
PGM_KICAD & PgmTop()
Definition kicad.cpp:93
Pertains to a single program module, either an EXE or a DSO/DLL ("bin_mod").
Definition bin_mod.h:37