[DEBUG] correction of debug and expand of sizer
This commit is contained in:
parent
87676f657a
commit
a5451a9f7f
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
|||||||
Subproject commit dffd6233d37dd886f910ca95d9f176724b6fc4ff
|
Subproject commit 4ffe6c34272127f822d6643273a471a0074e7743
|
@ -9,6 +9,9 @@
|
|||||||
#include <ewol/Dimension.h>
|
#include <ewol/Dimension.h>
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Dimension"
|
||||||
|
|
||||||
// ratio in milimeter :
|
// ratio in milimeter :
|
||||||
static vec2 ratio(9999999,888888);
|
static vec2 ratio(9999999,888888);
|
||||||
static vec2 invRatio(1,1);
|
static vec2 invRatio(1,1);
|
||||||
|
@ -153,7 +153,12 @@ void ewol::EObject::GenerateEventId(const char * generateEventId, const etk::USt
|
|||||||
// if we find the event ...
|
// if we find the event ...
|
||||||
if (m_externEvent[iii]->localEventId == generateEventId) {
|
if (m_externEvent[iii]->localEventId == generateEventId) {
|
||||||
if (NULL != m_externEvent[iii]->destEObject) {
|
if (NULL != m_externEvent[iii]->destEObject) {
|
||||||
|
if (m_externEvent[iii]->overloadData.Size()<=0){
|
||||||
m_externEvent[iii]->destEObject->OnReceiveMessage(this, m_externEvent[iii]->destEventId, data);
|
m_externEvent[iii]->destEObject->OnReceiveMessage(this, m_externEvent[iii]->destEventId, data);
|
||||||
|
} else {
|
||||||
|
// set the user requested data ...
|
||||||
|
m_externEvent[iii]->destEObject->OnReceiveMessage(this, m_externEvent[iii]->destEventId, m_externEvent[iii]->overloadData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,7 +182,7 @@ void ewol::EObject::RegisterMultiCast(const char* const messageId)
|
|||||||
MultiCastAdd(this, messageId);
|
MultiCastAdd(this, messageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::EObject::RegisterOnEvent(ewol::EObject * destinationObject, const char * eventId, const char * eventIdgenerated)
|
void ewol::EObject::RegisterOnEvent(ewol::EObject * destinationObject, const char * eventId, const char * eventIdgenerated, const etk::UString& overloadData)
|
||||||
{
|
{
|
||||||
if (NULL == destinationObject) {
|
if (NULL == destinationObject) {
|
||||||
EWOL_ERROR("Input ERROR NULL pointer EObject ...");
|
EWOL_ERROR("Input ERROR NULL pointer EObject ...");
|
||||||
@ -216,6 +221,7 @@ void ewol::EObject::RegisterOnEvent(ewol::EObject * destinationObject, const cha
|
|||||||
}
|
}
|
||||||
tmpEvent->localEventId = eventId;
|
tmpEvent->localEventId = eventId;
|
||||||
tmpEvent->destEObject = destinationObject;
|
tmpEvent->destEObject = destinationObject;
|
||||||
|
tmpEvent->overloadData = overloadData;
|
||||||
if (NULL != eventIdgenerated) {
|
if (NULL != eventIdgenerated) {
|
||||||
tmpEvent->destEventId = eventIdgenerated;
|
tmpEvent->destEventId = eventIdgenerated;
|
||||||
} else {
|
} else {
|
||||||
|
@ -29,6 +29,7 @@ namespace ewol {
|
|||||||
const char* localEventId; //!< local event Id generation
|
const char* localEventId; //!< local event Id generation
|
||||||
ewol::EObject* destEObject; //!< destination widget that might be call
|
ewol::EObject* destEObject; //!< destination widget that might be call
|
||||||
const char* destEventId; //!< Generated event ID on the distant widget
|
const char* destEventId; //!< Generated event ID on the distant widget
|
||||||
|
etk::UString overloadData; //!< sometimes the user prefer to receive some specific data on an event (instead of the one sed by the widget)
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -107,8 +108,9 @@ namespace ewol {
|
|||||||
* @param[in] destinationObject pointer on the object that might be call when an event is generated
|
* @param[in] destinationObject pointer on the object that might be call when an event is generated
|
||||||
* @param[in] eventId Event generate inside the object
|
* @param[in] eventId Event generate inside the object
|
||||||
* @param[in] eventIdgenerated event generated when call the distant EObject.OnReceiveMessage(...)
|
* @param[in] eventIdgenerated event generated when call the distant EObject.OnReceiveMessage(...)
|
||||||
|
* @param[in] overloadData When the user prever to receive a data specificly for this event ...
|
||||||
*/
|
*/
|
||||||
void RegisterOnEvent(ewol::EObject * destinationObject, const char * eventId, const char * eventIdgenerated = NULL);
|
void RegisterOnEvent(ewol::EObject * destinationObject, const char * eventId, const char * eventIdgenerated = NULL, const etk::UString& overloadData="");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Inform object that an other object is removed ...
|
* @brief Inform object that an other object is removed ...
|
||||||
|
@ -236,21 +236,21 @@ void ewol::openGL::UpdateAllFlags(void)
|
|||||||
|
|
||||||
void ewol::openGL::ActiveTexture(uint32_t flagID)
|
void ewol::openGL::ActiveTexture(uint32_t flagID)
|
||||||
{
|
{
|
||||||
if (l_programId>0) {
|
if (l_programId>=0) {
|
||||||
glActiveTexture(flagID);
|
glActiveTexture(flagID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::openGL::DesActiveTexture(uint32_t flagID)
|
void ewol::openGL::DesActiveTexture(uint32_t flagID)
|
||||||
{
|
{
|
||||||
if (l_programId>0) {
|
if (l_programId>=0) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::openGL::DrawArrays(uint32_t mode, int32_t first, int32_t count)
|
void ewol::openGL::DrawArrays(uint32_t mode, int32_t first, int32_t count)
|
||||||
{
|
{
|
||||||
if (l_programId>0) {
|
if (l_programId>=0) {
|
||||||
UpdateAllFlags();
|
UpdateAllFlags();
|
||||||
glDrawArrays(mode, first, count);
|
glDrawArrays(mode, first, count);
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ void ewol::openGL::DrawArrays(uint32_t mode, int32_t first, int32_t count)
|
|||||||
|
|
||||||
void ewol::openGL::DrawElements(uint32_t mode, const etk::Vector<uint32_t>& indices)
|
void ewol::openGL::DrawElements(uint32_t mode, const etk::Vector<uint32_t>& indices)
|
||||||
{
|
{
|
||||||
if (l_programId>0) {
|
if (l_programId>=0) {
|
||||||
UpdateAllFlags();
|
UpdateAllFlags();
|
||||||
//EWOL_DEBUG("Request draw of " << indices.Size() << "elements");
|
//EWOL_DEBUG("Request draw of " << indices.Size() << "elements");
|
||||||
glDrawElements(mode, indices.Size(), GL_UNSIGNED_INT, &indices[0]);
|
glDrawElements(mode, indices.Size(), GL_UNSIGNED_INT, &indices[0]);
|
||||||
@ -267,7 +267,7 @@ void ewol::openGL::DrawElements(uint32_t mode, const etk::Vector<uint32_t>& indi
|
|||||||
|
|
||||||
void ewol::openGL::DrawElements16(uint32_t mode, const etk::Vector<uint16_t>& indices)
|
void ewol::openGL::DrawElements16(uint32_t mode, const etk::Vector<uint16_t>& indices)
|
||||||
{
|
{
|
||||||
if (l_programId>0) {
|
if (l_programId>=0) {
|
||||||
UpdateAllFlags();
|
UpdateAllFlags();
|
||||||
glDrawElements(mode, indices.Size(), GL_UNSIGNED_SHORT, &indices[0]);
|
glDrawElements(mode, indices.Size(), GL_UNSIGNED_SHORT, &indices[0]);
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ void ewol::openGL::DrawElements16(uint32_t mode, const etk::Vector<uint16_t>& in
|
|||||||
|
|
||||||
void ewol::openGL::DrawElements8(uint32_t mode, const etk::Vector<uint8_t>& indices)
|
void ewol::openGL::DrawElements8(uint32_t mode, const etk::Vector<uint8_t>& indices)
|
||||||
{
|
{
|
||||||
if (l_programId>0) {
|
if (l_programId>=0) {
|
||||||
UpdateAllFlags();
|
UpdateAllFlags();
|
||||||
glDrawElements(mode, indices.Size(), GL_UNSIGNED_BYTE, &indices[0]);
|
glDrawElements(mode, indices.Size(), GL_UNSIGNED_BYTE, &indices[0]);
|
||||||
}
|
}
|
||||||
@ -284,7 +284,11 @@ void ewol::openGL::DrawElements8(uint32_t mode, const etk::Vector<uint8_t>& indi
|
|||||||
|
|
||||||
void ewol::openGL::UseProgram(int32_t id)
|
void ewol::openGL::UseProgram(int32_t id)
|
||||||
{
|
{
|
||||||
// note : program at -1 mean that no use of a program on open GL (here we did not use it ) when 0 ==> program error ...
|
//EWOL_DEBUG("USE prog : " << id);
|
||||||
|
#if 1
|
||||||
|
// note : In normal openGL case, the system might call with the program ID and at the end with 0,
|
||||||
|
// here, we wrap this use to prevent over call of glUseProgram ==> then we set -1 when the
|
||||||
|
// user no more use this program, and just stop grnerating. (chen 0 ==> this is an errored program ...
|
||||||
if (-1==id) {
|
if (-1==id) {
|
||||||
// not used ==> because it is unneded
|
// not used ==> because it is unneded
|
||||||
return;
|
return;
|
||||||
@ -293,6 +297,14 @@ void ewol::openGL::UseProgram(int32_t id)
|
|||||||
l_programId = id;
|
l_programId = id;
|
||||||
glUseProgram(l_programId);
|
glUseProgram(l_programId);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (-1==id) {
|
||||||
|
glUseProgram(0);
|
||||||
|
} else {
|
||||||
|
l_programId = id;
|
||||||
|
glUseProgram(id);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
#include <ewol/renderer/resources/Colored3DObject.h>
|
#include <ewol/renderer/resources/Colored3DObject.h>
|
||||||
#include <ewol/renderer/ResourceManager.h>
|
#include <ewol/renderer/ResourceManager.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Colored3DObject"
|
||||||
|
|
||||||
|
|
||||||
ewol::Colored3DObject::Colored3DObject(etk::UString genName) :
|
ewol::Colored3DObject::Colored3DObject(etk::UString genName) :
|
||||||
ewol::Resource(genName),
|
ewol::Resource(genName),
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/renderer/resources/ConfigFile.h>
|
#include <ewol/renderer/resources/ConfigFile.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "ConfigFile"
|
||||||
|
|
||||||
|
|
||||||
void ewol::SimpleConfigElement::Parse(const etk::UString& value)
|
void ewol::SimpleConfigElement::Parse(const etk::UString& value)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "ewol::FontFreeType"
|
#define __class__ "FontFreeType"
|
||||||
|
|
||||||
|
|
||||||
// free Font hnadle of librairies ... entry for acces ...
|
// free Font hnadle of librairies ... entry for acces ...
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#include <ewol/renderer/resources/image/ImageBMP.h>
|
#include <ewol/renderer/resources/image/ImageBMP.h>
|
||||||
#include <ewol/renderer/resources/image/ImagePNG.h>
|
#include <ewol/renderer/resources/image/ImagePNG.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "TextureFile"
|
||||||
|
|
||||||
ewol::TextureFile::TextureFile(etk::UString genName, etk::UString tmpfileName, ivec2 size) :
|
ewol::TextureFile::TextureFile(etk::UString genName, etk::UString tmpfileName, ivec2 size) :
|
||||||
Texture(genName)
|
Texture(genName)
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
#include <ewol/renderer/resources/Mesh.h>
|
#include <ewol/renderer/resources/Mesh.h>
|
||||||
#include <ewol/renderer/ResourceManager.h>
|
#include <ewol/renderer/ResourceManager.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Mesh"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VERTEX_OLD,
|
VERTEX_OLD,
|
||||||
VERTEX_CENTER_FACE,
|
VERTEX_CENTER_FACE,
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
#include <ewol/renderer/ResourceManager.h>
|
#include <ewol/renderer/ResourceManager.h>
|
||||||
#include <ewol/renderer/resources/MeshObj.h>
|
#include <ewol/renderer/resources/MeshObj.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "MeshObj"
|
||||||
|
|
||||||
ewol::MeshObj::MeshObj(etk::UString _fileName) :
|
ewol::MeshObj::MeshObj(etk::UString _fileName) :
|
||||||
ewol::Mesh(_fileName)
|
ewol::Mesh(_fileName)
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
//#define LOCAL_DEBUG EWOL_VERBOSE
|
//#define LOCAL_DEBUG EWOL_VERBOSE
|
||||||
#define LOCAL_DEBUG EWOL_DEBUG
|
#define LOCAL_DEBUG EWOL_DEBUG
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Program"
|
||||||
|
|
||||||
ewol::Program::Program(const etk::UString& filename) :
|
ewol::Program::Program(const etk::UString& filename) :
|
||||||
ewol::Resource(filename),
|
ewol::Resource(filename),
|
||||||
m_exist(false),
|
m_exist(false),
|
||||||
@ -177,6 +180,7 @@ void ewol::Program::UpdateContext(void)
|
|||||||
checkGlError("glCreateProgram", __LINE__);
|
checkGlError("glCreateProgram", __LINE__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
EWOL_DEBUG("Create program with oglID=" << m_program);
|
||||||
// first attach vertex shader, and after fragment shader
|
// first attach vertex shader, and after fragment shader
|
||||||
for (int32_t iii=0; iii<m_shaderList.Size(); iii++) {
|
for (int32_t iii=0; iii<m_shaderList.Size(); iii++) {
|
||||||
if (NULL != m_shaderList[iii]) {
|
if (NULL != m_shaderList[iii]) {
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
#include <ewol/renderer/resources/Shader.h>
|
#include <ewol/renderer/resources/Shader.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Shader"
|
||||||
|
|
||||||
ewol::Shader::Shader(const etk::UString& filename):
|
ewol::Shader::Shader(const etk::UString& filename):
|
||||||
ewol::Resource(filename),
|
ewol::Resource(filename),
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#include <ewol/renderer/resources/Texture.h>
|
#include <ewol/renderer/resources/Texture.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Texture"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get the next power 2 if the input
|
* @brief get the next power 2 if the input
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#include <ewol/renderer/resources/font/FontBase.h>
|
#include <ewol/renderer/resources/font/FontBase.h>
|
||||||
#include <ewol/renderer/resources/TexturedFont.h>
|
#include <ewol/renderer/resources/TexturedFont.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "TexturedFont"
|
||||||
|
|
||||||
static int32_t nextP2(int32_t value)
|
static int32_t nextP2(int32_t value)
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#include <ewol/renderer/ResourceManager.h>
|
#include <ewol/renderer/ResourceManager.h>
|
||||||
#include <ewol/renderer/resources/VirtualBufferObject.h>
|
#include <ewol/renderer/resources/VirtualBufferObject.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "VirtualBufferObject"
|
||||||
|
|
||||||
ewol::VirtualBufferObject::VirtualBufferObject(const etk::UString& accesMode):
|
ewol::VirtualBufferObject::VirtualBufferObject(const etk::UString& accesMode):
|
||||||
ewol::Resource(),
|
ewol::Resource(),
|
||||||
m_exist(false)
|
m_exist(false)
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "Container"
|
||||||
|
|
||||||
|
|
||||||
widget::Container::Container(ewol::Widget* subElement) :
|
widget::Container::Container(ewol::Widget* subElement) :
|
||||||
m_subWidget(subElement)
|
m_subWidget(subElement)
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#include <ewol/widget/ContainerN.h>
|
#include <ewol/widget/ContainerN.h>
|
||||||
#include <ewol/widget/WidgetManager.h>
|
#include <ewol/widget/WidgetManager.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "ContainerN"
|
||||||
|
|
||||||
|
|
||||||
widget::ContainerN::ContainerN(void) :
|
widget::ContainerN::ContainerN(void) :
|
||||||
m_lockExpand(false,false),
|
m_lockExpand(false,false),
|
||||||
@ -33,11 +36,12 @@ bvec2 widget::ContainerN::CanExpand(void)
|
|||||||
res.setX(true);
|
res.setX(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (false==m_lockExpand.x()) {
|
if (false==m_lockExpand.y()) {
|
||||||
if (true==m_subExpend.x()) {
|
if (true==m_subExpend.y()) {
|
||||||
res.setX(false);
|
res.setY(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//EWOL_DEBUG("Expend check : user=" << m_userExpand << " lock=" << m_lockExpand << " sub=" << m_subExpend << " res=" << res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace widget
|
|||||||
*/
|
*/
|
||||||
void LockExpand(const bvec2& lockExpand);
|
void LockExpand(const bvec2& lockExpand);
|
||||||
// herited function
|
// herited function
|
||||||
bvec2 CanExpand(void);
|
virtual bvec2 CanExpand(void);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Remove all sub element from the widget.
|
* @brief Remove all sub element from the widget.
|
||||||
|
@ -140,7 +140,7 @@ void widget::Sizer::CalculateSize(const vec2& availlable)
|
|||||||
void widget::Sizer::CalculateMinMaxSize(void)
|
void widget::Sizer::CalculateMinMaxSize(void)
|
||||||
{
|
{
|
||||||
//EWOL_DEBUG("[" << GetId() << "] Update minimum Size");
|
//EWOL_DEBUG("[" << GetId() << "] Update minimum Size");
|
||||||
m_userExpand.setValue(false, false);
|
m_subExpend.setValue(false, false);
|
||||||
m_minSize = m_userMinSize.GetPixel();
|
m_minSize = m_userMinSize.GetPixel();
|
||||||
vec2 tmpBorderSize = m_borderSize.GetPixel();
|
vec2 tmpBorderSize = m_borderSize.GetPixel();
|
||||||
|
|
||||||
@ -149,10 +149,10 @@ void widget::Sizer::CalculateMinMaxSize(void)
|
|||||||
if (NULL != m_subWidget[iii]) {
|
if (NULL != m_subWidget[iii]) {
|
||||||
m_subWidget[iii]->CalculateMinMaxSize();
|
m_subWidget[iii]->CalculateMinMaxSize();
|
||||||
if (true == m_subWidget[iii]->CanExpand().x()) {
|
if (true == m_subWidget[iii]->CanExpand().x()) {
|
||||||
m_userExpand.setX(true);
|
m_subExpend.setX(true);
|
||||||
}
|
}
|
||||||
if (true == m_subWidget[iii]->CanExpand().y()) {
|
if (true == m_subWidget[iii]->CanExpand().y()) {
|
||||||
m_userExpand.setY(true);
|
m_subExpend.setY(true);
|
||||||
}
|
}
|
||||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||||
//EWOL_DEBUG("[" << GetId() << "] NewMinSize=" << tmpSize);
|
//EWOL_DEBUG("[" << GetId() << "] NewMinSize=" << tmpSize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user