3 * - By John Hodge (thePowersGang)
9 #include <IIPCChannel.hpp>
11 #include <draw_text.hpp> // for the fonts
15 CClient::CClient(::AxWin::IIPCChannel& channel):
24 ::AxWin::IPC::DeregisterClient(*this);
27 CWindow* CClient::GetWindow(int ID)
30 return m_windows.at(ID);
32 catch(const std::exception& e) {
37 void CClient::SetWindow(int ID, CWindow* window)
39 //_SysDebug("SetWindow(ID=%i,window=%p)", ID, window);
40 auto it = m_windows.find(ID);
41 if( it != m_windows.end() ) {
42 _SysDebug("CLIENT BUG: Window ID %i is already used by %p", ID, it->second);
45 m_windows[ID] = window;
49 IFontFace& CClient::GetFont(unsigned int id)
51 static CFontFallback fallback_font;
53 _SysDebug("GetFont: %i = %p", id, &fallback_font);
56 assert(!"TODO: CClient::GetFont id != 0");
59 void CClient::HandleMessage(CDeserialiser& message)
62 IPC::HandleMessage(*this, message);
63 if( !message.IsConsumed() )
65 _SysDebug("NOTICE - CClient::HandleMessage - Trailing data in message");
68 catch( const ::std::exception& e )
70 _SysDebug("ERROR - Exception while processing message from client: %s", e.what());
74 _SysDebug("ERROR - Unknown exception while processing message from client");