Indentation cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32691 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+79
-34
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2005-2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
* Copyright 2005-2009, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT license.
|
||||
*/
|
||||
#ifndef _FONT_H_
|
||||
#define _FONT_H_
|
||||
@@ -17,6 +17,7 @@ class BPoint;
|
||||
typedef char font_family[B_FONT_FAMILY_LENGTH + 1];
|
||||
typedef char font_style[B_FONT_STYLE_LENGTH + 1];
|
||||
|
||||
|
||||
// font spacing
|
||||
enum {
|
||||
B_CHAR_SPACING = 0,
|
||||
@@ -25,17 +26,20 @@ enum {
|
||||
B_FIXED_SPACING = 3
|
||||
};
|
||||
|
||||
|
||||
enum font_direction {
|
||||
B_FONT_LEFT_TO_RIGHT = 0,
|
||||
B_FONT_RIGHT_TO_LEFT = 1
|
||||
};
|
||||
|
||||
|
||||
// font flags
|
||||
enum {
|
||||
B_DISABLE_ANTIALIASING = 0x00000001,
|
||||
B_FORCE_ANTIALIASING = 0x00000002
|
||||
};
|
||||
|
||||
|
||||
// truncation modes
|
||||
enum {
|
||||
B_TRUNCATE_END = 0,
|
||||
@@ -44,6 +48,7 @@ enum {
|
||||
B_TRUNCATE_SMART = 3
|
||||
};
|
||||
|
||||
|
||||
// font encodings
|
||||
enum {
|
||||
B_UNICODE_UTF8 = 0,
|
||||
@@ -60,12 +65,14 @@ enum {
|
||||
B_MACINTOSH_ROMAN = 11
|
||||
};
|
||||
|
||||
|
||||
// flags for get_font_family() and get_font_style()
|
||||
enum {
|
||||
B_HAS_TUNED_FONT = 0x0001,
|
||||
B_IS_FIXED = 0x0002
|
||||
};
|
||||
|
||||
|
||||
// font face flags
|
||||
enum {
|
||||
B_ITALIC_FACE = 0x0001,
|
||||
@@ -81,16 +88,19 @@ enum {
|
||||
B_HEAVY_FACE = 0x0200,
|
||||
};
|
||||
|
||||
|
||||
enum font_metric_mode {
|
||||
B_SCREEN_METRIC = 0,
|
||||
B_PRINTING_METRIC = 1
|
||||
};
|
||||
|
||||
|
||||
enum font_file_format {
|
||||
B_TRUETYPE_WINDOWS = 0,
|
||||
B_POSTSCRIPT_TYPE1_WINDOWS = 1
|
||||
};
|
||||
|
||||
|
||||
class unicode_block {
|
||||
public:
|
||||
inline unicode_block();
|
||||
@@ -107,22 +117,26 @@ class unicode_block {
|
||||
uint64 fData[2];
|
||||
};
|
||||
|
||||
|
||||
struct edge_info {
|
||||
float left;
|
||||
float right;
|
||||
};
|
||||
|
||||
|
||||
struct font_height {
|
||||
float ascent;
|
||||
float descent;
|
||||
float leading;
|
||||
};
|
||||
|
||||
|
||||
struct escapement_delta {
|
||||
float nonspace;
|
||||
float space;
|
||||
};
|
||||
|
||||
|
||||
struct font_cache_info {
|
||||
int32 sheared_font_penalty;
|
||||
int32 rotated_font_penalty;
|
||||
@@ -132,6 +146,7 @@ struct font_cache_info {
|
||||
float spacing_size_threshold;
|
||||
};
|
||||
|
||||
|
||||
struct tuned_font_info {
|
||||
float size;
|
||||
float shear;
|
||||
@@ -140,6 +155,7 @@ struct tuned_font_info {
|
||||
uint16 face;
|
||||
};
|
||||
|
||||
|
||||
class BShape;
|
||||
class BString;
|
||||
class BFontPrivate;
|
||||
@@ -154,7 +170,8 @@ class BFont {
|
||||
status_t SetFamilyAndStyle(const font_family family,
|
||||
const font_style style);
|
||||
void SetFamilyAndStyle(uint32 code);
|
||||
status_t SetFamilyAndFace(const font_family family, uint16 face);
|
||||
status_t SetFamilyAndFace(const font_family family,
|
||||
uint16 face);
|
||||
|
||||
void SetSize(float size);
|
||||
void SetShear(float shear);
|
||||
@@ -185,7 +202,8 @@ class BFont {
|
||||
font_file_format FileFormat() const;
|
||||
|
||||
int32 CountTuned() const;
|
||||
void GetTunedInfo(int32 index, tuned_font_info *info) const;
|
||||
void GetTunedInfo(int32 index,
|
||||
tuned_font_info* info) const;
|
||||
|
||||
void TruncateString(BString* inOut, uint32 mode,
|
||||
float width) const;
|
||||
@@ -193,44 +211,57 @@ class BFont {
|
||||
int32 numStrings, uint32 mode, float width,
|
||||
BString resultArray[]) const;
|
||||
void GetTruncatedStrings(const char* stringArray[],
|
||||
int32 numStrings, uint32 mode, float width,
|
||||
char *resultArray[]) const;
|
||||
int32 numStrings, uint32 mode,
|
||||
float width, char* resultArray[]) const;
|
||||
|
||||
float StringWidth(const char* string) const;
|
||||
float StringWidth(const char *string, int32 length) const;
|
||||
float StringWidth(const char* string,
|
||||
int32 length) const;
|
||||
void GetStringWidths(const char* stringArray[],
|
||||
const int32 lengthArray[], int32 numStrings,
|
||||
const int32 lengthArray[],
|
||||
int32 numStrings,
|
||||
float widthArray[]) const;
|
||||
|
||||
void GetEscapements(const char charArray[], int32 numChars,
|
||||
void GetEscapements(const char charArray[],
|
||||
int32 numChars,
|
||||
float escapementArray[]) const;
|
||||
void GetEscapements(const char charArray[], int32 numChars,
|
||||
escapement_delta *delta, float escapementArray[]) const;
|
||||
void GetEscapements(const char charArray[], int32 numChars,
|
||||
escapement_delta *delta, BPoint escapementArray[]) const;
|
||||
void GetEscapements(const char charArray[], int32 numChars,
|
||||
escapement_delta *delta, BPoint escapementArray[],
|
||||
void GetEscapements(const char charArray[],
|
||||
int32 numChars, escapement_delta* delta,
|
||||
float escapementArray[]) const;
|
||||
void GetEscapements(const char charArray[],
|
||||
int32 numChars, escapement_delta* delta,
|
||||
BPoint escapementArray[]) const;
|
||||
void GetEscapements(const char charArray[],
|
||||
int32 numChars, escapement_delta* delta,
|
||||
BPoint escapementArray[],
|
||||
BPoint offsetArray[]) const;
|
||||
|
||||
void GetEdges(const char charArray[], int32 numBytes,
|
||||
void GetEdges(const char charArray[],
|
||||
int32 numBytes,
|
||||
edge_info edgeArray[]) const;
|
||||
void GetHeight(font_height* height) const;
|
||||
|
||||
void GetBoundingBoxesAsGlyphs(const char charArray[],
|
||||
int32 numChars, font_metric_mode mode,
|
||||
void GetBoundingBoxesAsGlyphs(
|
||||
const char charArray[], int32 numChars,
|
||||
font_metric_mode mode,
|
||||
BRect boundingBoxArray[]) const;
|
||||
void GetBoundingBoxesAsString(const char charArray[],
|
||||
int32 numChars, font_metric_mode mode,
|
||||
escapement_delta *delta, BRect boundingBoxArray[]) const;
|
||||
void GetBoundingBoxesForStrings(const char *stringArray[],
|
||||
void GetBoundingBoxesAsString(
|
||||
const char charArray[], int32 numChars,
|
||||
font_metric_mode mode,
|
||||
escapement_delta* delta,
|
||||
BRect boundingBoxArray[]) const;
|
||||
void GetBoundingBoxesForStrings(
|
||||
const char* stringArray[],
|
||||
int32 numStrings, font_metric_mode mode,
|
||||
escapement_delta deltas[],
|
||||
BRect boundingBoxArray[]) const;
|
||||
|
||||
void GetGlyphShapes(const char charArray[], int32 numChars,
|
||||
void GetGlyphShapes(const char charArray[],
|
||||
int32 numChars,
|
||||
BShape* glyphShapeArray[]) const;
|
||||
|
||||
void GetHasGlyphs(const char charArray[], int32 numChars,
|
||||
void GetHasGlyphs(const char charArray[],
|
||||
int32 numChars,
|
||||
bool hasArray[]) const;
|
||||
|
||||
BFont& operator=(const BFont& font);
|
||||
@@ -242,6 +273,15 @@ class BFont {
|
||||
private:
|
||||
friend void _init_global_fonts_();
|
||||
|
||||
void _GetExtraFlags() const;
|
||||
void _GetBoundingBoxes(const char charArray[],
|
||||
int32 numChars, font_metric_mode mode,
|
||||
bool string_escapement,
|
||||
escapement_delta* delta,
|
||||
BRect boundingBoxArray[],
|
||||
bool asString) const;
|
||||
|
||||
private:
|
||||
uint16 fFamilyID;
|
||||
uint16 fStyleID;
|
||||
float fSize;
|
||||
@@ -254,24 +294,20 @@ class BFont {
|
||||
uint32 fFlags;
|
||||
mutable font_height fHeight;
|
||||
mutable uint32 fExtraFlags;
|
||||
uint32 _reserved[1];
|
||||
|
||||
void _GetExtraFlags() const;
|
||||
void _GetBoundingBoxes(const char charArray[],
|
||||
int32 numChars, font_metric_mode mode,
|
||||
bool string_escapement, escapement_delta *delta,
|
||||
BRect boundingBoxArray[], bool asString) const;
|
||||
uint32 _reserved[1];
|
||||
};
|
||||
|
||||
|
||||
// BFont related declarations
|
||||
// #pragma mark - BFont related declarations
|
||||
|
||||
extern const BFont* be_plain_font;
|
||||
extern const BFont* be_bold_font;
|
||||
extern const BFont* be_fixed_font;
|
||||
|
||||
int32 count_font_families(void);
|
||||
status_t get_font_family(int32 index, font_family *name, uint32 *flags = NULL);
|
||||
status_t get_font_family(int32 index, font_family* name,
|
||||
uint32* flags = NULL);
|
||||
|
||||
int32 count_font_styles(font_family name);
|
||||
status_t get_font_style(font_family family, int32 index, font_style* name,
|
||||
@@ -281,19 +317,23 @@ status_t get_font_style(font_family family, int32 index, font_style *name,
|
||||
bool update_font_families(bool checkOnly);
|
||||
|
||||
|
||||
// unicode_block inlines
|
||||
|
||||
// #pragma mark - unicode_block inlines
|
||||
|
||||
|
||||
unicode_block::unicode_block()
|
||||
{
|
||||
fData[0] = fData[1] = 0LL;
|
||||
}
|
||||
|
||||
|
||||
unicode_block::unicode_block(uint64 block2, uint64 block1)
|
||||
{
|
||||
fData[0] = block1;
|
||||
fData[1] = block2;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
unicode_block::Includes(const unicode_block& block) const
|
||||
{
|
||||
@@ -301,6 +341,7 @@ unicode_block::Includes(const unicode_block &block) const
|
||||
&& (fData[1] & block.fData[1]) == block.fData[1];
|
||||
}
|
||||
|
||||
|
||||
unicode_block
|
||||
unicode_block::operator&(const unicode_block& block) const
|
||||
{
|
||||
@@ -311,6 +352,7 @@ unicode_block::operator&(const unicode_block &block) const
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
unicode_block
|
||||
unicode_block::operator|(const unicode_block& block) const
|
||||
{
|
||||
@@ -321,6 +363,7 @@ unicode_block::operator|(const unicode_block &block) const
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
unicode_block&
|
||||
unicode_block::operator=(const unicode_block& block)
|
||||
{
|
||||
@@ -329,16 +372,18 @@ unicode_block::operator=(const unicode_block &block)
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
unicode_block::operator==(const unicode_block& block) const
|
||||
{
|
||||
return fData[0] == block.fData[0] && fData[1] == block.fData[1];
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
unicode_block::operator!=(const unicode_block& block) const
|
||||
{
|
||||
return fData[0] != block.fData[0] || fData[1] != block.fData[1];
|
||||
}
|
||||
|
||||
#endif /* _FONT_H_ */
|
||||
#endif // _FONT_H_
|
||||
|
||||
Reference in New Issue
Block a user