mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 17:03:05 +00:00
MACGUI: Add methods to find top window at at a given point
This commit is contained in:
parent
d754ed0e27
commit
bf46669cf8
@ -691,6 +691,32 @@ void MacWindowManager::setActiveWindow(int id) {
|
||||
_fullRefresh = true;
|
||||
}
|
||||
|
||||
MacWindow* MacWindowManager::findWindowAtPoint(int16 x, int16 y) {
|
||||
Common::List<Graphics::BaseMacWindow *>::iterator it;
|
||||
Graphics::MacWindow* win = nullptr;
|
||||
|
||||
for (it = _windowStack.begin(); it != _windowStack.end(); it++) {
|
||||
if ((*it)->getDimensions().contains(x, y)) {
|
||||
win = reinterpret_cast<Graphics::MacWindow *> (*it);
|
||||
}
|
||||
}
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
MacWindow* MacWindowManager::findWindowAtPoint(Common::Point point) {
|
||||
Common::List<Graphics::BaseMacWindow *>::iterator it;
|
||||
Graphics::MacWindow* win = nullptr;
|
||||
|
||||
for (it = _windowStack.begin(); it != _windowStack.end(); it++) {
|
||||
if ((*it)->getDimensions().contains(point)) {
|
||||
win = reinterpret_cast<Graphics::MacWindow *> (*it);
|
||||
}
|
||||
}
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
void MacWindowManager::removeWindow(MacWindow *target) {
|
||||
_windowsToRemove.push_back(target);
|
||||
_needsRemoval = true;
|
||||
|
@ -223,6 +223,18 @@ public:
|
||||
*/
|
||||
void setActiveWindow(int id);
|
||||
|
||||
/**
|
||||
* Return Top Window containing a point
|
||||
* @param x x coordinate of point
|
||||
* @param y y coordiante of point
|
||||
*/
|
||||
MacWindow* findWindowAtPoint(int16 x, int16 y);
|
||||
/**
|
||||
* Return Top Window containing a point
|
||||
* @param point Point
|
||||
*/
|
||||
MacWindow* findWindowAtPoint(Common::Point point);
|
||||
|
||||
/**
|
||||
* Mark a window for removal.
|
||||
* Note that the window data will be destroyed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user