ReactOS 0.4.16-dev-340-g0540c21
view.c
Go to the documentation of this file.
1/*
2 * Copyright 2005-2006 Jacek Caban for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include "mshtml_private.h"
20
21#define TIMER_ID 0x1000
22
24 {'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','_','S','e','r','v','e','r',0};
25
26static const WCHAR wszTooltipData[] = {'t','o','o','l','t','i','p','_','d','a','t','a',0};
27
29
30typedef struct {
34
36{
37 PAINTSTRUCT ps;
38 RECT rect;
39 HDC hdc;
40
41 GetClientRect(This->hwnd, &rect);
42
43 hdc = BeginPaint(This->hwnd, &ps);
44
47
48 EndPaint(This->hwnd, &ps);
49}
50
52{
53 TRACE("(%p) %p\n", This, This->window);
54
55 SetParent(This->hwnd, This->doc->hwnd);
56 ShowWindow(This->hwnd, SW_SHOW);
57
58 nsIBaseWindow_SetVisibility(This->window, TRUE);
59 nsIBaseWindow_SetEnabled(This->window, TRUE);
60}
61
63{
64 if(!This->doc_obj->update && This->doc_obj->hwnd)
65 SetTimer(This->doc_obj->hwnd, TIMER_ID, 100, NULL);
66
67 This->doc_obj->update |= flags;
68}
69
71{
72 IOleCommandTarget *olecmd;
74
75 if(!(This->update & UPDATE_TITLE))
76 return;
77
78 This->update &= ~UPDATE_TITLE;
79
80 if(!This->client)
81 return;
82
83 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&olecmd);
84 if(SUCCEEDED(hres)) {
86 WCHAR empty[] = {0};
87
88 V_VT(&title) = VT_BSTR;
90 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETTITLE, OLECMDEXECOPT_DONTPROMPTUSER,
91 &title, NULL);
93
94 IOleCommandTarget_Release(olecmd);
95 }
96}
97
99{
100 TRACE("(%p) %x\n", This, This->update);
101
102 KillTimer(This->hwnd, TIMER_ID);
103
104 if(!This->update)
105 return 0;
106
107 if(This->update & UPDATE_UI) {
108 if(This->hostui)
109 IDocHostUIHandler_UpdateUI(This->hostui);
110
111 if(This->client) {
112 IOleCommandTarget *cmdtrg;
114
115 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
116 (void**)&cmdtrg);
117 if(SUCCEEDED(hres)) {
118 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_UPDATECOMMANDS,
119 OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL);
120 IOleCommandTarget_Release(cmdtrg);
121 }
122 }
123 }
124
126 This->update = 0;
127 return 0;
128}
129
131{
134
135 if(!This->client)
136 return;
137
138 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleControlSite, (void**)&site);
139 if(FAILED(hres))
140 return;
141
142 IOleControlSite_OnFocus(site, This->focus);
143 IOleControlSite_Release(site);
144}
145
147{
149
150 static const WCHAR wszTHIS[] = {'T','H','I','S',0};
151
152 if(msg == WM_CREATE) {
154 SetPropW(hwnd, wszTHIS, This);
155 }else {
156 This = GetPropW(hwnd, wszTHIS);
157 }
158
159 switch(msg) {
160 case WM_CREATE:
161 This->hwnd = hwnd;
162 break;
163 case WM_PAINT:
165 break;
166 case WM_SIZE:
167 TRACE("(%p)->(WM_SIZE)\n", This);
168 if(This->nscontainer) {
169 INT ew=0, eh=0;
170
171 if(!(This->hostinfo.dwFlags & (DOCHOSTUIFLAG_NO3DOUTERBORDER|DOCHOSTUIFLAG_NO3DBORDER))) {
174 }
175
176 SetWindowPos(This->nscontainer->hwnd, NULL, ew, eh,
177 LOWORD(lParam) - 2*ew, HIWORD(lParam) - 2*eh,
179 }
180 break;
181 case WM_TIMER:
182 return on_timer(This);
183 case WM_SETFOCUS:
184 TRACE("(%p) WM_SETFOCUS\n", This);
185 nsIWebBrowserFocus_Activate(This->nscontainer->focus);
186 break;
187 case WM_MOUSEACTIVATE:
188 return MA_ACTIVATE;
189 }
190
192}
193
195{
196 static WNDCLASSEXW wndclass = {
197 sizeof(WNDCLASSEXW),
200 0, 0, NULL, NULL, NULL, NULL, NULL,
202 NULL,
203 };
204 wndclass.hInstance = hInst;
206}
207
209{
210 IOleInPlaceFrame *pIPFrame;
211 IOleCommandTarget *cmdtrg;
212 IOleInPlaceSiteEx *ipsiteex;
213 RECT posrect, cliprect;
214 OLEINPLACEFRAMEINFO frameinfo;
215 HWND parent_hwnd;
217
218 if(!serverwnd_class)
220
221 hres = IOleInPlaceSite_CanInPlaceActivate(This->ipsite);
222 if(hres != S_OK) {
223 WARN("CanInPlaceActivate returned: %08x\n", hres);
224 return FAILED(hres) ? hres : E_FAIL;
225 }
226
227 frameinfo.cb = sizeof(OLEINPLACEFRAMEINFO);
228 hres = IOleInPlaceSite_GetWindowContext(This->ipsite, &pIPFrame, &This->ip_window,
229 &posrect, &cliprect, &frameinfo);
230 if(FAILED(hres)) {
231 WARN("GetWindowContext failed: %08x\n", hres);
232 return hres;
233 }
234
235 TRACE("got window context: %p %p {%d %d %d %d} {%d %d %d %d} {%d %x %p %p %d}\n",
236 pIPFrame, This->ip_window, posrect.left, posrect.top, posrect.right, posrect.bottom,
237 cliprect.left, cliprect.top, cliprect.right, cliprect.bottom,
238 frameinfo.cb, frameinfo.fMDIApp, frameinfo.hwndFrame, frameinfo.haccel, frameinfo.cAccelEntries);
239
240 hres = IOleInPlaceSite_GetWindow(This->ipsite, &parent_hwnd);
241 if(FAILED(hres)) {
242 WARN("GetWindow failed: %08x\n", hres);
243 return hres;
244 }
245
246 TRACE("got parent window %p\n", parent_hwnd);
247
248 if(This->hwnd) {
249 if(GetParent(This->hwnd) != parent_hwnd)
250 SetParent(This->hwnd, parent_hwnd);
252 posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
254 }else {
257 posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
258 parent_hwnd, NULL, hInst, This);
259
260 TRACE("Created window %p\n", This->hwnd);
261
262 SetWindowPos(This->hwnd, NULL, 0, 0, 0, 0,
265
266 /* NOTE:
267 * Windows implementation calls:
268 * RegisterWindowMessage("MSWHEEL_ROLLMSG");
269 */
270 SetTimer(This->hwnd, TIMER_ID, 100, NULL);
271 }
272
273 if(This->nscontainer)
274 activate_gecko(This->nscontainer);
275
276 This->in_place_active = TRUE;
277 hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
278 if(SUCCEEDED(hres)) {
279 BOOL redraw = FALSE;
280
281 hres = IOleInPlaceSiteEx_OnInPlaceActivateEx(ipsiteex, &redraw, 0);
282 IOleInPlaceSiteEx_Release(ipsiteex);
283 if(redraw)
284 FIXME("unsupported redraw\n");
285 }else{
286 hres = IOleInPlaceSite_OnInPlaceActivate(This->ipsite);
287 }
288 if(FAILED(hres)) {
289 WARN("OnInPlaceActivate failed: %08x\n", hres);
290 This->in_place_active = FALSE;
291 return hres;
292 }
293
294 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
295 if(SUCCEEDED(hres)) {
296 VARIANT var;
297
298 IOleInPlaceFrame_SetStatusText(pIPFrame, NULL);
299
300 V_VT(&var) = VT_I4;
301 V_I4(&var) = 0;
302 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSMAX,
303 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
304 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSPOS,
305 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
306
307 IOleCommandTarget_Release(cmdtrg);
308 }
309
310 if(This->frame)
311 IOleInPlaceFrame_Release(This->frame);
312 This->frame = pIPFrame;
313
314 if(!This->request_uiactivate) {
315 hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
316 if(SUCCEEDED(hres)) {
317 IOleInPlaceSiteEx_RequestUIActivate(ipsiteex);
318 IOleInPlaceSiteEx_Release(ipsiteex);
319 }
320 }
321
322 This->window_active = TRUE;
323
324 return S_OK;
325}
326
328{
330
331 TRACE("%d %p\n", msg, data);
332
333 if(msg == TTM_WINDOWFROMPOINT) {
334 RECT rect;
335 POINT *pt = (POINT*)lParam;
336
337 TRACE("TTM_WINDOWFROMPOINT (%d,%d)\n", pt->x, pt->y);
338
339 GetWindowRect(data->doc->hwnd, &rect);
340
341 if(rect.left <= pt->x && pt->x <= rect.right
342 && rect.top <= pt->y && pt->y <= rect.bottom)
343 return (LPARAM)data->doc->hwnd;
344 }
345
346 return CallWindowProcW(data->proc, hwnd, msg, wParam, lParam);
347}
348
350{
351 tooltip_data *data = heap_alloc(sizeof(*data));
352
354 CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, This->hwnd, NULL, hInst, NULL);
355
356 data->doc = This;
357 data->proc = (WNDPROC)GetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC);
358
359 SetPropW(This->tooltips_hwnd, wszTooltipData, data);
360
362
363 SetWindowPos(This->tooltips_hwnd, HWND_TOPMOST,0, 0, 0, 0,
365
366}
367
369{
370 TTTOOLINFOW toolinfo = {
371 sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef,
372 {x>2 ? x-2 : 0, y>0 ? y-2 : 0, x+2, y+2}, /* FIXME */
373 NULL, (LPWSTR)text, 0};
374 MSG msg = {This->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(x,y), 0, {x,y}};
375
376 TRACE("(%p)->(%d %d %s)\n", This, x, y, debugstr_w(text));
377
378 if(!This->tooltips_hwnd)
380
381 SendMessageW(This->tooltips_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfo);
382 SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, TRUE, 0);
383 SendMessageW(This->tooltips_hwnd, TTM_RELAYEVENT, 0, (LPARAM)&msg);
384}
385
387{
388 TTTOOLINFOW toolinfo = {
389 sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef,
390 {0,0,0,0}, NULL, NULL, 0};
391
392 TRACE("(%p)\n", This);
393
394 SendMessageW(This->tooltips_hwnd, TTM_DELTOOLW, 0, (LPARAM)&toolinfo);
395 SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, FALSE, 0);
396}
397
399{
400 static WCHAR html_documentW[30];
401
402 if(act_obj && !html_documentW[0]) {
403 LoadStringW(hInst, IDS_HTMLDOCUMENT, html_documentW,
404 sizeof(html_documentW)/sizeof(WCHAR));
405 }
406
407 return IOleInPlaceUIWindow_SetActiveObject(window, act_obj, act_obj ? html_documentW : NULL);
408}
409
410/**********************************************************
411 * IOleDocumentView implementation
412 */
413
415{
416 return CONTAINING_RECORD(iface, HTMLDocument, IOleDocumentView_iface);
417}
418
420{
423}
424
426{
428 return htmldoc_addref(This);
429}
430
432{
434 return htmldoc_release(This);
435}
436
438{
440 TRACE("(%p)->(%p)\n", This, pIPSite);
441
442 if(pIPSite)
443 IOleInPlaceSite_AddRef(pIPSite);
444
445 if(This->doc_obj->ipsite)
446 IOleInPlaceSite_Release(This->doc_obj->ipsite);
447
448 This->doc_obj->ipsite = pIPSite;
449 This->doc_obj->request_uiactivate = TRUE;
450 return S_OK;
451}
452
454{
456 TRACE("(%p)->(%p)\n", This, ppIPSite);
457
458 if(!ppIPSite)
459 return E_INVALIDARG;
460
461 if(This->doc_obj->ipsite)
462 IOleInPlaceSite_AddRef(This->doc_obj->ipsite);
463
464 *ppIPSite = This->doc_obj->ipsite;
465 return S_OK;
466}
467
469{
471 TRACE("(%p)->(%p)\n", This, ppunk);
472
473 if(!ppunk)
474 return E_INVALIDARG;
475
477 *ppunk = (IUnknown*)&This->IHTMLDocument2_iface;
478 return S_OK;
479}
480
482{
484 RECT rect;
485
486 TRACE("(%p)->(%p)\n", This, prcView);
487
488 if(!prcView)
489 return E_INVALIDARG;
490
491 if(This->doc_obj->hwnd) {
492 GetClientRect(This->doc_obj->hwnd, &rect);
493 if(memcmp(prcView, &rect, sizeof(RECT))) {
494 InvalidateRect(This->doc_obj->hwnd, NULL, TRUE);
495 SetWindowPos(This->doc_obj->hwnd, NULL, prcView->left, prcView->top, prcView->right,
497 }
498 }
499
500 return S_OK;
501}
502
504{
506
507 TRACE("(%p)->(%p)\n", This, prcView);
508
509 if(!prcView)
510 return E_INVALIDARG;
511
512 GetClientRect(This->doc_obj->hwnd, prcView);
513 return S_OK;
514}
515
517 LPRECT prcHScroll, LPRECT prcVScroll, LPRECT prcSizeBox)
518{
520 FIXME("(%p)->(%p %p %p %p)\n", This, prcView, prcHScroll, prcVScroll, prcSizeBox);
521 return E_NOTIMPL;
522}
523
525{
528
529 TRACE("(%p)->(%x)\n", This, fShow);
530
531 if(fShow) {
532 if(!This->doc_obj->ui_active) {
533 hres = activate_window(This->doc_obj);
534 if(FAILED(hres))
535 return hres;
536 }
538 ShowWindow(This->doc_obj->hwnd, SW_SHOW);
539 }else {
540 ShowWindow(This->doc_obj->hwnd, SW_HIDE);
541
542 if(This->doc_obj->in_place_active)
543 IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface);
544
545 if(This->doc_obj->ip_window) {
546 IOleInPlaceUIWindow_Release(This->doc_obj->ip_window);
547 This->doc_obj->ip_window = NULL;
548 }
549 }
550
551 return S_OK;
552}
553
555{
558
559 TRACE("(%p)->(%x)\n", This, fUIActivate);
560
561 if(!This->doc_obj->ipsite) {
562 IOleClientSite *cs = This->doc_obj->client;
563 IOleInPlaceSite *ips;
564
565 if(!cs) {
566 WARN("this->ipsite = NULL\n");
567 return E_UNEXPECTED;
568 }
569
570 hres = IOleClientSite_QueryInterface(cs, &IID_IOleInPlaceSiteWindowless, (void**)&ips);
571 if(SUCCEEDED(hres))
572 This->doc_obj->ipsite = ips;
573 else {
574 hres = IOleClientSite_QueryInterface(cs, &IID_IOleInPlaceSiteEx, (void**)&ips);
575 if(SUCCEEDED(hres))
576 This->doc_obj->ipsite = ips;
577 else {
578 hres = IOleClientSite_QueryInterface(cs, &IID_IOleInPlaceSite, (void**)&ips);
579 if(SUCCEEDED(hres))
580 This->doc_obj->ipsite = ips;
581 else {
582 WARN("this->ipsite = NULL\n");
583 return E_NOINTERFACE;
584 }
585 }
586 }
587
588 IOleInPlaceSite_AddRef(This->doc_obj->ipsite);
589 This->doc_obj->request_uiactivate = FALSE;
591 }
592
593 if(fUIActivate) {
594 RECT rcBorderWidths;
595
596 if(This->doc_obj->ui_active)
597 return S_OK;
598
599 if(!This->doc_obj->window_active) {
600 hres = activate_window(This->doc_obj);
601 if(FAILED(hres))
602 return hres;
603 }
604
605 This->doc_obj->focus = TRUE;
606 if(This->doc_obj->nscontainer)
607 nsIWebBrowserFocus_Activate(This->doc_obj->nscontainer->focus);
608 notif_focus(This->doc_obj);
609
611
612 hres = IOleInPlaceSite_OnUIActivate(This->doc_obj->ipsite);
613 if(SUCCEEDED(hres)) {
615 &This->IOleInPlaceActiveObject_iface);
616 }else {
617 FIXME("OnUIActivate failed: %08x\n", hres);
618 IOleInPlaceFrame_Release(This->doc_obj->frame);
619 This->doc_obj->frame = NULL;
620 This->doc_obj->ui_active = FALSE;
621 return hres;
622 }
623
624 if(This->doc_obj->hostui) {
625 hres = IDocHostUIHandler_ShowUI(This->doc_obj->hostui,
626 This->doc_obj->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE,
627 &This->IOleInPlaceActiveObject_iface, &This->IOleCommandTarget_iface,
628 This->doc_obj->frame, This->doc_obj->ip_window);
629 if(FAILED(hres))
630 IDocHostUIHandler_HideUI(This->doc_obj->hostui);
631 }
632
633 if(This->doc_obj->ip_window)
634 call_set_active_object(This->doc_obj->ip_window, &This->IOleInPlaceActiveObject_iface);
635
636 memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
637 IOleInPlaceFrame_SetBorderSpace(This->doc_obj->frame, &rcBorderWidths);
638
639 This->doc_obj->ui_active = TRUE;
640 }else {
641 This->doc_obj->focus = FALSE;
642 nsIWebBrowserFocus_Deactivate(This->doc_obj->nscontainer->focus);
643 if(This->doc_obj->ui_active) {
644 This->doc_obj->ui_active = FALSE;
645 if(This->doc_obj->ip_window)
646 call_set_active_object(This->doc_obj->ip_window, NULL);
647 if(This->doc_obj->frame)
649 if(This->doc_obj->hostui)
650 IDocHostUIHandler_HideUI(This->doc_obj->hostui);
651 if(This->doc_obj->ipsite)
652 IOleInPlaceSite_OnUIDeactivate(This->doc_obj->ipsite, FALSE);
653 }
654 }
655 return S_OK;
656}
657
659{
661 FIXME("(%p)\n", This);
662 return E_NOTIMPL;
663}
664
666{
668 TRACE("(%p)->(%x)\n", This, dwReserved);
669
670 if(dwReserved)
671 WARN("dwReserved = %d\n", dwReserved);
672
673 /* NOTE:
674 * Windows implementation calls QueryInterface(IID_IOleCommandTarget),
675 * QueryInterface(IID_IOleControlSite) and KillTimer
676 */
677
678 IOleDocumentView_Show(iface, FALSE);
679
680 return S_OK;
681}
682
684{
686 FIXME("(%p)->(%p)\n", This, pstm);
687 return E_NOTIMPL;
688}
689
691{
693 FIXME("(%p)->(%p)\n", This, pstm);
694 return E_NOTIMPL;
695}
696
698 IOleDocumentView **ppViewNew)
699{
701 FIXME("(%p)->(%p %p)\n", This, pIPSiteNew, ppViewNew);
702 return E_NOTIMPL;
703}
704
705static const IOleDocumentViewVtbl OleDocumentViewVtbl = {
722};
723
724/**********************************************************
725 * IViewObject implementation
726 */
727
729{
730 return CONTAINING_RECORD(iface, HTMLDocument, IViewObjectEx_iface);
731}
732
734{
737}
738
740{
742 return htmldoc_addref(This);
743}
744
746{
748 return htmldoc_release(This);
749}
750
751static HRESULT WINAPI ViewObject_Draw(IViewObjectEx *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect,
752 DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds,
753 LPCRECTL lprcWBounds, BOOL (CALLBACK *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue)
754{
756 FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %ld)\n", This, dwDrawAspect, lindex, pvAspect,
757 ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue);
758 return E_NOTIMPL;
759}
760
761static HRESULT WINAPI ViewObject_GetColorSet(IViewObjectEx *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect,
762 DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet)
763{
765 FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet);
766 return E_NOTIMPL;
767}
768
769static HRESULT WINAPI ViewObject_Freeze(IViewObjectEx *iface, DWORD dwDrawAspect, LONG lindex,
770 void *pvAspect, DWORD *pdwFreeze)
771{
773 FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
774 return E_NOTIMPL;
775}
776
778{
780 FIXME("(%p)->(%d)\n", This, dwFreeze);
781 return E_NOTIMPL;
782}
783
785{
787
788 TRACE("(%p)->(%d %d %p)\n", This, aspects, advf, pAdvSink);
789
790 if(aspects != DVASPECT_CONTENT || advf != ADVF_PRIMEFIRST)
791 FIXME("unsupported arguments\n");
792
793 if(This->doc_obj->view_sink)
794 IAdviseSink_Release(This->doc_obj->view_sink);
795 if(pAdvSink)
796 IAdviseSink_AddRef(pAdvSink);
797
798 This->doc_obj->view_sink = pAdvSink;
799 return S_OK;
800}
801
802static HRESULT WINAPI ViewObject_GetAdvise(IViewObjectEx *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink)
803{
805 FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
806 return E_NOTIMPL;
807}
808
809static HRESULT WINAPI ViewObject_GetExtent(IViewObjectEx *iface, DWORD dwDrawAspect, LONG lindex,
810 DVTARGETDEVICE* ptd, LPSIZEL lpsizel)
811{
813 FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, ptd, lpsizel);
814 return E_NOTIMPL;
815}
816
818{
820 FIXME("(%p)->(%d %p)\n", This, dwAspect, pRect);
821 return E_NOTIMPL;
822}
823
825{
827 FIXME("(%p)->(%p)\n", This, pdwStatus);
828 return E_NOTIMPL;
829}
830
832 LPCRECT pRectBounds, POINT ptlLoc, LONG lCloseHint, DWORD *pHitResult)
833{
835 FIXME("(%p)->(%d %p (%d %d) %d %p)\n", This, dwAspect, pRectBounds, ptlLoc.x,
836 ptlLoc.y, lCloseHint, pHitResult);
837 return E_NOTIMPL;
838}
839
841 LPCRECT pRectBounds, LPCRECT pRectLoc, LONG lCloseHint, DWORD *pHitResult)
842{
844 FIXME("(%p)->(%d %p %p %d %p)\n", This, dwAspect, pRectBounds, pRectLoc, lCloseHint, pHitResult);
845 return E_NOTIMPL;
846}
847
849 DVTARGETDEVICE *ptd, HDC hicTargetDev, DVEXTENTINFO *pExtentInfo, LPSIZEL pSizel)
850{
852 FIXME("(%p)->(%d %d %p %p %p %p\n", This, dwAspect,lindex, ptd,
853 hicTargetDev, pExtentInfo, pSizel);
854 return E_NOTIMPL;
855}
856
857static const IViewObjectExVtbl ViewObjectVtbl = {
873};
874
876{
877 This->IOleDocumentView_iface.lpVtbl = &OleDocumentViewVtbl;
878 This->IViewObjectEx_iface.lpVtbl = &ViewObjectVtbl;
879}
880
882{
883 return CONTAINING_RECORD(iface, HTMLDocumentObj, IWindowForBindingUI_iface);
884}
885
887{
889
891 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
892 *ppv = &This->IWindowForBindingUI_iface;
893 }else if(IsEqualGUID(&IID_IWindowForBindingUI, riid)) {
894 TRACE("(%p)->(IID_IWindowForBindingUI %p)\n", This, ppv);
895 *ppv = &This->IWindowForBindingUI_iface;
896 }else {
897 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
898 *ppv = NULL;
899 return E_NOINTERFACE;
900 }
901
902 IUnknown_AddRef((IUnknown*)*ppv);
903 return S_OK;
904}
905
907{
909 return htmldoc_addref(&This->basedoc);
910}
911
913{
915 return htmldoc_release(&This->basedoc);
916}
917
919{
921
922 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(rguidReason), phwnd);
923
924 *phwnd = This->hwnd;
925 return S_OK;
926}
927
928static const IWindowForBindingUIVtbl WindowForBindingUIVtbl = {
933};
934
936{
938}
#define UPDATE_TITLE
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define msg(x)
Definition: auth_time.c:54
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR empty[]
Definition: main.c:47
#define CALLBACK
Definition: compat.h:35
@ VT_BSTR
Definition: compat.h:2303
@ VT_I4
Definition: compat.h:2298
static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
Definition: view.c:35
static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze)
Definition: view.c:76
static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf, IAdviseSink *pAdvSink)
Definition: view.c:91
static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
Definition: view.c:41
static const IViewObject2Vtbl ViewObjectVtbl
Definition: view.c:135
static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL(STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR), ULONG_PTR dwContinue)
Definition: view.c:53
static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink)
Definition: view.c:109
static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
Definition: view.c:84
static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
Definition: view.c:127
static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
Definition: view.c:47
static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet)
Definition: view.c:66
#define IDS_HTMLDOCUMENT
Definition: resource.h:21
void HTMLDocument_View_Init(HTMLDocument *This)
Definition: view.c:875
static ATOM serverwnd_class
Definition: view.c:28
static HRESULT WINAPI OleDocumentView_Open(IOleDocumentView *iface)
Definition: view.c:658
static const WCHAR wszTooltipData[]
Definition: view.c:26
static ULONG WINAPI WindowForBindingUI_AddRef(IWindowForBindingUI *iface)
Definition: view.c:906
static HRESULT activate_window(HTMLDocumentObj *This)
Definition: view.c:208
static LRESULT on_timer(HTMLDocumentObj *This)
Definition: view.c:98
void notif_focus(HTMLDocumentObj *This)
Definition: view.c:130
static HRESULT WINAPI OleDocumentView_SetRect(IOleDocumentView *iface, LPRECT prcView)
Definition: view.c:481
static HRESULT WINAPI OleDocumentView_GetDocument(IOleDocumentView *iface, IUnknown **ppunk)
Definition: view.c:468
static HTMLDocument * impl_from_IOleDocumentView(IOleDocumentView *iface)
Definition: view.c:414
void hide_tooltip(HTMLDocumentObj *This)
Definition: view.c:386
static HRESULT WINAPI OleDocumentView_GetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite **ppIPSite)
Definition: view.c:453
static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: view.c:146
static HRESULT WINAPI OleDocumentView_Clone(IOleDocumentView *iface, IOleInPlaceSite *pIPSiteNew, IOleDocumentView **ppViewNew)
Definition: view.c:697
static HTMLDocumentObj * impl_from_IWindowForBindingUI(IWindowForBindingUI *iface)
Definition: view.c:881
static HRESULT WINAPI ViewObject_GetNaturalExtent(IViewObjectEx *iface, DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, HDC hicTargetDev, DVEXTENTINFO *pExtentInfo, LPSIZEL pSizel)
Definition: view.c:848
static LRESULT WINAPI tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: view.c:327
void init_binding_ui(HTMLDocumentObj *doc)
Definition: view.c:935
static HRESULT WINAPI OleDocumentView_CloseView(IOleDocumentView *iface, DWORD dwReserved)
Definition: view.c:665
static void paint_document(HTMLDocumentObj *This)
Definition: view.c:35
static const IWindowForBindingUIVtbl WindowForBindingUIVtbl
Definition: view.c:928
static ULONG WINAPI WindowForBindingUI_Release(IWindowForBindingUI *iface)
Definition: view.c:912
static HRESULT WINAPI ViewObject_QueryHitPoint(IViewObjectEx *iface, DWORD dwAspect, LPCRECT pRectBounds, POINT ptlLoc, LONG lCloseHint, DWORD *pHitResult)
Definition: view.c:831
static ULONG WINAPI OleDocumentView_Release(IOleDocumentView *iface)
Definition: view.c:431
static void register_serverwnd_class(void)
Definition: view.c:194
static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL fUIActivate)
Definition: view.c:554
static HRESULT WINAPI OleDocumentView_QueryInterface(IOleDocumentView *iface, REFIID riid, void **ppvObject)
Definition: view.c:419
static void activate_gecko(NSContainer *This)
Definition: view.c:51
static HRESULT WINAPI OleDocumentView_ApplyViewState(IOleDocumentView *iface, LPSTREAM pstm)
Definition: view.c:690
void update_doc(HTMLDocument *This, DWORD flags)
Definition: view.c:62
static HRESULT WINAPI ViewObject_GetViewStatus(IViewObjectEx *iface, DWORD *pdwStatus)
Definition: view.c:824
void update_title(HTMLDocumentObj *This)
Definition: view.c:70
static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite *pIPSite)
Definition: view.c:437
static ULONG WINAPI OleDocumentView_AddRef(IOleDocumentView *iface)
Definition: view.c:425
static HRESULT WINAPI ViewObject_GetRect(IViewObjectEx *iface, DWORD dwAspect, LPRECTL pRect)
Definition: view.c:817
#define TIMER_ID
Definition: view.c:21
static HRESULT WINAPI OleDocumentView_GetRect(IOleDocumentView *iface, LPRECT prcView)
Definition: view.c:503
static void create_tooltips_window(HTMLDocumentObj *This)
Definition: view.c:349
void show_tooltip(HTMLDocumentObj *This, DWORD x, DWORD y, LPCWSTR text)
Definition: view.c:368
static HRESULT WINAPI OleDocumentView_SetRectComplex(IOleDocumentView *iface, LPRECT prcView, LPRECT prcHScroll, LPRECT prcVScroll, LPRECT prcSizeBox)
Definition: view.c:516
static HRESULT WINAPI OleDocumentView_SaveViewState(IOleDocumentView *iface, LPSTREAM pstm)
Definition: view.c:683
static HRESULT WINAPI WindowForBindingUI_GetWindow(IWindowForBindingUI *iface, REFGUID rguidReason, HWND *phwnd)
Definition: view.c:918
static HRESULT WINAPI WindowForBindingUI_QueryInterface(IWindowForBindingUI *iface, REFIID riid, void **ppv)
Definition: view.c:886
static const WCHAR wszInternetExplorer_Server[]
Definition: view.c:23
HRESULT call_set_active_object(IOleInPlaceUIWindow *window, IOleInPlaceActiveObject *act_obj)
Definition: view.c:398
static HTMLDocument * impl_from_IViewObjectEx(IViewObjectEx *iface)
Definition: view.c:728
static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
Definition: view.c:524
static const IOleDocumentViewVtbl OleDocumentViewVtbl
Definition: view.c:705
static HRESULT WINAPI ViewObject_QueryHitRect(IViewObjectEx *iface, DWORD dwAspect, LPCRECT pRectBounds, LPCRECT pRectLoc, LONG lCloseHint, DWORD *pHitResult)
Definition: view.c:840
const WCHAR * text
Definition: package.c:1794
#define pt(x, y)
Definition: drawing.c:79
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
#define cs
Definition: i386-dis.c:442
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
const char * var
Definition: shader.c:5666
HRESULT hres
Definition: protocol.c:465
static IHTMLWindow2 * window
Definition: events.c:77
static IActiveScriptSite * site
Definition: script.c:149
coclass HostDialogHelper DOCHOSTUITYPE_BROWSE
coclass HostDialogHelper DOCHOSTUITYPE_AUTHOR
@ DOCHOSTUIFLAG_NO3DOUTERBORDER
Definition: mshtmhst.idl:136
@ DOCHOSTUIFLAG_NO3DBORDER
Definition: mshtmhst.idl:118
static HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
void HTMLDocument_LockContainer(HTMLDocumentObj *, BOOL) DECLSPEC_HIDDEN
Definition: oleobj.c:1183
static ULONG htmldoc_addref(HTMLDocument *This)
@ EDITMODE
#define UPDATE_UI
static ULONG htmldoc_release(HTMLDocument *This)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
unsigned int UINT
Definition: ndis.h:50
interface IStream * LPSTREAM
Definition: objfwd.h:10
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
const GUID IID_IOleInPlaceSite
const GUID IID_IOleControlSite
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_POPUP
Definition: pedump.c:616
long LONG
Definition: pedump.c:60
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
static char title[]
Definition: ps.c:92
#define TTM_ACTIVATE
Definition: commctrl.h:1789
#define TTM_RELAYEVENT
Definition: commctrl.h:1797
#define TTM_DELTOOLW
Definition: commctrl.h:1794
struct tagTOOLINFOW TTTOOLINFOW
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define TTM_ADDTOOLW
Definition: commctrl.h:1792
#define TTM_WINDOWFROMPOINT
Definition: commctrl.h:1816
#define TTS_NOPREFIX
Definition: commctrl.h:1758
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
IWindowForBindingUI IWindowForBindingUI_iface
Definition: scsiwmi.h:51
Definition: windef.h:314
HINSTANCE hInstance
Definition: winuser.h:3224
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
WNDPROC proc
Definition: view.c:32
HTMLDocumentObj * doc
Definition: view.c:31
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_UNEXPECTED
Definition: winerror.h:2456
#define WM_PAINT
Definition: winuser.h:1623
#define SW_HIDE
Definition: winuser.h:771
#define SWP_NOACTIVATE
Definition: winuser.h:1245
#define SWP_NOREDRAW
Definition: winuser.h:1249
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define GetWindowLongPtrW
Definition: winuser.h:4832
#define SM_CYEDGE
Definition: winuser.h:1012
#define EDGE_SUNKEN
Definition: winuser.h:451
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HWND_TOPMOST
Definition: winuser.h:1211
#define SM_CXEDGE
Definition: winuser.h:1011
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1611
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define WM_SIZE
Definition: winuser.h:1614
#define SWP_NOMOVE
Definition: winuser.h:1247
#define MA_ACTIVATE
Definition: winuser.h:2504
#define BF_ADJUST
Definition: winuser.h:470
#define WM_SETFOCUS
Definition: winuser.h:1616
#define SWP_NOSIZE
Definition: winuser.h:1248
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define CS_DBLCLKS
Definition: winuser.h:651
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HWND_TOP
Definition: winuser.h:1210
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define RDW_ALLCHILDREN
Definition: winuser.h:1224
#define WM_TIMER
Definition: winuser.h:1745
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define SWP_SHOWWINDOW
Definition: winuser.h:1251
#define WM_MOUSEACTIVATE
Definition: winuser.h:1640
#define CW_USEDEFAULT
Definition: winuser.h:225
HWND WINAPI GetParent(_In_ HWND)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
struct _WNDCLASSEXW WNDCLASSEXW
#define SW_SHOW
Definition: winuser.h:778
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909
#define SWP_NOZORDER
Definition: winuser.h:1250
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5358
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BF_RECT
Definition: winuser.h:462
#define RDW_NOERASE
Definition: winuser.h:1218
int WINAPI GetSystemMetrics(_In_ int)
#define RDW_INVALIDATE
Definition: winuser.h:1217
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185