KiCad PCB EDA Suite
KIPLATFORM::APP Namespace Reference

Functions

bool Init ()
 Perform application-specific initialization tasks. More...
 
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. More...
 
bool RegisterApplicationRestart (const wxString &aCommandLine)
 Registers the application for restart with the OS with the given command line string to pass as args. More...
 
bool UnregisterApplicationRestart ()
 Unregisters the application from automatic restart. More...
 
bool SupportsShutdownBlockReason ()
 Whether or not the window supports setting a shutdown block reason. More...
 
void SetShutdownBlockReason (wxWindow *aWindow, const wxString &aReason)
 Sets the block reason why the window/application is preventing OS shutdown. More...
 
void RemoveShutdownBlockReason (wxWindow *aWindow)
 Removes any shutdown block reason set. More...
 
void ForceTimerMessagesToBeCreatedIfNecessary ()
 Forces wxTimers to fire more promptly on Win32. More...
 
void AddDynamicLibrarySearchPath (const wxString &aPath)
 Inserts a search path for loading dynamic libraries. More...
 

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 93 of file gtk/app.cpp.

94 {
95 }

Referenced by KIWAY::KiFACE().

◆ 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 88 of file gtk/app.cpp.

89 {
90 }

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 gtk/app.cpp.

41 {
42 #if !defined( KICAD_SHOW_GTK_MESSAGES )
43  // Attach a logger that will consume the annoying GTK error messages
44  g_log_set_writer_func( nullLogWriter, NULL, NULL );
45 #endif
46 
47  return true;
48 }
#define NULL
static GLogWriterOutput nullLogWriter(GLogLevelFlags log_level, const GLogField *fields, gsize n_fields, gpointer user_data)
Definition: gtk/app.cpp:33

References NULL, and nullLogWriter().

Referenced by APP_SINGLE_TOP::OnInit(), and APP_KICAD::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 51 of file gtk/app.cpp.

52 {
53  // Not implemented on this platform
54  return false;
55 }

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 58 of file gtk/app.cpp.

59 {
60  // Not implemented on this platform
61  return true;
62 }

Referenced by KICAD_MANAGER_FRAME::LoadProject(), PCB_EDIT_FRAME::OpenProjectFiles(), and SCH_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 78 of file gtk/app.cpp.

79 {
80 }

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 83 of file gtk/app.cpp.

84 {
85 }

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 ( )

Whether or not the window supports setting a shutdown block reason.

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

73 {
74  return false;
75 }

Referenced by FOOTPRINT_EDIT_FRAME::canCloseWindow(), PL_EDITOR_FRAME::canCloseWindow(), CVPCB_MAINFRAME::canCloseWindow(), SYMBOL_EDIT_FRAME::canCloseWindow(), PCB_EDIT_FRAME::canCloseWindow(), and SCH_EDIT_FRAME::canCloseWindow().

◆ UnregisterApplicationRestart()

bool KIPLATFORM::APP::UnregisterApplicationRestart ( )

Unregisters the application from automatic restart.

Depending on OS, this may not be required

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

66 {
67  // Not implemented on this platform
68  return true;
69 }