diff --git a/mozilla/cmd/winfe/cfe.cpp b/mozilla/cmd/winfe/cfe.cpp index 33d548e82ef..cf9acf69db9 100644 --- a/mozilla/cmd/winfe/cfe.cpp +++ b/mozilla/cmd/winfe/cfe.cpp @@ -569,6 +569,7 @@ void CFE_SetDrawable(MWContext *pContext, CL_Drawable *drawable) } #endif +#ifdef TRANSPARENT_APPLET /* java specific functions to allow delayed window creation and transparency */ void CFE_HandleClippingView(MWContext *pContext, LJAppletData *appletD, int x, int y, int width, int height) { if(ABSTRACTCX(pContext)->IsDestroyed()) { @@ -589,6 +590,7 @@ void CFE_DrawJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava WINCX(pContext)->DrawJavaApp(pContext, iLocation, pJava); } +#endif int CFE_FileSortMethod(MWContext *pContext) { if(ABSTRACTCX(pContext)->IsDestroyed()) { diff --git a/mozilla/cmd/winfe/cxdc.cpp b/mozilla/cmd/winfe/cxdc.cpp index fb183b51d23..1fca3da820e 100644 --- a/mozilla/cmd/winfe/cxdc.cpp +++ b/mozilla/cmd/winfe/cxdc.cpp @@ -33,7 +33,9 @@ #include "prefinfo.h" #include "cxprint.h" -#ifdef JAVA +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) #include "java.h" #endif @@ -3759,14 +3761,14 @@ BOOL CDCCX::ResolveTextExtent(int16 wincsid, HDC pDC, LPCTSTR pString, int iLeng #endif } - +#ifdef TRANSPARENT_APPLET // // This function is called only when applet are windowless and force a // paint on the java side // void CDCCX::DrawJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava) { -#ifdef JAVA +#if defined(OJI) || defined(JAVA) RECT rect; HDC hDC = GetContextDC(); @@ -3790,10 +3792,15 @@ void CDCCX::DrawJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJ event.event = WM_PAINT; event.wParam = (uint32)hDC; event.lParam = (uint32)▭ - + +#if defined(OJI) + // XXX help +#elif defined(JAVA) LJ_HandleEvent(pContext, pJava, (void *)&event); +#endif ReleaseContextDC(hDC); #endif } +#endif diff --git a/mozilla/cmd/winfe/cxdc.h b/mozilla/cmd/winfe/cxdc.h index 761b859e228..b1bf6822c37 100644 --- a/mozilla/cmd/winfe/cxdc.h +++ b/mozilla/cmd/winfe/cxdc.h @@ -729,7 +729,9 @@ public: virtual void ResetFormElement(MWContext *pContext, LO_FormElementStruct *pFormElement); virtual void SetFormElementToggle(MWContext *pContext, LO_FormElementStruct *pFormElement, XP_Bool iState); +#ifdef TRANSPARENT_APPLET virtual void DrawJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava); +#endif protected: void StretchMaskBlt(HDC hTargetDC, HBITMAP theBitmap, HBITMAP theMask, diff --git a/mozilla/cmd/winfe/cxstubs.cpp b/mozilla/cmd/winfe/cxstubs.cpp index 1d8f252d6fd..b3dd3e39764 100755 --- a/mozilla/cmd/winfe/cxstubs.cpp +++ b/mozilla/cmd/winfe/cxstubs.cpp @@ -518,6 +518,7 @@ void CStubsCX::GetDocPosition(MWContext * pContext, int iLoc, int32 * pX, int32 { } +#ifdef TRANSPARENT_APPLET /* java specific functions to allow delayed window creation and transparency */ void CStubsCX::HandleClippingView(MWContext *pContext, LJAppletData *appletD, int x, int y, int width, int height) { @@ -525,6 +526,7 @@ void CStubsCX::HandleClippingView(MWContext *pContext, LJAppletData *appletD, in void CStubsCX::DrawJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava) { } +#endif // URL Exit Routines void CStubsCX::GetUrlExitRoutine(URL_Struct *pUrl, int iStatus, MWContext *pContext) { diff --git a/mozilla/cmd/winfe/cxwin.cpp b/mozilla/cmd/winfe/cxwin.cpp index 651279fe437..aa7fcf224c3 100644 --- a/mozilla/cmd/winfe/cxwin.cpp +++ b/mozilla/cmd/winfe/cxwin.cpp @@ -51,14 +51,23 @@ extern char * EDT_NEW_DOC_NAME; #define EDT_IS_SIZING ( EDT_IS_EDITOR(GetContext()) && EDT_IsSizing(GetContext()) ) -#ifdef JAVA -#include "np.h" +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) #include "java.h" +#endif + +#if defined(JAVA) || defined(OJI) + +#include "np.h" #include "prlog.h" + #ifdef DDRAW static DDSURFACEDESC ddsd; #endif + extern "C" { + #ifndef NSPR20 PR_LOG_DEFINE(APPLET); #else @@ -87,7 +96,8 @@ PR_PUBLIC_API(HPALETTE) GET_APPLICATION_PALETTE(void) } return hPal; } -}; + +}; /* extern "C" */ #endif /* JAVA */ // older versions of MFC don't have this #define @@ -605,7 +615,9 @@ void CWinCX::DestroyContext() { #endif ReleaseContextDC(hdc); } -#ifdef JAVA +#if defined(OJI) + // XXX help +#elif defined(JAVA) // // Discard the events pending for the context... // @@ -4131,13 +4143,11 @@ void CWinCX::DestroyEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp) } - - //////////////////////////////////////////////////////////////////////////////// // Java Stuff //////////////////////////////////////////////////////////////////////////////// -#ifdef JAVA +#if defined(JAVA) && !defined(OJI) void PR_CALLBACK FE_DisplayNoJavaIcon(MWContext *pContext, LO_JavaAppStruct *java_struct) @@ -4323,7 +4333,7 @@ FE_FreeJavaWindow(MWContext *context, struct LJAppletData *appletData, void CWinCX::DisplayJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *java_struct) { -#ifdef JAVA +#if defined(JAVA) && !defined(OJI) LJ_DisplayJavaApp(pContext, java_struct, FE_DisplayNoJavaIcon, FE_GetFullWindowSize, @@ -4337,14 +4347,14 @@ void CWinCX::DisplayJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct void CWinCX::HideJavaAppElement(MWContext *pContext, LJAppletData * session_data) { -#ifdef JAVA +#if defined(JAVA) && !defined(OJI) LJ_HideJavaAppElement(pContext, session_data, FE_SaveJavaWindow); #endif /* JAVA */ } void CWinCX::FreeJavaAppElement(MWContext *pContext, LJAppletData *ad) { -#ifdef JAVA +#if defined(JAVA) && !defined(OJI) LJ_FreeJavaAppElement(pContext, ad, FE_SaveJavaWindow, FE_FreeJavaWindow); @@ -4354,7 +4364,7 @@ void CWinCX::FreeJavaAppElement(MWContext *pContext, LJAppletData *ad) void CWinCX::GetJavaAppSize(MWContext *pContext, LO_JavaAppStruct *java_struct, NET_ReloadMethod reloadMethod) { -#ifdef JAVA +#if defined(JAVA) && !defined(OJI) LJ_GetJavaAppSize(pContext, java_struct, reloadMethod); #else // jevering: should this be inside ifdef JAVA? @@ -4364,13 +4374,15 @@ void CWinCX::GetJavaAppSize(MWContext *pContext, LO_JavaAppStruct *java_struct, #endif /* ! JAVA */ } -//////////////////////////////////////////////////////////////////////////////// -// End of Java Stuff -//////////////////////////////////////////////////////////////////////////////// - +#ifdef TRANSPARENT_APPLET void CWinCX::HandleClippingView(MWContext *pContext, LJAppletData *appletD, int x, int y, int width, int height) { } +#endif + +//////////////////////////////////////////////////////////////////////////////// +// End of Java Stuff +//////////////////////////////////////////////////////////////////////////////// void CWinCX::LayoutNewDocument(MWContext *pContext, URL_Struct *pURL, int32 *pWidth, int32 *pHeight, int32 *pmWidth, int32 *pmHeight) { diff --git a/mozilla/cmd/winfe/cxwin.h b/mozilla/cmd/winfe/cxwin.h index 0f0b10ed7ac..001f08993b2 100644 --- a/mozilla/cmd/winfe/cxwin.h +++ b/mozilla/cmd/winfe/cxwin.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- 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 @@ -444,8 +444,10 @@ public: virtual void RestoreEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp); virtual void DestroyEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp); virtual void DisplayJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *java_struct); - virtual void HandleClippingView(MWContext *pContext, LJAppletData *appletD, int x, int y, int width, int height); - virtual void HideJavaAppElement(MWContext *pContext, LJAppletData * session_data); +#ifdef TRANSPARENT_APPLET + virtual void HandleClippingView(MWContext *pContext, LJAppletData *appletD, int x, int y, int width, int height); +#endif + virtual void HideJavaAppElement(MWContext *pContext, LJAppletData * session_data); virtual void SetDocDimension(MWContext *pContext, int iLocation, int32 lWidth, int32 lLength); virtual void SetDocPosition(MWContext *pContext, int iLocation, int32 lX, int32 lY); virtual void FreeJavaAppElement(MWContext *pContext, LJAppletData *appletD); diff --git a/mozilla/cmd/winfe/feorphan.cpp b/mozilla/cmd/winfe/feorphan.cpp index 9044bb443f3..6e81c04b831 100644 --- a/mozilla/cmd/winfe/feorphan.cpp +++ b/mozilla/cmd/winfe/feorphan.cpp @@ -52,7 +52,7 @@ #endif #endif -#if defined(JAVA) || defined(MOCHA) +#if defined(OJI) || defined(JAVA) || defined(MOCHA) #ifndef XP_PC #define XP_PC @@ -72,17 +72,24 @@ #endif #include "nspr.h" +#include "plevent.h" +#endif /* OJI || JAVA || MOCHA */ + +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) #include "java.h" -#endif /* JAVA || MOCHA */ +#endif #if defined(XP_PC) && !defined(_WIN32) -#ifdef JAVA +#if defined(JAVA) || defined(OJI) extern "C" PR_PUBLIC_API(void) SuspendAllJavaThreads(void); #endif #endif // Shared event queue used to pass messages between the java threads and // the main navigator thread... + extern "C" { PREventQueue *mozilla_event_queue; PRThread *mozilla_thread; @@ -623,31 +630,42 @@ static struct PRMethodCallbackStr DLLCallbacks = { #endif /* NSPR20 */ #endif /* XP_WIN16 */ -#if defined(JAVA) || defined(MOCHA) +#if defined(OJI) || defined(JAVA) || defined(MOCHA) #ifndef NSPR20 // Initialize the NSPR library PR_Init( "mozilla", MOZILLA_THREAD_PRIORITY, 1, stackBase); mozilla_thread = PR_CurrentThread(); #else - PR_STDIO_INIT() + PR_STDIO_INIT() mozilla_thread = PR_CurrentThread(); PR_SetThreadGCAble(); PR_SetThreadPriority(mozilla_thread, MOZILLA_THREAD_PRIORITY); PL_InitializeEventsLib("mozilla"); #endif -#endif /* JAVA || MOCHA */ +#endif /* OJI || JAVA || MOCHA */ } BOOL fe_ShutdownJava() { BOOL bRetval = TRUE; -#ifdef JAVA +#if defined(OJI) + + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr == NULL) + return FALSE; + bRetval = (jvmMgr->ShutdownJVM() == JVMStatus_Enabled); + // XXX suspend all java threads + jvmMgr->Release(); + +#elif defined(JAVA) + bRetval = (LJ_ShutdownJava() == LJJavaStatus_Enabled); #if defined(XP_PC) && !defined(_WIN32) SuspendAllJavaThreads(); #endif + #endif return(bRetval); diff --git a/mozilla/cmd/winfe/feutil.cpp b/mozilla/cmd/winfe/feutil.cpp index 284020301c4..f4939177b82 100755 --- a/mozilla/cmd/winfe/feutil.cpp +++ b/mozilla/cmd/winfe/feutil.cpp @@ -28,9 +28,14 @@ #include "toolbar2.h" #include "VerReg.h" #include "libmocha.h" -#include "java.h" #include "ngdwtrst.h" +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) +#include "java.h" +#endif + extern "C" { #include "xpgetstr.h" extern int XP_ALERT_NETCASTER_NO_JS; @@ -1776,9 +1781,21 @@ void FEU_OpenNetcaster(void) if (regErr == REGERR_OK) { - + BOOL javaEnabled = FALSE; +#if defined(OJI) + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr) { + NPIJVMPlugin* jvm = jvmMgr->GetJVM(); + if (jvm) { + javaEnabled = jvm->GetJVMEnabled(); + } + jvmMgr->Release(); + } +#elif defined(JAVA) + javaEnabled = LJ_GetJavaEnabled(); +#endif // Now check to see if Java and JS are enabled - if (!LM_GetMochaEnabled() || !LJ_GetJavaEnabled()) { + if (!LM_GetMochaEnabled() || !javaEnabled) { MessageBox(NULL, XP_GetString(XP_ALERT_NETCASTER_NO_JS), szLoadString(AFX_IDS_APP_TITLE), MB_OK | MB_ICONEXCLAMATION); return; } diff --git a/mozilla/cmd/winfe/genframe.cpp b/mozilla/cmd/winfe/genframe.cpp index 60c81659d9c..0eb5a748ff1 100644 --- a/mozilla/cmd/winfe/genframe.cpp +++ b/mozilla/cmd/winfe/genframe.cpp @@ -45,7 +45,9 @@ #include "intelli.h" #endif -#ifdef JAVA +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) #include "java.h" #endif @@ -756,7 +758,7 @@ BEGIN_MESSAGE_MAP(CGenericFrame, CFrameWnd) ON_COMMAND(ID_OPEN_NEWS_WINDOW, OnOpenNewsWindow) ON_COMMAND(ID_WINDOW_BOOKMARKWINDOW, OnShowBookmarkWindow) ON_COMMAND(ID_WINDOW_ADDRESSBOOK, OnShowAddressBookWindow) -#ifdef JAVA +#if defined(OJI) || defined(JAVA) ON_COMMAND(ID_OPTIONS_SHOWJAVACONSOLE, OnToggleJavaConsole) ON_UPDATE_COMMAND_UI(ID_OPTIONS_SHOWJAVACONSOLE, OnUpdateJavaConsole) #endif @@ -2196,25 +2198,57 @@ void CGenericFrame::OnShowBookmarkWindow() } /////////////////////////////////////////////////////////////////////////////// -#ifdef JAVA + +#if defined(OJI) || defined(JAVA) void CGenericFrame::OnToggleJavaConsole() { +#ifdef OJI + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr == NULL) + return; + NPIJVMPlugin* jvm = jvmMgr->GetJVM(); + if (jvm) { + if (jvm->IsConsoleVisible()) { + jvm->HideConsole(); + } else { + jvm->ShowConsole(); + } + } + jvmMgr->Release(); +#else if( LJ_IsConsoleShowing() ) { LJ_HideConsole(); } else { LJ_ShowConsole(); } +#endif } void CGenericFrame::OnUpdateJavaConsole(CCmdUI* pCmdUI) { +#ifdef OJI + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr == NULL) { + pCmdUI->Enable(FALSE); + } + NPIJVMPlugin* jvm = jvmMgr->GetJVM(); + if (jvm) { + if (jvm->GetJVMStatus() != JVMStatus_Failed) { + pCmdUI->SetCheck(jvm->IsConsoleVisible()); + } else { + pCmdUI->Enable(FALSE); + } + } + jvmMgr->Release(); +#else if (LJJavaStatus_Failed != LJ_GetJavaStatus()) { pCmdUI->SetCheck( LJ_IsConsoleShowing() ); } else { pCmdUI->Enable(FALSE); } +#endif } -#endif /* JAVA */ +#endif /* OJI || JAVA */ void CGenericFrame::OnTaskbar() { diff --git a/mozilla/cmd/winfe/genframe.h b/mozilla/cmd/winfe/genframe.h index 53ef8b69a99..692678a2e3d 100644 --- a/mozilla/cmd/winfe/genframe.h +++ b/mozilla/cmd/winfe/genframe.h @@ -264,7 +264,7 @@ protected: afx_msg void OnFishCam(); afx_msg void OnShowBookmarkWindow(); afx_msg void OnShowAddressBookWindow(); -#ifdef JAVA +#if defined(JAVA) || defined(OJI) afx_msg void OnToggleJavaConsole(); afx_msg void OnUpdateJavaConsole(CCmdUI* pCmdUI); #endif diff --git a/mozilla/cmd/winfe/intlwin.cpp b/mozilla/cmd/winfe/intlwin.cpp index bd28797ce02..ccd24fee2c3 100755 --- a/mozilla/cmd/winfe/intlwin.cpp +++ b/mozilla/cmd/winfe/intlwin.cpp @@ -24,11 +24,16 @@ #include "cxsave.h" #include "np.h" -#include "java.h" #include "prlog.h" #include "prlink.h" #include "xpstrsw.h" +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) +#include "java.h" +#endif + #include "cuvfs.h" #include "intl_csi.h" #include "edt.h" diff --git a/mozilla/cmd/winfe/mainfrm.cpp b/mozilla/cmd/winfe/mainfrm.cpp index 33bfd6f3168..21b6667edb8 100644 --- a/mozilla/cmd/winfe/mainfrm.cpp +++ b/mozilla/cmd/winfe/mainfrm.cpp @@ -46,7 +46,9 @@ #include "np.h" #include "npapi.h" // for NPWindow -#ifdef JAVA +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) #include "java.h" #endif diff --git a/mozilla/cmd/winfe/mozilla.cpp b/mozilla/cmd/winfe/mozilla.cpp index 1842642a524..16cbc217e2e 100644 --- a/mozilla/cmd/winfe/mozilla.cpp +++ b/mozilla/cmd/winfe/mozilla.cpp @@ -28,7 +28,11 @@ void STARTUP_li(void); void SHUTDOWN_li(void); #endif/* MOZ_LOC_INDEP */ +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) #include "jri.h" +#endif #define XP_CPLUSPLUS // temporary hack - jsw //#include "secnav.h" @@ -87,7 +91,7 @@ BOOL bIsGold = FALSE; // Full Circle stuff - see http://www.fullsoft.com for more info #include "fullsoft.h" -#ifdef JAVA +#if defined(OJI) || defined(JAVA) // don't include java.h here because the Win16 compiler won't be able to handle this file void WFE_LJ_StartupJava(void); void WFE_LJ_StartDebugger(void); @@ -1358,7 +1362,7 @@ BOOL CNetscapeApp::InitInstance() STARTUP_np(); // if PE mode, start up java too! -#ifdef JAVA +#if defined(OJI) || defined(JAVA) if (m_bAccountSetupStartupJava) { // rhp - Added flags for MAPI startup... @@ -1382,24 +1386,30 @@ BOOL CNetscapeApp::InitInstance() // only show splash if not embedded m_splash.NavDoneIniting(); } - -#ifdef JAVA +#if defined(OJI) || defined(JAVA) // if PE mode, check if java environment is valid if (m_bAccountSetupStartupJava) { - JRIEnv * ee = JRI_GetCurrentEnv(); - - if (ee == NULL) { - - CString szJavaStartupErr = "You are starting up an application that needs java.\nPlease turn on java in your navigator's preference and try again."; - AfxMessageBox(szJavaStartupErr, MB_OK); - - m_bAccountSetupStartupJava = FALSE; - - return FALSE; - } - - m_bAccountSetupStartupJava = FALSE; +#ifdef OJI + JRIEnv* ee = NULL; + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr) { + NPIJVMPlugin* jvm = jvmMgr->GetJVM(); + if (jvm) { + ee = jvm->EnsureExecEnv(); + } + jvmMgr->Release(); + } +#else + JRIEnv * ee = JRI_GetCurrentEnv(); +#endif + if (ee == NULL) { + CString szJavaStartupErr = "You are starting up an application that needs java.\nPlease turn on java in your navigator's preference and try again."; + AfxMessageBox(szJavaStartupErr, MB_OK); + m_bAccountSetupStartupJava = FALSE; + return FALSE; + } + m_bAccountSetupStartupJava = FALSE; } #endif // Its now safe to create the frame objects and start this whole thang @@ -1749,7 +1759,7 @@ BOOL CNetscapeApp::InitInstance() #endif /* MOZ_MAIL_NEWS */ -#ifdef JAVA +#if defined(OJI) || defined(JAVA) case STARTUP_JAVA_DEBUG_AGENT: WFE_LJ_StartDebugger(); // stub call because java.h can't be included here break; @@ -2084,7 +2094,7 @@ int CNetscapeApp::ExitInstance() // Free all resources allocated by NSPR... // #if !defined(_WIN32) -#if defined(JAVA) || defined(MOCHA) +#if defined(OJI) || defined(JAVA) || defined(MOCHA) #if defined(NSPR20) /* * XXX SHould PR_CLeanup be called here? @@ -2097,7 +2107,7 @@ int CNetscapeApp::ExitInstance() PR_Shutdown(); #endif #endif -#endif /* JAVA || MOCHA */ +#endif /* OJI || JAVA || MOCHA */ if (theApp.m_bNetworkProfile) { // if we have a network profile command-line we are assuming delete on exit (for now) diff --git a/mozilla/cmd/winfe/nsapp.cpp b/mozilla/cmd/winfe/nsapp.cpp index 9a0b23527eb..770d579165e 100644 --- a/mozilla/cmd/winfe/nsapp.cpp +++ b/mozilla/cmd/winfe/nsapp.cpp @@ -408,7 +408,7 @@ void CNetscapeApp::parseCommandLine(char * commandLine) if (IsRuntimeSwitch("-parse_telnet")) m_bParseTelnetURLs = TRUE; -#ifdef JAVA +#if defined(OJI) || defined(JAVA) if(IsRuntimeSwitch("-javadebug",TRUE)) { m_bCreateJavaDebugAgent = TRUE; } @@ -1594,14 +1594,14 @@ int CNetscapeApp::Run() } #ifdef XP_WIN16 -#if defined(JAVA) || defined(MOCHA) +#if defined(OJI) || defined(JAVA) || defined(MOCHA) /* ** On Win16 the only way for another thread to run is to explicitly ** yield... */ extern void fe_yield(void); fe_yield(); -#endif /* JAVA */ +#endif /* OJI || JAVA || MOCHA */ #endif /* XP_WIN16 */ do { @@ -1721,14 +1721,14 @@ BOOL CNetscapeApp::OnIdle(LONG lCount) // already sends a WM_IDLEUPDATECMDUI to each of the frames #ifdef XP_WIN16 -#if defined(JAVA) || defined(MOCHA) +#if defined(OJI) || defined(JAVA) || defined(MOCHA) /* ** On Win16 the only way for another thread to run is to explicitly ** yield... */ extern void fe_yield(void); fe_yield(); -#endif /* JAVA */ +#endif /* OJI || JAVA || MOCHA */ // Update the UI of the frames. if(lCount == 0) { diff --git a/mozilla/cmd/winfe/res/editor.rc2 b/mozilla/cmd/winfe/res/editor.rc2 index 85214de09d4..8fa6f09b763 100644 --- a/mozilla/cmd/winfe/res/editor.rc2 +++ b/mozilla/cmd/winfe/res/editor.rc2 @@ -563,7 +563,7 @@ BEGIN MENUITEM SEPARATOR END MENUITEM "&History\tCtrl+H", ID_GO_HISTORY -#ifdef JAVA +#if defined(JAVA) || defined(OJI) MENUITEM "&Java Console", ID_OPTIONS_SHOWJAVACONSOLE #endif MENUITEM "&Security Info\tCtrl+Shift+I", ID_SECURITY diff --git a/mozilla/cmd/winfe/res/mozilla.rc2 b/mozilla/cmd/winfe/res/mozilla.rc2 index 2244eaf00e7..9af68e61d37 100644 --- a/mozilla/cmd/winfe/res/mozilla.rc2 +++ b/mozilla/cmd/winfe/res/mozilla.rc2 @@ -659,7 +659,7 @@ BEGIN MENUITEM SEPARATOR END MENUITEM "&History\tCtrl+H", ID_GO_HISTORY -#ifdef JAVA +#if defined(JAVA) || defined(OJI) MENUITEM "&Java Console", ID_OPTIONS_SHOWJAVACONSOLE #endif MENUITEM "&Security Info\tCtrl+Shift+I", ID_SECURITY @@ -974,7 +974,7 @@ BEGIN END END MENUITEM "&History", ID_GO_HISTORY -#ifdef JAVA +#if defined(JAVA) || defined(OJI) MENUITEM "&Java Console", ID_OPTIONS_SHOWJAVACONSOLE #endif #ifdef MOZ_TASKBAR @@ -1307,7 +1307,7 @@ symlogo RCDATA #include "_gen\symlogo.rc" tdlogo RCDATA #include "_gen\tdlogo.rc" -#ifdef JAVA +#if defined(JAVA) || defined(OJI) javalogo RCDATA #include "_gen\javalogo.rc" #endif diff --git a/mozilla/cmd/winfe/woohoo.cpp b/mozilla/cmd/winfe/woohoo.cpp index a4889d17b9e..2e72cd4e552 100644 --- a/mozilla/cmd/winfe/woohoo.cpp +++ b/mozilla/cmd/winfe/woohoo.cpp @@ -27,10 +27,14 @@ #include "template.h" #include "mainfrm.h" #include "woohoo.h" -#ifdef JAVA + +#if defined(OJI) +#include "jvmmgr.h" +#elif defined(JAVA) #include "java.h" #endif +void WFE_LJ_StartDebugger(void); // // Parse the command line for component launch arguments @@ -194,7 +198,7 @@ BOOL CNetscapeApp::ExistComponentArguments(char * pszCommandLine) } else if (strcasestr(pszCommandLine,"-PROFILE_MANAGER" )){ m_bProfileManager = TRUE; -#ifdef JAVA +#if defined(OJI) || defined(JAVA) } else if (strcasestr(pszCommandLine,"-javadebug" )){ m_bCreateJavaDebugAgent = TRUE; #endif @@ -252,7 +256,7 @@ BOOL CNetscapeApp::BuildCmdLineList(const char* pszRemoveString, CCmdParse &cmdP if (!pFirst) { //just in case no switch was given - pFirst = strchr(pszCmdLine,'"'); + pFirst = strchr(pszCmdLine,'"'); } else { //jump over the flag since we don't want it on the list @@ -484,13 +488,13 @@ void CNetscapeApp::LaunchComponentWindow(int iStartupMode, char *pszCmdLine) //we do this outside the switch break; -#ifdef JAVA +#if defined(OJI) || defined(JAVA) case STARTUP_NETCASTER: FEU_OpenNetcaster() ; break; case STARTUP_JAVA_DEBUG_AGENT: - LJ_StartDebugger(LJDebugPort_SharedMemory); + WFE_LJ_StartDebugger(); break; case STARTUP_JAVA: @@ -1152,15 +1156,36 @@ inline UINT CMapStringToObNoCase::HashKey(LPCTSTR key) const void WFE_LJ_StartupJava(void) { -#ifdef JAVA - LJ_StartupJava(); +#ifdef OJI + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr) { + jvmMgr->StartupJVM(); + jvmMgr->Release(); + } +#else + LJ_StartupJava(); #endif } void WFE_LJ_StartDebugger(void) { -#ifdef JAVA - LJ_StartDebugger(LJDebugPort_SharedMemory); +#ifdef OJI + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr) { + NPIJVMPlugin* jvm = jvmMgr->GetJVM(); + if (jvm) { + static NS_DEFINE_IID(kISymantecDebuggerIID, NP_ISYMANTECDEBUGGER_IID); + NPISymantecDebugger* debugger; + if (jvm->QueryInterface(kISymantecDebuggerIID, (void**)&debugger) == NS_OK) { + // XXX should we make sure the vm is started first? + debugger->StartDebugger(NPSymantecDebugPort_SharedMemory); + debugger->Release(); + } + } + jvmMgr->Release(); + } +#else + LJ_StartDebugger(LJDebugPort_SharedMemory); #endif } diff --git a/mozilla/config/config.mak b/mozilla/config/config.mak index 2c165262109..d3a54b795f7 100644 --- a/mozilla/config/config.mak +++ b/mozilla/config/config.mak @@ -119,9 +119,17 @@ INCS=$(INCS) -I$(DEPTH)\lib\liblayer\include LCFLAGS=$(LCFLAGS) -DSTAND_ALONE_JAVA !endif - !if defined(MOZ_JAVA) MOZ_JAVA_FLAG=-DJAVA +!if defined(MOZ_OJI) +!error You can't define both MOZ_JAVA and MOZ_OJI anymore. +!endif +JAVA_OR_OJI=1 +!endif + +!if defined(MOZ_OJI) +LCFLAGS=$(LCFLAGS) -DOJI +JAVA_OR_OJI=1 !endif # Perhaps we should add MOZ_LITENESS_FLAGS to 16 bit build @@ -291,6 +299,7 @@ MOD_JDB=jdb$(MOZ_BITS)$(VERSION_NUMBER) MOD_ZIP=zip$(MOZ_BITS)$(VERSION_NUMBER) MOD_ZPW=zpw$(MOZ_BITS)$(VERSION_NUMBER) MOD_CON=con$(MOZ_BITS)$(VERSION_NUMBER) +MOD_NPJ=npj$(MOZ_BITS)$(VERSION_NUMBER) JRTDLL=$(MOD_JRT).$(DLL_SUFFIX) MMDLL =$(MOD_MM).$(DLL_SUFFIX) @@ -306,6 +315,7 @@ JDBDLL=$(MOD_JDB).$(DLL_SUFFIX) ZIPDLL=$(MOD_ZIP).$(DLL_SUFFIX) ZPWDLL=$(MOD_ZPW).$(DLL_SUFFIX) CONDLL=$(MOD_CON).$(DLL_SUFFIX) +NPJDLL=$(MOD_NPJ).$(DLL_SUFFIX) ZIPLIB=$(DIST)\lib\$(MOD_ZIP).$(LIB_SUFFIX) AWTLIB=$(DIST)\lib\$(MOD_AWT).$(LIB_SUFFIX) diff --git a/mozilla/config/config.mk b/mozilla/config/config.mk index 1e8e954f5b4..5dcafed4755 100644 --- a/mozilla/config/config.mk +++ b/mozilla/config/config.mk @@ -441,6 +441,15 @@ endif ifdef MOZ_JAVA DEFINES += -DJAVA +ifdef MOZ_OJI +error You can't define both MOZ_JAVA and MOZ_OJI anymore. +endif +JAVA_OR_OJI = 1 +endif + +ifdef MOZ_OJI +DEFINES += -DOJI +JAVA_OR_OJI = 1 endif ifndef NO_MOCHA diff --git a/mozilla/config/java.inc b/mozilla/config/java.inc index 0d6a0149b49..58dda8412a9 100644 --- a/mozilla/config/java.inc +++ b/mozilla/config/java.inc @@ -66,7 +66,7 @@ $(MAC_JAVA_HEADERS_DIR): !endif !ifdef JDK_GEN -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI #//------------------------------------------------------------------------ #// #// Rule to generate Java header files using javah. @@ -92,12 +92,12 @@ $(JDK_GEN)::display_java_header_msg_mac $(MAC_JAVA_HEADERS_DIR) display_java_header_msg_mac: echo +++ make: Generating Macintosh JDK header files +++ !endif -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI !endif !ifdef JDK_GEN -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI #//------------------------------------------------------------------------ #// #// Rules to generate Java stub files using javah. @@ -120,11 +120,11 @@ display_java_stub_msg_mac: export:: $(JDK_GEN) -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI !endif !ifdef JAVA_LIBSTUB_FILES -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI #//------------------------------------------------------------------------ #// #// Rules to generate libstubs.c using javah. @@ -138,11 +138,11 @@ stubs$(MOZ_BITS).c::$(JAVA_LIBSTUB_FILES) echo +++ make: Generating stubs$(MOZ_BITS).c... $(JAVAH) -o stubs$(MOZ_BITS).c -stubs $** -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI !endif !ifdef JRI_GEN -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI #//------------------------------------------------------------------------ #// #// Rule to generate JRI header files using javah. @@ -168,11 +168,11 @@ $(JRI_GEN)::display_jri_header_msg_mac $(MAC_JAVA_HEADERS_DIR) display_jri_header_msg_mac: echo +++ make: Generating Macintosh java JRI header files +++ !endif -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI !endif !ifdef JRI_GEN -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI #//------------------------------------------------------------------------ #// #// Rules to generate JRI stub files using javah. @@ -195,7 +195,7 @@ display_jri_stub_msg_mac: export:: $(JRI_GEN) -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI !endif !endif # CONFIG_JAVA_INC diff --git a/mozilla/config/obj.inc b/mozilla/config/obj.inc index a1fe7eb13b1..580179d5bb0 100644 --- a/mozilla/config/obj.inc +++ b/mozilla/config/obj.inc @@ -97,7 +97,7 @@ CONFIG_OBJ_INC=1 -Fd$(PDBFILE) -Fo.\$(OBJDIR)\ $(CURDIR)$(*B).cpp -<< +< #// JSRCS .java files to be compiled (.java extension included) #// #//------------------------------------------------------------------------ -!if defined(MOZ_JAVA) +!if defined(JAVA_OR_OJI) !if defined(JSRCS) JSRCS_DEPS = $(JAVA_DESTPATH) $(JAVA_DESTPATH)\$(PACKAGE) $(TMPDIR) @@ -525,7 +525,7 @@ export:: $(JMCSRCDIR) clobber:: -for %f in ($(JMC_EXPORT)) do $(RM) $(JMCSRCDIR:/=\)\%f.class !endif # JMC_EXPORT -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI #//------------------------------------------------------------------------ #// @@ -535,7 +535,7 @@ clobber:: #// Generated .h and .c files go to JMC_GEN_DIR #// #//------------------------------------------------------------------------ -!if defined(MOZ_JAVA) +!if defined(JAVA_OR_OJI) !if defined(JMC_GEN) export:: $(JMC_HEADERS) @@ -559,7 +559,7 @@ export:: $(JMC_STUBS) $(OBJDIR) $(JMC_OBJS) !endif # CCJMC !endif # JMC_GEN -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI #//------------------------------------------------------------------------ @@ -580,7 +580,7 @@ clobber:: #//------------------------------------------------------------------------ #// These rules must follow all lines that define the macros they use #//------------------------------------------------------------------------ -!ifdef MOZ_JAVA +!if defined(JAVA_OR_OJI) GARBAGE = $(JMC_GEN_DIR) $(JMC_HEADERS) $(JMC_STUBS) \ $(JDK_STUB_DIR) $(JRI_GEN_DIR) $(JDK_GEN_DIR) !endif diff --git a/mozilla/config/rules.mk b/mozilla/config/rules.mk index 3b7e0b0d7cd..12ee256272d 100644 --- a/mozilla/config/rules.mk +++ b/mozilla/config/rules.mk @@ -155,7 +155,7 @@ ifndef PACKAGE PACKAGE = . endif -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \ $(NOSUCHFILE) $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \ $(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) $(JMC_STUBS) \ @@ -170,13 +170,13 @@ ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \ _gen _stubs $(wildcard gts_tmp_*) endif -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI ifdef JDIRS ALL_TRASH += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS)) endif endif -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI JMC_SUBDIR = _jmc else JMC_SUBDIR = $(LOCAL_JMC_SUBDIR) @@ -435,7 +435,7 @@ $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) $(JMCSRCDIR):: ### JSRCS -- for compiling java files ifneq ($(JSRCS),) -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) list=`$(PERL) $(DEPTH)/config/outofdate.pl $(PERLARG) \ -d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS)`; \ @@ -460,7 +460,7 @@ endif # some builds to run out of memory # ifdef JDIRS -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) @for d in $(JDIRS); do \ if test -d $$d; then \ @@ -488,7 +488,7 @@ endif # Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory # ifneq ($(JDK_GEN),) -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI ifdef NSBUILDROOT INCLUDES += -I$(JDK_GEN_DIR) -I$(XPDIST) else @@ -520,7 +520,7 @@ ifdef MOZ_GENMAC @echo Generating/Updating JDK stubs for the Mac $(JAVAH) -mac -stubs -d $(DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES) endif -endif # MOZ_JAVA +endif # JAVA_OR_OJI endif # @@ -529,7 +529,7 @@ endif # Generate JRI Headers and Stubs into the 'jri' directory # ifneq ($(JRI_GEN),) -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI ifdef NSBUILDROOT INCLUDES += -I$(JRI_GEN_DIR) -I$(XPDIST) else @@ -561,14 +561,14 @@ ifdef MOZ_GENMAC @echo Generating/Updating JRI stubs for the Mac $(JAVAH) -jri -mac -stubs -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES) endif -endif # MOZ_JAVA +endif # JAVA_OR_OJI endif # # JMC_EXPORT -- for declaring which java classes are to be exported for jmc # ifneq ($(JMC_EXPORT),) -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI JMC_EXPORT_PATHS = $(subst .,/,$(JMC_EXPORT)) JMC_EXPORT_FILES = $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS)) @@ -579,7 +579,7 @@ JMC_EXPORT_FILES = $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT # export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR) $(NSINSTALL) -t -m 444 $(JMC_EXPORT_FILES) $(JMCSRCDIR) -endif # MOZ_JAVA +endif # JAVA_OR_OJI endif # @@ -589,7 +589,7 @@ endif # ifneq ($(JMC_GEN),) INCLUDES += -I$(JMC_GEN_DIR) -I. -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI JMC_HEADERS = $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN)) JMC_STUBS = $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN)) JMC_OBJS = $(patsubst %,$(OBJDIR)/%.o,$(JMC_GEN)) @@ -609,7 +609,7 @@ else endif export:: $(JMC_HEADERS) $(JMC_STUBS) -endif # MOZ_JAVA +endif # JAVA_OR_OJI endif # diff --git a/mozilla/include/lo_ele.h b/mozilla/include/lo_ele.h index 9080e20e957..e74ecc7c6df 100644 --- a/mozilla/include/lo_ele.h +++ b/mozilla/include/lo_ele.h @@ -977,6 +977,7 @@ struct LO_EmbedStruct_struct { int32 percent_width; /* needed for relayout. */ int32 percent_height; /* needed for relayout. */ + PA_Block base_url; }; #define LO_JAVA_SELECTOR_APPLET 0 diff --git a/mozilla/include/mk_cx_fn.h b/mozilla/include/mk_cx_fn.h index 724310e9429..47d67d2f806 100644 --- a/mozilla/include/mk_cx_fn.h +++ b/mozilla/include/mk_cx_fn.h @@ -138,9 +138,11 @@ FE_DEFINE(GetTextFrame, void, (MWContext *, LO_TextStruct *, int32, int32, XP_Re FE_DEFINE(GetDefaultBackgroundColor, void, (MWContext* context, LO_Color* color)) #endif #endif +#ifdef TRANSPARENT_APPLET /* these functions are to allow dealyed native window applet creation and transparent applet */ FE_DEFINE(HandleClippingView, void, (MWContext *pContext, struct LJAppletData *appletD, int x, int y, int width, int height)) FE_DEFINE(DrawJavaApp, void, (MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava)) +#endif #undef FE_DEFINE #undef MAKE_FE_FUNCS_PREFIX diff --git a/mozilla/include/np.h b/mozilla/include/np.h index 90c34f99475..99488d4062a 100644 --- a/mozilla/include/np.h +++ b/mozilla/include/np.h @@ -18,7 +18,7 @@ /* - * np.h $Revision: 3.1 $ + * np.h $Revision: 3.1.16.1 $ * 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. */ @@ -103,7 +103,7 @@ extern void NPL_SamePage(MWContext *context); extern void NPL_SameElement(LO_EmbedStruct *embed); extern void NPL_DeleteSessionData(MWContext* context, void* sessionData); extern XP_Bool NPL_HandleURL(MWContext *pContext, FO_Present_Types iFormatOut, URL_Struct *pURL, - Net_GetUrlExitFunc *pExitFunc); + Net_GetUrlExitFunc *pExitFunc); #ifndef XP_MAC extern void NPL_DisplayPluginsAsHTML(FO_Present_Types format_out, URL_Struct *urls, MWContext *cx); #endif @@ -125,6 +125,7 @@ extern NPError NPL_RegisterAppletType(NPMIMEType type); #endif /* ANTHRAX */ PR_EXTERN(void) NPL_SetPluginWindow(void *data); +PR_EXTERN(struct NPIPlugin*) NPL_LoadPluginByType(const char* typeAttribute); XP_END_PROTOS diff --git a/mozilla/include/npapi.h b/mozilla/include/npapi.h index 289346cb167..a206adc60be 100644 --- a/mozilla/include/npapi.h +++ b/mozilla/include/npapi.h @@ -18,7 +18,7 @@ /* - * npapi.h $Revision: 3.1 $ + * npapi.h $Revision: 3.1.16.1 $ * Netscape client plug-in API spec */ @@ -274,7 +274,8 @@ typedef enum { NPPVpluginWindowBool, NPPVpluginTransparentBool, NPPVjavaClass, - NPPVpluginWindowSize + NPPVpluginWindowSize, + NPPVpluginTimerInterval } NPPVariable; /* diff --git a/mozilla/js/jsj/Makefile b/mozilla/js/jsj/Makefile index 1cdc3c5ee2e..35c82cdefc5 100644 --- a/mozilla/js/jsj/Makefile +++ b/mozilla/js/jsj/Makefile @@ -19,7 +19,9 @@ DEPTH = ../.. -ifdef MOZ_JAVA +include $(DEPTH)/config/config.mk + +ifdef JAVA_OR_OJI DIRS = classes endif @@ -36,7 +38,7 @@ CSRCS = \ JRI_GEN = netscape.javascript.JSObject netscape.javascript.JSException -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI CSRCS += jsjsa.c \ stubs.c \ jsj_nodl.c \ @@ -66,7 +68,7 @@ jsj_nodl.c: $(OBJDIR)/stubs.o Makefile $(DEPTH)/config/nodl.pl `nm -Bn $(OBJDIR)/stubs.o | egrep Java_.*_stub | awk '{print $$3;}'` > $@ endif -ifdef MOZ_JAVA +ifdef JAVA_OR_OJI $(OBJDIR)/stubs.o: \ $(JRI_GEN_DIR)/netscape_javascript_JSObject.c \ $(JRI_GEN_DIR)/netscape_javascript_JSException.c \ diff --git a/mozilla/js/jsj/jsjava.h b/mozilla/js/jsj/jsjava.h index 9445e1c63e6..6f6016bfc45 100644 --- a/mozilla/js/jsj/jsjava.h +++ b/mozilla/js/jsj/jsjava.h @@ -70,7 +70,7 @@ typedef struct { PR_EXTERN(JSBool) JSJ_Init(JSJCallbacks *callbacks); -#ifdef JAVA +#if defined(JAVA) || defined(OJI) /* this is called by JSObject.initClass to initialize the default * glue if jsjava has been loaded into java.exe as a DLL. it does * nothing if the client or server has already initialized us */ @@ -165,6 +165,6 @@ js_GetJSPrincipalsFromJavaCaller(JSContext *cx, int callerDepth); PR_EXTERN(void) jsj_ClearSavedErrors(JSContext *cx); -#endif /* defined(JAVA) */ +#endif /* defined(JAVA) || defined(OJI) */ #endif /* _jsjava_h_ */ diff --git a/mozilla/js/jsj/makefile.win b/mozilla/js/jsj/makefile.win index 148cd2bf8bc..7063cc1c8bf 100644 --- a/mozilla/js/jsj/makefile.win +++ b/mozilla/js/jsj/makefile.win @@ -30,7 +30,9 @@ IGNORE_MANIFEST=1 #//------------------------------------------------------------------------ DEPTH= ..\.. -!ifdef MOZ_JAVA +include <$(DEPTH)/config/config.mak> + +!ifdef JAVA_OR_OJI DIRS = classes !endif @@ -51,7 +53,7 @@ MAKE_OBJ_TYPE = DLL DEFFILE = $(DLLNAME).def !endif -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI LLIBS=$(LIBNSPR) $(DIST)\lib\jrt$(MOZ_BITS)$(VERSION_NUMBER).lib \ $(DIST)\lib\js$(MOZ_BITS)$(VERSION_NUMBER).lib !else @@ -63,7 +65,7 @@ LLIBS=$(LIBNSPR) $(DIST)\lib\js$(MOZ_BITS)$(VERSION_NUMBER).lib #// Define the files necessary to build the target (ie. OBJS) #// #//------------------------------------------------------------------------ -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI OBJS= \ .\$(OBJDIR)\jsStubs.obj \ .\$(OBJDIR)\jsjava.obj \ @@ -78,7 +80,7 @@ OBJS= \ .\$(OBJDIR)\jsjava.obj \ .\$(OBJDIR)\jsStubs.obj \ $(NULL) -!endif # MOZ_JAVA +!endif # JAVA_OR_OJI # #//------------------------------------------------------------------------ @@ -103,7 +105,7 @@ JRI_GEN= \ $(NULL) MODULE = java -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI EXPORTS = \ $(JRI_GEN_DIR)/netscape_javascript_JSObject.h \ $(JRI_GEN_DIR)/netscape_javascript_JSException.h \ @@ -141,7 +143,7 @@ export:: $(DLL) INSTALL_FILES clobber:: $(RM_R) _jri -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI .\$(OBJDIR)\stubs.obj: \ $(JRI_GEN_DIR)\netscape_javascript_JSObject.c \ $(JRI_GEN_DIR)\netscape_javascript_JSException.c \ diff --git a/mozilla/lib/layout/layembed.c b/mozilla/lib/layout/layembed.c index a44a8d9f22e..23f94b15a57 100644 --- a/mozilla/lib/layout/layembed.c +++ b/mozilla/lib/layout/layembed.c @@ -392,6 +392,7 @@ lo_FormatEmbedInternal(MWContext *context, lo_DocState *state, PA_Tag *tag, embed->border_horiz_space = EMBED_DEF_HORIZONTAL_SPACE; embed->tag = tag; embed->ele_attrmask = 0; + embed->base_url = NULL; if (streamStarted) embed->ele_attrmask |= LO_ELE_STREAM_STARTED; @@ -454,6 +455,24 @@ lo_FormatEmbedInternal(MWContext *context, lo_DocState *state, PA_Tag *tag, } } + /* + * Save away the base of the document + */ + buff = PA_ALLOC(XP_STRLEN(state->top_state->base_url) + 1); + if (buff != NULL) + { + char *cp; + PA_LOCK(cp, char*, buff); + XP_STRCPY(cp, state->top_state->base_url); + PA_UNLOCK(buff); + embed->base_url = buff; + } + else + { + state->top_state->out_of_memory = TRUE; + return; + } + /* * Check for an align parameter */ diff --git a/mozilla/lib/layout/layform.c b/mozilla/lib/layout/layform.c index 03e44633043..b35f6a15e6d 100644 --- a/mozilla/lib/layout/layform.c +++ b/mozilla/lib/layout/layform.c @@ -22,7 +22,9 @@ #include "shist.h" #include "pa_parse.h" #include "layout.h" +#ifdef JAVA #include "java.h" +#endif #include "laylayer.h" #include "libevent.h" #include "libimg.h" /* Image Library public API. */ diff --git a/mozilla/lib/layout/layfree.c b/mozilla/lib/layout/layfree.c index 2ddc971d156..59b40bca7aa 100644 --- a/mozilla/lib/layout/layfree.c +++ b/mozilla/lib/layout/layfree.c @@ -21,7 +21,9 @@ #ifdef EDITOR #include "edt.h" #endif +#ifdef JAVA #include "java.h" +#endif #include "layers.h" #include "pa_parse.h" diff --git a/mozilla/lib/layout/layjava.c b/mozilla/lib/layout/layjava.c index c410a3ef948..3207348c70c 100644 --- a/mozilla/lib/layout/layjava.c +++ b/mozilla/lib/layout/layjava.c @@ -21,9 +21,12 @@ #include "pa_parse.h" #include "layout.h" #include "laylayer.h" +#ifdef JAVA #include "java.h" +#endif #include "laystyle.h" #include "layers.h" +#include "np.h" #define JAVA_DEF_DIM 50 #define JAVA_DEF_BORDER 0 @@ -36,6 +39,7 @@ static void lo_FormatJavaAppInternal(MWContext *context, PA_Tag *tag, LO_JavaAppStruct *java_app); +#if 0 // not used void LO_ClearJavaAppBlock(MWContext *context, LO_JavaAppStruct *java_app) { @@ -73,7 +77,7 @@ LO_ClearJavaAppBlock(MWContext *context, LO_JavaAppStruct *java_app) lo_FlushBlockage(context, state, main_doc_state); } } - +#endif void lo_FormatJavaObject(MWContext *context, lo_DocState *state, PA_Tag *tag, LO_JavaAppStruct *java_app) @@ -136,6 +140,7 @@ lo_FormatJavaObject(MWContext *context, lo_DocState *state, PA_Tag *tag, LO_Java lo_FormatJavaAppInternal(context, state, tag, java_app); } +#define JAVA_PLUGIN_MIMETYPE "application/x-java-vm" void lo_FormatJavaApp(MWContext *context, lo_DocState *state, PA_Tag *tag) @@ -1001,3 +1006,4 @@ lo_UpdateStateAfterJavaAppLayout(lo_DocState *state, /* Move layer to new position */ CL_MoveLayer(java_app->layer, x, y); } + diff --git a/mozilla/lib/layout/laylayer.c b/mozilla/lib/layout/laylayer.c index 18ccf744e40..b8f063ed0f1 100644 --- a/mozilla/lib/layout/laylayer.c +++ b/mozilla/lib/layout/laylayer.c @@ -2318,6 +2318,8 @@ lo_CreateEmbeddedObjectLayer(MWContext *context, * Java Applet layer code * **********************/ + +#ifdef TRANSPARENT_APPLET #ifdef JAVA #include "java.h" @@ -2386,7 +2388,8 @@ LO_SetJavaAppTransparent(LO_JavaAppStruct *javaData) CL_SetLayerBbox(layer, &bbox); } -#endif +#endif /* JAVA */ +#endif /* TRANSPARENT_APPLET */ /********************** * diff --git a/mozilla/lib/layout/laytags.c b/mozilla/lib/layout/laytags.c index 4c39620c03a..fce9d87f74e 100644 --- a/mozilla/lib/layout/laytags.c +++ b/mozilla/lib/layout/laytags.c @@ -22,13 +22,16 @@ #include "layout.h" #include "laylayer.h" #include "glhist.h" +#ifdef JAVA #include "java.h" +#endif #include "libi18n.h" #include "edt.h" #include "laystyle.h" #include "prefapi.h" #include "xp_ncent.h" #include "prefetch.h" +#include "np.h" /* style sheet tag stack and style struct */ #include "stystack.h" @@ -76,6 +79,11 @@ /* Added to encapsulate code that was previously in six different places in LO_LayoutTag()! */ static void lo_ProcessFontTag( lo_DocState *state, PA_Tag *tag, int32 fontSpecifier, int32 attrSpecifier ); +#ifdef OJI +#define JAVA_PLUGIN_MIMETYPE "application/x-java-vm" +static void lo_AddParam(PA_Tag* tag, char* aName, char* aValue); +#endif + /************************************* * Function: LO_ChangeFontSize * @@ -276,9 +284,15 @@ lo_FilterTag(MWContext *context, lo_DocState *state, PA_Tag *tag) * To determine if we're in a known object, we need to * look up the whole object stack for a known object at * any level. + * + * Also adding P_JAVA_APPLET to the list - support for applet redirect to obj tag */ if (top_state->object_stack != NULL && - tag->type != P_PARAM && tag->type != P_OBJECT) + tag->type != P_PARAM && tag->type != P_OBJECT +#ifdef OJI + && tag->type != P_JAVA_APPLET +#endif + ) { /* Check for a known object anywhere on the stack */ lo_ObjectStack* top = top_state->object_stack; @@ -4139,6 +4153,9 @@ lo_LayoutTag(MWContext *context, lo_DocState *state, PA_Tag *tag) { char *tptr; char *tptr2; +#ifdef OJI + char* javaPlugin; +#endif LO_TextAttr tmp_attr; StyleStruct *style_struct=NULL; XP_Bool has_ss_bottom_margin=FALSE; @@ -6679,7 +6696,44 @@ XP_TRACE(("lo_LayoutTag(%d)\n", tag->type)); * This is the NEW HTML-WG approved embedded JAVA * application. */ -#ifdef JAVA +#if defined(OJI) + case P_JAVA_APPLET: + javaPlugin = NPL_FindPluginEnabledForType(JAVA_PLUGIN_MIMETYPE); + + /* If there is a JVM installed as a plugin, redirect to the object tag */ + if(javaPlugin && !state->hide_content) + { + if(tag->is_end == FALSE) + { + PA_Block buff; + char* str; + + buff = lo_FetchParamValue(context, tag, PARAM_CODE); + if(buff) + { + PA_LOCK(str, char *, buff); + lo_AddParam(tag, "DATA", str); + lo_AddParam(tag, "TYPE", JAVA_PLUGIN_MIMETYPE); + + PA_UNLOCK(buff); + XP_FREE(buff); + + tag->type = P_OBJECT; + lo_ProcessObjectTag(context, state, tag, FALSE); + } + } + else + { + tag->type = P_OBJECT; + lo_ProcessObjectTag(context, state, tag, FALSE); + } + + XP_FREE(javaPlugin); + + } + break; + +#elif defined(JAVA) case P_JAVA_APPLET: /* * If the user has disabled Java, act like it we don't @@ -7379,3 +7433,32 @@ void lo_PostLayoutTag(MWContext * context, lo_DocState *state, PA_Tag *tag, XP_B } #endif /* PICS_SUPPORT */ } + +#ifdef OJI +static void lo_AddParam(PA_Tag* tag, char* aName, char* aValue) +{ + uint32 nameLen, valueLen, oldTagLen, newTagLen; + char* tagData; + + nameLen = XP_STRLEN(aName); + valueLen = XP_STRLEN(aValue); + oldTagLen = XP_STRLEN((char*)(tag->data)); + newTagLen = oldTagLen + nameLen + valueLen + 2; + + tag->data = XP_REALLOC(tag->data, newTagLen+1); + + /* Remove the '>' character */ + tagData = (char*)(tag->data); + tagData[oldTagLen-1] = 0; + + /* Add "aName=aValue" */ + XP_STRCAT(tagData, " "); + XP_STRCAT(tagData, aName); + XP_STRCAT(tagData, "="); + XP_STRCAT(tagData, aValue); + XP_STRCAT(tagData, ">"); + + tag->data_len = newTagLen; +} +#endif /* OJI */ + diff --git a/mozilla/lib/libmocha/et_mocha.c b/mozilla/lib/libmocha/et_mocha.c index 30cb879c7c1..8c7e703a47e 100644 --- a/mozilla/lib/libmocha/et_mocha.c +++ b/mozilla/lib/libmocha/et_mocha.c @@ -33,7 +33,9 @@ #endif #include "layout.h" /* XXX for lo_ContextToCell and lo_FormData */ #include "libimg.h" +#ifdef JAVA #include "java.h" +#endif #include "pa_tags.h" #include "css.h" #include "pa_parse.h" diff --git a/mozilla/lib/libmocha/lm_init.c b/mozilla/lib/libmocha/lm_init.c index 3905370be03..e90ce97d2e8 100644 --- a/mozilla/lib/libmocha/lm_init.c +++ b/mozilla/lib/libmocha/lm_init.c @@ -38,7 +38,9 @@ #include "jri.h" #include "jriext.h" +#ifdef JAVA #include "java.h" +#endif #include "prefapi.h" #include "libi18n.h" #include "intl_csi.h" diff --git a/mozilla/lib/libmocha/lm_nav.c b/mozilla/lib/libmocha/lm_nav.c index f3417a88226..62ead0b4981 100644 --- a/mozilla/lib/libmocha/lm_nav.c +++ b/mozilla/lib/libmocha/lm_nav.c @@ -22,7 +22,9 @@ */ #include "lm.h" #include "prmem.h" +#ifdef JAVA #include "java.h" +#endif #include "gui.h" #include "prefapi.h" #include "msgcom.h" diff --git a/mozilla/lib/libmocha/lm_taint.c b/mozilla/lib/libmocha/lm_taint.c index a864415b8b4..6daddc09549 100644 --- a/mozilla/lib/libmocha/lm_taint.c +++ b/mozilla/lib/libmocha/lm_taint.c @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- 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 @@ -35,7 +35,9 @@ #include "zig.h" #include "jri.h" #include "jsjava.h" +#ifdef JAVA #include "java.h" +#endif #include "jsobj.h" #include "jsatom.h" #include "jsscope.h" @@ -671,8 +673,12 @@ LM_NewJSPrincipals(URL_Struct *archive, char *id, const char *codebase) zip = zip_open(unixPath); } XP_FREEIF(unixPath); +#else +#ifdef OJI // XXX hack + zip = NULL; #else zip = zip_open(fn); +#endif #endif XP_FREE(fn); } @@ -743,8 +749,10 @@ destroyJSPrincipals(JSContext *cx, JSPrincipals *principals) XP_FREEIF(data->name); XP_FREEIF(data->untransformed); XP_FREEIF(data->transformed); +#ifndef OJI // XXX hack if (data->zip) zip_close(data->zip); +#endif if (data->needUnlock) NET_ChangeCacheFileLock(data->url_struct, FALSE); if (data->url_struct) @@ -1050,7 +1058,11 @@ lm_CheckContainerAccess(JSContext *cx, JSObject *obj, MochaDecoder *decoder, * We have signed scripts. Must check that the object principals are * a subset of the the subject principals. */ +#ifdef OJI // XXX hack + env = NULL; +#else env = LJ_JSJ_CurrentEnv(cx); +#endif if (env == NULL) { return JS_FALSE; } @@ -1069,14 +1081,16 @@ lm_CheckContainerAccess(JSContext *cx, JSObject *obj, MochaDecoder *decoder, return JS_TRUE; } fn = lm_GetSubjectOriginURL(cx); - if (!fn) - return JS_FALSE; + if (!fn) + return JS_FALSE; +#ifndef OJI // XXX hack if (subjPrincipals && principals) { PrintToConsole("Principals of script: "); printPrincipalsToConsole(cx, subjPrincipals); PrintToConsole("Principals of signed container: "); printPrincipalsToConsole(cx, principals); } +#endif JS_ReportError(cx, container_error_message, fn); return JS_FALSE; } @@ -1601,9 +1615,11 @@ LM_ExtractFromPrincipalsArchive(JSPrincipals *principals, char *name, uint *length) { JSPrincipalsData *data = (JSPrincipalsData *) principals; - char *result; + char *result = NULL; +#ifndef OJI // XXX hack result = LJ_LoadFromZipFile(data->zip, name); +#endif *length = result ? XP_STRLEN(result) : 0; return result; @@ -1980,17 +1996,21 @@ LM_RegisterPrincipals(MochaDecoder *decoder, JSPrincipals *principals, * Intersect principals and container principals, * modifying the container principals. */ +#ifndef OJI // XXX hack PrintToConsole("Intersecting principals "); printPrincipalsToConsole(cx, containerPrincipals); PrintToConsole("with "); printPrincipalsToConsole(cx, principals); +#endif if (!intersectPrincipals(decoder, containerPrincipals, principals)) { return NULL; } +#ifndef OJI // XXX hack PrintToConsole("yielding "); printPrincipalsToConsole(cx, containerPrincipals); +#endif } else { /* * Store the disjoint set of principals in the diff --git a/mozilla/lib/libmocha/lm_trggr.c b/mozilla/lib/libmocha/lm_trggr.c index c878cf6f8cb..2667f9a0ef0 100644 --- a/mozilla/lib/libmocha/lm_trggr.c +++ b/mozilla/lib/libmocha/lm_trggr.c @@ -27,7 +27,9 @@ #include "lm.h" #include "prefapi.h" #include "VerReg.h" +#ifdef JAVA #include "softupdt.h" +#endif #include "gui.h" /* XP_AppPlatform */ JSBool PR_CALLBACK asd_Version(JSContext *cx, JSObject *obj, uint argc, jsval *argv, jsval *rval); diff --git a/mozilla/lib/plugin/Makefile b/mozilla/lib/plugin/Makefile index 155af291257..3f9ed957607 100644 --- a/mozilla/lib/plugin/Makefile +++ b/mozilla/lib/plugin/Makefile @@ -24,7 +24,7 @@ CSRCS = npassoc.c CPPSRCS = nsplugin.cpp -EXPORTS = nppg.h npupp.h nsplugin.h nsjvm.h npglue.h nppriv.h +EXPORTS = nppg.h npupp.h nsplugin.h npglue.h nppriv.h REQUIRES = lay layer js style applet nspr dbm img util java pref xpcom diff --git a/mozilla/lib/plugin/npglue.cpp b/mozilla/lib/plugin/npglue.cpp index b2f76c126b2..3a759d08496 100644 --- a/mozilla/lib/plugin/npglue.cpp +++ b/mozilla/lib/plugin/npglue.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- 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 @@ -36,6 +36,12 @@ static void np_ReplaceChars(char* word, char oldChar, char newChar); static char* np_CreateMimePref(const char* mimetype, const char* pref); #endif /* ANTHRAX */ +#ifdef PLUGIN_TIMER_EVENT +static void np_SetTimerInterval(NPP npp, uint32 msecs); +static void np_TimerCallback(void* app); +#define DEFAULT_TIMER_INTERVAL 1000 +#endif + /* list of all plugins */ static np_handle *np_plist = 0; @@ -60,7 +66,7 @@ np_is50StylePlugin(np_handle* handle) /* Find a mimetype in the handle */ static np_mimetype * -np_getmimetype(np_handle *handle, char *mimeStr, XP_Bool wildCard) +np_getmimetype(np_handle *handle, const char *mimeStr, XP_Bool wildCard) { np_mimetype *mimetype; @@ -522,7 +528,7 @@ NPL_Write(NET_StreamClass *stream, const unsigned char *str, int32 len) if (newstream->handle->userPlugin) { nsPluginStreamPeer* peerStream = (nsPluginStreamPeer*)newstream->pstream->pdata; NPIPluginStream* userStream = peerStream->GetUserStream(); - ret = userStream->Write(len, (void*)&str[urls->position]); + ret = userStream->Write(len, (const char*)&str[urls->position]); } else if (ISFUNCPTR(newstream->handle->f->write)) { ret = CallNPP_WriteProc(newstream->handle->f->write, newstream->instance->npp, newstream->pstream, @@ -1056,7 +1062,6 @@ np_makecontext(np_instance* instance, const char* window) return cx; } - PR_STATIC_CALLBACK(void) np_redisable_js(URL_Struct* url_s, int status, MWContext* context) { @@ -1608,6 +1613,11 @@ npn_setvalue(NPP npp, NPPVariable variable, void *r_value) } #endif /* LAYERS */ break; + + case NPPVpluginTimerInterval: + np_SetTimerInterval(npp, *(uint32*)r_value); + break; + case NPPVpluginWindowSize: break; default: @@ -2186,10 +2196,10 @@ NS_DEFINE_IID(kLiveConnectPluginIID, NP_ILIVECONNECTPLUGIN_IID); #pragma pointers_in_D0 #endif -struct java_lang_Class* NP_EXPORT +#ifdef JAVA +java_lang_Class* NP_EXPORT npn_getJavaClass(np_handle* handle) { -#ifdef JAVA if (handle->userPlugin) { NPIPlugin* userPluginClass = (NPIPlugin*)handle->userPlugin; NPILiveConnectPlugin* lcPlugin; @@ -2210,9 +2220,9 @@ npn_getJavaClass(np_handle* handle) if (env == NULL) return NULL; return (java_lang_Class*)JRI_GetGlobalRef(env, handle->f->javaClass); } -#endif return NULL; } +#endif jref NP_EXPORT npn_getJavaPeer(NPP npp) @@ -2303,7 +2313,11 @@ np_IsLiveConnected(np_handle* handle) } } else { +#ifdef JAVA return npn_getJavaClass(handle) != NULL; +#else + return FALSE; +#endif } } @@ -2333,9 +2347,8 @@ XP_Bool NPL_IsLiveConnected(LO_EmbedStruct *embed) /******************************************************************************/ - - -static void +/* Returns false if there was an error: */ +static PRBool np_setwindow(np_instance *instance, NPWindow *appWin) { /* @@ -2356,9 +2369,8 @@ np_setwindow(np_instance *instance, NPWindow *appWin) lo_struct = ndata->lo_struct; #ifndef XP_MAC if (lo_struct && lo_struct->ele_attrmask & LO_ELE_HIDDEN) - return; + return PR_TRUE; #endif - } } @@ -2373,8 +2385,13 @@ np_setwindow(np_instance *instance, NPWindow *appWin) // If this is the first time we're drawing this, then call // the plugin's Start() method. - if (lo_struct && ! (lo_struct->ele_attrmask & LO_ELE_DRAWN)) - userInst->Start(); + if (lo_struct && ! (lo_struct->ele_attrmask & LO_ELE_DRAWN)) { + NPPluginError err = userInst->Start(); + if (err != NPPluginError_NoError) { + np_delete_instance(instance); + return PR_FALSE; + } + } } else if (ISFUNCPTR(instance->handle->f->setwindow)) { CallNPP_SetWindowProc(instance->handle->f->setwindow, instance->npp, appWin); @@ -2384,6 +2401,7 @@ np_setwindow(np_instance *instance, NPWindow *appWin) { NPTRACE(0,("setwindow before appWin was valid")); } + return PR_TRUE; } static void @@ -2392,7 +2410,7 @@ np_UnloadPluginClass(np_handle *handle) /* only called when we truly want to dispose the plugin class */ XP_ASSERT(handle && handle->refs == 0); -#ifdef JAVA +#ifdef JAVA if (handle->userPlugin == NULL && handle->f && handle->f->javaClass != NULL) { /* Don't get the environment unless there is a Java class, because this would cause the java runtime to start up. */ @@ -2415,6 +2433,7 @@ np_UnloadPluginClass(np_handle *handle) PR_IMPLEMENT(void) NPL_SetPluginWindow(void *data) { +#ifdef JAVA JRIEnv * env = NULL; np_instance *instance = (np_instance *) data; struct netscape_javascript_JSObject *mochaWindow = NULL; @@ -2422,7 +2441,6 @@ NPL_SetPluginWindow(void *data) if (instance && instance->cx) mochaWindow = LJ_GetMochaWindow(instance->cx); -#ifdef JAVA env = LJ_EnsureJavaEnv(PR_CurrentThread()); if (mochaWindow){ @@ -2513,6 +2531,11 @@ np_newinstance(np_handle *handle, MWContext *cx, NPEmbeddedApp *app, instance->npp = npp; instance->windowed = TRUE; instance->transparent = FALSE; + +#ifdef PLUGIN_TIMER_EVENT + instance->timeout = NULL; + instance->interval = DEFAULT_TIMER_INTERVAL; +#endif #ifdef LAYERS if (ndata) @@ -2599,7 +2622,8 @@ np_newinstance(np_handle *handle, MWContext *cx, NPEmbeddedApp *app, if (app->pagePluginType == NP_Embedded) { XP_ASSERT(app->wdata); - np_setwindow(instance, app->wdata); + PRBool success = np_setwindow(instance, app->wdata); + if (!success) goto error; } #endif } @@ -2635,8 +2659,10 @@ np_newinstance(np_handle *handle, MWContext *cx, NPEmbeddedApp *app, // The problem is that by deferring the jvm startup, we cause it to // happen later on the wrong thread. np_IsLiveConnected(handle) +#elif defined(JAVA) + npn_getJavaClass(handle) #else - npn_getJavaClass(handle) + FALSE #endif ) { /* for liveconnected plugins only */ ET_SetPluginWindow(cx, (void *)instance); @@ -3595,6 +3621,12 @@ np_delete_instance(np_instance *instance) if (instance->typeString) XP_FREE(instance->typeString); + +#ifdef PLUGIN_TIMER_EVENT + if(instance->timeout) + FE_ClearTimeout(instance->timeout); +#endif + XP_FREE(instance); } } @@ -3935,7 +3967,6 @@ np_deleteapp(MWContext* cx, NPEmbeddedApp* app) } } - /* * This is called by the front-end via layout when the plug-in's * context is going away. Based on what kind of plugin this is, what @@ -4006,21 +4037,28 @@ NPL_EmbedDelete(MWContext* cx, LO_EmbedStruct* embed_struct) nsPluginInstancePeer* peerInst = (nsPluginInstancePeer*) ndata->instance->npp->pdata; NPIPluginInstance* userInst = peerInst->GetUserInstance(); - /* XXX Where should this error go? */ NPPluginError err = userInst->Stop(); - XP_ASSERT(err == NPPluginError_NoError); + if (err == NPPluginError_NoError) { + /* XXX So I'm going out on a limb here and saying that + by keeping the plugin in a "cached" state, we + should pretty much not need to perturb much + else... */ + ndata->state = NPDataCached; + ndata->lo_struct = NULL; + np_unbindContext(app, cx); - /* XXX So I'm going out on a limb here and saying that - by keeping the plugin in a "cached" state, we - should pretty much not need to perturb much - else... */ - ndata->state = NPDataCached; - ndata->lo_struct = NULL; - np_unbindContext(app, cx); - - /* Tell the front-end to save the embedded window for us */ - FE_SaveEmbedWindow(cx, app); - return; + /* Tell the front-end to save the embedded window for us */ + FE_SaveEmbedWindow(cx, app); + return; + } + else { + // the plugin failed to stop properly + // XXX is the following right?... + np_delete_instance(ndata->instance); + embed_struct->session_data = NULL; + app->np_data = NULL; + XP_FREE(ndata); + } } else { /* It's a normal old-fashioned plugin. Destroy the instance */ np_delete_instance(ndata->instance); @@ -4043,7 +4081,7 @@ NPL_EmbedDelete(MWContext* cx, LO_EmbedStruct* embed_struct) /* XXX This is pretty convoluted how this just all falls through to here. Clean it up sometime... */ - np_deleteapp(cx, app); /* unlink app from context and delete app */ + np_deleteapp(cx, app); /* unlink app from context and delete app */ } @@ -4103,6 +4141,81 @@ np_findTypeAttribute(LO_EmbedStruct* embed_struct) return typeAttribute; } +void +np_FindHandleByType(const char* typeAttribute, np_handle* *resultingHandle, + np_mimetype* *resultingMimetype) +{ + np_handle* handle = NULL; + np_mimetype* mimetype = NULL; + + for (handle = np_plist; handle; handle = handle->next) { + mimetype = np_getmimetype(handle, typeAttribute, FALSE); + if (mimetype) break; + } + + /* No handler with an exactly-matching name, so check for a wildcard */ + if (!mimetype) + { + for (handle = np_plist; handle; handle = handle->next) { + mimetype = np_getmimetype(handle, typeAttribute, TRUE); + if (mimetype) break; + } + } + + *resultingHandle = handle; + *resultingMimetype = mimetype; +} + +// Used by OJI to load the Java VM plugin +PR_IMPLEMENT(struct NPIPlugin*) +NPL_LoadPluginByType(const char* typeAttribute) +{ + np_handle* handle = NULL; + np_mimetype* mimetype = NULL; + np_FindHandleByType(typeAttribute, &handle, &mimetype); + if (mimetype == NULL) + return NULL; + PR_ASSERT(handle); + + PRBool loaded = PR_FALSE; + if (handle->refs == 0) { +// FE_Progress(cx, XP_GetString(XP_PLUGIN_LOADING_PLUGIN)); + if (!(handle->f = FE_LoadPlugin(handle->pdesc, &npp_funcs, handle))) + { +// char* msg = PR_smprintf(XP_GetString(XP_PLUGIN_CANT_LOAD_PLUGIN), handle->name, mimetype->type); +// FE_Alert(cx, msg); +// XP_FREE(msg); + return NULL; + } + loaded = PR_TRUE; +#ifdef JAVA + /* + ** Don't use npn_getJavaEnv here. We don't want to start the + ** interpreter, just use env if it already exists. + */ + JRIEnv* env = JRI_GetCurrentEnv(); + + /* + ** An exception could have occurred when the plugin tried to load + ** it's class file. We'll print any exception to the console. + */ + if (env && JRI_ExceptionOccurred(env)) { + JRI_ExceptionDescribe(env); + JRI_ExceptionClear(env); + } +#endif + } + if (handle->userPlugin) { + // refcount was incremented + return handle->userPlugin; + } + else { + // old style plugin -- we failed so unload it + if (loaded) + FE_UnloadPlugin(handle->pdesc, handle); + return NULL; + } +} /* * This is called by the front-end to create a new plug-in. It will @@ -4287,22 +4400,7 @@ NPL_EmbedStart(MWContext* cx, LO_EmbedStruct* embed_struct, NPEmbeddedApp* app) app->pagePluginType = NP_Embedded; /* Found the TYPE attribute, so look for a matching handler */ - mimetype = NULL; - for (handle = np_plist; handle; handle = handle->next) - { - mimetype = np_getmimetype(handle, typeAttribute, FALSE); - if (mimetype) break; - } - - /* No handler with an exactly-matching name, so check for a wildcard */ - if (!mimetype) - { - for (handle = np_plist; handle; handle = handle->next) - { - mimetype = np_getmimetype(handle, typeAttribute, TRUE); - if (mimetype) break; - } - } + np_FindHandleByType(typeAttribute, &handle, &mimetype); /* * If we found a handler, now we can create an instance. @@ -4421,11 +4519,12 @@ error: void NPL_EmbedSize(NPEmbeddedApp *app) { - if(app) - { + if (app) { np_data *ndata = (np_data *)app->np_data; - if(ndata && ndata->instance && app->wdata) - np_setwindow(ndata->instance, app->wdata); + if (ndata && ndata->instance && app->wdata) { + PRBool success = np_setwindow(ndata->instance, app->wdata); + if (!success) return; // XXX deal with the error + } } } @@ -5067,3 +5166,37 @@ static void np_ReplaceChars(char* word, char oldChar, char newChar) #endif /* ANTHRAX */ +#ifdef PLUGIN_TIMER_EVENT + +static void np_SetTimerInterval(NPP npp, uint32 msecs) +{ + if(npp) { + np_instance* instance = (np_instance*) npp->ndata; + if(instance) + { + instance->interval = msecs; + instance->timeout = FE_SetTimeout(np_TimerCallback, (void*)instance, instance->interval); + } + } +} + +static void np_TimerCallback(void* data) +{ + NPEvent event; + np_instance* instance = (np_instance*) data; + +#ifdef XP_MAC + ((EventRecord)event).what = nullEvent; +#elif defined(XP_WIN) + event.event = 0; // ? +#elif defined(XP_OS2) + event.event = 0; // ? +#elif defined(XP_UNIX) + // not sure what to do here +#endif + + instance->timeout = FE_SetTimeout(np_TimerCallback, (void*)instance, instance->interval); + NPL_HandleEvent(instance->app, &event, NULL); +} +#endif + diff --git a/mozilla/lib/plugin/npglue.h b/mozilla/lib/plugin/npglue.h index f2df6544186..db9c3dc9a6f 100644 --- a/mozilla/lib/plugin/npglue.h +++ b/mozilla/lib/plugin/npglue.h @@ -1,4 +1,4 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- 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 @@ -34,7 +34,9 @@ extern "C" { #include "gui.h" /* For XP_AppCodeName */ #include "merrors.h" #include "xpgetstr.h" +#ifdef JAVA #include "java.h" +#endif #include "nppriv.h" #include "shist.h" @@ -452,7 +454,7 @@ public: // (Corresponds to NPP_Write and NPN_Write.) NS_IMETHOD_(PRInt32) - Write(PRInt32 len, void* buffer); + Write(PRInt32 len, const char* buffer); //////////////////////////////////////////////////////////////////////////// // from NPIPluginManagerStream: @@ -504,6 +506,22 @@ public: //////////////////////////////////////////////////////////////////////////// // from NPIPluginStreamPeer: + // (Corresponds to NPStream's url field.) + NS_IMETHOD_(const char*) + GetURL(void); + + // (Corresponds to NPStream's end field.) + NS_IMETHOD_(PRUint32) + GetEnd(void); + + // (Corresponds to NPStream's lastmodified field.) + NS_IMETHOD_(PRUint32) + GetLastModified(void); + + // (Corresponds to NPStream's notifyData field.) + NS_IMETHOD_(void*) + GetNotifyData(void); + // (Corresponds to NPP_DestroyStream's reason argument.) NS_IMETHOD_(NPPluginReason) GetReason(void); @@ -514,31 +532,7 @@ public: NS_IMETHOD_(PRUint32) GetContentLength(void); -#if 0 - NS_IMETHOD_(const char*) - GetContentEncoding(void); - NS_IMETHOD_(const char*) - GetCharSet(void); - - NS_IMETHOD_(const char*) - GetBoundary(void); - - NS_IMETHOD_(const char*) - GetContentName(void); - - NS_IMETHOD_(time_t) - GetExpires(void); - - NS_IMETHOD_(time_t) - GetLastModified(void); - - NS_IMETHOD_(time_t) - GetServerDate(void); - - NS_IMETHOD_(NPServerStatus) - GetServerStatus(void); -#endif NS_IMETHOD_(PRUint32) GetHeaderFieldCount(void); diff --git a/mozilla/lib/plugin/nppriv.h b/mozilla/lib/plugin/nppriv.h index e7f6833abe6..298e20d07f9 100644 --- a/mozilla/lib/plugin/nppriv.h +++ b/mozilla/lib/plugin/nppriv.h @@ -31,6 +31,8 @@ #define ISFUNCPTR(x) (x != NULL) +#define PLUGIN_TIMER_EVENT + typedef struct _np_handle np_handle; typedef struct _np_mimetype np_mimetype; typedef struct _np_instance np_instance; @@ -100,6 +102,12 @@ struct _np_instance { XP_Bool transparent; /* TRUE = transparent, FALSE = opaque */ XP_Bool calling_netlib_all_the_time; JRIGlobalRef mochaWindow; + +#ifdef PLUGIN_TIMER_EVENT + void* timeout; + uint32 interval; +#endif + #ifdef LAYERS CL_Layer *layer; #endif /* LAYERS */ diff --git a/mozilla/lib/plugin/npwplat.cpp b/mozilla/lib/plugin/npwplat.cpp index f2e3614a3e0..7c0422fbd42 100644 --- a/mozilla/lib/plugin/npwplat.cpp +++ b/mozilla/lib/plugin/npwplat.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- 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 @@ -37,7 +37,9 @@ #include "plgindll.h" #include "np.h" #include "helper.h" +#ifdef JAVA #include "java.h" +#endif #include "edt.h" #include "npglue.h" @@ -446,11 +448,28 @@ void fe_RegisterPlugins(char* pszPluginDir) CString csPluginSpec; csPluginSpec = pszPluginDir; -#ifdef JAVA // add directory to the java path no matter what +#if defined(xOJI) // XXX not yet -- ordering problem here between loading the vm and adding to the classpath + JVMMgr* jvmMgr = JVM_GetJVMMgr(); + if (jvmMgr) { + NPIJVMPlugin* jvm = jvmMgr->GetJVM(); + if (jvm) { + jvm->AddToClassPath(pszPluginDir); + } + jvmMgr->Release(); + } +#elif defined(JAVA) LJ_AddToClassPath(pszPluginDir); #endif + if (thePluginManager == NULL) { + static NS_DEFINE_IID(kIPluginManagerIID, NP_IPLUGINMANAGER_IID); + nsresult rslt = nsPluginManager::Create(NULL, kIPluginManagerIID, (void**)&thePluginManager); + // XXX Out of memory already? This function should return an error code! + PR_ASSERT(rslt == NS_OK); + // keep going anyway... + } + csPluginSpec += "\\*.*"; #ifndef _WIN32 @@ -649,11 +668,7 @@ NPPluginFuncs* FE_LoadPlugin(void* pluginType, NPNetscapeFuncs* pNavigatorFuncs, (NP_CREATEPLUGIN)PR_FindSymbol(pNPMgtBlock->pLibrary, "NP_CreatePlugin"); #endif if (npCreatePlugin != NULL) { - if (thePluginManager == NULL) { - static NS_DEFINE_IID(kIPluginManagerIID, NP_IPLUGINMANAGER_IID); - if (nsPluginManager::Create(NULL, kIPluginManagerIID, (void**)&thePluginManager) != NS_OK) - return NULL; - } + PR_ASSERT(thePluginManager != NULL); NPIPlugin* plugin = NULL; NPPluginError err = npCreatePlugin(thePluginManager, &plugin); handle->userPlugin = plugin; @@ -775,7 +790,8 @@ void FE_UnloadPlugin(void* pluginType, struct _np_handle* handle) // if this DLL is the last one, call its shutdown entry point if (pNPMgtBlk->uRefCount == 0) { if (handle->userPlugin) { - handle->userPlugin->Release(); + nsrefcnt cnt = handle->userPlugin->Release(); + PR_ASSERT(cnt == 0); } else { // the NP_Shutdown entry point was misnamed as NP_PluginShutdown, early @@ -804,8 +820,6 @@ void FE_UnloadPlugin(void* pluginType, struct _np_handle* handle) } } - // XXX Shouldn't the rest of this be inside the if statement, above?... - PR_UnloadLibrary(pNPMgtBlk->pLibrary); pNPMgtBlk->pLibrary = NULL; diff --git a/mozilla/lib/plugin/nsjvm.cpp b/mozilla/lib/plugin/nsjvm.cpp deleted file mode 100644 index daee0764150..00000000000 --- a/mozilla/lib/plugin/nsjvm.cpp +++ /dev/null @@ -1,351 +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. - */ - -//////////////////////////////////////////////////////////////////////////////// -// Plugin Manager Methods to support the JVM Plugin API -//////////////////////////////////////////////////////////////////////////////// - -#include "npglue.h" -#include "prefapi.h" -#include "xp_str.h" -#include "libmocha.h" - -#include "nsjvm.h" - -#if 0 // XXX for now - -static int PR_CALLBACK -JavaPrefChanged(const char *prefStr, void* data) -{ - nsPluginManager* mgr = (nsPluginManager*)data; - PRBool prefBool; - PREF_GetBoolPref(prefStr, &prefBool); - mgr->SetJVMEnabled(prefBool); - return 0; -} - -void -nsPluginManager::EnsurePrefCallbackRegistered(void) -{ - if (fRegisteredJavaPrefChanged != PR_TRUE) { - fRegisteredJavaPrefChanged = PR_TRUE; - PREF_RegisterCallback("security.enable_java", JavaPrefChanged, this); - JavaPrefChanged("security.enable_java", this); - } -} - -PRBool -nsPluginManager::GetJVMEnabled(void) -{ - EnsurePrefCallbackRegistered(); - return fJVM->GetJVMEnabled(); -} - -void -nsPluginManager::SetJVMEnabled(PRBool enable) -{ - return fJVM->SetJVMEnabled(enable); -} - -JVMStatus -nsPluginManager::GetJVMStatus(void) -{ - EnsurePrefCallbackRegistered(); - return fJVM->GetJVMStatus(); -} - -//////////////////////////////////////////////////////////////////////////////// - -// Should be in a header; must solve build-order problem first -extern void VR_Initialize(JRIEnv* env); -extern void SU_Initialize(JRIEnv * env); - -JVMStatus -nsPluginManager::StartupJVM() -{ - // Be sure to check the prefs first before asking java to startup. - if (GetJVMStatus() == JVMStatus_Disabled) { - return JVMStatus_Disabled; - } - JVMStatus status = fJVM->StartupJVM(); - if (status == JVMStatus_Ok) { - JRIEnv* env = fJVM->EnsureExecEnv(); - - /* initialize VersionRegistry native routines */ - /* it is not an error that prevents java from starting if this stuff throws exceptions */ - VR_Initialize(env); - if (JRI_ExceptionOccurred(env)) { -#if DEBUG - fJVM->PrintToConsole("LJ: VR_Initialize failed. Bugs to dveditz.\n"); -#endif - goto error; - } - - SU_Initialize(env); - if (JRI_ExceptionOccurred(env)) { -#if DEBUG - fJVM->PrintToConsole("LJ: SU_Initialize failed. Bugs to atotic.\n"); -#endif - goto error; - } - } - return status; - - error: -#if DEBUG - JRI_ExceptionDescribe(env); -#endif - JRI_ExceptionClear(env); - ShutdownJVM(); - return JVMStatus_JavaError; -} - -JVMStatus -nsPluginManager::ShutdownJVM(PRBool fullShutdown = PR_TRUE) -{ - return fJVM->ShutdownJVM(); -} - -#endif // 0 - -//////////////////////////////////////////////////////////////////////////////// - -void NP_LOADDS -nsPluginManager::BeginWaitCursor(void) -{ - if (fWaiting == 0) { -#ifdef XP_PC - fOldCursor = (void*)GetCursor(); - HCURSOR newCursor = LoadCursor(NULL, IDC_WAIT); - if (newCursor) - SetCursor(newCursor); -#endif -#ifdef XP_MAC - startAsyncCursors(); -#endif - } - fWaiting++; -} - -void NP_LOADDS -nsPluginManager::EndWaitCursor(void) -{ - fWaiting--; - if (fWaiting == 0) { -#ifdef XP_PC - if (fOldCursor) - SetCursor((HCURSOR)fOldCursor); -#endif -#ifdef XP_MAC - stopAsyncCursors(); -#endif - fOldCursor = NULL; - } -} - -//////////////////////////////////////////////////////////////////////////////// - -const char* NP_LOADDS -nsPluginManager::GetProgramPath(void) -{ - return fProgramPath; -} - -const char* NP_LOADDS -nsPluginManager::GetTempDirPath(void) -{ - // XXX I don't need a static really, the browser holds the tempDir name - // as a static string -- it's just the XP_TempDirName that strdups it. - static const char* tempDirName = NULL; - if (tempDirName == NULL) - tempDirName = XP_TempDirName(); - return tempDirName; -} - -nsresult NP_LOADDS -nsPluginManager::GetFileName(const char* fn, FileNameType type, - char* resultBuf, PRUint32 bufLen) -{ - // XXX This should be rewritten so that we don't have to malloc the name. - XP_FileType filetype; - - if (type == SIGNED_APPLET_DBNAME) - filetype = xpSignedAppletDB; - else if (type == TEMP_FILENAME) - filetype = xpTemporary; - else - return NS_ERROR_ILLEGAL_VALUE; - - char* tempName = WH_FileName(fn, filetype); - if (tempName != NULL) return NS_ERROR_OUT_OF_MEMORY; - XP_STRNCPY_SAFE(resultBuf, tempName, bufLen); - XP_FREE(tempName); - return NS_OK; -} - -nsresult NP_LOADDS -nsPluginManager::NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen) -{ - // XXX This should be rewritten so that we don't have to malloc the name. - char* tempName = WH_TempName(xpTemporary, prefix); - if (tempName != NULL) return NS_ERROR_OUT_OF_MEMORY; - XP_STRNCPY_SAFE(resultBuf, tempName, bufLen); - XP_FREE(tempName); - return NS_OK; -} - -PRBool NP_LOADDS -nsPluginManager::HandOffJSLock(PRThread* oldOwner, PRThread* newOwner) -{ - return LM_HandOffJSLock(oldOwner, newOwner); -} - -//////////////////////////////////////////////////////////////////////////// -// Debugger Stuff - -extern "C" HWND FindNavigatorHiddenWindow(void); - -PRBool NP_LOADDS -nsPluginManager::SetDebugAgentPassword(PRInt32 pwd) -{ -#if defined(XP_PC) && defined(_WIN32) - HWND win = FindNavigatorHiddenWindow(); - HANDLE sem; - long err; - - /* set up by aHiddenFrameClass in CNetscapeApp::InitInstance */ - err = SetWindowLong(win, 0, pwd); - if (err == 0) { -// PR_LOG(NSJAVA, PR_LOG_ALWAYS, -// ("SetWindowLong returned %ld (err=%d)\n", err, GetLastError())); - /* continue so that we try to wake up the debugger */ - } - sem = OpenSemaphore(SEMAPHORE_MODIFY_STATE, FALSE, "Netscape-Symantec Debugger"); - if (sem) { - ReleaseSemaphore(sem, 1, NULL); - CloseHandle(sem); - } - return PR_TRUE; -#else - return PR_FALSE; -#endif -} - -//////////////////////////////////////////////////////////////////////////////// - -#if 0 // XXX for now - -PRBool -nsPluginManager::StartDebugger(JVMDebugPort port) -{ - JVMError err = fJVM->StartDebugger(port); - if (err != JVMError_NoError) { - JRIEnv* env = fJVM->EnsureJNIEnv(); - ReportJVMError(env, err); - return PR_FALSE; - } - return PR_TRUE; -} - -void -nsPluginManager::ReportJVMError(JRIEnv* env, JVMError err) -{ - MWContext* cx = XP_FindSomeContext(); - char *s; - switch (err) { - case LJStartupError_NoClasses: { - const char* cp = CLASSPATH(); - cp = lj_ConvertToPlatformPathList(cp); - s = PR_smprintf(XP_GetString(XP_JAVA_NO_CLASSES), - lj_jar_name, lj_jar_name, - (cp ? cp : "")); - free((void*)cp); - break; - } - - case LJStartupError_JavaError: { - const char* msg = GetJavaErrorString(env); -#ifdef DEBUG - JRI_ExceptionDescribe(env); -#endif - s = PR_smprintf(XP_GetString(XP_JAVA_STARTUP_FAILED), - (msg ? msg : "")); - if (msg) free((void*)msg); - break; - } - case LJStartupError_NoDebugger: { - s = PR_smprintf(XP_GetString(XP_JAVA_DEBUGGER_FAILED)); - break; - } - default: - return; /* don't report anything */ - } - if (s) { - FE_Alert(cx, s); - free(s); - } -} - -/* stolen from java_lang_Object.h (jri version) */ -#define classname_java_lang_Object "java/lang/Object" -#define name_java_lang_Object_toString "toString" -#define sig_java_lang_Object_toString "()Ljava/lang/String;" - -const char* -nsPluginManager::GetJavaErrorString(JRIEnv* env) -{ - /* XXX javah is a pain wrt mixing JRI and JDK native methods. - Since we need to call a method on Object, we'll do it the hard way - to avoid using javah for this. - Maybe we need a new JRI entry point for toString. Yikes! */ - - const char* msg; - struct java_lang_Class* classObject; - JRIMethodID toString; - struct java_lang_String* excString; - struct java_lang_Throwable* exc = JRI_ExceptionOccurred(env); - - if (exc == NULL) { - return strdup(""); /* XXX better "no error" message? */ - } - - /* Got to do this before trying to find a class (like Object). - This is because the runtime refuses to do this with a pending - exception! I think it's broken. */ - - JRI_ExceptionClear(env); - - classObject = (struct java_lang_Class*) - JRI_FindClass(env, classname_java_lang_Object); - toString = JRI_GetMethodID(env, classObject, - name_java_lang_Object_toString, - sig_java_lang_Object_toString); - excString = (struct java_lang_String *) - JRI_CallMethod(env)(env, JRI_CallMethod_op, - (struct java_lang_Object*)exc, toString); - - /* XXX change to JRI_GetStringPlatformChars */ - msg = JRI_GetStringPlatformChars(env, excString, NULL, 0); - if (msg == NULL) return NULL; - return strdup(msg); -} - -#endif // 0 - -//////////////////////////////////////////////////////////////////////////////// - diff --git a/mozilla/lib/plugin/nsjvm.h b/mozilla/lib/plugin/nsjvm.h deleted file mode 100644 index 0975c9c8f5d..00000000000 --- a/mozilla/lib/plugin/nsjvm.h +++ /dev/null @@ -1,212 +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. - */ - -//////////////////////////////////////////////////////////////////////////////// -// 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. -//////////////////////////////////////////////////////////////////////////////// - -#ifndef nsjvm_h___ -#define nsjvm_h___ - -#include "nsplugin.h" -#include "jri.h" // XXX for now -#include "jni.h" -#include "prthread.h" - -//////////////////////////////////////////////////////////////////////////////// -// Java VM Plugin Manager -// This interface defines additional entry points that are available -// to JVM plugins for browsers that support JVM plugins. - -class NPIJVMPluginManager : public NPIPluginManager { -public: - - virtual void NP_LOADDS - BeginWaitCursor(void) = 0; - - virtual void NP_LOADDS - EndWaitCursor(void) = 0; - - virtual const char* NP_LOADDS - GetProgramPath(void) = 0; - - virtual const char* NP_LOADDS - GetTempDirPath(void) = 0; - - enum FileNameType { SIGNED_APPLET_DBNAME, TEMP_FILENAME }; - - virtual nsresult NP_LOADDS - GetFileName(const char* fn, FileNameType type, - char* resultBuf, PRUint32 bufLen) = 0; - - virtual nsresult NP_LOADDS - NewTempFileName(const char* prefix, char* resultBuf, PRUint32 bufLen) = 0; - - virtual PRBool NP_LOADDS - HandOffJSLock(PRThread* oldOwner, PRThread* newOwner) = 0; - - //////////////////////////////////////////////////////////////////////////// - // Debugger Stuff (XXX move to subclass) - - virtual PRBool NP_LOADDS - SetDebugAgentPassword(PRInt32 pwd) = 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 -}; - -enum JVMError { - JVMError_Ok = NPPluginError_NoError, - JVMError_Base = 0x1000, - JVMError_InternalError = JVMError_Base, - JVMError_NoClasses, - JVMError_WrongClasses, - JVMError_JavaError, - JVMError_NoDebugger -}; - -enum JVMDebugPort { - JVMDebugPort_None = 0, - JVMDebugPort_SharedMemory = -1 - // anything else is a port number -}; - -//////////////////////////////////////////////////////////////////////////////// -// 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: - - virtual JVMStatus NP_LOADDS - StartupJVM() = 0; - - virtual JVMStatus NP_LOADDS - ShutdownJVM(PRBool fullShutdown = PR_TRUE) = 0; - - virtual PRBool NP_LOADDS - GetJVMEnabled() = 0; - - virtual void NP_LOADDS - SetJVMEnabled(PRBool enable) = 0; - - virtual JVMStatus NP_LOADDS - GetJVMStatus() = 0; - - // Find or create a JNIEnv for the specified thread. The thread - // parameter may be NULL indicating the current thread. - // XXX JNIEnv* - virtual JRIEnv* NP_LOADDS - EnsureExecEnv(PRThread* thread = NULL) = 0; - - virtual void NP_LOADDS - AddToClassPath(const char* dirPath) = 0; - - virtual void NP_LOADDS - ShowConsole() = 0; - - virtual void NP_LOADDS - HideConsole() = 0; - - virtual PRBool NP_LOADDS - IsConsoleVisible() = 0; - - virtual void NP_LOADDS - PrintToConsole(const char* msg) = 0; - - //////////////////////////////////////////////////////////////////////////// - // Debugger Stuff (XXX move to subclass) - - virtual JVMError NP_LOADDS - StartDebugger(JVMDebugPort port) = 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 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 Does this overlap with GetArgNames/GetArgValues? - // XXX What happens if someone says something like: - // - // Which takes precedent? - virtual char* NP_LOADDS - GetAttribute(NPTagAttributeName name) = 0; - - // XXX reload method? - - // Returns a unique id for the current document on which the - // plugin is displayed. - virtual PRUint32 NP_LOADDS - GetDocumentID() = 0; - -}; - -#define NP_IJVMPLUGININSTANCEPEER_IID \ -{ /* 27b42df0-a1bd-11d1-85b1-00805f0e4dfe */ \ - 0x27b42df0, \ - 0xa1bd, \ - 0x11d1, \ - {0x85, 0xb1, 0x00, 0x80, 0x5f, 0x0e, 0x4d, 0xfe} \ -} - -//////////////////////////////////////////////////////////////////////////////// -#endif /* nsjvm_h___ */ diff --git a/mozilla/lib/plugin/nsplugin.cpp b/mozilla/lib/plugin/nsplugin.cpp index c7462c257ca..c11dc663158 100644 --- a/mozilla/lib/plugin/nsplugin.cpp +++ b/mozilla/lib/plugin/nsplugin.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- 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 @@ -206,7 +206,7 @@ nsPluginInstancePeer::AggregatedQueryInterface(const nsIID& aIID, void** aInstan np_data* ndata = (np_data*) app->np_data; nsresult result = JVMInstancePeer::Create((nsISupports*)this, kISupportsIID, (void**)&fJVMInstancePeer, - cx, (struct LO_JavaAppStruct_struct*)ndata->lo_struct); // XXX wrong kind of LO_Struct! + cx, (LO_ObjectStruct*)ndata->lo_struct); // XXX wrong kind of LO_Struct! if (result != NS_OK) return result; } #endif @@ -362,19 +362,19 @@ nsPluginInstancePeer::ForceRedraw(void) NS_METHOD_(void) nsPluginInstancePeer::RegisterWindow(void* window) { - npn_registerwindow(npp, window); + npn_registerwindow(npp, window); } NS_METHOD_(void) nsPluginInstancePeer::UnregisterWindow(void* window) { - npn_unregisterwindow(npp, window); + npn_unregisterwindow(npp, window); } NS_METHOD_(PRInt16) nsPluginInstancePeer::AllocateMenuID(PRBool isSubmenu) { - return npn_allocateMenuID(npp, isSubmenu); + return npn_allocateMenuID(npp, isSubmenu); } NS_METHOD_(jref) @@ -396,6 +396,8 @@ nsPluginManagerStream::nsPluginManagerStream(NPP npp, NPStream* pstr) nsPluginManagerStream::~nsPluginManagerStream(void) { + NPError err = npn_destroystream(npp, pstream, NPPluginReason_Done); + PR_ASSERT(err == NPPluginError_NoError); } NS_METHOD_(PRInt32) @@ -407,9 +409,9 @@ nsPluginManagerStream::WriteReady(void) } NS_METHOD_(PRInt32) -nsPluginManagerStream::Write(PRInt32 len, void* buffer) +nsPluginManagerStream::Write(PRInt32 len, const char* buffer) { - return npn_write(npp, pstream, len, buffer); + return npn_write(npp, pstream, len, (void*)buffer); } NS_METHOD_(const char*) @@ -453,6 +455,34 @@ nsPluginStreamPeer::nsPluginStreamPeer(URL_Struct *urls, np_stream *stream) nsPluginStreamPeer::~nsPluginStreamPeer(void) { +#if 0 + NPError err = npn_destroystream(stream->instance->npp, stream->pstream, reason); + PR_ASSERT(err == NPPluginError_NoError); +#endif +} + +NS_METHOD_(const char*) +nsPluginStreamPeer::GetURL(void) +{ + return stream->pstream->url; +} + +NS_METHOD_(PRUint32) +nsPluginStreamPeer::GetEnd(void) +{ + return stream->pstream->end; +} + +NS_METHOD_(PRUint32) +nsPluginStreamPeer::GetLastModified(void) +{ + return stream->pstream->lastmodified; +} + +NS_METHOD_(void*) +nsPluginStreamPeer::GetNotifyData(void) +{ + return stream->pstream->notifyData; } NS_METHOD_(NPPluginReason) diff --git a/mozilla/lib/plugin/nsplugin.h b/mozilla/lib/plugin/nsplugin.h index 68526ce8cb0..c860b648d39 100644 --- a/mozilla/lib/plugin/nsplugin.h +++ b/mozilla/lib/plugin/nsplugin.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- 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 @@ -190,7 +190,8 @@ enum NPPluginVariable { NPPluginVariable_WindowBool, // XXX go away NPPluginVariable_TransparentBool, // XXX go away? NPPluginVariable_JavaClass, // XXX go away - NPPluginVariable_WindowSize + NPPluginVariable_WindowSize, + NPPluginVariable_TimerInterval // XXX add MIMEDescription (for unix) (but GetValue is on the instance, not the class) }; @@ -419,7 +420,7 @@ public: // (Corresponds to NPP_Write and NPN_Write.) NS_IMETHOD_(PRInt32) - Write(PRInt32 len, void* buffer) = 0; + Write(PRInt32 len, const char* buffer) = 0; }; @@ -461,14 +462,10 @@ public: NS_IMETHOD_(NPPluginError) NewInstance(NPIPluginInstancePeer* peer, NPIPluginInstance* *result) = 0; -#ifdef XP_UNIX // XXX why can't this be XP? - // (Corresponds to NPP_GetMIMEDescription.) NS_IMETHOD_(const char*) GetMIMEDescription(void) = 0; -#endif /* XP_UNIX */ - }; #define NP_IPLUGIN_IID \ @@ -770,6 +767,7 @@ public: NS_IMETHOD_(PRInt16) AllocateMenuID(PRBool isSubmenu) = 0; + }; #define NP_IPLUGININSTANCEPEER_IID \ @@ -845,6 +843,22 @@ public: class NPIPluginStreamPeer : public nsISupports { public: + // (Corresponds to NPStream's url field.) + NS_IMETHOD_(const char*) + GetURL(void) = 0; + + // (Corresponds to NPStream's end field.) + NS_IMETHOD_(PRUint32) + GetEnd(void) = 0; + + // (Corresponds to NPStream's lastmodified field.) + NS_IMETHOD_(PRUint32) + GetLastModified(void) = 0; + + // (Corresponds to NPStream's notifyData field.) + NS_IMETHOD_(void*) + GetNotifyData(void) = 0; + // (Corresponds to NPP_DestroyStream's reason argument.) NS_IMETHOD_(NPPluginReason) GetReason(void) = 0; @@ -855,31 +869,7 @@ public: NS_IMETHOD_(PRUint32) GetContentLength(void) = 0; -#if 0 - NS_IMETHOD_(const char*) - GetContentEncoding(void) = 0; - NS_IMETHOD_(const char*) - GetCharSet(void) = 0; - - NS_IMETHOD_(const char*) - GetBoundary(void) = 0; - - NS_IMETHOD_(const char*) - GetContentName(void) = 0; - - NS_IMETHOD_(time_t) - GetExpires(void) = 0; - - NS_IMETHOD_(time_t) - GetLastModified(void) = 0; - - NS_IMETHOD_(time_t) - GetServerDate(void) = 0; - - NS_IMETHOD_(NPServerStatus) - GetServerStatus(void) = 0; -#endif NS_IMETHOD_(PRUint32) GetHeaderFieldCount(void) = 0; diff --git a/mozilla/lib/xlate/stubs.c b/mozilla/lib/xlate/stubs.c index 181dc94b3a5..b4ee44c4cbe 100644 --- a/mozilla/lib/xlate/stubs.c +++ b/mozilla/lib/xlate/stubs.c @@ -111,10 +111,12 @@ void PSFE_FreeJavaAppElement(){} void TXFE_HideJavaAppElement(){} void PSFE_HideJavaAppElement(){} void TXFE_DisplayJavaApp(){} +#ifdef TRANSPARENT_APPLET void TXFE_DrawJavaApp(){} void PSFE_DrawJavaApp(){} void TXFE_HandleClippingView(){} void PSFE_HandleClippingView(){} +#endif void TXFE_FreeEdgeElement(){} void PSFE_FreeEdgeElement(){} void TXFE_DisplayCell(){} diff --git a/mozilla/modules/edtplug/src/edtplugStubs.c b/mozilla/modules/edtplug/src/edtplugStubs.c index e7e566e6ea3..e9aa0a133b5 100644 --- a/mozilla/modules/edtplug/src/edtplugStubs.c +++ b/mozilla/modules/edtplug/src/edtplugStubs.c @@ -77,9 +77,11 @@ void EDTPLUG_RegisterEditURLCallback(EditURLCallback callback){ static JRIEnv* getEnv(MozillaEvent_MozillaCallback* e) { JRIEnv* ee = e->env; +#ifdef JAVA // XXX hack to get OJI working if ( ! ee ) { ee = JRI_GetCurrentEnv(); } +#endif return ee; } diff --git a/mozilla/modules/libfont/jmcgen/include/Mwinfp.h b/mozilla/modules/libfont/jmcgen/include/Mwinfp.h index 16edecebc6c..32f05760f7b 100755 --- a/mozilla/modules/libfont/jmcgen/include/Mwinfp.h +++ b/mozilla/modules/libfont/jmcgen/include/Mwinfp.h @@ -1,22 +1,6 @@ -/* -*- 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. - */ +/* -*- Mode: C; tab-width: 4; -*- */ /******************************************************************************* - * Source date: 26 Feb 1998 01:03:40 GMT + * Source date: 28 Apr 1998 21:44:18 GMT * netscape/fonts/winfp module C header file * Generated by jmc version 1.8 -- DO NOT EDIT ******************************************************************************/ diff --git a/mozilla/modules/libfont/jmcgen/include/Mwinrf.h b/mozilla/modules/libfont/jmcgen/include/Mwinrf.h index 6678a81081b..a9dfc9c9ea2 100755 --- a/mozilla/modules/libfont/jmcgen/include/Mwinrf.h +++ b/mozilla/modules/libfont/jmcgen/include/Mwinrf.h @@ -1,22 +1,6 @@ -/* -*- 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. - */ +/* -*- Mode: C; tab-width: 4; -*- */ /******************************************************************************* - * Source date: 26 Feb 1998 01:03:40 GMT + * Source date: 28 Apr 1998 21:44:18 GMT * netscape/fonts/winrf module C header file * Generated by jmc version 1.8 -- DO NOT EDIT ******************************************************************************/ diff --git a/mozilla/modules/libfont/producers/win/makefile.win b/mozilla/modules/libfont/producers/win/makefile.win index 3469f635698..0bd4fdf624e 100644 --- a/mozilla/modules/libfont/producers/win/makefile.win +++ b/mozilla/modules/libfont/producers/win/makefile.win @@ -20,7 +20,10 @@ IGNORE_MANIFEST=1 # DEPTH=..\..\..\.. -!ifdef MOZ_JAVA + +!include $(DEPTH)\config\config.mak + +!ifdef JAVA_OR_OJI DIRS=classes src !else DIRS=src diff --git a/mozilla/modules/libfont/producers/win/src/makefile.win b/mozilla/modules/libfont/producers/win/src/makefile.win index 7e0d9950358..5b73385e0d6 100644 --- a/mozilla/modules/libfont/producers/win/src/makefile.win +++ b/mozilla/modules/libfont/producers/win/src/makefile.win @@ -26,6 +26,9 @@ IGNORE_MANIFEST=1 OBJS = $(OBJS) $(JMC_OBJS) DEPTH=..\..\..\..\.. + +!include $(DEPTH)\config\config.mak + MODULE=winfont CCJMC=1 JMC_GEN=Mwinfp Mwinrf @@ -44,14 +47,14 @@ LINCS=-I$(XPDIST)\public\jtools -I$(XPDIST)\public\nspr \ -I$(XPDIST)\public\java !endif -!if !defined (MOZ_JAVA) +!if !defined (JAVA_OR_OJI) LOCAL_JMC_SUBDIR = ..\..\..\jmcgen\include LOCAL_JMC_SRC_SUBDIR = ..\..\..\jmcgen\src !endif !include $(DEPTH)\config\rules.mak -!if !defined (MOZ_JAVA) +!if !defined (JAVA_OR_OJI) export:: @echo +++ make: Copying JMC src files from $(LOCAL_JMC_SRC_SUBDIR)/Mwin*.c to cwd -for %f in ($(LOCAL_JMC_SRC_SUBDIR)\Mwin*.c) do $(MAKE_INSTALL) %f . @@ -81,4 +84,3 @@ MY_INSTALL_DIR = $(DIST)\lib install:: !$(MAKE_INSTALL) $(MY_INSTALL_FILE_LIST) $(MY_INSTALL_DIR) - diff --git a/mozilla/modules/libfont/public/Makefile b/mozilla/modules/libfont/public/Makefile index ebd683ffb93..f1d62884939 100644 --- a/mozilla/modules/libfont/public/Makefile +++ b/mozilla/modules/libfont/public/Makefile @@ -15,12 +15,14 @@ # Copyright (C) 1998 Netscape Communications Corporation. All Rights # Reserved. -ifndef MOZ_JAVA +DEPTH = ../../.. + +include $(DEPTH)/config/config.mk + +ifndef JAVA_OR_OJI LOCAL_JMC_SUBDIR = ../jmcgen/include endif -DEPTH = ../../.. - MODULE = libfont JMC_GEN = Mnfdoer \ diff --git a/mozilla/modules/libfont/public/makefile.win b/mozilla/modules/libfont/public/makefile.win index d195d161695..ee97c3ba3f6 100644 --- a/mozilla/modules/libfont/public/makefile.win +++ b/mozilla/modules/libfont/public/makefile.win @@ -17,14 +17,13 @@ IGNORE_MANIFEST=1 -!ifndef MOZ_JAVA -LOCAL_JMC_SUBDIR = ..\jmcgen\include -!endif - - DEPTH=..\..\.. !include $(DEPTH)\config\config.mak +!ifndef JAVA_OR_OJI +LOCAL_JMC_SUBDIR = ..\jmcgen\include +!endif + JMC_GEN=Mnfdoer Mnff Mnffbc Mnffbp Mnffbu Mnffmi Mnffp Mnfrc Mnfrf \ Mnfstrm Mnfdlm @@ -33,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)\Mnffp.h $(JMC_GEN_DIR)\Mnfrc.h $(JMC_GEN_DIR)\Mnfrf.h \ $(JMC_GEN_DIR)\Mnfstrm.h $(JMC_GEN_DIR)\Mnfdlm.h -!if !defined(MOZ_JAVA) +!if !defined(JAVA_OR_OJI) EXPORTS=$(EXPORTS) $(JMC_GEN_DIR)\Mwinfp.h !endif diff --git a/mozilla/modules/libfont/src/Makefile b/mozilla/modules/libfont/src/Makefile index 9bb62ce8e6e..11eeb9de268 100644 --- a/mozilla/modules/libfont/src/Makefile +++ b/mozilla/modules/libfont/src/Makefile @@ -15,13 +15,15 @@ # Copyright (C) 1998 Netscape Communications Corporation. All Rights # Reserved. -ifndef MOZ_JAVA +DEPTH = ../../.. + +include $(DEPTH)/config/config.mk + +ifndef JAVA_OR_OJI LOCAL_JMC_SUBDIR = ../jmcgen/include LOCAL_JMC_SRC_SUBDIR = ../jmcgen/src endif -DEPTH = ../../.. - MODULE = libfont LIBRARY_NAME = font @@ -62,7 +64,7 @@ SDK_TARGET = producer-sdk SDK_NAME = FontProducer-sdk-v1.0 SDK_DIR = $(OBJDIR)/$(SDK_TARGET) -ifndef MOZ_JAVA +ifndef JAVA_OR_OJI export:: @echo "Copying JMC src files from $(LOCAL_JMC_SRC_SUBDIR)/*.c to cwd" @for FILE in $(LOCAL_JMC_SRC_SUBDIR)/*.c ;\ diff --git a/mozilla/modules/libfont/src/makefile.win b/mozilla/modules/libfont/src/makefile.win index 5690ddd684b..11a628f471c 100644 --- a/mozilla/modules/libfont/src/makefile.win +++ b/mozilla/modules/libfont/src/makefile.win @@ -27,6 +27,9 @@ OBJS = $(OBJS) $(JMC_OBJS) DEPTH=..\..\.. + +!include $(DEPTH)\config\config.mak + MODULE=libfont JMC_GEN=Mcf Mcfb Mcfmi Mcrc Mcdoer JMC_GEN_FLAGS=-cimpl @@ -62,14 +65,14 @@ LINCS=-I$(XPDIST)\public\libfont -I$(XPDIST)\public\java \ -I$(XPDIST)\public\htmldlgs -I$(XPDIST)\public\security !endif -!if !defined (MOZ_JAVA) +!if !defined (JAVA_OR_OJI) LOCAL_JMC_SUBDIR = ..\jmcgen\include LOCAL_JMC_SRC_SUBDIR = ..\jmcgen\src !endif !include $(DEPTH)\config\rules.mak -!if !defined (MOZ_JAVA) +!if !defined (JAVA_OR_OJI) export:: @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 . diff --git a/mozilla/modules/makefile.win b/mozilla/modules/makefile.win index 362ebeb48b6..a810f47916b 100644 --- a/mozilla/modules/makefile.win +++ b/mozilla/modules/makefile.win @@ -30,6 +30,7 @@ DEPTH=.. ## Include support for MOZ_LITE/MOZ_MEDIUM +include <$(DEPTH)/config/config.mak> include <$(DEPTH)/config/liteness.mak> #//------------------------------------------------------------------------ @@ -50,7 +51,7 @@ DIRS= \ libimg \ libfont \ libreg \ -!ifdef MOZ_JAVA +!ifdef JAVA_OR_OJI !ifdef EDITOR edtplug \ !endif @@ -61,15 +62,15 @@ DIRS= \ !if ("$(MOZ_BITS)" == "16") libmem \ !endif - coreincl \ + coreincl \ !ifdef MOZ_LOC_INDEP li \ !endif !ifdef MOZ_SPELLCHK spellchk \ !endif - rdf \ - schedulr \ + rdf \ + schedulr \ xml #//------------------------------------------------------------------------ diff --git a/mozilla/modules/plugin/base/public/npapi.h b/mozilla/modules/plugin/base/public/npapi.h index 289346cb167..a206adc60be 100644 --- a/mozilla/modules/plugin/base/public/npapi.h +++ b/mozilla/modules/plugin/base/public/npapi.h @@ -18,7 +18,7 @@ /* - * npapi.h $Revision: 3.1 $ + * npapi.h $Revision: 3.1.16.1 $ * Netscape client plug-in API spec */ @@ -274,7 +274,8 @@ typedef enum { NPPVpluginWindowBool, NPPVpluginTransparentBool, NPPVjavaClass, - NPPVpluginWindowSize + NPPVpluginWindowSize, + NPPVpluginTimerInterval } NPPVariable; /* diff --git a/mozilla/modules/rdf/src/ht.c b/mozilla/modules/rdf/src/ht.c index 20c79e6a909..44d0cc12339 100644 --- a/mozilla/modules/rdf/src/ht.c +++ b/mozilla/modules/rdf/src/ht.c @@ -2545,7 +2545,7 @@ htIsMenuCmdEnabled(HT_Pane pane, HT_MenuCmd menuCmd, } else { - if ((node = HT_GetNextSelection(pane->selectedView, NULL)) == NULL) + if (pane->selectedView == NULL || (node = HT_GetNextSelection(pane->selectedView, NULL)) == NULL) { return(false); } diff --git a/mozilla/modules/softupdt/src/Makefile b/mozilla/modules/softupdt/src/Makefile index 519066e505c..5526738a049 100644 --- a/mozilla/modules/softupdt/src/Makefile +++ b/mozilla/modules/softupdt/src/Makefile @@ -17,10 +17,18 @@ DEPTH = ../../.. +include $(DEPTH)/config/config.mk + MODULE = softupdate LIBRARY_NAME = softupdate -REQUIRES = softupdt js java net dbm nspr img util layer pref jar security applet lay style libreg +REQUIRES = softupdt js java net dbm nspr img util layer pref jar security \ +#if defined(MOZ_OJI) + oji npj +#elseif defined(MOZ_JAVA) + applet \ +#endif + lay style libreg JRI_GEN = netscape.softupdate.FolderSpec \ netscape.softupdate.InstallObject \ @@ -63,7 +71,7 @@ EXPORTS = ../include/softupdt.h \ $(JRI_GEN_DIR)/netscape_softupdate_SoftwareUpdate.h \ $(JRI_GEN_DIR)/netscape_softupdate_SoftUpdateException.h \ $(JRI_GEN_DIR)/netscape_softupdate_VersionInfo.h \ - $(JRI_GEN_DIR)/netscape_softupdate_VersionRegistry.h \ + $(JRI_GEN_DIR)/netscape_softupdate_VersionRegistry.h \ $(JRI_GEN_DIR)/netscape_softupdate_VerRegEnumerator.h \ $(JRI_GEN_DIR)/netscape_softupdate_Registry.h \ $(JRI_GEN_DIR)/netscape_softupdate_RegistryNode.h \ @@ -105,4 +113,3 @@ $(OBJDIR)/vr_java.o: $(JRI_GEN_DIR)/netscape_softupdate_VersionInfo.h \ $(JRI_GEN_DIR)/netscape_softupdate_RegistryException.h \ $(JRI_GEN_DIR)/netscape_softupdate_RegKeyEnumerator.h \ $(JRI_GEN_DIR)/netscape_softupdate_RegEntryEnumerator.h - diff --git a/mozilla/modules/softupdt/src/makefile.win b/mozilla/modules/softupdt/src/makefile.win index ed4841f79de..744f118eed4 100644 --- a/mozilla/modules/softupdt/src/makefile.win +++ b/mozilla/modules/softupdt/src/makefile.win @@ -125,7 +125,12 @@ LINCS= $(LINCS) -I_jri \ LINCS= $(LINCS) \ -I$(PUBLIC)/softupdt \ -I$(PUBLIC)/libreg \ +#if defined(MOZ_OJI) + -I$(PUBLIC)/oji \ + -I$(PUBLIC)/npj \ +#elseif defined(MOZ_JAVA) -I$(PUBLIC)/applet \ +#endif -I$(PUBLIC)/java \ -I$(PUBLIC)/nspr \ -I$(PUBLIC)/js \ @@ -136,7 +141,6 @@ LINCS= $(LINCS) \ -I$(PUBLIC)/jtools/ \ -I$(PUBLIC)/winfont/ \ -I$(PUBLIC)/rdf \ - -I$(PUBLIC)/java \ -I$(PUBLIC)/applet \ -I$(PUBLIC)/rdf \ $(NULL) diff --git a/mozilla/modules/softupdt/src/su_trigger.c b/mozilla/modules/softupdt/src/su_trigger.c index 97c3730d5e2..41bf0ea806d 100644 --- a/mozilla/modules/softupdt/src/su_trigger.c +++ b/mozilla/modules/softupdt/src/su_trigger.c @@ -147,7 +147,11 @@ native_netscape_softupdate_SoftwareUpdate_VerifyJSObject(JRIEnv* env, */ JSObject * jsobj; JSClass * jsclass; +#ifdef OJI // XXX hack + jsobj = NULL; +#else jsobj = JSJ_ExtractInternalJSObject(env, (HObject*)a); +#endif jsclass = JS_GetClass(jsobj); if ( jsclass != &lm_softup_class ) { @@ -422,7 +426,11 @@ native_netscape_softupdate_SoftwareUpdate_getCertificates(JRIEnv* env, if (!pathname) return NULL; +#ifdef OJI // XXX hack + return NULL; +#else return LJ_GetCertificates(env, (void *)zigPtr, pathname); +#endif } #ifdef XP_MAC diff --git a/mozilla/nsprpub/pr/include/prmem.h b/mozilla/nsprpub/pr/include/prmem.h index dc88f755544..e2b88f82c37 100644 --- a/mozilla/nsprpub/pr/include/prmem.h +++ b/mozilla/nsprpub/pr/include/prmem.h @@ -121,7 +121,7 @@ PR_EXTERN(void) PR_Free(void *ptr); ** OUTPUTS: the referenced object is returned to the heap ** RETURN: void ***********************************************************************/ -#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; } +#define PR_DELETE(_ptr) { PR_Free((void*)_ptr); (_ptr) = NULL; } /*********************************************************************** ** FUNCTION: PR_FREEIF()