2005-03-31 12:08:02 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2005 Jacek Caban
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
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"
|
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"
|
|
|
|
|
|
|
|
#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)
|
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
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
typedef struct NSContainer NSContainer;
|
2005-08-09 22:46:05 +02:00
|
|
|
typedef struct BindStatusCallback BindStatusCallback;
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2005-04-11 18:11:52 +02:00
|
|
|
typedef struct {
|
2005-06-28 12:53:42 +02:00
|
|
|
const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
|
2005-12-12 11:51:43 +01:00
|
|
|
const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl;
|
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;
|
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;
|
|
|
|
|
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;
|
2005-04-14 13:30:50 +02:00
|
|
|
|
|
|
|
HWND hwnd;
|
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;
|
2005-08-09 22:46:05 +02:00
|
|
|
|
|
|
|
BindStatusCallback *status_callback;
|
2005-04-11 18:11:52 +02:00
|
|
|
} HTMLDocument;
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
struct NSContainer {
|
2005-08-25 21:24:58 +02:00
|
|
|
const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl;
|
|
|
|
const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl;
|
2005-09-02 14:19:42 +02:00
|
|
|
const nsIURIContentListenerVtbl *lpURIContentListenerVtbl;
|
2005-12-09 11:23:58 +01:00
|
|
|
const nsIEmbeddingSiteWindowVtbl *lpEmbeddingSiteWindowVtbl;
|
2005-08-25 21:24:58 +02:00
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
nsIWebBrowser *webbrowser;
|
|
|
|
nsIWebNavigation *navigation;
|
|
|
|
nsIBaseWindow *window;
|
2005-08-11 20:36:48 +02:00
|
|
|
nsIWebBrowserStream *stream;
|
2005-08-26 12:05:52 +02:00
|
|
|
nsIWebBrowserFocus *focus;
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2005-08-25 21:24:58 +02:00
|
|
|
HTMLDocument *doc;
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
HWND hwnd;
|
2005-09-02 14:19:42 +02:00
|
|
|
|
|
|
|
LPOLESTR url; /* hack */
|
2005-08-01 12:59:45 +02: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)
|
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-09 22:46:05 +02:00
|
|
|
#define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
|
2005-08-27 11:25:56 +02:00
|
|
|
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
|
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)
|
2005-08-25 21:24:58 +02:00
|
|
|
|
2005-07-13 13:29:53 +02:00
|
|
|
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
|
2005-04-11 18:11:52 +02:00
|
|
|
|
2005-03-31 12:08:02 +02:00
|
|
|
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
|
2005-04-11 18:11:52 +02:00
|
|
|
|
2005-12-12 11:51:43 +01:00
|
|
|
void HTMLDocument_HTMLDocument3_Init(HTMLDocument*);
|
2005-04-11 18:11:52 +02:00
|
|
|
void HTMLDocument_Persist_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*);
|
2005-08-01 12:59:45 +02:00
|
|
|
void HTMLDocument_NSContainer_Init(HTMLDocument*);
|
|
|
|
|
|
|
|
void HTMLDocument_NSContainer_Destroy(HTMLDocument*);
|
2005-04-14 13:30:50 +02:00
|
|
|
|
2005-08-22 16:07:49 +02:00
|
|
|
void HTMLDocument_LockContainer(HTMLDocument*,BOOL);
|
2005-08-25 21:24:58 +02:00
|
|
|
void HTMLDocument_ShowContextMenu(HTMLDocument*,DWORD,POINT*);
|
2005-09-02 14:19:42 +02:00
|
|
|
BOOL HTMLDocument_OnLoad(HTMLDocument*,LPCWSTR);
|
2005-08-22 16:07:49 +02:00
|
|
|
|
2005-06-27 11:50:56 +02:00
|
|
|
HRESULT ProtocolFactory_Create(REFCLSID,REFIID,void**);
|
|
|
|
|
2005-08-01 12:59:45 +02:00
|
|
|
void close_gecko(void);
|
2005-12-09 11:51:02 +01:00
|
|
|
void register_nsservice(nsIComponentRegistrar*);
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2005-08-11 20:36:48 +02:00
|
|
|
nsIURI *get_nsIURI(LPCWSTR);
|
|
|
|
|
|
|
|
nsACString *nsACString_Create(void);
|
|
|
|
void nsACString_SetData(nsACString*,const char*);
|
|
|
|
void nsACString_Destroy(nsACString*);
|
|
|
|
|
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);
|
|
|
|
|
2005-08-02 11:49:06 +02:00
|
|
|
extern LONG module_ref;
|
|
|
|
#define LOCK_MODULE() InterlockedIncrement(&module_ref)
|
|
|
|
#define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
|
|
|
|
|
2005-04-14 13:30:50 +02:00
|
|
|
extern HINSTANCE hInst;
|