[DEV] correction of virtual and refcounter of objects
This commit is contained in:
parent
c2eb3c1467
commit
3237d26474
2
external/airtaudio
vendored
2
external/airtaudio
vendored
@ -1 +1 @@
|
|||||||
Subproject commit bb547a72d99802ac5d9a99c843549f175c856826
|
Subproject commit b0eb151df0802a1d63a5cb6b6812a4460ddd09a1
|
2
external/egami
vendored
2
external/egami
vendored
@ -1 +1 @@
|
|||||||
Subproject commit bb58a8c06e30cf141a59f8a09a544919c1f695ed
|
Subproject commit 34eac48f5114151bab137e9cb177513c7cf42d96
|
@ -65,7 +65,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief Destructor
|
* @brief Destructor
|
||||||
*/
|
*/
|
||||||
~Dimension();
|
virtual ~Dimension();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief string cast :
|
* @brief string cast :
|
||||||
|
@ -47,7 +47,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief generic destructor
|
* @brief generic destructor
|
||||||
*/
|
*/
|
||||||
~Area();
|
virtual ~Area();
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief draw All the refistered text in the current element on openGL
|
* @brief draw All the refistered text in the current element on openGL
|
||||||
|
@ -43,7 +43,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief Basic destructor
|
* @brief Basic destructor
|
||||||
*/
|
*/
|
||||||
~Drawing();
|
virtual ~Drawing();
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* @brief load the openGL program and get all the ID needed
|
* @brief load the openGL program and get all the ID needed
|
||||||
|
@ -101,7 +101,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief generic destructor
|
* @brief generic destructor
|
||||||
*/
|
*/
|
||||||
~Shaper();
|
virtual ~Shaper();
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief draw All the refistered text in the current element on openGL
|
* @brief draw All the refistered text in the current element on openGL
|
||||||
|
@ -19,7 +19,7 @@ namespace ewol {
|
|||||||
* Constructor / destructor
|
* Constructor / destructor
|
||||||
*/
|
*/
|
||||||
ConfigFont();
|
ConfigFont();
|
||||||
~ConfigFont();
|
virtual ~ConfigFont();
|
||||||
private:
|
private:
|
||||||
std::string m_folder;
|
std::string m_folder;
|
||||||
public:
|
public:
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
|
Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
|
||||||
*/
|
*/
|
||||||
@interface OpenglView : UIView {
|
@interface OpenglView : UIView {
|
||||||
|
|
||||||
@private
|
@private
|
||||||
CAEAGLLayer* _eaglLayer;
|
CAEAGLLayer* _eaglLayer;
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ void ewol::object::Manager::remove(const ewol::object::Shared<ewol::Object>& _ob
|
|||||||
EWOL_ERROR("Try to Auto-Remove (nullptr) Object");
|
EWOL_ERROR("Try to Auto-Remove (nullptr) Object");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int32_t count = 0;
|
||||||
auto it(m_eObjectListActive.begin());
|
auto it(m_eObjectListActive.begin());
|
||||||
while (it != m_eObjectListActive.end()) {
|
while (it != m_eObjectListActive.end()) {
|
||||||
if (*it == _object) {
|
if (*it == _object) {
|
||||||
@ -120,13 +121,19 @@ void ewol::object::Manager::remove(const ewol::object::Shared<ewol::Object>& _ob
|
|||||||
EWOL_DEBUG("Auto-Remove Object : [" << _object->getId() << "] type='" << _object->getObjectType() << "' name=" << _object->getName());
|
EWOL_DEBUG("Auto-Remove Object : [" << _object->getId() << "] type='" << _object->getObjectType() << "' name=" << _object->getName());
|
||||||
informOneObjectIsRemoved(_object);
|
informOneObjectIsRemoved(_object);
|
||||||
ewol::getContext().forceRedrawAll();
|
ewol::getContext().forceRedrawAll();
|
||||||
EWOL_DEBUG("Auto-Remove Object ... done (have " << _object->getRefCount() << " references)");
|
EWOL_VERBOSE("Auto-Remove Object ... done (have " << _object->getRefCount() << " references)");
|
||||||
it = m_eObjectListActive.begin();
|
it = m_eObjectListActive.begin();
|
||||||
|
count++;
|
||||||
} else {
|
} else {
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (count == 0) {
|
||||||
EWOL_ERROR("Try to Auto-Remove Object that is not referenced ...");
|
EWOL_ERROR("Try to Auto-Remove Object that is not referenced ...");
|
||||||
|
} else if ( count>1
|
||||||
|
|| count<0) {
|
||||||
|
EWOL_ERROR("Remove more than one object in the system list ==> this is a real problem ...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean all Object that request an autoRemove ...
|
// clean all Object that request an autoRemove ...
|
||||||
|
@ -25,7 +25,7 @@ namespace ewol {
|
|||||||
Context& m_context;
|
Context& m_context;
|
||||||
public:
|
public:
|
||||||
Manager(Context& _context);
|
Manager(Context& _context);
|
||||||
~Manager();
|
virtual ~Manager();
|
||||||
/**
|
/**
|
||||||
* @brief remove all resources (un-init) out of the destructor (due to the system implementation)
|
* @brief remove all resources (un-init) out of the destructor (due to the system implementation)
|
||||||
*/
|
*/
|
||||||
|
@ -32,7 +32,7 @@ namespace ewol {
|
|||||||
std::vector<MessageList> m_messageList; //!< List of all message ...
|
std::vector<MessageList> m_messageList; //!< List of all message ...
|
||||||
public:
|
public:
|
||||||
MultiCast();
|
MultiCast();
|
||||||
~MultiCast();
|
virtual ~MultiCast();
|
||||||
void clear();
|
void clear();
|
||||||
void anonymousSend(const char* const _messageId, const std::string& _data) {
|
void anonymousSend(const char* const _messageId, const std::string& _data) {
|
||||||
send(nullptr, _messageId, _data);
|
send(nullptr, _messageId, _data);
|
||||||
|
@ -59,19 +59,41 @@ void ewol::Object::operator delete[](void* _ptr, std::size_t _sz) {
|
|||||||
EWOL_CRITICAL("custom delete for size ==> not implemented ..." << _sz);
|
EWOL_CRITICAL("custom delete for size ==> not implemented ..." << _sz);
|
||||||
::operator delete(_ptr);
|
::operator delete(_ptr);
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
void ewol::Object::incOwnerCount() {
|
||||||
|
std::unique_lock<std::mutex> lock(m_lockRefCount);
|
||||||
|
m_ownerCount++;
|
||||||
|
if (m_ownerCount>1) {
|
||||||
|
EWOL_CRITICAL("Multiple Owner on one Object ==> very bad ... " << m_ownerCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ewol::Object::decOwnerCount() {
|
||||||
|
std::unique_lock<std::mutex> lock(m_lockRefCount);
|
||||||
|
m_ownerCount--;
|
||||||
|
if (m_ownerCount<0) {
|
||||||
|
EWOL_CRITICAL("Owner remove the owner counter under 1 ==> very bad ... " << m_ownerCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ewol::Object::autoDestroy() {
|
void ewol::Object::autoDestroy() {
|
||||||
EWOL_VERBOSE("Destroy object : [" << getId() << "] type:" << getObjectType());
|
EWOL_VERBOSE("Destroy object : [" << getId() << "] type:" << getObjectType());
|
||||||
|
bool needRemove = false;
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(m_lockRefCount);
|
std::unique_lock<std::mutex> lock(m_lockRefCount);
|
||||||
if (m_isDestroyed == true) {
|
if (m_isDestroyed == true) {
|
||||||
EWOL_WARNING("Request remove of a removed object");
|
EWOL_WARNING("Request remove of a removed object");
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
m_isDestroyed = true;
|
m_isDestroyed = true;
|
||||||
|
needRemove = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (needRemove == true) {
|
||||||
getObjectManager().remove(this);
|
getObjectManager().remove(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ewol::Object::removeObject() {
|
void ewol::Object::removeObject() {
|
||||||
autoDestroy();
|
autoDestroy();
|
||||||
@ -89,6 +111,9 @@ void ewol::Object::respownObject() {
|
|||||||
|
|
||||||
ewol::Object::Object() :
|
ewol::Object::Object() :
|
||||||
m_objRefCount(1),
|
m_objRefCount(1),
|
||||||
|
#ifdef DEBUG
|
||||||
|
m_ownerCount(0),
|
||||||
|
#endif
|
||||||
m_isDestroyed(false),
|
m_isDestroyed(false),
|
||||||
m_static(false),
|
m_static(false),
|
||||||
m_isResource(false) {
|
m_isResource(false) {
|
||||||
@ -100,6 +125,9 @@ ewol::Object::Object() :
|
|||||||
}
|
}
|
||||||
ewol::Object::Object(const std::string& _name) :
|
ewol::Object::Object(const std::string& _name) :
|
||||||
m_objRefCount(1),
|
m_objRefCount(1),
|
||||||
|
#ifdef DEBUG
|
||||||
|
m_ownerCount(0),
|
||||||
|
#endif
|
||||||
m_isDestroyed(false),
|
m_isDestroyed(false),
|
||||||
m_static(false),
|
m_static(false),
|
||||||
m_name(_name),
|
m_name(_name),
|
||||||
@ -114,12 +142,6 @@ ewol::Object::Object(const std::string& _name) :
|
|||||||
ewol::Object::~Object() {
|
ewol::Object::~Object() {
|
||||||
EWOL_DEBUG("delete Object : [" << m_uniqueId << "] : " << getTypeDescription() << " refcount=" << m_objRefCount);
|
EWOL_DEBUG("delete Object : [" << m_uniqueId << "] : " << getTypeDescription() << " refcount=" << m_objRefCount);
|
||||||
getMultiCast().rm(this);
|
getMultiCast().rm(this);
|
||||||
for (size_t iii=0; iii<m_externEvent.size(); ++iii) {
|
|
||||||
if (m_externEvent[iii] != nullptr) {
|
|
||||||
delete(m_externEvent[iii]);
|
|
||||||
m_externEvent[iii] = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_externEvent.clear();
|
m_externEvent.clear();
|
||||||
m_availlableEventId.clear();
|
m_availlableEventId.clear();
|
||||||
m_uniqueId = -1;
|
m_uniqueId = -1;
|
||||||
@ -161,7 +183,13 @@ bool ewol::Object::isTypeCompatible(const std::string& _type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ewol::Object::addEventId(const char * _generateEventId) {
|
void ewol::Object::addEventId(const char * _generateEventId) {
|
||||||
if (nullptr != _generateEventId) {
|
for (auto &it : m_availlableEventId) {
|
||||||
|
if (std::string(it) == _generateEventId) {
|
||||||
|
EWOL_WARNING("Event already existed : '" << it << "' == '" << _generateEventId << "'");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_generateEventId != nullptr) {
|
||||||
m_availlableEventId.push_back(_generateEventId);
|
m_availlableEventId.push_back(_generateEventId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,29 +198,25 @@ void ewol::Object::generateEventId(const char * _generateEventId, const std::str
|
|||||||
int32_t nbObject = getObjectManager().getNumberObject();
|
int32_t nbObject = getObjectManager().getNumberObject();
|
||||||
EWOL_VERBOSE("try send message '" << _generateEventId << "'");
|
EWOL_VERBOSE("try send message '" << _generateEventId << "'");
|
||||||
// for every element registered ...
|
// for every element registered ...
|
||||||
for (size_t iii=0; iii<m_externEvent.size(); ++iii) {
|
for (auto &it : m_externEvent) {
|
||||||
if (nullptr==m_externEvent[iii]) {
|
|
||||||
EWOL_VERBOSE(" Null pointer");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// if we find the event ...
|
// if we find the event ...
|
||||||
if (m_externEvent[iii]->localEventId != _generateEventId) {
|
if (it.localEventId != _generateEventId) {
|
||||||
EWOL_VERBOSE(" wrong event '" << m_externEvent[iii]->localEventId << "' != '" << _generateEventId << "'");
|
EWOL_VERBOSE(" wrong event '" << it.localEventId << "' != '" << _generateEventId << "'");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (m_externEvent[iii]->destObject == nullptr) {
|
if (it.destObject == nullptr) {
|
||||||
EWOL_VERBOSE(" nullptr dest");
|
EWOL_VERBOSE(" nullptr dest");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (m_externEvent[iii]->overloadData.size() <= 0){
|
if (it.overloadData.size() <= 0){
|
||||||
ewol::object::Message tmpMsg(this, m_externEvent[iii]->destEventId, _data);
|
ewol::object::Message tmpMsg(this, it.destEventId, _data);
|
||||||
EWOL_VERBOSE("send message " << tmpMsg);
|
EWOL_VERBOSE("send message " << tmpMsg);
|
||||||
m_externEvent[iii]->destObject->onReceiveMessage(tmpMsg);
|
it.destObject->onReceiveMessage(tmpMsg);
|
||||||
} else {
|
} else {
|
||||||
// set the user requested data ...
|
// set the user requested data ...
|
||||||
ewol::object::Message tmpMsg(this, m_externEvent[iii]->destEventId, m_externEvent[iii]->overloadData);
|
ewol::object::Message tmpMsg(this, it.destEventId, it.overloadData);
|
||||||
EWOL_VERBOSE("send message " << tmpMsg);
|
EWOL_VERBOSE("send message " << tmpMsg);
|
||||||
m_externEvent[iii]->destObject->onReceiveMessage(tmpMsg);
|
it.destObject->onReceiveMessage(tmpMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nbObject > getObjectManager().getNumberObject()) {
|
if (nbObject > getObjectManager().getNumberObject()) {
|
||||||
@ -227,19 +251,15 @@ void ewol::Object::registerOnEvent(const ewol::object::Shared<ewol::Object>& _de
|
|||||||
if ( _eventId[0] == '*'
|
if ( _eventId[0] == '*'
|
||||||
&& _eventId[1] == '\0') {
|
&& _eventId[1] == '\0') {
|
||||||
EWOL_VERBOSE("Register on all event ...");
|
EWOL_VERBOSE("Register on all event ...");
|
||||||
for(size_t iii=0; iii<m_availlableEventId.size(); iii++) {
|
for(auto &it : m_availlableEventId) {
|
||||||
ewol::object::EventExtGen * tmpEvent = new ewol::object::EventExtGen();
|
ewol::object::EventExtGen tmpEvent;
|
||||||
if (nullptr == tmpEvent) {
|
tmpEvent.localEventId = it;
|
||||||
EWOL_ERROR("Allocation error in Register Event...");
|
tmpEvent.destObject = _destinationObject;
|
||||||
continue;
|
tmpEvent.overloadData = _overloadData;
|
||||||
}
|
|
||||||
tmpEvent->localEventId = m_availlableEventId[iii];
|
|
||||||
tmpEvent->destObject = _destinationObject;
|
|
||||||
tmpEvent->overloadData = _overloadData;
|
|
||||||
if (nullptr != _eventIdgenerated) {
|
if (nullptr != _eventIdgenerated) {
|
||||||
tmpEvent->destEventId = _eventIdgenerated;
|
tmpEvent.destEventId = _eventIdgenerated;
|
||||||
} else {
|
} else {
|
||||||
tmpEvent->destEventId = m_availlableEventId[iii];
|
tmpEvent.destEventId = it;
|
||||||
}
|
}
|
||||||
m_externEvent.push_back(tmpEvent);
|
m_externEvent.push_back(tmpEvent);
|
||||||
}
|
}
|
||||||
@ -247,18 +267,18 @@ void ewol::Object::registerOnEvent(const ewol::object::Shared<ewol::Object>& _de
|
|||||||
}
|
}
|
||||||
// check if event existed :
|
// check if event existed :
|
||||||
bool findIt = false;
|
bool findIt = false;
|
||||||
for(size_t iii=0; iii<m_availlableEventId.size(); iii++) {
|
for(auto &it : m_availlableEventId) {
|
||||||
if (m_availlableEventId[iii] == _eventId) {
|
if (it == _eventId) {
|
||||||
findIt = true;
|
findIt = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (false == findIt) {
|
if (false == findIt) {
|
||||||
EWOL_VERBOSE("Try to register with a NON direct string name");
|
EWOL_VERBOSE("Try to register with a NON direct string name");
|
||||||
for(size_t iii=0; iii<m_availlableEventId.size(); iii++) {
|
for(auto &it : m_availlableEventId) {
|
||||||
if (0 == strncmp(m_availlableEventId[iii], _eventId, 1024)) {
|
if (0 == strncmp(it, _eventId, 1024)) {
|
||||||
findIt = true;
|
findIt = true;
|
||||||
_eventId = m_availlableEventId[iii];
|
_eventId = it;
|
||||||
EWOL_VERBOSE("find event ID : '" << _eventId << "' ==> '" << _eventIdgenerated << "'");
|
EWOL_VERBOSE("find event ID : '" << _eventId << "' ==> '" << _eventIdgenerated << "'");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -268,50 +288,54 @@ void ewol::Object::registerOnEvent(const ewol::object::Shared<ewol::Object>& _de
|
|||||||
EWOL_ERROR("Can not register event on this Type=" << getObjectType() << " event=\"" << _eventId << "\" == > unknow event");
|
EWOL_ERROR("Can not register event on this Type=" << getObjectType() << " event=\"" << _eventId << "\" == > unknow event");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ewol::object::EventExtGen * tmpEvent = new ewol::object::EventExtGen();
|
ewol::object::EventExtGen tmpEvent;
|
||||||
if (nullptr == tmpEvent) {
|
tmpEvent.localEventId = _eventId;
|
||||||
EWOL_ERROR("Allocation error in Register Event...");
|
tmpEvent.destObject = _destinationObject;
|
||||||
return;
|
tmpEvent.overloadData = _overloadData;
|
||||||
}
|
|
||||||
tmpEvent->localEventId = _eventId;
|
|
||||||
tmpEvent->destObject = _destinationObject;
|
|
||||||
tmpEvent->overloadData = _overloadData;
|
|
||||||
if (nullptr != _eventIdgenerated) {
|
if (nullptr != _eventIdgenerated) {
|
||||||
tmpEvent->destEventId = _eventIdgenerated;
|
tmpEvent.destEventId = _eventIdgenerated;
|
||||||
} else {
|
} else {
|
||||||
tmpEvent->destEventId = _eventId;
|
tmpEvent.destEventId = _eventId;
|
||||||
}
|
}
|
||||||
m_externEvent.push_back(tmpEvent);
|
m_externEvent.push_back(tmpEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::Object::unRegisterOnEvent(const ewol::object::Shared<ewol::Object>& _destinationObject,
|
void ewol::Object::unRegisterOnEvent(const ewol::object::Shared<ewol::Object>& _destinationObject,
|
||||||
const char * _eventId) {
|
const char * _eventId) {
|
||||||
if (nullptr == _destinationObject) {
|
if (_destinationObject == nullptr) {
|
||||||
EWOL_ERROR("Input ERROR nullptr pointer Object ...");
|
EWOL_ERROR("Input ERROR nullptr pointer Object ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check if event existed :
|
// check if event existed :
|
||||||
for(int64_t iii = m_externEvent.size()-1; iii >= 0; --iii) {
|
auto it(m_externEvent.begin());
|
||||||
if (m_externEvent[iii] == nullptr) {
|
while(it != m_externEvent.end()) {
|
||||||
continue;
|
if (it->destObject == nullptr) {
|
||||||
}
|
m_externEvent.erase(it);
|
||||||
if (m_externEvent[iii]->destObject != _destinationObject) {
|
it = m_externEvent.begin();
|
||||||
continue;
|
} else if ( it->destObject == _destinationObject
|
||||||
}
|
&& it->localEventId == _eventId) {
|
||||||
if (_eventId == nullptr) {
|
m_externEvent.erase(it);
|
||||||
m_externEvent.erase(m_externEvent.begin()+iii);
|
it = m_externEvent.begin();
|
||||||
} else if (m_externEvent[iii]->localEventId == _eventId) {
|
EWOL_INFO("[" << getId() << "] Remove extern event : to object id=" << _destinationObject->getId() << " event=" << _eventId);
|
||||||
m_externEvent.erase(m_externEvent.begin()+iii);
|
} else {
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::Object::onObjectRemove(const ewol::object::Shared<ewol::Object>& _object) {
|
void ewol::Object::onObjectRemove(const ewol::object::Shared<ewol::Object>& _object) {
|
||||||
EWOL_VERBOSE("[" << getId() << "] onObjectRemove(" << _object->getId() << ")");
|
EWOL_VERBOSE("[" << getId() << "] onObjectRemove(" << _object->getId() << ")");
|
||||||
for(int32_t iii=m_externEvent.size()-1; iii >= 0; iii--) {
|
auto it(m_externEvent.begin());
|
||||||
if (m_externEvent[iii] != nullptr) {
|
while(it != m_externEvent.end()) {
|
||||||
m_externEvent.erase(m_externEvent.begin()+iii);
|
if (it->destObject == nullptr) {
|
||||||
EWOL_VERBOSE("[" << getId() << "] Remove extern event : to object id=" << _object->getId());
|
m_externEvent.erase(it);
|
||||||
|
it = m_externEvent.begin();
|
||||||
|
} else if (it->destObject == _object) {
|
||||||
|
m_externEvent.erase(it);
|
||||||
|
it = m_externEvent.begin();
|
||||||
|
EWOL_INFO("[" << getId() << "] Remove extern event : to object id=" << _object->getId());
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,12 @@ namespace ewol {
|
|||||||
static void operator delete(void* _ptr, std::size_t _sz);
|
static void operator delete(void* _ptr, std::size_t _sz);
|
||||||
//! @not-in-doc
|
//! @not-in-doc
|
||||||
static void operator delete[](void* _ptr, std::size_t _sz);
|
static void operator delete[](void* _ptr, std::size_t _sz);
|
||||||
|
#ifdef DEBUG
|
||||||
|
public:
|
||||||
|
int32_t m_ownerCount;
|
||||||
|
void incOwnerCount();
|
||||||
|
void decOwnerCount();
|
||||||
|
#endif
|
||||||
private:
|
private:
|
||||||
static size_t m_valUID; //!< stic used for the unique ID definition
|
static size_t m_valUID; //!< stic used for the unique ID definition
|
||||||
public:
|
public:
|
||||||
@ -157,7 +163,7 @@ namespace ewol {
|
|||||||
return m_uniqueId;
|
return m_uniqueId;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
std::vector<object::EventExtGen*> m_externEvent; //!< Generic list of event generation for output link
|
std::vector<object::EventExtGen> m_externEvent; //!< Generic list of event generation for output link
|
||||||
std::vector<const char*> m_availlableEventId; //!< List of all event availlable for this widget
|
std::vector<const char*> m_availlableEventId; //!< List of all event availlable for this widget
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
@ -54,6 +54,9 @@ namespace ewol {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_pointer->objRefCountIncrement();
|
m_pointer->objRefCountIncrement();
|
||||||
|
#ifdef DEBUG
|
||||||
|
m_pointer->incOwnerCount();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
template<typename T2, typename = typename
|
template<typename T2, typename = typename
|
||||||
std::enable_if<std::is_convertible<T*, T2*>::value>::type>
|
std::enable_if<std::is_convertible<T*, T2*>::value>::type>
|
||||||
@ -65,6 +68,9 @@ namespace ewol {
|
|||||||
m_pointer = _obj.get();
|
m_pointer = _obj.get();
|
||||||
if (m_pointer != nullptr) {
|
if (m_pointer != nullptr) {
|
||||||
m_pointer->objRefCountIncrement();
|
m_pointer->objRefCountIncrement();
|
||||||
|
#ifdef DEBUG
|
||||||
|
m_pointer->incOwnerCount();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -75,6 +81,9 @@ namespace ewol {
|
|||||||
m_pointer = _obj.get();
|
m_pointer = _obj.get();
|
||||||
if (m_pointer != nullptr) {
|
if (m_pointer != nullptr) {
|
||||||
m_pointer->objRefCountIncrement();
|
m_pointer->objRefCountIncrement();
|
||||||
|
#ifdef DEBUG
|
||||||
|
m_pointer->incOwnerCount();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -95,6 +104,9 @@ namespace ewol {
|
|||||||
delete tmp;
|
delete tmp;
|
||||||
} else {
|
} else {
|
||||||
tmp->objRefCountDecrement();
|
tmp->objRefCountDecrement();
|
||||||
|
#ifdef DEBUG
|
||||||
|
tmp->decOwnerCount();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void resetShared() {
|
void resetShared() {
|
||||||
@ -111,6 +123,9 @@ namespace ewol {
|
|||||||
delete tmp;
|
delete tmp;
|
||||||
} else {
|
} else {
|
||||||
tmp->objRefCountDecrement();
|
tmp->objRefCountDecrement();
|
||||||
|
#ifdef DEBUG
|
||||||
|
tmp->decOwnerCount();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
T* get() noexcept {
|
T* get() noexcept {
|
||||||
|
@ -19,7 +19,7 @@ namespace ewol {
|
|||||||
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _object) = 0;
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _object) = 0;
|
||||||
public:
|
public:
|
||||||
RemoveEvent();
|
RemoveEvent();
|
||||||
~RemoveEvent();
|
virtual ~RemoveEvent();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -48,7 +48,7 @@ void ewol::resource::ColorFile::reload() {
|
|||||||
EWOL_ERROR("Can not get basic array : 'color'");
|
EWOL_ERROR("Can not get basic array : 'color'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (int32_t iii = 0; iii < baseArray->size(); ++iii) {
|
for (size_t iii = 0; iii < baseArray->size(); ++iii) {
|
||||||
ejson::Object* tmpObj = baseArray->getObject(iii);
|
ejson::Object* tmpObj = baseArray->getObject(iii);
|
||||||
if (tmpObj == nullptr) {
|
if (tmpObj == nullptr) {
|
||||||
EWOL_DEBUG(" can not get object in 'color' id=" << iii);
|
EWOL_DEBUG(" can not get object in 'color' id=" << iii);
|
||||||
|
@ -29,7 +29,7 @@ ewol::resource::ConfigFile::ConfigFile(const std::string& _filename) :
|
|||||||
|
|
||||||
ewol::resource::ConfigFile::~ConfigFile() {
|
ewol::resource::ConfigFile::~ConfigFile() {
|
||||||
// remove all element
|
// remove all element
|
||||||
for (size_t iii=0; iii<m_list.size(); iii++){
|
for (int32_t iii=0; iii<m_list.size(); iii++){
|
||||||
if (nullptr != m_list[iii]) {
|
if (nullptr != m_list[iii]) {
|
||||||
delete(m_list[iii]);
|
delete(m_list[iii]);
|
||||||
m_list[iii] = nullptr;
|
m_list[iii] = nullptr;
|
||||||
@ -40,7 +40,7 @@ ewol::resource::ConfigFile::~ConfigFile() {
|
|||||||
|
|
||||||
void ewol::resource::ConfigFile::reload() {
|
void ewol::resource::ConfigFile::reload() {
|
||||||
// reset all parameters
|
// reset all parameters
|
||||||
for (size_t iii=0; iii<m_list.size(); iii++){
|
for (int32_t iii=0; iii<m_list.size(); iii++){
|
||||||
if (nullptr != m_list[iii]) {
|
if (nullptr != m_list[iii]) {
|
||||||
m_list[iii] = nullptr;
|
m_list[iii] = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ namespace ewol {
|
|||||||
protected:
|
protected:
|
||||||
DistanceFieldFont(const std::string& _fontName);
|
DistanceFieldFont(const std::string& _fontName);
|
||||||
public:
|
public:
|
||||||
~DistanceFieldFont();
|
virtual ~DistanceFieldFont();
|
||||||
public:
|
public:
|
||||||
float getDisplayRatio(float _size);
|
float getDisplayRatio(float _size);
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,7 @@ namespace ewol {
|
|||||||
protected:
|
protected:
|
||||||
FontFreeType(const std::string& _fontName);
|
FontFreeType(const std::string& _fontName);
|
||||||
public:
|
public:
|
||||||
~FontFreeType();
|
virtual ~FontFreeType();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool getGlyphProperty(int32_t _fontSize,
|
bool getGlyphProperty(int32_t _fontSize,
|
||||||
|
@ -186,6 +186,7 @@ bool ewol::resource::Manager::checkResourceToRemove() {
|
|||||||
if ((*it)->getRefCount() > 3) {
|
if ((*it)->getRefCount() > 3) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
EWOL_DEBUG("Request remove of an resource (refcount in Low : " << (*it)->getRefCount() << ")");
|
||||||
m_resourceList.erase(it);
|
m_resourceList.erase(it);
|
||||||
it = m_resourceList.begin();
|
it = m_resourceList.begin();
|
||||||
return true;
|
return true;
|
||||||
|
@ -32,7 +32,7 @@ namespace ewol {
|
|||||||
* @brief Uninitiamize the resource manager, free all resources previously requested
|
* @brief Uninitiamize the resource manager, free all resources previously requested
|
||||||
* @note when not free == > generate warning, because the segfault can appear after...
|
* @note when not free == > generate warning, because the segfault can appear after...
|
||||||
*/
|
*/
|
||||||
~Manager();
|
virtual ~Manager();
|
||||||
/**
|
/**
|
||||||
* @brief remove all resources (un-init) out of the destructor (due to the system implementation)
|
* @brief remove all resources (un-init) out of the destructor (due to the system implementation)
|
||||||
*/
|
*/
|
||||||
|
@ -48,7 +48,7 @@ namespace ewol {
|
|||||||
Texture(const std::string& _filename);
|
Texture(const std::string& _filename);
|
||||||
Texture();
|
Texture();
|
||||||
public:
|
public:
|
||||||
~Texture();
|
virtual ~Texture();
|
||||||
public:
|
public:
|
||||||
// you must set the size here, because it will be set in multiple of pow(2)
|
// you must set the size here, because it will be set in multiple of pow(2)
|
||||||
void setImageSize(ivec2 newSize);
|
void setImageSize(ivec2 newSize);
|
||||||
|
@ -47,7 +47,7 @@ namespace ewol {
|
|||||||
protected:
|
protected:
|
||||||
TexturedFont(const std::string& _fontName);
|
TexturedFont(const std::string& _fontName);
|
||||||
public:
|
public:
|
||||||
~TexturedFont();
|
virtual ~TexturedFont();
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief get the display height of this font
|
* @brief get the display height of this font
|
||||||
|
@ -40,7 +40,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief Destructor
|
* @brief Destructor
|
||||||
*/
|
*/
|
||||||
~Composer();
|
virtual ~Composer();
|
||||||
/**
|
/**
|
||||||
* @brief load a composition with a file
|
* @brief load a composition with a file
|
||||||
* @param[in] _fileName Name of the file
|
* @param[in] _fileName Name of the file
|
||||||
|
@ -30,7 +30,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief Destructor
|
* @brief Destructor
|
||||||
*/
|
*/
|
||||||
~Container();
|
virtual ~Container();
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief get the main node widget
|
* @brief get the main node widget
|
||||||
|
@ -34,7 +34,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief Destructor
|
* @brief Destructor
|
||||||
*/
|
*/
|
||||||
~Container2();
|
virtual ~Container2();
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* @brief Specify the current widget
|
* @brief Specify the current widget
|
||||||
|
@ -31,7 +31,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief Destructor
|
* @brief Destructor
|
||||||
*/
|
*/
|
||||||
~ContainerN();
|
virtual ~ContainerN();
|
||||||
protected:
|
protected:
|
||||||
bvec2 m_lockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget
|
bvec2 m_lockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget
|
||||||
bvec2 m_subExpend; //!< reference of the sub element expention requested.
|
bvec2 m_subExpend; //!< reference of the sub element expention requested.
|
||||||
|
@ -37,7 +37,7 @@ namespace ewol {
|
|||||||
// TODO : Add a standalone configuration ..
|
// TODO : Add a standalone configuration ..
|
||||||
public:
|
public:
|
||||||
ListFileSystem();
|
ListFileSystem();
|
||||||
~ListFileSystem();
|
virtual ~ListFileSystem();
|
||||||
protected:
|
protected:
|
||||||
ewol::object::Shared<ewol::resource::ColorFile> m_colorProperty; //!< theme color property.
|
ewol::object::Shared<ewol::resource::ColorFile> m_colorProperty; //!< theme color property.
|
||||||
int32_t m_colorIdText; //!< Color of the text.
|
int32_t m_colorIdText; //!< Color of the text.
|
||||||
|
@ -33,7 +33,7 @@ namespace ewol {
|
|||||||
int64_t m_lastPeriodicCallTime; //!< last call time ...
|
int64_t m_lastPeriodicCallTime; //!< last call time ...
|
||||||
public:
|
public:
|
||||||
Manager();
|
Manager();
|
||||||
~Manager();
|
virtual ~Manager();
|
||||||
|
|
||||||
void focusKeep(const ewol::object::Shared<ewol::Widget>& _newWidget); // set the focus at the specific widget
|
void focusKeep(const ewol::object::Shared<ewol::Widget>& _newWidget); // set the focus at the specific widget
|
||||||
void focusSetDefault(const ewol::object::Shared<ewol::Widget>& _newWidget); // select the default focus getter
|
void focusSetDefault(const ewol::object::Shared<ewol::Widget>& _newWidget); // select the default focus getter
|
||||||
|
@ -106,7 +106,7 @@ namespace ewol {
|
|||||||
unicodeValue = 0;
|
unicodeValue = 0;
|
||||||
keyboardMoveValue = ewol::key::keyboardUnknow;
|
keyboardMoveValue = ewol::key::keyboardUnknow;
|
||||||
};
|
};
|
||||||
~EventShortCut() { };
|
virtual ~EventShortCut() { };
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Widget class is the main widget interface, it hase some generic properties:
|
* @brief Widget class is the main widget interface, it hase some generic properties:
|
||||||
|
@ -30,7 +30,7 @@ namespace ewol {
|
|||||||
static const char * const eventChange;
|
static const char * const eventChange;
|
||||||
public:
|
public:
|
||||||
ColorChooser();
|
ColorChooser();
|
||||||
~ColorChooser();
|
virtual ~ColorChooser();
|
||||||
public: // Derived function
|
public: // Derived function
|
||||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||||
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
||||||
|
@ -32,7 +32,7 @@ namespace ewol {
|
|||||||
static const char * const eventClose;
|
static const char * const eventClose;
|
||||||
public:
|
public:
|
||||||
Parameter();
|
Parameter();
|
||||||
~Parameter();
|
virtual ~Parameter();
|
||||||
public: // Derived function
|
public: // Derived function
|
||||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||||
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
||||||
|
@ -30,7 +30,7 @@ namespace ewol {
|
|||||||
m_image(_image) {
|
m_image(_image) {
|
||||||
|
|
||||||
};
|
};
|
||||||
~elementPL() {};
|
virtual ~elementPL() {};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +48,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief std-pop-up destructor.
|
* @brief std-pop-up destructor.
|
||||||
*/
|
*/
|
||||||
~StdPopUp();
|
virtual ~StdPopUp();
|
||||||
protected:
|
protected:
|
||||||
ewol::object::Shared<ewol::widget::Label> m_title; //!< Title Label widget
|
ewol::object::Shared<ewol::widget::Label> m_title; //!< Title Label widget
|
||||||
public:
|
public:
|
||||||
|
@ -17,7 +17,7 @@ def create(target):
|
|||||||
myModule = module.Module(__file__, 'ewol', 'LIBRARY')
|
myModule = module.Module(__file__, 'ewol', 'LIBRARY')
|
||||||
|
|
||||||
# add extra compilation flags :
|
# add extra compilation flags :
|
||||||
#myModule.add_extra_compile_flags()
|
myModule.add_extra_compile_flags()
|
||||||
# add the file to compile:
|
# add the file to compile:
|
||||||
myModule.add_src_file([
|
myModule.add_src_file([
|
||||||
'ewol/ewol.cpp',
|
'ewol/ewol.cpp',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user