diff options
-rw-r--r-- | dw/oofpositionedmgr.cc | 38 | ||||
-rw-r--r-- | lout/debug_rtfl.hh | 16 | ||||
-rw-r--r-- | lout/misc.hh | 2 |
3 files changed, 46 insertions, 10 deletions
diff --git a/dw/oofpositionedmgr.cc b/dw/oofpositionedmgr.cc index 661c5bb9..9a248cf5 100644 --- a/dw/oofpositionedmgr.cc +++ b/dw/oofpositionedmgr.cc @@ -208,9 +208,7 @@ bool OOFPositionedMgr::haveExtremesChanged () DBG_OBJ_MSG_END (); - DBG_OBJ_MSGF ("resize.oofm", 1, "=> %s", changed ? "true" : "false"); - DBG_OBJ_LEAVE (); - + DBG_OBJ_LEAVE_VAL ("%s", boolToStr (changed)); return changed; } @@ -571,36 +569,56 @@ int OOFPositionedMgr::getPosBorder (style::Length cssValue, int refLength) bool OOFPositionedMgr::isHPosComplete (Child *child) { - return (style::isAbsLength (child->widget->getStyle()->left) || - style::isPerLength (child->widget->getStyle()->left)) && + DBG_OBJ_ENTER ("resize.oofm", 0, "isHPosComplete", "[%p]", child->widget); + bool b = + (style::isAbsLength (child->widget->getStyle()->left) || + style::isPerLength (child->widget->getStyle()->left)) && (style::isAbsLength (child->widget->getStyle()->right) || style::isPerLength (child->widget->getStyle()->right)); + DBG_OBJ_LEAVE_VAL ("%s", boolToStr (b)); + return b; } bool OOFPositionedMgr::isVPosComplete (Child *child) { - return (style::isAbsLength (child->widget->getStyle()->top) || - style::isPerLength (child->widget->getStyle()->top)) && + DBG_OBJ_ENTER ("resize.oofm", 0, "isVPosComplete", "[%p]", child->widget); + bool b = + (style::isAbsLength (child->widget->getStyle()->top) || + style::isPerLength (child->widget->getStyle()->top)) && (style::isAbsLength (child->widget->getStyle()->bottom) || style::isPerLength (child->widget->getStyle()->bottom)); + DBG_OBJ_LEAVE_VAL ("%s", boolToStr (b)); + return b; } bool OOFPositionedMgr::isHPosCalculable (Child *child, bool allocated) { - return + DBG_OBJ_ENTER ("resize.oofm", 0, "isHPosCalculable", "[%p], %s", + child->widget, boolToStr (allocated)); + bool b = allocated || (isHPosComplete (child) && child->reference == container); + DBG_OBJ_LEAVE_VAL ("%s", boolToStr (b)); + return b; } bool OOFPositionedMgr::isVPosCalculable (Child *child, bool allocated) { - return + DBG_OBJ_ENTER ("resize.oofm", 0, "isVPosCalculable", "[%p], %s", + child->widget, boolToStr (allocated)); + bool b = allocated || (isVPosComplete (child) && child->reference == container); + DBG_OBJ_LEAVE_VAL ("%s", boolToStr (b)); + return b; } bool OOFPositionedMgr::isPosCalculable (Child *child, bool allocated) { - return isHPosCalculable (child, allocated) && + DBG_OBJ_ENTER ("resize.oofm", 0, "isPosCalculable", "[%p], %s", + child->widget, boolToStr (allocated)); + bool b = isHPosCalculable (child, allocated) && isVPosCalculable (child, allocated); + DBG_OBJ_LEAVE_VAL ("%s", boolToStr (b)); + return b; } void OOFPositionedMgr::calcPosAndSizeChildOfChild (Child *child, int refWidth, diff --git a/lout/debug_rtfl.hh b/lout/debug_rtfl.hh index 7134238c..72a06138 100644 --- a/lout/debug_rtfl.hh +++ b/lout/debug_rtfl.hh @@ -183,6 +183,20 @@ inline void rtfl_print (const char *version, const char *file, int line, #define DBG_OBJ_LEAVE_O(obj) \ RTFL_OBJ_PRINT ("leave", "p", obj); +#define DBG_OBJ_LEAVE_VAL(fmt, ...) \ + STMT_START { \ + char vals[256]; \ + snprintf (vals, sizeof (vals), fmt, __VA_ARGS__); \ + RTFL_OBJ_PRINT ("leave", "p:s", this, vals); \ + } STMT_END + +#define DBG_OBJ_LEAVE_VAL_O(obj, fmt, ...) \ + STMT_START { \ + char vals[256]; \ + snprintf (vals, sizeof (vals), fmt, __VA_ARGS__); \ + RTFL_OBJ_PRINT ("leave", "p:s", obj, vals); \ + } STMT_END + #define DBG_OBJ_CREATE(klass) \ DBG_OBJ_CREATE_O (this, klass) @@ -343,6 +357,8 @@ inline void rtfl_print (const char *version, const char *file, int line, #define DBG_OBJ_ENTER_O(aspect, prio, obj, funname, fmt, ...) STMT_NOP #define DBG_OBJ_LEAVE() STMT_NOP #define DBG_OBJ_LEAVE_O(obj) STMT_NOP +#define DBG_OBJ_LEAVE_VAL(fmt, ...) STMT_NOP +#define DBG_OBJ_LEAVE_VAL_O(obj, fmt, ...) STMT_NOP #define DBG_OBJ_CREATE(klass) STMT_NOP #define DBG_OBJ_CREATE_O(obj, klass) STMT_NOP #define DBG_OBJ_DELETE() STMT_NOP diff --git a/lout/misc.hh b/lout/misc.hh index a0beb1b6..1bc1c1de 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -64,6 +64,8 @@ inline int AsciiStrcasecmp(const char *s1, const char *s2) return ret; } +inline const char *boolToStr (bool b) { return b ? "true" : "false"; } + /** * \brief Simple (simpler than container::untyped::Vector and * container::typed::Vector) template based vector. |