Link to common activex lib, implement get_all functionality. b=206901 r=dbradley@netscape.com sr=alecf@netscape.com
git-svn-id: svn://10.0.0.236/trunk@143670 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -233,7 +233,7 @@ END_COM_MAP()
|
||||
//
|
||||
NPError NPP_Initialize(void)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_Initialize);
|
||||
ATLTRACE(_T("NPP_Initialize()\n"));
|
||||
_Module.Lock();
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
@@ -245,7 +245,7 @@ NPError NPP_Initialize(void)
|
||||
//
|
||||
void NPP_Shutdown(void)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_Shutdown);
|
||||
ATLTRACE(_T("NPP_Shutdown()\n"));
|
||||
#ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
|
||||
liveconnect_Shutdown();
|
||||
#endif
|
||||
@@ -259,7 +259,7 @@ void NPP_Shutdown(void)
|
||||
//
|
||||
jref NPP_GetJavaClass(void)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_GetJavaClass);
|
||||
ATLTRACE(_T("NPP_GetJavaClass()\n"));
|
||||
#ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
|
||||
return liveconnect_GetJavaClass();
|
||||
#endif
|
||||
@@ -939,7 +939,7 @@ NPError NP_LOADDS NPP_New(NPMIMEType pluginType,
|
||||
char* argv[],
|
||||
NPSavedData* saved)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_New);
|
||||
ATLTRACE(_T("NPP_New()\n"));
|
||||
|
||||
// trap duff args
|
||||
if (instance == NULL)
|
||||
@@ -998,7 +998,7 @@ NPError NP_LOADDS NPP_New(NPMIMEType pluginType,
|
||||
NPError NP_LOADDS
|
||||
NPP_Destroy(NPP instance, NPSavedData** save)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_Destroy);
|
||||
ATLTRACE(_T("NPP_Destroy()\n"));
|
||||
|
||||
PluginInstanceData *pData = (PluginInstanceData *) instance->pdata;
|
||||
if (pData == NULL)
|
||||
@@ -1069,7 +1069,7 @@ NPP_Destroy(NPP instance, NPSavedData** save)
|
||||
NPError NP_LOADDS
|
||||
NPP_SetWindow(NPP instance, NPWindow* window)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_SetWindow);
|
||||
ATLTRACE(_T("NPP_SetWindow()\n"));
|
||||
|
||||
// Reject silly parameters
|
||||
if (!window)
|
||||
@@ -1140,7 +1140,7 @@ NPP_NewStream(NPP instance,
|
||||
NPBool seekable,
|
||||
uint16 *stype)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_NewStream);
|
||||
ATLTRACE(_T("NPP_NewStream()\n"));
|
||||
|
||||
if(!instance)
|
||||
{
|
||||
@@ -1162,7 +1162,7 @@ NPP_NewStream(NPP instance,
|
||||
void NP_LOADDS
|
||||
NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname)
|
||||
{
|
||||
NG_TRACE_METHOD(NPP_StreamAsFile);
|
||||
ATLTRACE(_T("NPP_StreamAsFile()\n"));
|
||||
|
||||
if(fname == NULL || fname[0] == NULL)
|
||||
{
|
||||
|
||||
@@ -58,16 +58,10 @@ enum PluginInstanceType
|
||||
struct PluginInstanceData {
|
||||
NPP pPluginInstance;
|
||||
PluginInstanceType nType;
|
||||
union
|
||||
{
|
||||
CActiveScriptSiteInstance *pScriptSite;
|
||||
struct {
|
||||
CControlSiteInstance *pControlSite;
|
||||
CControlSiteInstance *pControlSite;
|
||||
#ifdef XPC_IDISPATCH_SUPPORT
|
||||
nsEventSinkInstance *pControlEventSink;
|
||||
nsEventSinkInstance *pControlEventSink;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
char *szUrl;
|
||||
char *szContentType;
|
||||
CLSID clsid;
|
||||
|
||||
@@ -51,6 +51,7 @@ REQUIRES = \
|
||||
webshell \
|
||||
necko \
|
||||
windowwatcher \
|
||||
ax_common \
|
||||
$(NULL)
|
||||
|
||||
ifdef XPC_IDISPATCH_SUPPORT
|
||||
@@ -65,8 +66,8 @@ FORCE_SHARED_LIB = 1
|
||||
NO_DIST_INSTALL = 1
|
||||
NO_INSTALL = 1
|
||||
|
||||
# Path to the Mozilla ActiveX control (some files are copied from there)
|
||||
MOZCTLSRC=$(srcdir)/../control
|
||||
# Path to the Mozilla ActiveX common dir (some files are copied from there)
|
||||
AXCOMMONSRC=$(srcdir)/../common
|
||||
|
||||
############
|
||||
# LiveConnect settings
|
||||
@@ -104,6 +105,12 @@ MOZ_ACTIVEX_PLUGIN_XPCONNECT = 1
|
||||
|
||||
# XPConnect support in (Netscape 6.1+/Mozilla)
|
||||
|
||||
# Uncomment this line to install the plugin & policy
|
||||
# MOZ_USE_ACTIVEX_PLUGIN = 1
|
||||
|
||||
# Settings will also be read from this supplemental file if it exists
|
||||
-include $(srcdir)/plugin.mk
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -113,23 +120,13 @@ XPIDLSRCS = \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
_CONTROL_CPPSRCS = \
|
||||
ActiveScriptSite.cpp \
|
||||
ControlEventSink.cpp \
|
||||
ControlSite.cpp \
|
||||
ControlSiteIPFrame.cpp \
|
||||
ItemContainer.cpp \
|
||||
PropertyBag.cpp \
|
||||
$(NULL)
|
||||
|
||||
GARBAGE += $(addprefix $(srcdir)/,$(_CONTROL_CPPSRCS)) $(DEFFILE)
|
||||
GARBAGE += $(DEFFILE)
|
||||
|
||||
CPPSRCS = \
|
||||
StdAfx.cpp \
|
||||
LegacyPlugin.cpp \
|
||||
MozActiveX.cpp \
|
||||
npwin.cpp \
|
||||
$(_CONTROL_CPPSRCS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
|
||||
@@ -137,7 +134,15 @@ CPPSRCS += XPConnect.cpp XPCDocument.cpp XPCBrowser.cpp
|
||||
endif
|
||||
|
||||
ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
|
||||
CPPSRCS += LiveConnect.cpp
|
||||
_AXCOMMON_CPPSRCS = \
|
||||
ActiveScriptSite.cpp \
|
||||
ControlEventSink.cpp \
|
||||
ControlSite.cpp \
|
||||
ControlSiteIPFrame.cpp \
|
||||
ItemContainer.cpp \
|
||||
PropertyBag.cpp \
|
||||
$(NULL)
|
||||
CPPSRCS += LiveConnect.cpp $(_AXCOMMON_CPPSRCS)
|
||||
CSRCS += javastubs.c
|
||||
endif
|
||||
|
||||
@@ -145,7 +150,7 @@ ifdef XPC_IDISPATCH_SUPPORT
|
||||
CPPSRCS += PrefObserver.cpp
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir) -I$(MOZCTLSRC)
|
||||
LOCAL_INCLUDES = -I$(srcdir) -I$(AXCOMMONSRC)
|
||||
|
||||
ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
|
||||
LOCAL_INCLUDES += -I./_java
|
||||
@@ -164,50 +169,63 @@ OS_LIBS += \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
|
||||
DEFINES += -DMOZ_ACTIVEX_PLUGIN_LIVECONNECT
|
||||
DEFINES += -DMOZ_ACTIVEX_PLUGIN_LIVECONNECT -DXPCOM_GLUE
|
||||
endif
|
||||
|
||||
ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
|
||||
DEFINES += -DMOZ_ACTIVEX_PLUGIN_XPCONNECT -DXPCOM_GLUE
|
||||
DEFINES += -DMOZ_ACTIVEX_PLUGIN_XPCONNECT
|
||||
endif
|
||||
|
||||
ifdef XPC_IDISPATCH_SUPPORT
|
||||
DEFINES += -DXPC_IDISPATCH_SUPPORT
|
||||
endif
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_obsolete_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)embedstring_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(NSPR_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef XPC_IDISPATCH_SUPPORT
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_obsolete_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)embedstring_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
|
||||
$(NSPR_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
# LiveConnect links to XPCOM glue
|
||||
ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)embedstring_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_obsolete_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)
|
||||
LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)embedstring_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)string_obsolete_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
# XPConnect links to XPCOM and the shared activex lib
|
||||
ifdef XPC_IDISPATCH_SUPPORT
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)ax_common_s.$(LIB_SUFFIX) \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(XPCOM_LIBS) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
SRCS_IN_OBJDIR = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
CXXFLAGS += -GX
|
||||
|
||||
ifdef MOZ_ACTIVEX_PLUGIN_LIVCONNECT
|
||||
copy-sources: $(addprefix $(MOZCTLSRC)/,$(_CONTROL_CPPSRCS))
|
||||
$(INSTALL) $^ .
|
||||
|
||||
export:: copy-sources
|
||||
endif
|
||||
|
||||
install-plugin: $(SHARED_LIBRARY)
|
||||
ifdef SHARED_LIBRARY
|
||||
|
||||
@@ -84,16 +84,12 @@ extern CComModule _Module;
|
||||
// New winsock2.h doesn't define this anymore
|
||||
typedef long int32;
|
||||
|
||||
#include "ActiveXTypes.h"
|
||||
#include "BrowserDiagnostics.h"
|
||||
|
||||
#include "PropertyList.h"
|
||||
#include "PropertyBag.h"
|
||||
#include "ItemContainer.h"
|
||||
#include "ControlSite.h"
|
||||
#include "ControlSiteIPFrame.h"
|
||||
#include "ControlEventSink.h"
|
||||
#include "ActiveScriptSite.h"
|
||||
|
||||
#include "npapi.h"
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ public:
|
||||
#include "XPCBrowser.h"
|
||||
#include "LegacyPlugin.h"
|
||||
|
||||
#include "IEHtmlElementCollection.h"
|
||||
#include "IHTMLLocationImpl.h"
|
||||
|
||||
/*
|
||||
@@ -1083,7 +1084,28 @@ END_COM_MAP()
|
||||
virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_all(
|
||||
/* [out][retval] */ IHTMLElementCollection **p)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
// Validate parameters
|
||||
if (p == NULL)
|
||||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
*p = NULL;
|
||||
|
||||
// Create a collection object
|
||||
CIEHtmlElementCollectionInstance *pCollection = NULL;
|
||||
CIEHtmlElementCollectionInstance::CreateInstance(&pCollection);
|
||||
if (pCollection == NULL)
|
||||
{
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
// Initialise and populate the collection
|
||||
nsCOMPtr<nsIDOMNode> docNode = do_QueryInterface(mDOMDocument);
|
||||
pCollection->PopulateFromDOMNode(docNode, PR_TRUE);
|
||||
pCollection->QueryInterface(IID_IHTMLElementCollection, (void **) p);
|
||||
|
||||
return *p ? S_OK : E_UNEXPECTED;
|
||||
}
|
||||
|
||||
virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_body(
|
||||
|
||||
@@ -39,7 +39,10 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifdef XPCOM_GLUE
|
||||
#include "nsXPCOMGlue.h"
|
||||
#endif
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIServiceManagerUtils.h"
|
||||
@@ -71,7 +74,9 @@
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsIDOMLocation.h"
|
||||
#include "nsNetUtil.h"
|
||||
#ifdef XPCOM_GLUE
|
||||
#include "nsEmbedString.h"
|
||||
#endif
|
||||
#include "nsIURI.h"
|
||||
#endif
|
||||
|
||||
@@ -927,7 +932,9 @@ void MozAxPlugin::AddRef()
|
||||
{
|
||||
if (gInstances == 0)
|
||||
{
|
||||
#ifdef XPCOM_GLUE
|
||||
XPCOMGlueStartup(nsnull);
|
||||
#endif
|
||||
MozAxPlugin::PrefGetHostingFlags(); // Initial call to set it up
|
||||
}
|
||||
gInstances++;
|
||||
@@ -940,7 +947,9 @@ void MozAxPlugin::Release()
|
||||
#ifdef XPC_IDISPATCH_SUPPORT
|
||||
MozAxPlugin::ReleasePrefObserver();
|
||||
#endif
|
||||
#ifdef XPCOM_GLUE
|
||||
XPCOMGlueShutdown();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -962,7 +971,11 @@ nsresult MozAxPlugin::GetCurrentLocation(NPP instance, nsIURI **aLocation)
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMLocation> location;
|
||||
#ifdef XPCOM_GLUE
|
||||
nsEmbedString href;
|
||||
#else
|
||||
nsAutoString href;
|
||||
#endif
|
||||
windowInternal->GetLocation(getter_AddRefs(location));
|
||||
if (!location ||
|
||||
NS_FAILED(location->GetHref(href)))
|
||||
|
||||
Reference in New Issue
Block a user