From f9954bfc695673552e7eb217c4bf75b0e0717242 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 30 May 2013 20:35:42 -0400 Subject: [PATCH] Style fixes to BBox, update copyright header --- headers/os/interface/Box.h | 20 ++++++------ src/kits/interface/Box.cpp | 64 ++++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/headers/os/interface/Box.h b/headers/os/interface/Box.h index d3e4009431..786ea50691 100644 --- a/headers/os/interface/Box.h +++ b/headers/os/interface/Box.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2005-2013 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _BOX_H @@ -11,7 +11,7 @@ class BBox : public BView { public: - BBox(BRect frame, const char *name = NULL, + BBox(BRect frame, const char* name = NULL, uint32 resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP, uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS @@ -47,8 +47,8 @@ class BBox : public BView { virtual void DetachedFromWindow(); virtual void AllAttached(); virtual void AllDetached(); - virtual void FrameResized(float width, float height); - virtual void MessageReceived(BMessage* message); + virtual void FrameResized(float width, float height); + virtual void MessageReceived(BMessage* message); virtual void MouseDown(BPoint point); virtual void MouseUp(BPoint point); virtual void WindowActivated(bool active); @@ -56,16 +56,16 @@ class BBox : public BView { const BMessage* dragMessage); virtual void FrameMoved(BPoint newLocation); - virtual BHandler* ResolveSpecifier(BMessage* message, + virtual BHandler* ResolveSpecifier(BMessage* message, int32 index, BMessage* specifier, int32 what, const char* property); - virtual void ResizeToPreferred(); - virtual void GetPreferredSize(float* _width, float* _height); - virtual void MakeFocus(bool focused = true); - virtual status_t GetSupportedSuites(BMessage* message); + virtual void ResizeToPreferred(); + virtual void GetPreferredSize(float* _width, float* _height); + virtual void MakeFocus(bool focused = true); + virtual status_t GetSupportedSuites(BMessage* message); - virtual status_t Perform(perform_code d, void* arg); + virtual status_t Perform(perform_code d, void* arg); virtual BSize MinSize(); virtual BSize MaxSize(); diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp index a4a0165652..e9ff1359f1 100644 --- a/src/kits/interface/Box.cpp +++ b/src/kits/interface/Box.cpp @@ -1,12 +1,13 @@ /* - * Copyright (c) 2001-2009, Haiku, Inc. + * Copyright 2001-2013 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT license. * * Authors: - * Marc Flerackers (mflerackers@androme.be) - * Stephan Aßmus - * DarkWyrm + * Stephan Aßmus, superstippi@gmx.de + * DarkWyrm, bpmagic@columbus.rr.com * Axel Dörfler, axeld@pinc-software.de + * Marc Flerackers, mflerackers@androme.be + * John Scipione, jscipione@gmail.com */ @@ -41,9 +42,10 @@ struct BBox::LayoutData { }; -BBox::BBox(BRect frame, const char *name, uint32 resizingMode, uint32 flags, +BBox::BBox(BRect frame, const char* name, uint32 resizingMode, uint32 flags, border_style border) - : BView(frame, name, resizingMode, flags | B_WILL_DRAW | B_FRAME_EVENTS), + : + BView(frame, name, resizingMode, flags | B_WILL_DRAW | B_FRAME_EVENTS), fStyle(border) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); @@ -54,8 +56,9 @@ BBox::BBox(BRect frame, const char *name, uint32 resizingMode, uint32 flags, BBox::BBox(const char* name, uint32 flags, border_style border, BView* child) - : BView(name, flags | B_WILL_DRAW | B_FRAME_EVENTS), - fStyle(border) + : + BView(name, flags | B_WILL_DRAW | B_FRAME_EVENTS), + fStyle(border) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); @@ -68,8 +71,9 @@ BBox::BBox(const char* name, uint32 flags, border_style border, BView* child) BBox::BBox(border_style border, BView* child) - : BView(NULL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP), - fStyle(border) + : + BView(NULL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP), + fStyle(border) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); @@ -81,9 +85,10 @@ BBox::BBox(border_style border, BView* child) } -BBox::BBox(BMessage *archive) - : BView(archive), - fStyle(B_FANCY_BORDER) +BBox::BBox(BMessage* archive) + : + BView(archive), + fStyle(B_FANCY_BORDER) { _InitObject(archive); } @@ -97,8 +102,8 @@ BBox::~BBox() } -BArchivable * -BBox::Instantiate(BMessage *archive) +BArchivable* +BBox::Instantiate(BMessage* archive) { if (validate_instantiation(archive, "BBox")) return new BBox(archive); @@ -108,7 +113,7 @@ BBox::Instantiate(BMessage *archive) status_t -BBox::Archive(BMessage *archive, bool deep) const +BBox::Archive(BMessage* archive, bool deep) const { status_t ret = BView::Archive(archive, deep); @@ -179,7 +184,7 @@ BBox::InnerFrame() void -BBox::SetLabel(const char *string) +BBox::SetLabel(const char* string) { _ClearLabel(); @@ -194,7 +199,7 @@ BBox::SetLabel(const char *string) status_t -BBox::SetLabel(BView *viewLabel) +BBox::SetLabel(BView* viewLabel) { _ClearLabel(); @@ -213,14 +218,14 @@ BBox::SetLabel(BView *viewLabel) } -const char * +const char* BBox::Label() const { return fLabel; } -BView * +BView* BBox::LabelView() const { return fLabelView; @@ -357,7 +362,7 @@ BBox::FrameResized(float width, float height) void -BBox::MessageReceived(BMessage *message) +BBox::MessageReceived(BMessage* message) { BView::MessageReceived(message); } @@ -385,7 +390,7 @@ BBox::WindowActivated(bool active) void -BBox::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +BBox::MouseMoved(BPoint point, uint32 transit, const BMessage* message) { BView::MouseMoved(point, transit, message); } @@ -398,10 +403,9 @@ BBox::FrameMoved(BPoint newLocation) } -BHandler * -BBox::ResolveSpecifier(BMessage *message, int32 index, - BMessage *specifier, int32 what, - const char *property) +BHandler* +BBox::ResolveSpecifier(BMessage* message, int32 index, BMessage* specifier, + int32 what, const char* property) { return BView::ResolveSpecifier(message, index, specifier, what, property); } @@ -424,7 +428,7 @@ BBox::ResizeToPreferred() void -BBox::GetPreferredSize(float *_width, float *_height) +BBox::GetPreferredSize(float* _width, float* _height) { _ValidateLayoutData(); @@ -443,7 +447,7 @@ BBox::MakeFocus(bool focused) status_t -BBox::GetSupportedSuites(BMessage *message) +BBox::GetSupportedSuites(BMessage* message) { return BView::GetSupportedSuites(message); } @@ -480,7 +484,7 @@ BBox::Perform(perform_code code, void* _data) BBox::GetHeightForWidth(data->width, &data->min, &data->max, &data->preferred); return B_OK; -} + } case PERFORM_CODE_SET_LAYOUT: { perform_data_set_layout* data = (perform_data_set_layout*)_data; @@ -633,7 +637,7 @@ BBox::_InitObject(BMessage* archive) SetFont(&font, flags); if (archive != NULL) { - const char *string; + const char* string; if (archive->FindString("_label", &string) == B_OK) SetLabel(string);