Code style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Wim van der Meer
2010-07-02 03:07:18 +00:00
parent afa4fdf51e
commit 15676f3a87
19 changed files with 139 additions and 119 deletions
+38 -38
View File
@@ -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
+4 -5
View File
@@ -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();
}
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef APP_H
#define APP_H
#include <Application.h>
@@ -32,4 +33,3 @@ private:
};
#endif // APP_H
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef COMMON_H
#define COMMON_H
#include <Entry.h>
#include <GraphicsDefs.h>
#include <Resources.h>
@@ -100,4 +101,3 @@ BResources* read_resources(const char* appSignature);
void size_to_string(off_t byteCount, char* name);
#endif // COMMON_H
+19 -17
View File
@@ -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 <Bitmap.h>
@@ -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);
}
+2 -2
View File
@@ -9,6 +9,7 @@
#ifndef CONTROLS_VIEW_H
#define CONTROLS_VIEW_H
#include <Button.h>
#include <View.h>
@@ -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
-1
View File
@@ -16,4 +16,3 @@ main()
app.Run();
return 0;
}
+6 -4
View File
@@ -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 <stdio.h>
@@ -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()
{
}
+8 -8
View File
@@ -9,6 +9,7 @@
#ifndef INFO_WINDOW_H
#define INFO_WINDOW_H
#include <Window.h>
@@ -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
+6 -2
View File
@@ -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 <Application.h>
@@ -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;
+2
View File
@@ -10,6 +10,7 @@
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
#include <Window.h>
@@ -19,6 +20,7 @@ struct FileInfo;
class PieView;
class StatusView;
class MainWindow: public BWindow {
public:
MainWindow(BRect pieRect);
+18 -13
View File
@@ -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 <fs_info.h>
#include <math.h>
#include <Alert.h>
#include <AppFileInfo.h>
#include <Bitmap.h>
#include <Entry.h>
@@ -23,7 +26,6 @@
#include <Roster.h>
#include <String.h>
#include <Volume.h>
#include <Alert.h>
#include <tracker_private.h>
@@ -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);
}
}
+2 -1
View File
@@ -10,6 +10,7 @@
#ifndef PIE_VIEW_H
#define PIE_VIEW_H
#include <View.h>
#include <map>
@@ -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
+14 -13
View File
@@ -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 <stdlib.h>
@@ -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();
}
+2 -1
View File
@@ -9,6 +9,7 @@
#ifndef SCANNER_H
#define SCANNER_H
#include <string>
#include <Looper.h>
@@ -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
+8 -6
View File
@@ -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 <stdio.h>
@@ -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;
}
+2 -1
View File
@@ -9,6 +9,7 @@
#ifndef SNAPSHOT_H
#define SNAPSHOT_H
#include <string>
#include <vector>
@@ -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
+5 -4
View File
@@ -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 <math.h>
@@ -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);
}
}
+1 -1
View File
@@ -9,6 +9,7 @@
#ifndef STATUS_VIEW_H
#define STATUS_VIEW_H
#include <View.h>
#include <StringView.h>
#include <Rect.h>
@@ -32,4 +33,3 @@ private:
#endif // STATUS_VIEW_H