Also upload/download subpictures
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21926 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -694,9 +694,17 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
STRACE(("ServerApp %s: Create Picture\n", Signature()));
|
STRACE(("ServerApp %s: Create Picture\n", Signature()));
|
||||||
status_t status = B_ERROR;
|
status_t status = B_ERROR;
|
||||||
ServerPicture *picture = CreatePicture();
|
ServerPicture *picture = CreatePicture();
|
||||||
if (picture != NULL)
|
if (picture != NULL) {
|
||||||
|
int32 subPicturesCount = 0;
|
||||||
|
link.Read<int32>(&subPicturesCount);
|
||||||
|
for (int32 c = 0; c < subPicturesCount; c++) {
|
||||||
|
int32 token = -1;
|
||||||
|
link.Read<int32>(&token);
|
||||||
|
if (ServerPicture *subPicture = FindPicture(token))
|
||||||
|
picture->NestPicture(subPicture);
|
||||||
|
}
|
||||||
status = picture->ImportData(link);
|
status = picture->ImportData(link);
|
||||||
|
}
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
fLink.StartMessage(B_OK);
|
fLink.StartMessage(B_OK);
|
||||||
fLink.Attach<int32>(picture->Token());
|
fLink.Attach<int32>(picture->Token());
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ nop()
|
|||||||
static void
|
static void
|
||||||
move_pen_by(ViewLayer *view, BPoint delta)
|
move_pen_by(ViewLayer *view, BPoint delta)
|
||||||
{
|
{
|
||||||
// view->CurrentState()->SetPenLocation(delta - view->CurrentState()->PenLocation()); ?!?
|
|
||||||
view->CurrentState()->SetPenLocation(view->CurrentState()->PenLocation() + delta);
|
view->CurrentState()->SetPenLocation(view->CurrentState()->PenLocation() + delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,13 +875,7 @@ ServerPicture::DataLength() const
|
|||||||
|
|
||||||
status_t
|
status_t
|
||||||
ServerPicture::ImportData(BPrivate::LinkReceiver &link)
|
ServerPicture::ImportData(BPrivate::LinkReceiver &link)
|
||||||
{
|
{
|
||||||
int32 subPicturesCount = 0;
|
|
||||||
link.Read<int32>(&subPicturesCount);
|
|
||||||
for (int32 c = 0; c < subPicturesCount; c++) {
|
|
||||||
// TODO: Support nested pictures
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 size = 0;
|
int32 size = 0;
|
||||||
link.Read<int32>(&size);
|
link.Read<int32>(&size);
|
||||||
|
|
||||||
@@ -919,7 +912,15 @@ ServerPicture::ExportData(BPrivate::PortLink &link)
|
|||||||
fData->Seek(0, SEEK_SET);
|
fData->Seek(0, SEEK_SET);
|
||||||
|
|
||||||
int32 subPicturesCount = 0;
|
int32 subPicturesCount = 0;
|
||||||
|
if (fPictures != NULL)
|
||||||
|
subPicturesCount = fPictures->CountItems();
|
||||||
link.Attach<int32>(subPicturesCount);
|
link.Attach<int32>(subPicturesCount);
|
||||||
|
if (subPicturesCount > 0) {
|
||||||
|
for (int32 i = 0; i < subPicturesCount; i++) {
|
||||||
|
ServerPicture *subPic = static_cast<ServerPicture *>(fPictures->ItemAtFast(i));
|
||||||
|
link.Attach<int32>(subPic->Token());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
off_t size = 0;
|
off_t size = 0;
|
||||||
fData->GetSize(&size);
|
fData->GetSize(&size);
|
||||||
|
|||||||
@@ -2711,7 +2711,7 @@ ServerWindow::_DispatchPictureMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
link.Read<int32>(&pictureToken);
|
link.Read<int32>(&pictureToken);
|
||||||
ServerPicture *appendPicture = App()->FindPicture(pictureToken);
|
ServerPicture *appendPicture = App()->FindPicture(pictureToken);
|
||||||
if (appendPicture) {
|
if (appendPicture) {
|
||||||
picture->SyncState(fCurrentLayer);
|
//picture->SyncState(fCurrentLayer);
|
||||||
appendPicture->Usurp(picture);
|
appendPicture->Usurp(picture);
|
||||||
}
|
}
|
||||||
fCurrentLayer->SetPicture(appendPicture);
|
fCurrentLayer->SetPicture(appendPicture);
|
||||||
|
|||||||
Reference in New Issue
Block a user