KiCad PCB EDA Suite
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 <dick@softplc.com>
5  * Copyright (C) 2014 KiCad Developers, see CHANGELOG.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, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef PGM_KICAD_H_
26 #define PGM_KICAD_H_
27 
28 
29 #include <pgm_base.h>
30 #include <bin_mod.h>
31 
32 
40 class PGM_KICAD : public PGM_BASE
41 {
42 public:
44  m_bm( "kicad" ) // indicates a "$HOME/.kicad wxConfig like" config file.
45  {}
46 
47  ~PGM_KICAD() throw()
48  {
49  Destroy();
50  }
51 
52  bool OnPgmInit();
53  void OnPgmExit();
54 
55  void MacOpenFile( const wxString& aFileName ) override;
56 
57  wxFileHistory& GetFileHistory() { return m_bm.m_history; }
58 
59  wxConfigBase* PgmSettings() { return m_bm.m_config; }
60 
62 
63  wxString GetHelpFileName() { return m_bm.m_help_file; }
64 
65  // The PGM_* classes can have difficulties at termination if they
66  // are not destroyed soon enough. Relying on a static destructor can be
67  // too late for contained objects like wxSingleInstanceChecker.
68  void Destroy();
69 
70 protected:
71 
73 };
74 
75 
76 extern PGM_KICAD& PgmTop();
77 
78 
79 #endif // PGM_KICAD_H_
SEARCH_STACK & SysSearch()
Definition: pgm_kicad.h:61
Struct BIN_MOD pertains to a single program module, either an EXE or a DSO/DLL ("bin_mod").
Definition: bin_mod.h:47
Class PGM_BASE keeps program (whole process) data for KiCad programs.
Definition: pgm_base.h:107
Class PGM_KICAD extends PGM_BASE to bring in FileHistory() and PdfBrowser() which were moved from EDA...
Definition: pgm_kicad.h:40
void MacOpenFile(const wxString &aFileName) override
Function MacOpenFile is specific to MacOSX (not used under Linux or Windows).
Definition: kicad.cpp:191
PGM_KICAD()
Definition: pgm_kicad.h:43
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
bool OnPgmInit()
Definition: kicad.cpp:77
wxConfigBase * PgmSettings()
Definition: pgm_kicad.h:59
~PGM_KICAD()
Definition: pgm_kicad.h:47
void Destroy()
Definition: kicad.cpp:206
SEARCH_STACK m_search
Definition: bin_mod.h:61
wxString m_help_file
Definition: bin_mod.h:59
BIN_MOD m_bm
Definition: pgm_kicad.h:72
see class PGM_BASE
wxFileHistory m_history
Definition: bin_mod.h:58
wxString GetHelpFileName()
Definition: pgm_kicad.h:63
wxFileHistory & GetFileHistory()
Definition: pgm_kicad.h:57
PGM_KICAD & PgmTop()
Definition: kicad.cpp:71
void OnPgmExit()
Definition: kicad.cpp:178
wxConfigBase * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:57