* cleanup and style fixes in WidthBuffer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38033 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -17,8 +17,10 @@ class BFont;
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class TextGapBuffer;
|
||||
|
||||
|
||||
struct _width_table_ {
|
||||
BFont font; // corresponding font
|
||||
int32 hashCount; // number of hashed items
|
||||
@@ -29,34 +31,42 @@ struct _width_table_ {
|
||||
|
||||
class WidthBuffer : public _BTextViewSupportBuffer_<_width_table_> {
|
||||
public:
|
||||
WidthBuffer();
|
||||
virtual ~WidthBuffer();
|
||||
WidthBuffer();
|
||||
virtual ~WidthBuffer();
|
||||
|
||||
float StringWidth(const char* inText, int32 fromOffset, int32 length,
|
||||
const BFont* inStyle);
|
||||
float StringWidth(TextGapBuffer& gapBuffer, int32 fromOffset,
|
||||
int32 length, const BFont* inStyle);
|
||||
float StringWidth(const char* inText,
|
||||
int32 fromOffset, int32 length,
|
||||
const BFont* inStyle);
|
||||
float StringWidth(TextGapBuffer& gapBuffer,
|
||||
int32 fromOffset, int32 length,
|
||||
const BFont* inStyle);
|
||||
|
||||
private:
|
||||
bool FindTable(const BFont* font, int32* outIndex);
|
||||
int32 InsertTable(const BFont* font);
|
||||
bool FindTable(const BFont* font, int32* outIndex);
|
||||
int32 InsertTable(const BFont* font);
|
||||
|
||||
bool GetEscapement(uint32 value, int32 index, float* escapement);
|
||||
float HashEscapements(const char* chars, int32 numChars, int32 numBytes,
|
||||
int32 tableIndex, const BFont* font);
|
||||
bool GetEscapement(uint32 value, int32 index,
|
||||
float* escapement);
|
||||
float HashEscapements(const char* chars,
|
||||
int32 numChars, int32 numBytes,
|
||||
int32 tableIndex, const BFont* font);
|
||||
|
||||
static uint32 Hash(uint32);
|
||||
static uint32 Hash(uint32);
|
||||
|
||||
private:
|
||||
BLocker fLock;
|
||||
BLocker fLock;
|
||||
};
|
||||
|
||||
|
||||
extern WidthBuffer* gWidthBuffer;
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
|
||||
using BPrivate::WidthBuffer;
|
||||
|
||||
|
||||
#if __GNUC__ < 3
|
||||
//! NetPositive binary compatibility support
|
||||
|
||||
@@ -70,4 +80,5 @@ _BWidthBuffer_* gCompatibilityWidthBuffer;
|
||||
|
||||
#endif // __GNUC__ < 3
|
||||
|
||||
|
||||
#endif // __WIDTHBUFFER_H
|
||||
|
||||
Reference in New Issue
Block a user