From bcd6b8230b4a109b9eb35456b882cbd3d8ed9dae Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 15 Sep 2014 22:22:41 +0200 Subject: [PATCH] [DEV] update Readme --- README.md | 4 +++- sources/ewol/object/Manager.h | 14 ++++++++++++-- sources/ewol/object/Object.cpp | 2 ++ sources/ewol/object/Object.h | 4 ++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9dbb8e52..79f8e6b7 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,9 @@ Dependency packages # For andoid compilation (jdk 7 does not work...) sudo apt-get install javacc openjdk-6-jdk # if you want to compile for windows : - sudo apt-get install mingw32 + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get install gcc-mingw-w64 # on 64 bits processor for compatibility sudo apt-get install ia32-libs diff --git a/sources/ewol/object/Manager.h b/sources/ewol/object/Manager.h index 8f031b80..046dd6cc 100644 --- a/sources/ewol/object/Manager.h +++ b/sources/ewol/object/Manager.h @@ -31,8 +31,12 @@ namespace ewol { * @return number of Object */ int32_t getNumberObject(); + /** + * @brief Display all object Open. + */ void displayListObject(); private: + //! @not-in-doc friend class ewol::Object; /** * @brief Internal API that used only with Object toi reference itself in the manager. @@ -41,10 +45,16 @@ namespace ewol { */ void add(const std::shared_ptr& _object); public: + /** + * @brief clean the weak pointer list (remove weak_ptr that is remoed) + */ void cleanInternalRemoved(); - + /** + * @brief Retrive an Object with his name + * @param[in] _name Name of the Object + * @return Pointer on the finded Object. + */ std::shared_ptr get(const std::string& _name); - public: /** * @brief retrive an object with his name diff --git a/sources/ewol/object/Object.cpp b/sources/ewol/object/Object.cpp index c5aef84b..e97001e3 100644 --- a/sources/ewol/object/Object.cpp +++ b/sources/ewol/object/Object.cpp @@ -28,6 +28,7 @@ void ewol::Object::autoDestroy() { parent->requestDestroyFromChild(shared_from_this()); } //if no parent ==> noting to do ... + m_destroy = true; } void ewol::Object::requestDestroyFromChild(const std::shared_ptr& _child) { @@ -46,6 +47,7 @@ void ewol::Object::removeParent() { ewol::Object::Object() : m_objectHasBeenInit(false), + m_destroy(false), m_static(false), m_name(*this, "name", "", "Object name, might be a unique reference in all the program"), m_isResource(false) { diff --git a/sources/ewol/object/Object.h b/sources/ewol/object/Object.h index 62911e48..836d17e6 100644 --- a/sources/ewol/object/Object.h +++ b/sources/ewol/object/Object.h @@ -79,6 +79,7 @@ namespace ewol { } protected: std::weak_ptr m_parent; + bool m_destroy; protected: /** * @brief Auto-destroy the object @@ -88,6 +89,9 @@ namespace ewol { virtual void destroy() { autoDestroy(); } + bool isDestroyed() const { + return m_destroy; + } public: virtual void requestDestroyFromChild(const std::shared_ptr& _child); virtual void setParent(const std::shared_ptr& _newParent);