edn/sources/appl/GlyphPainting.hpp

54 lines
1.3 KiB
C++
Raw Normal View History

2016-05-02 22:01:55 +02:00
/** @file
2013-10-23 21:19:30 +02:00
* @author Edouard DUPIN
* @copyright 2010, Edouard DUPIN, all right reserved
* @license GPL v3 (see license file)
*/
2016-05-02 22:01:55 +02:00
#pragma once
2013-10-23 21:19:30 +02:00
2016-10-03 22:01:55 +02:00
#include <etk/types.hpp>
#include <ewol/debug.hpp>
#include <gale/resource/Resource.hpp>
#include <appl/GlyphDecoration.hpp>
2013-10-23 21:19:30 +02:00
namespace appl {
class GlyphPainting : public gale::Resource {
2013-10-23 21:19:30 +02:00
private:
2017-08-28 00:09:10 +02:00
etk::Vector<appl::GlyphDecoration> m_list;
2013-10-23 21:19:30 +02:00
protected:
GlyphPainting();
2018-09-29 21:59:06 +02:00
void init(const etk::Uri& _uri);
2014-05-20 21:35:41 +02:00
public:
2018-09-29 21:59:06 +02:00
DECLARE_RESOURCE_URI_FACTORY(GlyphPainting);
virtual ~GlyphPainting();
2013-10-23 21:19:30 +02:00
public:
2013-10-24 07:46:24 +02:00
/**
* @brief Load or reload data from config
*/
void reload();
2013-10-24 07:46:24 +02:00
/**
* @brief Register a decoration with his name and get the ref id.
* @param[in] _name Name of the deco.
* @return id of the deco.
*/
2017-08-28 00:09:10 +02:00
int32_t request(const etk::String& _name);
2013-10-24 07:46:24 +02:00
/**
* @brief Get Decoration handle.
* @param[in] _id Id of the decoration.
2013-10-25 22:12:34 +02:00
* @return reference on deco.
2013-10-24 07:46:24 +02:00
*/
const appl::GlyphDecoration& get(int32_t _id) const {
2013-10-24 21:09:58 +02:00
return m_list[_id];
};
2013-10-25 22:12:34 +02:00
/**
* @brief Operator to get decoration handle.
* @param[in] _pos Id of the decoration.
* @return reference on deco.
*/
const appl::GlyphDecoration& operator[] (int32_t _pos) const {
2013-10-25 22:12:34 +02:00
return m_list[_pos];
}
2013-10-23 21:19:30 +02:00
};
2016-05-02 22:01:55 +02:00
}
2013-10-23 21:19:30 +02:00
2013-10-25 22:12:34 +02:00