aboutsummaryrefslogtreecommitdiff
path: root/dw/types.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/types.cc')
-rw-r--r--dw/types.cc53
1 files changed, 53 insertions, 0 deletions
diff --git a/dw/types.cc b/dw/types.cc
index 86836bc1..a2f0737e 100644
--- a/dw/types.cc
+++ b/dw/types.cc
@@ -268,5 +268,58 @@ void Region::addRectangle (Rectangle *rPointer)
rectangleList->append (r);
}
+Content::Type Content::maskForSelection (bool followReferences)
+{
+ Content::Type widgetMask = (Content::Type)
+ (Content::WIDGET_IN_FLOW |
+ (followReferences ? Content::WIDGET_OOF_REF : Content::WIDGET_OOF_CONT));
+ 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 ("<%d?>", content->type);
+ 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 core
} // namespace dw