KiCad PCB EDA Suite
APP_KICAD Struct Reference

Struct APP_KICAD is not publicly visible because most of the action is in PGM_KICAD these days. More...

Inheritance diagram for APP_KICAD:

Public Member Functions

bool OnInit () override
 
int OnExit () override
 
int OnRun () override
 

Detailed Description

Struct APP_KICAD is not publicly visible because most of the action is in PGM_KICAD these days.

Definition at line 224 of file kicad.cpp.

Member Function Documentation

◆ OnExit()

int APP_KICAD::OnExit ( )
inlineoverride

Definition at line 263 of file kicad.cpp.

264  {
265  program.OnPgmExit();
266 
267 #if defined(__FreeBSD__)
268  /* Avoid wxLog crashing when used in destructors. */
269  wxLog::EnableLogging( false );
270 #endif
271 
272  return wxApp::OnExit();
273  }
static PGM_KICAD program
Definition: kicad.cpp:63
void OnPgmExit()
Definition: kicad.cpp:176

References PGM_KICAD::OnPgmExit(), and program.

◆ OnInit()

bool APP_KICAD::OnInit ( )
inlineoverride

Definition at line 252 of file kicad.cpp.

253  {
254  if( !program.OnPgmInit() )
255  {
256  program.OnPgmExit();
257  return false;
258  }
259 
260  return true;
261  }
bool OnPgmInit()
Definition: kicad.cpp:78
static PGM_KICAD program
Definition: kicad.cpp:63
void OnPgmExit()
Definition: kicad.cpp:176

References PGM_KICAD::OnPgmExit(), PGM_KICAD::OnPgmInit(), and program.

◆ OnRun()

int APP_KICAD::OnRun ( )
inlineoverride

Definition at line 275 of file kicad.cpp.

276  {
277  try
278  {
279  return wxApp::OnRun();
280  }
281  catch( const std::exception& e )
282  {
283  wxLogError( wxT( "Unhandled exception class: %s what: %s" ),
284  GetChars( FROM_UTF8( typeid(e).name() )),
285  GetChars( FROM_UTF8( e.what() ) ) );
286  }
287  catch( const IO_ERROR& ioe )
288  {
289  wxLogError( GetChars( ioe.What() ) );
290  }
291  catch(...)
292  {
293  wxLogError( wxT( "Unhandled exception of unknown type" ) );
294  }
295 
296  return -1;
297  }
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:62
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:101
const char * name
Definition: DXF_plotter.cpp:60
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76

References FROM_UTF8(), GetChars(), name, and IO_ERROR::What().


The documentation for this struct was generated from the following file: