Added CPWindowList and CPWindowObjectList functions for grabbing the currently visible windows.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-06-24 14:41:37 -07:00
1 parent adde315e2d
commit d57e7050db
1 file changed
+40
+40
View File
@@ -1018,3 +1018,43 @@ var CPDOMEventStop = function(aDOMEvent)
CPSharedDOMWindowBridge._DOMFocusElement.blur();
}
}
function CPWindowObjectList()
{
var bridge = [CPDOMWindowBridge sharedDOMWindowBridge],
levels = bridge._windowLevels,
layers = bridge._windowLayers,
levelCount = levels.length,
windowObjects = [];
while (levelCount--)
{
var windows = [layers objectForKey:levels[levelCount]]._windows,
windowCount = windows.length;
while (windowCount--)
windowObjects.push(windows[windowCount]);
}
return windowObjects;
}
function CPWindowList()
{
var bridge = [CPDOMWindowBridge sharedDOMWindowBridge],
levels = bridge._windowLevels,
layers = bridge._windowLayers,
levelCount = levels.length,
windowNumbers = [];
while (levelCount--)
{
var windows = [layers objectForKey:levels[levelCount]]._windows,
windowCount = windows.length;
while (windowCount--)
windowNumbers.push([windows[windowCount] windowNumber]);
}
return windowNumbers;
}