summaryrefslogtreecommitdiff
path: root/dw/types.hh
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2015-01-23 21:28:59 +0100
committerSebastian Geerken <devnull@localhost>2015-01-23 21:28:59 +0100
commite497d315b87a42184dce3f9b90e495b3a3806b14 (patch)
tree7709c3680197e471fdbcbcb6437c6ad64fbde676 /dw/types.hh
parent9d17539aa2d7c7b00ae08cdd0615ff6ea84493fc (diff)
StackingProcessingContext, GettingWidgetAtPointContext.
Diffstat (limited to 'dw/types.hh')
-rw-r--r--dw/types.hh55
1 files changed, 41 insertions, 14 deletions
diff --git a/dw/types.hh b/dw/types.hh
index c68ad781..481f4804 100644
--- a/dw/types.hh
+++ b/dw/types.hh
@@ -238,37 +238,64 @@ struct Content
};
/**
- * Set at the top when drawing. See \ref dw-interrupted-drawing for details.
+ * \brief Base class for dw::core::DrawingContext and
+ * dw::core::GettingWidgetAtPointContext.
+ *
+ * Not to be confused with the *stacking context* as defined by CSS.
*/
-class DrawingContext
+class StackingProcessingContext
{
private:
- Rectangle toplevelArea;
lout::container::typed::HashSet<lout::object::TypedPointer<Widget> >
- *widgetsDrawnAsInterruption;
+ *widgetsProcessedAsInterruption;
public:
- inline DrawingContext (Rectangle *toplevelArea) {
- this->toplevelArea = *toplevelArea;
- widgetsDrawnAsInterruption =
+ inline StackingProcessingContext () {
+ widgetsProcessedAsInterruption =
new lout::container::typed::HashSet<lout::object::
TypedPointer<Widget> > (true);
}
- inline ~DrawingContext () { delete widgetsDrawnAsInterruption; }
+ inline ~StackingProcessingContext ()
+ { delete widgetsProcessedAsInterruption; }
- inline Rectangle *getToplevelArea () { return &toplevelArea; }
-
- inline bool hasWidgetBeenDrawnAsInterruption (Widget *widget) {
+ inline bool hasWidgetBeenProcessedAsInterruption (Widget *widget) {
lout::object::TypedPointer<Widget> key (widget);
- return widgetsDrawnAsInterruption->contains (&key);
+ return widgetsProcessedAsInterruption->contains (&key);
}
- inline void addWidgetDrawnAsInterruption (Widget *widget) {
+ inline void addWidgetProcessedAsInterruption (Widget *widget) {
lout::object::TypedPointer<Widget> *key =
new lout::object::TypedPointer<Widget> (widget);
- return widgetsDrawnAsInterruption->put (key);
+ return widgetsProcessedAsInterruption->put (key);
+ }
+};
+
+/**
+ * \brief Set at the top when drawing.
+ *
+ * See \ref dw-interrupted-drawing for details.
+ */
+class DrawingContext: public StackingProcessingContext
+{
+private:
+ Rectangle toplevelArea;
+
+public:
+ inline DrawingContext (Rectangle *toplevelArea) {
+ this->toplevelArea = *toplevelArea;
}
+
+ inline Rectangle *getToplevelArea () { return &toplevelArea; }
+};
+
+/**
+ * \brief Set at the top when getting the widget at the point.
+ *
+ * Similar to dw::core::DrawingContext.
+ */
+class GettingWidgetAtPointContext: public StackingProcessingContext
+{
};
} // namespace core