2005-03-31 12:08:02 +02:00
|
|
|
/*
|
2008-04-29 01:38:09 +02:00
|
|
|
* Copyright 2005-2008 Jacek Caban for CodeWeavers
|
2005-03-31 12:08:02 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-03-31 12:08:02 +02:00
|
|
|
*/
|
|
|
|
|
2007-10-17 15:16:21 +02:00
|
|
|
#include "wingdi.h"
|
2005-08-11 12:30:30 +02:00
|
|
|
#include "docobj.h"
|
|
|
|
#include "mshtml.h"
|
|
|
|
#include "mshtmhst.h"
|
2005-08-27 11:25:56 +02:00
|
|
|
#include "hlink.h"
|
2008-04-17 02:31:43 +02:00
|
|
|
#include "dispex.h"
|
2005-08-11 12:30:30 +02:00
|
|
|
|
2006-12-08 12:38:19 +01:00
|
|
|
#include "wine/list.h"
|
2007-12-31 01:32:48 +01:00
|
|
|
#include "wine/unicode.h"
|
2006-12-08 12:38:19 +01:00
|
|
|
|
2005-08-11 12:30:30 +02:00
|
|
|
#ifdef INIT_GUID
|
|
|
|
#include "initguid.h"
|
|
|
|
#endif
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
#include "nsiface.h"
|
|
|
|
|
2006-08-09 16:33:00 +02:00
|
|
|
#define GENERATE_MSHTML_NS_FAILURE(code) \
|
|
|
|
((nsresult) ((PRUint32)(1<<31) | ((PRUint32)(0x45+6)<<16) | (PRUint32)(code)))
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
#define NS_OK ((nsresult)0x00000000L)
|
2005-12-09 11:51:02 +01:00
|
|
|
#define NS_ERROR_FAILURE ((nsresult)0x80004005L)
|
2005-08-01 12:59:45 +02:00
|
|
|
#define NS_NOINTERFACE ((nsresult)0x80004002L)
|
|
|
|
#define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
|
2005-08-25 21:24:58 +02:00
|
|
|
#define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
|
2006-02-09 12:19:33 +01:00
|
|
|
#define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
|
2006-02-20 11:13:37 +01:00
|
|
|
#define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L)
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2006-08-09 16:33:00 +02:00
|
|
|
#define WINE_NS_LOAD_FROM_MONIKER GENERATE_MSHTML_NS_FAILURE(0)
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
#define NS_FAILED(res) ((res) & 0x80000000)
|
|
|
|
#define NS_SUCCEEDED(res) (!NS_FAILED(res))
|
|
|
|
|
2005-08-25 21:24:58 +02:00
|
|
|
#define NSAPI WINAPI
|
|
|
|
|
2007-08-17 02:38:00 +02:00
|
|
|
#define MSHTML_E_NODOC 0x800a025c
|
|
|
|
|
2006-03-05 20:38:30 +01:00
|
|
|
typedef struct HTMLDOMNode HTMLDOMNode;
|
2006-04-28 20:01:07 +02:00
|
|
|
typedef struct ConnectionPoint ConnectionPoint;
|
2006-06-03 00:37:58 +02:00
|
|
|
typedef struct BSCallback BSCallback;
|
2008-03-23 02:17:17 +01:00
|
|
|
typedef struct nsChannelBSC nsChannelBSC;
|
2008-04-18 20:16:35 +02:00
|
|
|
typedef struct event_target_t event_target_t;
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2008-04-17 02:32:18 +02:00
|
|
|
/* NOTE: make sure to keep in sync with dispex.c */
|
|
|
|
typedef enum {
|
2008-04-19 12:55:24 +02:00
|
|
|
NULL_tid,
|
2008-04-30 18:18:09 +02:00
|
|
|
DispDOMChildrenCollection_tid,
|
2008-04-30 18:20:48 +02:00
|
|
|
DispHTMLCommentElement_tid,
|
2008-04-21 18:21:54 +02:00
|
|
|
DispHTMLDocument_tid,
|
2008-04-24 18:25:51 +02:00
|
|
|
DispHTMLDOMTextNode_tid,
|
2008-04-24 18:26:56 +02:00
|
|
|
DispHTMLElementCollection_tid,
|
2008-06-19 23:15:37 +02:00
|
|
|
DispHTMLGenericElement_tid,
|
2008-05-01 17:36:38 +02:00
|
|
|
DispHTMLImg_tid,
|
2008-04-29 01:39:09 +02:00
|
|
|
DispHTMLInputElement_tid,
|
2008-04-29 01:39:38 +02:00
|
|
|
DispHTMLOptionElement_tid,
|
2008-06-18 00:09:53 +02:00
|
|
|
DispHTMLSelectElement_tid,
|
2008-04-30 18:20:58 +02:00
|
|
|
DispHTMLStyle_tid,
|
2008-04-23 16:45:52 +02:00
|
|
|
DispHTMLUnknownElement_tid,
|
2008-04-19 18:41:25 +02:00
|
|
|
DispHTMLWindow2_tid,
|
2008-04-30 18:20:48 +02:00
|
|
|
IHTMLCommentElement_tid,
|
2008-04-21 18:21:54 +02:00
|
|
|
IHTMLDocument2_tid,
|
|
|
|
IHTMLDocument3_tid,
|
|
|
|
IHTMLDocument4_tid,
|
|
|
|
IHTMLDocument5_tid,
|
2008-04-30 18:18:09 +02:00
|
|
|
IHTMLDOMChildrenCollection_tid,
|
2008-04-23 16:45:52 +02:00
|
|
|
IHTMLDOMNode_tid,
|
2008-04-24 18:23:17 +02:00
|
|
|
IHTMLDOMNode2_tid,
|
2008-04-24 18:25:51 +02:00
|
|
|
IHTMLDOMTextNode_tid,
|
2008-04-23 16:45:52 +02:00
|
|
|
IHTMLElement_tid,
|
|
|
|
IHTMLElement2_tid,
|
2008-04-24 18:26:56 +02:00
|
|
|
IHTMLElementCollection_tid,
|
2008-06-19 23:15:37 +02:00
|
|
|
IHTMLGenericElement_tid,
|
2008-05-01 17:36:38 +02:00
|
|
|
IHTMLImgElement_tid,
|
2008-04-29 01:39:09 +02:00
|
|
|
IHTMLInputElement_tid,
|
2008-04-29 01:39:38 +02:00
|
|
|
IHTMLOptionElement_tid,
|
2008-06-18 00:09:53 +02:00
|
|
|
IHTMLSelectElement_tid,
|
2008-04-30 18:20:58 +02:00
|
|
|
IHTMLStyle_tid,
|
2008-04-17 02:32:18 +02:00
|
|
|
IHTMLWindow2_tid,
|
2008-04-19 18:41:25 +02:00
|
|
|
IHTMLWindow3_tid,
|
2008-04-19 12:55:24 +02:00
|
|
|
IOmNavigator_tid,
|
2008-04-17 02:32:18 +02:00
|
|
|
LAST_tid
|
|
|
|
} tid_t;
|
|
|
|
|
2008-06-23 16:54:00 +02:00
|
|
|
typedef enum {
|
2008-06-24 22:23:30 +02:00
|
|
|
EVENTID_CHANGE,
|
2008-06-23 16:54:00 +02:00
|
|
|
EVENTID_CLICK,
|
2008-06-24 03:01:04 +02:00
|
|
|
EVENTID_KEYUP,
|
2008-06-23 16:54:00 +02:00
|
|
|
EVENTID_LOAD,
|
|
|
|
EVENTID_LAST
|
|
|
|
} eventid_t;
|
|
|
|
|
2008-04-19 12:55:24 +02:00
|
|
|
typedef struct dispex_data_t dispex_data_t;
|
2008-06-18 00:10:26 +02:00
|
|
|
typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
|
2008-04-19 12:55:24 +02:00
|
|
|
|
2008-04-29 01:38:09 +02:00
|
|
|
#define MSHTML_DISPID_CUSTOM_MIN 0x60000000
|
|
|
|
#define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*);
|
|
|
|
HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
|
|
|
|
} dispex_static_data_vtbl_t;
|
|
|
|
|
2008-04-19 12:55:24 +02:00
|
|
|
typedef struct {
|
2008-04-29 01:38:09 +02:00
|
|
|
const dispex_static_data_vtbl_t *vtbl;
|
2008-04-19 12:55:24 +02:00
|
|
|
const tid_t disp_tid;
|
|
|
|
dispex_data_t *data;
|
2008-05-06 16:04:58 +02:00
|
|
|
const tid_t* const iface_tids;
|
2008-04-19 12:55:24 +02:00
|
|
|
} dispex_static_data_t;
|
|
|
|
|
2008-04-17 02:31:43 +02:00
|
|
|
typedef struct {
|
|
|
|
const IDispatchExVtbl *lpIDispatchExVtbl;
|
|
|
|
|
|
|
|
IUnknown *outer;
|
2008-04-19 12:55:24 +02:00
|
|
|
|
|
|
|
dispex_static_data_t *data;
|
2008-06-18 00:10:26 +02:00
|
|
|
dispex_dynamic_data_t *dynamic_data;
|
2008-04-17 02:31:43 +02:00
|
|
|
} DispatchEx;
|
|
|
|
|
2008-04-19 12:55:24 +02:00
|
|
|
void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*);
|
2008-06-30 21:38:23 +02:00
|
|
|
BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
|
2008-04-17 02:31:43 +02:00
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
typedef struct {
|
2008-04-19 18:41:25 +02:00
|
|
|
DispatchEx dispex;
|
2006-12-06 18:21:16 +01:00
|
|
|
const IHTMLWindow2Vtbl *lpHTMLWindow2Vtbl;
|
2008-04-17 22:53:31 +02:00
|
|
|
const IHTMLWindow3Vtbl *lpHTMLWindow3Vtbl;
|
2008-04-19 18:41:25 +02:00
|
|
|
const IDispatchExVtbl *lpIDispatchExVtbl;
|
2006-12-06 18:21:16 +01:00
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
HTMLDocument *doc;
|
|
|
|
nsIDOMWindow *nswindow;
|
2006-12-08 12:38:19 +01:00
|
|
|
|
2008-04-21 00:48:18 +02:00
|
|
|
IHTMLEventObj *event;
|
|
|
|
|
2006-12-08 12:38:19 +01:00
|
|
|
struct list entry;
|
2006-12-06 18:21:16 +01:00
|
|
|
} HTMLWindow;
|
|
|
|
|
2006-06-30 23:44:04 +02:00
|
|
|
typedef enum {
|
|
|
|
UNKNOWN_USERMODE,
|
|
|
|
BROWSEMODE,
|
|
|
|
EDITMODE
|
|
|
|
} USERMODE;
|
|
|
|
|
2007-06-29 02:49:27 +02:00
|
|
|
typedef struct {
|
|
|
|
const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
|
|
|
|
|
|
|
|
ConnectionPoint *cp_list;
|
|
|
|
IUnknown *outer;
|
|
|
|
} ConnectionPointContainer;
|
|
|
|
|
2007-06-29 02:47:59 +02:00
|
|
|
struct ConnectionPoint {
|
|
|
|
const IConnectionPointVtbl *lpConnectionPointVtbl;
|
|
|
|
|
2007-06-29 02:50:04 +02:00
|
|
|
IConnectionPointContainer *container;
|
2007-06-29 02:47:59 +02:00
|
|
|
|
|
|
|
union {
|
|
|
|
IUnknown *unk;
|
|
|
|
IDispatch *disp;
|
|
|
|
IPropertyNotifySink *propnotif;
|
|
|
|
} *sinks;
|
|
|
|
DWORD sinks_size;
|
|
|
|
|
2007-12-04 13:36:27 +01:00
|
|
|
const IID *iid;
|
2007-06-29 02:48:50 +02:00
|
|
|
|
|
|
|
ConnectionPoint *next;
|
2007-06-29 02:47:59 +02:00
|
|
|
};
|
|
|
|
|
2008-03-26 15:23:41 +01:00
|
|
|
typedef struct {
|
|
|
|
const IHTMLLocationVtbl *lpHTMLLocationVtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
HTMLDocument *doc;
|
|
|
|
} HTMLLocation;
|
|
|
|
|
2007-10-13 03:58:55 +02:00
|
|
|
typedef struct {
|
|
|
|
const IHTMLOptionElementFactoryVtbl *lpHTMLOptionElementFactoryVtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
HTMLDocument *doc;
|
|
|
|
} HTMLOptionElementFactory;
|
|
|
|
|
2006-08-03 02:36:15 +02:00
|
|
|
struct HTMLDocument {
|
2008-04-21 18:21:54 +02:00
|
|
|
DispatchEx dispex;
|
2005-06-28 12:53:42 +02:00
|
|
|
const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
|
2005-12-12 11:51:43 +01:00
|
|
|
const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl;
|
2007-10-13 03:59:38 +02:00
|
|
|
const IHTMLDocument4Vtbl *lpHTMLDocument4Vtbl;
|
2007-09-26 20:43:52 +02:00
|
|
|
const IHTMLDocument5Vtbl *lpHTMLDocument5Vtbl;
|
2005-06-28 12:53:42 +02:00
|
|
|
const IPersistMonikerVtbl *lpPersistMonikerVtbl;
|
|
|
|
const IPersistFileVtbl *lpPersistFileVtbl;
|
|
|
|
const IMonikerPropVtbl *lpMonikerPropVtbl;
|
|
|
|
const IOleObjectVtbl *lpOleObjectVtbl;
|
|
|
|
const IOleDocumentVtbl *lpOleDocumentVtbl;
|
|
|
|
const IOleDocumentViewVtbl *lpOleDocumentViewVtbl;
|
|
|
|
const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
|
|
|
|
const IViewObject2Vtbl *lpViewObject2Vtbl;
|
|
|
|
const IOleInPlaceObjectWindowlessVtbl *lpOleInPlaceObjectWindowlessVtbl;
|
2005-07-03 13:22:23 +02:00
|
|
|
const IServiceProviderVtbl *lpServiceProviderVtbl;
|
2005-07-12 19:00:58 +02:00
|
|
|
const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
|
2005-08-08 13:07:48 +02:00
|
|
|
const IOleControlVtbl *lpOleControlVtbl;
|
2005-08-27 11:25:56 +02:00
|
|
|
const IHlinkTargetVtbl *lpHlinkTargetVtbl;
|
2006-05-23 22:16:26 +02:00
|
|
|
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
|
2007-08-13 01:18:49 +02:00
|
|
|
const ICustomDocVtbl *lpCustomDocVtbl;
|
2008-04-21 18:21:54 +02:00
|
|
|
const IDispatchExVtbl *lpIDispatchExVtbl;
|
2005-04-11 18:11:52 +02:00
|
|
|
|
2005-07-06 12:33:10 +02:00
|
|
|
LONG ref;
|
2005-04-12 13:57:51 +02:00
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
NSContainer *nscontainer;
|
2006-12-06 18:21:16 +01:00
|
|
|
HTMLWindow *window;
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2005-04-12 13:57:51 +02:00
|
|
|
IOleClientSite *client;
|
2005-07-12 19:00:58 +02:00
|
|
|
IDocHostUIHandler *hostui;
|
2005-04-13 16:41:19 +02:00
|
|
|
IOleInPlaceSite *ipsite;
|
2005-04-15 18:12:45 +02:00
|
|
|
IOleInPlaceFrame *frame;
|
2007-07-25 00:06:42 +02:00
|
|
|
IOleInPlaceUIWindow *ip_window;
|
2005-04-14 13:30:50 +02:00
|
|
|
|
2007-09-09 20:17:30 +02:00
|
|
|
IOleUndoManager *undomgr;
|
|
|
|
|
2008-03-23 02:16:03 +01:00
|
|
|
nsChannelBSC *bscallback;
|
2007-06-11 17:27:19 +02:00
|
|
|
IMoniker *mon;
|
2007-10-01 18:07:30 +02:00
|
|
|
LPOLESTR url;
|
2007-11-05 21:45:07 +01:00
|
|
|
struct list bindings;
|
2006-09-24 23:39:55 +02:00
|
|
|
|
2008-03-25 02:10:47 +01:00
|
|
|
struct list script_hosts;
|
|
|
|
|
2005-04-14 13:30:50 +02:00
|
|
|
HWND hwnd;
|
2006-03-27 21:02:28 +02:00
|
|
|
HWND tooltips_hwnd;
|
2005-07-14 12:14:33 +02:00
|
|
|
|
2006-11-12 17:09:38 +01:00
|
|
|
DOCHOSTUIINFO hostinfo;
|
|
|
|
|
2006-06-30 23:44:04 +02:00
|
|
|
USERMODE usermode;
|
2006-09-27 16:37:36 +02:00
|
|
|
READYSTATE readystate;
|
2005-07-14 12:14:33 +02:00
|
|
|
BOOL in_place_active;
|
|
|
|
BOOL ui_active;
|
2005-08-15 11:41:30 +02:00
|
|
|
BOOL window_active;
|
2005-07-18 11:13:32 +02:00
|
|
|
BOOL has_key_path;
|
2005-08-22 16:07:49 +02:00
|
|
|
BOOL container_locked;
|
2007-06-22 23:33:00 +02:00
|
|
|
BOOL focus;
|
2007-12-31 01:32:48 +01:00
|
|
|
LPWSTR mime;
|
2005-08-09 22:46:05 +02:00
|
|
|
|
2007-06-10 11:38:51 +02:00
|
|
|
DWORD update;
|
|
|
|
|
2007-06-29 02:49:27 +02:00
|
|
|
ConnectionPointContainer cp_container;
|
2007-06-29 02:47:59 +02:00
|
|
|
ConnectionPoint cp_htmldocevents;
|
|
|
|
ConnectionPoint cp_htmldocevents2;
|
|
|
|
ConnectionPoint cp_propnotif;
|
2006-04-28 20:01:07 +02:00
|
|
|
|
2007-10-13 03:58:55 +02:00
|
|
|
HTMLOptionElementFactory *option_factory;
|
2008-03-26 15:23:41 +01:00
|
|
|
HTMLLocation *location;
|
2007-10-13 03:58:55 +02:00
|
|
|
|
2007-08-15 19:17:49 +02:00
|
|
|
struct list selection_list;
|
2007-08-17 02:37:01 +02:00
|
|
|
struct list range_list;
|
2007-08-15 19:17:49 +02:00
|
|
|
|
2006-03-05 20:38:30 +01:00
|
|
|
HTMLDOMNode *nodes;
|
2006-08-03 02:36:15 +02:00
|
|
|
};
|
2005-04-11 18:11:52 +02:00
|
|
|
|
2007-06-22 23:28:09 +02:00
|
|
|
typedef struct {
|
|
|
|
const nsIDOMEventListenerVtbl *lpDOMEventListenerVtbl;
|
|
|
|
NSContainer *This;
|
|
|
|
} nsEventListener;
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
struct NSContainer {
|
2006-03-27 21:02:28 +02:00
|
|
|
const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl;
|
|
|
|
const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl;
|
|
|
|
const nsIURIContentListenerVtbl *lpURIContentListenerVtbl;
|
|
|
|
const nsIEmbeddingSiteWindowVtbl *lpEmbeddingSiteWindowVtbl;
|
|
|
|
const nsITooltipListenerVtbl *lpTooltipListenerVtbl;
|
|
|
|
const nsIInterfaceRequestorVtbl *lpInterfaceRequestorVtbl;
|
|
|
|
const nsIWeakReferenceVtbl *lpWeakReferenceVtbl;
|
|
|
|
const nsISupportsWeakReferenceVtbl *lpSupportsWeakReferenceVtbl;
|
2005-08-25 21:24:58 +02:00
|
|
|
|
2007-06-22 23:33:00 +02:00
|
|
|
nsEventListener blur_listener;
|
|
|
|
nsEventListener focus_listener;
|
2007-06-22 23:28:09 +02:00
|
|
|
nsEventListener keypress_listener;
|
2007-06-22 23:28:54 +02:00
|
|
|
nsEventListener load_listener;
|
2008-03-03 01:20:27 +01:00
|
|
|
nsEventListener node_insert_listener;
|
2008-06-23 16:54:33 +02:00
|
|
|
nsEventListener htmlevent_listener;
|
2007-06-22 23:28:09 +02:00
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
nsIWebBrowser *webbrowser;
|
|
|
|
nsIWebNavigation *navigation;
|
|
|
|
nsIBaseWindow *window;
|
2005-08-26 12:05:52 +02:00
|
|
|
nsIWebBrowserFocus *focus;
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2007-09-12 11:41:36 +02:00
|
|
|
nsIEditor *editor;
|
2007-06-10 11:49:12 +02:00
|
|
|
nsIController *editor_controller;
|
|
|
|
|
2006-02-15 11:51:44 +01:00
|
|
|
LONG ref;
|
|
|
|
|
2006-03-01 22:04:51 +01:00
|
|
|
NSContainer *parent;
|
2005-08-25 21:24:58 +02:00
|
|
|
HTMLDocument *doc;
|
|
|
|
|
2006-08-16 16:34:32 +02:00
|
|
|
nsIURIContentListener *content_listener;
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
HWND hwnd;
|
2005-09-02 14:19:42 +02:00
|
|
|
|
2008-03-23 02:16:03 +01:00
|
|
|
nsChannelBSC *bscallback; /* hack */
|
2007-11-12 01:23:47 +01:00
|
|
|
HWND reset_focus; /* hack */
|
2008-06-23 16:54:33 +02:00
|
|
|
|
|
|
|
BOOL event_vector[EVENTID_LAST];
|
2005-08-01 12:59:45 +02:00
|
|
|
};
|
|
|
|
|
2006-06-03 00:40:26 +02:00
|
|
|
typedef struct {
|
|
|
|
const nsIHttpChannelVtbl *lpHttpChannelVtbl;
|
|
|
|
const nsIUploadChannelVtbl *lpUploadChannelVtbl;
|
|
|
|
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
nsIChannel *channel;
|
|
|
|
nsIHttpChannel *http_channel;
|
|
|
|
nsIWineURI *uri;
|
|
|
|
nsIInputStream *post_data_stream;
|
|
|
|
nsILoadGroup *load_group;
|
|
|
|
nsIInterfaceRequestor *notif_callback;
|
|
|
|
nsLoadFlags load_flags;
|
|
|
|
nsIURI *original_uri;
|
2008-03-26 15:24:03 +01:00
|
|
|
char *content_type;
|
2007-04-12 21:25:08 +02:00
|
|
|
char *charset;
|
2006-06-03 00:40:26 +02:00
|
|
|
} nsChannel;
|
|
|
|
|
2007-10-04 02:09:48 +02:00
|
|
|
typedef struct {
|
2007-10-04 02:10:36 +02:00
|
|
|
HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
|
2007-10-04 02:09:48 +02:00
|
|
|
void (*destructor)(HTMLDOMNode*);
|
|
|
|
} NodeImplVtbl;
|
|
|
|
|
2006-03-05 20:38:30 +01:00
|
|
|
struct HTMLDOMNode {
|
2008-04-23 16:45:52 +02:00
|
|
|
DispatchEx dispex;
|
2008-04-24 18:22:51 +02:00
|
|
|
const IHTMLDOMNodeVtbl *lpHTMLDOMNodeVtbl;
|
|
|
|
const IHTMLDOMNode2Vtbl *lpHTMLDOMNode2Vtbl;
|
2007-10-04 02:09:48 +02:00
|
|
|
const NodeImplVtbl *vtbl;
|
2006-03-05 20:38:30 +01:00
|
|
|
|
2007-10-14 12:07:27 +02:00
|
|
|
LONG ref;
|
|
|
|
|
2006-03-05 20:38:30 +01:00
|
|
|
nsIDOMNode *nsnode;
|
|
|
|
HTMLDocument *doc;
|
2008-04-18 20:16:35 +02:00
|
|
|
event_target_t *event_target;
|
2006-03-05 20:38:30 +01:00
|
|
|
|
|
|
|
HTMLDOMNode *next;
|
|
|
|
};
|
|
|
|
|
2006-03-05 20:39:59 +01:00
|
|
|
typedef struct {
|
2007-09-12 23:39:17 +02:00
|
|
|
HTMLDOMNode node;
|
2007-12-04 13:37:21 +01:00
|
|
|
ConnectionPointContainer cp_container;
|
2007-09-12 23:39:17 +02:00
|
|
|
|
2007-10-04 02:09:48 +02:00
|
|
|
const IHTMLElementVtbl *lpHTMLElementVtbl;
|
|
|
|
const IHTMLElement2Vtbl *lpHTMLElement2Vtbl;
|
2006-03-05 20:39:59 +01:00
|
|
|
|
|
|
|
nsIDOMHTMLElement *nselem;
|
|
|
|
} HTMLElement;
|
|
|
|
|
2006-04-28 19:57:28 +02:00
|
|
|
typedef struct {
|
2007-09-15 16:07:52 +02:00
|
|
|
HTMLElement element;
|
2006-04-28 19:57:28 +02:00
|
|
|
|
2007-09-15 16:07:52 +02:00
|
|
|
const IHTMLTextContainerVtbl *lpHTMLTextContainerVtbl;
|
2007-12-04 13:38:31 +01:00
|
|
|
|
|
|
|
ConnectionPoint cp;
|
2006-04-28 19:57:28 +02:00
|
|
|
} HTMLTextContainer;
|
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
|
2008-04-17 22:53:31 +02:00
|
|
|
#define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
|
2006-12-06 18:21:16 +01:00
|
|
|
|
2005-06-28 12:53:42 +02:00
|
|
|
#define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
|
2005-12-12 11:51:43 +01:00
|
|
|
#define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
|
2007-10-13 03:59:38 +02:00
|
|
|
#define HTMLDOC4(x) ((IHTMLDocument4*) &(x)->lpHTMLDocument4Vtbl)
|
2007-09-26 20:43:52 +02:00
|
|
|
#define HTMLDOC5(x) ((IHTMLDocument5*) &(x)->lpHTMLDocument5Vtbl)
|
2005-06-28 12:53:42 +02:00
|
|
|
#define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
|
|
|
|
#define PERSISTMON(x) ((IPersistMoniker*) &(x)->lpPersistMonikerVtbl)
|
|
|
|
#define PERSISTFILE(x) ((IPersistFile*) &(x)->lpPersistFileVtbl)
|
|
|
|
#define MONPROP(x) ((IMonikerProp*) &(x)->lpMonikerPropVtbl)
|
|
|
|
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
|
|
|
|
#define OLEDOC(x) ((IOleDocument*) &(x)->lpOleDocumentVtbl)
|
|
|
|
#define DOCVIEW(x) ((IOleDocumentView*) &(x)->lpOleDocumentViewVtbl)
|
|
|
|
#define OLEWIN(x) ((IOleWindow*) &(x)->lpOleInPlaceActiveObjectVtbl)
|
|
|
|
#define ACTOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
|
|
|
|
#define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObject2Vtbl)
|
|
|
|
#define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObject2Vtbl)
|
|
|
|
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
|
|
|
|
#define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
|
2005-07-03 13:22:23 +02:00
|
|
|
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
|
2005-07-12 19:00:58 +02:00
|
|
|
#define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
|
2005-08-08 13:07:48 +02:00
|
|
|
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
|
2005-08-27 11:25:56 +02:00
|
|
|
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
|
2006-04-28 19:59:58 +02:00
|
|
|
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
|
2006-05-23 22:16:26 +02:00
|
|
|
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
|
2007-08-13 01:18:49 +02:00
|
|
|
#define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)
|
2005-06-28 12:53:42 +02:00
|
|
|
|
2005-08-25 21:24:58 +02:00
|
|
|
#define NSWBCHROME(x) ((nsIWebBrowserChrome*) &(x)->lpWebBrowserChromeVtbl)
|
|
|
|
#define NSCML(x) ((nsIContextMenuListener*) &(x)->lpContextMenuListenerVtbl)
|
2005-09-02 14:19:42 +02:00
|
|
|
#define NSURICL(x) ((nsIURIContentListener*) &(x)->lpURIContentListenerVtbl)
|
2005-12-09 11:23:58 +01:00
|
|
|
#define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
|
2006-02-27 19:08:23 +01:00
|
|
|
#define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
|
2006-03-27 21:02:28 +02:00
|
|
|
#define NSTOOLTIP(x) ((nsITooltipListener*) &(x)->lpTooltipListenerVtbl)
|
2006-11-30 23:32:05 +01:00
|
|
|
#define NSEVENTLIST(x) ((nsIDOMEventListener*) &(x)->lpDOMEventListenerVtbl)
|
2006-03-27 21:02:28 +02:00
|
|
|
#define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
|
|
|
|
#define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
|
2005-08-25 21:24:58 +02:00
|
|
|
|
2006-06-03 00:40:26 +02:00
|
|
|
#define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
|
|
|
|
#define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
|
|
|
|
#define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
|
|
|
|
|
2006-06-03 00:37:58 +02:00
|
|
|
#define HTTPNEG(x) ((IHttpNegotiate2*) &(x)->lpHttpNegotiate2Vtbl)
|
2006-06-03 00:40:26 +02:00
|
|
|
#define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
|
2006-06-03 00:37:58 +02:00
|
|
|
#define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
|
|
|
|
|
2006-03-05 20:39:59 +01:00
|
|
|
#define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
|
2006-03-23 21:38:38 +01:00
|
|
|
#define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
|
2006-03-05 20:38:30 +01:00
|
|
|
#define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
|
2008-04-24 18:22:51 +02:00
|
|
|
#define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
|
2006-03-05 20:38:30 +01:00
|
|
|
|
2006-04-28 19:57:28 +02:00
|
|
|
#define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
|
|
|
|
|
2007-10-13 03:58:55 +02:00
|
|
|
#define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
|
2008-03-26 15:23:41 +01:00
|
|
|
#define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
|
2007-10-13 03:58:55 +02:00
|
|
|
|
2008-04-17 02:31:43 +02:00
|
|
|
#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
|
|
|
|
|
2007-10-04 02:07:59 +02:00
|
|
|
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
|
|
|
|
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
|
2005-04-11 18:11:52 +02:00
|
|
|
|
2005-03-31 12:08:02 +02:00
|
|
|
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
|
2006-06-22 16:14:14 +02:00
|
|
|
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**);
|
2005-04-11 18:11:52 +02:00
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
HTMLWindow *HTMLWindow_Create(HTMLDocument*);
|
2007-05-30 23:38:03 +02:00
|
|
|
HTMLWindow *nswindow_to_window(const nsIDOMWindow*);
|
2007-10-13 03:58:55 +02:00
|
|
|
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument*);
|
2008-03-26 15:23:41 +01:00
|
|
|
HTMLLocation *HTMLLocation_Create(HTMLDocument*);
|
2008-04-07 12:34:24 +02:00
|
|
|
IOmNavigator *OmNavigator_Create(void);
|
2007-08-14 22:36:56 +02:00
|
|
|
void setup_nswindow(HTMLWindow*);
|
2006-12-06 18:21:16 +01:00
|
|
|
|
2005-12-12 11:51:43 +01:00
|
|
|
void HTMLDocument_HTMLDocument3_Init(HTMLDocument*);
|
2007-09-26 20:43:52 +02:00
|
|
|
void HTMLDocument_HTMLDocument5_Init(HTMLDocument*);
|
2005-04-11 18:11:52 +02:00
|
|
|
void HTMLDocument_Persist_Init(HTMLDocument*);
|
2006-06-20 19:02:48 +02:00
|
|
|
void HTMLDocument_OleCmd_Init(HTMLDocument*);
|
2005-04-12 13:57:51 +02:00
|
|
|
void HTMLDocument_OleObj_Init(HTMLDocument*);
|
2005-04-13 16:41:19 +02:00
|
|
|
void HTMLDocument_View_Init(HTMLDocument*);
|
2005-06-28 12:53:42 +02:00
|
|
|
void HTMLDocument_Window_Init(HTMLDocument*);
|
2005-07-03 13:22:23 +02:00
|
|
|
void HTMLDocument_Service_Init(HTMLDocument*);
|
2005-08-27 11:25:56 +02:00
|
|
|
void HTMLDocument_Hlink_Init(HTMLDocument*);
|
2006-06-25 15:49:39 +02:00
|
|
|
|
2007-12-04 13:36:27 +01:00
|
|
|
void ConnectionPoint_Init(ConnectionPoint*,ConnectionPointContainer*,REFIID);
|
|
|
|
void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
|
2007-06-29 02:49:27 +02:00
|
|
|
void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
|
2007-06-29 02:48:50 +02:00
|
|
|
|
2006-03-01 22:04:51 +01:00
|
|
|
NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*);
|
2006-02-15 11:51:44 +01:00
|
|
|
void NSContainer_Release(NSContainer*);
|
2005-04-14 13:30:50 +02:00
|
|
|
|
2005-08-22 16:07:49 +02:00
|
|
|
void HTMLDocument_LockContainer(HTMLDocument*,BOOL);
|
2007-10-02 14:20:59 +02:00
|
|
|
void show_context_menu(HTMLDocument*,DWORD,POINT*,IDispatch*);
|
2007-06-22 23:33:00 +02:00
|
|
|
void notif_focus(HTMLDocument*);
|
2005-08-22 16:07:49 +02:00
|
|
|
|
2006-03-27 21:02:28 +02:00
|
|
|
void show_tooltip(HTMLDocument*,DWORD,DWORD,LPCWSTR);
|
|
|
|
void hide_tooltip(HTMLDocument*);
|
2006-08-17 03:34:22 +02:00
|
|
|
HRESULT get_client_disp_property(IOleClientSite*,DISPID,VARIANT*);
|
2006-03-27 21:02:28 +02:00
|
|
|
|
2005-06-27 11:50:56 +02:00
|
|
|
HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**);
|
|
|
|
|
2007-10-14 01:49:19 +02:00
|
|
|
BOOL load_gecko(BOOL);
|
2005-08-01 12:59:45 +02:00
|
|
|
void close_gecko(void);
|
2006-03-01 22:04:51 +01:00
|
|
|
void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*);
|
2006-02-09 12:17:08 +01:00
|
|
|
void init_nsio(nsIComponentManager*,nsIComponentRegistrar*);
|
2007-10-14 01:49:19 +02:00
|
|
|
BOOL install_wine_gecko(BOOL);
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2006-03-01 22:04:51 +01:00
|
|
|
void hlink_frame_navigate(HTMLDocument*,IHlinkFrame*,LPCWSTR,nsIInputStream*,DWORD);
|
2006-02-13 13:26:00 +01:00
|
|
|
|
2006-08-22 16:15:09 +02:00
|
|
|
void call_property_onchanged(ConnectionPoint*,DISPID);
|
2007-11-20 01:49:36 +01:00
|
|
|
HRESULT call_set_active_object(IOleInPlaceUIWindow*,IOleInPlaceActiveObject*);
|
2006-08-22 16:15:09 +02:00
|
|
|
|
2006-03-27 21:02:28 +02:00
|
|
|
void *nsalloc(size_t);
|
|
|
|
void nsfree(void*);
|
|
|
|
|
2006-03-18 22:00:34 +01:00
|
|
|
void nsACString_Init(nsACString*,const char*);
|
2006-12-14 00:20:26 +01:00
|
|
|
void nsACString_SetData(nsACString*,const char*);
|
2007-12-17 01:38:15 +01:00
|
|
|
PRUint32 nsACString_GetData(const nsACString*,const char**);
|
2006-03-18 22:00:34 +01:00
|
|
|
void nsACString_Finish(nsACString*);
|
2005-08-11 20:36:48 +02:00
|
|
|
|
2006-03-06 22:34:49 +01:00
|
|
|
void nsAString_Init(nsAString*,const PRUnichar*);
|
2008-03-07 12:56:33 +01:00
|
|
|
void nsAString_SetData(nsAString*,const PRUnichar*);
|
2007-12-17 01:38:30 +01:00
|
|
|
PRUint32 nsAString_GetData(const nsAString*,const PRUnichar**);
|
2006-03-06 22:34:49 +01:00
|
|
|
void nsAString_Finish(nsAString*);
|
|
|
|
|
2006-02-15 11:52:33 +01:00
|
|
|
nsIInputStream *create_nsstream(const char*,PRInt32);
|
2006-08-27 16:01:06 +02:00
|
|
|
nsICommandParams *create_nscommand_params(void);
|
2007-08-14 22:36:56 +02:00
|
|
|
nsIMutableArray *create_nsarray(void);
|
|
|
|
nsIWritableVariant *create_nsvariant(void);
|
2006-10-02 20:33:08 +02:00
|
|
|
void nsnode_to_nsstring(nsIDOMNode*,nsAString*);
|
2007-09-12 11:41:36 +02:00
|
|
|
void get_editor_controller(NSContainer*);
|
2007-06-22 23:28:09 +02:00
|
|
|
void init_nsevents(NSContainer*);
|
2008-06-23 16:54:33 +02:00
|
|
|
void add_nsevent_listener(NSContainer*,LPCWSTR);
|
2007-09-26 20:46:37 +02:00
|
|
|
nsresult get_nsinterface(nsISupports*,REFIID,void**);
|
2006-06-03 00:40:26 +02:00
|
|
|
|
2008-04-18 20:16:35 +02:00
|
|
|
void check_event_attr(HTMLDocument*,nsIDOMElement*);
|
|
|
|
void release_event_target(event_target_t*);
|
2008-04-21 00:48:18 +02:00
|
|
|
void fire_event(HTMLDocument*,eventid_t,nsIDOMNode*);
|
2008-06-23 16:54:51 +02:00
|
|
|
HRESULT set_node_event(HTMLDOMNode*,eventid_t,VARIANT*);
|
2008-06-23 16:54:33 +02:00
|
|
|
eventid_t str_to_eid(LPCWSTR);
|
2008-04-18 20:16:35 +02:00
|
|
|
|
2008-03-23 02:16:03 +01:00
|
|
|
void set_document_bscallback(HTMLDocument*,nsChannelBSC*);
|
2007-06-11 17:27:19 +02:00
|
|
|
void set_current_mon(HTMLDocument*,IMoniker*);
|
2008-03-23 02:16:03 +01:00
|
|
|
HRESULT start_binding(HTMLDocument*,BSCallback*,IBindCtx*);
|
|
|
|
|
2008-04-17 02:30:40 +02:00
|
|
|
HRESULT bind_mon_to_buffer(HTMLDocument*,IMoniker*,void**,DWORD*);
|
2006-02-15 11:52:33 +01:00
|
|
|
|
2008-03-23 02:16:03 +01:00
|
|
|
nsChannelBSC *create_channelbsc(IMoniker*);
|
|
|
|
HRESULT channelbsc_load_stream(nsChannelBSC*,IStream*);
|
|
|
|
void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*);
|
|
|
|
IMoniker *get_channelbsc_mon(nsChannelBSC*);
|
2008-03-23 02:15:20 +01:00
|
|
|
|
2007-08-15 19:17:49 +02:00
|
|
|
IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*);
|
2007-08-17 02:37:01 +02:00
|
|
|
IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument*,nsIDOMRange*);
|
2006-11-17 13:05:01 +01:00
|
|
|
IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration*);
|
2007-11-25 19:08:40 +01:00
|
|
|
IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*);
|
2007-09-19 13:09:35 +02:00
|
|
|
IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*);
|
2006-02-13 13:26:00 +01:00
|
|
|
|
2007-08-15 19:17:49 +02:00
|
|
|
void detach_selection(HTMLDocument*);
|
2007-08-17 02:37:01 +02:00
|
|
|
void detach_ranges(HTMLDocument*);
|
2007-08-15 19:17:49 +02:00
|
|
|
|
2008-06-19 23:13:16 +02:00
|
|
|
HTMLDOMNode *HTMLDOMTextNode_Create(HTMLDocument*,nsIDOMNode*);
|
2008-04-24 18:25:34 +02:00
|
|
|
|
2008-06-19 23:14:57 +02:00
|
|
|
HTMLElement *HTMLElement_Create(HTMLDocument*,nsIDOMNode*,BOOL);
|
2008-06-19 23:13:16 +02:00
|
|
|
HTMLElement *HTMLCommentElement_Create(HTMLDocument*,nsIDOMNode*);
|
2007-09-15 16:04:57 +02:00
|
|
|
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement*);
|
2007-09-15 16:05:34 +02:00
|
|
|
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement*);
|
2008-05-01 17:36:28 +02:00
|
|
|
HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement*);
|
2007-09-15 16:06:36 +02:00
|
|
|
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement*);
|
2007-10-04 02:13:39 +02:00
|
|
|
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement*);
|
2008-03-03 01:20:27 +01:00
|
|
|
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement*);
|
2007-09-15 16:07:01 +02:00
|
|
|
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement*);
|
2007-11-30 13:29:02 +01:00
|
|
|
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement*);
|
2007-09-15 16:07:26 +02:00
|
|
|
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement*);
|
2008-06-19 23:14:57 +02:00
|
|
|
HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement*);
|
2006-03-05 20:39:59 +01:00
|
|
|
|
2008-06-19 23:13:16 +02:00
|
|
|
void HTMLDOMNode_Init(HTMLDocument*,HTMLDOMNode*,nsIDOMNode*);
|
2007-12-04 13:37:00 +01:00
|
|
|
void HTMLElement_Init(HTMLElement*);
|
2006-03-23 21:38:38 +01:00
|
|
|
void HTMLElement2_Init(HTMLElement*);
|
2007-09-15 16:07:52 +02:00
|
|
|
void HTMLTextContainer_Init(HTMLTextContainer*);
|
2006-04-28 19:57:28 +02:00
|
|
|
|
2006-03-18 19:43:05 +01:00
|
|
|
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**);
|
2007-10-04 02:09:48 +02:00
|
|
|
void HTMLDOMNode_destructor(HTMLDOMNode*);
|
|
|
|
|
2007-10-04 02:10:36 +02:00
|
|
|
HRESULT HTMLElement_QI(HTMLDOMNode*,REFIID,void**);
|
2007-10-04 02:09:48 +02:00
|
|
|
void HTMLElement_destructor(HTMLDOMNode*);
|
2006-03-18 19:43:05 +01:00
|
|
|
|
2008-04-17 22:52:49 +02:00
|
|
|
HTMLDOMNode *get_node(HTMLDocument*,nsIDOMNode*,BOOL);
|
2006-03-05 20:38:30 +01:00
|
|
|
void release_nodes(HTMLDocument*);
|
|
|
|
|
2008-03-25 02:10:47 +01:00
|
|
|
void release_script_hosts(HTMLDocument*);
|
2008-03-28 19:01:15 +01:00
|
|
|
void connect_scripts(HTMLDocument*);
|
2008-03-25 02:10:47 +01:00
|
|
|
void doc_insert_script(HTMLDocument*,nsIDOMHTMLScriptElement*);
|
2008-04-18 20:16:35 +02:00
|
|
|
IDispatch *script_parse_event(HTMLDocument*,LPCWSTR);
|
2008-03-25 02:10:47 +01:00
|
|
|
|
2007-10-04 02:13:01 +02:00
|
|
|
IHTMLElementCollection *create_all_collection(HTMLDOMNode*);
|
2008-07-11 23:45:04 +02:00
|
|
|
IHTMLElementCollection *create_collection_from_nodelist(HTMLDocument*,IUnknown*,nsIDOMNodeList*);
|
2007-10-04 02:13:01 +02:00
|
|
|
|
2007-06-10 11:49:12 +02:00
|
|
|
/* commands */
|
2007-06-10 11:26:47 +02:00
|
|
|
typedef struct {
|
|
|
|
DWORD id;
|
|
|
|
HRESULT (*query)(HTMLDocument*,OLECMD*);
|
|
|
|
HRESULT (*exec)(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
|
|
|
} cmdtable_t;
|
|
|
|
|
2007-06-10 11:28:52 +02:00
|
|
|
extern const cmdtable_t editmode_cmds[];
|
|
|
|
|
2007-09-26 20:45:31 +02:00
|
|
|
void do_ns_command(NSContainer*,const char*,nsICommandParams*);
|
|
|
|
|
2007-06-10 11:49:12 +02:00
|
|
|
/* timer */
|
2007-06-10 11:38:51 +02:00
|
|
|
#define UPDATE_UI 0x0001
|
|
|
|
#define UPDATE_TITLE 0x0002
|
|
|
|
|
|
|
|
void update_doc(HTMLDocument *This, DWORD flags);
|
2007-06-10 11:39:39 +02:00
|
|
|
void update_title(HTMLDocument*);
|
2007-06-10 11:38:51 +02:00
|
|
|
|
2006-11-24 10:17:54 +01:00
|
|
|
/* editor */
|
2007-06-10 11:44:38 +02:00
|
|
|
void init_editor(HTMLDocument*);
|
2007-06-10 11:35:11 +02:00
|
|
|
void set_ns_editmode(NSContainer*);
|
2006-11-30 23:32:05 +01:00
|
|
|
void handle_edit_event(HTMLDocument*,nsIDOMEvent*);
|
2007-06-11 00:28:48 +02:00
|
|
|
HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
2007-06-11 00:30:30 +02:00
|
|
|
HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
2007-06-11 00:29:53 +02:00
|
|
|
HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
|
2008-01-10 12:53:38 +01:00
|
|
|
void handle_edit_load(HTMLDocument*);
|
2007-09-12 11:42:01 +02:00
|
|
|
HRESULT editor_is_dirty(HTMLDocument*);
|
2008-01-10 12:53:38 +01:00
|
|
|
void set_dirty(HTMLDocument*,VARIANT_BOOL);
|
2006-11-30 23:32:05 +01:00
|
|
|
|
2006-09-24 23:10:38 +02:00
|
|
|
extern DWORD mshtml_tls;
|
|
|
|
|
2006-09-24 23:12:06 +02:00
|
|
|
typedef struct task_t {
|
|
|
|
HTMLDocument *doc;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
TASK_SETDOWNLOADSTATE,
|
2006-11-02 17:34:01 +01:00
|
|
|
TASK_PARSECOMPLETE,
|
2007-02-10 17:36:13 +01:00
|
|
|
TASK_SETPROGRESS,
|
|
|
|
TASK_START_BINDING
|
2006-09-24 23:12:06 +02:00
|
|
|
} task_id;
|
|
|
|
|
2008-03-23 02:17:17 +01:00
|
|
|
nsChannelBSC *bscallback;
|
2007-02-10 17:36:13 +01:00
|
|
|
|
2006-09-24 23:12:06 +02:00
|
|
|
struct task_t *next;
|
|
|
|
} task_t;
|
|
|
|
|
2006-09-24 23:10:38 +02:00
|
|
|
typedef struct {
|
|
|
|
HWND thread_hwnd;
|
2006-09-24 23:12:06 +02:00
|
|
|
task_t *task_queue_head;
|
|
|
|
task_t *task_queue_tail;
|
2008-04-21 18:21:19 +02:00
|
|
|
struct list timer_list;
|
2006-09-24 23:10:38 +02:00
|
|
|
} thread_data_t;
|
|
|
|
|
|
|
|
thread_data_t *get_thread_data(BOOL);
|
|
|
|
HWND get_thread_hwnd(void);
|
2006-09-24 23:12:06 +02:00
|
|
|
void push_task(task_t*);
|
2007-05-30 23:38:03 +02:00
|
|
|
void remove_doc_tasks(const HTMLDocument*);
|
2008-06-27 21:11:38 +02:00
|
|
|
DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*);
|
2008-06-27 21:14:40 +02:00
|
|
|
HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD);
|
2006-09-24 23:10:38 +02:00
|
|
|
|
2008-04-17 02:32:18 +02:00
|
|
|
HRESULT get_typeinfo(tid_t,ITypeInfo**);
|
|
|
|
void release_typelib(void);
|
2008-04-21 00:48:18 +02:00
|
|
|
void call_disp_func(HTMLDocument*,IDispatch*);
|
2007-07-31 00:53:10 +02:00
|
|
|
|
2005-06-27 11:50:56 +02:00
|
|
|
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_ResProtocol, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
|
|
|
DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
|
|
|
|
|
2006-05-24 17:58:27 +02:00
|
|
|
DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
|
|
|
|
|
2005-08-02 11:49:06 +02:00
|
|
|
extern LONG module_ref;
|
|
|
|
#define LOCK_MODULE() InterlockedIncrement(&module_ref)
|
|
|
|
#define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
|
|
|
|
|
2006-07-16 23:21:36 +02:00
|
|
|
/* memory allocation functions */
|
|
|
|
|
2007-12-05 21:52:31 +01:00
|
|
|
static inline void *heap_alloc(size_t len)
|
2006-07-16 23:21:36 +02:00
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), 0, len);
|
|
|
|
}
|
|
|
|
|
2007-12-05 21:52:31 +01:00
|
|
|
static inline void *heap_alloc_zero(size_t len)
|
2006-09-24 23:10:38 +02:00
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
|
|
|
}
|
|
|
|
|
2007-12-05 21:52:31 +01:00
|
|
|
static inline void *heap_realloc(void *mem, size_t len)
|
2006-07-16 23:21:36 +02:00
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
|
|
|
}
|
|
|
|
|
2007-12-05 21:52:31 +01:00
|
|
|
static inline BOOL heap_free(void *mem)
|
2006-07-16 23:21:36 +02:00
|
|
|
{
|
|
|
|
return HeapFree(GetProcessHeap(), 0, mem);
|
|
|
|
}
|
|
|
|
|
2007-12-31 01:32:48 +01:00
|
|
|
static inline LPWSTR heap_strdupW(LPCWSTR str)
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
size = (strlenW(str)+1)*sizeof(WCHAR);
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2008-03-26 15:24:03 +01:00
|
|
|
static inline char *heap_strdupA(const char *str)
|
|
|
|
{
|
|
|
|
char *ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
size = strlen(str)+1;
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2008-02-01 15:31:19 +01:00
|
|
|
static inline WCHAR *heap_strdupAtoW(const char *str)
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
|
|
|
|
ret = heap_alloc(len*sizeof(WCHAR));
|
2008-03-26 15:24:20 +01:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
|
2008-02-01 15:31:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2007-12-31 01:32:48 +01:00
|
|
|
|
2008-03-26 15:24:03 +01:00
|
|
|
static inline char *heap_strdupWtoA(LPCWSTR str)
|
|
|
|
{
|
|
|
|
char *ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2006-11-09 23:54:09 +01:00
|
|
|
HINSTANCE get_shdoclc(void);
|
|
|
|
|
2005-04-14 13:30:50 +02:00
|
|
|
extern HINSTANCE hInst;
|