* Fixed wrong indentation of the if-clause introduced in r40144.

* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40147 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-01-08 12:38:13 +00:00
parent 40e0165b13
commit 9f609ed7c6
+15 -15
View File
@@ -66,7 +66,7 @@ BackgroundImage::GetBackgroundImage(const BNode *node, bool isDesktop)
attr_info info; attr_info info;
if (node->GetAttrInfo(kBackgroundImageInfo, &info) != B_OK) if (node->GetAttrInfo(kBackgroundImageInfo, &info) != B_OK)
return NULL; return NULL;
BMessage container; BMessage container;
char *buffer = new char [info.size]; char *buffer = new char [info.size];
@@ -88,7 +88,7 @@ BackgroundImage::GetBackgroundImage(const BNode *node, bool isDesktop)
BPoint offset; BPoint offset;
BBitmap *bitmap = NULL; BBitmap *bitmap = NULL;
if (container.FindString(kBackgroundImageInfoPath, index, &path) == B_OK) { if (container.FindString(kBackgroundImageInfoPath, index, &path) == B_OK) {
bitmap = BTranslationUtils::GetBitmap(path); bitmap = BTranslationUtils::GetBitmap(path);
if (!bitmap) { if (!bitmap) {
PRINT(("failed to load background bitmap from path\n")); PRINT(("failed to load background bitmap from path\n"));
@@ -146,14 +146,14 @@ BackgroundImage::~BackgroundImage()
} }
void void
BackgroundImage::Add(BackgroundImageInfo *info) BackgroundImage::Add(BackgroundImageInfo *info)
{ {
fBitmapForWorkspaceList.AddItem(info); fBitmapForWorkspaceList.AddItem(info);
} }
void void
BackgroundImage::Show(BView *view, int32 workspace) BackgroundImage::Show(BView *view, int32 workspace)
{ {
fView = view; fView = view;
@@ -167,7 +167,7 @@ BackgroundImage::Show(BView *view, int32 workspace)
} }
} }
void void
BackgroundImage::Show(BackgroundImageInfo *info, BView *view) BackgroundImage::Show(BackgroundImageInfo *info, BView *view)
{ {
BPoseView *poseView = dynamic_cast<BPoseView *>(view); BPoseView *poseView = dynamic_cast<BPoseView *>(view);
@@ -200,7 +200,7 @@ BackgroundImage::Show(BackgroundImageInfo *info, BView *view)
case kScaledToFit: case kScaledToFit:
if (fIsDesktop) { if (fIsDesktop) {
if (BRectRatio(destinationBitmapBounds) if (BRectRatio(destinationBitmapBounds)
>= BRectRatio(viewBounds)) { >= BRectRatio(viewBounds)) {
float overlap = BRectHorizontalOverlap(viewBounds, float overlap = BRectHorizontalOverlap(viewBounds,
destinationBitmapBounds); destinationBitmapBounds);
destinationBitmapBounds.Set(-overlap, 0, destinationBitmapBounds.Set(-overlap, 0,
@@ -227,7 +227,7 @@ BackgroundImage::Show(BackgroundImageInfo *info, BView *view)
tile = B_TILE_BITMAP; tile = B_TILE_BITMAP;
break; break;
} }
// switch to the bitmap and force a redraw // switch to the bitmap and force a redraw
view->SetViewBitmap(info->fBitmap, bitmapBounds, destinationBitmapBounds, view->SetViewBitmap(info->fBitmap, bitmapBounds, destinationBitmapBounds,
followFlags, tile); followFlags, tile);
@@ -259,7 +259,7 @@ BackgroundImage::BRectVerticalOverlap(BRect hostRect, BRect resizedRect)
} }
void void
BackgroundImage::Remove() BackgroundImage::Remove()
{ {
if (fShowingBitmap) { if (fShowingBitmap) {
@@ -280,7 +280,7 @@ BackgroundImage::ImageInfoForWorkspace(int32 workspace) const
for ( ; workspace; workspace--) for ( ; workspace; workspace--)
workspaceMask *= 2; workspaceMask *= 2;
int32 count = fBitmapForWorkspaceList.CountItems(); int32 count = fBitmapForWorkspaceList.CountItems();
// do a simple lookup for the most likely candidate bitmap - // do a simple lookup for the most likely candidate bitmap -
@@ -294,11 +294,11 @@ BackgroundImage::ImageInfoForWorkspace(int32 workspace) const
if (info->fWorkspace & workspaceMask) if (info->fWorkspace & workspaceMask)
result = info; result = info;
} }
return result; return result;
} }
void void
BackgroundImage::WorkspaceActivated(BView *view, int32 workspace, bool state) BackgroundImage::WorkspaceActivated(BView *view, int32 workspace, bool state)
{ {
if (!fIsDesktop) if (!fIsDesktop)
@@ -308,7 +308,7 @@ BackgroundImage::WorkspaceActivated(BView *view, int32 workspace, bool state)
if (!state) if (!state)
// we only care comming into a new workspace, not leaving one // we only care comming into a new workspace, not leaving one
return; return;
BackgroundImageInfo *info = ImageInfoForWorkspace(workspace); BackgroundImageInfo *info = ImageInfoForWorkspace(workspace);
if (info != fShowingBitmap) { if (info != fShowingBitmap) {
@@ -324,12 +324,12 @@ BackgroundImage::WorkspaceActivated(BView *view, int32 workspace, bool state)
} }
} }
void void
BackgroundImage::ScreenChanged(BRect, color_space) BackgroundImage::ScreenChanged(BRect, color_space)
{ {
if (!fIsDesktop || !fShowingBitmap) if (!fIsDesktop || !fShowingBitmap)
return; return;
if (fShowingBitmap->fMode == kCentered) { if (fShowingBitmap->fMode == kCentered) {
BRect viewBounds(fView->Bounds()); BRect viewBounds(fView->Bounds());
BRect bitmapBounds(fShowingBitmap->fBitmap->Bounds()); BRect bitmapBounds(fShowingBitmap->fBitmap->Bounds());
@@ -352,7 +352,7 @@ BackgroundImage::Refresh(BackgroundImage *oldBackgroundImage,
oldBackgroundImage->Remove(); oldBackgroundImage->Remove();
delete oldBackgroundImage; delete oldBackgroundImage;
} }
BackgroundImage *result = GetBackgroundImage(fromNode, desktop); BackgroundImage *result = GetBackgroundImage(fromNode, desktop);
if (result && poseView->ViewMode() != kListMode) if (result && poseView->ViewMode() != kListMode)
result->Show(poseView, current_workspace()); result->Show(poseView, current_workspace());