39 #include <wx/filename.h> 40 #include <wx/stdpaths.h> 41 #include <wx/snglinst.h> 42 #include <wx/html/htmlwin.h> 69 wxWindow*
CreateWindow( wxWindow* aParent,
int aClassId,
KIWAY* aKiway,
int aCtlBits = 0 )
override 112 wxFileName filename( aFileName );
114 if( filename.FileExists() )
119 KIWAY_PLAYER* frame = dynamic_cast<KIWAY_PLAYER*>(
App().GetTopWindow() );
173 auto app = wxApp::GetInstance();
181 catch(
const std::exception& e )
183 wxLogError( wxT(
"Unhandled exception class: %s what: %s" ),
189 wxLogError( ioe.
What() );
193 wxLogError( wxT(
"Unhandled exception of unknown type" ) );
206 return wxApp::OnExit();
215 ret = wxApp::OnRun();
217 catch(
const std::exception& e )
219 wxLogError( wxT(
"Unhandled exception class: %s what: %s" ),
225 wxLogError( ioe.
What() );
229 wxLogError( wxT(
"Unhandled exception of unknown type" ) );
248 Pgm().App().SetTopWindow( aFrame );
254 #ifndef TEST_APP_NO_MAIN 256 int main(
int argc,
char** argv )
258 wxInitialize( argc, argv );
262 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 KIFACE (I)mplementation.
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)
Struct APP_SINGLE_TOP implements a bare naked wxApp (so that we don't become dependent on functionali...
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
Function IfaceOrAddress return a pointer to the requested object.
FACE_T
Known KIFACE implementations.
int HandleCommandLine(int argc, char **argv) const
Take in a a command line and:
bool InitPgm()
Initialize this program.
IFACE KIFACE_I kiface("pcb_test_frame", KIWAY::FACE_PCB)
IMPLEMENT_APP_NO_MAIN(APP_TEST)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
#define KFCTL_STANDALONE
Running as a standalone Top.