Backgrounds: style fixes only

* Update copyright headers
* Fill in pragmas
* Eliminate superfluous B_USE_DEFAULT_SPACING, 80 char limit too
* rename msg variable to message
This commit is contained in:
John Scipione
2013-12-29 23:42:37 -05:00
parent a0848a1916
commit 0a669f8cd8
5 changed files with 33 additions and 32 deletions
+5 -6
View File
@@ -1,10 +1,10 @@
/* /*
* Copyright 2002-2009, Haiku, Inc. All Rights Reserved. * Copyright 2002-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Jerome Duval ([email protected])
* Axel Dörfler, [email protected] * Axel Dörfler, [email protected]
* Jerome Duval, [email protected]
*/ */
@@ -51,7 +51,7 @@ private:
}; };
// #pragma mark - // #pragma mark - BackgroundsApplication
BackgroundsApplication::BackgroundsApplication() BackgroundsApplication::BackgroundsApplication()
@@ -85,7 +85,7 @@ BackgroundsApplication::RefsReceived(BMessage* message)
} }
// #pragma mark - // #pragma mark - BackgroundsWindow
BackgroundsWindow::BackgroundsWindow() BackgroundsWindow::BackgroundsWindow()
@@ -133,7 +133,7 @@ BackgroundsWindow::WorkspaceActivated(int32 oldWorkspaces, bool active)
} }
// #pragma mark - // #pragma mark - main method
int int
@@ -143,4 +143,3 @@ main(int argc, char** argv)
app.Run(); app.Run();
return 0; return 0;
} }
+13 -13
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 Haiku, Inc. All Rights Reserved. * Copyright 2002-2013 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -188,7 +188,7 @@ BackgroundsView::BackgroundsView()
fPicker = new BColorControl(BPoint(0, 0), B_CELLS_32x8, 8.0, "Picker", fPicker = new BColorControl(BPoint(0, 0), B_CELLS_32x8, 8.0, "Picker",
new BMessage(kMsgUpdateColor)); new BMessage(kMsgUpdateColor));
rightbox->AddChild(BLayoutBuilder::Group<>(B_VERTICAL, B_USE_DEFAULT_SPACING) rightbox->AddChild(BLayoutBuilder::Group<>(B_VERTICAL)
.AddGrid(B_USE_DEFAULT_SPACING, B_USE_SMALL_SPACING) .AddGrid(B_USE_DEFAULT_SPACING, B_USE_SMALL_SPACING)
.Add(imageMenuField->CreateLabelLayoutItem(), 0, 0) .Add(imageMenuField->CreateLabelLayoutItem(), 0, 0)
.Add(imageMenuField->CreateMenuBarLayoutItem(), 1, 0, 2, 1) .Add(imageMenuField->CreateMenuBarLayoutItem(), 1, 0, 2, 1)
@@ -284,12 +284,12 @@ BackgroundsView::AllAttached()
void void
BackgroundsView::MessageReceived(BMessage* msg) BackgroundsView::MessageReceived(BMessage* message)
{ {
switch (msg->what) { switch (message->what) {
case B_SIMPLE_DATA: case B_SIMPLE_DATA:
case B_REFS_RECEIVED: case B_REFS_RECEIVED:
RefsReceived(msg); RefsReceived(message);
break; break;
case kMsgUpdatePreviewPlacement: case kMsgUpdatePreviewPlacement:
@@ -355,7 +355,7 @@ BackgroundsView::MessageReceived(BMessage* msg)
{ {
PRINT(("cancel received\n")); PRINT(("cancel received\n"));
void* pointer; void* pointer;
msg->FindPointer("source", &pointer); message->FindPointer("source", &pointer);
if (pointer == fPanel) { if (pointer == fPanel) {
if (fLastImageIndex >= 0) if (fLastImageIndex >= 0)
_FindImageItem(fLastImageIndex)->SetMarked(true); _FindImageItem(fLastImageIndex)->SetMarked(true);
@@ -404,7 +404,7 @@ BackgroundsView::MessageReceived(BMessage* msg)
break; break;
default: default:
BView::MessageReceived(msg); BView::MessageReceived(message);
break; break;
} }
} }
@@ -945,12 +945,12 @@ BackgroundsView::_UpdateButtons()
void void
BackgroundsView::RefsReceived(BMessage* msg) BackgroundsView::RefsReceived(BMessage* message)
{ {
if (!msg->HasRef("refs") && msg->HasRef("dir_ref")) { if (!message->HasRef("refs") && message->HasRef("dir_ref")) {
entry_ref dirRef; entry_ref dirRef;
if (msg->FindRef("dir_ref", &dirRef) == B_OK) if (message->FindRef("dir_ref", &dirRef) == B_OK)
msg->AddRef("refs", &dirRef); message->AddRef("refs", &dirRef);
} }
entry_ref ref; entry_ref ref;
@@ -959,7 +959,7 @@ BackgroundsView::RefsReceived(BMessage* msg)
BPath desktopPath; BPath desktopPath;
find_directory(B_DESKTOP_DIRECTORY, &desktopPath); find_directory(B_DESKTOP_DIRECTORY, &desktopPath);
while (msg->FindRef("refs", i++, &ref) == B_OK) { while (message->FindRef("refs", i++, &ref) == B_OK) {
BPath path; BPath path;
BEntry entry(&ref, true); BEntry entry(&ref, true);
path.SetTo(&entry); path.SetTo(&entry);
@@ -987,7 +987,7 @@ BackgroundsView::RefsReceived(BMessage* msg)
// An optional placement may have been sent // An optional placement may have been sent
int32 placement = 0; int32 placement = 0;
if (msg->FindInt32("placement", &placement) == B_OK) { if (message->FindInt32("placement", &placement) == B_OK) {
BMenuItem* item = fPlacementMenu->FindItem(placement); BMenuItem* item = fPlacementMenu->FindItem(placement);
if (item) if (item)
item->SetMarked(true); item->SetMarked(true);
@@ -1,9 +1,9 @@
/* /*
* Copyright 2002-2009, Haiku, Inc. All Rights Reserved. * Copyright 2002-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Jerome Duval ([email protected]) * Jerome Duval, [email protected]
*/ */
#ifndef BACKGROUNDS_VIEW_H #ifndef BACKGROUNDS_VIEW_H
#define BACKGROUNDS_VIEW_H #define BACKGROUNDS_VIEW_H
@@ -105,9 +105,9 @@ public:
~BackgroundsView(); ~BackgroundsView();
void AllAttached(); void AllAttached();
void MessageReceived(BMessage* msg); void MessageReceived(BMessage* message);
void RefsReceived(BMessage* msg); void RefsReceived(BMessage* message);
void SaveSettings(); void SaveSettings();
void WorkspaceActivated(uint32 oldWorkspaces, void WorkspaceActivated(uint32 oldWorkspaces,
@@ -177,4 +177,3 @@ protected:
}; };
#endif // BACKGROUNDS_VIEW_H #endif // BACKGROUNDS_VIEW_H
@@ -1,9 +1,9 @@
/* /*
* Copyright 2002-2009, Haiku, Inc. All Rights Reserved. * Copyright 2002-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Jerome Duval ([email protected]) * Jerome Duval, [email protected]
*/ */
@@ -23,11 +23,15 @@
#define B_TRANSLATION_CONTEXT "Image Filepanel" #define B_TRANSLATION_CONTEXT "Image Filepanel"
// #pragma mark - ImageFilePanel
ImageFilePanel::ImageFilePanel(file_panel_mode mode, BMessenger* target, ImageFilePanel::ImageFilePanel(file_panel_mode mode, BMessenger* target,
const entry_ref* startDirectory, uint32 nodeFlavors, const entry_ref* startDirectory, uint32 nodeFlavors,
bool allowMultipleSelection, BMessage* message, BRefFilter* filter, bool allowMultipleSelection, BMessage* message, BRefFilter* filter,
bool modal, bool hideWhenDone) bool modal, bool hideWhenDone)
: BFilePanel(mode, target, startDirectory, nodeFlavors, :
BFilePanel(mode, target, startDirectory, nodeFlavors,
allowMultipleSelection, message, filter, modal, hideWhenDone), allowMultipleSelection, message, filter, modal, hideWhenDone),
fImageView(NULL), fImageView(NULL),
fResolutionView(NULL), fResolutionView(NULL),
@@ -167,7 +171,7 @@ ImageFilePanel::SelectionChanged()
} }
// #pragma mark - // #pragma mark - CustomRefFilter
CustomRefFilter::CustomRefFilter(bool imageFiltering) CustomRefFilter::CustomRefFilter(bool imageFiltering)
@@ -194,4 +198,3 @@ CustomRefFilter::Filter(const entry_ref* ref, BNode* node,
return false; return false;
} }
+3 -3
View File
@@ -1,10 +1,11 @@
/* /*
* Copyright 2002-2009, Haiku, Inc. All Rights Reserved. * Copyright 2002-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Jerome Duval ([email protected]) * Jerome Duval, [email protected]
*/ */
#ifndef IMAGE_FILE_PANEL_H #ifndef IMAGE_FILE_PANEL_H
#define IMAGE_FILE_PANEL_H #define IMAGE_FILE_PANEL_H
@@ -55,4 +56,3 @@ protected:
}; };
#endif // IMAGE_FILE_PANEL_H #endif // IMAGE_FILE_PANEL_H