Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 1 | /* |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 2 | * Copyright 2005-2006 Jacek Caban for CodeWeavers |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 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 |
Jonathan Ernst | 360a3f9 | 2006-05-18 14:49:52 +0200 | [diff] [blame] | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #include "config.h" |
| 20 | |
| 21 | #include <stdarg.h> |
| 22 | #include <stdio.h> |
| 23 | |
| 24 | #define COBJMACROS |
| 25 | |
| 26 | #include "windef.h" |
| 27 | #include "winbase.h" |
| 28 | #include "winuser.h" |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 29 | #include "wingdi.h" |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 30 | #include "commctrl.h" |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 31 | #include "ole2.h" |
Jacek Caban | b5ec066 | 2005-08-29 10:15:17 +0000 | [diff] [blame] | 32 | #include "resource.h" |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 33 | |
| 34 | #include "wine/debug.h" |
| 35 | |
| 36 | #include "mshtml_private.h" |
| 37 | |
| 38 | WINE_DEFAULT_DEBUG_CHANNEL(mshtml); |
| 39 | |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 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}; |
| 42 | |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 43 | static const WCHAR wszTooltipData[] = {'t','o','o','l','t','i','p','_','d','a','t','a',0}; |
| 44 | |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 45 | static ATOM serverwnd_class = 0; |
| 46 | |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 47 | typedef struct { |
| 48 | HTMLDocument *doc; |
| 49 | WNDPROC proc; |
| 50 | } tooltip_data; |
| 51 | |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 52 | static void paint_disabled(HWND hwnd) { |
| 53 | HDC hdc; |
| 54 | PAINTSTRUCT ps; |
| 55 | HBRUSH brush; |
| 56 | RECT rect; |
| 57 | HFONT font; |
Jacek Caban | b5ec066 | 2005-08-29 10:15:17 +0000 | [diff] [blame] | 58 | WCHAR wszHTMLDisabled[100]; |
| 59 | |
| 60 | LoadStringW(hInst, IDS_HTMLDISABLED, wszHTMLDisabled, sizeof(wszHTMLDisabled)/sizeof(WCHAR)); |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 61 | |
| 62 | font = CreateFontA(25,0,0,0,400,0,0,0,ANSI_CHARSET,0,0,DEFAULT_QUALITY,DEFAULT_PITCH,NULL); |
| 63 | brush = CreateSolidBrush(RGB(255,255,255)); |
| 64 | GetClientRect(hwnd, &rect); |
| 65 | |
| 66 | hdc = BeginPaint(hwnd, &ps); |
| 67 | SelectObject(hdc, font); |
| 68 | SelectObject(hdc, brush); |
| 69 | Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); |
Jacek Caban | b5ec066 | 2005-08-29 10:15:17 +0000 | [diff] [blame] | 70 | DrawTextW(hdc, wszHTMLDisabled,-1, &rect, DT_CENTER | DT_SINGLELINE | DT_VCENTER); |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 71 | EndPaint(hwnd, &ps); |
| 72 | |
| 73 | DeleteObject(font); |
| 74 | DeleteObject(brush); |
| 75 | } |
| 76 | |
Jacek Caban | 068fa0a | 2005-08-01 10:59:45 +0000 | [diff] [blame] | 77 | static void activate_gecko(HTMLDocument *This) |
| 78 | { |
Jacek Caban | 068fa0a | 2005-08-01 10:59:45 +0000 | [diff] [blame] | 79 | TRACE("(%p) %p\n", This, This->nscontainer->window); |
| 80 | |
Jacek Caban | 2255e6f | 2005-08-10 09:54:02 +0000 | [diff] [blame] | 81 | SetParent(This->nscontainer->hwnd, This->hwnd); |
| 82 | ShowWindow(This->nscontainer->hwnd, SW_SHOW); |
Jacek Caban | 068fa0a | 2005-08-01 10:59:45 +0000 | [diff] [blame] | 83 | |
Jacek Caban | 2255e6f | 2005-08-10 09:54:02 +0000 | [diff] [blame] | 84 | nsIBaseWindow_SetVisibility(This->nscontainer->window, TRUE); |
| 85 | nsIBaseWindow_SetEnabled(This->nscontainer->window, TRUE); |
Jacek Caban | eb52044 | 2005-08-26 10:05:52 +0000 | [diff] [blame] | 86 | nsIWebBrowserFocus_Activate(This->nscontainer->focus); |
Jacek Caban | 068fa0a | 2005-08-01 10:59:45 +0000 | [diff] [blame] | 87 | } |
| 88 | |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 89 | static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
| 90 | { |
Jacek Caban | 068fa0a | 2005-08-01 10:59:45 +0000 | [diff] [blame] | 91 | HTMLDocument *This; |
| 92 | |
| 93 | static const WCHAR wszTHIS[] = {'T','H','I','S',0}; |
| 94 | |
| 95 | if(msg == WM_CREATE) { |
| 96 | This = *(HTMLDocument**)lParam; |
| 97 | SetPropW(hwnd, wszTHIS, This); |
| 98 | }else { |
| 99 | This = (HTMLDocument*)GetPropW(hwnd, wszTHIS); |
| 100 | } |
| 101 | |
| 102 | switch(msg) { |
| 103 | case WM_CREATE: |
| 104 | This->hwnd = hwnd; |
| 105 | if(This->nscontainer) |
| 106 | activate_gecko(This); |
| 107 | break; |
| 108 | case WM_PAINT: |
| 109 | if(!This->nscontainer) |
| 110 | paint_disabled(hwnd); |
| 111 | break; |
| 112 | case WM_SIZE: |
| 113 | TRACE("(%p)->(WM_SIZE)\n", This); |
Jacek Caban | 2255e6f | 2005-08-10 09:54:02 +0000 | [diff] [blame] | 114 | if(This->nscontainer) |
| 115 | SetWindowPos(This->nscontainer->hwnd, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam), |
| 116 | SWP_NOZORDER | SWP_NOACTIVATE); |
Jacek Caban | 068fa0a | 2005-08-01 10:59:45 +0000 | [diff] [blame] | 117 | } |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 118 | |
| 119 | return DefWindowProcW(hwnd, msg, wParam, lParam); |
| 120 | } |
| 121 | |
Stefan Huehner | 7120877 | 2005-06-16 15:52:44 +0000 | [diff] [blame] | 122 | static void register_serverwnd_class(void) |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 123 | { |
| 124 | static WNDCLASSEXW wndclass = { |
| 125 | sizeof(WNDCLASSEXW), |
| 126 | CS_DBLCLKS, |
| 127 | serverwnd_proc, |
| 128 | 0, 0, NULL, NULL, NULL, NULL, NULL, |
| 129 | wszInternetExplorer_Server, |
| 130 | NULL, |
| 131 | }; |
| 132 | wndclass.hInstance = hInst; |
| 133 | serverwnd_class = RegisterClassExW(&wndclass); |
| 134 | } |
| 135 | |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 136 | static HRESULT activate_window(HTMLDocument *This) |
| 137 | { |
| 138 | IOleInPlaceUIWindow *pIPWnd; |
| 139 | IOleInPlaceFrame *pIPFrame; |
Jacek Caban | 944ff51 | 2005-08-18 10:50:05 +0000 | [diff] [blame] | 140 | IOleCommandTarget *cmdtrg; |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 141 | RECT posrect, cliprect; |
| 142 | OLEINPLACEFRAMEINFO frameinfo; |
| 143 | HWND parent_hwnd; |
| 144 | HRESULT hres; |
| 145 | |
| 146 | if(!serverwnd_class) |
| 147 | register_serverwnd_class(); |
| 148 | |
| 149 | hres = IOleInPlaceSite_CanInPlaceActivate(This->ipsite); |
| 150 | if(hres != S_OK) { |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 151 | WARN("CanInPlaceActivate returned: %08x\n", hres); |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 152 | return FAILED(hres) ? hres : E_FAIL; |
| 153 | } |
| 154 | |
| 155 | hres = IOleInPlaceSite_GetWindowContext(This->ipsite, &pIPFrame, &pIPWnd, &posrect, &cliprect, &frameinfo); |
| 156 | if(FAILED(hres)) { |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 157 | WARN("GetWindowContext failed: %08x\n", hres); |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 158 | return hres; |
| 159 | } |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 160 | |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 161 | if(pIPWnd) |
| 162 | IOleInPlaceUIWindow_Release(pIPWnd); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 163 | TRACE("got window context: %p %p {%d %d %d %d} {%d %d %d %d} {%d %x %p %p %d}\n", |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 164 | pIPFrame, pIPWnd, posrect.left, posrect.top, posrect.right, posrect.bottom, |
| 165 | cliprect.left, cliprect.top, cliprect.right, cliprect.bottom, |
| 166 | frameinfo.cb, frameinfo.fMDIApp, frameinfo.hwndFrame, frameinfo.haccel, frameinfo.cAccelEntries); |
| 167 | |
| 168 | hres = IOleInPlaceSite_GetWindow(This->ipsite, &parent_hwnd); |
| 169 | if(FAILED(hres)) { |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 170 | WARN("GetWindow failed: %08x\n", hres); |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 171 | return hres; |
| 172 | } |
| 173 | |
| 174 | TRACE("got parent window %p\n", parent_hwnd); |
| 175 | |
| 176 | if(This->hwnd) { |
| 177 | if(GetParent(This->hwnd) != parent_hwnd) |
| 178 | SetParent(This->hwnd, parent_hwnd); |
| 179 | SetWindowPos(This->hwnd, HWND_TOP, |
| 180 | posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top, |
| 181 | SWP_NOACTIVATE | SWP_SHOWWINDOW); |
| 182 | }else { |
| 183 | CreateWindowExW(0, wszInternetExplorer_Server, NULL, |
| 184 | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, |
| 185 | posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top, |
| 186 | parent_hwnd, NULL, hInst, This); |
| 187 | |
| 188 | TRACE("Created window %p\n", This->hwnd); |
| 189 | |
| 190 | SetWindowPos(This->hwnd, NULL, 0, 0, 0, 0, |
| 191 | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_SHOWWINDOW); |
| 192 | RedrawWindow(This->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_ALLCHILDREN); |
| 193 | SetFocus(This->hwnd); |
| 194 | |
| 195 | /* NOTE: |
| 196 | * Windows implementation calls: |
| 197 | * RegisterWindowMessage("MSWHEEL_ROLLMSG"); |
| 198 | * SetTimer(This->hwnd, TIMER_ID, 100, NULL); |
| 199 | */ |
| 200 | } |
| 201 | |
| 202 | This->in_place_active = TRUE; |
| 203 | hres = IOleInPlaceSite_OnInPlaceActivate(This->ipsite); |
| 204 | if(FAILED(hres)) { |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 205 | WARN("OnInPlaceActivate failed: %08x\n", hres); |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 206 | This->in_place_active = FALSE; |
| 207 | return hres; |
| 208 | } |
| 209 | |
Jacek Caban | 944ff51 | 2005-08-18 10:50:05 +0000 | [diff] [blame] | 210 | hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg); |
| 211 | if(SUCCEEDED(hres)) { |
| 212 | VARIANT var; |
| 213 | |
| 214 | IOleInPlaceFrame_SetStatusText(pIPFrame, NULL); |
| 215 | |
| 216 | V_VT(&var) = VT_I4; |
| 217 | V_I4(&var) = 0; |
Jacek Caban | 3c71c7c | 2006-08-18 14:53:25 +0200 | [diff] [blame] | 218 | IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSMAX, |
| 219 | OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL); |
| 220 | IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSPOS, |
| 221 | OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL); |
Jacek Caban | 944ff51 | 2005-08-18 10:50:05 +0000 | [diff] [blame] | 222 | |
| 223 | IOleCommandTarget_Release(cmdtrg); |
| 224 | } |
| 225 | |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 226 | if(This->frame) |
| 227 | IOleInPlaceFrame_Release(This->frame); |
| 228 | This->frame = pIPFrame; |
| 229 | |
| 230 | This->window_active = TRUE; |
| 231 | |
| 232 | return S_OK; |
| 233 | } |
| 234 | |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 235 | static LRESULT tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
| 236 | { |
| 237 | tooltip_data *data = GetPropW(hwnd, wszTooltipData); |
| 238 | |
| 239 | TRACE("%d %p\n", msg, data); |
| 240 | |
| 241 | if(msg == TTM_WINDOWFROMPOINT) { |
| 242 | RECT rect; |
| 243 | POINT *pt = (POINT*)lParam; |
| 244 | |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 245 | TRACE("TTM_WINDOWFROMPOINT (%d,%d)\n", pt->x, pt->y); |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 246 | |
| 247 | GetWindowRect(data->doc->hwnd, &rect); |
| 248 | |
| 249 | if(rect.left <= pt->x && pt->x <= rect.right |
| 250 | && rect.top <= pt->y && pt->y <= rect.bottom) |
| 251 | return (LPARAM)data->doc->hwnd; |
| 252 | } |
| 253 | |
| 254 | return CallWindowProcW(data->proc, hwnd, msg, wParam, lParam); |
| 255 | } |
| 256 | |
| 257 | static void create_tooltips_window(HTMLDocument *This) |
| 258 | { |
Jacek Caban | 21ba0bf | 2006-07-19 23:39:54 +0200 | [diff] [blame] | 259 | tooltip_data *data = mshtml_alloc(sizeof(*data)); |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 260 | |
| 261 | This->tooltips_hwnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, TTS_NOPREFIX | WS_POPUP, |
| 262 | CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, This->hwnd, NULL, hInst, NULL); |
| 263 | |
| 264 | data->doc = This; |
| 265 | data->proc = (WNDPROC)GetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC); |
| 266 | |
| 267 | SetPropW(This->tooltips_hwnd, wszTooltipData, data); |
| 268 | |
| 269 | SetWindowLongPtrW(This->tooltips_hwnd, GWLP_WNDPROC, (LONG_PTR)tooltips_proc); |
| 270 | |
| 271 | SetWindowPos(This->tooltips_hwnd, HWND_TOPMOST,0, 0, 0, 0, |
| 272 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); |
| 273 | |
| 274 | } |
| 275 | |
| 276 | void show_tooltip(HTMLDocument *This, DWORD x, DWORD y, LPCWSTR text) |
| 277 | { |
| 278 | TTTOOLINFOW toolinfo = { |
| 279 | sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef, |
| 280 | {x>2 ? x-2 : 0, y>0 ? y-2 : 0, x+2, y+2}, /* FIXME */ |
| 281 | NULL, (LPWSTR)text, 0}; |
| 282 | MSG msg = {This->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(x,y), 0, {x,y}}; |
| 283 | |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 284 | TRACE("(%p)->(%d %d %s)\n", This, x, y, debugstr_w(text)); |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 285 | |
| 286 | if(!This->tooltips_hwnd) |
| 287 | create_tooltips_window(This); |
| 288 | |
| 289 | SendMessageW(This->tooltips_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfo); |
| 290 | SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, TRUE, 0); |
| 291 | SendMessageW(This->tooltips_hwnd, TTM_RELAYEVENT, 0, (LPARAM)&msg); |
| 292 | } |
| 293 | |
| 294 | void hide_tooltip(HTMLDocument *This) |
| 295 | { |
| 296 | TTTOOLINFOW toolinfo = { |
| 297 | sizeof(TTTOOLINFOW), 0, This->hwnd, 0xdeadbeef, |
| 298 | {0,0,0,0}, NULL, NULL, 0}; |
| 299 | |
| 300 | TRACE("(%p)\n", This); |
| 301 | |
| 302 | SendMessageW(This->tooltips_hwnd, TTM_DELTOOLW, 0, (LPARAM)&toolinfo); |
| 303 | SendMessageW(This->tooltips_hwnd, TTM_ACTIVATE, FALSE, 0); |
| 304 | } |
| 305 | |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 306 | /********************************************************** |
| 307 | * IOleDocumentView implementation |
| 308 | */ |
| 309 | |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 310 | #define DOCVIEW_THIS(iface) DEFINE_THIS(HTMLDocument, OleDocumentView, iface) |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 311 | |
| 312 | static HRESULT WINAPI OleDocumentView_QueryInterface(IOleDocumentView *iface, REFIID riid, void **ppvObject) |
| 313 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 314 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 315 | return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject); |
| 316 | } |
| 317 | |
| 318 | static ULONG WINAPI OleDocumentView_AddRef(IOleDocumentView *iface) |
| 319 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 320 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 321 | return IHTMLDocument2_AddRef(HTMLDOC(This)); |
| 322 | } |
| 323 | |
| 324 | static ULONG WINAPI OleDocumentView_Release(IOleDocumentView *iface) |
| 325 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 326 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 327 | return IHTMLDocument2_Release(HTMLDOC(This)); |
| 328 | } |
| 329 | |
| 330 | static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite *pIPSite) |
| 331 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 332 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 333 | TRACE("(%p)->(%p)\n", This, pIPSite); |
| 334 | |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 335 | if(pIPSite) |
| 336 | IOleInPlaceSite_AddRef(pIPSite); |
| 337 | |
| 338 | if(This->ipsite) |
| 339 | IOleInPlaceSite_Release(This->ipsite); |
| 340 | |
| 341 | This->ipsite = pIPSite; |
| 342 | return S_OK; |
| 343 | } |
| 344 | |
| 345 | static HRESULT WINAPI OleDocumentView_GetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite **ppIPSite) |
| 346 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 347 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 348 | TRACE("(%p)->(%p)\n", This, ppIPSite); |
| 349 | |
| 350 | if(!ppIPSite) |
| 351 | return E_INVALIDARG; |
| 352 | |
| 353 | if(This->ipsite) |
| 354 | IOleInPlaceSite_AddRef(This->ipsite); |
| 355 | |
| 356 | *ppIPSite = This->ipsite; |
| 357 | return S_OK; |
| 358 | } |
| 359 | |
| 360 | static HRESULT WINAPI OleDocumentView_GetDocument(IOleDocumentView *iface, IUnknown **ppunk) |
| 361 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 362 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 363 | TRACE("(%p)->(%p)\n", This, ppunk); |
| 364 | |
| 365 | if(!ppunk) |
| 366 | return E_INVALIDARG; |
| 367 | |
| 368 | IHTMLDocument2_AddRef(HTMLDOC(This)); |
| 369 | *ppunk = (IUnknown*)HTMLDOC(This); |
| 370 | return S_OK; |
| 371 | } |
| 372 | |
| 373 | static HRESULT WINAPI OleDocumentView_SetRect(IOleDocumentView *iface, LPRECT prcView) |
| 374 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 375 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 376 | RECT rect; |
| 377 | |
| 378 | TRACE("(%p)->(%p)\n", This, prcView); |
| 379 | |
| 380 | if(!prcView) |
| 381 | return E_INVALIDARG; |
| 382 | |
| 383 | if(This->hwnd) { |
| 384 | GetClientRect(This->hwnd, &rect); |
| 385 | if(memcmp(prcView, &rect, sizeof(RECT))) { |
| 386 | InvalidateRect(This->hwnd,NULL,TRUE); |
| 387 | SetWindowPos(This->hwnd, NULL, prcView->left, prcView->top, prcView->right, |
| 388 | prcView->bottom, SWP_NOZORDER | SWP_NOACTIVATE); |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | return S_OK; |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 393 | } |
| 394 | |
| 395 | static HRESULT WINAPI OleDocumentView_GetRect(IOleDocumentView *iface, LPRECT prcView) |
| 396 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 397 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 398 | |
| 399 | TRACE("(%p)->(%p)\n", This, prcView); |
| 400 | |
| 401 | if(!prcView) |
| 402 | return E_INVALIDARG; |
| 403 | |
| 404 | GetClientRect(This->hwnd, prcView); |
| 405 | return S_OK; |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | static HRESULT WINAPI OleDocumentView_SetRectComplex(IOleDocumentView *iface, LPRECT prcView, |
| 409 | LPRECT prcHScroll, LPRECT prcVScroll, LPRECT prcSizeBox) |
| 410 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 411 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 412 | FIXME("(%p)->(%p %p %p %p)\n", This, prcView, prcHScroll, prcVScroll, prcSizeBox); |
| 413 | return E_NOTIMPL; |
| 414 | } |
| 415 | |
| 416 | static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow) |
| 417 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 418 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 419 | HRESULT hres; |
| 420 | |
Jacek Caban | 6d54716 | 2005-04-15 16:12:45 +0000 | [diff] [blame] | 421 | TRACE("(%p)->(%x)\n", This, fShow); |
| 422 | |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 423 | if(fShow) { |
| 424 | if(!This->ui_active) { |
| 425 | hres = activate_window(This); |
| 426 | if(FAILED(hres)) |
| 427 | return hres; |
| 428 | } |
| 429 | ShowWindow(This->hwnd, SW_SHOW); |
| 430 | }else { |
| 431 | ShowWindow(This->hwnd, SW_HIDE); |
| 432 | } |
Jacek Caban | 6d54716 | 2005-04-15 16:12:45 +0000 | [diff] [blame] | 433 | |
| 434 | return S_OK; |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL fUIActivate) |
| 438 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 439 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 440 | HRESULT hres; |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 441 | |
| 442 | TRACE("(%p)->(%x)\n", This, fUIActivate); |
| 443 | |
| 444 | if(!This->ipsite) { |
| 445 | FIXME("This->ipsite = NULL\n"); |
| 446 | return E_FAIL; |
| 447 | } |
| 448 | |
| 449 | if(fUIActivate) { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 450 | if(This->ui_active) |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 451 | return S_OK; |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 452 | |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 453 | if(!This->window_active) { |
| 454 | hres = activate_window(This); |
| 455 | if(FAILED(hres)) |
| 456 | return hres; |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 457 | } |
| 458 | |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 459 | hres = IOleInPlaceSite_OnUIActivate(This->ipsite); |
| 460 | if(SUCCEEDED(hres)) { |
Jacek Caban | b5ec066 | 2005-08-29 10:15:17 +0000 | [diff] [blame] | 461 | OLECHAR wszHTMLDocument[30]; |
| 462 | LoadStringW(hInst, IDS_HTMLDOCUMENT, wszHTMLDocument, |
| 463 | sizeof(wszHTMLDocument)/sizeof(WCHAR)); |
| 464 | IOleInPlaceFrame_SetActiveObject(This->frame, ACTOBJ(This), wszHTMLDocument); |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 465 | }else { |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 466 | FIXME("OnUIActivate failed: %08x\n", hres); |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 467 | IOleInPlaceFrame_Release(This->frame); |
| 468 | This->frame = NULL; |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 469 | This->ui_active = FALSE; |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 470 | return hres; |
| 471 | } |
Jacek Caban | 9caed94 | 2005-07-13 11:29:38 +0000 | [diff] [blame] | 472 | |
| 473 | hres = IDocHostUIHandler_ShowUI(This->hostui, 0, ACTOBJ(This), CMDTARGET(This), |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 474 | This->frame, NULL); |
Jacek Caban | 9caed94 | 2005-07-13 11:29:38 +0000 | [diff] [blame] | 475 | if(FAILED(hres)) |
| 476 | IDocHostUIHandler_HideUI(This->hostui); |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 477 | |
| 478 | This->ui_active = TRUE; |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 479 | }else { |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 480 | This->window_active = FALSE; |
| 481 | if(This->ui_active) { |
| 482 | This->ui_active = FALSE; |
| 483 | if(This->frame) |
| 484 | IOleInPlaceFrame_SetActiveObject(This->frame, NULL, NULL); |
| 485 | if(This->hostui) |
| 486 | IDocHostUIHandler_HideUI(This->hostui); |
| 487 | if(This->ipsite) |
| 488 | IOleInPlaceSite_OnUIDeactivate(This->ipsite, FALSE); |
| 489 | } |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 490 | } |
| 491 | return S_OK; |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 492 | } |
| 493 | |
| 494 | static HRESULT WINAPI OleDocumentView_Open(IOleDocumentView *iface) |
| 495 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 496 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 497 | FIXME("(%p)\n", This); |
| 498 | return E_NOTIMPL; |
| 499 | } |
| 500 | |
| 501 | static HRESULT WINAPI OleDocumentView_CloseView(IOleDocumentView *iface, DWORD dwReserved) |
| 502 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 503 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 504 | TRACE("(%p)->(%x)\n", This, dwReserved); |
Jacek Caban | 6d54716 | 2005-04-15 16:12:45 +0000 | [diff] [blame] | 505 | |
| 506 | if(dwReserved) |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 507 | WARN("dwReserved = %d\n", dwReserved); |
Jacek Caban | 6d54716 | 2005-04-15 16:12:45 +0000 | [diff] [blame] | 508 | |
| 509 | /* NOTE: |
| 510 | * Windows implementation calls QueryInterface(IID_IOleCommandTarget), |
| 511 | * QueryInterface(IID_IOleControlSite) and KillTimer |
| 512 | */ |
| 513 | |
| 514 | IOleDocumentView_Show(iface, FALSE); |
| 515 | |
| 516 | return S_OK; |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 517 | } |
| 518 | |
| 519 | static HRESULT WINAPI OleDocumentView_SaveViewState(IOleDocumentView *iface, LPSTREAM pstm) |
| 520 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 521 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 522 | FIXME("(%p)->(%p)\n", This, pstm); |
| 523 | return E_NOTIMPL; |
| 524 | } |
| 525 | |
| 526 | static HRESULT WINAPI OleDocumentView_ApplyViewState(IOleDocumentView *iface, LPSTREAM pstm) |
| 527 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 528 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 529 | FIXME("(%p)->(%p)\n", This, pstm); |
| 530 | return E_NOTIMPL; |
| 531 | } |
| 532 | |
| 533 | static HRESULT WINAPI OleDocumentView_Clone(IOleDocumentView *iface, IOleInPlaceSite *pIPSiteNew, |
| 534 | IOleDocumentView **ppViewNew) |
| 535 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 536 | HTMLDocument *This = DOCVIEW_THIS(iface); |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 537 | FIXME("(%p)->(%p %p)\n", This, pIPSiteNew, ppViewNew); |
| 538 | return E_NOTIMPL; |
| 539 | } |
| 540 | |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 541 | #undef DOCVIEW_THIS |
| 542 | |
Dmitry Timoshkov | b67da5b | 2005-06-01 19:57:42 +0000 | [diff] [blame] | 543 | static const IOleDocumentViewVtbl OleDocumentViewVtbl = { |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 544 | OleDocumentView_QueryInterface, |
| 545 | OleDocumentView_AddRef, |
| 546 | OleDocumentView_Release, |
| 547 | OleDocumentView_SetInPlaceSite, |
| 548 | OleDocumentView_GetInPlaceSite, |
| 549 | OleDocumentView_GetDocument, |
| 550 | OleDocumentView_SetRect, |
| 551 | OleDocumentView_GetRect, |
| 552 | OleDocumentView_SetRectComplex, |
| 553 | OleDocumentView_Show, |
| 554 | OleDocumentView_UIActivate, |
| 555 | OleDocumentView_Open, |
| 556 | OleDocumentView_CloseView, |
| 557 | OleDocumentView_SaveViewState, |
| 558 | OleDocumentView_ApplyViewState, |
| 559 | OleDocumentView_Clone |
| 560 | }; |
| 561 | |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 562 | /********************************************************** |
| 563 | * IViewObject implementation |
| 564 | */ |
| 565 | |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 566 | #define VIEWOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, ViewObject2, iface) |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 567 | |
| 568 | static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppvObject) |
| 569 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 570 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 571 | return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject); |
| 572 | } |
| 573 | |
| 574 | static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface) |
| 575 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 576 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 577 | return IHTMLDocument2_AddRef(HTMLDOC(This)); |
| 578 | } |
| 579 | |
| 580 | static ULONG WINAPI ViewObject_Release(IViewObject2 *iface) |
| 581 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 582 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 583 | return IHTMLDocument2_Release(HTMLDOC(This)); |
| 584 | } |
| 585 | |
| 586 | static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, |
| 587 | DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, |
| 588 | LPCRECTL lprcWBounds, BOOL (CALLBACK *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue) |
| 589 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 590 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 591 | FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %ld)\n", This, dwDrawAspect, lindex, pvAspect, |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 592 | ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue); |
| 593 | return E_NOTIMPL; |
| 594 | } |
| 595 | |
| 596 | static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, |
| 597 | DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet) |
| 598 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 599 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 600 | FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 601 | return E_NOTIMPL; |
| 602 | } |
| 603 | |
| 604 | static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, |
| 605 | void *pvAspect, DWORD *pdwFreeze) |
| 606 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 607 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 608 | FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 609 | return E_NOTIMPL; |
| 610 | } |
| 611 | |
| 612 | static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze) |
| 613 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 614 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 615 | FIXME("(%p)->(%d)\n", This, dwFreeze); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 616 | return E_NOTIMPL; |
| 617 | } |
| 618 | |
| 619 | static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf, IAdviseSink *pAdvSink) |
| 620 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 621 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 622 | FIXME("(%p)->(%d %d %p)\n", This, aspects, advf, pAdvSink); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 623 | return E_NOTIMPL; |
| 624 | } |
| 625 | |
| 626 | static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink) |
| 627 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 628 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 629 | FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink); |
| 630 | return E_NOTIMPL; |
| 631 | } |
| 632 | |
| 633 | static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, |
| 634 | DVTARGETDEVICE* ptd, LPSIZEL lpsizel) |
| 635 | { |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 636 | HTMLDocument *This = VIEWOBJ_THIS(iface); |
Jacek Caban | 0c74c0a | 2006-10-05 23:50:39 +0200 | [diff] [blame] | 637 | FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, ptd, lpsizel); |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 638 | return E_NOTIMPL; |
| 639 | } |
| 640 | |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 641 | #undef VIEWOBJ_THIS |
| 642 | |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 643 | static const IViewObject2Vtbl ViewObjectVtbl = { |
| 644 | ViewObject_QueryInterface, |
| 645 | ViewObject_AddRef, |
| 646 | ViewObject_Release, |
| 647 | ViewObject_Draw, |
| 648 | ViewObject_GetColorSet, |
| 649 | ViewObject_Freeze, |
| 650 | ViewObject_Unfreeze, |
| 651 | ViewObject_SetAdvise, |
| 652 | ViewObject_GetAdvise, |
| 653 | ViewObject_GetExtent |
| 654 | }; |
| 655 | |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 656 | void HTMLDocument_View_Init(HTMLDocument *This) |
| 657 | { |
| 658 | This->lpOleDocumentViewVtbl = &OleDocumentViewVtbl; |
Jacek Caban | 34d7124 | 2005-06-23 16:44:43 +0000 | [diff] [blame] | 659 | This->lpViewObject2Vtbl = &ViewObjectVtbl; |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 660 | |
| 661 | This->ipsite = NULL; |
Jacek Caban | 6d54716 | 2005-04-15 16:12:45 +0000 | [diff] [blame] | 662 | This->frame = NULL; |
Jacek Caban | 44d2da9 | 2005-04-14 11:30:50 +0000 | [diff] [blame] | 663 | This->hwnd = NULL; |
Jacek Caban | 5f009f2 | 2006-03-27 21:02:28 +0200 | [diff] [blame] | 664 | This->tooltips_hwnd = NULL; |
Jacek Caban | 04a8cff | 2005-07-14 10:14:33 +0000 | [diff] [blame] | 665 | |
| 666 | This->in_place_active = FALSE; |
| 667 | This->ui_active = FALSE; |
Jacek Caban | 76cc9f2 | 2005-08-15 09:41:30 +0000 | [diff] [blame] | 668 | This->window_active = FALSE; |
Jacek Caban | da56a9c | 2005-04-13 14:41:19 +0000 | [diff] [blame] | 669 | } |