edn/sources/appl/GlyphDecoration.cpp

45 lines
1.2 KiB
C++
Raw Normal View History

2016-05-02 22:01:55 +02:00
/** @file
* @author Edouard DUPIN
2012-11-25 11:55:06 +01:00
* @copyright 2010, Edouard DUPIN, all right reserved
* @license GPL v3 (see license file)
*/
2016-10-03 22:01:55 +02:00
#include <appl/debug.hpp>
#include <appl/global.hpp>
#include <appl/GlyphDecoration.hpp>
2017-08-28 00:09:10 +02:00
appl::GlyphDecoration::GlyphDecoration(const etk::String &_newColorName) :
2016-05-02 22:01:55 +02:00
m_colorName(_newColorName),
m_colorFG(etk::color::black),
m_colorBG(etk::color::none),
m_italic(false),
m_bold(false) {
APPL_VERBOSE("create");
}
2016-05-02 22:01:55 +02:00
void appl::GlyphDecoration::setItalic(bool _enable) {
m_italic = _enable;
2016-05-02 22:01:55 +02:00
if (_enable == true) {
APPL_VERBOSE("color : \"" << m_colorName << "\" enable italic");
} else {
APPL_VERBOSE("color : \"" << m_colorName << "\" disable italic");
}
}
2016-05-02 22:01:55 +02:00
void appl::GlyphDecoration::setBold(bool _enable) {
m_bold = _enable;
2016-05-02 22:01:55 +02:00
if (_enable == true) {
APPL_VERBOSE("color : \"" << m_colorName << "\" enable bold");
} else {
APPL_VERBOSE("color : \"" << m_colorName << "\" disable bold");
}
}
2017-08-28 00:09:10 +02:00
etk::Stream& appl::operator <<(etk::Stream& _os, const appl::GlyphDecoration& _obj) {
2013-10-23 21:19:30 +02:00
_os << "{fg=" << _obj.getForeground();
_os << ",bg=" << _obj.getBackground();
_os << ",italic=" << _obj.getItalic();
_os << ",bold=" << _obj.getBold();
_os << "name='" << _obj.getName() << "'}";
return _os;
}