KiCad PCB EDA Suite
Loading...
Searching...
No Matches
TEST_KIWAY Class Reference
Inheritance diagram for TEST_KIWAY:
KIWAY

Public Types

enum  FACE_T {
  FACE_SCH , FACE_PCB , FACE_CVPCB , FACE_GERBVIEW ,
  FACE_PL_EDITOR , FACE_PCB_CALCULATOR , KIWAY_FACE_COUNT
}
 Known KIFACE implementations. More...
 

Public Member Functions

 TEST_KIWAY (SETTINGS_MANAGER &aManager)
 
void ProjectChanged () override
 Calls ProjectChanged() on all KIWAY_PLAYERs.
 
bool Notified () const
 
bool LockHeldWhenNotified () const
 
virtual KIFACE * KiFACE (FACE_T aFaceId, bool doLoad=true)
 Return the KIFACE* given a FACE_T.
 
virtual KIWAY_PLAYER * Player (FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
 Return the KIWAY_PLAYER* given a FRAME_T.
 
virtual bool PlayerClose (FRAME_T aFrameType, bool doForce)
 Call the KIWAY_PLAYER::Close( bool force ) function on the window and if not vetoed, returns true, else false.
 
virtual bool PlayersClose (bool doForce)
 Call the KIWAY_PLAYER::Close( bool force ) function on all the windows and if none are vetoed, returns true, else false.
 
void PlayerDidClose (FRAME_T aFrameType)
 Notifies a Kiway that a player has been closed.
 
virtual void ExpressMail (FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr, bool aFromOtherThread=false)
 Send aPayload to aDestination from aSource.
 
virtual void GetActions (std::vector< TOOL_ACTION * > &aActions) const
 Append all registered actions to the given list.
 
virtual PROJECT & Prj () const
 Return the PROJECT associated with this KIWAY.
 
LOCAL_HISTORY & LocalHistory ()
 Return the LOCAL_HISTORY associated with this KIWAY.
 
virtual void SetLanguage (int aLanguage)
 Change the language and then calls ShowChangedLanguage() on all KIWAY_PLAYER objects.
 
virtual void CommonSettingsChanged (int aFlags=0)
 Call CommonSettingsChanged() on all KIWAY_PLAYERs.
 
void ClearFileHistory ()
 Clear the wxWidgets file history on each open frame.
 
void SetCtlBits (int aCtlBits)
 Overwrites previously set ctl bits, only for use in kicad.cpp to flip between standalone and manager mode before we actually load anything.
 
void SetTop (wxFrame *aTop)
 Tell this KIWAY about the top most frame in the program and optionally allows it to play the role of one of the KIWAY_PLAYERs if launched from single_top.cpp.
 
wxFrame * GetTop ()
 
void OnKiCadExit ()
 
void OnKiwayEnd ()
 
bool ProcessEvent (wxEvent &aEvent) override
 
void QueueEvent (wxEvent *aEvent) override
 
int ProcessJob (KIWAY::FACE_T aFace, JOB *aJob, REPORTER *aReporter=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
 
bool ProcessApiCloseDocument (KIWAY::FACE_T aFace, const KIFACE::DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError=nullptr)
 
bool ProcessJobConfigDialog (KIWAY::FACE_T aFace, JOB *aJob, wxWindow *aWindow)
 
bool ProcessApiOpenDocument (KIWAY::FACE_T aFace, const KIFACE::DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError=nullptr)
 
wxWindow * GetBlockingDialog ()
 Gets the window pointer to the blocking dialog (to send it signals)
 
bool HasBlockingDialog () const
 
void SetBlockingDialog (wxWindow *aWin)
 

Static Public Member Functions

static FACE_T KifaceType (FRAME_T aFrameType)
 A simple mapping function which returns the FACE_T which is known to implement aFrameType.
 

Private Member Functions

const wxString dso_search_path (FACE_T aFaceId)
 Get the [path &] name of the DSO holding the requested FACE_T.
 
bool set_kiface (FACE_T aFaceType, KIFACE *aKiface)
 
KIWAY_PLAYER * GetPlayerFrame (FRAME_T aFrameType)
 

Private Attributes

SETTINGS_MANAGER & m_manager
 
bool m_notified = false
 
bool m_lockHeldWhenNotified = false
 
int m_ctl
 
wxFrame * m_top
 
wxWindowID m_blockingDialog
 
std::atomic< wxWindowID > m_playerFrameId [KIWAY_PLAYER_COUNT]
 
LOCAL_HISTORY * m_local_history
 

Static Private Attributes

static std::array< KIFACE *, KIWAY_FACE_COUNT > m_kiface
 
static std::array< int, KIWAY_FACE_COUNT > m_kiface_version
 

Detailed Description

Definition at line 314 of file test_settings_manager.cpp.

Member Enumeration Documentation

◆ FACE_T

enum KIWAY::FACE_T
inherited

Known KIFACE implementations.

Enumerator
FACE_SCH 

eeschema DSO

FACE_PCB 

pcbnew DSO

FACE_CVPCB 
FACE_GERBVIEW 
FACE_PL_EDITOR 
FACE_PCB_CALCULATOR 
KIWAY_FACE_COUNT 

Definition at line 353 of file kiway.h.

Constructor & Destructor Documentation

◆ TEST_KIWAY()

TEST_KIWAY::TEST_KIWAY ( SETTINGS_MANAGER & aManager)
inline

Definition at line 317 of file test_settings_manager.cpp.

References KFCTL_STANDALONE, KIWAY::KIWAY(), and m_manager.

Member Function Documentation

◆ ClearFileHistory()

void KIWAY::ClearFileHistory ( )
inherited

Clear the wxWidgets file history on each open frame.

Preference records are handled by SETTINGS_MANAGER (as not all frames might be open).

Definition at line 629 of file kiway.cpp.

References EDA_BASE_FRAME::ClearFileHistory(), GetPlayerFrame(), KFCTL_CPP_PROJECT_SUITE, KIWAY_PLAYER_COUNT, m_ctl, m_top, and top().

◆ CommonSettingsChanged()

void KIWAY::CommonSettingsChanged ( int aFlags = 0)
virtualinherited

◆ dso_search_path()

const wxString KIWAY::dso_search_path ( FACE_T aFaceId)
privateinherited

◆ ExpressMail()

◆ GetActions()

void KIWAY::GetActions ( std::vector< TOOL_ACTION * > & aActions) const
virtualinherited

Append all registered actions to the given list.

Definition at line 512 of file kiway.cpp.

References ACTION_MANAGER::GetActionList().

◆ GetBlockingDialog()

wxWindow * KIWAY::GetBlockingDialog ( )
inherited

◆ GetPlayerFrame()

KIWAY_PLAYER * KIWAY::GetPlayerFrame ( FRAME_T aFrameType)
privateinherited
Returns
the reference of the KIWAY_PLAYER having the type aFrameType if exists, or NULL if this KIWAY_PLAYER was not yet created, or was closed

Definition at line 383 of file kiway.cpp.

References m_playerFrameId.

Referenced by ClearFileHistory(), CommonSettingsChanged(), Player(), PlayerClose(), ProjectChanged(), and SetLanguage().

◆ GetTop()

wxFrame * KIWAY::GetTop ( )
inlineinherited

Definition at line 498 of file kiway.h.

References m_top.

◆ HasBlockingDialog()

bool KIWAY::HasBlockingDialog ( ) const
inlineinherited

Definition at line 524 of file kiway.h.

References m_blockingDialog.

◆ KiFACE()

◆ KifaceType()

◆ LocalHistory()

◆ LockHeldWhenNotified()

bool TEST_KIWAY::LockHeldWhenNotified ( ) const
inline

Definition at line 330 of file test_settings_manager.cpp.

References m_lockHeldWhenNotified.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Notified()

bool TEST_KIWAY::Notified ( ) const
inline

Definition at line 329 of file test_settings_manager.cpp.

References m_notified.

Referenced by BOOST_AUTO_TEST_CASE().

◆ OnKiCadExit()

◆ OnKiwayEnd()

void KIWAY::OnKiwayEnd ( )
inherited

Definition at line 818 of file kiway.cpp.

References m_kiface.

◆ Player()

KIWAY_PLAYER * KIWAY::Player ( FRAME_T aFrameType,
bool doCreate = true,
wxTopLevelWindow * aParent = nullptr )
virtualinherited

Return the KIWAY_PLAYER* given a FRAME_T.

If it is not already created, the required KIFACE is found and loaded and initialized if necessary, then the KIWAY_PLAYER window is created but not shown. Caller must Show() it. If it is already created, then the existing KIWAY_PLAYER* pointer is returned.

Parameters
aFrameTypeis from enum FRAME_T.
doCreatewhen true asks that the player be created if it is not already created, false means do not create and maybe return NULL.
aParentis a parent for modal KIWAY_PLAYER frames, otherwise NULL used only when doCreate = true and by KIWAY_PLAYER frames created in modal form
Returns
a valid opened KIWAY_PLAYER or NULL if there is something wrong or doCreate was false and the player has yet to be created.
Exceptions
IO_ERRORif the *.kiface file could not be found, filled with text saying what.

Definition at line 401 of file kiway.cpp.

References _, APP_MONITOR::AddNavigationBreadcrumb(), GetPlayerFrame(), PGM_BASE::HandleException(), KiFACE(), kiface(), KifaceType(), KIWAY_PLAYER_COUNT, m_ctl, m_playerFrameId, and Pgm().

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SCH_EDIT_FRAME::AskToSaveChanges(), SYMBOL_EDIT_FRAME::CanCloseSymbolFromSchematic(), PCB_EDIT_FRAME::canCloseWindow(), SCH_EDIT_FRAME::canCloseWindow(), PGE::IFACE::CreateKiWindow(), SCH::IFACE::CreateKiWindow(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), EESCHEMA_JOBS_HANDLER::EESCHEMA_JOBS_HANDLER(), InvokeSchEditSymbolLibTable(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromBoard(), KIGFX::WX_VIEW_CONTROLS::onMotion(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnUpdatePCB(), PCBNEW_JOBS_HANDLER::PCBNEW_JOBS_HANDLER(), ProcessEvent(), QueueEvent(), SYMBOL_EDIT_FRAME::saveCurrentSymbol(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SelectFootprintFromChooser(), FOOTPRINT_EDIT_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), showCalculatorPage(), BOARD_EDITOR_CONTROL::ShowEeschema(), and PCB_EDIT_FRAME::TestStandalone().

◆ PlayerClose()

bool KIWAY::PlayerClose ( FRAME_T aFrameType,
bool doForce )
virtualinherited

Call the KIWAY_PLAYER::Close( bool force ) function on the window and if not vetoed, returns true, else false.

If window actually closes, then this KIWAY marks it as not opened internally.

Returns
true if the window is closed and not vetoed, else false.

Definition at line 454 of file kiway.cpp.

References APP_MONITOR::AddNavigationBreadcrumb(), GetPlayerFrame(), KIWAY_PLAYER_COUNT, m_playerFrameId, and EDA_BASE_FRAME::NonUserClose().

Referenced by PlayersClose().

◆ PlayerDidClose()

void KIWAY::PlayerDidClose ( FRAME_T aFrameType)
inherited

Notifies a Kiway that a player has been closed.

Definition at line 493 of file kiway.cpp.

References m_playerFrameId.

Referenced by KIWAY_PLAYER::Destroy().

◆ PlayersClose()

bool KIWAY::PlayersClose ( bool doForce)
virtualinherited

Call the KIWAY_PLAYER::Close( bool force ) function on all the windows and if none are vetoed, returns true, else false.

If any window actually closes, then* this KIWAY marks it as not opened internally.

Returns
true indicates that all windows closed because none were vetoed, false means at least one cast a veto. Any that cast a veto are still open.

Definition at line 482 of file kiway.cpp.

References KIWAY_PLAYER_COUNT, and PlayerClose().

◆ Prj()

PROJECT & KIWAY::Prj ( ) const
virtualinherited

◆ ProcessApiCloseDocument()

bool KIWAY::ProcessApiCloseDocument ( KIWAY::FACE_T aFace,
const KIFACE::DOCUMENT_SPEC & aSpec,
KICAD_API_SERVER * aServer,
wxString * aError = nullptr )
inherited

Definition at line 786 of file kiway.cpp.

References KiFACE(), and kiface().

Referenced by CLI::API_SERVER_COMMAND::doPerform().

◆ ProcessApiOpenDocument()

bool KIWAY::ProcessApiOpenDocument ( KIWAY::FACE_T aFace,
const KIFACE::DOCUMENT_SPEC & aSpec,
KICAD_API_SERVER * aServer,
wxString * aError = nullptr )
inherited

Definition at line 769 of file kiway.cpp.

References KiFACE(), and kiface().

Referenced by CLI::API_SERVER_COMMAND::doPerform().

◆ ProcessEvent()

bool KIWAY::ProcessEvent ( wxEvent & aEvent)
overrideinherited

◆ ProcessJob()

int KIWAY::ProcessJob ( KIWAY::FACE_T aFace,
JOB * aJob,
REPORTER * aReporter = nullptr,
PROGRESS_REPORTER * aProgressReporter = nullptr )
inherited

Definition at line 753 of file kiway.cpp.

References KiFACE(), and kiface().

Referenced by ClassifyProjectForDowngrade(), CLI::DIFF_COMMAND< JOB_T >::doPerform(), CLI::EXPORT_BOM_COMMAND::doPerform(), CLI::FP_EXPORT_SVG_COMMAND::doPerform(), CLI::FP_UPGRADE_COMMAND::doPerform(), CLI::GERBER_CONVERT_PNG_COMMAND::doPerform(), CLI::GERBER_DIFF_COMMAND::doPerform(), CLI::GERBER_INFO_COMMAND::doPerform(), CLI::IMPORT_COMMAND::doPerform(), CLI::PCB_DOWNGRADE_COMMAND::doPerform(), CLI::PCB_DRC_COMMAND::doPerform(), CLI::PCB_EXPORT_3D_COMMAND::doPerform(), CLI::PCB_EXPORT_DRILL_COMMAND::doPerform(), CLI::PCB_EXPORT_DXF_COMMAND::doPerform(), CLI::PCB_EXPORT_GENCAD_COMMAND::doPerform(), CLI::PCB_EXPORT_GERBERS_COMMAND::doPerform(), CLI::PCB_EXPORT_IDF_COMMAND::doPerform(), CLI::PCB_EXPORT_IPC2581_COMMAND::doPerform(), CLI::PCB_EXPORT_IPCD356_COMMAND::doPerform(), CLI::PCB_EXPORT_ODB_COMMAND::doPerform(), CLI::PCB_EXPORT_PDF_COMMAND::doPerform(), CLI::PCB_EXPORT_PNG_COMMAND::doPerform(), CLI::PCB_EXPORT_POS_COMMAND::doPerform(), CLI::PCB_EXPORT_PS_COMMAND::doPerform(), CLI::PCB_EXPORT_SPECCTRA_COMMAND::doPerform(), CLI::PCB_EXPORT_STACKUP_COMMAND::doPerform(), CLI::PCB_EXPORT_STATS_COMMAND::doPerform(), CLI::PCB_EXPORT_SVG_COMMAND::doPerform(), CLI::PCB_IMPORT_COMMAND::doPerform(), CLI::PCB_RENDER_COMMAND::doPerform(), CLI::PCB_UPGRADE_COMMAND::doPerform(), CLI::SCH_DOWNGRADE_COMMAND::doPerform(), CLI::SCH_ERC_COMMAND::doPerform(), CLI::SCH_EXPORT_NETLIST_COMMAND::doPerform(), CLI::SCH_EXPORT_PLOT_COMMAND::doPerform(), CLI::SCH_EXPORT_PYTHONBOM_COMMAND::doPerform(), CLI::SCH_IMPORT_COMMAND::doPerform(), CLI::SCH_UPGRADE_COMMAND::doPerform(), CLI::SYM_EXPORT_SVG_COMMAND::doPerform(), CLI::SYM_UPGRADE_COMMAND::doPerform(), ExecuteBoardJob(), ExecuteSchematicJob(), and ExportProjectForDowngrade().

◆ ProcessJobConfigDialog()

bool KIWAY::ProcessJobConfigDialog ( KIWAY::FACE_T aFace,
JOB * aJob,
wxWindow * aWindow )
inherited

Definition at line 761 of file kiway.cpp.

References KiFACE(), and kiface().

◆ ProjectChanged()

void TEST_KIWAY::ProjectChanged ( )
inlineoverridevirtual

Calls ProjectChanged() on all KIWAY_PLAYERs.

Used after changing the project to ensure all players are updated correctly.

Reimplemented from KIWAY.

Definition at line 323 of file test_settings_manager.cpp.

References m_lockHeldWhenNotified, m_manager, and m_notified.

◆ QueueEvent()

void KIWAY::QueueEvent ( wxEvent * aEvent)
overrideinherited

Definition at line 734 of file kiway.cpp.

References KIWAY_MAIL_EVENT::Dest(), and Player().

Referenced by ExpressMail().

◆ set_kiface()

bool KIWAY::set_kiface ( FACE_T aFaceType,
KIFACE * aKiface )
inlineprivateinherited

Definition at line 531 of file kiway.h.

References KIWAY_FACE_COUNT, and m_kiface.

◆ SetBlockingDialog()

void KIWAY::SetBlockingDialog ( wxWindow * aWin)
inherited

Definition at line 699 of file kiway.cpp.

References m_blockingDialog.

Referenced by DIALOG_SHIM::~DIALOG_SHIM().

◆ SetCtlBits()

void KIWAY::SetCtlBits ( int aCtlBits)
inlineinherited

Overwrites previously set ctl bits, only for use in kicad.cpp to flip between standalone and manager mode before we actually load anything.

Definition at line 489 of file kiway.h.

References m_ctl.

◆ SetLanguage()

void KIWAY::SetLanguage ( int aLanguage)
virtualinherited

◆ SetTop()

void KIWAY::SetTop ( wxFrame * aTop)
inherited

Tell this KIWAY about the top most frame in the program and optionally allows it to play the role of one of the KIWAY_PLAYERs if launched from single_top.cpp.

Parameters
aTopis the top most wxFrame in the entire program.

Definition at line 89 of file kiway.cpp.

References m_top.

Referenced by KIWAY().

Member Data Documentation

◆ m_blockingDialog

wxWindowID KIWAY::m_blockingDialog
privateinherited

Definition at line 555 of file kiway.h.

Referenced by GetBlockingDialog(), HasBlockingDialog(), KIWAY(), and SetBlockingDialog().

◆ m_ctl

int KIWAY::m_ctl
privateinherited

◆ m_kiface

std::array< KIFACE *, KIWAY::FACE_T::KIWAY_FACE_COUNT > KIWAY::m_kiface
staticprivateinherited

Definition at line 548 of file kiway.h.

Referenced by KiFACE(), OnKiwayEnd(), and set_kiface().

◆ m_kiface_version

std::array< int, KIWAY::FACE_T::KIWAY_FACE_COUNT > KIWAY::m_kiface_version
staticprivateinherited

Definition at line 549 of file kiway.h.

Referenced by KiFACE().

◆ m_local_history

LOCAL_HISTORY* KIWAY::m_local_history
privateinherited

Definition at line 565 of file kiway.h.

Referenced by KIWAY(), LocalHistory(), and ~KIWAY().

◆ m_lockHeldWhenNotified

bool TEST_KIWAY::m_lockHeldWhenNotified = false
private

Definition at line 335 of file test_settings_manager.cpp.

Referenced by LockHeldWhenNotified(), and ProjectChanged().

◆ m_manager

SETTINGS_MANAGER& TEST_KIWAY::m_manager
private

Definition at line 333 of file test_settings_manager.cpp.

Referenced by ProjectChanged(), and TEST_KIWAY().

◆ m_notified

bool TEST_KIWAY::m_notified = false
private

Definition at line 334 of file test_settings_manager.cpp.

Referenced by Notified(), and ProjectChanged().

◆ m_playerFrameId

std::atomic<wxWindowID> KIWAY::m_playerFrameId[KIWAY_PLAYER_COUNT]
privateinherited

Definition at line 563 of file kiway.h.

Referenced by GetPlayerFrame(), KIWAY(), Player(), PlayerClose(), and PlayerDidClose().

◆ m_top

wxFrame* KIWAY::m_top
privateinherited

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