diff --git a/headers/os/app/Invoker.h b/headers/os/app/Invoker.h index 132ac563c3..13e8402148 100644 --- a/headers/os/app/Invoker.h +++ b/headers/os/app/Invoker.h @@ -18,52 +18,52 @@ class BMessage; class BInvoker { - public: - BInvoker(); - BInvoker(BMessage* message, const BHandler* handler, - const BLooper* looper = NULL); - BInvoker(BMessage* message, BMessenger target); - virtual ~BInvoker(); +public: + BInvoker(); + BInvoker(BMessage* message, const BHandler* handler, + const BLooper* looper = NULL); + BInvoker(BMessage* message, BMessenger target); + virtual ~BInvoker(); - virtual status_t SetMessage(BMessage *message); - BMessage* Message() const; - uint32 Command() const; + virtual status_t SetMessage(BMessage *message); + BMessage* Message() const; + uint32 Command() const; - virtual status_t SetTarget(const BHandler *handler, - const BLooper *looper = NULL); - virtual status_t SetTarget(BMessenger messenger); - bool IsTargetLocal() const; - BHandler* Target(BLooper** _looper = NULL) const; - BMessenger Messenger() const; + virtual status_t SetTarget(const BHandler *handler, + const BLooper *looper = NULL); + virtual status_t SetTarget(BMessenger messenger); + bool IsTargetLocal() const; + BHandler* Target(BLooper** _looper = NULL) const; + BMessenger Messenger() const; - virtual status_t SetHandlerForReply(BHandler* handler); - BHandler* HandlerForReply() const; + virtual status_t SetHandlerForReply(BHandler* handler); + BHandler* HandlerForReply() const; - virtual status_t Invoke(BMessage* message = NULL); - status_t InvokeNotify(BMessage* message, - uint32 kind = B_CONTROL_INVOKED); - status_t SetTimeout(bigtime_t timeout); - bigtime_t Timeout() const; + virtual status_t Invoke(BMessage* message = NULL); + status_t InvokeNotify(BMessage* message, + uint32 kind = B_CONTROL_INVOKED); + status_t SetTimeout(bigtime_t timeout); + bigtime_t Timeout() const; - protected: - uint32 InvokeKind(bool* _notify = NULL); - void BeginInvokeNotify(uint32 kind = B_CONTROL_INVOKED); - void EndInvokeNotify(); +protected: + uint32 InvokeKind(bool* _notify = NULL); + void BeginInvokeNotify(uint32 kind = B_CONTROL_INVOKED); + void EndInvokeNotify(); - private: - virtual void _ReservedInvoker1(); - virtual void _ReservedInvoker2(); - virtual void _ReservedInvoker3(); +private: + virtual void _ReservedInvoker1(); + virtual void _ReservedInvoker2(); + virtual void _ReservedInvoker3(); - BInvoker(const BInvoker&); - BInvoker& operator=(const BInvoker&); + BInvoker(const BInvoker&); + BInvoker& operator=(const BInvoker&); - BMessage* fMessage; - BMessenger fMessenger; - BHandler* fReplyTo; - bigtime_t fTimeout; - uint32 fNotifyKind; - uint32 _reserved[1]; + BMessage* fMessage; + BMessenger fMessenger; + BHandler* fReplyTo; + bigtime_t fTimeout; + uint32 fNotifyKind; + uint32 _reserved[1]; }; #endif // _INVOKER_H diff --git a/src/apps/diskusage/App.cpp b/src/apps/diskusage/App.cpp index 58f73fd005..af405d09a5 100644 --- a/src/apps/diskusage/App.cpp +++ b/src/apps/diskusage/App.cpp @@ -22,10 +22,10 @@ App::App() - : BApplication(kAppSignature), - fResources(read_resources(kAppSignature)), - fMainWindow(NULL), - fSavedRefsReceived(NULL) + : + BApplication(kAppSignature), + fResources(read_resources(kAppSignature)), + fMainWindow(NULL), fSavedRefsReceived(NULL) { } @@ -118,4 +118,3 @@ App::QuitRequested() return BApplication::QuitRequested(); } - diff --git a/src/apps/diskusage/App.h b/src/apps/diskusage/App.h index 8965e0b2c4..cc3b3f6392 100644 --- a/src/apps/diskusage/App.h +++ b/src/apps/diskusage/App.h @@ -9,6 +9,7 @@ #ifndef APP_H #define APP_H + #include @@ -32,4 +33,3 @@ private: }; #endif // APP_H - diff --git a/src/apps/diskusage/Common.h b/src/apps/diskusage/Common.h index 8d92420b11..bb3939491b 100644 --- a/src/apps/diskusage/Common.h +++ b/src/apps/diskusage/Common.h @@ -9,6 +9,7 @@ #ifndef COMMON_H #define COMMON_H + #include #include #include @@ -100,4 +101,3 @@ BResources* read_resources(const char* appSignature); void size_to_string(off_t byteCount, char* name); #endif // COMMON_H - diff --git a/src/apps/diskusage/ControlsView.cpp b/src/apps/diskusage/ControlsView.cpp index 39b16ea82a..eb1e2c8421 100644 --- a/src/apps/diskusage/ControlsView.cpp +++ b/src/apps/diskusage/ControlsView.cpp @@ -6,6 +6,8 @@ * as long as it is accompanied by it's documentation and this copyright notice. * The software comes with no warranty, etc. */ + + #include "ControlsView.h" #include @@ -24,27 +26,28 @@ class VolumeMenuItem: public BMenuItem { public: - VolumeMenuItem(BVolume* volume, BMessage* message); - virtual ~VolumeMenuItem(); + VolumeMenuItem(BVolume* volume, BMessage* message); + virtual ~VolumeMenuItem(); - virtual void GetContentSize(float* width, float* height); - virtual void DrawContent(); + virtual void GetContentSize(float* width, float* height); + virtual void DrawContent(); - BVolume* Volume() const - { return fVolume; } - status_t Invoke() - { return BMenuItem::Invoke(); } + BVolume* Volume() const + { return fVolume; } + status_t Invoke() + { return BMenuItem::Invoke(); } private: - BBitmap* fIcon; - BVolume* fVolume; + BBitmap* fIcon; + BVolume* fVolume; }; VolumeMenuItem::VolumeMenuItem(BVolume* volume, BMessage* message) - : BMenuItem(kEmptyStr, message), - fIcon(new BBitmap(BRect(0, 0, 15, 15), B_RGBA32)), - fVolume(volume) + : + BMenuItem(kEmptyStr, message), + fIcon(new BBitmap(BRect(0, 0, 15, 15), B_RGBA32)), + fVolume(volume) { char name[B_PATH_NAME_LENGTH]; fVolume->GetName(name); @@ -117,8 +120,9 @@ private: ControlsView::VolumePopup::VolumePopup(BRect r) - : BMenuField(r, NULL, kVolMenuLabel, new BPopUpMenu(kVolMenuDefault), - false, B_FOLLOW_LEFT) + : + BMenuField(r, NULL, kVolMenuLabel, new BPopUpMenu(kVolMenuDefault), false, + B_FOLLOW_LEFT) { SetViewColor(kWindowColor); SetLowColor(kWindowColor); @@ -295,5 +299,3 @@ ControlsView::FindDeviceFor(dev_t device, bool invoke) { return fVolumePopup->FindDeviceFor(device, invoke); } - - diff --git a/src/apps/diskusage/ControlsView.h b/src/apps/diskusage/ControlsView.h index b57f0558d2..155ae6e70d 100644 --- a/src/apps/diskusage/ControlsView.h +++ b/src/apps/diskusage/ControlsView.h @@ -9,6 +9,7 @@ #ifndef CONTROLS_VIEW_H #define CONTROLS_VIEW_H + #include #include @@ -27,7 +28,7 @@ public: bool invoke = false); private: - class VolumePopup; + class VolumePopup; VolumePopup* fVolumePopup; BButton* fRescanButton; @@ -35,4 +36,3 @@ private: #endif // CONTROLS_VIEW_H - diff --git a/src/apps/diskusage/DiskUsage.cpp b/src/apps/diskusage/DiskUsage.cpp index 1714001a51..bc3d8670e7 100644 --- a/src/apps/diskusage/DiskUsage.cpp +++ b/src/apps/diskusage/DiskUsage.cpp @@ -16,4 +16,3 @@ main() app.Run(); return 0; } - diff --git a/src/apps/diskusage/InfoWindow.cpp b/src/apps/diskusage/InfoWindow.cpp index 716d3be39a..7a0a80afa3 100644 --- a/src/apps/diskusage/InfoWindow.cpp +++ b/src/apps/diskusage/InfoWindow.cpp @@ -6,6 +6,8 @@ * as long as it is accompanied by it's documentation and this copyright notice. * The software comes with no warranty, etc. */ + + #include "InfoWindow.h" #include @@ -25,9 +27,11 @@ using std::string; using std::vector; using std::pair; + LeftView::LeftView(BRect frame, BBitmap* icon) - : BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW), - fIcon(icon) + : + BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW), + fIcon(icon) { SetViewColor(tint_color(kWindowColor, B_LIGHTEN_1_TINT)); } @@ -174,5 +178,3 @@ InfoWin::InfoWin(BPoint p, FileInfo *f, BWindow* parent) InfoWin::~InfoWin() { } - - diff --git a/src/apps/diskusage/InfoWindow.h b/src/apps/diskusage/InfoWindow.h index b72902e35b..5d47e67da5 100644 --- a/src/apps/diskusage/InfoWindow.h +++ b/src/apps/diskusage/InfoWindow.h @@ -9,6 +9,7 @@ #ifndef INFO_WINDOW_H #define INFO_WINDOW_H + #include @@ -16,22 +17,21 @@ struct FileInfo; class LeftView: public BView { public: - LeftView(BRect frame, BBitmap* icon); - virtual ~LeftView(); + LeftView(BRect frame, BBitmap* icon); + virtual ~LeftView(); - virtual void Draw(BRect updateRect); + virtual void Draw(BRect updateRect); private: - BBitmap* fIcon; + BBitmap* fIcon; }; class InfoWin: public BWindow { public: - InfoWin(BPoint location, FileInfo* info, - BWindow* parent); - virtual ~InfoWin(); + InfoWin(BPoint location, FileInfo* info, + BWindow* parent); + virtual ~InfoWin(); }; #endif // INFO_WINDOW_H - diff --git a/src/apps/diskusage/MainWindow.cpp b/src/apps/diskusage/MainWindow.cpp index ee831f6f6b..47212c6b20 100644 --- a/src/apps/diskusage/MainWindow.cpp +++ b/src/apps/diskusage/MainWindow.cpp @@ -7,6 +7,8 @@ * as long as it is accompanied by it's documentation and this copyright notice. * The software comes with no warranty, etc. */ + + #include "MainWindow.h" #include @@ -24,7 +26,8 @@ const float kMinWinSize = 275.0; MainWindow::MainWindow(BRect pieRect) - : BWindow(pieRect, "DiskUsage", B_TITLED_WINDOW, + : + BWindow(pieRect, "DiskUsage", B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE) { BRect r = Bounds(); @@ -57,7 +60,8 @@ MainWindow::MainWindow(BRect pieRect) // this bug, and Be said it's not a bug -- the Matrox driver actually uses // a resolution of 1152x900 in that mode. Oh well. Lock(); - float extraHeight = fControlsView->Bounds().Height() + fStatusView->Bounds().Height(); + float extraHeight = fControlsView->Bounds().Height() + + fStatusView->Bounds().Height(); float minHeight = kMinWinSize + extraHeight; float maxHeight = BScreen(this).Frame().Height(); float maxWidth = maxHeight - extraHeight; diff --git a/src/apps/diskusage/MainWindow.h b/src/apps/diskusage/MainWindow.h index 8e8562f4b4..2afcdb6bf5 100644 --- a/src/apps/diskusage/MainWindow.h +++ b/src/apps/diskusage/MainWindow.h @@ -10,6 +10,7 @@ #ifndef MAIN_WINDOW_H #define MAIN_WINDOW_H + #include @@ -19,6 +20,7 @@ struct FileInfo; class PieView; class StatusView; + class MainWindow: public BWindow { public: MainWindow(BRect pieRect); diff --git a/src/apps/diskusage/PieView.cpp b/src/apps/diskusage/PieView.cpp index 411c2c1992..9e92c84664 100644 --- a/src/apps/diskusage/PieView.cpp +++ b/src/apps/diskusage/PieView.cpp @@ -7,11 +7,14 @@ * as long as it is accompanied by it's documentation and this copyright notice. * The software comes with no warranty, etc. */ + + #include "PieView.h" #include #include +#include #include #include #include @@ -23,7 +26,6 @@ #include #include #include -#include #include @@ -42,7 +44,7 @@ static const int32 kIdxRescan = 3; // TODO: It would be nice to make a common base class for AppMenuItem and // VolMenuItem (menu items that include an icon). -class AppMenuItem: public BMenuItem { +class AppMenuItem : public BMenuItem { public: AppMenuItem(const char* appSig, int category); virtual ~AppMenuItem(); @@ -65,8 +67,12 @@ private: }; -AppMenuItem::AppMenuItem(const char* appSig, int category): - BMenuItem(kEmptyStr, NULL), fCategory(category), fIcon(NULL), fIsValid(false) +AppMenuItem::AppMenuItem(const char* appSig, int category) + : + BMenuItem(kEmptyStr, NULL), + fCategory(category), + fIcon(NULL), + fIsValid(false) { if (be_roster->FindApp(appSig, &fAppRef) == B_NO_ERROR) { fIcon = new BBitmap(BRect(0.0, 0.0, 15.0, 15.0), B_RGBA32); @@ -120,14 +126,15 @@ AppMenuItem::DrawContent() PieView::PieView(BRect frame, MainWindow* window) - : BView(frame, NULL, B_FOLLOW_ALL, + : + BView(frame, NULL, B_FOLLOW_ALL, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_SUBPIXEL_PRECISE), - fWindow(window), - fScanners(), - fCurrentVolume(NULL), - fMouseOverInfo(), - fClicked(false), - fDragging(false) + fWindow(window), + fScanners(), + fCurrentVolume(NULL), + fMouseOverInfo(), + fClicked(false), + fDragging(false) { SetViewColor(B_TRANSPARENT_COLOR); SetLowColor(kWindowColor); @@ -849,5 +856,3 @@ PieView::_OpenInfo(FileInfo* info, BPoint p) tracker.SendMessage(&message); } } - - diff --git a/src/apps/diskusage/PieView.h b/src/apps/diskusage/PieView.h index e9146117e5..1b8a9aa587 100644 --- a/src/apps/diskusage/PieView.h +++ b/src/apps/diskusage/PieView.h @@ -10,6 +10,7 @@ #ifndef PIE_VIEW_H #define PIE_VIEW_H + #include #include @@ -29,6 +30,7 @@ class MainWindow; using std::map; using std::vector; + class PieView: public BView { public: PieView(BRect frame, MainWindow* window); @@ -92,4 +94,3 @@ private: }; #endif // PIE_VIEW_H - diff --git a/src/apps/diskusage/Scanner.cpp b/src/apps/diskusage/Scanner.cpp index 68006afe40..5ac246bc1c 100644 --- a/src/apps/diskusage/Scanner.cpp +++ b/src/apps/diskusage/Scanner.cpp @@ -6,6 +6,8 @@ * as long as it is accompanied by it's documentation and this copyright notice. * The software comes with no warranty, etc. */ + + #include "Scanner.h" #include @@ -17,18 +19,19 @@ using std::vector; -Scanner::Scanner(BVolume *v, BHandler *handler) - : BLooper(), - fListener(handler), - fDoneMessage(kScanDone), - fProgressMessage(kScanProgress), - fVolume(v), - fSnapshot(NULL), - fDesiredPath(), - fTask(), - fBusy(false), - fQuitRequested(false) +Scanner::Scanner(BVolume *v, BHandler *handler) + : + BLooper(), + fListener(handler), + fDoneMessage(kScanDone), + fProgressMessage(kScanProgress), + fVolume(v), + fSnapshot(NULL), + fDesiredPath(), + fTask(), + fBusy(false), + fQuitRequested(false) { fDoneMessage.AddPointer(kNameVolPtr, fVolume); fProgressMessage.AddPointer(kNameVolPtr, fVolume); @@ -271,5 +274,3 @@ Scanner::_ChangeToDesired() free(workPath); fDesiredPath.erase(); } - - diff --git a/src/apps/diskusage/Scanner.h b/src/apps/diskusage/Scanner.h index 77c541b3de..d4269aa3e0 100644 --- a/src/apps/diskusage/Scanner.h +++ b/src/apps/diskusage/Scanner.h @@ -9,6 +9,7 @@ #ifndef SCANNER_H #define SCANNER_H + #include #include @@ -23,6 +24,7 @@ class BDirectory; using std::string; + class Scanner: public BLooper { public: Scanner(BVolume* volume, BHandler* handler); @@ -70,4 +72,3 @@ private: }; #endif // SCANNER_H - diff --git a/src/apps/diskusage/Snapshot.cpp b/src/apps/diskusage/Snapshot.cpp index 0d27b41c37..419b012e1d 100644 --- a/src/apps/diskusage/Snapshot.cpp +++ b/src/apps/diskusage/Snapshot.cpp @@ -6,6 +6,8 @@ * as long as it is accompanied by it's documentation and this copyright notice. * The software comes with no warranty, etc. */ + + #include "Snapshot.h" #include @@ -24,11 +26,12 @@ static const char* kVolumeType = "application/x-vnd.Be-volume"; FileInfo::FileInfo() - : pseudo(false), - size(0), - count(0), - parent(NULL), - children() + : + pseudo(false), + size(0), + count(0), + parent(NULL), + children() { } @@ -124,4 +127,3 @@ VolumeSnapshot::~VolumeSnapshot() delete rootDir; delete freeSpace; } - diff --git a/src/apps/diskusage/Snapshot.h b/src/apps/diskusage/Snapshot.h index c7c3698997..aded614759 100644 --- a/src/apps/diskusage/Snapshot.h +++ b/src/apps/diskusage/Snapshot.h @@ -9,6 +9,7 @@ #ifndef SNAPSHOT_H #define SNAPSHOT_H + #include #include @@ -21,6 +22,7 @@ class BVolume; using std::string; using std::vector; + struct FileInfo { FileInfo(); ~FileInfo(); @@ -53,4 +55,3 @@ struct VolumeSnapshot { }; #endif // SNAPSHOT_H - diff --git a/src/apps/diskusage/StatusView.cpp b/src/apps/diskusage/StatusView.cpp index df93335981..9de460cf54 100644 --- a/src/apps/diskusage/StatusView.cpp +++ b/src/apps/diskusage/StatusView.cpp @@ -6,6 +6,8 @@ * as long as it is accompanied by it's documentation and this copyright notice. * The software comes with no warranty, etc. */ + + #include "StatusView.h" #include @@ -21,8 +23,9 @@ StatusView::StatusView(BRect rect) - : BView(rect, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW), - fCurrentFileInfo(NULL) + : + BView(rect, NULL, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW), + fCurrentFileInfo(NULL) { SetViewColor(kWindowColor); @@ -130,5 +133,3 @@ StatusView::Show(const FileInfo* info) fCountView->SetText(kEmptyStr); } } - - diff --git a/src/apps/diskusage/StatusView.h b/src/apps/diskusage/StatusView.h index eaf409b5d0..4027fb0c6e 100644 --- a/src/apps/diskusage/StatusView.h +++ b/src/apps/diskusage/StatusView.h @@ -9,6 +9,7 @@ #ifndef STATUS_VIEW_H #define STATUS_VIEW_H + #include #include #include @@ -32,4 +33,3 @@ private: #endif // STATUS_VIEW_H -