X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fipc.cpp;h=5f59ae193c841fe1640ffb014c5910dbe787c57d;hb=6fbf6b93bec9b8b5bd6d7c683eefb0ebed8dff77;hp=c50728531382c522ea6cf33e099f078c87981f66;hpb=8b16265b4394af76f64c30393e27d08c294c4bac;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/ipc.cpp b/Usermode/Applications/axwin4_src/Server/ipc.cpp index c5072853..5f59ae19 100644 --- a/Usermode/Applications/axwin4_src/Server/ipc.cpp +++ b/Usermode/Applications/axwin4_src/Server/ipc.cpp @@ -65,6 +65,7 @@ void HandleSelect(const fd_set& rfds) void RegisterClient(CClient& client) { + _SysDebug("RegisterClient(&client=%p)", &client); // allocate a client ID, and save for( int i = 0; i < 100; i ++ ) { @@ -84,7 +85,14 @@ void RegisterClient(CClient& client) CClient* GetClientByID(uint16_t id) { auto it = glClients.find(id); - return (it == glClients.end() ? nullptr : it->second); + if(it == glClients.end()) { + //_SysDebug("Client %i not registered", id); + return nullptr; + } + else { + //_SysDebug("Client %i %i = %p", id, it->first, it->second); + return it->second; + } } void DeregisterClient(CClient& client) @@ -93,9 +101,36 @@ void DeregisterClient(CClient& client) } -void SendMessage_NotifyDims(CClient& client, unsigned int NewW, unsigned int NewH) +void SendMessage_NotifyDims(CClient& client, unsigned int WinID, unsigned int NewW, unsigned int NewH) +{ + _SysDebug("TODO: IPC::SendMessage_NotifyDims"); +} +void SendMessage_MouseButton(CClient& client, unsigned int WinID, unsigned int X, unsigned int Y, uint8_t Button, bool Pressed) +{ + CSerialiser msg; + msg.WriteU8(IPCMSG_INPUTEVENT); + msg.WriteU8(IPC_INEV_MOUSEBTN); + msg.WriteU16(WinID); + msg.WriteU16(X); + msg.WriteU16(Y); + msg.WriteU8(Button); + msg.WriteU8(Pressed ? 0 : 1); + client.SendMessage(msg); +} +void SendMessage_MouseMove(CClient& client, unsigned int WinID, unsigned int X, unsigned int Y) +{ + _SysDebug("TODO: IPC::SendMessage_MouseButton"); +} +void SendMessage_KeyEvent(CClient& client, unsigned int WinID, uint32_t KeySym, bool Pressed, const char *Translated) { - _SysDebug("TODO: CClient::SendNotify_Dims"); + CSerialiser msg; + msg.WriteU8(IPCMSG_INPUTEVENT); + msg.WriteU8(IPC_INEV_KEYBOARD); + msg.WriteU16(WinID); + msg.WriteU16(KeySym); + msg.WriteU8(Pressed ? 0 : 1); + msg.WriteString(Translated); + client.SendMessage(msg); }