[DEV] add debug in shaper

This commit is contained in:
Edouard DUPIN 2016-01-28 22:47:03 +01:00
parent 01ca0392fe
commit 03232752f1
2 changed files with 31 additions and 21 deletions

View File

@ -622,11 +622,38 @@ bool ewol::compositing::Shaper::hasSources() {
const etk::Color<float>& ewol::compositing::Shaper::getColor(int32_t _id) {
static const etk::Color<float> errorValue(0,0,0,0);
if (m_colorProperty == nullptr) {
EWOL_WARNING("nullptr of m_colorProperty ==> return #0000 for id " << _id);
return errorValue;
}
return m_colorProperty->get(_id);
}
int32_t ewol::compositing::Shaper::requestColor(const std::string& _name) {
if (m_colorProperty == nullptr) {
EWOL_WARNING("nullptr of m_colorProperty ==> return -1 for name " << _name);
return -1;
}
return m_colorProperty->request(_name);
}
int32_t ewol::compositing::Shaper::requestConfig(const std::string& _name) {
if (m_config == nullptr) {
EWOL_WARNING("nullptr of m_config ==> return -1 for name " << _name);
return -1;
}
return m_config->request(_name);
}
double ewol::compositing::Shaper::getConfigNumber(int32_t _id) {
if ( _id == -1
|| m_config == nullptr) {
EWOL_WARNING("nullptr of m_config ==> return 0.0 for id " << _id);
return 0.0;
}
return m_config->getNumber(_id);
}
namespace etk {
template<> std::string to_string<ewol::compositing::Shaper>(const ewol::compositing::Shaper& _obj) {
return _obj.getSource();
@ -641,5 +668,4 @@ namespace etk {
template<> bool from_string<ewol::compositing::Shaper>(ewol::compositing::Shaper& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}
};
};

View File

@ -231,12 +231,7 @@ namespace ewol {
* @param[in] _name Name of the element requested
* @return The Id of the color
*/
int32_t requestColor(const std::string& _name) {
if (m_colorProperty == nullptr) {
return -1;
}
return m_colorProperty->request(_name);
}
int32_t requestColor(const std::string& _name);
/**
* @brief Get The color associated at an ID.
* @param[in] _id Id of the color
@ -249,24 +244,13 @@ namespace ewol {
* @param[in] _name Name of the element requested
* @return The Id of the element
*/
int32_t requestConfig(const std::string& _name) {
if (m_config == nullptr) {
return -1;
}
return m_config->request(_name);
}
int32_t requestConfig(const std::string& _name);
/**
* @brief Get The number associated at an ID.
* @param[in] _id Id of the parameter
* @return the requested number.
*/
double getConfigNumber(int32_t _id) {
if ( _id == -1
|| m_config == nullptr) {
return 0.0;
}
return m_config->getNumber(_id);
}
double getConfigNumber(int32_t _id);
public:
/**
* @brief Set activate state of the element