21#define TIMER_ID 0x1000
24 {
'I',
'n',
't',
'e',
'r',
'n',
'e',
't',
' ',
'E',
'x',
'p',
'l',
'o',
'r',
'e',
'r',
'_',
'S',
'e',
'r',
'v',
'e',
'r',0};
26static const WCHAR wszTooltipData[] = {
't',
'o',
'o',
'l',
't',
'i',
'p',
'_',
'd',
'a',
't',
'a',0};
58 nsIBaseWindow_SetVisibility(
This->window,
TRUE);
59 nsIBaseWindow_SetEnabled(
This->window,
TRUE);
64 if(!
This->doc_obj->update &&
This->doc_obj->hwnd)
78 This->update &= ~UPDATE_TITLE;
83 hres = IOleClientSite_QueryInterface(
This->client, &IID_IOleCommandTarget, (
void**)&olecmd);
90 IOleCommandTarget_Exec(olecmd,
NULL, OLECMDID_SETTITLE, OLECMDEXECOPT_DONTPROMPTUSER,
94 IOleCommandTarget_Release(olecmd);
109 IDocHostUIHandler_UpdateUI(
This->hostui);
115 hres = IOleClientSite_QueryInterface(
This->client, &IID_IOleCommandTarget,
118 IOleCommandTarget_Exec(cmdtrg,
NULL, OLECMDID_UPDATECOMMANDS,
119 OLECMDEXECOPT_DONTPROMPTUSER,
NULL,
NULL);
120 IOleCommandTarget_Release(cmdtrg);
142 IOleControlSite_OnFocus(
site,
This->focus);
143 IOleControlSite_Release(
site);
150 static const WCHAR wszTHIS[] = {
'T',
'H',
'I',
'S',0};
168 if(
This->nscontainer) {
185 nsIWebBrowserFocus_Activate(
This->nscontainer->focus);
213 RECT posrect, cliprect;
214 OLEINPLACEFRAMEINFO frameinfo;
221 hres = IOleInPlaceSite_CanInPlaceActivate(
This->ipsite);
223 WARN(
"CanInPlaceActivate returned: %08x\n",
hres);
227 frameinfo.cb =
sizeof(OLEINPLACEFRAMEINFO);
228 hres = IOleInPlaceSite_GetWindowContext(
This->ipsite, &pIPFrame, &
This->ip_window,
229 &posrect, &cliprect, &frameinfo);
231 WARN(
"GetWindowContext failed: %08x\n",
hres);
235 TRACE(
"got window context: %p %p {%d %d %d %d} {%d %d %d %d} {%d %x %p %p %d}\n",
238 frameinfo.cb, frameinfo.fMDIApp, frameinfo.hwndFrame, frameinfo.haccel, frameinfo.cAccelEntries);
240 hres = IOleInPlaceSite_GetWindow(
This->ipsite, &parent_hwnd);
242 WARN(
"GetWindow failed: %08x\n",
hres);
246 TRACE(
"got parent window %p\n", parent_hwnd);
260 TRACE(
"Created window %p\n",
This->hwnd);
273 if(
This->nscontainer)
277 hres = IOleInPlaceSite_QueryInterface(
This->ipsite, &IID_IOleInPlaceSiteEx, (
void**)&ipsiteex);
281 hres = IOleInPlaceSiteEx_OnInPlaceActivateEx(ipsiteex, &
redraw, 0);
282 IOleInPlaceSiteEx_Release(ipsiteex);
284 FIXME(
"unsupported redraw\n");
286 hres = IOleInPlaceSite_OnInPlaceActivate(
This->ipsite);
289 WARN(
"OnInPlaceActivate failed: %08x\n",
hres);
294 hres = IOleClientSite_QueryInterface(
This->client, &IID_IOleCommandTarget, (
void**)&cmdtrg);
298 IOleInPlaceFrame_SetStatusText(pIPFrame,
NULL);
302 IOleCommandTarget_Exec(cmdtrg,
NULL, OLECMDID_SETPROGRESSMAX,
303 OLECMDEXECOPT_DONTPROMPTUSER, &
var,
NULL);
304 IOleCommandTarget_Exec(cmdtrg,
NULL, OLECMDID_SETPROGRESSPOS,
305 OLECMDEXECOPT_DONTPROMPTUSER, &
var,
NULL);
307 IOleCommandTarget_Release(cmdtrg);
311 IOleInPlaceFrame_Release(
This->frame);
312 This->frame = pIPFrame;
314 if(!
This->request_uiactivate) {
315 hres = IOleInPlaceSite_QueryInterface(
This->ipsite, &IID_IOleInPlaceSiteEx, (
void**)&ipsiteex);
317 IOleInPlaceSiteEx_RequestUIActivate(ipsiteex);
318 IOleInPlaceSiteEx_Release(ipsiteex);
337 TRACE(
"TTM_WINDOWFROMPOINT (%d,%d)\n",
pt->x,
pt->y);
372 {
x>2 ?
x-2 : 0,
y>0 ?
y-2 : 0,
x+2,
y+2},
378 if(!
This->tooltips_hwnd)
400 static WCHAR html_documentW[30];
402 if(act_obj && !html_documentW[0]) {
404 sizeof(html_documentW)/
sizeof(
WCHAR));
407 return IOleInPlaceUIWindow_SetActiveObject(
window, act_obj, act_obj ? html_documentW :
NULL);
443 IOleInPlaceSite_AddRef(pIPSite);
445 if(
This->doc_obj->ipsite)
446 IOleInPlaceSite_Release(
This->doc_obj->ipsite);
448 This->doc_obj->ipsite = pIPSite;
449 This->doc_obj->request_uiactivate =
TRUE;
461 if(
This->doc_obj->ipsite)
462 IOleInPlaceSite_AddRef(
This->doc_obj->ipsite);
464 *ppIPSite =
This->doc_obj->ipsite;
491 if(
This->doc_obj->hwnd) {
520 FIXME(
"(%p)->(%p %p %p %p)\n",
This, prcView, prcHScroll, prcVScroll, prcSizeBox);
532 if(!
This->doc_obj->ui_active) {
542 if(
This->doc_obj->in_place_active)
543 IOleInPlaceObjectWindowless_InPlaceDeactivate(&
This->IOleInPlaceObjectWindowless_iface);
545 if(
This->doc_obj->ip_window) {
546 IOleInPlaceUIWindow_Release(
This->doc_obj->ip_window);
559 TRACE(
"(%p)->(%x)\n",
This, fUIActivate);
561 if(!
This->doc_obj->ipsite) {
566 WARN(
"this->ipsite = NULL\n");
570 hres = IOleClientSite_QueryInterface(
cs, &IID_IOleInPlaceSiteWindowless, (
void**)&ips);
572 This->doc_obj->ipsite = ips;
574 hres = IOleClientSite_QueryInterface(
cs, &IID_IOleInPlaceSiteEx, (
void**)&ips);
576 This->doc_obj->ipsite = ips;
580 This->doc_obj->ipsite = ips;
582 WARN(
"this->ipsite = NULL\n");
588 IOleInPlaceSite_AddRef(
This->doc_obj->ipsite);
589 This->doc_obj->request_uiactivate =
FALSE;
596 if(
This->doc_obj->ui_active)
599 if(!
This->doc_obj->window_active) {
606 if(
This->doc_obj->nscontainer)
607 nsIWebBrowserFocus_Activate(
This->doc_obj->nscontainer->focus);
612 hres = IOleInPlaceSite_OnUIActivate(
This->doc_obj->ipsite);
615 &
This->IOleInPlaceActiveObject_iface);
617 FIXME(
"OnUIActivate failed: %08x\n",
hres);
618 IOleInPlaceFrame_Release(
This->doc_obj->frame);
624 if(
This->doc_obj->hostui) {
625 hres = IDocHostUIHandler_ShowUI(
This->doc_obj->hostui,
627 &
This->IOleInPlaceActiveObject_iface, &
This->IOleCommandTarget_iface,
628 This->doc_obj->frame,
This->doc_obj->ip_window);
630 IDocHostUIHandler_HideUI(
This->doc_obj->hostui);
633 if(
This->doc_obj->ip_window)
636 memset(&rcBorderWidths, 0,
sizeof(rcBorderWidths));
637 IOleInPlaceFrame_SetBorderSpace(
This->doc_obj->frame, &rcBorderWidths);
642 nsIWebBrowserFocus_Deactivate(
This->doc_obj->nscontainer->focus);
643 if(
This->doc_obj->ui_active) {
645 if(
This->doc_obj->ip_window)
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);
678 IOleDocumentView_Show(iface,
FALSE);
701 FIXME(
"(%p)->(%p %p)\n",
This, pIPSiteNew, ppViewNew);
752 DVTARGETDEVICE *ptd,
HDC hdcTargetDev,
HDC hdcDraw,
LPCRECTL lprcBounds,
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);
762 DVTARGETDEVICE *ptd,
HDC hicTargetDev,
LOGPALETTE **ppColorSet)
765 FIXME(
"(%p)->(%d %d %p %p %p %p)\n",
This, dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet);
770 void *pvAspect,
DWORD *pdwFreeze)
773 FIXME(
"(%p)->(%d %d %p %p)\n",
This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
788 TRACE(
"(%p)->(%d %d %p)\n",
This, aspects, advf, pAdvSink);
790 if(aspects != DVASPECT_CONTENT || advf != ADVF_PRIMEFIRST)
791 FIXME(
"unsupported arguments\n");
793 if(
This->doc_obj->view_sink)
794 IAdviseSink_Release(
This->doc_obj->view_sink);
796 IAdviseSink_AddRef(pAdvSink);
798 This->doc_obj->view_sink = pAdvSink;
805 FIXME(
"(%p)->(%p %p %p)\n",
This, pAspects, pAdvf, ppAdvSink);
810 DVTARGETDEVICE* ptd,
LPSIZEL lpsizel)
813 FIXME(
"(%p)->(%d %d %p %p)\n",
This, dwDrawAspect, lindex, ptd, lpsizel);
820 FIXME(
"(%p)->(%d %p)\n",
This, dwAspect, pRect);
835 FIXME(
"(%p)->(%d %p (%d %d) %d %p)\n",
This, dwAspect, pRectBounds, ptlLoc.
x,
836 ptlLoc.
y, lCloseHint, pHitResult);
844 FIXME(
"(%p)->(%d %p %p %d %p)\n",
This, dwAspect, pRectBounds, pRectLoc, lCloseHint, pHitResult);
849 DVTARGETDEVICE *ptd,
HDC hicTargetDev, DVEXTENTINFO *pExtentInfo,
LPSIZEL pSizel)
852 FIXME(
"(%p)->(%d %d %p %p %p %p\n",
This, dwAspect,lindex, ptd,
853 hicTargetDev, pExtentInfo, pSizel);
892 *
ppv = &
This->IWindowForBindingUI_iface;
894 TRACE(
"(%p)->(IID_IWindowForBindingUI %p)\n",
This,
ppv);
895 *
ppv = &
This->IWindowForBindingUI_iface;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static void * heap_alloc(size_t len)
static const WCHAR empty[]
static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze)
static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf, IAdviseSink *pAdvSink)
static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
static const IViewObject2Vtbl ViewObjectVtbl
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)
static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink)
static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet)
void HTMLDocument_View_Init(HTMLDocument *This)
static ATOM serverwnd_class
static HRESULT WINAPI OleDocumentView_Open(IOleDocumentView *iface)
static const WCHAR wszTooltipData[]
static ULONG WINAPI WindowForBindingUI_AddRef(IWindowForBindingUI *iface)
static HRESULT activate_window(HTMLDocumentObj *This)
static LRESULT on_timer(HTMLDocumentObj *This)
void notif_focus(HTMLDocumentObj *This)
static HRESULT WINAPI OleDocumentView_SetRect(IOleDocumentView *iface, LPRECT prcView)
static HRESULT WINAPI OleDocumentView_GetDocument(IOleDocumentView *iface, IUnknown **ppunk)
static HTMLDocument * impl_from_IOleDocumentView(IOleDocumentView *iface)
void hide_tooltip(HTMLDocumentObj *This)
static HRESULT WINAPI OleDocumentView_GetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite **ppIPSite)
static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
static HRESULT WINAPI OleDocumentView_Clone(IOleDocumentView *iface, IOleInPlaceSite *pIPSiteNew, IOleDocumentView **ppViewNew)
static HTMLDocumentObj * impl_from_IWindowForBindingUI(IWindowForBindingUI *iface)
static HRESULT WINAPI ViewObject_GetNaturalExtent(IViewObjectEx *iface, DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, HDC hicTargetDev, DVEXTENTINFO *pExtentInfo, LPSIZEL pSizel)
static LRESULT WINAPI tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void init_binding_ui(HTMLDocumentObj *doc)
static HRESULT WINAPI OleDocumentView_CloseView(IOleDocumentView *iface, DWORD dwReserved)
static void paint_document(HTMLDocumentObj *This)
static const IWindowForBindingUIVtbl WindowForBindingUIVtbl
static ULONG WINAPI WindowForBindingUI_Release(IWindowForBindingUI *iface)
static HRESULT WINAPI ViewObject_QueryHitPoint(IViewObjectEx *iface, DWORD dwAspect, LPCRECT pRectBounds, POINT ptlLoc, LONG lCloseHint, DWORD *pHitResult)
static ULONG WINAPI OleDocumentView_Release(IOleDocumentView *iface)
static void register_serverwnd_class(void)
static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL fUIActivate)
static HRESULT WINAPI OleDocumentView_QueryInterface(IOleDocumentView *iface, REFIID riid, void **ppvObject)
static void activate_gecko(NSContainer *This)
static HRESULT WINAPI OleDocumentView_ApplyViewState(IOleDocumentView *iface, LPSTREAM pstm)
void update_doc(HTMLDocument *This, DWORD flags)
static HRESULT WINAPI ViewObject_GetViewStatus(IViewObjectEx *iface, DWORD *pdwStatus)
void update_title(HTMLDocumentObj *This)
static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite *pIPSite)
static ULONG WINAPI OleDocumentView_AddRef(IOleDocumentView *iface)
static HRESULT WINAPI ViewObject_GetRect(IViewObjectEx *iface, DWORD dwAspect, LPRECTL pRect)
static HRESULT WINAPI OleDocumentView_GetRect(IOleDocumentView *iface, LPRECT prcView)
static void create_tooltips_window(HTMLDocumentObj *This)
void show_tooltip(HTMLDocumentObj *This, DWORD x, DWORD y, LPCWSTR text)
static HRESULT WINAPI OleDocumentView_SetRectComplex(IOleDocumentView *iface, LPRECT prcView, LPRECT prcHScroll, LPRECT prcVScroll, LPRECT prcSizeBox)
static HRESULT WINAPI OleDocumentView_SaveViewState(IOleDocumentView *iface, LPSTREAM pstm)
static HRESULT WINAPI WindowForBindingUI_GetWindow(IWindowForBindingUI *iface, REFGUID rguidReason, HWND *phwnd)
static HRESULT WINAPI WindowForBindingUI_QueryInterface(IWindowForBindingUI *iface, REFIID riid, void **ppv)
static const WCHAR wszInternetExplorer_Server[]
HRESULT call_set_active_object(IOleInPlaceUIWindow *window, IOleInPlaceActiveObject *act_obj)
static HTMLDocument * impl_from_IViewObjectEx(IViewObjectEx *iface)
static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
static const IOleDocumentViewVtbl OleDocumentViewVtbl
static HRESULT WINAPI ViewObject_QueryHitRect(IViewObjectEx *iface, DWORD dwAspect, LPCRECT pRectBounds, LPCRECT pRectLoc, LONG lCloseHint, DWORD *pHitResult)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static IHTMLWindow2 * window
static IActiveScriptSite * site
coclass HostDialogHelper DOCHOSTUITYPE_BROWSE
coclass HostDialogHelper DOCHOSTUITYPE_AUTHOR
@ DOCHOSTUIFLAG_NO3DOUTERBORDER
@ DOCHOSTUIFLAG_NO3DBORDER
static HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
void HTMLDocument_LockContainer(HTMLDocumentObj *, BOOL) DECLSPEC_HIDDEN
static ULONG htmldoc_addref(HTMLDocument *This)
static ULONG htmldoc_release(HTMLDocument *This)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
interface IStream * LPSTREAM
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
const GUID IID_IOleInPlaceSite
const GUID IID_IOleControlSite
struct tagTOOLINFOW TTTOOLINFOW
#define TTM_WINDOWFROMPOINT
#define IsEqualGUID(rguid1, rguid2)
void redraw(int x, int y, int cx, int cy)
IWindowForBindingUI IWindowForBindingUI_iface
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define CONTAINING_RECORD(address, type, field)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define GetWindowLongPtrW
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
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)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
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 *)
HWND WINAPI GetParent(_In_ HWND)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
struct _WNDCLASSEXW WNDCLASSEXW
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)