aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2011-12-01 03:20:05 (EST)
committerGrant Gayed2012-03-06 16:45:17 (EST)
commit852f17f3e885ddde267886a8be3483ac6f27465d (patch)
tree858959405a7894531edca23a38acfc6e6b633afe
parentce5bc5ccb4b7e34346accfd668928ba52a6f7a27 (diff)
downloadeclipse.platform.swt-852f17f3e885ddde267886a8be3483ac6f27465d.zip
eclipse.platform.swt-852f17f3e885ddde267886a8be3483ac6f27465d.tar.gz
eclipse.platform.swt-852f17f3e885ddde267886a8be3483ac6f27465d.tar.bz2
xulrunner-1.9-fixes
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java10
3 files changed, 52 insertions, 28 deletions
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 acb1167..2439036 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
@@ -1826,7 +1826,7 @@ void initFactories (nsIServiceManager serviceManager, nsIComponentManager compon
factory.AddRef ();
byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_PROMPTSERVICE_CONTRACTID, true);
byte[] aClassName = MozillaDelegate.wcsToMbcs (null, "swtPromptService", true); //$NON-NLS-1$
-// rc = componentRegistrar.RegisterFactory (XPCOM.NS_PROMPTSERVICE_CID, aClassName, aContractID, factory.getAddress());
+ rc = componentRegistrar.RegisterFactory (XPCOM.NS_PROMPTSERVICE_CID, aClassName, aContractID, factory.getAddress ());
if (rc != XPCOM.NS_OK) {
browser.dispose ();
error (rc);
@@ -1834,14 +1834,14 @@ void initFactories (nsIServiceManager serviceManager, nsIComponentManager compon
if (!IsPre_2) {
aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_PROMPTER_CONTRACTID, true);
aClassName = MozillaDelegate.wcsToMbcs (null, "swtPrompter", true); //$NON-NLS-1$
- rc = componentRegistrar.RegisterFactory (XPCOM.NS_PROMPTER_CID, aClassName, aContractID, factory.getAddress());
+ rc = componentRegistrar.RegisterFactory (XPCOM.NS_PROMPTER_CID, aClassName, aContractID, factory.getAddress ());
if (rc != XPCOM.NS_OK) {
browser.dispose ();
error (rc);
}
aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_AUTHPROMPTER_CONTRACTID, true);
aClassName = MozillaDelegate.wcsToMbcs (null, "swtAuthPrompter", true); //$NON-NLS-1$
- rc = componentRegistrar.RegisterFactory (XPCOM.NS_AUTHPROMPTER_CID, aClassName, aContractID, factory.getAddress());
+ rc = componentRegistrar.RegisterFactory (XPCOM.NS_AUTHPROMPTER_CID, aClassName, aContractID, factory.getAddress ());
if (rc != XPCOM.NS_OK) {
browser.dispose ();
error (rc);
@@ -3647,13 +3647,13 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
if (!IsPre_2) {
- nsIDOMEventTarget_1_9 target = new nsIDOMEventTarget_1_9 (result[0]);
- hookDOMListeners_1_9 (target, isTop);
- target.Release ();
- } else {
nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
hookDOMListeners (target, isTop);
target.Release ();
+ } else {
+ nsIDOMEventTarget_1_9 target = new nsIDOMEventTarget_1_9 (result[0]);
+ hookDOMListeners_1_9 (target, isTop);
+ target.Release ();
}
result[0] = 0;
@@ -3803,10 +3803,17 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
}
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
- nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+
+ if (!IsPre_2) {
+ nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+ hookDOMListeners (target, isTop);
+ target.Release ();
+ } else {
+ nsIDOMEventTarget_1_9 target = new nsIDOMEventTarget_1_9 (result[0]);
+ hookDOMListeners_1_9 (target, isTop);
+ target.Release ();
+ }
result[0] = 0;
- hookDOMListeners (target, isTop);
- target.Release ();
} else {
registerFunctionsOnState = 0;
}
@@ -3905,10 +3912,16 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
- nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+ if (!IsPre_2) {
+ nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+ hookDOMListeners (target, isTop);
+ target.Release ();
+ } else {
+ nsIDOMEventTarget_1_9 target = new nsIDOMEventTarget_1_9 (result[0]);
+ hookDOMListeners_1_9 (target, isTop);
+ target.Release ();
+ }
result[0] = 0;
- hookDOMListeners (target, isTop);
- target.Release ();
/*
* Remove and unreference the nsIDOMWindow from the collection of windows
@@ -4330,17 +4343,26 @@ int FocusPrevElement () {
int OnShowContextMenu (int aContextFlags, int /*long*/ aEvent, int /*long*/ aNode) {
nsIDOMEvent domEvent = new nsIDOMEvent (aEvent);
int /*long*/[] result = new int /*long*/[1];
- int rc = domEvent.QueryInterface (nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID, result);
+ int rc = domEvent.QueryInterface (IsPre_2 ? nsIDOMMouseEvent_1_9.NS_IDOMMOUSEEVENT_IID : nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
- nsIDOMMouseEvent domMouseEvent = new nsIDOMMouseEvent (result[0]);
int[] aScreenX = new int[1], aScreenY = new int[1];
- rc = domMouseEvent.GetScreenX (aScreenX);
- if (rc != XPCOM.NS_OK) error (rc);
- rc = domMouseEvent.GetScreenY (aScreenY);
- if (rc != XPCOM.NS_OK) error (rc);
- domMouseEvent.Release ();
+ if (!IsPre_2) {
+ nsIDOMMouseEvent domMouseEvent = new nsIDOMMouseEvent (result[0]);
+ rc = domMouseEvent.GetScreenX (aScreenX);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domMouseEvent.GetScreenY (aScreenY);
+ if (rc != XPCOM.NS_OK) error (rc);
+ domMouseEvent.Release ();
+ } else {
+ nsIDOMMouseEvent_1_9 domMouseEvent = new nsIDOMMouseEvent_1_9 (result[0]);
+ rc = domMouseEvent.GetScreenX (aScreenX);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domMouseEvent.GetScreenY (aScreenY);
+ if (rc != XPCOM.NS_OK) error (rc);
+ domMouseEvent.Release ();
+ }
Event event = new Event ();
event.x = aScreenX[0];
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 fe70518..fbdbfc3 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
@@ -90,18 +90,20 @@ int Release () {
int CreateInstance (int /*long*/ aOuter, int /*long*/ iid, int /*long*/ result) {
nsID guid = new nsID ();
XPCOM.memmove (guid, iid, nsID.sizeof);
- if (guid.Equals (nsIPromptService2.NS_IPROMPTSERVICE2_IID)) {
+ if (guid.Equals (nsIPromptService2.NS_IPROMPTSERVICE2_IID) || guid.Equals(nsIPromptService.NS_IPROMPTSERVICE_IID)) {
PromptService2 promptService = new PromptService2 ();
promptService.AddRef ();
XPCOM.memmove (result, new int /*long*/[] {promptService.getAddress ()}, C.PTR_SIZEOF);
- } else if (guid.Equals (nsIPromptFactory.NS_IPROMPTFACTORY_IID)) {
+ return XPCOM.NS_OK;
+ }
+ if (guid.Equals (nsIPromptFactory.NS_IPROMPTFACTORY_IID)) {
PromptFactory promptFactory = new PromptFactory();
promptFactory.AddRef ();
XPCOM.memmove (result, new int /*long*/[] {promptFactory.getAddress ()}, C.PTR_SIZEOF);
AddRef ();
return XPCOM.NS_OK;
}
- return XPCOM.NS_OK;
+ return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
}
int LockFactory (int lock) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java
index 1b2816b..811e1dc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java
@@ -27,9 +27,9 @@
* ***** END LICENSE BLOCK ***** */
package org.eclipse.swt.internal.mozilla;
-public class nsIDOMUIEvent_1_9 extends nsIDOMEvent {
+public class nsIDOMUIEvent_1_9 extends nsIDOMEvent_1_9 {
- static final int LAST_METHOD_ID = nsIDOMEvent.LAST_METHOD_ID + 3;
+ static final int LAST_METHOD_ID = nsIDOMEvent_1_9.LAST_METHOD_ID + 3;
public static final String NS_IDOMUIEVENT_IID_STR =
"a6cf906b-15b3-11d2-932e-00805f8add32";
@@ -42,15 +42,15 @@ public class nsIDOMUIEvent_1_9 extends nsIDOMEvent {
}
public int GetView(int /*long*/[] aView) {
- return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 1, getAddress(), aView);
+ return XPCOM.VtblCall(nsIDOMEvent_1_9.LAST_METHOD_ID + 1, getAddress(), aView);
}
public int GetDetail(int[] aDetail) {
- return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 2, getAddress(), aDetail);
+ return XPCOM.VtblCall(nsIDOMEvent_1_9.LAST_METHOD_ID + 2, getAddress(), aDetail);
}
//nsIDOMWindow - viewArg
public int InitUIEvent(int /*long*/ typeArg, int canBubbleArg, int cancelableArg, int /*long*/ viewArg, int detailArg) {
- return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 3, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
+ return XPCOM.VtblCall(nsIDOMEvent_1_9.LAST_METHOD_ID + 3, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
}
}