diff options
author | Grant Gayed <grant_gayed@ca.ibm.com> | 2013-04-29 00:59:13 -0400 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2013-04-29 00:59:13 -0400 |
commit | 586a8dabb2dccb88772e3ce251c221c5c45f4d14 (patch) | |
tree | 5f0acc7e144d02eb3a5960a6d2cdcd5307b87e00 /bundles/org.eclipse.swt/Eclipse SWT Mozilla | |
parent | 5d18a6b112a901db9cc96a414c22e67f0e7269d9 (diff) | |
parent | 50e2113dfb823e1ce2aee142306a5d70a19066f2 (diff) | |
download | eclipse.platform.swt-586a8dabb2dccb88772e3ce251c221c5c45f4d14.tar.gz eclipse.platform.swt-586a8dabb2dccb88772e3ce251c221c5c45f4d14.tar.xz eclipse.platform.swt-586a8dabb2dccb88772e3ce251c221c5c45f4d14.zip |
merge XULRunner 17 support
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Mozilla')
79 files changed, 1227 insertions, 3560 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext_17.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext_17.h new file mode 100644 index 0000000000..ac0d83065c --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext_17.h @@ -0,0 +1,396 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * This file is derived from the Original Code provided by mozilla.org, + * whose Initial Developer is Netscape Communications Corporation. Changes + * to the original file were made by SWT on March 7, 2013 and are marked + * with trailing comment "//SWT-20130307". + */ + +#ifndef nsIScriptContext17_h__ //SWT-20130307 +#define nsIScriptContext17_h__ //SWT-20130307 + +#include "nscore.h" +#include "nptypes.h" //SWT-20130307 +//#include "nsStringGlue.h" //SWT-20130307 +#include "nsISupports.h" +#include "nsCOMPtr.h" +#include "nsIProgrammingLanguage.h" +//#include "jsfriendapi.h" //SWT-20130307 +//#include "jspubtd.h" //SWT-20130307 + +class nsIScriptGlobalObject17; //SWT-20130307 +//class nsIScriptSecurityManager; //SWT-20130307 +//class nsIPrincipal; //SWT-20130307 +//class nsIAtom; //SWT-20130307 +//class nsIArray; //SWT-20130307 +//class nsIVariant; //SWT-20130307 +//class nsIObjectInputStream; //SWT-20130307 +//class nsIObjectOutputStream; //SWT-20130307 +template<class> class nsScriptObjectHolder17; //SWT-20130307 +class nsIScriptObjectPrincipal; +class nsIDOMWindow; +class nsIURI; +class JSContext; //SWT-20130307 +class JSVersion; //SWT-20130307 +class Value; //SWT-20130307 +typedef struct JSScript JSScript; //SWT-20130307 +typedef struct JSObject JSObject; //SWT-20130307 + +typedef void (*nsScriptTerminationFunc)(nsISupports* aRef); + +// #define NS_ISCRIPTCONTEXTPRINCIPAL_IID \ //SWT-20130307 +// { 0xd012cdb3, 0x8f1e, 0x4440, \ //SWT-20130307 +// { 0x8c, 0xbd, 0x32, 0x7f, 0x98, 0x1d, 0x37, 0xb4 } } //SWT-20130307 + +class nsIScriptContextPrincipal17 : public nsISupports //SWT-20130307 +{ +public: +// NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTCONTEXTPRINCIPAL_IID) //SWT-20130307 + + virtual nsIScriptObjectPrincipal* GetObjectPrincipal() = 0; +}; + +// NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContextPrincipal, //SWT-20130307 +// NS_ISCRIPTCONTEXTPRINCIPAL_IID) //SWT-20130307 + +//#define NS_ISCRIPTCONTEXT_IID \ //SWT-20130307 +//{ 0x8bdcea47, 0x6704, 0x4dd9, \ //SWT-20130307 +// { 0xa1, 0x48, 0x05, 0x34, 0xcf, 0xe2, 0xdd, 0x57 } } //SWT-20130307 + +/* This MUST match JSVERSION_DEFAULT. This version stuff if we don't + know what language we have is a little silly... */ +#define SCRIPTVERSION_DEFAULT JSVERSION_DEFAULT + +/** + * It is used by the application to initialize a runtime and run scripts. + * A script runtime would implement this interface. + */ +class nsIScriptContext17 : public nsIScriptContextPrincipal17 //SWT-20130307 +{ +public: +// NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTCONTEXT_IID) //SWT-20130307 + + virtual void SetGlobalObject(nsIScriptGlobalObject* aGlobalObject) = 0; + + /** + * Compile and execute a script. + * + * @param aScript a string representing the script to be executed + * @param aScopeObject a script object for the scope to execute in, or + * nullptr to use a default scope + * @param aPrincipal the principal the script should be evaluated with + * @param aOriginPrincipal the principal the script originates from. If null, + * aPrincipal is used. + * @param aURL the URL or filename for error messages + * @param aLineNo the starting line number of the script for error messages + * @param aVersion the script language version to use when executing + * @param aRetValue the result of executing the script, or null for no result. + * If this is a JS context, it's the caller's responsibility to + * preserve aRetValue from GC across this call + * @param aIsUndefined true if the result of executing the script is the + * undefined value + * + * @return NS_OK if the script was valid and got executed + * + **/ + virtual nsresult EvaluateString(const nsAString& aScript, + JSObject* aScopeObject, + nsIPrincipal *aPrincipal, + nsIPrincipal *aOriginPrincipal, + const char *aURL, + uint32_t aLineNo, + JSVersion aVersion, + nsAString *aRetValue, + bool* aIsUndefined) = 0; + + virtual nsresult EvaluateStringWithValue(const nsAString& aScript, + JSObject* aScopeObject, + nsIPrincipal *aPrincipal, + const char *aURL, + uint32_t aLineNo, + uint32_t aVersion, + /*JS::*/Value* aRetValue, //SWT-20130307 + bool* aIsUndefined) = 0; + + /** + * Compile a script. + * + * @param aText a PRUnichar buffer containing script source + * @param aTextLength number of characters in aText + * @param aPrincipal the principal that produced the script + * @param aURL the URL or filename for error messages + * @param aLineNo the starting line number of the script for error messages + * @param aVersion the script language version to use when executing + * @param aScriptObject an executable object that's the result of compiling + * the script. + * @param aSaveSource force the source code to be saved by the JS engine in memory + * + * @return NS_OK if the script source was valid and got compiled. + * + **/ + virtual nsresult CompileScript(const PRUnichar* aText, + int32_t aTextLength, + nsIPrincipal* aPrincipal, + const char* aURL, + uint32_t aLineNo, + uint32_t aVersion, + nsScriptObjectHolder17<JSScript>& aScriptObject, //SWT-20130307 + bool aSaveSource = false) = 0; + + /** + * Execute a precompiled script object. + * + * @param aScriptObject an object representing the script to be executed + * @param aScopeObject an object telling the scope in which to execute, + * or nullptr to use a default scope + * @param aRetValue the result of executing the script, may be null in + * which case no result string is computed + * @param aIsUndefined true if the result of executing the script is the + * undefined value, may be null for "don't care" + * + * @return NS_OK if the script was valid and got executed + * + */ + virtual nsresult ExecuteScript(JSScript* aScriptObject, + JSObject* aScopeObject, + nsAString* aRetValue, + bool* aIsUndefined) = 0; + + /** + * Compile the event handler named by atom aName, with function body aBody + * into a function object returned if ok via aHandler. Does NOT bind the + * function to anything - BindCompiledEventHandler() should be used for that + * purpose. Note that this event handler is always considered 'shared' and + * hence is compiled without principals. Never call the returned object + * directly - it must be bound (and thereby cloned, and therefore have the + * correct principals) before use! + * + * If the compilation sets a pending exception on the native context, it is + * this method's responsibility to report said exception immediately, without + * relying on callers to do so. + * + * + * @param aName an nsIAtom pointer naming the function; it must be lowercase + * and ASCII, and should not be longer than 63 chars. This bound on + * length is enforced only by assertions, so caveat caller! + * @param aEventName the name that the event object should be bound to + * @param aBody the event handler function's body + * @param aURL the URL or filename for error messages + * @param aLineNo the starting line number of the script for error messages + * @param aVersion the script language version to use when executing + * @param aHandler the out parameter in which a void pointer to the compiled + * function object is stored on success + * + * @return NS_OK if the function body was valid and got compiled + */ + virtual nsresult CompileEventHandler(nsIAtom* aName, + uint32_t aArgCount, + const char** aArgNames, + const nsAString& aBody, + const char* aURL, + uint32_t aLineNo, + uint32_t aVersion, + nsScriptObjectHolder17<JSObject>& aHandler) = 0; //SWT-20130307 + + /** + * Call the function object with given args and return its boolean result, + * or true if the result isn't boolean. + * + * @param aTarget the event target + * @param aScript an object telling the scope in which to call the compiled + * event handler function. + * @param aHandler function object (function and static scope) to invoke. + * @param argv array of arguments. Note each element is assumed to + * be an nsIVariant. + * @param rval out parameter returning result + **/ + virtual nsresult CallEventHandler(nsISupports* aTarget, + JSObject* aScope, JSObject* aHandler, + nsIArray *argv, nsIVariant **rval) = 0; + + /** + * Bind an already-compiled event handler function to the given + * target. Scripting languages with static scoping must re-bind the + * scope chain for aHandler to begin (after the activation scope for + * aHandler itself, typically) with aTarget's scope. + * + * The result of the bind operation is a new handler object, with + * principals now set and scope set as above. This is returned in + * aBoundHandler. When this function is called, aBoundHandler is + * expected to not be holding an object. + * + * @param aTarget an object telling the scope in which to bind the compiled + * event handler function. The context will presumably associate + * this nsISupports with a native script object. + * @param aScope the scope in which the script object for aTarget should be + * looked for. + * @param aHandler the function object to bind, created by an earlier call to + * CompileEventHandler + * @param aBoundHandler [out] the result of the bind operation. + * @return NS_OK if the function was successfully bound + */ + virtual nsresult BindCompiledEventHandler(nsISupports* aTarget, + JSObject* aScope, + JSObject* aHandler, + nsScriptObjectHolder17<JSObject>& aBoundHandler) = 0; //SWT-20130307 + + /** + * Compile a function that isn't used as an event handler. + * + * NOTE: Not yet language agnostic (main problem is XBL - not yet agnostic) + * Caller must make sure aFunctionObject is a JS GC root. + * + **/ + virtual nsresult CompileFunction(JSObject* aTarget, + const nsACString& aName, + uint32_t aArgCount, + const char** aArgArray, + const nsAString& aBody, + const char* aURL, + uint32_t aLineNo, + uint32_t aVersion, + bool aShared, + JSObject** aFunctionObject) = 0; + + /** + * Return the global object. + * + **/ + virtual nsIScriptGlobalObject *GetGlobalObject() = 0; + + /** + * Return the native script context + * + **/ + virtual JSContext* GetNativeContext() = 0; + + /** + * Return the native global object for this context. + * + **/ + virtual JSObject* GetNativeGlobal() = 0; + + /** + * Initialize the context generally. Does not create a global object. + **/ + virtual nsresult InitContext() = 0; + + /** + * Check to see if context is as yet intialized. Used to prevent + * reentrancy issues during the initialization process. + * + * @return true if initialized, false if not + * + */ + virtual bool IsContextInitialized() = 0; + + /** + * For garbage collected systems, do a synchronous collection pass. + * May be a no-op on other systems + * + * @return NS_OK if the method is successful + */ + // virtual void GC(js::gcreason::Reason aReason) = 0; //SWT-20130307 + + /** + * Inform the context that a script was evaluated. + * A GC may be done if "necessary." + * This call is necessary if script evaluation is done + * without using the EvaluateScript method. + * @param aTerminated If true then call termination function if it was + * previously set. Within DOM this will always be true, but outside + * callers (such as xpconnect) who may do script evaluations nested + * inside DOM script evaluations can pass false to avoid premature + * calls to the termination function. + * @return NS_OK if the method is successful + */ + virtual void ScriptEvaluated(bool aTerminated) = 0; + + virtual nsresult Serialize(nsIObjectOutputStream* aStream, + JSScript* aScriptObject) = 0; + + /* Deserialize a script from a stream. + */ + virtual nsresult Deserialize(nsIObjectInputStream* aStream, + nsScriptObjectHolder17<JSScript>& aResult) = 0; //SWT-20130307 + + /** + * JS only - this function need not be implemented by languages other + * than JS (ie, this should be moved to a private interface!) + * Called to specify a function that should be called when the current + * script (if there is one) terminates. Generally used if breakdown + * of script state needs to happen, but should be deferred till + * the end of script evaluation. + * + * @throws NS_ERROR_OUT_OF_MEMORY if that happens + */ + virtual void SetTerminationFunction(nsScriptTerminationFunc aFunc, + nsIDOMWindow* aRef) = 0; + + /** + * Called to disable/enable script execution in this context. + */ + virtual bool GetScriptsEnabled() = 0; + virtual void SetScriptsEnabled(bool aEnabled, bool aFireTimeouts) = 0; + + // SetProperty is suspect and jst believes should not be needed. Currenly + // used only for "arguments". + virtual nsresult SetProperty(JSObject* aTarget, const char* aPropName, nsISupports* aVal) = 0; + /** + * Called to set/get information if the script context is + * currently processing a script tag + */ + virtual bool GetProcessingScriptTag() = 0; + virtual void SetProcessingScriptTag(bool aResult) = 0; + + /** + * Called to find out if this script context might be executing script. + */ + virtual bool GetExecutingScript() = 0; + + /** + * Tell the context whether or not to GC when destroyed. An optimization + * used when the window is a [i]frame, so GC will happen anyway. + */ + virtual void SetGCOnDestruction(bool aGCOnDestruction) = 0; + + /** + * Initialize DOM classes on aGlobalObj, always call + * WillInitializeContext() before calling InitContext(), and always + * call DidInitializeContext() when a context is fully + * (successfully) initialized. + */ + virtual nsresult InitClasses(JSObject* aGlobalObj) = 0; + + /** + * Tell the context we're about to be reinitialize it. + */ + virtual void WillInitializeContext() = 0; + + /** + * Tell the context we're done reinitializing it. + */ + virtual void DidInitializeContext() = 0; + + /* Memory managment for script objects. Used by the implementation of + * nsScriptObjectHolder to manage the lifetimes of the held script objects. + * + * See also nsIScriptRuntime, which has identical methods and is useful + * in situations when you do not have an nsIScriptContext. + * + */ + virtual nsresult DropScriptObject(void *object) = 0; + virtual nsresult HoldScriptObject(void *object) = 0; + + virtual void EnterModalState() = 0; + virtual void LeaveModalState() = 0; +}; + +//NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContext, NS_ISCRIPTCONTEXT_IID) //SWT-20130307 + +#endif // nsIScriptContext17_h__ //SWT-20130307 + diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h index 276d40f4d5..c382e69eba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h @@ -187,7 +187,7 @@ public: //virtual nsresult HandleScriptError(nsScriptErrorEvent *aErrorEvent, //SWT-20090407 // nsEventStatus *aEventStatus) { //SWT-20090407 // return NS_HandleScriptError(this, aErrorEvent, aEventStatus); //SWT-20090407 -//} +//} //SWT-20090407 }; //NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptGlobalObject, //SWT-20090407 diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject_17.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject_17.h new file mode 100644 index 0000000000..e1ceb97c15 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject_17.h @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sw=2 et tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * This file is derived from the Original Code provided by mozilla.org, + * whose Initial Developer is Netscape Communications Corporation. Changes + * to the original file were made by SWT on May 7, 2013 and are marked + * with trailing comment "//SWT-20130307". + */ + +#ifndef nsIScriptGlobalObject17_h__ //SWT-20130307 +#define nsIScriptGlobalObject17_h__ //SWT-20130307 + +#include "nsISupports.h" +//#include "nsEvent.h" //SWT-20130307 +#include "nsIProgrammingLanguage.h" + +class nsIScriptContext; +class nsIDOMEvent; +class nsIScriptGlobalObjectOwner; +class nsIArray; +class nsScriptErrorEvent; +class nsIScriptGlobalObject; +struct JSObject; // until we finally remove GetGlobalJSObject... + +// Some helpers for working with integer "script type IDs", and specifically +// for working with arrays of such objects. For example, it is common for +// implementations supporting multiple script languages to keep each +// language's nsIScriptContext in an array indexed by the language ID. + +// Implementation note: We always ignore nsIProgrammingLanguage::UNKNOWN and +// nsIProgrammingLanguage::CPLUSPLUS - this gives javascript slot 0. An +// attempted micro-optimization tried to avoid us going all the way to +// nsIProgrammingLanguage::MAX; however: +// * Someone is reportedly working on a PHP impl - that has value 9 +// * nsGenericElement therefore allows 4 bits for the value. +// So there is no good reason for us to be more restrictive again... + +#define NS_STID_FIRST nsIProgrammingLanguage::JAVASCRIPT +// like nsGenericElement, only 4 bits worth is valid... +#define NS_STID_LAST (nsIProgrammingLanguage::MAX > 0x000FU ? \ + 0x000FU : nsIProgrammingLanguage::MAX) + +// Use to declare the array size +#define NS_STID_ARRAY_UBOUND (NS_STID_LAST-NS_STID_FIRST+1) + +// Is a language ID valid? +#define NS_STID_VALID(langID) (langID >= NS_STID_FIRST && langID <= NS_STID_LAST) + +// Return an index for a given ID. +#define NS_STID_INDEX(langID) (langID-NS_STID_FIRST) + +// Create a 'for' loop iterating over all possible language IDs (*not* indexes) +#define NS_STID_FOR_ID(varName) \ + for (varName=NS_STID_FIRST;varName<=NS_STID_LAST;varName++) + +// Create a 'for' loop iterating over all indexes (when you don't need to know +// what language it is) +#define NS_STID_FOR_INDEX(varName) \ + for (varName=0;varName<=NS_STID_INDEX(NS_STID_LAST);varName++) + +// A helper function for nsIScriptGlobalObject implementations to use +// when handling a script error. Generally called by the global when a context +// notifies it of an error via nsIScriptGlobalObject::HandleScriptError. +// Returns true if HandleDOMEvent was actually called, in which case +// aStatus will be filled in with the status. +//bool //SWT-20130307 +//NS_HandleScriptError(nsIScriptGlobalObject *aScriptGlobal, //SWT-20130307 +// nsScriptErrorEvent *aErrorEvent, //SWT-20130307 +// nsEventStatus *aStatus); //SWT-20130307 + + +//#define NS_ISCRIPTGLOBALOBJECT_IID \ //SWT-20130307 +//{ 0x92569431, 0x6e6e, 0x408a, \ //SWT-20130307 +// { 0xa8, 0x8c, 0x45, 0x28, 0x5c, 0x1c, 0x85, 0x73 } } //SWT-20130307 + +/** + * The global object which keeps a script context for each supported script + * language. This often used to store per-window global state. + */ + +class nsIScriptGlobalObject17 : public nsISupports //SWT-20130307 +{ +public: +// NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTGLOBALOBJECT_IID) //SWT-20130307 + + /** + * Ensure that the script global object is initialized for working with the + * specified script language ID. This will set up the nsIScriptContext + * and 'script global' for that language, allowing these to be fetched + * and manipulated. + * @return NS_OK if successful; error conditions include that the language + * has not been registered, as well as 'normal' errors, such as + * out-of-memory + */ + virtual nsresult EnsureScriptEnvironment() = 0; + /** + * Get a script context (WITHOUT added reference) for the specified language. + */ + virtual nsIScriptContext *GetScriptContext() = 0; + + virtual JSObject* GetGlobalJSObject() = 0; + + nsIScriptContext* GetContext() { + return GetScriptContext(); + } + + /** + * Called when the global script for a language is finalized, typically as + * part of its GC process. By the time this call is made, the + * nsIScriptContext for the language has probably already been removed. + * After this call, the passed object is dead - which should generally be the + * same object the global is using for a global for that language. + */ + virtual void OnFinalize(JSObject* aObject) = 0; + + /** + * Called to enable/disable scripts. + */ + virtual void SetScriptsEnabled(bool aEnabled, bool aFireTimeouts) = 0; + + /** + * Handle a script error. Generally called by a script context. + */ +// virtual nsresult HandleScriptError(nsScriptErrorEvent *aErrorEvent, //SWT-20130307 +// nsEventStatus *aEventStatus) { //SWT-20130307 +// NS_ENSURE_STATE(NS_HandleScriptError(this, aErrorEvent, aEventStatus)); //SWT-20130307 +// return NS_OK; //SWT-20130307 +// } //SWT-20130307 + + virtual bool IsBlackForCC() { return false; } +}; + +//NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptGlobalObject, //SWT-20130307 +// NS_ISCRIPTGLOBALOBJECT_IID) //SWT-20130307 + +#endif diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp index 026e178742..7c713c7f27 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp @@ -57,7 +57,7 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__JJJJ)(JNIEnv *env, jclass that, jint #else XPCOM_NATIVE_ENTER(env, that, _1Call__JJJJ_FUNC); #endif - rc = (jint)((SWT_XREInitEmbedding2)arg0)((nsILocalFile *)arg1, (nsILocalFile *)arg2, (nsIDirectoryServiceProvider *)arg3); + rc = (jint)((SWT_XREInitEmbedding2)arg0)((nsIFile *)arg1, (nsIFile *)arg2, (nsIDirectoryServiceProvider *)arg3); #ifndef JNI64 XPCOM_NATIVE_EXIT(env, that, _1Call__IIII_FUNC); #else @@ -7078,6 +7078,19 @@ JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIMemory_1Realloc) } #endif +#ifndef NO__1nsIScriptContext17_1GetNativeContext +extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptContext17_1GetNativeContext)(JNIEnv *env, jclass that, jintLong arg0); +JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptContext17_1GetNativeContext) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jintLong rc = 0; + XPCOM_NATIVE_ENTER(env, that, _1nsIScriptContext17_1GetNativeContext_FUNC); + rc = (jintLong)((nsIScriptContext17 *)arg0)->GetNativeContext(); + XPCOM_NATIVE_EXIT(env, that, _1nsIScriptContext17_1GetNativeContext_FUNC); + return rc; +} +#endif + #ifndef NO__1nsIScriptContext_1GetNativeContext extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptContext_1GetNativeContext)(JNIEnv *env, jclass that, jintLong arg0); JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptContext_1GetNativeContext) @@ -7091,6 +7104,32 @@ JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptContext_1GetNativeContext) } #endif +#ifndef NO__1nsIScriptGlobalObject17_1EnsureScriptEnvironment +extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject17_1EnsureScriptEnvironment)(JNIEnv *env, jclass that, jintLong arg0); +JNIEXPORT jint JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject17_1EnsureScriptEnvironment) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jint rc = 0; + XPCOM_NATIVE_ENTER(env, that, _1nsIScriptGlobalObject17_1EnsureScriptEnvironment_FUNC); + rc = (jint)((nsIScriptGlobalObject17 *)arg0)->EnsureScriptEnvironment(); + XPCOM_NATIVE_EXIT(env, that, _1nsIScriptGlobalObject17_1EnsureScriptEnvironment_FUNC); + return rc; +} +#endif + +#ifndef NO__1nsIScriptGlobalObject17_1GetScriptContext +extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject17_1GetScriptContext)(JNIEnv *env, jclass that, jintLong arg0); +JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject17_1GetScriptContext) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jintLong rc = 0; + XPCOM_NATIVE_ENTER(env, that, _1nsIScriptGlobalObject17_1GetScriptContext_FUNC); + rc = (jintLong)((nsIScriptGlobalObject17 *)arg0)->GetScriptContext(); + XPCOM_NATIVE_EXIT(env, that, _1nsIScriptGlobalObject17_1GetScriptContext_FUNC); + return rc; +} +#endif + #ifndef NO__1nsIScriptGlobalObject_1EnsureScriptEnvironment extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1EnsureScriptEnvironment)(JNIEnv *env, jclass that, jintLong arg0, jint arg1); JNIEXPORT jint JNICALL XPCOM_NATIVE(_1nsIScriptGlobalObject_1EnsureScriptEnvironment) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h index c6ee93e808..819712abec 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h @@ -26,6 +26,8 @@ #ifndef nsIScriptContext_h__ #include "nsIScriptContext.h" #include "nsIScriptGlobalObject.h" +#include "nsIScriptContext_17.h" +#include "nsIScriptGlobalObject_17.h" #endif /* nsIScriptContext_h__ */ #define XPCOM_LOAD_FUNCTION LOAD_FUNCTION @@ -43,7 +45,7 @@ #endif /* __APPLE__ */ #endif /* _WIN32 */ -#define SWT_XREInitEmbedding2 nsresult (*)(nsILocalFile *,nsILocalFile *,nsIDirectoryServiceProvider *) +#define SWT_XREInitEmbedding2 nsresult (*)(nsIFile *,nsIFile *,nsIDirectoryServiceProvider *) #define SWT_XREInitEmbedding nsresult (*)(nsILocalFile *,nsILocalFile *,nsIDirectoryServiceProvider *,nsStaticModuleInfo const *,PRUint32) #endif /* INC_xpcom_H */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp index c51c1689e3..ff0bffdc62 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp @@ -1123,7 +1123,10 @@ char * XPCOM_nativeFunctionNames[] = { "_1nsID_1new", "_1nsIMemory_1Alloc", "_1nsIMemory_1Realloc", + "_1nsIScriptContext17_1GetNativeContext", "_1nsIScriptContext_1GetNativeContext", + "_1nsIScriptGlobalObject17_1EnsureScriptEnvironment", + "_1nsIScriptGlobalObject17_1GetScriptContext", "_1nsIScriptGlobalObject_1EnsureScriptEnvironment", "_1nsIScriptGlobalObject_1GetScriptContext", #ifndef JNI64 diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h index ff1e3a0e5a..4b3fac4827 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h @@ -1133,7 +1133,10 @@ typedef enum { _1nsID_1new_FUNC, _1nsIMemory_1Alloc_FUNC, _1nsIMemory_1Realloc_FUNC, + _1nsIScriptContext17_1GetNativeContext_FUNC, _1nsIScriptContext_1GetNativeContext_FUNC, + _1nsIScriptGlobalObject17_1EnsureScriptEnvironment_FUNC, + _1nsIScriptGlobalObject17_1GetScriptContext_FUNC, _1nsIScriptGlobalObject_1EnsureScriptEnvironment_FUNC, _1nsIScriptGlobalObject_1GetScriptContext_FUNC, #ifndef JNI64 diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java index 4781d213f2..d84eb741be 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java @@ -120,12 +120,12 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIDirectoryServiceProvider.NS_IDIRECTORYSERVICEPROVIDER_IID)) { + if (guid.Equals (XPCOM.NS_IDIRECTORYSERVICEPROVIDER_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {directoryServiceProvider.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIDirectoryServiceProvider2.NS_IDIRECTORYSERVICEPROVIDER2_IID)) { + if (guid.Equals (XPCOM.NS_IDIRECTORYSERVICEPROVIDER2_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {directoryServiceProvider2.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; @@ -220,7 +220,7 @@ int getFiles (long /*int*/ prop, long /*int*/ _retval) { nsILocalFile localFile = new nsILocalFile (result[0]); result[0] = 0; - rc = localFile.QueryInterface (nsIFile.NS_IFILE_IID, result); + rc = localFile.QueryInterface (Mozilla.IsPre_17 ? nsIFile.NS_IFILE_IID : nsIFile.NS_IFILE_17_IID, result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); localFile.Release (); @@ -315,7 +315,7 @@ int getFile(long /*int*/ prop, long /*int*/ persistent, long /*int*/ _retval) { nsILocalFile localFile = new nsILocalFile (result [0]); result[0] = 0; - rc = localFile.QueryInterface (nsIFile.NS_IFILE_IID, result); + rc = localFile.QueryInterface (Mozilla.IsPre_17 ? nsIFile.NS_IFILE_IID : nsIFile.NS_IFILE_17_IID, result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory.java index a0e2f2136b..a425ed81ea 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory.java @@ -69,7 +69,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFactory.NS_IFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IFACTORY_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {factory.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory_1_8.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory_1_8.java index a6bf534ebe..59d5f63c30 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory_1_8.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/DownloadFactory_1_8.java @@ -69,7 +69,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFactory.NS_IFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IFACTORY_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {factory.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java index 4ac867ba02..45911031e5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/External.java @@ -252,7 +252,7 @@ static Object convertToJava (nsIVariant variant, short type) { arrayReturn = new Object[count[0]]; for (int i = 0; i < count[0]; i++) { /* mozilla's representation of boolean changed from 4 bytes to 1 byte as of XULRunner 4.x */ - if (nsISupports.IsXULRunner10) { + if (nsISupports.IsXULRunner10 || nsISupports.IsXULRunner17) { byte[] byteValue = new byte[1]; C.memmove (byteValue, ptr[0] + i, 1); arrayReturn[i] = new Boolean (byteValue[0] != 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/ExternalFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/ExternalFactory.java index f90ef3d0e9..f6a16af9a5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/ExternalFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/ExternalFactory.java @@ -69,7 +69,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFactory.NS_IFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IFACTORY_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {factory.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java index 44b9e5fece..43e4812446 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java @@ -85,23 +85,28 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { if (riid == 0 || ppvObject == 0) return XPCOM.NS_ERROR_NO_INTERFACE; nsID guid = new nsID (); XPCOM.memmove (guid, riid, nsID.sizeof); - + if (guid.Equals (nsISupports.NS_ISUPPORTS_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {supports.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFilePicker.NS_IFILEPICKER_IID)) { + if (guid.Equals (nsIFilePicker.NS_IFILEPICKER_17_IID)) { XPCOM.memmove(ppvObject, new long /*int*/[] {filePicker.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFilePicker_1_8.NS_IFILEPICKER_IID)) { + if (guid.Equals (nsIFilePicker.NS_IFILEPICKER_10_IID)) { XPCOM.memmove(ppvObject, new long /*int*/[] {filePicker.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFilePicker_1_8.NS_IFILEPICKER_10_IID)) { + if (guid.Equals (nsIFilePicker.NS_IFILEPICKER_1_8_IID)) { + XPCOM.memmove(ppvObject, new long /*int*/[] {filePicker.getAddress ()}, C.PTR_SIZEOF); + AddRef (); + return XPCOM.NS_OK; + } + if (guid.Equals (nsIFilePicker.NS_IFILEPICKER_IID)) { XPCOM.memmove(ppvObject, new long /*int*/[] {filePicker.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory.java index fcf4a18a2e..3a8ed26b59 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory.java @@ -69,7 +69,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFactory.NS_IFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IFACTORY_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {factory.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; @@ -88,7 +88,11 @@ int Release () { /* nsIFactory */ int CreateInstance (long /*int*/ aOuter, long /*int*/ iid, long /*int*/ result) { - if (!Mozilla.IsPre_4) { + if (!Mozilla.IsPre_17) { + FilePicker_17 picker = new FilePicker_17 (); + picker.AddRef (); + XPCOM.memmove (result, new long /*int*/[] {picker.getAddress ()}, C.PTR_SIZEOF); + } else if (!Mozilla.IsPre_4) { FilePicker_10 picker = new FilePicker_10 (); picker.AddRef (); XPCOM.memmove (result, new long /*int*/[] {picker.getAddress ()}, C.PTR_SIZEOF); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_17.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_17.java new file mode 100644 index 0000000000..916c201726 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_17.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright (c) 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.swt.browser; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.internal.mozilla.*; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; + +class FilePicker_17 extends FilePicker_1_8 { + +void createCOMInterfaces () { + /* Create each of the interfaces that this object implements */ + supports = new XPCOMObject (new int[] {2, 0, 0}) { + public long /*int*/ method0 (long /*int*/[] args) {return QueryInterface (args[0], args[1]);} + public long /*int*/ method1 (long /*int*/[] args) {return AddRef ();} + public long /*int*/ method2 (long /*int*/[] args) {return Release ();} + }; + + filePicker = new XPCOMObject (new int[] {2, 0, 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) { + public long /*int*/ method0 (long /*int*/[] args) {return QueryInterface (args[0], args[1]);} + public long /*int*/ method1 (long /*int*/[] args) {return AddRef ();} + public long /*int*/ method2 (long /*int*/[] args) {return Release ();} + public long /*int*/ method3 (long /*int*/[] args) {return Init (args[0], args[1], (short)args[2]);} + public long /*int*/ method4 (long /*int*/[] args) {return AppendFilters ((int)/*64*/args[0]);} + public long /*int*/ method5 (long /*int*/[] args) {return AppendFilter (args[0], args[1]);} + public long /*int*/ method6 (long /*int*/[] args) {return GetDefaultString (args[0]);} + public long /*int*/ method7 (long /*int*/[] args) {return SetDefaultString (args[0]);} + public long /*int*/ method8 (long /*int*/[] args) {return GetDefaultExtension (args[0]);} + public long /*int*/ method9 (long /*int*/[] args) {return SetDefaultExtension (args[0]);} + public long /*int*/ method10 (long /*int*/[] args) {return GetFilterIndex (args[0]);} + public long /*int*/ method11 (long /*int*/[] args) {return SetFilterIndex ((int)/*64*/args[0]);} + public long /*int*/ method12 (long /*int*/[] args) {return GetDisplayDirectory (args[0]);} + public long /*int*/ method13 (long /*int*/[] args) {return SetDisplayDirectory (args[0]);} + public long /*int*/ method14 (long /*int*/[] args) {return GetFile (args[0]);} + public long /*int*/ method15 (long /*int*/[] args) {return GetFileURL (args[0]);} + public long /*int*/ method16 (long /*int*/[] args) {return GetFiles (args[0]);} + public long /*int*/ method17 (long /*int*/[] args) {return XPCOM.NS_ERROR_NOT_IMPLEMENTED;} + public long /*int*/ method18 (long /*int*/[] args) {return XPCOM.NS_ERROR_NOT_IMPLEMENTED;} + public long /*int*/ method19 (long /*int*/[] args) {return Show (args[0]);} + public long /*int*/ method20 (long /*int*/[] args) {return Open (args[0]);} + }; +} + +int Open (long /*int*/ aFilePickerShownCallback) { + if (mode == nsIFilePicker.modeGetFolder) { + /* picking a directory */ + int result = showDirectoryPicker (); + if (aFilePickerShownCallback != 0) { + new nsIFilePickerShownCallback (aFilePickerShownCallback).Done (result); + } + return XPCOM.NS_OK; + } + + /* picking a file */ + int style = mode == nsIFilePicker.modeSave ? SWT.SAVE : SWT.OPEN; + if (mode == nsIFilePicker.modeOpenMultiple) style |= SWT.MULTI; + Browser browser = getBrowser (parentHandle); + Shell parent = null; + if (browser != null) { + parent = browser.getShell (); + } else { + parent = new Shell (); + } + FileDialog dialog = new FileDialog (parent, style); + if (title != null) dialog.setText (title); + if (directory != null) dialog.setFilterPath (directory); + if (masks != null) dialog.setFilterExtensions (masks); + if (defaultFilename != null) dialog.setFileName (defaultFilename); + String filename = dialog.open (); + files = dialog.getFileNames (); + directory = dialog.getFilterPath (); + title = defaultFilename = null; + masks = null; + int result = filename == null ? nsIFilePicker.returnCancel : nsIFilePicker.returnOK; + if (aFilePickerShownCallback != 0) { + new nsIFilePickerShownCallback (aFilePickerShownCallback).Done (result); + } + return XPCOM.NS_OK; +} + +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog.java index a8d9d5a011..9f2ecb7541 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog.java @@ -77,7 +77,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIHelperAppLauncherDialog.NS_IHELPERAPPLAUNCHERDIALOG_IID)) { + if (guid.Equals (XPCOM.NS_IHELPERAPPLAUNCHERDIALOG_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {helperAppLauncherDialog.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java index 80ed72e8ab..e20e0638b9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java @@ -69,7 +69,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFactory.NS_IFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IFACTORY_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {factory.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.java index 5599b9bf2a..99c3a97739 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_1_9.java @@ -77,7 +77,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIHelperAppLauncherDialog_1_9.NS_IHELPERAPPLAUNCHERDIALOG_IID)) { + if (guid.Equals (XPCOM.NS_IHELPERAPPLAUNCHERDIALOG_1_9_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {helperAppLauncherDialog.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/InputStream.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/InputStream.java index 1f4a55a328..49975b4d92 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/InputStream.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/InputStream.java @@ -66,7 +66,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIInputStream.NS_IINPUTSTREAM_IID)) { + if (guid.Equals (nsIInputStream.NS_IINPUTSTREAM_IID) || guid.Equals (nsIInputStream.NS_IINPUTSTREAM_17_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {inputStream.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java index 41f621ef80..006eec49c3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java @@ -32,9 +32,11 @@ class Mozilla extends WebBrowser { XPCOMObject supports; XPCOMObject weakReference; XPCOMObject webProgressListener; + XPCOMObject webProgressListener_17; XPCOMObject webBrowserChrome; XPCOMObject webBrowserChromeFocus; XPCOMObject embeddingSiteWindow; + XPCOMObject embeddingSiteWindow_17; XPCOMObject interfaceRequestor; XPCOMObject supportsWeakReference; XPCOMObject contextMenuListener; @@ -62,7 +64,7 @@ class Mozilla extends WebBrowser { static int BrowserCount, NextJSFunctionIndex = 1; static Hashtable AllFunctions = new Hashtable (); static Listener DisplayListener; - static boolean Initialized, IsPre_1_8, IsPre_1_9, IsPre_4, IsXULRunner, PerformedVersionCheck, XPCOMWasGlued, XPCOMInitWasGlued; + static boolean Initialized, IsPre_1_8, IsPre_1_9, IsPre_4, IsPre_17, IsXULRunner, PerformedVersionCheck, XPCOMWasGlued, XPCOMInitWasGlued; static boolean IsGettingSiteWindow; static String MozillaPath; static String oldProxyHostFTP, oldProxyHostHTTP, oldProxyHostSSL; @@ -156,7 +158,7 @@ class Mozilla extends WebBrowser { nsILocalFile localFile = new nsILocalFile (result [0]); result[0] = 0; - rc = localFile.QueryInterface (nsIFile.NS_IFILE_IID, result); + rc = localFile.QueryInterface (IsPre_17 ? nsIFile.NS_IFILE_IID : nsIFile.NS_IFILE_17_IID, result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_ERROR_NO_INTERFACE); localFile.Release (); @@ -822,6 +824,7 @@ public void create (Composite parent, int style) { initWebBrowserWindows (); if (!PerformedVersionCheck) { + /* IsPre_4 and IsPre_17 are already determined in initXPCOM() */ PerformedVersionCheck = true; rc = componentManager.QueryInterface (nsIComponentRegistrar.NS_ICOMPONENTREGISTRAR_IID, result); @@ -864,7 +867,6 @@ public void create (Composite parent, int style) { new nsISupports (result[0]).Release (); } IsPre_1_9 = true; - IsPre_4 = true; result[0] = 0; /* @@ -878,7 +880,7 @@ public void create (Composite parent, int style) { */ if (!IsPre_1_8) { rc = interfaceRequestor.GetInterface (nsIDocShell.NS_IDOCSHELL_1_8_IID, result); - if (rc == XPCOM.NS_OK && result[0] != 0) { /* 1.8 */ + if (rc == XPCOM.NS_OK && result[0] != 0) { /* 1.8.x */ new nsISupports (result[0]).Release (); result[0] = 0; @@ -894,14 +896,8 @@ public void create (Composite parent, int style) { } downloadFactory_1_8.Release (); } - } else { /* >= 1.9 */ + } else { /* >= 1.9.x */ IsPre_1_9 = false; - result[0] = 0; - rc = interfaceRequestor.GetInterface(nsIDocShell.NS_IDOCSHELL_10_IID, result); - if (rc == XPCOM.NS_OK && result[0] != 0) { /* >= 4.0 */ - IsPre_4 = false; - new nsISupports (result[0]).Release(); - } } } result[0] = 0; @@ -938,7 +934,7 @@ public void create (Composite parent, int style) { } /* add listeners for progress and content */ - rc = webBrowser.AddWebBrowserListener (weakReference.getAddress (), nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID); + rc = webBrowser.AddWebBrowserListener (weakReference.getAddress (), IsPre_17 ? nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID : nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_17_IID); if (rc != XPCOM.NS_OK) { browser.dispose (); error (rc); @@ -1004,10 +1000,9 @@ public void create (Composite parent, int style) { rc = domDocument.GetDocumentElement (result); domDocument.Release (); if (rc == XPCOM.NS_OK && result[0] != 0) { - nsIDOMElement domElement = new nsIDOMElement (result[0]); + rc = focusManager.SetFocus (result[0], nsIFocusManager.FLAG_BYKEY); + new nsISupports(result[0]).Release (); result[0] = 0; - rc = focusManager.SetFocus (domElement.getAddress (), nsIFocusManager.FLAG_BYKEY); - domElement.Release (); } } } @@ -1112,6 +1107,17 @@ void createCOMInterfaces () { public long /*int*/ method7 (long /*int*/[] args) {return OnSecurityChange (args[0], args[1], (int)/*64*/args[2]);} }; + webProgressListener_17 = new XPCOMObject (new int[] {2, 0, 0, 4, 6, 4, 4, 3}) { + public long /*int*/ method0 (long /*int*/[] args) {return QueryInterface (args[0], args[1]);} + public long /*int*/ method1 (long /*int*/[] args) {return AddRef ();} + public long /*int*/ method2 (long /*int*/[] args) {return Release ();} + public long /*int*/ method3 (long /*int*/[] args) {return OnStateChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3]);} + public long /*int*/ method4 (long /*int*/[] args) {return OnProgressChange (args[0], args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4], (int)/*64*/args[5]);} + public long /*int*/ method5 (long /*int*/[] args) {return OnLocationChange (args[0], args[1], args[2], (int)/*64*/args[3]);} + public long /*int*/ method6 (long /*int*/[] args) {return OnStatusChange (args[0], args[1], (int)/*64*/args[2], args[3]);} + public long /*int*/ method7 (long /*int*/[] args) {return OnSecurityChange (args[0], args[1], (int)/*64*/args[2]);} + }; + webBrowserChrome = new XPCOMObject (new int[] {2, 0, 0, 2, 1, 1, 1, 1, 0, 2, 0, 1, 1}) { public long /*int*/ method0 (long /*int*/[] args) {return QueryInterface (args[0], args[1]);} public long /*int*/ method1 (long /*int*/[] args) {return AddRef ();} @@ -1150,6 +1156,21 @@ void createCOMInterfaces () { public long /*int*/ method10 (long /*int*/[] args) {return GetSiteWindow (args[0]);} }; + embeddingSiteWindow_17 = new XPCOMObject (new int[] {2, 0, 0, 5, 5, 0, 1, 1, 1, 1, 1, 0}) { + public long /*int*/ method0 (long /*int*/[] args) {return QueryInterface (args[0], args[1]);} + public long /*int*/ method1 (long /*int*/[] args) {return AddRef ();} + public long /*int*/ method2 (long /*int*/[] args) {return Release ();} + public long /*int*/ method3 (long /*int*/[] args) {return SetDimensions ((int)/*64*/args[0], (int)/*64*/args[1], (int)/*64*/args[2], (int)/*64*/args[3], (int)/*64*/args[4]);} + public long /*int*/ method4 (long /*int*/[] args) {return GetDimensions ((int)/*64*/args[0], args[1], args[2], args[3], args[4]);} + public long /*int*/ method5 (long /*int*/[] args) {return SetFocus ();} + public long /*int*/ method6 (long /*int*/[] args) {return GetVisibility (args[0]);} + public long /*int*/ method7 (long /*int*/[] args) {return SetVisibility ((int)/*64*/args[0]);} + public long /*int*/ method8 (long /*int*/[] args) {return GetTitle (args[0]);} + public long /*int*/ method9 (long /*int*/[] args) {return SetTitle (args[0]);} + public long /*int*/ method10 (long /*int*/[] args) {return GetSiteWindow (args[0]);} + public long /*int*/ method11 (long /*int*/[] args) {return Blur ();} + }; + interfaceRequestor = new XPCOMObject (new int[] {2, 0, 0, 2} ){ public long /*int*/ method0 (long /*int*/[] args) {return QueryInterface (args[0], args[1]);} public long /*int*/ method1 (long /*int*/[] args) {return AddRef ();} @@ -1226,6 +1247,10 @@ void disposeCOMInterfaces () { webProgressListener.dispose (); webProgressListener = null; } + if (webProgressListener_17 != null) { + webProgressListener_17.dispose (); + webProgressListener_17 = null; + } if (webBrowserChrome != null) { webBrowserChrome.dispose (); webBrowserChrome = null; @@ -1238,6 +1263,10 @@ void disposeCOMInterfaces () { embeddingSiteWindow.dispose (); embeddingSiteWindow = null; } + if (embeddingSiteWindow_17 != null) { + embeddingSiteWindow_17.dispose (); + embeddingSiteWindow_17 = null; + } if (interfaceRequestor != null) { interfaceRequestor.dispose (); interfaceRequestor = null; @@ -1293,15 +1322,19 @@ public boolean execute (String script) { nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_SCRIPTSECURITYMANAGER_CONTRACTID, true); - rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager.NS_ISCRIPTSECURITYMANAGER_10_IID, result); + rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager.NS_ISCRIPTSECURITYMANAGER_17_IID, result); if (!(rc == XPCOM.NS_OK && result[0] != 0)) { result[0] = 0; - rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager.NS_ISCRIPTSECURITYMANAGER_191_IID, result); + rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager.NS_ISCRIPTSECURITYMANAGER_10_IID, result); if (!(rc == XPCOM.NS_OK && result[0] != 0)) { result[0] = 0; - rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager.NS_ISCRIPTSECURITYMANAGER_IID, result); - if (rc == XPCOM.NS_OK && result[0] != 0) { - isXULRunner190x = true; + rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager.NS_ISCRIPTSECURITYMANAGER_191_IID, result); + if (!(rc == XPCOM.NS_OK && result[0] != 0)) { + result[0] = 0; + rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager.NS_ISCRIPTSECURITYMANAGER_IID, result); + if (rc == XPCOM.NS_OK && result[0] != 0) { + isXULRunner190x = true; + } } } } @@ -1321,16 +1354,17 @@ public boolean execute (String script) { nsIInterfaceRequestor interfaceRequestor = new nsIInterfaceRequestor (result[0]); result[0] = 0; - nsID scriptGlobalObjectNSID_10 = new nsID ("08f73284-26e3-4fa6-bf89-8326f92a94b3"); /* nsIScriptGlobalObject */ //$NON-NLS-1$ - rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID_10, result); + rc = interfaceRequestor.GetInterface (XPCOM.NS_ISCRIPTGLOBALOBJECT_17_IID, result); if (!(rc == XPCOM.NS_OK && result[0] != 0)) { result[0] = 0; - nsID scriptGlobalObjectNSID_1_9_2 = new nsID ("e9f3f2c1-2d94-4722-bbd4-2bf6fdf42f48"); /* nsIScriptGlobalObject */ //$NON-NLS-1$ - rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID_1_9_2, result); + rc = interfaceRequestor.GetInterface (XPCOM.NS_ISCRIPTGLOBALOBJECT_10_IID, result); if (!(rc == XPCOM.NS_OK && result[0] != 0)) { result[0] = 0; - nsID scriptGlobalObjectNSID_1_9 = new nsID ("6afecd40-0b9a-4cfd-8c42-0f645cd91829"); /* nsIScriptGlobalObject */ //$NON-NLS-1$ - rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID_1_9, result); + rc = interfaceRequestor.GetInterface (XPCOM.NS_ISCRIPTGLOBALOBJECT_1_9_2_IID, result); + if (!(rc == XPCOM.NS_OK && result[0] != 0)) { + result[0] = 0; + rc = interfaceRequestor.GetInterface (XPCOM.NS_ISCRIPTGLOBALOBJECT_1_9_IID, result); + } } } interfaceRequestor.Release (); @@ -1338,26 +1372,36 @@ public boolean execute (String script) { if (rc == XPCOM.NS_OK && result[0] != 0) { long /*int*/ scriptGlobalObject = result[0]; result[0] = 0; - rc = (int/*64*/)XPCOM.nsIScriptGlobalObject_EnsureScriptEnvironment (scriptGlobalObject, 2); /* nsIProgrammingLanguage.JAVASCRIPT */ + if (IsPre_17) { + rc = (int/*64*/)XPCOM.nsIScriptGlobalObject_EnsureScriptEnvironment (scriptGlobalObject, 2); /* nsIProgrammingLanguage.JAVASCRIPT */ + } else { + rc = (int/*64*/)XPCOM.nsIScriptGlobalObject17_EnsureScriptEnvironment (scriptGlobalObject); + } if (rc != XPCOM.NS_OK) { new nsISupports (scriptGlobalObject).Release (); } else { - long /*int*/ scriptContext = XPCOM.nsIScriptGlobalObject_GetScriptContext (scriptGlobalObject, 2); /* nsIProgrammingLanguage.JAVASCRIPT */ + long /*int*/ scriptContext; + if (IsPre_17) { + scriptContext = XPCOM.nsIScriptGlobalObject_GetScriptContext (scriptGlobalObject, 2); /* nsIProgrammingLanguage.JAVASCRIPT */ + } else { + scriptContext = XPCOM.nsIScriptGlobalObject17_GetScriptContext (scriptGlobalObject); + } new nsISupports (scriptGlobalObject).Release (); if (scriptContext != 0) { /* ensure that the received nsIScriptContext implements the expected interface */ nsISupports supports = new nsISupports (scriptContext); - nsID scriptContextNSID_10 = new nsID ("2e583bf4-3c1f-432d-8283-8dee7eccc88b"); /* nsIScriptContext */ //$NON-NLS-1$ - rc = supports.QueryInterface (scriptContextNSID_10, result); + rc = supports.QueryInterface (XPCOM.NS_ISCRIPTCONTEXT_17_IID, result); if (!(rc == XPCOM.NS_OK && result[0] != 0)) { result[0] = 0; - nsID scriptContextNSID_1_9_2 = new nsID ("87482b5e-e019-4df5-9bc2-b2a51b1f2d28"); /* nsIScriptContext */ //$NON-NLS-1$ - rc = supports.QueryInterface (scriptContextNSID_1_9_2, result); + rc = supports.QueryInterface (XPCOM.NS_ISCRIPTCONTEXT_10_IID, result); if (!(rc == XPCOM.NS_OK && result[0] != 0)) { result[0] = 0; - nsID scriptContextNSID_1_9 = new nsID ("e7b9871d-3adc-4bf7-850d-7fb9554886bf"); /* nsIScriptContext */ //$NON-NLS-1$ - rc = supports.QueryInterface (scriptContextNSID_1_9, result); + rc = supports.QueryInterface (XPCOM.NS_ISCRIPTCONTEXT_1_9_2_IID, result); + if (!(rc == XPCOM.NS_OK && result[0] != 0)) { + result[0] = 0; + rc = supports.QueryInterface (XPCOM.NS_ISCRIPTCONTEXT_1_9_IID, result); + } } } @@ -1365,38 +1409,43 @@ public boolean execute (String script) { new nsISupports (result[0]).Release (); result[0] = 0; - long /*int*/ nativeContext = XPCOM.nsIScriptContext_GetNativeContext (scriptContext); - if (nativeContext != 0) { + long /*int*/ jsContext; + if (IsPre_17) { + jsContext = XPCOM.nsIScriptContext_GetNativeContext (scriptContext); + } else { + jsContext = XPCOM.nsIScriptContext17_GetNativeContext (scriptContext); + } + if (jsContext != 0) { int length = script.length (); char[] scriptChars = new char[length]; script.getChars(0, length, scriptChars, 0); byte[] urlbytes = MozillaDelegate.wcsToMbcs (null, getUrl (), true); - rc = principal.GetJSPrincipals (nativeContext, result); + rc = principal.GetJSPrincipals (jsContext, result); + long /*int*/ principals = 0; if (rc == XPCOM.NS_OK && result[0] != 0) { - long /*int*/ principals = result[0]; + principals = result[0]; result[0] = 0; - - byte[] jsLibPath = getJSLibPathBytes (); - long /*int*/ globalJSObject = XPCOM.JS_GetGlobalObject (jsLibPath, nativeContext); - if (globalJSObject != 0) { - aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CONTEXTSTACK_CONTRACTID, true); - rc = serviceManager.GetServiceByContractID (aContractID, nsIJSContextStack.NS_IJSCONTEXTSTACK_IID, result); - if (rc == XPCOM.NS_OK && result[0] != 0) { - nsIJSContextStack stack = new nsIJSContextStack (result[0]); + } + byte[] jsLibPath = getJSLibPathBytes (); + long /*int*/ globalJSObject = XPCOM.JS_GetGlobalObject (jsLibPath, jsContext); + if (globalJSObject != 0) { + aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CONTEXTSTACK_CONTRACTID, true); + rc = serviceManager.GetServiceByContractID (aContractID, nsIJSContextStack.NS_IJSCONTEXTSTACK_IID, result); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIJSContextStack stack = new nsIJSContextStack (result[0]); + result[0] = 0; + rc = stack.Push (jsContext); + if (rc != XPCOM.NS_OK) { + stack.Release (); + } else { + boolean success = XPCOM.JS_EvaluateUCScriptForPrincipals (jsLibPath, jsContext, globalJSObject, principals, scriptChars, length, urlbytes, 0, isXULRunner190x ? result : null) != 0; result[0] = 0; - rc = stack.Push (nativeContext); - if (rc != XPCOM.NS_OK) { - stack.Release (); - } else { - boolean success = XPCOM.JS_EvaluateUCScriptForPrincipals (jsLibPath, nativeContext, globalJSObject, principals, scriptChars, length, urlbytes, 0, isXULRunner190x ? result : null) != 0; - result[0] = 0; - rc = stack.Pop (result); - stack.Release (); - // should principals be Release()d too? - principal.Release (); - serviceManager.Release (); - return success; - } + rc = stack.Pop (result); + stack.Release (); + // should principals be Release()d too? + principal.Release (); + serviceManager.Release (); + return success; } } } @@ -1462,7 +1511,7 @@ static Browser getBrowser (long /*int*/ aDOMWindow) { nsIWebBrowserChrome webBrowserChrome = new nsIWebBrowserChrome (result[0]); result[0] = 0; - rc = webBrowserChrome.QueryInterface (nsIEmbeddingSiteWindow.NS_IEMBEDDINGSITEWINDOW_IID, result); + rc = webBrowserChrome.QueryInterface (IsPre_17 ? nsIEmbeddingSiteWindow.NS_IEMBEDDINGSITEWINDOW_IID : nsIEmbeddingSiteWindow.NS_IEMBEDDINGSITEWINDOW_17_IID, result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); webBrowserChrome.Release (); @@ -1529,12 +1578,12 @@ static String getMozillaPath () { nsIServiceManager serviceManager = new nsIServiceManager (result[0]); result[0] = 0; byte[] buffer = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_DIRECTORYSERVICE_CONTRACTID, true); - rc = serviceManager.GetServiceByContractID (buffer, nsIDirectoryService.NS_IDIRECTORYSERVICE_IID, result); + rc = serviceManager.GetServiceByContractID (buffer, XPCOM.NS_IDIRECTORYSERVICE_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); serviceManager.Release(); - nsIDirectoryService directoryService = new nsIDirectoryService (result[0]); + nsISupports directoryService = new nsISupports (result[0]); result[0] = 0; rc = directoryService.QueryInterface (nsIProperties.NS_IPROPERTIES_IID, result); if (rc != XPCOM.NS_OK) error (rc); @@ -1544,7 +1593,7 @@ static String getMozillaPath () { nsIProperties properties = new nsIProperties (result[0]); result[0] = 0; buffer = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_GRE_DIR, true); - rc = properties.Get (buffer, nsIFile.NS_IFILE_IID, result); + rc = properties.Get (buffer, IsPre_17 ? nsIFile.NS_IFILE_IID : nsIFile.NS_IFILE_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); properties.Release (); @@ -1804,7 +1853,9 @@ void initFactories (nsIServiceManager serviceManager, nsIComponentManager compon nsIComponentRegistrar componentRegistrar = new nsIComponentRegistrar (result[0]); result[0] = 0; - componentRegistrar.AutoRegister (0); /* detect the External component */ + if (IsPre_17) { + componentRegistrar.AutoRegister (0); /* detect the External component */ + } PromptService2Factory factory = new PromptService2Factory (); factory.AddRef (); @@ -1992,7 +2043,7 @@ void initXPCOM (String mozillaPath, boolean isXULRunner) { error (XPCOM.NS_ERROR_NULL_POINTER); } - nsILocalFile localFile = new nsILocalFile (result[0]); + nsIFile localFile = new nsIFile (result[0]); result[0] = 0; if (isXULRunner) { int size = XPCOM.nsDynamicFunctionLoad_sizeof (); @@ -2012,9 +2063,22 @@ void initXPCOM (String mozillaPath, boolean isXULRunner) { C.memmove (functionLoad.function, new long /*int*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ()); rc = XPCOM.XPCOMGlueLoadXULFunctions (ptr); - if (rc == XPCOM.NS_OK) { - IsPre_4 = false; - nsISupports.IsXULRunner10 = true; + if (rc == XPCOM.NS_OK) { /* > 3.x */ + result[0] = 0; + rc = localFile.QueryInterface(nsIFile.NS_IFILE_17_IID, result); + if (rc == XPCOM.NS_OK) { /* 17.x */ + nsISupports.IsXULRunner17 = true; + } else { /* 10.x */ + rc = localFile.QueryInterface (nsILocalFile.NS_ILOCALFILE_IID, result); + if (rc != XPCOM.NS_OK) { + browser.dispose (); + error (rc); + } + IsPre_17 = true; + nsISupports.IsXULRunner10 = true; + } + if (result[0] != 0) new nsISupports (result[0]).Release(); + result[0] = 0; } else { /* * XRE_InitEmbedding2 was not found, so fall back to XRE_InitEmbedding, which is @@ -2025,10 +2089,7 @@ void initXPCOM (String mozillaPath, boolean isXULRunner) { functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); rc = XPCOM.XPCOMGlueLoadXULFunctions (ptr); - if (rc == XPCOM.NS_OK) { - IsPre_4 = true; - nsISupports.IsXULRunner10 = false; - } + IsPre_4 = IsPre_17 = true; } C.memmove (result, functionLoad.function, C.PTR_SIZEOF); @@ -2660,7 +2721,7 @@ void onDispose (Display display) { new nsISupports (badCertRequest).Release (); } - int rc = webBrowser.RemoveWebBrowserListener (weakReference.getAddress (), nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID); + int rc = webBrowser.RemoveWebBrowserListener (weakReference.getAddress (), IsPre_17 ? nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID : nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_17_IID); if (rc != XPCOM.NS_OK) error (rc); rc = webBrowser.SetParentURIContentListener (0); @@ -2768,10 +2829,18 @@ void navigate (long /*int*/ requestHandle) { if (rc == XPCOM.NS_OK) { rc = seekableStream.Seek (nsISeekableStream.NS_SEEK_SET, 0); if (rc == XPCOM.NS_OK) { - int[] available = new int[1]; - rc = inputStream.Available (available); + long available; + if (IsPre_17) { + int[] _retval = new int[1]; + rc = inputStream.Available (_retval); + available = _retval[0]; + } else { + long[] _retval = new long[1]; + rc = inputStream.Available (_retval); + available = _retval[0]; + } if (rc == XPCOM.NS_OK) { - int length = available[0]; + int length = (int)available; byte[] bytes = new byte[length]; int[] retVal = new int[1]; rc = inputStream.Read (bytes, length, retVal); @@ -3257,7 +3326,7 @@ void unhookDOMListeners () { nsIDOMWindow window = new nsIDOMWindow (result[0]); result[0] = 0; - rc = window.QueryInterface (!IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result); + rc = window.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID) : nsIDOMEventTarget.NS_IDOMEVENTTARGET_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE); nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]); @@ -3284,7 +3353,7 @@ void unhookDOMListeners () { nsIDOMWindow frame = new nsIDOMWindow (result[0]); result[0] = 0; - rc = frame.QueryInterface (!IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result); + rc = frame.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID) : nsIDOMEventTarget.NS_IDOMEVENTTARGET_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE); @@ -3351,7 +3420,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIWeakReference.NS_IWEAKREFERENCE_IID)) { + if (guid.Equals (XPCOM.NS_IWEAKREFERENCE_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {weakReference.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; @@ -3361,12 +3430,17 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIWebBrowserChrome.NS_IWEBBROWSERCHROME_IID)) { + if (guid.Equals (nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_17_IID)) { + XPCOM.memmove (ppvObject, new long /*int*/[] {webProgressListener_17.getAddress ()}, C.PTR_SIZEOF); + AddRef (); + return XPCOM.NS_OK; + } + if (guid.Equals (nsIWebBrowserChrome.NS_IWEBBROWSERCHROME_IID) || guid.Equals (nsIWebBrowserChrome.NS_IWEBBROWSERCHROME_17_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {webBrowserChrome.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIWebBrowserChromeFocus.NS_IWEBBROWSERCHROMEFOCUS_IID)) { + if (guid.Equals (XPCOM.NS_IWEBBROWSERCHROMEFOCUS_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {webBrowserChromeFocus.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; @@ -3376,32 +3450,37 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } + if (guid.Equals (nsIEmbeddingSiteWindow.NS_IEMBEDDINGSITEWINDOW_17_IID)) { + XPCOM.memmove (ppvObject, new long /*int*/[] {embeddingSiteWindow_17.getAddress ()}, C.PTR_SIZEOF); + AddRef (); + return XPCOM.NS_OK; + } if (guid.Equals (nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {interfaceRequestor.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsISupportsWeakReference.NS_ISUPPORTSWEAKREFERENCE_IID)) { + if (guid.Equals (XPCOM.NS_ISUPPORTSWEAKREFERENCE_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {supportsWeakReference.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIContextMenuListener.NS_ICONTEXTMENULISTENER_IID)) { + if (guid.Equals (XPCOM.NS_ICONTEXTMENULISTENER_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {contextMenuListener.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIURIContentListener.NS_IURICONTENTLISTENER_IID)) { + if (guid.Equals (XPCOM.NS_IURICONTENTLISTENER_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {uriContentListener.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsITooltipListener.NS_ITOOLTIPLISTENER_IID)) { + if (guid.Equals (XPCOM.NS_ITOOLTIPLISTENER_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {tooltipListener.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIBadCertListener2.NS_IBADCERTLISTENER2_IID)) { + if (guid.Equals (XPCOM.NS_IBADCERTLISTENER2_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {badCertListener.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; @@ -3433,7 +3512,7 @@ int GetInterface (long /*int*/ riid, long /*int*/ ppvObject) { if (riid == 0 || ppvObject == 0) return XPCOM.NS_ERROR_NO_INTERFACE; nsID guid = new nsID (); XPCOM.memmove (guid, riid, nsID.sizeof); - if (guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_10_IID) || guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_IID)) { + if (guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_17_IID) || guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_10_IID) || guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_IID)) { long /*int*/[] aContentDOMWindow = new long /*int*/[1]; int rc = webBrowser.GetContentDOMWindow (aContentDOMWindow); if (rc != XPCOM.NS_OK) error (rc); @@ -3598,7 +3677,7 @@ int OnStateChange (long /*int*/ aWebProgress, long /*int*/ aRequest, int aStateF result[0] = 0; nsIDOMWindow domWindow = new nsIDOMWindow (window[0]); - rc = domWindow.QueryInterface (!IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result); + rc = domWindow.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID) : nsIDOMEventTarget.NS_IDOMEVENTTARGET_17_IID, result); domWindow.Release(); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE); @@ -3744,7 +3823,7 @@ int OnStateChange (long /*int*/ aWebProgress, long /*int*/ aRequest, int aStateF result[0] = 0; nsIDOMWindow domWindow = new nsIDOMWindow (window[0]); - rc = domWindow.QueryInterface (!IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result); + rc = domWindow.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID) : nsIDOMEventTarget.NS_IDOMEVENTTARGET_17_IID, result); domWindow.Release(); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE); @@ -3854,7 +3933,7 @@ int OnStateChange (long /*int*/ aWebProgress, long /*int*/ aRequest, int aStateF new nsISupports (result[0]).Release (); result[0] = 0; - rc = domWindow.QueryInterface (!IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result); + rc = domWindow.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID : nsIDOMEventTarget.NS_IDOMEVENTTARGET_10_IID) : nsIDOMEventTarget.NS_IDOMEVENTTARGET_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE); @@ -3889,6 +3968,10 @@ int OnProgressChange (long /*int*/ aWebProgress, long /*int*/ aRequest, int aCur } int OnLocationChange (long /*int*/ aWebProgress, long /*int*/ aRequest, long /*int*/ aLocation) { + return OnLocationChange(aWebProgress, aRequest, aLocation, 0); +} + +int OnLocationChange (long /*int*/ aWebProgress, long /*int*/ aRequest, long /*int*/ aLocation, int aFlags) { /* * Feature in Mozilla. When a page is loaded via setText before a previous * setText page load has completed, the expected OnStateChange STATE_STOP for the @@ -4239,7 +4322,11 @@ int GetSiteWindow (long /*int*/ aSiteWindow) { XPCOM.memmove (aSiteWindow, new long /*int*/[] {siteWindow}, C.PTR_SIZEOF); return XPCOM.NS_OK; } - + +int Blur () { + return XPCOM.NS_OK; +} + /* nsIWebBrowserChromeFocus */ int FocusNextElement () { @@ -4279,7 +4366,7 @@ int FocusPrevElement () { int OnShowContextMenu (int aContextFlags, long /*int*/ aEvent, long /*int*/ aNode) { nsIDOMEvent domEvent = new nsIDOMEvent (aEvent); long /*int*/[] result = new long /*int*/[1]; - int rc = domEvent.QueryInterface (!IsPre_4 ? nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_10_IID : nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID, result); + int rc = domEvent.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID : nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_10_IID) :nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); @@ -4541,7 +4628,7 @@ int HandleEvent (long /*int*/ event) { if (XPCOM.DOMEVENT_KEYDOWN.equals (typeString)) { long /*int*/[] result = new long /*int*/[1]; - rc = domEvent.QueryInterface (!IsPre_4 ? nsIDOMKeyEvent.NS_IDOMKEYEVENT_10_IID : nsIDOMKeyEvent.NS_IDOMKEYEVENT_IID, result); + rc = domEvent.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMKeyEvent.NS_IDOMKEYEVENT_IID : nsIDOMKeyEvent.NS_IDOMKEYEVENT_10_IID) : nsIDOMKeyEvent.NS_IDOMKEYEVENT_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); nsIDOMKeyEvent domKeyEvent = new nsIDOMKeyEvent (result[0]); @@ -4649,7 +4736,7 @@ int HandleEvent (long /*int*/ event) { } long /*int*/[] result = new long /*int*/[1]; - rc = domEvent.QueryInterface (!IsPre_4 ? nsIDOMKeyEvent.NS_IDOMKEYEVENT_10_IID : nsIDOMKeyEvent.NS_IDOMKEYEVENT_IID, result); + rc = domEvent.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMKeyEvent.NS_IDOMKEYEVENT_IID : nsIDOMKeyEvent.NS_IDOMKEYEVENT_10_IID) : nsIDOMKeyEvent.NS_IDOMKEYEVENT_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); nsIDOMKeyEvent domKeyEvent = new nsIDOMKeyEvent (result[0]); @@ -4664,11 +4751,10 @@ int HandleEvent (long /*int*/ event) { if (rc != XPCOM.NS_OK) error (rc); rc = domKeyEvent.GetMetaKey (aMetaKey); if (rc != XPCOM.NS_OK) error (rc); - domKeyEvent.Release (); - int[] aCharCode = new int[1]; /* PRUint32 */ rc = domKeyEvent.GetCharCode (aCharCode); if (rc != XPCOM.NS_OK) error (rc); + domKeyEvent.Release (); lastCharCode = aCharCode[0]; if (lastCharCode == 0) { switch (lastKeyCode) { @@ -4705,7 +4791,7 @@ int HandleEvent (long /*int*/ event) { if (XPCOM.DOMEVENT_KEYUP.equals (typeString)) { long /*int*/[] result = new long /*int*/[1]; - rc = domEvent.QueryInterface (!IsPre_4 ? nsIDOMKeyEvent.NS_IDOMKEYEVENT_10_IID : nsIDOMKeyEvent.NS_IDOMKEYEVENT_IID, result); + rc = domEvent.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMKeyEvent.NS_IDOMKEYEVENT_IID : nsIDOMKeyEvent.NS_IDOMKEYEVENT_10_IID) : nsIDOMKeyEvent.NS_IDOMKEYEVENT_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); nsIDOMKeyEvent domKeyEvent = new nsIDOMKeyEvent (result[0]); @@ -4762,7 +4848,7 @@ int HandleEvent (long /*int*/ event) { /* mouse event */ long /*int*/[] result = new long /*int*/[1]; - rc = domEvent.QueryInterface (!IsPre_4 ? nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_10_IID : nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID, result); + rc = domEvent.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID : nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_10_IID) : nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_17_IID, result); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); nsIDOMMouseEvent domMouseEvent = new nsIDOMMouseEvent (result[0]); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java index abef771eec..b280f545c5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java @@ -72,7 +72,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIAuthPrompt2.NS_IAUTHPROMPT2_IID)) { + if (guid.Equals (XPCOM.NS_IAUTHPROMPT2_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {promptAuth.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java index 3f3da8e90e..54ff4bb1c3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java @@ -68,7 +68,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIPromptFactory.NS_IPROMPTFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IPROMPTFACTORY_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {factory.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; @@ -98,7 +98,7 @@ int GetPrompt (long /*int*/ aParent, long /*int*/ iid, long /*int*/ result) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIAuthPrompt2.NS_IAUTHPROMPT2_IID)) { + if (guid.Equals (XPCOM.NS_IAUTHPROMPT2_IID)) { PromptAuth2 promptAuth = new PromptAuth2(); promptAuth.AddRef (); promptAuth.setParent (aParent); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java index bb8f380c53..e1245c775d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java @@ -105,7 +105,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIPromptService2.NS_IPROMPTSERVICE2_IID)) { + if (guid.Equals (XPCOM.NS_IPROMPTSERVICE2_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {promptService2.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java index 8c7c18921a..7cd6f472ab 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java @@ -69,7 +69,7 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIFactory.NS_IFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IFACTORY_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {factory.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; @@ -90,13 +90,13 @@ int Release () { int CreateInstance (long /*int*/ aOuter, long /*int*/ iid, long /*int*/ result) { nsID guid = new nsID (); XPCOM.memmove (guid, iid, nsID.sizeof); - if (guid.Equals (nsIPromptService2.NS_IPROMPTSERVICE2_IID) || guid.Equals(nsIPromptService.NS_IPROMPTSERVICE_IID)) { + if (guid.Equals (XPCOM.NS_IPROMPTSERVICE2_IID) || guid.Equals(nsIPromptService.NS_IPROMPTSERVICE_IID)) { PromptService2 promptService = new PromptService2 (); promptService.AddRef (); XPCOM.memmove (result, new long /*int*/[] {promptService.getAddress ()}, C.PTR_SIZEOF); return XPCOM.NS_OK; } - if (guid.Equals (nsIPromptFactory.NS_IPROMPTFACTORY_IID)) { + if (guid.Equals (XPCOM.NS_IPROMPTFACTORY_IID)) { PromptFactory promptFactory = new PromptFactory(); promptFactory.AddRef (); XPCOM.memmove (result, new long /*int*/[] {promptFactory.getAddress ()}, C.PTR_SIZEOF); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/WindowCreator2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/WindowCreator2.java index 78c21ab875..88ed52dff2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/WindowCreator2.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/WindowCreator2.java @@ -86,12 +86,12 @@ int QueryInterface (long /*int*/ riid, long /*int*/ ppvObject) { AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIWindowCreator.NS_IWINDOWCREATOR_IID)) { + if (guid.Equals (XPCOM.NS_IWINDOWCREATOR_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {windowCreator.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; } - if (guid.Equals (nsIWindowCreator2.NS_IWINDOWCREATOR2_IID)) { + if (guid.Equals (XPCOM.NS_IWINDOWCREATOR2_IID)) { XPCOM.memmove (ppvObject, new long /*int*/[] {windowCreator2.getAddress ()}, C.PTR_SIZEOF); AddRef (); return XPCOM.NS_OK; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java index b5c7f2751a..fe560cf70f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java @@ -64,9 +64,37 @@ public class XPCOM extends C { public static final nsID NS_IWEBBROWSER_CID = new nsID ("F1EAC761-87E9-11d3-AF80-00A024FFC08C"); //$NON-NLS-1$ public static final nsID NS_IXPCONNECT_CID = new nsID ("CB6593E0-F9B2-11d2-BDD6-000064657374"); //$NON-NLS-1$ + /* IID constants */ + public static final nsID NS_IAUTHPROMPT2_IID = new nsID ("651395eb-8612-4876-8ac0-a88d4dce9e1e"); //$NON-NLS-1$ + public static final nsID NS_IBADCERTLISTENER2_IID = new nsID ("2c3d268c-ad82-49f3-99aa-e9ffddd7a0dc"); //$NON-NLS-1$ + public static final nsID NS_ICONTEXTMENULISTENER_IID = new nsID ("3478b6b0-3875-11d4-94ef-0020183bf181"); //$NON-NLS-1$ + public static final nsID NS_IDIRECTORYSERVICE_IID = new nsID ("57a66a60-d43a-11d3-8cc2-00609792278c"); //$NON-NLS-1$ + public static final nsID NS_IDIRECTORYSERVICEPROVIDER_IID = new nsID ("bbf8cab0-d43a-11d3-8cc2-00609792278c"); //$NON-NLS-1$ + public static final nsID NS_IDIRECTORYSERVICEPROVIDER2_IID = new nsID ("2f977d4b-5485-11d4-87e2-0010a4e75ef2"); //$NON-NLS-1$ + public static final nsID NS_IFACTORY_IID = new nsID ("00000001-0000-0000-c000-000000000046"); //$NON-NLS-1$ + public static final nsID NS_IHELPERAPPLAUNCHERDIALOG_IID = new nsID ("d7ebddf0-4c84-11d4-807a-00600811a9c3"); //$NON-NLS-1$ + public static final nsID NS_IHELPERAPPLAUNCHERDIALOG_1_9_IID = new nsID ("f3704fdc-8ae6-4eba-a3c3-f02958ac0649"); //$NON-NLS-1$ + public static final nsID NS_IPROMPTFACTORY_IID = new nsID ("2532b748-75db-4732-9173-78d3bf34f694"); //$NON-NLS-1$ + public static final nsID NS_IPROMPTSERVICE2_IID = new nsID ("cf86d196-dbee-4482-9dfa-3477aa128319"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTCONTEXT_1_9_IID = new nsID ("e7b9871d-3adc-4bf7-850d-7fb9554886bf"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTCONTEXT_1_9_2_IID = new nsID ("87482b5e-e019-4df5-9bc2-b2a51b1f2d28"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTCONTEXT_10_IID = new nsID ("2e583bf4-3c1f-432d-8283-8dee7eccc88b"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTCONTEXT_17_IID = new nsID ("d012cdb3-8f1e-4440-8cbd-327f981d37b4"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTGLOBALOBJECT_1_9_2_IID = new nsID ("e9f3f2c1-2d94-4722-bbd4-2bf6fdf42f48"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTGLOBALOBJECT_10_IID = new nsID ("08f73284-26e3-4fa6-bf89-8326f92a94b3"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTGLOBALOBJECT_17_IID = new nsID ("92569431-6e6e-408a-a88c-45285c1c8573"); //$NON-NLS-1$ + public static final nsID NS_ISCRIPTGLOBALOBJECT_1_9_IID = new nsID ("6afecd40-0b9a-4cfd-8c42-0f645cd91829"); //$NON-NLS-1$ public static final nsID NS_ISCRIPTOBJECTOWNER_IID = new nsID ("8f6bca7e-ce42-11d1-b724-00600891d8c9"); //$NON-NLS-1$ public static final nsID NS_ISECURITYCHECKEDCOMPONENT_IID = new nsID ("0dad9e8c-a12d-4dcb-9a6f-7d09839356e1"); //$NON-NLS-1$ + public static final nsID NS_ISUPPORTSWEAKREFERENCE_IID = new nsID ("9188bc86-f92e-11d2-81ef-0060083a0bcf"); //$NON-NLS-1$ + public static final nsID NS_ITOOLTIPLISTENER_IID = new nsID ("44b78386-1dd2-11b2-9ad2-e4eee2ca1916"); //$NON-NLS-1$ + public static final nsID NS_IURICONTENTLISTENER_IID = new nsID ("94928ab3-8b63-11d3-989d-001083010e9b"); //$NON-NLS-1$ + public static final nsID NS_IWEAKREFERENCE_IID = new nsID ("9188bc85-f92e-11d2-81ef-0060083a0bcf"); //$NON-NLS-1$ + public static final nsID NS_IWEBBROWSERCHROMEFOCUS_IID = new nsID ("d2206418-1dd1-11b2-8e55-acddcd2bcfb8"); //$NON-NLS-1$ + public static final nsID NS_IWINDOWCREATOR_IID = new nsID ("30465632-a777-44cc-90f9-8145475ef999"); //$NON-NLS-1$ + public static final nsID NS_IWINDOWCREATOR2_IID = new nsID ("f673ec81-a4b0-11d6-964b-eb5a2bf216fc"); //$NON-NLS-1$ + /* contract ID constants */ public static final String EXTERNAL_CONTRACTID = "@eclipse.org/external;1"; //$NON-NLS-1$ public static final String NS_AUTHPROMPTER_CONTRACTID = "@mozilla.org/passwordmanager/authpromptfactory;1"; //$NON-NLS-1$ public static final String NS_CERTOVERRIDE_CONTRACTID = "@mozilla.org/security/certoverride;1"; //$NON-NLS-1$ @@ -161,7 +189,7 @@ public class XPCOM extends C { public static final native int nsDynamicFunctionLoad_sizeof (); public static void memmove(long /*int*/ dest, boolean[] src) { - if (nsISupports.IsXULRunner10) { // TODO change this reference + if (nsISupports.IsXULRunner10 || nsISupports.IsXULRunner17) { // TODO change this reference memmove (dest, new byte[] {src[0] ? (byte)1 : 0}, 1); } else { memmove (dest, new int[] {src[0] ? 1 : 0}, 4); @@ -169,7 +197,7 @@ public static void memmove(long /*int*/ dest, boolean[] src) { } public static void memmove(boolean[] dest, long /*int*/ src) { - if (nsISupports.IsXULRunner10) { // TODO change this reference + if (nsISupports.IsXULRunner10 || nsISupports.IsXULRunner17) { // TODO change this reference byte[] result = new byte[1]; memmove (result, src, 1); dest[0] = result[0] != 0; @@ -378,6 +406,19 @@ public static final int nsIScriptGlobalObject_EnsureScriptEnvironment(long /*int } /** * @method flags=cpp + * @param ptr cast=(nsIScriptGlobalObject17 *) + */ +public static final native int _nsIScriptGlobalObject17_EnsureScriptEnvironment(long /*int*/ ptr); +public static final int nsIScriptGlobalObject17_EnsureScriptEnvironment(long /*int*/ ptr) { + lock.lock(); + try { + return _nsIScriptGlobalObject17_EnsureScriptEnvironment(ptr); + } finally { + lock.unlock(); + } +} +/** + * @method flags=cpp * @param ptr cast=(nsIScriptGlobalObject *) */ public static final native long /*int*/ _nsIScriptGlobalObject_GetScriptContext(long /*int*/ ptr, int lang); @@ -391,6 +432,19 @@ public static final long /*int*/ nsIScriptGlobalObject_GetScriptContext(long /*i } /** * @method flags=cpp + * @param ptr cast=(nsIScriptGlobalObject17 *) + */ +public static final native long /*int*/ _nsIScriptGlobalObject17_GetScriptContext(long /*int*/ ptr); +public static final long /*int*/ nsIScriptGlobalObject17_GetScriptContext(long /*int*/ ptr) { + lock.lock(); + try { + return _nsIScriptGlobalObject17_GetScriptContext(ptr); + } finally { + lock.unlock(); + } +} +/** + * @method flags=cpp * @param ptr cast=(nsIScriptContext *) */ public static final native long /*int*/ _nsIScriptContext_GetNativeContext(long /*int*/ ptr); @@ -404,6 +458,19 @@ public static final long /*int*/ nsIScriptContext_GetNativeContext(long /*int*/ } /** * @method flags=cpp + * @param ptr cast=(nsIScriptContext17 *) + */ +public static final native long /*int*/ _nsIScriptContext17_GetNativeContext(long /*int*/ ptr); +public static final long /*int*/ nsIScriptContext17_GetNativeContext(long /*int*/ ptr) { + lock.lock(); + try { + return _nsIScriptContext17_GetNativeContext(ptr); + } finally { + lock.unlock(); + } +} +/** + * @method flags=cpp * @param ptr cast=(nsEmbedCString *) */ public static final native long /*int*/ _nsEmbedCString_get(long /*int*/ ptr); @@ -619,8 +686,8 @@ public static final int Call(long /*int*/ ptr, long /*int*/ aLibXULDirectory, lo /** * @param ptr cast=(SWT_XREInitEmbedding2) - * @param aLibXULDirectory cast=(nsILocalFile *) - * @param aAppDirectory cast=(nsILocalFile *) + * @param aLibXULDirectory cast=(nsIFile *) + * @param aAppDirectory cast=(nsIFile *) * @param aAppDirProvider cast=(nsIDirectoryServiceProvider *) */ public static final native int _Call(long /*int*/ ptr, long /*int*/ aLibXULDirectory, long /*int*/ aAppDirectory, long /*int*/ aAppDirProvider); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAppShell.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAppShell.java index c67dd14e7c..a34cb847e0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAppShell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAppShell.java @@ -36,7 +36,7 @@ public class nsIAppShell extends nsISupports { public static final nsID NS_IAPPSHELL_IID = new nsID(NS_IAPPSHELL_IID_STR); - + public nsIAppShell(long /*int*/ address) { super(address); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java deleted file mode 100644 index f13efea66f..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2012 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIAuthPrompt2 extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2; - - public static final String NS_IAUTHPROMPT2_IID_STR = - "651395eb-8612-4876-8ac0-a88d4dce9e1e"; - - public static final nsID NS_IAUTHPROMPT2_IID = - new nsID(NS_IAUTHPROMPT2_IID_STR); - - public nsIAuthPrompt2(long /*int*/ address) { - super(address); - } - - public static final int LEVEL_NONE = 0; - public static final int LEVEL_PW_ENCRYPTED = 1; - public static final int LEVEL_SECURE = 2; - - public int PromptAuth(long /*int*/ aParent, long /*int*/ aChannel, int level, long /*int*/ authInfo, char[] checkboxLabel, int[] checkValue, int[] _retval) { - return XPCOM.VtblCall(nsIPromptService.LAST_METHOD_ID + 1, getAddress(), aParent, aChannel, level, authInfo, checkboxLabel, checkValue, _retval); - } - - public int AsyncPromptAuth(long /*int*/ aParent, long /*int*/ aChannel, long /*int*/ aCallback, long /*int*/ aContext, int level, long /*int*/ authInfo, char[] checkboxLabel, int[] checkValue, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIPromptService.LAST_METHOD_ID + 2, getAddress(), aParent, aChannel, aCallback, aContext, level, authInfo, checkboxLabel, checkValue, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIBadCertListener2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIBadCertListener2.java deleted file mode 100644 index 583214061c..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIBadCertListener2.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIBadCertListener2 extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; - - public static final String NS_IBADCERTLISTENER2_IID_STR = - "2c3d268c-ad82-49f3-99aa-e9ffddd7a0dc"; - - public static final nsID NS_IBADCERTLISTENER2_IID = - new nsID(NS_IBADCERTLISTENER2_IID_STR); - - public nsIBadCertListener2(long /*int*/ address) { - super(address); - } - - public int NotifyCertProblem(long /*int*/ socketInfo, long /*int*/ status, long /*int*/ targetSite, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), socketInfo, status, targetSite, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIBaseWindow.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIBaseWindow.java index d67711f3ea..47d8765e33 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIBaseWindow.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIBaseWindow.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIBaseWindow extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 22 : 24); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 23 : (IsXULRunner10 ? 22 : 24)); public static final String NS_IBASEWINDOW_IID_STR = "046bc8a0-8015-11d3-af70-00a024ffc08c"; @@ -59,89 +59,19 @@ public class nsIBaseWindow extends nsISupports { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress()); } - public int SetPosition(int x, int y) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), x, y); - } - - public int GetPosition(int[] x, int[] y) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), x, y); - } - - public int SetSize(int cx, int cy, int fRepaint) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), cx, cy, fRepaint); - } - - public int GetSize(int[] cx, int[] cy) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), cx, cy); - } - public int SetPositionAndSize(int x, int y, int cx, int cy, int fRepaint) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), x, y, cx, cy, fRepaint); } - public int GetPositionAndSize(int[] x, int[] y, int[] cx, int[] cy) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), x, y, cx, cy); - } - - public int Repaint(int force) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), force); - } - - public int GetParentWidget(long /*int*/[] aParentWidget) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aParentWidget); - } - - public int SetParentWidget(long /*int*/ aParentWidget) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aParentWidget); - } - public int GetParentNativeWindow(long /*int*/[] aParentNativeWindow) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aParentNativeWindow); } - public int SetParentNativeWindow(long /*int*/ aParentNativeWindow) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aParentNativeWindow); - } - - public int GetVisibility(int[] aVisibility) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aVisibility); - } - public int SetVisibility(int aVisibility) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aVisibility); - } - - public int GetEnabled(int[] aEnabled) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aEnabled); - } - - public int SetEnabled(int aEnabled) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aEnabled); - } - - public int GetBlurSuppression(int[] aBlurSuppression) { - if (IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress(), aBlurSuppression); - } - - public int SetBlurSuppression(int aBlurSuppression) { - if (IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), aBlurSuppression); - } - - public int GetMainWidget(long /*int*/[] aMainWidget) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 19 : 21), getAddress(), aMainWidget); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 17 : 16), getAddress(), aVisibility); } public int SetFocus() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 20 : 22), getAddress()); - } - - public int GetTitle(long /*int*/[] aTitle) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 21 : 23), getAddress(), aTitle); - } - - public int SetTitle(char[] aTitle) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 22 : 24), getAddress(), aTitle); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 21 : (IsXULRunner10 ? 20 : 22)), getAddress()); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIChannel.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIChannel.java index 9a6517d9a4..5f6bfaf7c2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIChannel.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIChannel.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIChannel extends nsIRequest { - static final int LAST_METHOD_ID = nsIRequest.LAST_METHOD_ID + (IsXULRunner10 ? 19 : 16); + static final int LAST_METHOD_ID = nsIRequest.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 19 : 16); public static final String NS_ICHANNEL_IID_STR = "c63a055a-a676-4e71-bf3c-6cfa11082018"; @@ -112,17 +112,17 @@ public class nsIChannel extends nsIRequest { } public int GetContentDisposition(int[] aContentDisposition) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsIRequest.LAST_METHOD_ID + 17, getAddress(), aContentDisposition); } public int GetContentDispositionFilename(long /*int*/ aContentDispositionFilename) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsIRequest.LAST_METHOD_ID + 18, getAddress(), aContentDispositionFilename); } public int GetContentDispositionHeader(long /*int*/ aContentDispositionHeader) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsIRequest.LAST_METHOD_ID + 19, getAddress(), aContentDispositionHeader); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIComponentManager.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIComponentManager.java index 7140219d74..2b1e81bd2e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIComponentManager.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIComponentManager.java @@ -29,26 +29,24 @@ package org.eclipse.swt.internal.mozilla; public class nsIComponentManager extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 4; + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 6 : 4); public static final String NS_ICOMPONENTMANAGER_IID_STR = "a88e5a60-205a-4bb1-94e1-2628daf51eae"; + public static final String NS_ICOMPONENTMANAGER_17_IID_STR = + "1d940426-5fe5-42c3-84ae-a300f2d9ebd5"; + public static final nsID NS_ICOMPONENTMANAGER_IID = new nsID(NS_ICOMPONENTMANAGER_IID_STR); + + public static final nsID NS_ICOMPONENTMANAGER_17_IID = + new nsID(NS_ICOMPONENTMANAGER_17_IID_STR); public nsIComponentManager(long /*int*/ address) { super(address); } - public int GetClassObject(nsID aClass, nsID aIID, long /*int*/[] result) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aClass, aIID, result); - } - - public int GetClassObjectByContractID(byte[] aContractID, nsID aIID, long /*int*/[] result) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aContractID, aIID, result); - } - public int CreateInstance(nsID aClass, long /*int*/ aDelegate, nsID aIID, long /*int*/[] result) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aClass, aDelegate, aIID, result); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIContextMenuListener.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIContextMenuListener.java deleted file mode 100644 index 3e4d4b92c8..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIContextMenuListener.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIContextMenuListener extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; - - public static final String NS_ICONTEXTMENULISTENER_IID_STR = - "3478b6b0-3875-11d4-94ef-0020183bf181"; - - public static final nsID NS_ICONTEXTMENULISTENER_IID = - new nsID(NS_ICONTEXTMENULISTENER_IID_STR); - - public nsIContextMenuListener(long /*int*/ address) { - super(address); - } - - public static final int CONTEXT_NONE = 0; - public static final int CONTEXT_LINK = 1; - public static final int CONTEXT_IMAGE = 2; - public static final int CONTEXT_DOCUMENT = 4; - public static final int CONTEXT_TEXT = 8; - public static final int CONTEXT_INPUT = 16; - - public int OnShowContextMenu(int aContextFlags, long /*int*/ aEvent, long /*int*/ aNode) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aContextFlags, aEvent, aNode); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java index 2ff7477231..9f6cde12e0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java @@ -29,13 +29,16 @@ package org.eclipse.swt.internal.mozilla; public class nsIDOMDocument extends nsIDOMNode { - static final int LAST_METHOD_ID = nsIDOMNode.LAST_METHOD_ID + (IsXULRunner10 ? 61 : 17); + static final int LAST_METHOD_ID = nsIDOMNode.LAST_METHOD_ID + (IsXULRunner17 ? 63 : (IsXULRunner10 ? 61 : 17)); public static final String NS_IDOMDOCUMENT_IID_STR = "a6cf9075-15b3-11d2-932e-00805f8add32"; public static final String NS_IDOMDOCUMENT_10_IID_STR = "5c3bff4d-ae7f-4c93-948c-519589672c30"; + + public static final String NS_IDOMDOCUMENT_17_IID_STR = + "fdb92f4f-c6b4-4509-a29d-a309981e28ac"; public static final nsID NS_IDOMDOCUMENT_IID = new nsID(NS_IDOMDOCUMENT_IID_STR); @@ -43,307 +46,14 @@ public class nsIDOMDocument extends nsIDOMNode { public static final nsID NS_IDOMDOCUMENT_10_IID = new nsID(NS_IDOMDOCUMENT_10_IID_STR); + public static final nsID NS_IDOMDOCUMENT_17_IID = + new nsID(NS_IDOMDOCUMENT_17_IID_STR); + public nsIDOMDocument(long /*int*/ address) { super(address); } - public int GetDoctype(long /*int*/[] aDoctype) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 1, getAddress(), aDoctype); - } - - public int GetImplementation(long /*int*/[] aImplementation) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 2, getAddress(), aImplementation); - } - public int GetDocumentElement(long /*int*/[] aDocumentElement) { return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 3, getAddress(), aDocumentElement); } - - public int CreateElement(long /*int*/ tagName, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 4, getAddress(), tagName, _retval); - } - - public int CreateDocumentFragment(long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 5, getAddress(), _retval); - } - - public int CreateTextNode(long /*int*/ data, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 6, getAddress(), data, _retval); - } - - public int CreateComment(long /*int*/ data, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 7, getAddress(), data, _retval); - } - - public int CreateCDATASection(long /*int*/ data, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 8, getAddress(), data, _retval); - } - - public int CreateProcessingInstruction(long /*int*/ target, long /*int*/ data, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 9, getAddress(), target, data, _retval); - } - - public int CreateAttribute(long /*int*/ name, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 10, getAddress(), name, _retval); - } - - public int CreateEntityReference(long /*int*/ name, long /*int*/[] _retval) { - if (IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 11, getAddress(), name, _retval); - } - - public int GetElementsByTagName(long /*int*/ tagname, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + (IsXULRunner10 ? 11 : 12), getAddress(), tagname, _retval); - } - - public int ImportNode(long /*int*/ importedNode, int deep, long /*int*/[] _retval) { - if (IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 13, getAddress(), importedNode, deep, _retval); - } - - public int ImportNode(long /*int*/ importedNode, int deep, int _argc, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 12, getAddress(), importedNode, deep, _argc, _retval); - } - - public int CreateElementNS(long /*int*/ namespaceURI, long /*int*/ qualifiedName, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + (IsXULRunner10 ? 13 : 14), getAddress(), namespaceURI, qualifiedName, _retval); - } - - public int CreateAttributeNS(long /*int*/ namespaceURI, long /*int*/ qualifiedName, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + (IsXULRunner10 ? 14 : 15), getAddress(), namespaceURI, qualifiedName, _retval); - } - - public int GetElementsByTagNameNS(long /*int*/ namespaceURI, long /*int*/ localName, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + (IsXULRunner10 ? 15 : 16), getAddress(), namespaceURI, localName, _retval); - } - - public int GetElementById(long /*int*/ elementId, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + (IsXULRunner10 ? 16 : 17), getAddress(), elementId, _retval); - } - - public int GetInputEncoding(long /*int*/ aInputEncoding) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 17, getAddress(), aInputEncoding); - } - - public int GetDocumentURI(long /*int*/ aDocumentURI) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 18, getAddress(), aDocumentURI); - } - - public int AdoptNode(long /*int*/ source, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 19, getAddress(), source, _retval); - } - - public int CreateRange(long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 20, getAddress(), _retval); - } - - public int CreateNodeIterator(long /*int*/ root, int whatToShow, long /*int*/ filter, int entityReferenceExpansion, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 21, getAddress(), root, whatToShow, filter, entityReferenceExpansion, _retval); - } - - public int CreateTreeWalker(long /*int*/ root, int whatToShow, long /*int*/ filter, int entityReferenceExpansion, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 22, getAddress(), root, whatToShow, filter, entityReferenceExpansion, _retval); - } - - public int CreateEvent(long /*int*/ eventType, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 23, getAddress(), eventType, _retval); - } - - public int GetDefaultView(long /*int*/[] aDefaultView) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 24, getAddress(), aDefaultView); - } - - public int GetCharacterSet(long /*int*/ aCharacterSet) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 25, getAddress(), aCharacterSet); - } - - public int GetDir(long /*int*/ aDir) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 26, getAddress(), aDir); - } - - public int SetDir(long /*int*/ aDir) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 27, getAddress(), aDir); - } - - public int GetLocation(long /*int*/[] aLocation) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 28, getAddress(), aLocation); - } - - public int GetTitle(long /*int*/ aTitle) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 29, getAddress(), aTitle); - } - - public int SetTitle(long /*int*/ aTitle) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 30, getAddress(), aTitle); - } - - public int GetReadyState(long /*int*/ aReadyState) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 31, getAddress(), aReadyState); - } - - public int GetLastModified(long /*int*/ aLastModified) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 32, getAddress(), aLastModified); - } - - public int GetReferrer(long /*int*/ aReferrer) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 33, getAddress(), aReferrer); - } - - public int HasFocus(int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 34, getAddress(), _retval); - } - - public int GetActiveElement(long /*int*/[] aActiveElement) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 35, getAddress(), aActiveElement); - } - - public int GetElementsByClassName(long /*int*/ classes, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 36, getAddress(), classes, _retval); - } - - public int GetStyleSheets(long /*int*/[] aStyleSheets) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 37, getAddress(), aStyleSheets); - } - - public int GetPreferredStyleSheetSet(long /*int*/ aPreferredStyleSheetSet) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 38, getAddress(), aPreferredStyleSheetSet); - } - - public int GetSelectedStyleSheetSet(long /*int*/ aSelectedStyleSheetSet) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 39, getAddress(), aSelectedStyleSheetSet); - } - - public int SetSelectedStyleSheetSet(long /*int*/ aSelectedStyleSheetSet) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 40, getAddress(), aSelectedStyleSheetSet); - } - - public int GetLastStyleSheetSet(long /*int*/ aLastStyleSheetSet) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 41, getAddress(), aLastStyleSheetSet); - } - - public int GetStyleSheetSets(long /*int*/[] aStyleSheetSets) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 42, getAddress(), aStyleSheetSets); - } - - public int EnableStyleSheetsForSet(long /*int*/ name) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 43, getAddress(), name); - } - - public int ElementFromPoint(float x, float y, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 44, getAddress(), x, y, _retval); - } - - public int GetContentType(long /*int*/ aContentType) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 45, getAddress(), aContentType); - } - - public int GetMozSyntheticDocument(int[] aMozSyntheticDocument) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 46, getAddress(), aMozSyntheticDocument); - } - - public int GetCurrentScript(long /*int*/[] aCurrentScript) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 47, getAddress(), aCurrentScript); - } - - public int ReleaseCapture() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 48, getAddress()); - } - - public int MozSetImageElement(long /*int*/ aImageElementId, long /*int*/ aImageElement) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 49, getAddress(), aImageElementId, aImageElement); - } - - public int GetMozFullScreenElement(long /*int*/[] aMozFullScreenElement) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 50, getAddress(), aMozFullScreenElement); - } - - public int MozCancelFullScreen() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 51, getAddress()); - } - - public int GetMozFullScreen(int[] aMozFullScreen) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 52, getAddress(), aMozFullScreen); - } - - public int GetMozFullScreenEnabled(int[] aMozFullScreenEnabled) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 53, getAddress(), aMozFullScreenEnabled); - } - - public int GetOnreadystatechange(long /*int*/ cx, long /*int*/ aOnreadystatechange) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 54, getAddress(), cx, aOnreadystatechange); - } - - public int SetOnreadystatechange(long /*int*/ cx, long /*int*/ aOnreadystatechange) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 55, getAddress(), cx, aOnreadystatechange); - } - - public int GetOnmouseenter(long /*int*/ cx, long /*int*/ aOnmouseenter) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 56, getAddress(), cx, aOnmouseenter); - } - - public int SetOnmouseenter(long /*int*/ cx, long /*int*/ aOnmouseenter) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 57, getAddress(), cx, aOnmouseenter); - } - - public int GetOnmouseleave(long /*int*/ cx, long /*int*/ aOnmouseleave) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 58, getAddress(), cx, aOnmouseleave); - } - - public int SetOnmouseleave(long /*int*/ cx, long /*int*/ aOnmouseleave) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 59, getAddress(), cx, aOnmouseleave); - } - - public int GetMozHidden(int[] aMozHidden) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 60, getAddress(), aMozHidden); - } - - public int GetMozVisibilityState(long /*int*/ aMozVisibilityState) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 61, getAddress(), aMozVisibilityState); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java deleted file mode 100644 index 0d30cbd4fb..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2011, 2012 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIDOMElement extends nsIDOMNode { - - static final int LAST_METHOD_ID = nsIDOMNode.LAST_METHOD_ID + (IsXULRunner10 ? 20 : 16); - - public static final String NS_IDOMELEMENT_IID_STR = - "a6cf9078-15b3-11d2-932e-00805f8add32"; - - public static final String NS_IDOMELEMENT_10_IID_STR = - "1f249e8b-7b41-44c0-a8d5-15298c1198cd"; - - public static final nsID NS_IDOMELEMENT_IID = - new nsID(NS_IDOMELEMENT_IID_STR); - - public static final nsID NS_IDOMELEMENT_10_IID = - new nsID(NS_IDOMELEMENT_10_IID_STR); - - public nsIDOMElement(long /*int*/ address) { - super(address); - } - - public int GetTagName(long /*int*/ aTagName) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 1, getAddress(), aTagName); - } - - public int GetAttribute(long /*int*/ name, long /*int*/ _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 2, getAddress(), name, _retval); - } - - public int SetAttribute(long /*int*/ name, long /*int*/ value) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 3, getAddress(), name, value); - } - - public int RemoveAttribute(long /*int*/ name) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 4, getAddress(), name); - } - - public int GetAttributeNode(long /*int*/ name, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 5, getAddress(), name, _retval); - } - - public int SetAttributeNode(long /*int*/ newAttr, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 6, getAddress(), newAttr, _retval); - } - - public int RemoveAttributeNode(long /*int*/ oldAttr, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 7, getAddress(), oldAttr, _retval); - } - - public int GetElementsByTagName(long /*int*/ name, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 8, getAddress(), name, _retval); - } - - public int GetAttributeNS(long /*int*/ namespaceURI, long /*int*/ localName, long /*int*/ _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 9, getAddress(), namespaceURI, localName, _retval); - } - - public int SetAttributeNS(long /*int*/ namespaceURI, long /*int*/ qualifiedName, long /*int*/ value) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 10, getAddress(), namespaceURI, qualifiedName, value); - } - - public int RemoveAttributeNS(long /*int*/ namespaceURI, long /*int*/ localName) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 11, getAddress(), namespaceURI, localName); - } - - public int GetAttributeNodeNS(long /*int*/ namespaceURI, long /*int*/ localName, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 12, getAddress(), namespaceURI, localName, _retval); - } - - public int SetAttributeNodeNS(long /*int*/ newAttr, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 13, getAddress(), newAttr, _retval); - } - - public int GetElementsByTagNameNS(long /*int*/ namespaceURI, long /*int*/ localName, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 14, getAddress(), namespaceURI, localName, _retval); - } - - public int HasAttribute(long /*int*/ name, int[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 15, getAddress(), name, _retval); - } - - public int HasAttributeNS(long /*int*/ namespaceURI, long /*int*/ localName, int[] _retval) { - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 16, getAddress(), namespaceURI, localName, _retval); - } - - public int GetOnmouseenter(long /*int*/ cx, long /*int*/ aOnmouseenter) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 17, getAddress(), cx, aOnmouseenter); - } - - public int SetOnmouseenter(long /*int*/ cx, long /*int*/ aOnmouseenter) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 18, getAddress(), cx, aOnmouseenter); - } - - public int GetOnmouseleave(long /*int*/ cx, long /*int*/ aOnmouseleave) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 19, getAddress(), cx, aOnmouseleave); - } - - public int SetOnmouseleave(long /*int*/ cx, long /*int*/ aOnmouseleave) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 20, getAddress(), cx, aOnmouseleave); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java index a031d616b4..5fdb9d99cb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java @@ -29,13 +29,16 @@ package org.eclipse.swt.internal.mozilla; public class nsIDOMEvent extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 12 : 10); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 25 : (IsXULRunner10 ? 12 : 10)); public static final String NS_IDOMEVENT_IID_STR = "a66b7b80-ff46-bd97-0080-5f8ae38add32"; public static final String NS_IDOMEVENT_10_IID_STR = "e85cff74-951f-45c1-be0c-89442ea2f500"; + + public static final String NS_IDOMEVENT_17_IID_STR = + "270c945b-8a65-4170-bc0b-4ec1443cd39f"; public static final nsID NS_IDOMEVENT_IID = new nsID(NS_IDOMEVENT_IID_STR); @@ -43,6 +46,9 @@ public class nsIDOMEvent extends nsISupports { public static final nsID NS_IDOMEVENT_10_IID = new nsID(NS_IDOMEVENT_10_IID_STR); + public static final nsID NS_IDOMEVENT_17_IID = + new nsID(NS_IDOMEVENT_17_IID_STR); + public nsIDOMEvent(long /*int*/ address) { super(address); } @@ -55,49 +61,11 @@ public class nsIDOMEvent extends nsISupports { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aType); } - public int GetTarget(long /*int*/[] aTarget) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aTarget); - } - public int GetCurrentTarget(long /*int*/[] aCurrentTarget) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aCurrentTarget); } - public int GetEventPhase(short[] aEventPhase) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aEventPhase); - } - - public int GetBubbles(int[] aBubbles) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aBubbles); - } - - public int GetCancelable(int[] aCancelable) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aCancelable); - } - - public int GetTimeStamp(long /*int*/ aTimeStamp) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aTimeStamp); - } - - public int StopPropagation() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress()); - } - public int PreventDefault() { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress()); } - - public int InitEvent(long /*int*/ eventTypeArg, int canBubbleArg, int cancelableArg) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), eventTypeArg, canBubbleArg, cancelableArg); - } - - public int GetDefaultPrevented(int[] aDefaultPrevented) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aDefaultPrevented); - } - - public int StopImmediatePropagation() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress()); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java index 891bfe9e75..569a09c117 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java @@ -37,31 +37,33 @@ public class nsIDOMEventTarget extends nsISupports { public static final String NS_IDOMEVENTTARGET_10_IID_STR = "1797d5a4-b12a-428d-9eef-a0e13839728c"; + public static final String NS_IDOMEVENTTARGET_17_IID_STR = + "8e375931-298d-4d0a-9cb4-5668f0cdc5a8"; + public static final nsID NS_IDOMEVENTTARGET_IID = new nsID(NS_IDOMEVENTTARGET_IID_STR); public static final nsID NS_IDOMEVENTTARGET_10_IID = new nsID(NS_IDOMEVENTTARGET_10_IID_STR); + public static final nsID NS_IDOMEVENTTARGET_17_IID = + new nsID(NS_IDOMEVENTTARGET_17_IID_STR); + public nsIDOMEventTarget(long /*int*/ address) { super(address); } public int AddEventListener(long /*int*/ type, long /*int*/ listener, int useCapture) { - if (IsXULRunner10) return XPCOM.NS_COMFALSE; + if (IsXULRunner10 || IsXULRunner17) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), type, listener, useCapture); } public int AddEventListener(long /*int*/ type, long /*int*/ listener, int useCapture, int wantsUntrusted, int _argc) { - if (!IsXULRunner10) return AddEventListener(type, listener, useCapture); + if (!(IsXULRunner10 || IsXULRunner17)) return AddEventListener(type, listener, useCapture); return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), type, listener, useCapture, wantsUntrusted, _argc); } public int RemoveEventListener(long /*int*/ type, long /*int*/ listener, int useCapture) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), type, listener, useCapture); - } - - public int DispatchEvent(long /*int*/ evt, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), evt, _retval); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 3 : 2), getAddress(), type, listener, useCapture); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java index dd1cbb4469..ebdf978c05 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIDOMKeyEvent extends nsIDOMUIEvent { - static final int LAST_METHOD_ID = nsIDOMUIEvent.LAST_METHOD_ID + 7; + static final int LAST_METHOD_ID = nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 9 : 7); public static final String NS_IDOMKEYEVENT_IID_STR = "028e0e6e-8b01-11d3-aae7-0010838a3123"; @@ -37,12 +37,18 @@ public class nsIDOMKeyEvent extends nsIDOMUIEvent { public static final String NS_IDOMKEYEVENT_10_IID_STR = "def974c3-b491-481b-bc67-29174af4b26a"; + public static final String NS_IDOMKEYEVENT_17_IID_STR = + "5d116380-8432-48cb-a717-200f04c39d2f"; + public static final nsID NS_IDOMKEYEVENT_IID = new nsID(NS_IDOMKEYEVENT_IID_STR); public static final nsID NS_IDOMKEYEVENT_10_IID = new nsID(NS_IDOMKEYEVENT_10_IID_STR); + public static final nsID NS_IDOMKEYEVENT_17_IID = + new nsID(NS_IDOMKEYEVENT_17_IID_STR); + public nsIDOMKeyEvent(long /*int*/ address) { super(address); } @@ -179,7 +185,6 @@ public class nsIDOMKeyEvent extends nsIDOMUIEvent { public static final int DOM_VK_CONTEXT_MENU = 93; public static final int DOM_VK_SLEEP = 95; - public int GetCharCode(int[] aCharCode) { return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 1, getAddress(), aCharCode); } @@ -203,8 +208,4 @@ public class nsIDOMKeyEvent extends nsIDOMUIEvent { public int GetMetaKey(int[] aMetaKey) { return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 6, getAddress(), aMetaKey); } - - public int InitKeyEvent(long /*int*/ typeArg, int canBubbleArg, int cancelableArg, long /*int*/ viewArg, int ctrlKeyArg, int altKeyArg, int shiftKeyArg, int metaKeyArg, int keyCodeArg, int charCodeArg) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 7, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, keyCodeArg, charCodeArg); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java index e4e99ee43b..ac26765055 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java @@ -29,19 +29,25 @@ package org.eclipse.swt.internal.mozilla; public class nsIDOMMouseEvent extends nsIDOMUIEvent { - static final int LAST_METHOD_ID = nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner10 ? 14 : 11); + static final int LAST_METHOD_ID = nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 18 : (IsXULRunner10 ? 14 : 11)); public static final String NS_IDOMMOUSEEVENT_IID_STR = "ff751edc-8b02-aae7-0010-8301838a3123"; public static final String NS_IDOMMOUSEEVENT_10_IID_STR = "7f57aa45-6792-4d8b-ba5b-201533cf0b2f"; + + public static final String NS_IDOMMOUSEEVENT_17_IID_STR = + "796c3436-5f89-4145-be3a-49808c09fdc6"; public static final nsID NS_IDOMMOUSEEVENT_IID = new nsID(NS_IDOMMOUSEEVENT_IID_STR); public static final nsID NS_IDOMMOUSEEVENT_10_IID = new nsID(NS_IDOMMOUSEEVENT_10_IID_STR); + + public static final nsID NS_IDOMMOUSEEVENT_17_IID = + new nsID(NS_IDOMMOUSEEVENT_17_IID_STR); public nsIDOMMouseEvent(long /*int*/ address) { super(address); @@ -55,40 +61,28 @@ public class nsIDOMMouseEvent extends nsIDOMUIEvent { return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 2, getAddress(), aScreenY); } - public int GetClientX(int[] aClientX) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 3, getAddress(), aClientX); - } - - public int GetClientY(int[] aClientY) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 4, getAddress(), aClientY); - } - public int GetCtrlKey(int[] aCtrlKey) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 5, getAddress(), aCtrlKey); + return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 7 : 5), getAddress(), aCtrlKey); } public int GetShiftKey(int[] aShiftKey) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 6, getAddress(), aShiftKey); + return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 8 : 6), getAddress(), aShiftKey); } public int GetAltKey(int[] aAltKey) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 7, getAddress(), aAltKey); + return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 9 : 7), getAddress(), aAltKey); } public int GetMetaKey(int[] aMetaKey) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 8, getAddress(), aMetaKey); + return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 10 : 8), getAddress(), aMetaKey); } public int GetButton(short[] aButton) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 9, getAddress(), aButton); + return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 11 : 9), getAddress(), aButton); } public int GetRelatedTarget(long /*int*/[] aRelatedTarget) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 10, getAddress(), aRelatedTarget); - } - - public int InitMouseEvent(long /*int*/ typeArg, int canBubbleArg, int cancelableArg, long /*int*/ viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, int ctrlKeyArg, int altKeyArg, int shiftKeyArg, int metaKeyArg, short buttonArg, long /*int*/ relatedTargetArg) { - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 11, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg); + return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + (IsXULRunner17 ? 13 : 10), getAddress(), aRelatedTarget); } /* the following constants are defined in Mozilla 10 */ @@ -99,20 +93,4 @@ public class nsIDOMMouseEvent extends nsIDOMUIEvent { public static final int MOZ_SOURCE_CURSOR = 4; public static final int MOZ_SOURCE_TOUCH = 5; public static final int MOZ_SOURCE_KEYBOARD = 6; - - public int GetMozPressure(float[] aMozPressure) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 12, getAddress(), aMozPressure); - } - - public int GetMozInputSource(short[] aMozInputSource) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 13, getAddress(), aMozInputSource); - } - - public int InitNSMouseEvent(long /*int*/ typeArg, int canBubbleArg, int cancelableArg, long /*int*/ viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, int ctrlKeyArg, int altKeyArg, int shiftKeyArg, int metaKeyArg, short buttonArg, long /*int*/ relatedTargetArg, float pressure, short inputSourceArg) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 14, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg, pressure, inputSourceArg); - } - } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java index 2437ff288b..d7f618605d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java @@ -29,13 +29,16 @@ package org.eclipse.swt.internal.mozilla; public class nsIDOMNode extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 36 : 25); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 36 : 25); public static final String NS_IDOMNODE_IID_STR = "a6cf907c-15b3-11d2-932e-00805f8add32"; public static final String NS_IDOMNODE_10_IID_STR = "ce82fb71-60f2-4c38-be31-de5f2f90dada"; + + public static final String NS_IDOMNODE_17_IID_STR = + "5e9bcec9-5928-4f77-8a9c-424ef01c20e1"; public static final nsID NS_IDOMNODE_IID = new nsID(NS_IDOMNODE_IID_STR); @@ -43,6 +46,9 @@ public class nsIDOMNode extends nsISupports { public static final nsID NS_IDOMNODE_10_IID = new nsID(NS_IDOMNODE_10_IID_STR); + public static final nsID NS_IDOMNODE_17_IID = + new nsID(NS_IDOMNODE_17_IID_STR); + public nsIDOMNode(long /*int*/ address) { super(address); } @@ -60,172 +66,11 @@ public class nsIDOMNode extends nsISupports { public static final int DOCUMENT_FRAGMENT_NODE = 11; public static final int NOTATION_NODE = 12; - public int GetNodeName(long /*int*/ aNodeName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aNodeName); - } - - public int GetNodeValue(long /*int*/ aNodeValue) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aNodeValue); - } - - public int SetNodeValue(long /*int*/ aNodeValue) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aNodeValue); - } - - public int GetNodeType(short[] aNodeType) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aNodeType); - } - - public int GetParentNode(long /*int*/[] aParentNode) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aParentNode); - } - - public int GetParentElement(long /*int*/[] aParentElement) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aParentElement); - } - - public int GetChildNodes(long /*int*/[] aChildNodes) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 7 : 6), getAddress(), aChildNodes); - } - - public int GetFirstChild(long /*int*/[] aFirstChild) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 8 : 7), getAddress(), aFirstChild); - } - - public int GetLastChild(long /*int*/[] aLastChild) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 9 : 8), getAddress(), aLastChild); - } - - public int GetPreviousSibling(long /*int*/[] aPreviousSibling) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 10 : 9), getAddress(), aPreviousSibling); - } - - public int GetNextSibling(long /*int*/[] aNextSibling) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 11 : 10), getAddress(), aNextSibling); - } - - public int GetAttributes(long /*int*/[] aAttributes) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 12 : 11), getAddress(), aAttributes); - } - - public int GetOwnerDocument(long /*int*/[] aOwnerDocument) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 13 : 12), getAddress(), aOwnerDocument); - } - - public int InsertBefore(long /*int*/ newChild, long /*int*/ refChild, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 14 : 13), getAddress(), newChild, refChild, _retval); - } - - public int ReplaceChild(long /*int*/ newChild, long /*int*/ oldChild, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 15 : 14), getAddress(), newChild, oldChild, _retval); - } - - public int RemoveChild(long /*int*/ oldChild, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 16 : 15), getAddress(), oldChild, _retval); - } - - public int AppendChild(long /*int*/ newChild, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 17 : 16), getAddress(), newChild, _retval); - } - - public int HasChildNodes(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 18 : 17), getAddress(), _retval); - } - - public int CloneNode(int deep, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 19 : 18), getAddress(), deep, _retval); - } - - public int Normalize() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 20 : 19), getAddress()); - } - - public int IsSupported(long /*int*/ feature, long /*int*/ version, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 21 : 20), getAddress(), feature, version, _retval); - } - - public int GetNamespaceURI(long /*int*/ aNamespaceURI) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 22 : 21), getAddress(), aNamespaceURI); - } - - public int GetPrefix(long /*int*/ aPrefix) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 23 : 22), getAddress(), aPrefix); - } - - public int SetPrefix(long /*int*/ aPrefix) { - if (IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), aPrefix); - } - - public int GetLocalName(long /*int*/ aLocalName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aLocalName); - } - - public int HasAttributes(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), _retval); - } - - public int GetDOMBaseURI(long /*int*/ aBaseURI) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 26, getAddress(), aBaseURI); - } - - /* the following constants are defined in Mozilla 10 */ + /* the following constants are available as of Mozilla 10 */ public static final int DOCUMENT_POSITION_DISCONNECTED = 1; public static final int DOCUMENT_POSITION_PRECEDING = 2; public static final int DOCUMENT_POSITION_FOLLOWING = 4; public static final int DOCUMENT_POSITION_CONTAINS = 8; public static final int DOCUMENT_POSITION_CONTAINED_BY = 16; public static final int DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32; - - public int CompareDocumentPosition(long /*int*/ other, short[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 27, getAddress(), other, _retval); - } - - public int GetTextContent(long /*int*/ aTextContent) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 28, getAddress(), aTextContent); - } - - public int SetTextContent(long /*int*/ aTextContent) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 29, getAddress(), aTextContent); - } - - public int LookupPrefix(long /*int*/ namespaceURI, long /*int*/ _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 30, getAddress(), namespaceURI, _retval); - } - - public int IsDefaultNamespace(long /*int*/ namespaceURI, int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 31, getAddress(), namespaceURI, _retval); - } - - public int LookupNamespaceURI(long /*int*/ prefix, long /*int*/ _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 32, getAddress(), prefix, _retval); - } - - public int IsEqualNode(long /*int*/ arg, int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 33, getAddress(), arg, _retval); - } - - public int SetUserData(long /*int*/ key, long /*int*/ data, long /*int*/ handler, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 34, getAddress(), key, data, handler, _retval); - } - - public int GetUserData(long /*int*/ key, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 35, getAddress(), key, _retval); - } - - public int Contains(long /*int*/ aOther, int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 36, getAddress(), aOther, _retval); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java index 2dbb51a6b4..2f4536d3f7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java @@ -29,87 +29,35 @@ package org.eclipse.swt.internal.mozilla; public class nsIDOMUIEvent extends nsIDOMEvent { - static final int LAST_METHOD_ID = nsIDOMEvent.LAST_METHOD_ID + (IsXULRunner10 ? 13 : 3); + static final int LAST_METHOD_ID = nsIDOMEvent.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 13 : 3); public static final String NS_IDOMUIEVENT_IID_STR = "a6cf90c3-15b3-11d2-932e-00805f8add32"; public static final String NS_IDOMUIEVENT_10_IID_STR = "af3f130e-0c22-4613-a150-780a46c22e3a"; - + + public static final String NS_IDOMUIEVENT_17_IID_STR = + "415453e6-132a-4902-9a99-cc480f0311b6"; + public static final nsID NS_IDOMUIEVENT_IID = new nsID(NS_IDOMUIEVENT_IID_STR); public static final nsID NS_IDOMUIEVENT_10_IID = new nsID(NS_IDOMUIEVENT_10_IID_STR); + public static final nsID NS_IDOMUIEVENT_17_IID = + new nsID(NS_IDOMUIEVENT_17_IID_STR); + public nsIDOMUIEvent(long /*int*/ address) { super(address); } - public int GetView(long /*int*/[] aView) { - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 1, getAddress(), aView); - } - public int GetDetail(int[] aDetail) { return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 2, getAddress(), aDetail); } - public int InitUIEvent(long /*int*/ typeArg, int canBubbleArg, int cancelableArg, long /*int*/ viewArg, int detailArg) { - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 3, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg); - } - /* the following constants are defined in Mozilla 10 */ public static final int SCROLL_PAGE_UP = -32768; public static final int SCROLL_PAGE_DOWN = 32768; - - public int GetLayerX(int[] aLayerX) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 4, getAddress(), aLayerX); - } - - public int GetLayerY(int[] aLayerY) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 5, getAddress(), aLayerY); - } - - public int GetPageX(int[] aPageX) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 6, getAddress(), aPageX); - } - - public int GetPageY(int[] aPageY) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 7, getAddress(), aPageY); - } - - public int GetWhich(int[] aWhich) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 8, getAddress(), aWhich); - } - - public int GetRangeParent(long /*int*/[] aRangeParent) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 9, getAddress(), aRangeParent); - } - - public int GetRangeOffset(int[] aRangeOffset) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 10, getAddress(), aRangeOffset); - } - - public int GetCancelBubble(int[] aCancelBubble) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 11, getAddress(), aCancelBubble); - } - - public int SetCancelBubble(int aCancelBubble) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 12, getAddress(), aCancelBubble); - } - - public int GetIsChar(int[] aIsChar) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 13, getAddress(), aIsChar); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java index e2d80f628f..28700dbd9f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIDOMWindow extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 129 : 17); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 139 : (IsXULRunner10 ? 129 : 17)); public static final String NS_IDOMWINDOW_IID_STR = "a6cf906b-15b3-11d2-932e-00805f8add32"; @@ -37,642 +37,37 @@ public class nsIDOMWindow extends nsISupports { public static final String NS_IDOMWINDOW_10_IID_STR = "8f577294-d572-4473-94b1-d2c5a74a2a74"; + public static final String NS_IDOMWINDOW_17_IID_STR = + "a1af6cd9-c6e7-4037-99f8-dbca1b03e345"; + public static final nsID NS_IDOMWINDOW_IID = new nsID(NS_IDOMWINDOW_IID_STR); public static final nsID NS_IDOMWINDOW_10_IID = new nsID(NS_IDOMWINDOW_10_IID_STR); + public static final nsID NS_IDOMWINDOW_17_IID = + new nsID(NS_IDOMWINDOW_17_IID_STR); + public nsIDOMWindow(long /*int*/ address) { super(address); } - public int GetWindow(long /*int*/[] aWindow) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aWindow); - } - - public int GetSelf(long /*int*/[] aSelf) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aSelf); - } - public int GetDocument(long /*int*/[] aDocument) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 3 : 1), getAddress(), aDocument); - } - - public int GetParent(long /*int*/[] aParent) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 24 : 2), getAddress(), aParent); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 3 : 1), getAddress(), aDocument); } public int GetTop(long /*int*/[] aTop) { + if (IsXULRunner17) return GetRealTop(aTop); return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 21 : 3), getAddress(), aTop); } - - public int GetScrollbars(long /*int*/[] aScrollbars) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 11 : 4), getAddress(), aScrollbars); - } - - public int GetFrames(long /*int*/[] aFrames) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 62 : 5), getAddress(), aFrames); - } - - public int GetName(long /*int*/ aName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 4 : 6), getAddress(), aName); - } - - public int SetName(long /*int*/ aName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 5 : 7), getAddress(), aName); - } - - public int GetLocation(long /*int*/[] aLocation) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aLocation); - } - - public int GetHistory(long /*int*/[] aHistory) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aHistory); - } - - public int GetLocationbar(long /*int*/[] aLocationbar) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aLocationbar); - } - - public int GetMenubar(long /*int*/[] aMenubar) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aMenubar); - } - - public int GetPersonalbar(long /*int*/[] aPersonalbar) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aPersonalbar); - } - - public int GetTextZoom(float[] aTextZoom) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 63 : 8), getAddress(), aTextZoom); - } - - public int SetTextZoom(float aTextZoom) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 64 : 9), getAddress(), aTextZoom); - } - - public int GetScrollX(int[] aScrollX) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 45 : 10), getAddress(), aScrollX); - } - - public int GetScrollY(int[] aScrollY) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 47 : 11), getAddress(), aScrollY); - } - - public int ScrollTo(int xScroll, int yScroll) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 50 : 12), getAddress(), xScroll, yScroll); - } - - public int ScrollBy(int xScrollDif, int yScrollDif) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 51 : 13), getAddress(), xScrollDif, yScrollDif); - } - - public int GetSelection(long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 38 : 14), getAddress(), _retval); - } - - public int ScrollByLines(int numLines) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 65 : 15), getAddress(), numLines); - } - - public int ScrollByPages(int numPages) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 66 : 16), getAddress(), numPages); - } - - public int SizeToContent() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 67 : 17), getAddress()); - } - - public int GetStatusbar(long /*int*/[] aStatusbar) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aStatusbar); - } - - public int GetToolbar(long /*int*/[] aToolbar) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aToolbar); - } - - public int GetStatus(long /*int*/ aStatus) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aStatus); - } - - public int SetStatus(long /*int*/ aStatus) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aStatus); - } - - public int Close() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress()); - } - - public int Stop() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress()); - } - - public int Focus() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress()); - } - - public int Blur() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress()); - } - - public int GetLength(int[] aLength) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), aLength); + public int GetRealTop(long /*int*/[] aTop) { + if (!IsXULRunner17) return XPCOM.NS_ERROR_NOT_IMPLEMENTED; + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), aTop); } - - public int GetOpener(long /*int*/[] aOpener) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), aOpener); - } - - public int SetOpener(long /*int*/ aOpener) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), aOpener); - } - - public int GetFrameElement(long /*int*/[] aFrameElement) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), aFrameElement); - } - - public int GetNavigator(long /*int*/[] aNavigator) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 26, getAddress(), aNavigator); - } - - public int GetApplicationCache(long /*int*/[] aApplicationCache) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 27, getAddress(), aApplicationCache); - } - - public int Alert(long /*int*/ text) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 28, getAddress(), text); - } - - public int Confirm(long /*int*/ text, int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 29, getAddress(), text, _retval); - } - - public int Prompt(long /*int*/ aMessage, long /*int*/ aInitial, long /*int*/ _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 30, getAddress(), aMessage, aInitial, _retval); - } - - public int Print() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 31, getAddress()); - } - - public int ShowModalDialog(long /*int*/ aURI, long /*int*/ aArgs, long /*int*/ aOptions, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 32, getAddress(), aURI, aArgs, aOptions, _retval); - } - - public int PostMessageMoz(long /*int*/ message, long /*int*/ targetOrigin, long /*int*/ cx) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 33, getAddress(), message, targetOrigin, cx); - } - - public int Atob(long /*int*/ aAsciiString, long /*int*/ _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 34, getAddress(), aAsciiString, _retval); - } - - public int Btoa(long /*int*/ aBase64Data, long /*int*/ _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 35, getAddress(), aBase64Data, _retval); - } - - public int GetSessionStorage(long /*int*/[] aSessionStorage) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 36, getAddress(), aSessionStorage); - } - - public int GetLocalStorage(long /*int*/[] aLocalStorage) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 37, getAddress(), aLocalStorage); - } - - public int MatchMedia(long /*int*/ media_query_list, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 39, getAddress(), media_query_list, _retval); - } - - public int GetScreen(long /*int*/[] aScreen) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 40, getAddress(), aScreen); - } - - public int GetInnerWidth(int[] aInnerWidth) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 41, getAddress(), aInnerWidth); - } - - public int SetInnerWidth(int aInnerWidth) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 42, getAddress(), aInnerWidth); - } - - public int GetInnerHeight(int[] aInnerHeight) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 43, getAddress(), aInnerHeight); - } - - public int SetInnerHeight(int aInnerHeight) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 44, getAddress(), aInnerHeight); - } - - public int GetPageXOffset(int[] aPageXOffset) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 46, getAddress(), aPageXOffset); - } - - public int GetPageYOffset(int[] aPageYOffset) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 48, getAddress(), aPageYOffset); - } - - public int Scroll(int xScroll, int yScroll) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 49, getAddress(), xScroll, yScroll); - } - - public int GetScreenX(int[] aScreenX) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 52, getAddress(), aScreenX); - } - - public int SetScreenX(int aScreenX) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 53, getAddress(), aScreenX); - } - - public int GetScreenY(int[] aScreenY) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 54, getAddress(), aScreenY); - } - - public int SetScreenY(int aScreenY) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 55, getAddress(), aScreenY); - } - - public int GetOuterWidth(int[] aOuterWidth) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 56, getAddress(), aOuterWidth); - } - - public int SetOuterWidth(int aOuterWidth) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 57, getAddress(), aOuterWidth); - } - - public int GetOuterHeight(int[] aOuterHeight) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 58, getAddress(), aOuterHeight); - } - - public int SetOuterHeight(int aOuterHeight) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 59, getAddress(), aOuterHeight); - } - - public int GetComputedStyle(long /*int*/ elt, long /*int*/ pseudoElt, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 60, getAddress(), elt, pseudoElt, _retval); - } - - public int GetWindowRoot(long /*int*/[] aWindowRoot) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 61, getAddress(), aWindowRoot); - } - - public int GetContent(long /*int*/[] aContent) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 68, getAddress(), aContent); - } - - public int GetPrompter(long /*int*/[] aPrompter) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 69, getAddress(), aPrompter); - } - - public int GetClosed(int[] aClosed) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 70, getAddress(), aClosed); - } - - public int GetCrypto(long /*int*/[] aCrypto) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 71, getAddress(), aCrypto); - } - - public int GetPkcs11(long /*int*/[] aPkcs11) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 72, getAddress(), aPkcs11); - } - - public int GetControllers(long /*int*/[] aControllers) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 73, getAddress(), aControllers); - } - - public int GetDefaultStatus(long /*int*/ aDefaultStatus) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 74, getAddress(), aDefaultStatus); - } - - public int SetDefaultStatus(long /*int*/ aDefaultStatus) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 75, getAddress(), aDefaultStatus); - } - - public int GetMozInnerScreenX(float[] aMozInnerScreenX) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 76, getAddress(), aMozInnerScreenX); - } - - public int GetMozInnerScreenY(float[] aMozInnerScreenY) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 77, getAddress(), aMozInnerScreenY); - } - - public int GetScrollMaxX(int[] aScrollMaxX) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 78, getAddress(), aScrollMaxX); - } - - public int GetScrollMaxY(int[] aScrollMaxY) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 79, getAddress(), aScrollMaxY); - } - - public int GetFullScreen(int[] aFullScreen) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 80, getAddress(), aFullScreen); - } - - public int SetFullScreen(int aFullScreen) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 81, getAddress(), aFullScreen); - } - - public int Back() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 82, getAddress()); - } - - public int Forward() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 83, getAddress()); - } - - public int Home() { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 84, getAddress()); - } - - public int MoveTo(int xPos, int yPos) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 85, getAddress(), xPos, yPos); - } - - public int MoveBy(int xDif, int yDif) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 86, getAddress(), xDif, yDif); - } - - public int ResizeTo(int width, int height) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 87, getAddress(), width, height); - } - - public int ResizeBy(int widthDif, int heightDif) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 88, getAddress(), widthDif, heightDif); - } - - public int Open(long /*int*/ url, long /*int*/ name, long /*int*/ options, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 89, getAddress(), url, name, options, _retval); - } - - public int OpenDialog(long /*int*/ url, long /*int*/ name, long /*int*/ options, long /*int*/ aExtraArgument, long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 90, getAddress(), url, name, options, aExtraArgument, _retval); - } - - public int UpdateCommands(long /*int*/ action) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 91, getAddress(), action); - } - - public int Find(long /*int*/ str, int caseSensitive, int backwards, int wrapAround, int wholeWord, int searchInFrames, int showDialog, int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 92, getAddress(), str, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog, _retval); - } - - public int GetMozPaintCount(long /*int*/ aMozPaintCount) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 93, getAddress(), aMozPaintCount); - } - - public int MozRequestAnimationFrame(long /*int*/ aListener) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 94, getAddress(), aListener); - } - - public int GetMozAnimationStartTime(long[] aMozAnimationStartTime) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 95, getAddress(), aMozAnimationStartTime); - } - - public int GetURL(long /*int*/[] aURL) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 96, getAddress(), aURL); - } - - public int GetGlobalStorage(long /*int*/[] aGlobalStorage) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 97, getAddress(), aGlobalStorage); - } - - public int GetOnafterprint(long /*int*/ cx, long /*int*/ aOnafterprint) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 98, getAddress(), cx, aOnafterprint); - } - - public int SetOnafterprint(long /*int*/ cx, long /*int*/ aOnafterprint) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 99, getAddress(), cx, aOnafterprint); - } - - public int GetOnbeforeprint(long /*int*/ cx, long /*int*/ aOnbeforeprint) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 100, getAddress(), cx, aOnbeforeprint); - } - - public int SetOnbeforeprint(long /*int*/ cx, long /*int*/ aOnbeforeprint) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 101, getAddress(), cx, aOnbeforeprint); - } - - public int GetOnbeforeunload(long /*int*/ cx, long /*int*/ aOnbeforeunload) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 102, getAddress(), cx, aOnbeforeunload); - } - - public int SetOnbeforeunload(long /*int*/ cx, long /*int*/ aOnbeforeunload) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 103, getAddress(), cx, aOnbeforeunload); - } - - public int GetOnhashchange(long /*int*/ cx, long /*int*/ aOnhashchange) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 104, getAddress(), cx, aOnhashchange); - } - - public int SetOnhashchange(long /*int*/ cx, long /*int*/ aOnhashchange) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 105, getAddress(), cx, aOnhashchange); - } - - public int GetOnmessage(long /*int*/ cx, long /*int*/ aOnmessage) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 106, getAddress(), cx, aOnmessage); - } - - public int SetOnmessage(long /*int*/ cx, long /*int*/ aOnmessage) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 107, getAddress(), cx, aOnmessage); - } - - public int GetOnoffline(long /*int*/ cx, long /*int*/ aOnoffline) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 108, getAddress(), cx, aOnoffline); - } - - public int SetOnoffline(long /*int*/ cx, long /*int*/ aOnoffline) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 109, getAddress(), cx, aOnoffline); - } - - public int GetOnonline(long /*int*/ cx, long /*int*/ aOnonline) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 110, getAddress(), cx, aOnonline); - } - - public int SetOnonline(long /*int*/ cx, long /*int*/ aOnonline) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 111, getAddress(), cx, aOnonline); - } - - public int GetOnpopstate(long /*int*/ cx, long /*int*/ aOnpopstate) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 112, getAddress(), cx, aOnpopstate); - } - - public int SetOnpopstate(long /*int*/ cx, long /*int*/ aOnpopstate) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 113, getAddress(), cx, aOnpopstate); - } - - public int GetOnpagehide(long /*int*/ cx, long /*int*/ aOnpagehide) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 114, getAddress(), cx, aOnpagehide); - } - - public int SetOnpagehide(long /*int*/ cx, long /*int*/ aOnpagehide) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 115, getAddress(), cx, aOnpagehide); - } - - public int GetOnpageshow(long /*int*/ cx, long /*int*/ aOnpageshow) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 116, getAddress(), cx, aOnpageshow); - } - - public int SetOnpageshow(long /*int*/ cx, long /*int*/ aOnpageshow) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 117, getAddress(), cx, aOnpageshow); - } - - public int GetOnresize(long /*int*/ cx, long /*int*/ aOnresize) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 118, getAddress(), cx, aOnresize); - } - - public int SetOnresize(long /*int*/ cx, long /*int*/ aOnresize) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 119, getAddress(), cx, aOnresize); - } - - public int GetOnunload(long /*int*/ cx, long /*int*/ aOnunload) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 120, getAddress(), cx, aOnunload); - } - - public int SetOnunload(long /*int*/ cx, long /*int*/ aOnunload) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 121, getAddress(), cx, aOnunload); - } - - public int GetOndevicemotion(long /*int*/ cx, long /*int*/ aOndevicemotion) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 122, getAddress(), cx, aOndevicemotion); - } - - public int SetOndevicemotion(long /*int*/ cx, long /*int*/ aOndevicemotion) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 123, getAddress(), cx, aOndevicemotion); - } - - public int GetOndeviceorientation(long /*int*/ cx, long /*int*/ aOndeviceorientation) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 124, getAddress(), cx, aOndeviceorientation); - } - - public int SetOndeviceorientation(long /*int*/ cx, long /*int*/ aOndeviceorientation) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 125, getAddress(), cx, aOndeviceorientation); - } - - public int GetOnmouseenter(long /*int*/ cx, long /*int*/ aOnmouseenter) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 126, getAddress(), cx, aOnmouseenter); - } - - public int SetOnmouseenter(long /*int*/ cx, long /*int*/ aOnmouseenter) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 127, getAddress(), cx, aOnmouseenter); - } - - public int GetOnmouseleave(long /*int*/ cx, long /*int*/ aOnmouseleave) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 128, getAddress(), cx, aOnmouseleave); - } - - public int SetOnmouseleave(long /*int*/ cx, long /*int*/ aOnmouseleave) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 129, getAddress(), cx, aOnmouseleave); + + public int GetFrames(long /*int*/[] aFrames) { + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 65 : (IsXULRunner10 ? 62 : 5)), getAddress(), aFrames); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryService.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryService.java deleted file mode 100644 index 9b0719748b..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryService.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIDirectoryService extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3; - - public static final String NS_IDIRECTORYSERVICE_IID_STR = - "57a66a60-d43a-11d3-8cc2-00609792278c"; - - public static final nsID NS_IDIRECTORYSERVICE_IID = - new nsID(NS_IDIRECTORYSERVICE_IID_STR); - - public nsIDirectoryService(long /*int*/ address) { - super(address); - } - - public int Init() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress()); - } - - public int RegisterProvider(long /*int*/ prov) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), prov); - } - - public int UnregisterProvider(long /*int*/ prov) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), prov); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryServiceProvider.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryServiceProvider.java deleted file mode 100644 index 435d97d05c..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryServiceProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIDirectoryServiceProvider extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; - - public static final String NS_IDIRECTORYSERVICEPROVIDER_IID_STR = - "bbf8cab0-d43a-11d3-8cc2-00609792278c"; - - public static final nsID NS_IDIRECTORYSERVICEPROVIDER_IID = - new nsID(NS_IDIRECTORYSERVICEPROVIDER_IID_STR); - - public nsIDirectoryServiceProvider(long /*int*/ address) { - super(address); - } - - public int GetFile(byte[] prop, int[] persistent, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), prop, persistent, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryServiceProvider2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryServiceProvider2.java deleted file mode 100644 index a3b68f2609..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDirectoryServiceProvider2.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIDirectoryServiceProvider2 extends nsIDirectoryServiceProvider { - - static final int LAST_METHOD_ID = nsIDirectoryServiceProvider.LAST_METHOD_ID + 1; - - public static final String NS_IDIRECTORYSERVICEPROVIDER2_IID_STRING = - "2f977d4b-5485-11d4-87e2-0010a4e75ef2"; - - public static final nsID NS_IDIRECTORYSERVICEPROVIDER2_IID = - new nsID(NS_IDIRECTORYSERVICEPROVIDER2_IID_STRING); - - public nsIDirectoryServiceProvider2(long /*int*/ address) { - super(address); - } - - public int GetFiles(byte[] prop, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIDirectoryServiceProvider.LAST_METHOD_ID + 1, getAddress(), prop, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell.java index 4c8d7b7f24..fe6a91fe08 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell.java @@ -48,228 +48,18 @@ public class nsIDocShell extends nsISupports { public static final nsID NS_IDOCSHELL_10_IID = new nsID(NS_IDOCSHELL_10_IID_STR); + + public static final String NS_IDOCSHELL_17_IID_STR = + "9b283337-097d-4fa8-a2da-916318eaf828"; + + public static final nsID NS_IDOCSHELL_17_IID = + new nsID(NS_IDOCSHELL_17_IID_STR); public nsIDocShell(long /*int*/ address) { super(address); } - public int LoadURI(long /*int*/ uri, long /*int*/ loadInfo, int aLoadFlags, int firstParty) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), uri, loadInfo, aLoadFlags, firstParty); - } - public int LoadStream(long /*int*/ aStream, long /*int*/ aURI, long /*int*/ aContentType, long /*int*/ aContentCharset, long /*int*/ aLoadInfo) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aStream, aURI, aContentType, aContentCharset, aLoadInfo); } - - public int InternalLoad(long /*int*/ aURI, long /*int*/ aReferrer, long /*int*/ aOwner, int aInheritOwner, char[] aWindowTarget, long /*int*/ aPostDataStream, long /*int*/ aHeadersStream, int aLoadFlags, long /*int*/ aSHEntry, int firstParty, long /*int*/[] aDocShell, long /*int*/[] aRequest) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aURI, aReferrer, aOwner, aInheritOwner, aWindowTarget, aPostDataStream, aHeadersStream, aLoadFlags, aSHEntry, firstParty, aDocShell, aRequest); - } - - public int CreateLoadInfo(long /*int*/[] loadInfo) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), loadInfo); - } - - public int PrepareForNewContentModel() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress()); - } - - public int SetCurrentURI(long /*int*/ aURI) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aURI); - } - - public int FireUnloadNotification() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress()); - } - - public int GetPresContext(long /*int*/[] aPresContext) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aPresContext); - } - - public int GetPresShell(long /*int*/[] aPresShell) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aPresShell); - } - - public int GetEldestPresShell(long /*int*/[] aEldestPresShell) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aEldestPresShell); - } - - public int GetContentViewer(long /*int*/[] aContentViewer) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aContentViewer); - } - - public int GetChromeEventHandler(long /*int*/[] aChromeEventHandler) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aChromeEventHandler); - } - - public int SetChromeEventHandler(long /*int*/ aChromeEventHandler) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aChromeEventHandler); - } - - public int GetParentURIContentListener(long /*int*/[] aParentURIContentListener) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aParentURIContentListener); - } - - public int SetParentURIContentListener(long /*int*/ aParentURIContentListener) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aParentURIContentListener); - } - - public int GetDocumentCharsetInfo(long /*int*/[] aDocumentCharsetInfo) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aDocumentCharsetInfo); - } - - public int SetDocumentCharsetInfo(long /*int*/ aDocumentCharsetInfo) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aDocumentCharsetInfo); - } - - public int GetAllowPlugins(int[] aAllowPlugins) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aAllowPlugins); - } - - public int SetAllowPlugins(int aAllowPlugins) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress(), aAllowPlugins); - } - - public int GetAllowJavascript(int[] aAllowJavascript) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), aAllowJavascript); - } - - public int SetAllowJavascript(int aAllowJavascript) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), aAllowJavascript); - } - - public int GetAllowMetaRedirects(int[] aAllowMetaRedirects) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), aAllowMetaRedirects); - } - - public int SetAllowMetaRedirects(int aAllowMetaRedirects) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), aAllowMetaRedirects); - } - - public int GetAllowSubframes(int[] aAllowSubframes) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aAllowSubframes); - } - - public int SetAllowSubframes(int aAllowSubframes) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), aAllowSubframes); - } - - public int GetAllowImages(int[] aAllowImages) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 26, getAddress(), aAllowImages); - } - - public int SetAllowImages(int aAllowImages) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 27, getAddress(), aAllowImages); - } - - public static final int ENUMERATE_FORWARDS = 0; - - public static final int ENUMERATE_BACKWARDS = 1; - - public int GetDocShellEnumerator(int aItemType, int aDirection, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 28, getAddress(), aItemType, aDirection, _retval); - } - - public static final int APP_TYPE_UNKNOWN = 0; - - public static final int APP_TYPE_MAIL = 1; - - public int GetAppType(int[] aAppType) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 29, getAddress(), aAppType); - } - - public int SetAppType(int aAppType) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 30, getAddress(), aAppType); - } - - public int GetAllowAuth(int[] aAllowAuth) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 31, getAddress(), aAllowAuth); - } - - public int SetAllowAuth(int aAllowAuth) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 32, getAddress(), aAllowAuth); - } - - public int GetZoom(float[] aZoom) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 33, getAddress(), aZoom); - } - - public int SetZoom(float aZoom) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 34, getAddress(), aZoom); - } - - public int GetMarginWidth(int[] aMarginWidth) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 35, getAddress(), aMarginWidth); - } - - public int SetMarginWidth(int aMarginWidth) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 36, getAddress(), aMarginWidth); - } - - public int GetMarginHeight(int[] aMarginHeight) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 37, getAddress(), aMarginHeight); - } - - public int SetMarginHeight(int aMarginHeight) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 38, getAddress(), aMarginHeight); - } - - public int GetHasFocus(int[] aHasFocus) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 39, getAddress(), aHasFocus); - } - - public int SetHasFocus(int aHasFocus) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 40, getAddress(), aHasFocus); - } - - public int GetCanvasHasFocus(int[] aCanvasHasFocus) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 41, getAddress(), aCanvasHasFocus); - } - - public int SetCanvasHasFocus(int aCanvasHasFocus) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 42, getAddress(), aCanvasHasFocus); - } - - public int TabToTreeOwner(int forward, int[] tookFocus) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 43, getAddress(), forward, tookFocus); - } - - public static final int BUSY_FLAGS_NONE = 0; - public static final int BUSY_FLAGS_BUSY = 1; - public static final int BUSY_FLAGS_BEFORE_PAGE_LOAD = 2; - public static final int BUSY_FLAGS_PAGE_LOADING = 4; - public static final int LOAD_CMD_NORMAL = 1; - public static final int LOAD_CMD_RELOAD = 2; - public static final int LOAD_CMD_HISTORY = 4; - - public int GetBusyFlags(int[] aBusyFlags) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 44, getAddress(), aBusyFlags); - } - - public int GetLoadType(int[] aLoadType) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 45, getAddress(), aLoadType); - } - - public int SetLoadType(int aLoadType) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 46, getAddress(), aLoadType); - } - - public int IsBeingDestroyed(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 47, getAddress(), _retval); - } - - public int GetIsExecutingOnLoadHandler(int[] aIsExecutingOnLoadHandler) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 48, getAddress(), aIsExecutingOnLoadHandler); - } - - public int GetLayoutHistoryState(long /*int*/[] aLayoutHistoryState) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 49, getAddress(), aLayoutHistoryState); - } - - public int SetLayoutHistoryState(long /*int*/ aLayoutHistoryState) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 50, getAddress(), aLayoutHistoryState); - } - - public int GetShouldSaveLayoutState(int[] aShouldSaveLayoutState) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 51, getAddress(), aShouldSaveLayoutState); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow.java index a584ac20a2..bf8f08c8df 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIEmbeddingSiteWindow.java @@ -29,13 +29,19 @@ package org.eclipse.swt.internal.mozilla; public class nsIEmbeddingSiteWindow extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 8; + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 9 : 8); public static final String NS_IEMBEDDINGSITEWINDOW_IID_STR = "3e5432cd-9568-4bd1-8cbe-d50aba110743"; public static final nsID NS_IEMBEDDINGSITEWINDOW_IID = new nsID(NS_IEMBEDDINGSITEWINDOW_IID_STR); + + public static final String NS_IEMBEDDINGSITEWINDOW_17_IID_STR = + "0b976267-4aaa-4f36-a2d4-27b5ca8d73bb"; + + public static final nsID NS_IEMBEDDINGSITEWINDOW_17_IID = + new nsID(NS_IEMBEDDINGSITEWINDOW_17_IID_STR); public nsIEmbeddingSiteWindow(long /*int*/ address) { super(address); @@ -45,34 +51,6 @@ public class nsIEmbeddingSiteWindow extends nsISupports { public static final int DIM_FLAGS_SIZE_INNER = 2; public static final int DIM_FLAGS_SIZE_OUTER = 4; - public int SetDimensions(int flags, int x, int y, int cx, int cy) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), flags, x, y, cx, cy); - } - - public int GetDimensions(int flags, int[] x, int[] y, int[] cx, int[] cy) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), flags, x, y, cx, cy); - } - - public int SetFocus() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress()); - } - - public int GetVisibility(int[] aVisibility) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aVisibility); - } - - public int SetVisibility(int aVisibility) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aVisibility); - } - - public int GetTitle(long /*int*/[] aTitle) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aTitle); - } - - public int SetTitle(char[] aTitle) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aTitle); - } - public int GetSiteWindow(long /*int*/[] aSiteWindow) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aSiteWindow); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFactory.java deleted file mode 100644 index 3429f561e2..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIFactory extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2; - - public static final String NS_IFACTORY_IID_STR = - "00000001-0000-0000-c000-000000000046"; - - public static final nsID NS_IFACTORY_IID = - new nsID(NS_IFACTORY_IID_STR); - - public nsIFactory(long /*int*/ address) { - super(address); - } - - public int CreateInstance(long /*int*/ aOuter, nsID iid, long /*int*/[] result) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aOuter, iid, result); - } - - public int LockFactory(int lock) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), lock); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFile.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFile.java index 455f59bc73..f652baf329 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFile.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFile.java @@ -29,14 +29,20 @@ package org.eclipse.swt.internal.mozilla; public class nsIFile extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 45; + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 62 : 45); public static final String NS_IFILE_IID_STR = "c8c0a080-0868-11d3-915f-d9d889d48e3c"; + + public static final String NS_IFILE_17_IID_STR = + "272a5020-64f5-485c-a8c4-44b2882ae0a2"; public static final nsID NS_IFILE_IID = new nsID(NS_IFILE_IID_STR); + public static final nsID NS_IFILE_17_IID = + new nsID(NS_IFILE_17_IID_STR); + public nsIFile(long /*int*/ address) { super(address); } @@ -44,18 +50,6 @@ public class nsIFile extends nsISupports { public static final int NORMAL_FILE_TYPE = 0; public static final int DIRECTORY_TYPE = 1; - public int Append(long /*int*/ node) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), node); - } - - public int AppendNative(long /*int*/ node) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), node); - } - - public int Normalize() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress()); - } - public int Create(int type, int permissions) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), type, permissions); } @@ -64,163 +58,7 @@ public class nsIFile extends nsISupports { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aLeafName); } - public int SetLeafName(long /*int*/ aLeafName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aLeafName); - } - - public int GetNativeLeafName(long /*int*/ aNativeLeafName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aNativeLeafName); - } - - public int SetNativeLeafName(long /*int*/ aNativeLeafName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aNativeLeafName); - } - - public int CopyTo(long /*int*/ newParentDir, long /*int*/ newName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), newParentDir, newName); - } - - public int CopyToNative(long /*int*/ newParentDir, long /*int*/ newName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), newParentDir, newName); - } - - public int CopyToFollowingLinks(long /*int*/ newParentDir, long /*int*/ newName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), newParentDir, newName); - } - - public int CopyToFollowingLinksNative(long /*int*/ newParentDir, long /*int*/ newName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), newParentDir, newName); - } - - public int MoveTo(long /*int*/ newParentDir, long /*int*/ newName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), newParentDir, newName); - } - - public int MoveToNative(long /*int*/ newParentDir, long /*int*/ newName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), newParentDir, newName); - } - - public int Remove(int recursive) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), recursive); - } - - public int GetPermissions(int[] aPermissions) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aPermissions); - } - - public int SetPermissions(int aPermissions) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aPermissions); - } - - public int GetPermissionsOfLink(int[] aPermissionsOfLink) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aPermissionsOfLink); - } - - public int SetPermissionsOfLink(int aPermissionsOfLink) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress(), aPermissionsOfLink); - } - - public int GetLastModifiedTime(long[] aLastModifiedTime) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), aLastModifiedTime); - } - - public int SetLastModifiedTime(long aLastModifiedTime) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), aLastModifiedTime); - } - - public int GetLastModifiedTimeOfLink(long[] aLastModifiedTimeOfLink) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), aLastModifiedTimeOfLink); - } - - public int SetLastModifiedTimeOfLink(long aLastModifiedTimeOfLink) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), aLastModifiedTimeOfLink); - } - - public int GetFileSize(long[] aFileSize) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aFileSize); - } - - public int SetFileSize(long aFileSize) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), aFileSize); - } - - public int GetFileSizeOfLink(long[] aFileSizeOfLink) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 26, getAddress(), aFileSizeOfLink); - } - - public int GetTarget(long /*int*/ aTarget) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 27, getAddress(), aTarget); - } - - public int GetNativeTarget(long /*int*/ aNativeTarget) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 28, getAddress(), aNativeTarget); - } - public int GetPath(long /*int*/ aPath) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 29, getAddress(), aPath); } - - public int GetNativePath(long /*int*/ aNativePath) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 30, getAddress(), aNativePath); - } - - public int Exists(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 31, getAddress(), _retval); - } - - public int IsWritable(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 32, getAddress(), _retval); - } - - public int IsReadable(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 33, getAddress(), _retval); - } - - public int IsExecutable(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 34, getAddress(), _retval); - } - - public int IsHidden(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 35, getAddress(), _retval); - } - - public int IsDirectory(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 36, getAddress(), _retval); - } - - public int IsFile(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 37, getAddress(), _retval); - } - - public int IsSymlink(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 38, getAddress(), _retval); - } - - public int IsSpecial(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 39, getAddress(), _retval); - } - - public int CreateUnique(int type, int permissions) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 40, getAddress(), type, permissions); - } - - public int Clone(long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 41, getAddress(), _retval); - } - - public int Equals(long /*int*/ inFile, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 42, getAddress(), inFile, _retval); - } - - public int Contains(long /*int*/ inFile, int recur, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 43, getAddress(), inFile, recur, _retval); - } - - public int GetParent(long /*int*/[] aParent) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 44, getAddress(), aParent); - } - - public int GetDirectoryEntries(long /*int*/[] aDirectoryEntries) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 45, getAddress(), aDirectoryEntries); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker.java index f74a83c6b0..141696e61f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker.java @@ -27,19 +27,31 @@ * ***** END LICENSE BLOCK ***** */ package org.eclipse.swt.internal.mozilla; -public class nsIFilePicker extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 15; +public class nsIFilePicker { public static final String NS_IFILEPICKER_IID_STR = "c47de916-1dd1-11b2-8141-82507fa02b21"; + public static final String NS_IFILEPICKER_1_8_IID_STR = + "80faf095-c807-4558-a2cc-185ed70754ea"; + + public static final String NS_IFILEPICKER_10_IID_STR = + "f2c0e216-5d07-4df4-bbcb-37683077ae7e"; + + public static final String NS_IFILEPICKER_17_IID_STR = + "60e2dfb6-3fc7-4a2c-8137-16bef44536fc"; + public static final nsID NS_IFILEPICKER_IID = new nsID(NS_IFILEPICKER_IID_STR); - public nsIFilePicker(long /*int*/ address) { - super(address); - } + public static final nsID NS_IFILEPICKER_1_8_IID = + new nsID(NS_IFILEPICKER_1_8_IID_STR); + + public static final nsID NS_IFILEPICKER_10_IID = + new nsID(NS_IFILEPICKER_10_IID_STR); + + public static final nsID NS_IFILEPICKER_17_IID = + new nsID(NS_IFILEPICKER_17_IID_STR); public static final int modeOpen = 0; public static final int modeSave = 1; @@ -56,63 +68,10 @@ public class nsIFilePicker extends nsISupports { public static final int filterXUL = 32; public static final int filterApps = 64; - public int Init(long /*int*/ parent, char[] title, int mode) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), parent, title, mode); - } - - public int AppendFilters(int filterMask) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), filterMask); - } - - public int AppendFilter(char[] title, char[] filter) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), title, filter); - } - - public int GetDefaultString(long /*int*/[] aDefaultString) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aDefaultString); - } - - public int SetDefaultString(char[] aDefaultString) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aDefaultString); - } - - public int GetDefaultExtension(long /*int*/[] aDefaultExtension) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aDefaultExtension); - } - - public int SetDefaultExtension(char[] aDefaultExtension) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aDefaultExtension); - } - - public int GetFilterIndex(int[] aFilterIndex) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aFilterIndex); - } - - public int SetFilterIndex(int aFilterIndex) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aFilterIndex); - } - - public int GetDisplayDirectory(long /*int*/[] aDisplayDirectory) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aDisplayDirectory); - } - - public int SetDisplayDirectory(long /*int*/ aDisplayDirectory) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aDisplayDirectory); - } - - public int GetFile(long /*int*/[] aFile) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aFile); - } - - public int GetFileURL(long /*int*/[] aFileURL) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aFileURL); - } - - public int GetFiles(long /*int*/[] aFiles) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aFiles); - } + /* the following constants are available as of mozilla 10 */ + public static final int filterAllowURLs = 128; + public static final int filterAudio = 256; + public static final int filterVideo = 512; - public int Show(long /*int*/ _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), _retval); - } + /* outgoing functions removed because this is an implemented interface */ } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePickerShownCallback.java index 1a467a0ab7..e5e48808d6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePickerShownCallback.java @@ -27,21 +27,19 @@ * ***** END LICENSE BLOCK ***** */ package org.eclipse.swt.internal.mozilla; -public class nsIPromptFactory extends nsISupports { +public class nsIFilePickerShownCallback extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; + public static final String NS_IFILEPICKER_IID_STR = + "0d79adad-b244-49A5-9997-2a8cad93fc44"; - public static final String NS_IPROMPTFACTORY_IID_STR = - "2532b748-75db-4732-9173-78d3bf34f694"; + public static final nsID NS_IFILEPICKER_IID = + new nsID (NS_IFILEPICKER_IID_STR); - public static final nsID NS_IPROMPTFACTORY_IID = - new nsID(NS_IPROMPTFACTORY_IID_STR); - - public nsIPromptFactory(long /*int*/ address) { - super(address); + public nsIFilePickerShownCallback (long /*int*/ address) { + super (address); } - public int getPrompt(long /*int*/ aParent, nsID iid, long /*int*/[] result) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aParent, iid, result); + public int Done (int aResult) { + return XPCOM.VtblCall (nsISupports.LAST_METHOD_ID + 1, getAddress(), aResult); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker_1_8.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker_1_8.java deleted file mode 100644 index e0cdd2e2a4..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker_1_8.java +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIFilePicker_1_8 extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 17 : 15); - - public static final String NS_IFILEPICKER_IID_STR = - "80faf095-c807-4558-a2cc-185ed70754ea"; - - public static final String NS_IFILEPICKER_10_IID_STR = - "f2c0e216-5d07-4df4-bbcb-37683077ae7e"; - - public static final nsID NS_IFILEPICKER_IID = - new nsID(NS_IFILEPICKER_IID_STR); - - public static final nsID NS_IFILEPICKER_10_IID = - new nsID(NS_IFILEPICKER_10_IID_STR); - - public nsIFilePicker_1_8(long /*int*/ address) { - super(address); - } - - public static final int modeOpen = 0; - public static final int modeSave = 1; - public static final int modeGetFolder = 2; - public static final int modeOpenMultiple = 3; - public static final int returnOK = 0; - public static final int returnCancel = 1; - public static final int returnReplace = 2; - public static final int filterAll = 1; - public static final int filterHTML = 2; - public static final int filterText = 4; - public static final int filterImages = 8; - public static final int filterXML = 16; - public static final int filterXUL = 32; - public static final int filterApps = 64; - - /* the following constants are defined in mozilla 8 */ - public static final int filterAllowURLs = 128; - public static final int filterAudio = 256; - public static final int filterVideo = 512; - - public int Init(long /*int*/ parent, long /*int*/ title, short mode) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), parent, title, mode); - } - - public int AppendFilters(int filterMask) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), filterMask); - } - - public int AppendFilter(long /*int*/ title, long /*int*/ filter) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), title, filter); - } - - public int GetDefaultString(long /*int*/ aDefaultString) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aDefaultString); - } - - public int SetDefaultString(long /*int*/ aDefaultString) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aDefaultString); - } - - public int GetDefaultExtension(long /*int*/ aDefaultExtension) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aDefaultExtension); - } - - public int SetDefaultExtension(long /*int*/ aDefaultExtension) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aDefaultExtension); - } - - public int GetFilterIndex(int[] aFilterIndex) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aFilterIndex); - } - - public int SetFilterIndex(int aFilterIndex) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aFilterIndex); - } - - public int GetDisplayDirectory(long /*int*/[] aDisplayDirectory) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aDisplayDirectory); - } - - public int SetDisplayDirectory(long /*int*/ aDisplayDirectory) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aDisplayDirectory); - } - - public int GetFile(long /*int*/[] aFile) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aFile); - } - - public int GetFileURL(long /*int*/[] aFileURL) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aFileURL); - } - - public int GetFiles(long /*int*/[] aFiles) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aFiles); - } - - public int Show(long /*int*/ _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 17 : 15), getAddress(), _retval); - } - - public int GetAddToRecentDocs(int[] aAddToRecentDocs) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aAddToRecentDocs); - } - - public int SetAddToRecentDocs(int aAddToRecentDocs) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aAddToRecentDocs); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java index c795bd79ba..a53bd9e662 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIFocusManager extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 18 : 17); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 18 : 17); public static final String NS_IFOCUSMANAGER_IID_STR = "cd6040a8-243f-412a-8a16-0bf2aa1083b9"; @@ -131,7 +131,7 @@ public class nsIFocusManager extends nsISupports { } public int FocusPlugin(long /*int*/ aPlugin) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aPlugin); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog.java deleted file mode 100644 index cca3b464da..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2004, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIHelperAppLauncherDialog extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3; - - public static final String NS_IHELPERAPPLAUNCHERDIALOG_IID_STR = - "d7ebddf0-4c84-11d4-807a-00600811a9c3"; - - public static final nsID NS_IHELPERAPPLAUNCHERDIALOG_IID = - new nsID(NS_IHELPERAPPLAUNCHERDIALOG_IID_STR); - - public nsIHelperAppLauncherDialog(long /*int*/ address) { - super(address); - } - - public int Show(long /*int*/ aLauncher, long /*int*/ aContext) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aLauncher, aContext); - } - - public int PromptForSaveToFile(long /*int*/ aWindowContext, char[] aDefaultFile, char[] aSuggestedFileExtension, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aWindowContext, aDefaultFile, aSuggestedFileExtension, _retval); - } - - public int ShowProgressDialog(long /*int*/ aLauncher, long /*int*/ aContext) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aLauncher, aContext); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog_1_9.java deleted file mode 100644 index 332abfccca..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncherDialog_1_9.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIHelperAppLauncherDialog_1_9 extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2; - - public static final String NS_IHELPERAPPLAUNCHERDIALOG_IID_STR = - "f3704fdc-8ae6-4eba-a3c3-f02958ac0649"; - - public static final nsID NS_IHELPERAPPLAUNCHERDIALOG_IID = - new nsID(NS_IHELPERAPPLAUNCHERDIALOG_IID_STR); - - public nsIHelperAppLauncherDialog_1_9(long /*int*/ address) { - super(address); - } - - public static final int REASON_CANTHANDLE = 0; - public static final int REASON_SERVERREQUEST = 1; - public static final int REASON_TYPESNIFFED = 2; - - public int Show(long /*int*/ aLauncher, long /*int*/ aWindowContext, int aReason) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aLauncher, aWindowContext, aReason); - } - - public int PromptForSaveToFile(long /*int*/ aLauncher, long /*int*/ aWindowContext, char[] aDefaultFileName, char[] aSuggestedFileExtension, int aForcePrompt, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aLauncher, aWindowContext, aDefaultFileName, aSuggestedFileExtension, aForcePrompt, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIInputStream.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIInputStream.java index 15026fea9b..1380ba385a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIInputStream.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIInputStream.java @@ -33,31 +33,31 @@ public class nsIInputStream extends nsISupports { public static final String NS_IINPUTSTREAM_IID_STR = "fa9c7f6c-61b3-11d4-9877-00c04fa0cf4a"; + + public static final String NS_IINPUTSTREAM_17_IID_STR = + "53cdbc97-c2d7-4e30-b2c3-45b2ee79db18"; public static final nsID NS_IINPUTSTREAM_IID = new nsID(NS_IINPUTSTREAM_IID_STR); + + public static final nsID NS_IINPUTSTREAM_17_IID = + new nsID(NS_IINPUTSTREAM_17_IID_STR); public nsIInputStream(long /*int*/ address) { super(address); } - public int Close() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress()); - } - public int Available(int[] _retval) { + if (IsXULRunner17) return XPCOM.NS_COMFALSE; + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), _retval); + } + + public int Available(long[] _retval) { + if (!IsXULRunner17) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), _retval); } public int Read(byte[] aBuf, int aCount, int[] _retval) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aBuf, aCount, _retval); } - - public int ReadSegments(long /*int*/ aWriter, long /*int*/ aClosure, int aCount, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aWriter, aClosure, aCount, _retval); - } - - public int IsNonBlocking(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), _retval); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsILocalFile.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsILocalFile.java index b3c75d93e1..af3317f162 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsILocalFile.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsILocalFile.java @@ -29,83 +29,21 @@ package org.eclipse.swt.internal.mozilla; public class nsILocalFile extends nsIFile { - static final int LAST_METHOD_ID = nsIFile.LAST_METHOD_ID + 17; + static final int LAST_METHOD_ID = nsIFile.LAST_METHOD_ID + (IsXULRunner17 ? 0 : 17); public static final String NS_ILOCALFILE_IID_STR = "aa610f20-a889-11d3-8c81-000064657374"; + + public static final String NS_ILOCALFILE_17_IID_STR = + "ce4ef184-7660-445e-9e59-6731bdc65505"; public static final nsID NS_ILOCALFILE_IID = new nsID(NS_ILOCALFILE_IID_STR); + + public static final nsID NS_ILOCALFILE_17_IID = + new nsID(NS_ILOCALFILE_17_IID_STR); public nsILocalFile(long /*int*/ address) { super(address); } - - public int InitWithPath(long /*int*/ filePath) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 1, getAddress(), filePath); - } - - public int InitWithNativePath(long /*int*/ filePath) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 2, getAddress(), filePath); - } - - public int InitWithFile(long /*int*/ aFile) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 3, getAddress(), aFile); - } - - public int GetFollowLinks(int[] aFollowLinks) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 4, getAddress(), aFollowLinks); - } - - public int SetFollowLinks(int aFollowLinks) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 5, getAddress(), aFollowLinks); - } - - public int OpenNSPRFileDesc(int flags, int mode, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 6, getAddress(), flags, mode, _retval); - } - - public int OpenANSIFileDesc(byte[] mode, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 7, getAddress(), mode, _retval); - } - - public int Load(long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 8, getAddress(), _retval); - } - - public int GetDiskSpaceAvailable(long[] aDiskSpaceAvailable) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 9, getAddress(), aDiskSpaceAvailable); - } - - public int AppendRelativePath(long /*int*/ relativeFilePath) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 10, getAddress(), relativeFilePath); - } - - public int AppendRelativeNativePath(long /*int*/ relativeFilePath) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 11, getAddress(), relativeFilePath); - } - - public int GetPersistentDescriptor(long /*int*/ aPersistentDescriptor) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 12, getAddress(), aPersistentDescriptor); - } - - public int SetPersistentDescriptor(long /*int*/ aPersistentDescriptor) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 13, getAddress(), aPersistentDescriptor); - } - - public int Reveal() { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 14, getAddress()); - } - - public int Launch() { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 15, getAddress()); - } - - public int GetRelativeDescriptor(long /*int*/ fromFile, long /*int*/ _retval) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 16, getAddress(), fromFile, _retval); - } - - public int SetRelativeDescriptor(long /*int*/ fromFile, long /*int*/ relativeDesc) { - return XPCOM.VtblCall(nsIFile.LAST_METHOD_ID + 17, getAddress(), fromFile, relativeDesc); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java index 37612614a3..6a736fbda1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIPrefBranch extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 18; + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 20 : 18); public static final String NS_IPREFBRANCH_IID_STR = "56c35506-f14b-11d3-99d3-ddbfac2ccf65"; @@ -37,11 +37,17 @@ public class nsIPrefBranch extends nsISupports { public static final String NS_IPREFBRANCH_10_IID_STR = "e162bfa0-01bd-4e9f-9843-8fb2efcd6d1f"; + public static final String NS_IPREFBRANCH_17_IID_STR = + "7df46a54-d8b0-448e-903c-4341a1b2499c"; + public static final nsID NS_IPREFBRANCH_IID = new nsID(NS_IPREFBRANCH_IID_STR); public static final nsID NS_IPREFBRANCH_10_IID = new nsID(NS_IPREFBRANCH_10_IID_STR); + + public static final nsID NS_IPREFBRANCH_17_IID = + new nsID(NS_IPREFBRANCH_17_IID_STR); public nsIPrefBranch(long /*int*/ address) { super(address); @@ -52,30 +58,10 @@ public class nsIPrefBranch extends nsISupports { public static final int PREF_INT = 64; public static final int PREF_BOOL = 128; - public int GetRoot(long /*int*/[] aRoot) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aRoot); - } - - public int GetPrefType(byte[] aPrefName, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aPrefName, _retval); - } - - public int GetBoolPref(byte[] aPrefName, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aPrefName, _retval); - } - public int SetBoolPref(byte[] aPrefName, int aValue) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aPrefName, aValue); } - public int GetCharPref(byte[] aPrefName, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aPrefName, _retval); - } - - public int SetCharPref(byte[] aPrefName, byte[] aValue) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aPrefName, aValue); - } - public int GetIntPref(byte[] aPrefName, int[] _retval) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aPrefName, _retval); } @@ -95,32 +81,4 @@ public class nsIPrefBranch extends nsISupports { public int ClearUserPref(byte[] aPrefName) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aPrefName); } - - public int LockPref(byte[] aPrefName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aPrefName); - } - - public int PrefHasUserValue(byte[] aPrefName, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aPrefName, _retval); - } - - public int PrefIsLocked(byte[] aPrefName, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aPrefName, _retval); - } - - public int UnlockPref(byte[] aPrefName) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aPrefName); - } - - public int DeleteBranch(byte[] aStartingAt) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aStartingAt); - } - - public int GetChildList(byte[] aStartingAt, int[] aCount, long /*int*/[] aChildArray) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aStartingAt, aCount, aChildArray); - } - - public int ResetBranch(byte[] aStartingAt) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aStartingAt); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java index b3f5760560..286abb406f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIPrincipal extends nsISerializable { - static final int LAST_METHOD_ID = nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 26 : 23); + static final int LAST_METHOD_ID = nsISerializable.LAST_METHOD_ID + (IsXULRunner17 ? 27 : (IsXULRunner10 ? 26 : 23)); public static final String NS_IPRINCIPAL_IID_STR = "b8268b9a-2403-44ed-81e3-614075c92034"; @@ -42,6 +42,12 @@ public class nsIPrincipal extends nsISerializable { public static final nsID NS_IPRINCIPAL_10_IID = new nsID(NS_IPRINCIPAL_10_IID_STR); + + public static final String NS_IPRINCIPAL_17_IID_STR = + "825ffce8-962d-11e1-aef3-8f2b6188709b"; + + public static final nsID NS_IPRINCIPAL_17_IID = + new nsID(NS_IPRINCIPAL_17_IID_STR); public nsIPrincipal(long /*int*/ address) { super(address); @@ -52,110 +58,8 @@ public class nsIPrincipal extends nsISerializable { public static final int ENABLE_WITH_USER_PERMISSION = 3; public static final int ENABLE_GRANTED = 4; - public int GetPreferences(long /*int*/[] prefBranch, long /*int*/[] id, long /*int*/[] subjectName, long /*int*/[] grantedList, long /*int*/[] deniedList, int[] isTrusted) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 1, getAddress(), prefBranch, id, subjectName, grantedList, deniedList, isTrusted); - } - - public int Equals(long /*int*/ other, int[] _retval) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 2, getAddress(), other, _retval); - } - - public int EqualsIgnoringDomain(long /*int*/ other, int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 3, getAddress(), other, _retval); - } - - public int GetHashValue(int[] aHashValue) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 4 : 3), getAddress(), aHashValue); - } - public int GetJSPrincipals(long /*int*/ cx, long /*int*/[] _retval) { + if (IsXULRunner17) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 5 : 4), getAddress(), cx, _retval); } - - public int GetSecurityPolicy(long /*int*/[] aSecurityPolicy) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 6 : 5), getAddress(), aSecurityPolicy); - } - - public int SetSecurityPolicy(long /*int*/ aSecurityPolicy) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 7 : 6), getAddress(), aSecurityPolicy); - } - - public int CanEnableCapability(byte[] capability, long /*int*/ _retval) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 8 : 7), getAddress(), capability, _retval); - } - - public int SetCanEnableCapability(byte[] capability, short canEnable) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 9 : 8), getAddress(), capability, canEnable); - } - - public int IsCapabilityEnabled(byte[] capability, long /*int*/ annotation, int[] _retval) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 10 : 9), getAddress(), capability, annotation, _retval); - } - - public int EnableCapability(byte[] capability, long /*int*/[] annotation) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 11 : 10), getAddress(), capability, annotation); - } - - public int RevertCapability(byte[] capability, long /*int*/[] annotation) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 12 : 11), getAddress(), capability, annotation); - } - - public int DisableCapability(byte[] capability, long /*int*/[] annotation) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 13 : 12), getAddress(), capability, annotation); - } - - public int GetURI(long /*int*/[] aURI) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 14 : 13), getAddress(), aURI); - } - - public int GetDomain(long /*int*/[] aDomain) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 15 : 14), getAddress(), aDomain); - } - - public int SetDomain(long /*int*/ aDomain) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 16 : 15), getAddress(), aDomain); - } - - public int GetOrigin(long /*int*/[] aOrigin) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 17 : 16), getAddress(), aOrigin); - } - - public int GetHasCertificate(int[] aHasCertificate) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 18 : 17), getAddress(), aHasCertificate); - } - - public int GetFingerprint(long /*int*/ aFingerprint) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 19 : 18), getAddress(), aFingerprint); - } - - public int GetPrettyName(long /*int*/ aPrettyName) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 20 : 19), getAddress(), aPrettyName); - } - - public int Subsumes(long /*int*/ other, int[] _retval) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 21 : 20), getAddress(), other, _retval); - } - - public int CheckMayLoad(long /*int*/ uri, int report) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 22 : 21), getAddress(), uri, report); - } - - public int GetSubjectName(long /*int*/ aSubjectName) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 23 : 22), getAddress(), aSubjectName); - } - - public int GetCertificate(long /*int*/[] aCertificate) { - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + (IsXULRunner10 ? 24 : 23), getAddress(), aCertificate); - } - - public int GetCsp(long /*int*/[] aCsp) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 25, getAddress(), aCsp); - } - - public int SetCsp(long /*int*/ aCsp) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 26, getAddress(), aCsp); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptService.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptService.java index 9cfb774a19..94f402f8a9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptService.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptService.java @@ -27,9 +27,7 @@ * ***** END LICENSE BLOCK ***** */ package org.eclipse.swt.internal.mozilla; -public class nsIPromptService extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 9; +public class nsIPromptService { public static final String NS_IPROMPTSERVICE_IID_STR = "1630c61a-325e-49ca-8759-a31b16c47aa5"; @@ -37,26 +35,6 @@ public class nsIPromptService extends nsISupports { public static final nsID NS_IPROMPTSERVICE_IID = new nsID(NS_IPROMPTSERVICE_IID_STR); - public nsIPromptService(long /*int*/ address) { - super(address); - } - - public int Alert(long /*int*/ aParent, char[] aDialogTitle, char[] aText) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aParent, aDialogTitle, aText); - } - - public int AlertCheck(long /*int*/ aParent, char[] aDialogTitle, char[] aText, char[] aCheckMsg, int[] aCheckState) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aParent, aDialogTitle, aText, aCheckMsg, aCheckState); - } - - public int Confirm(long /*int*/ aParent, char[] aDialogTitle, char[] aText, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aParent, aDialogTitle, aText, _retval); - } - - public int ConfirmCheck(long /*int*/ aParent, char[] aDialogTitle, char[] aText, char[] aCheckMsg, int[] aCheckState, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aParent, aDialogTitle, aText, aCheckMsg, aCheckState, _retval); - } - public static final int BUTTON_POS_0 = 1; public static final int BUTTON_POS_1 = 256; public static final int BUTTON_POS_2 = 65536; @@ -74,24 +52,6 @@ public class nsIPromptService extends nsISupports { public static final int BUTTON_DELAY_ENABLE = 67108864; public static final int STD_OK_CANCEL_BUTTONS = 513; public static final int STD_YES_NO_BUTTONS = 1027; - - public int ConfirmEx(long /*int*/ aParent, char[] aDialogTitle, char[] aText, int aButtonFlags, char[] aButton0Title, char[] aButton1Title, char[] aButton2Title, char[] aCheckMsg, int[] aCheckState, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState, _retval); - } - - public int Prompt(long /*int*/ aParent, char[] aDialogTitle, char[] aText, long /*int*/[] aValue, char[] aCheckMsg, int[] aCheckState, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState, _retval); - } - - public int PromptUsernameAndPassword(long /*int*/ aParent, char[] aDialogTitle, char[] aText, long /*int*/[] aUsername, long /*int*/[] aPassword, char[] aCheckMsg, int[] aCheckState, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState, _retval); - } - - public int PromptPassword(long /*int*/ aParent, char[] aDialogTitle, char[] aText, long /*int*/[] aPassword, char[] aCheckMsg, int[] aCheckState, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState, _retval); - } - public int Select(long /*int*/ aParent, char[] aDialogTitle, char[] aText, int aCount, long /*int*/[] aSelectList, int[] aOutSelection, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection, _retval); - } + /* outgoing functions removed because this is an implemented interface */ } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptService2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptService2.java deleted file mode 100644 index 5d0207fc1f..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptService2.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIPromptService2 extends nsIPromptService { - - static final int LAST_METHOD_ID = nsIPromptService.LAST_METHOD_ID + 2; - - public static final String NS_IPROMPTSERVICE2_IID_STR = - "cf86d196-dbee-4482-9dfa-3477aa128319"; - - public static final nsID NS_IPROMPTSERVICE2_IID = - new nsID(NS_IPROMPTSERVICE2_IID_STR); - - public nsIPromptService2(long /*int*/ address) { - super(address); - } - - public int PromptAuth(long /*int*/ aParent, long /*int*/ aChannel, int level, long /*int*/ authInfo, char[] checkboxLabel, int[] checkValue, int[] _retval) { - return XPCOM.VtblCall(nsIPromptService.LAST_METHOD_ID + 1, getAddress(), aParent, aChannel, level, authInfo, checkboxLabel, checkValue, _retval); - } - - public int AsyncPromptAuth(long /*int*/ aParent, long /*int*/ aChannel, long /*int*/ aCallback, long /*int*/ aContext, int level, long /*int*/ authInfo, char[] checkboxLabel, int[] checkValue, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIPromptService.LAST_METHOD_ID + 2, getAddress(), aParent, aChannel, aCallback, aContext, level, authInfo, checkboxLabel, checkValue, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISSLStatus.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISSLStatus.java index 0a8b3c3531..3575674900 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISSLStatus.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISSLStatus.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsISSLStatus extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 8 : 7); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 8 : 7); public static final String NS_ISSLSTATUS_IID_STR = "cfede939-def1-49be-81ed-d401b3a07d1c"; @@ -76,7 +76,7 @@ public class nsISSLStatus extends nsISupports { } public int GetIsExtendedValidation(int[] aIsExtendedValidation) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aIsExtendedValidation); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java index 2ecc2c9765..93eea95294 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIScriptSecurityManager extends nsIXPCSecurityManager { - static final int LAST_METHOD_ID = nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 27 : 26); + static final int LAST_METHOD_ID = nsIXPCSecurityManager.LAST_METHOD_ID + ((IsXULRunner17 || IsXULRunner10) ? 27 : 26); public static final String NS_ISCRIPTSECURITYMANAGER_IID_STR = "3fffd8e8-3fea-442e-a0ed-2ba81ae197d5"; @@ -48,24 +48,17 @@ public class nsIScriptSecurityManager extends nsIXPCSecurityManager { public static final nsID NS_ISCRIPTSECURITYMANAGER_10_IID = new nsID(NS_ISCRIPTSECURITYMANAGER_10_IID_STR); + + public static final String NS_ISCRIPTSECURITYMANAGER_17_IID_STR = + "45e12581-2c3f-4142-8e0d-4075e5a67d2d"; + + public static final nsID NS_ISCRIPTSECURITYMANAGER_17_IID = + new nsID(NS_ISCRIPTSECURITYMANAGER_17_IID_STR); public nsIScriptSecurityManager(long /*int*/ address) { super(address); } -// public int CheckPropertyAccess(long /*int*/ aJSContext, long /*int*/ aJSObject, byte[] aClassName, !ERROR UNKNOWN C TYPE <jsval >! aProperty, int aAction) { -// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 1, getAddress(), aJSContext, aJSObject, aClassName, aProperty, aAction); -// } - - public int CheckConnect(long /*int*/ aJSContext, long /*int*/ aTargetURI, byte[] aClassName, byte[] aProperty) { - if (IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 2, getAddress(), aJSContext, aTargetURI, aClassName, aProperty); - } - - public int CheckLoadURIFromScript(long /*int*/ cx, long /*int*/ uri) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 2 : 3), getAddress(), cx, uri); - } - public static final int STANDARD = 0; public static final int LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT = 1; public static final int ALLOW_CHROME = 2; @@ -73,105 +66,7 @@ public class nsIScriptSecurityManager extends nsIXPCSecurityManager { public static final int DISALLOW_SCRIPT_OR_DATA = 4; public static final int DISALLOW_SCRIPT = 8; - public int CheckLoadURIWithPrincipal(long /*int*/ aPrincipal, long /*int*/ uri, int flags) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 3 : 4), getAddress(), aPrincipal, uri, flags); - } - - public int CheckLoadURI(long /*int*/ from, long /*int*/ uri, int flags) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 4 : 5), getAddress(), from, uri, flags); - } - - public int CheckLoadURIStrWithPrincipal(long /*int*/ aPrincipal, long /*int*/ uri, int flags) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 5 : 6), getAddress(), aPrincipal, uri, flags); - } - - public int CheckLoadURIStr(long /*int*/ from, long /*int*/ uri, int flags) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 6 : 7), getAddress(), from, uri, flags); - } - - public int CheckFunctionAccess(long /*int*/ cx, long /*int*/ funObj, long /*int*/ targetObj) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 7 : 8), getAddress(), cx, funObj, targetObj); - } - - public int CanExecuteScripts(long /*int*/ cx, long /*int*/ principal, int[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 8 : 9), getAddress(), cx, principal, _retval); - } - - public int GetSubjectPrincipal(long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 9 : 10), getAddress(), _retval); - } - public int GetSystemPrincipal(long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 10 : 11), getAddress(), _retval); - } - -// public int GetCertificatePrincipal(long /*int*/ aCertFingerprint, long /*int*/ aSubjectName, long /*int*/ aPrettyName, long /*int*/ aCert, long /*int*/ aURI, long /*int*/[] _retval) { -// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (Is8 ? 11 : 12), getAddress(), aCertFingerprint, aSubjectName, aPrettyName, aCert, aURI, _retval); -// } - - public int GetCodebasePrincipal(long /*int*/ aURI, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 12 : 13), getAddress(), aURI, _retval); - } - -// public int RequestCapability(long /*int*/ principal, byte[] capability, long /*int*/ _retval) { -// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (Is8 ? 13 : 14), getAddress(), principal, capability, _retval); -// } - - public int IsCapabilityEnabled(byte[] capability, int[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 14 : 15), getAddress(), capability, _retval); - } - - public int EnableCapability(byte[] capability) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 15 : 16), getAddress(), capability); - } - - public int RevertCapability(byte[] capability) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 16 : 17), getAddress(), capability); - } - - public int DisableCapability(byte[] capability) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 17 : 18), getAddress(), capability); - } - -// public int SetCanEnableCapability(long /*int*/ certificateFingerprint, byte[] capability, !ERROR UNKNOWN C TYPE <PRInt16 >! canEnable) { -// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (Is8 ? 18 : 19), getAddress(), certificateFingerprint, capability, canEnable); -// } - - public int GetObjectPrincipal(long /*int*/ cx, long /*int*/ obj, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 19 : 20), getAddress(), cx, obj, _retval); - } - - public int SubjectPrincipalIsSystem(int[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 20 : 21), getAddress(), _retval); - } - - public int CheckSameOrigin(long /*int*/ aJSContext, long /*int*/ aTargetURI) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 21 : 22), getAddress(), aJSContext, aTargetURI); - } - - public int CheckSameOriginURI(long /*int*/ aSourceURI, long /*int*/ aTargetURI, int reportError) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 22 : 23), getAddress(), aSourceURI, aTargetURI, reportError); - } - - public int GetPrincipalFromContext(long /*int*/ cx, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 23 : 24), getAddress(), cx, _retval); - } - - public int GetChannelPrincipal(long /*int*/ aChannel, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 24 : 25), getAddress(), aChannel, _retval); - } - - public int IsSystemPrincipal(long /*int*/ aPrincipal, int[] _retval) { - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner10 ? 25 : 26), getAddress(), aPrincipal, _retval); - } - - public int PushContextPrincipal(long /*int*/ cx, long /*int*/ fp, long /*int*/ principal) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 26, getAddress(), cx, fp, principal); - } - - public int PopContextPrincipal(long /*int*/ cx) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; - return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 27, getAddress(), cx); + return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + (IsXULRunner17 ? 8 : (IsXULRunner10 ? 10 : 11)), getAddress(), _retval); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISupports.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISupports.java index 885542a894..83f3fc7e5d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISupports.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISupports.java @@ -38,7 +38,7 @@ public class nsISupports { static final int FIRST_METHOD_ID = IsSolaris ? 2 : 0; static final int LAST_METHOD_ID = FIRST_METHOD_ID + 2; - public static boolean IsXULRunner10; + public static boolean IsXULRunner10, IsXULRunner17; public static final String NS_ISUPPORTS_IID_STR = "00000000-0000-0000-c000-000000000046"; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISupportsWeakReference.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISupportsWeakReference.java deleted file mode 100644 index 92f390afa5..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISupportsWeakReference.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsISupportsWeakReference extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; - - public static final String NS_ISUPPORTSWEAKREFERENCE_IID_STR = - "9188bc86-f92e-11d2-81ef-0060083a0bcf"; - - public static final nsID NS_ISUPPORTSWEAKREFERENCE_IID = - new nsID(NS_ISUPPORTSWEAKREFERENCE_IID_STR); - - public nsISupportsWeakReference(long /*int*/ address) { - super(address); - } - - public int GetWeakReference(long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsITooltipListener.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsITooltipListener.java deleted file mode 100644 index c362e6b1b9..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsITooltipListener.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2004, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsITooltipListener extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2; - - public static final String NS_ITOOLTIPLISTENER_IID_STR = - "44b78386-1dd2-11b2-9ad2-e4eee2ca1916"; - - public static final nsID NS_ITOOLTIPLISTENER_IID = - new nsID(NS_ITOOLTIPLISTENER_IID_STR); - - public nsITooltipListener(long /*int*/ address) { - super(address); - } - - public int OnShowTooltip(int aXCoords, int aYCoords, char[] aTipText) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aXCoords, aYCoords, aTipText); - } - - public int OnHideTooltip() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress()); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java index 28adbdb1cb..6288c0126e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIURI extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 32 : 26); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 32 : 26); public static final String NS_IURI_IID_STR = "07a22cc0-0ce5-11d3-9331-00104ba0fd40"; @@ -152,32 +152,32 @@ public class nsIURI extends nsISupports { } public int GetRef(long /*int*/ aRef) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 27, getAddress(), aRef); } public int SetRef(long /*int*/ aRef) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 28, getAddress(), aRef); } public int EqualsExceptRef(long /*int*/ other, int[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 29, getAddress(), other, _retval); } public int CloneIgnoringRef(long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 30, getAddress(), _retval); } public int GetSpecIgnoringRef(long /*int*/ aSpecIgnoringRef) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 31, getAddress(), aSpecIgnoringRef); } public int GetHasRef(int[] aHasRef) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 32, getAddress(), aHasRef); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURIContentListener.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURIContentListener.java deleted file mode 100644 index 8b2235f2cb..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURIContentListener.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIURIContentListener extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 8; - - public static final String NS_IURICONTENTLISTENER_IID_STR = - "94928ab3-8b63-11d3-989d-001083010e9b"; - - public static final nsID NS_IURICONTENTLISTENER_IID = - new nsID(NS_IURICONTENTLISTENER_IID_STR); - - public nsIURIContentListener(long /*int*/ address) { - super(address); - } - - public int OnStartURIOpen(long /*int*/ aURI, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aURI, _retval); - } - - public int DoContent(byte[] aContentType, int aIsContentPreferred, long /*int*/ aRequest, long /*int*/[] aContentHandler, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aContentType, aIsContentPreferred, aRequest, aContentHandler, _retval); - } - - public int IsPreferred(byte[] aContentType, long /*int*/[] aDesiredContentType, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aContentType, aDesiredContentType, _retval); - } - - public int CanHandleContent(byte[] aContentType, int aIsContentPreferred, long /*int*/[] aDesiredContentType, int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aContentType, aIsContentPreferred, aDesiredContentType, _retval); - } - - public int GetLoadCookie(long /*int*/[] aLoadCookie) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aLoadCookie); - } - - public int SetLoadCookie(long /*int*/ aLoadCookie) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aLoadCookie); - } - - public int GetParentContentListener(long /*int*/[] aParentContentListener) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aParentContentListener); - } - - public int SetParentContentListener(long /*int*/ aParentContentListener) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aParentContentListener); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIVariant.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIVariant.java index 36ea2a2915..57f8021495 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIVariant.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIVariant.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIVariant extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 27 : 26); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 27 : 26); public static final String NS_IVARIANT_IID_STR = "6c9eb060-8c6a-11d5-90f3-0010a4e73d9a"; @@ -93,7 +93,7 @@ public class nsIVariant extends nsISupports { public int GetAsBool(int[] _retval) { /* mozilla's representation of boolean changed from 4 bytes to 1 byte as of XULRunner 4.x */ - if (nsISupports.IsXULRunner10) { + if (nsISupports.IsXULRunner10 || nsISupports.IsXULRunner17) { byte[] byteValue = new byte[1]; int rc = XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), byteValue); _retval[0] = (int)byteValue[0]; @@ -143,23 +143,23 @@ public class nsIVariant extends nsISupports { } public int GetAsJSVal(long /*int*/[] _retval) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), _retval); } public int GetAsInterface(long /*int*/[] iid, long /*int*/[] iface) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 24 : 23), getAddress(), iid, iface); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 24 : 23), getAddress(), iid, iface); } public int GetAsArray(short[] type, long /*int*/ iid, int[] count, long /*int*/[] ptr) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 25 : 24), getAddress(), type, iid, count, ptr); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 25 : 24), getAddress(), type, iid, count, ptr); } public int GetAsStringWithSize(int[] size, long /*int*/[] str) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 26 : 25), getAddress(), size, str); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 26 : 25), getAddress(), size, str); } public int GetAsWStringWithSize(int[] size, long /*int*/[] str) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 27 : 26), getAddress(), size, str); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 27 : 26), getAddress(), size, str); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWeakReference.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWeakReference.java deleted file mode 100644 index 7a37dbd41d..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWeakReference.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIWeakReference extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; - - public static final String NS_IWEAKREFERENCE_IID_STR = - "9188bc85-f92e-11d2-81ef-0060083a0bcf"; - - public static final nsID NS_IWEAKREFERENCE_IID = - new nsID(NS_IWEAKREFERENCE_IID_STR); - - public nsIWeakReference(long /*int*/ address) { - super(address); - } - - public int QueryReferent(nsID uuid, long /*int*/[] result) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), uuid, result); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java index 02c79c1c58..e14fb82e0a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java @@ -29,7 +29,7 @@ package org.eclipse.swt.internal.mozilla; public class nsIWebBrowser extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner10 ? 9 : 7); + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + ((IsXULRunner10 || IsXULRunner17) ? 9 : 7); public static final String NS_IWEBBROWSER_IID_STR = "69e5df00-7b8b-11d3-af61-00a024ffc08c"; @@ -76,12 +76,12 @@ public class nsIWebBrowser extends nsISupports { } public int GetIsActive(int[] aIsActive) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aIsActive); } public int SetIsActive(int aIsActive) { - if (!IsXULRunner10) return XPCOM.NS_COMFALSE; + if (!(IsXULRunner10 || IsXULRunner17)) return XPCOM.NS_COMFALSE; return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aIsActive); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserChrome.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserChrome.java index e0e0a14cd3..6b600aef0c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserChrome.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserChrome.java @@ -36,6 +36,12 @@ public class nsIWebBrowserChrome extends nsISupports { public static final nsID NS_IWEBBROWSERCHROME_IID = new nsID(NS_IWEBBROWSERCHROME_IID_STR); + + public static final String NS_IWEBBROWSERCHROME_17_IID_STR = + "e8c414c4-dc38-4ba3-ab4e-ec4cbbe22907"; + + public static final nsID NS_IWEBBROWSERCHROME_17_IID = + new nsID(NS_IWEBBROWSERCHROME_17_IID_STR); public nsIWebBrowserChrome(long /*int*/ address) { super(address); @@ -45,18 +51,10 @@ public class nsIWebBrowserChrome extends nsISupports { public static final int STATUS_SCRIPT_DEFAULT = 2; public static final int STATUS_LINK = 3; - public int SetStatus(int statusType, char[] status) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), statusType, status); - } - public int GetWebBrowser(long /*int*/[] aWebBrowser) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aWebBrowser); } - public int SetWebBrowser(long /*int*/ aWebBrowser) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aWebBrowser); - } - public static final int CHROME_DEFAULT = 1; public static final int CHROME_WINDOW_BORDERS = 2; public static final int CHROME_WINDOW_CLOSE = 4; @@ -82,31 +80,7 @@ public class nsIWebBrowserChrome extends nsISupports { public static final int CHROME_OPENAS_CHROME = -2147483648; public static final int CHROME_ALL = 4094; - public int GetChromeFlags(int[] aChromeFlags) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aChromeFlags); - } - public int SetChromeFlags(int aChromeFlags) { return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aChromeFlags); } - - public int DestroyBrowserWindow() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress()); - } - - public int SizeBrowserTo(int aCX, int aCY) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aCX, aCY); - } - - public int ShowAsModal() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress()); - } - - public int IsWindowModal(int[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), _retval); - } - - public int ExitModalEventLoop(int aStatus) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aStatus); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserChromeFocus.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserChromeFocus.java deleted file mode 100644 index 4f85413a52..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserChromeFocus.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIWebBrowserChromeFocus extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2; - - public static final String NS_IWEBBROWSERCHROMEFOCUS_IID_STR = - "d2206418-1dd1-11b2-8e55-acddcd2bcfb8"; - - public static final nsID NS_IWEBBROWSERCHROMEFOCUS_IID = - new nsID(NS_IWEBBROWSERCHROMEFOCUS_IID_STR); - - public nsIWebBrowserChromeFocus(long /*int*/ address) { - super(address); - } - - public int FocusNextElement() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress()); - } - - public int FocusPrevElement() { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress()); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener.java index 902ef3a290..75fce55828 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener.java @@ -36,6 +36,12 @@ public class nsIWebProgressListener extends nsISupports { public static final nsID NS_IWEBPROGRESSLISTENER_IID = new nsID(NS_IWEBPROGRESSLISTENER_IID_STR); + + public static final String NS_IWEBPROGRESSLISTENER_17_IID_STR = + "a0cda7e4-c6ca-11e0-b6a5-001320257da5"; + + public static final nsID NS_IWEBPROGRESSLISTENER_17_IID = + new nsID(NS_IWEBPROGRESSLISTENER_17_IID_STR); public nsIWebProgressListener(long /*int*/ address) { super(address); @@ -56,24 +62,4 @@ public class nsIWebProgressListener extends nsISupports { public static final int STATE_SECURE_HIGH = 262144; public static final int STATE_SECURE_MED = 65536; public static final int STATE_SECURE_LOW = 131072; - - public int OnStateChange(long /*int*/ aWebProgress, long /*int*/ aRequest, int aStateFlags, int aStatus) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aWebProgress, aRequest, aStateFlags, aStatus); - } - - public int OnProgressChange(long /*int*/ aWebProgress, long /*int*/ aRequest, int aCurSelfProgress, int aMaxSelfProgress, int aCurTotalProgress, int aMaxTotalProgress) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress); - } - - public int OnLocationChange(long /*int*/ aWebProgress, long /*int*/ aRequest, long /*int*/ location) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aWebProgress, aRequest, location); - } - - public int OnStatusChange(long /*int*/ aWebProgress, long /*int*/ aRequest, int aStatus, char[] aMessage) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aWebProgress, aRequest, aStatus, aMessage); - } - - public int OnSecurityChange(long /*int*/ aWebProgress, long /*int*/ aRequest, int state) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aWebProgress, aRequest, state); - } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWindowCreator.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWindowCreator.java deleted file mode 100644 index 0db573ee20..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWindowCreator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2011 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIWindowCreator extends nsISupports { - - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; - - public static final String NS_IWINDOWCREATOR_IID_STR = - "30465632-a777-44cc-90f9-8145475ef999"; - - public static final nsID NS_IWINDOWCREATOR_IID = - new nsID(NS_IWINDOWCREATOR_IID_STR); - - public nsIWindowCreator(long /*int*/ address) { - super(address); - } - - public int CreateChromeWindow(long /*int*/ parent, int chromeFlags, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), parent, chromeFlags, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWindowCreator2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWindowCreator2.java deleted file mode 100644 index 7596227d07..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWindowCreator2.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by Netscape are Copyright (C) 1998-1999 - * Netscape Communications Corporation. All Rights Reserved. - * - * Contributor(s): - * - * IBM - * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. - * - * ***** END LICENSE BLOCK ***** */ -package org.eclipse.swt.internal.mozilla; - -public class nsIWindowCreator2 extends nsIWindowCreator { - - static final int LAST_METHOD_ID = nsIWindowCreator.LAST_METHOD_ID + 1; - - public static final String NS_IWINDOWCREATOR2_IID_STR = - "f673ec81-a4b0-11d6-964b-eb5a2bf216fc"; - - public static final nsID NS_IWINDOWCREATOR2_IID = - new nsID(NS_IWINDOWCREATOR2_IID_STR); - - public nsIWindowCreator2(long /*int*/ address) { - super(address); - } - - public static final int PARENT_IS_LOADING_OR_RUNNING_TIMEOUT = 1; - - public int CreateChromeWindow2(long /*int*/ parent, int chromeFlags, int contextFlags, long /*int*/ uri, int[] cancel, long /*int*/[] _retval) { - return XPCOM.VtblCall(nsIWindowCreator.LAST_METHOD_ID + 1, getAddress(), parent, chromeFlags, contextFlags, uri, cancel, _retval); - } -} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWritableVariant.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWritableVariant.java index 59b5008028..18f229a72c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWritableVariant.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWritableVariant.java @@ -91,7 +91,7 @@ public class nsIWritableVariant extends nsIVariant { public int SetAsBool(int aValue) { /* mozilla's representation of boolean changed from 4 bytes to 1 byte as of XULRunner 4.x */ - if (IsXULRunner10) { + if (IsXULRunner10 || IsXULRunner17) { return XPCOM.VtblCall(nsIVariant.LAST_METHOD_ID + 13, getAddress(), (byte)aValue); } return XPCOM.VtblCall(nsIVariant.LAST_METHOD_ID + 13, getAddress(), aValue); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPConnect.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPConnect.java index 4a22bff04a..1fd3dc6258 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPConnect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIXPConnect.java @@ -29,13 +29,19 @@ package org.eclipse.swt.internal.mozilla; public class nsIXPConnect extends nsISupports { - static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 27; + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 48 : 27); public static final String NS_IXPCONNECT_IID_STR = "a995b541-d514-43f1-ac0e-f49746c0b063"; public static final nsID NS_IXPCONNECT_IID = new nsID(NS_IXPCONNECT_IID_STR); + + public static final String NS_IXPCONNECT_17_IID_STR = + "bd300b18-1c34-4589-8285-23a12cc580ea"; + + public static final nsID NS_IXPCONNECT_17_IID = + new nsID(NS_IXPCONNECT_17_IID_STR); public nsIXPConnect(long /*int*/ address) { super(address); @@ -46,6 +52,6 @@ public class nsIXPConnect extends nsISupports { } public int VariantToJS(long /*int*/ ctx, long /*int*/ scope, long /*int*/ value, long /*int*/ _retval) { - return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 33, getAddress(), ctx, scope, value, _retval); + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + (IsXULRunner17 ? 31 : 33), getAddress(), ctx, scope, value, _retval); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java index a9d7bbbf4c..f73f1d23f1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java @@ -24,6 +24,7 @@ class MozillaDelegate { Vector childWindows = new Vector (9); static long /*int*/ MozillaProc; static Callback SubclassProc; + static Callback SubclassProc_UpdateUIState; MozillaDelegate (Browser browser) { super (); @@ -108,6 +109,12 @@ static byte[] wcsToMbcs (String codePage, String string, boolean terminate) { static long /*int*/ windowProc (long /*int*/ hwnd, long /*int*/ msg, long /*int*/ wParam, long /*int*/ lParam) { switch ((int)/*64*/msg) { + case OS.WM_UPDATEUISTATE: + /* + * In XULRunner 17, calling the default windowProc for WM_UPDATEUISTATE message + * terminates the program. Workaround is to prevent the call to default windowProc. + */ + return 0; case OS.WM_ERASEBKGND: RECT rect = new RECT (); OS.GetClientRect (hwnd, rect); @@ -117,6 +124,18 @@ static long /*int*/ windowProc (long /*int*/ hwnd, long /*int*/ msg, long /*int* return OS.CallWindowProc (MozillaProc, hwnd, (int)/*64*/msg, wParam, lParam); } +static long /*int*/ windowProc1 (long /*int*/ hwnd, long /*int*/ msg, long /*int*/ wParam, long /*int*/ lParam) { + switch ((int)/*64*/msg) { + case OS.WM_UPDATEUISTATE: + /* + * In XULRunner 17, calling the default windowProc for WM_UPDATEUISTATE message + * terminates the program. Workaround is to prevent the call to default windowProc. + */ + return 0; + } + return OS.CallWindowProc (MozillaProc, hwnd, (int)/*64*/msg, wParam, lParam); +} + void addWindowSubclass () { long /*int*/ hwndChild = OS.GetWindow (browser.handle, OS.GW_CHILD); if (SubclassProc == null) { @@ -231,15 +250,25 @@ void init () { } void onDispose (long /*int*/ embedHandle) { - removeWindowSubclass (); + if (SubclassProc == null && SubclassProc_UpdateUIState == null) return; + long /*int*/ hwndChild = OS.GetWindow (browser.handle, OS.GW_CHILD); + OS.SetWindowLongPtr (hwndChild, OS.GWL_WNDPROC, MozillaProc); childWindows = null; browser = null; } void removeWindowSubclass () { - if (SubclassProc == null) return; long /*int*/ hwndChild = OS.GetWindow (browser.handle, OS.GW_CHILD); - OS.SetWindowLongPtr (hwndChild, OS.GWL_WNDPROC, MozillaProc); + if (Mozilla.IsPre_17) { + if (SubclassProc != null) { + OS.SetWindowLongPtr (hwndChild, OS.GWL_WNDPROC, MozillaProc); + } + } else { + if (SubclassProc_UpdateUIState == null) { + SubclassProc_UpdateUIState = new Callback (MozillaDelegate.class, "windowProc1", 4); //$NON-NLS-1$ + } + OS.SetWindowLongPtr (hwndChild, OS.GWL_WNDPROC, SubclassProc_UpdateUIState.getAddress ()); + } } boolean sendTraverse () { |