HaikuDepot: Added TextStyle convenience methods
* Empty constructor * Copy constructor * operator==(const TextStyle& other)
This commit is contained in:
@@ -6,6 +6,28 @@
|
|||||||
#include "TextStyle.h"
|
#include "TextStyle.h"
|
||||||
|
|
||||||
|
|
||||||
|
TextStyle::TextStyle()
|
||||||
|
:
|
||||||
|
font(),
|
||||||
|
|
||||||
|
ascent(0.0f),
|
||||||
|
descent(0.0f),
|
||||||
|
width(-1.0f),
|
||||||
|
glyphSpacing(0.0f),
|
||||||
|
|
||||||
|
fgColor((rgb_color){ 0, 0, 0, 255 }),
|
||||||
|
bgColor((rgb_color){ 255, 255, 255, 255 }),
|
||||||
|
|
||||||
|
strikeOut(false),
|
||||||
|
strikeOutColor((rgb_color){ 0, 0, 0, 255 }),
|
||||||
|
|
||||||
|
underline(false),
|
||||||
|
underlineStyle(0),
|
||||||
|
underlineColor((rgb_color){ 0, 0, 0, 255 })
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TextStyle::TextStyle(const BFont& font, float ascent, float descent,
|
TextStyle::TextStyle(const BFont& font, float ascent, float descent,
|
||||||
float width, float glyphSpacing, rgb_color fgColor, rgb_color bgColor,
|
float width, float glyphSpacing, rgb_color fgColor, rgb_color bgColor,
|
||||||
bool strikeOut, rgb_color strikeOutColor, bool underline,
|
bool strikeOut, rgb_color strikeOutColor, bool underline,
|
||||||
@@ -29,3 +51,47 @@ TextStyle::TextStyle(const BFont& font, float ascent, float descent,
|
|||||||
underlineColor(underlineColor)
|
underlineColor(underlineColor)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TextStyle::TextStyle(const TextStyle& other)
|
||||||
|
:
|
||||||
|
font(other.font),
|
||||||
|
|
||||||
|
ascent(other.ascent),
|
||||||
|
descent(other.descent),
|
||||||
|
width(other.width),
|
||||||
|
glyphSpacing(other.glyphSpacing),
|
||||||
|
|
||||||
|
fgColor(other.fgColor),
|
||||||
|
bgColor(other.bgColor),
|
||||||
|
|
||||||
|
strikeOut(other.strikeOut),
|
||||||
|
strikeOutColor(other.strikeOutColor),
|
||||||
|
|
||||||
|
underline(other.underline),
|
||||||
|
underlineStyle(other.underlineStyle),
|
||||||
|
underlineColor(other.underlineColor)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
TextStyle::operator==(const TextStyle& other) const
|
||||||
|
{
|
||||||
|
return font == other.font
|
||||||
|
|
||||||
|
&& ascent == other.ascent
|
||||||
|
&& descent == other.descent
|
||||||
|
&& width == other.width
|
||||||
|
&& glyphSpacing == other.glyphSpacing
|
||||||
|
|
||||||
|
&& fgColor == other.fgColor
|
||||||
|
&& bgColor == other.bgColor
|
||||||
|
|
||||||
|
&& strikeOut == other.strikeOut
|
||||||
|
&& strikeOutColor == other.strikeOutColor
|
||||||
|
|
||||||
|
&& underline == other.underline
|
||||||
|
&& underlineStyle == other.underlineStyle
|
||||||
|
&& underlineColor == other.underlineColor;
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,12 +12,17 @@
|
|||||||
|
|
||||||
class TextStyle : public BReferenceable {
|
class TextStyle : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
|
TextStyle();
|
||||||
TextStyle(const BFont& font, float ascent, float descent, float width,
|
TextStyle(const BFont& font, float ascent, float descent, float width,
|
||||||
float glyphSpacing,
|
float glyphSpacing,
|
||||||
rgb_color fgColor, rgb_color bgColor, bool strikeOut,
|
rgb_color fgColor, rgb_color bgColor, bool strikeOut,
|
||||||
rgb_color strikeOutColor, bool underline,
|
rgb_color strikeOutColor, bool underline,
|
||||||
uint32 underlineStyle, rgb_color underlineColor);
|
uint32 underlineStyle, rgb_color underlineColor);
|
||||||
|
|
||||||
|
TextStyle(const TextStyle& other);
|
||||||
|
|
||||||
|
bool operator==(const TextStyle& other) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BFont font;
|
BFont font;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user