edn/sources/appl/GlyphDecoration.cpp

56 lines
1.3 KiB
C++
Raw Normal View History

/**
* @author Edouard DUPIN
2012-11-25 11:55:06 +01:00
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
2013-10-25 20:49:26 +02:00
#include <appl/debug.h>
2012-04-24 09:42:14 +02:00
#include <appl/global.h>
#include <appl/GlyphDecoration.h>
#undef __class__
2013-10-23 21:19:30 +02:00
#define __class__ "GlyphDecoration"
2013-11-14 21:57:10 +01:00
appl::GlyphDecoration::GlyphDecoration(const std::string &_newColorName) :
m_colorName(_newColorName),
2013-07-09 15:18:53 +02:00
m_colorFG(etk::color::black),
m_colorBG(etk::color::none),
m_italic(false),
m_bold(false)
{
2013-10-23 21:19:30 +02:00
APPL_VERBOSE("New(" << __class__ << ")");
}
2013-10-23 21:19:30 +02:00
void appl::GlyphDecoration::setItalic(bool _enable)
{
m_italic = _enable;
if (true == _enable) {
APPL_VERBOSE("color : \"" << m_colorName << "\" enable italic");
} else {
APPL_VERBOSE("color : \"" << m_colorName << "\" disable italic");
}
}
2013-10-23 21:19:30 +02:00
void appl::GlyphDecoration::setBold(bool _enable)
{
m_bold = _enable;
if (true == _enable) {
APPL_VERBOSE("color : \"" << m_colorName << "\" enable bold");
} else {
APPL_VERBOSE("color : \"" << m_colorName << "\" disable bold");
}
}
2014-04-30 22:18:00 +02:00
std::ostream& appl::operator <<(std::ostream& _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;
}