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
,
70 DispHTMLInputElement_tid
,
71 DispHTMLOptionElement_tid
,
73 DispHTMLUnknownElement_tid
,
75 IHTMLCommentElement_tid
,
80 IHTMLDOMChildrenCollection_tid
,
86 IHTMLElementCollection_tid
,
88 IHTMLInputElement_tid
,
89 IHTMLOptionElement_tid
,
97 typedef struct dispex_data_t dispex_data_t
;
99 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
100 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
103 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
104 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
105 } dispex_static_data_vtbl_t
;
108 const dispex_static_data_vtbl_t
*vtbl
;
109 const tid_t disp_tid
;
111 const tid_t iface_tids
[];
112 } dispex_static_data_t
;
115 const IDispatchExVtbl
*lpIDispatchExVtbl
;
119 dispex_static_data_t
*data
;
122 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
126 const IHTMLWindow2Vtbl
*lpHTMLWindow2Vtbl
;
127 const IHTMLWindow3Vtbl
*lpHTMLWindow3Vtbl
;
128 const IDispatchExVtbl
*lpIDispatchExVtbl
;
133 nsIDOMWindow
*nswindow
;
135 IHTMLEventObj
*event
;
147 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
149 ConnectionPoint
*cp_list
;
151 } ConnectionPointContainer
;
153 struct ConnectionPoint
{
154 const IConnectionPointVtbl
*lpConnectionPointVtbl
;
156 IConnectionPointContainer
*container
;
161 IPropertyNotifySink
*propnotif
;
167 ConnectionPoint
*next
;
171 const IHTMLLocationVtbl
*lpHTMLLocationVtbl
;
179 const IHTMLOptionElementFactoryVtbl
*lpHTMLOptionElementFactoryVtbl
;
184 } HTMLOptionElementFactory
;
186 struct HTMLDocument
{
188 const IHTMLDocument2Vtbl
*lpHTMLDocument2Vtbl
;
189 const IHTMLDocument3Vtbl
*lpHTMLDocument3Vtbl
;
190 const IHTMLDocument4Vtbl
*lpHTMLDocument4Vtbl
;
191 const IHTMLDocument5Vtbl
*lpHTMLDocument5Vtbl
;
192 const IPersistMonikerVtbl
*lpPersistMonikerVtbl
;
193 const IPersistFileVtbl
*lpPersistFileVtbl
;
194 const IMonikerPropVtbl
*lpMonikerPropVtbl
;
195 const IOleObjectVtbl
*lpOleObjectVtbl
;
196 const IOleDocumentVtbl
*lpOleDocumentVtbl
;
197 const IOleDocumentViewVtbl
*lpOleDocumentViewVtbl
;
198 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
199 const IViewObject2Vtbl
*lpViewObject2Vtbl
;
200 const IOleInPlaceObjectWindowlessVtbl
*lpOleInPlaceObjectWindowlessVtbl
;
201 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
202 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
203 const IOleControlVtbl
*lpOleControlVtbl
;
204 const IHlinkTargetVtbl
*lpHlinkTargetVtbl
;
205 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
206 const ICustomDocVtbl
*lpCustomDocVtbl
;
207 const IDispatchExVtbl
*lpIDispatchExVtbl
;
211 NSContainer
*nscontainer
;
214 IOleClientSite
*client
;
215 IDocHostUIHandler
*hostui
;
216 IOleInPlaceSite
*ipsite
;
217 IOleInPlaceFrame
*frame
;
218 IOleInPlaceUIWindow
*ip_window
;
220 IOleUndoManager
*undomgr
;
222 nsChannelBSC
*bscallback
;
225 struct list bindings
;
227 struct list script_hosts
;
232 DOCHOSTUIINFO hostinfo
;
235 READYSTATE readystate
;
236 BOOL in_place_active
;
240 BOOL container_locked
;
246 ConnectionPointContainer cp_container
;
247 ConnectionPoint cp_htmldocevents
;
248 ConnectionPoint cp_htmldocevents2
;
249 ConnectionPoint cp_propnotif
;
251 HTMLOptionElementFactory
*option_factory
;
252 HTMLLocation
*location
;
254 struct list selection_list
;
255 struct list range_list
;
261 const nsIDOMEventListenerVtbl
*lpDOMEventListenerVtbl
;
266 const nsIWebBrowserChromeVtbl
*lpWebBrowserChromeVtbl
;
267 const nsIContextMenuListenerVtbl
*lpContextMenuListenerVtbl
;
268 const nsIURIContentListenerVtbl
*lpURIContentListenerVtbl
;
269 const nsIEmbeddingSiteWindowVtbl
*lpEmbeddingSiteWindowVtbl
;
270 const nsITooltipListenerVtbl
*lpTooltipListenerVtbl
;
271 const nsIInterfaceRequestorVtbl
*lpInterfaceRequestorVtbl
;
272 const nsIWeakReferenceVtbl
*lpWeakReferenceVtbl
;
273 const nsISupportsWeakReferenceVtbl
*lpSupportsWeakReferenceVtbl
;
275 nsEventListener blur_listener
;
276 nsEventListener focus_listener
;
277 nsEventListener keypress_listener
;
278 nsEventListener load_listener
;
279 nsEventListener node_insert_listener
;
281 nsIWebBrowser
*webbrowser
;
282 nsIWebNavigation
*navigation
;
283 nsIBaseWindow
*window
;
284 nsIWebBrowserFocus
*focus
;
287 nsIController
*editor_controller
;
294 nsIURIContentListener
*content_listener
;
298 nsChannelBSC
*bscallback
; /* hack */
299 HWND reset_focus
; /* hack */
303 const nsIHttpChannelVtbl
*lpHttpChannelVtbl
;
304 const nsIUploadChannelVtbl
*lpUploadChannelVtbl
;
309 nsIHttpChannel
*http_channel
;
311 nsIInputStream
*post_data_stream
;
312 nsILoadGroup
*load_group
;
313 nsIInterfaceRequestor
*notif_callback
;
314 nsLoadFlags load_flags
;
315 nsIURI
*original_uri
;
321 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
322 void (*destructor
)(HTMLDOMNode
*);
327 const IHTMLDOMNodeVtbl
*lpHTMLDOMNodeVtbl
;
328 const IHTMLDOMNode2Vtbl
*lpHTMLDOMNode2Vtbl
;
329 const NodeImplVtbl
*vtbl
;
335 event_target_t
*event_target
;
342 ConnectionPointContainer cp_container
;
344 const IHTMLElementVtbl
*lpHTMLElementVtbl
;
345 const IHTMLElement2Vtbl
*lpHTMLElement2Vtbl
;
347 nsIDOMHTMLElement
*nselem
;
353 const IHTMLTextContainerVtbl
*lpHTMLTextContainerVtbl
;
358 #define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
359 #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
361 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
362 #define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
363 #define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
364 #define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
365 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
366 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
367 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
368 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
369 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
370 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
371 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
372 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
373 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
374 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
375 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
376 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
377 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
378 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
379 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
380 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
381 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
382 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
383 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
384 #define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
386 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
387 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
388 #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
389 #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
390 #define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
391 #define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
392 #define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
393 #define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
394 #define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
396 #define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
397 #define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
398 #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
400 #define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
401 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
402 #define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
404 #define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
405 #define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
406 #define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
407 #define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
409 #define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
411 #define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
412 #define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
414 #define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
416 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
417 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
419 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
420 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
422 HTMLWindow
*HTMLWindow_Create(HTMLDocument
*);
423 HTMLWindow
*nswindow_to_window(const nsIDOMWindow
*);
424 HTMLOptionElementFactory
*HTMLOptionElementFactory_Create(HTMLDocument
*);
425 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*);
426 IOmNavigator
*OmNavigator_Create(void);
427 void setup_nswindow(HTMLWindow
*);
429 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*);
430 void HTMLDocument_HTMLDocument5_Init(HTMLDocument
*);
431 void HTMLDocument_Persist_Init(HTMLDocument
*);
432 void HTMLDocument_OleCmd_Init(HTMLDocument
*);
433 void HTMLDocument_OleObj_Init(HTMLDocument
*);
434 void HTMLDocument_View_Init(HTMLDocument
*);
435 void HTMLDocument_Window_Init(HTMLDocument
*);
436 void HTMLDocument_Service_Init(HTMLDocument
*);
437 void HTMLDocument_Hlink_Init(HTMLDocument
*);
439 void ConnectionPoint_Init(ConnectionPoint
*,ConnectionPointContainer
*,REFIID
);
440 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
441 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
443 NSContainer
*NSContainer_Create(HTMLDocument
*,NSContainer
*);
444 void NSContainer_Release(NSContainer
*);
446 void HTMLDocument_LockContainer(HTMLDocument
*,BOOL
);
447 void show_context_menu(HTMLDocument
*,DWORD
,POINT
*,IDispatch
*);
448 void notif_focus(HTMLDocument
*);
450 void show_tooltip(HTMLDocument
*,DWORD
,DWORD
,LPCWSTR
);
451 void hide_tooltip(HTMLDocument
*);
452 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
454 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
456 BOOL
load_gecko(BOOL
);
457 void close_gecko(void);
458 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
459 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*);
460 BOOL
install_wine_gecko(BOOL
);
462 void hlink_frame_navigate(HTMLDocument
*,IHlinkFrame
*,LPCWSTR
,nsIInputStream
*,DWORD
);
464 void call_property_onchanged(ConnectionPoint
*,DISPID
);
465 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
467 void *nsalloc(size_t);
470 void nsACString_Init(nsACString
*,const char*);
471 void nsACString_SetData(nsACString
*,const char*);
472 PRUint32
nsACString_GetData(const nsACString
*,const char**);
473 void nsACString_Finish(nsACString
*);
475 void nsAString_Init(nsAString
*,const PRUnichar
*);
476 void nsAString_SetData(nsAString
*,const PRUnichar
*);
477 PRUint32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
478 void nsAString_Finish(nsAString
*);
480 nsIInputStream
*create_nsstream(const char*,PRInt32
);
481 nsICommandParams
*create_nscommand_params(void);
482 nsIMutableArray
*create_nsarray(void);
483 nsIWritableVariant
*create_nsvariant(void);
484 void nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
485 void get_editor_controller(NSContainer
*);
486 void init_nsevents(NSContainer
*);
487 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
494 void check_event_attr(HTMLDocument
*,nsIDOMElement
*);
495 void release_event_target(event_target_t
*);
496 void fire_event(HTMLDocument
*,eventid_t
,nsIDOMNode
*);
498 void set_document_bscallback(HTMLDocument
*,nsChannelBSC
*);
499 void set_current_mon(HTMLDocument
*,IMoniker
*);
500 HRESULT
start_binding(HTMLDocument
*,BSCallback
*,IBindCtx
*);
502 HRESULT
bind_mon_to_buffer(HTMLDocument
*,IMoniker
*,void**,DWORD
*);
504 nsChannelBSC
*create_channelbsc(IMoniker
*);
505 HRESULT
channelbsc_load_stream(nsChannelBSC
*,IStream
*);
506 void channelbsc_set_channel(nsChannelBSC
*,nsChannel
*,nsIStreamListener
*,nsISupports
*);
507 IMoniker
*get_channelbsc_mon(nsChannelBSC
*);
509 IHTMLSelectionObject
*HTMLSelectionObject_Create(HTMLDocument
*,nsISelection
*);
510 IHTMLTxtRange
*HTMLTxtRange_Create(HTMLDocument
*,nsIDOMRange
*);
511 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*);
512 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*);
513 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*);
515 void detach_selection(HTMLDocument
*);
516 void detach_ranges(HTMLDocument
*);
518 HTMLDOMNode
*HTMLDOMTextNode_Create(nsIDOMNode
*);
520 HTMLElement
*HTMLElement_Create(nsIDOMNode
*);
521 HTMLElement
*HTMLCommentElement_Create(nsIDOMNode
*);
522 HTMLElement
*HTMLAnchorElement_Create(nsIDOMHTMLElement
*);
523 HTMLElement
*HTMLBodyElement_Create(nsIDOMHTMLElement
*);
524 HTMLElement
*HTMLImgElement_Create(nsIDOMHTMLElement
*);
525 HTMLElement
*HTMLInputElement_Create(nsIDOMHTMLElement
*);
526 HTMLElement
*HTMLOptionElement_Create(nsIDOMHTMLElement
*);
527 HTMLElement
*HTMLScriptElement_Create(nsIDOMHTMLElement
*);
528 HTMLElement
*HTMLSelectElement_Create(nsIDOMHTMLElement
*);
529 HTMLElement
*HTMLTable_Create(nsIDOMHTMLElement
*);
530 HTMLElement
*HTMLTextAreaElement_Create(nsIDOMHTMLElement
*);
532 void HTMLElement_Init(HTMLElement
*);
533 void HTMLElement2_Init(HTMLElement
*);
534 void HTMLTextContainer_Init(HTMLTextContainer
*);
536 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
537 void HTMLDOMNode_destructor(HTMLDOMNode
*);
539 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
540 void HTMLElement_destructor(HTMLDOMNode
*);
542 HTMLDOMNode
*get_node(HTMLDocument
*,nsIDOMNode
*,BOOL
);
543 void release_nodes(HTMLDocument
*);
545 void release_script_hosts(HTMLDocument
*);
546 void connect_scripts(HTMLDocument
*);
547 void doc_insert_script(HTMLDocument
*,nsIDOMHTMLScriptElement
*);
548 IDispatch
*script_parse_event(HTMLDocument
*,LPCWSTR
);
550 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*);
555 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
556 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
559 extern const cmdtable_t editmode_cmds
[];
561 void do_ns_command(NSContainer
*,const char*,nsICommandParams
*);
564 #define UPDATE_UI 0x0001
565 #define UPDATE_TITLE 0x0002
567 void update_doc(HTMLDocument
*This
, DWORD flags
);
568 void update_title(HTMLDocument
*);
571 void init_editor(HTMLDocument
*);
572 void set_ns_editmode(NSContainer
*);
573 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*);
574 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
575 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
576 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
577 void handle_edit_load(HTMLDocument
*);
578 HRESULT
editor_is_dirty(HTMLDocument
*);
579 void set_dirty(HTMLDocument
*,VARIANT_BOOL
);
581 extern DWORD mshtml_tls
;
583 typedef struct task_t
{
587 TASK_SETDOWNLOADSTATE
,
593 nsChannelBSC
*bscallback
;
600 task_t
*task_queue_head
;
601 task_t
*task_queue_tail
;
602 struct list timer_list
;
605 thread_data_t
*get_thread_data(BOOL
);
606 HWND
get_thread_hwnd(void);
607 void push_task(task_t
*);
608 void remove_doc_tasks(const HTMLDocument
*);
609 DWORD
set_task_timer(HTMLDocument
*,DWORD
,IDispatch
*);
611 HRESULT
get_typeinfo(tid_t
,ITypeInfo
**);
612 void release_typelib(void);
613 void call_disp_func(HTMLDocument
*,IDispatch
*);
615 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
616 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
617 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
618 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
619 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
621 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
623 extern LONG module_ref
;
624 #define LOCK_MODULE() InterlockedIncrement(&module_ref)
625 #define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
627 /* memory allocation functions */
629 static inline void *heap_alloc(size_t len
)
631 return HeapAlloc(GetProcessHeap(), 0, len
);
634 static inline void *heap_alloc_zero(size_t len
)
636 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
639 static inline void *heap_realloc(void *mem
, size_t len
)
641 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
644 static inline BOOL
heap_free(void *mem
)
646 return HeapFree(GetProcessHeap(), 0, mem
);
649 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
656 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
657 ret
= heap_alloc(size
);
658 memcpy(ret
, str
, size
);
664 static inline char *heap_strdupA(const char *str
)
671 size
= strlen(str
)+1;
672 ret
= heap_alloc(size
);
673 memcpy(ret
, str
, size
);
679 static inline WCHAR
*heap_strdupAtoW(const char *str
)
686 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
687 ret
= heap_alloc(len
*sizeof(WCHAR
));
688 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
694 static inline char *heap_strdupWtoA(LPCWSTR str
)
699 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
700 ret
= heap_alloc(size
);
701 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
707 HINSTANCE
get_shdoclc(void);
709 extern HINSTANCE hInst
;