2 * Copyright 2005-2008 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
26 #include "wine/list.h"
27 #include "wine/unicode.h"
35 #define GENERATE_MSHTML_NS_FAILURE(code) \
36 ((nsresult) ((PRUint32)(1<<31) | ((PRUint32)(0x45+6)<<16) | (PRUint32)(code)))
38 #define NS_OK ((nsresult)0x00000000L)
39 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
40 #define NS_NOINTERFACE ((nsresult)0x80004002L)
41 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
42 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
43 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
44 #define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L)
46 #define WINE_NS_LOAD_FROM_MONIKER GENERATE_MSHTML_NS_FAILURE(0)
48 #define NS_FAILED(res) ((res) & 0x80000000)
49 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
53 #define MSHTML_E_NODOC 0x800a025c
55 typedef struct HTMLDOMNode HTMLDOMNode
;
56 typedef struct ConnectionPoint ConnectionPoint
;
57 typedef struct BSCallback BSCallback
;
58 typedef struct nsChannelBSC nsChannelBSC
;
59 typedef struct event_target_t event_target_t
;
61 /* NOTE: make sure to keep in sync with dispex.c */
64 DispDOMChildrenCollection_tid
,
65 DispHTMLCommentElement_tid
,
67 DispHTMLDOMTextNode_tid
,
68 DispHTMLElementCollection_tid
,
69 DispHTMLInputElement_tid
,
70 DispHTMLOptionElement_tid
,
72 DispHTMLUnknownElement_tid
,
74 IHTMLCommentElement_tid
,
79 IHTMLDOMChildrenCollection_tid
,
85 IHTMLElementCollection_tid
,
86 IHTMLInputElement_tid
,
87 IHTMLOptionElement_tid
,
95 typedef struct dispex_data_t dispex_data_t
;
97 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
98 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
101 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
102 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
103 } dispex_static_data_vtbl_t
;
106 const dispex_static_data_vtbl_t
*vtbl
;
107 const tid_t disp_tid
;
109 const tid_t iface_tids
[];
110 } dispex_static_data_t
;
113 const IDispatchExVtbl
*lpIDispatchExVtbl
;
117 dispex_static_data_t
*data
;
120 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
124 const IHTMLWindow2Vtbl
*lpHTMLWindow2Vtbl
;
125 const IHTMLWindow3Vtbl
*lpHTMLWindow3Vtbl
;
126 const IDispatchExVtbl
*lpIDispatchExVtbl
;
131 nsIDOMWindow
*nswindow
;
133 IHTMLEventObj
*event
;
145 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
147 ConnectionPoint
*cp_list
;
149 } ConnectionPointContainer
;
151 struct ConnectionPoint
{
152 const IConnectionPointVtbl
*lpConnectionPointVtbl
;
154 IConnectionPointContainer
*container
;
159 IPropertyNotifySink
*propnotif
;
165 ConnectionPoint
*next
;
169 const IHTMLLocationVtbl
*lpHTMLLocationVtbl
;
177 const IHTMLOptionElementFactoryVtbl
*lpHTMLOptionElementFactoryVtbl
;
182 } HTMLOptionElementFactory
;
184 struct HTMLDocument
{
186 const IHTMLDocument2Vtbl
*lpHTMLDocument2Vtbl
;
187 const IHTMLDocument3Vtbl
*lpHTMLDocument3Vtbl
;
188 const IHTMLDocument4Vtbl
*lpHTMLDocument4Vtbl
;
189 const IHTMLDocument5Vtbl
*lpHTMLDocument5Vtbl
;
190 const IPersistMonikerVtbl
*lpPersistMonikerVtbl
;
191 const IPersistFileVtbl
*lpPersistFileVtbl
;
192 const IMonikerPropVtbl
*lpMonikerPropVtbl
;
193 const IOleObjectVtbl
*lpOleObjectVtbl
;
194 const IOleDocumentVtbl
*lpOleDocumentVtbl
;
195 const IOleDocumentViewVtbl
*lpOleDocumentViewVtbl
;
196 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
197 const IViewObject2Vtbl
*lpViewObject2Vtbl
;
198 const IOleInPlaceObjectWindowlessVtbl
*lpOleInPlaceObjectWindowlessVtbl
;
199 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
200 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
201 const IOleControlVtbl
*lpOleControlVtbl
;
202 const IHlinkTargetVtbl
*lpHlinkTargetVtbl
;
203 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
204 const ICustomDocVtbl
*lpCustomDocVtbl
;
205 const IDispatchExVtbl
*lpIDispatchExVtbl
;
209 NSContainer
*nscontainer
;
212 IOleClientSite
*client
;
213 IDocHostUIHandler
*hostui
;
214 IOleInPlaceSite
*ipsite
;
215 IOleInPlaceFrame
*frame
;
216 IOleInPlaceUIWindow
*ip_window
;
218 IOleUndoManager
*undomgr
;
220 nsChannelBSC
*bscallback
;
223 struct list bindings
;
225 struct list script_hosts
;
230 DOCHOSTUIINFO hostinfo
;
233 READYSTATE readystate
;
234 BOOL in_place_active
;
238 BOOL container_locked
;
244 ConnectionPointContainer cp_container
;
245 ConnectionPoint cp_htmldocevents
;
246 ConnectionPoint cp_htmldocevents2
;
247 ConnectionPoint cp_propnotif
;
249 HTMLOptionElementFactory
*option_factory
;
250 HTMLLocation
*location
;
252 struct list selection_list
;
253 struct list range_list
;
259 const nsIDOMEventListenerVtbl
*lpDOMEventListenerVtbl
;
264 const nsIWebBrowserChromeVtbl
*lpWebBrowserChromeVtbl
;
265 const nsIContextMenuListenerVtbl
*lpContextMenuListenerVtbl
;
266 const nsIURIContentListenerVtbl
*lpURIContentListenerVtbl
;
267 const nsIEmbeddingSiteWindowVtbl
*lpEmbeddingSiteWindowVtbl
;
268 const nsITooltipListenerVtbl
*lpTooltipListenerVtbl
;
269 const nsIInterfaceRequestorVtbl
*lpInterfaceRequestorVtbl
;
270 const nsIWeakReferenceVtbl
*lpWeakReferenceVtbl
;
271 const nsISupportsWeakReferenceVtbl
*lpSupportsWeakReferenceVtbl
;
273 nsEventListener blur_listener
;
274 nsEventListener focus_listener
;
275 nsEventListener keypress_listener
;
276 nsEventListener load_listener
;
277 nsEventListener node_insert_listener
;
279 nsIWebBrowser
*webbrowser
;
280 nsIWebNavigation
*navigation
;
281 nsIBaseWindow
*window
;
282 nsIWebBrowserFocus
*focus
;
285 nsIController
*editor_controller
;
292 nsIURIContentListener
*content_listener
;
296 nsChannelBSC
*bscallback
; /* hack */
297 HWND reset_focus
; /* hack */
301 const nsIHttpChannelVtbl
*lpHttpChannelVtbl
;
302 const nsIUploadChannelVtbl
*lpUploadChannelVtbl
;
307 nsIHttpChannel
*http_channel
;
309 nsIInputStream
*post_data_stream
;
310 nsILoadGroup
*load_group
;
311 nsIInterfaceRequestor
*notif_callback
;
312 nsLoadFlags load_flags
;
313 nsIURI
*original_uri
;
319 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
320 void (*destructor
)(HTMLDOMNode
*);
325 const IHTMLDOMNodeVtbl
*lpHTMLDOMNodeVtbl
;
326 const IHTMLDOMNode2Vtbl
*lpHTMLDOMNode2Vtbl
;
327 const NodeImplVtbl
*vtbl
;
333 event_target_t
*event_target
;
340 ConnectionPointContainer cp_container
;
342 const IHTMLElementVtbl
*lpHTMLElementVtbl
;
343 const IHTMLElement2Vtbl
*lpHTMLElement2Vtbl
;
345 nsIDOMHTMLElement
*nselem
;
351 const IHTMLTextContainerVtbl
*lpHTMLTextContainerVtbl
;
356 #define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
357 #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
359 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
360 #define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
361 #define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
362 #define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
363 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
364 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
365 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
366 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
367 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
368 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
369 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
370 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
371 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
372 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
373 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
374 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
375 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
376 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
377 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
378 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
379 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
380 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
381 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
382 #define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
384 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
385 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
386 #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
387 #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
388 #define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
389 #define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
390 #define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
391 #define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
392 #define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
394 #define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
395 #define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
396 #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
398 #define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
399 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
400 #define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
402 #define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
403 #define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
404 #define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
405 #define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
407 #define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
409 #define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
410 #define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
412 #define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
414 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
415 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
417 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
418 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
420 HTMLWindow
*HTMLWindow_Create(HTMLDocument
*);
421 HTMLWindow
*nswindow_to_window(const nsIDOMWindow
*);
422 HTMLOptionElementFactory
*HTMLOptionElementFactory_Create(HTMLDocument
*);
423 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*);
424 IOmNavigator
*OmNavigator_Create(void);
425 void setup_nswindow(HTMLWindow
*);
427 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*);
428 void HTMLDocument_HTMLDocument5_Init(HTMLDocument
*);
429 void HTMLDocument_Persist_Init(HTMLDocument
*);
430 void HTMLDocument_OleCmd_Init(HTMLDocument
*);
431 void HTMLDocument_OleObj_Init(HTMLDocument
*);
432 void HTMLDocument_View_Init(HTMLDocument
*);
433 void HTMLDocument_Window_Init(HTMLDocument
*);
434 void HTMLDocument_Service_Init(HTMLDocument
*);
435 void HTMLDocument_Hlink_Init(HTMLDocument
*);
437 void ConnectionPoint_Init(ConnectionPoint
*,ConnectionPointContainer
*,REFIID
);
438 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
439 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
441 NSContainer
*NSContainer_Create(HTMLDocument
*,NSContainer
*);
442 void NSContainer_Release(NSContainer
*);
444 void HTMLDocument_LockContainer(HTMLDocument
*,BOOL
);
445 void show_context_menu(HTMLDocument
*,DWORD
,POINT
*,IDispatch
*);
446 void notif_focus(HTMLDocument
*);
448 void show_tooltip(HTMLDocument
*,DWORD
,DWORD
,LPCWSTR
);
449 void hide_tooltip(HTMLDocument
*);
450 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
452 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
454 BOOL
load_gecko(BOOL
);
455 void close_gecko(void);
456 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
457 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*);
458 BOOL
install_wine_gecko(BOOL
);
460 void hlink_frame_navigate(HTMLDocument
*,IHlinkFrame
*,LPCWSTR
,nsIInputStream
*,DWORD
);
462 void call_property_onchanged(ConnectionPoint
*,DISPID
);
463 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
465 void *nsalloc(size_t);
468 void nsACString_Init(nsACString
*,const char*);
469 void nsACString_SetData(nsACString
*,const char*);
470 PRUint32
nsACString_GetData(const nsACString
*,const char**);
471 void nsACString_Finish(nsACString
*);
473 void nsAString_Init(nsAString
*,const PRUnichar
*);
474 void nsAString_SetData(nsAString
*,const PRUnichar
*);
475 PRUint32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
476 void nsAString_Finish(nsAString
*);
478 nsIInputStream
*create_nsstream(const char*,PRInt32
);
479 nsICommandParams
*create_nscommand_params(void);
480 nsIMutableArray
*create_nsarray(void);
481 nsIWritableVariant
*create_nsvariant(void);
482 void nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
483 void get_editor_controller(NSContainer
*);
484 void init_nsevents(NSContainer
*);
485 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
492 void check_event_attr(HTMLDocument
*,nsIDOMElement
*);
493 void release_event_target(event_target_t
*);
494 void fire_event(HTMLDocument
*,eventid_t
,nsIDOMNode
*);
496 void set_document_bscallback(HTMLDocument
*,nsChannelBSC
*);
497 void set_current_mon(HTMLDocument
*,IMoniker
*);
498 HRESULT
start_binding(HTMLDocument
*,BSCallback
*,IBindCtx
*);
500 HRESULT
bind_mon_to_buffer(HTMLDocument
*,IMoniker
*,void**,DWORD
*);
502 nsChannelBSC
*create_channelbsc(IMoniker
*);
503 HRESULT
channelbsc_load_stream(nsChannelBSC
*,IStream
*);
504 void channelbsc_set_channel(nsChannelBSC
*,nsChannel
*,nsIStreamListener
*,nsISupports
*);
505 IMoniker
*get_channelbsc_mon(nsChannelBSC
*);
507 IHTMLSelectionObject
*HTMLSelectionObject_Create(HTMLDocument
*,nsISelection
*);
508 IHTMLTxtRange
*HTMLTxtRange_Create(HTMLDocument
*,nsIDOMRange
*);
509 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*);
510 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*);
511 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*);
513 void detach_selection(HTMLDocument
*);
514 void detach_ranges(HTMLDocument
*);
516 HTMLDOMNode
*HTMLDOMTextNode_Create(nsIDOMNode
*);
518 HTMLElement
*HTMLElement_Create(nsIDOMNode
*);
519 HTMLElement
*HTMLCommentElement_Create(nsIDOMNode
*);
520 HTMLElement
*HTMLAnchorElement_Create(nsIDOMHTMLElement
*);
521 HTMLElement
*HTMLBodyElement_Create(nsIDOMHTMLElement
*);
522 HTMLElement
*HTMLInputElement_Create(nsIDOMHTMLElement
*);
523 HTMLElement
*HTMLOptionElement_Create(nsIDOMHTMLElement
*);
524 HTMLElement
*HTMLScriptElement_Create(nsIDOMHTMLElement
*);
525 HTMLElement
*HTMLSelectElement_Create(nsIDOMHTMLElement
*);
526 HTMLElement
*HTMLTable_Create(nsIDOMHTMLElement
*);
527 HTMLElement
*HTMLTextAreaElement_Create(nsIDOMHTMLElement
*);
529 void HTMLElement_Init(HTMLElement
*);
530 void HTMLElement2_Init(HTMLElement
*);
531 void HTMLTextContainer_Init(HTMLTextContainer
*);
533 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
534 void HTMLDOMNode_destructor(HTMLDOMNode
*);
536 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
537 void HTMLElement_destructor(HTMLDOMNode
*);
539 HTMLDOMNode
*get_node(HTMLDocument
*,nsIDOMNode
*,BOOL
);
540 void release_nodes(HTMLDocument
*);
542 void release_script_hosts(HTMLDocument
*);
543 void connect_scripts(HTMLDocument
*);
544 void doc_insert_script(HTMLDocument
*,nsIDOMHTMLScriptElement
*);
545 IDispatch
*script_parse_event(HTMLDocument
*,LPCWSTR
);
547 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*);
552 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
553 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
556 extern const cmdtable_t editmode_cmds
[];
558 void do_ns_command(NSContainer
*,const char*,nsICommandParams
*);
561 #define UPDATE_UI 0x0001
562 #define UPDATE_TITLE 0x0002
564 void update_doc(HTMLDocument
*This
, DWORD flags
);
565 void update_title(HTMLDocument
*);
568 void init_editor(HTMLDocument
*);
569 void set_ns_editmode(NSContainer
*);
570 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*);
571 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
572 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
573 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
574 void handle_edit_load(HTMLDocument
*);
575 HRESULT
editor_is_dirty(HTMLDocument
*);
576 void set_dirty(HTMLDocument
*,VARIANT_BOOL
);
578 extern DWORD mshtml_tls
;
580 typedef struct task_t
{
584 TASK_SETDOWNLOADSTATE
,
590 nsChannelBSC
*bscallback
;
597 task_t
*task_queue_head
;
598 task_t
*task_queue_tail
;
599 struct list timer_list
;
602 thread_data_t
*get_thread_data(BOOL
);
603 HWND
get_thread_hwnd(void);
604 void push_task(task_t
*);
605 void remove_doc_tasks(const HTMLDocument
*);
606 DWORD
set_task_timer(HTMLDocument
*,DWORD
,IDispatch
*);
608 HRESULT
get_typeinfo(tid_t
,ITypeInfo
**);
609 void release_typelib(void);
610 void call_disp_func(HTMLDocument
*,IDispatch
*);
612 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
613 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
614 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
615 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
616 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
618 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
620 extern LONG module_ref
;
621 #define LOCK_MODULE() InterlockedIncrement(&module_ref)
622 #define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
624 /* memory allocation functions */
626 static inline void *heap_alloc(size_t len
)
628 return HeapAlloc(GetProcessHeap(), 0, len
);
631 static inline void *heap_alloc_zero(size_t len
)
633 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
636 static inline void *heap_realloc(void *mem
, size_t len
)
638 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
641 static inline BOOL
heap_free(void *mem
)
643 return HeapFree(GetProcessHeap(), 0, mem
);
646 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
653 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
654 ret
= heap_alloc(size
);
655 memcpy(ret
, str
, size
);
661 static inline char *heap_strdupA(const char *str
)
668 size
= strlen(str
)+1;
669 ret
= heap_alloc(size
);
670 memcpy(ret
, str
, size
);
676 static inline WCHAR
*heap_strdupAtoW(const char *str
)
683 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
684 ret
= heap_alloc(len
*sizeof(WCHAR
));
685 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
691 static inline char *heap_strdupWtoA(LPCWSTR str
)
696 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
697 ret
= heap_alloc(size
);
698 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
704 HINSTANCE
get_shdoclc(void);
706 extern HINSTANCE hInst
;