33#include <wx/evtloop.h>
39static const wxString
HOSTNAME( wxT(
"localhost" ) );
42#define IPC_BUF_SIZE 4096
51 const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
52 long aStyle, const wxString& aFrameName,
54 EDA_BASE_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName, aKiway,
86 socket->Notify(
false );
103 wxASSERT_MSG(
IsModal(), wxT(
"ShowModal() shouldn't be called on non-modal frame" ) );
127 wxWindow* parent = GetParent();
129 while( parent && !parent->IsTopLevel() )
130 parent = parent->GetParent();
134 wxGUIEventLoop event_loop;
142 if( aResultantFocusWindow )
144 aResultantFocusWindow->Raise();
149 aResultantFocusWindow->SetFocus();
160 return EDA_BASE_FRAME::Destroy();
197 addr.Service( service );
221 wxSocketBase* sock = evt.GetSocket();
223 switch( evt.GetSocketEvent() )
228 if( sock->LastCount() == 0 )
232 len = 1 + sock->LastCount();
242 wxLogError( wxT(
"EDA_DRAW_FRAME::OnSockRequest() error: Invalid event !" ) );
250 wxSocketBase* socket;
251 wxSocketServer* server = (wxSocketServer*) evt.GetSocket();
253 socket = server->Accept();
255 if( socket ==
nullptr )
260 socket->Notify(
true );
262 socket->SetNotify( wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG );
The base frame for deriving all KiCad main window classes.
FRAME_T GetFrameType() const
EDA_BASE_FRAME(wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName, KIWAY *aKiway, const EDA_IU_SCALE &aIuScale)
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
virtual bool ShowModal(wxString *aResult=nullptr, wxWindow *aResultantFocusWindow=nullptr)
Show this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until t...
virtual void ExecuteRemoteCommand(const char *cmdline)
Execute a remote command sent via socket (to port KICAD_PCB_PORT_SERVICE_NUMBER, currently 4242).
void CreateServer(int service, bool local=true)
virtual void KiwayMailIn(KIWAY_MAIL_EVENT &aEvent)
Receive #KIWAY_ROUTED_EVENT messages from other players.
wxWindow * m_modal_resultant_parent
KIWAY_PLAYER(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName, const EDA_IU_SCALE &aIuScale)
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
wxGUIEventLoop * m_modal_loop
Points to nested event_loop. NULL means not modal and dismissed.
std::vector< wxSocketBase * > m_sockets
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
void OnSockRequestServer(wxSocketEvent &evt)
void OnSockRequest(wxSocketEvent &evt)
bool IsModal() const override
Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame...
void kiway_express(KIWAY_MAIL_EVENT &aEvent)
Event handler, routes to derivative specific virtual KiwayMailIn().
wxSocketServer * m_socketServer
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
void PlayerDidClose(FRAME_T aFrameType)
Notifies a Kiway that a player has been closed.
Temporarily disable a window, and then re-enable on destruction.
static const wxString HOSTNAME(wxT("localhost"))
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
@ ID_EDA_SOCKET_EVENT_SERV
#define EVT_KIWAY_EXPRESS(func)
Event table definition for the KIWAY_ROUTED_EVENT event class.
static char client_ipc_buffer[IPC_BUF_SIZE]
static const wxString HOSTNAME(wxT("localhost"))
This file contains miscellaneous commonly used macros and functions.