diff options
author | Sebastian Geerken <devnull@localhost> | 2013-01-05 11:48:21 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-01-05 11:48:21 +0100 |
commit | 824cd84f321d358ab878b99cbaaef936823d8c8b (patch) | |
tree | 8eafc276a7adc25c4708e3d6806f0d6f387b0a77 /dw/types.cc | |
parent | cdc11dcd40d57b07e73304d0f41ad5273d292874 (diff) |
Debug messages.
Diffstat (limited to 'dw/types.cc')
-rw-r--r-- | dw/types.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/dw/types.cc b/dw/types.cc index dc243ad7..4835f95b 100644 --- a/dw/types.cc +++ b/dw/types.cc @@ -276,5 +276,50 @@ Content::Type Content::maskForSelection (bool followReferences) return (Content::Type)(Content::SELECTION_CONTENT | widgetMask); } +void Content::print (Content *content) +{ + switch(content->type) { + case START: + printf ("<start>"); + break; + case END: + printf ("<end>"); + break; + case TEXT: + printf ("\"%s\"", content->text); + break; + case WIDGET_IN_FLOW: + printf ("<widget in flow: %p (%s)>", + content->widget, content->widget->getClassName()); + break; + case WIDGET_OOF_REF: + printf ("<widget oof ref: %p (%s)>", + content->widget, content->widget->getClassName()); + break; + case WIDGET_OOF_CONT: + printf ("<widge oof cont: %p (%s)>", + content->widget, content->widget->getClassName()); + break; + case BREAK: + printf ("<break>"); + break; + default: + printf ("<?>"); + break; + } +} + +void Content::printMask (Type mask) +{ + printf ("%s:%s:%s:%s:%s:%s:%s", + (mask & START) ? "st" : "--", + (mask & END) ? "en" : "--", + (mask & TEXT) ? "tx" : "--", + (mask & WIDGET_IN_FLOW) ? "wf" : "--", + (mask & WIDGET_OOF_REF) ? "Wr" : "--", + (mask & WIDGET_OOF_CONT) ? "Wc" : "--", + (mask & BREAK) ? "br" : "--"); +} + } // namespace dw } // namespace core |