Applied our style guide as someone (cough! *** Axel *** cough!) bugged me (correctly) about it :)

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11181 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-02-01 14:29:06 +00:00
parent 976f53a988
commit 422c07914d
4 changed files with 79 additions and 76 deletions
+14 -11
View File
@@ -180,14 +180,17 @@ protected:
private: private:
int32 _m_channel_count; int32 fChannelCount;
int32 _m_value_channel; int32 fCurrentChannel;
int32 * _m_channel_min; int32 * fChannelMin;
int32 * _m_channel_max; int32 * fChannelMax;
int32 * _m_channel_val; int32 * fChannelValues;
BString _m_min_label;
BString _m_max_label; BString fMinLabel;
void * _m_multi_labels; BString fMaxLabel;
void * fMultiLabels;
BMessage * fModificationMsg; BMessage * fModificationMsg;
uint32 _reserved_[15]; uint32 _reserved_[15];
@@ -200,17 +203,17 @@ private:
inline int32 * const & BChannelControl::MinLimitList() const inline int32 * const & BChannelControl::MinLimitList() const
{ {
return _m_channel_min; return fChannelMin;
} }
inline int32 * const & BChannelControl::MaxLimitList() const inline int32 * const & BChannelControl::MaxLimitList() const
{ {
return _m_channel_max; return fChannelMax;
} }
inline int32 * const & BChannelControl::ValueList() const inline int32 * const & BChannelControl::ValueList() const
{ {
return _m_channel_val; return fChannelValues;
} }
+10 -10
View File
@@ -122,16 +122,16 @@ virtual void _Reserved_BChannelSlider_5(void *, ...);
virtual void _Reserved_BChannelSlider_6(void *, ...); virtual void _Reserved_BChannelSlider_6(void *, ...);
virtual void _Reserved_BChannelSlider_7(void *, ...); virtual void _Reserved_BChannelSlider_7(void *, ...);
float _m_baseline; float fBaseLine;
float _m_linefeed; float fLineFeed;
BBitmap * _m_left_knob; BBitmap * fLeftKnob;
BBitmap * _m_mid_knob; BBitmap * fMidKnob;
BBitmap * _m_right_knob; BBitmap * fRightKnob;
BBitmap * _m_backing; BBitmap * fBacking;
BView * _m_backing_view; BView * fBackingView;
bool _m_vertical; bool fVertical;
bool _m_padding_[3]; bool fPadding[3];
BPoint _m_click_delta; BPoint fClickDelta;
int32 fCurrentChannel; int32 fCurrentChannel;
bool fAllChannels; bool fAllChannels;
+39 -39
View File
@@ -17,22 +17,22 @@ sPropertyInfo[] = {
BChannelControl::BChannelControl(BRect frame, const char *name, const char *label, BChannelControl::BChannelControl(BRect frame, const char *name, const char *label,
BMessage *model, int32 channel_count, uint32 resizeMode, uint32 flags) BMessage *model, int32 channel_count, uint32 resizeMode, uint32 flags)
: BControl(frame, name, label, model, resizeMode, flags), : BControl(frame, name, label, model, resizeMode, flags),
_m_channel_count(channel_count), fChannelCount(channel_count),
_m_value_channel(0), fCurrentChannel(0),
_m_channel_min(NULL), fChannelMin(NULL),
_m_channel_max(NULL), fChannelMax(NULL),
_m_channel_val(NULL), fChannelValues(NULL),
_m_multi_labels(NULL), fMultiLabels(NULL),
fModificationMsg(NULL) fModificationMsg(NULL)
{ {
_m_channel_min = new int32[channel_count]; fChannelMin = new int32[channel_count];
memset(_m_channel_min, 0, sizeof(int32) * channel_count); memset(fChannelMin, 0, sizeof(int32) * channel_count);
_m_channel_max = new int32[channel_count]; fChannelMax = new int32[channel_count];
memset(_m_channel_max, 100, sizeof(int32) * channel_count); memset(fChannelMax, 100, sizeof(int32) * channel_count);
_m_channel_val = new int32[channel_count]; fChannelValues = new int32[channel_count];
memset(_m_channel_val, 0, sizeof(int32) * channel_count); memset(fChannelValues, 0, sizeof(int32) * channel_count);
} }
@@ -44,9 +44,9 @@ BChannelControl::BChannelControl(BMessage *archive)
BChannelControl::~BChannelControl() BChannelControl::~BChannelControl()
{ {
delete[] _m_channel_min; delete[] fChannelMin;
delete[] _m_channel_max; delete[] fChannelMax;
delete[] _m_channel_val; delete[] fChannelValues;
} }
@@ -170,14 +170,14 @@ void
BChannelControl::SetValue(int32 value) BChannelControl::SetValue(int32 value)
{ {
// Get real // Get real
if (value > _m_channel_max[_m_value_channel]) if (value > fChannelMax[fCurrentChannel])
value = _m_channel_max[_m_value_channel]; value = fChannelMax[fCurrentChannel];
if (value < _m_channel_min[_m_value_channel]); if (value < fChannelMin[fCurrentChannel]);
value = _m_channel_min[_m_value_channel]; value = fChannelMin[fCurrentChannel];
if (value != _m_channel_val[_m_value_channel]) { if (value != fChannelValues[fCurrentChannel]) {
StuffValues(_m_value_channel, 1, &value); StuffValues(fCurrentChannel, 1, &value);
BControl::SetValue(value); BControl::SetValue(value);
} }
} }
@@ -186,12 +186,12 @@ BChannelControl::SetValue(int32 value)
status_t status_t
BChannelControl::SetCurrentChannel(int32 channel) BChannelControl::SetCurrentChannel(int32 channel)
{ {
if (channel < 0 || channel >= _m_channel_count) if (channel < 0 || channel >= fChannelCount)
return B_BAD_INDEX; return B_BAD_INDEX;
if (channel != _m_value_channel) { if (channel != fCurrentChannel) {
_m_value_channel = channel; fCurrentChannel = channel;
BControl::SetValue(_m_channel_val[_m_value_channel]); BControl::SetValue(fChannelValues[fCurrentChannel]);
} }
return B_OK; return B_OK;
@@ -201,14 +201,14 @@ BChannelControl::SetCurrentChannel(int32 channel)
int32 int32
BChannelControl::CurrentChannel() const BChannelControl::CurrentChannel() const
{ {
return _m_value_channel; return fCurrentChannel;
} }
int32 int32
BChannelControl::CountChannels() const BChannelControl::CountChannels() const
{ {
return _m_channel_count; return fChannelCount;
} }
@@ -219,25 +219,25 @@ BChannelControl::SetChannelCount(int32 channel_count)
return B_BAD_VALUE; return B_BAD_VALUE;
// TODO: Currently we only grow the buffer. Test what BeOS does // TODO: Currently we only grow the buffer. Test what BeOS does
if (channel_count > _m_channel_count) { if (channel_count > fChannelCount) {
int32 *newMin = new int32[channel_count]; int32 *newMin = new int32[channel_count];
int32 *newMax = new int32[channel_count]; int32 *newMax = new int32[channel_count];
int32 *newVal = new int32[channel_count]; int32 *newVal = new int32[channel_count];
memcpy(newMin, _m_channel_min, _m_channel_count); memcpy(newMin, fChannelMin, fChannelCount);
memcpy(newMax, _m_channel_max, _m_channel_count); memcpy(newMax, fChannelMax, fChannelCount);
memcpy(newVal, _m_channel_val, _m_channel_count); memcpy(newVal, fChannelValues, fChannelCount);
delete[] _m_channel_min; delete[] fChannelMin;
delete[] _m_channel_max; delete[] fChannelMax;
delete[] _m_channel_val; delete[] fChannelValues;
_m_channel_min = newMin; fChannelMin = newMin;
_m_channel_max = newMax; fChannelMax = newMax;
_m_channel_val = newVal; fChannelValues = newVal;
} }
_m_channel_count = channel_count; fChannelCount = channel_count;
return B_OK; return B_OK;
} }
@@ -260,7 +260,7 @@ BChannelControl::GetValue(int32 *outValues, int32 fromChannel,
{ {
int32 i = 0; int32 i = 0;
for (i = 0; i < channelCount; i++) for (i = 0; i < channelCount; i++)
outValues[i] = _m_channel_val[fromChannel + i]; outValues[i] = fChannelValues[fromChannel + i];
return i; return i;
} }
+16 -16
View File
@@ -79,7 +79,7 @@ BChannelSlider::Archive(BMessage *into, bool deep) const
orientation orientation
BChannelSlider::Orientation() const BChannelSlider::Orientation() const
{ {
return _m_vertical ? B_VERTICAL : B_HORIZONTAL; return fVertical ? B_VERTICAL : B_HORIZONTAL;
} }
@@ -88,7 +88,7 @@ BChannelSlider::SetOrientation(orientation _orientation)
{ {
bool isVertical = _orientation == B_VERTICAL; bool isVertical = _orientation == B_VERTICAL;
if (isVertical != Vertical()) { if (isVertical != Vertical()) {
_m_vertical = isVertical; fVertical = isVertical;
Invalidate(Bounds()); Invalidate(Bounds());
} }
} }
@@ -331,9 +331,9 @@ BChannelSlider::ThumbFrameFor(int32 channel)
if (thumb != NULL) { if (thumb != NULL) {
frame = thumb->Bounds(); frame = thumb->Bounds();
if (Vertical()) if (Vertical())
frame.OffsetBy(0, _m_linefeed * 2); frame.OffsetBy(0, fLineFeed * 2);
else else
frame.OffsetBy(_m_linefeed, _m_linefeed); frame.OffsetBy(fLineFeed, fLineFeed);
} }
return frame; return frame;
@@ -367,9 +367,9 @@ BChannelSlider::ThumbRangeFor(int32 channel)
BRect bounds = Bounds(); BRect bounds = Bounds();
BRect frame = ThumbFrameFor(channel); BRect frame = ThumbFrameFor(channel);
if (Vertical()) if (Vertical())
range = bounds.Height() - frame.Height() - _m_linefeed * 4; range = bounds.Height() - frame.Height() - fLineFeed * 4;
else else
range = bounds.Width() - frame.Width() - _m_linefeed * 2; range = bounds.Width() - frame.Width() - fLineFeed * 2;
return range; return range;
} }
@@ -380,13 +380,13 @@ BChannelSlider::InitData()
{ {
UpdateFontDimens(); UpdateFontDimens();
_m_left_knob = NULL; fLeftKnob = NULL;
_m_mid_knob = NULL; fMidKnob = NULL;
_m_right_knob = NULL; fRightKnob = NULL;
_m_backing = NULL; fBacking = NULL;
_m_backing_view = NULL; fBackingView = NULL;
_m_vertical = Bounds().Width() / Bounds().Height() < 1; fVertical = Bounds().Width() / Bounds().Height() < 1;
_m_click_delta = B_ORIGIN; fClickDelta = B_ORIGIN;
fCurrentChannel = -1; fCurrentChannel = -1;
fAllChannels = false; fAllChannels = false;
@@ -428,8 +428,8 @@ BChannelSlider::UpdateFontDimens()
{ {
font_height height; font_height height;
GetFontHeight(&height); GetFontHeight(&height);
_m_baseline = height.ascent + height.leading; fBaseLine = height.ascent + height.leading;
_m_linefeed = _m_baseline + height.descent; fLineFeed = fBaseLine + height.descent;
} }
@@ -448,7 +448,7 @@ BChannelSlider::DrawThumbFrame(BView *where, const BRect &area)
bool bool
BChannelSlider::Vertical() BChannelSlider::Vertical()
{ {
return _m_vertical; return fVertical;
} }