2016-05-02 22:01:55 +02:00
|
|
|
/** @file
|
2011-07-20 10:33:24 +02:00
|
|
|
* @author Edouard DUPIN
|
2012-11-25 11:55:06 +01:00
|
|
|
* @copyright 2010, Edouard DUPIN, all right reserved
|
|
|
|
* @license GPL v3 (see license file)
|
2011-07-20 10:33:24 +02:00
|
|
|
*/
|
2016-10-03 22:01:55 +02:00
|
|
|
#include <appl/debug.hpp>
|
|
|
|
#include <appl/global.hpp>
|
|
|
|
#include <appl/GlyphDecoration.hpp>
|
2011-07-20 10:33:24 +02:00
|
|
|
|
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");
|
2011-07-20 10:33:24 +02:00
|
|
|
}
|
|
|
|
|
2016-05-02 22:01:55 +02:00
|
|
|
void appl::GlyphDecoration::setItalic(bool _enable) {
|
2013-06-26 23:48:23 +02:00
|
|
|
m_italic = _enable;
|
2016-05-02 22:01:55 +02:00
|
|
|
if (_enable == true) {
|
2013-06-26 23:48:23 +02:00
|
|
|
APPL_VERBOSE("color : \"" << m_colorName << "\" enable italic");
|
2011-07-20 10:33:24 +02:00
|
|
|
} else {
|
2013-06-26 23:48:23 +02:00
|
|
|
APPL_VERBOSE("color : \"" << m_colorName << "\" disable italic");
|
2011-07-20 10:33:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-02 22:01:55 +02:00
|
|
|
void appl::GlyphDecoration::setBold(bool _enable) {
|
2013-06-26 23:48:23 +02:00
|
|
|
m_bold = _enable;
|
2016-05-02 22:01:55 +02:00
|
|
|
if (_enable == true) {
|
2013-06-26 23:48:23 +02:00
|
|
|
APPL_VERBOSE("color : \"" << m_colorName << "\" enable bold");
|
2011-07-20 10:33:24 +02:00
|
|
|
} else {
|
2013-06-26 23:48:23 +02:00
|
|
|
APPL_VERBOSE("color : \"" << m_colorName << "\" disable bold");
|
2011-07-20 10:33:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|