Skip to content

Commit

Permalink
Use Mozilla type brace break
Browse files Browse the repository at this point in the history
  • Loading branch information
bitigchi authored and humdingerb committed Apr 5, 2024
1 parent 1021151 commit 3dbdbf7
Show file tree
Hide file tree
Showing 198 changed files with 1,430 additions and 1,941 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Stroustrup
BreakBeforeBraces: Mozilla
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
Expand Down
3 changes: 1 addition & 2 deletions source/AboutView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ SAboutView::Draw(BRect updateRect)
SetHighColor(Red);
SetFontSize(13);
DrawString(lstring(4, "Unregistered Version"), BPoint(85, 155));
}
else {
} else {
SetHighColor(Grey8);
#if defined(__HAIKU__)
DrawString("Released under the MIT license", BPoint(85, 152));
Expand Down
3 changes: 2 additions & 1 deletion source/AboutView.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#include <Button.h>
#include <Bitmap.h>

class SAboutView : public BView {
class SAboutView : public BView
{
public:
SAboutView(BRect rect, BBitmap* becasso, BBitmap* sum, bool startup = false);
virtual ~SAboutView();
Expand Down
3 changes: 2 additions & 1 deletion source/AboutWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

#include <Window.h>

class AboutWindow : public BWindow {
class AboutWindow : public BWindow
{
public:
AboutWindow(BRect rect);
virtual ~AboutWindow();
Expand Down
10 changes: 4 additions & 6 deletions source/AddOn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ AddOn::AddOn(BEntry entry)
fprintf(stderr, "Problems finding addon_open routine in %s\n", path.Path());
throw(1);
}
}
else if (get_image_symbol(
fAddOnID, "addon_make_config", B_SYMBOL_TYPE_TEXT, (void**)&addon_make_config
)) {
} else if (get_image_symbol(
fAddOnID, "addon_make_config", B_SYMBOL_TYPE_TEXT, (void**)&addon_make_config
)) {
if (VerbAddOns)
fprintf(stderr, "Problems finding addon_make_config routine in %s\n", path.Path());
throw(1);
Expand Down Expand Up @@ -186,8 +185,7 @@ AddOn::SetTargetOfControlsRecurse(BView* target, BView* view)
if (DebugLevel > 2)
printf("setting target of control %s\n", control->Name());
control->SetTarget(target);
}
else if (DebugLevel > 2)
} else if (DebugLevel > 2)
printf("skipping target for control %s\n", control->Name());
return;
}
Expand Down
3 changes: 2 additions & 1 deletion source/AddOn.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include "Modes.h"
#include <Bitmap.h>

class AddOn {
class AddOn
{
public:
AddOn(BEntry entry);
~AddOn();
Expand Down
15 changes: 5 additions & 10 deletions source/AddOnSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ pixelblend(bgra_pixel d, bgra_pixel s)
if (sa == 255 || !(d & 0xFF)) // Fully opaque
{
res = s;
}
else if (sa == 0) // Fully transparent
} else if (sa == 0) // Fully transparent
{
res = d;
}
else {
} else {
res =
((((d & 0xFF000000) / ta) * da + ((s & 0xFF000000) / ta) * sa) & 0xFF000000) |
((((d & 0x00FF0000) / ta) * da + ((s & 0x00FF0000) / ta) * sa) & 0x00FF0000) |
Expand All @@ -96,12 +94,10 @@ pixelblend(bgra_pixel d, bgra_pixel s)
if (sa == 255 || !(d >> 24)) // Fully opaque
{
res = s;
}
else if (sa == 0) // Fully transparent
} else if (sa == 0) // Fully transparent
{
res = d;
}
else {
} else {
res = ((((d & 0x00FF0000) * da + (s & 0x00FF0000) * sa) / ta) & 0x00FF0000) |
((((d & 0x0000FF00) * da + (s & 0x0000FF00) * sa) / ta) & 0x0000FF00) |
((((d & 0x000000FF) * da + (s & 0x000000FF) * sa) / ta) & 0x000000FF) |
Expand Down Expand Up @@ -197,8 +193,7 @@ contrastingcolor(rgb_color a, rgb_color b)
return (Black);
else
return (White);
}
else
} else
return (Red);
}

Expand Down
3 changes: 2 additions & 1 deletion source/AddOnSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ typedef uint32 bgra_pixel;
typedef uint32 cmyk_pixel;
typedef uint8 grey_pixel;

typedef struct {
typedef struct
{
float hue; // [0,360>
float saturation; // [0,1]
float value; // [0,1]
Expand Down
3 changes: 1 addition & 2 deletions source/AddOnWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ AddOnWindow::MessageReceived(BMessage* msg)
bounds.right = 188;
bounds.bottom += 64;
ResizeTo(bounds.Width(), bounds.Height());
}
else
} else
fprintf(stderr, "AddOnWindow: ADDON_RESIZED but couldn't find config view\n");
break;
}
Expand Down
3 changes: 2 additions & 1 deletion source/AddOnWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#include "BecassoAddOn.h"
#include "Build.h"

