* Finished rewriting the header.

* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32667 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-08-25 14:13:59 +00:00
parent f1f6eacd46
commit d89b690d3b
2 changed files with 235 additions and 228 deletions
+65 -73
View File
@@ -1,15 +1,7 @@
/*******************************************************************************
/
/ File: ChannelSlider.h
/
/ Description: BChannelSlider implements a slider which can have a number
/ of (on-screen) related values. A typical use is for a stereo
/ volume control.
/
/ Copyright 1998-99, Be Incorporated, All Rights Reserved
/
*******************************************************************************/
/*
* Copyright 2009, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*/
#ifndef _CHANNEL_SLIDER_H
#define _CHANNEL_SLIDER_H
@@ -41,13 +33,8 @@ public:
virtual ~BChannelSlider();
static BArchivable* Instantiate(BMessage* from);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual orientation Orientation() const;
void SetOrientation(enum orientation orientation);
virtual int32 MaxChannelCount() const;
virtual bool SupportsIndividualLimits() const;
virtual status_t Archive(BMessage* into,
bool deep = true) const;
virtual void AttachedToWindow();
virtual void AllAttached();
@@ -56,7 +43,7 @@ public:
virtual void MessageReceived(BMessage* message);
virtual void Draw(BRect area);
virtual void Draw(BRect updateRect);
virtual void MouseDown(BPoint where);
virtual void MouseUp(BPoint where);
virtual void MouseMoved(BPoint where, uint32 transit,
@@ -70,74 +57,79 @@ public:
uint32 mask = B_FONT_ALL);
virtual void MakeFocus(bool focusState = true);
virtual void SetEnabled(bool on);
virtual void GetPreferredSize(float* _width, float* _height);
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
BMessage* specifier, int32 form,
const char* p);
virtual BHandler* ResolveSpecifier(BMessage* message,
int32 index, BMessage* specifier,
int32 form, const char* property);
virtual status_t GetSupportedSuites(BMessage* data);
// Perform rendering for an entire slider channel.
virtual void DrawChannel(BView* into, int32 channel, BRect area,
bool pressed);
virtual void SetEnabled(bool on);
// Draw groove that appears behind a channel's thumb.
virtual void DrawGroove(BView* into, int32 channel, BPoint lt,
BPoint br);
virtual orientation Orientation() const;
void SetOrientation(enum orientation orientation);
// Draw the thumb for a single channel.
virtual void DrawThumb(BView* into, int32 channel, BPoint where,
bool pressed);
virtual int32 MaxChannelCount() const;
virtual bool SupportsIndividualLimits() const;
virtual const BBitmap* ThumbFor(int32 channel, bool pressed);
virtual BRect ThumbFrameFor(int32 channel);
virtual float ThumbDeltaFor(int32 channel);
virtual float ThumbRangeFor(int32 channel);
virtual void DrawChannel(BView* into, int32 channel,
BRect area, bool pressed);
virtual void DrawGroove(BView* into, int32 channel,
BPoint leftTop, BPoint rightBottom);
virtual void DrawThumb(BView* into, int32 channel,
BPoint where, bool pressed);
virtual const BBitmap* ThumbFor(int32 channel, bool pressed);
virtual BRect ThumbFrameFor(int32 channel);
virtual float ThumbDeltaFor(int32 channel);
virtual float ThumbRangeFor(int32 channel);
private:
BChannelSlider(const BChannelSlider &);
BChannelSlider& operator=(const BChannelSlider &);
// FBC padding
BChannelSlider(const BChannelSlider&);
BChannelSlider& operator=(const BChannelSlider&);
virtual void _Reserved_BChannelSlider_0(void* , ...);
virtual void _Reserved_BChannelSlider_1(void* , ...);
virtual void _Reserved_BChannelSlider_2(void* , ...);
virtual void _Reserved_BChannelSlider_3(void* , ...);
virtual void _Reserved_BChannelSlider_4(void* , ...);
virtual void _Reserved_BChannelSlider_5(void* , ...);
virtual void _Reserved_BChannelSlider_6(void* , ...);
virtual void _Reserved_BChannelSlider_7(void* , ...);
virtual void _Reserved_BChannelSlider_0(void*, ...);
virtual void _Reserved_BChannelSlider_1(void*, ...);
virtual void _Reserved_BChannelSlider_2(void*, ...);
virtual void _Reserved_BChannelSlider_3(void*, ...);
virtual void _Reserved_BChannelSlider_4(void*, ...);
virtual void _Reserved_BChannelSlider_5(void*, ...);
virtual void _Reserved_BChannelSlider_6(void*, ...);
virtual void _Reserved_BChannelSlider_7(void*, ...);
float fBaseLine;
float fLineFeed;
BBitmap* fLeftKnob;
BBitmap* fMidKnob;
BBitmap* fRightKnob;
BBitmap* fBacking;
BView* fBackingView;
bool fVertical;
bool fPadding[3];
BPoint fClickDelta;
private:
void _InitData();
void _FinishChange(bool update = false);
void _UpdateFontDimens();
void _DrawThumbs();
void _DrawGrooveFrame(BView* where,
const BRect& area);
void _MouseMovedCommon(BPoint point, BPoint point2);
int32 fCurrentChannel;
bool fAllChannels;
int32* fInitialValues;
float fMinpoint;
int32 fFocusChannel;
private:
float fBaseLine;
float fLineFeed;
BBitmap* fLeftKnob;
BBitmap* fMidKnob;
BBitmap* fRightKnob;
BBitmap* fBacking;
BView* fBackingView;
bool fIsVertical;
bool _padding_[3];
BPoint fClickDelta;
uint32 _reserved_[12];
int32 fCurrentChannel;
bool fAllChannels;
int32* fInitialValues;
float fMinPoint;
int32 fFocusChannel;
void _InitData();
void _FinishChange(bool update = false);
void _UpdateFontDimens();
void _DrawThumbs();
void _DrawGrooveFrame(BView* where, const BRect& area);
bool _Vertical() const;
void _Redraw();
void _MouseMovedCommon(BPoint point, BPoint point2);
uint32 _reserved_[12];
};
#endif /* _CHANNEL_SLIDER_H */
#endif // _CHANNEL_SLIDER_H