aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/widget.cc10
-rw-r--r--lout/debug.hh50
2 files changed, 60 insertions, 0 deletions
diff --git a/dw/widget.cc b/dw/widget.cc
index a91a749b..3360a799 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -1951,20 +1951,30 @@ void Widget::removeChild (Widget *child)
void splitHeightPreserveAscent (int height, int *ascent, int *descent)
{
+ DBG_OBJ_ENTER_S ("resize", 1, "splitHeightPreserveAscent", "%d, %d, %d",
+ height, *ascent, *descent);
+
*descent = height - *ascent;
if (*descent < 0) {
*descent = 0;
*ascent = height;
}
+
+ DBG_OBJ_LEAVE_VAL_S ("%d, %d", *ascent, *descent);
}
void splitHeightPreserveDescent (int height, int *ascent, int *descent)
{
+ DBG_OBJ_ENTER_S ("resize", 1, "splitHeightPreserveDescent", "%d, %d, %d",
+ height, *ascent, *descent);
+
*ascent = height - *descent;
if (*ascent < 0) {
*ascent = 0;
*descent = height;
}
+
+ DBG_OBJ_LEAVE_VAL_S ("%d, %d", *ascent, *descent);
}
} // namespace core
diff --git a/lout/debug.hh b/lout/debug.hh
index 5c0169e3..86b45c7f 100644
--- a/lout/debug.hh
+++ b/lout/debug.hh
@@ -31,6 +31,56 @@
#include "debug_rtfl.hh"
+/* Some extensions for RTFL dealing with static stuff. */
+
+#ifdef DBG_RTFL
+
+#define DBG_OBJ_MSG_S(aspect, prio, msg) \
+ RTFL_OBJ_PRINT ("msg", "s:s:d:s", "<static>", aspect, prio, msg)
+
+#define DBG_OBJ_MSGF_S(aspect, prio, fmt, ...) \
+ STMT_START { \
+ char msg[256]; \
+ snprintf (msg, sizeof (msg), fmt, __VA_ARGS__); \
+ RTFL_OBJ_PRINT ("msg", "s:s:d:s", "<static>", aspect, prio, msg) \
+ } STMT_END
+
+#define DBG_OBJ_ENTER0_S(aspect, prio, funname) \
+ RTFL_OBJ_PRINT ("enter", "s:s:d:s:", "<static>", aspect, prio, funname);
+
+#define DBG_OBJ_ENTER_S(aspect, prio, funname, fmt, ...) \
+ STMT_START { \
+ char args[256]; \
+ snprintf (args, sizeof (args), fmt, __VA_ARGS__); \
+ RTFL_OBJ_PRINT ("enter", "s:s:d:s:s", "<static>", aspect, prio, funname, \
+ args); \
+ } STMT_END
+
+#define DBG_OBJ_LEAVE_S() \
+ RTFL_OBJ_PRINT ("leave", "s", "<static>");
+
+#define DBG_OBJ_LEAVE_VAL_S(fmt, ...) \
+ STMT_START { \
+ char vals[256]; \
+ snprintf (vals, sizeof (vals), fmt, __VA_ARGS__); \
+ RTFL_OBJ_PRINT ("leave", "s:s", "<static>", vals); \
+ } STMT_END
+
+#else /* DBG_RTFL */
+
+#define STMT_NOP do { } while (0)
+
+#define DBG_IF_RTFL if(0)
+
+#define DBG_OBJ_MSG_S(aspect, prio, msg) STMT_NOP
+#define DBG_OBJ_MSGF_S(aspect, prio, fmt, ...) STMT_NOP
+#define DBG_OBJ_ENTER0_S(aspect, prio, funname) STMT_NOP
+#define DBG_OBJ_ENTER_S(aspect, prio, funname, fmt, ...) STMT_NOP
+#define DBG_OBJ_LEAVE_S() STMT_NOP
+#define DBG_OBJ_LEAVE_VAL_S(fmt, ...) STMT_NOP
+
+#endif /* DBG_RTFL */
+
#endif /* __LOUT_DEBUG_H__ */