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
34 #include "wine/debug.h"
36 #include "mshtml_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
40 #define TIMER_ID 0x1000
42 static const WCHAR wszInternetExplorer_Server
[] =
43 {'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','_','S','e','r','v','e','r',0};
45 static const WCHAR wszTooltipData
[] = {'t','o','o','l','t','i','p','_','d','a','t','a',0};
47 static ATOM serverwnd_class
= 0;
54 static void paint_document(HTMLDocument
*This
)
60 GetClientRect(This
->hwnd
, &rect
);
62 hdc
= BeginPaint(This
->hwnd
, &ps
);
64 if(!(This
->hostinfo
.dwFlags
& (DOCHOSTUIFLAG_NO3DOUTERBORDER
|DOCHOSTUIFLAG_NO3DBORDER
)))
65 DrawEdge(hdc
, &rect
, EDGE_SUNKEN
, BF_RECT
|BF_ADJUST
);
67 if(!This
->nscontainer
) {
68 WCHAR wszHTMLDisabled
[100];
71 LoadStringW(hInst
, IDS_HTMLDISABLED
, wszHTMLDisabled
, sizeof(wszHTMLDisabled
)/sizeof(WCHAR
));
73 font
= CreateFontA(25,0,0,0,400,0,0,0,ANSI_CHARSET
,0,0,DEFAULT_QUALITY
,DEFAULT_PITCH
,NULL
);
75 SelectObject(hdc
, font
);
76 SelectObject(hdc
, GetSysColorBrush(COLOR_WINDOW
));
78 Rectangle(hdc
, rect
.left
, rect
.top
, rect
.right
, rect
.bottom
);
79 DrawTextW(hdc
, wszHTMLDisabled
,-1, &rect
, DT_CENTER
| DT_SINGLELINE
| DT_VCENTER
);
84 EndPaint(This
->hwnd
, &ps
);
87 static void activate_gecko(HTMLDocument
*This
)
89 TRACE("(%p) %p\n", This
, This
->nscontainer
->window
);
91 SetParent(This
->nscontainer
->hwnd
, This
->hwnd
);
92 ShowWindow(This
->nscontainer
->hwnd
, SW_SHOW
);
94 nsIBaseWindow_SetVisibility(This
->nscontainer
->window
, TRUE
);
95 nsIBaseWindow_SetEnabled(This
->nscontainer
->window
, TRUE
);
96 nsIWebBrowserFocus_Activate(This
->nscontainer
->focus
);
99 void update_doc(HTMLDocument
*This
, DWORD flags
)
101 if(!This
->update
&& This
->hwnd
)
102 SetTimer(This
->hwnd
, TIMER_ID
, 100, NULL
);
104 This
->update
|= flags
;
107 void update_title(HTMLDocument
*This
)
109 IOleCommandTarget
*olecmd
;
112 if(!(This
->update
& UPDATE_TITLE
))
115 This
->update
&= ~UPDATE_TITLE
;
120 hres
= IOleClientSite_QueryInterface(This
->client
, &IID_IOleCommandTarget
, (void**)&olecmd
);
121 if(SUCCEEDED(hres
)) {
125 V_VT(&title
) = VT_BSTR
;
126 V_BSTR(&title
) = SysAllocString(empty
);
127 IOleCommandTarget_Exec(olecmd
, NULL
, OLECMDID_SETTITLE
, OLECMDEXECOPT_DONTPROMPTUSER
,
129 SysFreeString(V_BSTR(&title
));
131 IOleCommandTarget_Release(olecmd
);
135 static LRESULT
on_timer(HTMLDocument
*This
)
137 TRACE("(%p) %x\n", This
, This
->update
);
139 KillTimer(This
->hwnd
, TIMER_ID
);
144 if(This
->update
& UPDATE_UI
) {
146 IDocHostUIHandler_UpdateUI(This
->hostui
);
149 IOleCommandTarget
*cmdtrg
;
152 hres
= IOleClientSite_QueryInterface(This
->client
, &IID_IOleCommandTarget
,
154 if(SUCCEEDED(hres
)) {
155 IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_UPDATECOMMANDS
,
156 OLECMDEXECOPT_DONTPROMPTUSER
, NULL
, NULL
);
157 IOleCommandTarget_Release(cmdtrg
);
167 static LRESULT WINAPI
serverwnd_proc(HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
171 static const WCHAR wszTHIS
[] = {'T','H','I','S',0};
173 if(msg
== WM_CREATE
) {
174 This
= *(HTMLDocument
**)lParam
;
175 SetPropW(hwnd
, wszTHIS
, This
);
177 This
= (HTMLDocument
*)GetPropW(hwnd
, wszTHIS
);
183 if(This
->nscontainer
)
184 activate_gecko(This
);
187 paint_document(This
);
190 TRACE("(%p)->(WM_SIZE)\n", This
);
191 if(This
->nscontainer
) {
194 if(!(This
->hostinfo
.dwFlags
& (DOCHOSTUIFLAG_NO3DOUTERBORDER
|DOCHOSTUIFLAG_NO3DBORDER
))) {
195 ew
= GetSystemMetrics(SM_CXEDGE
);
196 eh
= GetSystemMetrics(SM_CYEDGE
);
199 SetWindowPos(This
->nscontainer
->hwnd
, NULL
, ew
, eh
,
200 LOWORD(lParam
) - 2*ew
, HIWORD(lParam
) - 2*eh
,
201 SWP_NOZORDER
| SWP_NOACTIVATE
);
205 return on_timer(This
);
208 return DefWindowProcW(hwnd
, msg
, wParam
, lParam
);
211 static void register_serverwnd_class(void)
213 static WNDCLASSEXW wndclass
= {
217 0, 0, NULL
, NULL
, NULL
, NULL
, NULL
,
218 wszInternetExplorer_Server
,
221 wndclass
.hInstance
= hInst
;
222 serverwnd_class
= RegisterClassExW(&wndclass
);
225 static HRESULT
activate_window(HTMLDocument
*This
)
227 IOleInPlaceUIWindow
*pIPWnd
;
228 IOleInPlaceFrame
*pIPFrame
;
229 IOleCommandTarget
*cmdtrg
;
230 IOleInPlaceSiteEx
*ipsiteex
;
231 RECT posrect
, cliprect
;
232 OLEINPLACEFRAMEINFO frameinfo
;
237 register_serverwnd_class();
239 hres
= IOleInPlaceSite_CanInPlaceActivate(This
->ipsite
);
241 WARN("CanInPlaceActivate returned: %08x\n", hres
);
242 return FAILED(hres
) ? hres
: E_FAIL
;
245 hres
= IOleInPlaceSite_GetWindowContext(This
->ipsite
, &pIPFrame
, &pIPWnd
, &posrect
, &cliprect
, &frameinfo
);
247 WARN("GetWindowContext failed: %08x\n", hres
);
252 IOleInPlaceUIWindow_Release(pIPWnd
);
253 TRACE("got window context: %p %p {%d %d %d %d} {%d %d %d %d} {%d %x %p %p %d}\n",
254 pIPFrame
, pIPWnd
, posrect
.left
, posrect
.top
, posrect
.right
, posrect
.bottom
,
255 cliprect
.left
, cliprect
.top
, cliprect
.right
, cliprect
.bottom
,
256 frameinfo
.cb
, frameinfo
.fMDIApp
, frameinfo
.hwndFrame
, frameinfo
.haccel
, frameinfo
.cAccelEntries
);
258 hres
= IOleInPlaceSite_GetWindow(This
->ipsite
, &parent_hwnd
);
260 WARN("GetWindow failed: %08x\n", hres
);
264 TRACE("got parent window %p\n", parent_hwnd
);
267 if(GetParent(This
->hwnd
) != parent_hwnd
)
268 SetParent(This
->hwnd
, parent_hwnd
);
269 SetWindowPos(This
->hwnd
, HWND_TOP
,
270 posrect
.left
, posrect
.top
, posrect
.right
-posrect
.left
, posrect
.bottom
-posrect
.top
,
271 SWP_NOACTIVATE
| SWP_SHOWWINDOW
);
273 CreateWindowExW(0, wszInternetExplorer_Server
, NULL
,
274 WS_CHILD
| WS_CLIPSIBLINGS
| WS_CLIPCHILDREN
,
275 posrect
.left
, posrect
.top
, posrect
.right
-posrect
.left
, posrect
.bottom
-posrect
.top
,
276 parent_hwnd
, NULL
, hInst
, This
);
278 TRACE("Created window %p\n", This
->hwnd
);
280 SetWindowPos(This
->hwnd
, NULL
, 0, 0, 0, 0,
281 SWP_NOSIZE
| SWP_NOMOVE
| SWP_NOZORDER
| SWP_NOREDRAW
| SWP_NOACTIVATE
| SWP_SHOWWINDOW
);
282 RedrawWindow(This
->hwnd
, NULL
, NULL
, RDW_INVALIDATE
| RDW_NOERASE
| RDW_ALLCHILDREN
);
283 SetFocus(This
->hwnd
);
286 * Windows implementation calls:
287 * RegisterWindowMessage("MSWHEEL_ROLLMSG");
289 SetTimer(This
->hwnd
, TIMER_ID
, 100, NULL
);
292 This
->in_place_active
= TRUE
;
293 hres
= IOleInPlaceSite_QueryInterface(This
->ipsite
, &IID_IOleInPlaceSiteEx
, (void**)&ipsiteex
);
294 if(SUCCEEDED(hres
)) {
297 hres
= IOleInPlaceSiteEx_OnInPlaceActivateEx(ipsiteex
, &redraw
, 0);
298 IOleInPlaceSiteEx_Release(ipsiteex
);
300 FIXME("unsupported redraw\n");
302 hres
= IOleInPlaceSite_OnInPlaceActivate(This
->ipsite
);
305 WARN("OnInPlaceActivate failed: %08x\n", hres
);
306 This
->in_place_active
= FALSE
;
310 hres
= IOleClientSite_QueryInterface(This
->client
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
311 if(SUCCEEDED(hres
)) {
314 IOleInPlaceFrame_SetStatusText(pIPFrame
, NULL
);
318 IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_SETPROGRESSMAX
,
319 OLECMDEXECOPT_DONTPROMPTUSER
, &var
, NULL
);
320 IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_SETPROGRESSPOS
,
321 OLECMDEXECOPT_DONTPROMPTUSER
, &var
, NULL
);
323 IOleCommandTarget_Release(cmdtrg
);
327 IOleInPlaceFrame_Release(This
->frame
);
328 This
->frame
= pIPFrame
;
330 This
->window_active
= TRUE
;
335 static LRESULT WINAPI
tooltips_proc(HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
337 tooltip_data
*data
= GetPropW(hwnd
, wszTooltipData
);
339 TRACE("%d %p\n", msg
, data
);
341 if(msg
== TTM_WINDOWFROMPOINT
) {
343 POINT
*pt
= (POINT
*)lParam
;
345 TRACE("TTM_WINDOWFROMPOINT (%d,%d)\n", pt
->x
, pt
->y
);
347 GetWindowRect(data
->doc
->hwnd
, &rect
);
349 if(rect
.left
<= pt
->x
&& pt
->x
<= rect
.right
350 && rect
.top
<= pt
->y
&& pt
->y
<= rect
.bottom
)
351 return (LPARAM
)data
->doc
->hwnd
;
354 return CallWindowProcW(data
->proc
, hwnd
, msg
, wParam
, lParam
);
357 static void create_tooltips_window(HTMLDocument
*This
)
359 tooltip_data
*data
= mshtml_alloc(sizeof(*data
));
361 This
->tooltips_hwnd
= CreateWindowExW(0, TOOLTIPS_CLASSW
, NULL
, TTS_NOPREFIX
| WS_POPUP
,
362 CW_USEDEFAULT
, CW_USEDEFAULT
, 10, 10, This
->hwnd
, NULL
, hInst
, NULL
);
365 data
->proc
= (WNDPROC
)GetWindowLongPtrW(This
->tooltips_hwnd
, GWLP_WNDPROC
);
367 SetPropW(This
->tooltips_hwnd
, wszTooltipData
, data
);
369 SetWindowLongPtrW(This
->tooltips_hwnd
, GWLP_WNDPROC
, (LONG_PTR
)tooltips_proc
);
371 SetWindowPos(This
->tooltips_hwnd
, HWND_TOPMOST
,0, 0, 0, 0,
372 SWP_NOMOVE
| SWP_NOSIZE
| SWP_NOACTIVATE
);
376 void show_tooltip(HTMLDocument
*This
, DWORD x
, DWORD y
, LPCWSTR text
)
378 TTTOOLINFOW toolinfo
= {
379 sizeof(TTTOOLINFOW
), 0, This
->hwnd
, 0xdeadbeef,
380 {x
>2 ? x
-2 : 0, y
>0 ? y
-2 : 0, x
+2, y
+2}, /* FIXME */
381 NULL
, (LPWSTR
)text
, 0};
382 MSG msg
= {This
->hwnd
, WM_MOUSEMOVE
, 0, MAKELPARAM(x
,y
), 0, {x
,y
}};
384 TRACE("(%p)->(%d %d %s)\n", This
, x
, y
, debugstr_w(text
));
386 if(!This
->tooltips_hwnd
)
387 create_tooltips_window(This
);
389 SendMessageW(This
->tooltips_hwnd
, TTM_ADDTOOLW
, 0, (LPARAM
)&toolinfo
);
390 SendMessageW(This
->tooltips_hwnd
, TTM_ACTIVATE
, TRUE
, 0);
391 SendMessageW(This
->tooltips_hwnd
, TTM_RELAYEVENT
, 0, (LPARAM
)&msg
);
394 void hide_tooltip(HTMLDocument
*This
)
396 TTTOOLINFOW toolinfo
= {
397 sizeof(TTTOOLINFOW
), 0, This
->hwnd
, 0xdeadbeef,
398 {0,0,0,0}, NULL
, NULL
, 0};
400 TRACE("(%p)\n", This
);
402 SendMessageW(This
->tooltips_hwnd
, TTM_DELTOOLW
, 0, (LPARAM
)&toolinfo
);
403 SendMessageW(This
->tooltips_hwnd
, TTM_ACTIVATE
, FALSE
, 0);
406 /**********************************************************
407 * IOleDocumentView implementation
410 #define DOCVIEW_THIS(iface) DEFINE_THIS(HTMLDocument, OleDocumentView, iface)
412 static HRESULT WINAPI
OleDocumentView_QueryInterface(IOleDocumentView
*iface
, REFIID riid
, void **ppvObject
)
414 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
415 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
418 static ULONG WINAPI
OleDocumentView_AddRef(IOleDocumentView
*iface
)
420 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
421 return IHTMLDocument2_AddRef(HTMLDOC(This
));
424 static ULONG WINAPI
OleDocumentView_Release(IOleDocumentView
*iface
)
426 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
427 return IHTMLDocument2_Release(HTMLDOC(This
));
430 static HRESULT WINAPI
OleDocumentView_SetInPlaceSite(IOleDocumentView
*iface
, IOleInPlaceSite
*pIPSite
)
432 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
433 TRACE("(%p)->(%p)\n", This
, pIPSite
);
436 IOleInPlaceSite_AddRef(pIPSite
);
439 IOleInPlaceSite_Release(This
->ipsite
);
441 This
->ipsite
= pIPSite
;
445 static HRESULT WINAPI
OleDocumentView_GetInPlaceSite(IOleDocumentView
*iface
, IOleInPlaceSite
**ppIPSite
)
447 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
448 TRACE("(%p)->(%p)\n", This
, ppIPSite
);
454 IOleInPlaceSite_AddRef(This
->ipsite
);
456 *ppIPSite
= This
->ipsite
;
460 static HRESULT WINAPI
OleDocumentView_GetDocument(IOleDocumentView
*iface
, IUnknown
**ppunk
)
462 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
463 TRACE("(%p)->(%p)\n", This
, ppunk
);
468 IHTMLDocument2_AddRef(HTMLDOC(This
));
469 *ppunk
= (IUnknown
*)HTMLDOC(This
);
473 static HRESULT WINAPI
OleDocumentView_SetRect(IOleDocumentView
*iface
, LPRECT prcView
)
475 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
478 TRACE("(%p)->(%p)\n", This
, prcView
);
484 GetClientRect(This
->hwnd
, &rect
);
485 if(memcmp(prcView
, &rect
, sizeof(RECT
))) {
486 InvalidateRect(This
->hwnd
,NULL
,TRUE
);
487 SetWindowPos(This
->hwnd
, NULL
, prcView
->left
, prcView
->top
, prcView
->right
,
488 prcView
->bottom
, SWP_NOZORDER
| SWP_NOACTIVATE
);
495 static HRESULT WINAPI
OleDocumentView_GetRect(IOleDocumentView
*iface
, LPRECT prcView
)
497 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
499 TRACE("(%p)->(%p)\n", This
, prcView
);
504 GetClientRect(This
->hwnd
, prcView
);
508 static HRESULT WINAPI
OleDocumentView_SetRectComplex(IOleDocumentView
*iface
, LPRECT prcView
,
509 LPRECT prcHScroll
, LPRECT prcVScroll
, LPRECT prcSizeBox
)
511 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
512 FIXME("(%p)->(%p %p %p %p)\n", This
, prcView
, prcHScroll
, prcVScroll
, prcSizeBox
);
516 static HRESULT WINAPI
OleDocumentView_Show(IOleDocumentView
*iface
, BOOL fShow
)
518 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
521 TRACE("(%p)->(%x)\n", This
, fShow
);
524 if(!This
->ui_active
) {
525 hres
= activate_window(This
);
529 update_doc(This
, UPDATE_UI
);
530 ShowWindow(This
->hwnd
, SW_SHOW
);
532 ShowWindow(This
->hwnd
, SW_HIDE
);
538 static HRESULT WINAPI
OleDocumentView_UIActivate(IOleDocumentView
*iface
, BOOL fUIActivate
)
540 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
543 TRACE("(%p)->(%x)\n", This
, fUIActivate
);
546 FIXME("This->ipsite = NULL\n");
554 if(!This
->window_active
) {
555 hres
= activate_window(This
);
560 update_doc(This
, UPDATE_UI
);
562 hres
= IOleInPlaceSite_OnUIActivate(This
->ipsite
);
563 if(SUCCEEDED(hres
)) {
564 OLECHAR wszHTMLDocument
[30];
565 LoadStringW(hInst
, IDS_HTMLDOCUMENT
, wszHTMLDocument
,
566 sizeof(wszHTMLDocument
)/sizeof(WCHAR
));
567 IOleInPlaceFrame_SetActiveObject(This
->frame
, ACTOBJ(This
), wszHTMLDocument
);
569 FIXME("OnUIActivate failed: %08x\n", hres
);
570 IOleInPlaceFrame_Release(This
->frame
);
572 This
->ui_active
= FALSE
;
576 hres
= IDocHostUIHandler_ShowUI(This
->hostui
, 0, ACTOBJ(This
), CMDTARGET(This
),
579 IDocHostUIHandler_HideUI(This
->hostui
);
581 This
->ui_active
= TRUE
;
583 This
->window_active
= FALSE
;
584 if(This
->ui_active
) {
585 This
->ui_active
= FALSE
;
587 IOleInPlaceFrame_SetActiveObject(This
->frame
, NULL
, NULL
);
589 IDocHostUIHandler_HideUI(This
->hostui
);
591 IOleInPlaceSite_OnUIDeactivate(This
->ipsite
, FALSE
);
597 static HRESULT WINAPI
OleDocumentView_Open(IOleDocumentView
*iface
)
599 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
600 FIXME("(%p)\n", This
);
604 static HRESULT WINAPI
OleDocumentView_CloseView(IOleDocumentView
*iface
, DWORD dwReserved
)
606 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
607 TRACE("(%p)->(%x)\n", This
, dwReserved
);
610 WARN("dwReserved = %d\n", dwReserved
);
613 * Windows implementation calls QueryInterface(IID_IOleCommandTarget),
614 * QueryInterface(IID_IOleControlSite) and KillTimer
617 IOleDocumentView_Show(iface
, FALSE
);
622 static HRESULT WINAPI
OleDocumentView_SaveViewState(IOleDocumentView
*iface
, LPSTREAM pstm
)
624 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
625 FIXME("(%p)->(%p)\n", This
, pstm
);
629 static HRESULT WINAPI
OleDocumentView_ApplyViewState(IOleDocumentView
*iface
, LPSTREAM pstm
)
631 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
632 FIXME("(%p)->(%p)\n", This
, pstm
);
636 static HRESULT WINAPI
OleDocumentView_Clone(IOleDocumentView
*iface
, IOleInPlaceSite
*pIPSiteNew
,
637 IOleDocumentView
**ppViewNew
)
639 HTMLDocument
*This
= DOCVIEW_THIS(iface
);
640 FIXME("(%p)->(%p %p)\n", This
, pIPSiteNew
, ppViewNew
);
646 static const IOleDocumentViewVtbl OleDocumentViewVtbl
= {
647 OleDocumentView_QueryInterface
,
648 OleDocumentView_AddRef
,
649 OleDocumentView_Release
,
650 OleDocumentView_SetInPlaceSite
,
651 OleDocumentView_GetInPlaceSite
,
652 OleDocumentView_GetDocument
,
653 OleDocumentView_SetRect
,
654 OleDocumentView_GetRect
,
655 OleDocumentView_SetRectComplex
,
656 OleDocumentView_Show
,
657 OleDocumentView_UIActivate
,
658 OleDocumentView_Open
,
659 OleDocumentView_CloseView
,
660 OleDocumentView_SaveViewState
,
661 OleDocumentView_ApplyViewState
,
662 OleDocumentView_Clone
665 /**********************************************************
666 * IViewObject implementation
669 #define VIEWOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, ViewObject2, iface)
671 static HRESULT WINAPI
ViewObject_QueryInterface(IViewObject2
*iface
, REFIID riid
, void **ppvObject
)
673 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
674 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
677 static ULONG WINAPI
ViewObject_AddRef(IViewObject2
*iface
)
679 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
680 return IHTMLDocument2_AddRef(HTMLDOC(This
));
683 static ULONG WINAPI
ViewObject_Release(IViewObject2
*iface
)
685 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
686 return IHTMLDocument2_Release(HTMLDOC(This
));
689 static HRESULT WINAPI
ViewObject_Draw(IViewObject2
*iface
, DWORD dwDrawAspect
, LONG lindex
, void *pvAspect
,
690 DVTARGETDEVICE
*ptd
, HDC hdcTargetDev
, HDC hdcDraw
, LPCRECTL lprcBounds
,
691 LPCRECTL lprcWBounds
, BOOL (CALLBACK
*pfnContinue
)(ULONG_PTR dwContinue
), ULONG_PTR dwContinue
)
693 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
694 FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %ld)\n", This
, dwDrawAspect
, lindex
, pvAspect
,
695 ptd
, hdcTargetDev
, hdcDraw
, lprcBounds
, lprcWBounds
, pfnContinue
, dwContinue
);
699 static HRESULT WINAPI
ViewObject_GetColorSet(IViewObject2
*iface
, DWORD dwDrawAspect
, LONG lindex
, void *pvAspect
,
700 DVTARGETDEVICE
*ptd
, HDC hicTargetDev
, LOGPALETTE
**ppColorSet
)
702 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
703 FIXME("(%p)->(%d %d %p %p %p %p)\n", This
, dwDrawAspect
, lindex
, pvAspect
, ptd
, hicTargetDev
, ppColorSet
);
707 static HRESULT WINAPI
ViewObject_Freeze(IViewObject2
*iface
, DWORD dwDrawAspect
, LONG lindex
,
708 void *pvAspect
, DWORD
*pdwFreeze
)
710 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
711 FIXME("(%p)->(%d %d %p %p)\n", This
, dwDrawAspect
, lindex
, pvAspect
, pdwFreeze
);
715 static HRESULT WINAPI
ViewObject_Unfreeze(IViewObject2
*iface
, DWORD dwFreeze
)
717 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
718 FIXME("(%p)->(%d)\n", This
, dwFreeze
);
722 static HRESULT WINAPI
ViewObject_SetAdvise(IViewObject2
*iface
, DWORD aspects
, DWORD advf
, IAdviseSink
*pAdvSink
)
724 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
725 FIXME("(%p)->(%d %d %p)\n", This
, aspects
, advf
, pAdvSink
);
729 static HRESULT WINAPI
ViewObject_GetAdvise(IViewObject2
*iface
, DWORD
*pAspects
, DWORD
*pAdvf
, IAdviseSink
**ppAdvSink
)
731 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
732 FIXME("(%p)->(%p %p %p)\n", This
, pAspects
, pAdvf
, ppAdvSink
);
736 static HRESULT WINAPI
ViewObject_GetExtent(IViewObject2
*iface
, DWORD dwDrawAspect
, LONG lindex
,
737 DVTARGETDEVICE
* ptd
, LPSIZEL lpsizel
)
739 HTMLDocument
*This
= VIEWOBJ_THIS(iface
);
740 FIXME("(%p)->(%d %d %p %p)\n", This
, dwDrawAspect
, lindex
, ptd
, lpsizel
);
746 static const IViewObject2Vtbl ViewObjectVtbl
= {
747 ViewObject_QueryInterface
,
751 ViewObject_GetColorSet
,
754 ViewObject_SetAdvise
,
755 ViewObject_GetAdvise
,
759 void HTMLDocument_View_Init(HTMLDocument
*This
)
761 This
->lpOleDocumentViewVtbl
= &OleDocumentViewVtbl
;
762 This
->lpViewObject2Vtbl
= &ViewObjectVtbl
;
767 This
->tooltips_hwnd
= NULL
;
769 This
->in_place_active
= FALSE
;
770 This
->ui_active
= FALSE
;
771 This
->window_active
= FALSE
;