diff options
author | Sebastian Geerken <devnull@localhost> | 2015-01-23 13:17:13 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-01-23 13:17:13 +0100 |
commit | 80229b2b5159af52b407fdf2f535d57c669bb667 (patch) | |
tree | 1119ca90bc237648a1dea0bd5392dbd759239bca /dw/types.hh | |
parent | 101b4e1ddcf164b55ccf06513fc007463bfc0662 (diff) |
Simplified interrupted drawing. (Mouse events will follow.)
Diffstat (limited to 'dw/types.hh')
-rw-r--r-- | dw/types.hh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dw/types.hh b/dw/types.hh index 87f688aa..0b2d7a0e 100644 --- a/dw/types.hh +++ b/dw/types.hh @@ -237,6 +237,37 @@ struct Content static void printMask (Type mask); }; +class DrawingContext +{ +private: + Rectangle toplevelArea; + lout::container::typed::HashSet<lout::object::TypedPointer<Widget> > + *widgetsDrawnAsInterruption; + +public: + inline DrawingContext (Rectangle *toplevelArea) { + this->toplevelArea = *toplevelArea; + widgetsDrawnAsInterruption = + new lout::container::typed::HashSet<lout::object:: + TypedPointer<Widget> > (true); + } + + inline ~DrawingContext () { delete widgetsDrawnAsInterruption; } + + inline Rectangle *getToplevelArea () { return &toplevelArea; } + + inline bool hasWidgetBeenDrawnAsInterruption (Widget *widget) { + lout::object::TypedPointer<Widget> key (widget); + return widgetsDrawnAsInterruption->contains (&key); + } + + inline void addWidgetDrawnAsInterruption (Widget *widget) { + lout::object::TypedPointer<Widget> *key = + new lout::object::TypedPointer<Widget> (widget); + return widgetsDrawnAsInterruption->put (key); + } +}; + } // namespace core } // namespace dw |