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
,
66 DispHTMLCommentElement_tid
,
68 DispHTMLDOMTextNode_tid
,
69 DispHTMLElementCollection_tid
,
70 DispHTMLGenericElement_tid
,
72 DispHTMLInputElement_tid
,
73 DispHTMLOptionElement_tid
,
74 DispHTMLSelectElement_tid
,
78 DispHTMLUnknownElement_tid
,
81 IHTMLBodyElement2_tid
,
82 IHTMLCommentElement_tid
,
87 IHTMLDOMChildrenCollection_tid
,
95 IHTMLElementCollection_tid
,
96 IHTMLGenericElement_tid
,
98 IHTMLInputElement_tid
,
99 IHTMLOptionElement_tid
,
100 IHTMLSelectElement_tid
,
105 IHTMLTextContainer_tid
,
121 typedef struct dispex_data_t dispex_data_t
;
122 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
124 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
125 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
128 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
129 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
130 } dispex_static_data_vtbl_t
;
133 const dispex_static_data_vtbl_t
*vtbl
;
134 const tid_t disp_tid
;
136 const tid_t
* const iface_tids
;
137 } dispex_static_data_t
;
140 const IDispatchExVtbl
*lpIDispatchExVtbl
;
144 dispex_static_data_t
*data
;
145 dispex_dynamic_data_t
*dynamic_data
;
148 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
149 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**);
153 const IHTMLWindow2Vtbl
*lpHTMLWindow2Vtbl
;
154 const IHTMLWindow3Vtbl
*lpHTMLWindow3Vtbl
;
155 const IDispatchExVtbl
*lpIDispatchExVtbl
;
160 nsIDOMWindow
*nswindow
;
162 IHTMLEventObj
*event
;
175 SCRIPTMODE_ACTIVESCRIPT
179 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
181 ConnectionPoint
*cp_list
;
183 } ConnectionPointContainer
;
185 struct ConnectionPoint
{
186 const IConnectionPointVtbl
*lpConnectionPointVtbl
;
188 IConnectionPointContainer
*container
;
193 IPropertyNotifySink
*propnotif
;
199 ConnectionPoint
*next
;
203 const IHTMLLocationVtbl
*lpHTMLLocationVtbl
;
211 const IHTMLOptionElementFactoryVtbl
*lpHTMLOptionElementFactoryVtbl
;
216 } HTMLOptionElementFactory
;
218 struct HTMLDocument
{
220 const IHTMLDocument2Vtbl
*lpHTMLDocument2Vtbl
;
221 const IHTMLDocument3Vtbl
*lpHTMLDocument3Vtbl
;
222 const IHTMLDocument4Vtbl
*lpHTMLDocument4Vtbl
;
223 const IHTMLDocument5Vtbl
*lpHTMLDocument5Vtbl
;
224 const IPersistMonikerVtbl
*lpPersistMonikerVtbl
;
225 const IPersistFileVtbl
*lpPersistFileVtbl
;
226 const IMonikerPropVtbl
*lpMonikerPropVtbl
;
227 const IOleObjectVtbl
*lpOleObjectVtbl
;
228 const IOleDocumentVtbl
*lpOleDocumentVtbl
;
229 const IOleDocumentViewVtbl
*lpOleDocumentViewVtbl
;
230 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
231 const IViewObject2Vtbl
*lpViewObject2Vtbl
;
232 const IOleInPlaceObjectWindowlessVtbl
*lpOleInPlaceObjectWindowlessVtbl
;
233 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
234 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
235 const IOleControlVtbl
*lpOleControlVtbl
;
236 const IHlinkTargetVtbl
*lpHlinkTargetVtbl
;
237 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
238 const ICustomDocVtbl
*lpCustomDocVtbl
;
239 const IDispatchExVtbl
*lpIDispatchExVtbl
;
243 NSContainer
*nscontainer
;
246 IOleClientSite
*client
;
247 IDocHostUIHandler
*hostui
;
248 IOleInPlaceSite
*ipsite
;
249 IOleInPlaceFrame
*frame
;
250 IOleInPlaceUIWindow
*ip_window
;
252 IOleUndoManager
*undomgr
;
254 nsChannelBSC
*bscallback
;
257 struct list bindings
;
259 struct list script_hosts
;
264 DOCHOSTUIINFO hostinfo
;
267 SCRIPTMODE scriptmode
;
268 READYSTATE readystate
;
269 BOOL in_place_active
;
273 BOOL container_locked
;
279 ConnectionPointContainer cp_container
;
280 ConnectionPoint cp_htmldocevents
;
281 ConnectionPoint cp_htmldocevents2
;
282 ConnectionPoint cp_propnotif
;
284 HTMLOptionElementFactory
*option_factory
;
285 HTMLLocation
*location
;
287 struct list selection_list
;
288 struct list range_list
;
294 const nsIDOMEventListenerVtbl
*lpDOMEventListenerVtbl
;
299 const nsIWebBrowserChromeVtbl
*lpWebBrowserChromeVtbl
;
300 const nsIContextMenuListenerVtbl
*lpContextMenuListenerVtbl
;
301 const nsIURIContentListenerVtbl
*lpURIContentListenerVtbl
;
302 const nsIEmbeddingSiteWindowVtbl
*lpEmbeddingSiteWindowVtbl
;
303 const nsITooltipListenerVtbl
*lpTooltipListenerVtbl
;
304 const nsIInterfaceRequestorVtbl
*lpInterfaceRequestorVtbl
;
305 const nsIWeakReferenceVtbl
*lpWeakReferenceVtbl
;
306 const nsISupportsWeakReferenceVtbl
*lpSupportsWeakReferenceVtbl
;
308 nsEventListener blur_listener
;
309 nsEventListener focus_listener
;
310 nsEventListener keypress_listener
;
311 nsEventListener load_listener
;
312 nsEventListener node_insert_listener
;
313 nsEventListener htmlevent_listener
;
315 nsIWebBrowser
*webbrowser
;
316 nsIWebNavigation
*navigation
;
317 nsIBaseWindow
*window
;
318 nsIWebBrowserFocus
*focus
;
321 nsIController
*editor_controller
;
328 nsIURIContentListener
*content_listener
;
332 nsChannelBSC
*bscallback
; /* hack */
333 HWND reset_focus
; /* hack */
335 BOOL event_vector
[EVENTID_LAST
];
339 const nsIHttpChannelVtbl
*lpHttpChannelVtbl
;
340 const nsIUploadChannelVtbl
*lpUploadChannelVtbl
;
345 nsIHttpChannel
*http_channel
;
347 nsIInputStream
*post_data_stream
;
348 nsILoadGroup
*load_group
;
349 nsIInterfaceRequestor
*notif_callback
;
350 nsLoadFlags load_flags
;
351 nsIURI
*original_uri
;
357 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
358 void (*destructor
)(HTMLDOMNode
*);
363 const IHTMLDOMNodeVtbl
*lpHTMLDOMNodeVtbl
;
364 const IHTMLDOMNode2Vtbl
*lpHTMLDOMNode2Vtbl
;
365 const NodeImplVtbl
*vtbl
;
371 event_target_t
*event_target
;
378 ConnectionPointContainer cp_container
;
380 const IHTMLElementVtbl
*lpHTMLElementVtbl
;
381 const IHTMLElement2Vtbl
*lpHTMLElement2Vtbl
;
383 nsIDOMHTMLElement
*nselem
;
389 const IHTMLTextContainerVtbl
*lpHTMLTextContainerVtbl
;
396 const IHTMLStyleVtbl
*lpHTMLStyleVtbl
;
397 const IHTMLStyle2Vtbl
*lpHTMLStyle2Vtbl
;
401 nsIDOMCSSStyleDeclaration
*nsstyle
;
404 #define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
405 #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
407 #define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
408 #define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
409 #define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
410 #define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
411 #define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
412 #define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
413 #define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
414 #define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
415 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
416 #define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
417 #define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
418 #define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
419 #define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
420 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
421 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
422 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
423 #define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
424 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
425 #define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
426 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
427 #define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
428 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
429 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
430 #define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
432 #define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
433 #define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
434 #define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
435 #define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
436 #define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
437 #define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
438 #define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
439 #define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
440 #define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
442 #define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
443 #define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
444 #define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
446 #define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
447 #define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
448 #define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
450 #define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
451 #define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
452 #define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
453 #define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
455 #define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
457 #define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
458 #define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
460 #define HTMLSTYLE(x) ((IHTMLStyle*) &(x)->lpHTMLStyleVtbl)
461 #define HTMLSTYLE2(x) ((IHTMLStyle2*) &(x)->lpHTMLStyle2Vtbl)
463 #define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
465 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
466 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
468 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
469 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
471 HTMLWindow
*HTMLWindow_Create(HTMLDocument
*);
472 HTMLWindow
*nswindow_to_window(const nsIDOMWindow
*);
473 HTMLOptionElementFactory
*HTMLOptionElementFactory_Create(HTMLDocument
*);
474 HTMLLocation
*HTMLLocation_Create(HTMLDocument
*);
475 IOmNavigator
*OmNavigator_Create(void);
476 void setup_nswindow(HTMLWindow
*);
478 void HTMLDocument_HTMLDocument3_Init(HTMLDocument
*);
479 void HTMLDocument_HTMLDocument5_Init(HTMLDocument
*);
480 void HTMLDocument_Persist_Init(HTMLDocument
*);
481 void HTMLDocument_OleCmd_Init(HTMLDocument
*);
482 void HTMLDocument_OleObj_Init(HTMLDocument
*);
483 void HTMLDocument_View_Init(HTMLDocument
*);
484 void HTMLDocument_Window_Init(HTMLDocument
*);
485 void HTMLDocument_Service_Init(HTMLDocument
*);
486 void HTMLDocument_Hlink_Init(HTMLDocument
*);
488 void HTMLStyle2_Init(HTMLStyle
*);
489 HRESULT
HTMLCurrentStyle_Create(IHTMLCurrentStyle
**);
491 void ConnectionPoint_Init(ConnectionPoint
*,ConnectionPointContainer
*,REFIID
);
492 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
493 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
495 NSContainer
*NSContainer_Create(HTMLDocument
*,NSContainer
*);
496 void NSContainer_Release(NSContainer
*);
498 void HTMLDocument_LockContainer(HTMLDocument
*,BOOL
);
499 void show_context_menu(HTMLDocument
*,DWORD
,POINT
*,IDispatch
*);
500 void notif_focus(HTMLDocument
*);
502 void show_tooltip(HTMLDocument
*,DWORD
,DWORD
,LPCWSTR
);
503 void hide_tooltip(HTMLDocument
*);
504 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
506 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
508 BOOL
load_gecko(BOOL
);
509 void close_gecko(void);
510 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
511 void init_nsio(nsIComponentManager
*,nsIComponentRegistrar
*);
512 BOOL
install_wine_gecko(BOOL
);
514 void hlink_frame_navigate(HTMLDocument
*,IHlinkFrame
*,LPCWSTR
,nsIInputStream
*,DWORD
);
516 void call_property_onchanged(ConnectionPoint
*,DISPID
);
517 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
519 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1);
522 void nsACString_Init(nsACString
*,const char*);
523 void nsACString_SetData(nsACString
*,const char*);
524 PRUint32
nsACString_GetData(const nsACString
*,const char**);
525 void nsACString_Finish(nsACString
*);
527 void nsAString_Init(nsAString
*,const PRUnichar
*);
528 void nsAString_SetData(nsAString
*,const PRUnichar
*);
529 PRUint32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
530 void nsAString_Finish(nsAString
*);
532 nsIInputStream
*create_nsstream(const char*,PRInt32
);
533 nsICommandParams
*create_nscommand_params(void);
534 nsIMutableArray
*create_nsarray(void);
535 nsIWritableVariant
*create_nsvariant(void);
536 void nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
537 void get_editor_controller(NSContainer
*);
538 void init_nsevents(NSContainer
*);
539 void add_nsevent_listener(NSContainer
*,LPCWSTR
);
540 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
542 void check_event_attr(HTMLDocument
*,nsIDOMElement
*);
543 void release_event_target(event_target_t
*);
544 void fire_event(HTMLDocument
*,eventid_t
,nsIDOMNode
*);
545 HRESULT
set_node_event(HTMLDOMNode
*,eventid_t
,VARIANT
*);
546 eventid_t
str_to_eid(LPCWSTR
);
548 void set_document_bscallback(HTMLDocument
*,nsChannelBSC
*);
549 void set_current_mon(HTMLDocument
*,IMoniker
*);
550 HRESULT
start_binding(HTMLDocument
*,BSCallback
*,IBindCtx
*);
552 HRESULT
bind_mon_to_buffer(HTMLDocument
*,IMoniker
*,void**,DWORD
*);
554 nsChannelBSC
*create_channelbsc(IMoniker
*);
555 HRESULT
channelbsc_load_stream(nsChannelBSC
*,IStream
*);
556 void channelbsc_set_channel(nsChannelBSC
*,nsChannel
*,nsIStreamListener
*,nsISupports
*);
557 IMoniker
*get_channelbsc_mon(nsChannelBSC
*);
559 IHTMLSelectionObject
*HTMLSelectionObject_Create(HTMLDocument
*,nsISelection
*);
560 IHTMLTxtRange
*HTMLTxtRange_Create(HTMLDocument
*,nsIDOMRange
*);
561 IHTMLStyle
*HTMLStyle_Create(nsIDOMCSSStyleDeclaration
*);
562 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*);
563 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*);
565 void detach_selection(HTMLDocument
*);
566 void detach_ranges(HTMLDocument
*);
568 HTMLDOMNode
*HTMLDOMTextNode_Create(HTMLDocument
*,nsIDOMNode
*);
570 HTMLElement
*HTMLElement_Create(HTMLDocument
*,nsIDOMNode
*,BOOL
);
571 HTMLElement
*HTMLCommentElement_Create(HTMLDocument
*,nsIDOMNode
*);
572 HTMLElement
*HTMLAnchorElement_Create(nsIDOMHTMLElement
*);
573 HTMLElement
*HTMLBodyElement_Create(nsIDOMHTMLElement
*);
574 HTMLElement
*HTMLImgElement_Create(nsIDOMHTMLElement
*);
575 HTMLElement
*HTMLInputElement_Create(nsIDOMHTMLElement
*);
576 HTMLElement
*HTMLOptionElement_Create(nsIDOMHTMLElement
*);
577 HTMLElement
*HTMLScriptElement_Create(nsIDOMHTMLElement
*);
578 HTMLElement
*HTMLSelectElement_Create(nsIDOMHTMLElement
*);
579 HTMLElement
*HTMLTable_Create(nsIDOMHTMLElement
*);
580 HTMLElement
*HTMLTableRow_Create(nsIDOMHTMLElement
*);
581 HTMLElement
*HTMLTextAreaElement_Create(nsIDOMHTMLElement
*);
582 HTMLElement
*HTMLGenericElement_Create(nsIDOMHTMLElement
*);
584 void HTMLDOMNode_Init(HTMLDocument
*,HTMLDOMNode
*,nsIDOMNode
*);
585 void HTMLElement_Init(HTMLElement
*);
586 void HTMLElement2_Init(HTMLElement
*);
587 void HTMLTextContainer_Init(HTMLTextContainer
*);
589 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
590 void HTMLDOMNode_destructor(HTMLDOMNode
*);
592 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
593 void HTMLElement_destructor(HTMLDOMNode
*);
595 HTMLDOMNode
*get_node(HTMLDocument
*,nsIDOMNode
*,BOOL
);
596 void release_nodes(HTMLDocument
*);
598 void release_script_hosts(HTMLDocument
*);
599 void connect_scripts(HTMLDocument
*);
600 void doc_insert_script(HTMLDocument
*,nsIDOMHTMLScriptElement
*);
601 IDispatch
*script_parse_event(HTMLDocument
*,LPCWSTR
);
602 void set_script_mode(HTMLDocument
*,SCRIPTMODE
);
604 IHTMLElementCollection
*HTMLElementCollection_Create(IUnknown
*,HTMLElement
**,DWORD
);
605 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*,BOOL
);
606 IHTMLElementCollection
*create_collection_from_nodelist(HTMLDocument
*,IUnknown
*,nsIDOMNodeList
*);
607 IHTMLElementCollection
*create_collection_from_htmlcol(HTMLDocument
*,IUnknown
*,nsIDOMHTMLCollection
*);
612 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
613 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
616 extern const cmdtable_t editmode_cmds
[];
618 void do_ns_command(NSContainer
*,const char*,nsICommandParams
*);
621 #define UPDATE_UI 0x0001
622 #define UPDATE_TITLE 0x0002
624 void update_doc(HTMLDocument
*This
, DWORD flags
);
625 void update_title(HTMLDocument
*);
628 void init_editor(HTMLDocument
*);
629 void set_ns_editmode(NSContainer
*);
630 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*);
631 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
632 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
633 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
634 void handle_edit_load(HTMLDocument
*);
635 HRESULT
editor_is_dirty(HTMLDocument
*);
636 void set_dirty(HTMLDocument
*,VARIANT_BOOL
);
638 extern DWORD mshtml_tls
;
640 typedef struct task_t
{
644 TASK_SETDOWNLOADSTATE
,
650 nsChannelBSC
*bscallback
;
657 task_t
*task_queue_head
;
658 task_t
*task_queue_tail
;
659 struct list timer_list
;
662 thread_data_t
*get_thread_data(BOOL
);
663 HWND
get_thread_hwnd(void);
664 void push_task(task_t
*);
665 void remove_doc_tasks(const HTMLDocument
*);
666 DWORD
set_task_timer(HTMLDocument
*,DWORD
,BOOL
,IDispatch
*);
667 HRESULT
clear_task_timer(HTMLDocument
*,BOOL
,DWORD
);
669 HRESULT
get_typeinfo(tid_t
,ITypeInfo
**);
670 void release_typelib(void);
671 void call_disp_func(HTMLDocument
*,IDispatch
*);
673 const char *debugstr_variant(const VARIANT
*);
675 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
676 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
677 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
678 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
679 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
681 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
683 extern LONG module_ref
;
684 #define LOCK_MODULE() InterlockedIncrement(&module_ref)
685 #define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
687 /* memory allocation functions */
689 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len
)
691 return HeapAlloc(GetProcessHeap(), 0, len
);
694 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len
)
696 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
699 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem
, size_t len
)
701 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
704 static inline BOOL
heap_free(void *mem
)
706 return HeapFree(GetProcessHeap(), 0, mem
);
709 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
716 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
717 ret
= heap_alloc(size
);
718 memcpy(ret
, str
, size
);
724 static inline char *heap_strdupA(const char *str
)
731 size
= strlen(str
)+1;
732 ret
= heap_alloc(size
);
733 memcpy(ret
, str
, size
);
739 static inline WCHAR
*heap_strdupAtoW(const char *str
)
746 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
747 ret
= heap_alloc(len
*sizeof(WCHAR
));
748 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
754 static inline char *heap_strdupWtoA(LPCWSTR str
)
759 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
760 ret
= heap_alloc(size
);
761 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
767 HINSTANCE
get_shdoclc(void);
769 extern HINSTANCE hInst
;