Merges from OJI_19980528_TEMP_BRANCH

This commit is contained in:
jgellman 1998-06-03 06:19:45 +00:00
Родитель ff3a76fcf6
Коммит b79d1d09f7
20 изменённых файлов: 277 добавлений и 2791 удалений

Просмотреть файл

@ -555,6 +555,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()) {
@ -575,6 +576,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()) {

Просмотреть файл

@ -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
@ -1177,12 +1179,12 @@ BOOL CDCCX::ResolveElement(LTRB& Rect, LO_EmbedStruct *pEmbed, int iLocation, Bo
// and we ignore the layer origin. For windowless embeds, we only
// need the layer origin, and not the position of the embed.
if (bWindowed) {
Rect.left += pEmbed->x + pEmbed->x_offset + pEmbed->border_width;
Rect.top += pEmbed->y + pEmbed->y_offset + pEmbed->border_width;
Rect.left += pEmbed->objTag.x + pEmbed->objTag.x_offset + pEmbed->objTag.border_width;
Rect.top += pEmbed->objTag.y + pEmbed->objTag.y_offset + pEmbed->objTag.border_width;
}
Rect.right = Rect.left + pEmbed->width;
Rect.bottom = Rect.top + pEmbed->height;
Rect.right = Rect.left + pEmbed->objTag.width;
Rect.bottom = Rect.top + pEmbed->objTag.height;
if (!bWindowed)
ExtendCoord(Rect);
@ -2554,8 +2556,8 @@ void CDCCX::DisplayImageFeedback(MWContext *pContext, int iLocation, LO_Element
BOOL CDCCX::IsPluginFullPage(LO_EmbedStruct *pLayoutData)
{
// 1x1 size is signal that plugin is full page, not embedded
if((pLayoutData->width == Pix2TwipsX(1))
&& (pLayoutData->height == Pix2TwipsX(1)))
if((pLayoutData->objTag.width == Pix2TwipsX(1))
&& (pLayoutData->objTag.height == Pix2TwipsX(1)))
return TRUE;
return FALSE;
}
@ -2662,7 +2664,7 @@ void CDCCX::DisplayPlugin(MWContext *pContext, LO_EmbedStruct *pEmbed,
return;
if (::IsWindowVisible((HWND)pAppWin->window) &&
(pEmbed->ele_attrmask & LO_ELE_INVISIBLE))
(pEmbed->objTag.ele_attrmask & LO_ELE_INVISIBLE))
::ShowWindow((HWND)pAppWin->window, SW_HIDE);
// If the plugin is embedded we need to make sure the window is
@ -2697,14 +2699,14 @@ void CDCCX::DisplayPlugin(MWContext *pContext, LO_EmbedStruct *pEmbed,
}
if (!::IsWindowVisible((HWND)pAppWin->window) &&
!(pEmbed->ele_attrmask & LO_ELE_INVISIBLE))
!(pEmbed->objTag.ele_attrmask & LO_ELE_INVISIBLE))
::ShowWindow((HWND)pAppWin->window, SW_SHOW);
}
void CDCCX::DisplayEmbed(MWContext *pContext, int iLocation, LO_EmbedStruct *pEmbed)
{
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pEmbed->FE_Data;
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pEmbed->objTag.FE_Data;
if(pEmbeddedApp == NULL)
return;
@ -2733,8 +2735,8 @@ void CDCCX::DisplayEmbed(MWContext *pContext, int iLocation, LO_EmbedStruct *pEm
SafeSixteen(Rect);
// Draw a border around the embed if needed.
if(pEmbed->border_width != 0) {
DrawRectBorder(Rect, ResolveBorderColor(NULL), pEmbed->border_width);
if(pEmbed->objTag.border_width != 0) {
DrawRectBorder(Rect, ResolveBorderColor(NULL), pEmbed->objTag.border_width);
}
// Get the embedded item
@ -3796,14 +3798,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();
@ -3827,10 +3829,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

Просмотреть файл

@ -731,7 +731,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,

Просмотреть файл

@ -1844,14 +1844,15 @@ void CPrintCX::DisplayEmbed(MWContext *pContext, int iLocation, LO_EmbedStruct *
return;
else if (GetDisplayMode() == CAPTURE_POSITION) {
// Capture the coordinates of this element.
Capture(pEmbed->x + pEmbed->x_offset, pEmbed->y + pEmbed->y_offset, pEmbed->width, pEmbed->height);
Capture(pEmbed->objTag.x + pEmbed->objTag.x_offset, pEmbed->objTag.y + pEmbed->objTag.y_offset,
pEmbed->objTag.width, pEmbed->objTag.height);
// We don't actually allow display while we are capturing the area.
return;
}
// Call the base for actual display.
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pEmbed->FE_Data;
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pEmbed->objTag.FE_Data;
if (pEmbeddedApp->type == NP_OLE) {
CNetscapeCntrItem *pItem = (CNetscapeCntrItem *)pEmbeddedApp->fe_data;
pItem->SetPrintDevice( &(m_pcpiPrintJob->m_pPD->m_pd) );

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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...
//
@ -623,7 +635,7 @@ void CWinCX::OnDeactivateEmbedCX() {
CGenericView *pView = GetView();
if(pView != NULL && m_pSelected != NULL) {
// Obtain the plugin structure.
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)m_pSelected->FE_Data;
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)m_pSelected->objTag.FE_Data;
// Make sure it is not a plugin, but an OLE container item.
if(pPluginShim != NULL && wfe_IsTypePlugin(pPluginShim) == FALSE) {
// Get the container item, and deactivate it.
@ -1246,7 +1258,7 @@ BOOL CWinCX::HandleEmbedEvent(LO_EmbedStruct *embed, CL_Event *pEvent)
{
NPEvent npEvent;
fe_EventStruct *pFEEvent = (fe_EventStruct *)pEvent->fe_event;
NPEmbeddedApp *pEmbeddedApp = (NPEmbeddedApp *)embed->FE_Data;
NPEmbeddedApp *pEmbeddedApp = (NPEmbeddedApp *)embed->objTag.FE_Data;
if (CL_IS_MOUSE_EVENT(pEvent)) {
if (pFEEvent)
@ -1557,7 +1569,7 @@ CWinCX::OnLButtonDblClkForLayerCX(UINT uFlags, CPoint& cpPoint,
if(pElement != NULL && pElement->type == LO_EMBED) {
// Any previous activated embed was deactivated in the button down event.
// However, we should not reactivate an already active item.
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pElement->lo_embed.FE_Data;
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pElement->lo_embed.objTag.FE_Data;
ASSERT(pEmbeddedApp);
CNetscapeCntrItem *pItem = (CNetscapeCntrItem *)pEmbeddedApp->fe_data;
if(pItem != NULL) {
@ -3996,7 +4008,7 @@ void CWinCX::CreateEmbedWindow(MWContext *pContext, NPEmbeddedApp *pApp)
HWND hWnd = ::CreateWindow(szClassName,
"a Plugin Window",
WS_CHILD | (pEmbed->ele_attrmask & LO_ELE_INVISIBLE ? 0 : WS_VISIBLE),
WS_CHILD | (pEmbed->objTag.ele_attrmask & LO_ELE_INVISIBLE ? 0 : WS_VISIBLE),
rect.left,
rect.top,
rect.right - rect.left,
@ -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)
@ -4150,7 +4160,7 @@ FE_CreateJavaWindow(MWContext *pContext, LO_JavaAppStruct *java_struct,
int32 xp, int32 yp, int32 xs, int32 ys)
{
CWinCX* ctxt = WINCX(pContext);
LJAppletData* ad = (LJAppletData*)java_struct->session_data;
LJAppletData* ad = (LJAppletData*)java_struct->objTag.session_data;
HWND parent;
PR_ASSERT(ad);
@ -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,24 +4364,26 @@ 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?
// FE_DisplayNoJavaIcon(pContext, java_struct);
java_struct->width = 1;
java_struct->height = 1;
java_struct->objTag.width = 1;
java_struct->objTag.height = 1;
#endif /* ! JAVA */
}
#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::HandleClippingView(MWContext *pContext, LJAppletData *appletD, int x, int y, int width, int height)
{
}
void CWinCX::LayoutNewDocument(MWContext *pContext, URL_Struct *pURL, int32 *pWidth, int32 *pHeight, int32 *pmWidth, int32 *pmHeight)
{
// Call the base.
@ -6238,8 +6250,8 @@ mouse_over_callback(MWContext * context, LO_Element * lo_element, int32 event,
// See if we are over an embedded item.
pEmbed = (LO_EmbedStruct *)lo_element;
if(pEmbed && pEmbed->type == LO_EMBED && pEmbed->FE_Data) {
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)pEmbed->FE_Data;
if(pEmbed && pEmbed->objTag.type == LO_EMBED && pEmbed->objTag.FE_Data) {
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)pEmbed->objTag.FE_Data;
if(pPluginShim != NULL && wfe_IsTypePlugin(pPluginShim) == FALSE) {
CNetscapeCntrItem *pItem = (CNetscapeCntrItem *)pPluginShim->fe_data;
if(pItem != NULL && pItem->m_bLoading == FALSE && pItem->m_bBroken == FALSE &&

Просмотреть файл

@ -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);

Просмотреть файл

@ -100,6 +100,7 @@ extern int wfe_FillFontComboBox(CComboBox * pCombo, int * pMaxWidth = NULL);
// Total font sizes with Netscape extension -- SHOULD GET THIS FROM A COMMON H FILE!
#define MAX_FONT_SIZE 7
#define MIN_FONT_SIZE 7 // XXX I don't know where this is supposed to come from, but it's breaking my build.
// We map {-2 ... +4} onto absolute sizes {1 ... 7}
// This is minimum of scale

Просмотреть файл

@ -159,12 +159,12 @@ void EmbedUrlExit(URL_Struct *pUrl, int iStatus, MWContext *pContext)
while(rIndex != NULL && iStatus != MK_INTERRUPTED) {
pLayoutData = (LO_EmbedStruct *)pItem->m_cplUnblock.GetNext(rIndex);
if ((pEmbeddedApp->type == NP_OLE) && pItem->m_lpObject) {
if ( pLayoutData->width)
csExtents.cx = pLayoutData->width;
if ( pLayoutData->height)
csExtents.cy = pLayoutData->height;
pLayoutData->width = csExtents.cx;
pLayoutData->height = csExtents.cy;
if ( pLayoutData->objTag.width)
csExtents.cx = pLayoutData->objTag.width;
if ( pLayoutData->objTag.height)
csExtents.cy = pLayoutData->objTag.height;
pLayoutData->objTag.width = csExtents.cx;
pLayoutData->objTag.height = csExtents.cy;
}
LO_ClearEmbedBlock(ABSTRACTCX(pContext)->GetDocumentContext(), pLayoutData);
@ -186,20 +186,20 @@ void EmbedUrlExit(URL_Struct *pUrl, int iStatus, MWContext *pContext)
pLayoutData = (LO_EmbedStruct *)pItem->m_cplDisplay.GetNext(rIndex);
if ((pEmbeddedApp->type == NP_OLE) && pItem->m_lpObject) {
if ( pLayoutData->width )
csExtents.cx = pLayoutData->width;
if ( pLayoutData->height)
csExtents.cy = pLayoutData->height;
pLayoutData->width = csExtents.cx;
pLayoutData->height = csExtents.cy;
if ( pLayoutData->objTag.width )
csExtents.cx = pLayoutData->objTag.width;
if ( pLayoutData->objTag.height)
csExtents.cy = pLayoutData->objTag.height;
pLayoutData->objTag.width = csExtents.cx;
pLayoutData->objTag.height = csExtents.cy;
}
#ifdef LAYERS
if (pContext->compositor) {
XP_Rect rect;
CL_GetLayerBbox(pLayoutData->layer, &rect);
CL_UpdateLayerRect(CL_GetLayerCompositor(pLayoutData->layer),
pLayoutData->layer, &rect, PR_FALSE);
CL_GetLayerBbox(pLayoutData->objTag.layer, &rect);
CL_UpdateLayerRect(CL_GetLayerCompositor(pLayoutData->objTag.layer),
pLayoutData->objTag.layer, &rect, PR_FALSE);
}
else
#endif /* LAYERS */
@ -260,16 +260,16 @@ static void wfe_PluginStream(URL_Struct *pUrlData, MWContext *pContext)
/* Convert layer-relative coordinates for element to document
coordinates, since that's what the FE uses. */
rect.top = rect.left = rect.right = rect.bottom = 0;
CL_LayerToWindowRect(pContext->compositor, pLayoutData->layer, &rect);
CL_LayerToWindowRect(pContext->compositor, pLayoutData->objTag.layer, &rect);
CL_WindowToDocumentRect(pContext->compositor, &rect);
/* Save old, layer-relative coordinates */
lXSave = pLayoutData->x;
lYSave = pLayoutData->y;
lXSave = pLayoutData->objTag.x;
lYSave = pLayoutData->objTag.y;
/* Temporarily shift element to document coordinates */
pLayoutData->x = rect.left - pLayoutData->x_offset;
pLayoutData->y = rect.top - pLayoutData->y_offset;
pLayoutData->objTag.x = rect.left - pLayoutData->objTag.x_offset;
pLayoutData->objTag.y = rect.top - pLayoutData->objTag.y_offset;
}
#endif /* LAYERS */
@ -278,8 +278,8 @@ static void wfe_PluginStream(URL_Struct *pUrlData, MWContext *pContext)
#ifdef LAYERS
if (pContext->compositor) {
pLayoutData->x = lXSave;
pLayoutData->y = lYSave;
pLayoutData->objTag.x = lXSave;
pLayoutData->objTag.y = lYSave;
}
#endif /* LAYERS */

Просмотреть файл

@ -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);

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -364,9 +364,9 @@ void CGenericDoc::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pLayoutData,
if (rIndex) {
LO_EmbedStruct* pLayoutData = (LO_EmbedStruct *)pItem->m_cplElements.GetNext(rIndex);
ASSERT(pLayoutData && pLayoutData->type == LO_EMBED);
ASSERT(pLayoutData && pLayoutData->objTag.type == LO_EMBED);
if (pLayoutData) {
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pLayoutData->FE_Data;
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pLayoutData->objTag.FE_Data;
ASSERT(pEmbeddedApp);
if (pEmbeddedApp && pEmbeddedApp->type == NP_OLE)
@ -408,11 +408,11 @@ void CGenericDoc::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pLayoutData,
pEmbeddedApp->wdata = pAppWin;
// Go ahead and assign it into the layout data for use in other functions.
pLayoutData->FE_Data = (void *)pEmbeddedApp;
pLayoutData->objTag.FE_Data = (void *)pEmbeddedApp;
pItem->m_iLock++;
// Is layout blocking for this information?
if(pLayoutData->width == 0 || pLayoutData->height == 0) {
if(pLayoutData->objTag.width == 0 || pLayoutData->objTag.height == 0) {
if(pItem->m_bLoading == TRUE) {
// Add this layout element to those that will be unblocked once loaded.
@ -439,12 +439,12 @@ void CGenericDoc::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pLayoutData,
csExtents.cx = pCX->Metric2TwipsX(csExtents.cx);
csExtents.cy = pCX->Metric2TwipsY(csExtents.cy);
if ( pLayoutData->width )
csExtents.cx = pLayoutData->width;
if ( pLayoutData->height )
csExtents.cy = pLayoutData->height;
pLayoutData->width = csExtents.cx;
pLayoutData->height = csExtents.cy;
if ( pLayoutData->objTag.width )
csExtents.cx = pLayoutData->objTag.width;
if ( pLayoutData->objTag.height )
csExtents.cy = pLayoutData->objTag.height;
pLayoutData->objTag.width = csExtents.cx;
pLayoutData->objTag.height = csExtents.cy;
}
return;
@ -506,8 +506,8 @@ void CGenericDoc::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pLayoutData,
//
// If we're printing we will use a cached app from the session data so we don't
// need to do either of these
if ((pLayoutData->ele_attrmask & LO_ELE_HIDDEN) == 0 && !bPrinting) {
if(pLayoutData->width == 0 || pLayoutData->height == 0) {
if ((pLayoutData->objTag.ele_attrmask & LO_ELE_HIDDEN) == 0 && !bPrinting) {
if(pLayoutData->objTag.width == 0 || pLayoutData->objTag.height == 0) {
// Layout is blocking, be sure to unblock once loaded.
pItem->m_cplUnblock.AddTail(pLayoutData);
}
@ -542,19 +542,19 @@ void CGenericDoc::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pLayoutData,
csExtents.cx = pCX->Metric2TwipsX(csExtents.cx);
csExtents.cy = pCX->Metric2TwipsY(csExtents.cy);
if ( pLayoutData->width )
csExtents.cx = pLayoutData->width;
if ( pLayoutData->height )
csExtents.cy = pLayoutData->height;
pLayoutData->width = csExtents.cx;
pLayoutData->height = csExtents.cy;
if ( pLayoutData->objTag.width )
csExtents.cx = pLayoutData->objTag.width;
if ( pLayoutData->objTag.height )
csExtents.cy = pLayoutData->objTag.height;
pLayoutData->objTag.width = csExtents.cx;
pLayoutData->objTag.height = csExtents.cy;
// In the printing case, an OLE container is not windowed
LO_SetEmbedType(pLayoutData, PR_FALSE);
}
else {
// so layout will not block on us. Since this embed element is missing.
pLayoutData->width = 1;
pLayoutData->height = 1;
pLayoutData->objTag.width = 1;
pLayoutData->objTag.height = 1;
}
@ -593,13 +593,13 @@ void CGenericDoc::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pLayoutData,
pItem->m_csAddress = pLayoutAddress;
// Go ahead and assign it into the layout data for use in other functions.
pLayoutData->FE_Data = (void *)pEmbeddedApp;
pLayoutData->objTag.FE_Data = (void *)pEmbeddedApp;
// Now that we've set the NPEmbeddedApp's fe_data and layout's FE_Data we can start the embed
if (NPL_EmbedStart(pContext, pLayoutData, pEmbeddedApp) != NPERR_NO_ERROR) {
// Something went wrong. Time to clean up. The XP code has already deleted
// the NPEmbeddedApp
pLayoutData->FE_Data = NULL;
pLayoutData->objTag.FE_Data = NULL;
pItem->m_bLoading = FALSE;
delete pItem;
}
@ -609,7 +609,7 @@ void CGenericDoc::GetEmbedSize(MWContext *pContext, LO_EmbedStruct *pLayoutData,
void CGenericDoc::FreeEmbedElement(MWContext *pContext, LO_EmbedStruct *pLayoutData)
{
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pLayoutData->FE_Data;
NPEmbeddedApp* pEmbeddedApp = (NPEmbeddedApp*)pLayoutData->objTag.FE_Data;
CNetscapeCntrItem* pItem = NULL;
CNetscapeCntrItem* curItem = NULL;
int32 iRefCountIndicator = 0;
@ -643,7 +643,7 @@ void CGenericDoc::FreeEmbedElement(MWContext *pContext, LO_EmbedStruct *pLayoutD
curItem = (CNetscapeCntrItem*)pEmbeddedApp->fe_data;
NPL_EmbedDelete(pContext, pLayoutData);
pLayoutData->FE_Data = NULL;
pLayoutData->objTag.FE_Data = NULL;
// If the item is already gone, bail now.
// Also check for npdata->refs being greater or equal 0

Просмотреть файл

@ -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
@ -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,59 @@ void CGenericFrame::OnShowBookmarkWindow()
}
///////////////////////////////////////////////////////////////////////////////
#ifdef JAVA
#if defined(OJI) || defined(JAVA)
void CGenericFrame::OnToggleJavaConsole()
{
if( LJ_IsConsoleShowing() ) {
LJ_HideConsole();
} else {
LJ_ShowConsole();
#ifdef OJI
JVMMgr* jvmMgr = JVM_GetJVMMgr();
if (jvmMgr == NULL)
return;
NPIJVMPlugin* jvm = jvmMgr->GetJVM();
if (jvm) {
if (jvm->IsConsoleVisible()) {
jvm->HideConsole();
} else {
jvm->ShowConsole();
}
jvm->Release();
}
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);
}
jvm->Release();
}
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()
{

Просмотреть файл

@ -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

Просмотреть файл

@ -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"

Просмотреть файл

@ -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

Просмотреть файл

@ -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,31 @@ 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();
jvm->Release();
}
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 +1760,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 +2095,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 +2108,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)

Просмотреть файл

@ -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) {

Просмотреть файл

@ -195,7 +195,7 @@ BOOL CNetscapeView::AddEmbedToPopup(CMenu * pMenu, LO_Element * pElement, CL_Lay
// Inline
CNetscapeCntrItem *pItem = NULL;
if(pElement != NULL && pElement->type == LO_EMBED) {
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)((LO_EmbedStruct *)pElement)->FE_Data;
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)((LO_EmbedStruct *)pElement)->objTag.FE_Data;
if(pPluginShim != NULL && wfe_IsTypePlugin(pPluginShim) == FALSE) {
pItem = (CNetscapeCntrItem *)pPluginShim->fe_data;
}
@ -1228,11 +1228,11 @@ void CNetscapeView::OnPopupActivateEmbed() {
CWinCX *pWinCX = GetContext();
if(pWinCX && pWinCX->m_pSelected) {
// Figure out the rect that the item covers.
long lLeft = pWinCX->m_pSelected->x + pWinCX->m_pSelected->y_offset - pWinCX->GetOriginX();
long lRight = lLeft + pWinCX->m_pSelected->width;
long lLeft = pWinCX->m_pSelected->objTag.x + pWinCX->m_pSelected->objTag.y_offset - pWinCX->GetOriginX();
long lRight = lLeft + pWinCX->m_pSelected->objTag.width;
long lTop = pWinCX->m_pSelected->y + pWinCX->m_pSelected->y_offset - pWinCX->GetOriginY();
long lBottom = lTop + pWinCX->m_pSelected->height;
long lTop = pWinCX->m_pSelected->objTag.y + pWinCX->m_pSelected->objTag.y_offset - pWinCX->GetOriginY();
long lBottom = lTop + pWinCX->m_pSelected->objTag.height;
HDC pDC = pWinCX->GetContextDC();
RECT crBounds;
@ -1251,7 +1251,7 @@ void CNetscapeView::OnPopupActivateEmbed() {
if(m_pRBElement != NULL) {
if(m_pRBElement->type == LO_EMBED) {
LO_EmbedStruct *pLayoutData = (LO_EmbedStruct *)m_pRBElement;
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)pLayoutData->FE_Data;
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)pLayoutData->objTag.FE_Data;
if(pPluginShim != NULL && wfe_IsTypePlugin(pPluginShim) == FALSE) {
CNetscapeCntrItem *pItem = (CNetscapeCntrItem *)pPluginShim->fe_data;
@ -1324,7 +1324,7 @@ void CNetscapeView::OnPopupCopyEmbedToClipboard() {
if(m_pRBElement != NULL) {
if(m_pRBElement->type == LO_EMBED) {
LO_EmbedStruct *pLayoutData = (LO_EmbedStruct *)m_pRBElement;
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)pLayoutData->FE_Data;
NPEmbeddedApp *pPluginShim = (NPEmbeddedApp *)pLayoutData->objTag.FE_Data;
if(pPluginShim != NULL && wfe_IsTypePlugin(pPluginShim) == FALSE) {
CNetscapeCntrItem *pItem = (CNetscapeCntrItem *)pPluginShim->fe_data;

Просмотреть файл

@ -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,37 @@ 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();
}
jvm->Release();
}
jvmMgr->Release();
}
#else
LJ_StartDebugger(LJDebugPort_SharedMemory);
#endif
}