aboutsummaryrefslogtreecommitdiff
path: root/dw/widget.hh
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-01-06 11:13:30 +0100
committerSebastian Geerken <devnull@localhost>2013-01-06 11:13:30 +0100
commitcc89e1ccf89b1d684d7615a4ea8e526b7345cd38 (patch)
tree71e9a90aa1af27a56938643fa5672742c177a4f3 /dw/widget.hh
parentf4f8bcbd550da7a539b277ed587052842a694ec0 (diff)
Introducing generating widget.
Diffstat (limited to 'dw/widget.hh')
-rw-r--r--dw/widget.hh12
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);