2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/debug.h"
29 #include "wine/unicode.h"
31 #include "mshtml_private.h"
32 #include "htmlevent.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 static struct list window_list = LIST_INIT(window_list);
39 #define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
41 static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv)
43 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
47 if(IsEqualGUID(&IID_IUnknown, riid)) {
48 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
49 *ppv = HTMLWINDOW2(This);
50 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
51 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
52 *ppv = HTMLWINDOW2(This);
53 }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
54 TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
55 *ppv = DISPATCHEX(This);
56 }else if(IsEqualGUID(&IID_IHTMLFramesCollection2, riid)) {
57 TRACE("(%p)->(IID_IHTMLFramesCollection2 %p)\n", This, ppv);
58 *ppv = HTMLWINDOW2(This);
59 }else if(IsEqualGUID(&IID_IHTMLWindow2, riid)) {
60 TRACE("(%p)->(IID_IHTMLWindow2 %p)\n", This, ppv);
61 *ppv = HTMLWINDOW2(This);
62 }else if(IsEqualGUID(&IID_IHTMLWindow3, riid)) {
63 TRACE("(%p)->(IID_IHTMLWindow2 %p)\n", This, ppv);
64 *ppv = HTMLWINDOW3(This);
65 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
66 return *ppv ? S_OK : E_NOINTERFACE;
70 IUnknown_AddRef((IUnknown*)*ppv);
74 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
78 static ULONG WINAPI HTMLWindow2_AddRef(IHTMLWindow2 *iface)
80 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
81 LONG ref = InterlockedIncrement(&This->ref);
83 TRACE("(%p) ref=%d\n", This, ref);
88 static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
90 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
91 LONG ref = InterlockedDecrement(&This->ref);
93 TRACE("(%p) ref=%d\n", This, ref);
96 if(This->event_target)
97 release_event_target(This->event_target);
98 list_remove(&This->entry);
99 release_dispex(&This->dispex);
106 static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pctinfo)
108 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
110 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
113 static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
114 LCID lcid, ITypeInfo **ppTInfo)
116 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
118 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
121 static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid,
122 LPOLESTR *rgszNames, UINT cNames,
123 LCID lcid, DISPID *rgDispId)
125 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
127 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
130 static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember,
131 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
132 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
134 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
136 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
137 pVarResult, pExcepInfo, puArgErr);
140 static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
142 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
143 FIXME("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
147 static HRESULT WINAPI HTMLWindow2_get_length(IHTMLWindow2 *iface, LONG *p)
149 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
150 FIXME("(%p)->(%p)\n", This, p);
154 static HRESULT WINAPI HTMLWindow2_get_frames(IHTMLWindow2 *iface, IHTMLFramesCollection2 **p)
156 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
157 FIXME("(%p)->(%p)\n", This, p);
161 static HRESULT WINAPI HTMLWindow2_put_defaultStatus(IHTMLWindow2 *iface, BSTR v)
163 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
164 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
168 static HRESULT WINAPI HTMLWindow2_get_defaultStatus(IHTMLWindow2 *iface, BSTR *p)
170 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
171 FIXME("(%p)->(%p)\n", This, p);
175 static HRESULT WINAPI HTMLWindow2_put_status(IHTMLWindow2 *iface, BSTR v)
177 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
178 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
182 static HRESULT WINAPI HTMLWindow2_get_status(IHTMLWindow2 *iface, BSTR *p)
184 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
185 FIXME("(%p)->(%p)\n", This, p);
189 static HRESULT WINAPI HTMLWindow2_setTimeout(IHTMLWindow2 *iface, BSTR expression,
190 LONG msec, VARIANT *language, LONG *timerID)
192 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
195 TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
197 V_VT(&expr_var) = VT_BSTR;
198 V_BSTR(&expr_var) = expression;
200 return IHTMLWindow3_setTimeout(HTMLWINDOW3(This), &expr_var, msec, language, timerID);
203 static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, LONG timerID)
205 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
207 TRACE("(%p)->(%d)\n", This, timerID);
209 return clear_task_timer(This->doc, FALSE, timerID);
212 static HRESULT WINAPI HTMLWindow2_alert(IHTMLWindow2 *iface, BSTR message)
214 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
217 TRACE("(%p)->(%s)\n", This, debugstr_w(message));
219 if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle,
220 sizeof(wszTitle)/sizeof(WCHAR))) {
221 WARN("Could not load message box title: %d\n", GetLastError());
225 MessageBoxW(This->doc->hwnd, message, wszTitle, MB_ICONWARNING);
229 static HRESULT WINAPI HTMLWindow2_confirm(IHTMLWindow2 *iface, BSTR message,
230 VARIANT_BOOL *confirmed)
232 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
235 TRACE("(%p)->(%s %p)\n", This, debugstr_w(message), confirmed);
237 if(!confirmed) return E_INVALIDARG;
239 if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle,
240 sizeof(wszTitle)/sizeof(WCHAR))) {
241 WARN("Could not load message box title: %d\n", GetLastError());
242 *confirmed = VARIANT_TRUE;
246 if(MessageBoxW(This->doc->hwnd, message, wszTitle,
247 MB_OKCANCEL|MB_ICONQUESTION)==IDOK)
248 *confirmed = VARIANT_TRUE;
249 else *confirmed = VARIANT_FALSE;
261 static INT_PTR CALLBACK prompt_dlgproc(HWND hwnd, UINT msg,
262 WPARAM wparam, LPARAM lparam)
268 prompt_arg *arg = (prompt_arg*)lparam;
271 if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle,
272 sizeof(wszTitle)/sizeof(WCHAR))) {
273 WARN("Could not load message box title: %d\n", GetLastError());
274 EndDialog(hwnd, wparam);
278 SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
279 SetWindowTextW(hwnd, wszTitle);
280 SetWindowTextW(GetDlgItem(hwnd, ID_PROMPT_PROMPT), arg->message);
281 SetWindowTextW(GetDlgItem(hwnd, ID_PROMPT_EDIT), arg->dststr);
287 case MAKEWPARAM(IDCANCEL, BN_CLICKED):
288 EndDialog(hwnd, wparam);
290 case MAKEWPARAM(IDOK, BN_CLICKED):
293 (prompt_arg*)GetWindowLongPtrW(hwnd, DWLP_USER);
294 HWND hwndPrompt = GetDlgItem(hwnd, ID_PROMPT_EDIT);
295 INT len = GetWindowTextLengthW(hwndPrompt);
299 EndDialog(hwnd, wparam);
303 V_VT(arg->textdata) = VT_BSTR;
304 if(!len && !arg->dststr)
305 V_BSTR(arg->textdata) = NULL;
308 V_BSTR(arg->textdata) = SysAllocStringLen(NULL, len);
309 GetWindowTextW(hwndPrompt, V_BSTR(arg->textdata), len+1);
311 EndDialog(hwnd, wparam);
317 EndDialog(hwnd, IDCANCEL);
324 static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message,
325 BSTR dststr, VARIANT *textdata)
327 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
330 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(message), debugstr_w(dststr), textdata);
332 if(textdata) V_VT(textdata) = VT_NULL;
334 arg.message = message;
336 arg.textdata = textdata;
338 DialogBoxParamW(hInst, MAKEINTRESOURCEW(ID_PROMPT_DIALOG),
339 This->doc->hwnd, prompt_dlgproc, (LPARAM)&arg);
343 static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
345 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
346 FIXME("(%p)->(%p)\n", This, p);
350 static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
352 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
354 TRACE("(%p)->(%p)\n", This, p);
357 FIXME("This->doc is NULL\n");
361 return IHTMLDocument2_get_location(HTMLDOC(This->doc), p);
364 static HRESULT WINAPI HTMLWindow2_get_history(IHTMLWindow2 *iface, IOmHistory **p)
366 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
367 FIXME("(%p)->(%p)\n", This, p);
371 static HRESULT WINAPI HTMLWindow2_close(IHTMLWindow2 *iface)
373 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
374 FIXME("(%p)->()\n", This);
378 static HRESULT WINAPI HTMLWindow2_put_opener(IHTMLWindow2 *iface, VARIANT v)
380 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
381 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
385 static HRESULT WINAPI HTMLWindow2_get_opener(IHTMLWindow2 *iface, VARIANT *p)
387 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
388 FIXME("(%p)->(%p)\n", This, p);
392 static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigator **p)
394 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
396 TRACE("(%p)->(%p)\n", This, p);
398 *p = OmNavigator_Create();
402 static HRESULT WINAPI HTMLWindow2_put_name(IHTMLWindow2 *iface, BSTR v)
404 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
405 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
409 static HRESULT WINAPI HTMLWindow2_get_name(IHTMLWindow2 *iface, BSTR *p)
411 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
412 FIXME("(%p)->(%p)\n", This, p);
416 static HRESULT WINAPI HTMLWindow2_get_parent(IHTMLWindow2 *iface, IHTMLWindow2 **p)
418 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
419 FIXME("(%p)->(%p)\n", This, p);
423 static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
424 BSTR features, VARIANT_BOOL replace, IHTMLWindow2 **pomWindowResult)
426 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
427 FIXME("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
428 debugstr_w(features), replace, pomWindowResult);
432 static HRESULT WINAPI HTMLWindow2_get_self(IHTMLWindow2 *iface, IHTMLWindow2 **p)
434 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
436 TRACE("(%p)->(%p)\n", This, p);
438 /* FIXME: We should return kind of proxy window here. */
439 IHTMLWindow2_AddRef(HTMLWINDOW2(This));
440 *p = HTMLWINDOW2(This);
444 static HRESULT WINAPI HTMLWindow2_get_top(IHTMLWindow2 *iface, IHTMLWindow2 **p)
446 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
447 FIXME("(%p)->(%p)\n", This, p);
451 static HRESULT WINAPI HTMLWindow2_get_window(IHTMLWindow2 *iface, IHTMLWindow2 **p)
453 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
455 TRACE("(%p)->(%p)\n", This, p);
457 /* FIXME: We should return kind of proxy window here. */
458 IHTMLWindow2_AddRef(HTMLWINDOW2(This));
459 *p = HTMLWINDOW2(This);
463 static HRESULT WINAPI HTMLWindow2_navigate(IHTMLWindow2 *iface, BSTR url)
465 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
466 FIXME("(%p)->(%s)\n", This, debugstr_w(url));
470 static HRESULT WINAPI HTMLWindow2_put_onfocus(IHTMLWindow2 *iface, VARIANT v)
472 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
473 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
477 static HRESULT WINAPI HTMLWindow2_get_onfocus(IHTMLWindow2 *iface, VARIANT *p)
479 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
480 FIXME("(%p)->(%p)\n", This, p);
484 static HRESULT WINAPI HTMLWindow2_put_onblur(IHTMLWindow2 *iface, VARIANT v)
486 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
487 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
491 static HRESULT WINAPI HTMLWindow2_get_onblur(IHTMLWindow2 *iface, VARIANT *p)
493 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
494 FIXME("(%p)->(%p)\n", This, p);
498 static HRESULT WINAPI HTMLWindow2_put_onload(IHTMLWindow2 *iface, VARIANT v)
500 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
502 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
504 return set_window_event(This, EVENTID_LOAD, &v);
507 static HRESULT WINAPI HTMLWindow2_get_onload(IHTMLWindow2 *iface, VARIANT *p)
509 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
511 TRACE("(%p)->(%p)\n", This, p);
513 return get_window_event(This, EVENTID_LOAD, p);
516 static HRESULT WINAPI HTMLWindow2_put_onbeforeunload(IHTMLWindow2 *iface, VARIANT v)
518 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
520 TRACE("(%p)->(v(%d))\n", This, V_VT(&v));
522 return set_window_event(This, EVENTID_BEFOREUNLOAD, &v);
525 static HRESULT WINAPI HTMLWindow2_get_onbeforeunload(IHTMLWindow2 *iface, VARIANT *p)
527 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
529 TRACE("(%p)->(%p)\n", This, p);
531 return get_window_event(This, EVENTID_BEFOREUNLOAD, p);
534 static HRESULT WINAPI HTMLWindow2_put_onunload(IHTMLWindow2 *iface, VARIANT v)
536 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
537 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
541 static HRESULT WINAPI HTMLWindow2_get_onunload(IHTMLWindow2 *iface, VARIANT *p)
543 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
544 FIXME("(%p)->(%p)\n", This, p);
548 static HRESULT WINAPI HTMLWindow2_put_onhelp(IHTMLWindow2 *iface, VARIANT v)
550 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
551 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
555 static HRESULT WINAPI HTMLWindow2_get_onhelp(IHTMLWindow2 *iface, VARIANT *p)
557 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
558 FIXME("(%p)->(%p)\n", This, p);
562 static HRESULT WINAPI HTMLWindow2_put_onerror(IHTMLWindow2 *iface, VARIANT v)
564 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
565 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
569 static HRESULT WINAPI HTMLWindow2_get_onerror(IHTMLWindow2 *iface, VARIANT *p)
571 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
572 FIXME("(%p)->(%p)\n", This, p);
576 static HRESULT WINAPI HTMLWindow2_put_onresize(IHTMLWindow2 *iface, VARIANT v)
578 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
579 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
583 static HRESULT WINAPI HTMLWindow2_get_onresize(IHTMLWindow2 *iface, VARIANT *p)
585 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
586 FIXME("(%p)->(%p)\n", This, p);
590 static HRESULT WINAPI HTMLWindow2_put_onscroll(IHTMLWindow2 *iface, VARIANT v)
592 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
593 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
597 static HRESULT WINAPI HTMLWindow2_get_onscroll(IHTMLWindow2 *iface, VARIANT *p)
599 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
600 FIXME("(%p)->(%p)\n", This, p);
604 static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocument2 **p)
606 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
608 TRACE("(%p)->(%p)\n", This, p);
611 /* FIXME: We should return a wrapper object here */
612 *p = HTMLDOC(This->doc);
613 IHTMLDocument2_AddRef(*p);
621 static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p)
623 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
625 TRACE("(%p)->(%p)\n", This, p);
628 IHTMLEventObj_AddRef(This->event);
633 static HRESULT WINAPI HTMLWindow2_get__newEnum(IHTMLWindow2 *iface, IUnknown **p)
635 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
636 FIXME("(%p)->(%p)\n", This, p);
640 static HRESULT WINAPI HTMLWindow2_showModalDialog(IHTMLWindow2 *iface, BSTR dialog,
641 VARIANT *varArgIn, VARIANT *varOptions, VARIANT *varArgOut)
643 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
644 FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(dialog), varArgIn, varOptions, varArgOut);
648 static HRESULT WINAPI HTMLWindow2_showHelp(IHTMLWindow2 *iface, BSTR helpURL, VARIANT helpArg,
651 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
652 FIXME("(%p)->(%s v(%d) %s)\n", This, debugstr_w(helpURL), V_VT(&helpArg), debugstr_w(features));
656 static HRESULT WINAPI HTMLWindow2_get_screen(IHTMLWindow2 *iface, IHTMLScreen **p)
658 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
659 FIXME("(%p)->(%p)\n", This, p);
663 static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionElementFactory **p)
665 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
667 TRACE("(%p)->(%p)\n", This, p);
669 if(!This->doc->option_factory)
670 This->doc->option_factory = HTMLOptionElementFactory_Create(This->doc);
672 *p = HTMLOPTFACTORY(This->doc->option_factory);
673 IHTMLOptionElementFactory_AddRef(*p);
678 static HRESULT WINAPI HTMLWindow2_focus(IHTMLWindow2 *iface)
680 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
681 FIXME("(%p)->()\n", This);
685 static HRESULT WINAPI HTMLWindow2_get_closed(IHTMLWindow2 *iface, VARIANT_BOOL *p)
687 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
688 FIXME("(%p)->(%p)\n", This, p);
692 static HRESULT WINAPI HTMLWindow2_blur(IHTMLWindow2 *iface)
694 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
695 FIXME("(%p)->()\n", This);
699 static HRESULT WINAPI HTMLWindow2_scroll(IHTMLWindow2 *iface, LONG x, LONG y)
701 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
702 FIXME("(%p)->(%d %d)\n", This, x, y);
706 static HRESULT WINAPI HTMLWindow2_get_clientInformation(IHTMLWindow2 *iface, IOmNavigator **p)
708 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
709 FIXME("(%p)->(%p)\n", This, p);
713 static HRESULT WINAPI HTMLWindow2_setInterval(IHTMLWindow2 *iface, BSTR expression,
714 LONG msec, VARIANT *language, LONG *timerID)
716 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
719 TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
721 V_VT(&expr) = VT_BSTR;
722 V_BSTR(&expr) = expression;
723 return IHTMLWindow3_setInterval(HTMLWINDOW3(This), &expr, msec, language, timerID);
726 static HRESULT WINAPI HTMLWindow2_clearInterval(IHTMLWindow2 *iface, LONG timerID)
728 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
730 TRACE("(%p)->(%d)\n", This, timerID);
732 return clear_task_timer(This->doc, TRUE, timerID);
735 static HRESULT WINAPI HTMLWindow2_put_offscreenBuffering(IHTMLWindow2 *iface, VARIANT v)
737 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
738 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
742 static HRESULT WINAPI HTMLWindow2_get_offscreenBuffering(IHTMLWindow2 *iface, VARIANT *p)
744 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
745 FIXME("(%p)->(%p)\n", This, p);
749 static HRESULT WINAPI HTMLWindow2_execScript(IHTMLWindow2 *iface, BSTR scode, BSTR language,
752 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
753 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(scode), debugstr_w(language), pvarRet);
757 static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
759 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
761 static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
763 TRACE("(%p)->(%p)\n", This, String);
768 *String = SysAllocString(objectW);
769 return *String ? S_OK : E_OUTOFMEMORY;
772 static HRESULT WINAPI HTMLWindow2_scrollBy(IHTMLWindow2 *iface, LONG x, LONG y)
774 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
777 TRACE("(%p)->(%d %d)\n", This, x, y);
779 nsres = nsIDOMWindow_ScrollBy(This->nswindow, x, y);
781 ERR("ScrollBy failed: %08x\n", nsres);
786 static HRESULT WINAPI HTMLWindow2_scrollTo(IHTMLWindow2 *iface, LONG x, LONG y)
788 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
791 TRACE("(%p)->(%d %d)\n", This, x, y);
793 nsres = nsIDOMWindow_ScrollTo(This->nswindow, x, y);
795 ERR("ScrollTo failed: %08x\n", nsres);
800 static HRESULT WINAPI HTMLWindow2_moveTo(IHTMLWindow2 *iface, LONG x, LONG y)
802 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
803 FIXME("(%p)->(%d %d)\n", This, x, y);
807 static HRESULT WINAPI HTMLWindow2_moveBy(IHTMLWindow2 *iface, LONG x, LONG y)
809 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
810 FIXME("(%p)->(%d %d)\n", This, x, y);
814 static HRESULT WINAPI HTMLWindow2_resizeTo(IHTMLWindow2 *iface, LONG x, LONG y)
816 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
817 FIXME("(%p)->(%d %d)\n", This, x, y);
821 static HRESULT WINAPI HTMLWindow2_resizeBy(IHTMLWindow2 *iface, LONG x, LONG y)
823 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
824 FIXME("(%p)->(%d %d)\n", This, x, y);
828 static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **p)
830 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
832 TRACE("(%p)->(%p)\n", This, p);
836 if(!This->doc->hostui)
839 return IDocHostUIHandler_GetExternal(This->doc->hostui, p);
842 #undef HTMLWINDOW2_THIS
844 static const IHTMLWindow2Vtbl HTMLWindow2Vtbl = {
845 HTMLWindow2_QueryInterface,
848 HTMLWindow2_GetTypeInfoCount,
849 HTMLWindow2_GetTypeInfo,
850 HTMLWindow2_GetIDsOfNames,
853 HTMLWindow2_get_length,
854 HTMLWindow2_get_frames,
855 HTMLWindow2_put_defaultStatus,
856 HTMLWindow2_get_defaultStatus,
857 HTMLWindow2_put_status,
858 HTMLWindow2_get_status,
859 HTMLWindow2_setTimeout,
860 HTMLWindow2_clearTimeout,
864 HTMLWindow2_get_Image,
865 HTMLWindow2_get_location,
866 HTMLWindow2_get_history,
868 HTMLWindow2_put_opener,
869 HTMLWindow2_get_opener,
870 HTMLWindow2_get_navigator,
871 HTMLWindow2_put_name,
872 HTMLWindow2_get_name,
873 HTMLWindow2_get_parent,
875 HTMLWindow2_get_self,
877 HTMLWindow2_get_window,
878 HTMLWindow2_navigate,
879 HTMLWindow2_put_onfocus,
880 HTMLWindow2_get_onfocus,
881 HTMLWindow2_put_onblur,
882 HTMLWindow2_get_onblur,
883 HTMLWindow2_put_onload,
884 HTMLWindow2_get_onload,
885 HTMLWindow2_put_onbeforeunload,
886 HTMLWindow2_get_onbeforeunload,
887 HTMLWindow2_put_onunload,
888 HTMLWindow2_get_onunload,
889 HTMLWindow2_put_onhelp,
890 HTMLWindow2_get_onhelp,
891 HTMLWindow2_put_onerror,
892 HTMLWindow2_get_onerror,
893 HTMLWindow2_put_onresize,
894 HTMLWindow2_get_onresize,
895 HTMLWindow2_put_onscroll,
896 HTMLWindow2_get_onscroll,
897 HTMLWindow2_get_document,
898 HTMLWindow2_get_event,
899 HTMLWindow2_get__newEnum,
900 HTMLWindow2_showModalDialog,
901 HTMLWindow2_showHelp,
902 HTMLWindow2_get_screen,
903 HTMLWindow2_get_Option,
905 HTMLWindow2_get_closed,
908 HTMLWindow2_get_clientInformation,
909 HTMLWindow2_setInterval,
910 HTMLWindow2_clearInterval,
911 HTMLWindow2_put_offscreenBuffering,
912 HTMLWindow2_get_offscreenBuffering,
913 HTMLWindow2_execScript,
914 HTMLWindow2_toString,
915 HTMLWindow2_scrollBy,
916 HTMLWindow2_scrollTo,
919 HTMLWindow2_resizeTo,
920 HTMLWindow2_resizeBy,
921 HTMLWindow2_get_external
924 #define HTMLWINDOW3_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow3, iface)
926 static HRESULT WINAPI HTMLWindow3_QueryInterface(IHTMLWindow3 *iface, REFIID riid, void **ppv)
928 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
930 return IHTMLWindow2_QueryInterface(HTMLWINDOW2(This), riid, ppv);
933 static ULONG WINAPI HTMLWindow3_AddRef(IHTMLWindow3 *iface)
935 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
937 return IHTMLWindow2_AddRef(HTMLWINDOW2(This));
940 static ULONG WINAPI HTMLWindow3_Release(IHTMLWindow3 *iface)
942 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
944 return IHTMLWindow2_Release(HTMLWINDOW2(This));
947 static HRESULT WINAPI HTMLWindow3_GetTypeInfoCount(IHTMLWindow3 *iface, UINT *pctinfo)
949 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
951 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
954 static HRESULT WINAPI HTMLWindow3_GetTypeInfo(IHTMLWindow3 *iface, UINT iTInfo,
955 LCID lcid, ITypeInfo **ppTInfo)
957 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
959 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
962 static HRESULT WINAPI HTMLWindow3_GetIDsOfNames(IHTMLWindow3 *iface, REFIID riid,
963 LPOLESTR *rgszNames, UINT cNames,
964 LCID lcid, DISPID *rgDispId)
966 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
968 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
971 static HRESULT WINAPI HTMLWindow3_Invoke(IHTMLWindow3 *iface, DISPID dispIdMember,
972 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
973 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
975 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
977 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
978 pVarResult, pExcepInfo, puArgErr);
981 static HRESULT WINAPI HTMLWindow3_get_screenLeft(IHTMLWindow3 *iface, LONG *p)
983 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
984 FIXME("(%p)->(%p)\n", This, p);
988 static HRESULT WINAPI HTMLWindow3_get_screenTop(IHTMLWindow3 *iface, LONG *p)
990 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
991 FIXME("(%p)->(%p)\n", This, p);
995 static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp, VARIANT_BOOL *pfResult)
997 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
998 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
1002 static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp)
1004 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1005 FIXME("(%p)->()\n", This);
1009 static HRESULT window_set_timer(HTMLWindow *This, VARIANT *expr, LONG msec, VARIANT *language,
1010 BOOL interval, LONG *timer_id)
1012 IDispatch *disp = NULL;
1014 switch(V_VT(expr)) {
1016 disp = V_DISPATCH(expr);
1017 IDispatch_AddRef(disp);
1021 disp = script_parse_event(This->doc, V_BSTR(expr));
1025 FIXME("unimplemented vt=%d\n", V_VT(expr));
1032 *timer_id = set_task_timer(This->doc, msec, interval, disp);
1033 IDispatch_Release(disp);
1038 static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expression, LONG msec,
1039 VARIANT *language, LONG *timerID)
1041 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1043 TRACE("(%p)->(%p(%d) %d %p %p)\n", This, expression, V_VT(expression), msec, language, timerID);
1045 return window_set_timer(This, expression, msec, language, FALSE, timerID);
1048 static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expression, LONG msec,
1049 VARIANT *language, LONG *timerID)
1051 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1053 TRACE("(%p)->(%p %d %p %p)\n", This, expression, msec, language, timerID);
1055 return window_set_timer(This, expression, msec, language, TRUE, timerID);
1058 static HRESULT WINAPI HTMLWindow3_print(IHTMLWindow3 *iface)
1060 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1061 FIXME("(%p)\n", This);
1065 static HRESULT WINAPI HTMLWindow3_put_onbeforeprint(IHTMLWindow3 *iface, VARIANT v)
1067 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1068 FIXME("(%p)->()\n", This);
1072 static HRESULT WINAPI HTMLWindow3_get_onbeforeprint(IHTMLWindow3 *iface, VARIANT *p)
1074 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1075 FIXME("(%p)->(%p)\n", This, p);
1079 static HRESULT WINAPI HTMLWindow3_put_onafterprint(IHTMLWindow3 *iface, VARIANT v)
1081 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1082 FIXME("(%p)->()\n", This);
1086 static HRESULT WINAPI HTMLWindow3_get_onafterprint(IHTMLWindow3 *iface, VARIANT *p)
1088 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1089 FIXME("(%p)->(%p)\n", This, p);
1093 static HRESULT WINAPI HTMLWindow3_get_clipboardData(IHTMLWindow3 *iface, IHTMLDataTransfer **p)
1095 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1096 FIXME("(%p)->(%p)\n", This, p);
1100 static HRESULT WINAPI HTMLWindow3_showModelessDialog(IHTMLWindow3 *iface, BSTR url,
1101 VARIANT *varArgIn, VARIANT *options, IHTMLWindow2 **pDialog)
1103 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
1104 FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(url), varArgIn, options, pDialog);
1108 #undef HTMLWINDOW3_THIS
1110 static const IHTMLWindow3Vtbl HTMLWindow3Vtbl = {
1111 HTMLWindow3_QueryInterface,
1113 HTMLWindow3_Release,
1114 HTMLWindow3_GetTypeInfoCount,
1115 HTMLWindow3_GetTypeInfo,
1116 HTMLWindow3_GetIDsOfNames,
1118 HTMLWindow3_get_screenLeft,
1119 HTMLWindow3_get_screenTop,
1120 HTMLWindow3_attachEvent,
1121 HTMLWindow3_detachEvent,
1122 HTMLWindow3_setTimeout,
1123 HTMLWindow3_setInterval,
1125 HTMLWindow3_put_onbeforeprint,
1126 HTMLWindow3_get_onbeforeprint,
1127 HTMLWindow3_put_onafterprint,
1128 HTMLWindow3_get_onafterprint,
1129 HTMLWindow3_get_clipboardData,
1130 HTMLWindow3_showModelessDialog
1133 #define DISPEX_THIS(iface) DEFINE_THIS(HTMLWindow, IDispatchEx, iface)
1135 static HRESULT WINAPI WindowDispEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
1137 HTMLWindow *This = DISPEX_THIS(iface);
1139 return IHTMLWindow2_QueryInterface(HTMLWINDOW2(This), riid, ppv);
1142 static ULONG WINAPI WindowDispEx_AddRef(IDispatchEx *iface)
1144 HTMLWindow *This = DISPEX_THIS(iface);
1146 return IHTMLWindow2_AddRef(HTMLWINDOW2(This));
1149 static ULONG WINAPI WindowDispEx_Release(IDispatchEx *iface)
1151 HTMLWindow *This = DISPEX_THIS(iface);
1153 return IHTMLWindow2_Release(HTMLWINDOW2(This));
1156 static HRESULT WINAPI WindowDispEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
1158 HTMLWindow *This = DISPEX_THIS(iface);
1160 TRACE("(%p)->(%p)\n", This, pctinfo);
1162 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
1165 static HRESULT WINAPI WindowDispEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
1166 LCID lcid, ITypeInfo **ppTInfo)
1168 HTMLWindow *This = DISPEX_THIS(iface);
1170 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
1172 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
1175 static HRESULT WINAPI WindowDispEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
1176 LPOLESTR *rgszNames, UINT cNames,
1177 LCID lcid, DISPID *rgDispId)
1179 HTMLWindow *This = DISPEX_THIS(iface);
1181 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
1184 /* FIXME: Use script dispatch */
1186 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
1189 static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
1190 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1191 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1193 HTMLWindow *This = DISPEX_THIS(iface);
1195 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
1196 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1198 /* FIXME: Use script dispatch */
1200 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
1201 pVarResult, pExcepInfo, puArgErr);
1204 static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
1206 HTMLWindow *This = DISPEX_THIS(iface);
1208 TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
1210 return IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid);
1213 static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
1214 VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
1216 HTMLWindow *This = DISPEX_THIS(iface);
1218 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1220 return IDispatchEx_InvokeEx(DISPATCHEX(&This->dispex), id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1223 static HRESULT WINAPI WindowDispEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
1225 HTMLWindow *This = DISPEX_THIS(iface);
1227 TRACE("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
1229 return IDispatchEx_DeleteMemberByName(DISPATCHEX(&This->dispex), bstrName, grfdex);
1232 static HRESULT WINAPI WindowDispEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
1234 HTMLWindow *This = DISPEX_THIS(iface);
1236 TRACE("(%p)->(%x)\n", This, id);
1238 return IDispatchEx_DeleteMemberByDispID(DISPATCHEX(&This->dispex), id);
1241 static HRESULT WINAPI WindowDispEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
1243 HTMLWindow *This = DISPEX_THIS(iface);
1245 TRACE("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
1247 return IDispatchEx_GetMemberProperties(DISPATCHEX(&This->dispex), id, grfdexFetch, pgrfdex);
1250 static HRESULT WINAPI WindowDispEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
1252 HTMLWindow *This = DISPEX_THIS(iface);
1254 TRACE("(%p)->(%x %p)\n", This, id, pbstrName);
1256 return IDispatchEx_GetMemberName(DISPATCHEX(&This->dispex), id, pbstrName);
1259 static HRESULT WINAPI WindowDispEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
1261 HTMLWindow *This = DISPEX_THIS(iface);
1263 TRACE("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
1265 return IDispatchEx_GetNextDispID(DISPATCHEX(&This->dispex), grfdex, id, pid);
1268 static HRESULT WINAPI WindowDispEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
1270 HTMLWindow *This = DISPEX_THIS(iface);
1272 TRACE("(%p)->(%p)\n", This, ppunk);
1280 static const IDispatchExVtbl WindowDispExVtbl = {
1281 WindowDispEx_QueryInterface,
1282 WindowDispEx_AddRef,
1283 WindowDispEx_Release,
1284 WindowDispEx_GetTypeInfoCount,
1285 WindowDispEx_GetTypeInfo,
1286 WindowDispEx_GetIDsOfNames,
1287 WindowDispEx_Invoke,
1288 WindowDispEx_GetDispID,
1289 WindowDispEx_InvokeEx,
1290 WindowDispEx_DeleteMemberByName,
1291 WindowDispEx_DeleteMemberByDispID,
1292 WindowDispEx_GetMemberProperties,
1293 WindowDispEx_GetMemberName,
1294 WindowDispEx_GetNextDispID,
1295 WindowDispEx_GetNameSpaceParent
1298 static const tid_t HTMLWindow_iface_tids[] = {
1303 static dispex_static_data_t HTMLWindow_dispex = {
1305 DispHTMLWindow2_tid,
1307 HTMLWindow_iface_tids
1310 HRESULT HTMLWindow_Create(HTMLDocument *doc, nsIDOMWindow *nswindow, HTMLWindow **ret)
1314 window = heap_alloc_zero(sizeof(HTMLWindow));
1316 return E_OUTOFMEMORY;
1318 window->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl;
1319 window->lpHTMLWindow3Vtbl = &HTMLWindow3Vtbl;
1320 window->lpIDispatchExVtbl = &WindowDispExVtbl;
1324 init_dispex(&window->dispex, (IUnknown*)HTMLWINDOW2(window), &HTMLWindow_dispex);
1327 nsIDOMWindow_AddRef(nswindow);
1328 window->nswindow = nswindow;
1331 list_add_head(&window_list, &window->entry);
1337 HTMLWindow *nswindow_to_window(const nsIDOMWindow *nswindow)
1341 LIST_FOR_EACH_ENTRY(iter, &window_list, HTMLWindow, entry) {
1342 if(iter->nswindow == nswindow)