37#include <wx/filename.h>
38#include <wx/stdpaths.h>
39#include <wx/snglinst.h>
40#include <wx/html/htmlwin.h>
68 int aCtlBits = 0 )
override
112 wxFileName filename( aFileName );
114 if( filename.FileExists() )
174 auto app = wxApp::GetInstance();
182 catch(
const std::exception& e )
184 wxLogError( wxT(
"Unhandled exception class: %s what: %s" ),
189 wxLogError( ioe.
What() );
193 wxLogError( wxT(
"Unhandled exception of unknown type" ) );
204 return wxApp::OnExit();
213 ret = wxApp::OnRun();
215 catch(
const std::exception& e )
217 wxLogError( wxT(
"Unhandled exception class: %s what: %s" ),
223 wxLogError( ioe.
What() );
227 wxLogError( wxT(
"Unhandled exception of unknown type" ) );
244 Pgm().App().SetTopWindow( aFrame );
252#ifndef TEST_APP_NO_MAIN
254int main(
int argc,
char** argv )
256 wxInitialize( argc, argv );
259 Pgm().InitPgm(
false,
true );
261 Pgm().InitPgm(
true,
true );
264 auto ret = wxEntry( argc, argv );
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
FACE_T
Known KIFACE implementations.
Class that handles delegation of command lines to one of a number of "sub-utilities".
int HandleCommandLine(int argc, char **argv) const
Take in a command line and:
Container for data for KiCad programs.
virtual wxApp & App()
Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
This file is part of the common library.
#define KFCTL_STANDALONE
Running as a standalone Top.
wxString From_UTF8(const char *cstring)
Implement a bare naked wxApp (so that we don't become dependent on functionality in a wxApp derivativ...
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
IFACE(const char *aName, KIWAY::FACE_T aType)
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
void MacOpenFile(const wxString &aFileName) override
Specific to MacOSX (not used under Linux or Windows).
IMPLEMENT_APP_NO_MAIN(APP_TEST)
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
void SetTopFrame(wxFrame *aFrame)
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...