mshtml: Added IHTMLObjectElement2 stub implementation.
[wine.git] / dlls / mshtml / mshtml_private.h
blob697dcf3cd72a3046aa5f1eff5331ba57282d4038
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"
32 #include "wine/list.h"
33 #include "wine/unicode.h"
35 #ifdef INIT_GUID
36 #include "initguid.h"
37 #endif
39 #include "nsiface.h"
41 #define NS_ERROR_GENERATE_FAILURE(module,code) \
42 ((nsresult) (((PRUint32)(1<<31)) | ((PRUint32)(module+0x45)<<16) | ((PRUint32)(code))))
44 #define NS_OK ((nsresult)0x00000000L)
45 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
46 #define NS_ERROR_OUT_OF_MEMORY ((nsresult)0x8007000EL)
47 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
48 #define NS_NOINTERFACE ((nsresult)0x80004002L)
49 #define NS_ERROR_INVALID_POINTER ((nsresult)0x80004003L)
50 #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
51 #define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
52 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
53 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
55 #define NS_ERROR_MODULE_NETWORK 6
57 #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
58 #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
60 #define NS_FAILED(res) ((res) & 0x80000000)
61 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
63 #define NSAPI WINAPI
65 #define MSHTML_E_NODOC 0x800a025c
67 typedef struct HTMLDOMNode HTMLDOMNode;
68 typedef struct ConnectionPoint ConnectionPoint;
69 typedef struct BSCallback BSCallback;
70 typedef struct event_target_t event_target_t;
72 #define TID_LIST \
73 XIID(NULL) \
74 XDIID(DispCEventObj) \
75 XDIID(DispCPlugins) \
76 XDIID(DispDOMChildrenCollection) \
77 XDIID(DispHTMLAnchorElement) \
78 XDIID(DispHTMLAttributeCollection) \
79 XDIID(DispHTMLBody) \
80 XDIID(DispHTMLCommentElement) \
81 XDIID(DispHTMLCurrentStyle) \
82 XDIID(DispHTMLDocument) \
83 XDIID(DispHTMLDOMAttribute) \
84 XDIID(DispHTMLDOMTextNode) \
85 XDIID(DispHTMLElementCollection) \
86 XDIID(DispHTMLEmbed) \
87 XDIID(DispHTMLFormElement) \
88 XDIID(DispHTMLGenericElement) \
89 XDIID(DispHTMLFrameElement) \
90 XDIID(DispHTMLHeadElement) \
91 XDIID(DispHTMLIFrame) \
92 XDIID(DispHTMLImg) \
93 XDIID(DispHTMLInputElement) \
94 XDIID(DispHTMLLocation) \
95 XDIID(DispHTMLNavigator) \
96 XDIID(DispHTMLObjectElement) \
97 XDIID(DispHTMLOptionElement) \
98 XDIID(DispHTMLScreen) \
99 XDIID(DispHTMLScriptElement) \
100 XDIID(DispHTMLSelectElement) \
101 XDIID(DispHTMLStyle) \
102 XDIID(DispHTMLStyleElement) \
103 XDIID(DispHTMLStyleSheetsCollection) \
104 XDIID(DispHTMLTable) \
105 XDIID(DispHTMLTableRow) \
106 XDIID(DispHTMLTextAreaElement) \
107 XDIID(DispHTMLTitleElement) \
108 XDIID(DispHTMLUnknownElement) \
109 XDIID(DispHTMLWindow2) \
110 XDIID(HTMLDocumentEvents) \
111 XIID(IHTMLAnchorElement) \
112 XIID(IHTMLAttributeCollection) \
113 XIID(IHTMLAttributeCollection2) \
114 XIID(IHTMLAttributeCollection3) \
115 XIID(IHTMLBodyElement) \
116 XIID(IHTMLBodyElement2) \
117 XIID(IHTMLCommentElement) \
118 XIID(IHTMLCurrentStyle) \
119 XIID(IHTMLCurrentStyle2) \
120 XIID(IHTMLCurrentStyle3) \
121 XIID(IHTMLCurrentStyle4) \
122 XIID(IHTMLDocument2) \
123 XIID(IHTMLDocument3) \
124 XIID(IHTMLDocument4) \
125 XIID(IHTMLDocument5) \
126 XIID(IHTMLDOMAttribute) \
127 XIID(IHTMLDOMChildrenCollection) \
128 XIID(IHTMLDOMNode) \
129 XIID(IHTMLDOMNode2) \
130 XIID(IHTMLDOMTextNode) \
131 XIID(IHTMLElement) \
132 XIID(IHTMLElement2) \
133 XIID(IHTMLElement3) \
134 XIID(IHTMLElement4) \
135 XIID(IHTMLElementCollection) \
136 XIID(IHTMLEmbedElement) \
137 XIID(IHTMLEventObj) \
138 XIID(IHTMLFiltersCollection) \
139 XIID(IHTMLFormElement) \
140 XIID(IHTMLFrameBase) \
141 XIID(IHTMLFrameBase2) \
142 XIID(IHTMLFrameElement3) \
143 XIID(IHTMLGenericElement) \
144 XIID(IHTMLHeadElement) \
145 XIID(IHTMLIFrameElement) \
146 XIID(IHTMLImageElementFactory) \
147 XIID(IHTMLImgElement) \
148 XIID(IHTMLInputElement) \
149 XIID(IHTMLLocation) \
150 XIID(IHTMLMimeTypesCollection) \
151 XIID(IHTMLObjectElement) \
152 XIID(IHTMLObjectElement2) \
153 XIID(IHTMLOptionElement) \
154 XIID(IHTMLPluginsCollection) \
155 XIID(IHTMLRect) \
156 XIID(IHTMLScreen) \
157 XIID(IHTMLScriptElement) \
158 XIID(IHTMLSelectElement) \
159 XIID(IHTMLStyle) \
160 XIID(IHTMLStyle2) \
161 XIID(IHTMLStyle3) \
162 XIID(IHTMLStyle4) \
163 XIID(IHTMLStyle5) \
164 XIID(IHTMLStyle6) \
165 XIID(IHTMLStyleElement) \
166 XIID(IHTMLStyleSheetsCollection) \
167 XIID(IHTMLTable) \
168 XIID(IHTMLTable2) \
169 XIID(IHTMLTable3) \
170 XIID(IHTMLTableRow) \
171 XIID(IHTMLTextAreaElement) \
172 XIID(IHTMLTextContainer) \
173 XIID(IHTMLTitleElement) \
174 XIID(IHTMLUniqueName) \
175 XIID(IHTMLWindow2) \
176 XIID(IHTMLWindow3) \
177 XIID(IHTMLWindow4) \
178 XIID(IHTMLWindow6) \
179 XIID(IOmNavigator)
181 typedef enum {
182 #define XIID(iface) iface ## _tid,
183 #define XDIID(iface) iface ## _tid,
184 TID_LIST
185 #undef XIID
186 #undef XDIID
187 LAST_tid
188 } tid_t;
190 typedef struct dispex_data_t dispex_data_t;
191 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
193 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
194 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
195 #define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
197 typedef struct DispatchEx DispatchEx;
199 typedef struct {
200 HRESULT (*value)(DispatchEx*,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
201 HRESULT (*get_dispid)(DispatchEx*,BSTR,DWORD,DISPID*);
202 HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
203 HRESULT (*populate_props)(DispatchEx*);
204 } dispex_static_data_vtbl_t;
206 typedef struct {
207 const dispex_static_data_vtbl_t *vtbl;
208 const tid_t disp_tid;
209 dispex_data_t *data;
210 const tid_t* const iface_tids;
211 } dispex_static_data_t;
213 struct DispatchEx {
214 IDispatchEx IDispatchEx_iface;
216 IUnknown *outer;
218 dispex_static_data_t *data;
219 dispex_dynamic_data_t *dynamic_data;
222 void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*) DECLSPEC_HIDDEN;
223 void release_dispex(DispatchEx*) DECLSPEC_HIDDEN;
224 BOOL dispex_query_interface(DispatchEx*,REFIID,void**) DECLSPEC_HIDDEN;
225 HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**) DECLSPEC_HIDDEN;
226 HRESULT get_dispids(tid_t,DWORD*,DISPID**) DECLSPEC_HIDDEN;
227 HRESULT remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*) DECLSPEC_HIDDEN;
228 void release_typelib(void) DECLSPEC_HIDDEN;
229 HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
231 typedef struct HTMLWindow HTMLWindow;
232 typedef struct HTMLDocumentNode HTMLDocumentNode;
233 typedef struct HTMLDocumentObj HTMLDocumentObj;
234 typedef struct HTMLFrameBase HTMLFrameBase;
235 typedef struct NSContainer NSContainer;
236 typedef struct HTMLAttributeCollection HTMLAttributeCollection;
238 typedef enum {
239 SCRIPTMODE_GECKO,
240 SCRIPTMODE_ACTIVESCRIPT
241 } SCRIPTMODE;
243 typedef struct ScriptHost ScriptHost;
245 typedef enum {
246 GLOBAL_SCRIPTVAR,
247 GLOBAL_ELEMENTVAR
248 } global_prop_type_t;
250 typedef struct {
251 global_prop_type_t type;
252 WCHAR *name;
253 ScriptHost *script_host;
254 DISPID id;
255 } global_prop_t;
257 typedef struct {
258 IHTMLOptionElementFactory IHTMLOptionElementFactory_iface;
260 LONG ref;
262 HTMLWindow *window;
263 } HTMLOptionElementFactory;
265 typedef struct {
266 DispatchEx dispex;
267 IHTMLImageElementFactory IHTMLImageElementFactory_iface;
269 LONG ref;
271 HTMLWindow *window;
272 } HTMLImageElementFactory;
274 struct HTMLLocation {
275 DispatchEx dispex;
276 IHTMLLocation IHTMLLocation_iface;
278 LONG ref;
280 HTMLWindow *window;
283 typedef struct {
284 HTMLWindow *window;
285 LONG ref;
286 } windowref_t;
288 typedef struct nsChannelBSC nsChannelBSC;
290 struct HTMLWindow {
291 DispatchEx dispex;
292 IHTMLWindow2 IHTMLWindow2_iface;
293 IHTMLWindow3 IHTMLWindow3_iface;
294 IHTMLWindow4 IHTMLWindow4_iface;
295 IHTMLWindow5 IHTMLWindow5_iface;
296 IHTMLWindow6 IHTMLWindow6_iface;
297 IHTMLPrivateWindow IHTMLPrivateWindow_iface;
298 IDispatchEx IDispatchEx_iface;
299 IServiceProvider IServiceProvider_iface;
300 ITravelLogClient ITravelLogClient_iface;
302 LONG ref;
304 windowref_t *window_ref;
305 LONG task_magic;
307 HTMLDocumentNode *doc;
308 HTMLDocumentObj *doc_obj;
309 nsIDOMWindow *nswindow;
310 HTMLWindow *parent;
311 HTMLFrameBase *frame_element;
312 READYSTATE readystate;
314 nsChannelBSC *bscallback;
315 IMoniker *mon;
316 IUri *uri;
317 BSTR url;
319 IHTMLEventObj *event;
321 SCRIPTMODE scriptmode;
322 struct list script_hosts;
324 IInternetSecurityManager *secmgr;
326 HTMLOptionElementFactory *option_factory;
327 HTMLImageElementFactory *image_factory;
328 HTMLLocation *location;
329 IHTMLScreen *screen;
331 global_prop_t *global_props;
332 DWORD global_prop_cnt;
333 DWORD global_prop_size;
335 struct list children;
336 struct list sibling_entry;
337 struct list entry;
340 typedef enum {
341 UNKNOWN_USERMODE,
342 BROWSEMODE,
343 EDITMODE
344 } USERMODE;
346 typedef struct _cp_static_data_t {
347 tid_t tid;
348 void (*on_advise)(IUnknown*,struct _cp_static_data_t*);
349 DWORD id_cnt;
350 DISPID *ids;
351 } cp_static_data_t;
353 typedef struct ConnectionPointContainer {
354 IConnectionPointContainer IConnectionPointContainer_iface;
356 ConnectionPoint *cp_list;
357 IUnknown *outer;
358 struct ConnectionPointContainer *forward_container;
359 } ConnectionPointContainer;
361 struct ConnectionPoint {
362 IConnectionPoint IConnectionPoint_iface;
364 ConnectionPointContainer *container;
366 union {
367 IUnknown *unk;
368 IDispatch *disp;
369 IPropertyNotifySink *propnotif;
370 } *sinks;
371 DWORD sinks_size;
373 const IID *iid;
374 cp_static_data_t *data;
376 ConnectionPoint *next;
379 struct HTMLDocument {
380 IHTMLDocument2 IHTMLDocument2_iface;
381 IHTMLDocument3 IHTMLDocument3_iface;
382 IHTMLDocument4 IHTMLDocument4_iface;
383 IHTMLDocument5 IHTMLDocument5_iface;
384 IHTMLDocument6 IHTMLDocument6_iface;
385 IPersistMoniker IPersistMoniker_iface;
386 IPersistFile IPersistFile_iface;
387 IPersistHistory IPersistHistory_iface;
388 IMonikerProp IMonikerProp_iface;
389 IOleObject IOleObject_iface;
390 IOleDocument IOleDocument_iface;
391 IOleDocumentView IOleDocumentView_iface;
392 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
393 IViewObjectEx IViewObjectEx_iface;
394 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
395 IServiceProvider IServiceProvider_iface;
396 IOleCommandTarget IOleCommandTarget_iface;
397 IOleControl IOleControl_iface;
398 IHlinkTarget IHlinkTarget_iface;
399 IPersistStreamInit IPersistStreamInit_iface;
400 IDispatchEx IDispatchEx_iface;
401 ISupportErrorInfo ISupportErrorInfo_iface;
402 IObjectWithSite IObjectWithSite_iface;
403 IOleContainer IOleContainer_iface;
404 IObjectSafety IObjectSafety_iface;
405 IProvideClassInfo IProvideClassInfo_iface;
407 IUnknown *unk_impl;
408 IDispatchEx *dispex;
410 HTMLDocumentObj *doc_obj;
411 HTMLDocumentNode *doc_node;
413 HTMLWindow *window;
415 LONG task_magic;
417 ConnectionPointContainer cp_container;
418 ConnectionPoint cp_htmldocevents;
419 ConnectionPoint cp_htmldocevents2;
420 ConnectionPoint cp_propnotif;
421 ConnectionPoint cp_dispatch;
423 IOleAdviseHolder *advise_holder;
426 static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
428 return IUnknown_QueryInterface(This->unk_impl, riid, ppv);
431 static inline ULONG htmldoc_addref(HTMLDocument *This)
433 return IUnknown_AddRef(This->unk_impl);
436 static inline ULONG htmldoc_release(HTMLDocument *This)
438 return IUnknown_Release(This->unk_impl);
441 struct HTMLDocumentObj {
442 HTMLDocument basedoc;
443 DispatchEx dispex;
444 ICustomDoc ICustomDoc_iface;
445 ITargetContainer ITargetContainer_iface;
447 LONG ref;
449 NSContainer *nscontainer;
451 IOleClientSite *client;
452 IDocHostUIHandler *hostui;
453 BOOL custom_hostui;
454 IOleInPlaceSite *ipsite;
455 IOleInPlaceFrame *frame;
456 IOleInPlaceUIWindow *ip_window;
457 IAdviseSink *view_sink;
458 IDocObjectService *doc_object_service;
460 DOCHOSTUIINFO hostinfo;
462 IOleUndoManager *undomgr;
464 HWND hwnd;
465 HWND tooltips_hwnd;
467 BOOL request_uiactivate;
468 BOOL in_place_active;
469 BOOL ui_active;
470 BOOL window_active;
471 BOOL hostui_setup;
472 BOOL is_webbrowser;
473 BOOL container_locked;
474 BOOL focus;
475 BOOL has_popup;
476 INT download_state;
478 USERMODE usermode;
479 LPWSTR mime;
481 DWORD update;
484 typedef struct nsWeakReference nsWeakReference;
486 struct NSContainer {
487 nsIWebBrowserChrome nsIWebBrowserChrome_iface;
488 nsIContextMenuListener nsIContextMenuListener_iface;
489 nsIURIContentListener nsIURIContentListener_iface;
490 nsIEmbeddingSiteWindow nsIEmbeddingSiteWindow_iface;
491 nsITooltipListener nsITooltipListener_iface;
492 nsIInterfaceRequestor nsIInterfaceRequestor_iface;
493 nsISupportsWeakReference nsISupportsWeakReference_iface;
495 nsIWebBrowser *webbrowser;
496 nsIWebNavigation *navigation;
497 nsIBaseWindow *window;
498 nsIWebBrowserFocus *focus;
500 nsIEditor *editor;
501 nsIController *editor_controller;
503 LONG ref;
505 nsWeakReference *weak_reference;
507 NSContainer *parent;
508 HTMLDocumentObj *doc;
510 nsIURIContentListener *content_listener;
512 HWND hwnd;
515 typedef struct {
516 HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
517 void (*destructor)(HTMLDOMNode*);
518 HRESULT (*clone)(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**);
519 HRESULT (*get_attr_col)(HTMLDOMNode*,HTMLAttributeCollection**);
520 event_target_t **(*get_event_target)(HTMLDOMNode*);
521 HRESULT (*fire_event)(HTMLDOMNode*,DWORD,BOOL*);
522 HRESULT (*handle_event)(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*);
523 HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
524 HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
525 HRESULT (*get_document)(HTMLDOMNode*,IDispatch**);
526 HRESULT (*get_readystate)(HTMLDOMNode*,BSTR*);
527 HRESULT (*get_dispid)(HTMLDOMNode*,BSTR,DWORD,DISPID*);
528 HRESULT (*invoke)(HTMLDOMNode*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
529 HRESULT (*bind_to_tree)(HTMLDOMNode*);
530 } NodeImplVtbl;
532 struct HTMLDOMNode {
533 DispatchEx dispex;
534 IHTMLDOMNode IHTMLDOMNode_iface;
535 IHTMLDOMNode2 IHTMLDOMNode2_iface;
536 const NodeImplVtbl *vtbl;
538 LONG ref;
540 nsIDOMNode *nsnode;
541 HTMLDocumentNode *doc;
542 event_target_t *event_target;
543 ConnectionPointContainer *cp_container;
545 HTMLDOMNode *next;
548 typedef struct {
549 HTMLDOMNode node;
550 ConnectionPointContainer cp_container;
552 IHTMLElement IHTMLElement_iface;
553 IHTMLElement2 IHTMLElement2_iface;
554 IHTMLElement3 IHTMLElement3_iface;
555 IHTMLElement4 IHTMLElement4_iface;
557 nsIDOMHTMLElement *nselem;
558 HTMLStyle *style;
559 HTMLAttributeCollection *attrs;
560 WCHAR *filter;
561 } HTMLElement;
563 #define HTMLELEMENT_TIDS \
564 IHTMLDOMNode_tid, \
565 IHTMLDOMNode2_tid, \
566 IHTMLElement_tid, \
567 IHTMLElement2_tid, \
568 IHTMLElement3_tid, \
569 IHTMLElement4_tid
571 typedef struct {
572 HTMLElement element;
574 IHTMLTextContainer IHTMLTextContainer_iface;
576 ConnectionPoint cp;
577 } HTMLTextContainer;
579 struct HTMLFrameBase {
580 HTMLElement element;
582 IHTMLFrameBase IHTMLFrameBase_iface;
583 IHTMLFrameBase2 IHTMLFrameBase2_iface;
585 HTMLWindow *content_window;
587 nsIDOMHTMLFrameElement *nsframe;
588 nsIDOMHTMLIFrameElement *nsiframe;
591 typedef struct nsDocumentEventListener nsDocumentEventListener;
593 struct HTMLDocumentNode {
594 HTMLDOMNode node;
595 HTMLDocument basedoc;
597 IInternetHostSecurityManager IInternetHostSecurityManager_iface;
599 nsIDocumentObserver nsIDocumentObserver_iface;
601 LONG ref;
603 nsIDOMHTMLDocument *nsdoc;
604 HTMLDOMNode *nodes;
605 BOOL content_ready;
606 event_target_t *body_event_target;
608 ICatInformation *catmgr;
609 nsDocumentEventListener *nsevent_listener;
610 BOOL *event_vector;
612 WCHAR **elem_vars;
613 unsigned elem_vars_size;
614 unsigned elem_vars_cnt;
616 BOOL skip_mutation_notif;
618 struct list bindings;
619 struct list selection_list;
620 struct list range_list;
621 struct list plugin_hosts;
624 HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
625 HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
626 HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLWindow*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
627 HRESULT create_document_fragment(nsIDOMNode*,HTMLDocumentNode*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
629 HRESULT HTMLWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLWindow*,HTMLWindow**) DECLSPEC_HIDDEN;
630 void update_window_doc(HTMLWindow*) DECLSPEC_HIDDEN;
631 HTMLWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
632 HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*) DECLSPEC_HIDDEN;
633 HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow*) DECLSPEC_HIDDEN;
634 HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**) DECLSPEC_HIDDEN;
635 IOmNavigator *OmNavigator_Create(void) DECLSPEC_HIDDEN;
636 HRESULT HTMLScreen_Create(IHTMLScreen**) DECLSPEC_HIDDEN;
638 void HTMLDocument_HTMLDocument3_Init(HTMLDocument*) DECLSPEC_HIDDEN;
639 void HTMLDocument_HTMLDocument5_Init(HTMLDocument*) DECLSPEC_HIDDEN;
640 void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN;
641 void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN;
642 void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN;
643 void HTMLDocument_View_Init(HTMLDocument*) DECLSPEC_HIDDEN;
644 void HTMLDocument_Window_Init(HTMLDocument*) DECLSPEC_HIDDEN;
645 void HTMLDocument_Service_Init(HTMLDocument*) DECLSPEC_HIDDEN;
646 void HTMLDocument_Hlink_Init(HTMLDocument*) DECLSPEC_HIDDEN;
648 void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
650 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
652 HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**) DECLSPEC_HIDDEN;
654 void ConnectionPoint_Init(ConnectionPoint*,ConnectionPointContainer*,REFIID,cp_static_data_t*) DECLSPEC_HIDDEN;
655 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
656 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
658 HRESULT create_nscontainer(HTMLDocumentObj*,NSContainer*,NSContainer**) DECLSPEC_HIDDEN;
659 void NSContainer_Release(NSContainer*) DECLSPEC_HIDDEN;
660 nsresult create_chrome_window(nsIWebBrowserChrome*,nsIWebBrowserChrome**) DECLSPEC_HIDDEN;
662 void init_mutation(nsIComponentManager*) DECLSPEC_HIDDEN;
663 void init_document_mutation(HTMLDocumentNode*) DECLSPEC_HIDDEN;
664 void release_document_mutation(HTMLDocumentNode*) DECLSPEC_HIDDEN;
666 void HTMLDocument_LockContainer(HTMLDocumentObj*,BOOL) DECLSPEC_HIDDEN;
667 void show_context_menu(HTMLDocumentObj*,DWORD,POINT*,IDispatch*) DECLSPEC_HIDDEN;
668 void notif_focus(HTMLDocumentObj*) DECLSPEC_HIDDEN;
670 void show_tooltip(HTMLDocumentObj*,DWORD,DWORD,LPCWSTR) DECLSPEC_HIDDEN;
671 void hide_tooltip(HTMLDocumentObj*) DECLSPEC_HIDDEN;
672 HRESULT get_client_disp_property(IOleClientSite*,DISPID,VARIANT*) DECLSPEC_HIDDEN;
674 HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**) DECLSPEC_HIDDEN;
676 BOOL load_gecko(void) DECLSPEC_HIDDEN;
677 void close_gecko(void) DECLSPEC_HIDDEN;
678 void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*) DECLSPEC_HIDDEN;
679 void init_nsio(nsIComponentManager*,nsIComponentRegistrar*) DECLSPEC_HIDDEN;
680 void release_nsio(void) DECLSPEC_HIDDEN;
681 BOOL is_gecko_path(const char*) DECLSPEC_HIDDEN;
683 HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*) DECLSPEC_HIDDEN;
684 BOOL compare_ignoring_frag(IUri*,IUri*) DECLSPEC_HIDDEN;
686 HRESULT navigate_url(HTMLWindow*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
687 HRESULT set_frame_doc(HTMLFrameBase*,nsIDOMDocument*) DECLSPEC_HIDDEN;
689 void call_property_onchanged(ConnectionPoint*,DISPID) DECLSPEC_HIDDEN;
690 HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*) DECLSPEC_HIDDEN;
692 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN;
693 void nsfree(void*) DECLSPEC_HIDDEN;
695 void nsACString_InitDepend(nsACString*,const char*) DECLSPEC_HIDDEN;
696 void nsACString_SetData(nsACString*,const char*) DECLSPEC_HIDDEN;
697 PRUint32 nsACString_GetData(const nsACString*,const char**) DECLSPEC_HIDDEN;
698 void nsACString_Finish(nsACString*) DECLSPEC_HIDDEN;
700 BOOL nsAString_Init(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
701 void nsAString_InitDepend(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
702 void nsAString_SetData(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
703 PRUint32 nsAString_GetData(const nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
704 void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN;
705 HRESULT return_nsstr(nsresult,nsAString*,BSTR*) DECLSPEC_HIDDEN;
707 nsICommandParams *create_nscommand_params(void) DECLSPEC_HIDDEN;
708 HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN;
709 void get_editor_controller(NSContainer*) DECLSPEC_HIDDEN;
710 nsresult get_nsinterface(nsISupports*,REFIID,void**) DECLSPEC_HIDDEN;
711 nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN;
713 void set_window_bscallback(HTMLWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
714 void set_current_mon(HTMLWindow*,IMoniker*) DECLSPEC_HIDDEN;
715 void set_current_uri(HTMLWindow*,IUri*) DECLSPEC_HIDDEN;
716 HRESULT start_binding(HTMLWindow*,HTMLDocumentNode*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
717 HRESULT async_start_doc_binding(HTMLWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
718 void abort_document_bindings(HTMLDocumentNode*) DECLSPEC_HIDDEN;
719 void set_download_state(HTMLDocumentObj*,int) DECLSPEC_HIDDEN;
721 HRESULT bind_mon_to_buffer(HTMLDocumentNode*,IMoniker*,void**,DWORD*) DECLSPEC_HIDDEN;
723 void set_ready_state(HTMLWindow*,READYSTATE) DECLSPEC_HIDDEN;
725 HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**) DECLSPEC_HIDDEN;
726 HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**) DECLSPEC_HIDDEN;
727 HRESULT HTMLStyle_Create(HTMLElement*,nsIDOMCSSStyleDeclaration*,HTMLStyle**) DECLSPEC_HIDDEN;
728 IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*) DECLSPEC_HIDDEN;
729 IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*) DECLSPEC_HIDDEN;
731 void detach_selection(HTMLDocumentNode*) DECLSPEC_HIDDEN;
732 void detach_ranges(HTMLDocumentNode*) DECLSPEC_HIDDEN;
733 HRESULT get_node_text(HTMLDOMNode*,BSTR*) DECLSPEC_HIDDEN;
734 HRESULT replace_node_by_html(nsIDOMHTMLDocument*,nsIDOMNode*,const WCHAR*) DECLSPEC_HIDDEN;
736 HRESULT create_nselem(HTMLDocumentNode*,const WCHAR*,nsIDOMHTMLElement**) DECLSPEC_HIDDEN;
738 HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
740 struct HTMLAttributeCollection {
741 DispatchEx dispex;
742 IHTMLAttributeCollection IHTMLAttributeCollection_iface;
743 IHTMLAttributeCollection2 IHTMLAttributeCollection2_iface;
744 IHTMLAttributeCollection3 IHTMLAttributeCollection3_iface;
746 LONG ref;
748 HTMLElement *elem;
749 struct list attrs;
752 typedef struct {
753 DispatchEx dispex;
754 IHTMLDOMAttribute IHTMLDOMAttribute_iface;
756 LONG ref;
758 DISPID dispid;
759 HTMLElement *elem;
760 struct list entry;
761 } HTMLDOMAttribute;
763 HRESULT HTMLDOMAttribute_Create(HTMLElement*,DISPID,HTMLDOMAttribute**) DECLSPEC_HIDDEN;
765 HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**) DECLSPEC_HIDDEN;
766 HRESULT HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLElement**) DECLSPEC_HIDDEN;
767 HRESULT HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
768 HRESULT HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
769 HRESULT HTMLEmbedElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
770 HRESULT HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
771 HRESULT HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
772 HRESULT HTMLHeadElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
773 HRESULT HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
774 HRESULT HTMLStyleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
775 HRESULT HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
776 HRESULT HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
777 HRESULT HTMLObjectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
778 HRESULT HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
779 HRESULT HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
780 HRESULT HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
781 HRESULT HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
782 HRESULT HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
783 HRESULT HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
784 HRESULT HTMLTitleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
785 HRESULT HTMLGenericElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN;
787 void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*) DECLSPEC_HIDDEN;
788 void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
789 void HTMLElement2_Init(HTMLElement*) DECLSPEC_HIDDEN;
790 void HTMLElement3_Init(HTMLElement*) DECLSPEC_HIDDEN;
791 void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
792 void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
794 HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
795 void HTMLDOMNode_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
797 HRESULT HTMLElement_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
798 void HTMLElement_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
799 HRESULT HTMLElement_clone(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
800 HRESULT HTMLElement_get_attr_col(HTMLDOMNode*,HTMLAttributeCollection**) DECLSPEC_HIDDEN;
802 HRESULT HTMLFrameBase_QI(HTMLFrameBase*,REFIID,void**) DECLSPEC_HIDDEN;
803 void HTMLFrameBase_destructor(HTMLFrameBase*) DECLSPEC_HIDDEN;
805 HRESULT get_node(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLDOMNode**) DECLSPEC_HIDDEN;
806 void release_nodes(HTMLDocumentNode*) DECLSPEC_HIDDEN;
808 HTMLElement *unsafe_impl_from_IHTMLElement(IHTMLElement*) DECLSPEC_HIDDEN;
810 void release_script_hosts(HTMLWindow*) DECLSPEC_HIDDEN;
811 void connect_scripts(HTMLWindow*) DECLSPEC_HIDDEN;
812 void doc_insert_script(HTMLWindow*,nsIDOMHTMLScriptElement*) DECLSPEC_HIDDEN;
813 IDispatch *script_parse_event(HTMLWindow*,LPCWSTR) DECLSPEC_HIDDEN;
814 HRESULT exec_script(HTMLWindow*,const WCHAR*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN;
815 void set_script_mode(HTMLWindow*,SCRIPTMODE) DECLSPEC_HIDDEN;
816 BOOL find_global_prop(HTMLWindow*,BSTR,DWORD,ScriptHost**,DISPID*) DECLSPEC_HIDDEN;
817 IDispatch *get_script_disp(ScriptHost*) DECLSPEC_HIDDEN;
818 HRESULT search_window_props(HTMLWindow*,BSTR,DWORD,DISPID*) DECLSPEC_HIDDEN;
820 HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN;
822 IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL) DECLSPEC_HIDDEN;
823 IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,IUnknown*,nsIDOMNodeList*) DECLSPEC_HIDDEN;
824 IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode*,IUnknown*,nsIDOMHTMLCollection*) DECLSPEC_HIDDEN;
826 /* commands */
827 typedef struct {
828 DWORD id;
829 HRESULT (*query)(HTMLDocument*,OLECMD*);
830 HRESULT (*exec)(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
831 } cmdtable_t;
833 extern const cmdtable_t editmode_cmds[] DECLSPEC_HIDDEN;
835 void do_ns_command(HTMLDocument*,const char*,nsICommandParams*) DECLSPEC_HIDDEN;
837 /* timer */
838 #define UPDATE_UI 0x0001
839 #define UPDATE_TITLE 0x0002
841 void update_doc(HTMLDocument*,DWORD) DECLSPEC_HIDDEN;
842 void update_title(HTMLDocumentObj*) DECLSPEC_HIDDEN;
844 HRESULT do_query_service(IUnknown*,REFGUID,REFIID,void**) DECLSPEC_HIDDEN;
846 /* editor */
847 void init_editor(HTMLDocument*) DECLSPEC_HIDDEN;
848 void handle_edit_event(HTMLDocument*,nsIDOMEvent*) DECLSPEC_HIDDEN;
849 HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
850 HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
851 HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
852 void handle_edit_load(HTMLDocument*) DECLSPEC_HIDDEN;
853 HRESULT editor_is_dirty(HTMLDocument*) DECLSPEC_HIDDEN;
854 void set_dirty(HTMLDocument*,VARIANT_BOOL) DECLSPEC_HIDDEN;
856 extern DWORD mshtml_tls DECLSPEC_HIDDEN;
858 typedef struct task_t task_t;
859 typedef void (*task_proc_t)(task_t*);
861 struct task_t {
862 LONG target_magic;
863 task_proc_t proc;
864 task_proc_t destr;
865 struct task_t *next;
868 typedef struct {
869 task_t header;
870 HTMLDocumentObj *doc;
871 } docobj_task_t;
873 typedef struct {
874 HWND thread_hwnd;
875 task_t *task_queue_head;
876 task_t *task_queue_tail;
877 struct list timer_list;
878 } thread_data_t;
880 thread_data_t *get_thread_data(BOOL) DECLSPEC_HIDDEN;
881 HWND get_thread_hwnd(void) DECLSPEC_HIDDEN;
883 LONG get_task_target_magic(void) DECLSPEC_HIDDEN;
884 void push_task(task_t*,task_proc_t,task_proc_t,LONG) DECLSPEC_HIDDEN;
885 void remove_target_tasks(LONG) DECLSPEC_HIDDEN;
887 DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*) DECLSPEC_HIDDEN;
888 HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD) DECLSPEC_HIDDEN;
890 const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
892 DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
893 DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
894 DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
895 DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
896 DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
898 DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
900 DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
902 /* memory allocation functions */
904 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
906 return HeapAlloc(GetProcessHeap(), 0, len);
909 static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
911 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
914 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len)
916 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
919 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
921 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
924 static inline BOOL heap_free(void *mem)
926 return HeapFree(GetProcessHeap(), 0, mem);
929 static inline LPWSTR heap_strdupW(LPCWSTR str)
931 LPWSTR ret = NULL;
933 if(str) {
934 DWORD size;
936 size = (strlenW(str)+1)*sizeof(WCHAR);
937 ret = heap_alloc(size);
938 memcpy(ret, str, size);
941 return ret;
944 static inline LPWSTR heap_strndupW(LPCWSTR str, unsigned len)
946 LPWSTR ret = NULL;
948 if(str) {
949 ret = heap_alloc((len+1)*sizeof(WCHAR));
950 memcpy(ret, str, len*sizeof(WCHAR));
951 ret[len] = 0;
954 return ret;
957 static inline char *heap_strdupA(const char *str)
959 char *ret = NULL;
961 if(str) {
962 DWORD size;
964 size = strlen(str)+1;
965 ret = heap_alloc(size);
966 memcpy(ret, str, size);
969 return ret;
972 static inline WCHAR *heap_strdupAtoW(const char *str)
974 LPWSTR ret = NULL;
976 if(str) {
977 DWORD len;
979 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
980 ret = heap_alloc(len*sizeof(WCHAR));
981 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
984 return ret;
987 static inline char *heap_strdupWtoA(LPCWSTR str)
989 char *ret = NULL;
991 if(str) {
992 DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
993 ret = heap_alloc(size);
994 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
997 return ret;
1000 static inline void windowref_addref(windowref_t *ref)
1002 InterlockedIncrement(&ref->ref);
1005 static inline void windowref_release(windowref_t *ref)
1007 if(!InterlockedDecrement(&ref->ref))
1008 heap_free(ref);
1011 HDC get_display_dc(void) DECLSPEC_HIDDEN;
1012 HINSTANCE get_shdoclc(void) DECLSPEC_HIDDEN;
1013 void set_statustext(HTMLDocumentObj*,INT,LPCWSTR) DECLSPEC_HIDDEN;
1015 extern HINSTANCE hInst DECLSPEC_HIDDEN;