KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIPLATFORM::APP Namespace Reference

Functions

bool Init ()
 Perform application-specific initialization tasks.
 
bool AttachConsole (bool aTryAlloc)
 Tries to attach a console window with stdout, stderr and stdin.
 
bool IsOperatingSystemUnsupported ()
 Checks if the Operating System is explicitly unsupported and we want to prevent users from sending bug reports and show them a disclaimer on startup.
 
bool RegisterApplicationRestart (const wxString &aCommandLine)
 Registers the application for restart with the OS with the given command line string to pass as args.
 
bool UnregisterApplicationRestart ()
 Unregisters the application from automatic restart.
 
bool SupportsShutdownBlockReason ()
 Whether or not the window supports setting a shutdown block reason.
 
void SetShutdownBlockReason (wxWindow *aWindow, const wxString &aReason)
 Sets the block reason why the window/application is preventing OS shutdown.
 
void RemoveShutdownBlockReason (wxWindow *aWindow)
 Removes any shutdown block reason set.
 
void ForceTimerMessagesToBeCreatedIfNecessary ()
 Forces wxTimers to fire more promptly on Win32.
 
void AddDynamicLibrarySearchPath (const wxString &aPath)
 Inserts a search path for loading dynamic libraries.
 

Function Documentation

◆ AddDynamicLibrarySearchPath()

void KIPLATFORM::APP::AddDynamicLibrarySearchPath ( const wxString &  aPath)

Inserts a search path for loading dynamic libraries.

The exact place this new path ends up in the dynamic library search order is platform-dependent, but generally this can be used to make sure dynamic libraries are found in non-standard runtime situations.

Parameters
aPathis the full path to insert

Definition at line 100 of file unix/app.cpp.

Referenced by KIWAY::KiFACE().

◆ AttachConsole()

bool KIPLATFORM::APP::AttachConsole ( bool  aTryAlloc)

Tries to attach a console window with stdout, stderr and stdin.

Parameters
aTryAlloctry to allocate the console if cannot attach to it.
Returns
true if attach successful, false if unsuccessful

Definition at line 51 of file unix/app.cpp.

Referenced by PYTHON_ACTION_PLUGIN::CallMethod().

◆ ForceTimerMessagesToBeCreatedIfNecessary()

void KIPLATFORM::APP::ForceTimerMessagesToBeCreatedIfNecessary ( )

Forces wxTimers to fire more promptly on Win32.

wxTimers on win32 are not real timers They live in the message pump at the absolute lowest priority (only when no other events are pending) This functions "peeks" the message pump which causes them to get queued immediately

Call as needed in an application to ensure timers are dispatched

Definition at line 95 of file unix/app.cpp.

Referenced by TOOL_DISPATCHER::DispatchWxEvent().

◆ Init()

bool KIPLATFORM::APP::Init ( )

Perform application-specific initialization tasks.

These tasks should be called after the wxApp is constructed (e.g. inside the OnInit method).

Returns
true if init successful, false if unsuccessful

Definition at line 40 of file unix/app.cpp.

References nullLogWriter().

Referenced by init_unit_test(), APP_SINGLE_TOP::OnInit(), APP_KICAD::OnInit(), and APP_KICAD_CLI::OnInit().

◆ IsOperatingSystemUnsupported()

bool KIPLATFORM::APP::IsOperatingSystemUnsupported ( )

Checks if the Operating System is explicitly unsupported and we want to prevent users from sending bug reports and show them a disclaimer on startup.

Returns
true if unsupported

Definition at line 58 of file unix/app.cpp.

Referenced by buildKicadAboutBanner(), GetVersionInfoData(), and WarnUserIfOperatingSystemUnsupported().

◆ RegisterApplicationRestart()

bool KIPLATFORM::APP::RegisterApplicationRestart ( const wxString &  aCommandLine)

Registers the application for restart with the OS with the given command line string to pass as args.

Parameters
aCommandLineis string the OS will invoke the application with

Definition at line 65 of file unix/app.cpp.

Referenced by KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::OpenProjectFiles(), and PCB_EDIT_FRAME::OpenProjectFiles().

◆ RemoveShutdownBlockReason()

void KIPLATFORM::APP::RemoveShutdownBlockReason ( wxWindow *  aWindow)

Removes any shutdown block reason set.

Parameters
aWindowthat has a shutdown block reason set

Definition at line 85 of file unix/app.cpp.

Referenced by EDA_BASE_FRAME::~EDA_BASE_FRAME().

◆ SetShutdownBlockReason()

void KIPLATFORM::APP::SetShutdownBlockReason ( wxWindow *  aWindow,
const wxString &  aReason 
)

Sets the block reason why the window/application is preventing OS shutdown.

This should be set far ahead of any close event.

This is mainly intended for Windows platforms where this is a native feature.

Parameters
aWindowthat will have a shutdown blocker message
aReasonto display why the shutdown block is occurring

Definition at line 90 of file unix/app.cpp.

Referenced by CVPCB_MAINFRAME::CVPCB_MAINFRAME(), EVT_UPDATE_UI_RANGE(), FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME(), PCB_EDIT_FRAME::onBoardLoaded(), PL_EDITOR_FRAME::OnNewDrawingSheet(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::SCH_EDIT_FRAME(), and SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME().

◆ SupportsShutdownBlockReason()

bool KIPLATFORM::APP::SupportsShutdownBlockReason ( )

◆ UnregisterApplicationRestart()

bool KIPLATFORM::APP::UnregisterApplicationRestart ( )

Unregisters the application from automatic restart.

Depending on OS, this may not be required

Definition at line 72 of file unix/app.cpp.