** NOT PART OF TBOX BUILDS**
Upgraded blackConnect for M16. Added make files for win git-svn-id: svn://10.0.0.236/trunk@74148 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
33
mozilla/java/xpcom/connect/makefile.win
Normal file
33
mozilla/java/xpcom/connect/makefile.win
Normal file
@@ -0,0 +1,33 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Sun Microsystems,
|
||||
# Inc. Portions created by Sun are
|
||||
# Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
|
||||
DIRS= \
|
||||
src \
|
||||
xpcom \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ enum bcXPType {
|
||||
bc_T_IID ,
|
||||
bc_T_CHAR_STR, bc_T_WCHAR_STR,
|
||||
bc_T_ARRAY,
|
||||
bc_T_INTERFACE
|
||||
bc_T_INTERFACE,
|
||||
bc_T_UNDEFINED
|
||||
};
|
||||
|
||||
typedef long bcOID;
|
||||
|
||||
@@ -22,7 +22,12 @@
|
||||
|
||||
#ifndef __Call_h
|
||||
#define __Call_h
|
||||
|
||||
#ifdef WIN32
|
||||
#include <strstrea.h>
|
||||
#else
|
||||
#include <strstream.h>
|
||||
#endif
|
||||
#include "bcICall.h"
|
||||
|
||||
class Call : public bcICall {
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
*/
|
||||
|
||||
#include <iostream.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include <string.h>
|
||||
#include "Marshaler.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -56,7 +57,7 @@ int Marshaler::WriteArray(void *ptr, size_t length, bcXPType type) {
|
||||
case bc_T_CHAR_STR:
|
||||
case bc_T_WCHAR_STR:
|
||||
{
|
||||
for (int i = 0; i < length; i++) {
|
||||
for (unsigned int i = 0; i < length; i++) {
|
||||
char *str = ((char**)ptr)[i];
|
||||
size_t size = (!str) ? 0 : strlen(str)+1; //we want to store \0
|
||||
WriteString((void *)str, size);
|
||||
|
||||
@@ -60,7 +60,7 @@ int UnMarshaler::ReadArray(void *ptr, size_t *length, bcXPType type, bcIAllocato
|
||||
char **strArray = *(char***)ptr;
|
||||
*strArray = (char*)allocator->Alloc(*length * sizeof(char*));
|
||||
|
||||
for (int i = 0; i < *length; i++) {
|
||||
for (unsigned int i = 0; i < *length; i++) {
|
||||
char * str;
|
||||
size_t size;
|
||||
ReadString((void*)&str, &size, allocator);
|
||||
|
||||
62
mozilla/java/xpcom/connect/src/makefile.win
Normal file
62
mozilla/java/xpcom/connect/src/makefile.win
Normal file
@@ -0,0 +1,62 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Sun Microsystems,
|
||||
# Inc. Portions created by Sun are
|
||||
# Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = lib
|
||||
LIBRARY_NAME = bcorbcore
|
||||
LIB=.\$(OBJDIR)\bcorbcore.lib
|
||||
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\Allocator.obj \
|
||||
.\$(OBJDIR)\Call.obj \
|
||||
.\$(OBJDIR)\Marshaler.obj \
|
||||
.\$(OBJDIR)\ORB.obj \
|
||||
.\$(OBJDIR)\UnMarshaler.obj \
|
||||
.\$(OBJDIR)\util.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
..\public\bcIORB.h \
|
||||
..\public\bcDefs.h \
|
||||
..\public\bcICall.h \
|
||||
..\public\bcIUnMarshaler.h \
|
||||
..\public\bcIAllocator.h \
|
||||
..\public\bcIMarshaler.h \
|
||||
..\public\bcIStub.h \
|
||||
..\public\bcIThread.h
|
||||
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
|
||||
|
||||
INCS = \
|
||||
-I..\public -I..\src \
|
||||
$(INCS) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(LIB)
|
||||
$(MAKE_INSTALL) $(LIB) $(DIST)\lib
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
@@ -34,14 +34,14 @@ LIBRARY_NAME = bcorb
|
||||
MODULE = bcorb
|
||||
IS_COMPONENT = 1
|
||||
|
||||
CPPSRCS = \
|
||||
bcORB.cpp \
|
||||
../src/Allocator.cpp \
|
||||
../src/Call.cpp \
|
||||
../src/Marshaler.cpp \
|
||||
../src/ORB.cpp \
|
||||
../src/UnMarshaler.cpp \
|
||||
../src/util.cpp \
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\bcORB.cpp \
|
||||
..\$(OBJDIR)\src\Allocator.cpp \
|
||||
..\$(OBJDIR)\src\Call.cpp \
|
||||
..\$(OBJDIR)\src\Marshaler.cpp \
|
||||
..\$(OBJDIR)\src\ORB.cpp \
|
||||
..\$(OBJDIR)\src\UnMarshaler.cpp \
|
||||
..\$(OBJDIR)\src\util.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
@@ -58,18 +58,6 @@ EXPORTS = \
|
||||
|
||||
CXXFLAGS += -I../public -I../src
|
||||
|
||||
DSO_LDOPTS += \
|
||||
-L$(JDKHOME)/jre/lib/$(HOSTTYPE)/ \
|
||||
-L$(JDKHOME)/jre/lib/$(HOSTTYPE)/classic \
|
||||
-ljava -ljvm \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(OS_ARCH), Linux)
|
||||
DSO_LDOPTS += \
|
||||
-lthread -lXm -lX11 -lXt -lm
|
||||
endif
|
||||
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ NS_IMETHODIMP bcORB::GetORB(bcIORB **_orb) {
|
||||
orb = new ORB();
|
||||
}
|
||||
*_orb = orb;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* Contributor(s):
|
||||
* Igor Kushnirskiy <idk@eng.sun.com>
|
||||
*/
|
||||
|
||||
#ifndef _bcORB_h
|
||||
#define _bcORB_h
|
||||
#include "nsISupports.h"
|
||||
|
||||
47
mozilla/java/xpcom/connect/xpcom/makefile.win
Normal file
47
mozilla/java/xpcom/connect/xpcom/makefile.win
Normal file
@@ -0,0 +1,47 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Sun Microsystems,
|
||||
# Inc. Portions created by Sun are
|
||||
# Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
MODULE=bcorb
|
||||
COMPONENT = 1
|
||||
DLLNAME = bcorb
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\bcORB.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
bcORB.h \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib $(DIST)\lib\bcorbcore.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\components\$(DLLNAME).dll
|
||||
39
mozilla/java/xpcom/java/classes/makefile.win
Normal file
39
mozilla/java/xpcom/java/classes/makefile.win
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Sun Microsystems,
|
||||
# Inc. Portions created by Sun are
|
||||
# Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
IGNORE_MANIFEST=1
|
||||
DEPTH = ..\..\..\..
|
||||
|
||||
JAVA_OR_NSJVM=1
|
||||
NO_CAFE=1
|
||||
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
|
||||
JAR_PLUGLET_CLASSES = \
|
||||
org\mozilla\xpcom \
|
||||
$(NULL)
|
||||
|
||||
JDIRS = $(JAR_PLUGLET_CLASSES)
|
||||
JAVAC_PROG=$(JDKHOME)\bin\javac
|
||||
JAVAC_FLAGS=-classpath "$(CLASSPATH);$(JAVA_DESTPATH)" -d "$(JAVA_DESTPATH)"
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -23,6 +23,7 @@
|
||||
/*
|
||||
A bunch of stuff was copied from mozJSComponentLoader.cpp
|
||||
*/
|
||||
#include "nsICategoryManager.h"
|
||||
#include "bcJavaComponentLoader.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIModule.h"
|
||||
@@ -32,17 +33,19 @@
|
||||
#include "bcJavaModule.h"
|
||||
|
||||
|
||||
/*********************************************************************************/
|
||||
|
||||
//#include "bcIJavaSample.h"
|
||||
#include "unistd.h"
|
||||
#include "signal.h"
|
||||
|
||||
|
||||
/********************************************************************************/
|
||||
|
||||
const char javaComponentTypeName[] = JAVACOMPONENTTYPENAME;
|
||||
extern const char xpcomKeyName[];
|
||||
|
||||
/* XXX export properly from libxpcom, for now this will let Mac build */
|
||||
#ifdef RHAPSODY
|
||||
extern const char fileSizeValueName[]; // = "FileSize";
|
||||
extern const char lastModValueName[]; // = "LastModTimeStamp";
|
||||
extern const char xpcomKeyName[]; // = "Software/Mozilla/XPCOM";
|
||||
#else
|
||||
const char fileSizeValueName[] = "FileSize";
|
||||
const char lastModValueName[] = "LastModTimeStamp";
|
||||
const char xpcomKeyName[] = "software/mozilla/XPCOM/components";
|
||||
#endif
|
||||
|
||||
NS_IMPL_ISUPPORTS(bcJavaComponentLoader,NS_GET_IID(nsIComponentLoader));
|
||||
|
||||
@@ -50,7 +53,6 @@ bcJavaComponentLoader::bcJavaComponentLoader()
|
||||
: mCompMgr(NULL),
|
||||
|
||||
mXPCOMKey(0)
|
||||
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
printf("--bcJavaComponentLoader::bcJavaComponentLoader \n");
|
||||
@@ -126,12 +128,18 @@ NS_IMETHODIMP bcJavaComponentLoader::OnRegister(const nsIID & aCID, const char *
|
||||
/**
|
||||
* AutoRegister components in the given directory.
|
||||
*/
|
||||
/* void autoRegisterComponents (in long aWhen, in nsIFile aDirectory); */
|
||||
NS_IMETHODIMP bcJavaComponentLoader::AutoRegisterComponents(PRInt32 aWhen, nsIFile *aDirectory) {
|
||||
//printf("--bcJavaComponentLoader::AutoRegisterComponents \n");
|
||||
printf("--bcJavaComponentLoader::AutoRegisterComponents \n");
|
||||
return RegisterComponentsInDir(aWhen,aDirectory);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP bcJavaComponentLoader::AutoUnregisterComponent(PRInt32 when,
|
||||
nsIFile *component,
|
||||
PRBool *unregistered) {
|
||||
//nb need to impelement
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult bcJavaComponentLoader::RegisterComponentsInDir(PRInt32 when, nsIFile *dir)
|
||||
{
|
||||
nsresult rv;
|
||||
@@ -403,230 +411,56 @@ NS_IMETHODIMP bcJavaComponentLoader::UnloadAll(PRInt32 aWhen) { //nb
|
||||
|
||||
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(bcJavaComponentLoader)
|
||||
|
||||
static nsModuleComponentInfo components[] =
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
|
||||
/* XXX this should all be data-driven, via NS_IMPL_GETMODULE_WITH_CATEGORIES */
|
||||
static NS_METHOD
|
||||
RegisterJavaLoader(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
||||
const char *registryLocation, const char *componentType)
|
||||
{
|
||||
{
|
||||
"Java Component Loader",
|
||||
BC_JAVACOMPONENTLOADER_CID,
|
||||
BC_JAVACOMPONENTLOADER_PROGID,
|
||||
bcJavaComponentLoaderConstructor
|
||||
}
|
||||
};
|
||||
printf("--JavaLoader got registered\n");
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsICategoryManager> catman =
|
||||
do_GetService(NS_CATEGORYMANAGER_PROGID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsXPIDLCString previous;
|
||||
return catman->AddCategoryEntry("component-loader", javaComponentTypeName,
|
||||
BC_JAVACOMPONENTLOADER_PROGID,
|
||||
PR_TRUE, PR_TRUE, getter_Copies(previous));
|
||||
|
||||
|
||||
/* copied-and-pasted from mozJSComponentLoader */
|
||||
#include "nsHashtable.h"
|
||||
class bcJavaComponentLoaderModule : public nsIModule
|
||||
{
|
||||
public:
|
||||
bcJavaComponentLoaderModule(const char *moduleName, PRUint32 componentCount,
|
||||
nsModuleComponentInfo *components);
|
||||
virtual ~bcJavaComponentLoaderModule();
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIMODULE
|
||||
|
||||
protected:
|
||||
nsresult Initialize();
|
||||
|
||||
void Shutdown();
|
||||
|
||||
PRBool mInitialized;
|
||||
const char* mModuleName;
|
||||
PRUint32 mComponentCount;
|
||||
nsModuleComponentInfo* mComponents;
|
||||
nsSupportsHashtable mFactories;
|
||||
};
|
||||
|
||||
bcJavaComponentLoaderModule::bcJavaComponentLoaderModule(const char* moduleName, PRUint32 componentCount,
|
||||
nsModuleComponentInfo* aComponents)
|
||||
: mInitialized(PR_FALSE),
|
||||
mModuleName(moduleName),
|
||||
mComponentCount(componentCount),
|
||||
mComponents(aComponents),
|
||||
mFactories(8, PR_FALSE)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
bcJavaComponentLoaderModule::~bcJavaComponentLoaderModule()
|
||||
{
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(bcJavaComponentLoaderModule, nsIModule)
|
||||
|
||||
// Perform our one-time intialization for this module
|
||||
nsresult
|
||||
bcJavaComponentLoaderModule::Initialize()
|
||||
{
|
||||
if (mInitialized) {
|
||||
return NS_OK;
|
||||
}
|
||||
mInitialized = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Shutdown this module, releasing all of the module resources
|
||||
void
|
||||
bcJavaComponentLoaderModule::Shutdown()
|
||||
{
|
||||
// Release the factory objects
|
||||
mFactories.Reset();
|
||||
}
|
||||
|
||||
// Create a factory object for creating instances of aClass.
|
||||
NS_IMETHODIMP
|
||||
bcJavaComponentLoaderModule::GetClassObject(nsIComponentManager *aCompMgr,
|
||||
const nsCID& aClass,
|
||||
const nsIID& aIID,
|
||||
void** r_classObj)
|
||||
static NS_METHOD
|
||||
UnregisterJavaLoader(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
||||
const char *registryLocation)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsICategoryManager> catman =
|
||||
do_GetService(NS_CATEGORYMANAGER_PROGID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsXPIDLCString javaLoader;
|
||||
rv = catman->GetCategoryEntry("component-loader", javaComponentTypeName,
|
||||
getter_Copies(javaLoader));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Defensive programming: Initialize *r_classObj in case of error below
|
||||
if (!r_classObj) {
|
||||
return NS_ERROR_INVALID_POINTER;
|
||||
// only unregister if we're the current JS component loader
|
||||
if (!strcmp(javaLoader, BC_JAVACOMPONENTLOADER_PROGID)) {
|
||||
return catman->DeleteCategoryEntry("component-loader",
|
||||
javaComponentTypeName, PR_TRUE,
|
||||
getter_Copies(javaLoader));
|
||||
}
|
||||
*r_classObj = NULL;
|
||||
|
||||
// Do one-time-only initialization if necessary
|
||||
if (!mInitialized) {
|
||||
rv = Initialize();
|
||||
if (NS_FAILED(rv)) {
|
||||
// Initialization failed! yikes!
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
// Choose the appropriate factory, based on the desired instance
|
||||
// class type (aClass).
|
||||
nsIDKey key(aClass);
|
||||
nsCOMPtr<nsIGenericFactory> fact = getter_AddRefs(NS_REINTERPRET_CAST(nsIGenericFactory *, mFactories.Get(&key)));
|
||||
if (fact == nsnull) {
|
||||
nsModuleComponentInfo* desc = mComponents;
|
||||
for (PRUint32 i = 0; i < mComponentCount; i++) {
|
||||
if (desc->mCID.Equals(aClass)) {
|
||||
rv = NS_NewGenericFactory(getter_AddRefs(fact), desc->mConstructor);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
(void)mFactories.Put(&key, fact);
|
||||
goto found;
|
||||
}
|
||||
desc++;
|
||||
}
|
||||
// not found in descriptions
|
||||
#ifdef DEBUG
|
||||
char* cs = aClass.ToString();
|
||||
printf("+++ nsGenericModule %s: unable to create factory for %s\n", mModuleName, cs);
|
||||
nsCRT::free(cs);
|
||||
#endif
|
||||
// XXX put in stop-gap so that we don't search for this one again
|
||||
return NS_ERROR_FACTORY_NOT_REGISTERED;
|
||||
}
|
||||
found:
|
||||
rv = fact->QueryInterface(aIID, r_classObj);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
bcJavaComponentLoaderModule::RegisterSelf(nsIComponentManager *aCompMgr,
|
||||
nsIFile* aPath,
|
||||
const char* registryLocation,
|
||||
const char* componentType)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("*** Registering %s components (all right -- an almost-generic module!)\n", mModuleName);
|
||||
#endif
|
||||
|
||||
nsModuleComponentInfo* cp = mComponents;
|
||||
for (PRUint32 i = 0; i < mComponentCount; i++) {
|
||||
rv = aCompMgr->RegisterComponentSpec(cp->mCID, cp->mDescription,
|
||||
cp->mProgID, aPath, PR_TRUE,
|
||||
PR_TRUE);
|
||||
if (NS_FAILED(rv)) {
|
||||
#ifdef DEBUG
|
||||
printf("nsGenericModule %s: unable to register %s component => %x\n",
|
||||
mModuleName, cp->mDescription, rv);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
printf("JavaComponentLoaderModule::RegisterSelf \n");
|
||||
return aCompMgr->RegisterComponentLoader(javaComponentTypeName,
|
||||
BC_JAVACOMPONENTLOADER_PROGID,
|
||||
PR_TRUE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
bcJavaComponentLoaderModule::UnregisterSelf(nsIComponentManager* aCompMgr,
|
||||
nsIFile* aPath,
|
||||
const char* registryLocation)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("*** Unregistering %s components (all right -- an almost-generic module!)\n", mModuleName);
|
||||
#endif
|
||||
nsModuleComponentInfo* cp = mComponents;
|
||||
for (PRUint32 i = 0; i < mComponentCount; i++) {
|
||||
nsresult rv = aCompMgr->UnregisterComponentSpec(cp->mCID, aPath);
|
||||
if (NS_FAILED(rv)) {
|
||||
#ifdef DEBUG
|
||||
printf("nsGenericModule %s: unable to unregister %s component => %x\n",
|
||||
mModuleName, cp->mDescription, rv);
|
||||
#endif
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
bcJavaComponentLoaderModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
|
||||
{
|
||||
printf("--bcJavaComponentLoaderModule::CanUnload\n");
|
||||
if (!okToUnload) {
|
||||
return NS_ERROR_INVALID_POINTER;
|
||||
}
|
||||
*okToUnload = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(bcJavaComponentLoader);
|
||||
static nsModuleComponentInfo components[] = {
|
||||
{ "Java component loader", BC_JAVACOMPONENTLOADER_CID,
|
||||
BC_JAVACOMPONENTLOADER_PROGID,
|
||||
bcJavaComponentLoaderConstructor,
|
||||
RegisterJavaLoader, UnregisterJavaLoader }
|
||||
};
|
||||
|
||||
NS_EXPORT nsresult
|
||||
NS_NewJavaComponentLoaderModule(const char* moduleName,
|
||||
PRUint32 componentCount,
|
||||
nsModuleComponentInfo* aComponents,
|
||||
nsIModule* *result)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
NS_IMPL_NSGETMODULE("Java component loader", components);
|
||||
|
||||
NS_ASSERTION(result, "Null argument");
|
||||
|
||||
// Create and initialize the module instance
|
||||
bcJavaComponentLoaderModule *m = new bcJavaComponentLoaderModule(moduleName, componentCount, aComponents);
|
||||
if (!m) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// Increase refcnt and store away nsIModule interface to m in return_cobj
|
||||
rv = m->QueryInterface(NS_GET_IID(nsIModule), (void**)result);
|
||||
if (NS_FAILED(rv)) {
|
||||
delete m;
|
||||
m = nsnull;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *compMgr,
|
||||
nsIFile *location,
|
||||
nsIModule** result)
|
||||
{
|
||||
return NS_NewJavaComponentLoaderModule("bcJavaComponentLoaderModule",
|
||||
sizeof(components) / sizeof(components[0]),
|
||||
components, result);
|
||||
}
|
||||
|
||||
|
||||
46
mozilla/java/xpcom/java/loader/makefile.win
Normal file
46
mozilla/java/xpcom/java/loader/makefile.win
Normal file
@@ -0,0 +1,46 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
MODULE=bcjavaloader
|
||||
COMPONENT = 1
|
||||
DLLNAME = bcjavaloader
|
||||
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\bcJavaComponentLoader.obj \
|
||||
.\$(OBJDIR)\bcJavaModule.obj \
|
||||
.\$(OBJDIR)\bcJavaComponentFactory.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\components\$(DLLNAME).dll
|
||||
@@ -25,7 +25,12 @@
|
||||
|
||||
JavaVM *bcJavaGlobal::jvm = NULL;
|
||||
|
||||
#ifdef XP_PC
|
||||
#define PATH_SEPARATOR ';'
|
||||
#else
|
||||
#define PATH_SEPARATOR ':'
|
||||
#endif
|
||||
|
||||
JNIEnv * bcJavaGlobal::GetJNIEnv(void) {
|
||||
JNIEnv * res;
|
||||
if (!jvm) {
|
||||
@@ -53,6 +58,7 @@ void bcJavaGlobal::StartJVM() {
|
||||
/* Append USER_CLASSPATH to the default system class path */
|
||||
sprintf(classpath, "%s%c%s",
|
||||
vm_args.classpath, PATH_SEPARATOR, PR_GetEnv("CLASSPATH"));
|
||||
printf("--[c++] classpath %s\n",classpath);
|
||||
char **props = new char*[2];
|
||||
props[0]="java.compiler=NONE";
|
||||
props[1]=0;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
#ifndef __bcJavaGlobal_h_
|
||||
#define __bcJavaGlobal_h_
|
||||
#include "nscore.h"
|
||||
#include "jni.h"
|
||||
|
||||
class bcJavaGlobal {
|
||||
|
||||
@@ -116,7 +116,7 @@ nsresult bcJavaMarshalToolkit::UnMarshal(bcIUnMarshaler *um) {
|
||||
PRUint32 paramCount = info->GetParamCount();
|
||||
jobject value;
|
||||
void * data = allocator->Alloc(sizeof(nsXPTCMiniVariant)); // sizeof(nsXPTCMiniVariant) is ok
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
for (unsigned int i = 0; i < paramCount; i++) {
|
||||
nsXPTParamInfo param = info->GetParam(i);
|
||||
PRBool isOut = param.IsOut();
|
||||
nsXPTType type = param.GetType();
|
||||
@@ -230,6 +230,8 @@ bcXPType bcJavaMarshalToolkit::XPTType2bcXPType(uint8 type) {
|
||||
return bc_T_INTERFACE;
|
||||
case nsXPTType::T_ARRAY:
|
||||
return bc_T_ARRAY;
|
||||
default:
|
||||
return bc_T_UNDEFINED;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
#ifndef _bcJavaMarshalToolkit_h
|
||||
#define _bcJavaMarshalToolkit_h
|
||||
|
||||
#include "jni.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nscore.h"
|
||||
#include "xptcall.h"
|
||||
#include "nsISupports.h"
|
||||
#include "jni.h"
|
||||
#include "bcIMarshaler.h"
|
||||
#include "bcIUnMarshaler.h"
|
||||
#include "bcIORB.h"
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
* Igor Kushnirskiy <idk@eng.sun.com>
|
||||
*/
|
||||
|
||||
|
||||
#include "nscore.h"
|
||||
#include "xptcall.h"
|
||||
#include "bcJavaStub.h"
|
||||
#include "nsIInterfaceInfo.h"
|
||||
#include "nsIInterfaceInfoManager.h"
|
||||
#include "xptcall.h"
|
||||
#include "bcJavaMarshalToolkit.h"
|
||||
#include "bcJavaGlobal.h"
|
||||
#include "bcIIDJava.h"
|
||||
#include "unistd.h"
|
||||
#include "signal.h"
|
||||
|
||||
jclass bcJavaStub::objectClass = NULL;
|
||||
jclass bcJavaStub::utilitiesClass = NULL;
|
||||
|
||||
@@ -87,7 +87,8 @@ NS_IMETHODIMP bcJavaStubsAndProxies::GetOID(char *location, bcOID *oid) {
|
||||
if (!componentLoader) {
|
||||
Init();
|
||||
}
|
||||
location[strlen(location)-5] = 0; //nb dirty hack. location is xyz.jar.info
|
||||
//location[strlen(location)-5] = 0; //nb dirty hack. location is xyz.jar.info
|
||||
strcpy(location + strlen(location)-4,"comp");
|
||||
jstring jstr = env->NewStringUTF(location);
|
||||
jobject object = env->CallStaticObjectMethod(componentLoader, loadComponentID, jstr);
|
||||
bcIStub *stub = new bcJavaStub(object);
|
||||
|
||||
52
mozilla/java/xpcom/java/src/makefile.win
Normal file
52
mozilla/java/xpcom/java/src/makefile.win
Normal file
@@ -0,0 +1,52 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
MODULE=bcjavastubs
|
||||
COMPONENT = 1
|
||||
DLLNAME = bcjavastubs
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
EXPORTS = \
|
||||
bcJavaStubsAndProxies.h
|
||||
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\bcJavaMarshalToolkit.obj \
|
||||
.\$(OBJDIR)\bcJavaStub.obj \
|
||||
.\$(OBJDIR)\bcJavaGlobal.obj \
|
||||
.\$(OBJDIR)\bcJavaStubsAndProxies.obj \
|
||||
.\$(OBJDIR)\bcIIDJava.obj \
|
||||
.\$(OBJDIR)\org_mozilla_xpcom_Utilities.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib $(JDKHOME)\lib\jvm.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\components\$(DLLNAME).dll
|
||||
@@ -32,16 +32,17 @@ include $(DEPTH)/config/autoconf.mk
|
||||
MODULE = javaSample
|
||||
LIBRARY_NAME = javaSample
|
||||
IS_COMPONENT = 1
|
||||
XPIDL_MODULE = javaSample
|
||||
XPIDLSRCS = bcIJavaSample.idl
|
||||
CPPSRCS = bcJavaSample.cpp
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
bcJavaSample.jar: manifest bcIJavaSample.class bcJavaSample.class
|
||||
$(JDKHOME)/bin/jar cvfm bcJavaSample.jar manifest *.class
|
||||
bcJavaSample.jar.comp: manifest bcIJavaSample.class bcJavaSample.class
|
||||
$(JDKHOME)/bin/jar cvfm bcJavaSample.jar.comp manifest *.class
|
||||
.java.class:
|
||||
$(JDKHOME)/bin/javac -classpath .:../classes $<
|
||||
install-component: bcJavaSample.jar bcJavaSample.jar.info
|
||||
cp bcJavaSample.jar bcJavaSample.jar.info $(DEPTH)/dist/bin/components/
|
||||
install-component: bcJavaSample.jar.comp bcJavaSample.jar.info
|
||||
cp bcJavaSample.jar.comp bcJavaSample.jar.info $(DEPTH)/dist/bin/components/
|
||||
|
||||
clobber-java:
|
||||
rm -f *.class *.jar
|
||||
|
||||
63
mozilla/java/xpcom/java/test/makefile.win
Normal file
63
mozilla/java/xpcom/java/test/makefile.win
Normal file
@@ -0,0 +1,63 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
|
||||
DEPTH = ..\..\..\..
|
||||
topsrcdir = ..\..\..\..
|
||||
srcdir = .
|
||||
VPATH = .
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
MODULE=javaSample
|
||||
COMPONENT=1
|
||||
DLLNAME=$(MODULE)
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\bcIJavaSample.idl \
|
||||
$(NULL)
|
||||
|
||||
OBJS = bcJavaSample.obj
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
bcJavaSample.jar.comp: manifest bcIJavaSample.class bcJavaSample.class
|
||||
$(JDKHOME)\bin\jar cvfm bcJavaSample.jar.comp manifest *.class
|
||||
|
||||
.SUFFIXES: .java .class
|
||||
|
||||
.java.class:
|
||||
$(JDKHOME)\bin\javac -classpath .;..\classes $<
|
||||
|
||||
install-component: bcJavaSample.jar.comp bcJavaSample.jar.info $(DLL)
|
||||
copy bcJavaSample.jar* $(DIST)\bin\components
|
||||
copy $(DLL) $(DIST)\bin\components
|
||||
|
||||
clobber-java:
|
||||
-del *.class *.jar.comp
|
||||
clobber:: clobber-java
|
||||
rm $(DIST)\bin\components\$(DLLNAME).dll
|
||||
rm $(DIST)\bin\components\bcJavaSample.jar.*
|
||||
clobber_all:: clobber-java
|
||||
install:: install-component
|
||||
@@ -41,7 +41,7 @@ bcXPCOMMarshalToolkit::bcXPCOMMarshalToolkit(PRUint16 _methodIndex, nsIInterface
|
||||
if (params == nsnull) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
for (unsigned int i = 0; i < paramCount; i++) {
|
||||
(params)[i].Init(_params[i], info->GetParam(i).GetType());
|
||||
if (info->GetParam(i).IsOut()) {
|
||||
params[i].flags |= nsXPTCVariant::PTR_IS_DATA;
|
||||
@@ -66,7 +66,7 @@ bcXPCOMMarshalToolkit::~bcXPCOMMarshalToolkit() {
|
||||
|
||||
nsresult bcXPCOMMarshalToolkit::Marshal(bcIMarshaler *m) {
|
||||
PRUint32 paramCount = info->GetParamCount();
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
for (unsigned int i = 0; i < paramCount; i++) {
|
||||
nsXPTParamInfo param = info->GetParam(i);
|
||||
nsXPTType type = param.GetType();
|
||||
PRBool isOut = param.IsOut();
|
||||
@@ -172,7 +172,7 @@ nsresult bcXPCOMMarshalToolkit::Marshal(bcIMarshaler *m) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
class xpAllocator : public bcIAllocator {
|
||||
@@ -197,7 +197,7 @@ private:
|
||||
nsresult bcXPCOMMarshalToolkit::UnMarshal(bcIUnMarshaler *um) {
|
||||
bcIAllocator * allocator = new xpAllocator(nsAllocator::GetGlobalAllocator());
|
||||
PRUint32 paramCount = info->GetParamCount();
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
for (unsigned int i = 0; i < paramCount; i++) {
|
||||
nsXPTParamInfo param = info->GetParam(i);
|
||||
PRBool isOut = param.IsOut();
|
||||
nsXPTCMiniVariant tmpValue = params[i]; //we need to set value for client side
|
||||
@@ -344,6 +344,8 @@ bcXPType bcXPCOMMarshalToolkit::XPTType2bcXPType(uint8 type) {
|
||||
return bc_T_INTERFACE;
|
||||
case nsXPTType::T_ARRAY:
|
||||
return bc_T_ARRAY;
|
||||
default:
|
||||
return bc_T_UNDEFINED;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,6 @@
|
||||
#include "bcXPCOMProxy.h"
|
||||
#include "bcXPCOMMarshalToolkit.h"
|
||||
|
||||
#include "unistd.h"
|
||||
#include "signal.h"
|
||||
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS(bcXPCOMProxy, NS_GET_IID(bcXPCOMProxy));
|
||||
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ void bcXPCOMStub::Dispatch(bcICall *call) {
|
||||
}
|
||||
//nb return value; excepion handling
|
||||
XPTC_InvokeByIndex(object, mid, paramCount, params);
|
||||
bcIMarshaler * m = call->GetMarshaler(); //nb ** to do
|
||||
mt->Marshal(m);
|
||||
//bcIMarshaler * m = call->GetMarshaler(); //nb ** to do
|
||||
//mt->Marshal(m);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
52
mozilla/java/xpcom/xpcom/makefile.win
Normal file
52
mozilla/java/xpcom/xpcom/makefile.win
Normal file
@@ -0,0 +1,52 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Sun Microsystems,
|
||||
# Inc. Portions created by Sun are
|
||||
# Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
DLLNAME = bcxpcomstubs
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
MODULE = bcxpcomstubs
|
||||
COMPONENT = 1
|
||||
|
||||
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\bcXPCOMProxy.obj \
|
||||
.\$(OBJDIR)\bcXPCOMStub.obj \
|
||||
.\$(OBJDIR)\bcXPCOMMarshalToolkit.obj \
|
||||
.\$(OBJDIR)\bcXPCOMStubsAndProxies.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
bcXPCOMStubsAndProxies.h
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\components\$(DLLNAME).dll
|
||||
Reference in New Issue
Block a user