5 * Created by Toshi Nagata on 12/10/10.
6 * Copyright 2012 Toshi Nagata. All rights reserved.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation version 2 of the License.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
18 // For compilers that support precompilation, includes "wx/wx.h".
19 #include "wx/wxprec.h"
26 #if defined(__WXMSW__)
28 #include "MyIPCSupport.h"
31 wxString *gIPCServiceName = NULL;
34 MyClientConnection::OnDisconnect()
36 wxGetApp().m_client->Disconnect();
41 m_clientConnection = NULL;
50 MyClient::Disconnect()
52 if (m_clientConnection != NULL) {
53 m_clientConnection->Disconnect();
54 m_clientConnection = NULL;
59 MyClient::OnMakeConnection()
61 if (m_clientConnection == NULL)
62 m_clientConnection = new MyClientConnection;
63 return m_clientConnection;
67 MyServerConnection::OnDisconnect()
69 wxGetApp().m_server->Disconnect();
73 MyServerConnection::OnExecute(const wxString& topic, wxChar* data, int size, wxIPCFormat format)
75 if (topic == MOLBY_IPC_TOPIC) {
77 wxGetApp().RequestOpenFilesByIPC(files);
84 m_serverConnection = NULL;
93 MyServer::Disconnect()
95 if (m_serverConnection != NULL) {
96 m_serverConnection->Disconnect();
97 m_serverConnection = NULL;
102 MyServer::OnAcceptConnection(const wxString &topic)
104 if (topic == MOLBY_IPC_TOPIC) {
105 if (m_serverConnection == NULL)
106 m_serverConnection = new MyServerConnection();
107 return m_serverConnection;
112 #endif // defined(__WXMSW__)