diff options
Diffstat (limited to 'dw/widget.hh')
-rw-r--r-- | dw/widget.hh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dw/widget.hh b/dw/widget.hh index b50269cf..ff52e096 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -79,6 +79,14 @@ private: * \brief The parent widget, NULL for top-level widgets. */ Widget *parent; + + /** + * \brief The generating widget, NULL for top-level widgets, or if + * not set; in the latter case, the effective generator (see + * getGenerator) is the parent. + */ + Widget *generator; + style::Style *style; Flags flags; @@ -246,6 +254,8 @@ public: void setParent (Widget *parent); + void setGenerator (Widget *generator) { this->generator = generator; } + inline style::Style *getStyle () { return style; } /** \todo I do not like this. */ inline Allocation *getAllocation () { return &allocation; } @@ -285,6 +295,8 @@ public: int getLevel (); Widget *getNearestCommonAncestor (Widget *otherWidget); + inline Widget *getGenerator () { return generator ? generator : parent; } + inline Layout *getLayout () { return layout; } virtual Widget *getWidgetAtPoint (int x, int y, int level); |