X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2FCClient.cpp;h=2abcb9b5ed2714e4ca3e3b9b2bb839dfea684a3c;hb=845b6f9d90bb87b5e760e4d49aa93b0e003ab750;hp=f61ca31a730b0ee043469857ca7efabbe30c0300;hpb=8ae0b1147e613573a45fcd8e6f2f6af2aeff54ac;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/CClient.cpp b/Usermode/Applications/axwin4_src/Server/CClient.cpp index f61ca31a..2abcb9b5 100644 --- a/Usermode/Applications/axwin4_src/Server/CClient.cpp +++ b/Usermode/Applications/axwin4_src/Server/CClient.cpp @@ -8,11 +8,13 @@ #include #include #include +#include // for the fonts namespace AxWin { CClient::CClient(::AxWin::IIPCChannel& channel): - m_channel(channel) + m_channel(channel), + m_id(0) { } @@ -24,18 +26,34 @@ CClient::~CClient() CWindow* CClient::GetWindow(int ID) { - if( ID == 0 ) - return 0; - - return m_windows[ID]; + try { + return m_windows.at(ID); + } + catch(const std::exception& e) { + return NULL; + } } void CClient::SetWindow(int ID, CWindow* window) { - if( m_windows[ID] ) { - delete m_windows[ID]; + //_SysDebug("SetWindow(ID=%i,window=%p)", ID, window); + auto it = m_windows.find(ID); + if( it != m_windows.end() ) { + _SysDebug("CLIENT BUG: Window ID %i is already used by %p", ID, it->second); + } + else { + m_windows[ID] = window; + } +} + +IFontFace& CClient::GetFont(unsigned int id) +{ + static CFontFallback fallback_font; + if( id == 0 ) { + _SysDebug("GetFont: %i = %p", id, &fallback_font); + return fallback_font; } - m_windows[ID] = window; + assert(!"TODO: CClient::GetFont id != 0"); } void CClient::HandleMessage(CDeserialiser& message)