зеркало из https://github.com/mozilla/pjs.git
Bug 595277 - Part 1: Add a method to iterate over all windows. r=roc
This commit is contained in:
Родитель
e95f123c37
Коммит
8d14c56d1c
|
@ -1097,6 +1097,35 @@ nsWindow* nsWindow::GetParentWindow(PRBool aIncludeOwner)
|
|||
|
||||
return widget;
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
nsWindow::EnumAllChildWindProc(HWND aWnd, LPARAM aParam)
|
||||
{
|
||||
nsWindow *wnd = nsWindow::GetNSWindowPtr(aWnd);
|
||||
if (wnd) {
|
||||
((nsWindow::WindowEnumCallback*)aParam)(wnd);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
nsWindow::EnumAllThreadWindowProc(HWND aWnd, LPARAM aParam)
|
||||
{
|
||||
nsWindow *wnd = nsWindow::GetNSWindowPtr(aWnd);
|
||||
if (wnd) {
|
||||
((nsWindow::WindowEnumCallback*)aParam)(wnd);
|
||||
}
|
||||
EnumChildWindows(aWnd, EnumAllChildWindProc, aParam);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::EnumAllWindows(WindowEnumCallback aCallback)
|
||||
{
|
||||
EnumThreadWindows(GetCurrentThreadId(),
|
||||
EnumAllThreadWindowProc,
|
||||
(LPARAM)&aCallback);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
|
|
|
@ -247,6 +247,9 @@ public:
|
|||
static nsWindow* GetNSWindowPtr(HWND aWnd);
|
||||
WindowHook& GetWindowHook() { return mWindowHook; }
|
||||
nsWindow* GetParentWindow(PRBool aIncludeOwner);
|
||||
// Get an array of all nsWindow*s on the main thread.
|
||||
typedef void (WindowEnumCallback)(nsWindow*);
|
||||
static void EnumAllWindows(WindowEnumCallback aCallback);
|
||||
|
||||
/**
|
||||
* Misc.
|
||||
|
@ -292,6 +295,8 @@ protected:
|
|||
static LRESULT CALLBACK MozSpecialMouseProc(int code, WPARAM wParam, LPARAM lParam);
|
||||
static VOID CALLBACK HookTimerForPopups( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime );
|
||||
static BOOL CALLBACK ClearResourcesCallback(HWND aChild, LPARAM aParam);
|
||||
static BOOL CALLBACK EnumAllChildWindProc(HWND aWnd, LPARAM aParam);
|
||||
static BOOL CALLBACK EnumAllThreadWindowProc(HWND aWnd, LPARAM aParam);
|
||||
|
||||
/**
|
||||
* Window utilities
|
||||
|
|
Загрузка…
Ссылка в новой задаче