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() )
119 KIWAY_PLAYER* frame = dynamic_cast<KIWAY_PLAYER*>(
App().GetTopWindow() );
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 254 int 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 );
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
void SetTopFrame(wxFrame *aFrame)
Implement a bare naked wxApp (so that we don't become dependent on functionality in a wxApp derivativ...
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
void MacOpenFile(const wxString &aFileName) override
Specific to MacOSX (not used under Linux or Windows).
This file is part of the common library.
Container for data for KiCad programs.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
virtual wxApp & App()
Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
IFACE(const char *aName, KIWAY::FACE_T aType)
int main(int argc, char **argv)
Class that handles delegation of command lines to one of a number of "sub-utilities".
This file contains miscellaneous commonly used macros and functions.
virtual const wxString What() const
A composite of Problem() and Where()
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
FACE_T
Known KIFACE implementations.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
int HandleCommandLine(int argc, char **argv) const
Take in a command line and:
IMPLEMENT_APP_NO_MAIN(APP_TEST)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)
#define KFCTL_STANDALONE
Running as a standalone Top.