HaikuDepot: Give access to glyph spacing
* The implementation for the get-accessors was missing from CharacterStyle.
This commit is contained in:
@@ -66,6 +66,13 @@ CharacterStyle::SetFont(const BFont& font)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const BFont&
|
||||||
|
CharacterStyle::Font() const
|
||||||
|
{
|
||||||
|
return fStyleData->Font();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetAscent(float ascent)
|
CharacterStyle::SetAscent(float ascent)
|
||||||
{
|
{
|
||||||
@@ -78,6 +85,13 @@ CharacterStyle::SetAscent(float ascent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
CharacterStyle::Ascent() const
|
||||||
|
{
|
||||||
|
return fStyleData->Ascent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetDescent(float descent)
|
CharacterStyle::SetDescent(float descent)
|
||||||
{
|
{
|
||||||
@@ -90,6 +104,13 @@ CharacterStyle::SetDescent(float descent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
CharacterStyle::Descent() const
|
||||||
|
{
|
||||||
|
return fStyleData->Descent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetWidth(float width)
|
CharacterStyle::SetWidth(float width)
|
||||||
{
|
{
|
||||||
@@ -102,6 +123,32 @@ CharacterStyle::SetWidth(float width)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
CharacterStyle::Width() const
|
||||||
|
{
|
||||||
|
return fStyleData->Width();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
CharacterStyle::SetGlyphSpacing(float spacing)
|
||||||
|
{
|
||||||
|
CharacterStyleDataRef data = fStyleData->SetGlyphSpacing(spacing);
|
||||||
|
if (data == fStyleData)
|
||||||
|
return data->GlyphSpacing() == spacing;
|
||||||
|
|
||||||
|
fStyleData = data;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
CharacterStyle::GlyphSpacing() const
|
||||||
|
{
|
||||||
|
return fStyleData->GlyphSpacing();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetForegroundColor(rgb_color color)
|
CharacterStyle::SetForegroundColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -114,6 +161,13 @@ CharacterStyle::SetForegroundColor(rgb_color color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rgb_color
|
||||||
|
CharacterStyle::ForegroundColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->ForegroundColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetBackgroundColor(rgb_color color)
|
CharacterStyle::SetBackgroundColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -126,6 +180,13 @@ CharacterStyle::SetBackgroundColor(rgb_color color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rgb_color
|
||||||
|
CharacterStyle::BackgroundColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->BackgroundColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetStrikeOutColor(rgb_color color)
|
CharacterStyle::SetStrikeOutColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -138,6 +199,13 @@ CharacterStyle::SetStrikeOutColor(rgb_color color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rgb_color
|
||||||
|
CharacterStyle::StrikeOutColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->StrikeOutColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetUnderlineColor(rgb_color color)
|
CharacterStyle::SetUnderlineColor(rgb_color color)
|
||||||
{
|
{
|
||||||
@@ -150,6 +218,13 @@ CharacterStyle::SetUnderlineColor(rgb_color color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rgb_color
|
||||||
|
CharacterStyle::UnderlineColor() const
|
||||||
|
{
|
||||||
|
return fStyleData->UnderlineColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetStrikeOut(uint8 strikeOut)
|
CharacterStyle::SetStrikeOut(uint8 strikeOut)
|
||||||
{
|
{
|
||||||
@@ -162,6 +237,13 @@ CharacterStyle::SetStrikeOut(uint8 strikeOut)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8
|
||||||
|
CharacterStyle::StrikeOut() const
|
||||||
|
{
|
||||||
|
return fStyleData->StrikeOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CharacterStyle::SetUnderline(uint8 underline)
|
CharacterStyle::SetUnderline(uint8 underline)
|
||||||
{
|
{
|
||||||
@@ -174,3 +256,10 @@ CharacterStyle::SetUnderline(uint8 underline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8
|
||||||
|
CharacterStyle::Underline() const
|
||||||
|
{
|
||||||
|
return fStyleData->Underline();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ public:
|
|||||||
bool SetWidth(float width);
|
bool SetWidth(float width);
|
||||||
float Width() const;
|
float Width() const;
|
||||||
|
|
||||||
|
bool SetGlyphSpacing(float spacing);
|
||||||
|
float GlyphSpacing() const;
|
||||||
|
|
||||||
bool SetForegroundColor(rgb_color color);
|
bool SetForegroundColor(rgb_color color);
|
||||||
rgb_color ForegroundColor() const;
|
rgb_color ForegroundColor() const;
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,21 @@ CharacterStyleData::SetWidth(float width)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CharacterStyleDataRef
|
||||||
|
CharacterStyleData::SetGlyphSpacing(float glyphSpacing)
|
||||||
|
{
|
||||||
|
if (fGlyphSpacing == glyphSpacing)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
CharacterStyleData* ret = new(std::nothrow) CharacterStyleData(*this);
|
||||||
|
if (ret == NULL)
|
||||||
|
return CharacterStyleDataRef(this);
|
||||||
|
|
||||||
|
ret->fGlyphSpacing = glyphSpacing;
|
||||||
|
return CharacterStyleDataRef(ret, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CharacterStyleDataRef
|
CharacterStyleDataRef
|
||||||
CharacterStyleData::SetForegroundColor(rgb_color color)
|
CharacterStyleData::SetForegroundColor(rgb_color color)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ public:
|
|||||||
inline float Width() const
|
inline float Width() const
|
||||||
{ return fWidth; }
|
{ return fWidth; }
|
||||||
|
|
||||||
|
CharacterStyleDataRef SetGlyphSpacing(float glyphSpacing);
|
||||||
|
inline float GlyphSpacing() const
|
||||||
|
{ return fGlyphSpacing; }
|
||||||
|
|
||||||
CharacterStyleDataRef SetForegroundColor(rgb_color color);
|
CharacterStyleDataRef SetForegroundColor(rgb_color color);
|
||||||
inline rgb_color ForegroundColor() const
|
inline rgb_color ForegroundColor() const
|
||||||
{ return fFgColor; }
|
{ return fFgColor; }
|
||||||
|
|||||||
Reference in New Issue
Block a user