diff options
author | Sebastian Geerken <devnull@localhost> | 2015-01-23 23:20:59 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-01-23 23:20:59 +0100 |
commit | cf581248257b88e98fa4315525a0ee531b4cb9c8 (patch) | |
tree | 73ecec5922d6ae58de09fb32ad4636cd6dedab17 /dw/widget.hh | |
parent | e497d315b87a42184dce3f9b90e495b3a3806b14 (diff) |
Same simplifications for Widget::getWidgetAtPoint as for Widget::draw before.
Diffstat (limited to 'dw/widget.hh')
-rw-r--r-- | dw/widget.hh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dw/widget.hh b/dw/widget.hh index c8a57250..c8431f97 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -426,6 +426,11 @@ public: inline style::Style *getStyle () { return style; } /** \todo I do not like this. */ inline Allocation *getAllocation () { return &allocation; } + inline bool inAllocation (int x, int y) { + return wasAllocated () && x >= allocation.x && y >= allocation.y && + x <= allocation.x + allocation.width && + y <= allocation.y + getHeight (); + } inline int boxOffsetX () { return extraSpace.left + getStyle()->boxOffsetX (); } @@ -475,12 +480,9 @@ public: void drawInterruption (View *view, Rectangle *area, DrawingContext *context); virtual Widget *getWidgetAtPoint (int x, int y, - StackingIteratorStack *iteratorStack, - Widget **interruptedWidget); - Widget *getWidgetAtPointTotal (int x, int y, - StackingIteratorStack *iteratorStack, - Widget **interruptedWidget); - Widget *getWidgetAtPointToplevel (int x, int y); + GettingWidgetAtPointContext *context); + Widget *getWidgetAtPointInterrupted (int x, int y, + GettingWidgetAtPointContext *context); bool buttonPress (EventButton *event); bool buttonRelease (EventButton *event); |