Updated constructor to use newer replay API
Tweaked messaging so that things should work properly now git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4735 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+24
-25
@@ -34,6 +34,7 @@
|
|||||||
// System Includes -------------------------------------------------------------
|
// System Includes -------------------------------------------------------------
|
||||||
#include <Cursor.h>
|
#include <Cursor.h>
|
||||||
#include <PortLink.h>
|
#include <PortLink.h>
|
||||||
|
#include <PortMessage.h>
|
||||||
#include <AppServerLink.h>
|
#include <AppServerLink.h>
|
||||||
|
|
||||||
// Project Includes ------------------------------------------------------------
|
// Project Includes ------------------------------------------------------------
|
||||||
@@ -49,31 +50,24 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
BCursor::BCursor(const void *cursorData)
|
BCursor::BCursor(const void *cursorData)
|
||||||
{
|
{
|
||||||
int8 *data = (int8 *)cursorData;
|
int8 *data = (int8 *)cursorData;
|
||||||
m_serverToken = 0;
|
m_serverToken = 0;
|
||||||
|
|
||||||
if ( data[0] != 16 )
|
if ( data[0] != 16 )
|
||||||
return;
|
return;
|
||||||
if ( data[1] != 1 )
|
if ( data[1] != 1 )
|
||||||
return;
|
return;
|
||||||
if ( (data[2] >= 16) || (data[3] >= 16) )
|
if ( (data[2] >= 16) || (data[3] >= 16) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ssize_t buffersize;
|
// Send data directly to server
|
||||||
status_t status;
|
BPrivate::BAppServerLink serverlink;
|
||||||
int32 returncode;
|
PortMessage pmsg;
|
||||||
int8 *buffer;
|
|
||||||
|
serverlink.SetOpCode(AS_CREATE_BCURSOR);
|
||||||
// Send data directly to server
|
serverlink.Attach((void *)cursorData,68);
|
||||||
BPrivate::BAppServerLink *serverlink = new BPrivate::BAppServerLink;
|
serverlink.FlushWithReply(&pmsg);
|
||||||
serverlink->SetOpCode(AS_SET_CURSOR_BCURSOR);
|
pmsg.Read(&m_serverToken);
|
||||||
serverlink->Attach((void *)cursorData,68);
|
|
||||||
|
|
||||||
//Rumor has it that this API will be cleaned up later
|
|
||||||
buffer=serverlink->FlushWithReply(&returncode,&status,&buffersize);
|
|
||||||
m_serverToken=*((int32*)buffer);
|
|
||||||
|
|
||||||
delete serverlink;
|
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// undefined on BeOS
|
// undefined on BeOS
|
||||||
@@ -84,6 +78,11 @@ BCursor::BCursor(BMessage *data)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
BCursor::~BCursor()
|
BCursor::~BCursor()
|
||||||
{
|
{
|
||||||
|
// Notify server to deallocate server-side objects for this cursor
|
||||||
|
BPrivate::BAppServerLink serverlink;
|
||||||
|
serverlink.SetOpCode(AS_DELETE_BCURSOR);
|
||||||
|
serverlink.Attach(m_serverToken);
|
||||||
|
serverlink.Flush();
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// not implemented on BeOS
|
// not implemented on BeOS
|
||||||
|
|||||||
Reference in New Issue
Block a user