secur32: Gracefully handle ntlm_auth versions that don't support the new commands.
[wine/winequartzdrv.git] / dlls / mshtml / view.c
blob3302f5f56aff83d25842e6d15ae7aa273504f6e2
1 /*
2 * Copyright 2005-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
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
24 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "wingdi.h"
30 #include "commctrl.h"
31 #include "ole2.h"
32 #include "resource.h"
34 #include "wine/debug.h"
36 #include "mshtml_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
40 static const WCHAR wszInternetExplorer_Server[] =
41 {'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','_','S','e','r','v','e','r',0};
43 static const WCHAR wszTooltipData[] = {'t','o','o','l','t','i','p','_','d','a','t','a',0};
45 static ATOM serverwnd_class = 0;
47 typedef struct {
48 HTMLDocument *doc;
49 WNDPROC proc;
50 } tooltip_data;
52 static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
54 if(msg > WM_USER)
55 FIXME("(%p %d %x %lx)\n", hwnd, msg, wParam, lParam);
57 return DefWindowProcW(hwnd, msg, wParam, lParam);
60 static void create_hidden_window(HTMLDocument *This)
62 static ATOM hidden_wnd_class = 0;
63 static const WCHAR wszInternetExplorer_Hidden[] = {'I','n','t','e','r','n','e','t',
64 ' ','E','x','p','l','o','r','e','r','_','H','i','d','d','e','n',0};
66 if(!hidden_wnd_class) {
67 WNDCLASSEXW wndclass = {
68 sizeof(WNDCLASSEXW), 0,
69 hidden_proc,
70 0, 0, hInst, NULL, NULL, NULL, NULL,
71 wszInternetExplorer_Hidden,
72 NULL
75 hidden_wnd_class = RegisterClassExW(&wndclass);
78 This->hidden_hwnd = CreateWindowExW(0, wszInternetExplorer_Hidden, NULL, WS_POPUP,
79 0, 0, 0, 0, NULL, NULL, hInst, This);
82 static void paint_disabled(HWND hwnd) {
83 HDC hdc;
84 PAINTSTRUCT ps;
85 HBRUSH brush;
86 RECT rect;
87 HFONT font;
88 WCHAR wszHTMLDisabled[100];
90 LoadStringW(hInst, IDS_HTMLDISABLED, wszHTMLDisabled, sizeof(wszHTMLDisabled)/sizeof(WCHAR));
92 font = CreateFontA(25,0,0,0,400,0,0,0,ANSI_CHARSET,0,0,DEFAULT_QUALITY,DEFAULT_PITCH,NULL);
93 brush = CreateSolidBrush(RGB(255,255,255));
94 GetClientRect(hwnd, &rect);
96 hdc = BeginPaint(hwnd, &ps);
97 SelectObject(hdc, font);
98 SelectObject(hdc, brush);
99 Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom);
100 DrawTextW(hdc, wszHTMLDisabled,-1, &rect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
101 EndPaint(hwnd, &ps);
103 DeleteObject(font);
104 DeleteObject(brush);
107 static void activate_gecko(HTMLDocument *This)
109 TRACE("(%p) %p\n", This, This->nscontainer->window);
111 SetParent(This->nscontainer->hwnd, This->hwnd);
112 ShowWindow(This->nscontainer->hwnd, SW_SHOW);
114 nsIBaseWindow_SetVisibility(This->nscontainer->window, TRUE);
115 nsIBaseWindow_SetEnabled(This->nscontainer->window, TRUE);
116 nsIWebBrowserFocus_Activate(This->nscontainer->focus);
119 static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
121 HTMLDocument *This;
123 static const WCHAR wszTHIS[] = {'T','H','I','S',0};
125 if(msg == WM_CREATE) {
126 This = *(HTMLDocument**)lParam;
127 SetPropW(hwnd, wszTHIS, This);
128 }else {
129 This = (HTMLDocument*)GetPropW(hwnd, wszTHIS);
132 switch(msg) {
133 case WM_CREATE:
134 This->hwnd = hwnd;
135 if(This->nscontainer)
136 activate_gecko(This);
137 break;
138 case WM_PAINT:
139 if(!This->nscontainer)
140 paint_disabled(hwnd);
141 break;
142 case WM_SIZE:
143 TRACE("(%p)->(WM_SIZE)\n", This);
144 if(This->nscontainer)
145 SetWindowPos(This->nscontainer->hwnd, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam),
146 SWP_NOZORDER | SWP_NOACTIVATE);
149 return DefWindowProcW(hwnd, msg, wParam, lParam);
152 static void register_serverwnd_class(void)
154 static WNDCLASSEXW wndclass = {
155 sizeof(WNDCLASSEXW),
156 CS_DBLCLKS,
157 serverwnd_proc,
158 0, 0, NULL, NULL, NULL, NULL, NULL,
159 wszInternetExplorer_Server,
160 NULL,
162 wndclass.hInstance = hInst;
163 serverwnd_class = RegisterClassExW(&wndclass);
166 static HRESULT activate_window(HTMLDocument *This)
168 IOleInPlaceUIWindow *pIPWnd;
169 IOleInPlaceFrame *pIPFrame;
170 IOleCommandTarget *cmdtrg;
171 RECT posrect, cliprect;
172 OLEINPLACEFRAMEINFO frameinfo;
173 HWND parent_hwnd;
174 HRESULT hres;
176 if(!serverwnd_class)
177 register_serverwnd_class();
179 hres = IOleInPlaceSite_CanInPlaceActivate(This->ipsite);
180 if(hres != S_OK) {
181 WARN("CanInPlaceActivate returned: %08lx\n", hres);
182 return FAILED(hres) ? hres : E_FAIL;
185 hres = IOleInPlaceSite_GetWindowContext(This->ipsite, &pIPFrame, &pIPWnd, &posrect, &cliprect, &frameinfo);
186 if(FAILED(hres)) {
187 WARN("GetWindowContext failed: %08lx\n", hres);
188 return hres;
191 if(pIPWnd)
192 IOleInPlaceUIWindow_Release(pIPWnd);
193 TRACE("got window context: %p %p {%ld %ld %ld %ld} {%ld %ld %ld %ld} {%d %x %p %p %d}\n",
194 pIPFrame, pIPWnd, posrect.left, posrect.top, posrect.right, posrect.bottom,
195 cliprect.left, cliprect.top, cliprect.right, cliprect.bottom,
196 frameinfo.cb, frameinfo.fMDIApp, frameinfo.hwndFrame, frameinfo.haccel, frameinfo.cAccelEntries);
198 hres = IOleInPlaceSite_GetWindow(This->ipsite, &parent_hwnd);
199 if(FAILED(hres)) {
200 WARN("GetWindow failed: %08lx\n", hres);
201 return hres;
204 TRACE("got parent window %p\n", parent_hwnd);
206 if(This->hwnd) {
207 if(GetParent(This->hwnd) != parent_hwnd)
208 SetParent(This->hwnd, parent_hwnd);
209 SetWindowPos(This->hwnd, HWND_TOP,
210 posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
211 SWP_NOACTIVATE | SWP_SHOWWINDOW);
212 }else {
213 CreateWindowExW(0, wszInternetExplorer_Server, NULL,
214 WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
215 posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
216 parent_hwnd, NULL, hInst, This);
218 TRACE("Created window %p\n", This->hwnd);
220 SetWindowPos(This->hwnd, NULL, 0, 0, 0, 0,
221 SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_SHOWWINDOW);
222 RedrawWindow(This->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_ALLCHILDREN);
223 SetFocus(This->hwnd);
225 /* NOTE:
226 * Windows implementation calls:
227 * RegisterWindowMessage("MSWHEEL_ROLLMSG");
228 * SetTimer(This->hwnd, TIMER_ID, 100, NULL);
232 This->in_place_active = TRUE;
233 hres = IOleInPlaceSite_OnInPlaceActivate(This->ipsite);
234 if(FAILED(hres)) {
235 WARN("OnInPlaceActivate failed: %08lx\n", hres);
236 This->in_place_active = FALSE;
237 return hres;
240 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
241 if(SUCCEEDED(hres)) {
242 VARIANT var;
244 IOleInPlaceFrame_SetStatusText(pIPFrame, NULL);
246 V_VT(&var) = VT_I4;
247 V_I4(&var) = 0;
248 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSMAX, 0, &var, NULL);
249 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSPOS, 0, &var, NULL);
251 IOleCommandTarget_Release(cmdtrg);
254 if(This->frame)
255 IOleInPlaceFrame_Release(This->frame);
256 This->frame = pIPFrame;
258 This->window_active = TRUE;
260 return S_OK;
263 static LRESULT tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
265 tooltip_data *data = GetPropW(hwnd, wszTooltipData);
267 TRACE("%d %p\n", msg, data);
269 if(msg == TTM_WINDOWFROMPOINT) {
270 RECT rect;
271 POINT *pt = (POINT*)lParam;
273 TRACE("TTM_WINDOWFROMPOINT (%ld,%ld)\n", pt->x, pt->y);
275 GetWindowRect(data->doc->hwnd, &rect);
277 if(rect.left <= pt->x && pt->x <= rect.right
278 && rect.top <= pt->y && pt->y <= rect.bottom)
279 return (LPARAM)data->doc->hwnd;
282 return CallWindowProcW(data->proc, hwnd, msg, wParam, lParam);
285 static void create_tooltips_window(HTMLDocument *This)
287 tooltip_data *data = mshtml_alloc(sizeof(*data));
289 This->tooltips_hwnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, TTS_NOPREFIX | WS_POPUP,
290 CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, This->hwnd, NULL, hInst, NULL);
292 data->doc = This;
293 data->proc = (WNDPROC)GetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC);
295 SetPropW(This->tooltips_hwnd, wszTooltipData, data);
297 SetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC, (LONG_PTR)tooltips_proc);
299 SetWindowPos(This->tooltips_hwnd, HWND_TOPMOST,0, 0, 0, 0,
300 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
304 void show_tooltip(HTMLDocument *This, DWORD x, DWORD y, LPCWSTR text)
306 TTTOOLINFOW toolinfo = {
307 sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef,
308 {x>2 ? x-2 : 0, y>0 ? y-2 : 0, x+2, y+2}, /* FIXME */
309 NULL, (LPWSTR)text, 0};
310 MSG msg = {This->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(x,y), 0, {x,y}};
312 TRACE("(%p)->(%ld %ld %s)\n", This, x, y, debugstr_w(text));
314 if(!This->tooltips_hwnd)
315 create_tooltips_window(This);
317 SendMessageW(This->tooltips_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfo);
318 SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, TRUE, 0);
319 SendMessageW(This->tooltips_hwnd, TTM_RELAYEVENT, 0, (LPARAM)&msg);
322 void hide_tooltip(HTMLDocument *This)
324 TTTOOLINFOW toolinfo = {
325 sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef,
326 {0,0,0,0}, NULL, NULL, 0};
328 TRACE("(%p)\n", This);
330 SendMessageW(This->tooltips_hwnd, TTM_DELTOOLW, 0, (LPARAM)&toolinfo);
331 SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, FALSE, 0);
334 /**********************************************************
335 * IOleDocumentView implementation
338 #define DOCVIEW_THIS(iface) DEFINE_THIS(HTMLDocument, OleDocumentView, iface)
340 static HRESULT WINAPI OleDocumentView_QueryInterface(IOleDocumentView *iface, REFIID riid, void **ppvObject)
342 HTMLDocument *This = DOCVIEW_THIS(iface);
343 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
346 static ULONG WINAPI OleDocumentView_AddRef(IOleDocumentView *iface)
348 HTMLDocument *This = DOCVIEW_THIS(iface);
349 return IHTMLDocument2_AddRef(HTMLDOC(This));
352 static ULONG WINAPI OleDocumentView_Release(IOleDocumentView *iface)
354 HTMLDocument *This = DOCVIEW_THIS(iface);
355 return IHTMLDocument2_Release(HTMLDOC(This));
358 static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite *pIPSite)
360 HTMLDocument *This = DOCVIEW_THIS(iface);
361 TRACE("(%p)->(%p)\n", This, pIPSite);
363 if(pIPSite)
364 IOleInPlaceSite_AddRef(pIPSite);
366 if(This->ipsite)
367 IOleInPlaceSite_Release(This->ipsite);
369 This->ipsite = pIPSite;
370 return S_OK;
373 static HRESULT WINAPI OleDocumentView_GetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite **ppIPSite)
375 HTMLDocument *This = DOCVIEW_THIS(iface);
376 TRACE("(%p)->(%p)\n", This, ppIPSite);
378 if(!ppIPSite)
379 return E_INVALIDARG;
381 if(This->ipsite)
382 IOleInPlaceSite_AddRef(This->ipsite);
384 *ppIPSite = This->ipsite;
385 return S_OK;
388 static HRESULT WINAPI OleDocumentView_GetDocument(IOleDocumentView *iface, IUnknown **ppunk)
390 HTMLDocument *This = DOCVIEW_THIS(iface);
391 TRACE("(%p)->(%p)\n", This, ppunk);
393 if(!ppunk)
394 return E_INVALIDARG;
396 IHTMLDocument2_AddRef(HTMLDOC(This));
397 *ppunk = (IUnknown*)HTMLDOC(This);
398 return S_OK;
401 static HRESULT WINAPI OleDocumentView_SetRect(IOleDocumentView *iface, LPRECT prcView)
403 HTMLDocument *This = DOCVIEW_THIS(iface);
404 RECT rect;
406 TRACE("(%p)->(%p)\n", This, prcView);
408 if(!prcView)
409 return E_INVALIDARG;
411 if(This->hwnd) {
412 GetClientRect(This->hwnd, &rect);
413 if(memcmp(prcView, &rect, sizeof(RECT))) {
414 InvalidateRect(This->hwnd,NULL,TRUE);
415 SetWindowPos(This->hwnd, NULL, prcView->left, prcView->top, prcView->right,
416 prcView->bottom, SWP_NOZORDER | SWP_NOACTIVATE);
420 return S_OK;
423 static HRESULT WINAPI OleDocumentView_GetRect(IOleDocumentView *iface, LPRECT prcView)
425 HTMLDocument *This = DOCVIEW_THIS(iface);
427 TRACE("(%p)->(%p)\n", This, prcView);
429 if(!prcView)
430 return E_INVALIDARG;
432 GetClientRect(This->hwnd, prcView);
433 return S_OK;
436 static HRESULT WINAPI OleDocumentView_SetRectComplex(IOleDocumentView *iface, LPRECT prcView,
437 LPRECT prcHScroll, LPRECT prcVScroll, LPRECT prcSizeBox)
439 HTMLDocument *This = DOCVIEW_THIS(iface);
440 FIXME("(%p)->(%p %p %p %p)\n", This, prcView, prcHScroll, prcVScroll, prcSizeBox);
441 return E_NOTIMPL;
444 static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
446 HTMLDocument *This = DOCVIEW_THIS(iface);
447 HRESULT hres;
449 TRACE("(%p)->(%x)\n", This, fShow);
451 if(fShow) {
452 if(!This->ui_active) {
453 hres = activate_window(This);
454 if(FAILED(hres))
455 return hres;
457 ShowWindow(This->hwnd, SW_SHOW);
458 }else {
459 ShowWindow(This->hwnd, SW_HIDE);
462 return S_OK;
465 static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL fUIActivate)
467 HTMLDocument *This = DOCVIEW_THIS(iface);
468 HRESULT hres;
470 TRACE("(%p)->(%x)\n", This, fUIActivate);
472 if(!This->ipsite) {
473 FIXME("This->ipsite = NULL\n");
474 return E_FAIL;
477 if(fUIActivate) {
478 if(This->ui_active)
479 return S_OK;
481 if(!This->window_active) {
482 hres = activate_window(This);
483 if(FAILED(hres))
484 return hres;
487 hres = IOleInPlaceSite_OnUIActivate(This->ipsite);
488 if(SUCCEEDED(hres)) {
489 OLECHAR wszHTMLDocument[30];
490 LoadStringW(hInst, IDS_HTMLDOCUMENT, wszHTMLDocument,
491 sizeof(wszHTMLDocument)/sizeof(WCHAR));
492 IOleInPlaceFrame_SetActiveObject(This->frame, ACTOBJ(This), wszHTMLDocument);
493 }else {
494 FIXME("OnUIActivate failed: %08lx\n", hres);
495 IOleInPlaceFrame_Release(This->frame);
496 This->frame = NULL;
497 This->ui_active = FALSE;
498 return hres;
501 hres = IDocHostUIHandler_ShowUI(This->hostui, 0, ACTOBJ(This), CMDTARGET(This),
502 This->frame, NULL);
503 if(FAILED(hres))
504 IDocHostUIHandler_HideUI(This->hostui);
506 This->ui_active = TRUE;
507 }else {
508 This->window_active = FALSE;
509 if(This->ui_active) {
510 This->ui_active = FALSE;
511 if(This->frame)
512 IOleInPlaceFrame_SetActiveObject(This->frame, NULL, NULL);
513 if(This->hostui)
514 IDocHostUIHandler_HideUI(This->hostui);
515 if(This->ipsite)
516 IOleInPlaceSite_OnUIDeactivate(This->ipsite, FALSE);
519 return S_OK;
522 static HRESULT WINAPI OleDocumentView_Open(IOleDocumentView *iface)
524 HTMLDocument *This = DOCVIEW_THIS(iface);
525 FIXME("(%p)\n", This);
526 return E_NOTIMPL;
529 static HRESULT WINAPI OleDocumentView_CloseView(IOleDocumentView *iface, DWORD dwReserved)
531 HTMLDocument *This = DOCVIEW_THIS(iface);
532 TRACE("(%p)->(%lx)\n", This, dwReserved);
534 if(dwReserved)
535 WARN("dwReserved = %ld\n", dwReserved);
537 /* NOTE:
538 * Windows implementation calls QueryInterface(IID_IOleCommandTarget),
539 * QueryInterface(IID_IOleControlSite) and KillTimer
542 IOleDocumentView_Show(iface, FALSE);
544 return S_OK;
547 static HRESULT WINAPI OleDocumentView_SaveViewState(IOleDocumentView *iface, LPSTREAM pstm)
549 HTMLDocument *This = DOCVIEW_THIS(iface);
550 FIXME("(%p)->(%p)\n", This, pstm);
551 return E_NOTIMPL;
554 static HRESULT WINAPI OleDocumentView_ApplyViewState(IOleDocumentView *iface, LPSTREAM pstm)
556 HTMLDocument *This = DOCVIEW_THIS(iface);
557 FIXME("(%p)->(%p)\n", This, pstm);
558 return E_NOTIMPL;
561 static HRESULT WINAPI OleDocumentView_Clone(IOleDocumentView *iface, IOleInPlaceSite *pIPSiteNew,
562 IOleDocumentView **ppViewNew)
564 HTMLDocument *This = DOCVIEW_THIS(iface);
565 FIXME("(%p)->(%p %p)\n", This, pIPSiteNew, ppViewNew);
566 return E_NOTIMPL;
569 #undef DOCVIEW_THIS
571 static const IOleDocumentViewVtbl OleDocumentViewVtbl = {
572 OleDocumentView_QueryInterface,
573 OleDocumentView_AddRef,
574 OleDocumentView_Release,
575 OleDocumentView_SetInPlaceSite,
576 OleDocumentView_GetInPlaceSite,
577 OleDocumentView_GetDocument,
578 OleDocumentView_SetRect,
579 OleDocumentView_GetRect,
580 OleDocumentView_SetRectComplex,
581 OleDocumentView_Show,
582 OleDocumentView_UIActivate,
583 OleDocumentView_Open,
584 OleDocumentView_CloseView,
585 OleDocumentView_SaveViewState,
586 OleDocumentView_ApplyViewState,
587 OleDocumentView_Clone
590 /**********************************************************
591 * IViewObject implementation
594 #define VIEWOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, ViewObject2, iface)
596 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppvObject)
598 HTMLDocument *This = VIEWOBJ_THIS(iface);
599 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
602 static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
604 HTMLDocument *This = VIEWOBJ_THIS(iface);
605 return IHTMLDocument2_AddRef(HTMLDOC(This));
608 static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
610 HTMLDocument *This = VIEWOBJ_THIS(iface);
611 return IHTMLDocument2_Release(HTMLDOC(This));
614 static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect,
615 DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds,
616 LPCRECTL lprcWBounds, BOOL (CALLBACK *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue)
618 HTMLDocument *This = VIEWOBJ_THIS(iface);
619 FIXME("(%p)->(%ld %ld %p %p %p %p %p %p %p %ld)\n", This, dwDrawAspect, lindex, pvAspect,
620 ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue);
621 return E_NOTIMPL;
624 static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect,
625 DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet)
627 HTMLDocument *This = VIEWOBJ_THIS(iface);
628 FIXME("(%p)->(%ld %ld %p %p %p %p)\n", This, dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet);
629 return E_NOTIMPL;
632 static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
633 void *pvAspect, DWORD *pdwFreeze)
635 HTMLDocument *This = VIEWOBJ_THIS(iface);
636 FIXME("(%p)->(%ld %ld %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
637 return E_NOTIMPL;
640 static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
642 HTMLDocument *This = VIEWOBJ_THIS(iface);
643 FIXME("(%p)->(%ld)\n", This, dwFreeze);
644 return E_NOTIMPL;
647 static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf, IAdviseSink *pAdvSink)
649 HTMLDocument *This = VIEWOBJ_THIS(iface);
650 FIXME("(%p)->(%ld %ld %p)\n", This, aspects, advf, pAdvSink);
651 return E_NOTIMPL;
654 static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink)
656 HTMLDocument *This = VIEWOBJ_THIS(iface);
657 FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
658 return E_NOTIMPL;
661 static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
662 DVTARGETDEVICE* ptd, LPSIZEL lpsizel)
664 HTMLDocument *This = VIEWOBJ_THIS(iface);
665 FIXME("(%p)->(%ld %ld %p %p)\n", This, dwDrawAspect, lindex, ptd, lpsizel);
666 return E_NOTIMPL;
669 #undef VIEWOBJ_THIS
671 static const IViewObject2Vtbl ViewObjectVtbl = {
672 ViewObject_QueryInterface,
673 ViewObject_AddRef,
674 ViewObject_Release,
675 ViewObject_Draw,
676 ViewObject_GetColorSet,
677 ViewObject_Freeze,
678 ViewObject_Unfreeze,
679 ViewObject_SetAdvise,
680 ViewObject_GetAdvise,
681 ViewObject_GetExtent
684 void HTMLDocument_View_Init(HTMLDocument *This)
686 This->lpOleDocumentViewVtbl = &OleDocumentViewVtbl;
687 This->lpViewObject2Vtbl = &ViewObjectVtbl;
689 This->ipsite = NULL;
690 This->frame = NULL;
691 This->hwnd = NULL;
692 This->tooltips_hwnd = NULL;
694 This->in_place_active = FALSE;
695 This->ui_active = FALSE;
696 This->window_active = FALSE;
698 create_hidden_window(This);