2 * Copyright 2005-2009 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
21 #include "docobjectservice.h"
31 #include "shdeprecated.h"
33 #include "wine/list.h"
34 #include "wine/unicode.h"
42 #define NS_ERROR_GENERATE_FAILURE(module,code) \
43 ((nsresult) (((UINT32)(1<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code))))
45 #define NS_OK ((nsresult)0x00000000L)
46 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
47 #define NS_ERROR_OUT_OF_MEMORY ((nsresult)0x8007000EL)
48 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
49 #define NS_NOINTERFACE ((nsresult)0x80004002L)
50 #define NS_ERROR_INVALID_POINTER ((nsresult)0x80004003L)
51 #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
52 #define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
53 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
54 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
56 #define NS_ERROR_MODULE_NETWORK 6
58 #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
59 #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
61 #define NS_FAILED(res) ((res) & 0x80000000)
62 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
66 #define MSHTML_E_NODOC 0x800a025c
68 typedef struct HTMLDOMNode HTMLDOMNode
;
69 typedef struct ConnectionPoint ConnectionPoint
;
70 typedef struct BSCallback BSCallback
;
71 typedef struct event_target_t event_target_t
;
75 XDIID(DispCEventObj) \
77 XDIID(DispDOMChildrenCollection) \
78 XDIID(DispHTMLAnchorElement) \
79 XDIID(DispHTMLAttributeCollection) \
81 XDIID(DispHTMLButtonElement) \
82 XDIID(DispHTMLCommentElement) \
83 XDIID(DispHTMLCurrentStyle) \
84 XDIID(DispHTMLDocument) \
85 XDIID(DispHTMLDOMAttribute) \
86 XDIID(DispHTMLDOMTextNode) \
87 XDIID(DispHTMLElementCollection) \
88 XDIID(DispHTMLEmbed) \
89 XDIID(DispHTMLFormElement) \
90 XDIID(DispHTMLGenericElement) \
91 XDIID(DispHTMLFrameElement) \
92 XDIID(DispHTMLHeadElement) \
93 XDIID(DispHTMLHistory) \
94 XDIID(DispHTMLIFrame) \
96 XDIID(DispHTMLInputElement) \
97 XDIID(DispHTMLLabelElement) \
98 XDIID(DispHTMLLinkElement) \
99 XDIID(DispHTMLLocation) \
100 XDIID(DispHTMLMetaElement) \
101 XDIID(DispHTMLNavigator) \
102 XDIID(DispHTMLObjectElement) \
103 XDIID(DispHTMLOptionElement) \
104 XDIID(DispHTMLScreen) \
105 XDIID(DispHTMLScriptElement) \
106 XDIID(DispHTMLSelectElement) \
107 XDIID(DispHTMLStyle) \
108 XDIID(DispHTMLStyleElement) \
109 XDIID(DispHTMLStyleSheet) \
110 XDIID(DispHTMLStyleSheetRulesCollection) \
111 XDIID(DispHTMLStyleSheetsCollection) \
112 XDIID(DispHTMLTable) \
113 XDIID(DispHTMLTableCell) \
114 XDIID(DispHTMLTableRow) \
115 XDIID(DispHTMLTextAreaElement) \
116 XDIID(DispHTMLTitleElement) \
117 XDIID(DispHTMLUnknownElement) \
118 XDIID(DispHTMLWindow2) \
119 XDIID(HTMLDocumentEvents) \
120 XDIID(HTMLElementEvents2) \
121 XIID(IHTMLAnchorElement) \
122 XIID(IHTMLAttributeCollection) \
123 XIID(IHTMLAttributeCollection2) \
124 XIID(IHTMLAttributeCollection3) \
125 XIID(IHTMLBodyElement) \
126 XIID(IHTMLBodyElement2) \
127 XIID(IHTMLButtonElement) \
128 XIID(IHTMLCommentElement) \
129 XIID(IHTMLCurrentStyle) \
130 XIID(IHTMLCurrentStyle2) \
131 XIID(IHTMLCurrentStyle3) \
132 XIID(IHTMLCurrentStyle4) \
133 XIID(IHTMLDocument2) \
134 XIID(IHTMLDocument3) \
135 XIID(IHTMLDocument4) \
136 XIID(IHTMLDocument5) \
137 XIID(IHTMLDOMAttribute) \
138 XIID(IHTMLDOMAttribute2) \
139 XIID(IHTMLDOMChildrenCollection) \
140 XIID(IHTMLDOMImplementation) \
142 XIID(IHTMLDOMNode2) \
143 XIID(IHTMLDOMTextNode) \
144 XIID(IHTMLDOMTextNode2) \
146 XIID(IHTMLElement2) \
147 XIID(IHTMLElement3) \
148 XIID(IHTMLElement4) \
149 XIID(IHTMLElementCollection) \
150 XIID(IHTMLEmbedElement) \
151 XIID(IHTMLEventObj) \
152 XIID(IHTMLFiltersCollection) \
153 XIID(IHTMLFormElement) \
154 XIID(IHTMLFrameBase) \
155 XIID(IHTMLFrameBase2) \
156 XIID(IHTMLFrameElement3) \
157 XIID(IHTMLGenericElement) \
158 XIID(IHTMLHeadElement) \
159 XIID(IHTMLIFrameElement) \
160 XIID(IHTMLIFrameElement2) \
161 XIID(IHTMLIFrameElement3) \
162 XIID(IHTMLImageElementFactory) \
163 XIID(IHTMLImgElement) \
164 XIID(IHTMLInputElement) \
165 XIID(IHTMLLabelElement) \
166 XIID(IHTMLLinkElement) \
167 XIID(IHTMLLocation) \
168 XIID(IHTMLMetaElement) \
169 XIID(IHTMLMimeTypesCollection) \
170 XIID(IHTMLObjectElement) \
171 XIID(IHTMLObjectElement2) \
172 XIID(IHTMLOptionElement) \
173 XIID(IHTMLOptionElementFactory) \
174 XIID(IHTMLPluginsCollection) \
177 XIID(IHTMLScriptElement) \
178 XIID(IHTMLSelectElement) \
179 XIID(IHTMLSelectionObject) \
180 XIID(IHTMLSelectionObject2) \
188 XIID(IHTMLStyleElement) \
189 XIID(IHTMLStyleSheet) \
190 XIID(IHTMLStyleSheetRulesCollection) \
191 XIID(IHTMLStyleSheetsCollection) \
195 XIID(IHTMLTableCell) \
196 XIID(IHTMLTableRow) \
197 XIID(IHTMLTextAreaElement) \
198 XIID(IHTMLTextContainer) \
199 XIID(IHTMLTitleElement) \
200 XIID(IHTMLTxtRange) \
201 XIID(IHTMLUniqueName) \
211 #define XIID(iface) iface ## _tid,
212 #define XDIID(iface) iface ## _tid,
219 typedef struct dispex_data_t dispex_data_t
;
220 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
222 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
223 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
224 #define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
226 typedef struct DispatchEx DispatchEx
;
229 HRESULT (*value
)(DispatchEx
*,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
230 HRESULT (*get_dispid
)(DispatchEx
*,BSTR
,DWORD
,DISPID
*);
231 HRESULT (*invoke
)(DispatchEx
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
232 HRESULT (*populate_props
)(DispatchEx
*);
233 /* We abuse this vtbl for EventTarget functions to avoid separated vtbl. */
234 event_target_t
**(*get_event_target_ptr
)(DispatchEx
*);
235 void (*bind_event
)(DispatchEx
*,int);
236 } dispex_static_data_vtbl_t
;
239 const dispex_static_data_vtbl_t
*vtbl
;
240 const tid_t disp_tid
;
242 const tid_t
* const iface_tids
;
243 } dispex_static_data_t
;
246 IDispatchEx IDispatchEx_iface
;
250 dispex_static_data_t
*data
;
251 dispex_dynamic_data_t
*dynamic_data
;
256 } nsCycleCollectingAutoRefCnt
;
262 } ExternalCycleCollectionParticipant
;
264 typedef struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback
;
267 nsresult (NSAPI
*traverse
)(void*,void*,nsCycleCollectionTraversalCallback
*);
268 nsresult (NSAPI
*unlink
)(void*);
269 void (NSAPI
*delete_cycle_collectable
)(void*);
272 DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant
, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9);
274 nsrefcnt (__cdecl
*ccref_incr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*) DECLSPEC_HIDDEN
;
275 nsrefcnt (__cdecl
*ccref_decr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*,ExternalCycleCollectionParticipant
*) DECLSPEC_HIDDEN
;
276 void (__cdecl
*ccref_init
)(nsCycleCollectingAutoRefCnt
*,nsrefcnt
) DECLSPEC_HIDDEN
;
277 void (__cdecl
*ccp_init
)(ExternalCycleCollectionParticipant
*,const CCObjCallback
*) DECLSPEC_HIDDEN
;
278 void (__cdecl
*describe_cc_node
)(nsCycleCollectingAutoRefCnt
*,const char*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
279 void (__cdecl
*note_cc_edge
)(nsISupports
*,const char*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
281 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
282 void release_dispex(DispatchEx
*) DECLSPEC_HIDDEN
;
283 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**) DECLSPEC_HIDDEN
;
284 HRESULT
dispex_get_dprop_ref(DispatchEx
*,const WCHAR
*,BOOL
,VARIANT
**) DECLSPEC_HIDDEN
;
285 HRESULT
get_dispids(tid_t
,DWORD
*,DISPID
**) DECLSPEC_HIDDEN
;
286 HRESULT
remove_attribute(DispatchEx
*,DISPID
,VARIANT_BOOL
*) DECLSPEC_HIDDEN
;
287 HRESULT
dispex_get_dynid(DispatchEx
*,const WCHAR
*,DISPID
*) DECLSPEC_HIDDEN
;
288 void dispex_traverse(DispatchEx
*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
289 void dispex_unlink(DispatchEx
*) DECLSPEC_HIDDEN
;
290 void release_typelib(void) DECLSPEC_HIDDEN
;
291 HRESULT
get_htmldoc_classinfo(ITypeInfo
**typeinfo
) DECLSPEC_HIDDEN
;
297 } dispex_prop_type_t
;
299 dispex_prop_type_t
get_dispid_type(DISPID
) DECLSPEC_HIDDEN
;
301 typedef struct HTMLWindow HTMLWindow
;
302 typedef struct HTMLInnerWindow HTMLInnerWindow
;
303 typedef struct HTMLOuterWindow HTMLOuterWindow
;
304 typedef struct HTMLDocumentNode HTMLDocumentNode
;
305 typedef struct HTMLDocumentObj HTMLDocumentObj
;
306 typedef struct HTMLFrameBase HTMLFrameBase
;
307 typedef struct NSContainer NSContainer
;
308 typedef struct HTMLAttributeCollection HTMLAttributeCollection
;
312 SCRIPTMODE_ACTIVESCRIPT
315 typedef struct ScriptHost ScriptHost
;
322 } global_prop_type_t
;
325 global_prop_type_t type
;
327 ScriptHost
*script_host
;
338 IHTMLOptionElementFactory IHTMLOptionElementFactory_iface
;
342 HTMLInnerWindow
*window
;
343 } HTMLOptionElementFactory
;
347 IHTMLImageElementFactory IHTMLImageElementFactory_iface
;
351 HTMLInnerWindow
*window
;
352 } HTMLImageElementFactory
;
354 struct HTMLLocation
{
356 IHTMLLocation IHTMLLocation_iface
;
360 HTMLInnerWindow
*window
;
365 IOmHistory IOmHistory_iface
;
369 HTMLInnerWindow
*window
;
373 HTMLOuterWindow
*window
;
377 typedef struct nsChannelBSC nsChannelBSC
;
380 IHTMLWindow2 IHTMLWindow2_iface
;
381 IHTMLWindow3 IHTMLWindow3_iface
;
382 IHTMLWindow4 IHTMLWindow4_iface
;
383 IHTMLWindow5 IHTMLWindow5_iface
;
384 IHTMLWindow6 IHTMLWindow6_iface
;
385 IHTMLPrivateWindow IHTMLPrivateWindow_iface
;
386 IDispatchEx IDispatchEx_iface
;
387 IServiceProvider IServiceProvider_iface
;
388 ITravelLogClient ITravelLogClient_iface
;
389 IObjectIdentity IObjectIdentity_iface
;
393 HTMLInnerWindow
*inner_window
;
394 HTMLOuterWindow
*outer_window
;
397 struct HTMLOuterWindow
{
400 windowref_t
*window_ref
;
403 HTMLDocumentObj
*doc_obj
;
404 nsIDOMWindow
*nswindow
;
405 HTMLOuterWindow
*parent
;
406 HTMLFrameBase
*frame_element
;
408 READYSTATE readystate
;
409 BOOL readystate_locked
;
410 unsigned readystate_pending
;
412 HTMLInnerWindow
*pending_window
;
419 SCRIPTMODE scriptmode
;
421 IInternetSecurityManager
*secmgr
;
423 struct list children
;
424 struct list sibling_entry
;
428 struct HTMLInnerWindow
{
430 EventTarget event_target
;
432 HTMLDocumentNode
*doc
;
434 struct list script_hosts
;
436 IHTMLEventObj
*event
;
438 HTMLImageElementFactory
*image_factory
;
439 HTMLOptionElementFactory
*option_factory
;
442 IHTMLStorage
*session_storage
;
444 unsigned parser_callback_cnt
;
445 struct list script_queue
;
447 global_prop_t
*global_props
;
448 DWORD global_prop_cnt
;
449 DWORD global_prop_size
;
453 HTMLLocation
*location
;
456 nsChannelBSC
*bscallback
;
457 struct list bindings
;
466 typedef struct _cp_static_data_t
{
468 void (*on_advise
)(IUnknown
*,struct _cp_static_data_t
*);
476 cp_static_data_t
*desc
;
479 typedef struct ConnectionPointContainer
{
480 IConnectionPointContainer IConnectionPointContainer_iface
;
482 ConnectionPoint
*cps
;
483 const cpc_entry_t
*cp_entries
;
485 struct ConnectionPointContainer
*forward_container
;
486 } ConnectionPointContainer
;
488 struct ConnectionPoint
{
489 IConnectionPoint IConnectionPoint_iface
;
491 ConnectionPointContainer
*container
;
496 IPropertyNotifySink
*propnotif
;
501 cp_static_data_t
*data
;
504 struct HTMLDocument
{
505 IHTMLDocument2 IHTMLDocument2_iface
;
506 IHTMLDocument3 IHTMLDocument3_iface
;
507 IHTMLDocument4 IHTMLDocument4_iface
;
508 IHTMLDocument5 IHTMLDocument5_iface
;
509 IHTMLDocument6 IHTMLDocument6_iface
;
510 IHTMLDocument7 IHTMLDocument7_iface
;
511 IPersistMoniker IPersistMoniker_iface
;
512 IPersistFile IPersistFile_iface
;
513 IPersistHistory IPersistHistory_iface
;
514 IMonikerProp IMonikerProp_iface
;
515 IOleObject IOleObject_iface
;
516 IOleDocument IOleDocument_iface
;
517 IOleDocumentView IOleDocumentView_iface
;
518 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
;
519 IViewObjectEx IViewObjectEx_iface
;
520 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface
;
521 IServiceProvider IServiceProvider_iface
;
522 IOleCommandTarget IOleCommandTarget_iface
;
523 IOleControl IOleControl_iface
;
524 IHlinkTarget IHlinkTarget_iface
;
525 IPersistStreamInit IPersistStreamInit_iface
;
526 IDispatchEx IDispatchEx_iface
;
527 ISupportErrorInfo ISupportErrorInfo_iface
;
528 IObjectWithSite IObjectWithSite_iface
;
529 IOleContainer IOleContainer_iface
;
530 IObjectSafety IObjectSafety_iface
;
531 IProvideClassInfo IProvideClassInfo_iface
;
536 HTMLDocumentObj
*doc_obj
;
537 HTMLDocumentNode
*doc_node
;
539 HTMLOuterWindow
*window
;
543 ConnectionPointContainer cp_container
;
544 IOleAdviseHolder
*advise_holder
;
547 static inline HRESULT
htmldoc_query_interface(HTMLDocument
*This
, REFIID riid
, void **ppv
)
549 return IUnknown_QueryInterface(This
->unk_impl
, riid
, ppv
);
552 static inline ULONG
htmldoc_addref(HTMLDocument
*This
)
554 return IUnknown_AddRef(This
->unk_impl
);
557 static inline ULONG
htmldoc_release(HTMLDocument
*This
)
559 return IUnknown_Release(This
->unk_impl
);
562 struct HTMLDocumentObj
{
563 HTMLDocument basedoc
;
565 ICustomDoc ICustomDoc_iface
;
566 ITargetContainer ITargetContainer_iface
;
568 IWindowForBindingUI IWindowForBindingUI_iface
;
572 NSContainer
*nscontainer
;
574 IOleClientSite
*client
;
575 IDocHostUIHandler
*hostui
;
576 IOleCommandTarget
*client_cmdtrg
;
578 IOleInPlaceSite
*ipsite
;
579 IOleInPlaceFrame
*frame
;
580 IOleInPlaceUIWindow
*ip_window
;
581 IAdviseSink
*view_sink
;
582 IDocObjectService
*doc_object_service
;
583 IUnknown
*webbrowser
;
584 ITravelLog
*travel_log
;
585 IUnknown
*browser_service
;
587 DOCHOSTUIINFO hostinfo
;
589 IOleUndoManager
*undomgr
;
594 BOOL request_uiactivate
;
595 BOOL in_place_active
;
599 BOOL container_locked
;
610 typedef struct nsWeakReference nsWeakReference
;
613 nsIWebBrowserChrome nsIWebBrowserChrome_iface
;
614 nsIContextMenuListener nsIContextMenuListener_iface
;
615 nsIURIContentListener nsIURIContentListener_iface
;
616 nsIEmbeddingSiteWindow nsIEmbeddingSiteWindow_iface
;
617 nsITooltipListener nsITooltipListener_iface
;
618 nsIInterfaceRequestor nsIInterfaceRequestor_iface
;
619 nsISupportsWeakReference nsISupportsWeakReference_iface
;
621 nsIWebBrowser
*webbrowser
;
622 nsIWebNavigation
*navigation
;
623 nsIBaseWindow
*window
;
624 nsIWebBrowserFocus
*focus
;
627 nsIController
*editor_controller
;
631 nsWeakReference
*weak_reference
;
634 HTMLDocumentObj
*doc
;
636 nsIURIContentListener
*content_listener
;
642 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
643 void (*destructor
)(HTMLDOMNode
*);
644 const cpc_entry_t
*cpc_entries
;
645 HRESULT (*clone
)(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**);
646 HRESULT (*handle_event
)(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*);
647 HRESULT (*get_attr_col
)(HTMLDOMNode
*,HTMLAttributeCollection
**);
648 event_target_t
**(*get_event_target_ptr
)(HTMLDOMNode
*);
649 HRESULT (*fire_event
)(HTMLDOMNode
*,DWORD
,BOOL
*);
650 HRESULT (*put_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
);
651 HRESULT (*get_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
*);
652 HRESULT (*get_document
)(HTMLDOMNode
*,IDispatch
**);
653 HRESULT (*get_readystate
)(HTMLDOMNode
*,BSTR
*);
654 HRESULT (*get_dispid
)(HTMLDOMNode
*,BSTR
,DWORD
,DISPID
*);
655 HRESULT (*invoke
)(HTMLDOMNode
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
656 HRESULT (*bind_to_tree
)(HTMLDOMNode
*);
657 void (*traverse
)(HTMLDOMNode
*,nsCycleCollectionTraversalCallback
*);
658 void (*unlink
)(HTMLDOMNode
*);
659 BOOL (*is_text_edit
)(HTMLDOMNode
*);
663 EventTarget event_target
;
664 IHTMLDOMNode IHTMLDOMNode_iface
;
665 IHTMLDOMNode2 IHTMLDOMNode2_iface
;
666 const NodeImplVtbl
*vtbl
;
668 nsCycleCollectingAutoRefCnt ccref
;
671 HTMLDocumentNode
*doc
;
672 ConnectionPointContainer
*cp_container
;
675 static inline void node_addref(HTMLDOMNode
*node
)
677 IHTMLDOMNode_AddRef(&node
->IHTMLDOMNode_iface
);
680 static inline void node_release(HTMLDOMNode
*node
)
682 IHTMLDOMNode_Release(&node
->IHTMLDOMNode_iface
);
687 ConnectionPointContainer cp_container
;
689 IHTMLElement IHTMLElement_iface
;
690 IHTMLElement2 IHTMLElement2_iface
;
691 IHTMLElement3 IHTMLElement3_iface
;
692 IHTMLElement4 IHTMLElement4_iface
;
694 nsIDOMHTMLElement
*nselem
;
696 HTMLStyle
*runtime_style
;
697 HTMLAttributeCollection
*attrs
;
701 #define HTMLELEMENT_TIDS \
709 extern cp_static_data_t HTMLElementEvents2_data DECLSPEC_HIDDEN
;
710 #define HTMLELEMENT_CPC {&DIID_HTMLElementEvents2, &HTMLElementEvents2_data}
711 extern const cpc_entry_t HTMLElement_cpc
[] DECLSPEC_HIDDEN
;
716 IHTMLTextContainer IHTMLTextContainer_iface
;
719 struct HTMLFrameBase
{
722 IHTMLFrameBase IHTMLFrameBase_iface
;
723 IHTMLFrameBase2 IHTMLFrameBase2_iface
;
725 HTMLOuterWindow
*content_window
;
727 nsIDOMHTMLFrameElement
*nsframe
;
728 nsIDOMHTMLIFrameElement
*nsiframe
;
731 typedef struct nsDocumentEventListener nsDocumentEventListener
;
733 struct HTMLDocumentNode
{
735 HTMLDocument basedoc
;
737 IInternetHostSecurityManager IInternetHostSecurityManager_iface
;
739 nsIDocumentObserver nsIDocumentObserver_iface
;
743 HTMLInnerWindow
*window
;
745 nsIDOMHTMLDocument
*nsdoc
;
747 event_target_t
*body_event_target
;
749 IHTMLDOMImplementation
*dom_implementation
;
751 ICatInformation
*catmgr
;
752 nsDocumentEventListener
*nsevent_listener
;
756 unsigned elem_vars_size
;
757 unsigned elem_vars_cnt
;
759 BOOL skip_mutation_notif
;
763 struct list selection_list
;
764 struct list range_list
;
765 struct list plugin_hosts
;
768 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
769 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
770 HRESULT
create_doc_from_nsdoc(nsIDOMHTMLDocument
*,HTMLDocumentObj
*,HTMLInnerWindow
*,HTMLDocumentNode
**) DECLSPEC_HIDDEN
;
772 HRESULT
HTMLOuterWindow_Create(HTMLDocumentObj
*,nsIDOMWindow
*,HTMLOuterWindow
*,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
773 HRESULT
update_window_doc(HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
774 HTMLOuterWindow
*nswindow_to_window(const nsIDOMWindow
*) DECLSPEC_HIDDEN
;
775 void get_top_window(HTMLOuterWindow
*,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
776 HRESULT
HTMLOptionElementFactory_Create(HTMLInnerWindow
*,HTMLOptionElementFactory
**) DECLSPEC_HIDDEN
;
777 HRESULT
HTMLImageElementFactory_Create(HTMLInnerWindow
*,HTMLImageElementFactory
**) DECLSPEC_HIDDEN
;
778 HRESULT
HTMLLocation_Create(HTMLInnerWindow
*,HTMLLocation
**) DECLSPEC_HIDDEN
;
779 IOmNavigator
*OmNavigator_Create(void) DECLSPEC_HIDDEN
;
780 HRESULT
HTMLScreen_Create(IHTMLScreen
**) DECLSPEC_HIDDEN
;
781 HRESULT
create_history(HTMLInnerWindow
*,OmHistory
**) DECLSPEC_HIDDEN
;
782 HRESULT
create_dom_implementation(IHTMLDOMImplementation
**) DECLSPEC_HIDDEN
;
784 HRESULT
create_storage(IHTMLStorage
**) DECLSPEC_HIDDEN
;
786 void HTMLDocument_Persist_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
787 void HTMLDocument_OleCmd_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
788 void HTMLDocument_OleObj_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
789 void HTMLDocument_View_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
790 void HTMLDocument_Window_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
791 void HTMLDocument_Service_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
792 void HTMLDocument_Hlink_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
794 void TargetContainer_Init(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
795 void init_binding_ui(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
797 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
799 HRESULT
HTMLCurrentStyle_Create(HTMLElement
*,IHTMLCurrentStyle
**) DECLSPEC_HIDDEN
;
801 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*,const cpc_entry_t
*) DECLSPEC_HIDDEN
;
802 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*) DECLSPEC_HIDDEN
;
804 HRESULT
create_nscontainer(HTMLDocumentObj
*,NSContainer
**) DECLSPEC_HIDDEN
;
805 void NSContainer_Release(NSContainer
*) DECLSPEC_HIDDEN
;
807 void init_mutation(nsIComponentManager
*) DECLSPEC_HIDDEN
;
808 void init_document_mutation(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
809 void release_document_mutation(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
810 JSContext
*get_context_from_document(nsIDOMHTMLDocument
*) DECLSPEC_HIDDEN
;
812 void HTMLDocument_LockContainer(HTMLDocumentObj
*,BOOL
) DECLSPEC_HIDDEN
;
813 void show_context_menu(HTMLDocumentObj
*,DWORD
,POINT
*,IDispatch
*) DECLSPEC_HIDDEN
;
814 void notif_focus(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
816 void show_tooltip(HTMLDocumentObj
*,DWORD
,DWORD
,LPCWSTR
) DECLSPEC_HIDDEN
;
817 void hide_tooltip(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
818 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*) DECLSPEC_HIDDEN
;
820 UINT
get_document_charset(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
822 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**) DECLSPEC_HIDDEN
;
824 BOOL
load_gecko(void) DECLSPEC_HIDDEN
;
825 void close_gecko(void) DECLSPEC_HIDDEN
;
826 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*) DECLSPEC_HIDDEN
;
827 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*) DECLSPEC_HIDDEN
;
828 void release_nsio(void) DECLSPEC_HIDDEN
;
829 BOOL
is_gecko_path(const char*) DECLSPEC_HIDDEN
;
830 void set_viewer_zoom(NSContainer
*,float) DECLSPEC_HIDDEN
;
832 void init_node_cc(void) DECLSPEC_HIDDEN
;
834 HRESULT
nsuri_to_url(LPCWSTR
,BOOL
,BSTR
*) DECLSPEC_HIDDEN
;
836 HRESULT
set_frame_doc(HTMLFrameBase
*,nsIDOMDocument
*) DECLSPEC_HIDDEN
;
838 void call_property_onchanged(ConnectionPointContainer
*,DISPID
) DECLSPEC_HIDDEN
;
839 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*) DECLSPEC_HIDDEN
;
841 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
;
842 void nsfree(void*) DECLSPEC_HIDDEN
;
844 void nsACString_InitDepend(nsACString
*,const char*) DECLSPEC_HIDDEN
;
845 void nsACString_SetData(nsACString
*,const char*) DECLSPEC_HIDDEN
;
846 UINT32
nsACString_GetData(const nsACString
*,const char**) DECLSPEC_HIDDEN
;
847 void nsACString_Finish(nsACString
*) DECLSPEC_HIDDEN
;
849 BOOL
nsAString_Init(nsAString
*,const PRUnichar
*) DECLSPEC_HIDDEN
;
850 void nsAString_InitDepend(nsAString
*,const PRUnichar
*) DECLSPEC_HIDDEN
;
851 UINT32
nsAString_GetData(const nsAString
*,const PRUnichar
**) DECLSPEC_HIDDEN
;
852 void nsAString_Finish(nsAString
*) DECLSPEC_HIDDEN
;
854 HRESULT
return_nsstr(nsresult
,nsAString
*,BSTR
*) DECLSPEC_HIDDEN
;
856 static inline HRESULT
return_nsstr_variant(nsresult nsres
, nsAString
*nsstr
, VARIANT
*p
)
859 return return_nsstr(nsres
, nsstr
, &V_BSTR(p
));
862 nsICommandParams
*create_nscommand_params(void) DECLSPEC_HIDDEN
;
863 HRESULT
nsnode_to_nsstring(nsIDOMNode
*,nsAString
*) DECLSPEC_HIDDEN
;
864 void get_editor_controller(NSContainer
*) DECLSPEC_HIDDEN
;
865 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**) DECLSPEC_HIDDEN
;
866 nsIWritableVariant
*create_nsvariant(void) DECLSPEC_HIDDEN
;
867 nsresult
create_nsfile(const PRUnichar
*,nsIFile
**) DECLSPEC_HIDDEN
;
868 char *get_nscategory_entry(const char*,const char*) DECLSPEC_HIDDEN
;
870 HRESULT
create_pending_window(HTMLOuterWindow
*,nsChannelBSC
*) DECLSPEC_HIDDEN
;
871 HRESULT
start_binding(HTMLInnerWindow
*,BSCallback
*,IBindCtx
*) DECLSPEC_HIDDEN
;
872 HRESULT
async_start_doc_binding(HTMLOuterWindow
*,HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
873 void abort_window_bindings(HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
874 void set_download_state(HTMLDocumentObj
*,int) DECLSPEC_HIDDEN
;
875 void call_docview_84(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
877 void set_ready_state(HTMLOuterWindow
*,READYSTATE
) DECLSPEC_HIDDEN
;
878 HRESULT
get_readystate_string(READYSTATE
,BSTR
*) DECLSPEC_HIDDEN
;
880 HRESULT
HTMLSelectionObject_Create(HTMLDocumentNode
*,nsISelection
*,IHTMLSelectionObject
**) DECLSPEC_HIDDEN
;
881 HRESULT
HTMLTxtRange_Create(HTMLDocumentNode
*,nsIDOMRange
*,IHTMLTxtRange
**) DECLSPEC_HIDDEN
;
882 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*) DECLSPEC_HIDDEN
;
883 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*) DECLSPEC_HIDDEN
;
885 void detach_selection(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
886 void detach_ranges(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
887 HRESULT
get_node_text(HTMLDOMNode
*,BSTR
*) DECLSPEC_HIDDEN
;
888 HRESULT
replace_node_by_html(nsIDOMHTMLDocument
*,nsIDOMNode
*,const WCHAR
*) DECLSPEC_HIDDEN
;
890 HRESULT
create_nselem(HTMLDocumentNode
*,const WCHAR
*,nsIDOMHTMLElement
**) DECLSPEC_HIDDEN
;
891 HRESULT
create_element(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**) DECLSPEC_HIDDEN
;
893 HRESULT
HTMLDOMTextNode_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
895 BOOL
variant_to_nscolor(const VARIANT
*v
, nsAString
*nsstr
) DECLSPEC_HIDDEN
;
896 HRESULT
nscolor_to_str(LPCWSTR color
, BSTR
*ret
) DECLSPEC_HIDDEN
;
899 struct HTMLAttributeCollection
{
901 IHTMLAttributeCollection IHTMLAttributeCollection_iface
;
902 IHTMLAttributeCollection2 IHTMLAttributeCollection2_iface
;
903 IHTMLAttributeCollection3 IHTMLAttributeCollection3_iface
;
913 IHTMLDOMAttribute IHTMLDOMAttribute_iface
;
914 IHTMLDOMAttribute2 IHTMLDOMAttribute2_iface
;
925 HRESULT
HTMLDOMAttribute_Create(const WCHAR
*,HTMLElement
*,DISPID
,HTMLDOMAttribute
**) DECLSPEC_HIDDEN
;
927 HRESULT
HTMLElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,BOOL
,HTMLElement
**) DECLSPEC_HIDDEN
;
928 HRESULT
HTMLCommentElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLElement
**) DECLSPEC_HIDDEN
;
929 HRESULT
HTMLAnchorElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
930 HRESULT
HTMLBodyElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
931 HRESULT
HTMLButtonElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
932 HRESULT
HTMLEmbedElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
933 HRESULT
HTMLFormElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
934 HRESULT
HTMLFrameElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
935 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
936 HRESULT
HTMLIFrame_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
937 HRESULT
HTMLStyleElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
938 HRESULT
HTMLImgElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
939 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
940 HRESULT
HTMLLabelElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
941 HRESULT
HTMLLinkElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
942 HRESULT
HTMLMetaElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
943 HRESULT
HTMLObjectElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
944 HRESULT
HTMLOptionElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
945 HRESULT
HTMLScriptElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
946 HRESULT
HTMLSelectElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
947 HRESULT
HTMLTable_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
948 HRESULT
HTMLTableCell_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
949 HRESULT
HTMLTableRow_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
950 HRESULT
HTMLTextAreaElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
951 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
952 HRESULT
HTMLGenericElement_Create(HTMLDocumentNode
*,nsIDOMHTMLElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
954 void HTMLDOMNode_Init(HTMLDocumentNode
*,HTMLDOMNode
*,nsIDOMNode
*) DECLSPEC_HIDDEN
;
955 void HTMLElement_Init(HTMLElement
*,HTMLDocumentNode
*,nsIDOMHTMLElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
956 void HTMLTextContainer_Init(HTMLTextContainer
*,HTMLDocumentNode
*,nsIDOMHTMLElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
957 void HTMLFrameBase_Init(HTMLFrameBase
*,HTMLDocumentNode
*,nsIDOMHTMLElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
959 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**) DECLSPEC_HIDDEN
;
960 void HTMLDOMNode_destructor(HTMLDOMNode
*) DECLSPEC_HIDDEN
;
962 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**) DECLSPEC_HIDDEN
;
963 void HTMLElement_destructor(HTMLDOMNode
*) DECLSPEC_HIDDEN
;
964 HRESULT
HTMLElement_clone(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
965 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*,HTMLAttributeCollection
**) DECLSPEC_HIDDEN
;
966 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*) DECLSPEC_HIDDEN
;
968 HRESULT
HTMLFrameBase_QI(HTMLFrameBase
*,REFIID
,void**) DECLSPEC_HIDDEN
;
969 void HTMLFrameBase_destructor(HTMLFrameBase
*) DECLSPEC_HIDDEN
;
971 HRESULT
get_node(HTMLDocumentNode
*,nsIDOMNode
*,BOOL
,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
972 HRESULT
get_elem(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
974 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*) DECLSPEC_HIDDEN
;
976 HRESULT
search_window_props(HTMLInnerWindow
*,BSTR
,DWORD
,DISPID
*) DECLSPEC_HIDDEN
;
977 HRESULT
get_frame_by_name(HTMLOuterWindow
*,const WCHAR
*,BOOL
,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
978 HRESULT
get_doc_elem_by_id(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**) DECLSPEC_HIDDEN
;
979 HTMLOuterWindow
*get_target_window(HTMLOuterWindow
*,nsAString
*,BOOL
*) DECLSPEC_HIDDEN
;
981 HRESULT
wrap_iface(IUnknown
*,IUnknown
*,IUnknown
**) DECLSPEC_HIDDEN
;
983 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*,BOOL
) DECLSPEC_HIDDEN
;
984 IHTMLElementCollection
*create_collection_from_nodelist(HTMLDocumentNode
*,nsIDOMNodeList
*) DECLSPEC_HIDDEN
;
985 IHTMLElementCollection
*create_collection_from_htmlcol(HTMLDocumentNode
*,nsIDOMHTMLCollection
*) DECLSPEC_HIDDEN
;
987 #define ATTRFLAG_CASESENSITIVE 0x0001
988 #define ATTRFLAG_ASSTRING 0x0002
989 #define ATTRFLAG_EXPANDURL 0x0004
991 HRESULT
get_elem_attr_value_by_dispid(HTMLElement
*,DISPID
,DWORD
,VARIANT
*) DECLSPEC_HIDDEN
;
992 HRESULT
get_elem_source_index(HTMLElement
*,LONG
*) DECLSPEC_HIDDEN
;
994 nsresult
get_elem_attr_value(nsIDOMHTMLElement
*,const WCHAR
*,nsAString
*,const PRUnichar
**) DECLSPEC_HIDDEN
;
995 HRESULT
elem_string_attr_getter(HTMLElement
*,const WCHAR
*,BOOL
,BSTR
*) DECLSPEC_HIDDEN
;
996 HRESULT
elem_string_attr_setter(HTMLElement
*,const WCHAR
*,const WCHAR
*) DECLSPEC_HIDDEN
;
1001 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
1002 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
1005 extern const cmdtable_t editmode_cmds
[] DECLSPEC_HIDDEN
;
1007 void do_ns_command(HTMLDocument
*,const char*,nsICommandParams
*) DECLSPEC_HIDDEN
;
1010 #define UPDATE_UI 0x0001
1011 #define UPDATE_TITLE 0x0002
1013 void update_doc(HTMLDocument
*,DWORD
) DECLSPEC_HIDDEN
;
1014 void update_title(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
1015 void set_document_navigation(HTMLDocumentObj
*,BOOL
) DECLSPEC_HIDDEN
;
1017 HRESULT
do_query_service(IUnknown
*,REFGUID
,REFIID
,void**) DECLSPEC_HIDDEN
;
1020 HRESULT
setup_edit_mode(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
1021 void init_editor(HTMLDocument
*) DECLSPEC_HIDDEN
;
1022 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*) DECLSPEC_HIDDEN
;
1023 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1024 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1025 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1026 void handle_edit_load(HTMLDocument
*) DECLSPEC_HIDDEN
;
1027 HRESULT
editor_is_dirty(HTMLDocument
*) DECLSPEC_HIDDEN
;
1028 void set_dirty(HTMLDocument
*,VARIANT_BOOL
) DECLSPEC_HIDDEN
;
1030 extern DWORD mshtml_tls DECLSPEC_HIDDEN
;
1032 typedef struct task_t task_t
;
1033 typedef void (*task_proc_t
)(task_t
*);
1044 HTMLDocumentObj
*doc
;
1049 struct list task_list
;
1050 struct list timer_list
;
1053 thread_data_t
*get_thread_data(BOOL
) DECLSPEC_HIDDEN
;
1054 HWND
get_thread_hwnd(void) DECLSPEC_HIDDEN
;
1056 LONG
get_task_target_magic(void) DECLSPEC_HIDDEN
;
1057 HRESULT
push_task(task_t
*,task_proc_t
,task_proc_t
,LONG
) DECLSPEC_HIDDEN
;
1058 void remove_target_tasks(LONG
) DECLSPEC_HIDDEN
;
1059 void flush_pending_tasks(LONG
) DECLSPEC_HIDDEN
;
1061 HRESULT
set_task_timer(HTMLInnerWindow
*,DWORD
,BOOL
,IDispatch
*,LONG
*) DECLSPEC_HIDDEN
;
1062 HRESULT
clear_task_timer(HTMLInnerWindow
*,BOOL
,DWORD
) DECLSPEC_HIDDEN
;
1064 const char *debugstr_mshtml_guid(const GUID
*) DECLSPEC_HIDDEN
;
1066 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1067 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1068 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1069 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1070 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
1072 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
1074 DEFINE_OLEGUID(CGID_DocHostCmdPriv
, 0x000214D4L
, 0, 0);
1076 DEFINE_GUID(CLSID_JScript
, 0xf414c260,0x6ac0,0x11cf, 0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58);
1077 DEFINE_GUID(CLSID_VBScript
, 0xb54f3741,0x5b07,0x11cf, 0xa4,0xb0,0x00,0xaa,0x00,0x4a,0x55,0xe8);
1079 DEFINE_GUID(IID_UndocumentedScriptIface
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa0);
1080 DEFINE_GUID(IID_IDispatchJS
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa6);
1082 /* memory allocation functions */
1084 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len
)
1086 return HeapAlloc(GetProcessHeap(), 0, len
);
1089 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len
)
1091 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
1094 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem
, size_t len
)
1096 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
1099 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem
, size_t len
)
1101 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, mem
, len
);
1104 static inline BOOL
heap_free(void *mem
)
1106 return HeapFree(GetProcessHeap(), 0, mem
);
1109 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
1116 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
1117 ret
= heap_alloc(size
);
1119 memcpy(ret
, str
, size
);
1125 static inline LPWSTR
heap_strndupW(LPCWSTR str
, unsigned len
)
1130 ret
= heap_alloc((len
+1)*sizeof(WCHAR
));
1133 memcpy(ret
, str
, len
*sizeof(WCHAR
));
1141 static inline char *heap_strdupA(const char *str
)
1148 size
= strlen(str
)+1;
1149 ret
= heap_alloc(size
);
1151 memcpy(ret
, str
, size
);
1157 static inline WCHAR
*heap_strdupAtoW(const char *str
)
1164 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
1165 ret
= heap_alloc(len
*sizeof(WCHAR
));
1167 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
1173 static inline char *heap_strdupWtoA(LPCWSTR str
)
1178 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1179 ret
= heap_alloc(size
);
1181 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1187 static inline WCHAR
*heap_strdupUtoW(const char *str
)
1194 len
= MultiByteToWideChar(CP_UTF8
, 0, str
, -1, NULL
, 0);
1195 ret
= heap_alloc(len
*sizeof(WCHAR
));
1197 MultiByteToWideChar(CP_UTF8
, 0, str
, -1, ret
, len
);
1203 static inline char *heap_strdupWtoU(const WCHAR
*str
)
1208 size_t size
= WideCharToMultiByte(CP_UTF8
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1209 ret
= heap_alloc(size
);
1211 WideCharToMultiByte(CP_UTF8
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1217 static inline void windowref_addref(windowref_t
*ref
)
1219 InterlockedIncrement(&ref
->ref
);
1222 static inline void windowref_release(windowref_t
*ref
)
1224 if(!InterlockedDecrement(&ref
->ref
))
1228 UINT
cp_from_charset_string(BSTR
) DECLSPEC_HIDDEN
;
1229 HDC
get_display_dc(void) DECLSPEC_HIDDEN
;
1230 HINSTANCE
get_shdoclc(void) DECLSPEC_HIDDEN
;
1231 void set_statustext(HTMLDocumentObj
*,INT
,LPCWSTR
) DECLSPEC_HIDDEN
;
1233 extern HINSTANCE hInst DECLSPEC_HIDDEN
;