[haiku-commits] r37792 - haiku/trunk/src/preferences/time

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 28 Jul 2010 18:26:54 +0200 (CEST)

Author: zooey
Date: 2010-07-28 18:26:53 +0200 (Wed, 28 Jul 2010)
New Revision: 37792
Changeset: http://dev.haiku-os.org/changeset/37792

Modified:
   haiku/trunk/src/preferences/time/AnalogClock.cpp
   haiku/trunk/src/preferences/time/AnalogClock.h
   haiku/trunk/src/preferences/time/BaseView.cpp
   haiku/trunk/src/preferences/time/BaseView.h
   haiku/trunk/src/preferences/time/Bitmaps.cpp
   haiku/trunk/src/preferences/time/Bitmaps.h
   haiku/trunk/src/preferences/time/DateTimeEdit.cpp
   haiku/trunk/src/preferences/time/DateTimeEdit.h
   haiku/trunk/src/preferences/time/DateTimeView.cpp
   haiku/trunk/src/preferences/time/DateTimeView.h
   haiku/trunk/src/preferences/time/SectionEdit.cpp
   haiku/trunk/src/preferences/time/SectionEdit.h
   haiku/trunk/src/preferences/time/TZDisplay.cpp
   haiku/trunk/src/preferences/time/TZDisplay.h
   haiku/trunk/src/preferences/time/Time.cpp
   haiku/trunk/src/preferences/time/Time.h
   haiku/trunk/src/preferences/time/Time.rdef
   haiku/trunk/src/preferences/time/TimeMessages.h
   haiku/trunk/src/preferences/time/TimeSettings.h
   haiku/trunk/src/preferences/time/TimeWindow.cpp
   haiku/trunk/src/preferences/time/TimeWindow.h
   haiku/trunk/src/preferences/time/TimeZoneListItem.h
   haiku/trunk/src/preferences/time/ZoneView.cpp
   haiku/trunk/src/preferences/time/ZoneView.h
Log:
Cleanup, no functional change
* coding style adjustements
* fixed all warnings

Modified: haiku/trunk/src/preferences/time/AnalogClock.cpp
===================================================================
--- haiku/trunk/src/preferences/time/AnalogClock.cpp    2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/AnalogClock.cpp    2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -26,11 +26,11 @@
 
 class OffscreenClock : public BView {
 public:
-                                                       OffscreenClock(BRect 
frame, const char *name);
+                                                       OffscreenClock(BRect 
frame, const char* name);
        virtual                                 ~OffscreenClock();
 
                        void                    SetTime(int32 hour, int32 
minute, int32 second);
-                       void                    GetTime(int32 *hour, int32 
*minute, int32 *second);
+                       void                    GetTime(int32* hour, int32* 
minute, int32* second);
                        bool                    IsDirty() const {       return 
fDirty;  }
                        void                    DrawClock();
 
@@ -65,7 +65,7 @@
 };
 
 
-OffscreenClock::OffscreenClock(BRect frame, const char *name)
+OffscreenClock::OffscreenClock(BRect frame, const char* name)
        :
        BView(frame, name, B_FOLLOW_NONE, B_WILL_DRAW),
        fHours(0),
@@ -108,7 +108,7 @@
 
 
 void
