[haiku-commits] r42698 - in haiku/trunk: headers/private/shared src/kits/shared

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 28 Aug 2011 12:15:42 +0200 (CEST)

Author: zooey
Date: 2011-08-28 12:15:41 +0200 (Sun, 28 Aug 2011)
New Revision: 42698
Changeset: https://dev.haiku-os.org/changeset/42698

Modified:
   haiku/trunk/headers/private/shared/CalendarView.h
   haiku/trunk/src/kits/shared/CalendarView.cpp
Log:
Minor cleanup: respect 80-chars line length limit

Modified: haiku/trunk/headers/private/shared/CalendarView.h
===================================================================
--- haiku/trunk/headers/private/shared/CalendarView.h   2011-08-27 21:19:56 UTC 
(rev 42697)
+++ haiku/trunk/headers/private/shared/CalendarView.h   2011-08-28 10:15:41 UTC 
(rev 42698)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2008, Haiku, Inc. All Rights Reserved.
+ * Copyright 2007-2011, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  */
 #ifndef _CALENDAR_VIEW_H_
@@ -30,24 +30,32 @@
 class BCalendarView : public BView, public BInvoker {
        public:
                                                                
BCalendarView(BRect frame, const char *name,
-                                                                       uint32 
resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP,
-                                                                       uint32 
flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
+                                                                       uint32 
resizeMask = B_FOLLOW_LEFT
+                                                                               
| B_FOLLOW_TOP,
+                                                                       uint32 
flags = B_WILL_DRAW | B_FRAME_EVENTS
+                                                                               
| B_NAVIGABLE);
 
-                                                               
BCalendarView(BRect frame, const char *name, week_start start,
-                                                                       uint32 
resizeMask = B_FOLLOW_LEFT | B_FOLLOW_TOP,
-                                                                       uint32 
flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
+                                                               
BCalendarView(BRect frame, const char *name,
+                                                                       
week_start start,
+                                                                       uint32 
resizeMask = B_FOLLOW_LEFT
+                                                                               
| B_FOLLOW_TOP,
+                                                                       uint32 
flags = B_WILL_DRAW | B_FRAME_EVENTS
+                                                                               
| B_NAVIGABLE);
 
                                                                
BCalendarView(const char* name,
-                                                                       uint32 
flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
+                                                                       uint32 
flags = B_WILL_DRAW | B_FRAME_EVENTS
+                                                                               
| B_NAVIGABLE);
 
-                                                               
BCalendarView(const char* name, week_start start,
-                                                                       uint32 
flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
+                                                               
BCalendarView(const char* name,
+                                                                       
week_start start, uint32 flags = B_WILL_DRAW
+                                                                               
| B_FRAME_EVENTS | B_NAVIGABLE);
 
                virtual                                 ~BCalendarView();
 
                                                                
BCalendarView(BMessage *archive);
                static BArchivable*             Instantiate(BMessage *archive);
-               virtual status_t                Archive(BMessage *archive, bool 
deep = true) const;
+               virtual status_t                Archive(BMessage *archive,
+                                                                       bool 
deep = true) const;
 
                virtual void                    AttachedToWindow();
                virtual void                    DetachedFromWindow();
@@ -60,11 +68,13 @@
 
                virtual void                    Draw(BRect updateRect);
 
-               virtual void                    DrawDay(BView *owner, BRect 
frame, const char *text,
-                                                                       bool 
isSelected = false, bool isEnabled = true,
-                                                                       bool 
focus = false);
-               virtual void                    DrawDayName(BView *owner, BRect 
frame, const char *text);
-               virtual void                    DrawWeekNumber(BView *owner, 
BRect frame, const char *text);
+               virtual void                    DrawDay(BView *owner, BRect 
frame,
+                                                                       const 
char *text, bool isSelected = false,
+                                                                       bool 
isEnabled = true, bool focus = false);
+               virtual void                    DrawDayName(BView *owner, BRect 
frame,
+                                                                       const 
char *text);
+               virtual void                    DrawWeekNumber(BView *owner, 
BRect frame,
+                                                                       const 
char *text);
 
                virtual void                    MessageReceived(BMessage 
*message);
 
@@ -88,7 +98,8 @@
                virtual void                    KeyDown(const char *bytes, 
int32 numBytes);
 
                virtual BHandler*               ResolveSpecifier(BMessage 
*message, int32 index,
-                                                                       
BMessage *specifier, int32 form, const char *property);
+                                                                       
BMessage *specifier, int32 form,
+                                                                       const 
char *property);
                virtual status_t                GetSupportedSuites(BMessage 
*data);
                virtual status_t                Perform(perform_code code, 
void* arg);
 
@@ -133,10 +144,11 @@
                void                                    _DrawWeekHeader();
                void                                    _DrawDay(int32 curRow, 
int32 curColumn,
                                                                        int32 
row, int32 column, int32 counter,
-                                                                       BRect 
frame, const char *text, bool focus = false);
-               void                                    _DrawItem(BView *owner, 
BRect frame, const char *text,
-                                                                       bool 
isSelected = false, bool isEnabled = true,
+                                                                       BRect 
frame, const char *text,
                                                                        bool 
focus = false);
+               void                                    _DrawItem(BView *owner, 
BRect frame,
+                                                                       const 
char *text, bool isSelected = false,
+                                                                       bool 
isEnabled = true, bool focus = false);
 
                void                                    _UpdateSelection();
                BRect                                   
_FirstCalendarItemFrame() const;
@@ -157,13 +169,23 @@
                                                                        int32 
column;
 
                                                                        
Selection& operator=(const Selection &s)
-                                                                       { row = 
s.row; column = s.column; return *this; }
+                                                                       {
+                                                                               
row = s.row;
+                                                                               
column = s.column;
+                                                                               
return *this;
+                                                                       }
 
                                                                        bool 
operator==(const Selection &s) const
-                                                                       { 
return row == s.row && column == s.column; }
+                                                                       {
+                                                                               
return row == s.row
+                                                                               
        && column == s.column;
+                                                                       }
 
                                                                        bool 
operator!=(const Selection &s) const
-                                                                       { 
return row != s.row || column != s.column; }
+                                                                       {
+                                                                               
return row != s.row
+                                                                               
        || column != s.column;
+                                                                       }
                                                                };
                BRect                                   _RectOfDay(const 
Selection &selection) const;
 

Modified: haiku/trunk/src/kits/shared/CalendarView.cpp
===================================================================
--- haiku/trunk/src/kits/shared/CalendarView.cpp        2011-08-27 21:19:56 UTC 
(rev 42697)
+++ haiku/trunk/src/kits/shared/CalendarView.cpp        2011-08-28 10:15:41 UTC 
(rev 42698)
@@ -478,7 +478,8 @@
 
 
 void
-BCalendarView::MouseMoved(BPoint point, uint32 code, const BMessage 
*dragMessage)
+BCalendarView::MouseMoved(BPoint point, uint32 code,
+       const BMessage *dragMessage)
 {
        BView::MouseMoved(point, code, dragMessage);
 }
@@ -806,7 +807,8 @@
        for (int32 row = 0; row < 6; ++row) {
                for (int32 column = 0; column < 7; ++column) {
                        int32 day = counter - (firstDay - 1);
-                       if (counter >= firstDay && counter <= dayCountCurrent + 
firstDay - 1) {
+                       if (counter >= firstDay
+                               && counter <= dayCountCurrent + firstDay - 1) {
                                if (day == fDay) {
                                        fNewFocusedDay.SetTo(row, column);
                                        fNewSelectedDay.SetTo(row, column);
@@ -845,7 +847,8 @@
        int32 counter = 0;
        for (int32 row = 0; row < 6; ++row) {
                for (int32 column = 0; column < 7; ++column) {
-                       if (counter < firstDay || counter > dayCountCurrent + 
firstDay - 1) {
+                       if (counter < firstDay
+                               || counter > dayCountCurrent + firstDay - 1) {
                                if (counter - firstDay < 0) {
                                        if (row == currRow && column == 
currColumn) {
                                                *year = date.Year();
@@ -954,7 +957,8 @@
        for (int32 row = 0; row < 6; ++row) {
                for (int32 column = 0; column < 7; ++column) {
                        int32 day = counter - (firstDay - 1);
-                       if (counter < firstDay || counter > dayCountCurrent + 
firstDay - 1) {
+                       if (counter < firstDay
+                               || counter > dayCountCurrent + firstDay - 1) {
                                if (counter - firstDay < 0)
                                        day += lastDayBefore;
                                else
@@ -997,8 +1001,8 @@
 
 
 void
-BCalendarView::_DrawDay(int32 currRow, int32 currColumn, int32 row, int32 
column,
-       int32 counter, BRect frame, const char *text, bool focus)
+BCalendarView::_DrawDay(int32 currRow, int32 currColumn, int32 row,
+       int32 column, int32 counter, BRect frame, const char *text, bool focus)
 {
        const BDate date(fYear, fMonth, 1);
        const int32 daysMonth = date.DaysInMonth();
@@ -1044,7 +1048,8 @@
                        counter++;
                        const char *day = fDayNumbers[row][column].String();
                        bool focus = isFocus && focusRow == row && focusColumn 
== column;
-                       _DrawDay(currRow, currColumn, row, column, counter, 
tmp, day, focus);
+                       _DrawDay(currRow, currColumn, row, column, counter, 
tmp, day,
+                               focus);
 
                        tmp.OffsetBy(tmp.Width(), 0.0);
                }
@@ -1074,11 +1079,13 @@
 
                                bool focus = IsFocus() && true;
                                const char *day = 
fDayNumbers[row][column].String();
-                               _DrawDay(currRow, currColumn, row, column, 
counter, tmp, day, focus);
+                               _DrawDay(currRow, currColumn, row, column, 
counter, tmp, day,
+                                       focus);
                        }
                        else if (focusRow == row && focusColumn == column) {
                                const char *day = 
fDayNumbers[row][column].String();
-                               _DrawDay(currRow, currColumn, row, column, 
counter, tmp, day, false);
+                               _DrawDay(currRow, currColumn, row, column, 
counter, tmp, day,
+                                       false);
                        }
                        tmp.OffsetBy(tmp.Width(), 0.0);
                }
@@ -1198,16 +1205,19 @@
                BRect tmp = frame;
                for (int32 column = 0; column < 7; ++column) {
                        counter++;
-                       if (fNewSelectedDay.row == row && 
fNewSelectedDay.column == column) {
+                       if (fNewSelectedDay.row == row
+                               && fNewSelectedDay.column == column) {
                                fSelectedDay.SetTo(row, column);
 
                                const char *day = 
fDayNumbers[row][column].String();
-                               bool focus = IsFocus() && focusRow == row && 
focusColumn == column;
+                               bool focus = IsFocus() && focusRow == row
+                                       && focusColumn == column;
                                _DrawDay(row, column, row, column, counter, 
tmp, day, focus);
                        }
                        else if (currRow == row && currColumn == column) {
                                const char *day = 
fDayNumbers[row][column].String();
-                               bool focus = IsFocus() && focusRow == row && 
focusColumn == column;
+                               bool focus = IsFocus() && focusRow == row
+                                       && focusColumn == column;
                                _DrawDay(currRow, currColumn, -1, -1, counter, 
tmp, day, focus);
                        }
                        tmp.OffsetBy(tmp.Width(), 0.0);


Other related posts:

  • » [haiku-commits] r42698 - in haiku/trunk: headers/private/shared src/kits/shared - zooey