msvcrt/tests: The tests must not include msvcrt.h because it contains declarations...
[wine/multimedia.git] / dlls / mshtml / view.c
blobe0db0b8e0ff7155a5ab3a609fe0d5ad07e8a0077
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 void paint_document(HTMLDocument *This)
54 PAINTSTRUCT ps;
55 RECT rect;
56 HDC hdc;
58 GetClientRect(This->hwnd, &rect);
60 hdc = BeginPaint(This->hwnd, &ps);
62 if(!(This->hostinfo.dwFlags & (DOCHOSTUIFLAG_NO3DOUTERBORDER|DOCHOSTUIFLAG_NO3DBORDER)))
63 DrawEdge(hdc, &rect, EDGE_SUNKEN, BF_RECT|BF_ADJUST);
65 if(!This->nscontainer) {
66 WCHAR wszHTMLDisabled[100];
67 HFONT font;
69 LoadStringW(hInst, IDS_HTMLDISABLED, wszHTMLDisabled, sizeof(wszHTMLDisabled)/sizeof(WCHAR));
71 font = CreateFontA(25,0,0,0,400,0,0,0,ANSI_CHARSET,0,0,DEFAULT_QUALITY,DEFAULT_PITCH,NULL);
73 SelectObject(hdc, font);
74 SelectObject(hdc, GetSysColorBrush(COLOR_WINDOW));
76 Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom);
77 DrawTextW(hdc, wszHTMLDisabled,-1, &rect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
79 DeleteObject(font);
82 EndPaint(This->hwnd, &ps);
85 static void activate_gecko(HTMLDocument *This)
87 TRACE("(%p) %p\n", This, This->nscontainer->window);
89 SetParent(This->nscontainer->hwnd, This->hwnd);
90 ShowWindow(This->nscontainer->hwnd, SW_SHOW);
92 nsIBaseWindow_SetVisibility(This->nscontainer->window, TRUE);
93 nsIBaseWindow_SetEnabled(This->nscontainer->window, TRUE);
94 nsIWebBrowserFocus_Activate(This->nscontainer->focus);
97 static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
99 HTMLDocument *This;
101 static const WCHAR wszTHIS[] = {'T','H','I','S',0};
103 if(msg == WM_CREATE) {
104 This = *(HTMLDocument**)lParam;
105 SetPropW(hwnd, wszTHIS, This);
106 }else {
107 This = (HTMLDocument*)GetPropW(hwnd, wszTHIS);
110 switch(msg) {
111 case WM_CREATE:
112 This->hwnd = hwnd;
113 if(This->nscontainer)
114 activate_gecko(This);
115 break;
116 case WM_PAINT:
117 paint_document(This);
118 break;
119 case WM_SIZE:
120 TRACE("(%p)->(WM_SIZE)\n", This);
121 if(This->nscontainer) {
122 INT ew=0, eh=0;
124 if(!(This->hostinfo.dwFlags & (DOCHOSTUIFLAG_NO3DOUTERBORDER|DOCHOSTUIFLAG_NO3DBORDER))) {
125 ew = GetSystemMetrics(SM_CXEDGE);
126 eh = GetSystemMetrics(SM_CYEDGE);
129 SetWindowPos(This->nscontainer->hwnd, NULL, ew, eh,
130 LOWORD(lParam) - 2*ew, HIWORD(lParam) - 2*eh,
131 SWP_NOZORDER | SWP_NOACTIVATE);
135 return DefWindowProcW(hwnd, msg, wParam, lParam);
138 static void register_serverwnd_class(void)
140 static WNDCLASSEXW wndclass = {
141 sizeof(WNDCLASSEXW),
142 CS_DBLCLKS,
143 serverwnd_proc,
144 0, 0, NULL, NULL, NULL, NULL, NULL,
145 wszInternetExplorer_Server,
146 NULL,
148 wndclass.hInstance = hInst;
149 serverwnd_class = RegisterClassExW(&wndclass);
152 static HRESULT activate_window(HTMLDocument *This)
154 IOleInPlaceUIWindow *pIPWnd;
155 IOleInPlaceFrame *pIPFrame;
156 IOleCommandTarget *cmdtrg;
157 RECT posrect, cliprect;
158 OLEINPLACEFRAMEINFO frameinfo;
159 HWND parent_hwnd;
160 HRESULT hres;
162 if(!serverwnd_class)
163 register_serverwnd_class();
165 hres = IOleInPlaceSite_CanInPlaceActivate(This->ipsite);
166 if(hres != S_OK) {
167 WARN("CanInPlaceActivate returned: %08x\n", hres);
168 return FAILED(hres) ? hres : E_FAIL;
171 hres = IOleInPlaceSite_GetWindowContext(This->ipsite, &pIPFrame, &pIPWnd, &posrect, &cliprect, &frameinfo);
172 if(FAILED(hres)) {
173 WARN("GetWindowContext failed: %08x\n", hres);
174 return hres;
177 if(pIPWnd)
178 IOleInPlaceUIWindow_Release(pIPWnd);
179 TRACE("got window context: %p %p {%d %d %d %d} {%d %d %d %d} {%d %x %p %p %d}\n",
180 pIPFrame, pIPWnd, posrect.left, posrect.top, posrect.right, posrect.bottom,
181 cliprect.left, cliprect.top, cliprect.right, cliprect.bottom,
182 frameinfo.cb, frameinfo.fMDIApp, frameinfo.hwndFrame, frameinfo.haccel, frameinfo.cAccelEntries);
184 hres = IOleInPlaceSite_GetWindow(This->ipsite, &parent_hwnd);
185 if(FAILED(hres)) {
186 WARN("GetWindow failed: %08x\n", hres);
187 return hres;
190 TRACE("got parent window %p\n", parent_hwnd);
192 if(This->hwnd) {
193 if(GetParent(This->hwnd) != parent_hwnd)
194 SetParent(This->hwnd, parent_hwnd);
195 SetWindowPos(This->hwnd, HWND_TOP,
196 posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
197 SWP_NOACTIVATE | SWP_SHOWWINDOW);
198 }else {
199 CreateWindowExW(0, wszInternetExplorer_Server, NULL,
200 WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
201 posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
202 parent_hwnd, NULL, hInst, This);
204 TRACE("Created window %p\n", This->hwnd);
206 SetWindowPos(This->hwnd, NULL, 0, 0, 0, 0,
207 SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_SHOWWINDOW);
208 RedrawWindow(This->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_ALLCHILDREN);
209 SetFocus(This->hwnd);
211 /* NOTE:
212 * Windows implementation calls:
213 * RegisterWindowMessage("MSWHEEL_ROLLMSG");
214 * SetTimer(This->hwnd, TIMER_ID, 100, NULL);
218 This->in_place_active = TRUE;
219 hres = IOleInPlaceSite_OnInPlaceActivate(This->ipsite);
220 if(FAILED(hres)) {
221 WARN("OnInPlaceActivate failed: %08x\n", hres);
222 This->in_place_active = FALSE;
223 return hres;
226 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
227 if(SUCCEEDED(hres)) {
228 VARIANT var;
230 IOleInPlaceFrame_SetStatusText(pIPFrame, NULL);
232 V_VT(&var) = VT_I4;
233 V_I4(&var) = 0;
234 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSMAX,
235 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
236 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSPOS,
237 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
239 IOleCommandTarget_Release(cmdtrg);
242 if(This->frame)
243 IOleInPlaceFrame_Release(This->frame);
244 This->frame = pIPFrame;
246 This->window_active = TRUE;
248 return S_OK;
251 static LRESULT tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
253 tooltip_data *data = GetPropW(hwnd, wszTooltipData);
255 TRACE("%d %p\n", msg, data);
257 if(msg == TTM_WINDOWFROMPOINT) {
258 RECT rect;
259 POINT *pt = (POINT*)lParam;
261 TRACE("TTM_WINDOWFROMPOINT (%d,%d)\n", pt->x, pt->y);
263 GetWindowRect(data->doc->hwnd, &rect);
265 if(rect.left <= pt->x && pt->x <= rect.right
266 && rect.top <= pt->y && pt->y <= rect.bottom)
267 return (LPARAM)data->doc->hwnd;
270 return CallWindowProcW(data->proc, hwnd, msg, wParam, lParam);
273 static void create_tooltips_window(HTMLDocument *This)
275 tooltip_data *data = mshtml_alloc(sizeof(*data));
277 This->tooltips_hwnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, TTS_NOPREFIX | WS_POPUP,
278 CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, This->hwnd, NULL, hInst, NULL);
280 data->doc = This;
281 data->proc = (WNDPROC)GetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC);
283 SetPropW(This->tooltips_hwnd, wszTooltipData, data);
285 SetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC, (LONG_PTR)tooltips_proc);
287 SetWindowPos(This->tooltips_hwnd, HWND_TOPMOST,0, 0, 0, 0,
288 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
292 void show_tooltip(HTMLDocument *This, DWORD x, DWORD y, LPCWSTR text)
294 TTTOOLINFOW toolinfo = {
295 sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef,
296 {x>2 ? x-2 : 0, y>0 ? y-2 : 0, x+2, y+2}, /* FIXME */
297 NULL, (LPWSTR)text, 0};
298 MSG msg = {This->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(x,y), 0, {x,y}};
300 TRACE("(%p)->(%d %d %s)\n", This, x, y, debugstr_w(text));
302 if(!This->tooltips_hwnd)
303 create_tooltips_window(This);
305 SendMessageW(This->tooltips_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfo);
306 SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, TRUE, 0);
307 SendMessageW(This->tooltips_hwnd, TTM_RELAYEVENT, 0, (LPARAM)&msg);
310 void hide_tooltip(HTMLDocument *This)
312 TTTOOLINFOW toolinfo = {
313 sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef,
314 {0,0,0,0}, NULL, NULL, 0};
316 TRACE("(%p)\n", This);
318 SendMessageW(This->tooltips_hwnd, TTM_DELTOOLW, 0, (LPARAM)&toolinfo);
319 SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, FALSE, 0);
322 /**********************************************************
323 * IOleDocumentView implementation
326 #define DOCVIEW_THIS(iface) DEFINE_THIS(HTMLDocument, OleDocumentView, iface)
328 static HRESULT WINAPI OleDocumentView_QueryInterface(IOleDocumentView *iface, REFIID riid, void **ppvObject)
330 HTMLDocument *This = DOCVIEW_THIS(iface);
331 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
334 static ULONG WINAPI OleDocumentView_AddRef(IOleDocumentView *iface)
336 HTMLDocument *This = DOCVIEW_THIS(iface);
337 return IHTMLDocument2_AddRef(HTMLDOC(This));
340 static ULONG WINAPI OleDocumentView_Release(IOleDocumentView *iface)
342 HTMLDocument *This = DOCVIEW_THIS(iface);
343 return IHTMLDocument2_Release(HTMLDOC(This));
346 static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite *pIPSite)
348 HTMLDocument *This = DOCVIEW_THIS(iface);
349 TRACE("(%p)->(%p)\n", This, pIPSite);
351 if(pIPSite)
352 IOleInPlaceSite_AddRef(pIPSite);
354 if(This->ipsite)
355 IOleInPlaceSite_Release(This->ipsite);
357 This->ipsite = pIPSite;
358 return S_OK;
361 static HRESULT WINAPI OleDocumentView_GetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite **ppIPSite)
363 HTMLDocument *This = DOCVIEW_THIS(iface);
364 TRACE("(%p)->(%p)\n", This, ppIPSite);
366 if(!ppIPSite)
367 return E_INVALIDARG;
369 if(This->ipsite)
370 IOleInPlaceSite_AddRef(This->ipsite);
372 *ppIPSite = This->ipsite;
373 return S_OK;
376 static HRESULT WINAPI OleDocumentView_GetDocument(IOleDocumentView *iface, IUnknown **ppunk)
378 HTMLDocument *This = DOCVIEW_THIS(iface);
379 TRACE("(%p)->(%p)\n", This, ppunk);
381 if(!ppunk)
382 return E_INVALIDARG;
384 IHTMLDocument2_AddRef(HTMLDOC(This));
385 *ppunk = (IUnknown*)HTMLDOC(This);
386 return S_OK;
389 static HRESULT WINAPI OleDocumentView_SetRect(IOleDocumentView *iface, LPRECT prcView)
391 HTMLDocument *This = DOCVIEW_THIS(iface);
392 RECT rect;
394 TRACE("(%p)->(%p)\n", This, prcView);
396 if(!prcView)
397 return E_INVALIDARG;
399 if(This->hwnd) {
400 GetClientRect(This->hwnd, &rect);
401 if(memcmp(prcView, &rect, sizeof(RECT))) {
402 InvalidateRect(This->hwnd,NULL,TRUE);
403 SetWindowPos(This->hwnd, NULL, prcView->left, prcView->top, prcView->right,
404 prcView->bottom, SWP_NOZORDER | SWP_NOACTIVATE);
408 return S_OK;
411 static HRESULT WINAPI OleDocumentView_GetRect(IOleDocumentView *iface, LPRECT prcView)
413 HTMLDocument *This = DOCVIEW_THIS(iface);
415 TRACE("(%p)->(%p)\n", This, prcView);
417 if(!prcView)
418 return E_INVALIDARG;
420 GetClientRect(This->hwnd, prcView);
421 return S_OK;
424 static HRESULT WINAPI OleDocumentView_SetRectComplex(IOleDocumentView *iface, LPRECT prcView,
425 LPRECT prcHScroll, LPRECT prcVScroll, LPRECT prcSizeBox)
427 HTMLDocument *This = DOCVIEW_THIS(iface);
428 FIXME("(%p)->(%p %p %p %p)\n", This, prcView, prcHScroll, prcVScroll, prcSizeBox);
429 return E_NOTIMPL;
432 static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
434 HTMLDocument *This = DOCVIEW_THIS(iface);
435 HRESULT hres;
437 TRACE("(%p)->(%x)\n", This, fShow);
439 if(fShow) {
440 if(!This->ui_active) {
441 hres = activate_window(This);
442 if(FAILED(hres))
443 return hres;
445 ShowWindow(This->hwnd, SW_SHOW);
446 }else {
447 ShowWindow(This->hwnd, SW_HIDE);
450 return S_OK;
453 static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL fUIActivate)
455 HTMLDocument *This = DOCVIEW_THIS(iface);
456 HRESULT hres;
458 TRACE("(%p)->(%x)\n", This, fUIActivate);
460 if(!This->ipsite) {
461 FIXME("This->ipsite = NULL\n");
462 return E_FAIL;
465 if(fUIActivate) {
466 if(This->ui_active)
467 return S_OK;
469 if(!This->window_active) {
470 hres = activate_window(This);
471 if(FAILED(hres))
472 return hres;
475 hres = IOleInPlaceSite_OnUIActivate(This->ipsite);
476 if(SUCCEEDED(hres)) {
477 OLECHAR wszHTMLDocument[30];
478 LoadStringW(hInst, IDS_HTMLDOCUMENT, wszHTMLDocument,
479 sizeof(wszHTMLDocument)/sizeof(WCHAR));
480 IOleInPlaceFrame_SetActiveObject(This->frame, ACTOBJ(This), wszHTMLDocument);
481 }else {
482 FIXME("OnUIActivate failed: %08x\n", hres);
483 IOleInPlaceFrame_Release(This->frame);
484 This->frame = NULL;
485 This->ui_active = FALSE;
486 return hres;
489 hres = IDocHostUIHandler_ShowUI(This->hostui, 0, ACTOBJ(This), CMDTARGET(This),
490 This->frame, NULL);
491 if(FAILED(hres))
492 IDocHostUIHandler_HideUI(This->hostui);
494 This->ui_active = TRUE;
495 }else {
496 This->window_active = FALSE;
497 if(This->ui_active) {
498 This->ui_active = FALSE;
499 if(This->frame)
500 IOleInPlaceFrame_SetActiveObject(This->frame, NULL, NULL);
501 if(This->hostui)
502 IDocHostUIHandler_HideUI(This->hostui);
503 if(This->ipsite)
504 IOleInPlaceSite_OnUIDeactivate(This->ipsite, FALSE);
507 return S_OK;
510 static HRESULT WINAPI OleDocumentView_Open(IOleDocumentView *iface)
512 HTMLDocument *This = DOCVIEW_THIS(iface);
513 FIXME("(%p)\n", This);
514 return E_NOTIMPL;
517 static HRESULT WINAPI OleDocumentView_CloseView(IOleDocumentView *iface, DWORD dwReserved)
519 HTMLDocument *This = DOCVIEW_THIS(iface);
520 TRACE("(%p)->(%x)\n", This, dwReserved);
522 if(dwReserved)
523 WARN("dwReserved = %d\n", dwReserved);
525 /* NOTE:
526 * Windows implementation calls QueryInterface(IID_IOleCommandTarget),
527 * QueryInterface(IID_IOleControlSite) and KillTimer
530 IOleDocumentView_Show(iface, FALSE);
532 return S_OK;
535 static HRESULT WINAPI OleDocumentView_SaveViewState(IOleDocumentView *iface, LPSTREAM pstm)
537 HTMLDocument *This = DOCVIEW_THIS(iface);
538 FIXME("(%p)->(%p)\n", This, pstm);
539 return E_NOTIMPL;
542 static HRESULT WINAPI OleDocumentView_ApplyViewState(IOleDocumentView *iface, LPSTREAM pstm)
544 HTMLDocument *This = DOCVIEW_THIS(iface);
545 FIXME("(%p)->(%p)\n", This, pstm);
546 return E_NOTIMPL;
549 static HRESULT WINAPI OleDocumentView_Clone(IOleDocumentView *iface, IOleInPlaceSite *pIPSiteNew,
550 IOleDocumentView **ppViewNew)
552 HTMLDocument *This = DOCVIEW_THIS(iface);
553 FIXME("(%p)->(%p %p)\n", This, pIPSiteNew, ppViewNew);
554 return E_NOTIMPL;
557 #undef DOCVIEW_THIS
559 static const IOleDocumentViewVtbl OleDocumentViewVtbl = {
560 OleDocumentView_QueryInterface,
561 OleDocumentView_AddRef,
562 OleDocumentView_Release,
563 OleDocumentView_SetInPlaceSite,
564 OleDocumentView_GetInPlaceSite,
565 OleDocumentView_GetDocument,
566 OleDocumentView_SetRect,
567 OleDocumentView_GetRect,
568 OleDocumentView_SetRectComplex,
569 OleDocumentView_Show,
570 OleDocumentView_UIActivate,
571 OleDocumentView_Open,
572 OleDocumentView_CloseView,
573 OleDocumentView_SaveViewState,
574 OleDocumentView_ApplyViewState,
575 OleDocumentView_Clone
578 /**********************************************************
579 * IViewObject implementation
582 #define VIEWOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, ViewObject2, iface)
584 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppvObject)
586 HTMLDocument *This = VIEWOBJ_THIS(iface);
587 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
590 static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
592 HTMLDocument *This = VIEWOBJ_THIS(iface);
593 return IHTMLDocument2_AddRef(HTMLDOC(This));
596 static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
598 HTMLDocument *This = VIEWOBJ_THIS(iface);
599 return IHTMLDocument2_Release(HTMLDOC(This));
602 static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect,
603 DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds,
604 LPCRECTL lprcWBounds, BOOL (CALLBACK *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue)
606 HTMLDocument *This = VIEWOBJ_THIS(iface);
607 FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %ld)\n", This, dwDrawAspect, lindex, pvAspect,
608 ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue);
609 return E_NOTIMPL;
612 static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect,
613 DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet)
615 HTMLDocument *This = VIEWOBJ_THIS(iface);
616 FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet);
617 return E_NOTIMPL;
620 static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
621 void *pvAspect, DWORD *pdwFreeze)
623 HTMLDocument *This = VIEWOBJ_THIS(iface);
624 FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
625 return E_NOTIMPL;
628 static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
630 HTMLDocument *This = VIEWOBJ_THIS(iface);
631 FIXME("(%p)->(%d)\n", This, dwFreeze);
632 return E_NOTIMPL;
635 static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf, IAdviseSink *pAdvSink)
637 HTMLDocument *This = VIEWOBJ_THIS(iface);
638 FIXME("(%p)->(%d %d %p)\n", This, aspects, advf, pAdvSink);
639 return E_NOTIMPL;
642 static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink)
644 HTMLDocument *This = VIEWOBJ_THIS(iface);
645 FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
646 return E_NOTIMPL;
649 static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
650 DVTARGETDEVICE* ptd, LPSIZEL lpsizel)
652 HTMLDocument *This = VIEWOBJ_THIS(iface);
653 FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, ptd, lpsizel);
654 return E_NOTIMPL;
657 #undef VIEWOBJ_THIS
659 static const IViewObject2Vtbl ViewObjectVtbl = {
660 ViewObject_QueryInterface,
661 ViewObject_AddRef,
662 ViewObject_Release,
663 ViewObject_Draw,
664 ViewObject_GetColorSet,
665 ViewObject_Freeze,
666 ViewObject_Unfreeze,
667 ViewObject_SetAdvise,
668 ViewObject_GetAdvise,
669 ViewObject_GetExtent
672 void HTMLDocument_View_Init(HTMLDocument *This)
674 This->lpOleDocumentViewVtbl = &OleDocumentViewVtbl;
675 This->lpViewObject2Vtbl = &ViewObjectVtbl;
677 This->ipsite = NULL;
678 This->frame = NULL;
679 This->hwnd = NULL;
680 This->tooltips_hwnd = NULL;
682 This->in_place_active = FALSE;
683 This->ui_active = FALSE;
684 This->window_active = FALSE;