class AddOnWindow : public BWindow {
class AddOnWindow : public BWindow
{
public:
AddOnWindow(BRect frame);
virtual ~AddOnWindow();
Expand Down
3 changes: 1 addition & 2 deletions source/AttribBrush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ AttribBrush::mkDiagonalBrush(Brush* b, int dir)
b->Set(d, 0, 64);
b->Set(d, 1, 128);
b->Set(d - 1, 0, 128);
}
else // backward slash
} else // backward slash
{
for (int i = 1; i < d; i++) {
b->Set(i, i, 255);
Expand Down
3 changes: 2 additions & 1 deletion source/AttribBrush.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#define PROP_Y 5
#define PROP_HARDNESS 6

class AttribBrush : public AttribView {
class AttribBrush : public AttribView
{
public:
AttribBrush();
virtual ~AttribBrush();
Expand Down
15 changes: 5 additions & 10 deletions source/AttribCircle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,12 @@ AttribCircle::MessageReceived(BMessage* msg)
pT2->SetValue(B_CONTROL_OFF);
pT3->SetValue(B_CONTROL_OFF);
value = CIRCLE_OUTFILL;
}
else if (!strcasecmp(name, "Filled")) {
} else if (!strcasecmp(name, "Filled")) {
pT1->SetValue(B_CONTROL_OFF);
pT2->SetValue(B_CONTROL_ON);
pT3->SetValue(B_CONTROL_OFF);
value = CIRCLE_FILL;
}
else if (!strcasecmp(name, "Outline")) {
} else if (!strcasecmp(name, "Outline")) {
pT1->SetValue(B_CONTROL_OFF);
pT2->SetValue(B_CONTROL_OFF);
pT3->SetValue(B_CONTROL_ON);
Expand All @@ -261,8 +259,7 @@ AttribCircle::MessageReceived(BMessage* msg)
error.AddInt32("error", B_NO_ERROR);
msg->SendReply(&error);
}
}
else {
} else {
// Error report...
}
}
Expand All @@ -277,8 +274,7 @@ AttribCircle::MessageReceived(BMessage* msg)
pF1->SetValue(B_CONTROL_ON);
pF2->SetValue(B_CONTROL_OFF);
value = FIXES_CENTER;
}
else if (!strcasecmp(name, "Perimeter")) {
} else if (!strcasecmp(name, "Perimeter")) {
pF1->SetValue(B_CONTROL_OFF);
pF2->SetValue(B_CONTROL_ON);
value = FIXES_PERIMETER;
Expand All @@ -290,8 +286,7 @@ AttribCircle::MessageReceived(BMessage* msg)
error.AddInt32("error", B_NO_ERROR);
msg->SendReply(&error);
}
}
else {
} else {
// Error report...
}
}
Expand Down
3 changes: 2 additions & 1 deletion source/AttribCircle.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#define PROP_TYPE 2
#define PROP_FIXPOINT 3

