if(serialised.size() > 0x1000 ) {
throw ::std::length_error("CIPCChannel_AcessIPCPipe::Send");
}
- _SysDebug("Send %i bytes", serialised.size());
- _SysWrite(m_fd, serialised.data(), serialised.size());
+ _SysDebug("CIPCChannel_AcessIPCPipe::Send(%i bytes)", serialised.size());
+ size_t rv = _SysWrite(m_fd, serialised.data(), serialised.size());
+ if( rv != serialised.size() ) {
+ throw ::std::system_error(errno, ::std::system_category());
+ }
}
#include <axwin4/axwin.h>
#include "include/common.hpp"
#include <ipc_proto.hpp>
+#include <algorithm> // min
namespace AxWin {
if( W > 128 )
{
const uint32_t* data32 = static_cast<uint32_t*>(Data);
- for( unsigned int row = 0; row < H; row ++ )
+ const unsigned int rows_per_message = 2048 / W;
+ for( unsigned int row = 0; row < H; row += rows_per_message )
{
CSerialiser message;
message.WriteU8(IPCMSG_PUSHDATA);
message.WriteU16(X);
message.WriteU16(Y+row);
message.WriteU16(W);
- message.WriteU16(1);
+ message.WriteU16( ::std::min(rows_per_message,H-row) );
message.WriteBuffer(W*4, data32);
::AxWin::SendMessage(message);
- data32 += W;
+ data32 += W*rows_per_message;
}
}
else
extern "C" tAxWin4_Window *AxWin4_CreateWindow(const char *Name)
{
// Allocate a window ID
+
// Create window structure locally
+ tAxWin4_Window *ret = new tAxWin4_Window();
+ ret->m_id = 0;
// Request creation of window
CSerialiser message;
message.WriteU8(IPCMSG_CREATEWIN);
- message.WriteU16(0);
+ message.WriteU16(ret->m_id);
message.WriteString(Name);
::AxWin::SendMessage(message);
+ return ret;
}
extern "C" void AxWin4_ShowWindow(tAxWin4_Window *Window)
CSerialiser message;
message.WriteU8(IPCMSG_SETWINATTR);
message.WriteU16(Window->m_id);
- message.WriteU16(IPC_WINATTR_POSITION);
+ message.WriteU16(IPC_WINATTR_DIMENSIONS);
message.WriteU16(W);
message.WriteU16(H);
::AxWin::SendMessage(message);