aboutsummaryrefslogtreecommitdiff
path: root/dw/types.hh
diff options
context:
space:
mode:
Diffstat (limited to 'dw/types.hh')
-rw-r--r--dw/types.hh15
1 files changed, 15 insertions, 0 deletions
diff --git a/dw/types.hh b/dw/types.hh
index 481f4804..ab562a49 100644
--- a/dw/types.hh
+++ b/dw/types.hh
@@ -185,6 +185,15 @@ struct Extremes
int adjustmentWidth;
};
+class WidgetReference: public lout::object::Object
+{
+public:
+ Widget *widget;
+ int parentRef;
+
+ WidgetReference (Widget *widget) { this->widget = widget; }
+};
+
struct Content
{
enum Type {
@@ -226,6 +235,7 @@ struct Content
union {
const char *text;
Widget *widget;
+ WidgetReference *widgetReference;
int breakSpace;
};
@@ -235,6 +245,11 @@ struct Content
static void maskIntoStringBuffer(Type mask, lout::misc::StringBuffer *sb);
static void print (Content *content);
static void printMask (Type mask);
+
+ inline Widget *getWidget () {
+ assert (type & ANY_WIDGET);
+ return type == WIDGET_OOF_REF ? widgetReference->widget : widget;
+ }
};
/**