зеркало из https://github.com/mozilla/pjs.git
Webclient compiles with 1.3A but does not yet link.
This commit is contained in:
Родитель
37950f0b09
Коммит
a87c8aa951
|
@ -96,10 +96,8 @@
|
|||
executable="gmake"/>
|
||||
<exec os="Linux" dir="${basedir}/src_share" failonerror="yes"
|
||||
executable="make"/>
|
||||
<exec os="Windows 2000" dir="${basedir}/src_share" executable="nmake"
|
||||
failonerror="yes">
|
||||
<arg line="-f makefile.win"/>
|
||||
</exec>
|
||||
<exec os="Windows 2000" dir="${basedir}/src_share" executable="make"
|
||||
failonerror="yes"/>
|
||||
|
||||
</target>
|
||||
|
||||
|
@ -182,10 +180,8 @@
|
|||
<exec os="Linux" dir="${basedir}/src_moz" executable="make"
|
||||
failonerror="yes">
|
||||
</exec>
|
||||
<exec os="Windows 2000" dir="${basedir}/src_moz" executable="nmake"
|
||||
failonerror="yes">
|
||||
<arg line="-f makefile.win"/>
|
||||
</exec>
|
||||
<exec os="Windows 2000" dir="${basedir}/src_moz" executable="make"
|
||||
failonerror="yes"/>
|
||||
|
||||
<exec os="SunOS" dir="${basedir}/src_moz" executable="gmake"
|
||||
failonerror="yes">
|
||||
|
@ -195,10 +191,8 @@
|
|||
failonerror="yes">
|
||||
<arg line="buildRunems"/>
|
||||
</exec>
|
||||
<exec os="Windows 2000" dir="${basedir}/src_moz" executable="nmake"
|
||||
failonerror="yes">
|
||||
<arg line="-f makefile.win buildRunems"/>
|
||||
</exec>
|
||||
<exec os="Windows 2000" dir="${basedir}/src_moz" executable="make"
|
||||
failonerror="yes"/>
|
||||
|
||||
</target>
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ CBrowserContainer::CBrowserContainer(nsIWebBrowser *pOwner, JNIEnv *env,
|
|||
mDomEventTarget(nsnull), inverseDepth(-1),
|
||||
properties(nsnull), currentDOMEvent(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_INIT_ISUPPORTS();
|
||||
// initialize the string constants (including properties keys)
|
||||
if (!util_StringConstantsAreInitialized()) {
|
||||
util_InitStringConstants();
|
||||
|
|
|
@ -33,19 +33,19 @@
|
|||
|
||||
#include "CurrentPageActionEvents.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsISearchContext.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIContentViewerEdit.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIHistoryEntry.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIFindComponent.h"
|
||||
#include "nsIWebBrowserFind.h"
|
||||
|
||||
wsCopySelectionEvent::wsCopySelectionEvent(WebShellInitContext *yourInitContext) :
|
||||
nsActionEvent(),
|
||||
|
@ -102,99 +102,48 @@ wsFindEvent::handleEvent ()
|
|||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
|
||||
if (mInitContext) {
|
||||
//First get the FindComponent object
|
||||
nsCOMPtr<nsIFindComponent> findComponent;
|
||||
findComponent = do_GetService(NS_IFINDCOMPONENT_CONTRACTID, &rv);
|
||||
//First get the nsIWebBrowserFind object
|
||||
nsCOMPtr<nsIWebBrowserFind> findComponent;
|
||||
nsCOMPtr<nsIInterfaceRequestor>
|
||||
findRequestor(do_GetInterface(mInitContext->webBrowser));
|
||||
|
||||
rv = findRequestor->GetInterface(NS_GET_IID(nsIWebBrowserFind),
|
||||
getter_AddRefs(findComponent));
|
||||
|
||||
if (NS_FAILED(rv) || nsnull == findComponent) {
|
||||
return (void *) rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> searchContext;
|
||||
// get the nsISearchContext
|
||||
// No seachString means this is Find, not FindNext.
|
||||
|
||||
// If this a Find, not a FindNext, we must make the
|
||||
// nsIWebBrowserFind instance aware of the string to search.
|
||||
if (mSearchString) {
|
||||
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindowInternal;
|
||||
if (mInitContext->docShell != nsnull) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> interfaceRequestor(do_QueryInterface(mInitContext->docShell));
|
||||
nsCOMPtr<nsIURI> url = nsnull;
|
||||
|
||||
rv = mInitContext->webNavigation->GetCurrentURI(getter_AddRefs(url));
|
||||
if (NS_FAILED(rv) || nsnull == url) {
|
||||
return (void *) rv;
|
||||
}
|
||||
|
||||
if (interfaceRequestor != nsnull) {
|
||||
rv = interfaceRequestor->GetInterface(NS_GET_IID(nsIDOMWindowInternal),
|
||||
getter_AddRefs(domWindowInternal));
|
||||
if (NS_FAILED(rv) || nsnull == domWindowInternal) {
|
||||
return (void *) rv;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mInitContext->initFailCode = kFindComponentError;
|
||||
return (void *) rv;
|
||||
}
|
||||
}
|
||||
else {
|
||||
mInitContext->initFailCode = kFindComponentError;
|
||||
return (void *) rv;
|
||||
}
|
||||
PRUnichar * srchString = nsnull;
|
||||
|
||||
// if we get here, we have a domWindowInternal
|
||||
|
||||
rv = findComponent->CreateContext(domWindowInternal, nsnull, getter_AddRefs(searchContext));
|
||||
if (NS_FAILED(rv)) {
|
||||
mInitContext->initFailCode = kSearchContextError;
|
||||
return (void *) rv;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
// this is findNext
|
||||
searchContext = mInitContext->searchContext;
|
||||
}
|
||||
if (!searchContext) {
|
||||
mInitContext->initFailCode = kSearchContextError;
|
||||
return (void *) NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISearchContext> srchcontext;
|
||||
rv = searchContext->QueryInterface(NS_GET_IID(nsISearchContext), getter_AddRefs(srchcontext));
|
||||
if (NS_FAILED(rv)) {
|
||||
mInitContext->initFailCode = kSearchContextError;
|
||||
return (void *) rv;
|
||||
}
|
||||
|
||||
PRUnichar * aString;
|
||||
srchcontext->GetSearchString(& aString);
|
||||
|
||||
PRUnichar * srchString = nsnull;
|
||||
if (mSearchString) {
|
||||
srchString = (PRUnichar *) ::util_GetStringChars(env, mSearchString);
|
||||
srchString = (PRUnichar *) ::util_GetStringChars(env,
|
||||
mSearchString);
|
||||
|
||||
// Check if String is NULL
|
||||
if (nsnull == srchString) {
|
||||
return (void *) NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
srchcontext->SetSearchString(srchString);
|
||||
srchcontext->SetSearchBackwards(!mForward);
|
||||
srchcontext->SetCaseSensitive(mMatchCase);
|
||||
}
|
||||
|
||||
PRBool found = PR_TRUE;
|
||||
rv = findComponent->FindNext(srchcontext, &found);
|
||||
result = (void *) rv;
|
||||
if (mSearchString) {
|
||||
rv = findComponent->SetSearchString(srchString);
|
||||
if (NS_FAILED(rv)) {
|
||||
mInitContext->initFailCode = kFindComponentError;
|
||||
return (void *) rv;
|
||||
}
|
||||
::util_ReleaseStringChars(env, mSearchString, srchString);
|
||||
::util_DeleteGlobalRef(env, mSearchString);
|
||||
mSearchString = nsnull;
|
||||
|
||||
}
|
||||
// Save in initContext struct for future findNextInPage calls
|
||||
mInitContext->searchContext = srchcontext;
|
||||
findComponent->SetFindBackwards(!mForward);
|
||||
findComponent->SetMatchCase(mMatchCase);
|
||||
|
||||
|
||||
PRBool found = PR_TRUE;
|
||||
rv = findComponent->FindNext(&found);
|
||||
result = (void *) rv;
|
||||
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "nsActions.h"
|
||||
|
||||
#include "nsIContentViewerEdit.h"
|
||||
#include "nsISearchContext.h"
|
||||
#include "nsISHistory.h"
|
||||
#include "ns_util.h"
|
||||
|
||||
|
|
|
@ -94,10 +94,9 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_CurrentPageImp
|
|||
WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr;
|
||||
//First get the FindComponent object
|
||||
|
||||
// Pass searchContext to findComponent for the actual find call
|
||||
PRBool found = PR_TRUE;
|
||||
|
||||
if (initContext->initComplete && initContext->searchContext) {
|
||||
if (initContext->initComplete) {
|
||||
wsFindEvent * actionEvent = new wsFindEvent(initContext);
|
||||
PLEvent * event = (PLEvent*) *actionEvent;
|
||||
::util_PostEvent(initContext, event);
|
||||
|
@ -237,7 +236,6 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_CurrentPageImp
|
|||
(JNIEnv * env, jobject obj, jint webShellPtr)
|
||||
{
|
||||
WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr;
|
||||
initContext->searchContext = nsnull;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ InputStreamShim::InputStreamShim(jobject yourJavaStreamRef,
|
|||
mCountFromMozilla(0), mAvailable(0), mAvailableForMozilla(0), mNumRead(0),
|
||||
mDoClose(PR_FALSE), mDidClose(PR_FALSE), mLock(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_INIT_ISUPPORTS();
|
||||
mLock = PR_NewLock();
|
||||
JNIEnv *env = (JNIEnv *) JNU_GetEnv(gVm, JNI_VERSION);
|
||||
}
|
||||
|
|
|
@ -206,8 +206,7 @@ wsLoadFromStreamEvent::~wsLoadFromStreamEvent ()
|
|||
* wsPostEvent
|
||||
*/
|
||||
wsPostEvent::wsPostEvent(WebShellInitContext *yourInitContext,
|
||||
const PRUnichar *absoluteUrlToCopy,
|
||||
PRInt32 absoluteUrlLength,
|
||||
nsIURI *absoluteUri,
|
||||
const PRUnichar *targetToCopy,
|
||||
PRInt32 targetLength,
|
||||
PRInt32 postDataLength,
|
||||
|
@ -217,8 +216,7 @@ wsPostEvent::wsPostEvent(WebShellInitContext *yourInitContext,
|
|||
nsActionEvent(),
|
||||
mInitContext(yourInitContext)
|
||||
{
|
||||
mAbsoluteURL = new nsString(absoluteUrlToCopy, absoluteUrlLength);
|
||||
|
||||
mAbsoluteURI = absoluteUri;
|
||||
if (targetToCopy != nsnull){
|
||||
mTarget = new nsString(targetToCopy, targetLength);
|
||||
}
|
||||
|
@ -320,7 +318,7 @@ wsPostEvent::handleEvent ()
|
|||
|
||||
rv = lh->OnLinkClick(content,
|
||||
eLinkVerb_Replace,
|
||||
mAbsoluteURL->get(),
|
||||
mAbsoluteURI,
|
||||
((mTarget != nsnull) ? mTarget->get() : nsnull),
|
||||
postDataStream,
|
||||
headersDataStream);
|
||||
|
@ -331,8 +329,7 @@ wsPostEvent::handleEvent ()
|
|||
|
||||
wsPostEvent::~wsPostEvent ()
|
||||
{
|
||||
if (mAbsoluteURL != nsnull)
|
||||
delete mAbsoluteURL;
|
||||
mAbsoluteURI = nsnull;
|
||||
if (mTarget != nsnull)
|
||||
delete mTarget;
|
||||
mPostData = nsnull;
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "nsActions.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIURI.h"
|
||||
#include "ns_util.h"
|
||||
|
||||
struct WebShellInitContext;
|
||||
|
@ -81,8 +82,7 @@ protected:
|
|||
class wsPostEvent : public nsActionEvent {
|
||||
public:
|
||||
wsPostEvent(WebShellInitContext *yourInitContext,
|
||||
const PRUnichar *absoluteUrlToCopy,
|
||||
PRInt32 absoluteUrlLength,
|
||||
nsIURI *absoluteUrl,
|
||||
const PRUnichar *targetToCopy,
|
||||
PRInt32 targetLength,
|
||||
PRInt32 postDataLength,
|
||||
|
@ -98,7 +98,7 @@ private:
|
|||
protected:
|
||||
|
||||
WebShellInitContext *mInitContext;
|
||||
nsString *mAbsoluteURL;
|
||||
nsCOMPtr<nsIURI> mAbsoluteURI;
|
||||
nsString *mTarget;
|
||||
const char *mPostData;
|
||||
const char *mPostHeaders;
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
#include "NavigationImpl.h"
|
||||
|
||||
#include "NavigationActionEvents.h"
|
||||
#include "nsIServiceManagerUtils.h"
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetCID.h"
|
||||
|
||||
#include "ns_util.h"
|
||||
|
||||
|
@ -159,6 +163,15 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NavigationImpl
|
|||
const char *postHeadersChars = nsnull;
|
||||
char *headersAndData = nsnull;
|
||||
wsPostEvent *actionEvent = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID,
|
||||
&rv);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
NS_ConvertUCS2toUTF8 uriACString(urlChars);
|
||||
|
||||
if (!ioService || NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (initContext == nsnull || !initContext->initComplete) {
|
||||
::util_ThrowExceptionToJava(env, "Exception: null webShellPtr passed to nativePost");
|
||||
|
@ -219,10 +232,15 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_NavigationImpl
|
|||
}
|
||||
}
|
||||
|
||||
rv = ioService->NewURI(uriACString, nsnull, nsnull,
|
||||
getter_AddRefs(uri));
|
||||
if (!uri || NS_FAILED(rv)) {
|
||||
goto NPFS_CLEANUP;
|
||||
}
|
||||
|
||||
|
||||
if (!(actionEvent = new wsPostEvent(initContext,
|
||||
urlChars,
|
||||
urlLen,
|
||||
uri,
|
||||
targetChars,
|
||||
targetLen,
|
||||
(PRInt32) postDataLength,
|
||||
|
|
|
@ -37,6 +37,9 @@
|
|||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsEmbedAPI.h" // for NS_TermEmbedding
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -137,7 +140,6 @@ wsDeallocateInitContextEvent::handleEvent ()
|
|||
mInitContext->w = -1;
|
||||
mInitContext->h = -1;
|
||||
mInitContext->gtkWinPtr = nsnull;
|
||||
mInitContext->searchContext = nsnull;
|
||||
|
||||
// make sure we aren't listening anymore. This needs to be done
|
||||
// before currentDocument = nsnull
|
||||
|
@ -151,7 +153,7 @@ wsDeallocateInitContextEvent::handleEvent ()
|
|||
if (isLastWindow) {
|
||||
NS_TermEmbedding();
|
||||
#ifdef _WIN32
|
||||
_exit(0);
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
return (void *) NS_OK;
|
||||
|
|
|
@ -98,7 +98,6 @@ JNIEXPORT jint JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI
|
|||
initContext->y = y;
|
||||
initContext->w = width;
|
||||
initContext->h = height;
|
||||
initContext->searchContext = nsnull;
|
||||
initContext->currentDocument = nsnull;
|
||||
initContext->browserContainer = nsnull;
|
||||
util_InitializeShareInitContext(&(initContext->shareContext));
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
#include "nsIThread.h" // for PRThread
|
||||
#include "nsIWebShell.h" // for nsIWebShell
|
||||
#include "nsIEventQueueService.h" // for PLEventQueue
|
||||
#include "nsISearchContext.h" // for Find
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
#include "wcIBrowserContainer.h" // our BrowserContainer
|
||||
|
@ -101,7 +100,6 @@ struct WebShellInitContext {
|
|||
int w;
|
||||
int h;
|
||||
int gtkWinPtr;
|
||||
nsCOMPtr<nsISearchContext> searchContext;
|
||||
nsCOMPtr<nsIDOMDocument> currentDocument;
|
||||
nsCOMPtr<wcIBrowserContainer> browserContainer;
|
||||
// This struct contains all per-window information not specific to mozilla
|
||||
|
@ -118,7 +116,6 @@ enum {
|
|||
kHistoryWebShellError,
|
||||
kClipboardWebShellError,
|
||||
kFindComponentError,
|
||||
kSearchContextError,
|
||||
kGetContentViewerError,
|
||||
kGetDOMWindowError
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@ NS_INTERFACE_MAP_END
|
|||
|
||||
wsRDFObserver::wsRDFObserver()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
wsRDFObserver::~wsRDFObserver() {}
|
||||
|
|
|
@ -52,9 +52,13 @@ ifneq ($(BAL_INTERFACE),)
|
|||
INCLUDES := -I../bal -I../bal/solaris $(INCLUDES)
|
||||
else
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
INCLUDES := -I$(JDKHOME)/include -I$(JDKHOME)/include/linux $(INCLUDES)
|
||||
INCLUDES := -I$(MOZ_JDKHOME)/include -I$(MOZ_JDKHOME)/include/linux $(INCLUDES)
|
||||
else
|
||||
INCLUDES := -I$(JDKHOME)/include -I$(JDKHOME)/include/solaris $(INCLUDES)
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
INCLUDES := -I$(MOZ_JDKHOME)/include -I$(MOZ_JDKHOME)/include/win32 $(INCLUDES)
|
||||
else
|
||||
INCLUDES := -I$(MOZ_JDKHOME)/include -I$(MOZ_JDKHOME)/include/solaris $(INCLUDES)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче