summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-12-07 15:58:32 +0100
committerSebastian Geerken <devnull@localhost>2012-12-07 15:58:32 +0100
commit9fa93cd7762c3a10443bc6b10c5121db71e2e0af (patch)
treec2737e40a1b45c72815c59a35737798aa61fd480
parentc0bb803ca951d8fc3021b12cad87afa93e4c8dc5 (diff)
Debug message stuff.
-rw-r--r--dw/textblock.hh1
-rw-r--r--dw/textblock_linebreaking.cc22
2 files changed, 17 insertions, 6 deletions
diff --git a/dw/textblock.hh b/dw/textblock.hh
index b1ad3ee8..5e6bfa1c 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -335,6 +335,7 @@ protected:
later set by a_Dw_page_add_space */
};
+ void printWordShort (Word *word);
void printWord (Word *word);
struct Anchor
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index 401e1a88..3a719086 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -191,8 +191,6 @@ void Textblock::BadnessAndPenalty::print ()
#ifdef DEBUG
printf (" [%d + %d - %d vs. %d] + ",
totalWidth, totalStretchability, totalShrinkability, idealWidth);
-#else
- printf (" <no debug> + ");
#endif
printf ("(");
@@ -210,14 +208,15 @@ void Textblock::BadnessAndPenalty::print ()
printf (")");
}
-void Textblock::printWord (Word *word)
+void Textblock::printWordShort (Word *word)
{
switch(word->content.type) {
case core::Content::TEXT:
printf ("\"%s\"", word->content.text);
break;
case core::Content::WIDGET:
- printf ("<widget: %p>", word->content.widget);
+ printf ("<widget: %p (%s)>",
+ word->content.widget, word->content.widget->getClassName());
break;
case core::Content::BREAK:
printf ("<break>");
@@ -226,9 +225,13 @@ void Textblock::printWord (Word *word)
printf ("<?>");
break;
}
+}
- printf (" (flags = %d)", word->flags);
-
+void Textblock::printWord (Word *word)
+{
+ printWordShort (word);
+
+ printf (" (flags = %d)", word->flags);
printf (" [%d / %d + %d - %d => %d + %d - %d] => ",
word->size.width, word->origSpace, word->stretchability,
word->shrinkability, word->totalWidth, word->totalStretchability,
@@ -411,6 +414,13 @@ Textblock::Line *Textblock::addLine (int firstWord, int lastWord,
mustQueueResize = true;
+ //printWordShort (words->getRef (line->firstWord));
+ //printf (" ... ");
+ //printWordShort (words->getRef (line->lastWord));
+ //printf (": ");
+ //words->getRef(line->lastWord)->badnessAndPenalty.print ();
+ //printf ("\n");
+
return line;
}