35 #include "nsIInterfaceRequestorUtils.h"
36 #include "nsIDOMNode.h"
39 #include "nsIServiceManager.h"
40 #include "nsIDOMDocument.h"
41 #include "nsIDOMDocumentView.h"
42 #include "nsIDOMAbstractView.h"
43 #include "nsIWebNavigation.h"
44 #include "nsIDocShellTreeItem.h"
45 #include "nsIDocShellTreeOwner.h"
46 #include "nsIBaseWindow.h"
47 #include "nsIWidget.h"
54 if (!widget)
return NULL;
57 wnd =
reinterpret_cast<NATIVEWINDOW>(widget->GetNativeData(NS_NATIVE_WIDGET));
58 #elif defined(XP_MACOSX)
59 wnd =
reinterpret_cast<NATIVEWINDOW>(widget->GetNativeData(NS_NATIVE_WINDOW));
60 #elif defined(XP_UNIX)
61 wnd =
reinterpret_cast<NATIVEWINDOW>(widget->GetNativeData(NS_NATIVE_WIDGET));
69 nsCOMPtr<nsIDOMAbstractView> domAbstractView;
70 nsCOMPtr<nsIDOMDocumentView> domDocumentView(do_QueryInterface(window));
74 if (!domDocumentView) {
75 domAbstractView = do_QueryInterface(window);
76 if (!domAbstractView)
return NULL;
79 domDocumentView->GetDefaultView(getter_AddRefs(domAbstractView));
80 if (!domAbstractView)
return NULL;
83 nsCOMPtr<nsIWebNavigation> webNavigation(do_GetInterface(domAbstractView));
84 nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(webNavigation));
85 if (!docShellTreeItem)
return NULL;
87 nsCOMPtr<nsIDocShellTreeOwner> docShellTreeOwner;
88 docShellTreeItem->GetTreeOwner(getter_AddRefs(docShellTreeOwner));
89 if (!docShellTreeOwner)
return NULL;
91 nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(docShellTreeOwner);
92 if (!baseWindow)
return NULL;
94 nsCOMPtr<nsIWidget>
widget;
95 baseWindow->GetMainWidget(getter_AddRefs(widget));
static nsIWidget * getWidget(nsISupports *window)
Finds the Native window handle associated with a DOM node - Prototypes.
static void * get(nsISupports *window)