diff --git a/sources/ewol/UserConfig.cpp b/sources/ewol/UserConfig.cpp deleted file mode 100644 index 1d3cbf08..00000000 --- a/sources/ewol/UserConfig.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @author Edouard DUPIN - * - * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) - */ - - -#include -#include -#include -#include -#include - -class UserConfig : public ewol::EObject -{ - private: - etk::Vector m_list; - etk::UString m_fileName; - public: - UserConfig(void) : m_fileName("USERDATA:generalConfig.xml") - { - m_static = true; // Note : Set the object static notification( Must be set or assert at the end of process) - }; - ~UserConfig(void) { m_list.Clear(); }; - etk::Vector& List(void) { return m_list; }; - etk::UString& FileName(void) { return m_fileName; }; - - void OnObjectRemove(ewol::EObject * _removeObject) - { - for( int32_t iii=m_list.Size()-1 ; iii>=0 ; iii--) { - if (m_list[iii] == _removeObject) { - m_list.Erase(iii); - } - } - }; -}; - - -static UserConfig& l_obj(void) -{ - static UserConfig s_obj; - return s_obj; -} - - -void ewol::userConfig::Init(void) -{ - -} - -void ewol::userConfig::UnInit(void) -{ - -} - - -const ewol::EObject* ewol::userConfig::GetUserConfig(const etk::UString& _name) -{ - if (_name == "") { - return NULL; - } - for (int32_t iii=0; iiiGetName() == _name) { - return l_obj().List()[iii]; - } - } - } - return NULL; -} - -void ewol::userConfig::AddUserConfig(ewol::EObject* _newConfig) -{ - if (_newConfig == NULL) { - return; - } - for (int32_t iii=0; iiiSize(); iii++) { - exml::Element* child = root->GetElement(iii); - if (child==NULL) { - // other than element is trash here - continue; - } - bool elementFound = false; - for (int32_t iii=0; iiiGetName() == child->GetValue()) { - l_obj().List()[iii]->LoadXML(child); - elementFound = true; - break; - } - } - } - if (elementFound==false) { - EWOL_ERROR("(l "<GetPos()<<") node not suported : \""<GetValue()); - } - } - return true; -} - -bool ewol::userConfig::Save(void) -{ - // step 1 : Move the file to prevent writing error - etk::FSNodeHistory(l_obj().FileName(), 9); - - exml::Document doc; - doc.Append(new exml::DeclarationXML("1.0")); - exml::Element * ElementBase = new exml::Element("config"); - doc.Append(ElementBase); - for (int32_t iii=0; iiiGetName().Size() == 0) { - continue; - } - exml::Element* element = new exml::Element(l_obj().List()[iii]->GetName()); - if (NULL != element) { - l_obj().List()[iii]->StoreXML(element); - ElementBase->Append(element); - } - } - //Save Document - doc.Store(l_obj().FileName()); - EWOL_DEBUG("Save in file : " << l_obj().FileName()); - // step 3 : Remove oldest save - return true; -} - - diff --git a/sources/ewol/UserConfig.h b/sources/ewol/UserConfig.h deleted file mode 100644 index ba3aaaf4..00000000 --- a/sources/ewol/UserConfig.h +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @author Edouard DUPIN - * - * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) - */ - -#ifndef __EWOL_USER_CONFIG_H__ -#define __EWOL_USER_CONFIG_H__ - -#include -#include -#include - -namespace ewol -{ - namespace userConfig - { - void Init(void); - void UnInit(void); - const ewol::EObject* GetUserConfig(const etk::UString& _name); - void AddUserConfig(ewol::EObject* _newConfig); - //void RmUserConfig(ewol::EObject* _newConfig); // note : To remove user config ==> just destroy it ==> simple .. - void SetConfigName(const etk::UString& _fileName="USERDATA:generalConfig.xml"); - bool Load(void); - bool Save(void); - }; -}; - -#endif - diff --git a/sources/ewol/clipBoard.cpp b/sources/ewol/clipBoard.cpp index 3df74d97..33693eb1 100644 --- a/sources/ewol/clipBoard.cpp +++ b/sources/ewol/clipBoard.cpp @@ -10,8 +10,7 @@ #include #include -#include -#include +#include #undef __class__ #define __class__ "ClipBoard" diff --git a/sources/ewol/compositing/Area.cpp b/sources/ewol/compositing/Area.cpp index 08625c79..247a0784 100644 --- a/sources/ewol/compositing/Area.cpp +++ b/sources/ewol/compositing/Area.cpp @@ -8,7 +8,6 @@ #include #include -#include #undef __class__ #define __class__ "ewol::Area" @@ -24,7 +23,7 @@ ewol::Area::Area(const ivec2& _size) : m_GLtexID(-1), m_resource(NULL) { - ewol::resource::Keep(m_resource); + ewol::ResourceManager::Keep(m_resource); m_resource->SetImageSize(_size); m_resource->Flush(); LoadProgram(); @@ -33,10 +32,10 @@ ewol::Area::Area(const ivec2& _size) : ewol::Area::~Area(void) { if (NULL != m_resource) { - ewol::resource::Release(m_resource); + ewol::ResourceManager::Release(m_resource); m_resource = NULL; } - ewol::resource::Release(m_GLprogram); + ewol::ResourceManager::Release(m_GLprogram); } void ewol::Area::LoadProgram(void) @@ -44,7 +43,7 @@ void ewol::Area::LoadProgram(void) etk::UString tmpString("DATA:textured3D.prog"); // get the shader resource : m_GLPosition = 0; - if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { + if (true == ewol::ResourceManager::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d"); m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); diff --git a/sources/ewol/compositing/Drawing.cpp b/sources/ewol/compositing/Drawing.cpp index 96662702..9eb12ee7 100644 --- a/sources/ewol/compositing/Drawing.cpp +++ b/sources/ewol/compositing/Drawing.cpp @@ -289,7 +289,7 @@ void ewol::Drawing::ResetCount(void) void ewol::Drawing::UnLoadProgram(void) { if (NULL!=m_GLprogram) { - ewol::resource::Release(m_GLprogram); + ewol::ResourceManager::Release(m_GLprogram); m_GLprogram = NULL; } } @@ -301,7 +301,7 @@ void ewol::Drawing::LoadProgram(void) // oad the new ... etk::UString tmpString("DATA:color3.prog"); // get the shader resource : - if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { + if (true == ewol::ResourceManager::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d"); m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); diff --git a/sources/ewol/compositing/Image.cpp b/sources/ewol/compositing/Image.cpp index 582104b3..233db2c4 100644 --- a/sources/ewol/compositing/Image.cpp +++ b/sources/ewol/compositing/Image.cpp @@ -8,7 +8,6 @@ #include #include -#include #undef __class__ #define __class__ "ewol::Image" @@ -35,10 +34,10 @@ ewol::Image::Image(const etk::UString& _imageName) : ewol::Image::~Image(void) { if (NULL != m_resource) { - ewol::resource::Release(m_resource); + ewol::ResourceManager::Release(m_resource); m_resource = NULL; } - ewol::resource::Release(m_GLprogram); + ewol::ResourceManager::Release(m_GLprogram); } void ewol::Image::LoadProgram(void) @@ -46,7 +45,7 @@ void ewol::Image::LoadProgram(void) etk::UString tmpString("DATA:textured3D.prog"); // get the shader resource : m_GLPosition = 0; - if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { + if (true == ewol::ResourceManager::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d"); m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); @@ -241,14 +240,14 @@ void ewol::Image::SetSource(const etk::UString& _newFile, const vec2& _size) Clear(); // remove old one if (NULL != m_resource) { - ewol::resource::Release(m_resource); + ewol::ResourceManager::Release(m_resource); m_resource = NULL; } ivec2 tmpSize(_size.x(),_size.y()); // note that no image can be loaded... if (_newFile != "") { // link to new One - if (false == ewol::resource::Keep(_newFile, m_resource, tmpSize)) { + if (false == ewol::ResourceManager::Keep(_newFile, m_resource, tmpSize)) { EWOL_ERROR("Can not get Image resource"); } } diff --git a/sources/ewol/compositing/Shaper.cpp b/sources/ewol/compositing/Shaper.cpp index 88b7b723..66116788 100644 --- a/sources/ewol/compositing/Shaper.cpp +++ b/sources/ewol/compositing/Shaper.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #undef __class__ #define __class__ "ewol::Shaper" @@ -52,15 +51,15 @@ ewol::Shaper::~Shaper(void) void ewol::Shaper::UnLoadProgram(void) { if (NULL != m_GLprogram) { - ewol::resource::Release(m_GLprogram); + ewol::ResourceManager::Release(m_GLprogram); m_GLprogram = NULL; } if (NULL != m_resourceTexture) { - ewol::resource::Release(m_resourceTexture); + ewol::ResourceManager::Release(m_resourceTexture); m_resourceTexture = NULL; } if (NULL != m_config) { - ewol::resource::Release(m_config); + ewol::ResourceManager::Release(m_config); m_config = NULL; } } @@ -71,7 +70,7 @@ void ewol::Shaper::LoadProgram(void) EWOL_DEBUG("no Shaper set for loading resources ..."); return; } - if (true == ewol::resource::Keep(m_name, m_config) ) { + if (true == ewol::ResourceManager::Keep(m_name, m_config) ) { m_confIdPaddingX = m_config->Request("PaddingX"); m_confIdPaddingY = m_config->Request("PaddingY"); m_confIdChangeTime = m_config->Request("ChangeTime"); @@ -86,7 +85,7 @@ void ewol::Shaper::LoadProgram(void) EWOL_DEBUG("Shaper try load shader : " << tmpFilename << " with base : " << basicShaderFile); // get the shader resource : m_GLPosition = 0; - if (true == ewol::resource::Keep(tmpFilename, m_GLprogram) ) { + if (true == ewol::ResourceManager::Keep(tmpFilename, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); // Widget property ==> for the Vertex shader @@ -105,7 +104,7 @@ void ewol::Shaper::LoadProgram(void) if (basicImageFile != "") { tmpFilename = file.GetRelativeFolder() + basicImageFile; ivec2 size(64,64); - if (true == ewol::resource::Keep(tmpFilename, m_resourceTexture, size) ) { + if (true == ewol::ResourceManager::Keep(tmpFilename, m_resourceTexture, size) ) { // nothing else to do ... } } diff --git a/sources/ewol/compositing/Sprite.cpp b/sources/ewol/compositing/Sprite.cpp index 270d9aab..99ea162b 100644 --- a/sources/ewol/compositing/Sprite.cpp +++ b/sources/ewol/compositing/Sprite.cpp @@ -8,7 +8,6 @@ #include #include -#include #undef __class__ #define __class__ "ewol::Sprite" diff --git a/sources/ewol/compositing/Text.cpp b/sources/ewol/compositing/Text.cpp index bbb9b4e8..df86db59 100644 --- a/sources/ewol/compositing/Text.cpp +++ b/sources/ewol/compositing/Text.cpp @@ -8,42 +8,11 @@ #include #include -#include - +#include #undef __class__ #define __class__ "ewol::Text" -ewol::Text::Text(void) : - m_position(0.0, 0.0, 0.0), - m_clippingPosStart(0.0, 0.0, 0.0), - m_clippingPosStop(0.0, 0.0, 0.0), - m_clippingEnable(false), - m_color(etk::color::black), - m_colorBg(etk::color::none), - m_colorCursor(etk::color::black), - m_colorSelection(etk::color::olive), - m_mode(ewol::font::Regular), - m_kerning(true), - m_distanceField(false), - m_previousCharcode(0), - m_startTextpos(0), - m_stopTextPos(0), - m_alignement(ewol::Text::alignDisable), - m_GLprogram(NULL), - m_GLPosition(-1), - m_GLMatrix(-1), - m_GLColor(-1), - m_GLtexture(-1), - m_GLtexID(-1), - m_selectionStartPos(-100), - m_cursorPos(-100), - m_font(NULL) -{ - SetFont("", -1); - LoadProgram(); -} - ewol::Text::Text(const etk::UString& _fontName, int32_t _fontSize) : m_position(0.0, 0.0, 0.0), @@ -80,10 +49,10 @@ ewol::Text::~Text(void) { if (NULL != m_font) { - ewol::resource::Release(m_font); + ewol::ResourceManager::Release(m_font); m_font = NULL; } - ewol::resource::Release(m_GLprogram); + ewol::ResourceManager::Release(m_GLprogram); } void ewol::Text::LoadProgram(void) @@ -91,7 +60,7 @@ void ewol::Text::LoadProgram(void) etk::UString tmpString("DATA:text.prog"); // get the shader resource : m_GLPosition = 0; - if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { + if (true == ewol::ResourceManager::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord2d"); m_GLColor = m_GLprogram->GetAttribute("EW_color"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); @@ -347,19 +316,19 @@ void ewol::Text::SetFont(etk::UString _fontName, int32_t _fontSize) Clear(); // remove old one if (NULL != m_font) { - ewol::resource::Release(m_font); + ewol::ResourceManager::Release(m_font); m_font = NULL; } if (_fontSize <= 0) { - _fontSize = ewol::config::FontGetDefaultSize(); + _fontSize = ewol::eSystem::GetSystem().GetFontDefault().GetSize(); } if (_fontName == "") { - _fontName = ewol::config::FontGetDefaultName(); + _fontName = ewol::eSystem::GetSystem().GetFontDefault().GetName(); } _fontName += ":"; _fontName += _fontSize; // link to new One - if (false == ewol::resource::Keep(_fontName, m_font)) { + if (false == ewol::ResourceManager::Keep(_fontName, m_font)) { EWOL_ERROR("Can not get font resource"); } } diff --git a/sources/ewol/compositing/Text.h b/sources/ewol/compositing/Text.h index 4272bf4b..2d179a11 100644 --- a/sources/ewol/compositing/Text.h +++ b/sources/ewol/compositing/Text.h @@ -94,16 +94,12 @@ namespace ewol */ void LoadProgram(void); public: - /** - * @brief generic constructor - */ - Text(void); /** * @brief generic constructor * @param[in] _fontName Name of the font that might be loaded * @param[in] _fontSize Size of the font that might be loaded */ - Text(const etk::UString& _fontName, int32_t _fontSize); + Text(const etk::UString& _fontName="", int32_t _fontSize=-1); /** * @brief generic destructor */ diff --git a/sources/ewol/config.cpp b/sources/ewol/config.cpp deleted file mode 100644 index 7039159e..00000000 --- a/sources/ewol/config.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author Edouard DUPIN - * - * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) - */ - -#include -#include - -#undef __class__ -#define __class__ "ewol::config" - -static etk::UString l_fontConfigFolder = "DATA::fonts"; -static etk::UString l_fontConfigName = "Arial"; -static int32_t l_fontConfigSize = 10; - -void ewol::config::Init(void) -{ - // reset font properties - l_fontConfigFolder = "DATA::fonts"; - l_fontConfigName = "Arial;Helvetica"; - l_fontConfigSize = 10; - ewol::FreeTypeInit(); -} - -void ewol::config::UnInit(void) -{ - // UnInit FreeTypes - ewol::FreeTypeUnInit(); -} - -void ewol::config::FontFolder(const etk::UString& _folder) -{ - l_fontConfigFolder = _folder; -} - -void ewol::config::FontSetDefault(const etk::UString& _fontName, int32_t _size) -{ - l_fontConfigName = _fontName; - l_fontConfigSize = _size; -} - -const etk::UString& ewol::config::FontGetDefaultName(void) -{ - return l_fontConfigName; -} - -int32_t ewol::config::FontGetDefaultSize(void) -{ - return l_fontConfigSize; -} - - - diff --git a/sources/ewol/config.h b/sources/ewol/config.h deleted file mode 100644 index f6f163fc..00000000 --- a/sources/ewol/config.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author Edouard DUPIN - * - * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) - */ - -#ifndef __EWOL_CONFIG_H__ -#define __EWOL_CONFIG_H__ - -#include -#include - -namespace ewol -{ - namespace config - { - /** - * @brief Specify the default font folder for the Ewol search system (only needed when embended font) - * @param[in] _folder basic folder of the font (ex: DATA:fonts) - */ - void FontFolder(const etk::UString& _folder); - /** - * @brief Set the defaut font for all the widgets and basics display. - * @param[in] _fontName The font name requested (not case sensitive) ex "Arial" or multiple separate by ';' ex : "Arial;Helvetica". - * @param[in] _size The default size of the font default=10. - */ - void FontSetDefault(const etk::UString& _fontName, int32_t _size); - /** - * @brief Get the current default font name - * @raturn a reference on the font name string - */ - const etk::UString& FontGetDefaultName(void); - /** - * @brief Get the default font size. - * @return the font size. - */ - int32_t FontGetDefaultSize(void); - - - // Internal section : - - /** - * Init the configuration - */ - void Init(void); - /** - * UnInit the configuration - */ - void UnInit(void); - }; -}; - -#endif - diff --git a/sources/ewol/ewol.cpp b/sources/ewol/ewol.cpp index 1e27bb32..c9ffb000 100644 --- a/sources/ewol/ewol.cpp +++ b/sources/ewol/ewol.cpp @@ -8,23 +8,16 @@ #include #include -#include +#include -#include -#include #include #include #include #include -#include + #undef __class__ #define __class__ "ewol" -/* -void ewol::SetFontSourcesFolder(bool _inOsSystem) -{ - ewol::font::SetFontPropety(_inOsSystem); -} -*/ + int32_t ewol::Run(int32_t _argc, const char* _argv[]) { if (NULL!=_argv) { @@ -32,7 +25,6 @@ int32_t ewol::Run(int32_t _argc, const char* _argv[]) } // init display convertions: ewol::dimension::Init(); - ewol::userConfig::Init(); EWOL_DEBUG("Store commangLine in the specific system"); ewol::commandLine::Clean(); diff --git a/sources/ewol/renderer/ConfigFont.cpp b/sources/ewol/renderer/ConfigFont.cpp new file mode 100644 index 00000000..3f40f683 --- /dev/null +++ b/sources/ewol/renderer/ConfigFont.cpp @@ -0,0 +1,36 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ + +#include +#include + +#undef __class__ +#define __class__ "ConfigFont" + +ewol::ConfigFont::ConfigFont(void) : + m_folder("DATA::fonts"), + m_name("Arial;Helvetica"), + m_size(10), + m_useExternal(false) +{ + ewol::FreeTypeInit(); +} + +ewol::ConfigFont::~ConfigFont(void) +{ + // UnInit FreeTypes + ewol::FreeTypeUnInit(); +} + +void ewol::ConfigFont::Set(const etk::UString& _fontName, int32_t _size) +{ + m_name = _fontName; + m_size = _size; +} + + diff --git a/sources/ewol/renderer/ConfigFont.h b/sources/ewol/renderer/ConfigFont.h new file mode 100644 index 00000000..5184f3d4 --- /dev/null +++ b/sources/ewol/renderer/ConfigFont.h @@ -0,0 +1,75 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ + +#ifndef __EWOL_CONFIG_FONT_H__ +#define __EWOL_CONFIG_FONT_H__ + +#include +#include + +namespace ewol +{ + class ConfigFont + { + public: + /** + * Constructor / destructor + */ + ConfigFont(void); + ~ConfigFont(void); + private: + etk::UString m_folder; + public: + /** + * @brief Specify the default font folder for the Ewol search system (only needed when embended font) + * @param[in] _folder basic folder of the font (ex: DATA:fonts) + */ + void SetFolder(const etk::UString& _folder) { m_folder = _folder; }; + /** + * @brief Get the default font folder. + * @return The default font folder. + */ + const etk::UString& GetFolder(void) { return m_folder; }; + private: + etk::UString m_name; + int32_t m_size; + public: + /** + * @brief Set the defaut font for all the widgets and basics display. + * @param[in] _fontName The font name requested (not case sensitive) ex "Arial" or multiple separate by ';' ex : "Arial;Helvetica". + * @param[in] _size The default size of the font default=10. + */ + void Set(const etk::UString& _fontName, int32_t _size); + /** + * @brief Get the current default font name + * @raturn a reference on the font name string + */ + const etk::UString& GetName(void) { return m_name; }; + /** + * @brief Get the default font size. + * @return the font size. + */ + int32_t GetSize(void) { return m_size; }; + private: + bool m_useExternal; + public: + /** + * @brief Set use of internal/external Font + * @param[in] _val true to enable search of internal data. + */ + void SetUseExternal(bool _val) { m_useExternal=_val; }; + /** + * @brief Get the use of internal/external Font + * @return true to enable search of internal data. + */ + bool GetUseExternal(void) { return m_useExternal; }; + }; +}; + +#endif + diff --git a/sources/ewol/eObject/EConfig.cpp b/sources/ewol/renderer/EConfig.cpp similarity index 96% rename from sources/ewol/eObject/EConfig.cpp rename to sources/ewol/renderer/EConfig.cpp index bfa4eef6..9b7fa306 100644 --- a/sources/ewol/eObject/EConfig.cpp +++ b/sources/ewol/renderer/EConfig.cpp @@ -6,7 +6,7 @@ * @license BSD v3 (see license file) */ -#include +#include #undef __class__ #define __class__ "EConfig" diff --git a/sources/ewol/eObject/EConfig.h b/sources/ewol/renderer/EConfig.h similarity index 100% rename from sources/ewol/eObject/EConfig.h rename to sources/ewol/renderer/EConfig.h diff --git a/sources/ewol/eObject/EMessage.cpp b/sources/ewol/renderer/EMessage.cpp similarity index 92% rename from sources/ewol/eObject/EMessage.cpp rename to sources/ewol/renderer/EMessage.cpp index b829baea..5b5ae459 100644 --- a/sources/ewol/eObject/EMessage.cpp +++ b/sources/ewol/renderer/EMessage.cpp @@ -6,7 +6,7 @@ * @license BSD v3 (see license file) */ -#include +#include #undef __class__ #define __class__ "EMessage" diff --git a/sources/ewol/eObject/EMessage.h b/sources/ewol/renderer/EMessage.h similarity index 100% rename from sources/ewol/eObject/EMessage.h rename to sources/ewol/renderer/EMessage.h diff --git a/sources/ewol/eObject/EObject.cpp b/sources/ewol/renderer/EObject.cpp similarity index 98% rename from sources/ewol/eObject/EObject.cpp rename to sources/ewol/renderer/EObject.cpp index 56a1260a..5313fcaf 100644 --- a/sources/ewol/eObject/EObject.cpp +++ b/sources/ewol/renderer/EObject.cpp @@ -6,11 +6,11 @@ * @license BSD v3 (see license file) */ -#include -#include -#include +#include +#include +#include #include -#include +#include #undef __class__ #define __class__ "ewol::EObject" diff --git a/sources/ewol/eObject/EObject.h b/sources/ewol/renderer/EObject.h similarity index 99% rename from sources/ewol/eObject/EObject.h rename to sources/ewol/renderer/EObject.h index e071d7d2..946f3ad3 100644 --- a/sources/ewol/eObject/EObject.h +++ b/sources/ewol/renderer/EObject.h @@ -21,8 +21,8 @@ namespace ewol { class eSystem; }; -#include -#include +#include +#include namespace ewol { diff --git a/sources/ewol/eObject/EObjectManager.cpp b/sources/ewol/renderer/EObjectManager.cpp similarity index 98% rename from sources/ewol/eObject/EObjectManager.cpp rename to sources/ewol/renderer/EObjectManager.cpp index 6142d857..efe699c9 100644 --- a/sources/ewol/eObject/EObjectManager.cpp +++ b/sources/ewol/renderer/EObjectManager.cpp @@ -6,8 +6,8 @@ * @license BSD v3 (see license file) */ -#include -#include +#include +#include #include #undef __class__ diff --git a/sources/ewol/eObject/EObjectManager.h b/sources/ewol/renderer/EObjectManager.h similarity index 96% rename from sources/ewol/eObject/EObjectManager.h rename to sources/ewol/renderer/EObjectManager.h index 60dd2016..262ce8b9 100644 --- a/sources/ewol/eObject/EObjectManager.h +++ b/sources/ewol/renderer/EObjectManager.h @@ -10,7 +10,7 @@ #define __EWOL_E_OBJECT_MANAGER_H__ #include -#include +#include namespace ewol { diff --git a/sources/ewol/eObject/EObjectMessageMultiCast.cpp b/sources/ewol/renderer/EObjectMessageMultiCast.cpp similarity index 96% rename from sources/ewol/eObject/EObjectMessageMultiCast.cpp rename to sources/ewol/renderer/EObjectMessageMultiCast.cpp index 0367c779..80788d68 100644 --- a/sources/ewol/eObject/EObjectMessageMultiCast.cpp +++ b/sources/ewol/renderer/EObjectMessageMultiCast.cpp @@ -7,8 +7,8 @@ */ #include -#include -#include +#include +#include #undef __class__ #define __class__ "EObjectMessageMultiCast" diff --git a/sources/ewol/eObject/EObjectMessageMultiCast.h b/sources/ewol/renderer/EObjectMessageMultiCast.h similarity index 96% rename from sources/ewol/eObject/EObjectMessageMultiCast.h rename to sources/ewol/renderer/EObjectMessageMultiCast.h index 7208bc4e..0f0a104c 100644 --- a/sources/ewol/eObject/EObjectMessageMultiCast.h +++ b/sources/ewol/renderer/EObjectMessageMultiCast.h @@ -14,7 +14,7 @@ #include #include -#include +#include namespace ewol { class EObjectMessageMultiCast diff --git a/sources/ewol/renderer/Material.cpp b/sources/ewol/renderer/Material.cpp index 6e59c3fc..d5b3ad8d 100644 --- a/sources/ewol/renderer/Material.cpp +++ b/sources/ewol/renderer/Material.cpp @@ -45,7 +45,7 @@ ewol::Material::Material(void) : ewol::Material::~Material(void) { if(NULL!=m_texture0) { - ewol::resource::Release(m_texture0); + ewol::ResourceManager::Release(m_texture0); } } @@ -66,7 +66,7 @@ void ewol::Material::SetTexture0(const etk::UString& _filename) // prevent overloard error : ewol::TextureFile* tmpCopy = m_texture0; m_texture0 = NULL; - if (false == ewol::resource::Keep(_filename, m_texture0, tmpSize)) { + if (false == ewol::ResourceManager::Keep(_filename, m_texture0, tmpSize)) { EWOL_ERROR("Can not load specific texture : " << _filename); // retreave previous texture: m_texture0 = tmpCopy; @@ -74,7 +74,7 @@ void ewol::Material::SetTexture0(const etk::UString& _filename) } if (NULL != tmpCopy) { // really release previous texture. In case of same texture loading, then we did not have reload it .. just increase and decrease index... - ewol::resource::Release(tmpCopy); + ewol::ResourceManager::Release(tmpCopy); } } diff --git a/sources/ewol/renderer/ResourceManager.cpp b/sources/ewol/renderer/ResourceManager.cpp index 007cdb67..26b5818b 100644 --- a/sources/ewol/renderer/ResourceManager.cpp +++ b/sources/ewol/renderer/ResourceManager.cpp @@ -12,72 +12,64 @@ #include #include #include +#include // Specific for the resource : uint32_t ewol::Resource::valBase=0; -static etk::Vector l_resourceList; -static etk::Vector l_resourceListToUpdate; -static bool l_contextHasBeenRemoved = true; -void ewol::resource::Init(void) +ewol::ResourceManager::ResourceManager(void) : + m_contextHasBeenRemoved(true) { - // nothing to do in theory then, we clean the buffers : - // NOTE : If we do domething here, then the system does not work corectly - if (l_resourceList.Size() != 0) { - EWOL_CRITICAL("Start with a resource manager Not empty, number of resources loaded : " << l_resourceList.Size()); - } - l_resourceListToUpdate.Clear(); - l_resourceList.Clear(); - l_contextHasBeenRemoved = true; + // nothing to do ... } -void ewol::resource::UnInit(void) +ewol::ResourceManager::~ResourceManager(void) { Display(); - l_resourceListToUpdate.Clear(); + m_resourceListToUpdate.Clear(); // remove all resources ... - for (int32_t iii=l_resourceList.Size()-1; iii>=0; iii--) { - if (l_resourceList[iii] != NULL) { - EWOL_WARNING("Find a resource that is not removed : [" << l_resourceList[iii]->GetUID() << "]" - << "=\"" << l_resourceList[iii]->GetName() << "\" " - << l_resourceList[iii]->GetCounter() << " elements"); - delete(l_resourceList[iii]); - l_resourceList[iii] = NULL; + for (int32_t iii=m_resourceList.Size()-1; iii>=0; iii--) { + if (m_resourceList[iii] != NULL) { + EWOL_WARNING("Find a resource that is not removed : [" << m_resourceList[iii]->GetUID() << "]" + << "=\"" << m_resourceList[iii]->GetName() << "\" " + << m_resourceList[iii]->GetCounter() << " elements"); + delete(m_resourceList[iii]); + m_resourceList[iii] = NULL; } } - l_resourceList.Clear(); + m_resourceList.Clear(); } -void ewol::resource::Display(void) +void ewol::ResourceManager::Display(void) { EWOL_INFO("Resources loaded : "); // remove all resources ... - for (int32_t iii=l_resourceList.Size()-1; iii>=0; iii--) { - if (l_resourceList[iii] != NULL) { - EWOL_INFO(" [" << l_resourceList[iii]->GetUID() << "]" - << l_resourceList[iii]->GetType() - << "=\"" << l_resourceList[iii]->GetName() << "\" " - << l_resourceList[iii]->GetCounter() << " elements"); + for (int32_t iii=m_resourceList.Size()-1; iii>=0; iii--) { + if (m_resourceList[iii] != NULL) { + EWOL_INFO(" [" << m_resourceList[iii]->GetUID() << "]" + << m_resourceList[iii]->GetType() + << "=\"" << m_resourceList[iii]->GetName() << "\" " + << m_resourceList[iii]->GetCounter() << " elements"); } } EWOL_INFO("Resources ---"); } -void ewol::resource::ReLoadResources(void) +void ewol::ResourceManager::ReLoadResources(void) { EWOL_INFO("------------- Resources re-loaded -------------"); // remove all resources ... - if (l_resourceList.Size() != 0) { + if (m_resourceList.Size() != 0) { for (int32_t jjj=0; jjj=0; iii--) { - if(l_resourceList[iii] != NULL) { - if (jjj==l_resourceList[iii]->GetResourceLevel()) { - l_resourceList[iii]->Reload(); - EWOL_INFO(" [" << l_resourceList[iii]->GetUID() << "]="<< l_resourceList[iii]->GetType()); + for (int32_t iii=m_resourceList.Size()-1; iii>=0; iii--) { + if(m_resourceList[iii] != NULL) { + if (jjj==m_resourceList[iii]->GetResourceLevel()) { + m_resourceList[iii]->Reload(); + EWOL_INFO(" [" << m_resourceList[iii]->GetUID() << "]="<< m_resourceList[iii]->GetType()); } } } @@ -88,48 +80,48 @@ void ewol::resource::ReLoadResources(void) EWOL_INFO("------------- Resources -------------"); } -void ewol::resource::Update(ewol::Resource* object) +void ewol::ResourceManager::Update(ewol::Resource* object) { // chek if not added before - for (int32_t iii=0; iii system use only -void ewol::resource::UpdateContext(void) +void ewol::ResourceManager::UpdateContext(void) { - if (true == l_contextHasBeenRemoved) { + if (true == m_contextHasBeenRemoved) { // need to update all ... - l_contextHasBeenRemoved = false; - if (l_resourceList.Size() != 0) { + m_contextHasBeenRemoved = false; + if (m_resourceList.Size() != 0) { for (int32_t jjj=0; jjjGetResourceLevel()) { + for (int32_t iii=0; iiiGetResourceLevel()) { //EWOL_DEBUG("Update context of " << iii << " named : " << l_resourceList[iii]->GetName()); - l_resourceList[iii]->UpdateContext(); + m_resourceList[iii]->UpdateContext(); } } } } } }else { - if (l_resourceListToUpdate.Size() != 0) { + if (m_resourceListToUpdate.Size() != 0) { for (int32_t jjj=0; jjjGetResourceLevel()) { - l_resourceListToUpdate[iii]->UpdateContext(); + for (int32_t iii=0; iiiGetResourceLevel()) { + m_resourceListToUpdate[iii]->UpdateContext(); } } } @@ -137,20 +129,19 @@ void ewol::resource::UpdateContext(void) } } // Clean the update list - l_resourceListToUpdate.Clear(); + m_resourceListToUpdate.Clear(); } // in this case, it is really too late ... -void ewol::resource::ContextHasBeenDestroyed(void) +void ewol::ResourceManager::ContextHasBeenDestroyed(void) { - for (int32_t iii=0; iiiRemoveContextToLate(); + for (int32_t iii=0; iiiRemoveContextToLate(); } } - ewol::openGL::ContextIsRemoved(); // no context preent ... - l_contextHasBeenRemoved = true; + m_contextHasBeenRemoved = true; } @@ -158,14 +149,14 @@ void ewol::resource::ContextHasBeenDestroyed(void) // internal generic keeper ... -ewol::Resource* ewol::resource::LocalKeep(const etk::UString& filename) +ewol::Resource* ewol::ResourceManager::LocalKeep(const etk::UString& filename) { EWOL_VERBOSE("KEEP (DEFAULT) : file : \"" << filename << "\""); - for (int32_t iii=0; iiiHasName(filename)) { - l_resourceList[iii]->Increment(); - return l_resourceList[iii]; + for (int32_t iii=0; iiiHasName(filename)) { + m_resourceList[iii]->Increment(); + return m_resourceList[iii]; } } } @@ -174,24 +165,24 @@ ewol::Resource* ewol::resource::LocalKeep(const etk::UString& filename) } // internal generic keeper ... -void ewol::resource::LocalAdd(ewol::Resource* object) +void ewol::ResourceManager::LocalAdd(ewol::Resource* object) { //Add ... find empty slot - for (int32_t iii=0; iii(LocalKeep(filename)); + object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(filename)); if (NULL != object) { return true; } @@ -201,15 +192,15 @@ bool ewol::resource::Keep(const etk::UString& filename, ewol::TexturedFont*& obj EWOL_ERROR("allocation error of a resource : " << filename); return false; } - LocalAdd(object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(object); return true; } -bool ewol::resource::Keep(const etk::UString& filename, ewol::FontBase*& object) +bool ewol::ResourceManager::Keep(const etk::UString& filename, ewol::FontBase*& object) { EWOL_VERBOSE("KEEP : Font : file : \"" << filename << "\""); - object = static_cast(LocalKeep(filename)); + object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(filename)); if (NULL != object) { return true; } @@ -219,14 +210,14 @@ bool ewol::resource::Keep(const etk::UString& filename, ewol::FontBase*& object) EWOL_ERROR("allocation error of a resource : " << filename); return false; } - LocalAdd(object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(object); return true; } -bool ewol::resource::Keep(const etk::UString& filename, ewol::Program*& object) +bool ewol::ResourceManager::Keep(const etk::UString& filename, ewol::Program*& object) { EWOL_VERBOSE("KEEP : Program : file : \"" << filename << "\""); - object = static_cast(LocalKeep(filename)); + object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(filename)); if (NULL != object) { return true; } @@ -236,14 +227,14 @@ bool ewol::resource::Keep(const etk::UString& filename, ewol::Program*& object) EWOL_ERROR("allocation error of a resource : " << filename); return false; } - LocalAdd(object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(object); return true; } -bool ewol::resource::Keep(const etk::UString& filename, ewol::Shader*& object) +bool ewol::ResourceManager::Keep(const etk::UString& filename, ewol::Shader*& object) { EWOL_VERBOSE("KEEP : Simpleshader : file : \"" << filename << "\""); - object = static_cast(LocalKeep(filename)); + object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(filename)); if (NULL != object) { return true; } @@ -253,11 +244,11 @@ bool ewol::resource::Keep(const etk::UString& filename, ewol::Shader*& object) EWOL_ERROR("allocation error of a resource : " << filename); return false; } - LocalAdd(object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(object); return true; } -bool ewol::resource::Keep(ewol::Texture*& object) +bool ewol::ResourceManager::Keep(ewol::Texture*& object) { // this element create a new one every time .... object = new ewol::Texture(""); @@ -265,15 +256,15 @@ bool ewol::resource::Keep(ewol::Texture*& object) EWOL_ERROR("allocation error of a resource : ??TEX??"); return false; } - LocalAdd(object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(object); return true; } -bool ewol::resource::Keep(ewol::Colored3DObject*& _object) +bool ewol::ResourceManager::Keep(ewol::Colored3DObject*& _object) { EWOL_VERBOSE("KEEP : direct Colored3DObject"); etk::UString filename = "?metaObject?Colored3DObject"; - _object = static_cast(LocalKeep(filename)); + _object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(filename)); if (NULL != _object) { return true; } @@ -283,7 +274,7 @@ bool ewol::resource::Keep(ewol::Colored3DObject*& _object) EWOL_ERROR("allocation error of a resource : Colored3DObject "); return false; } - LocalAdd(_object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(_object); return true; } #ifdef __TARGET_OS__Android @@ -306,7 +297,7 @@ static int32_t nextP2(int32_t _value) } #endif -bool ewol::resource::Keep(const etk::UString& _filename, ewol::TextureFile*& _object, ivec2 _size) +bool ewol::ResourceManager::Keep(const etk::UString& _filename, ewol::TextureFile*& _object, ivec2 _size) { EWOL_INFO("KEEP : TextureFile : file : " << _filename << " basic size=" << _size); if (_filename == "") { @@ -315,7 +306,7 @@ bool ewol::resource::Keep(const etk::UString& _filename, ewol::TextureFile*& _ob EWOL_ERROR("allocation error of a resource : ??TEX??"); return false; } - LocalAdd(_object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(_object); return true; } if (_size.x()==0) { @@ -346,7 +337,7 @@ bool ewol::resource::Keep(const etk::UString& _filename, ewol::TextureFile*& _ob } EWOL_INFO("KEEP : TextureFile : file : \"" << TmpFilename << "\" new size=" << _size); - _object = static_cast(LocalKeep(TmpFilename)); + _object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(TmpFilename)); if (NULL != _object) { return true; } @@ -357,14 +348,14 @@ bool ewol::resource::Keep(const etk::UString& _filename, ewol::TextureFile*& _ob EWOL_ERROR("allocation error of a resource : " << _filename); return false; } - LocalAdd(_object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(_object); return true; } -bool ewol::resource::Keep(const etk::UString& _meshName, ewol::Mesh*& _object) +bool ewol::ResourceManager::Keep(const etk::UString& _meshName, ewol::Mesh*& _object) { - _object = static_cast(LocalKeep(_meshName)); + _object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(_meshName)); if (NULL != _object) { return true; } @@ -373,12 +364,12 @@ bool ewol::resource::Keep(const etk::UString& _meshName, ewol::Mesh*& _object) EWOL_ERROR("allocation error of a resource : ??Mesh??" << _meshName); return false; } - LocalAdd(_object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(_object); return true; } -bool ewol::resource::Keep(const etk::UString& _accesMode, ewol::VirtualBufferObject*& _object) +bool ewol::ResourceManager::Keep(const etk::UString& _accesMode, ewol::VirtualBufferObject*& _object) { // this element create a new one every time .... _object = new ewol::VirtualBufferObject(_accesMode); @@ -386,14 +377,14 @@ bool ewol::resource::Keep(const etk::UString& _accesMode, ewol::VirtualBufferObj EWOL_ERROR("allocation error of a resource : ??VBO??"); return false; } - LocalAdd(_object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(_object); return true; } -bool ewol::resource::Keep(const etk::UString& filename, ewol::ConfigFile*& object) +bool ewol::ResourceManager::Keep(const etk::UString& filename, ewol::ConfigFile*& object) { EWOL_INFO("KEEP : SimpleConfig : file : \"" << filename << "\""); - object = static_cast(LocalKeep(filename)); + object = static_cast(ewol::eSystem::GetSystem().GetResourcesManager().LocalKeep(filename)); if (NULL != object) { return true; } @@ -403,33 +394,33 @@ bool ewol::resource::Keep(const etk::UString& filename, ewol::ConfigFile*& objec EWOL_ERROR("allocation error of a resource : ??Mesh.obj??"); return false; } - LocalAdd(object); + ewol::eSystem::GetSystem().GetResourcesManager().LocalAdd(object); return true; } -void ewol::resource::Release(ewol::Resource*& object) +void ewol::ResourceManager::Release(ewol::Resource*& object) { if (NULL == object) { EWOL_ERROR("Try to remove a resource that have null pointer ..."); return; } - for (int32_t iii=0; iiiGetName() << "\""); - for (int32_t iii=l_resourceList.Size()-1; iii>=0; iii--) { - if (l_resourceList[iii] != NULL) { - if(l_resourceList[iii] == object) { - if (true == l_resourceList[iii]->Decrement()) { + for (int32_t iii=m_resourceList.Size()-1; iii>=0; iii--) { + if (m_resourceList[iii] != NULL) { + if(m_resourceList[iii] == object) { + if (true == m_resourceList[iii]->Decrement()) { // delete element - delete(l_resourceList[iii]); + delete(m_resourceList[iii]); // remove element from the list : - l_resourceList[iii] = NULL; + m_resourceList[iii] = NULL; } // insidiously remove the pointer for the caller ... object = NULL; @@ -443,68 +434,68 @@ void ewol::resource::Release(ewol::Resource*& object) } -void ewol::resource::Release(ewol::TexturedFont*& object) +void ewol::ResourceManager::Release(ewol::TexturedFont*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::FontBase*& object) +void ewol::ResourceManager::Release(ewol::FontBase*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::Program*& object) +void ewol::ResourceManager::Release(ewol::Program*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::Shader*& object) +void ewol::ResourceManager::Release(ewol::Shader*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::Texture*& object) +void ewol::ResourceManager::Release(ewol::Texture*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::TextureFile*& object) +void ewol::ResourceManager::Release(ewol::TextureFile*& object) { ewol::Resource* object2 = static_cast(object); //EWOL_INFO("RELEASE : TextureFile : nb=" << object2->GetCounter()); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::Mesh*& object) +void ewol::ResourceManager::Release(ewol::Mesh*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::ConfigFile*& object) +void ewol::ResourceManager::Release(ewol::ConfigFile*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::Colored3DObject*& object) +void ewol::ResourceManager::Release(ewol::Colored3DObject*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } -void ewol::resource::Release(ewol::VirtualBufferObject*& object) +void ewol::ResourceManager::Release(ewol::VirtualBufferObject*& object) { ewol::Resource* object2 = static_cast(object); - Release(object2); + ewol::eSystem::GetSystem().GetResourcesManager().Release(object2); object = NULL; } diff --git a/sources/ewol/renderer/ResourceManager.h b/sources/ewol/renderer/ResourceManager.h index e83e2d34..ff8df358 100644 --- a/sources/ewol/renderer/ResourceManager.h +++ b/sources/ewol/renderer/ResourceManager.h @@ -24,96 +24,102 @@ namespace ewol { - namespace resource { - /** - * @brief Initialize the internal variable - */ - void Init(void); - /** - * @brief Uninitiamize the resource manager, free all resources previously requested - * @note when not free ==> generate warning, because the segfault can appear after... - */ - void UnInit(void); - /** - * @brief Display in the log all the resources loaded ... - */ - void Display(void); - /** - * @brief Reload all resources from files, and send there in openGL card if needed. - * @note If File is reference at THEME:XXX:filename if the Theme change the file will reload the newOne - */ - void ReLoadResources(void); - /** - * @brief Call by the system to send all the needed data on the graphic card chen they change ... - * @param[in] object The resources that might be updated - */ - void Update(ewol::Resource* object); - /** - * @brief Call by the system chen the openGL Context has been unexpectially removed ==> This reload all the texture, VBO and other .... - */ - void UpdateContext(void); - /** - * @brief This is to inform the resources manager that we have no more openGl context ... - */ - void ContextHasBeenDestroyed(void); - - // internal API to extent eResources in extern Soft - ewol::Resource* LocalKeep(const etk::UString& filename); - void LocalAdd(ewol::Resource* object); - - /** - * @brief Load the specify resources type - * @param[in] filename The filename of the resources - * @param[in,out] object The resources that might be instanciate. - * @return true if the resource has been loaded corectly. - * @return false An error occured ... - * @note when you call the Keep function, you must call the Realease function ==> otherwise the resources will never be freed - * @note The resources with the same name are loaded only one time, a counter prevent multiple loading... - */ - bool Keep(const etk::UString& filename, ewol::TexturedFont*& object); - bool Keep(const etk::UString& filename, ewol::FontBase*& object); - bool Keep(const etk::UString& filename, ewol::Program*& object); - bool Keep(const etk::UString& filename, ewol::Shader*& object); - bool Keep(ewol::Texture*& object); // no name needed here ... - bool Keep(const etk::UString& filename, ewol::TextureFile*& object, ivec2 size=ivec2(-1,-1)); - bool Keep(const etk::UString& accesMode, ewol::VirtualBufferObject*& object); - bool Keep(const etk::UString& meshName, ewol::Mesh*& object); - bool Keep(const etk::UString& filename, ewol::ConfigFile*& object); - bool Keep(ewol::Colored3DObject*& object); - - // must became : - /* - ewol::Font* KeepFont(const etk::UString& _filename); - ewol::Program* KeepProgram(const etk::UString& _filename); - ewol::Shader* KeepShader(const etk::UString& _filename); - ewol::Texture* KeepTexture(void); - ewol::Texture* KeepTexture(const etk::UString& _filename, const ivec2& size=ivec2(-1,-1)); - void AddTextureResourceCreator(pf* _plop, const etk::UString& _ext); - ewol::Audio* KeepAudio(const etk::UString& _filename, bool _inRam=false); - void AddAudioResourceCreator(pf* _plop, const etk::UString& _ext); - ewol::VirtualBufferObject* KeepVBO(const etk::UString& _accesMode); - ewol::Mesh* KeepMesh(const etk::UString& _filename); - ewol::ConfigFile* KeepConfigFile(const etk::UString& _filename); - ewol::Colored3DObject* Keep3DObject(void); - - void Release(ewol::Resource*& object); - */ - /** - * @brief Release a resources and free it if the Last release is call. - * @param[in,out] object element to realease ==> is return at NULL value. - */ - void Release(ewol::Resource*& object); - void Release(ewol::TexturedFont*& object); - void Release(ewol::FontBase*& object); - void Release(ewol::Program*& object); - void Release(ewol::Shader*& object); - void Release(ewol::Texture*& object); - void Release(ewol::TextureFile*& object); - void Release(ewol::VirtualBufferObject*& object); - void Release(ewol::Mesh*& object); - void Release(ewol::ConfigFile*& object); - void Release(ewol::Colored3DObject*& object); - } + class ResourceManager + { + private: + etk::Vector m_resourceList; + etk::Vector m_resourceListToUpdate; + bool m_contextHasBeenRemoved; + public: + /** + * @brief Initialize the internal variable + */ + ResourceManager(void); + /** + * @brief Uninitiamize the resource manager, free all resources previously requested + * @note when not free ==> generate warning, because the segfault can appear after... + */ + ~ResourceManager(void); + /** + * @brief Display in the log all the resources loaded ... + */ + void Display(void); + /** + * @brief Reload all resources from files, and send there in openGL card if needed. + * @note If File is reference at THEME:XXX:filename if the Theme change the file will reload the newOne + */ + void ReLoadResources(void); + /** + * @brief Call by the system to send all the needed data on the graphic card chen they change ... + * @param[in] object The resources that might be updated + */ + void Update(ewol::Resource* object); + /** + * @brief Call by the system chen the openGL Context has been unexpectially removed ==> This reload all the texture, VBO and other .... + */ + void UpdateContext(void); + /** + * @brief This is to inform the resources manager that we have no more openGl context ... + */ + void ContextHasBeenDestroyed(void); + private: + // internal API to extent eResources in extern Soft + ewol::Resource* LocalKeep(const etk::UString& filename); + void LocalAdd(ewol::Resource* object); + public: + /** + * @brief Load the specify resources type + * @param[in] filename The filename of the resources + * @param[in,out] object The resources that might be instanciate. + * @return true if the resource has been loaded corectly. + * @return false An error occured ... + * @note when you call the Keep function, you must call the Realease function ==> otherwise the resources will never be freed + * @note The resources with the same name are loaded only one time, a counter prevent multiple loading... + */ + static bool Keep(const etk::UString& filename, ewol::TexturedFont*& object); + static bool Keep(const etk::UString& filename, ewol::FontBase*& object); + static bool Keep(const etk::UString& filename, ewol::Program*& object); + static bool Keep(const etk::UString& filename, ewol::Shader*& object); + static bool Keep(ewol::Texture*& object); // no name needed here ... + static bool Keep(const etk::UString& filename, ewol::TextureFile*& object, ivec2 size=ivec2(-1,-1)); + static bool Keep(const etk::UString& accesMode, ewol::VirtualBufferObject*& object); + static bool Keep(const etk::UString& meshName, ewol::Mesh*& object); + static bool Keep(const etk::UString& filename, ewol::ConfigFile*& object); + static bool Keep(ewol::Colored3DObject*& object); + + // must became : + /* + ewol::Font* KeepFont(const etk::UString& _filename); + ewol::Program* KeepProgram(const etk::UString& _filename); + ewol::Shader* KeepShader(const etk::UString& _filename); + ewol::Texture* KeepTexture(void); + ewol::Texture* KeepTexture(const etk::UString& _filename, const ivec2& size=ivec2(-1,-1)); + void AddTextureResourceCreator(pf* _plop, const etk::UString& _ext); + ewol::Audio* KeepAudio(const etk::UString& _filename, bool _inRam=false); + void AddAudioResourceCreator(pf* _plop, const etk::UString& _ext); + ewol::VirtualBufferObject* KeepVBO(const etk::UString& _accesMode); + ewol::Mesh* KeepMesh(const etk::UString& _filename); + ewol::ConfigFile* KeepConfigFile(const etk::UString& _filename); + ewol::Colored3DObject* Keep3DObject(void); + + void Release(ewol::Resource*& object); + */ + /** + * @brief Release a resources and free it if the Last release is call. + * @param[in,out] object element to realease ==> is return at NULL value. + */ + void Release(ewol::Resource*& object); + static void Release(ewol::TexturedFont*& object); + static void Release(ewol::FontBase*& object); + static void Release(ewol::Program*& object); + static void Release(ewol::Shader*& object); + static void Release(ewol::Texture*& object); + static void Release(ewol::TextureFile*& object); + static void Release(ewol::VirtualBufferObject*& object); + static void Release(ewol::Mesh*& object); + static void Release(ewol::ConfigFile*& object); + static void Release(ewol::Colored3DObject*& object); + }; }; diff --git a/sources/ewol/renderer/os/eSystem.cpp b/sources/ewol/renderer/eSystem.cpp similarity index 94% rename from sources/ewol/renderer/os/eSystem.cpp rename to sources/ewol/renderer/eSystem.cpp index f274a75e..bc56930c 100644 --- a/sources/ewol/renderer/os/eSystem.cpp +++ b/sources/ewol/renderer/eSystem.cpp @@ -14,15 +14,12 @@ #include #include -#include +#include +#include -#include -#include - -#include -#include +#include #include -#include +#include #include #include @@ -43,16 +40,6 @@ static etk::Mutex& MutexInterface(void) return s_interfaceMutex; } -/** - * @brief Get the draw mutex (ewol render). - * @note due ti the fact that the system can be called for multiple instance, for naw we just limit the acces to one process at a time. - * @return the main inteface Mutex - */ -static etk::Mutex& MutexDraw(void) -{ - static etk::Mutex s_drawMutex; - return s_drawMutex; -} static ewol::eSystem* l_curentInterface=NULL; ewol::eSystem& ewol::eSystem::GetSystem(void) @@ -251,10 +238,6 @@ ewol::eSystem::eSystem(void) : EWOL_INFO("Build Date: " << date::GetYear() << "/" << date::GetMonth() << "/" << date::GetDay() << " " << date::GetHour() << "h" << date::GetMinute()); // TODO : Remove this ... etk::InitDefaultFolder("ewolApplNoName"); - // TODO : Remove all of this gloabals ... - ewol::openGL::Init(); - ewol::resource::Init(); - ewol::config::Init(); // request the init of the application in the main context of openGL ... { eSystemMessage data; @@ -282,11 +265,11 @@ ewol::eSystem::~eSystem(void) SetSystem(); // call application to uninit APP_UnInit(*this); + if (NULL!=m_windowsCurrent) { + EWOL_ERROR("Main windows has not been removed... ==> memory leek"); + } // unset all windows m_windowsCurrent = NULL; - ewol::config::UnInit(); - ewol::resource::UnInit(); - ewol::openGL::UnInit(); m_msgSystem.Clean(); // release the curent interface : ReleaseSystem(); @@ -461,12 +444,12 @@ bool ewol::eSystem::OS_Draw(bool _displayEveryTime) //! Drawing section : { // Lock OpenGl context: - MutexDraw().Lock(); + ewol::openGL::Lock(); m_FpsSystemContext.Tic(); if (NULL != m_windowsCurrent) { if( true == needRedraw || true == _displayEveryTime) { - ewol::resource::UpdateContext(); + m_resourceManager.UpdateContext(); m_FpsSystemContext.IncrementCounter(); } } @@ -488,7 +471,7 @@ bool ewol::eSystem::OS_Draw(bool _displayEveryTime) //glFinish(); m_FpsFlush.Toc(); // Release Open GL Context - MutexDraw().UnLock(); + ewol::openGL::UnLock(); } m_FpsSystemEvent.Draw(); m_FpsSystemContext.Draw(); @@ -512,7 +495,7 @@ void ewol::eSystem::ResetIOEvent(void) void ewol::eSystem::OS_OpenGlContextDestroy(void) { - ewol::resource::ContextHasBeenDestroyed(); + m_resourceManager.ContextHasBeenDestroyed(); } diff --git a/sources/ewol/renderer/os/eSystem.h b/sources/ewol/renderer/eSystem.h similarity index 94% rename from sources/ewol/renderer/os/eSystem.h rename to sources/ewol/renderer/eSystem.h index 83302f89..905b94a2 100644 --- a/sources/ewol/renderer/os/eSystem.h +++ b/sources/ewol/renderer/eSystem.h @@ -14,12 +14,14 @@ #include #include #include -#include +#include #include #include #include -#include -#include +#include +#include +#include +#include // TODO : Remove this from here ... @@ -75,8 +77,13 @@ class eSystemMessage { namespace ewol { + // TODO : Rename this Context class eSystem { + private: + ewol::ConfigFont m_configFont; //!< global font configuration + public: + ewol::ConfigFont& GetFontDefault(void) { return m_configFont; }; private: ewol::WidgetManager m_widgetManager; //!< global widget manager public: @@ -89,13 +96,17 @@ namespace ewol ewol::EObjectMessageMultiCast m_MessageMulticast; //!< global message multicastiong system public: ewol::EObjectMessageMultiCast& GetEObjectMessageMultiCast(void) { return m_MessageMulticast; }; + private: + ewol::ResourceManager m_resourceManager; //!< global resources Manager + public: + ewol::ResourceManager& GetResourcesManager(void) { return m_resourceManager; }; public: eSystem(void); virtual ~eSystem(void); public: /** * @brief From everyware in the program, we can get the system inteface. - * @return curent pointer on the instance. + * @return current reference on the instance. */ static eSystem& GetSystem(void); protected: diff --git a/sources/ewol/renderer/os/eSystemInput.cpp b/sources/ewol/renderer/eSystemInput.cpp similarity index 98% rename from sources/ewol/renderer/os/eSystemInput.cpp rename to sources/ewol/renderer/eSystemInput.cpp index 39d0af45..f0b52b4d 100644 --- a/sources/ewol/renderer/os/eSystemInput.cpp +++ b/sources/ewol/renderer/eSystemInput.cpp @@ -13,12 +13,10 @@ #include -#include -#include - -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/sources/ewol/renderer/os/eSystemInput.h b/sources/ewol/renderer/eSystemInput.h similarity index 100% rename from sources/ewol/renderer/os/eSystemInput.h rename to sources/ewol/renderer/eSystemInput.h diff --git a/sources/ewol/renderer/openGL.cpp b/sources/ewol/renderer/openGL.cpp index 7e99df96..9d49aae1 100644 --- a/sources/ewol/renderer/openGL.cpp +++ b/sources/ewol/renderer/openGL.cpp @@ -10,6 +10,17 @@ #include #include +/** + * @brief Get the draw mutex (ewol render). + * @note due ti the fact that the system can be called for multiple instance, for naw we just limit the acces to one process at a time. + * @return the main inteface Mutex + */ +static etk::Mutex& MutexOpenGl(void) +{ + static etk::Mutex s_drawMutex; + return s_drawMutex; +} + etk::Vector l_matrixList; mat4 l_matrixCamera; static uint32_t l_flagsCurrent = 0; @@ -17,9 +28,10 @@ static uint32_t l_flagsMustBeSet = 0; static uint32_t l_textureflags = 0; static int32_t l_programId = 0; -void ewol::openGL::Init(void) + +void ewol::openGL::Lock(void) { - // remove deprecated pb ... + MutexOpenGl().Lock(); l_matrixList.Clear(); mat4 tmpMat; l_matrixList.PushBack(tmpMat); @@ -30,17 +42,9 @@ void ewol::openGL::Init(void) l_programId = -1; } - -void ewol::openGL::UnInit(void) +void ewol::openGL::UnLock(void) { - l_matrixList.Clear(); - l_matrixCamera.Identity(); -} - -void ewol::openGL::ContextIsRemoved(void) -{ - // same as call Init, but in case of changing... - ewol::openGL::Init(); + MutexOpenGl().UnLock(); } void ewol::openGL::SetBasicMatrix(const mat4& newOne) diff --git a/sources/ewol/renderer/openGL.h b/sources/ewol/renderer/openGL.h index af71aaaa..531013ca 100644 --- a/sources/ewol/renderer/openGL.h +++ b/sources/ewol/renderer/openGL.h @@ -56,18 +56,13 @@ extern "C" { namespace ewol { namespace openGL { /** - * @brief Initialize the open gl system (all the data register in the graphic card is all time duplicate in the memory) - * this is due to the fact of some operating system destroy sometime the opengl context + * @brief Lock the OpenGL context for one user only ==> better to keep flags and other things ... */ - void Init(void); + void Lock(void); /** - * @brief un-init the opengl element from the graphic card + * @brief Un-lock the OpenGL context for an other user... */ - void UnInit(void); - /** - * @brief Need to call it when openGl context is removed ==> need to reset internal properties ... - */ - void ContextIsRemoved(void); + void UnLock(void); /** * @brief When you will done an opengl rendering, you might call this reset matrix first. It remove all the stach of the matrix pushed. * @param[in] newOne the default matrix that might be set for the graphic card for renderer. if too more pop will be done, this is the last that mmight survived diff --git a/sources/ewol/renderer/os/gui.Android.cpp b/sources/ewol/renderer/os/gui.Android.cpp index 98534d5c..a6cdce34 100644 --- a/sources/ewol/renderer/os/gui.Android.cpp +++ b/sources/ewol/renderer/os/gui.Android.cpp @@ -12,9 +12,8 @@ #include #include #include -#include +#include #include -#include #include /* include auto generated file */ #include diff --git a/sources/ewol/renderer/os/gui.MacOs.OpenglView.mm b/sources/ewol/renderer/os/gui.MacOs.OpenglView.mm index b5521b19..3cca3f8c 100644 --- a/sources/ewol/renderer/os/gui.MacOs.OpenglView.mm +++ b/sources/ewol/renderer/os/gui.MacOs.OpenglView.mm @@ -9,7 +9,7 @@ #import #include -#include +#include #include #include diff --git a/sources/ewol/renderer/os/gui.MacOs.cpp b/sources/ewol/renderer/os/gui.MacOs.cpp index 0e2a7e8b..fedd091f 100644 --- a/sources/ewol/renderer/os/gui.MacOs.cpp +++ b/sources/ewol/renderer/os/gui.MacOs.cpp @@ -15,10 +15,9 @@ #include #include #include -#include #include -#include +#include #include #include diff --git a/sources/ewol/renderer/os/gui.Windows.cpp b/sources/ewol/renderer/os/gui.Windows.cpp index d7fd8585..6a02f6c0 100644 --- a/sources/ewol/renderer/os/gui.Windows.cpp +++ b/sources/ewol/renderer/os/gui.Windows.cpp @@ -15,11 +15,10 @@ #include #include #include -#include #include #include -#include +#include #include #include diff --git a/sources/ewol/renderer/os/gui.X11.cpp b/sources/ewol/renderer/os/gui.X11.cpp index acf3aaba..4955c6c0 100644 --- a/sources/ewol/renderer/os/gui.X11.cpp +++ b/sources/ewol/renderer/os/gui.X11.cpp @@ -10,15 +10,13 @@ #include #include #include -#include #include #include #include #include -#include #include -#include +#include #include #include diff --git a/sources/ewol/renderer/os/gui.directFB.cpp b/sources/ewol/renderer/os/gui.directFB.cpp index 5f12c319..99f7c118 100644 --- a/sources/ewol/renderer/os/gui.directFB.cpp +++ b/sources/ewol/renderer/os/gui.directFB.cpp @@ -33,10 +33,9 @@ #include #include #include -#include #include -#include +#include #include #include diff --git a/sources/ewol/renderer/os/gui.h b/sources/ewol/renderer/os/gui.h deleted file mode 100644 index e69de29b..00000000 diff --git a/sources/ewol/renderer/resources/Colored3DObject.cpp b/sources/ewol/renderer/resources/Colored3DObject.cpp index d2ef0603..a4744c63 100644 --- a/sources/ewol/renderer/resources/Colored3DObject.cpp +++ b/sources/ewol/renderer/resources/Colored3DObject.cpp @@ -21,7 +21,7 @@ ewol::Colored3DObject::Colored3DObject(etk::UString _genName) : etk::UString tmpString("DATA:simple3D.prog"); // get the shader resource : m_GLPosition = 0; - if (true == ewol::resource::Keep(tmpString, m_GLprogram) ) { + if (true == ewol::ResourceManager::Keep(tmpString, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d"); m_GLColor = m_GLprogram->GetUniform("EW_color"); m_GLMatrix = m_GLprogram->GetUniform("EW_MatrixTransformation"); @@ -31,7 +31,7 @@ ewol::Colored3DObject::Colored3DObject(etk::UString _genName) : ewol::Colored3DObject::~Colored3DObject(void) { // remove dynamics dependencies : - ewol::resource::Release(m_GLprogram); + ewol::ResourceManager::Release(m_GLprogram); } diff --git a/sources/ewol/renderer/resources/FontFreeType.cpp b/sources/ewol/renderer/resources/FontFreeType.cpp index fede8952..2a8a6438 100644 --- a/sources/ewol/renderer/resources/FontFreeType.cpp +++ b/sources/ewol/renderer/resources/FontFreeType.cpp @@ -23,11 +23,17 @@ // free Font hnadle of librairies ... entry for acces ... +static int32_t l_countLoaded=0; static FT_Library library; void ewol::FreeTypeInit(void) { EWOL_DEBUG("==> Init Font-Manager"); + l_countLoaded++; + if (l_countLoaded>1) { + // already loaded ... + return; + } int32_t error = FT_Init_FreeType( &library ); if(0 != error) { EWOL_CRITICAL(" when loading FreeType Librairy ..."); @@ -37,6 +43,11 @@ void ewol::FreeTypeInit(void) void ewol::FreeTypeUnInit(void) { EWOL_DEBUG("==> Un-Init Font-Manager"); + l_countLoaded--; + if (l_countLoaded>0) { + // already needed ... + return; + } int32_t error = FT_Done_FreeType( library ); library = NULL; if(0 != error) { diff --git a/sources/ewol/renderer/resources/Mesh.cpp b/sources/ewol/renderer/resources/Mesh.cpp index 72c07452..5351152e 100644 --- a/sources/ewol/renderer/resources/Mesh.cpp +++ b/sources/ewol/renderer/resources/Mesh.cpp @@ -33,7 +33,7 @@ ewol::Mesh::Mesh(const etk::UString& _fileName, const etk::UString& _shaderName) //EWOL_DEBUG(m_name << " " << m_light); - if (true == ewol::resource::Keep(_shaderName, m_GLprogram) ) { + if (true == ewol::ResourceManager::Keep(_shaderName, m_GLprogram) ) { m_GLPosition = m_GLprogram->GetAttribute("EW_coord3d"); m_GLtexture = m_GLprogram->GetAttribute("EW_texture2d"); m_GLNormal = m_GLprogram->GetAttribute("EW_normal"); @@ -44,7 +44,7 @@ ewol::Mesh::Mesh(const etk::UString& _fileName, const etk::UString& _shaderName) m_light.Link(m_GLprogram, "EW_directionalLight"); } // this is the properties of the buffer requested : "r"/"w" + "-" + buffer type "f"=flaot "i"=integer - ewol::resource::Keep("w-fff", m_verticesVBO); + ewol::ResourceManager::Keep("w-fff", m_verticesVBO); // load the curent file : etk::UString tmpName = _fileName.ToLower(); @@ -68,8 +68,8 @@ ewol::Mesh::Mesh(const etk::UString& _fileName, const etk::UString& _shaderName) ewol::Mesh::~Mesh(void) { // remove dynamics dependencies : - ewol::resource::Release(m_GLprogram); - ewol::resource::Release(m_verticesVBO); + ewol::ResourceManager::Release(m_GLprogram); + ewol::ResourceManager::Release(m_verticesVBO); if (m_functionFreeShape!=NULL) { m_functionFreeShape(m_pointerShape); m_pointerShape = NULL; diff --git a/sources/ewol/renderer/resources/Program.cpp b/sources/ewol/renderer/resources/Program.cpp index 78e11afc..132dbb08 100644 --- a/sources/ewol/renderer/resources/Program.cpp +++ b/sources/ewol/renderer/resources/Program.cpp @@ -37,14 +37,14 @@ ewol::Program::Program(const etk::UString& filename) : // remove extention ... tmpFilename.Remove(tmpFilename.Size()-4, 4); ewol::Shader* tmpShader = NULL; - if (false == ewol::resource::Keep(tmpFilename+"vert", tmpShader)) { + if (false == ewol::ResourceManager::Keep(tmpFilename+"vert", tmpShader)) { EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename); return; } else { EWOL_DEBUG("Add shader on program : "<< tmpFilename << "vert"); m_shaderList.PushBack(tmpShader); } - if (false == ewol::resource::Keep(tmpFilename+"frag", tmpShader)) { + if (false == ewol::ResourceManager::Keep(tmpFilename+"frag", tmpShader)) { EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename); return; } else { @@ -81,7 +81,7 @@ ewol::Program::Program(const etk::UString& filename) : // get it with relative position : etk::UString tmpFilename = file.GetRelativeFolder() + tmpData; ewol::Shader* tmpShader = NULL; - if (false == ewol::resource::Keep(tmpFilename, tmpShader)) { + if (false == ewol::ResourceManager::Keep(tmpFilename, tmpShader)) { EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename); } else { EWOL_DEBUG("Add shader on program : "<< tmpFilename); @@ -99,7 +99,7 @@ ewol::Program::Program(const etk::UString& filename) : ewol::Program::~Program(void) { for (int32_t iii=0; iii #include -#include - #include +#include #include #include @@ -68,16 +67,6 @@ static int32_t simpleSQRT(int32_t value) return val; } -static bool& GetFontInSystem(void) -{ - static bool fontInOs = true; - return fontInOs; -} - -void ewol::font::SetFontPropety(bool inOSSystem) -{ - GetFontInSystem() = inOSSystem; -} ewol::TexturedFont::TexturedFont(etk::UString fontName) : ewol::Texture(fontName) @@ -123,14 +112,14 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) : m_size = tmpSize; etk::Vector folderList; - if (true==GetFontInSystem()) { + if (true==ewol::eSystem::GetSystem().GetFontDefault().GetUseExternal()) { #if defined(__TARGET_OS__Android) folderList.PushBack("/system/fonts"); #elif defined(__TARGET_OS__Linux) folderList.PushBack("/usr/share/fonts/truetype"); #endif } - folderList.PushBack("DATA:fonts"); + folderList.PushBack(ewol::eSystem::GetSystem().GetFontDefault().GetFolder()); for (int32_t folderID=0; folderID #include -#include +#include #undef __class__ #define __class__ "Button" diff --git a/sources/ewol/widget/ButtonColor.cpp b/sources/ewol/widget/ButtonColor.cpp index c7b2b868..93a3181c 100644 --- a/sources/ewol/widget/ButtonColor.cpp +++ b/sources/ewol/widget/ButtonColor.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include extern const char * const ewolEventButtonColorChange = "ewol-Button-Color-Change"; diff --git a/sources/ewol/widget/Entry.cpp b/sources/ewol/widget/Entry.cpp index 1f98a9a6..6979077c 100644 --- a/sources/ewol/widget/Entry.cpp +++ b/sources/ewol/widget/Entry.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include diff --git a/sources/ewol/widget/Menu.cpp b/sources/ewol/widget/Menu.cpp index 46d77dfa..632daaeb 100644 --- a/sources/ewol/widget/Menu.cpp +++ b/sources/ewol/widget/Menu.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include diff --git a/sources/ewol/widget/Widget.cpp b/sources/ewol/widget/Widget.cpp index 0e73a997..a2b5b438 100644 --- a/sources/ewol/widget/Widget.cpp +++ b/sources/ewol/widget/Widget.cpp @@ -7,12 +7,11 @@ */ #include -#include +#include #include #include #include -#include -#include +#include #undef __class__ #define __class__ "DrawProperty" diff --git a/sources/ewol/widget/Widget.h b/sources/ewol/widget/Widget.h index fd1de978..801145e9 100644 --- a/sources/ewol/widget/Widget.h +++ b/sources/ewol/widget/Widget.h @@ -9,7 +9,7 @@ #ifndef __EWOL_WIDGET_H__ #define __EWOL_WIDGET_H__ -#include +#include #include namespace ewol { diff --git a/sources/ewol/widget/Windows.cpp b/sources/ewol/widget/Windows.cpp index ee26cd3b..0b7240af 100644 --- a/sources/ewol/widget/Windows.cpp +++ b/sources/ewol/widget/Windows.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sources/ewol/widget/meta/Parameter.cpp b/sources/ewol/widget/meta/Parameter.cpp index 02b8ff90..5d81a241 100644 --- a/sources/ewol/widget/meta/Parameter.cpp +++ b/sources/ewol/widget/meta/Parameter.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include @@ -213,7 +212,8 @@ void widget::Parameter::OnReceiveMessage(const ewol::EMessage& _msg) // Close this widget ... AutoDestroy(); } else if (_msg.GetMessage() == ewolEventParameterSave) { - ewol::userConfig::Save(); + //ewol::userConfig::Save(); + EWOL_TODO("Save Parameter !!! "); } else if (_msg.GetMessage() == l_eventMenuSelected) { if (NULL != m_wSlider) { int32_t value = 0; diff --git a/sources/lutin_ewol.py b/sources/lutin_ewol.py index 4d8a1e73..7c3be2ee 100755 --- a/sources/lutin_ewol.py +++ b/sources/lutin_ewol.py @@ -15,34 +15,30 @@ def Create(target): 'ewol/ewol.cpp', 'ewol/clipBoard.cpp', 'ewol/debug.cpp', - 'ewol/config.cpp', 'ewol/commandLine.cpp', 'ewol/key.cpp', 'ewol/cursor.cpp', - 'ewol/Dimension.cpp', - 'ewol/UserConfig.cpp']) + 'ewol/Dimension.cpp']) # Basic Eobject of EWOL - myModule.AddSrcFile([ - 'ewol/eObject/EConfig.cpp', - 'ewol/eObject/EMessage.cpp', - 'ewol/eObject/EObject.cpp', - 'ewol/eObject/EObjectManager.cpp', - 'ewol/eObject/EObjectMessageMultiCast.cpp']) + myModule.AddSrcFile([]) #openGl Basic access abstraction (for the model matrix and include myModule.AddSrcFile([ + 'ewol/renderer/EConfig.cpp', + 'ewol/renderer/EMessage.cpp', + 'ewol/renderer/EObject.cpp', + 'ewol/renderer/EObjectManager.cpp', + 'ewol/renderer/EObjectMessageMultiCast.cpp', 'ewol/renderer/openGL.cpp', + 'ewol/renderer/ConfigFont.cpp', 'ewol/renderer/EventInput.cpp', 'ewol/renderer/EventEntry.cpp', 'ewol/renderer/EventTime.cpp', 'ewol/renderer/Light.cpp', - 'ewol/renderer/Material.cpp']) - - # Operating System interface - myModule.AddSrcFile([ - 'ewol/renderer/os/eSystem.cpp', - 'ewol/renderer/os/eSystemInput.cpp']) + 'ewol/renderer/Material.cpp', + 'ewol/renderer/eSystem.cpp', + 'ewol/renderer/eSystemInput.cpp']) # renderer : myModule.AddSrcFile([