Simplified code for BView::ClipToPicture() a lot (both server side and client side). Regions passed with that method should take the place of regions passed with BView::ConstrainClippingRegion(). Note that the needed server support hasn't yet been implemented.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12939 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-06-03 14:20:10 +00:00
parent b9b38bc7b2
commit 45ca1c948c
5 changed files with 65 additions and 155 deletions
+27 -30
View File
@@ -1948,21 +1948,7 @@ BView::TruncateString(BString *in_out, uint32 mode, float width) const
void
BView::ClipToPicture(BPicture *picture, BPoint where, bool sync)
{
if (!picture)
return;
if (do_owner_check()) {
owner->fLink->StartMessage(AS_LAYER_CLIP_TO_PICTURE);
owner->fLink->Attach<int32>(picture->token);
owner->fLink->Attach<BPoint>(where);
if (sync)
owner->fLink->Flush();
fState->flags |= B_VIEW_CLIP_REGION_BIT;
}
fState->archivingFlags |= B_VIEW_CLIP_REGION_BIT;
DoPictureClip(picture, where, false, sync);
}
@@ -1970,21 +1956,7 @@ void
BView::ClipToInversePicture(BPicture *picture,
BPoint where, bool sync)
{
if (!picture)
return;
if (do_owner_check()) {
owner->fLink->StartMessage(AS_LAYER_CLIP_TO_INVERSE_PICTURE);
owner->fLink->Attach<int32>(picture->token);
owner->fLink->Attach<BPoint>(where);
if (sync)
owner->fLink->Flush();
fState->flags |= B_VIEW_CLIP_REGION_BIT;
}
fState->archivingFlags |= B_VIEW_CLIP_REGION_BIT;
DoPictureClip(picture, where, true, sync);
}
//---------------------------------------------------------------------------
@@ -3687,6 +3659,31 @@ BView::setOwner(BWindow *theOwner)
}
void
BView::DoPictureClip(BPicture *picture, BPoint where,
bool invert, bool sync)
{
if (!picture)
return;
if (do_owner_check()) {
owner->fLink->StartMessage(AS_LAYER_CLIP_TO_PICTURE);
owner->fLink->Attach<int32>(picture->token);
owner->fLink->Attach<BPoint>(where);
owner->fLink->Attach<bool>(invert);
// TODO: I think that "sync" means another thing here:
// the bebook, at least, says so.
if (sync)
owner->fLink->Flush();
fState->flags |= B_VIEW_CLIP_REGION_BIT;
}
fState->archivingFlags |= B_VIEW_CLIP_REGION_BIT;
}
bool
BView::removeSelf()
{