зеркало из https://github.com/mozilla/gecko-dev.git
Bug 595277 - Part 1: Add a method to iterate over all windows. r=roc
This commit is contained in:
Родитель
604a3dd45e
Коммит
cc920b59ae
|
@ -1098,6 +1098,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);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* SECTION: nsIWidget::Show
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче