Pahtz's changes from PortLink/BSession/PortMessage/PortQueue to BPortLink
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8519 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include <Errors.h>
|
||||
#include <List.h>
|
||||
#include <AppServerLink.h>
|
||||
#include <PortMessage.h>
|
||||
#include <ServerProtocol.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
@@ -83,15 +82,14 @@ BPicture::BPicture(const BPicture &picture)
|
||||
|
||||
if (picture.token != -1)
|
||||
{
|
||||
|
||||
BPrivate::BAppServerLink link;
|
||||
PortMessage msg;
|
||||
int32 code=SERVER_FALSE;
|
||||
|
||||
link.Attach<int32>(AS_CLONE_PICTURE);
|
||||
link.StartMessage(AS_CLONE_PICTURE);
|
||||
link.Attach<int32>(picture.token);
|
||||
link.FlushWithReply(&msg);
|
||||
msg.Read<int32>(&token);
|
||||
|
||||
link.FlushWithReply(&code);
|
||||
if(code==SERVER_TRUE)
|
||||
link.Read<int32>(&token);
|
||||
}
|
||||
if (picture.extent->fNewData != NULL)
|
||||
{
|
||||
@@ -160,10 +158,10 @@ BPicture::BPicture(BMessage *archive)
|
||||
if (extent->fNewSize != 0 && extent->fNewData != 0)
|
||||
{
|
||||
BPrivate::BAppServerLink link;
|
||||
PortMessage msg;
|
||||
int32 code=SERVER_FALSE;
|
||||
BPicture *pic;
|
||||
|
||||
link.Attach<int32>(AS_CREATE_PICTURE);
|
||||
link.StartMessage(AS_CREATE_PICTURE);
|
||||
link.Attach<int32>(extent->fPictures.CountItems());
|
||||
for (int32 i = 0; i < extent->fPictures.CountItems(); i++)
|
||||
{
|
||||
@@ -173,8 +171,9 @@ BPicture::BPicture(BMessage *archive)
|
||||
}
|
||||
link.Attach<int32>(extent->fNewSize);
|
||||
link.Attach(extent->fNewData,extent->fNewSize);
|
||||
link.FlushWithReply(&msg);
|
||||
msg.Read<int32>(&token);
|
||||
link.FlushWithReply(&code);
|
||||
if(code==SERVER_TRUE)
|
||||
link.Read<int32>(&token);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +204,7 @@ BPicture::~BPicture()
|
||||
{
|
||||
BPrivate::BAppServerLink link;
|
||||
|
||||
link.Attach<int32>(AS_DELETE_PICTURE);
|
||||
link.StartMessage(AS_DELETE_PICTURE);
|
||||
link.Attach<int32>(token);
|
||||
link.Flush();
|
||||
}
|
||||
@@ -341,10 +340,10 @@ status_t BPicture::Unflatten(BDataIO *stream)
|
||||
// swap_data(extent->fNewData, extent->fNewSize);
|
||||
|
||||
BPrivate::BAppServerLink link;
|
||||
PortMessage msg;
|
||||
int32 code=SERVER_FALSE;
|
||||
BPicture *pic;
|
||||
|
||||
link.Attach<int32>(AS_CREATE_PICTURE);
|
||||
link.StartMessage(AS_CREATE_PICTURE);
|
||||
link.Attach<int32>(extent->fPictures.CountItems());
|
||||
for (int32 i = 0; i < extent->fPictures.CountItems(); i++)
|
||||
{
|
||||
@@ -354,8 +353,9 @@ status_t BPicture::Unflatten(BDataIO *stream)
|
||||
}
|
||||
link.Attach<int32>(extent->fNewSize);
|
||||
link.Attach(extent->fNewData, extent->fNewSize);
|
||||
link.FlushWithReply(&msg);
|
||||
msg.Read<int32>(&token);
|
||||
link.FlushWithReply(&code);
|
||||
if(code==SERVER_TRUE)
|
||||
link.Read<int32>(&token);
|
||||
|
||||
if (extent->fNewData)
|
||||
{
|
||||
@@ -395,9 +395,9 @@ void BPicture::import_data(const void *data, int32 size, BPicture **subs,
|
||||
return;
|
||||
|
||||
BPrivate::BAppServerLink link;
|
||||
PortMessage msg;
|
||||
int32 code=SERVER_FALSE;
|
||||
|
||||
link.Attach<int32>(AS_CREATE_PICTURE);
|
||||
link.StartMessage(AS_CREATE_PICTURE);
|
||||
link.Attach<int32>(subCount);
|
||||
|
||||
for (int32 i = 0; i < subCount; i++)
|
||||
@@ -405,8 +405,9 @@ void BPicture::import_data(const void *data, int32 size, BPicture **subs,
|
||||
|
||||
link.Attach<int32>(size);
|
||||
link.Attach(data, size);
|
||||
link.FlushWithReply(&msg);
|
||||
msg.Read<int32>(&token);
|
||||
link.FlushWithReply(&code);
|
||||
if(code==SERVER_TRUE)
|
||||
link.Read<int32>(&token);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
void BPicture::import_old_data(const void *data, int32 size)
|
||||
@@ -421,12 +422,13 @@ void BPicture::import_old_data(const void *data, int32 size)
|
||||
convert_old_to_new(data, size, &extent->fNewData, &extent->fNewSize);
|
||||
|
||||
BPrivate::BAppServerLink link;
|
||||
link.Attach<int32>(AS_CREATE_PICTURE);
|
||||
link.StartMessage(AS_CREATE_PICTURE);
|
||||
link.Attach<int32>(0L);
|
||||
link.Attach<int32>(extent->fNewSize);
|
||||
link.Attach(extent->fNewData,extent->fNewSize);
|
||||
link.FlushWithReply(&msg);
|
||||
msg.Read<int32>(&token)
|
||||
link.FlushWithReply(&code);
|
||||
if(code==SERVER_TRUE)
|
||||
link.Read<int32>(&token)
|
||||
|
||||
// Do we free all data now?
|
||||
free(extent->fNewData);
|
||||
@@ -453,9 +455,9 @@ bool BPicture::assert_local_copy()
|
||||
/* BPrivate::BAppServerLink link;
|
||||
int32 count;
|
||||
|
||||
link.Attach<int32>(AS_DOWNLOAD_PICTURE);
|
||||
link.StartMessage(AS_DOWNLOAD_PICTURE);
|
||||
link.Attach<int32>(token);
|
||||
link.FlushWithReply(&msg);
|
||||
link.FlushWithReply(&code);
|
||||
count=*((int32*)replydata.buffer);
|
||||
|
||||
// Read sub picture tokens
|
||||
@@ -501,14 +503,15 @@ bool BPicture::assert_server_copy()
|
||||
extent->fPictures.ItemAt(i)->assert_server_copy();
|
||||
|
||||
BPrivate::BAppServerLink link;
|
||||
link.Attach<int32>(AS_CREATE_PICTURE);
|
||||
link.StartMessage(AS_CREATE_PICTURE);
|
||||
link.Attach<int32>(extent->fPictures.CountItems());
|
||||
for (int32 i = 0; i < extent->fPictures.CountItems(); i++)
|
||||
link.Attach<int32>(extent->fPictures.ItemAt(i)->token);
|
||||
link.Attach<int32>(extent->fNewSize);
|
||||
link.Attach(extent->fNewData,extent->fNewSize);
|
||||
link.FlushWithReply(&msg);
|
||||
msg.Read<int32>(&token);
|
||||
link.FlushWithReply(&code);
|
||||
if(code==SERVER_TRUE)
|
||||
link.Read<int32>(&token);
|
||||
|
||||
return token != -1;*/
|
||||
return true;
|
||||
@@ -548,7 +551,7 @@ void BPicture::usurp(BPicture *lameDuck)
|
||||
{
|
||||
BPrivate::BAppServerLink link;
|
||||
|
||||
link.Attach<int32>(AS_DELETE_PICTURE);
|
||||
link.StartMessage(AS_DELETE_PICTURE);
|
||||
link.Attach<int32>(token);
|
||||
link.Flush();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user