* Style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31579 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-07-15 08:04:50 +00:00
parent ca38af4c2b
commit 68504ee9f2
+37 -30
View File
@@ -9,6 +9,7 @@
* Ingo Weinhold <[email protected]>
*/
#include <View.h>
#include <new>
@@ -345,7 +346,8 @@ struct BView::LayoutData {
BView::BView(const char* name, uint32 flags, BLayout* layout)
: BHandler(name)
:
BHandler(name)
{
_InitData(BRect(0, 0, 0, 0), name, B_FOLLOW_NONE,
flags | B_SUPPORTS_LAYOUT);
@@ -354,14 +356,16 @@ BView::BView(const char* name, uint32 flags, BLayout* layout)
BView::BView(BRect frame, const char* name, uint32 resizingMode, uint32 flags)
: BHandler(name)
:
BHandler(name)
{
_InitData(frame, name, resizingMode, flags);
}
BView::BView(BMessage* archive)
: BHandler(archive)
:
BHandler(archive)
{
BRect frame;
archive->FindRect("_frame", &frame);
@@ -2296,9 +2300,9 @@ BView::GetStringWidths(char *stringArray[],int32 lengthArray[],
void
BView::TruncateString(BString *in_out, uint32 mode, float width) const
BView::TruncateString(BString* string, uint32 mode, float width) const
{
fState->font.TruncateString(in_out, mode, width);
fState->font.TruncateString(string, mode, width);
}
@@ -2310,8 +2314,7 @@ BView::ClipToPicture(BPicture *picture, BPoint where, bool sync)
void
BView::ClipToInversePicture(BPicture *picture,
BPoint where, bool sync)
BView::ClipToInversePicture(BPicture* picture, BPoint where, bool sync)
{
_ClipToPicture(picture, where, true, sync);
}
@@ -2868,8 +2871,8 @@ BView::FillPolygon(const BPolygon *polygon, const BGradient& gradient)
_CheckLockAndSwitchCurrent();
if (fOwner->fLink->StartMessage(AS_FILL_POLYGON_GRADIENT,
polygon->fCount * sizeof(BPoint)
+ sizeof(BRect) + sizeof(int32)) == B_OK) {
polygon->fCount * sizeof(BPoint) + sizeof(BRect) + sizeof(int32))
== B_OK) {
fOwner->fLink->Attach<BRect>(polygon->Frame());
fOwner->fLink->Attach<int32>(polygon->fCount);
fOwner->fLink->Attach(polygon->fPoints,
@@ -3754,10 +3757,10 @@ BView::InvertRect(BRect rect)
void
BView::AddChild(BView* child, BView* before)
{
STRACE(("BView(%s)::AddChild(child='%s' before='%s')\n",
this->Name() ? this->Name(): "NULL",
child && child->Name() ? child->Name(): "NULL",
before && before->Name() ? before->Name(): "NULL"));
STRACE(("BView(%s)::AddChild(child '%s', before '%s')\n",
this->Name(),
child != NULL && child->Name() ? child->Name() : "NULL",
before != NULL && before->Name() ? before->Name() : "NULL"));
if (!_AddChild(child, before))
return;
@@ -3889,7 +3892,7 @@ BView::RemoveSelf()
bool
BView::_RemoveSelf()
{
STRACE(("BView(%s)::RemoveSelf()...\n", Name()));
STRACE(("BView(%s)::RemoveSelf()\n", Name()));
// Remove this child from its parent
@@ -4081,7 +4084,8 @@ BView::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
{
if (!fFirstChild) {
err = B_NAME_NOT_FOUND;
replyMsg.AddString("message", "This window doesn't have children.");
replyMsg.AddString("message", "This window doesn't have "
"children.");
break;
}
BView* child = NULL;
@@ -4602,7 +4606,8 @@ BView::_Layout(bool force, BLayoutContext* context)
{
//printf("%p->BView::_Layout(%d, %p)\n", this, force, context);
//printf(" fNeedsRelayout: %d, fLayoutValid: %d, fLayoutInProgress: %d\n",
//fLayoutData->fNeedsRelayout, fLayoutData->fLayoutValid, fLayoutData->fLayoutInProgress);
//fLayoutData->fNeedsRelayout, fLayoutData->fLayoutValid,
//fLayoutData->fLayoutInProgress);
if (fLayoutData->fNeedsRelayout || !fLayoutData->fLayoutValid || force) {
fLayoutData->fLayoutValid = false;
@@ -4750,16 +4755,15 @@ BView::_SetOwner(BWindow *newOwner)
void
BView::_ClipToPicture(BPicture *picture, BPoint where,
bool invert, bool sync)
BView::_ClipToPicture(BPicture* picture, BPoint where, bool invert, bool sync)
{
if (!picture)
return;
#if 1
// TODO: Move the implementation to the server!!!
// This implementation is pretty slow, since just creating an offscreen bitmap
// takes a lot of time. That's the main reason why it should be moved
// This implementation is pretty slow, since just creating an offscreen
// bitmap takes a lot of time. That's the main reason why it should be moved
// to the server.
// Here the idea is to get rid of the padding bytes in the bitmap,
@@ -4767,8 +4771,10 @@ BView::_ClipToPicture(BPicture *picture, BPoint where,
// TODO: Maybe it's not so nice as it assumes BBitmaps to be aligned
// to a 4 byte boundary.
BRect bounds(Bounds());
if ((bounds.IntegerWidth() + 1) % 32)
bounds.right = bounds.left + ((bounds.IntegerWidth() + 1) / 32 + 1) * 32 - 1;
if ((bounds.IntegerWidth() + 1) % 32) {
bounds.right = bounds.left + ((bounds.IntegerWidth() + 1) / 32 + 1)
* 32 - 1;
}
// TODO: I used a RGBA32 bitmap because drawing on a GRAY8 doesn't work.
BBitmap* bitmap = new(std::nothrow) BBitmap(bounds, B_RGBA32, true);
@@ -5200,10 +5206,11 @@ BView::_DrawAfterChildren(BRect updateRect)
void
BView::_Pulse()
{
if (Flags() & B_PULSE_NEEDED)
if ((Flags() & B_PULSE_NEEDED) != 0)
Pulse();
for (BView *child = fFirstChild; child != NULL; child = child->fNextSibling) {
for (BView* child = fFirstChild; child != NULL;
child = child->fNextSibling) {
child->_Pulse();
}
}
@@ -5231,7 +5238,8 @@ BView::_UpdateStateForRemove()
// update children as well
for (BView *child = fFirstChild; child != NULL; child = child->fNextSibling) {
for (BView* child = fFirstChild; child != NULL;
child = child->fNextSibling) {
if (child->fOwner)
child->_UpdateStateForRemove();
}
@@ -5312,7 +5320,7 @@ BView::_SetViewBitmap(const BBitmap* bitmap, BRect srcRect, BRect dstRect,
bool
BView::_CheckOwnerLockAndSwitchCurrent() const
{
STRACE(("BView(%s)::_CheckOwnerLockAndSwitchCurrent()...", Name()));
STRACE(("BView(%s)::_CheckOwnerLockAndSwitchCurrent()\n", Name()));
if (fOwner == NULL) {
debugger("View method requires owner and doesn't have one.");
@@ -5341,7 +5349,7 @@ BView::_CheckOwnerLock() const
void
BView::_CheckLockAndSwitchCurrent() const
{
STRACE(("BView(%s)::_CheckLockAndSwitchCurrent()...", Name() ? Name(): "NULL"));
STRACE(("BView(%s)::_CheckLockAndSwitchCurrent()\n", Name()));
if (!fOwner)
return;
@@ -5371,8 +5379,6 @@ BView::_SwitchServerCurrentView() const
fOwner->fLink->Attach<int32>(serverToken);
fOwner->fLastViewToken = serverToken;
} else {
STRACE(("quiet2\n"));
}
}
@@ -5486,7 +5492,8 @@ void BView::_ReservedView16(){}
BView::BView(const BView& other)
: BHandler()
:
BHandler()
{
// this is private and not functional, but exported
}