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 DispHTMLGenericElement_tid
,
71 DispHTMLInputElement_tid
,
72 DispHTMLOptionElement_tid
,
73 DispHTMLSelectElement_tid
,
75 DispHTMLUnknownElement_tid
,
77 IHTMLCommentElement_tid
,
82 IHTMLDOMChildrenCollection_tid
,
88 IHTMLElementCollection_tid
,
89 IHTMLGenericElement_tid
,
91 IHTMLInputElement_tid
,
92 IHTMLOptionElement_tid
,
93 IHTMLSelectElement_tid
,
101 typedef struct dispex_data_t dispex_data_t
;
102 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
104 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
105 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
108 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
109 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
110 } dispex_static_data_vtbl_t
;
113 const dispex_static_data_vtbl_t
*vtbl
;
114 const tid_t disp_tid
;
116 const tid_t
* const iface_tids
;
117 } dispex_static_data_t
;
120 const IDispatchExVtbl
*lpIDispatchExVtbl
;
124 dispex_static_data_t
*data
;
125 dispex_dynamic_data_t
*dynamic_data
;
128 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
132 const IHTMLWindow2Vtbl
*lpHTMLWindow2Vtbl
;
133 const IHTMLWindow3Vtbl
*lpHTMLWindow3Vtbl
;
134 const IDispatchExVtbl
*lpIDispatchExVtbl
;
139 nsIDOMWindow
*nswindow
;
141 IHTMLEventObj
*event
;
153 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
155 ConnectionPoint
*cp_list
;
157 } ConnectionPointContainer
;
159 struct ConnectionPoint
{
160 const IConnectionPointVtbl
*lpConnectionPointVtbl
;
162 IConnectionPointContainer
*container
;
167 IPropertyNotifySink
*propnotif
;
173 ConnectionPoint
*next
;
177 const IHTMLLocationVtbl
*lpHTMLLocationVtbl
;
185 const IHTMLOptionElementFactoryVtbl
*lpHTMLOptionElementFactoryVtbl
;
190 } HTMLOptionElementFactory
;
192 struct HTMLDocument
{
194 const IHTMLDocument2Vtbl
*lpHTMLDocument2Vtbl
;
195 const IHTMLDocument3Vtbl
*lpHTMLDocument3Vtbl
;
196 const IHTMLDocument4Vtbl
*lpHTMLDocument4Vtbl
;
197 const IHTMLDocument5Vtbl
*lpHTMLDocument5Vtbl
;
198 const IPersistMonikerVtbl
*lpPersistMonikerVtbl
;
199 const IPersistFileVtbl
*lpPersistFileVtbl
;
200 const IMonikerPropVtbl
*lpMonikerPropVtbl
;
201 const IOleObjectVtbl
*lpOleObjectVtbl
;
202 const IOleDocumentVtbl
*lpOleDocumentVtbl
;
203 const IOleDocumentViewVtbl
*lpOleDocumentViewVtbl
;
204 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
205 const IViewObject2Vtbl
*lpViewObject2Vtbl
;
206 const IOleInPlaceObjectWindowlessVtbl
*lpOleInPlaceObjectWindowlessVtbl
;
207 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
208 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
209 const IOleControlVtbl
*lpOleControlVtbl
;
210 const IHlinkTargetVtbl
*lpHlinkTargetVtbl
;
211 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
212 const ICustomDocVtbl
*lpCustomDocVtbl
;
213 const IDispatchExVtbl
*lpIDispatchExVtbl
;
217 NSContainer
*nscontainer
;
220 IOleClientSite
*client
;
221 IDocHostUIHandler
*hostui
;
222 IOleInPlaceSite
*ipsite
;
223 IOleInPlaceFrame
*frame
;
224 IOleInPlaceUIWindow
*ip_window
;
226 IOleUndoManager
*undomgr
;
228 nsChannelBSC
*bscallback
;
231 struct list bindings
;
233 struct list script_hosts
;
238 DOCHOSTUIINFO hostinfo
;
241 READYSTATE readystate
;
242 BOOL in_place_active
;
246 BOOL container_locked
;
252 ConnectionPointContainer cp_container
;
253 ConnectionPoint cp_htmldocevents
;
254 ConnectionPoint cp_htmldocevents2
;
255 ConnectionPoint cp_propnotif
;
257 HTMLOptionElementFactory
*option_factory
;
258 HTMLLocation
*location
;
260 struct list selection_list
;
261 struct list range_list
;
267 const nsIDOMEventListenerVtbl
*lpDOMEventListenerVtbl
;
272 const nsIWebBrowserChromeVtbl
*lpWebBrowserChromeVtbl
;
273 const nsIContextMenuListenerVtbl
*lpContextMenuListenerVtbl
;
274 const nsIURIContentListenerVtbl
*lpURIContentListenerVtbl
;
275 const nsIEmbeddingSiteWindowVtbl
*lpEmbeddingSiteWindowVtbl
;
276 const nsITooltipListenerVtbl
*lpTooltipListenerVtbl
;
277 const nsIInterfaceRequestorVtbl
*lpInterfaceRequestorVtbl
;
278 const nsIWeakReferenceVtbl
*lpWeakReferenceVtbl
;
279 const nsISupportsWeakReferenceVtbl
*lpSupportsWeakReferenceVtbl
;
281 nsEventListener blur_listener
;
282 nsEventListener focus_listener
;
283 nsEventListener keypress_listener
;
284 nsEventListener load_listener
;
285 nsEventListener node_insert_listener
;
287 nsIWebBrowser
*webbrowser
;
288 nsIWebNavigation
*navigation
;
289 nsIBaseWindow
*window
;
290 nsIWebBrowserFocus
*focus
;
293 nsIController
*editor_controller
;
300 nsIURIContentListener
*content_listener
;
304 nsChannelBSC
*bscallback
; /* hack */
305 HWND reset_focus
; /* hack */
309 const nsIHttpChannelVtbl
*lpHttpChannelVtbl
;
310 const nsIUploadChannelVtbl
*lpUploadChannelVtbl
;
315 nsIHttpChannel
*http_channel
;
317 nsIInputStream
*post_data_stream
;
318 nsILoadGroup
*load_group
;
319 nsIInterfaceRequestor
*notif_callback
;
320 nsLoadFlags load_flags
;
321 nsIURI
*original_uri
;
327 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
328 void (*destructor
)(HTMLDOMNode
*);
333 const IHTMLDOMNodeVtbl
*lpHTMLDOMNodeVtbl
;
334 const IHTMLDOMNode2Vtbl
*lpHTMLDOMNode2Vtbl
;
335 const NodeImplVtbl
*vtbl
;
341 event_target_t
*event_target
;
348 ConnectionPointContainer cp_container
;
350 const IHTMLElementVtbl
*lpHTMLElementVtbl
;
351 const IHTMLElement2Vtbl
*lpHTMLElement2Vtbl
;
353 nsIDOMHTMLElement
*nselem
;
359 const IHTMLTextContainerVtbl
*lpHTMLTextContainerVtbl
;
364 #define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
365 #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
367 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
368 #define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
369 #define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
370 #define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
371 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
372 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
373 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
374 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
375 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
376 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
377 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
378 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
379 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
380 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
381 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
382 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
383 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
384 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
385 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
386 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
387 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
388 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
389 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
390 #define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
392 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
393 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
394 #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
395 #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
396 #define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
397 #define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
398 #define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
399 #define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
400 #define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
402 #define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
403 #define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
404 #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
406 #define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
407 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
408 #define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
410 #define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
411 #define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
412 #define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
413 #define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
415 #define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
417 #define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
418 #define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
420 #define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
422 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
423 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
425 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
426 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
428 HTMLWindow
*HTMLWindow_Create(HTMLDocument
*);
429 HTMLWindow
*nswindow_to_window(const nsIDOMWindow
*);
430 HTMLOptionElementFactory
*HTMLOptionElementFactory_Create(HTMLDocument
*);
431 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*);
432 IOmNavigator
*OmNavigator_Create(void);
433 void setup_nswindow(HTMLWindow
*);
435 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*);
436 void HTMLDocument_HTMLDocument5_Init(HTMLDocument
*);
437 void HTMLDocument_Persist_Init(HTMLDocument
*);
438 void HTMLDocument_OleCmd_Init(HTMLDocument
*);
439 void HTMLDocument_OleObj_Init(HTMLDocument
*);
440 void HTMLDocument_View_Init(HTMLDocument
*);
441 void HTMLDocument_Window_Init(HTMLDocument
*);
442 void HTMLDocument_Service_Init(HTMLDocument
*);
443 void HTMLDocument_Hlink_Init(HTMLDocument
*);
445 void ConnectionPoint_Init(ConnectionPoint
*,ConnectionPointContainer
*,REFIID
);
446 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
447 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
449 NSContainer
*NSContainer_Create(HTMLDocument
*,NSContainer
*);
450 void NSContainer_Release(NSContainer
*);
452 void HTMLDocument_LockContainer(HTMLDocument
*,BOOL
);
453 void show_context_menu(HTMLDocument
*,DWORD
,POINT
*,IDispatch
*);
454 void notif_focus(HTMLDocument
*);
456 void show_tooltip(HTMLDocument
*,DWORD
,DWORD
,LPCWSTR
);
457 void hide_tooltip(HTMLDocument
*);
458 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
460 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
462 BOOL
load_gecko(BOOL
);
463 void close_gecko(void);
464 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
465 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*);
466 BOOL
install_wine_gecko(BOOL
);
468 void hlink_frame_navigate(HTMLDocument
*,IHlinkFrame
*,LPCWSTR
,nsIInputStream
*,DWORD
);
470 void call_property_onchanged(ConnectionPoint
*,DISPID
);
471 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
473 void *nsalloc(size_t);
476 void nsACString_Init(nsACString
*,const char*);
477 void nsACString_SetData(nsACString
*,const char*);
478 PRUint32
nsACString_GetData(const nsACString
*,const char**);
479 void nsACString_Finish(nsACString
*);
481 void nsAString_Init(nsAString
*,const PRUnichar
*);
482 void nsAString_SetData(nsAString
*,const PRUnichar
*);
483 PRUint32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
484 void nsAString_Finish(nsAString
*);
486 nsIInputStream
*create_nsstream(const char*,PRInt32
);
487 nsICommandParams
*create_nscommand_params(void);
488 nsIMutableArray
*create_nsarray(void);
489 nsIWritableVariant
*create_nsvariant(void);
490 void nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
491 void get_editor_controller(NSContainer
*);
492 void init_nsevents(NSContainer
*);
493 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
500 void check_event_attr(HTMLDocument
*,nsIDOMElement
*);
501 void release_event_target(event_target_t
*);
502 void fire_event(HTMLDocument
*,eventid_t
,nsIDOMNode
*);
504 void set_document_bscallback(HTMLDocument
*,nsChannelBSC
*);
505 void set_current_mon(HTMLDocument
*,IMoniker
*);
506 HRESULT
start_binding(HTMLDocument
*,BSCallback
*,IBindCtx
*);
508 HRESULT
bind_mon_to_buffer(HTMLDocument
*,IMoniker
*,void**,DWORD
*);
510 nsChannelBSC
*create_channelbsc(IMoniker
*);
511 HRESULT
channelbsc_load_stream(nsChannelBSC
*,IStream
*);
512 void channelbsc_set_channel(nsChannelBSC
*,nsChannel
*,nsIStreamListener
*,nsISupports
*);
513 IMoniker
*get_channelbsc_mon(nsChannelBSC
*);
515 IHTMLSelectionObject
*HTMLSelectionObject_Create(HTMLDocument
*,nsISelection
*);
516 IHTMLTxtRange
*HTMLTxtRange_Create(HTMLDocument
*,nsIDOMRange
*);
517 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*);
518 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*);
519 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*);
521 void detach_selection(HTMLDocument
*);
522 void detach_ranges(HTMLDocument
*);
524 HTMLDOMNode
*HTMLDOMTextNode_Create(HTMLDocument
*,nsIDOMNode
*);
526 HTMLElement
*HTMLElement_Create(HTMLDocument
*,nsIDOMNode
*,BOOL
);
527 HTMLElement
*HTMLCommentElement_Create(HTMLDocument
*,nsIDOMNode
*);
528 HTMLElement
*HTMLAnchorElement_Create(nsIDOMHTMLElement
*);
529 HTMLElement
*HTMLBodyElement_Create(nsIDOMHTMLElement
*);
530 HTMLElement
*HTMLImgElement_Create(nsIDOMHTMLElement
*);
531 HTMLElement
*HTMLInputElement_Create(nsIDOMHTMLElement
*);
532 HTMLElement
*HTMLOptionElement_Create(nsIDOMHTMLElement
*);
533 HTMLElement
*HTMLScriptElement_Create(nsIDOMHTMLElement
*);
534 HTMLElement
*HTMLSelectElement_Create(nsIDOMHTMLElement
*);
535 HTMLElement
*HTMLTable_Create(nsIDOMHTMLElement
*);
536 HTMLElement
*HTMLTextAreaElement_Create(nsIDOMHTMLElement
*);
537 HTMLElement
*HTMLGenericElement_Create(nsIDOMHTMLElement
*);
539 void HTMLDOMNode_Init(HTMLDocument
*,HTMLDOMNode
*,nsIDOMNode
*);
540 void HTMLElement_Init(HTMLElement
*);
541 void HTMLElement2_Init(HTMLElement
*);
542 void HTMLTextContainer_Init(HTMLTextContainer
*);
544 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
545 void HTMLDOMNode_destructor(HTMLDOMNode
*);
547 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
548 void HTMLElement_destructor(HTMLDOMNode
*);
550 HTMLDOMNode
*get_node(HTMLDocument
*,nsIDOMNode
*,BOOL
);
551 void release_nodes(HTMLDocument
*);
553 void release_script_hosts(HTMLDocument
*);
554 void connect_scripts(HTMLDocument
*);
555 void doc_insert_script(HTMLDocument
*,nsIDOMHTMLScriptElement
*);
556 IDispatch
*script_parse_event(HTMLDocument
*,LPCWSTR
);
558 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*);
563 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
564 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
567 extern const cmdtable_t editmode_cmds
[];
569 void do_ns_command(NSContainer
*,const char*,nsICommandParams
*);
572 #define UPDATE_UI 0x0001
573 #define UPDATE_TITLE 0x0002
575 void update_doc(HTMLDocument
*This
, DWORD flags
);
576 void update_title(HTMLDocument
*);
579 void init_editor(HTMLDocument
*);
580 void set_ns_editmode(NSContainer
*);
581 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*);
582 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
583 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
584 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
585 void handle_edit_load(HTMLDocument
*);
586 HRESULT
editor_is_dirty(HTMLDocument
*);
587 void set_dirty(HTMLDocument
*,VARIANT_BOOL
);
589 extern DWORD mshtml_tls
;
591 typedef struct task_t
{
595 TASK_SETDOWNLOADSTATE
,
601 nsChannelBSC
*bscallback
;
608 task_t
*task_queue_head
;
609 task_t
*task_queue_tail
;
610 struct list timer_list
;
613 thread_data_t
*get_thread_data(BOOL
);
614 HWND
get_thread_hwnd(void);
615 void push_task(task_t
*);
616 void remove_doc_tasks(const HTMLDocument
*);
617 DWORD
set_task_timer(HTMLDocument
*,DWORD
,IDispatch
*);
619 HRESULT
get_typeinfo(tid_t
,ITypeInfo
**);
620 void release_typelib(void);
621 void call_disp_func(HTMLDocument
*,IDispatch
*);
623 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
624 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
625 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
626 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
627 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
629 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
631 extern LONG module_ref
;
632 #define LOCK_MODULE() InterlockedIncrement(&module_ref)
633 #define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
635 /* memory allocation functions */
637 static inline void *heap_alloc(size_t len
)
639 return HeapAlloc(GetProcessHeap(), 0, len
);
642 static inline void *heap_alloc_zero(size_t len
)
644 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
647 static inline void *heap_realloc(void *mem
, size_t len
)
649 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
652 static inline BOOL
heap_free(void *mem
)
654 return HeapFree(GetProcessHeap(), 0, mem
);
657 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
664 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
665 ret
= heap_alloc(size
);
666 memcpy(ret
, str
, size
);
672 static inline char *heap_strdupA(const char *str
)
679 size
= strlen(str
)+1;
680 ret
= heap_alloc(size
);
681 memcpy(ret
, str
, size
);
687 static inline WCHAR
*heap_strdupAtoW(const char *str
)
694 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
695 ret
= heap_alloc(len
*sizeof(WCHAR
));
696 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
702 static inline char *heap_strdupWtoA(LPCWSTR str
)
707 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
708 ret
= heap_alloc(size
);
709 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
715 HINSTANCE
get_shdoclc(void);
717 extern HINSTANCE hInst
;