TESTING -- override pthreads to fix gstreamer v5
[wine/multimedia.git] / dlls / mshtml / mshtml_private.h
blobc32824e385ed33c4388a6d722b927d6913ef7835
1 /*
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
19 #include "wingdi.h"
20 #include "docobj.h"
21 #include "docobjectservice.h"
22 #include "comcat.h"
23 #include "mshtml.h"
24 #include "mshtmhst.h"
25 #include "hlink.h"
26 #include "perhist.h"
27 #include "dispex.h"
28 #include "objsafe.h"
29 #include "htiframe.h"
30 #include "tlogstg.h"
31 #include "shdeprecated.h"
33 #include "wine/list.h"
34 #include "wine/unicode.h"
36 #ifdef INIT_GUID
37 #include "initguid.h"
38 #endif
40 #include "nsiface.h"
42 #define NS_ERROR_GENERATE_FAILURE(module,code) \
43 ((nsresult) (((UINT32)(1u<<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))
64 #define NSAPI WINAPI
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;
73 #define TID_LIST \
74 XIID(NULL) \
75 XDIID(DispCEventObj) \
76 XDIID(DispCPlugins) \
77 XDIID(DispDOMChildrenCollection) \
78 XDIID(DispHTMLAnchorElement) \
79 XDIID(DispHTMLAreaElement) \
80 XDIID(DispHTMLAttributeCollection) \
81 XDIID(DispHTMLBody) \
82 XDIID(DispHTMLButtonElement) \
83 XDIID(DispHTMLCommentElement) \
84 XDIID(DispHTMLCurrentStyle) \
85 XDIID(DispHTMLDocument) \
86 XDIID(DispHTMLDOMAttribute) \
87 XDIID(DispHTMLDOMTextNode) \
88 XDIID(DispHTMLElementCollection) \
89 XDIID(DispHTMLEmbed) \
90 XDIID(DispHTMLFormElement) \
91 XDIID(DispHTMLGenericElement) \
92 XDIID(DispHTMLFrameElement) \
93 XDIID(DispHTMLHeadElement) \
94 XDIID(DispHTMLHistory) \
95 XDIID(DispHTMLIFrame) \
96 XDIID(DispHTMLImg) \
97 XDIID(DispHTMLInputElement) \
98 XDIID(DispHTMLLabelElement) \
99 XDIID(DispHTMLLinkElement) \
100 XDIID(DispHTMLLocation) \
101 XDIID(DispHTMLMetaElement) \
102 XDIID(DispHTMLNavigator) \
103 XDIID(DispHTMLObjectElement) \
104 XDIID(DispHTMLOptionElement) \
105 XDIID(DispHTMLScreen) \
106 XDIID(DispHTMLScriptElement) \
107 XDIID(DispHTMLSelectElement) \
108 XDIID(DispHTMLStyle) \
109 XDIID(DispHTMLStyleElement) \
110 XDIID(DispHTMLStyleSheet) \
111 XDIID(DispHTMLStyleSheetRulesCollection) \
112 XDIID(DispHTMLStyleSheetsCollection) \
113 XDIID(DispHTMLTable) \
114 XDIID(DispHTMLTableCell) \
115 XDIID(DispHTMLTableRow) \
116 XDIID(DispHTMLTextAreaElement) \
117 XDIID(DispHTMLTitleElement) \
118 XDIID(DispHTMLUnknownElement) \
119 XDIID(DispHTMLWindow2) \
120 XDIID(DispHTMLXMLHttpRequest) \
121 XDIID(HTMLDocumentEvents) \
122 XDIID(HTMLElementEvents2) \
123 XIID(IHTMLAnchorElement) \
124 XIID(IHTMLAreaElement) \
125 XIID(IHTMLAttributeCollection) \
126 XIID(IHTMLAttributeCollection2) \
127 XIID(IHTMLAttributeCollection3) \
128 XIID(IHTMLBodyElement) \
129 XIID(IHTMLBodyElement2) \
130 XIID(IHTMLButtonElement) \
131 XIID(IHTMLCommentElement) \
132 XIID(IHTMLCurrentStyle) \
133 XIID(IHTMLCurrentStyle2) \
134 XIID(IHTMLCurrentStyle3) \
135 XIID(IHTMLCurrentStyle4) \
136 XIID(IHTMLDocument2) \
137 XIID(IHTMLDocument3) \
138 XIID(IHTMLDocument4) \
139 XIID(IHTMLDocument5) \
140 XIID(IHTMLDOMAttribute) \
141 XIID(IHTMLDOMAttribute2) \
142 XIID(IHTMLDOMChildrenCollection) \
143 XIID(IHTMLDOMImplementation) \
144 XIID(IHTMLDOMNode) \
145 XIID(IHTMLDOMNode2) \
146 XIID(IHTMLDOMTextNode) \
147 XIID(IHTMLDOMTextNode2) \
148 XIID(IHTMLElement) \
149 XIID(IHTMLElement2) \
150 XIID(IHTMLElement3) \
151 XIID(IHTMLElement4) \
152 XIID(IHTMLElementCollection) \
153 XIID(IHTMLEmbedElement) \
154 XIID(IHTMLEventObj) \
155 XIID(IHTMLFiltersCollection) \
156 XIID(IHTMLFormElement) \
157 XIID(IHTMLFrameBase) \
158 XIID(IHTMLFrameBase2) \
159 XIID(IHTMLFrameElement3) \
160 XIID(IHTMLGenericElement) \
161 XIID(IHTMLHeadElement) \
162 XIID(IHTMLIFrameElement) \
163 XIID(IHTMLIFrameElement2) \
164 XIID(IHTMLIFrameElement3) \
165 XIID(IHTMLImageElementFactory) \
166 XIID(IHTMLImgElement) \
167 XIID(IHTMLInputElement) \
168 XIID(IHTMLLabelElement) \
169 XIID(IHTMLLinkElement) \
170 XIID(IHTMLLocation) \
171 XIID(IHTMLMetaElement) \
172 XIID(IHTMLMimeTypesCollection) \
173 XIID(IHTMLObjectElement) \
174 XIID(IHTMLObjectElement2) \
175 XIID(IHTMLOptionElement) \
176 XIID(IHTMLOptionElementFactory) \
177 XIID(IHTMLPluginsCollection) \
178 XIID(IHTMLRect) \
179 XIID(IHTMLScreen) \
180 XIID(IHTMLScriptElement) \
181 XIID(IHTMLSelectElement) \
182 XIID(IHTMLSelectionObject) \
183 XIID(IHTMLSelectionObject2) \
184 XIID(IHTMLStorage) \
185 XIID(IHTMLStyle) \
186 XIID(IHTMLStyle2) \
187 XIID(IHTMLStyle3) \
188 XIID(IHTMLStyle4) \
189 XIID(IHTMLStyle5) \
190 XIID(IHTMLStyle6) \
191 XIID(IHTMLStyleElement) \
192 XIID(IHTMLStyleSheet) \
193 XIID(IHTMLStyleSheetRulesCollection) \
194 XIID(IHTMLStyleSheetsCollection) \
195 XIID(IHTMLTable) \
196 XIID(IHTMLTable2) \
197 XIID(IHTMLTable3) \
198 XIID(IHTMLTableCell) \
199 XIID(IHTMLTableRow) \
200 XIID(IHTMLTextAreaElement) \
201 XIID(IHTMLTextContainer) \
202 XIID(IHTMLTitleElement) \
203 XIID(IHTMLTxtRange) \
204 XIID(IHTMLUniqueName) \
205 XIID(IHTMLWindow2) \
206 XIID(IHTMLWindow3) \
207 XIID(IHTMLWindow4) \
208 XIID(IHTMLWindow5) \
209 XIID(IHTMLWindow6) \
210 XIID(IHTMLXMLHttpRequest) \
211 XIID(IHTMLXMLHttpRequestFactory) \
212 XIID(IOmHistory) \
213 XIID(IOmNavigator)
215 typedef enum {
216 #define XIID(iface) iface ## _tid,
217 #define XDIID(iface) iface ## _tid,
218 TID_LIST
219 #undef XIID
220 #undef XDIID
221 LAST_tid
222 } tid_t;
224 typedef struct dispex_data_t dispex_data_t;
225 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
227 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
228 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
229 #define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
231 typedef struct DispatchEx DispatchEx;
233 typedef struct {
234 HRESULT (*value)(DispatchEx*,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
235 HRESULT (*get_dispid)(DispatchEx*,BSTR,DWORD,DISPID*);
236 HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
237 HRESULT (*populate_props)(DispatchEx*);
238 /* We abuse this vtbl for EventTarget functions to avoid separated vtbl. */
239 event_target_t **(*get_event_target_ptr)(DispatchEx*);
240 void (*bind_event)(DispatchEx*,int);
241 } dispex_static_data_vtbl_t;
243 typedef struct {
244 const dispex_static_data_vtbl_t *vtbl;
245 const tid_t disp_tid;
246 dispex_data_t *data;
247 const tid_t* const iface_tids;
248 } dispex_static_data_t;
250 struct DispatchEx {
251 IDispatchEx IDispatchEx_iface;
253 IUnknown *outer;
255 dispex_static_data_t *data;
256 dispex_dynamic_data_t *dynamic_data;
259 typedef struct {
260 UINT_PTR x;
261 } nsCycleCollectingAutoRefCnt;
263 typedef struct {
264 void *vtbl;
265 int ref_flags;
266 void *callbacks;
267 } ExternalCycleCollectionParticipant;
269 typedef struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback;
271 typedef struct {
272 nsresult (NSAPI *traverse)(void*,void*,nsCycleCollectionTraversalCallback*);
273 nsresult (NSAPI *unlink)(void*);
274 void (NSAPI *delete_cycle_collectable)(void*);
275 } CCObjCallback;
277 DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9);
279 nsrefcnt (__cdecl *ccref_incr)(nsCycleCollectingAutoRefCnt*,nsISupports*) DECLSPEC_HIDDEN;
280 nsrefcnt (__cdecl *ccref_decr)(nsCycleCollectingAutoRefCnt*,nsISupports*,ExternalCycleCollectionParticipant*) DECLSPEC_HIDDEN;
281 void (__cdecl *ccref_init)(nsCycleCollectingAutoRefCnt*,nsrefcnt) DECLSPEC_HIDDEN;
282 void (__cdecl *ccp_init)(ExternalCycleCollectionParticipant*,const CCObjCallback*) DECLSPEC_HIDDEN;
283 void (__cdecl *describe_cc_node)(nsCycleCollectingAutoRefCnt*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN;
284 void (__cdecl *note_cc_edge)(nsISupports*,const char*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN;
286 void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*) DECLSPEC_HIDDEN;
287 void release_dispex(DispatchEx*) DECLSPEC_HIDDEN;
288 BOOL dispex_query_interface(DispatchEx*,REFIID,void**) DECLSPEC_HIDDEN;
289 HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**) DECLSPEC_HIDDEN;
290 HRESULT get_dispids(tid_t,DWORD*,DISPID**) DECLSPEC_HIDDEN;
291 HRESULT remove_attribute(DispatchEx*,DISPID,VARIANT_BOOL*) DECLSPEC_HIDDEN;
292 HRESULT dispex_get_dynid(DispatchEx*,const WCHAR*,DISPID*) DECLSPEC_HIDDEN;
293 void dispex_traverse(DispatchEx*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN;
294 void dispex_unlink(DispatchEx*) DECLSPEC_HIDDEN;
295 void release_typelib(void) DECLSPEC_HIDDEN;
296 HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
298 typedef enum {
299 DISPEXPROP_CUSTOM,
300 DISPEXPROP_DYNAMIC,
301 DISPEXPROP_BUILTIN
302 } dispex_prop_type_t;
304 dispex_prop_type_t get_dispid_type(DISPID) DECLSPEC_HIDDEN;
306 typedef struct HTMLWindow HTMLWindow;
307 typedef struct HTMLInnerWindow HTMLInnerWindow;
308 typedef struct HTMLOuterWindow HTMLOuterWindow;
309 typedef struct HTMLDocumentNode HTMLDocumentNode;
310 typedef struct HTMLDocumentObj HTMLDocumentObj;
311 typedef struct HTMLFrameBase HTMLFrameBase;
312 typedef struct NSContainer NSContainer;
313 typedef struct HTMLAttributeCollection HTMLAttributeCollection;
315 typedef enum {
316 SCRIPTMODE_GECKO,
317 SCRIPTMODE_ACTIVESCRIPT
318 } SCRIPTMODE;
320 typedef struct ScriptHost ScriptHost;
322 typedef enum {
323 GLOBAL_SCRIPTVAR,
324 GLOBAL_ELEMENTVAR,
325 GLOBAL_DISPEXVAR,
326 GLOBAL_FRAMEVAR
327 } global_prop_type_t;
329 typedef struct {
330 global_prop_type_t type;
331 WCHAR *name;
332 ScriptHost *script_host;
333 DISPID id;
334 } global_prop_t;
336 typedef struct {
337 DispatchEx dispex;
338 event_target_t *ptr;
339 } EventTarget;
341 typedef struct {
342 DispatchEx dispex;
343 IHTMLOptionElementFactory IHTMLOptionElementFactory_iface;
345 LONG ref;
347 HTMLInnerWindow *window;
348 } HTMLOptionElementFactory;
350 typedef struct {
351 DispatchEx dispex;
352 IHTMLImageElementFactory IHTMLImageElementFactory_iface;
354 LONG ref;
356 HTMLInnerWindow *window;
357 } HTMLImageElementFactory;
359 typedef struct {
360 DispatchEx dispex;
361 IHTMLXMLHttpRequestFactory IHTMLXMLHttpRequestFactory_iface;
363 LONG ref;
365 HTMLInnerWindow *window;
366 } HTMLXMLHttpRequestFactory;
368 struct HTMLLocation {
369 DispatchEx dispex;
370 IHTMLLocation IHTMLLocation_iface;
372 LONG ref;
374 HTMLInnerWindow *window;
377 typedef struct {
378 DispatchEx dispex;
379 IOmHistory IOmHistory_iface;
381 LONG ref;
383 HTMLInnerWindow *window;
384 } OmHistory;
386 typedef struct {
387 HTMLOuterWindow *window;
388 LONG ref;
389 } windowref_t;
391 typedef struct nsChannelBSC nsChannelBSC;
393 struct HTMLWindow {
394 IHTMLWindow2 IHTMLWindow2_iface;
395 IHTMLWindow3 IHTMLWindow3_iface;
396 IHTMLWindow4 IHTMLWindow4_iface;
397 IHTMLWindow5 IHTMLWindow5_iface;
398 IHTMLWindow6 IHTMLWindow6_iface;
399 IHTMLPrivateWindow IHTMLPrivateWindow_iface;
400 IDispatchEx IDispatchEx_iface;
401 IServiceProvider IServiceProvider_iface;
402 ITravelLogClient ITravelLogClient_iface;
403 IObjectIdentity IObjectIdentity_iface;
405 LONG ref;
407 HTMLInnerWindow *inner_window;
408 HTMLOuterWindow *outer_window;
411 struct HTMLOuterWindow {
412 HTMLWindow base;
414 windowref_t *window_ref;
415 LONG task_magic;
417 HTMLDocumentObj *doc_obj;
418 nsIDOMWindow *nswindow;
419 HTMLOuterWindow *parent;
420 HTMLFrameBase *frame_element;
422 READYSTATE readystate;
423 BOOL readystate_locked;
424 unsigned readystate_pending;
426 HTMLInnerWindow *pending_window;
427 IMoniker *mon;
428 IUri *uri;
429 IUri *uri_nofrag;
430 BSTR url;
431 DWORD load_flags;
433 SCRIPTMODE scriptmode;
435 IInternetSecurityManager *secmgr;
437 struct list children;
438 struct list sibling_entry;
439 struct list entry;
442 struct HTMLInnerWindow {
443 HTMLWindow base;
444 EventTarget event_target;
446 HTMLDocumentNode *doc;
448 struct list script_hosts;
450 IHTMLEventObj *event;
452 HTMLImageElementFactory *image_factory;
453 HTMLOptionElementFactory *option_factory;
454 HTMLXMLHttpRequestFactory *xhr_factory;
455 IHTMLScreen *screen;
456 OmHistory *history;
457 IHTMLStorage *session_storage;
459 unsigned parser_callback_cnt;
460 struct list script_queue;
462 global_prop_t *global_props;
463 DWORD global_prop_cnt;
464 DWORD global_prop_size;
466 LONG task_magic;
468 HTMLLocation *location;
470 IMoniker *mon;
471 nsChannelBSC *bscallback;
472 struct list bindings;
475 typedef enum {
476 UNKNOWN_USERMODE,
477 BROWSEMODE,
478 EDITMODE
479 } USERMODE;
481 typedef struct _cp_static_data_t {
482 tid_t tid;
483 void (*on_advise)(IUnknown*,struct _cp_static_data_t*);
484 BOOL pass_event_arg;
485 DWORD id_cnt;
486 DISPID *ids;
487 } cp_static_data_t;
489 typedef struct {
490 const IID *riid;
491 cp_static_data_t *desc;
492 } cpc_entry_t;
494 typedef struct ConnectionPointContainer {
495 IConnectionPointContainer IConnectionPointContainer_iface;
497 ConnectionPoint *cps;
498 const cpc_entry_t *cp_entries;
499 IUnknown *outer;
500 struct ConnectionPointContainer *forward_container;
501 } ConnectionPointContainer;
503 struct ConnectionPoint {
504 IConnectionPoint IConnectionPoint_iface;
506 ConnectionPointContainer *container;
508 union {
509 IUnknown *unk;
510 IDispatch *disp;
511 IPropertyNotifySink *propnotif;
512 } *sinks;
513 DWORD sinks_size;
515 const IID *iid;
516 cp_static_data_t *data;
519 struct HTMLDocument {
520 IHTMLDocument2 IHTMLDocument2_iface;
521 IHTMLDocument3 IHTMLDocument3_iface;
522 IHTMLDocument4 IHTMLDocument4_iface;
523 IHTMLDocument5 IHTMLDocument5_iface;
524 IHTMLDocument6 IHTMLDocument6_iface;
525 IHTMLDocument7 IHTMLDocument7_iface;
526 IPersistMoniker IPersistMoniker_iface;
527 IPersistFile IPersistFile_iface;
528 IPersistHistory IPersistHistory_iface;
529 IMonikerProp IMonikerProp_iface;
530 IOleObject IOleObject_iface;
531 IOleDocument IOleDocument_iface;
532 IOleDocumentView IOleDocumentView_iface;
533 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
534 IViewObjectEx IViewObjectEx_iface;
535 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
536 IServiceProvider IServiceProvider_iface;
537 IOleCommandTarget IOleCommandTarget_iface;
538 IOleControl IOleControl_iface;
539 IHlinkTarget IHlinkTarget_iface;
540 IPersistStreamInit IPersistStreamInit_iface;
541 IDispatchEx IDispatchEx_iface;
542 ISupportErrorInfo ISupportErrorInfo_iface;
543 IObjectWithSite IObjectWithSite_iface;
544 IOleContainer IOleContainer_iface;
545 IObjectSafety IObjectSafety_iface;
546 IProvideClassInfo IProvideClassInfo_iface;
548 IUnknown *unk_impl;
549 IDispatchEx *dispex;
551 HTMLDocumentObj *doc_obj;
552 HTMLDocumentNode *doc_node;
554 HTMLOuterWindow *window;
556 LONG task_magic;
558 ConnectionPointContainer cp_container;
559 IOleAdviseHolder *advise_holder;
562 static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
564 return IUnknown_QueryInterface(This->unk_impl, riid, ppv);
567 static inline ULONG htmldoc_addref(HTMLDocument *This)
569 return IUnknown_AddRef(This->unk_impl);
572 static inline ULONG htmldoc_release(HTMLDocument *This)
574 return IUnknown_Release(This->unk_impl);
577 struct HTMLDocumentObj {
578 HTMLDocument basedoc;
579 DispatchEx dispex;
580 ICustomDoc ICustomDoc_iface;
581 ITargetContainer ITargetContainer_iface;
583 IWindowForBindingUI IWindowForBindingUI_iface;
585 LONG ref;
587 NSContainer *nscontainer;
589 IOleClientSite *client;
590 IDocHostUIHandler *hostui;
591 IOleCommandTarget *client_cmdtrg;
592 BOOL custom_hostui;
593 IOleInPlaceSite *ipsite;
594 IOleInPlaceFrame *frame;
595 IOleInPlaceUIWindow *ip_window;
596 IAdviseSink *view_sink;
597 IDocObjectService *doc_object_service;
598 IUnknown *webbrowser;
599 ITravelLog *travel_log;
600 IUnknown *browser_service;
602 DOCHOSTUIINFO hostinfo;
604 IOleUndoManager *undomgr;
605 IHTMLEditServices *editsvcs;
607 HWND hwnd;
608 HWND tooltips_hwnd;
610 BOOL request_uiactivate;
611 BOOL in_place_active;
612 BOOL ui_active;
613 BOOL window_active;
614 BOOL hostui_setup;
615 BOOL container_locked;
616 BOOL focus;
617 BOOL has_popup;
618 INT download_state;
620 USERMODE usermode;
621 LPWSTR mime;
623 DWORD update;
626 typedef struct nsWeakReference nsWeakReference;
628 struct NSContainer {
629 nsIWebBrowserChrome nsIWebBrowserChrome_iface;
630 nsIContextMenuListener nsIContextMenuListener_iface;
631 nsIURIContentListener nsIURIContentListener_iface;
632 nsIEmbeddingSiteWindow nsIEmbeddingSiteWindow_iface;
633 nsITooltipListener nsITooltipListener_iface;
634 nsIInterfaceRequestor nsIInterfaceRequestor_iface;
635 nsISupportsWeakReference nsISupportsWeakReference_iface;
637 nsIWebBrowser *webbrowser;
638 nsIWebNavigation *navigation;
639 nsIBaseWindow *window;
640 nsIWebBrowserFocus *focus;
642 nsIEditor *editor;
643 nsIController *editor_controller;
645 LONG ref;
647 nsWeakReference *weak_reference;
649 NSContainer *parent;
650 HTMLDocumentObj *doc;
652 nsIURIContentListener *content_listener;
654 HWND hwnd;
657 typedef struct {
658 HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
659 void (*destructor)(HTMLDOMNode*);
660 const cpc_entry_t *cpc_entries;
661 HRESULT (*clone)(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**);
662 HRESULT (*handle_event)(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*);
663 HRESULT (*get_attr_col)(HTMLDOMNode*,HTMLAttributeCollection**);
664 event_target_t **(*get_event_target_ptr)(HTMLDOMNode*);
665 HRESULT (*fire_event)(HTMLDOMNode*,DWORD,BOOL*);
666 HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
667 HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
668 HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
669 HRESULT (*get_readystate)(HTMLDOMNode*,BSTR*);
670 HRESULT (*get_dispid)(HTMLDOMNode*,BSTR,DWORD,DISPID*);
671 HRESULT (*invoke)(HTMLDOMNode*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
672 HRESULT (*bind_to_tree)(HTMLDOMNode*);
673 void (*traverse)(HTMLDOMNode*,nsCycleCollectionTraversalCallback*);
674 void (*unlink)(HTMLDOMNode*);
675 BOOL (*is_text_edit)(HTMLDOMNode*);
676 } NodeImplVtbl;
678 struct HTMLDOMNode {
679 EventTarget event_target;
680 IHTMLDOMNode IHTMLDOMNode_iface;
681 IHTMLDOMNode2 IHTMLDOMNode2_iface;
682 const NodeImplVtbl *vtbl;
684 nsCycleCollectingAutoRefCnt ccref;
686 nsIDOMNode *nsnode;
687 HTMLDocumentNode *doc;
688 ConnectionPointContainer *cp_container;
691 static inline void node_addref(HTMLDOMNode *node)
693 IHTMLDOMNode_AddRef(&node->IHTMLDOMNode_iface);
696 static inline void node_release(HTMLDOMNode *node)
698 IHTMLDOMNode_Release(&node->IHTMLDOMNode_iface);
701 typedef struct {
702 HTMLDOMNode node;
703 ConnectionPointContainer cp_container;
705 IHTMLElement IHTMLElement_iface;
706 IHTMLElement2 IHTMLElement2_iface;
707 IHTMLElement3 IHTMLElement3_iface;
708 IHTMLElement4 IHTMLElement4_iface;
710 nsIDOMHTMLElement *nselem;
711 HTMLStyle *style;
712 HTMLStyle *runtime_style;
713 HTMLAttributeCollection *attrs;
714 WCHAR *filter;
715 } HTMLElement;
717 #define HTMLELEMENT_TIDS \
718 IHTMLDOMNode_tid, \
719 IHTMLDOMNode2_tid, \
720 IHTMLElement_tid, \
721 IHTMLElement2_tid, \
722 IHTMLElement3_tid, \
723 IHTMLElement4_tid
725 extern cp_static_data_t HTMLElementEvents2_data DECLSPEC_HIDDEN;
726 #define HTMLELEMENT_CPC {&DIID_HTMLElementEvents2, &HTMLElementEvents2_data}
727 extern const cpc_entry_t HTMLElement_cpc[] DECLSPEC_HIDDEN;
729 typedef struct {
730 HTMLElement element;
732 IHTMLTextContainer IHTMLTextContainer_iface;
733 } HTMLTextContainer;
735 struct HTMLFrameBase {
736 HTMLElement element;
738 IHTMLFrameBase IHTMLFrameBase_iface;
739 IHTMLFrameBase2 IHTMLFrameBase2_iface;
741 HTMLOuterWindow *content_window;
743 nsIDOMHTMLFrameElement *nsframe;
744 nsIDOMHTMLIFrameElement *nsiframe;
747 typedef struct nsDocumentEventListener nsDocumentEventListener;
749 struct HTMLDocumentNode {
750 HTMLDOMNode node;
751 HTMLDocument basedoc;
753 IInternetHostSecurityManager IInternetHostSecurityManager_iface;
755 nsIDocumentObserver nsIDocumentObserver_iface;
757 LONG ref;
759 HTMLInnerWindow *window;
761 nsIDOMHTMLDocument *nsdoc;
762 BOOL content_ready;
763 event_target_t *body_event_target;
765 IHTMLDOMImplementation *dom_implementation;
767 ICatInformation *catmgr;
768 nsDocumentEventListener *nsevent_listener;
769 BOOL *event_vector;
771 WCHAR **elem_vars;
772 unsigned elem_vars_size;
773 unsigned elem_vars_cnt;
775 BOOL skip_mutation_notif;
777 UINT charset;
779 struct list selection_list;
780 struct list range_list;
781 struct list plugin_hosts;
784 HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
785 HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
786 HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLInnerWindow*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
788 HRESULT HTMLOuterWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
789 HRESULT update_window_doc(HTMLInnerWindow*) DECLSPEC_HIDDEN;
790 HTMLOuterWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
791 void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
792 HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactory**) DECLSPEC_HIDDEN;
793 HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,HTMLImageElementFactory**) DECLSPEC_HIDDEN;
794 HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,HTMLXMLHttpRequestFactory**) DECLSPEC_HIDDEN;
795 HRESULT HTMLLocation_Create(HTMLInnerWindow*,HTMLLocation**) DECLSPEC_HIDDEN;
796 IOmNavigator *OmNavigator_Create(void) DECLSPEC_HIDDEN;
797 HRESULT HTMLScreen_Create(IHTMLScreen**) DECLSPEC_HIDDEN;
798 HRESULT create_history(HTMLInnerWindow*,OmHistory**) DECLSPEC_HIDDEN;
799 HRESULT create_dom_implementation(IHTMLDOMImplementation**) DECLSPEC_HIDDEN;
801 HRESULT create_storage(IHTMLStorage**) DECLSPEC_HIDDEN;
803 void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN;
804 void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN;
805 void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN;
806 void HTMLDocument_View_Init(HTMLDocument*) DECLSPEC_HIDDEN;
807 void HTMLDocument_Window_Init(HTMLDocument*) DECLSPEC_HIDDEN;
808 void HTMLDocument_Service_Init(HTMLDocument*) DECLSPEC_HIDDEN;
809 void HTMLDocument_Hlink_Init(HTMLDocument*) DECLSPEC_HIDDEN;
811 void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
812 void init_binding_ui(HTMLDocumentObj*) DECLSPEC_HIDDEN;
814 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
816 HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**) DECLSPEC_HIDDEN;
818 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*,const cpc_entry_t*) DECLSPEC_HIDDEN;
819 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
821 HRESULT create_nscontainer(HTMLDocumentObj*,NSContainer**) DECLSPEC_HIDDEN;
822 void NSContainer_Release(NSContainer*) DECLSPEC_HIDDEN;
824 void init_mutation(nsIComponentManager*) DECLSPEC_HIDDEN;
825 void init_document_mutation(HTMLDocumentNode*) DECLSPEC_HIDDEN;
826 void release_document_mutation(HTMLDocumentNode*) DECLSPEC_HIDDEN;
827 JSContext *get_context_from_document(nsIDOMHTMLDocument*) DECLSPEC_HIDDEN;
829 void HTMLDocument_LockContainer(HTMLDocumentObj*,BOOL) DECLSPEC_HIDDEN;
830 void show_context_menu(HTMLDocumentObj*,DWORD,POINT*,IDispatch*) DECLSPEC_HIDDEN;
831 void notif_focus(HTMLDocumentObj*) DECLSPEC_HIDDEN;
833 void show_tooltip(HTMLDocumentObj*,DWORD,DWORD,LPCWSTR) DECLSPEC_HIDDEN;
834 void hide_tooltip(HTMLDocumentObj*) DECLSPEC_HIDDEN;
835 HRESULT get_client_disp_property(IOleClientSite*,DISPID,VARIANT*) DECLSPEC_HIDDEN;
837 UINT get_document_charset(HTMLDocumentNode*) DECLSPEC_HIDDEN;
839 HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**) DECLSPEC_HIDDEN;
841 BOOL load_gecko(void) DECLSPEC_HIDDEN;
842 void close_gecko(void) DECLSPEC_HIDDEN;
843 void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*) DECLSPEC_HIDDEN;
844 void init_nsio(nsIComponentManager*,nsIComponentRegistrar*) DECLSPEC_HIDDEN;
845 void release_nsio(void) DECLSPEC_HIDDEN;
846 BOOL is_gecko_path(const char*) DECLSPEC_HIDDEN;
847 void set_viewer_zoom(NSContainer*,float) DECLSPEC_HIDDEN;
849 void init_node_cc(void) DECLSPEC_HIDDEN;
851 HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*) DECLSPEC_HIDDEN;
853 HRESULT set_frame_doc(HTMLFrameBase*,nsIDOMDocument*) DECLSPEC_HIDDEN;
855 void call_property_onchanged(ConnectionPointContainer*,DISPID) DECLSPEC_HIDDEN;
856 HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*) DECLSPEC_HIDDEN;
858 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN;
859 void nsfree(void*) DECLSPEC_HIDDEN;
861 BOOL nsACString_Init(nsACString *str, const char *data) DECLSPEC_HIDDEN;
862 void nsACString_InitDepend(nsACString*,const char*) DECLSPEC_HIDDEN;
863 void nsACString_SetData(nsACString*,const char*) DECLSPEC_HIDDEN;
864 UINT32 nsACString_GetData(const nsACString*,const char**) DECLSPEC_HIDDEN;
865 void nsACString_Finish(nsACString*) DECLSPEC_HIDDEN;
867 BOOL nsAString_Init(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
868 void nsAString_InitDepend(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
869 UINT32 nsAString_GetData(const nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
870 void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN;
872 HRESULT return_nsstr(nsresult,nsAString*,BSTR*) DECLSPEC_HIDDEN;
874 static inline HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p)
876 V_VT(p) = VT_BSTR;
877 return return_nsstr(nsres, nsstr, &V_BSTR(p));
880 nsICommandParams *create_nscommand_params(void) DECLSPEC_HIDDEN;
881 HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN;
882 void get_editor_controller(NSContainer*) DECLSPEC_HIDDEN;
883 nsresult get_nsinterface(nsISupports*,REFIID,void**) DECLSPEC_HIDDEN;
884 nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN;
885 nsIXMLHttpRequest *create_nsxhr(nsIDOMWindow *nswindow) DECLSPEC_HIDDEN;
886 nsresult create_nsfile(const PRUnichar*,nsIFile**) DECLSPEC_HIDDEN;
887 char *get_nscategory_entry(const char*,const char*) DECLSPEC_HIDDEN;
889 HRESULT create_pending_window(HTMLOuterWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
890 HRESULT start_binding(HTMLInnerWindow*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
891 HRESULT async_start_doc_binding(HTMLOuterWindow*,HTMLInnerWindow*) DECLSPEC_HIDDEN;
892 void abort_window_bindings(HTMLInnerWindow*) DECLSPEC_HIDDEN;
893 void set_download_state(HTMLDocumentObj*,int) DECLSPEC_HIDDEN;
894 void call_docview_84(HTMLDocumentObj*) DECLSPEC_HIDDEN;
896 void set_ready_state(HTMLOuterWindow*,READYSTATE) DECLSPEC_HIDDEN;
897 HRESULT get_readystate_string(READYSTATE,BSTR*) DECLSPEC_HIDDEN;
899 HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**) DECLSPEC_HIDDEN;
900 HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**) DECLSPEC_HIDDEN;
901 IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*) DECLSPEC_HIDDEN;
902 IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*) DECLSPEC_HIDDEN;
904 void detach_selection(HTMLDocumentNode*) DECLSPEC_HIDDEN;
905 void detach_ranges(HTMLDocumentNode*) DECLSPEC_HIDDEN;
906 HRESULT get_node_text(HTMLDOMNode*,BSTR*) DECLSPEC_HIDDEN;
907 HRESULT replace_node_by_html(nsIDOMHTMLDocument*,nsIDOMNode*,const WCHAR*) DECLSPEC_HIDDEN;
909 HRESULT create_nselem(HTMLDocumentNode*,const WCHAR*,nsIDOMHTMLElement**) DECLSPEC_HIDDEN;
910 HRESULT create_element(HTMLDocumentNode*,const WCHAR*,HTMLElement**) DECLSPEC_HIDDEN;
912 HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
914 BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) DECLSPEC_HIDDEN;
915 HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) DECLSPEC_HIDDEN;
918 struct HTMLAttributeCollection {
919 DispatchEx dispex;
920 IHTMLAttributeCollection IHTMLAttributeCollection_iface;
921 IHTMLAttributeCollection2 IHTMLAttributeCollection2_iface;
922 IHTMLAttributeCollection3 IHTMLAttributeCollection3_iface;
924 LONG ref;
926 HTMLElement *elem;
927 struct list attrs;
930 typedef struct {
931 DispatchEx dispex;
932 IHTMLDOMAttribute IHTMLDOMAttribute_iface;
933 IHTMLDOMAttribute2 IHTMLDOMAttribute2_iface;
935 LONG ref;
937 WCHAR *name;
939 HTMLElement *elem;
940 DISPID dispid;
941 struct list entry;
942 } HTMLDOMAttribute;
944 HRESULT HTMLDOMAttribute_Create(const WCHAR*,HTMLElement*,DISPID,HTMLDOMAttribute**) DECLSPEC_HIDDEN;
946 HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**) DECLSPEC_HIDDEN;
947 HRESULT HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLElement**) DECLSPEC_HIDDEN;
948 HRESULT HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
949 HRESULT HTMLAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
950 HRESULT HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
951 HRESULT HTMLButtonElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
952 HRESULT HTMLEmbedElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
953 HRESULT HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
954 HRESULT HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
955 HRESULT HTMLHeadElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
956 HRESULT HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
957 HRESULT HTMLStyleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
958 HRESULT HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
959 HRESULT HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
960 HRESULT HTMLLabelElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
961 HRESULT HTMLLinkElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
962 HRESULT HTMLMetaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
963 HRESULT HTMLObjectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
964 HRESULT HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
965 HRESULT HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
966 HRESULT HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
967 HRESULT HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
968 HRESULT HTMLTableCell_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
969 HRESULT HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
970 HRESULT HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
971 HRESULT HTMLTitleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
972 HRESULT HTMLGenericElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
974 void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*) DECLSPEC_HIDDEN;
975 void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
976 void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
977 void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
979 HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
980 void HTMLDOMNode_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
982 HRESULT HTMLElement_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
983 void HTMLElement_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
984 HRESULT HTMLElement_clone(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
985 HRESULT HTMLElement_get_attr_col(HTMLDOMNode*,HTMLAttributeCollection**) DECLSPEC_HIDDEN;
986 HRESULT HTMLElement_handle_event(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*) DECLSPEC_HIDDEN;
988 HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**) DECLSPEC_HIDDEN;
989 void HTMLFrameBase_destructor(HTMLFrameBase*) DECLSPEC_HIDDEN;
991 HRESULT get_node(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLDOMNode**) DECLSPEC_HIDDEN;
992 HRESULT get_elem(HTMLDocumentNode*,nsIDOMElement*,HTMLElement**) DECLSPEC_HIDDEN;
994 HTMLElement *unsafe_impl_from_IHTMLElement(IHTMLElement*) DECLSPEC_HIDDEN;
996 HRESULT search_window_props(HTMLInnerWindow*,BSTR,DWORD,DISPID*) DECLSPEC_HIDDEN;
997 HRESULT get_frame_by_name(HTMLOuterWindow*,const WCHAR*,BOOL,HTMLOuterWindow**) DECLSPEC_HIDDEN;
998 HRESULT get_doc_elem_by_id(HTMLDocumentNode*,const WCHAR*,HTMLElement**) DECLSPEC_HIDDEN;
999 HTMLOuterWindow *get_target_window(HTMLOuterWindow*,nsAString*,BOOL*) DECLSPEC_HIDDEN;
1000 HRESULT handle_link_click_event(HTMLElement*,nsAString*,nsAString*,nsIDOMEvent*,BOOL*) DECLSPEC_HIDDEN;
1002 HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN;
1004 IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL) DECLSPEC_HIDDEN;
1005 IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,nsIDOMNodeList*) DECLSPEC_HIDDEN;
1006 IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode*,nsIDOMHTMLCollection*) DECLSPEC_HIDDEN;
1008 #define ATTRFLAG_CASESENSITIVE 0x0001
1009 #define ATTRFLAG_ASSTRING 0x0002
1010 #define ATTRFLAG_EXPANDURL 0x0004
1012 HRESULT get_elem_attr_value_by_dispid(HTMLElement*,DISPID,DWORD,VARIANT*) DECLSPEC_HIDDEN;
1013 HRESULT get_elem_source_index(HTMLElement*,LONG*) DECLSPEC_HIDDEN;
1015 nsresult get_elem_attr_value(nsIDOMHTMLElement*,const WCHAR*,nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
1016 HRESULT elem_string_attr_getter(HTMLElement*,const WCHAR*,BOOL,BSTR*) DECLSPEC_HIDDEN;
1017 HRESULT elem_string_attr_setter(HTMLElement*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
1019 /* commands */
1020 typedef struct {
1021 DWORD id;
1022 HRESULT (*query)(HTMLDocument*,OLECMD*);
1023 HRESULT (*exec)(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
1024 } cmdtable_t;
1026 extern const cmdtable_t editmode_cmds[] DECLSPEC_HIDDEN;
1028 void do_ns_command(HTMLDocument*,const char*,nsICommandParams*) DECLSPEC_HIDDEN;
1030 /* timer */
1031 #define UPDATE_UI 0x0001
1032 #define UPDATE_TITLE 0x0002
1034 void update_doc(HTMLDocument*,DWORD) DECLSPEC_HIDDEN;
1035 void update_title(HTMLDocumentObj*) DECLSPEC_HIDDEN;
1036 void set_document_navigation(HTMLDocumentObj*,BOOL) DECLSPEC_HIDDEN;
1038 HRESULT do_query_service(IUnknown*,REFGUID,REFIID,void**) DECLSPEC_HIDDEN;
1040 /* editor */
1041 HRESULT setup_edit_mode(HTMLDocumentObj*) DECLSPEC_HIDDEN;
1042 void init_editor(HTMLDocument*) DECLSPEC_HIDDEN;
1043 void handle_edit_event(HTMLDocument*,nsIDOMEvent*) DECLSPEC_HIDDEN;
1044 HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
1045 HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
1046 HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
1047 void handle_edit_load(HTMLDocument*) DECLSPEC_HIDDEN;
1048 HRESULT editor_is_dirty(HTMLDocument*) DECLSPEC_HIDDEN;
1049 void set_dirty(HTMLDocument*,VARIANT_BOOL) DECLSPEC_HIDDEN;
1051 extern DWORD mshtml_tls DECLSPEC_HIDDEN;
1053 typedef struct task_t task_t;
1054 typedef void (*task_proc_t)(task_t*);
1056 struct task_t {
1057 LONG target_magic;
1058 task_proc_t proc;
1059 task_proc_t destr;
1060 struct list entry;
1063 typedef struct {
1064 task_t header;
1065 HTMLDocumentObj *doc;
1066 } docobj_task_t;
1068 typedef struct {
1069 HWND thread_hwnd;
1070 struct list task_list;
1071 struct list timer_list;
1072 } thread_data_t;
1074 thread_data_t *get_thread_data(BOOL) DECLSPEC_HIDDEN;
1075 HWND get_thread_hwnd(void) DECLSPEC_HIDDEN;
1077 LONG get_task_target_magic(void) DECLSPEC_HIDDEN;
1078 HRESULT push_task(task_t*,task_proc_t,task_proc_t,LONG) DECLSPEC_HIDDEN;
1079 void remove_target_tasks(LONG) DECLSPEC_HIDDEN;
1080 void flush_pending_tasks(LONG) DECLSPEC_HIDDEN;
1082 HRESULT set_task_timer(HTMLInnerWindow*,DWORD,BOOL,IDispatch*,LONG*) DECLSPEC_HIDDEN;
1083 HRESULT clear_task_timer(HTMLInnerWindow*,BOOL,DWORD) DECLSPEC_HIDDEN;
1085 const char *debugstr_mshtml_guid(const GUID*) DECLSPEC_HIDDEN;
1087 DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1088 DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1089 DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1090 DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1091 DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
1093 DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
1095 DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
1097 DEFINE_GUID(CLSID_JScript, 0xf414c260,0x6ac0,0x11cf, 0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58);
1098 DEFINE_GUID(CLSID_VBScript, 0xb54f3741,0x5b07,0x11cf, 0xa4,0xb0,0x00,0xaa,0x00,0x4a,0x55,0xe8);
1100 DEFINE_GUID(IID_UndocumentedScriptIface,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa0);
1101 DEFINE_GUID(IID_IDispatchJS,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa6);
1103 /* memory allocation functions */
1105 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
1107 return HeapAlloc(GetProcessHeap(), 0, len);
1110 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
1112 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
1115 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len)
1117 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
1120 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
1122 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
1125 static inline BOOL heap_free(void *mem)
1127 return HeapFree(GetProcessHeap(), 0, mem);
1130 static inline LPWSTR heap_strdupW(LPCWSTR str)
1132 LPWSTR ret = NULL;
1134 if(str) {
1135 DWORD size;
1137 size = (strlenW(str)+1)*sizeof(WCHAR);
1138 ret = heap_alloc(size);
1139 if(ret)
1140 memcpy(ret, str, size);
1143 return ret;
1146 static inline LPWSTR heap_strndupW(LPCWSTR str, unsigned len)
1148 LPWSTR ret = NULL;
1150 if(str) {
1151 ret = heap_alloc((len+1)*sizeof(WCHAR));
1152 if(ret)
1154 memcpy(ret, str, len*sizeof(WCHAR));
1155 ret[len] = 0;
1159 return ret;
1162 static inline char *heap_strdupA(const char *str)
1164 char *ret = NULL;
1166 if(str) {
1167 DWORD size;
1169 size = strlen(str)+1;
1170 ret = heap_alloc(size);
1171 if(ret)
1172 memcpy(ret, str, size);
1175 return ret;
1178 static inline WCHAR *heap_strdupAtoW(const char *str)
1180 LPWSTR ret = NULL;
1182 if(str) {
1183 DWORD len;
1185 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
1186 ret = heap_alloc(len*sizeof(WCHAR));
1187 if(ret)
1188 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
1191 return ret;
1194 static inline char *heap_strdupWtoA(LPCWSTR str)
1196 char *ret = NULL;
1198 if(str) {
1199 DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
1200 ret = heap_alloc(size);
1201 if(ret)
1202 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
1205 return ret;
1208 static inline WCHAR *heap_strdupUtoW(const char *str)
1210 WCHAR *ret = NULL;
1212 if(str) {
1213 size_t len;
1215 len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
1216 ret = heap_alloc(len*sizeof(WCHAR));
1217 if(ret)
1218 MultiByteToWideChar(CP_UTF8, 0, str, -1, ret, len);
1221 return ret;
1224 static inline char *heap_strdupWtoU(const WCHAR *str)
1226 char *ret = NULL;
1228 if(str) {
1229 size_t size = WideCharToMultiByte(CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
1230 ret = heap_alloc(size);
1231 if(ret)
1232 WideCharToMultiByte(CP_UTF8, 0, str, -1, ret, size, NULL, NULL);
1235 return ret;
1238 static inline char *heap_strndupWtoU(LPCWSTR str, unsigned len)
1240 char *ret = NULL;
1241 DWORD size;
1243 if(str && len) {
1244 size = WideCharToMultiByte(CP_UTF8, 0, str, len, NULL, 0, NULL, NULL);
1245 ret = heap_alloc(size + 1);
1246 if(ret) {
1247 WideCharToMultiByte(CP_UTF8, 0, str, len, ret, size, NULL, NULL);
1248 ret[size] = '\0';
1252 return ret;
1255 static inline void windowref_addref(windowref_t *ref)
1257 InterlockedIncrement(&ref->ref);
1260 static inline void windowref_release(windowref_t *ref)
1262 if(!InterlockedDecrement(&ref->ref))
1263 heap_free(ref);
1266 UINT cp_from_charset_string(BSTR) DECLSPEC_HIDDEN;
1267 HDC get_display_dc(void) DECLSPEC_HIDDEN;
1268 HINSTANCE get_shdoclc(void) DECLSPEC_HIDDEN;
1269 void set_statustext(HTMLDocumentObj*,INT,LPCWSTR) DECLSPEC_HIDDEN;
1271 extern HINSTANCE hInst DECLSPEC_HIDDEN;