app_server: Style and comment cleanup, no functional change.
This commit is contained in:
@@ -2065,7 +2065,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
// Attached Data:
|
// Attached Data:
|
||||||
// 1) uint16 family ID
|
// 1) uint16 family ID
|
||||||
// 2) uint16 style ID
|
// 2) uint16 style ID
|
||||||
// 3 uint32 start of unicode block
|
// 3) uint32 start of unicode block
|
||||||
// 4) uint32 end of unicode block
|
// 4) uint32 end of unicode block
|
||||||
|
|
||||||
// Returns:
|
// Returns:
|
||||||
@@ -2107,7 +2107,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
// 6) uint32 - flags
|
// 6) uint32 - flags
|
||||||
// 7) int32 - numChars
|
// 7) int32 - numChars
|
||||||
// 8) int32 - numBytes
|
// 8) int32 - numBytes
|
||||||
// 8) char - chars (bytesInBuffer times)
|
// 8) char - chars (numBytes times)
|
||||||
|
|
||||||
// Returns:
|
// Returns:
|
||||||
// 1) BShape - glyph shape
|
// 1) BShape - glyph shape
|
||||||
@@ -2300,7 +2300,6 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
delete[] charArray;
|
delete[] charArray;
|
||||||
delete[] escapements;
|
delete[] escapements;
|
||||||
delete[] offsets;
|
delete[] offsets;
|
||||||
|
|
||||||
fLink.StartMessage(B_NO_MEMORY);
|
fLink.StartMessage(B_NO_MEMORY);
|
||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -669,9 +669,11 @@ ServerFont::IncludesUnicodeBlock(uint32 start, uint32 end, bool& hasBlock)
|
|||||||
class HasGlyphsConsumer {
|
class HasGlyphsConsumer {
|
||||||
public:
|
public:
|
||||||
HasGlyphsConsumer(bool* hasArray)
|
HasGlyphsConsumer(bool* hasArray)
|
||||||
: fHasArray(hasArray)
|
:
|
||||||
|
fHasArray(hasArray)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NeedsVector() { return false; }
|
bool NeedsVector() { return false; }
|
||||||
void Start() {}
|
void Start() {}
|
||||||
void Finish(double x, double y) {}
|
void Finish(double x, double y) {}
|
||||||
@@ -679,6 +681,7 @@ class HasGlyphsConsumer {
|
|||||||
{
|
{
|
||||||
fHasArray[index] = false;
|
fHasArray[index] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
||||||
FontCacheEntry* entry, double x, double y, double advanceX,
|
FontCacheEntry* entry, double x, double y, double advanceX,
|
||||||
double advanceY)
|
double advanceY)
|
||||||
@@ -711,10 +714,12 @@ ServerFont::GetHasGlyphs(const char* string, int32 numBytes,
|
|||||||
class EdgesConsumer {
|
class EdgesConsumer {
|
||||||
public:
|
public:
|
||||||
EdgesConsumer(edge_info* edges, float size)
|
EdgesConsumer(edge_info* edges, float size)
|
||||||
: fEdges(edges)
|
:
|
||||||
, fSize(size)
|
fEdges(edges),
|
||||||
|
fSize(size)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NeedsVector() { return false; }
|
bool NeedsVector() { return false; }
|
||||||
void Start() {}
|
void Start() {}
|
||||||
void Finish(double x, double y) {}
|
void Finish(double x, double y) {}
|
||||||
@@ -723,6 +728,7 @@ class EdgesConsumer {
|
|||||||
fEdges[index].left = 0.0;
|
fEdges[index].left = 0.0;
|
||||||
fEdges[index].right = 0.0;
|
fEdges[index].right = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
||||||
FontCacheEntry* entry, double x, double y, double advanceX,
|
FontCacheEntry* entry, double x, double y, double advanceX,
|
||||||
double advanceY)
|
double advanceY)
|
||||||
@@ -894,6 +900,7 @@ ServerFont::GetEscapements(const char* string, int32 numBytes, int32 numChars,
|
|||||||
&delta, fSpacing)) {
|
&delta, fSpacing)) {
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -902,14 +909,15 @@ class BoundingBoxConsumer {
|
|||||||
public:
|
public:
|
||||||
BoundingBoxConsumer(Transformable& transform, BRect* rectArray,
|
BoundingBoxConsumer(Transformable& transform, BRect* rectArray,
|
||||||
bool asString)
|
bool asString)
|
||||||
: rectArray(rectArray)
|
:
|
||||||
, stringBoundingBox(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN)
|
rectArray(rectArray),
|
||||||
, fAsString(asString)
|
stringBoundingBox(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN),
|
||||||
, fCurves(fPathAdaptor)
|
fAsString(asString),
|
||||||
, fContour(fCurves)
|
fCurves(fPathAdaptor),
|
||||||
, fTransformedOutline(fCurves, transform)
|
fContour(fCurves),
|
||||||
, fTransformedContourOutline(fContour, transform)
|
fTransformedOutline(fCurves, transform),
|
||||||
, fTransform(transform)
|
fTransformedContourOutline(fContour, transform),
|
||||||
|
fTransform(transform)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,6 +925,7 @@ class BoundingBoxConsumer {
|
|||||||
void Start() {}
|
void Start() {}
|
||||||
void Finish(double x, double y) {}
|
void Finish(double x, double y) {}
|
||||||
void ConsumeEmptyGlyph(int32 index, uint32 charCode, double x, double y) {}
|
void ConsumeEmptyGlyph(int32 index, uint32 charCode, double x, double y) {}
|
||||||
|
|
||||||
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
||||||
FontCacheEntry* entry, double x, double y, double advanceX,
|
FontCacheEntry* entry, double x, double y, double advanceX,
|
||||||
double advanceY)
|
double advanceY)
|
||||||
@@ -1038,7 +1047,12 @@ ServerFont::GetBoundingBoxesForStrings(char *charArray[], int32 lengthArray[],
|
|||||||
|
|
||||||
class StringWidthConsumer {
|
class StringWidthConsumer {
|
||||||
public:
|
public:
|
||||||
StringWidthConsumer() : width(0.0) {}
|
StringWidthConsumer()
|
||||||
|
:
|
||||||
|
width(0.0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
bool NeedsVector() { return false; }
|
bool NeedsVector() { return false; }
|
||||||
void Start() {}
|
void Start() {}
|
||||||
void Finish(double x, double y) { width = x; }
|
void Finish(double x, double y) { width = x; }
|
||||||
@@ -1046,7 +1060,9 @@ class StringWidthConsumer {
|
|||||||
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
bool ConsumeGlyph(int32 index, uint32 charCode, const GlyphCache* glyph,
|
||||||
FontCacheEntry* entry, double x, double y, double advanceX,
|
FontCacheEntry* entry, double x, double y, double advanceX,
|
||||||
double advanceY)
|
double advanceY)
|
||||||
{ return true; }
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
float width;
|
float width;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,12 +27,11 @@ class ServerFont {
|
|||||||
public:
|
public:
|
||||||
ServerFont();
|
ServerFont();
|
||||||
ServerFont(FontStyle& style,
|
ServerFont(FontStyle& style,
|
||||||
float size = 12.0,
|
float size = 12.0, float rotation = 0.0,
|
||||||
float rotation = 0.0,
|
float shear = 90.0,
|
||||||
float shear = 90.0,
|
float falseBoldWidth = 0.0,
|
||||||
float falseBoldWidth = 0.0,
|
uint16 flags = 0,
|
||||||
uint16 flags = 0,
|
uint8 spacing = B_BITMAP_SPACING);
|
||||||
uint8 spacing = B_BITMAP_SPACING);
|
|
||||||
ServerFont(const ServerFont& font);
|
ServerFont(const ServerFont& font);
|
||||||
virtual ~ServerFont();
|
virtual ~ServerFont();
|
||||||
|
|
||||||
@@ -70,7 +69,7 @@ class ServerFont {
|
|||||||
|
|
||||||
void SetStyle(FontStyle* style);
|
void SetStyle(FontStyle* style);
|
||||||
status_t SetFamilyAndStyle(uint16 familyID,
|
status_t SetFamilyAndStyle(uint16 familyID,
|
||||||
uint16 styleID);
|
uint16 styleID);
|
||||||
status_t SetFamilyAndStyle(uint32 fontID);
|
status_t SetFamilyAndStyle(uint32 fontID);
|
||||||
|
|
||||||
uint16 StyleID() const
|
uint16 StyleID() const
|
||||||
@@ -159,19 +158,19 @@ class ServerFont {
|
|||||||
void GetHeight(font_height& height) const;
|
void GetHeight(font_height& height) const;
|
||||||
|
|
||||||
void TruncateString(BString* inOut,
|
void TruncateString(BString* inOut,
|
||||||
uint32 mode,
|
uint32 mode, float width) const;
|
||||||
float width) const;
|
|
||||||
|
|
||||||
Transformable EmbeddedTransformation() const;
|
Transformable EmbeddedTransformation() const;
|
||||||
status_t GetUnicodeBlocks(unicode_block &blocksForFont);
|
status_t GetUnicodeBlocks(unicode_block &blocksForFont);
|
||||||
status_t IncludesUnicodeBlock(uint32 start, uint32 end, bool &hasBlock);
|
status_t IncludesUnicodeBlock(uint32 start, uint32 end,
|
||||||
|
bool &hasBlock);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class FontStyle;
|
friend class FontStyle;
|
||||||
FT_Face GetTransformedFace(bool rotate,
|
FT_Face GetTransformedFace(bool rotate,
|
||||||
bool shear) const;
|
bool shear) const;
|
||||||
void PutTransformedFace(FT_Face face) const;
|
void PutTransformedFace(FT_Face face) const;
|
||||||
|
|
||||||
FontStyle* fStyle;
|
FontStyle* fStyle;
|
||||||
float fSize;
|
float fSize;
|
||||||
float fRotation;
|
float fRotation;
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
|
|||||||
// glyphs from it. We need to obtain the fallback font while we have not
|
// glyphs from it. We need to obtain the fallback font while we have not
|
||||||
// locked anything, since locking the FontManager with the write-lock held
|
// locked anything, since locking the FontManager with the write-lock held
|
||||||
// can obvisouly lead to a deadlock.
|
// can obvisouly lead to a deadlock.
|
||||||
|
|
||||||
bool writeLocked = entry->IsWriteLocked();
|
bool writeLocked = entry->IsWriteLocked();
|
||||||
|
|
||||||
if (writeLocked) {
|
if (writeLocked) {
|
||||||
|
|||||||
Reference in New Issue
Block a user