-OffscreenClock::GetTime(int32 *hour, int32 *minute, int32 *second)
+OffscreenClock::GetTime(int32* hour, int32* minute, int32* second)
 {
        *hour = fHours;
        *minute = fMinutes;
@@ -359,7 +359,7 @@
 //     #pragma mark -
 
 
-TAnalogClock::TAnalogClock(BRect frame, const char *name)
+TAnalogClock::TAnalogClock(BRect frame, const char* name)
        :
        BView(frame, name, B_FOLLOW_NONE, B_WILL_DRAW | B_DRAW_ON_CHILDREN),
        fBitmap(NULL),
@@ -397,7 +397,7 @@
 
 
 void
-TAnalogClock::MessageReceived(BMessage *message)
+TAnalogClock::MessageReceived(BMessage* message)
 {
        int32 change;
        switch (message->what) {
@@ -468,7 +468,7 @@
 
 
 void
-TAnalogClock::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
+TAnalogClock::MouseMoved(BPoint point, uint32 transit, const BMessage* message)
 {
 
        if (fDraggingMinuteHand)

Modified: haiku/trunk/src/preferences/time/AnalogClock.h
===================================================================
--- haiku/trunk/src/preferences/time/AnalogClock.h      2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/AnalogClock.h      2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -1,13 +1,13 @@
 /*
- * Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
  *             Mike Berg <mike@xxxxxxxxxxx>
  *             Julun <host.haiku@xxxxxx>
  */
-#ifndef ANALOG_CLOCK_H
-#define ANALOG_CLOCK_H
+#ifndef _ANALOG_CLOCK_H
+#define _ANALOG_CLOCK_H
 
 
 #include <View.h>
@@ -18,32 +18,34 @@
 
 
 class TAnalogClock : public BView {
-       public:
-                                               TAnalogClock(BRect frame, const 
char *name);
-               virtual                 ~TAnalogClock();
+public:
+                                                               
TAnalogClock(BRect frame, const char* name);
+       virtual                                         ~TAnalogClock();
 
-               virtual void    AttachedToWindow();             
-               virtual void    Draw(BRect updateRect);
-               virtual void    MessageReceived(BMessage *message);
-               virtual void    MouseDown(BPoint point);
-               virtual void    MouseUp(BPoint point);
-               virtual void    MouseMoved(BPoint point, uint32 transit, const 
BMessage *message);
+       virtual void                            AttachedToWindow();
+       virtual void                            Draw(BRect updateRect);
+       virtual void                            MessageReceived(BMessage* 
message);
+       virtual void                            MouseDown(BPoint point);
+       virtual void                            MouseUp(BPoint point);
+       virtual void                            MouseMoved(BPoint point, uint32 
transit,
+                                                                       const 
BMessage* message);
 
-               void                    SetTime(int32 hour, int32 minute, int32 
second);
+                       void                            SetTime(int32 hour, 
int32 minute, int32 second);
 
-               bool                    IsChangingTime() {      return 
fTimeChangeIsOngoing;    }
-               void                    ChangeTimeFinished();
-       private:
-               void                    _InitView(BRect frame);
+                       bool                            IsChangingTime()
+                                                                       {       
return fTimeChangeIsOngoing;    }
+                       void                            ChangeTimeFinished();
+private:
+                       void                            _InitView(BRect frame);
 
-               BBitmap                 *fBitmap;
-               OffscreenClock  *fClock;
+                       BBitmap*                        fBitmap;
+                       OffscreenClock*         fClock;
 
-               bool                    fDraggingHourHand;
-               bool                    fDraggingMinuteHand;
+                       bool                            fDraggingHourHand;
+                       bool                            fDraggingMinuteHand;
 
-               bool                    fTimeChangeIsOngoing;
+                       bool                            fTimeChangeIsOngoing;
 };
 
-#endif // ANALOG_CLOCK_H
 
+#endif // _ANALOG_CLOCK_H

Modified: haiku/trunk/src/preferences/time/BaseView.cpp
===================================================================
--- haiku/trunk/src/preferences/time/BaseView.cpp       2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/BaseView.cpp       2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -15,7 +15,7 @@
 #include <OS.h>
 
 
-TTimeBaseView::TTimeBaseView(BRect frame, const char *name)
+TTimeBaseView::TTimeBaseView(BRect frame, const char* name)
        : BView(frame, name, B_FOLLOW_NONE, B_PULSE_NEEDED),
          fMessage(H_TIME_UPDATE)
 {
@@ -43,7 +43,7 @@
 
 
 void
-TTimeBaseView::ChangeTime(BMessage *message)
+TTimeBaseView::ChangeTime(BMessage* message)
 {
        bool isTime;
        if (message->FindBool("time", &isTime) != B_OK)

Modified: haiku/trunk/src/preferences/time/BaseView.h
===================================================================
--- haiku/trunk/src/preferences/time/BaseView.h 2010-07-28 15:24:12 UTC (rev 
37791)
+++ haiku/trunk/src/preferences/time/BaseView.h 2010-07-28 16:26:53 UTC (rev 
37792)
@@ -1,13 +1,13 @@
 /*
- * Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
  *             Mike Berg <mike@xxxxxxxxxxx>
  *             Julun <host.haiku@xxxxxx>
  */
-#ifndef TIMEBASE_H
-#define TIMEBASE_H
+#ifndef _BASE_VIEW_H
+#define _BASE_VIEW_H
 
 
 #include <Message.h>
@@ -15,21 +15,21 @@
 
 
 class TTimeBaseView: public BView {
-       public:
-                                               TTimeBaseView(BRect frame, 
const char *name);
-               virtual                 ~TTimeBaseView();
-               
-               virtual void    Pulse();
-               virtual void    AttachedToWindow();
+public:
+                                                               
TTimeBaseView(BRect frame, const char* name);
+       virtual                                         ~TTimeBaseView();
 
-               void                    ChangeTime(BMessage *message);
+       virtual void                            Pulse();
+       virtual void                            AttachedToWindow();
 
-       private:
-               void                    _SendNotices();
+                       void                            ChangeTime(BMessage* 
message);
 
-       private:
-               BMessage                fMessage;
+private:
+                       void                            _SendNotices();
+
+private:
+                       BMessage                        fMessage;
 };
 
-#endif // TIMEBASE_H
 
+#endif // _BASE_VIEW_H

Modified: haiku/trunk/src/preferences/time/Bitmaps.cpp
===================================================================
--- haiku/trunk/src/preferences/time/Bitmaps.cpp        2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/Bitmaps.cpp        2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -16,18 +16,18 @@
 #include <Screen.h>
 
 
-void 
-ReplaceTransparentColor(BBitmap *bitmap, rgb_color with)
+void
+ReplaceTransparentColor(BBitmap* bitmap, rgb_color with)
 {
        // other color spaces not implemented yet
        ASSERT(bitmap->ColorSpace() == B_COLOR_8_BIT);
-       
+
        BScreen screen(B_MAIN_SCREEN_ID);
-       uint32 withIndex = screen.IndexForColor(with); 
-       
-       uchar *bits = (uchar *)bitmap->Bits();
-       int32 bitsLength = bitmap->BitsLength();        
-       for (int32 index = 0; index < bitsLength; index++) 
+       uint32 withIndex = screen.IndexForColor(with);
+
+       uchar* bits = (uchar*)bitmap->Bits();
+       int32 bitsLength = bitmap->BitsLength();
+       for (int32 index = 0; index < bitsLength; index++)
                if (bits[index] == B_TRANSPARENT_8_BIT)
                        bits[index] = withIndex;
 }

Modified: haiku/trunk/src/preferences/time/Bitmaps.h
===================================================================
--- haiku/trunk/src/preferences/time/Bitmaps.h  2010-07-28 15:24:12 UTC (rev 
37791)
+++ haiku/trunk/src/preferences/time/Bitmaps.h  2010-07-28 16:26:53 UTC (rev 
37792)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -8,14 +8,14 @@
  *             Julun <host.haiku@xxxxxx>
  *
  */
-#ifndef ANALOG_CLOCK_H
-#define ANALOG_CLOCK_H
+#ifndef _BITMAPS_H
+#define _BITMAPS_H
 
 
 #include <Bitmap.h>
 
 
-void ReplaceTransparentColor(BBitmap *bitmap, rgb_color with);
+void ReplaceTransparentColor(BBitmap* bitmap, rgb_color with);
 
 const int32 kUpArrowWidth = 16;
 const int32 kUpArrowHeight = 7;
@@ -45,5 +45,6 @@
        
0xff,0xff,0xff,0xff,0xff,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0x18,0x3f,0xff,0xff
 };
 
-#endif // ANALOG_CLOCK_H
 
+#endif // _BITMAPS_H
+

Modified: haiku/trunk/src/preferences/time/DateTimeEdit.cpp
===================================================================
--- haiku/trunk/src/preferences/time/DateTimeEdit.cpp   2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/DateTimeEdit.cpp   2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -87,7 +87,7 @@
 void
 TTimeEdit::DrawSection(uint32 index, bool hasFocus)
 {
-       TSection *section = NULL;
+       TSection* section = NULL;
        section = static_cast<TSection*> (fSectionList->ItemAt(index));
 
        if (!section)
@@ -110,7 +110,7 @@
        country->FormatTime(&text, fieldPositions, fieldCount, time, true);
                // TODO : this should be cached somehow to not redo it for each 
field
 
-       if (index * 2 + 1 > fieldCount) {
+       if (index * 2 + 1 > (uint32)fieldCount) {
                free(fieldPositions);
                return;
        }
@@ -135,7 +135,7 @@
 void
 TTimeEdit::DrawSeparator(uint32 index)
 {
-       TSection *section = NULL;
+       TSection* section = NULL;
        section = static_cast<TSection*> (fSectionList->ItemAt(index));
 
        if (!section)
@@ -154,7 +154,7 @@
        country->FormatTime(&text, fieldPositions, fieldCount, time, true);
                // TODO : this should be cached somehow to not redo it for each 
field
 
-       if (index * 2 + 2 > fieldCount) {
+       if (index * 2 + 2 > (uint32)fieldCount) {
                free(fieldPositions);
                return;
        }
@@ -257,9 +257,9 @@
 
 
 void
-TTimeEdit::BuildDispatch(BMessage *message)
+TTimeEdit::BuildDispatch(BMessage* message)
 {
-       const char *fields[3] = { "hour", "minute", "second" };
+       const char* fields[3] = { "hour", "minute", "second" };
 
        message->AddBool("time", true);
 
@@ -445,7 +445,7 @@
 //     #pragma mark -
 
 
-TDateEdit::TDateEdit(BRect frame, const char *name, uint32 sections)
+TDateEdit::TDateEdit(BRect frame, const char* name, uint32 sections)
        : TSectionEdit(frame, name, sections)
 {
        InitView();
@@ -484,7 +484,7 @@
        }
 
        // if year add 2000
-       
+
        BDateElement* dateFormat;
        int fieldCount;
        BCountry* here;
@@ -523,7 +523,7 @@
 void
 TDateEdit::DrawSection(uint32 index, bool hasFocus)
 {
-       TSection *section = NULL;
+       TSection* section = NULL;
        section = static_cast<TSection*> (fSectionList->ItemAt(index));
 
        if (!section)
@@ -547,7 +547,7 @@
                false);
                // TODO : this should be cached somehow to not redo it for each 
field
 
-       if (index * 2 + 1 > fieldCount) {
+       if (index * 2 + 1 > (uint32)fieldCount) {
                free(fieldPositions);
                return;
        }
@@ -575,7 +575,7 @@
        if (index == 3)
                return;
 
-       TSection *section = NULL;
+       TSection* section = NULL;
        section = static_cast<TSection*> (fSectionList->ItemAt(index));
        BRect bounds = section->Frame();
 
@@ -594,7 +594,7 @@
                false);
                // TODO : this should be cached somehow to not redo it for each 
field
 
-       if (index * 2 + 2 > fieldCount) {
+       if (index * 2 + 2 > (uint32)fieldCount) {
                free(fieldPositions);
                return;
        }
@@ -625,7 +625,7 @@
        float sepWidth = SeparatorWidth();
 
        // year
-       TSection *section = NULL;
+       TSection* section = NULL;
        float width = be_plain_font->StringWidth("0000") +6;
        bounds.right = area.right;
        bounds.left = bounds.right -width;
@@ -708,9 +708,9 @@
 
 
 void
-TDateEdit::BuildDispatch(BMessage *message)
+TDateEdit::BuildDispatch(BMessage* message)
 {
-       const char *fields[3] = { "month", "day", "year" };
+       const char* fields[3] = { "month", "day", "year" };
 
        message->AddBool("time", false);
 

Modified: haiku/trunk/src/preferences/time/DateTimeEdit.h
===================================================================
--- haiku/trunk/src/preferences/time/DateTimeEdit.h     2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/DateTimeEdit.h     2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -8,8 +8,8 @@
  *             Julun <host.haiku@xxxxxx>
  *
  */
-#ifndef DATETIME_H
-#define DATETIME_H
+#ifndef _DATE_TIME_EDIT_H
+#define _DATE_TIME_EDIT_H
 
 
 #include "SectionEdit.h"
@@ -19,36 +19,37 @@
 
 
 class TTimeEdit : public TSectionEdit {
-       public:
-                                               TTimeEdit(BRect frame, const 
char *name,
-                                                       uint32 sections);
-               virtual                 ~TTimeEdit();
-               virtual void    KeyDown(const char* bytes, int32 numBytes);
+public:
+                                                               TTimeEdit(BRect 
frame, const char* name,
+                                                                       uint32 
sections);
+       virtual                                         ~TTimeEdit();
 
-               virtual void    InitView();
-               virtual void    DrawSection(uint32 index, bool isfocus);
-               virtual void    DrawSeparator(uint32 index);
+       virtual void                            KeyDown(const char* bytes, 
int32 numBytes);
 
-               virtual void    SetSections(BRect area);
-               virtual void    SectionFocus(uint32 index);
-               virtual float   SeparatorWidth() const;
+       virtual void                            InitView();
+       virtual void                            DrawSection(uint32 index, bool 
isfocus);
+       virtual void                            DrawSeparator(uint32 index);
 
-               virtual void    DoUpPress();
-               virtual void    DoDownPress();
+       virtual void                            SetSections(BRect area);
+       virtual void                            SectionFocus(uint32 index);
+       virtual float                           SeparatorWidth() const;
 
-               virtual void    BuildDispatch(BMessage *message);
+       virtual void                            DoUpPress();
+       virtual void                            DoDownPress();
 
-               void                    SetTime(int32 hour, int32 minute, int32 
second);
+       virtual void                            BuildDispatch(BMessage* 
message);
 
-       private:
-               void                    _CheckRange();
-               bool                    _IsValidDoubleDigi(int32 value);
-               int32                   _SectionValue(int32 index) const;
+                       void                            SetTime(int32 hour, 
int32 minute, int32 second);
 
-       private:
-               BDateTime               fTime;
-               bigtime_t               fLastKeyDownTime;
-               int32                   fLastKeyDownInt;
+private:
+                       void                            _CheckRange();
+                       bool                            
_IsValidDoubleDigi(int32 value);
+                       int32                           _SectionValue(int32 
index) const;
+
+private:
+                       BDateTime               fTime;
+                       bigtime_t               fLastKeyDownTime;
+                       int32                   fLastKeyDownInt;
 };
 
 
@@ -85,5 +86,5 @@
                int32                   fLastKeyDownInt;
 };
 
-#endif // DATETIME_H
+#endif // _DATE_TIME_EDIT_H
 

Modified: haiku/trunk/src/preferences/time/DateTimeView.cpp
===================================================================
--- haiku/trunk/src/preferences/time/DateTimeView.cpp   2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/DateTimeView.cpp   2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -39,7 +39,7 @@
 #ifdef HAIKU_TARGET_PLATFORM_HAIKU
 #      include <syscalls.h>
 #else
-extern "C" void _kset_tzfilename_(const char *name, size_t length, bool isGMT);
+extern "C" void _kset_tzfilename_(const char* name, size_t length, bool isGMT);
 #      define _kern_set_tzfilename _kset_tzfilename_
 #endif
 
@@ -105,7 +105,7 @@
 
 
 void
-DateTimeView::MessageReceived(BMessage *message)
+DateTimeView::MessageReceived(BMessage* message)
 {
        int32 change;
        switch (message->what) {
@@ -249,7 +249,7 @@
 
        // clock radio buttons
        bounds.top = fClock->Frame().bottom + 10.0;
-       BStringView *text = new BStringView(bounds, "clockSetTo", "Clock set 
to:");
+       BStringView* text = new BStringView(bounds, "clockSetTo", "Clock set 
to:");
        AddChild(text);
        text->ResizeToPreferred();
 
@@ -342,7 +342,7 @@
 
 
 void
-DateTimeView::_UpdateDateTime(BMessage *message)
+DateTimeView::_UpdateDateTime(BMessage* message)
 {
        int32 day;
        int32 month;

Modified: haiku/trunk/src/preferences/time/DateTimeView.h
===================================================================
--- haiku/trunk/src/preferences/time/DateTimeView.h     2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/DateTimeView.h     2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -8,8 +8,8 @@
  *             Julun <host.haiku@xxxxxx>
  *             Philippe Saint-Pierre <stpere@xxxxxxxxx>
  */
-#ifndef DATE_TIME_VIEW_H
-#define DATE_TIME_VIEW_H
+#ifndef _DATE_TIME_VIEW_H
+#define _DATE_TIME_VIEW_H
 
 
 #include <View.h>
@@ -28,41 +28,41 @@
 
 
 class DateTimeView : public BView {
-       public:
-                                               DateTimeView(BRect frame);
-               virtual                 ~DateTimeView();
+public:
+                                                               
DateTimeView(BRect frame);
+       virtual                                         ~DateTimeView();
 
-               virtual void    AttachedToWindow();
-               virtual void    Draw(BRect updaterect);
-               virtual void    MessageReceived(BMessage *message);
+       virtual void                            AttachedToWindow();
+       virtual void                            Draw(BRect updaterect);
+       virtual void                            MessageReceived(BMessage* 
message);
 
-               bool                    CheckCanRevert();
-               bool                    GetUseGmtTime();
+                       bool                            CheckCanRevert();
+                       bool                            GetUseGmtTime();
 
-       private:
-               void                    _InitView();
-               void                    _ReadRTCSettings();
-               void                    _WriteRTCSettings();
-               void                    _UpdateGmtSettings();
-               void                    _UpdateDateTime(BMessage *message);
-               void                    _Revert();
-               time_t                  _PrefletUptime() const;
+private:
+                       void                            _InitView();
+                       void                            _ReadRTCSettings();
+                       void                            _WriteRTCSettings();
+                       void                            _UpdateGmtSettings();
+                       void                            
_UpdateDateTime(BMessage* message);
+                       void                            _Revert();
+                       time_t                          _PrefletUptime() const;
 
-       private:
-               BRadioButton    *fLocalTime;
-               BRadioButton    *fGmtTime;
-               TDateEdit               *fDateEdit;
-               TTimeEdit               *fTimeEdit;
-               BCalendarView   *fCalendarView;
-               TAnalogClock    *fClock;
+private:
+                       BRadioButton*           fLocalTime;
+                       BRadioButton*           fGmtTime;
+                       TDateEdit*                      fDateEdit;
+                       TTimeEdit*                      fTimeEdit;
+                       BCalendarView*          fCalendarView;
+                       TAnalogClock*           fClock;
 
-               bool                    fUseGmtTime;
-               bool                    fOldUseGmtTime;
-               bool                    fInitialized;
+                       bool                            fUseGmtTime;
+                       bool                            fOldUseGmtTime;
+                       bool                            fInitialized;
 
-               time_t                  fTimeAtStart;
-               bigtime_t               fSystemTimeAtStart;
+                       time_t                          fTimeAtStart;
+                       bigtime_t                       fSystemTimeAtStart;
 };
 
-#endif // DATE_TIME_VIEW_H
 
+#endif // _DATE_TIME_VIEW_H

Modified: haiku/trunk/src/preferences/time/SectionEdit.cpp
===================================================================
--- haiku/trunk/src/preferences/time/SectionEdit.cpp    2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/SectionEdit.cpp    2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -18,10 +18,39 @@
 #include "TimeMessages.h"
 
 
+TSection::TSection(BRect frame)
+       :
+       fFrame(frame)
+{
+}
+
+
+BRect
+TSection::Bounds() const
+{
+       BRect frame(fFrame);
+       return frame.OffsetByCopy(B_ORIGIN);
+}
+
+
+void
+TSection::SetFrame(BRect frame)
+{
+       fFrame = frame;
+}
+
+
+BRect
+TSection::Frame() const
+{
+       return fFrame;
+}
+
+
 const uint32 kArrowAreaWidth = 16;
 
 
-TSectionEdit::TSectionEdit(BRect frame, const char *name, uint32 sections)
+TSectionEdit::TSectionEdit(BRect frame, const char* name, uint32 sections)
        :
        BControl(frame, name, NULL, NULL, B_FOLLOW_NONE, B_NAVIGABLE | 
B_WILL_DRAW),
        fSectionList(NULL),
@@ -74,9 +103,9 @@
        else if (fDownRect.Contains(where))
                DoDownPress();
        else if (fSectionList->CountItems()> 0) {
-               TSection *section;
+               TSection* section;
                for (uint32 idx = 0; idx < fSectionCount; idx++) {
-                       section = (TSection *)fSectionList->ItemAt(idx);
+                       section = (TSection*)fSectionList->ItemAt(idx);
                        if (section->Frame().Contains(where)) {
                                SectionFocus(idx);
                                return;
@@ -102,7 +131,7 @@
 
 
 void
-TSectionEdit::KeyDown(const char *bytes, int32 numbytes)
+TSectionEdit::KeyDown(const char* bytes, int32 numbytes)
 {
        if (fFocus == -1)
                SectionFocus(0);

Modified: haiku/trunk/src/preferences/time/SectionEdit.h
===================================================================
--- haiku/trunk/src/preferences/time/SectionEdit.h      2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/SectionEdit.h      2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -7,8 +7,8 @@
  *             Julun <host.haiku@xxxxxx>
  *
  */
-#ifndef SECTIONEDIT_H
-#define SECTIONEDIT_H
+#ifndef _SECTION_EDIT_H
+#define _SECTION_EDIT_H
 
 
 #include <Control.h>
@@ -19,75 +19,66 @@
 
 
 class TSection {
-       public:
-                               TSection(BRect frame)
-                                       : fFrame(frame) {}
+public:
+                                                               TSection(BRect 
frame);
 
-               BRect   Bounds() const
-                               {
-                                       BRect frame(fFrame);
-                                       return frame.OffsetByCopy(B_ORIGIN);
-                               }
+                       BRect                           Bounds() const;
+                       void                            SetFrame(BRect frame);
+                       BRect                           Frame() const;
 
-               void    SetFrame(BRect frame)
-                               {       fFrame = frame; }
-
-               BRect   Frame() const
-                               {       return fFrame;  }
-
-       private:
-               BRect   fFrame;
+private:
+                       BRect                           fFrame;
 };
 
 
 class TSectionEdit: public BControl {
-       public:
-                                               TSectionEdit(BRect frame, const 
char *name,
-                                                       uint32 sections);
-               virtual                 ~TSectionEdit();
+public:
+                                                               
TSectionEdit(BRect frame, const char* name,
+                                                                       uint32 
sections);
+       virtual                                         ~TSectionEdit();
 
-               virtual void    AttachedToWindow();
-               virtual void    Draw(BRect updateRect);
-               virtual void    MouseDown(BPoint point);
-               virtual void    MakeFocus(bool focused = true);
-               virtual void    KeyDown(const char *bytes, int32 numBytes);
+       virtual void                            AttachedToWindow();
+       virtual void                            Draw(BRect updateRect);
+       virtual void                            MouseDown(BPoint point);
+       virtual void                            MakeFocus(bool focused = true);
+       virtual void                            KeyDown(const char* bytes, 
int32 numBytes);
 
-               uint32                  CountSections() const;
-               int32                   FocusIndex() const;
-               BRect                   SectionArea() const;
+       uint32                                          CountSections() const;
+       int32                                           FocusIndex() const;
+       BRect                                           SectionArea() const;
 
-       protected:
-               virtual void    InitView();
+protected:
+       virtual void                            InitView();
 
-               // hooks
-               virtual void    DrawBorder(const BRect& updateRect);
-               virtual void    DrawSection(uint32 index, bool isFocus) {}
-               virtual void    DrawSeparator(uint32 index) {}
+       // hooks
+       virtual void                            DrawBorder(const BRect& 
updateRect);
+       virtual void                            DrawSection(uint32 index, bool 
isFocus) {}
+       virtual void                            DrawSeparator(uint32 index) {}
 
-               virtual void    SectionFocus(uint32 index) {}
-               virtual void    SectionChange(uint32 index, uint32 value) {}
-               virtual void    SetSections(BRect area) {}
-               virtual float   SeparatorWidth() const;
+       virtual void                            SectionFocus(uint32 index) {}
+       virtual void                            SectionChange(uint32 index, 
uint32 value) {}
+       virtual void                            SetSections(BRect area) {}
+       virtual float                           SeparatorWidth() const;
 
-               virtual void    DoUpPress() {}
-               virtual void    DoDownPress() {}
+       virtual void                            DoUpPress() {}
+       virtual void                            DoDownPress() {}
 
-               virtual void    DispatchMessage();
-               virtual void    BuildDispatch(BMessage *message) = 0;
+       virtual void                            DispatchMessage();
+       virtual void                            BuildDispatch(BMessage* 
message) = 0;
 
-       protected:
-               BList                   *fSectionList;
+protected:
+                       BList*                          fSectionList;
 
-               BRect                   fUpRect;
-               BRect                   fDownRect;
-               BRect                   fSectionArea;
+                       BRect                           fUpRect;
+                       BRect                           fDownRect;
+                       BRect                           fSectionArea;
 
-               int32                   fFocus;
-               uint32                  fSectionCount;
-               uint32                  fHoldValue;
+                       int32                           fFocus;
+                       uint32                          fSectionCount;
+                       uint32                          fHoldValue;
 
-               bool                    fShowFocus;
+                       bool                            fShowFocus;
 };
 
-#endif
 
+#endif // _SECTION_EDIT_H

Modified: haiku/trunk/src/preferences/time/TZDisplay.cpp
===================================================================
--- haiku/trunk/src/preferences/time/TZDisplay.cpp      2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/TZDisplay.cpp      2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -26,7 +26,7 @@
 }
 
 
-TTZDisplay::TTZDisplay(BRect frame, const char *name, const char *label)
+TTZDisplay::TTZDisplay(BRect frame, const char* name, const char* label)
        : BView(frame, name, B_FOLLOW_NONE, B_WILL_DRAW),
          fLabel(label),
          fText(""),
@@ -62,7 +62,7 @@
 
        BRect bounds = Bounds();
        FillRect(Bounds(), B_SOLID_LOW);
-       
+
        float fontHeight = _FontHeight();
 
        BPoint pt(bounds.left + 2.0, fontHeight / 2.0 + 2.0);
@@ -70,7 +70,7 @@
 
        pt.y += fontHeight;
        DrawString(fText.String(), pt);
-       
+
        pt.x = bounds.right - StringWidth(fTime.String()) - 2.0;
        DrawString(fTime.String(), pt);
 }
@@ -84,7 +84,7 @@
 
 
 void
-TTZDisplay::SetLabel(const char *label)
+TTZDisplay::SetLabel(const char* label)
 {
        fLabel.SetTo(label);
        Draw(Bounds());
@@ -99,7 +99,7 @@
 
 
 void
-TTZDisplay::SetText(const char *text)
+TTZDisplay::SetText(const char* text)
 {
        fText.SetTo(text);
        Draw(Bounds());
@@ -119,11 +119,11 @@
        int32 ahour = hour;
        if (hour > 12)
                ahour = hour -12;
-               
+
        if (ahour == 0)
                ahour = 12;
 
-       const char *ap = "AM";
+       const char* ap = "AM";
        if (hour > 11)
                ap = "PM";
 

Modified: haiku/trunk/src/preferences/time/TZDisplay.h
===================================================================
--- haiku/trunk/src/preferences/time/TZDisplay.h        2010-07-28 15:24:12 UTC 
(rev 37791)
+++ haiku/trunk/src/preferences/time/TZDisplay.h        2010-07-28 16:26:53 UTC 
(rev 37792)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
+ * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -8,8 +8,8 @@
  *             Julun <host.haiku@xxxxxx>
  *
  */
-#ifndef TTZDISPLAY_H
-#define TTZDISPLAY_H
+#ifndef _TZ_DISPLAY_H
+#define _TZ_DISPLAY_H
 
 
 #include <View.h>
@@ -17,29 +17,30 @@
 
 
 class TTZDisplay : public BView {
-       public:
-                                               TTZDisplay(BRect frame, const 
char *name, const char *label);
-               virtual                 ~TTZDisplay();
+public:
+                                                               
TTZDisplay(BRect frame, const char* name,
+                                                                       const 
char* label);
+       virtual                                         ~TTZDisplay();
 
-               virtual void    AttachedToWindow();
-               virtual void    ResizeToPreferred();
-               virtual void    Draw(BRect updateRect);
+       virtual void                            AttachedToWindow();
+       virtual void                            ResizeToPreferred();
+       virtual void                            Draw(BRect updateRect);
 
-               const char*             Label() const;
-               void                    SetLabel(const char *label);
+                       const char*                     Label() const;
+                       void                            SetLabel(const char* 
label);
 
-               const char*             Text() const;
-               void                    SetText(const char *text);
+                       const char*                     Text() const;
+                       void                            SetText(const char* 
text);
 
-               const char*             Time() const;
-               void                    SetTime(int32 hour, int32 minute);
+                       const char*                     Time() const;
+                       void                            SetTime(int32 hour, 
int32 minute);
 
-       private:
-               BString                 fLabel;
-               BString                 fText;
-               BString                 fTime;
-
+private:
+                       BString                 fLabel;
+                       BString                 fText;
+                       BString                 fTime;
 };
 
-#endif // TTZDISPLAY_H
 
+#endif // _TZ_DISPLAY_H
+

Modified: haiku/trunk/src/preferences/time/Time.cpp
===================================================================
--- haiku/trunk/src/preferences/time/Time.cpp   2010-07-28 15:24:12 UTC (rev 
37791)
+++ haiku/trunk/src/preferences/time/Time.cpp   2010-07-28 16:26:53 UTC (rev 
37792)
@@ -44,7 +44,7 @@
 void
 TimeApplication::AboutRequested()
 {
-       BAlert *alert = new BAlert("about", 
+       BAlert* alert = new BAlert("about",
                "Time & Date, writen by:\n\n\tAndrew Edward McCall\n\tMike 
Berg\n\t"

[... truncated: 643 lines follow ...]

Other related posts:

  • » [haiku-commits] r37792 - haiku/trunk/src/preferences/time - zooey