class AttribCircle : public AttribView {
class AttribCircle : public AttribView
{
public:
AttribCircle();
virtual ~AttribCircle();
Expand Down
3 changes: 1 addition & 2 deletions source/AttribClone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ AttribClone::mkDiagonalBrush(Brush* b, int dir)
b->Set(d, 0, 64);
b->Set(d, 1, 128);
b->Set(d - 1, 0, 128);
}
else // backward slash
} else // backward slash
{
for (int i = 1; i < d; i++) {
b->Set(i, i, 255);
Expand Down
3 changes: 2 additions & 1 deletion source/AttribClone.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#define PROP_Y 5
#define PROP_HARDNESS 6

class AttribClone : public AttribView {
class AttribClone : public AttribView
{
public:
AttribClone();
virtual ~AttribClone();
Expand Down
3 changes: 2 additions & 1 deletion source/AttribDraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

#define MAX_LAYERS 32

class AttribDraw : public AttribView {
class AttribDraw : public AttribView
{
public:
AttribDraw();
virtual ~AttribDraw();
Expand Down
9 changes: 3 additions & 6 deletions source/AttribEllipse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,12 @@ AttribEllipse::MessageReceived(BMessage* msg)
pT2->SetValue(B_CONTROL_OFF);
pT3->SetValue(B_CONTROL_OFF);
value = ELLIPSE_OUTFILL;
}
else if (!strcasecmp(name, "Filled")) {
} else if (!strcasecmp(name, "Filled")) {
pT1->SetValue(B_CONTROL_OFF);
pT2->SetValue(B_CONTROL_ON);
pT3->SetValue(B_CONTROL_OFF);
value = ELLIPSE_FILL;
}
else if (!strcasecmp(name, "Outline")) {
} else if (!strcasecmp(name, "Outline")) {
pT1->SetValue(B_CONTROL_OFF);
pT2->SetValue(B_CONTROL_OFF);
pT3->SetValue(B_CONTROL_ON);
Expand All @@ -199,8 +197,7 @@ AttribEllipse::MessageReceived(BMessage* msg)
error.AddInt32("error", B_NO_ERROR);
msg->SendReply(&error);
}
}
else {
} else {
// Error report...
}
}
Expand Down
3 changes: 2 additions & 1 deletion source/AttribEllipse.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#define PROP_PENSIZE 1
#define PROP_TYPE 2

class AttribEllipse : public AttribView {
class AttribEllipse : public AttribView
{
public:
AttribEllipse();
virtual ~AttribEllipse();
Expand Down
6 changes: 2 additions & 4 deletions source/AttribEraser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ AttribEraser::MessageReceived(BMessage* msg)
eT1->SetValue(B_CONTROL_OFF);
eT2->SetValue(B_CONTROL_ON);
value = ERASER_ELLIPSE;
}
else if (!strcasecmp(name, "Rectangle")) {
} else if (!strcasecmp(name, "Rectangle")) {
eT1->SetValue(B_CONTROL_ON);
eT2->SetValue(B_CONTROL_OFF);
value = ERASER_RECT;
Expand All @@ -209,8 +208,7 @@ AttribEraser::MessageReceived(BMessage* msg)
error.AddInt32("error", B_NO_ERROR);
msg->SendReply(&error);
}
}
else {
} else {
// Error report...
}
}
Expand Down
3 changes: 2 additions & 1 deletion source/AttribEraser.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#define PROP_XSIZE 1
#define PROP_YSIZE 3

class AttribEraser : public AttribView {
class AttribEraser : public AttribView
{
public:
AttribEraser();
virtual ~AttribEraser();
Expand Down
6 changes: 2 additions & 4 deletions source/AttribFill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ AttribFill::MessageReceived(BMessage* msg)
if (!strcasecmp(name, "Visual")) {
tol->SetValue(B_CONTROL_ON);
value = FILLTOL_TOL;
}
else if (!strcasecmp(name, "RGB") || !strcasecmp(name, "Absolute")) {
} else if (!strcasecmp(name, "RGB") || !strcasecmp(name, "Absolute")) {
rgb->SetValue(B_CONTROL_ON);
value = FILLTOL_RGB;
}
Expand All @@ -213,8 +212,7 @@ AttribFill::MessageReceived(BMessage* msg)
error.AddInt32("error", B_NO_ERROR);
msg->SendReply(&error);
}
}
else {
} else {
// Error report...
}
}
Expand Down
3 changes: 2 additions & 1 deletion source/AttribFill.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#define PROP_DGREEN 3
#define PROP_DBLUE 4

class AttribFill : public AttribView {
class AttribFill : public AttribView
{
public:
AttribFill();
virtual ~AttribFill();
Expand Down
3 changes: 2 additions & 1 deletion source/AttribFreehand.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

#define PROP_PENSIZE 1

class AttribFreehand : public AttribView {
class AttribFreehand : public AttribView
{
public:
AttribFreehand();
virtual ~AttribFreehand();
Expand Down
3 changes: 2 additions & 1 deletion source/AttribLines.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#define PROP_PENSIZE 1
#define PROP_FILLCORNERS 2

class AttribLines : public AttribView {
class AttribLines : public AttribView
{
public:
AttribLines();
virtual ~AttribLines();
Expand Down
9 changes: 3 additions & 6 deletions source/AttribPolyblob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,12 @@ AttribPolyblob::MessageReceived(BMessage* msg)
pT2->SetValue(B_CONTROL_OFF);
pT3->SetValue(B_CONTROL_OFF);
value = POLYBLOB_OUTFILL;
}
else if (!strcasecmp(name, "Filled")) {
} else if (!strcasecmp(name, "Filled")) {
pT1->SetValue(B_CONTROL_OFF);
pT2->SetValue(B_CONTROL_ON);
pT3->SetValue(B_CONTROL_OFF);
value = POLYBLOB_FILL;
}
else if (!strcasecmp(name, "Outline")) {
} else if (!strcasecmp(name, "Outline")) {
pT1->SetValue(B_CONTROL_OFF);
pT2->SetValue(B_CONTROL_OFF);
pT3->SetValue(B_CONTROL_ON);
Expand All @@ -208,8 +206,7 @@ AttribPolyblob::MessageReceived(BMessage* msg)
error.AddInt32("error", B_NO_ERROR);
msg->SendReply(&error);
}
}
else {
} else {
// Error report...
}
}
Expand Down
Loading

0 comments on commit 3dbdbf7

Please sign in to comment.