Landing changes in the OJI_19980727_BRANCH since the OJI_19980727_TIP_MERGE tag.
git-svn-id: svn://10.0.0.236/trunk@6967 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
16d692ef0b
commit
3c42f93bf9
@ -25,7 +25,7 @@ ifndef NO_MOCHA
|
|||||||
DIRS_JS = js
|
DIRS_JS = js
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DIRS = config coreconf $(NSPRDIR) jpeg dbm xpcom network
|
DIRS = config coreconf $(NSPRDIR) jpeg dbm xpcom base network caps
|
||||||
|
|
||||||
ifdef MOZ_NETCAST
|
ifdef MOZ_NETCAST
|
||||||
DIRS += netcast
|
DIRS += netcast
|
||||||
@ -53,7 +53,7 @@ endif
|
|||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
include $(DEPTH)/config/rules.mk
|
||||||
|
|
||||||
export:: $(OBJS)
|
export:: envirocheck $(OBJS)
|
||||||
|
|
||||||
# Running this rule assembles all the SDK source pieces into dist/sdk.
|
# Running this rule assembles all the SDK source pieces into dist/sdk.
|
||||||
# You'll need to run this rule on every platform to get all the
|
# You'll need to run this rule on every platform to get all the
|
||||||
|
|||||||
@ -23,14 +23,18 @@ PROG1 = .\$(OBJDIR)\TestAtoms.exe
|
|||||||
PROG2 = .\$(OBJDIR)\CvtURL.exe
|
PROG2 = .\$(OBJDIR)\CvtURL.exe
|
||||||
PROG3 = .\$(OBJDIR)\TestCRT.exe
|
PROG3 = .\$(OBJDIR)\TestCRT.exe
|
||||||
RESFILE = timer.res
|
RESFILE = timer.res
|
||||||
PROGRAMS = $(PROG0) $(PROG1) $(PROG2) $(PROG3)
|
PROGRAMS = $(PROG0) $(PROG1) \
|
||||||
|
!ifdef MODULAR_NETLIB
|
||||||
|
$(PROG2) $(PROG3) \
|
||||||
|
!endif
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
LINCS=-I..\src -I$(PUBLIC)\xpcom -I$(PUBLIC)\netlib
|
LINCS=-I..\src -I$(PUBLIC)\xpcom -I$(PUBLIC)\netlib
|
||||||
|
|
||||||
LLIBS= \
|
LLIBS= \
|
||||||
$(DIST)\lib\xpcom32.lib \
|
$(DIST)\lib\xpcom32.lib \
|
||||||
$(DIST)\lib\raptorbase.lib \
|
$(DIST)\lib\raptorbase.lib \
|
||||||
$(DIST)\lib\netlib.lib \
|
$(DIST)\lib\network.lib \
|
||||||
$(LIBNSPR) \
|
$(LIBNSPR) \
|
||||||
$(DIST)\lib\libplc21.lib \
|
$(DIST)\lib\libplc21.lib \
|
||||||
$(RESFILE)
|
$(RESFILE)
|
||||||
@ -40,14 +44,18 @@ include <$(DEPTH)\config\rules.mak>
|
|||||||
install:: $(PROGRAMS)
|
install:: $(PROGRAMS)
|
||||||
$(MAKE_INSTALL) $(PROG0) $(DIST)\bin
|
$(MAKE_INSTALL) $(PROG0) $(DIST)\bin
|
||||||
$(MAKE_INSTALL) $(PROG1) $(DIST)\bin
|
$(MAKE_INSTALL) $(PROG1) $(DIST)\bin
|
||||||
|
!ifdef MODULAR_NETLIB
|
||||||
$(MAKE_INSTALL) $(PROG2) $(DIST)\bin
|
$(MAKE_INSTALL) $(PROG2) $(DIST)\bin
|
||||||
$(MAKE_INSTALL) $(PROG3) $(DIST)\bin
|
$(MAKE_INSTALL) $(PROG3) $(DIST)\bin
|
||||||
|
!endif
|
||||||
|
|
||||||
clobber::
|
clobber::
|
||||||
rm -f $(DIST)\bin\TimerTest.exe
|
rm -f $(DIST)\bin\TimerTest.exe
|
||||||
rm -f $(DIST)\bin\TestAtoms.exe
|
rm -f $(DIST)\bin\TestAtoms.exe
|
||||||
|
!ifdef MODULAR_NETLIB
|
||||||
rm -f $(DIST)\bin\CvtURL.exe
|
rm -f $(DIST)\bin\CvtURL.exe
|
||||||
rm -f $(DIST)\bin\TestCRT.exe
|
rm -f $(DIST)\bin\TestCRT.exe
|
||||||
|
!endif
|
||||||
|
|
||||||
# Move this into config/obj.inc when it's allowed
|
# Move this into config/obj.inc when it's allowed
|
||||||
.cpp{.\$(OBJDIR)\}.exe:
|
.cpp{.\$(OBJDIR)\}.exe:
|
||||||
@ -72,4 +80,3 @@ $(PROG1): $(OBJDIR) TestAtoms.cpp
|
|||||||
$(PROG2): $(OBJDIR) CvtURL.cpp
|
$(PROG2): $(OBJDIR) CvtURL.cpp
|
||||||
|
|
||||||
$(PROG2): $(OBJDIR) TestCRT.cpp
|
$(PROG2): $(OBJDIR) TestCRT.cpp
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
5009808600
|
5009821211
|
||||||
|
|||||||
@ -102,6 +102,9 @@ sub BuildMozilla()
|
|||||||
BuildProject(":mozilla:js:macbuild:JavaScriptPPC.mcp", "JavaScript$D.shlb");
|
BuildProject(":mozilla:js:macbuild:JavaScriptPPC.mcp", "JavaScript$D.shlb");
|
||||||
MakeAlias(":mozilla:js:macbuild:JavaScript$D.shlb", "$dist_dir");
|
MakeAlias(":mozilla:js:macbuild:JavaScript$D.shlb", "$dist_dir");
|
||||||
|
|
||||||
|
BuildProject(":mozilla:js:macbuild:LiveConnect.mcp", "LiveConnect$D.shlb");
|
||||||
|
MakeAlias(":mozilla:js:macbuild:LiveConnect$D.shlb", "$dist_dir");
|
||||||
|
|
||||||
BuildProject(":mozilla:nav-java:stubs:macbuild:NavJavaStubs.mcp", "NavJava$D.shlb");
|
BuildProject(":mozilla:nav-java:stubs:macbuild:NavJavaStubs.mcp", "NavJava$D.shlb");
|
||||||
MakeAlias(":mozilla:nav-java:stubs:macbuild:NavJava$D.shlb", "$dist_dir");
|
MakeAlias(":mozilla:nav-java:stubs:macbuild:NavJava$D.shlb", "$dist_dir");
|
||||||
|
|
||||||
@ -119,6 +122,7 @@ sub BuildMozilla()
|
|||||||
|
|
||||||
BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "Security.o");
|
BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "Security.o");
|
||||||
BuildProject(":mozilla:modules:libfont:macbuild:FontBroker.mcp", "FontBroker$D.o");
|
BuildProject(":mozilla:modules:libfont:macbuild:FontBroker.mcp", "FontBroker$D.o");
|
||||||
|
BuildProject(":mozilla:modules:oji:macbuild:oji.mcp", "oji$D.o");
|
||||||
BuildProject(":mozilla:lib:libmocha:macbuild:LibMocha.mcp", "LibMocha$D.o");
|
BuildProject(":mozilla:lib:libmocha:macbuild:LibMocha.mcp", "LibMocha$D.o");
|
||||||
|
|
||||||
if ( $main::MOZ_DARK == 1 )
|
if ( $main::MOZ_DARK == 1 )
|
||||||
@ -129,6 +133,7 @@ sub BuildMozilla()
|
|||||||
{
|
{
|
||||||
BuildProject(":mozilla:network:macbuild:network.mcp", "Network$D.o");
|
BuildProject(":mozilla:network:macbuild:network.mcp", "Network$D.o");
|
||||||
}
|
}
|
||||||
|
BuildProject(":mozilla:caps:macbuild:Caps.mcp", "Caps$D.o");
|
||||||
|
|
||||||
BuildProject(":mozilla:modules:libimg:macbuild:png.mcp", "png$D.o");
|
BuildProject(":mozilla:modules:libimg:macbuild:png.mcp", "png$D.o");
|
||||||
BuildProject(":mozilla:modules:libimg:macbuild:libimg.mcp", "libimg$D.o");
|
BuildProject(":mozilla:modules:libimg:macbuild:libimg.mcp", "libimg$D.o");
|
||||||
@ -227,6 +232,9 @@ sub DistMozilla()
|
|||||||
#JS
|
#JS
|
||||||
InstallFromManifest(":mozilla:js:src:MANIFEST", ":mozilla:dist:js:");
|
InstallFromManifest(":mozilla:js:src:MANIFEST", ":mozilla:dist:js:");
|
||||||
|
|
||||||
|
#LIVECONNECT
|
||||||
|
InstallFromManifest(":mozilla:js:src:liveconnect:MANIFEST", ":mozilla:dist:liveconnect:");
|
||||||
|
|
||||||
#RDF
|
#RDF
|
||||||
InstallFromManifest(":mozilla:modules:rdf:include:MANIFEST", ":mozilla:dist:rdf:");
|
InstallFromManifest(":mozilla:modules:rdf:include:MANIFEST", ":mozilla:dist:rdf:");
|
||||||
|
|
||||||
@ -291,7 +299,8 @@ sub DistMozilla()
|
|||||||
InstallFromManifest(":mozilla:lib:libstyle:MANIFEST", ":mozilla:dist:libstyle:");
|
InstallFromManifest(":mozilla:lib:libstyle:MANIFEST", ":mozilla:dist:libstyle:");
|
||||||
|
|
||||||
#PLUGIN
|
#PLUGIN
|
||||||
InstallFromManifest(":mozilla:lib:plugin:MANIFEST", ":mozilla:dist:plugin:");
|
InstallFromManifest(":mozilla:modules:plugin:public:MANIFEST", ":mozilla:dist:plugin:");
|
||||||
|
InstallFromManifest(":mozilla:modules:plugin:src:MANIFEST", ":mozilla:dist:plugin:");
|
||||||
|
|
||||||
#LIBHOOK
|
#LIBHOOK
|
||||||
InstallFromManifest(":mozilla:modules:libhook:public:MANIFEST", ":mozilla:dist:libhook:");
|
InstallFromManifest(":mozilla:modules:libhook:public:MANIFEST", ":mozilla:dist:libhook:");
|
||||||
@ -318,8 +327,18 @@ sub DistMozilla()
|
|||||||
#SUN_JAVA
|
#SUN_JAVA
|
||||||
InstallFromManifest(":mozilla:sun-java:stubs:include:MANIFEST", ":mozilla:dist:sun-java:");
|
InstallFromManifest(":mozilla:sun-java:stubs:include:MANIFEST", ":mozilla:dist:sun-java:");
|
||||||
InstallFromManifest(":mozilla:sun-java:stubs:macjri:MANIFEST", ":mozilla:dist:sun-java:");
|
InstallFromManifest(":mozilla:sun-java:stubs:macjri:MANIFEST", ":mozilla:dist:sun-java:");
|
||||||
|
|
||||||
|
#OJI
|
||||||
|
InstallFromManifest(":mozilla:modules:oji:public:MANIFEST", ":mozilla:dist:oji:");
|
||||||
|
InstallFromManifest(":mozilla:modules:oji:src:MANIFEST", ":mozilla:dist:oji:");
|
||||||
|
|
||||||
|
#CAPS
|
||||||
|
InstallFromManifest(":mozilla:caps:include:MANIFEST", ":mozilla:dist:caps:");
|
||||||
|
|
||||||
|
#BASE
|
||||||
|
InstallFromManifest(":mozilla:base:public:MANIFEST", ":mozilla:dist:base:");
|
||||||
|
InstallFromManifest(":mozilla:base:src:MANIFEST", ":mozilla:dist:base:");
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -11,3 +11,5 @@ nsUserDialogHelper.h
|
|||||||
nsZip.h
|
nsZip.h
|
||||||
nsLoadZig.h
|
nsLoadZig.h
|
||||||
admin.h
|
admin.h
|
||||||
|
nsCaps.h
|
||||||
|
nsCapsEnums.h
|
||||||
|
|||||||
@ -18,7 +18,7 @@ MODULE = caps
|
|||||||
|
|
||||||
DEPTH = ../..
|
DEPTH = ../..
|
||||||
|
|
||||||
EXPORTS = nsZip.h nsZig.h nsLoadZig.h nsPrincipal.h nsPrivilege.h nsPrivilegeManager.h nsPrivilegeTable.h nsSystemPrivilegeTable.h nsTarget.h nsUserTarget.h jpermission.h nsUserDialogHelper.h admin.h
|
EXPORTS = nsZip.h nsZig.h nsLoadZig.h nsPrincipal.h nsPrivilege.h nsPrivilegeManager.h nsPrivilegeTable.h nsSystemPrivilegeTable.h nsTarget.h nsUserTarget.h jpermission.h nsUserDialogHelper.h admin.h nsCaps.h nsCapsEnums.h
|
||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
include $(DEPTH)/config/rules.mk
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ IGNORE_MANIFEST=1
|
|||||||
|
|
||||||
MODULE=caps
|
MODULE=caps
|
||||||
DEPTH=..\..
|
DEPTH=..\..
|
||||||
EXPORTS=nsZip.h nsZig.h nsLoadZig.h nsPrincipal.h nsPrivilege.h nsPrivilegeManager.h nsPrivilegeTable.h nsSystemPrivilegeTable.h nsTarget.h nsUserTarget.h jpermission.h nsUserDialogHelper.h admin.h
|
EXPORTS=nsZip.h nsZig.h nsLoadZig.h nsPrincipal.h nsPrivilege.h nsPrivilegeManager.h nsPrivilegeTable.h nsSystemPrivilegeTable.h nsTarget.h nsUserTarget.h jpermission.h nsUserDialogHelper.h admin.h nsCaps.h nsCapsEnums.h
|
||||||
|
|
||||||
include <$(DEPTH)/config/rules.mak>
|
include <$(DEPTH)/config/rules.mak>
|
||||||
|
|
||||||
|
|||||||
@ -22,23 +22,13 @@
|
|||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
#include "nsVector.h"
|
#include "nsVector.h"
|
||||||
#include "nsZig.h"
|
#include "nsCaps.h"
|
||||||
#include "nsCom.h"
|
#include "nsCapsEnums.h"
|
||||||
|
|
||||||
/* The following should match what is in nsJVM plugin's java security code */
|
|
||||||
typedef enum nsPrincipalType {
|
|
||||||
nsPrincipalType_Unknown=-1,
|
|
||||||
nsPrincipalType_CodebaseExact=10,
|
|
||||||
nsPrincipalType_CodebaseRegexp,
|
|
||||||
nsPrincipalType_Cert,
|
|
||||||
nsPrincipalType_CertFingerPrint,
|
|
||||||
nsPrincipalType_CertKey
|
|
||||||
} nsPrincipalType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef nsVector nsPrincipalArray;
|
typedef nsVector nsPrincipalArray;
|
||||||
|
|
||||||
class nsPrincipal {
|
struct nsPrincipal {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -48,7 +38,7 @@ public:
|
|||||||
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len);
|
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len);
|
||||||
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, char *stringRep);
|
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, char *stringRep);
|
||||||
virtual ~nsPrincipal();
|
virtual ~nsPrincipal();
|
||||||
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, nsZig *zigObject);
|
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, void *zigObject);
|
||||||
|
|
||||||
PRBool equals(nsPrincipal *principal);
|
PRBool equals(nsPrincipal *principal);
|
||||||
|
|
||||||
@ -97,7 +87,7 @@ private:
|
|||||||
/* Private Field Accessors */
|
/* Private Field Accessors */
|
||||||
nsPrincipalType itsType;
|
nsPrincipalType itsType;
|
||||||
|
|
||||||
nsZig * itsZig;
|
void * itsZig;
|
||||||
|
|
||||||
char * itsKey;
|
char * itsKey;
|
||||||
|
|
||||||
|
|||||||
@ -20,33 +20,12 @@
|
|||||||
#define _NS_PRIVILEGE_H_
|
#define _NS_PRIVILEGE_H_
|
||||||
|
|
||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
#include "nsCom.h"
|
#include "nsCaps.h"
|
||||||
|
#include "nsCapsEnums.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* number of possible permissions (allowed, forbidden, or blank)
|
|
||||||
*/
|
|
||||||
typedef enum nsPermissionState {
|
|
||||||
nsPermissionState_Forbidden = 0,
|
|
||||||
nsPermissionState_Allowed,
|
|
||||||
nsPermissionState_Blank,
|
|
||||||
nsPermissionState_NumberOfPermissions
|
|
||||||
} nsPermissionState;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* number of possible durations (scope, session, or forever)
|
|
||||||
*/
|
|
||||||
typedef enum nsDurationState {
|
|
||||||
nsDurationState_Scope=0,
|
|
||||||
nsDurationState_Session,
|
|
||||||
nsDurationState_Forever,
|
|
||||||
nsDurationState_NumberOfDurations
|
|
||||||
} nsDurationState;
|
|
||||||
|
|
||||||
PRBool nsPrivilegeInitialize(void);
|
PRBool nsPrivilegeInitialize(void);
|
||||||
|
|
||||||
class nsPrivilege {
|
struct nsPrivilege {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* Public Field Accessors */
|
/* Public Field Accessors */
|
||||||
|
|||||||
@ -25,18 +25,13 @@
|
|||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
|
|
||||||
#include "nsVector.h"
|
#include "nsVector.h"
|
||||||
|
#include "nsCaps.h"
|
||||||
#include "nsTarget.h"
|
#include "nsTarget.h"
|
||||||
#include "nsPrincipal.h"
|
#include "nsPrincipal.h"
|
||||||
#include "nsPrivilege.h"
|
#include "nsPrivilege.h"
|
||||||
#include "nsPrivilegeTable.h"
|
#include "nsPrivilegeTable.h"
|
||||||
#include "nsSystemPrivilegeTable.h"
|
#include "nsSystemPrivilegeTable.h"
|
||||||
#include "nsCom.h"
|
#include "nsCapsEnums.h"
|
||||||
|
|
||||||
typedef enum nsSetComparisonType {
|
|
||||||
nsSetComparisonType_ProperSubset=-1,
|
|
||||||
nsSetComparisonType_Equal=0,
|
|
||||||
nsSetComparisonType_NoSubset=1
|
|
||||||
} nsSetComparisonType;
|
|
||||||
|
|
||||||
extern PRBool nsCaps_lock(void);
|
extern PRBool nsCaps_lock(void);
|
||||||
extern void nsCaps_unlock(void);
|
extern void nsCaps_unlock(void);
|
||||||
@ -45,39 +40,9 @@ PR_BEGIN_EXTERN_C
|
|||||||
PRBool CMGetBoolPref(char * pref_name);
|
PRBool CMGetBoolPref(char * pref_name);
|
||||||
PR_END_EXTERN_C
|
PR_END_EXTERN_C
|
||||||
|
|
||||||
struct NSJSJavaFrameWrapper;
|
|
||||||
|
|
||||||
void
|
|
||||||
setNewNSJSJavaFrameWrapperCallback(struct NSJSJavaFrameWrapper * (*fp)(void));
|
|
||||||
|
|
||||||
void
|
|
||||||
setFreeNSJSJavaFrameWrapperCallback(void (*fp)(struct NSJSJavaFrameWrapper *));
|
|
||||||
|
|
||||||
void
|
|
||||||
setGetStartFrameCallback(void (*fp)(struct NSJSJavaFrameWrapper *));
|
|
||||||
|
|
||||||
void
|
|
||||||
setIsEndOfFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *));
|
|
||||||
|
|
||||||
void
|
|
||||||
setIsValidFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *));
|
|
||||||
|
|
||||||
void
|
|
||||||
setGetNextFrameCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, int *));
|
|
||||||
|
|
||||||
void
|
|
||||||
setOJIGetPrincipalArrayCallback(void * (*fp)(struct NSJSJavaFrameWrapper *));
|
|
||||||
|
|
||||||
void
|
|
||||||
setOJIGetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *));
|
|
||||||
|
|
||||||
void
|
|
||||||
setOJISetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, void *));
|
|
||||||
|
|
||||||
|
|
||||||
PRBool nsPrivilegeManagerInitialize(void);
|
PRBool nsPrivilegeManagerInitialize(void);
|
||||||
|
|
||||||
class nsPrivilegeManager {
|
struct nsPrivilegeManager {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* Public Methods */
|
/* Public Methods */
|
||||||
|
|||||||
@ -21,12 +21,11 @@
|
|||||||
|
|
||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
|
#include "nsCaps.h"
|
||||||
#include "nsTarget.h"
|
#include "nsTarget.h"
|
||||||
#include "nsPrivilege.h"
|
#include "nsPrivilege.h"
|
||||||
#include "nsCom.h"
|
|
||||||
|
|
||||||
|
struct nsPrivilegeTable {
|
||||||
class nsPrivilegeTable {
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -23,11 +23,11 @@
|
|||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
#include "plhash.h"
|
#include "plhash.h"
|
||||||
|
|
||||||
#include "nsPrincipal.h"
|
|
||||||
#include "nsPrivilege.h"
|
|
||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
#include "nsVector.h"
|
#include "nsVector.h"
|
||||||
#include "nsCom.h"
|
#include "nsCaps.h"
|
||||||
|
#include "nsPrincipal.h"
|
||||||
|
#include "nsPrivilege.h"
|
||||||
#include "nsUserDialogHelper.h"
|
#include "nsUserDialogHelper.h"
|
||||||
|
|
||||||
typedef nsVector nsTargetArray;
|
typedef nsVector nsTargetArray;
|
||||||
@ -43,7 +43,7 @@ extern int CAPS_TARGET_RISK_COLOR_HIGH;
|
|||||||
|
|
||||||
extern PRBool CreateSystemTargets(nsPrincipal *sysPrin);
|
extern PRBool CreateSystemTargets(nsPrincipal *sysPrin);
|
||||||
|
|
||||||
class nsTarget {
|
struct nsTarget {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -36,6 +36,7 @@ CSRCS = \
|
|||||||
jpermission.c \
|
jpermission.c \
|
||||||
nsUserTarget.c \
|
nsUserTarget.c \
|
||||||
admin.c \
|
admin.c \
|
||||||
|
nsCaps.c \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
include $(DEPTH)/config/rules.mk
|
||||||
|
|||||||
@ -41,7 +41,6 @@ extern "C" {
|
|||||||
PR_PUBLIC_API(const char *)
|
PR_PUBLIC_API(const char *)
|
||||||
java_netscape_security_getPrincipals(const char *charSetName)
|
java_netscape_security_getPrincipals(const char *charSetName)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_raman
|
|
||||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||||
const char *prins = nsPrivManager->getAllPrincipalsString();
|
const char *prins = nsPrivManager->getAllPrincipalsString();
|
||||||
PRBool test_admin_api = PR_FALSE;
|
PRBool test_admin_api = PR_FALSE;
|
||||||
@ -54,20 +53,13 @@ java_netscape_security_getPrincipals(const char *charSetName)
|
|||||||
java_netscape_security_removePrincipal(NULL, "raman tenneti");
|
java_netscape_security_removePrincipal(NULL, "raman tenneti");
|
||||||
}
|
}
|
||||||
return prins;
|
return prins;
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PR_PUBLIC_API(PRBool)
|
PR_PUBLIC_API(PRBool)
|
||||||
java_netscape_security_removePrincipal(const char *charSetName, char *prinName)
|
java_netscape_security_removePrincipal(const char *charSetName, char *prinName)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_raman
|
|
||||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||||
return nsPrivManager->removePrincipal(prinName);
|
return nsPrivManager->removePrincipal(prinName);
|
||||||
#else
|
|
||||||
return PR_FALSE;
|
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PR_PUBLIC_API(void)
|
PR_PUBLIC_API(void)
|
||||||
@ -75,22 +67,16 @@ java_netscape_security_getPrivilegeDescs(const char *charSetName, char *prinName
|
|||||||
char** forever, char** session,
|
char** forever, char** session,
|
||||||
char **denied)
|
char **denied)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_raman
|
|
||||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||||
nsPrivManager->getTargetsWithPrivileges(prinName, forever, session, denied);
|
nsPrivManager->getTargetsWithPrivileges(prinName, forever, session, denied);
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PR_PUBLIC_API(PRBool)
|
PR_PUBLIC_API(PRBool)
|
||||||
java_netscape_security_removePrivilege(const char *charSetName, char *prinName,
|
java_netscape_security_removePrivilege(const char *charSetName, char *prinName,
|
||||||
char *targetName)
|
char *targetName)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_raman
|
|
||||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||||
return nsPrivManager->removePrincipalsPrivilege(prinName, targetName);
|
return nsPrivManager->removePrincipalsPrivilege(prinName, targetName);
|
||||||
#else
|
|
||||||
return PR_FALSE;
|
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -63,6 +63,7 @@ OBJS= \
|
|||||||
.\$(OBJDIR)\jpermission.obj \
|
.\$(OBJDIR)\jpermission.obj \
|
||||||
.\$(OBJDIR)\nsUserTarget.obj \
|
.\$(OBJDIR)\nsUserTarget.obj \
|
||||||
.\$(OBJDIR)\admin.obj \
|
.\$(OBJDIR)\admin.obj \
|
||||||
|
.\$(OBJDIR)\nsCaps.obj \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -144,7 +144,7 @@ nsPrincipal::nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len)
|
|||||||
init(type, key, key_len);
|
init(type, key, key_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsPrincipal::nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, nsZig *zigObject)
|
nsPrincipal::nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, void *zigObject)
|
||||||
{
|
{
|
||||||
init(type, key, key_len);
|
init(type, key, key_len);
|
||||||
itsZig = zigObject;
|
itsZig = zigObject;
|
||||||
@ -158,9 +158,9 @@ nsPrincipal::nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, cha
|
|||||||
|
|
||||||
nsPrincipal::~nsPrincipal(void)
|
nsPrincipal::~nsPrincipal(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_RAMAN
|
#ifdef DEBUG_raman
|
||||||
fprintf(stderr, "Deleting principal %s\n", itsKey);
|
fprintf(stderr, "Deleting principal %s\n", itsKey);
|
||||||
#endif /* DEBUG_RAMAN */
|
#endif /* DEBUG_raman */
|
||||||
if (itsKey) {
|
if (itsKey) {
|
||||||
delete []itsKey;
|
delete []itsKey;
|
||||||
}
|
}
|
||||||
@ -215,6 +215,29 @@ char * nsPrincipal::getVendor(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX copyied from ns/lib/libjar/zig.h
|
||||||
|
#ifndef ZIG_C_COMPANY
|
||||||
|
#define ZIG_C_COMPANY 1
|
||||||
|
#endif
|
||||||
|
#ifndef ZIG_C_CA
|
||||||
|
#define ZIG_C_CA 2
|
||||||
|
#endif
|
||||||
|
#ifndef ZIG_C_SERIAL
|
||||||
|
#define ZIG_C_SERIAL 3
|
||||||
|
#endif
|
||||||
|
#ifndef ZIG_C_EXPIRES
|
||||||
|
#define ZIG_C_EXPIRES 4
|
||||||
|
#endif
|
||||||
|
#ifndef ZIG_C_NICKNAME
|
||||||
|
#define ZIG_C_NICKNAME 5
|
||||||
|
#endif
|
||||||
|
#ifndef ZIG_C_FP
|
||||||
|
#define ZIG_C_FP 6
|
||||||
|
#endif
|
||||||
|
#ifndef ZIG_C_JAVA
|
||||||
|
#define ZIG_C_JAVA 100
|
||||||
|
#endif
|
||||||
|
|
||||||
char * nsPrincipal::getCompanyName(void)
|
char * nsPrincipal::getCompanyName(void)
|
||||||
{
|
{
|
||||||
if (itsCompanyName == NULL)
|
if (itsCompanyName == NULL)
|
||||||
@ -434,9 +457,9 @@ void nsPrincipal::init(nsPrincipalType type, void * key, PRUint32 key_len)
|
|||||||
itsKey = new char[key_len+1];
|
itsKey = new char[key_len+1];
|
||||||
memcpy(itsKey, key, key_len);
|
memcpy(itsKey, key, key_len);
|
||||||
itsKey[key_len] = '\0';
|
itsKey[key_len] = '\0';
|
||||||
#ifdef DEBUG_RAMAN
|
#ifdef DEBUG_raman
|
||||||
fprintf(stderr, "Creating principal %d, %s\n", type, itsKey);
|
fprintf(stderr, "Creating principal %d, %s\n", type, itsKey);
|
||||||
#endif /* DEBUG_RAMAN */
|
#endif /* DEBUG_raman */
|
||||||
itsKeyLen = key_len;
|
itsKeyLen = key_len;
|
||||||
itsHashCode = computeHashCode();
|
itsHashCode = computeHashCode();
|
||||||
itsZig = NULL;
|
itsZig = NULL;
|
||||||
@ -484,7 +507,7 @@ char * nsPrincipal::saveCert(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = SOB_stash_cert((ZIG *)itsZig->GetZig(), itsKeyLen, itsKey);
|
result = SOB_stash_cert((ZIG *)itsZig, itsKeyLen, itsKey);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
return SOB_get_error(result);
|
return SOB_get_error(result);
|
||||||
}
|
}
|
||||||
@ -501,7 +524,7 @@ nsPrincipal::getCertAttribute(int attrib)
|
|||||||
ZIG *zig = NULL;
|
ZIG *zig = NULL;
|
||||||
|
|
||||||
if (itsZig != NULL) {
|
if (itsZig != NULL) {
|
||||||
zig = (ZIG *)itsZig->GetZig();
|
zig = (ZIG *)itsZig;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SOB_cert_attribute(attrib, zig,
|
if (SOB_cert_attribute(attrib, zig,
|
||||||
|
|||||||
@ -26,12 +26,7 @@
|
|||||||
#include "jpermission.h"
|
#include "jpermission.h"
|
||||||
#include "rdf.h"
|
#include "rdf.h"
|
||||||
|
|
||||||
#ifdef DEBUG_raman
|
|
||||||
/* ifdef'ed out ADMIN UI until we merge changes with rdf branch.
|
|
||||||
* All these changes are under DEBUG_raman
|
|
||||||
*/
|
|
||||||
#include "jsec2rdf.h"
|
#include "jsec2rdf.h"
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
|
|
||||||
static nsPrivilegeManager * thePrivilegeManager = NULL;
|
static nsPrivilegeManager * thePrivilegeManager = NULL;
|
||||||
|
|
||||||
@ -58,10 +53,7 @@ nsPrivilegeTable *gPrivilegeTable;
|
|||||||
|
|
||||||
static PRBool getPrincipalString(nsHashKey *aKey, void *aData);
|
static PRBool getPrincipalString(nsHashKey *aKey, void *aData);
|
||||||
|
|
||||||
#ifdef DEBUG_raman
|
|
||||||
static nsPrincipal *RDF_getPrincipal(JSec_Principal jsec_pr);
|
static nsPrincipal *RDF_getPrincipal(JSec_Principal jsec_pr);
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
|
|
||||||
static PRBool RDF_RemovePrincipal(nsPrincipal *prin);
|
static PRBool RDF_RemovePrincipal(nsPrincipal *prin);
|
||||||
static PRBool RDF_RemovePrincipalsPrivilege(nsPrincipal *prin, nsTarget *target);
|
static PRBool RDF_RemovePrincipalsPrivilege(nsPrincipal *prin, nsTarget *target);
|
||||||
|
|
||||||
@ -661,6 +653,8 @@ nsPrivilegeManager::intersectPrincipalArray(nsPrincipalArray* p1,
|
|||||||
PRBool nsPrivilegeManager::canExtendTrust(nsPrincipalArray* from,
|
PRBool nsPrivilegeManager::canExtendTrust(nsPrincipalArray* from,
|
||||||
nsPrincipalArray* to)
|
nsPrincipalArray* to)
|
||||||
{
|
{
|
||||||
|
if ((from == NULL) || (to == NULL))
|
||||||
|
return PR_FALSE;
|
||||||
nsPrincipalArray * intersect = intersectPrincipalArray(from, to);
|
nsPrincipalArray * intersect = intersectPrincipalArray(from, to);
|
||||||
if (intersect->GetSize() == from->GetSize())
|
if (intersect->GetSize() == from->GetSize())
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
@ -981,87 +975,6 @@ nsPrivilegeManager::isPermissionGranted(nsTarget *target,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The following method should call native code */
|
|
||||||
|
|
||||||
static struct NSJSJavaFrameWrapper * (*NewNSJSJavaFrameWrapperCallback)(void);
|
|
||||||
|
|
||||||
void
|
|
||||||
setNewNSJSJavaFrameWrapperCallback(struct NSJSJavaFrameWrapper * (*fp)(void))
|
|
||||||
{
|
|
||||||
NewNSJSJavaFrameWrapperCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void (*FreeNSJSJavaFrameWrapperCallback)(struct NSJSJavaFrameWrapper *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setFreeNSJSJavaFrameWrapperCallback(void (*fp)(struct NSJSJavaFrameWrapper *))
|
|
||||||
{
|
|
||||||
FreeNSJSJavaFrameWrapperCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void (*GetStartFrameCallback)(struct NSJSJavaFrameWrapper *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setGetStartFrameCallback(void (*fp)(struct NSJSJavaFrameWrapper *))
|
|
||||||
{
|
|
||||||
GetStartFrameCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static PRBool (*IsEndOfFrameCallback)(struct NSJSJavaFrameWrapper *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setIsEndOfFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *))
|
|
||||||
{
|
|
||||||
IsEndOfFrameCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static PRBool (*IsValidFrameCallback)(struct NSJSJavaFrameWrapper *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setIsValidFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *))
|
|
||||||
{
|
|
||||||
IsValidFrameCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void * (*GetNextFrameCallback)(struct NSJSJavaFrameWrapper *, int *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setGetNextFrameCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, int *))
|
|
||||||
{
|
|
||||||
GetNextFrameCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void * (*GetPrincipalArrayCallback)(struct NSJSJavaFrameWrapper *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setOJIGetPrincipalArrayCallback(void * (*fp)(struct NSJSJavaFrameWrapper *))
|
|
||||||
{
|
|
||||||
GetPrincipalArrayCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void * (*GetAnnotationCallback)(struct NSJSJavaFrameWrapper *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setOJIGetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *))
|
|
||||||
{
|
|
||||||
GetAnnotationCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void * (*SetAnnotationCallback)(struct NSJSJavaFrameWrapper *, void *);
|
|
||||||
|
|
||||||
void
|
|
||||||
setOJISetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, void *))
|
|
||||||
{
|
|
||||||
SetAnnotationCallback = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
nsPrivilegeManager::checkPrivilegeEnabled(nsTargetArray * targetArray,
|
nsPrivilegeManager::checkPrivilegeEnabled(nsTargetArray * targetArray,
|
||||||
@ -1087,18 +1000,21 @@ nsPrivilegeManager::checkPrivilegeEnabled(nsTargetArray * targetArray,
|
|||||||
return "internal error - null target array";
|
return "internal error - null target array";
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapper = (*NewNSJSJavaFrameWrapperCallback)();
|
if (*nsCapsNewNSJSJavaFrameWrapperCallback == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
wrapper = (*nsCapsNewNSJSJavaFrameWrapperCallback)();
|
||||||
if (wrapper == NULL) {
|
if (wrapper == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
noOfTargets = targetArray->GetSize();
|
noOfTargets = targetArray->GetSize();
|
||||||
|
|
||||||
for ((*GetStartFrameCallback)(wrapper);
|
for ((*nsCapsGetStartFrameCallback)(wrapper);
|
||||||
(!(*IsEndOfFrameCallback)(wrapper));
|
(!(*nsCapsIsEndOfFrameCallback)(wrapper));
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if ((*IsValidFrameCallback)(wrapper)) {
|
if ((*nsCapsIsValidFrameCallback)(wrapper)) {
|
||||||
if (depth >= callerDepth) {
|
if (depth >= callerDepth) {
|
||||||
scopePerm = nsPermissionState_Blank;
|
scopePerm = nsPermissionState_Blank;
|
||||||
prinPerm = nsPermissionState_Blank;
|
prinPerm = nsPermissionState_Blank;
|
||||||
@ -1109,8 +1025,8 @@ nsPrivilegeManager::checkPrivilegeEnabled(nsTargetArray * targetArray,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
annotation = (nsPrivilegeTable *) (*GetAnnotationCallback)(wrapper);
|
annotation = (nsPrivilegeTable *) (*nsCapsGetAnnotationCallback)(wrapper);
|
||||||
prinArray = (nsPrincipalArray *) (*GetPrincipalArrayCallback)(wrapper);
|
prinArray = (nsPrincipalArray *) (*nsCapsGetPrincipalArrayCallback)(wrapper);
|
||||||
/*
|
/*
|
||||||
* frame->annotation holds a PrivilegeTable, describing
|
* frame->annotation holds a PrivilegeTable, describing
|
||||||
* the scope privileges of this frame. We'll check
|
* the scope privileges of this frame. We'll check
|
||||||
@ -1168,7 +1084,7 @@ nsPrivilegeManager::checkPrivilegeEnabled(nsTargetArray * targetArray,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(*GetNextFrameCallback)(wrapper, &depth))
|
if (!(*nsCapsGetNextFrameCallback)(wrapper, &depth))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -1186,7 +1102,7 @@ nsPrivilegeManager::checkPrivilegeEnabled(nsTargetArray * targetArray,
|
|||||||
errMsg = "access to target forbidden. Target was not enabled on stack (stack included only system code)";
|
errMsg = "access to target forbidden. Target was not enabled on stack (stack included only system code)";
|
||||||
|
|
||||||
done:
|
done:
|
||||||
(*FreeNSJSJavaFrameWrapperCallback)(wrapper);
|
(*nsCapsFreeNSJSJavaFrameWrapperCallback)(wrapper);
|
||||||
return errMsg;
|
return errMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1198,23 +1114,26 @@ nsPrivilegeManager::getClassPrincipalsFromStack(PRInt32 callerDepth)
|
|||||||
int depth = 0;
|
int depth = 0;
|
||||||
struct NSJSJavaFrameWrapper *wrapper = NULL;
|
struct NSJSJavaFrameWrapper *wrapper = NULL;
|
||||||
|
|
||||||
wrapper = (*NewNSJSJavaFrameWrapperCallback)();
|
if (*nsCapsNewNSJSJavaFrameWrapperCallback == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
wrapper = (*nsCapsNewNSJSJavaFrameWrapperCallback)();
|
||||||
if (wrapper == NULL)
|
if (wrapper == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for ((*GetStartFrameCallback)(wrapper) ;
|
for ((*nsCapsGetStartFrameCallback)(wrapper) ;
|
||||||
(!(*IsEndOfFrameCallback)(wrapper)) ;
|
(!(*nsCapsIsEndOfFrameCallback)(wrapper)) ;
|
||||||
) {
|
) {
|
||||||
if ((*IsValidFrameCallback)(wrapper)) {
|
if ((*nsCapsIsValidFrameCallback)(wrapper)) {
|
||||||
if (depth >= callerDepth) {
|
if (depth >= callerDepth) {
|
||||||
principalArray = (nsPrincipalArray *) (*GetPrincipalArrayCallback)(wrapper);
|
principalArray = (nsPrincipalArray *) (*nsCapsGetPrincipalArrayCallback)(wrapper);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(*GetNextFrameCallback)(wrapper, &depth))
|
if (!(*nsCapsGetNextFrameCallback)(wrapper, &depth))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
(*FreeNSJSJavaFrameWrapperCallback)(wrapper);
|
(*nsCapsFreeNSJSJavaFrameWrapperCallback)(wrapper);
|
||||||
return principalArray;
|
return principalArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1228,14 +1147,17 @@ nsPrivilegeManager::getPrivilegeTableFromStack(PRInt32 callerDepth,
|
|||||||
struct NSJSJavaFrameWrapper *wrapper = NULL;
|
struct NSJSJavaFrameWrapper *wrapper = NULL;
|
||||||
nsPrivilegeTable *annotation;
|
nsPrivilegeTable *annotation;
|
||||||
|
|
||||||
wrapper = (*NewNSJSJavaFrameWrapperCallback)();
|
if (*nsCapsNewNSJSJavaFrameWrapperCallback == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
wrapper = (*nsCapsNewNSJSJavaFrameWrapperCallback)();
|
||||||
if (wrapper == NULL)
|
if (wrapper == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for ((*GetStartFrameCallback)(wrapper) ;
|
for ((*nsCapsGetStartFrameCallback)(wrapper) ;
|
||||||
(!(*IsEndOfFrameCallback)(wrapper)) ;
|
(!(*nsCapsIsEndOfFrameCallback)(wrapper)) ;
|
||||||
) {
|
) {
|
||||||
if ((*IsValidFrameCallback)(wrapper)) {
|
if ((*nsCapsIsValidFrameCallback)(wrapper)) {
|
||||||
if (depth >= callerDepth) {
|
if (depth >= callerDepth) {
|
||||||
/*
|
/*
|
||||||
* it's possible for the annotation to be NULL, meaning
|
* it's possible for the annotation to be NULL, meaning
|
||||||
@ -1244,7 +1166,7 @@ nsPrivilegeManager::getPrivilegeTableFromStack(PRInt32 callerDepth,
|
|||||||
* default "blank forever" privileges), assign that
|
* default "blank forever" privileges), assign that
|
||||||
* to the annotation, and return it.
|
* to the annotation, and return it.
|
||||||
*/
|
*/
|
||||||
annotation = (nsPrivilegeTable *) (*GetAnnotationCallback)(wrapper);
|
annotation = (nsPrivilegeTable *) (*nsCapsGetAnnotationCallback)(wrapper);
|
||||||
if (createIfNull && annotation == NULL) {
|
if (createIfNull && annotation == NULL) {
|
||||||
privTable = new nsPrivilegeTable();
|
privTable = new nsPrivilegeTable();
|
||||||
if (privTable == NULL) {
|
if (privTable == NULL) {
|
||||||
@ -1255,22 +1177,21 @@ nsPrivilegeManager::getPrivilegeTableFromStack(PRInt32 callerDepth,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PR_ASSERT(privTable != NULL);
|
PR_ASSERT(privTable != NULL);
|
||||||
(*SetAnnotationCallback)(wrapper, privTable);
|
(*nsCapsSetAnnotationCallback)(wrapper, privTable);
|
||||||
} else {
|
} else {
|
||||||
privTable = annotation;
|
privTable = annotation;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(*GetNextFrameCallback)(wrapper, &depth))
|
if (!(*nsCapsGetNextFrameCallback)(wrapper, &depth))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
(*FreeNSJSJavaFrameWrapperCallback)(wrapper);
|
(*nsCapsFreeNSJSJavaFrameWrapperCallback)(wrapper);
|
||||||
return privTable;
|
return privTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_raman
|
static JSec_Principal
|
||||||
JSec_Principal
|
|
||||||
RDF_CreatePrincipal(nsPrincipal *prin)
|
RDF_CreatePrincipal(nsPrincipal *prin)
|
||||||
{
|
{
|
||||||
/* For certificate principals we should convert the key into string, because
|
/* For certificate principals we should convert the key into string, because
|
||||||
@ -1342,7 +1263,7 @@ RDF_getPrincipal(JSec_Principal jsec_pr)
|
|||||||
return prin;
|
return prin;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSec_Target
|
static JSec_Target
|
||||||
RDF_CreateTarget(nsTarget *target)
|
RDF_CreateTarget(nsTarget *target)
|
||||||
{
|
{
|
||||||
char *targetName = target->getName();
|
char *targetName = target->getName();
|
||||||
@ -1351,7 +1272,7 @@ RDF_CreateTarget(nsTarget *target)
|
|||||||
return RDFJSec_NewTarget(targetName, pr);
|
return RDFJSec_NewTarget(targetName, pr);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsTarget *
|
static nsTarget *
|
||||||
RDF_getTarget(JSec_Target jsec_target)
|
RDF_getTarget(JSec_Target jsec_target)
|
||||||
{
|
{
|
||||||
char *targetName = RDFJSec_GetTargetName(jsec_target);
|
char *targetName = RDFJSec_GetTargetName(jsec_target);
|
||||||
@ -1410,7 +1331,6 @@ RDF_RemovePrincipalsPrivilege(nsPrincipal *prin, nsTarget *target)
|
|||||||
nsCaps_unlock();
|
nsCaps_unlock();
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
|
|
||||||
|
|
||||||
/* The following methods are used to save and load the persistent store */
|
/* The following methods are used to save and load the persistent store */
|
||||||
@ -1423,7 +1343,6 @@ void nsPrivilegeManager::save(nsPrincipal *prin,
|
|||||||
if (prin->equals(getSystemPrincipal())) {
|
if (prin->equals(getSystemPrincipal())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_raman
|
|
||||||
nsCaps_lock();
|
nsCaps_lock();
|
||||||
RDFJSec_InitPrivilegeDB();
|
RDFJSec_InitPrivilegeDB();
|
||||||
JSec_Principal pr = RDF_CreatePrincipal(prin);
|
JSec_Principal pr = RDF_CreatePrincipal(prin);
|
||||||
@ -1433,7 +1352,6 @@ void nsPrivilegeManager::save(nsPrincipal *prin,
|
|||||||
RDFJSec_AddPrincipalUse(pr, prUse);
|
RDFJSec_AddPrincipalUse(pr, prUse);
|
||||||
|
|
||||||
nsCaps_unlock();
|
nsCaps_unlock();
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The following routine should be called after setting up the system targets
|
/* The following routine should be called after setting up the system targets
|
||||||
@ -1441,7 +1359,6 @@ void nsPrivilegeManager::save(nsPrincipal *prin,
|
|||||||
*/
|
*/
|
||||||
void nsPrivilegeManager::load(void)
|
void nsPrivilegeManager::load(void)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_raman
|
|
||||||
nsCaps_lock();
|
nsCaps_lock();
|
||||||
RDFJSec_InitPrivilegeDB();
|
RDFJSec_InitPrivilegeDB();
|
||||||
RDF_Cursor prin_cursor = RDFJSec_ListAllPrincipals();
|
RDF_Cursor prin_cursor = RDFJSec_ListAllPrincipals();
|
||||||
@ -1479,7 +1396,6 @@ void nsPrivilegeManager::load(void)
|
|||||||
|
|
||||||
RDFJSec_ReleaseCursor(prin_cursor);
|
RDFJSec_ReleaseCursor(prin_cursor);
|
||||||
nsCaps_unlock();
|
nsCaps_unlock();
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1502,12 +1418,8 @@ PRBool nsPrivilegeManagerInitialize(void)
|
|||||||
theUnknownPrincipalArray->Add(theUnknownPrincipal);
|
theUnknownPrincipalArray->Add(theUnknownPrincipal);
|
||||||
|
|
||||||
thePrivilegeManager = new nsPrivilegeManager();
|
thePrivilegeManager = new nsPrivilegeManager();
|
||||||
#ifdef DEBUG_raman
|
|
||||||
RDFJSec_InitPrivilegeDB();
|
RDFJSec_InitPrivilegeDB();
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
#endif /* DEBUG_raman */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool nsPrivilegeManager::theInited = nsPrivilegeManagerInitialize();
|
PRBool nsPrivilegeManager::theInited = nsPrivilegeManagerInitialize();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,8 @@ extern "C" {
|
|||||||
|
|
||||||
#include "jpermission.h"
|
#include "jpermission.h"
|
||||||
|
|
||||||
|
static PRBool displayUI=PR_FALSE;
|
||||||
|
|
||||||
static nsPermState
|
static nsPermState
|
||||||
displayPermissionDialog(char *prinStr, char *targetStr, char *riskStr, PRBool isCert)
|
displayPermissionDialog(char *prinStr, char *targetStr, char *riskStr, PRBool isCert)
|
||||||
{
|
{
|
||||||
@ -60,10 +62,12 @@ nsPrivilege * nsUserTarget::enablePrivilege(nsPrincipal *prin, void *data)
|
|||||||
PRBool isCert = (prin->isCodebase()) ? PR_FALSE : PR_TRUE;
|
PRBool isCert = (prin->isCodebase()) ? PR_FALSE : PR_TRUE;
|
||||||
nsPermState permState = nsPermState_AllowedSession;
|
nsPermState permState = nsPermState_AllowedSession;
|
||||||
|
|
||||||
nsCaps_lock();
|
/* set displayUI to TRUE, to enable UI */
|
||||||
/* comment the above line, uncomment the following line to disable UI */
|
if (displayUI) {
|
||||||
permState = displayPermissionDialog(prinStr, targetStr, riskStr, isCert);
|
nsCaps_lock();
|
||||||
nsCaps_unlock();
|
permState = displayPermissionDialog(prinStr, targetStr, riskStr, isCert);
|
||||||
|
nsCaps_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
nsPermissionState permVal;
|
nsPermissionState permVal;
|
||||||
nsDurationState durationVal;
|
nsDurationState durationVal;
|
||||||
|
|||||||
@ -16,9 +16,15 @@
|
|||||||
* Reserved.
|
* Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "prtypes.h"
|
||||||
|
|
||||||
|
PR_BEGIN_EXTERN_C
|
||||||
|
|
||||||
#include "nsZig.h"
|
#include "nsZig.h"
|
||||||
#include "zig.h"
|
#include "zig.h"
|
||||||
|
|
||||||
|
PR_END_EXTERN_C
|
||||||
|
|
||||||
//
|
//
|
||||||
// PUBLIC METHODS
|
// PUBLIC METHODS
|
||||||
//
|
//
|
||||||
|
|||||||
@ -93,7 +93,8 @@ REQUIRES =\
|
|||||||
plds \
|
plds \
|
||||||
nspr20 \
|
nspr20 \
|
||||||
parse \
|
parse \
|
||||||
plug \
|
plugin \
|
||||||
|
plugimpl \
|
||||||
hook \
|
hook \
|
||||||
pref \
|
pref \
|
||||||
rdf \
|
rdf \
|
||||||
@ -118,7 +119,12 @@ REQUIRES += \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef MOZ_FULLCIRCLE
|
ifdef MOZ_FULLCIRCLE
|
||||||
REQUIRES += fullsoft
|
REQUIRES += fullsoft
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef OJI
|
||||||
|
REQUIRES += oji \
|
||||||
|
ojiimpl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CSRCS = \
|
CSRCS = \
|
||||||
@ -185,6 +191,7 @@ GUESS_CONFIG := $(shell $(DEPTH)/config/config.guess | sed 's/i[23456]86/x86/')
|
|||||||
CCLD = $(CCC)
|
CCLD = $(CCC)
|
||||||
LDFLAGS = $(CFLAGS)
|
LDFLAGS = $(CFLAGS)
|
||||||
NOMD_LDFLAGS = $(NOMD_CFLAGS)
|
NOMD_LDFLAGS = $(NOMD_CFLAGS)
|
||||||
|
BASIC_DSOS = -L$(DIST)/bin
|
||||||
|
|
||||||
ifdef MOZILLA_GPROF
|
ifdef MOZILLA_GPROF
|
||||||
CSRCS += gmon.c
|
CSRCS += gmon.c
|
||||||
@ -219,10 +226,21 @@ DTWIDGETS_LIB = $(DIST)/lib/libDtWidgets.a
|
|||||||
XFE_WIDGETS_LIB = $(DIST)/lib/libXfeWidgets.a
|
XFE_WIDGETS_LIB = $(DIST)/lib/libXfeWidgets.a
|
||||||
XFE_WIDGETS_BM_LIB = $(DIST)/lib/libXfeBm.a
|
XFE_WIDGETS_BM_LIB = $(DIST)/lib/libXfeBm.a
|
||||||
|
|
||||||
|
DYNAMIC_SYMBOLS_F = -rdynamic # default
|
||||||
|
ifeq ($(OS_ARCH),SunOS)
|
||||||
|
ifdef NS_USE_NATIVE
|
||||||
|
DYNAMIC_SYMBOLS_F = -Bdynamic
|
||||||
|
else
|
||||||
|
DYNAMIC_SYMBOLS_F = # nothing for gcc
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),AIX)
|
ifeq ($(OS_ARCH),AIX)
|
||||||
NSPR_LIB =
|
NSPR_LIB =
|
||||||
else
|
else
|
||||||
NSPR_LIB = $(DIST)/lib/libplds21.a $(DIST)/lib/libplc21.a $(DIST)/lib/libmsgc21.a $(DIST)/lib/libnspr21.a
|
# XXX To a DSO...
|
||||||
|
#NSPR_LIB = $(DIST)/lib/libplds21.a $(DIST)/lib/libplc21.a $(DIST)/lib/libmsgc21.a $(DIST)/lib/libnspr21.a
|
||||||
|
BASIC_DSOS += -lplds21 -lplc21 -lmsgc21 -lnspr21
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef DBMALLOC
|
ifdef DBMALLOC
|
||||||
@ -282,7 +300,7 @@ ifdef MOZ_LOC_INDEP
|
|||||||
BASIC_LIBS += $(DIST)/lib/libli.a
|
BASIC_LIBS += $(DIST)/lib/libli.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
JAVA_JMC = $(DIST)/lib/libjmc.a # XXX To be removed...
|
JAVA_JMC = $(DIST)/lib/libjmc.a # XXX To be removed...
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -302,6 +320,8 @@ BASIC_LIBS += \
|
|||||||
BASIC_LIBS_2 = \
|
BASIC_LIBS_2 = \
|
||||||
$(DIST)/lib/lib$(LITE_PREFIX)xp.a \
|
$(DIST)/lib/lib$(LITE_PREFIX)xp.a \
|
||||||
$(DIST)/lib/libdbm.a \
|
$(DIST)/lib/libdbm.a \
|
||||||
|
$(DIST)/lib/libcaps.a \
|
||||||
|
$(DIST)/lib/lib$(LITE_PREFIX)rdf.a \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifdef MOZ_MAIL_NEWS
|
ifdef MOZ_MAIL_NEWS
|
||||||
@ -379,15 +399,18 @@ ifndef NO_LAYERS
|
|||||||
BASIC_LIBS += $(DIST)/lib/liblayer.a
|
BASIC_LIBS += $(DIST)/lib/liblayer.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BASIC_LIBS += $(DIST)/lib/libxpcom.a
|
BASIC_LIBS += $(DIST)/lib/libxpcom.a \
|
||||||
|
$(DIST)/lib/libcaps.a
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
########################################################################
|
||||||
|
# Java
|
||||||
BASIC_LIBS += $(DIST)/lib/libcaps.a
|
#
|
||||||
|
|
||||||
ifdef MOZ_JAVA
|
ifdef MOZ_JAVA
|
||||||
|
#
|
||||||
# Monolithic Java
|
# Monolithic Java
|
||||||
|
#
|
||||||
|
|
||||||
BASIC_LIBS += \
|
BASIC_LIBS += \
|
||||||
$(DIST)/lib/lib$(LITE_PREFIX)applet.a \
|
$(DIST)/lib/lib$(LITE_PREFIX)applet.a \
|
||||||
$(DIST)/lib/libjrt.a \
|
$(DIST)/lib/libjrt.a \
|
||||||
@ -423,35 +446,52 @@ endif
|
|||||||
|
|
||||||
BASIC_LIBS += $(DIST)/lib/libjrt.a
|
BASIC_LIBS += $(DIST)/lib/libjrt.a
|
||||||
|
|
||||||
else # MOZ_JAVA
|
else # !MOZ_JAVA
|
||||||
|
|
||||||
|
#
|
||||||
# OJI
|
# OJI
|
||||||
|
#
|
||||||
|
|
||||||
|
ifdef MOZ_OJI
|
||||||
|
|
||||||
BASIC_LIBS += $(DIST)/lib/liboji.a
|
BASIC_LIBS += $(DIST)/lib/liboji.a
|
||||||
|
|
||||||
|
ifdef NSJVM
|
||||||
|
|
||||||
ifdef EDITOR
|
ifdef EDITOR
|
||||||
BASIC_LIBS += $(DIST)/lib/libedtplug.a
|
BASIC_LIBS += $(DIST)/lib/libedtplug.a
|
||||||
endif
|
endif
|
||||||
|
BASIC_LIBS += $(DIST)/lib/libsoftupdate.a
|
||||||
|
else # !NSJVM
|
||||||
|
BASIC_LIBS += \
|
||||||
|
$(DIST)/lib/libstubsj.a \
|
||||||
|
$(DIST)/lib/libstubnj.a \
|
||||||
|
$(NULL)
|
||||||
|
endif # !NSJVM
|
||||||
|
|
||||||
BASIC_LIBS += $(DIST)/lib/libsoftupdate.a \
|
BASIC_LIBS += $(DIST)/lib/libprgrss.a \
|
||||||
$(DIST)/lib/libprgrss.a \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
endif # MOZ_JAVA
|
else # !MOZ_OJI
|
||||||
|
|
||||||
else # JAVA_OR_OJI
|
|
||||||
|
|
||||||
# No Monolithic Java, no OJI, just stubs.
|
# No Monolithic Java, no OJI, just stubs.
|
||||||
|
|
||||||
BASIC_LIBS += \
|
BASIC_LIBS += \
|
||||||
$(DIST)/lib/libstubsj.a \
|
$(DIST)/lib/libstubsj.a \
|
||||||
$(DIST)/lib/libstubnj.a \
|
$(DIST)/lib/libstubnj.a \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
endif # JAVA_OR_OJI
|
endif # !MOZ_OJI
|
||||||
|
endif # !MOZ_JAVA
|
||||||
|
|
||||||
BASIC_LIBS += $(DIST)/lib/libzlib.a
|
# XXX To a DSO...
|
||||||
|
#BASIC_LIBS += $(DIST)/lib/libzlib.a
|
||||||
|
BASIC_DSOS += -lzlib
|
||||||
|
|
||||||
ifndef NO_MOCHA
|
ifndef NO_MOCHA
|
||||||
BASIC_LIBS += $(DIST)/lib/libjs.a $(DIST)/lib/libjsj.a $(DIST)/lib/libmocha.a
|
# XXX To a DSO...
|
||||||
|
#BASIC_LIBS += $(DIST)/lib/libjs.a $(DIST)/lib/libjsj.a
|
||||||
|
BASIC_DSOS += -ljs -ljsj
|
||||||
|
BASIC_LIBS += $(DIST)/lib/libmocha.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Post-Java libs
|
# Post-Java libs
|
||||||
@ -460,11 +500,7 @@ BASIC_LIBS += $(DIST)/lib/libstyle.a
|
|||||||
ifdef MOZ_SECURITY
|
ifdef MOZ_SECURITY
|
||||||
BASIC_LIBS += $(DIST)/lib/libjar.a
|
BASIC_LIBS += $(DIST)/lib/libjar.a
|
||||||
else
|
else
|
||||||
EXPORT_LIB = $(DIST)/lib/libhtmldlgs.a
|
EXPORT_LIB = $(DIST)/lib/libhtmldlgs.a $(DIST)/lib/libsecfree.a
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef MOZ_SECURITY
|
|
||||||
EXPORT_LIB += $(DIST)/lib/libsecfree.a
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LOCALES = $(LOCALE_MAP) $(MAIL_IM_HACK) $(NEWS_IM_HACK)
|
LOCALES = $(LOCALE_MAP) $(MAIL_IM_HACK) $(NEWS_IM_HACK)
|
||||||
@ -573,7 +609,7 @@ MCS_CMD = true
|
|||||||
# Only IRIX 5.x uses this.
|
# Only IRIX 5.x uses this.
|
||||||
EXTRA_POST_LINK_CMD = echo
|
EXTRA_POST_LINK_CMD = echo
|
||||||
|
|
||||||
EXPORT_LDFLAGS = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(OTHER_LIBS) $(NSPR_LIB)
|
EXPORT_LDFLAGS = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(BASIC_DSOS) $(OTHER_LIBS) $(NSPR_LIB)
|
||||||
EXPORT_DEPLIBS = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB)
|
EXPORT_DEPLIBS = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB)
|
||||||
|
|
||||||
DSO_EX_LIBS = $(EXPORT_LDFLAGS:$(DIST)/lib/lib%.a=-l%)
|
DSO_EX_LIBS = $(EXPORT_LDFLAGS:$(DIST)/lib/lib%.a=-l%)
|
||||||
@ -878,7 +914,7 @@ endif
|
|||||||
|
|
||||||
EXPORT_LDFLAGS = -z defs -L$(MOTIF)/lib -L$(USRLIBDIR) -R$(MOTIF)/lib \
|
EXPORT_LDFLAGS = -z defs -L$(MOTIF)/lib -L$(USRLIBDIR) -R$(MOTIF)/lib \
|
||||||
-R$(USRLIBDIR) $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) \
|
-R$(USRLIBDIR) $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) \
|
||||||
$(OTHER_LIBS) $(NSPR_LIB)
|
$(BASIC_DSOS) $(OTHER_LIBS) $(NSPR_LIB)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -1011,7 +1047,7 @@ $(OBJDIR)/$(DSO_PROGNAME)-export.quantify: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLI
|
|||||||
$(OBJDIR)/$(XFE_PROGNAME)-export: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
|
$(OBJDIR)/$(XFE_PROGNAME)-export: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
|
||||||
@$(MAKE_OBJDIR)
|
@$(MAKE_OBJDIR)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
$(CCLD) -o $@ $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) $(EXPORT_LDFLAGS) $(DNS_LIB)
|
$(CCLD) -o $@ $(DYNAMIC_SYMBOLS_F) $(LDFLAGS) $(OBJS) $(EXPORT_OBJS) $(EXPORT_LDFLAGS) $(DNS_LIB)
|
||||||
@$(EXTRA_POST_LINK_CMD) $@
|
@$(EXTRA_POST_LINK_CMD) $@
|
||||||
|
|
||||||
$(OBJDIR)/$(XFE_PROGNAME)-export.pure: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
|
$(OBJDIR)/$(XFE_PROGNAME)-export.pure: $(OBJS) $(EXPORT_OBJS) $(EXPORT_DEPLIBS)
|
||||||
|
|||||||
@ -126,7 +126,7 @@ ICONLIST = $(OBJDIR)/icon.list
|
|||||||
ICONANIMLIST = $(OBJDIR)/iconanim.list
|
ICONANIMLIST = $(OBJDIR)/iconanim.list
|
||||||
MKICONS_EXE = $(OBJDIR)/mkicons
|
MKICONS_EXE = $(OBJDIR)/mkicons
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
JAVA_JMC = $(DIST)/lib/libjmc.a # XXX To be removed...
|
JAVA_JMC = $(DIST)/lib/libjmc.a # XXX To be removed...
|
||||||
else
|
else
|
||||||
JAVA_JMC = $(DIST)/lib/libstubsj.a
|
JAVA_JMC = $(DIST)/lib/libstubsj.a
|
||||||
|
|||||||
@ -53,10 +53,17 @@ REQUIRES =\
|
|||||||
rdf \
|
rdf \
|
||||||
progress \
|
progress \
|
||||||
xpcom \
|
xpcom \
|
||||||
|
plugin \
|
||||||
|
plugimpl \
|
||||||
|
raptor \
|
||||||
netcnvts \
|
netcnvts \
|
||||||
msg \
|
msg \
|
||||||
progress \
|
progress
|
||||||
plug
|
|
||||||
|
ifdef OJI
|
||||||
|
REQUIRES += oji \
|
||||||
|
ojiimpl
|
||||||
|
endif
|
||||||
|
|
||||||
CPPSRCS = \
|
CPPSRCS = \
|
||||||
plugin.cpp \
|
plugin.cpp \
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Netscape Public License
|
* The contents of this file are subject to the Netscape Public License
|
||||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||||
@ -924,28 +924,40 @@ FE_LoadPlugin(void *pdesc, NPNetscapeFuncs *funcs, np_handle* handle)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
NP_CREATEPLUGIN npCreatePlugin =
|
nsFactoryProc nsGetFactory =
|
||||||
#ifndef NSPR20
|
(nsFactoryProc)PR_FindSymbol(plugin->dlopen_obj, "NSGetFactory");
|
||||||
(NP_CREATEPLUGIN)PR_FindSymbol("NP_CreatePlugin", plugin->dlopen_obj);
|
|
||||||
#else
|
if (nsGetFactory != NULL) {
|
||||||
(NP_CREATEPLUGIN)PR_FindSymbol(plugin->dlopen_obj, "NP_CreatePlugin");
|
// XXX Figure out where this should go: this seems a
|
||||||
#endif
|
// little late in the game to be creating the plugin
|
||||||
if (npCreatePlugin != NULL) {
|
// manager...
|
||||||
if (thePluginManager == NULL) {
|
if (thePluginManager == NULL) {
|
||||||
static NS_DEFINE_IID(kIPluginManagerIID, NP_IPLUGINMANAGER_IID);
|
static NS_DEFINE_IID(kIPluginManagerIID, NS_IPLUGINMANAGER_IID);
|
||||||
if (nsPluginManager::Create(NULL, kIPluginManagerIID, (void**)&thePluginManager) != NS_OK)
|
if (nsPluginManager::Create(NULL, kIPluginManagerIID, (void**)&thePluginManager) != NS_OK)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
NPIPlugin* userPlugin = NULL;
|
|
||||||
NPPluginError err = npCreatePlugin(thePluginManager, &userPlugin);
|
PR_ASSERT(thePluginManager != NULL);
|
||||||
|
|
||||||
|
static NS_DEFINE_IID(kIPluginIID, NS_IPLUGIN_IID);
|
||||||
|
nsIPlugin* userPlugin = NULL;
|
||||||
|
nsresult err = nsGetFactory(kIPluginIID, (nsIFactory**)&userPlugin);
|
||||||
|
|
||||||
handle->userPlugin = userPlugin;
|
handle->userPlugin = userPlugin;
|
||||||
plugin->handle = handle;
|
plugin->handle = handle;
|
||||||
if (err != NPPluginError_NoError || userPlugin == NULL) {
|
|
||||||
int err = PR_UnloadLibrary(plugin->dlopen_obj);
|
if ((err != NS_OK)
|
||||||
PR_ASSERT(err == 0);
|
|| (userPlugin == NULL)
|
||||||
|
|| (userPlugin->Initialize((nsIPluginManager*)thePluginManager) != NS_OK)) {
|
||||||
|
PR_UnloadLibrary(plugin->dlopen_obj);
|
||||||
plugin->dlopen_obj = NULL;
|
plugin->dlopen_obj = NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LATER // XXX coming soon...
|
||||||
|
// add the plugin directory if successful
|
||||||
|
JVM_AddToClassPathRecursively(csPluginDir);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifndef NSPR20
|
#ifndef NSPR20
|
||||||
@ -998,7 +1010,10 @@ FE_UnloadPlugin(void *pdesc, struct _np_handle* handle)
|
|||||||
|
|
||||||
if (plugin->handle) {
|
if (plugin->handle) {
|
||||||
if (plugin->handle->userPlugin) {
|
if (plugin->handle->userPlugin) {
|
||||||
NPIPlugin* userPlugin = (NPIPlugin*)plugin->handle->userPlugin;
|
nsIPlugin* userPlugin = (nsIPlugin*)plugin->handle->userPlugin;
|
||||||
|
// XXX We should be calling userPlugin->Shutdown() here,
|
||||||
|
// and then we should ping the lib's NSCanUnload()
|
||||||
|
// function before actually unloading the library.
|
||||||
XP_VERIFY(userPlugin->Release() == 0);
|
XP_VERIFY(userPlugin->Release() == 0);
|
||||||
plugin->handle = NULL;
|
plugin->handle = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,6 +104,7 @@ PORT_FLAGS += -DNO_INT64_T
|
|||||||
PLATFORM_FLAGS += -DLINUX2_0
|
PLATFORM_FLAGS += -DLINUX2_0
|
||||||
BUILD_UNIX_PLUGINS = 1
|
BUILD_UNIX_PLUGINS = 1
|
||||||
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
|
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
|
||||||
|
DSO_BIND_REFERENCES = -Wl,-Bsymbolic
|
||||||
ifdef BUILD_OPT
|
ifdef BUILD_OPT
|
||||||
OPTIMIZER = -O2
|
OPTIMIZER = -O2
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -171,6 +171,7 @@ FC_PLATFORM_DIR = SunOS5_sparc
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||||
|
DSO_BIND_REFERENCES = -Bsymbolic
|
||||||
|
|
||||||
DSO_LDOPTS = -G -L$(MOTIF)/lib -L/usr/openwin/lib
|
DSO_LDOPTS = -G -L$(MOTIF)/lib -L/usr/openwin/lib
|
||||||
DSO_LDFLAGS =
|
DSO_LDFLAGS =
|
||||||
|
|||||||
@ -499,6 +499,11 @@ ifdef MOZ_OJI
|
|||||||
error You can't define both MOZ_JAVA and MOZ_OJI anymore.
|
error You can't define both MOZ_JAVA and MOZ_OJI anymore.
|
||||||
endif
|
endif
|
||||||
JAVA_OR_OJI = 1
|
JAVA_OR_OJI = 1
|
||||||
|
JAVA_OR_NSJVM = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef NSJVM
|
||||||
|
JAVA_OR_NSJVM = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef MOZ_OJI
|
ifdef MOZ_OJI
|
||||||
@ -506,7 +511,7 @@ DEFINES += -DOJI
|
|||||||
JAVA_OR_OJI = 1
|
JAVA_OR_OJI = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM # XXX fix -- su can't depend on java
|
||||||
MOZ_SMARTUPDATE = 1
|
MOZ_SMARTUPDATE = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,9 @@
|
|||||||
# JRI_GEN -- files to run through javah to generate headers and stubs
|
# JRI_GEN -- files to run through javah to generate headers and stubs
|
||||||
# (output goes into the _jri sub-dir)
|
# (output goes into the _jri sub-dir)
|
||||||
# j)
|
# j)
|
||||||
|
# JNI_GEN -- files to run through javah to generate headers and stubs
|
||||||
|
# (output goes into the _jni sub-dir)
|
||||||
|
# k)
|
||||||
# JMC_GEN -- files to run through jmc to generate headers and stubs
|
# JMC_GEN -- files to run through jmc to generate headers and stubs
|
||||||
# (output goes into the _jmc sub-dir)
|
# (output goes into the _jmc sub-dir)
|
||||||
#
|
#
|
||||||
@ -167,7 +170,7 @@ ifndef PACKAGE
|
|||||||
PACKAGE = .
|
PACKAGE = .
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
|
ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
|
||||||
$(NOSUCHFILE) $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \
|
$(NOSUCHFILE) $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \
|
||||||
$(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) $(JMC_STUBS) \
|
$(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) $(JMC_STUBS) \
|
||||||
@ -182,13 +185,13 @@ ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
|
|||||||
_gen _stubs $(wildcard gts_tmp_*)
|
_gen _stubs $(wildcard gts_tmp_*)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
ifdef JDIRS
|
ifdef JDIRS
|
||||||
ALL_TRASH += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS))
|
ALL_TRASH += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
JMC_SUBDIR = _jmc
|
JMC_SUBDIR = _jmc
|
||||||
else
|
else
|
||||||
JMC_SUBDIR = $(LOCAL_JMC_SUBDIR)
|
JMC_SUBDIR = $(LOCAL_JMC_SUBDIR)
|
||||||
@ -198,11 +201,13 @@ ifdef NSBUILDROOT
|
|||||||
JDK_GEN_DIR = $(XPDIST)/_gen
|
JDK_GEN_DIR = $(XPDIST)/_gen
|
||||||
JMC_GEN_DIR = $(XPDIST)/$(JMC_SUBDIR)
|
JMC_GEN_DIR = $(XPDIST)/$(JMC_SUBDIR)
|
||||||
JRI_GEN_DIR = $(XPDIST)/_jri
|
JRI_GEN_DIR = $(XPDIST)/_jri
|
||||||
|
JNI_GEN_DIR = $(XPDIST)/_jni
|
||||||
JDK_STUB_DIR = $(XPDIST)/_stubs
|
JDK_STUB_DIR = $(XPDIST)/_stubs
|
||||||
else
|
else
|
||||||
JDK_GEN_DIR = _gen
|
JDK_GEN_DIR = _gen
|
||||||
JMC_GEN_DIR = $(JMC_SUBDIR)
|
JMC_GEN_DIR = $(JMC_SUBDIR)
|
||||||
JRI_GEN_DIR = _jri
|
JRI_GEN_DIR = _jri
|
||||||
|
JNI_GEN_DIR = _jni
|
||||||
JDK_STUB_DIR = _stubs
|
JDK_STUB_DIR = _stubs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -483,7 +488,7 @@ $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) $(JMCSRCDIR)::
|
|||||||
### JSRCS -- for compiling java files
|
### JSRCS -- for compiling java files
|
||||||
|
|
||||||
ifneq ($(JSRCS),)
|
ifneq ($(JSRCS),)
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
||||||
list=`$(PERL) $(DEPTH)/config/outofdate.pl $(PERLARG) \
|
list=`$(PERL) $(DEPTH)/config/outofdate.pl $(PERLARG) \
|
||||||
-d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS)`; \
|
-d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS)`; \
|
||||||
@ -508,7 +513,7 @@ endif
|
|||||||
# some builds to run out of memory
|
# some builds to run out of memory
|
||||||
#
|
#
|
||||||
ifdef JDIRS
|
ifdef JDIRS
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
||||||
@for d in $(JDIRS); do \
|
@for d in $(JDIRS); do \
|
||||||
if test -d $$d; then \
|
if test -d $$d; then \
|
||||||
@ -536,7 +541,7 @@ endif
|
|||||||
# Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory
|
# Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory
|
||||||
#
|
#
|
||||||
ifneq ($(JDK_GEN),)
|
ifneq ($(JDK_GEN),)
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
ifdef NSBUILDROOT
|
ifdef NSBUILDROOT
|
||||||
INCLUDES += -I$(JDK_GEN_DIR) -I$(XPDIST)
|
INCLUDES += -I$(JDK_GEN_DIR) -I$(XPDIST)
|
||||||
else
|
else
|
||||||
@ -568,7 +573,7 @@ ifdef MOZ_GENMAC
|
|||||||
@echo Generating/Updating JDK stubs for the Mac
|
@echo Generating/Updating JDK stubs for the Mac
|
||||||
$(JAVAH) -mac -stubs -d $(DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES)
|
$(JAVAH) -mac -stubs -d $(DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES)
|
||||||
endif
|
endif
|
||||||
endif # JAVA_OR_OJI
|
endif # JAVA_OR_NSJVM
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -577,7 +582,7 @@ endif
|
|||||||
# Generate JRI Headers and Stubs into the 'jri' directory
|
# Generate JRI Headers and Stubs into the 'jri' directory
|
||||||
#
|
#
|
||||||
ifneq ($(JRI_GEN),)
|
ifneq ($(JRI_GEN),)
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
ifdef NSBUILDROOT
|
ifdef NSBUILDROOT
|
||||||
INCLUDES += -I$(JRI_GEN_DIR) -I$(XPDIST)
|
INCLUDES += -I$(JRI_GEN_DIR) -I$(XPDIST)
|
||||||
else
|
else
|
||||||
@ -609,14 +614,53 @@ ifdef MOZ_GENMAC
|
|||||||
@echo Generating/Updating JRI stubs for the Mac
|
@echo Generating/Updating JRI stubs for the Mac
|
||||||
$(JAVAH) -jri -mac -stubs -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES)
|
$(JAVAH) -jri -mac -stubs -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES)
|
||||||
endif
|
endif
|
||||||
endif # JAVA_OR_OJI
|
endif # JAVA_OR_NSJVM
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# JNI_GEN -- for generating JNI native methods
|
||||||
|
#
|
||||||
|
# Generate JNI Headers and Stubs into the 'jni' directory
|
||||||
|
#
|
||||||
|
ifneq ($(JNI_GEN),)
|
||||||
|
ifdef JAVA_OR_NSJVM
|
||||||
|
ifdef NSBUILDROOT
|
||||||
|
INCLUDES += -I$(JNI_GEN_DIR) -I$(XPDIST)
|
||||||
|
else
|
||||||
|
INCLUDES += -I$(JNI_GEN_DIR)
|
||||||
|
endif
|
||||||
|
JNI_PACKAGE_CLASSES = $(JNI_GEN)
|
||||||
|
JNI_PATH_CLASSES = $(subst .,/,$(JNI_PACKAGE_CLASSES))
|
||||||
|
JNI_HEADER_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JNI_PATH_CLASSES))
|
||||||
|
JNI_HEADER_CFILES = $(patsubst %,$(JNI_GEN_DIR)/%.h,$(JNI_GEN))
|
||||||
|
JNI_STUB_CFILES = $(patsubst %,$(JNI_GEN_DIR)/%.c,$(JNI_GEN))
|
||||||
|
|
||||||
|
$(JNI_HEADER_CFILES): $(JNI_HEADER_CLASSFILES)
|
||||||
|
|
||||||
|
export::
|
||||||
|
@echo Generating/Updating JNI headers
|
||||||
|
$(JAVAH) -jni -d $(JNI_GEN_DIR) $(JNI_PACKAGE_CLASSES)
|
||||||
|
ifdef MOZ_GENMAC
|
||||||
|
@if test ! -d $(DEPTH)/lib/mac/Java/; then \
|
||||||
|
echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \
|
||||||
|
echo "!!! This allows us to automatically update generated files for the mac."; \
|
||||||
|
echo "!!! If you see any modified files there, please check them in."; \
|
||||||
|
fi
|
||||||
|
@echo Generating/Updating JNI headers for the Mac
|
||||||
|
$(JAVAH) -jni -mac -d $(DEPTH)/lib/mac/Java/_jni $(JNI_PACKAGE_CLASSES)
|
||||||
|
endif
|
||||||
|
endif # JAVA_OR_NSJVM
|
||||||
|
endif # JNI_GEN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# JMC_EXPORT -- for declaring which java classes are to be exported for jmc
|
# JMC_EXPORT -- for declaring which java classes are to be exported for jmc
|
||||||
#
|
#
|
||||||
ifneq ($(JMC_EXPORT),)
|
ifneq ($(JMC_EXPORT),)
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
JMC_EXPORT_PATHS = $(subst .,/,$(JMC_EXPORT))
|
JMC_EXPORT_PATHS = $(subst .,/,$(JMC_EXPORT))
|
||||||
JMC_EXPORT_FILES = $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS))
|
JMC_EXPORT_FILES = $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS))
|
||||||
|
|
||||||
@ -627,7 +671,7 @@ JMC_EXPORT_FILES = $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT
|
|||||||
#
|
#
|
||||||
export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
||||||
$(NSINSTALL) -t -m 444 $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
$(NSINSTALL) -t -m 444 $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
||||||
endif # JAVA_OR_OJI
|
endif # JAVA_OR_NSJVM
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -637,7 +681,7 @@ endif
|
|||||||
#
|
#
|
||||||
ifneq ($(JMC_GEN),)
|
ifneq ($(JMC_GEN),)
|
||||||
INCLUDES += -I$(JMC_GEN_DIR) -I.
|
INCLUDES += -I$(JMC_GEN_DIR) -I.
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM
|
||||||
JMC_HEADERS = $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN))
|
JMC_HEADERS = $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN))
|
||||||
JMC_STUBS = $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN))
|
JMC_STUBS = $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN))
|
||||||
JMC_OBJS = $(patsubst %,$(OBJDIR)/%.o,$(JMC_GEN))
|
JMC_OBJS = $(patsubst %,$(OBJDIR)/%.o,$(JMC_GEN))
|
||||||
@ -657,7 +701,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
export:: $(JMC_HEADERS) $(JMC_STUBS)
|
export:: $(JMC_HEADERS) $(JMC_STUBS)
|
||||||
endif # JAVA_OR_OJI
|
endif # JAVA_OR_NSJVM
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -791,3 +835,14 @@ endif
|
|||||||
#
|
#
|
||||||
.PHONY: all all_platforms alltags boot clean clobber clobber_all export install libs realclean $(OBJDIR) $(DIRS)
|
.PHONY: all all_platforms alltags boot clean clobber clobber_all export install libs realclean $(OBJDIR) $(DIRS)
|
||||||
|
|
||||||
|
envirocheck::
|
||||||
|
@echo -----------------------------------
|
||||||
|
@echo "Enviro-Check (tm)"
|
||||||
|
@echo -----------------------------------
|
||||||
|
@echo "MOZILLA_CLIENT = $(MOZILLA_CLIENT)"
|
||||||
|
@echo "NO_MDUPDATE = $(NO_MDUPDATE)"
|
||||||
|
@echo "BUILD_OPT = $(BUILD_OPT)"
|
||||||
|
@echo "MOZ_LITE = $(MOZ_LITE)"
|
||||||
|
@echo "MOZ_MEDIUM = $(MOZ_MEDIUM)"
|
||||||
|
@echo -----------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -53,8 +53,10 @@ m_cvstrm.h
|
|||||||
ncompat.h
|
ncompat.h
|
||||||
net.h
|
net.h
|
||||||
np.h
|
np.h
|
||||||
|
np2.h
|
||||||
npapi.h
|
npapi.h
|
||||||
npassoc.h
|
npassoc.h
|
||||||
|
npupp.h
|
||||||
nsldap.h
|
nsldap.h
|
||||||
nslocks.h
|
nslocks.h
|
||||||
ntos.h
|
ntos.h
|
||||||
|
|||||||
@ -213,7 +213,12 @@ typedef void
|
|||||||
(PR_CALLBACK *JSLockReleaseFunc)(void * data);
|
(PR_CALLBACK *JSLockReleaseFunc)(void * data);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
extern JSBool PR_CALLBACK LM_LockJS(char **errp);
|
||||||
|
#else
|
||||||
extern void PR_CALLBACK LM_LockJS(void);
|
extern void PR_CALLBACK LM_LockJS(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void PR_CALLBACK LM_UnlockJS(void);
|
extern void PR_CALLBACK LM_UnlockJS(void);
|
||||||
extern JSBool PR_CALLBACK LM_AttemptLockJS(JSLockReleaseFunc fn, void * data);
|
extern JSBool PR_CALLBACK LM_AttemptLockJS(JSLockReleaseFunc fn, void * data);
|
||||||
extern JSBool PR_CALLBACK LM_ClearAttemptLockJS(JSLockReleaseFunc fn, void * data);
|
extern JSBool PR_CALLBACK LM_ClearAttemptLockJS(JSLockReleaseFunc fn, void * data);
|
||||||
|
|||||||
@ -983,6 +983,7 @@ struct LO_CommonPluginStruct_struct {
|
|||||||
#ifdef MOCHA
|
#ifdef MOCHA
|
||||||
struct JSObject *mocha_object;
|
struct JSObject *mocha_object;
|
||||||
#endif
|
#endif
|
||||||
|
int16 sub_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LO_BuiltinStruct_struct {
|
struct LO_BuiltinStruct_struct {
|
||||||
@ -1001,12 +1002,12 @@ struct LO_BuiltinStruct_struct {
|
|||||||
void * FE_Data;
|
void * FE_Data;
|
||||||
void *session_data;
|
void *session_data;
|
||||||
PA_Block builtin_src;
|
PA_Block builtin_src;
|
||||||
#ifndef OJI
|
#if defined(OJI)
|
||||||
|
struct lo_NVList attributes;
|
||||||
|
#else
|
||||||
int32 attribute_cnt;
|
int32 attribute_cnt;
|
||||||
char **attribute_list;
|
char **attribute_list;
|
||||||
char **value_list;
|
char **value_list;
|
||||||
#else
|
|
||||||
lo_NVList attributes;
|
|
||||||
#endif /* OJI */
|
#endif /* OJI */
|
||||||
int32 alignment;
|
int32 alignment;
|
||||||
int32 border_width;
|
int32 border_width;
|
||||||
|
|||||||
@ -658,7 +658,6 @@ typedef struct _mdata {
|
|||||||
#define APPLICATION_WWW_FORM_URLENCODED "application/x-www-form-urlencoded"
|
#define APPLICATION_WWW_FORM_URLENCODED "application/x-www-form-urlencoded"
|
||||||
#define APPLICATION_OLEOBJECT "application/oleobject"
|
#define APPLICATION_OLEOBJECT "application/oleobject"
|
||||||
#define APPLICATION_OLEOBJECT2 "application/x-oleobject"
|
#define APPLICATION_OLEOBJECT2 "application/x-oleobject"
|
||||||
#define APPLICATION_JAVAVM "application/java-vm"
|
|
||||||
#define APPLICATION_JAVAARCHIVE "application/java-archive"
|
#define APPLICATION_JAVAARCHIVE "application/java-archive"
|
||||||
#define APPLICATION_MARIMBA "application/marimba"
|
#define APPLICATION_MARIMBA "application/marimba"
|
||||||
#define APPLICATION_XMARIMBA "application/x-marimba"
|
#define APPLICATION_XMARIMBA "application/x-marimba"
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* np.h $Revision: 3.3 $
|
* np.h $Revision: 3.4 $
|
||||||
* Prototypes for functions exported by libplugin and called by the FEs or other XP libs.
|
* Prototypes for functions exported by libplugin and called by the FEs or other XP libs.
|
||||||
* Prototypes for functions exported by the FEs and called by libplugin are in nppg.h.
|
* Prototypes for functions exported by the FEs and called by libplugin are in nppg.h.
|
||||||
*/
|
*/
|
||||||
@ -129,7 +129,17 @@ extern NPError NPL_RegisterAppletType(NPMIMEType type);
|
|||||||
#endif /* ANTHRAX */
|
#endif /* ANTHRAX */
|
||||||
|
|
||||||
PR_EXTERN(void) NPL_SetPluginWindow(void *data);
|
PR_EXTERN(void) NPL_SetPluginWindow(void *data);
|
||||||
PR_EXTERN(struct NPIPlugin*) NPL_LoadPluginByType(const char* typeAttribute);
|
PR_EXTERN(struct nsIPlugin*) NPL_LoadPluginByType(const char* typeAttribute);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This callback is installed by the FE to handle the nsIPluginManager2::ProcessNextEvent
|
||||||
|
* operation. The result parameter should return PR_TRUE if called on the mozilla thread
|
||||||
|
* (unlike the old nsn_TickleHookProcPtr which returned false (I think)).
|
||||||
|
*/
|
||||||
|
typedef PRBool (PR_CALLBACK* NPL_ProcessNextEventProc)(void* data);
|
||||||
|
|
||||||
|
PR_EXTERN(void)
|
||||||
|
NPL_InstallProcessNextEventProc(NPL_ProcessNextEventProc proc, void* data);
|
||||||
|
|
||||||
XP_END_PROTOS
|
XP_END_PROTOS
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* np2.h $Revision: 3.1 $
|
|
||||||
* Prototypes for functions exported by OJI based libplugin and called by the FEs or other XP libs.
|
* Prototypes for functions exported by OJI based libplugin and called by the FEs or other XP libs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -37,7 +36,7 @@ PR_EXTERN(const char *) NPL_GetText(struct nsIPluginInstance *);
|
|||||||
PR_EXTERN(jobject) NPL_GetJavaObject(struct nsIPluginInstance *);
|
PR_EXTERN(jobject) NPL_GetJavaObject(struct nsIPluginInstance *);
|
||||||
PR_EXTERN(void ) NPL_Release(struct nsISupports *);
|
PR_EXTERN(void ) NPL_Release(struct nsISupports *);
|
||||||
PR_EXTERN(XP_Bool) NPL_IsJVMAndMochaPrefsEnabled(void);
|
PR_EXTERN(XP_Bool) NPL_IsJVMAndMochaPrefsEnabled(void);
|
||||||
PR_EXTERN(void)NPL_JSJInit(void);
|
PR_EXTERN(PRBool)NPL_JSJInit(void);
|
||||||
PR_EXTERN(JNIEnv *)NPL_EnsureJNIExecEnv(PRThread* thread);
|
PR_EXTERN(JNIEnv *)NPL_EnsureJNIExecEnv(PRThread* thread);
|
||||||
|
|
||||||
#endif /* _NP2_H */
|
#endif /* _NP2_H */
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* npapi.h $Revision: 3.2 $
|
* npapi.h $Revision: 3.3 $
|
||||||
* Netscape client plug-in API spec
|
* Netscape client plug-in API spec
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -133,22 +133,29 @@ RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
|
|||||||
#ifndef _UINT16
|
#ifndef _UINT16
|
||||||
typedef unsigned short uint16;
|
typedef unsigned short uint16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _UINT32
|
#ifndef _UINT32
|
||||||
#if defined(__alpha)
|
# ifndef NSPR20
|
||||||
|
# if defined(__alpha)
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
#else /* __alpha */
|
# else /* __alpha */
|
||||||
typedef unsigned long uint32;
|
typedef unsigned long uint32;
|
||||||
#endif /* __alpha */
|
# endif /* __alpha */
|
||||||
|
# endif /* NSPR20 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _INT16
|
#ifndef _INT16
|
||||||
typedef short int16;
|
typedef short int16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _INT32
|
#ifndef _INT32
|
||||||
#if defined(__alpha)
|
# ifndef NSPR20
|
||||||
|
# if defined(__alpha)
|
||||||
typedef int int32;
|
typedef int int32;
|
||||||
#else /* __alpha */
|
# else /* __alpha */
|
||||||
typedef long int32;
|
typedef long int32;
|
||||||
#endif /* __alpha */
|
# endif /* __alpha */
|
||||||
|
# endif /* NSPR20 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
@ -513,11 +520,11 @@ void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
|
|||||||
int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
|
int16 NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
|
||||||
void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
|
void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
|
||||||
NPReason reason, void* notifyData);
|
NPReason reason, void* notifyData);
|
||||||
jref NP_LOADDS NPP_GetJavaClass(void);
|
jref NP_LOADDS NPP_GetJavaClass(void);
|
||||||
NPError NP_LOADDS NPP_GetValue(void *instance, NPPVariable variable,
|
NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable,
|
||||||
void *value);
|
void *value);
|
||||||
NPError NP_LOADDS NPP_SetValue(void *instance, NPNVariable variable,
|
NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable,
|
||||||
void *value);
|
void *value);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NPN_* functions are provided by the navigator and called by the plugin.
|
* NPN_* functions are provided by the navigator and called by the plugin.
|
||||||
|
|||||||
@ -34,6 +34,13 @@ DEPTH = ..
|
|||||||
# See top-level makefile for details
|
# See top-level makefile for details
|
||||||
#
|
#
|
||||||
|
|
||||||
DIRS = src jsj tests
|
ifndef MOZ_OJI
|
||||||
|
DIRS = src \
|
||||||
|
jsj \
|
||||||
|
tests
|
||||||
|
else
|
||||||
|
DIRS = src \
|
||||||
|
tests
|
||||||
|
endif
|
||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
include $(DEPTH)/config/rules.mk
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
!!! HEED THE WARNING.
|
!!! HEED THE WARNING.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if !defined(XP_MAC)
|
||||||
#if defined (JAVA) || defined(OJI)
|
#if defined (JAVA) || defined(OJI)
|
||||||
#define IMPLEMENT_netscape_javascript_JSObject
|
#define IMPLEMENT_netscape_javascript_JSObject
|
||||||
#define IMPLEMENT_netscape_javascript_JSException
|
#define IMPLEMENT_netscape_javascript_JSException
|
||||||
@ -40,3 +41,4 @@
|
|||||||
void _java_javascript_init(void) { }
|
void _java_javascript_init(void) { }
|
||||||
|
|
||||||
#endif /* defined (JAVA) */
|
#endif /* defined (JAVA) */
|
||||||
|
#endif /* !defined(XP_MAC) */
|
||||||
|
|||||||
@ -16,7 +16,10 @@
|
|||||||
DEPTH=..
|
DEPTH=..
|
||||||
|
|
||||||
DIRS=src \
|
DIRS=src \
|
||||||
jsj
|
!ifdef MOZ_JAVA
|
||||||
|
jsj \
|
||||||
|
!endif
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
|
||||||
include <$(DEPTH)\config\rules.mak>
|
include <$(DEPTH)\config\rules.mak>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
jsapi.h
|
jsapi.h
|
||||||
|
jspubtd.h
|
||||||
jsarray.h
|
jsarray.h
|
||||||
jsatom.h
|
jsatom.h
|
||||||
jsbool.h
|
jsbool.h
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
DEPTH = ../..
|
DEPTH = ../..
|
||||||
|
|
||||||
|
DIRS = liveconnect
|
||||||
|
|
||||||
LIBRARY_NAME = js
|
LIBRARY_NAME = js
|
||||||
|
|
||||||
ifeq ($(subst /,_,$(shell uname -s)),OS2)
|
ifeq ($(subst /,_,$(shell uname -s)),OS2)
|
||||||
@ -101,8 +103,6 @@ endif
|
|||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
include $(DEPTH)/config/rules.mk
|
||||||
|
|
||||||
export:: install
|
|
||||||
|
|
||||||
ifndef BUILD_OPT
|
ifndef BUILD_OPT
|
||||||
MOCHAFILE = 1
|
MOCHAFILE = 1
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -63,6 +63,10 @@ js_DropProperty(JSContext *cx, JSObject *obj, JSProperty *prop);
|
|||||||
#define NATIVE_DROP_PROPERTY NULL
|
#define NATIVE_DROP_PROPERTY NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XP_MAC
|
||||||
|
#pragma export on
|
||||||
|
#endif
|
||||||
|
|
||||||
JS_FRIEND_DATA(JSObjectOps) js_ObjectOps = {
|
JS_FRIEND_DATA(JSObjectOps) js_ObjectOps = {
|
||||||
js_NewObjectMap, js_DestroyObjectMap,
|
js_NewObjectMap, js_DestroyObjectMap,
|
||||||
#if defined JS_THREADSAFE && defined DEBUG
|
#if defined JS_THREADSAFE && defined DEBUG
|
||||||
@ -79,6 +83,10 @@ JS_FRIEND_DATA(JSObjectOps) js_ObjectOps = {
|
|||||||
NULL, js_HasInstance
|
NULL, js_HasInstance
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef XP_MAC
|
||||||
|
#pragma export off
|
||||||
|
#endif
|
||||||
|
|
||||||
JSClass js_ObjectClass = {
|
JSClass js_ObjectClass = {
|
||||||
js_Object_str,
|
js_Object_str,
|
||||||
0,
|
0,
|
||||||
|
|||||||
@ -1,4 +1,26 @@
|
|||||||
/*stddef inclusion here to first declare ptrdif as a signed long instead of a signed int*/
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Netscape Public License
|
||||||
|
* Version 1.0 (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 Communicator client 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* stddef inclusion here to first declare ptrdif as a signed long instead of a
|
||||||
|
* signed int.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
# ifndef XP_WIN
|
# ifndef XP_WIN
|
||||||
|
|||||||
@ -27,12 +27,13 @@ DIRS = classes
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef MOZ_OJI
|
||||||
|
|
||||||
MODULE = java
|
MODULE = java
|
||||||
LIBRARY_NAME = jsj
|
LIBRARY_NAME = jsj
|
||||||
|
|
||||||
REQUIRES = java js applet nspr img util layer
|
REQUIRES = java js applet nspr img util layer
|
||||||
|
|
||||||
ifdef MOZ_OJI
|
|
||||||
CSRCS = jsj.c \
|
CSRCS = jsj.c \
|
||||||
jsj_JSObject.c \
|
jsj_JSObject.c \
|
||||||
jsj_JavaArray.c \
|
jsj_JavaArray.c \
|
||||||
@ -46,11 +47,7 @@ CSRCS = jsj.c \
|
|||||||
jsj_hash.c \
|
jsj_hash.c \
|
||||||
jsj_method.c \
|
jsj_method.c \
|
||||||
jsj_utils.c
|
jsj_utils.c
|
||||||
else
|
|
||||||
CSRCS = \
|
|
||||||
jsjava.c \
|
|
||||||
jsStubs.c \
|
|
||||||
$(NULL)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef MOZ_OJI
|
ifdef MOZ_OJI
|
||||||
@ -96,8 +93,6 @@ else
|
|||||||
$(OBJDIR)/stubs.o:
|
$(OBJDIR)/stubs.o:
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export:: install
|
|
||||||
|
|
||||||
ifndef REGENERATE
|
ifndef REGENERATE
|
||||||
|
|
||||||
export:: jsj10.jar
|
export:: jsj10.jar
|
||||||
|
|||||||
@ -374,7 +374,7 @@ JSJ_ConnectToJavaVM(JavaVM *java_vm_arg, const char *user_classpath)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef OJI
|
#if !defined(OJI) && !defined(XP_MAC)
|
||||||
else {
|
else {
|
||||||
/* No Java VM supplied, so create our own */
|
/* No Java VM supplied, so create our own */
|
||||||
JDK1_1InitArgs vm_args;
|
JDK1_1InitArgs vm_args;
|
||||||
|
|||||||
Binary file not shown.
@ -236,7 +236,7 @@ JavaClass_finalize(JSContext *cx, JSObject *obj)
|
|||||||
if (!jEnv)
|
if (!jEnv)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printf("Finalizing %s\n", class_descriptor->name);
|
/* printf("Finalizing %s\n", class_descriptor->name); */
|
||||||
jsj_ReleaseJavaClassDescriptor(cx, jEnv, class_descriptor);
|
jsj_ReleaseJavaClassDescriptor(cx, jEnv, class_descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -582,7 +582,7 @@ static JSBool
|
|||||||
JavaObject_defaultValue(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
|
JavaObject_defaultValue(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
|
||||||
{
|
{
|
||||||
/* printf("In JavaObject_defaultValue()\n"); */
|
/* printf("In JavaObject_defaultValue()\n"); */
|
||||||
return JavaObject_convert(cx, obj, JSTYPE_STRING, vp);
|
return JavaObject_convert(cx, obj, type, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static JSBool
|
static JSBool
|
||||||
|
|||||||
@ -21,6 +21,8 @@
|
|||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
DEPTH=..\..
|
DEPTH=..\..
|
||||||
|
|
||||||
|
DIRS = liveconnect
|
||||||
|
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
#//
|
#//
|
||||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
* "Fast Allocation and Deallocation of Memory Based on Object Lifetimes"
|
* "Fast Allocation and Deallocation of Memory Based on Object Lifetimes"
|
||||||
* David R. Hanson, Software -- Practice and Experience, Vol. 20(1).
|
* David R. Hanson, Software -- Practice and Experience, Vol. 20(1).
|
||||||
*/
|
*/
|
||||||
|
#include "jsstddef.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
|
|||||||
@ -1,11 +1,25 @@
|
|||||||
/* -*- Mode: C; tab-width: 8 -*-
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||||
* Copyright © 1996, 1997, 1998 Netscape Communications Corporation,
|
*
|
||||||
* All Rights Reserved.
|
* The contents of this file are subject to the Netscape Public License
|
||||||
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||||
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||||
|
* http://www.mozilla.org/NPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* NPL.
|
||||||
|
*
|
||||||
|
* The Initial Developer of this code under the NPL is Netscape
|
||||||
|
* Communications Corporation. Portions created by Netscape are
|
||||||
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||||
|
* Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Portable double to alphanumeric string and back converters.
|
* Portable double to alphanumeric string and back converters.
|
||||||
*/
|
*/
|
||||||
|
#include "jsstddef.h"
|
||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
#include "prdtoa.h"
|
#include "prdtoa.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
@ -2538,7 +2552,7 @@ PR_cnvtf(char *buf,int bufsz, int prcsn,double fval)
|
|||||||
|
|
||||||
if(decpt == 9999){
|
if(decpt == 9999){
|
||||||
while((*bufp++ = *nump++) != 0) ;
|
while((*bufp++ = *nump++) != 0) ;
|
||||||
return;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(decpt > (prcsn+1) || decpt < -(prcsn-1) || decpt < -5){
|
if(decpt > (prcsn+1) || decpt < -(prcsn-1) || decpt < -5){
|
||||||
|
|||||||
@ -1,6 +1,19 @@
|
|||||||
/* -*- Mode: C; tab-width: 8 -*-
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||||
* Copyright © 1996, 1997, 1998 Netscape Communications Corporation,
|
*
|
||||||
* All Rights Reserved.
|
* The contents of this file are subject to the Netscape Public License
|
||||||
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||||
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||||
|
* http://www.mozilla.org/NPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* NPL.
|
||||||
|
*
|
||||||
|
* The Initial Developer of this code under the NPL is Netscape
|
||||||
|
* Communications Corporation. Portions created by Netscape are
|
||||||
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||||
|
* Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef prdtoa_h___
|
#ifndef prdtoa_h___
|
||||||
|
|||||||
@ -35,7 +35,7 @@ ifdef MOZ_NEO
|
|||||||
DIRS += libneo
|
DIRS += libneo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DIRS += libparse plugin xlate xp
|
DIRS += libparse xlate xp
|
||||||
|
|
||||||
ifdef MOZ_MAIL_NEWS
|
ifdef MOZ_MAIL_NEWS
|
||||||
DIRS += libaddr libmime
|
DIRS += libaddr libmime
|
||||||
|
|||||||
@ -39,6 +39,20 @@ void lo_FillInBuiltinGeometry(lo_DocState *state, LO_BuiltinStruct *builtin,
|
|||||||
void lo_UpdateStateAfterBuiltinLayout (lo_DocState *state, LO_BuiltinStruct *builtin,
|
void lo_UpdateStateAfterBuiltinLayout (lo_DocState *state, LO_BuiltinStruct *builtin,
|
||||||
int32 line_inc, int32 baseline_inc);
|
int32 line_inc, int32 baseline_inc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some accessor macros, to manage the OJI changes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(OJI)
|
||||||
|
#define BUILTIN_ATTRIBUTE_COUNT(builtin) (builtin)->attributes.n
|
||||||
|
#define BUILTIN_ATTRIBUTE_NAMES(builtin) (builtin)->attributes.names
|
||||||
|
#define BUILTIN_ATTRIBUTE_VALUES(builtin) (builtin)->attributes.values
|
||||||
|
#else
|
||||||
|
#define BUILTIN_ATTRIBUTE_COUNT(builtin) (builtin)->attribute_cnt
|
||||||
|
#define BUILTIN_ATTRIBUTE_NAMES(builtin) (builtin)->attribute_list
|
||||||
|
#define BUILTIN_ATTRIBUTE_VALUES(builtin) (builtin)->value_list
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag)
|
lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag)
|
||||||
{
|
{
|
||||||
@ -74,12 +88,13 @@ lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag)
|
|||||||
builtin->height = 0;
|
builtin->height = 0;
|
||||||
builtin->next = NULL;
|
builtin->next = NULL;
|
||||||
builtin->prev = NULL;
|
builtin->prev = NULL;
|
||||||
builtin->attribute_cnt = 0;
|
|
||||||
builtin->attribute_list = NULL;
|
|
||||||
builtin->value_list = NULL;
|
|
||||||
|
|
||||||
builtin->attribute_cnt = PA_FetchAllNameValues (tag,
|
BUILTIN_ATTRIBUTE_COUNT(builtin) = 0;
|
||||||
&(builtin->attribute_list), &(builtin->value_list), CS_FE_ASCII);
|
BUILTIN_ATTRIBUTE_NAMES(builtin) = NULL;
|
||||||
|
BUILTIN_ATTRIBUTE_VALUES(builtin) = NULL;
|
||||||
|
|
||||||
|
BUILTIN_ATTRIBUTE_COUNT(builtin) = PA_FetchAllNameValues (tag,
|
||||||
|
&BUILTIN_ATTRIBUTE_NAMES(builtin), &BUILTIN_ATTRIBUTE_VALUES(builtin), CS_FE_ASCII);
|
||||||
|
|
||||||
lo_FormatBuiltinInternal (context, state, tag, builtin, FALSE, FALSE);
|
lo_FormatBuiltinInternal (context, state, tag, builtin, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
@ -87,18 +102,18 @@ lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag)
|
|||||||
void
|
void
|
||||||
lo_appendParams (LO_BuiltinStruct *builtin, uint32 param_count,
|
lo_appendParams (LO_BuiltinStruct *builtin, uint32 param_count,
|
||||||
char **param_names, char **param_values) {
|
char **param_names, char **param_values) {
|
||||||
int32 newcount = builtin->attribute_cnt + param_count;
|
int32 newcount = BUILTIN_ATTRIBUTE_COUNT(builtin) + param_count;
|
||||||
int32 n = builtin->attribute_cnt;
|
int32 n = BUILTIN_ATTRIBUTE_COUNT(builtin);
|
||||||
builtin->attribute_list = (char**)XP_REALLOC(builtin->attribute_list,
|
BUILTIN_ATTRIBUTE_NAMES(builtin) = (char**)XP_REALLOC(BUILTIN_ATTRIBUTE_NAMES(builtin),
|
||||||
newcount * sizeof(char*));
|
newcount * sizeof(char*));
|
||||||
builtin->value_list = (char**)XP_REALLOC(builtin->value_list,
|
BUILTIN_ATTRIBUTE_VALUES(builtin) = (char**)XP_REALLOC(BUILTIN_ATTRIBUTE_VALUES(builtin),
|
||||||
newcount * sizeof(char*));
|
newcount * sizeof(char*));
|
||||||
while (n < newcount) {
|
while (n < newcount) {
|
||||||
*(builtin->attribute_list + n) = XP_STRDUP(*(param_names + n - builtin->attribute_cnt));
|
*(BUILTIN_ATTRIBUTE_NAMES(builtin) + n) = XP_STRDUP(*(param_names + n - BUILTIN_ATTRIBUTE_COUNT(builtin)));
|
||||||
*(builtin->value_list + n) = XP_STRDUP(*(param_values + n - builtin->attribute_cnt));
|
*(BUILTIN_ATTRIBUTE_VALUES(builtin) + n) = XP_STRDUP(*(param_values + n - BUILTIN_ATTRIBUTE_COUNT(builtin)));
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
builtin->attribute_cnt = builtin->attribute_cnt + param_count;
|
BUILTIN_ATTRIBUTE_COUNT(builtin) = BUILTIN_ATTRIBUTE_COUNT(builtin) + param_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -115,12 +130,12 @@ lo_FormatBuiltinObject (MWContext *context, lo_DocState* state,
|
|||||||
printf ("lo_FormatBuiltinObject\n");
|
printf ("lo_FormatBuiltinObject\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
builtin->attribute_cnt = 0;
|
BUILTIN_ATTRIBUTE_COUNT(builtin) = 0;
|
||||||
builtin->attribute_list = NULL;
|
BUILTIN_ATTRIBUTE_NAMES(builtin) = NULL;
|
||||||
builtin->value_list = NULL;
|
BUILTIN_ATTRIBUTE_VALUES(builtin) = NULL;
|
||||||
|
|
||||||
builtin->attribute_cnt = PA_FetchAllNameValues (tag,
|
BUILTIN_ATTRIBUTE_COUNT(builtin) = PA_FetchAllNameValues (tag,
|
||||||
&(builtin->attribute_list), &(builtin->value_list), CS_FE_ASCII);
|
&(BUILTIN_ATTRIBUTE_NAMES(builtin)), &(BUILTIN_ATTRIBUTE_VALUES(builtin)), CS_FE_ASCII);
|
||||||
|
|
||||||
if (param_count > 0) lo_appendParams(builtin, param_count, param_names, param_values);
|
if (param_count > 0) lo_appendParams(builtin, param_count, param_names, param_values);
|
||||||
lo_FormatBuiltinInternal (context, state, tag, builtin, TRUE, streamStarted);
|
lo_FormatBuiltinInternal (context, state, tag, builtin, TRUE, streamStarted);
|
||||||
@ -206,7 +221,7 @@ lo_FormatBuiltinInternal (MWContext *context, lo_DocState *state, PA_Tag *tag,
|
|||||||
builtin->ele_attrmask |= LO_ELE_STREAM_STARTED;
|
builtin->ele_attrmask |= LO_ELE_STREAM_STARTED;
|
||||||
|
|
||||||
/* Convert any js in the values */
|
/* Convert any js in the values */
|
||||||
lo_ConvertAllValues (context, builtin->value_list, builtin->attribute_cnt,
|
lo_ConvertAllValues (context, BUILTIN_ATTRIBUTE_VALUES(builtin), BUILTIN_ATTRIBUTE_COUNT(builtin),
|
||||||
tag->newline_count);
|
tag->newline_count);
|
||||||
|
|
||||||
/* double-counting builtins? XXX */
|
/* double-counting builtins? XXX */
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "laylayer.h"
|
#include "laylayer.h"
|
||||||
#include "np.h"
|
#include "np.h"
|
||||||
|
#include "np2.h"
|
||||||
#include "laystyle.h"
|
#include "laystyle.h"
|
||||||
#include "layers.h"
|
#include "layers.h"
|
||||||
|
|
||||||
@ -290,7 +291,13 @@ lo_FormatEmbedObject(MWContext* context, lo_DocState* state,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OJI
|
#ifdef OJI
|
||||||
/* XXX */
|
for (count = 0; count < (uint32)embed->attributes.n; count++)
|
||||||
|
{
|
||||||
|
if ( (XP_STRCASECMP(embed->attributes.names[count], PARAM_MAYSCRIPT) == 0)
|
||||||
|
&&(embed->attributes.values[count] == NULL) ) {
|
||||||
|
StrAllocCopy(embed->attributes.values[count], "true");
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* Look through the parameters and replace "id"
|
* Look through the parameters and replace "id"
|
||||||
@ -755,57 +762,70 @@ lo_FormatEmbedInternal(MWContext *context, lo_DocState *state, PA_Tag *tag,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Put the embed onto the embed list for later
|
* Put embed onto the embed list and applets into applet list
|
||||||
* possible reflection.
|
* for later possible reflection.
|
||||||
*/
|
*/
|
||||||
doc_lists = lo_GetCurrentDocLists(state);
|
{
|
||||||
if (state->in_relayout) {
|
int32 i, count, *pDoclistCount;
|
||||||
int32 i, count;
|
LO_EmbedStruct *prev_embed, *cur_embed;
|
||||||
LO_EmbedStruct *prev_embed, *cur_embed;
|
LO_CommonPluginStruct **ppDoclistList;
|
||||||
|
doc_lists = lo_GetCurrentDocLists(state);
|
||||||
|
if( embed->objTag.sub_type == LO_JAVA )
|
||||||
|
{
|
||||||
|
cur_embed = (LO_EmbedStruct *)doc_lists->applet_list;
|
||||||
|
pDoclistCount = &doc_lists->applet_list_count;
|
||||||
|
ppDoclistList = (LO_CommonPluginStruct **)&doc_lists->applet_list;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cur_embed = doc_lists->embed_list;
|
||||||
|
pDoclistCount = &doc_lists->embed_list_count;
|
||||||
|
ppDoclistList = (LO_CommonPluginStruct **)&doc_lists->embed_list;
|
||||||
|
}
|
||||||
|
if (state->in_relayout) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In the interest of changing as little as possible, I'm not
|
* In the interest of changing as little as possible, I'm not
|
||||||
* going to change the embed_list to be in the order of layout
|
* going to change the embed_list to be in the order of layout
|
||||||
* (it is currently in reverse order). Instead, we do what
|
* (it is currently in reverse order). Instead, we do what
|
||||||
* everybody else does - iterate till the end of the list to get
|
* everybody else does - iterate till the end of the list to get
|
||||||
* find an element with the correct index.
|
* find an element with the correct index.
|
||||||
* If we're in table relayout, we need to replace the element
|
* If we're in table relayout, we need to replace the element
|
||||||
* of the same index in this list with the new layout element
|
* of the same index in this list with the new layout element
|
||||||
* to prevent multiple reflection.
|
* to prevent multiple reflection.
|
||||||
*/
|
*/
|
||||||
count = 0;
|
count = 0;
|
||||||
cur_embed = doc_lists->embed_list;
|
|
||||||
while (cur_embed) {
|
|
||||||
cur_embed = cur_embed->nextEmbed;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* reverse order... */
|
/* reverse order... */
|
||||||
prev_embed = NULL;
|
prev_embed = NULL;
|
||||||
cur_embed = doc_lists->embed_list;
|
while (cur_embed) {
|
||||||
for (i = count-1; i >= 0; i--) {
|
cur_embed = cur_embed->nextEmbed;
|
||||||
if (i == doc_lists->embed_list_count) {
|
count++;
|
||||||
/* Copy over the mocha object (it might not exist) */
|
}
|
||||||
embed->objTag.mocha_object = cur_embed->objTag.mocha_object;
|
for (i = count-1; i >= 0; i--) {
|
||||||
|
if (i == *pDoclistCount) {
|
||||||
|
/* Copy over the mocha object (it might not exist) */
|
||||||
|
embed->objTag.mocha_object = cur_embed->objTag.mocha_object;
|
||||||
|
|
||||||
embed->nextEmbed = cur_embed->nextEmbed;
|
embed->nextEmbed = cur_embed->nextEmbed;
|
||||||
|
|
||||||
/* Replace the old embed with the new one */
|
/* Replace the old embed with the new one */
|
||||||
if (prev_embed == NULL)
|
if (prev_embed == NULL)
|
||||||
doc_lists->embed_list = embed;
|
*ppDoclistList = (LO_CommonPluginStruct *)embed;
|
||||||
else
|
else
|
||||||
prev_embed->nextEmbed = embed;
|
prev_embed->nextEmbed = embed;
|
||||||
doc_lists->embed_list_count++;
|
(*pDoclistCount)++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
prev_embed = cur_embed;
|
prev_embed = cur_embed;
|
||||||
cur_embed = cur_embed->nextEmbed;
|
cur_embed = cur_embed->nextEmbed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
embed->nextEmbed = doc_lists->embed_list;
|
embed->nextEmbed = (LO_EmbedStruct *)*ppDoclistList;
|
||||||
doc_lists->embed_list = embed;
|
*ppDoclistList = (LO_CommonPluginStruct *)embed;
|
||||||
doc_lists->embed_list_count++;
|
(*pDoclistCount)++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -2885,7 +2885,7 @@ lo_get_form_element_data(MWContext *context,
|
|||||||
type = (uint8)form_data->type;
|
type = (uint8)form_data->type;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef JAVA
|
#if defined(JAVA ) || defined(OJI)
|
||||||
case FORM_TYPE_OBJECT:
|
case FORM_TYPE_OBJECT:
|
||||||
{
|
{
|
||||||
lo_FormElementObjectData *form_data;
|
lo_FormElementObjectData *form_data;
|
||||||
@ -2897,7 +2897,27 @@ lo_get_form_element_data(MWContext *context,
|
|||||||
char *vstr;
|
char *vstr;
|
||||||
|
|
||||||
name = lo_dup_block(form_data->name);
|
name = lo_dup_block(form_data->name);
|
||||||
|
#ifdef OJI
|
||||||
|
{
|
||||||
|
#include "np.h"
|
||||||
|
#include "np2.h"
|
||||||
|
|
||||||
|
NPEmbeddedApp *embed = (NPEmbeddedApp*) form_data->object->objTag.FE_Data;
|
||||||
|
if (embed) {
|
||||||
|
struct nsIPluginInstance *pNPI = NPL_GetOJIPluginInstance(embed);
|
||||||
|
object_value = NPL_GetText(pNPI);
|
||||||
|
NPL_Release((struct nsISupports *)pNPI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (object_value != NULL)
|
||||||
|
{
|
||||||
|
value = PA_ALLOC(XP_STRLEN(object_value) + 1);
|
||||||
|
PA_LOCK(vstr, char *, value);
|
||||||
|
XP_STRCPY(vstr, object_value);
|
||||||
|
PA_UNLOCK(value);
|
||||||
|
XP_FREE(object_value);
|
||||||
|
}
|
||||||
|
#else
|
||||||
object_value = LJ_Applet_GetText(form_data->object->objTag.session_data);
|
object_value = LJ_Applet_GetText(form_data->object->objTag.session_data);
|
||||||
value = PA_ALLOC(XP_STRLEN(object_value) + 1);
|
value = PA_ALLOC(XP_STRLEN(object_value) + 1);
|
||||||
if (value != NULL)
|
if (value != NULL)
|
||||||
@ -2907,6 +2927,7 @@ lo_get_form_element_data(MWContext *context,
|
|||||||
PA_UNLOCK(value);
|
PA_UNLOCK(value);
|
||||||
}
|
}
|
||||||
XP_FREE(object_value);
|
XP_FREE(object_value);
|
||||||
|
#endif
|
||||||
|
|
||||||
type = (uint8)form_data->type;
|
type = (uint8)form_data->type;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,11 @@
|
|||||||
#include "laylayer.h"
|
#include "laylayer.h"
|
||||||
#include "pa_parse.h"
|
#include "pa_parse.h"
|
||||||
#include "libevent.h"
|
#include "libevent.h"
|
||||||
#ifdef JAVA
|
#if defined (JAVA)
|
||||||
#include "jsjava.h"
|
#include "jsjava.h"
|
||||||
|
#elif defined (OJI)
|
||||||
|
#include "jsjava.h"
|
||||||
|
#include "np2.h"
|
||||||
#endif
|
#endif
|
||||||
#include "layers.h"
|
#include "layers.h"
|
||||||
|
|
||||||
@ -557,7 +560,7 @@ LO_EnumerateLinks(MWContext *context, int32 layer_id)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined (OJI)
|
||||||
LO_JavaAppStruct *
|
LO_JavaAppStruct *
|
||||||
LO_GetAppletByIndex(MWContext *context, int32 layer_id, uint index)
|
LO_GetAppletByIndex(MWContext *context, int32 layer_id, uint index)
|
||||||
{
|
{
|
||||||
@ -566,9 +569,15 @@ LO_GetAppletByIndex(MWContext *context, int32 layer_id, uint index)
|
|||||||
int i, count;
|
int i, count;
|
||||||
lo_DocLists *doc_lists;
|
lo_DocLists *doc_lists;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
if (!NPL_IsJVMAndMochaPrefsEnabled())
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
/* XXX */
|
/* XXX */
|
||||||
if (!JSJ_IsEnabled())
|
if (!JSJ_IsEnabled())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
top_state = lo_GetTopState(context);
|
top_state = lo_GetTopState(context);
|
||||||
if (top_state == NULL)
|
if (top_state == NULL)
|
||||||
@ -604,9 +613,15 @@ LO_EnumerateApplets(MWContext *context, int32 layer_id)
|
|||||||
LO_JavaAppStruct *applet;
|
LO_JavaAppStruct *applet;
|
||||||
lo_DocLists *doc_lists;
|
lo_DocLists *doc_lists;
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
if (!NPL_IsJVMAndMochaPrefsEnabled())
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
/* XXX */
|
/* XXX */
|
||||||
if (!JSJ_IsEnabled())
|
if (!JSJ_IsEnabled())
|
||||||
return 0;
|
return NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
top_state = lo_GetMochaTopState(context);
|
top_state = lo_GetMochaTopState(context);
|
||||||
if (top_state == NULL)
|
if (top_state == NULL)
|
||||||
@ -643,9 +658,15 @@ LO_GetEmbedByIndex(MWContext *context, int32 layer_id, uint index)
|
|||||||
int i, count;
|
int i, count;
|
||||||
lo_DocLists *doc_lists;
|
lo_DocLists *doc_lists;
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
if (!NPL_IsJVMAndMochaPrefsEnabled())
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
/* XXX */
|
/* XXX */
|
||||||
if (!JSJ_IsEnabled())
|
if (!JSJ_IsEnabled())
|
||||||
return NULL;
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
top_state = lo_GetTopState(context);
|
top_state = lo_GetTopState(context);
|
||||||
if (top_state == NULL)
|
if (top_state == NULL)
|
||||||
@ -681,9 +702,14 @@ LO_EnumerateEmbeds(MWContext *context, int32 layer_id)
|
|||||||
LO_EmbedStruct *embed;
|
LO_EmbedStruct *embed;
|
||||||
lo_DocLists *doc_lists;
|
lo_DocLists *doc_lists;
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
if (!NPL_IsJVMAndMochaPrefsEnabled())
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
/* XXX */
|
/* XXX */
|
||||||
if (!JSJ_IsEnabled())
|
if (!JSJ_IsEnabled())
|
||||||
return 0;
|
return NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
top_state = lo_GetMochaTopState(context);
|
top_state = lo_GetMochaTopState(context);
|
||||||
if (top_state == NULL)
|
if (top_state == NULL)
|
||||||
|
|||||||
@ -55,6 +55,7 @@ lo_FormatObject(MWContext* context, lo_DocState* state, PA_Tag* tag)
|
|||||||
LO_ObjectStruct* object;
|
LO_ObjectStruct* object;
|
||||||
PA_Block buff;
|
PA_Block buff;
|
||||||
int16 type = LO_NONE;
|
int16 type = LO_NONE;
|
||||||
|
int16 sub_type = LO_NONE;
|
||||||
char* str;
|
char* str;
|
||||||
char* pluginName;
|
char* pluginName;
|
||||||
|
|
||||||
@ -191,7 +192,10 @@ lo_FormatObject(MWContext* context, lo_DocState* state, PA_Tag* tag)
|
|||||||
/* It's a Java class */
|
/* It's a Java class */
|
||||||
#ifdef OJI
|
#ifdef OJI
|
||||||
if (type == LO_NONE)
|
if (type == LO_NONE)
|
||||||
type = LO_EMBED;
|
{
|
||||||
|
type = LO_EMBED;
|
||||||
|
sub_type = LO_JAVA;
|
||||||
|
}
|
||||||
else if (type != LO_EMBED) /* XXX */
|
else if (type != LO_EMBED) /* XXX */
|
||||||
#else
|
#else
|
||||||
if (type == LO_NONE)
|
if (type == LO_NONE)
|
||||||
@ -229,10 +233,19 @@ lo_FormatObject(MWContext* context, lo_DocState* state, PA_Tag* tag)
|
|||||||
PA_LOCK(str, char *, buff);
|
PA_LOCK(str, char *, buff);
|
||||||
if ((pluginName = NPL_FindPluginEnabledForType(str)) != NULL)
|
if ((pluginName = NPL_FindPluginEnabledForType(str)) != NULL)
|
||||||
{
|
{
|
||||||
XP_FREE(pluginName);
|
XP_FREE(pluginName);
|
||||||
/* It's a plug-in */
|
/* It's a plug-in */
|
||||||
if (type == LO_NONE)
|
if (type == LO_NONE)
|
||||||
|
{
|
||||||
type = LO_EMBED;
|
type = LO_EMBED;
|
||||||
|
#ifdef OJI
|
||||||
|
#define JAVA_PLUGIN_MIMETYPE "application/x-java-vm"
|
||||||
|
if (XP_STRCMP(JAVA_PLUGIN_MIMETYPE, str)==0)
|
||||||
|
{
|
||||||
|
sub_type = LO_JAVA;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else if (type != LO_EMBED)
|
else if (type != LO_EMBED)
|
||||||
type = LO_UNKNOWN;
|
type = LO_UNKNOWN;
|
||||||
}
|
}
|
||||||
@ -328,6 +341,10 @@ lo_FormatObject(MWContext* context, lo_DocState* state, PA_Tag* tag)
|
|||||||
if (type == LO_EMBED)
|
if (type == LO_EMBED)
|
||||||
{
|
{
|
||||||
object->lo_element.lo_plugin.type = LO_EMBED;
|
object->lo_element.lo_plugin.type = LO_EMBED;
|
||||||
|
if(sub_type == LO_JAVA)
|
||||||
|
{
|
||||||
|
object->lo_element.lo_plugin.sub_type = LO_JAVA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (type == LO_BUILTIN)
|
else if (type == LO_BUILTIN)
|
||||||
{
|
{
|
||||||
@ -883,20 +900,20 @@ lo_ProcessObjectTag(MWContext* context, lo_DocState* state, PA_Tag* tag, XP_Bool
|
|||||||
if (object->lo_element.lo_plugin.type == LO_EMBED)
|
if (object->lo_element.lo_plugin.type == LO_EMBED)
|
||||||
{
|
{
|
||||||
lo_FormatEmbedObject(context,
|
lo_FormatEmbedObject(context,
|
||||||
state,
|
state,
|
||||||
top->clone_tag,
|
top->clone_tag,
|
||||||
(LO_EmbedStruct*) object,
|
(LO_EmbedStruct*) object,
|
||||||
FALSE, /* Stream not started */
|
FALSE, /* Stream not started */
|
||||||
#ifdef OJI
|
#ifdef OJI
|
||||||
top->parameters.n,
|
top->parameters.n,
|
||||||
top->parameters.names,
|
top->parameters.names,
|
||||||
top->parameters.values);
|
top->parameters.values);
|
||||||
top->formatted_object = TRUE;
|
top->formatted_object = TRUE;
|
||||||
LO_NVList_Init( &top->parameters );
|
LO_NVList_Init( &top->parameters );
|
||||||
#else
|
#else
|
||||||
top->param_count,
|
top->param_count,
|
||||||
top->param_names,
|
top->param_names,
|
||||||
top->param_values);
|
top->param_values);
|
||||||
top->formatted_object = TRUE;
|
top->formatted_object = TRUE;
|
||||||
top->param_count = 0;
|
top->param_count = 0;
|
||||||
top->param_names = NULL;
|
top->param_names = NULL;
|
||||||
|
|||||||
@ -6794,7 +6794,6 @@ XP_TRACE(("lo_LayoutTag(%d)\n", tag->type));
|
|||||||
if(buff)
|
if(buff)
|
||||||
{
|
{
|
||||||
PA_LOCK(str, char *, buff);
|
PA_LOCK(str, char *, buff);
|
||||||
lo_AddParam(tag, "DATA", str);
|
|
||||||
lo_AddParam(tag, "TYPE", JAVA_PLUGIN_MIMETYPE);
|
lo_AddParam(tag, "TYPE", JAVA_PLUGIN_MIMETYPE);
|
||||||
|
|
||||||
PA_UNLOCK(buff);
|
PA_UNLOCK(buff);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ MODULE = mocha
|
|||||||
LIBRARY_NAME = mocha
|
LIBRARY_NAME = mocha
|
||||||
|
|
||||||
REQUIRES = lay parse img js style layer applet dbm nspr security \
|
REQUIRES = lay parse img js style layer applet dbm nspr security \
|
||||||
htmldlgs util jtools pref java libreg softupdt jsdebug netcache network httpurl
|
htmldlgs util jtools pref caps java libreg softupdt jsdebug netcache network httpurl plugin plugimpl
|
||||||
|
|
||||||
ifdef MOZ_SECURITY
|
ifdef MOZ_SECURITY
|
||||||
REQUIRES += jar
|
REQUIRES += jar
|
||||||
@ -68,14 +68,13 @@ include $(DEPTH)/config/rules.mk
|
|||||||
|
|
||||||
DEFINES += -DDLL_SUFFIX=\"$(DLL_SUFFIX)\"
|
DEFINES += -DDLL_SUFFIX=\"$(DLL_SUFFIX)\"
|
||||||
|
|
||||||
EMBED_CFLAGS = $(CFLAGS) -I$(DEPTH)/lib/plugin
|
|
||||||
TAINT_CFLAGS = $(CFLAGS) -I$(DEPTH)/lib/libjar -I$(DEPTH)/sun-java/netscape/security/_jri \
|
TAINT_CFLAGS = $(CFLAGS) -I$(DEPTH)/lib/libjar -I$(DEPTH)/sun-java/netscape/security/_jri \
|
||||||
-I$(DEPTH)/dist/public/security
|
-I$(DEPTH)/dist/public/security
|
||||||
|
|
||||||
ifneq ($(OS_ARCH),OS2)
|
ifneq ($(OS_ARCH),OS2)
|
||||||
$(OBJDIR)/lm_embed.o: lm_embed.c
|
$(OBJDIR)/lm_embed.o: lm_embed.c
|
||||||
@$(MAKE_OBJDIR)
|
@$(MAKE_OBJDIR)
|
||||||
$(CC) -o $@ -c $(EMBED_CFLAGS) $<
|
$(CC) -o $@ -c $(CFLAGS) $<
|
||||||
|
|
||||||
$(OBJDIR)/lm_taint.o: lm_taint.c
|
$(OBJDIR)/lm_taint.o: lm_taint.c
|
||||||
@$(MAKE_OBJDIR)
|
@$(MAKE_OBJDIR)
|
||||||
@ -84,7 +83,7 @@ $(OBJDIR)/lm_taint.o: lm_taint.c
|
|||||||
else
|
else
|
||||||
$(OBJDIR)/lm_embed.o: lm_embed.c
|
$(OBJDIR)/lm_embed.o: lm_embed.c
|
||||||
@$(MAKE_OBJDIR)
|
@$(MAKE_OBJDIR)
|
||||||
$(CC) -Fo$@ -c $(EMBED_CFLAGS) $<
|
$(CC) -Fo$@ -c $(CFLAGS) $<
|
||||||
|
|
||||||
$(OBJDIR)/lm_taint.o: lm_taint.c
|
$(OBJDIR)/lm_taint.o: lm_taint.c
|
||||||
@$(MAKE_OBJDIR)
|
@$(MAKE_OBJDIR)
|
||||||
|
|||||||
@ -751,13 +751,14 @@ et_reflect_handler(Reflect_Event * e)
|
|||||||
|
|
||||||
switch(e->type) {
|
switch(e->type) {
|
||||||
case LM_APPLETS:
|
case LM_APPLETS:
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
|
|
||||||
LM_ReflectApplet(e->ce.context, (LO_JavaAppStruct *) e->lo_ele,
|
LM_ReflectApplet(e->ce.context, (LO_JavaAppStruct *) e->lo_ele,
|
||||||
e->pa_tag, e->layer_id, e->index);
|
e->pa_tag, e->layer_id, e->index);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case LM_EMBEDS:
|
case LM_EMBEDS:
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
LM_ReflectEmbed(e->ce.context, e->lo_ele, e->pa_tag,
|
LM_ReflectEmbed(e->ce.context, e->lo_ele, e->pa_tag,
|
||||||
e->layer_id, e->index);
|
e->layer_id, e->index);
|
||||||
#endif
|
#endif
|
||||||
@ -2193,7 +2194,13 @@ et_FinishMochaHandler(JSEvent * e)
|
|||||||
lm_crippled_decoder = 0;
|
lm_crippled_decoder = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JAVA
|
#if defined(OJI)
|
||||||
|
/*
|
||||||
|
=-= sudu Ask scott about this.
|
||||||
|
PR_PUBLIC_API(void)
|
||||||
|
JSJ_DisconnectFromJavaVM(JSJavaVM *);
|
||||||
|
*/
|
||||||
|
#elif defined (JAVA)
|
||||||
JSJ_Finish();
|
JSJ_Finish();
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -2286,7 +2293,11 @@ et_SubEventLoop(QueueStackElement * qse)
|
|||||||
/* can't be interrupted yet */
|
/* can't be interrupted yet */
|
||||||
lm_InterruptCurrentOp = JS_FALSE;
|
lm_InterruptCurrentOp = JS_FALSE;
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
LM_LockJS(NULL);
|
||||||
|
#else
|
||||||
LM_LockJS();
|
LM_LockJS();
|
||||||
|
#endif
|
||||||
/* need to interlock the getting of an event with ET_Interrupt */
|
/* need to interlock the getting of an event with ET_Interrupt */
|
||||||
PR_EnterMonitor(lm_queue_monitor);
|
PR_EnterMonitor(lm_queue_monitor);
|
||||||
pEvent = PR_GetEvent(qse->queue);
|
pEvent = PR_GetEvent(qse->queue);
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
#include "prthread.h"
|
#include "prthread.h"
|
||||||
|
#include "prtypes.h"
|
||||||
#include "prmem.h"
|
#include "prmem.h"
|
||||||
#include "ds.h" /* XXX required by htmldlgs.h */
|
#include "ds.h" /* XXX required by htmldlgs.h */
|
||||||
#include "htmldlgs.h"
|
#include "htmldlgs.h"
|
||||||
@ -2883,7 +2884,7 @@ typedef struct {
|
|||||||
char* prin;
|
char* prin;
|
||||||
char* target;
|
char* target;
|
||||||
char* risk;
|
char* risk;
|
||||||
int isCert;
|
PRBool isCert;
|
||||||
} MozillaEvent_signedAppletPrivileges;
|
} MozillaEvent_signedAppletPrivileges;
|
||||||
|
|
||||||
PR_STATIC_CALLBACK(void)
|
PR_STATIC_CALLBACK(void)
|
||||||
@ -2904,7 +2905,7 @@ et_DestroyEvent_signedAppletPrivileges(MozillaEvent_signedAppletPrivileges* e)
|
|||||||
|
|
||||||
void
|
void
|
||||||
ET_PostSignedAppletPrivileges
|
ET_PostSignedAppletPrivileges
|
||||||
(MWContext* context, char* prin, char* target, char* risk, int isCert)
|
(MWContext* context, char* prin, char* target, char* risk, PRBool isCert)
|
||||||
{
|
{
|
||||||
MozillaEvent_signedAppletPrivileges* event =
|
MozillaEvent_signedAppletPrivileges* event =
|
||||||
PR_NEW(MozillaEvent_signedAppletPrivileges);
|
PR_NEW(MozillaEvent_signedAppletPrivileges);
|
||||||
|
|||||||
@ -23,10 +23,11 @@
|
|||||||
/* Please leave outside of ifdef for windows precompiled headers */
|
/* Please leave outside of ifdef for windows precompiled headers */
|
||||||
#include "lm.h"
|
#include "lm.h"
|
||||||
|
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
|
|
||||||
#include "xp.h"
|
#include "xp.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
|
#if defined(JAVA)
|
||||||
#include "java.h"
|
#include "java.h"
|
||||||
#include "lj.h" /* for LJ_InvokeMethod */
|
#include "lj.h" /* for LJ_InvokeMethod */
|
||||||
#define IMPLEMENT_netscape_applet_MozillaAppletContext
|
#define IMPLEMENT_netscape_applet_MozillaAppletContext
|
||||||
@ -38,6 +39,10 @@
|
|||||||
#include "netscape_applet_MozillaAppletContext.h"
|
#include "netscape_applet_MozillaAppletContext.h"
|
||||||
#include "netscape_applet_EmbeddedObjectNatives.h"
|
#include "netscape_applet_EmbeddedObjectNatives.h"
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(OJI)
|
||||||
|
#include "np2.h"
|
||||||
|
#include "jni.h"
|
||||||
|
#endif /* OJI */
|
||||||
#include "jsjava.h"
|
#include "jsjava.h"
|
||||||
#include "jsobj.h"
|
#include "jsobj.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
@ -192,6 +197,7 @@ lm_GetAppletArray(MochaDecoder *decoder, JSObject *document)
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static JSObject *
|
static JSObject *
|
||||||
lm_ReallyReflectApplet(MWContext *context, LO_JavaAppStruct *lo_applet,
|
lm_ReallyReflectApplet(MWContext *context, LO_JavaAppStruct *lo_applet,
|
||||||
int32 layer_id, uint32 index)
|
int32 layer_id, uint32 index)
|
||||||
@ -199,10 +205,17 @@ lm_ReallyReflectApplet(MWContext *context, LO_JavaAppStruct *lo_applet,
|
|||||||
JSObject *obj;
|
JSObject *obj;
|
||||||
MochaDecoder *decoder;
|
MochaDecoder *decoder;
|
||||||
JSContext *cx;
|
JSContext *cx;
|
||||||
|
#ifdef JAVA
|
||||||
LJAppletData *ad;
|
LJAppletData *ad;
|
||||||
jref japplet;
|
jref javaobject;
|
||||||
|
#endif
|
||||||
lo_TopState *top_state;
|
lo_TopState *top_state;
|
||||||
PRHashTable *map;
|
PRHashTable *map;
|
||||||
|
#ifdef OJI
|
||||||
|
NPEmbeddedApp* embed;
|
||||||
|
LO_CommonPluginStruct *lo_embed = (LO_CommonPluginStruct *)lo_applet;
|
||||||
|
jobject javaobject;
|
||||||
|
#endif /* OJI */
|
||||||
|
|
||||||
PR_LOG(Moja, debug, ("really reflect applet 0x%x\n", lo_applet));
|
PR_LOG(Moja, debug, ("really reflect applet 0x%x\n", lo_applet));
|
||||||
|
|
||||||
@ -212,7 +225,7 @@ lm_ReallyReflectApplet(MWContext *context, LO_JavaAppStruct *lo_applet,
|
|||||||
|
|
||||||
decoder = LM_GetMochaDecoder(context);
|
decoder = LM_GetMochaDecoder(context);
|
||||||
if (!decoder)
|
if (!decoder)
|
||||||
return NULL;
|
return NULL;
|
||||||
cx = decoder->js_context;
|
cx = decoder->js_context;
|
||||||
|
|
||||||
top_state = lo_GetMochaTopState(context);
|
top_state = lo_GetMochaTopState(context);
|
||||||
@ -228,6 +241,35 @@ lm_ReallyReflectApplet(MWContext *context, LO_JavaAppStruct *lo_applet,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
{
|
||||||
|
if (! NPL_IsJVMAndMochaPrefsEnabled()) {
|
||||||
|
return lo_embed->mocha_object = lm_DummyObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
embed = (NPEmbeddedApp*) lo_embed->FE_Data;
|
||||||
|
if (embed) {
|
||||||
|
struct nsIPluginInstance *pNPI = NULL;
|
||||||
|
JNIEnv *jniEnv = NULL;
|
||||||
|
jsval val;
|
||||||
|
|
||||||
|
pNPI = NPL_GetOJIPluginInstance(embed);
|
||||||
|
javaobject = NPL_GetJavaObject(pNPI);
|
||||||
|
NPL_Release((struct nsISupports *)pNPI);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
jniEnv = NPL_EnsureJNIExecEnv(NULL);
|
||||||
|
obj = JSJ_WrapJavaObject(decoder->js_context,
|
||||||
|
jniEnv,
|
||||||
|
javaobject,
|
||||||
|
(*jniEnv)->GetObjectClass(jniEnv, javaobject));
|
||||||
|
#else
|
||||||
|
if (JSJ_ConvertJavaObjectToJSValue(decoder->js_context, javaobject, &val))
|
||||||
|
obj = JSVAL_TO_OBJECT(val);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
/* set the element to something bad if we can't get the java obj */
|
/* set the element to something bad if we can't get the java obj */
|
||||||
if (!JSJ_IsEnabled()) {
|
if (!JSJ_IsEnabled()) {
|
||||||
PR_LOG(Moja, debug, ("reflected applet 0x%x as null\n",
|
PR_LOG(Moja, debug, ("reflected applet 0x%x as null\n",
|
||||||
@ -241,44 +283,63 @@ lm_ReallyReflectApplet(MWContext *context, LO_JavaAppStruct *lo_applet,
|
|||||||
/* MozillaAppletContext.reflectApplet gets the java applet
|
/* MozillaAppletContext.reflectApplet gets the java applet
|
||||||
* object out of a hash table given the AppletData pointer
|
* object out of a hash table given the AppletData pointer
|
||||||
* as an integer */
|
* as an integer */
|
||||||
if (ad->selector_type != LO_JAVA_SELECTOR_APPLET)
|
if (ad->selector_type != LO_JAVA_SELECTOR_APPLET)
|
||||||
japplet = LJ_InvokeMethod(classEmbeddedObjectNatives,
|
javaobject = LJ_InvokeMethod(classEmbeddedObjectNatives,
|
||||||
methodID_netscape_applet_EmbeddedObjectNatives_reflectObject,
|
methodID_netscape_applet_EmbeddedObjectNatives_reflectObject,
|
||||||
ad->docID, ad);
|
ad->docID, ad);
|
||||||
else
|
else
|
||||||
japplet = LJ_InvokeMethod(classMozillaAppletContext,
|
javaobject = LJ_InvokeMethod(classMozillaAppletContext,
|
||||||
methodID_netscape_applet_MozillaAppletContext_reflectApplet_1,
|
methodID_netscape_applet_MozillaAppletContext_reflectApplet_1,
|
||||||
ad->docID, ad);
|
ad->docID, ad);
|
||||||
|
obj = js_ReflectJObjectToJSObject(decoder->js_context,
|
||||||
|
(HObject *)javaobject);
|
||||||
|
}
|
||||||
|
#endif /* !OJI */
|
||||||
|
|
||||||
obj = js_ReflectJObjectToJSObject(decoder->js_context,
|
if( obj == NULL )
|
||||||
(HObject *)japplet);
|
{
|
||||||
|
|
||||||
map = lm_GetIdToObjectMap(decoder);
|
|
||||||
if (map)
|
|
||||||
PR_HashTableAdd(map,
|
|
||||||
LM_GET_MAPPING_KEY(LM_APPLETS, layer_id, index),
|
|
||||||
obj);
|
|
||||||
|
|
||||||
/*
|
|
||||||
lj_mozilla_ee->js_context = saved_context;
|
|
||||||
*/
|
|
||||||
|
|
||||||
PR_LOG(Moja, debug, ("reflected applet 0x%x (java 0x%x) to 0x%x ok\n",
|
|
||||||
lo_applet, japplet, obj));
|
|
||||||
|
|
||||||
if (obj)
|
|
||||||
lm_java_clasp = JS_GetClass(obj);
|
|
||||||
return lo_applet->objTag.mocha_object = obj;
|
|
||||||
} else {
|
|
||||||
PR_LOG(Moja, warn, ("failed to reflect applet 0x%x\n", lo_applet));
|
PR_LOG(Moja, warn, ("failed to reflect applet 0x%x\n", lo_applet));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
map = lm_GetIdToObjectMap(decoder);
|
||||||
|
if (map)
|
||||||
|
PR_HashTableAdd(map,
|
||||||
|
LM_GET_MAPPING_KEY(LM_APPLETS, layer_id, index),
|
||||||
|
obj);
|
||||||
|
|
||||||
|
/*
|
||||||
|
lj_mozilla_ee->js_context = saved_context;
|
||||||
|
*/
|
||||||
|
|
||||||
|
PR_LOG(Moja, debug, ("reflected applet 0x%x (java 0x%x) to 0x%x ok\n",
|
||||||
|
lo_applet, javaobject, obj));
|
||||||
|
|
||||||
|
if (obj)
|
||||||
|
lm_java_clasp = JS_GetClass(obj);
|
||||||
|
return lo_applet->objTag.mocha_object = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* XXX what happens if this is called before java starts up?
|
/* XXX what happens if this is called before java starts up?
|
||||||
* or if java is disabled? */
|
* or if java is disabled? */
|
||||||
|
|
||||||
|
#if defined(OJI)
|
||||||
|
|
||||||
|
static char* getValue(struct lo_NVList* nvlist, const char* name)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char** names = nvlist->names;
|
||||||
|
char** values = nvlist->values;
|
||||||
|
|
||||||
|
for (i = nvlist->n - 1; i >= 0; --i)
|
||||||
|
if (XP_STRCASECMP(names[i], name) == 0)
|
||||||
|
return values[i];
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
JSObject *
|
JSObject *
|
||||||
LM_ReflectApplet(MWContext *context, LO_JavaAppStruct *applet_data,
|
LM_ReflectApplet(MWContext *context, LO_JavaAppStruct *applet_data,
|
||||||
PA_Tag * tag, int32 layer_id, uint index)
|
PA_Tag * tag, int32 layer_id, uint index)
|
||||||
@ -287,6 +348,9 @@ LM_ReflectApplet(MWContext *context, LO_JavaAppStruct *applet_data,
|
|||||||
MochaDecoder *decoder;
|
MochaDecoder *decoder;
|
||||||
JSContext *cx;
|
JSContext *cx;
|
||||||
char *name;
|
char *name;
|
||||||
|
#ifdef OJI
|
||||||
|
LO_EmbedStruct *embed = (LO_EmbedStruct *)applet_data;
|
||||||
|
#endif
|
||||||
|
|
||||||
obj = applet_data->objTag.mocha_object;
|
obj = applet_data->objTag.mocha_object;
|
||||||
if (obj)
|
if (obj)
|
||||||
@ -297,12 +361,19 @@ LM_ReflectApplet(MWContext *context, LO_JavaAppStruct *applet_data,
|
|||||||
return NULL;
|
return NULL;
|
||||||
cx = decoder->js_context;
|
cx = decoder->js_context;
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
/* this is really skanky, but we don't really have a LO_JavaAppStruct, but instead a LO_EmbedStruct. */
|
||||||
|
name = getValue(&embed->attributes, "NAME");
|
||||||
|
if (name != NULL)
|
||||||
|
name = JS_strdup(cx, name);
|
||||||
|
#else
|
||||||
/* get the name */
|
/* get the name */
|
||||||
if (applet_data->attr_name) {
|
if (applet_data->attr_name) {
|
||||||
name = JS_strdup(cx, (char *) applet_data->attr_name);
|
name = JS_strdup(cx, (char *) applet_data->attr_name);
|
||||||
} else {
|
} else {
|
||||||
name = 0;
|
name = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Get the document object that will hold this applet */
|
/* Get the document object that will hold this applet */
|
||||||
document = lm_GetDocumentFromLayerId(decoder, layer_id);
|
document = lm_GetDocumentFromLayerId(decoder, layer_id);
|
||||||
@ -364,4 +435,4 @@ LM_ReflectNamedApplet(MWContext *context, lo_NameList *name_rec,
|
|||||||
|
|
||||||
void *lm_java_clasp = NULL;
|
void *lm_java_clasp = NULL;
|
||||||
|
|
||||||
#endif /* JAVA */
|
#endif /* !JAVA && !OJI */
|
||||||
|
|||||||
@ -38,8 +38,11 @@
|
|||||||
#include "libstyle.h"
|
#include "libstyle.h"
|
||||||
#include "prthread.h"
|
#include "prthread.h"
|
||||||
#include "np.h"
|
#include "np.h"
|
||||||
#ifdef JAVA
|
#if defined (JAVA)
|
||||||
#include "jsjava.h"
|
#include "jsjava.h"
|
||||||
|
#elif defined (OJI)
|
||||||
|
#include "jsjava.h"
|
||||||
|
#include "np2.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DOM
|
#ifndef DOM
|
||||||
@ -233,7 +236,7 @@ doc_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
|
|
||||||
case DOC_APPLETS:
|
case DOC_APPLETS:
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
if (LM_MOJA_OK != ET_InitMoja(context)) {
|
if (LM_MOJA_OK != ET_InitMoja(context)) {
|
||||||
LO_UnlockLayout();
|
LO_UnlockLayout();
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
@ -252,7 +255,7 @@ doc_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
case DOC_EMBEDS:
|
case DOC_EMBEDS:
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
if (LM_MOJA_OK != ET_InitMoja(context)) {
|
if (LM_MOJA_OK != ET_InitMoja(context)) {
|
||||||
LO_UnlockLayout();
|
LO_UnlockLayout();
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
@ -623,7 +626,7 @@ doc_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||||||
return doc_getProperty(cx, obj, id, vp);
|
return doc_getProperty(cx, obj, id, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
static void
|
static void
|
||||||
lm_reflect_stuff_eagerly(MWContext * context, int32 layer_id)
|
lm_reflect_stuff_eagerly(MWContext * context, int32 layer_id)
|
||||||
{
|
{
|
||||||
@ -677,13 +680,12 @@ lm_reflect_stuff_eagerly(MWContext * context, int32 layer_id)
|
|||||||
|
|
||||||
LO_UnlockLayout();
|
LO_UnlockLayout();
|
||||||
}
|
}
|
||||||
#endif /* JAVA */
|
#endif /* JAVA || OJI*/
|
||||||
|
|
||||||
PR_STATIC_CALLBACK(JSBool)
|
PR_STATIC_CALLBACK(JSBool)
|
||||||
doc_list_properties(JSContext *cx, JSObject *obj)
|
doc_list_properties(JSContext *cx, JSObject *obj)
|
||||||
{
|
{
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
|
|
||||||
/* reflect applets eagerly, anything else? */
|
/* reflect applets eagerly, anything else? */
|
||||||
JSDocument *doc;
|
JSDocument *doc;
|
||||||
MWContext *context;
|
MWContext *context;
|
||||||
@ -726,11 +728,24 @@ doc_list_properties(JSContext *cx, JSObject *obj)
|
|||||||
if(bDoInitMoja) {
|
if(bDoInitMoja) {
|
||||||
if (LM_MOJA_OK != ET_InitMoja(context))
|
if (LM_MOJA_OK != ET_InitMoja(context))
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
{
|
||||||
|
PRBool jvmMochaPrefsEnabled = PR_FALSE;
|
||||||
|
if (NPL_IsJVMAndMochaPrefsEnabled() == PR_TRUE) {
|
||||||
|
jvmMochaPrefsEnabled = PR_TRUE;
|
||||||
|
}
|
||||||
|
if (jvmMochaPrefsEnabled == PR_FALSE) {
|
||||||
|
return JS_TRUE;
|
||||||
|
}
|
||||||
|
lm_reflect_stuff_eagerly(context, doc->layer_id);
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (JSJ_IsEnabled())
|
if (JSJ_IsEnabled())
|
||||||
lm_reflect_stuff_eagerly(context, doc->layer_id);
|
lm_reflect_stuff_eagerly(context, doc->layer_id);
|
||||||
|
#endif /* !OJI */
|
||||||
}
|
}
|
||||||
|
#endif /* JAVA || OJI */
|
||||||
#endif
|
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,13 +25,18 @@
|
|||||||
/* Please leave outside of ifdef for windows precompiled headers */
|
/* Please leave outside of ifdef for windows precompiled headers */
|
||||||
#include "lm.h"
|
#include "lm.h"
|
||||||
|
|
||||||
#ifdef JAVA
|
#if defined(JAVA) || defined(OJI)
|
||||||
|
|
||||||
#include "xp.h"
|
#include "xp.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "np.h"
|
#include "np.h"
|
||||||
#include "nppriv.h"
|
#include "nppriv.h"
|
||||||
|
#ifdef OJI
|
||||||
|
#include "jni.h"
|
||||||
|
#include "np2.h"
|
||||||
|
#else
|
||||||
#include "jri.h"
|
#include "jri.h"
|
||||||
|
#endif
|
||||||
#include "jsjava.h"
|
#include "jsjava.h"
|
||||||
#include "jsobj.h"
|
#include "jsobj.h"
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
@ -177,6 +182,8 @@ lm_GetEmbedArray(MochaDecoder *decoder, JSObject *document)
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* this calls MozillaEmbedContext to reflect the embed by
|
/* this calls MozillaEmbedContext to reflect the embed by
|
||||||
* calling into mocha... yow! */
|
* calling into mocha... yow! */
|
||||||
static JSObject *
|
static JSObject *
|
||||||
@ -213,13 +220,26 @@ lm_ReallyReflectEmbed(MWContext *context, LO_EmbedStruct *lo_embed,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
{
|
||||||
|
PRBool jvmMochaPrefsEnabled = PR_FALSE;
|
||||||
|
if (NPL_IsJVMAndMochaPrefsEnabled() == PR_TRUE) {
|
||||||
|
jvmMochaPrefsEnabled = PR_TRUE;
|
||||||
|
}
|
||||||
|
if (jvmMochaPrefsEnabled == PR_FALSE) {
|
||||||
|
PR_LOG(Moja, debug, ("reflected embed 0x%x as null\n",
|
||||||
|
lo_embed));
|
||||||
|
return lo_embed->objTag.mocha_object = lm_DummyObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
/* set the element to something bad if we can't get the java obj */
|
/* set the element to something bad if we can't get the java obj */
|
||||||
if (!JSJ_IsEnabled()) {
|
if (!JSJ_IsEnabled()) {
|
||||||
PR_LOG(Moja, debug, ("reflected embed 0x%x as null\n",
|
PR_LOG(Moja, debug, ("reflected embed 0x%x as null\n",
|
||||||
lo_embed));
|
lo_embed));
|
||||||
return lo_embed->objTag.mocha_object = lm_DummyObject;
|
return lo_embed->objTag.mocha_object = lm_DummyObject;
|
||||||
}
|
}
|
||||||
|
#endif /* !OJI */
|
||||||
embed = (NPEmbeddedApp*) lo_embed->objTag.FE_Data;
|
embed = (NPEmbeddedApp*) lo_embed->objTag.FE_Data;
|
||||||
if (embed) {
|
if (embed) {
|
||||||
np_data *ndata = (np_data*) embed->np_data;
|
np_data *ndata = (np_data*) embed->np_data;
|
||||||
@ -235,11 +255,28 @@ lm_ReallyReflectEmbed(MWContext *context, LO_EmbedStruct *lo_embed,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
instance = ndata->instance;
|
instance = ndata->instance;
|
||||||
if (!instance) return NULL;
|
if (!instance) return NULL;
|
||||||
jembed = npn_getJavaPeer(instance->npp);
|
jembed = npn_getJavaPeer(instance->npp);
|
||||||
|
|
||||||
|
#ifdef OJI
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
JNIEnv *jniEnv = NULL;
|
||||||
|
jniEnv = NPL_EnsureJNIExecEnv(NULL);
|
||||||
|
obj = JSJ_WrapJavaObject(decoder->js_context,
|
||||||
|
jniEnv,
|
||||||
|
jembed,
|
||||||
|
(*jniEnv)->GetObjectClass(jniEnv, jembed));
|
||||||
|
#else
|
||||||
|
jsval val;
|
||||||
|
if (JSJ_ConvertJavaObjectToJSValue(decoder->js_context, jembed, &val))
|
||||||
|
obj = JSVAL_TO_OBJECT(val);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#else
|
||||||
obj = js_ReflectJObjectToJSObject(decoder->js_context,
|
obj = js_ReflectJObjectToJSObject(decoder->js_context,
|
||||||
(HObject *)jembed);
|
(HObject *)jembed);
|
||||||
|
#endif /* !OJI */
|
||||||
PR_LOG(Moja, debug, ("reflected embed 0x%x (java 0x%x) to 0x%x ok\n",
|
PR_LOG(Moja, debug, ("reflected embed 0x%x (java 0x%x) to 0x%x ok\n",
|
||||||
lo_embed, jembed, obj));
|
lo_embed, jembed, obj));
|
||||||
|
|
||||||
@ -293,7 +330,7 @@ LM_ReflectEmbed(MWContext *context, LO_EmbedStruct *lo_embed,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* !OJI */
|
||||||
|
|
||||||
/* Get the document object that will hold this applet */
|
/* Get the document object that will hold this applet */
|
||||||
document = lm_GetDocumentFromLayerId(decoder, layer_id);
|
document = lm_GetDocumentFromLayerId(decoder, layer_id);
|
||||||
@ -347,4 +384,4 @@ LM_ReflectNamedEmbed(MWContext *context, lo_NameList *name_rec,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* JAVA */
|
#endif /* JAVA || OJI */
|
||||||
|
|||||||
@ -35,11 +35,16 @@
|
|||||||
#include "private/pprthred.h"
|
#include "private/pprthred.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined (JAVA)
|
||||||
#include "jri.h"
|
#include "jri.h"
|
||||||
#include "jriext.h"
|
#include "jriext.h"
|
||||||
#ifdef JAVA
|
|
||||||
#include "java.h"
|
#include "java.h"
|
||||||
|
#elif defined (OJI)
|
||||||
|
#include "jni.h"
|
||||||
|
#include "np2.h"
|
||||||
|
#include "jsjava.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "prefapi.h"
|
#include "prefapi.h"
|
||||||
#include "libi18n.h"
|
#include "libi18n.h"
|
||||||
#include "intl_csi.h"
|
#include "intl_csi.h"
|
||||||
@ -123,7 +128,11 @@ MochaDecoder *lm_crippled_decoder;
|
|||||||
JSContext *lm_crippled_context; /* exported to jsStubs.c */
|
JSContext *lm_crippled_context; /* exported to jsStubs.c */
|
||||||
|
|
||||||
PRThread *lm_InterpretThread; /* interpreter now in its own thread */
|
PRThread *lm_InterpretThread; /* interpreter now in its own thread */
|
||||||
|
#ifdef OJI
|
||||||
|
JNIEnv *lm_JSEnv; /* Java env for lm_InterpretThread */
|
||||||
|
#elif defined(JAVA)
|
||||||
JRIEnv *lm_JSEnv; /* Java env for lm_InterpretThread */
|
JRIEnv *lm_JSEnv; /* Java env for lm_InterpretThread */
|
||||||
|
#endif /* ! (OJI || JAVA) */
|
||||||
PREventQueue *lm_InterpretQueue; /* for "normal" event messages */
|
PREventQueue *lm_InterpretQueue; /* for "normal" event messages */
|
||||||
PREventQueue *lm_PriorityQueue; /* for stop and death messages */
|
PREventQueue *lm_PriorityQueue; /* for stop and death messages */
|
||||||
|
|
||||||
@ -655,10 +664,6 @@ lm_PrefChangedFunc(const char *pref, void *data)
|
|||||||
|
|
||||||
static JSBool mochaInited = JS_FALSE;
|
static JSBool mochaInited = JS_FALSE;
|
||||||
|
|
||||||
/* nix, where is this */
|
|
||||||
extern void
|
|
||||||
JSJ_InitContext(JSContext *context, JSObject *obj);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* create the mocha thread, event queues, and stream converters
|
* create the mocha thread, event queues, and stream converters
|
||||||
*/
|
*/
|
||||||
@ -687,7 +692,19 @@ lm_ReallyInitMocha(void)
|
|||||||
lm_crippled_decoder = lm_new_decoder(lm_runtime, &lm_dummy_class);
|
lm_crippled_decoder = lm_new_decoder(lm_runtime, &lm_dummy_class);
|
||||||
lm_crippled_context = lm_crippled_decoder->js_context;
|
lm_crippled_context = lm_crippled_decoder->js_context;
|
||||||
|
|
||||||
#ifdef JAVA
|
#ifdef OJI
|
||||||
|
{
|
||||||
|
PRBool jvmMochaPrefsEnabled = PR_FALSE;
|
||||||
|
if (NPL_IsJVMAndMochaPrefsEnabled() == PR_TRUE) {
|
||||||
|
jvmMochaPrefsEnabled = NPL_JSJInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jvmMochaPrefsEnabled == PR_TRUE)
|
||||||
|
{
|
||||||
|
JSJ_InitJSContext(lm_crippled_context, JS_GetGlobalObject(lm_crippled_context), NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif defined (JAVA)
|
||||||
LJ_JSJ_Init();
|
LJ_JSJ_Init();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -819,8 +836,16 @@ LM_InitMoja()
|
|||||||
* called on the moz thread we can do it the easy way */
|
* called on the moz thread we can do it the easy way */
|
||||||
if (lm_moja_initialized != LM_MOJA_UNINITIALIZED)
|
if (lm_moja_initialized != LM_MOJA_UNINITIALIZED)
|
||||||
return lm_moja_initialized;
|
return lm_moja_initialized;
|
||||||
|
#if defined(OJI)
|
||||||
|
lm_JSEnv = NPL_EnsureJNIExecEnv(lm_InterpretThread);
|
||||||
|
if (lm_JSEnv == NULL) {
|
||||||
|
lm_moja_initialized = LM_MOJA_JAVA_FAILED;
|
||||||
|
return lm_moja_initialized;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef JAVA
|
lm_moja_initialized = LM_MOJA_OK;
|
||||||
|
|
||||||
|
#elif defined(JAVA)
|
||||||
/* initialize the java env associated with the mocha thread */
|
/* initialize the java env associated with the mocha thread */
|
||||||
lm_JSEnv = LJ_EnsureJavaEnv(lm_InterpretThread);
|
lm_JSEnv = LJ_EnsureJavaEnv(lm_InterpretThread);
|
||||||
if (lm_JSEnv == NULL) {
|
if (lm_JSEnv == NULL) {
|
||||||
@ -908,8 +933,13 @@ LM_WaitForJSLock(void)
|
|||||||
/*
|
/*
|
||||||
* Wait until we get the JSLock
|
* Wait until we get the JSLock
|
||||||
*/
|
*/
|
||||||
|
#ifdef OJI
|
||||||
|
JSBool PR_CALLBACK
|
||||||
|
LM_LockJS(char **errp)
|
||||||
|
#else
|
||||||
void PR_CALLBACK
|
void PR_CALLBACK
|
||||||
LM_LockJS()
|
LM_LockJS()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
PRThread *t = PR_CurrentThread();
|
PRThread *t = PR_CurrentThread();
|
||||||
|
|
||||||
@ -942,6 +972,9 @@ LM_LockJS()
|
|||||||
}
|
}
|
||||||
lm_owner_count++;
|
lm_owner_count++;
|
||||||
PR_ExitMonitor(lm_owner_mon);
|
PR_ExitMonitor(lm_owner_mon);
|
||||||
|
#ifdef OJI
|
||||||
|
return( PR_TRUE );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -39,7 +39,10 @@
|
|||||||
#include "libimg.h" /* Image Library public API. */
|
#include "libimg.h" /* Image Library public API. */
|
||||||
#include "prthread.h"
|
#include "prthread.h"
|
||||||
|
|
||||||
#ifdef JAVA
|
#if defined(JAVA)
|
||||||
|
#include "jsjava.h"
|
||||||
|
#elif defined (OJI)
|
||||||
|
#include "np2.h"
|
||||||
#include "jsjava.h"
|
#include "jsjava.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3222,7 +3225,20 @@ lm_InitWindowContent(MochaDecoder *decoder)
|
|||||||
if (!JS_InitStandardClasses(cx, obj))
|
if (!JS_InitStandardClasses(cx, obj))
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
|
|
||||||
#ifdef JAVA
|
#if defined(OJI)
|
||||||
|
{
|
||||||
|
PRBool jvmMochaPrefsEnabled = PR_FALSE;
|
||||||
|
if (NPL_IsJVMAndMochaPrefsEnabled() == PR_TRUE) {
|
||||||
|
jvmMochaPrefsEnabled = NPL_JSJInit();
|
||||||
|
}
|
||||||
|
if ( (jvmMochaPrefsEnabled == PR_TRUE)
|
||||||
|
&&(!JSJ_InitJSContext(cx, obj, NULL))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return JS_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif defined(JAVA)
|
||||||
if (JSJ_IsEnabled() && !JSJ_InitContext(cx, obj))
|
if (JSJ_IsEnabled() && !JSJ_InitContext(cx, obj))
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Binary file not shown.
@ -1,46 +1 @@
|
|||||||
#!gmake
|
Use the version in mozilla/modules/plugin/src now.
|
||||||
#
|
|
||||||
# The contents of this file are subject to the Netscape Public License
|
|
||||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
|
||||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
|
||||||
# http://www.mozilla.org/NPL/
|
|
||||||
#
|
|
||||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
||||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
||||||
# for the specific language governing rights and limitations under the
|
|
||||||
# NPL.
|
|
||||||
#
|
|
||||||
# The Initial Developer of this code under the NPL is Netscape
|
|
||||||
# Communications Corporation. Portions created by Netscape are
|
|
||||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
||||||
# Reserved.
|
|
||||||
|
|
||||||
DEPTH = ../..
|
|
||||||
|
|
||||||
MODULE = plug
|
|
||||||
LIBRARY_NAME = plug
|
|
||||||
|
|
||||||
CSRCS = npassoc.c
|
|
||||||
|
|
||||||
CPPSRCS = nsplugin.cpp
|
|
||||||
|
|
||||||
EXPORTS = nppg.h npupp.h nsIPlug.h nsILCPlg.h npglue.h nppriv.h
|
|
||||||
|
|
||||||
REQUIRES = lay layer js style applet nspr dbm img util java pref xpcom netcnvts oji
|
|
||||||
|
|
||||||
ifeq ($(subst /,_,$(shell uname -s)),OS2)
|
|
||||||
CPPSRCS = npwplat.cpp
|
|
||||||
REQUIRES += xp libfont os2font jtools
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPPSRCS += npglue.cpp
|
|
||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
|
||||||
|
|
||||||
ifeq ($(subst /,_,$(shell uname -s)),OS2)
|
|
||||||
INCLUDES += -I$(DEPTH)/cmd/os2fe/nfc/include -I$(DEPTH)/cmd/os2fe -I$(DEPTH)/cmd/winfe
|
|
||||||
endif
|
|
||||||
|
|
||||||
INCLUDES += -I.
|
|
||||||
|
|
||||||
$(LIBRARY): $(OBJS)
|
|
||||||
|
|||||||
@ -1,163 +0,0 @@
|
|||||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Netscape Public License
|
|
||||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
||||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
||||||
* http://www.mozilla.org/NPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
||||||
* for the specific language governing rights and limitations under the
|
|
||||||
* NPL.
|
|
||||||
*
|
|
||||||
* The Initial Developer of this code under the NPL is Netscape
|
|
||||||
* Communications Corporation. Portions created by Netscape are
|
|
||||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
||||||
* Reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "npapi.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#if defined(__sun)
|
|
||||||
# include "sunos4.h"
|
|
||||||
#endif /* __sun */
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
extern int np_debug;
|
|
||||||
static void
|
|
||||||
nptrace (const char* message, ...)
|
|
||||||
{
|
|
||||||
int len;
|
|
||||||
char buf[2048];
|
|
||||||
va_list stack;
|
|
||||||
|
|
||||||
va_start (stack, message);
|
|
||||||
len = vsprintf (buf, message, stack);
|
|
||||||
va_end (stack);
|
|
||||||
len = strlen(buf);
|
|
||||||
fwrite("\t\tjp: ", 1, 6, stderr);
|
|
||||||
fwrite(buf, 1, len, stderr);
|
|
||||||
if (buf[len-1] != '\n')
|
|
||||||
fwrite("\n", 1, 1, stderr);
|
|
||||||
}
|
|
||||||
#define NPTRACE(l,t) { if(np_debug>l){nptrace t;}}
|
|
||||||
#else
|
|
||||||
#define NPTRACE(l,t) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "npupp.h"
|
|
||||||
extern NPNetscapeFuncs *np_nfuncs;
|
|
||||||
|
|
||||||
static int inum = 1;
|
|
||||||
|
|
||||||
static NPError
|
|
||||||
javap_new(void *j, NPP npp, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved)
|
|
||||||
{
|
|
||||||
if(mode==NP_EMBED) {
|
|
||||||
NPTRACE(0,("new embed"));
|
|
||||||
} else {
|
|
||||||
NPTRACE(0,("new full"));
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static NPError
|
|
||||||
javap_destroy(NPP instance, NPSavedData **save)
|
|
||||||
{
|
|
||||||
NPTRACE(0,("destroy"));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static NPError
|
|
||||||
javap_setwindow(NPP instance, NPWindow *window)
|
|
||||||
{
|
|
||||||
NPTRACE(0,("setwindow x %d y %d w %d h %d", window->x, window->y, window->width, window->height));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static NPError
|
|
||||||
javap_newstream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
|
|
||||||
{
|
|
||||||
NPTRACE(0,("new stream"));
|
|
||||||
|
|
||||||
switch(inum)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
NPByteRange a, b;
|
|
||||||
*stype = NP_SEEK;
|
|
||||||
a.offset = 0;
|
|
||||||
a.length = 60;
|
|
||||||
b.offset = 252525;
|
|
||||||
b.length = 10;
|
|
||||||
a.next = &b;
|
|
||||||
b.next = 0;
|
|
||||||
np_nfuncs->requestread(stream, &a);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
*stype = NP_ASFILE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
np_nfuncs->geturl(instance, "about:", "_current");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
inum++;
|
|
||||||
|
|
||||||
np_nfuncs->status(instance, "wow");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int32
|
|
||||||
javap_write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
|
|
||||||
{
|
|
||||||
char buf[64];
|
|
||||||
NPTRACE(0,("got %d bytes at %d", len, offset));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
strncpy(buf, (const char *)buffer, 63);
|
|
||||||
buf[63]=0;
|
|
||||||
NPTRACE(0,("\"%s\"", (char *)buf));
|
|
||||||
fwrite(buffer, len, 1, stream->pdata);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static NPError
|
|
||||||
javap_closestream(NPP instance, NPStream *stream, NPError reason)
|
|
||||||
{
|
|
||||||
NPTRACE(0,("sclose"));
|
|
||||||
pclose(stream->pdata);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
javap_asfile(NPP instance, NPStream *stream, const char *fname)
|
|
||||||
{
|
|
||||||
NPTRACE(0,("fname: \"%s\"", fname));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
NPPluginFuncs javap_funcs = {
|
|
||||||
javap_new,
|
|
||||||
javap_destroy,
|
|
||||||
javap_setwindow,
|
|
||||||
javap_newstream,
|
|
||||||
javap_closestream,
|
|
||||||
javap_asfile,
|
|
||||||
NULL,
|
|
||||||
javap_write,
|
|
||||||
NULL,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
NPPluginFuncs *j_pfncs = &javap_funcs;
|
|
||||||
@ -20,20 +20,20 @@ DEPTH = ..
|
|||||||
|
|
||||||
include $(DEPTH)/config/config.mk
|
include $(DEPTH)/config/config.mk
|
||||||
|
|
||||||
DIRS = \
|
DIRS = \
|
||||||
libhook \
|
libhook \
|
||||||
libreg \
|
libreg \
|
||||||
libpref \
|
libpref \
|
||||||
libutil \
|
libutil \
|
||||||
libimg \
|
libimg \
|
||||||
libfont \
|
libfont \
|
||||||
libreg \
|
|
||||||
rdf \
|
rdf \
|
||||||
xml \
|
xml \
|
||||||
schedulr \
|
schedulr \
|
||||||
zlib \
|
zlib \
|
||||||
li \
|
li \
|
||||||
progress \
|
progress \
|
||||||
|
plugin \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifndef MOZ_SECURITY
|
ifndef MOZ_SECURITY
|
||||||
@ -50,9 +50,9 @@ endif
|
|||||||
|
|
||||||
ifdef EDITOR
|
ifdef EDITOR
|
||||||
|
|
||||||
ifdef JAVA_OR_OJI
|
ifdef JAVA_OR_NSJVM # change later to JAVA_OR_OJI
|
||||||
DIRS += edtplug
|
DIRS += edtplug
|
||||||
endif # JAVA_OR_OJI
|
endif # JAVA_OR_NSJVM
|
||||||
|
|
||||||
DIRS += spellchk
|
DIRS += spellchk
|
||||||
endif # EDITOR
|
endif # EDITOR
|
||||||
|
|||||||
@ -16,6 +16,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
DEPTH = ../../..
|
DEPTH = ../../..
|
||||||
|
ifdef JAVA_OR_NSJVM
|
||||||
DIRS = netscape
|
DIRS = netscape
|
||||||
|
else
|
||||||
|
endif
|
||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
include $(DEPTH)/config/rules.mk
|
||||||
|
|||||||
@ -20,6 +20,16 @@ IGNORE_MANIFEST=1
|
|||||||
#
|
#
|
||||||
|
|
||||||
DEPTH=..\..\..
|
DEPTH=..\..\..
|
||||||
|
|
||||||
|
!ifdef NSJVM
|
||||||
|
|
||||||
DIRS=netscape
|
DIRS=netscape
|
||||||
|
|
||||||
|
!else
|
||||||
|
|
||||||
|
export::
|
||||||
|
|
||||||
|
|
||||||
|
!endif
|
||||||
|
|
||||||
include <$(DEPTH)\config\rules.mak>
|
include <$(DEPTH)\config\rules.mak>
|
||||||
|
|||||||
@ -19,7 +19,7 @@ DEPTH = ../../..
|
|||||||
|
|
||||||
include $(DEPTH)/config/config.mk
|
include $(DEPTH)/config/config.mk
|
||||||
|
|
||||||
ifndef JAVA_OR_OJI
|
ifndef JAVA_OR_NSJVM
|
||||||
LOCAL_JMC_SUBDIR = ../jmcgen/include
|
LOCAL_JMC_SUBDIR = ../jmcgen/include
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ IGNORE_MANIFEST=1
|
|||||||
DEPTH=..\..\..
|
DEPTH=..\..\..
|
||||||
!include $(DEPTH)\config\config.mak
|
!include $(DEPTH)\config\config.mak
|
||||||
|
|
||||||
!ifndef JAVA_OR_OJI
|
!ifndef JAVA_OR_NSJVM
|
||||||
LOCAL_JMC_SUBDIR = ..\jmcgen\include
|
LOCAL_JMC_SUBDIR = ..\jmcgen\include
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ EXPORTS=$(JMC_GEN_DIR)\Mnfdoer.h $(JMC_GEN_DIR)\Mnff.h \
|
|||||||
$(JMC_GEN_DIR)\Mnffbu.h $(JMC_GEN_DIR)\Mnffmi.h \
|
$(JMC_GEN_DIR)\Mnffbu.h $(JMC_GEN_DIR)\Mnffmi.h \
|
||||||
$(JMC_GEN_DIR)\Mnffp.h $(JMC_GEN_DIR)\Mnfrc.h $(JMC_GEN_DIR)\Mnfrf.h \
|
$(JMC_GEN_DIR)\Mnffp.h $(JMC_GEN_DIR)\Mnfrc.h $(JMC_GEN_DIR)\Mnfrf.h \
|
||||||
$(JMC_GEN_DIR)\Mnfstrm.h $(JMC_GEN_DIR)\Mnfdlm.h
|
$(JMC_GEN_DIR)\Mnfstrm.h $(JMC_GEN_DIR)\Mnfdlm.h
|
||||||
!if !defined(JAVA_OR_OJI)
|
!if !defined(JAVA_OR_NSJVM)
|
||||||
EXPORTS=$(EXPORTS) $(JMC_GEN_DIR)\Mwinfp.h
|
EXPORTS=$(EXPORTS) $(JMC_GEN_DIR)\Mwinfp.h
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ DEPTH = ../../..
|
|||||||
|
|
||||||
include $(DEPTH)/config/config.mk
|
include $(DEPTH)/config/config.mk
|
||||||
|
|
||||||
ifndef JAVA_OR_OJI
|
ifndef JAVA_OR_NSJVM
|
||||||
LOCAL_JMC_SUBDIR = ../jmcgen/include
|
LOCAL_JMC_SUBDIR = ../jmcgen/include
|
||||||
LOCAL_JMC_SRC_SUBDIR = ../jmcgen/src
|
LOCAL_JMC_SRC_SUBDIR = ../jmcgen/src
|
||||||
endif
|
endif
|
||||||
@ -64,7 +64,7 @@ SDK_TARGET = producer-sdk
|
|||||||
SDK_NAME = FontProducer-sdk-v1.0
|
SDK_NAME = FontProducer-sdk-v1.0
|
||||||
SDK_DIR = $(OBJDIR)/$(SDK_TARGET)
|
SDK_DIR = $(OBJDIR)/$(SDK_TARGET)
|
||||||
|
|
||||||
ifndef JAVA_OR_OJI
|
ifndef JAVA_OR_NSJVM
|
||||||
export::
|
export::
|
||||||
@echo "Copying JMC src files from $(LOCAL_JMC_SRC_SUBDIR)/*.c to cwd"
|
@echo "Copying JMC src files from $(LOCAL_JMC_SRC_SUBDIR)/*.c to cwd"
|
||||||
@for FILE in $(LOCAL_JMC_SRC_SUBDIR)/*.c ;\
|
@for FILE in $(LOCAL_JMC_SRC_SUBDIR)/*.c ;\
|
||||||
|
|||||||
@ -65,14 +65,14 @@ LINCS=-I$(XPDIST)\public\libfont -I$(XPDIST)\public\java \
|
|||||||
-I$(XPDIST)\public\htmldlgs -I$(XPDIST)\public\security
|
-I$(XPDIST)\public\htmldlgs -I$(XPDIST)\public\security
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!if !defined (JAVA_OR_OJI)
|
!if !defined (JAVA_OR_NSJVM)
|
||||||
LOCAL_JMC_SUBDIR = ..\jmcgen\include
|
LOCAL_JMC_SUBDIR = ..\jmcgen\include
|
||||||
LOCAL_JMC_SRC_SUBDIR = ..\jmcgen\src
|
LOCAL_JMC_SRC_SUBDIR = ..\jmcgen\src
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!include $(DEPTH)\config\rules.mak
|
!include $(DEPTH)\config\rules.mak
|
||||||
|
|
||||||
!if !defined (JAVA_OR_OJI)
|
!if !defined (JAVA_OR_NSJVM)
|
||||||
export::
|
export::
|
||||||
@echo +++ make: Copying JMC src files from $(LOCAL_JMC_SRC_SUBDIR)/*.c to cwd
|
@echo +++ make: Copying JMC src files from $(LOCAL_JMC_SRC_SUBDIR)/*.c to cwd
|
||||||
-for %f in ($(LOCAL_JMC_SRC_SUBDIR)\*.c) do $(MAKE_INSTALL) %f .
|
-for %f in ($(LOCAL_JMC_SRC_SUBDIR)\*.c) do $(MAKE_INSTALL) %f .
|
||||||
|
|||||||
@ -80,7 +80,7 @@ extern "C" int
|
|||||||
wfWrite(NET_StreamClass *stream, const unsigned char *str, int32 len)
|
wfWrite(NET_StreamClass *stream, const unsigned char *str, int32 len)
|
||||||
{
|
{
|
||||||
struct stream_data *data = (struct stream_data *) stream->data_object;
|
struct stream_data *data = (struct stream_data *) stream->data_object;
|
||||||
return ((int)nfstrm_Write((nfstrm *)data->fpStream, (char *)str, (jint)len, NULL));
|
return ((int)nfstrm_Write((nfstrm *)data->fpStream, (jbyte *)str, (jint)len, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef XP_OS2
|
#ifndef XP_OS2
|
||||||
|
|||||||
@ -20,7 +20,7 @@ DEPTH=../..
|
|||||||
#// DIRS - There are subdirectories to process
|
#// DIRS - There are subdirectories to process
|
||||||
#//
|
#//
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
DIRS= src
|
DIRS= public src
|
||||||
|
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
#//
|
#//
|
||||||
|
|||||||
Binary file not shown.
@ -20,7 +20,7 @@ DEPTH=..\..
|
|||||||
#// DIRS - There are subdirectories to process
|
#// DIRS - There are subdirectories to process
|
||||||
#//
|
#//
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
DIRS= src
|
DIRS= public src
|
||||||
|
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
#//
|
#//
|
||||||
|
|||||||
@ -25,3 +25,6 @@ nsIJVMManager.h
|
|||||||
nsIJVMPlugin.h
|
nsIJVMPlugin.h
|
||||||
nsIJVMPluginInstance.h
|
nsIJVMPluginInstance.h
|
||||||
nsIJVMPluginTagInfo.h
|
nsIJVMPluginTagInfo.h
|
||||||
|
nsISymantecDebugger.h
|
||||||
|
nsISymantecDebugManager.h
|
||||||
|
nsjvm.h
|
||||||
|
|||||||
@ -43,8 +43,8 @@ public:
|
|||||||
|
|
||||||
// Find or create a JRIEnv for the current thread.
|
// Find or create a JRIEnv for the current thread.
|
||||||
// Returns NULL if an error occurs.
|
// Returns NULL if an error occurs.
|
||||||
NS_IMETHOD_(JRIEnv*)
|
NS_IMETHOD_(nsrefcnt)
|
||||||
GetJRIEnv(void) = 0;
|
GetJRIEnv(JRIEnv* *result) = 0;
|
||||||
|
|
||||||
// This method must be called when the caller is done using the JRIEnv.
|
// This method must be called when the caller is done using the JRIEnv.
|
||||||
// This decrements a refcount associated with it may free it.
|
// This decrements a refcount associated with it may free it.
|
||||||
|
|||||||
@ -41,19 +41,19 @@ public:
|
|||||||
|
|
||||||
// QueryInterface on nsIJVMPlugin to get this.
|
// QueryInterface on nsIJVMPlugin to get this.
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
NS_IMETHOD
|
||||||
ShowConsole(void) = 0;
|
ShowConsole(void) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
NS_IMETHOD
|
||||||
HideConsole(void) = 0;
|
HideConsole(void) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
NS_IMETHOD
|
||||||
IsConsoleVisible(void) = 0;
|
IsConsoleVisible(PRBool *result) = 0;
|
||||||
|
|
||||||
// Prints a message to the Java console. The encodingName specifies the
|
// Prints a message to the Java console. The encodingName specifies the
|
||||||
// encoding of the message, and if NULL, specifies the default platform
|
// encoding of the message, and if NULL, specifies the default platform
|
||||||
// encoding.
|
// encoding.
|
||||||
NS_IMETHOD_(void)
|
NS_IMETHOD
|
||||||
Print(const char* msg, const char* encodingName = NULL) = 0;
|
Print(const char* msg, const char* encodingName = NULL) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,20 +29,18 @@
|
|||||||
#ifndef nsIJVMManager_h___
|
#ifndef nsIJVMManager_h___
|
||||||
#define nsIJVMManager_h___
|
#define nsIJVMManager_h___
|
||||||
|
|
||||||
#include "nsplugin.h"
|
#include "nsISupports.h"
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define NPJVM_MIME_TYPE "application/x-java-vm" // XXX application/java
|
#define NPJVM_MIME_TYPE "application/x-java-vm" // XXX application/java
|
||||||
|
|
||||||
enum nsJVMError {
|
enum {
|
||||||
nsJVMError_Ok = nsPluginError_NoError,
|
NS_JVM_ERROR_BASE = NS_ERROR_BASE + 0x10000,
|
||||||
nsJVMError_Base = 0x1000,
|
NS_JVM_ERROR_NO_CLASSES,
|
||||||
nsJVMError_InternalError = nsJVMError_Base,
|
NS_JVM_ERROR_WRONG_CLASSES,
|
||||||
nsJVMError_NoClasses,
|
NS_JVM_ERROR_JAVA_ERROR,
|
||||||
nsJVMError_WrongClasses,
|
NS_JVM_ERROR_NO_DEBUGGER
|
||||||
nsJVMError_JavaError,
|
|
||||||
nsJVMError_NoDebugger
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -55,12 +53,6 @@ class nsIJVMPlugin;
|
|||||||
class nsIJVMManager : public nsISupports {
|
class nsIJVMManager : public nsISupports {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// This method may be called by the JVM to indicate that an error has
|
|
||||||
// occurred, e.g. that the JVM has failed or is shutting down spontaneously.
|
|
||||||
// This allows the browser to clean up any JVM-specific state.
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
NotifyJVMStatusChange(nsJVMError error) = 0;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NS_IJVMMANAGER_IID \
|
#define NS_IJVMMANAGER_IID \
|
||||||
|
|||||||
@ -38,11 +38,17 @@
|
|||||||
// to implement in order to implement a Java virtual machine plugin.
|
// to implement in order to implement a Java virtual machine plugin.
|
||||||
|
|
||||||
struct nsJVMInitArgs {
|
struct nsJVMInitArgs {
|
||||||
jint version;
|
PRUint32 version;
|
||||||
const char* classpathAdditions; // appended to the JVM's classpath
|
const char* classpathAdditions; // appended to the JVM's classpath
|
||||||
|
// other fields may be added here for version numbers beyond 0x00010000
|
||||||
};
|
};
|
||||||
|
|
||||||
#define nsJVMInitArgs_Version 0x00010000
|
/**
|
||||||
|
* nsJVMInitArgs_Version is the current version number for the nsJVMInitArgs
|
||||||
|
* struct specified above. The nsVersionOk macro should be used when comparing
|
||||||
|
* a supplied nsJVMInitArgs struct against this version.
|
||||||
|
*/
|
||||||
|
#define nsJVMInitArgs_Version 0x00010000L
|
||||||
|
|
||||||
class nsIJVMPlugin : public nsIPlugin {
|
class nsIJVMPlugin : public nsIPlugin {
|
||||||
public:
|
public:
|
||||||
@ -52,43 +58,43 @@ public:
|
|||||||
// Note that calling this method is distinctly separate from
|
// Note that calling this method is distinctly separate from
|
||||||
// initializing the nsIJVMPlugin object (done by the Initialize
|
// initializing the nsIJVMPlugin object (done by the Initialize
|
||||||
// method).
|
// method).
|
||||||
NS_IMETHOD_(nsJVMError)
|
NS_IMETHOD
|
||||||
StartupJVM(nsJVMInitArgs* initargs) = 0;
|
StartupJVM(nsJVMInitArgs* initargs) = 0;
|
||||||
|
|
||||||
// This method us used to stop the Java virtual machine.
|
// This method us used to stop the Java virtual machine.
|
||||||
// It tears down any global state necessary to host Java programs.
|
// It tears down any global state necessary to host Java programs.
|
||||||
// The fullShutdown flag specifies whether the browser is quitting
|
// The fullShutdown flag specifies whether the browser is quitting
|
||||||
// (PR_TRUE) or simply whether the JVM is being shut down (PR_FALSE).
|
// (PR_TRUE) or simply whether the JVM is being shut down (PR_FALSE).
|
||||||
NS_IMETHOD_(nsJVMError)
|
NS_IMETHOD
|
||||||
ShutdownJVM(PRBool fullShutdown) = 0;
|
ShutdownJVM(PRBool fullShutdown = PR_FALSE) = 0;
|
||||||
|
|
||||||
// Causes the JVM to append a new directory to its classpath.
|
// Causes the JVM to append a new directory to its classpath.
|
||||||
// If the JVM doesn't support this operation, an error is returned.
|
// If the JVM doesn't support this operation, an error is returned.
|
||||||
NS_IMETHOD_(nsJVMError)
|
NS_IMETHOD
|
||||||
AddToClassPath(const char* dirPath) = 0;
|
AddToClassPath(const char* dirPath) = 0;
|
||||||
|
|
||||||
// Causes the JVM to remove a directory from its classpath.
|
// Causes the JVM to remove a directory from its classpath.
|
||||||
// If the JVM doesn't support this operation, an error is returned.
|
// If the JVM doesn't support this operation, an error is returned.
|
||||||
NS_IMETHOD_(nsJVMError)
|
NS_IMETHOD
|
||||||
RemoveFromClassPath(const char* dirPath) = 0;
|
RemoveFromClassPath(const char* dirPath) = 0;
|
||||||
|
|
||||||
// Returns the current classpath in use by the JVM.
|
// Returns the current classpath in use by the JVM.
|
||||||
NS_IMETHOD_(const char*)
|
NS_IMETHOD
|
||||||
GetClassPath(void) = 0;
|
GetClassPath(const char* *result) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(nsIPluginInstance*)
|
NS_IMETHOD
|
||||||
GetPluginInstance(jobject javaObject) = 0;
|
GetPluginInstance(jobject javaObject, nsIPluginInstance* *result) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(nsIPluginInstance*)
|
NS_IMETHOD
|
||||||
GetPluginInstance(JNIEnv* jenv) = 0;
|
GetPluginInstance(JNIEnv* jenv, nsIPluginInstance* *result) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(JavaVM *)
|
NS_IMETHOD
|
||||||
GetJavaVM(void) = 0;
|
GetJavaVM(JavaVM* *result) = 0;
|
||||||
|
|
||||||
// Find or create a JNIEnv for the current thread.
|
// Find or create a JNIEnv for the current thread.
|
||||||
// Returns NULL if an error occurs.
|
// Returns NULL if an error occurs.
|
||||||
NS_IMETHOD_(JNIEnv*)
|
NS_IMETHOD_(nsrefcnt)
|
||||||
GetJNIEnv(void) = 0;
|
GetJNIEnv(JNIEnv* *result) = 0;
|
||||||
|
|
||||||
// This method must be called when the caller is done using the JNIEnv.
|
// This method must be called when the caller is done using the JNIEnv.
|
||||||
// This decrements a refcount associated with it may free it.
|
// This decrements a refcount associated with it may free it.
|
||||||
|
|||||||
@ -39,15 +39,11 @@ public:
|
|||||||
|
|
||||||
// This method is called when LiveConnect wants to find the Java object
|
// This method is called when LiveConnect wants to find the Java object
|
||||||
// associated with this plugin instance, e.g. the Applet or JavaBean object.
|
// associated with this plugin instance, e.g. the Applet or JavaBean object.
|
||||||
NS_IMETHOD_(jobject)
|
NS_IMETHOD
|
||||||
GetJavaObject(void) = 0;
|
GetJavaObject(jobject *result) = 0;
|
||||||
|
|
||||||
/* =-= sudu: Ask Eric Bina, what is GetText used for in layform.c
|
NS_IMETHOD
|
||||||
Check to see if this should be more general api applicaple to
|
GetText(const char* *result) = 0;
|
||||||
applets/beans and plugins.
|
|
||||||
*/
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetText(void) = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NS_IJVMPLUGININSTANCE_IID \
|
#define NS_IJVMPLUGININSTANCE_IID \
|
||||||
|
|||||||
@ -39,20 +39,20 @@
|
|||||||
class nsIJVMPluginTagInfo : public nsISupports {
|
class nsIJVMPluginTagInfo : public nsISupports {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
NS_IMETHOD
|
||||||
GetCode(void) = 0;
|
GetCode(const char* *result) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
NS_IMETHOD
|
||||||
GetCodeBase(void) = 0;
|
GetCodeBase(const char* *result) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
NS_IMETHOD
|
||||||
GetArchive(void) = 0;
|
GetArchive(const char* *result) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
NS_IMETHOD
|
||||||
GetName(void) = 0;
|
GetName(const char* *result) = 0;
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
NS_IMETHOD
|
||||||
GetMayScript(void) = 0;
|
GetMayScript(PRBool *result) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
class nsISymantecDebugManager : public nsISupports {
|
class nsISymantecDebugManager : public nsISupports {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
NS_IMETHOD
|
||||||
SetDebugAgentPassword(PRInt32 pwd) = 0;
|
SetDebugAgentPassword(PRInt32 pwd) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -44,7 +44,7 @@ enum nsSymantecDebugPort {
|
|||||||
class nsISymantecDebugger : public nsISupports {
|
class nsISymantecDebugger : public nsISupports {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_IMETHOD_(nsJVMError)
|
NS_IMETHOD
|
||||||
StartDebugger(nsSymantecDebugPort port) = 0;
|
StartDebugger(nsSymantecDebugPort port) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
#ifndef nsjvm_h___
|
#ifndef nsjvm_h___
|
||||||
#define nsjvm_h___
|
#define nsjvm_h___
|
||||||
|
|
||||||
|
#include "nsplugin.h"
|
||||||
#include "nsIJRIPlugin.h"
|
#include "nsIJRIPlugin.h"
|
||||||
#include "nsIJVMConsole.h"
|
#include "nsIJVMConsole.h"
|
||||||
#include "nsIJVMManager.h"
|
#include "nsIJVMManager.h"
|
||||||
|
|||||||
@ -3,5 +3,3 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
jvmmgr.h
|
jvmmgr.h
|
||||||
nsjvm.h
|
|
||||||
nsscd.h
|
|
||||||
|
|||||||
@ -6,19 +6,18 @@
|
|||||||
|
|
||||||
DEPTH = ../../..
|
DEPTH = ../../..
|
||||||
|
|
||||||
MODULE = oji
|
MODULE = ojiimpl
|
||||||
|
|
||||||
ifdef MOZ_OJI
|
ifdef MOZ_OJI
|
||||||
LIBRARY_NAME = oji
|
LIBRARY_NAME = oji
|
||||||
|
|
||||||
CPPSRCS = jvmmgr.cpp \
|
CPPSRCS = jvmmgr.cpp \
|
||||||
jvmpeer.cpp \
|
|
||||||
scd.cpp
|
scd.cpp
|
||||||
|
|
||||||
REQUIRES = img java js lay layer plug pref style util xpcom
|
REQUIRES = img java js lay layer plugin plugimpl pref style util xpcom raptor oji
|
||||||
endif # MOZ_OJI
|
endif # MOZ_OJI
|
||||||
|
|
||||||
EXPORTS = nsjvm.h jvmmgr.h nsscd.h
|
EXPORTS = jvmmgr.h
|
||||||
|
|
||||||
include $(DEPTH)/config/rules.mk
|
include $(DEPTH)/config/rules.mk
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -19,54 +19,34 @@
|
|||||||
#ifndef jvmmgr_h___
|
#ifndef jvmmgr_h___
|
||||||
#define jvmmgr_h___
|
#define jvmmgr_h___
|
||||||
|
|
||||||
|
#include "xp_core.h" // include first because of Bool problem
|
||||||
#include "nsjvm.h"
|
#include "nsjvm.h"
|
||||||
#include "nsscd.h"
|
|
||||||
#include "nsAgg.h"
|
#include "nsAgg.h"
|
||||||
|
#include "jsjava.h"
|
||||||
|
#include "nsVector.h"
|
||||||
|
|
||||||
|
class nsIPluginTagInfo2;
|
||||||
class nsSymantecDebugManager;
|
class nsSymantecDebugManager;
|
||||||
|
|
||||||
|
enum nsJVMStatus {
|
||||||
|
nsJVMStatus_Enabled, // but not Running
|
||||||
|
nsJVMStatus_Disabled, // explicitly disabled
|
||||||
|
nsJVMStatus_Running, // enabled and started
|
||||||
|
nsJVMStatus_Failed // enabled but failed to start
|
||||||
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// JVMMgr is the interface to the JVM manager that the browser sees. All
|
// JVMMgr is the interface to the JVM manager that the browser sees. All
|
||||||
// files that want to include java services should include this header file.
|
// files that want to include java services should include this header file.
|
||||||
// NPIJVMPluginManager is the more limited interface what the JVM plugin sees.
|
// nsIJVMManager is the more limited interface what the JVM plugin sees.
|
||||||
|
|
||||||
class JVMMgr : public NPIJVMPluginManager {
|
class nsJVMMgr : public nsIJVMManager {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_DECL_AGGREGATED
|
NS_DECL_AGGREGATED
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// from NPIJVMPluginManager:
|
// from nsIJVMManager:
|
||||||
|
|
||||||
// ====> These are usually only called by the plugin, not the browser...
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
BeginWaitCursor(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
EndWaitCursor(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetProgramPath(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetTempDirPath(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(nsresult)
|
|
||||||
GetFileName(const char* fn, FileNameType type,
|
|
||||||
char* resultBuf, PRUint32 bufLen);
|
|
||||||
|
|
||||||
NS_IMETHOD_(nsresult)
|
|
||||||
NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
HandOffJSLock(PRThread* oldOwner, PRThread* newOwner);
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
ReportJVMError(JVMEnv* env, JVMError err);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
SupportsURLProtocol(const char* protocol);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// JVMMgr specific methods:
|
// JVMMgr specific methods:
|
||||||
@ -76,277 +56,150 @@ public:
|
|||||||
static NS_METHOD
|
static NS_METHOD
|
||||||
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
||||||
|
|
||||||
NPIJVMPlugin* GetJVM(void);
|
nsIJVMPlugin* GetJVMPlugin(void);
|
||||||
|
|
||||||
// Unlike the NPIJVMPlugin::StartupJVM, this version handles putting
|
// Unlike the nsIJVMPlugin::StartupJVM, this version handles putting
|
||||||
// up any error dialog:
|
// up any error dialog:
|
||||||
JVMStatus StartupJVM(void);
|
nsJVMStatus StartupJVM(void);
|
||||||
JVMStatus ShutdownJVM(PRBool fullShutdown = PR_TRUE);
|
nsJVMStatus ShutdownJVM(PRBool fullShutdown = PR_FALSE);
|
||||||
|
nsJVMStatus GetJVMStatus(void);
|
||||||
|
void SetJVMEnabled(PRBool enabled);
|
||||||
|
|
||||||
PRBool GetJVMEnabled(void);
|
nsresult AddToClassPath(const char* dirPath);
|
||||||
void SetJVMEnabled(PRBool enable);
|
PRBool JSJInit();
|
||||||
JVMStatus GetJVMStatus(void);
|
PRBool IsJVMAndMochaPrefsEnabled(void);
|
||||||
|
JSJavaVM* GetJSJavaVM() { return fJSJavaVM; }
|
||||||
|
|
||||||
void SetProgramPath(const char* path) { fProgramPath = path; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
JVMMgr(nsISupports* outer);
|
nsJVMMgr(nsISupports* outer);
|
||||||
virtual ~JVMMgr(void);
|
virtual ~nsJVMMgr(void);
|
||||||
|
|
||||||
void EnsurePrefCallbackRegistered(void);
|
void EnsurePrefCallbackRegistered(void);
|
||||||
const char* GetJavaErrorString(JVMEnv* env);
|
const char* GetJavaErrorString(JRIEnv* env);
|
||||||
|
|
||||||
NPIJVMPlugin* fJVM;
|
nsIJVMPlugin* fJVM;
|
||||||
PRUint16 fWaiting;
|
nsJVMStatus fStatus;
|
||||||
void* fOldCursor;
|
|
||||||
const char* fProgramPath;
|
|
||||||
PRBool fRegisteredJavaPrefChanged;
|
PRBool fRegisteredJavaPrefChanged;
|
||||||
nsISupports* fDebugManager;
|
nsISupports* fDebugManager;
|
||||||
|
JSJavaVM * fJSJavaVM;
|
||||||
|
nsVector* fClassPathAdditions;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Symantec Debugger Stuff
|
// Symantec Debugger Stuff
|
||||||
|
|
||||||
class nsSymantecDebugManager : public NPISymantecDebugManager {
|
class nsSymantecDebugManager : public nsISymantecDebugManager {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_DECL_AGGREGATED
|
NS_DECL_AGGREGATED
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
NS_IMETHOD
|
||||||
SetDebugAgentPassword(PRInt32 pwd);
|
SetDebugAgentPassword(PRInt32 pwd);
|
||||||
|
|
||||||
static NS_METHOD
|
static NS_METHOD
|
||||||
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr,
|
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr,
|
||||||
JVMMgr* jvmMgr);
|
nsJVMMgr* jvmMgr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsSymantecDebugManager(nsISupports* outer, JVMMgr* jvmMgr);
|
nsSymantecDebugManager(nsISupports* outer, nsJVMMgr* jvmMgr);
|
||||||
virtual ~nsSymantecDebugManager(void);
|
virtual ~nsSymantecDebugManager(void);
|
||||||
|
|
||||||
JVMMgr* fJVMMgr;
|
nsJVMMgr* fJVMMgr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// JVMInstancePeer: The browser makes one of these when it sees an APPLET or
|
// nsJVMPluginTagInfo: The browser makes one of these when it sees an APPLET or
|
||||||
// appropriate OBJECT tag.
|
// appropriate OBJECT tag.
|
||||||
|
|
||||||
class JVMInstancePeer : public NPIJVMPluginInstancePeer {
|
class nsJVMPluginTagInfo : public nsIJVMPluginTagInfo {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_DECL_AGGREGATED
|
NS_DECL_AGGREGATED
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Methods specific to NPIPluginInstancePeer:
|
// from nsIJVMPluginTagInfo:
|
||||||
|
|
||||||
// ====> These are usually only called by the plugin, not the browser...
|
// ====> These are usually only called by the plugin, not the browser...
|
||||||
|
|
||||||
NS_IMETHOD_(NPIPlugin*)
|
NS_IMETHOD
|
||||||
GetClass(void);
|
GetCode(const char* *result);
|
||||||
|
|
||||||
// (Corresponds to NPP_New's MIMEType argument.)
|
NS_IMETHOD
|
||||||
NS_IMETHOD_(nsMIMEType)
|
GetCodeBase(const char* *result);
|
||||||
GetMIMEType(void);
|
|
||||||
|
|
||||||
// (Corresponds to NPP_New's mode argument.)
|
NS_IMETHOD
|
||||||
NS_IMETHOD_(NPPluginType)
|
GetArchive(const char* *result);
|
||||||
GetMode(void);
|
|
||||||
|
|
||||||
// Get a ptr to the paired list of attribute names and values,
|
NS_IMETHOD
|
||||||
// returns the length of the array.
|
GetName(const char* *result);
|
||||||
//
|
|
||||||
// Each name or value is a null-terminated string.
|
|
||||||
NS_IMETHOD_(NPPluginError)
|
|
||||||
GetAttributes(PRUint16& n, const char*const*& names, const char*const*& values);
|
|
||||||
|
|
||||||
// Get the value for the named attribute. Returns null
|
NS_IMETHOD
|
||||||
// if the attribute was not set.
|
GetMayScript(PRBool *result);
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetAttribute(const char* name);
|
|
||||||
|
|
||||||
// Get a ptr to the paired list of parameter names and values,
|
|
||||||
// returns the length of the array.
|
|
||||||
//
|
|
||||||
// Each name or value is a null-terminated string.
|
|
||||||
NS_IMETHOD_(NPPluginError)
|
|
||||||
GetParameters(PRUint16& n, const char*const*& names, const char*const*& values);
|
|
||||||
|
|
||||||
// Get the value for the named parameter. Returns null
|
|
||||||
// if the parameter was not set.
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetParameter(const char* name);
|
|
||||||
|
|
||||||
// Get the complete text of the HTML tag that was
|
|
||||||
// used to instantiate this plugin
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetTagText(void);
|
|
||||||
|
|
||||||
// Get the type of the HTML tag that was used ot instantiate this
|
|
||||||
// plugin. Currently supported tags are EMBED, OBJECT and APPLET.
|
|
||||||
//
|
|
||||||
NS_IMETHOD_(NPTagType)
|
|
||||||
GetTagType(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(NPIPluginManager*)
|
|
||||||
GetPluginManager(void);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_GetURL and NPN_GetURLNotify.)
|
|
||||||
// notifyData: When present, URLNotify is called passing the notifyData back
|
|
||||||
// to the client. When NULL, this call behaves like NPN_GetURL.
|
|
||||||
// New arguments:
|
|
||||||
// altHost: An IP-address string that will be used instead of the host
|
|
||||||
// specified in the URL. This is used to prevent DNS-spoofing attacks.
|
|
||||||
// Can be defaulted to NULL meaning use the host in the URL.
|
|
||||||
// referrer:
|
|
||||||
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
|
|
||||||
// even if the user currently has JavaScript disabled.
|
|
||||||
NS_IMETHOD_(NPPluginError)
|
|
||||||
GetURL(const char* url, const char* target, void* notifyData = NULL,
|
|
||||||
const char* altHost = NULL, const char* referrer = NULL,
|
|
||||||
PRBool forceJSEnabled = PR_FALSE);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
|
|
||||||
// notifyData: When present, URLNotify is called passing the notifyData back
|
|
||||||
// to the client. When NULL, this call behaves like NPN_GetURL.
|
|
||||||
// New arguments:
|
|
||||||
// altHost: An IP-address string that will be used instead of the host
|
|
||||||
// specified in the URL. This is used to prevent DNS-spoofing attacks.
|
|
||||||
// Can be defaulted to NULL meaning use the host in the URL.
|
|
||||||
// referrer:
|
|
||||||
// forceJSEnabled: Forces JavaScript to be enabled for 'javascript:' URLs,
|
|
||||||
// even if the user currently has JavaScript disabled.
|
|
||||||
// postHeaders: A string containing post headers.
|
|
||||||
// postHeadersLength: The length of the post headers string.
|
|
||||||
NS_IMETHOD_(NPPluginError)
|
|
||||||
PostURL(const char* url, const char* target, PRUint32 bufLen,
|
|
||||||
const char* buf, PRBool file, void* notifyData = NULL,
|
|
||||||
const char* altHost = NULL, const char* referrer = NULL,
|
|
||||||
PRBool forceJSEnabled = PR_FALSE,
|
|
||||||
PRUint32 postHeadersLength = 0, const char* postHeaders = NULL);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_NewStream.)
|
|
||||||
NS_IMETHOD_(NPPluginError)
|
|
||||||
NewStream(nsMIMEType type, const char* target,
|
|
||||||
NPIPluginManagerStream* *result);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_Status.)
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
ShowStatus(const char* message);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_UserAgent.)
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
UserAgent(void);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_GetValue.)
|
|
||||||
NS_IMETHOD_(NPPluginError)
|
|
||||||
GetValue(NPPluginManagerVariable variable, void *value);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_SetValue.)
|
|
||||||
NS_IMETHOD_(NPPluginError)
|
|
||||||
SetValue(NPPluginVariable variable, void *value);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_InvalidateRect.)
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
InvalidateRect(nsRect *invalidRect);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_InvalidateRegion.)
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
InvalidateRegion(nsRegion invalidRegion);
|
|
||||||
|
|
||||||
// (Corresponds to NPN_ForceRedraw.)
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
ForceRedraw(void);
|
|
||||||
|
|
||||||
// New top-level window handling calls for Mac:
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
RegisterWindow(void* window);
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
UnregisterWindow(void* window);
|
|
||||||
|
|
||||||
// Menu ID allocation calls for Mac:
|
|
||||||
NS_IMETHOD_(PRInt16)
|
|
||||||
AllocateMenuID(PRBool isSubmenu);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Methods specific to NPIJVMPluginInstancePeer:
|
// Methods specific to nsJVMPluginInstancePeer:
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetCode(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetCodeBase(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetArchive(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
GetMayScript(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetID(void);
|
|
||||||
|
|
||||||
// XXX reload method?
|
|
||||||
|
|
||||||
// Returns a unique id for the current document on which the
|
|
||||||
// plugin is displayed.
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetDocumentID(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetDocumentBase(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(INTL_CharSetInfo)
|
|
||||||
GetDocumentCharSetInfo(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetAlignment(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetWidth(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetHeight(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetBorderVertSpace(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetBorderHorizSpace(void);
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
Tickle(void);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Methods specific to JVMPluginInstancePeer:
|
|
||||||
|
|
||||||
// ====> From here on are things only called by the browser, not the plugin...
|
// ====> From here on are things only called by the browser, not the plugin...
|
||||||
|
|
||||||
static NS_METHOD
|
static NS_METHOD
|
||||||
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr,
|
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr,
|
||||||
MWContext* cx, LO_CommonPluginStruct* lo);
|
nsIPluginTagInfo2* info);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
JVMInstancePeer(nsISupports* outer, MWContext* cx, LO_CommonPluginStruct* lo);
|
nsJVMPluginTagInfo(nsISupports* outer, nsIPluginTagInfo2* info);
|
||||||
virtual ~JVMInstancePeer(void);
|
virtual ~nsJVMPluginTagInfo(void);
|
||||||
|
|
||||||
// Instance Variables:
|
// Instance Variables:
|
||||||
NPIPluginInstancePeer* fPluginInstancePeer;
|
nsIPluginTagInfo2* fPluginTagInfo;
|
||||||
MWContext* fContext;
|
char* fSimulatedCodebase;
|
||||||
LO_CommonPluginStruct* fLayoutElement;
|
char* fSimulatedCode;
|
||||||
PRUint32 fUniqueID;
|
|
||||||
char* fSimulatedCodebase;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Convenience Routines
|
||||||
|
|
||||||
|
PR_BEGIN_EXTERN_C
|
||||||
|
|
||||||
// Returns the JVM manager. You must do a Release on the
|
// Returns the JVM manager. You must do a Release on the
|
||||||
// pointer returned when you're done with it.
|
// pointer returned when you're done with it.
|
||||||
extern "C" PR_EXTERN(JVMMgr*)
|
PR_EXTERN(nsJVMMgr*)
|
||||||
JVM_GetJVMMgr(void);
|
JVM_GetJVMMgr(void);
|
||||||
|
|
||||||
|
// Returns true if java is enabled, and has not failed to load.
|
||||||
|
PR_EXTERN(PRBool)
|
||||||
|
JVM_IsJVMAvailable(void);
|
||||||
|
|
||||||
|
PR_EXTERN(nsresult)
|
||||||
|
JVM_AddToClassPath(const char* dirPath);
|
||||||
|
|
||||||
|
PR_EXTERN(void)
|
||||||
|
JVM_ShowConsole(void);
|
||||||
|
|
||||||
|
PR_EXTERN(void)
|
||||||
|
JVM_HideConsole(void);
|
||||||
|
|
||||||
|
PR_EXTERN(PRBool)
|
||||||
|
JVM_IsConsoleVisible(void);
|
||||||
|
|
||||||
|
PR_EXTERN(void)
|
||||||
|
JVM_ToggleConsole(void);
|
||||||
|
|
||||||
|
PR_EXTERN(void)
|
||||||
|
JVM_PrintToConsole(const char* msg);
|
||||||
|
|
||||||
|
PR_EXTERN(void)
|
||||||
|
JVM_StartDebugger(void);
|
||||||
|
|
||||||
|
PR_EXTERN(JavaVM*)
|
||||||
|
JVM_GetJavaVM(void);
|
||||||
|
|
||||||
|
PR_EXTERN(JNIEnv*)
|
||||||
|
JVM_GetJNIEnv(void);
|
||||||
|
|
||||||
|
PR_END_EXTERN_C
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
#endif /* jvmmgr_h___ */
|
#endif /* jvmmgr_h___ */
|
||||||
|
|||||||
@ -35,7 +35,6 @@ PDBFILE=$(LIBNAME).pdb
|
|||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
|
|
||||||
OBJS = .\$(OBJDIR)\jvmmgr.obj \
|
OBJS = .\$(OBJDIR)\jvmmgr.obj \
|
||||||
.\$(OBJDIR)\jvmpeer.obj \
|
|
||||||
.\$(OBJDIR)\scd.obj
|
.\$(OBJDIR)\scd.obj
|
||||||
|
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
@ -54,7 +53,7 @@ LIBRARY= .\$(OBJDIR)\$(LIBNAME).lib
|
|||||||
#//
|
#//
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
|
|
||||||
LINCS= $(LINCS) -I_jri -I$(DEPTH)/lib/plugin \
|
LINCS= $(LINCS) -I_jri \
|
||||||
#
|
#
|
||||||
# For Win16 the following include directories are copied into
|
# For Win16 the following include directories are copied into
|
||||||
# ns/dist/public/win16
|
# ns/dist/public/win16
|
||||||
@ -68,22 +67,24 @@ LINCS= $(LINCS) -I_jri -I$(DEPTH)/lib/plugin \
|
|||||||
-I$(PUBLIC)/security \
|
-I$(PUBLIC)/security \
|
||||||
-I$(PUBLIC)/pref \
|
-I$(PUBLIC)/pref \
|
||||||
-I$(PUBLIC)/xpcom \
|
-I$(PUBLIC)/xpcom \
|
||||||
|
-I$(PUBLIC)/raptor \
|
||||||
|
-I$(PUBLIC)/plugin \
|
||||||
|
-I$(PUBLIC)/oji \
|
||||||
|
-I$(PUBLIC)/plugimpl \
|
||||||
!endif
|
!endif
|
||||||
-I$(DEPTH)/lib/layout \
|
-I$(DEPTH)/lib/layout \
|
||||||
-I$(DEPTH)/lib/libstyle \
|
-I$(DEPTH)/lib/libstyle \
|
||||||
-I$(DEPTH)/lib/libjar \
|
-I$(DEPTH)/lib/libjar \
|
||||||
-I$(DEPTH)/lib/plugin \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
CSRCS = jvmmgr.cpp \
|
CSRCS = jvmmgr.cpp \
|
||||||
jvmpeer.cpp \
|
|
||||||
scd.cpp
|
scd.cpp
|
||||||
|
|
||||||
!endif # MOZ_OJI
|
!endif # MOZ_OJI
|
||||||
|
|
||||||
MODULE = oji
|
MODULE = ojiimpl
|
||||||
|
|
||||||
EXPORTS = nsjvm.h jvmmgr.h nsscd.h
|
EXPORTS = jvmmgr.h
|
||||||
|
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
#//
|
#//
|
||||||
@ -96,14 +97,12 @@ LCFLAGS=$(LCFLAGS) ^
|
|||||||
$(JAVA_DEFINES)
|
$(JAVA_DEFINES)
|
||||||
|
|
||||||
!if "$(MOZ_BITS)" == "32"
|
!if "$(MOZ_BITS)" == "32"
|
||||||
PUBLIC_HEADER_DIR=$(PUBLIC)\oji
|
PUBLIC_HEADER_DIR=$(PUBLIC)\ojiimpl
|
||||||
!else
|
!else
|
||||||
PUBLIC_HEADER_DIR=$(PUBLIC)\win16
|
PUBLIC_HEADER_DIR=$(PUBLIC)\win16
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
export::
|
export::
|
||||||
$(MAKE_INSTALL) nsjvm.h $(PUBLIC_HEADER_DIR)
|
|
||||||
$(MAKE_INSTALL) nsscd.h $(PUBLIC_HEADER_DIR)
|
|
||||||
$(MAKE_INSTALL) jvmmgr.h $(PUBLIC_HEADER_DIR)
|
$(MAKE_INSTALL) jvmmgr.h $(PUBLIC_HEADER_DIR)
|
||||||
|
|
||||||
!ifdef MOZ_OJI
|
!ifdef MOZ_OJI
|
||||||
|
|||||||
@ -1,274 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Netscape Public License
|
|
||||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
||||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
||||||
* http://www.mozilla.org/NPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
||||||
* for the specific language governing rights and limitations under the
|
|
||||||
* NPL.
|
|
||||||
*
|
|
||||||
* The Initial Developer of this code under the NPL is Netscape
|
|
||||||
* Communications Corporation. Portions created by Netscape are
|
|
||||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
||||||
* Reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NETSCAPE JAVA VM PLUGIN EXTENSIONS
|
|
||||||
//
|
|
||||||
// This interface allows a Java virtual machine to be plugged into
|
|
||||||
// Communicator to implement the APPLET tag and host applets.
|
|
||||||
//
|
|
||||||
// Note that this is the C++ interface that the plugin sees. The browser
|
|
||||||
// uses a specific implementation of this, nsJVMPlugin, found in navjvm.h.
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef nsjvm_h___
|
|
||||||
#define nsjvm_h___
|
|
||||||
|
|
||||||
#include "nsIPlug.h"
|
|
||||||
#include "jri.h" // XXX for now
|
|
||||||
#include "jni.h"
|
|
||||||
#include "prthread.h"
|
|
||||||
|
|
||||||
#include "libi18n.h" // XXX way too much browser dependence
|
|
||||||
#include "intl_csi.h"
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#define NPJVM_MIME_TYPE "application/x-java-vm"
|
|
||||||
|
|
||||||
enum JVMError {
|
|
||||||
JVMError_Ok = NPPluginError_NoError,
|
|
||||||
JVMError_Base = 0x1000,
|
|
||||||
JVMError_InternalError = JVMError_Base,
|
|
||||||
JVMError_NoClasses,
|
|
||||||
JVMError_WrongClasses,
|
|
||||||
JVMError_JavaError,
|
|
||||||
JVMError_NoDebugger
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef XP_MAC
|
|
||||||
typedef JNIEnv JVMEnv;
|
|
||||||
#else
|
|
||||||
typedef JRIEnv JVMEnv;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Java VM Plugin Manager
|
|
||||||
// This interface defines additional entry points that are available
|
|
||||||
// to JVM plugins for browsers that support JVM plugins.
|
|
||||||
|
|
||||||
class NPIJVMPlugin;
|
|
||||||
|
|
||||||
class NPIJVMPluginManager : public nsISupports {
|
|
||||||
public:
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
BeginWaitCursor(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
EndWaitCursor(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetProgramPath(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetTempDirPath(void) = 0;
|
|
||||||
|
|
||||||
enum FileNameType { SIGNED_APPLET_DBNAME, TEMP_FILENAME };
|
|
||||||
|
|
||||||
NS_IMETHOD_(nsresult)
|
|
||||||
GetFileName(const char* fn, FileNameType type,
|
|
||||||
char* resultBuf, PRUint32 bufLen) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(nsresult)
|
|
||||||
NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
HandOffJSLock(PRThread* oldOwner, PRThread* newOwner) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
ReportJVMError(JVMEnv* env, JVMError err) = 0; // XXX JNIEnv*
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
SupportsURLProtocol(const char* protocol) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#define NP_IJVMPLUGINMANAGER_IID \
|
|
||||||
{ /* a1e5ed50-aa4a-11d1-85b2-00805f0e4dfe */ \
|
|
||||||
0xa1e5ed50, \
|
|
||||||
0xaa4a, \
|
|
||||||
0x11d1, \
|
|
||||||
{0x85, 0xb2, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
enum JVMStatus {
|
|
||||||
JVMStatus_Enabled, // but not Running
|
|
||||||
JVMStatus_Disabled, // explicitly disabled
|
|
||||||
JVMStatus_Running, // enabled and started
|
|
||||||
JVMStatus_Failed // enabled but failed to start
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Java VM Plugin Interface
|
|
||||||
// This interface defines additional entry points that a plugin developer needs
|
|
||||||
// to implement in order to implement a Java virtual machine plugin.
|
|
||||||
|
|
||||||
class NPIJVMPlugin : public NPIPlugin {
|
|
||||||
public:
|
|
||||||
|
|
||||||
// QueryInterface may be used to obtain a JRIEnv or JNIEnv
|
|
||||||
// from an NPIPluginManager.
|
|
||||||
// (Corresponds to NPN_GetJavaEnv.)
|
|
||||||
|
|
||||||
NS_IMETHOD_(JVMStatus)
|
|
||||||
StartupJVM(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(JVMStatus)
|
|
||||||
ShutdownJVM(PRBool fullShutdown = PR_TRUE) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
GetJVMEnabled(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
SetJVMEnabled(PRBool enable) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(JVMStatus)
|
|
||||||
GetJVMStatus(void) = 0;
|
|
||||||
|
|
||||||
// Find or create a JNIEnv for the specified thread. The thread
|
|
||||||
// parameter may be NULL indicating the current thread.
|
|
||||||
// XXX JNIEnv*
|
|
||||||
NS_IMETHOD_(JVMEnv*)
|
|
||||||
EnsureExecEnv(PRThread* thread = NULL) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
AddToClassPath(const char* dirPath) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
ShowConsole(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
HideConsole(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
IsConsoleVisible(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(void)
|
|
||||||
PrintToConsole(const char* msg) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetClassPath(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetSystemJARPath(void) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#define NP_IJVMPLUGIN_IID \
|
|
||||||
{ /* da6f3bc0-a1bc-11d1-85b1-00805f0e4dfe */ \
|
|
||||||
0xda6f3bc0, \
|
|
||||||
0xa1bc, \
|
|
||||||
0x11d1, \
|
|
||||||
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Java VM Plugin Instance Interface
|
|
||||||
|
|
||||||
class NPIJVMPluginInstance : public NPIPluginInstance {
|
|
||||||
public:
|
|
||||||
|
|
||||||
// This method is called when LiveConnect wants to find the Java object
|
|
||||||
// associated with this plugin instance, e.g. the Applet or JavaBean object.
|
|
||||||
NS_IMETHOD_(jobject)
|
|
||||||
GetJavaObject(void) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Java VM Plugin Instance Peer Interface
|
|
||||||
// This interface provides additional hooks into the plugin manager that allow
|
|
||||||
// a plugin to implement the plugin manager's Java virtual machine.
|
|
||||||
|
|
||||||
enum NPTagAttributeName {
|
|
||||||
NPTagAttributeName_Width,
|
|
||||||
NPTagAttributeName_Height,
|
|
||||||
NPTagAttributeName_Classid,
|
|
||||||
NPTagAttributeName_Code,
|
|
||||||
NPTagAttributeName_Codebase,
|
|
||||||
NPTagAttributeName_Docbase,
|
|
||||||
NPTagAttributeName_Archive,
|
|
||||||
NPTagAttributeName_Name,
|
|
||||||
NPTagAttributeName_MayScript
|
|
||||||
};
|
|
||||||
|
|
||||||
class NPIJVMPluginInstancePeer : public NPIPluginInstancePeer {
|
|
||||||
public:
|
|
||||||
|
|
||||||
// XXX reload method?
|
|
||||||
|
|
||||||
// Returns a unique id for the current document on which the
|
|
||||||
// plugin is displayed.
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetDocumentID(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetCode(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetCodeBase(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetArchive(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char *)
|
|
||||||
GetID(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
GetMayScript(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetDocumentBase(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(INTL_CharSetInfo)
|
|
||||||
GetDocumentCharSetInfo(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(const char*)
|
|
||||||
GetAlignment(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetWidth(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetHeight(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetBorderVertSpace(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRUint32)
|
|
||||||
GetBorderHorizSpace(void) = 0;
|
|
||||||
|
|
||||||
NS_IMETHOD_(PRBool)
|
|
||||||
Tickle(void) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#define NP_IJVMPLUGININSTANCEPEER_IID \
|
|
||||||
{ /* 27b42df0-a1bd-11d1-85b1-00805f0e4dfe */ \
|
|
||||||
0x27b42df0, \
|
|
||||||
0xa1bd, \
|
|
||||||
0x11d1, \
|
|
||||||
{0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
#endif /* nsjvm_h___ */
|
|
||||||
@ -23,11 +23,11 @@
|
|||||||
#include "jvmmgr.h"
|
#include "jvmmgr.h"
|
||||||
|
|
||||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
static NS_DEFINE_IID(kISymantecDebugManagerIID, NP_ISYMANTECDEBUGMANAGER_IID);
|
static NS_DEFINE_IID(kISymantecDebugManagerIID, NS_ISYMANTECDEBUGMANAGER_IID);
|
||||||
|
|
||||||
NS_IMPL_AGGREGATED(nsSymantecDebugManager);
|
NS_IMPL_AGGREGATED(nsSymantecDebugManager);
|
||||||
|
|
||||||
nsSymantecDebugManager::nsSymantecDebugManager(nsISupports* outer, JVMMgr* jvmMgr)
|
nsSymantecDebugManager::nsSymantecDebugManager(nsISupports* outer, nsJVMMgr* jvmMgr)
|
||||||
: fJVMMgr(jvmMgr)
|
: fJVMMgr(jvmMgr)
|
||||||
{
|
{
|
||||||
NS_INIT_AGGREGATED(outer);
|
NS_INIT_AGGREGATED(outer);
|
||||||
@ -50,7 +50,7 @@ nsSymantecDebugManager::AggregatedQueryInterface(const nsIID& aIID, void** aInst
|
|||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsSymantecDebugManager::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr,
|
nsSymantecDebugManager::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr,
|
||||||
JVMMgr* jvmMgr)
|
nsJVMMgr* jvmMgr)
|
||||||
{
|
{
|
||||||
if (outer && !aIID.Equals(kISupportsIID))
|
if (outer && !aIID.Equals(kISupportsIID))
|
||||||
return NS_NOINTERFACE; // XXX right error?
|
return NS_NOINTERFACE; // XXX right error?
|
||||||
@ -66,7 +66,7 @@ nsSymantecDebugManager::Create(nsISupports* outer, const nsIID& aIID, void* *aIn
|
|||||||
extern "C" HWND FindNavigatorHiddenWindow(void);
|
extern "C" HWND FindNavigatorHiddenWindow(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_METHOD_(PRBool)
|
NS_METHOD
|
||||||
nsSymantecDebugManager::SetDebugAgentPassword(PRInt32 pwd)
|
nsSymantecDebugManager::SetDebugAgentPassword(PRInt32 pwd)
|
||||||
{
|
{
|
||||||
#if defined(XP_PC) && defined(_WIN32)
|
#if defined(XP_PC) && defined(_WIN32)
|
||||||
@ -86,9 +86,9 @@ nsSymantecDebugManager::SetDebugAgentPassword(PRInt32 pwd)
|
|||||||
ReleaseSemaphore(sem, 1, NULL);
|
ReleaseSemaphore(sem, 1, NULL);
|
||||||
CloseHandle(sem);
|
CloseHandle(sem);
|
||||||
}
|
}
|
||||||
return PR_TRUE;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
return PR_FALSE;
|
return NS_ERROR_FAILURE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,11 @@ DEPTH=../..
|
|||||||
#// DIRS - There are subdirectories to process
|
#// DIRS - There are subdirectories to process
|
||||||
#//
|
#//
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
|
ifndef NGLAYOUT_PLUGINS
|
||||||
DIRS= public src
|
DIRS= public src
|
||||||
|
else
|
||||||
|
DIRS= public nglsrc
|
||||||
|
endif
|
||||||
|
|
||||||
#//------------------------------------------------------------------------
|
#//------------------------------------------------------------------------
|
||||||
#//
|
#//
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user