aboutsummaryrefslogtreecommitdiff
path: root/dw/types.hh
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2016-04-02 22:48:21 +0200
committerSebastian Geerken <devnull@localhost>2016-04-02 22:48:21 +0200
commit70b9f2b70d9f0c0f48d2ae649023ea3ae5271367 (patch)
tree41c998067cde197225621171b0ab096734e5812e /dw/types.hh
parent639fbbfd350e32ab128482078d83a05a3f208983 (diff)
Content with type WIDGET_OOF_REF now refers to new class WidgetReference.
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;
+ }
};
/**