org.eclipse.swt.win32.win32.x86_3.7.2.v3740f

 return this$0.Release();
  }
  
  public int method3(int[] args)
  {
    return this$0.canCreateWrapper(args[0], args[1]);
  }
  
  public int method4(int[] args)
  {
    return this$0.canCallMethod(args[0], args[1], args[2]);
  }
  
  public int method5(int[] args)
  {
    return this$0.canGetProperty(args[0], args[1], args[2]);
  }
  
  public int method6(int[] args)
  {
    return this$0.canSetProperty(args[0], args[1], args[2]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.External.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class External$4
  extends XPCOMObject
{
  final External this$0;
  
  External$4(External paramExternal, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramExternal;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
  
  public int method3(int[] args)
  {
    return this$0.callJava(args[0], args[1], args[2], args[3]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.External.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import java.util.Hashtable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.internal.C;
import org.eclipse.swt.internal.mozilla.XPCOM;
import org.eclipse.swt.internal.mozilla.XPCOMObject;
import org.eclipse.swt.internal.mozilla.nsIClassInfo;
import org.eclipse.swt.internal.mozilla.nsIComponentManager;
import org.eclipse.swt.internal.mozilla.nsID;
import org.eclipse.swt.internal.mozilla.nsIMemory;
import org.eclipse.swt.internal.mozilla.nsISecurityCheckedComponent;
import org.eclipse.swt.internal.mozilla.nsIServiceManager;
import org.eclipse.swt.internal.mozilla.nsISupports;
import org.eclipse.swt.internal.mozilla.nsIVariant;
import org.eclipse.swt.internal.mozilla.nsIWritableVariant;

class External
{
  public static final String EXTERNAL_IID_STR = "ded01d20-ba6f-11dd-ad8b-0800200c9a66";
  public static final nsID EXTERNAL_IID = new nsID("ded01d20-ba6f-11dd-ad8b-0800200c9a66");
  XPCOMObject supports;
  XPCOMObject external;
  XPCOMObject classInfo;
  XPCOMObject securityCheckedComponent;
  int refCount = 0;
  
  External()
  {
    createCOMInterfaces();
  }
  
  int AddRef()
  {
    refCount += 1;
    return refCount;
  }
  
  void createCOMInterfaces()
  {
    supports = new XPCOMObject(new int[] { 2 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
    };
    classInfo = new XPCOMObject(new int[] { 2, 0, 0, 2, 2, 1, 1, 1, 1, 1, 1 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return getInterfaces(args[0], args[1]);
      }
      
      public int method4(int[] args)
      {
        return getHelperForLanguage(args[0], args[1]);
      }
      
      public int method5(int[] args)
      {
        return getContractID(args[0]);
      }
      
      public int method6(int[] args)
      {
        return getClassDescription(args[0]);
      }
      
      public int method7(int[] args)
      {
        return getClassID(args[0]);
      }
      
      public int method8(int[] args)
      {
        return getImplementationLanguage(args[0]);
      }
      
      public int method9(int[] args)
      {
        return getFlags(args[0]);
      }
      
      public int method10(int[] args)
      {
        return getClassIDNoAlloc(args[0]);
      }
    };
    securityCheckedComponent = new XPCOMObject(new int[] { 2, 0, 0, 2, 3, 3, 3 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return canCreateWrapper(args[0], args[1]);
      }
      
      public int method4(int[] args)
      {
        return canCallMethod(args[0], args[1], args[2]);
      }
      
      public int method5(int[] args)
      {
        return canGetProperty(args[0], args[1], args[2]);
      }
      
      public int method6(int[] args)
      {
        return canSetProperty(args[0], args[1], args[2]);
      }
    };
    external = new XPCOMObject(new int[] { 2, 0, 0, 4 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return callJava(args[0], args[1], args[2], args[3]);
      }
    };
  }
  
  void disposeCOMInterfaces()
  {
    if (supports != null)
    {
      supports.dispose();
      supports = null;
    }
    if (external != null)
    {
      external.dispose();
      external = null;
    }
  }
  
  int getAddress()
  {
    return external.getAddress();
  }
  
  int QueryInterface(int riid, int ppvObject)
  {
    if ((riid == 0) || (ppvObject == 0)) {
      return -2147467262;
    }
    nsID guid = new nsID();
    XPCOM.memmove(guid, riid, 16);
    if (guid.Equals(nsISupports.NS_ISUPPORTS_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { supports.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(nsIClassInfo.NS_ICLASSINFO_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { classInfo.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(nsISecurityCheckedComponent.NS_ISECURITYCHECKEDCOMPONENT_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { securityCheckedComponent.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(EXTERNAL_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { external.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    XPCOM.memmove(ppvObject, new int[1], C.PTR_SIZEOF);
    return -2147467262;
  }
  
  int Release()
  {
    refCount -= 1;
    if (refCount == 0) {
      disposeCOMInterfaces();
    }
    return refCount;
  }
  
  int getClassDescription(int _retValue)
  {
    int[] result = new int[1];
    int rc = XPCOM.NS_GetServiceManager(result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
    result[0] = 0;
    byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
    rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    serviceManager.Release();
    
    nsIMemory memory = new nsIMemory(result[0]);
    result[0] = 0;
    byte[] bytes = MozillaDelegate.wcsToMbcs(null, "external", true);
    int ptr = memory.Alloc(bytes.length);
    C.memmove(ptr, bytes, bytes.length);
    C.memmove(_retValue, new int[] { ptr }, C.PTR_SIZEOF);
    memory.Release();
    
    return 0;
  }
  
  int getClassID(int _retValue)
  {
    return 0;
  }
  
  int getClassIDNoAlloc(int _retValue)
  {
    return 0;
  }
  
  int getContractID(int _retValue)
  {
    return 0;
  }
  
  int getFlags(int flags)
  {
    C.memmove(flags, new int[] { 4 }, 4);
    return 0;
  }
  
  int getHelperForLanguage(int language, int _retValue)
  {
    C.memmove(_retValue, new int[1], C.PTR_SIZEOF);
    return 0;
  }
  
  int getImplementationLanguage(int _retValue)
  {
    C.memmove(_retValue, new int[] { 5 }, 4);
    return 0;
  }
  
  int getInterfaces(int count, int array)
  {
    int[] result = new int[1];
    int rc = XPCOM.NS_GetServiceManager(result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
    result[0] = 0;
    byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
    rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    serviceManager.Release();
    
    nsIMemory memory = new nsIMemory(result[0]);
    result[0] = 0;
    int securityCheckedComponentIID = memory.Alloc(16);
    XPCOM.memmove(securityCheckedComponentIID, nsISecurityCheckedComponent.NS_ISECURITYCHECKEDCOMPONENT_IID, 16);
    int externalIID = memory.Alloc(16);
    XPCOM.memmove(externalIID, EXTERNAL_IID, 16);
    int ptrArray = memory.Alloc(2 * C.PTR_SIZEOF);
    C.memmove(ptrArray, new int[] { securityCheckedComponentIID }, C.PTR_SIZEOF);
    C.memmove(ptrArray + C.PTR_SIZEOF, new int[] { externalIID }, C.PTR_SIZEOF);
    C.memmove(array, new int[] { ptrArray }, C.PTR_SIZEOF);
    memory.Release();
    
    C.memmove(count, new int[] { 2 }, 4);
    return 0;
  }
  
  int canCreateWrapper(int iid, int _retVal)
  {
    int[] result = new int[1];
    int rc = XPCOM.NS_GetServiceManager(result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
    result[0] = 0;
    byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
    rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    serviceManager.Release();
    
    nsIMemory memory = new nsIMemory(result[0]);
    result[0] = 0;
    byte[] bytes = MozillaDelegate.wcsToMbcs(null, "allAccess", true);
    int ptr = memory.Alloc(bytes.length);
    C.memmove(ptr, bytes, bytes.length);
    C.memmove(_retVal, new int[] { ptr }, C.PTR_SIZEOF);
    memory.Release();
    
    return 0;
  }
  
  int canCallMethod(int iid, int methodName, int _retVal)
  {
    int[] result = new int[1];
    int rc = XPCOM.NS_GetServiceManager(result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
    result[0] = 0;
    byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
    rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    serviceManager.Release();
    
    nsIMemory memory = new nsIMemory(result[0]);
    result[0] = 0;
    int length = XPCOM.strlen_PRUnichar(methodName);
    char[] dest = new char[length];
    XPCOM.memmove(dest, methodName, length * 2);
    String string = new String(dest);
    byte[] bytes;
    byte[] bytes;
    if (string.equals("callJava")) {
      bytes = MozillaDelegate.wcsToMbcs(null, "allAccess", true);
    } else {
      bytes = MozillaDelegate.wcsToMbcs(null, "noAccess", true);
    }
    int ptr = memory.Alloc(bytes.length);
    C.memmove(ptr, bytes, bytes.length);
    C.memmove(_retVal, new int[] { ptr }, C.PTR_SIZEOF);
    memory.Release();
    
    return 0;
  }
  
  int canGetProperty(int iid, int propertyName, int _retVal)
  {
    int[] result = new int[1];
    int rc = XPCOM.NS_GetServiceManager(result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
    result[0] = 0;
    byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
    rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    serviceManager.Release();
    
    nsIMemory memory = new nsIMemory(result[0]);
    result[0] = 0;
    byte[] bytes = MozillaDelegate.wcsToMbcs(null, "noAccess", true);
    int ptr = memory.Alloc(bytes.length);
    C.memmove(ptr, bytes, bytes.length);
    C.memmove(_retVal, new int[] { ptr }, C.PTR_SIZEOF);
    memory.Release();
    
    return 0;
  }
  
  int canSetProperty(int iid, int propertyName, int _retVal)
  {
    int[] result = new int[1];
    int rc = XPCOM.NS_GetServiceManager(result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
    result[0] = 0;
    byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
    rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    serviceManager.Release();
    
    nsIMemory memory = new nsIMemory(result[0]);
    result[0] = 0;
    byte[] bytes = MozillaDelegate.wcsToMbcs(null, "noAccess", true);
    int ptr = memory.Alloc(bytes.length);
    C.memmove(ptr, bytes, bytes.length);
    C.memmove(_retVal, new int[] { ptr }, C.PTR_SIZEOF);
    memory.Release();
    
    return 0;
  }
  
  Object convertToJava(nsIVariant variant, short type)
  {
    switch (type)
    {
    case 13: 
    case 255: 
      return null;
    case 254: 
      return new Object[0];
    case 10: 
      int[] boolResult = new int[1];
      int rc = variant.GetAsBool(boolResult);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      return new Boolean(boolResult[0] != 0);
    case 2: 
      int[] intResult = new int[1];
      int rc = variant.GetAsInt32(intResult);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      return new Double(intResult[0]);
    case 9: 
      int doubleReturn = C.malloc(8);
      int rc = variant.GetAsDouble(doubleReturn);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      double[] doubleResult = new double[1];
      C.memmove(doubleResult, doubleReturn, 8);
      C.free(doubleReturn);
      return new Double(doubleResult[0]);
    case 22: 
      int[] size = new int[1];
      int[] wString = new int[1];
      int rc = variant.GetAsWStringWithSize(size, wString);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      char[] chars = new char[size[0]];
      C.memmove(chars, wString[0], size[0] * 2);
      return new String(chars);
    case 20: 
      Object[] arrayReturn = new Object[0];
      int iid = C.malloc(16);
      C.memset(iid, 0, 16);
      int[] count = new int[1];
      short[] currentType = new short[1];
      int[] ptr = new int[1];
      int rc = variant.GetAsArray(currentType, iid, count, ptr);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      if (ptr[0] == 0) {
        Mozilla.error(-2147467261);
      }
      nsID id = new nsID();
      XPCOM.memmove(id, iid, 16);
      C.free(iid);
      
      int[] result = new int[1];
      rc = XPCOM.NS_GetServiceManager(result);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      if (result[0] == 0) {
        Mozilla.error(-2147467262);
      }
      nsIServiceManager serviceManager = new nsIServiceManager(result[0]);
      result[0] = 0;
      byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/xpcom/memory-service;1", true);
      rc = serviceManager.GetServiceByContractID(aContractID, nsIMemory.NS_IMEMORY_IID, result);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      if (result[0] == 0) {
        Mozilla.error(-2147467262);
      }
      serviceManager.Release();
      
      nsIMemory memory = new nsIMemory(result[0]);
      result[0] = 0;
      if (id.Equals(nsIVariant.NS_IVARIANT_IID))
      {
        arrayReturn = new Object[count[0]];
        for (int i = 0; i < count[0]; i++)
        {
          int[] arrayPtr = new int[1];
          C.memmove(arrayPtr, ptr[0] + i * C.PTR_SIZEOF, C.PTR_SIZEOF);
          nsISupports supports = new nsISupports(arrayPtr[0]);
          rc = supports.QueryInterface(nsIVariant.NS_IVARIANT_IID, result);
          if (rc != 0) {
            Mozilla.error(rc);
          }
          if (result[0] == 0) {
            Mozilla.error(-2147467262);
          }
          nsIVariant currentVariant = new nsIVariant(result[0]);
          result[0] = 0;
          currentType[0] = 0;
          rc = currentVariant.GetDataType(currentType);
          if (rc != 0) {
            Mozilla.error(rc);
          }
          try
          {
            arrayReturn[i] = convertToJava(currentVariant, currentType[0]);
            currentVariant.Release();
          }
          catch (IllegalArgumentException e)
          {
            currentVariant.Release();
            memory.Free(ptr[0]);
            memory.Release();
            throw e;
          }
        }
      }
      else
      {
        switch (currentType[0])
        {
        case 9: 
          arrayReturn = new Object[count[0]];
          for (int i = 0; i < count[0]; i++)
          {
            double[] doubleValue = new double[1];
            C.memmove(doubleValue, ptr[0] + i * 8, 8);
            arrayReturn[i] = new Double(doubleValue[0]);
          }
          break;
        case 10: 
          arrayReturn = new Object[count[0]];
          for (int i = 0; i < count[0]; i++)
          {
            int[] boolValue = new int[1];
            C.memmove(boolValue, ptr[0] + i * 4, 4);
            arrayReturn[i] = new Boolean(boolValue[0] != 0);
          }
          break;
        case 2: 
          arrayReturn = new Object[count[0]];
          for (int i = 0; i < count[0]; i++)
          {
            int[] intValue = new int[1];
            C.memmove(intValue, ptr[0] + i * 4, 4);
            arrayReturn[i] = new Double(intValue[0]);
          }
          break;
        case 17: 
          arrayReturn = new Object[count[0]];
          for (int i = 0; i < count[0]; i++)
          {
            int currentPtr = ptr[0] + i * C.PTR_SIZEOF;
            int[] stringPtr = new int[1];
            C.memmove(stringPtr, currentPtr, C.PTR_SIZEOF);
            int length = XPCOM.strlen_PRUnichar(stringPtr[0]);
            char[] dest = new char[length];
            XPCOM.memmove(dest, stringPtr[0], length * 2);
            arrayReturn[i] = new String(dest);
          }
          break;
        default: 
          memory.Free(ptr[0]);
          memory.Release();
          SWT.error(5);
        }
      }
      memory.Free(ptr[0]);
      memory.Release();
      return arrayReturn;
    }
    SWT.error(5);
    return null;
  }
  
  nsIVariant convertToJS(Object value, nsIComponentManager componentManager)
  {
    int[] result = new int[1];
    byte[] aContractID = MozillaDelegate.wcsToMbcs(null, "@mozilla.org/variant;1", true);
    int rc = componentManager.CreateInstanceByContractID(aContractID, 0, nsIWritableVariant.NS_IWRITABLEVARIANT_IID, result);
    nsIWritableVariant variant = new nsIWritableVariant(result[0]);
    result[0] = 0;
    if (value == null)
    {
      rc = variant.SetAsEmpty();
      if (rc != 0) {
        Mozilla.error(rc);
      }
      return variant;
    }
    if ((value instanceof String))
    {
      String stringValue = (String)value;
      int length = stringValue.length();
      char[] chars = new char[length];
      stringValue.getChars(0, length, chars, 0);
      rc = variant.SetAsWStringWithSize(length, chars);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      return variant;
    }
    if ((value instanceof Boolean))
    {
      Boolean booleanValue = (Boolean)value;
      rc = variant.SetAsBool(booleanValue.booleanValue() ? 1 : 0);
      if (rc != 0) {
        Mozilla.error(rc);
      }
      return variant;
    }
    if ((value instanceof Number))
    {
      Number numberValue = (Number)value;
      rc = variant.SetAsDouble(numberValue.doubleValue());
      if (rc != 0) {
        Mozilla.error(rc);
      }
      return variant;
    }
    if ((value instanceof Object[]))
    {
      Object[] arrayValue = (Object[])value;
      int length = arrayValue.length;
      if (length == 0)
      {
        rc = variant.SetAsEmptyArray();
        if (rc != 0) {
          Mozilla.error(rc);
        }
      }
      else
      {
        int arrayPtr = C.malloc(C.PTR_SIZEOF * length);
        for (int i = 0; i < length; i++)
        {
          Object currentObject = arrayValue[i];
          try
          {
            nsIVariant currentVariant = convertToJS(currentObject, componentManager);
            C.memmove(arrayPtr + C.PTR_SIZEOF * i, new int[] { currentVariant.getAddress() }, C.PTR_SIZEOF);
          }
          catch (SWTException e)
          {
            C.free(arrayPtr);
            variant.Release();
            for (int j = 0; j < i; j++)
            {
              int[] ptr = new int[1];
              C.memmove(ptr, arrayPtr + C.PTR_SIZEOF * j, C.PTR_SIZEOF);
              new nsISupports(ptr[0]).Release();
            }
            throw e;
          }
        }
        int idPtr = C.malloc(16);
        XPCOM.memmove(idPtr, nsIVariant.NS_IVARIANT_IID, 16);
        rc = variant.SetAsArray((short)19, idPtr, length, arrayPtr);
        C.free(idPtr);
        C.free(arrayPtr);
        if (rc != 0) {
          Mozilla.error(rc);
        }
      }
      return variant;
    }
    variant.Release();
    SWT.error(51);
    return null;
  }
  
  int callJava(int functionId, int tokenVariant, int args, int returnPtr)
  {
    Object key = new Integer(functionId);
    BrowserFunction function = (BrowserFunction)Mozilla.AllFunctions.get(key);
    Object returnValue = null;
    if (function != null) {
      try
      {
        short[] type = new short[1];
        nsIVariant variant = new nsIVariant(tokenVariant);
        int rc = variant.GetDataType(type);
        if (rc != 0) {
          Mozilla.error(rc);
        }
        Object temp = convertToJava(variant, type[0]);
        type[0] = 0;
        if ((temp instanceof Number))
        {
          long token = ((Number)temp).longValue();
          if (token == token)
          {
            variant = new nsIVariant(args);
            rc = variant.GetDataType(type);
            if (rc != 0) {
              Mozilla.error(rc);
            }
            temp = convertToJava(variant, type[0]);
            if ((temp instanceof Object[]))
            {
              Object[] arguments = (Object[])temp;
              try
              {
                returnValue = function.function(arguments);
              }
              catch (Exception e)
              {
                returnValue = WebBrowser.CreateErrorString(e.getLocalizedMessage());
              }
            }
          }
        }
        result = new int[1];
      }
      catch (IllegalArgumentException e)
      {
        if (isEvaluate) {
          function.function(new String[] { WebBrowser.CreateErrorString(new SWTException(51).getLocalizedMessage()) });
        }
        returnValue = WebBrowser.CreateErrorString(e.getLocalizedMessage());
      }
    }
    int[] result;
    int rc = XPCOM.NS_GetComponentManager(result);
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (result[0] == 0) {
      Mozilla.error(-2147467262);
    }
    nsIComponentManager componentManager = new nsIComponentManager(result[0]);
    result[0] = 0;
    nsIVariant variant;
    try
    {
      variant = convertToJS(returnValue, componentManager);
    }
    catch (SWTException e)
    {
      nsIVariant variant;
      variant = convertToJS(WebBrowser.CreateErrorString(e.getLocalizedMessage()), componentManager);
    }
    componentManager.Release();
    C.memmove(returnPtr, new int[] { variant.getAddress() }, C.PTR_SIZEOF);
    
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.External
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class ExternalFactory$1
  extends XPCOMObject
{
  final ExternalFactory this$0;
  
  ExternalFactory$1(ExternalFactory paramExternalFactory, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramExternalFactory;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.ExternalFactory.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class ExternalFactory$2
  extends XPCOMObject
{
  final ExternalFactory this$0;
  
  ExternalFactory$2(ExternalFactory paramExternalFactory, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramExternalFactory;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
  
  public int method3(int[] args)
  {
    return this$0.CreateInstance(args[0], args[1], args[2]);
  }
  
  public int method4(int[] args)
  {
    return this$0.LockFactory(args[0]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.ExternalFactory.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.C;
import org.eclipse.swt.internal.mozilla.XPCOM;
import org.eclipse.swt.internal.mozilla.XPCOMObject;
import org.eclipse.swt.internal.mozilla.nsID;
import org.eclipse.swt.internal.mozilla.nsIFactory;
import org.eclipse.swt.internal.mozilla.nsISupports;

class ExternalFactory
{
  XPCOMObject supports;
  XPCOMObject factory;
  int refCount = 0;
  
  ExternalFactory()
  {
    createCOMInterfaces();
  }
  
  int AddRef()
  {
    refCount += 1;
    return refCount;
  }
  
  void createCOMInterfaces()
  {
    supports = new XPCOMObject(new int[] { 2 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
    };
    factory = new XPCOMObject(new int[] { 2, 0, 0, 3, 1 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return CreateInstance(args[0], args[1], args[2]);
      }
      
      public int method4(int[] args)
      {
        return LockFactory(args[0]);
      }
    };
  }
  
  void disposeCOMInterfaces()
  {
    if (supports != null)
    {
      supports.dispose();
      supports = null;
    }
    if (factory != null)
    {
      factory.dispose();
      factory = null;
    }
  }
  
  int getAddress()
  {
    return factory.getAddress();
  }
  
  int QueryInterface(int riid, int ppvObject)
  {
    if ((riid == 0) || (ppvObject == 0)) {
      return -2147467262;
    }
    nsID guid = new nsID();
    XPCOM.memmove(guid, riid, 16);
    if (guid.Equals(nsISupports.NS_ISUPPORTS_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { supports.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(nsIFactory.NS_IFACTORY_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { factory.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    XPCOM.memmove(ppvObject, new int[1], C.PTR_SIZEOF);
    return -2147467262;
  }
  
  int Release()
  {
    refCount -= 1;
    if (refCount == 0) {
      disposeCOMInterfaces();
    }
    return refCount;
  }
  
  int CreateInstance(int aOuter, int iid, int result)
  {
    External external = new External();
    external.AddRef();
    XPCOM.memmove(result, new int[] { external.getAddress() }, C.PTR_SIZEOF);
    return 0;
  }
  
  int LockFactory(int lock)
  {
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.ExternalFactory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class FilePicker$1
  extends XPCOMObject
{
  final FilePicker this$0;
  
  FilePicker$1(FilePicker paramFilePicker, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramFilePicker;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.FilePicker.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.mozilla.XPCOMObject;

class FilePicker$2
  extends XPCOMObject
{
  final FilePicker this$0;
  
  FilePicker$2(FilePicker paramFilePicker, int[] $anonymous0)
  {
    super($anonymous0);this$0 = paramFilePicker;
  }
  
  public int method0(int[] args)
  {
    return this$0.QueryInterface(args[0], args[1]);
  }
  
  public int method1(int[] args)
  {
    return this$0.AddRef();
  }
  
  public int method2(int[] args)
  {
    return this$0.Release();
  }
  
  public int method3(int[] args)
  {
    return this$0.Init(args[0], args[1], (short)args[2]);
  }
  
  public int method4(int[] args)
  {
    return this$0.AppendFilters(args[0]);
  }
  
  public int method5(int[] args)
  {
    return this$0.AppendFilter(args[0], args[1]);
  }
  
  public int method6(int[] args)
  {
    return this$0.GetDefaultString(args[0]);
  }
  
  public int method7(int[] args)
  {
    return this$0.SetDefaultString(args[0]);
  }
  
  public int method8(int[] args)
  {
    return this$0.GetDefaultExtension(args[0]);
  }
  
  public int method9(int[] args)
  {
    return this$0.SetDefaultExtension(args[0]);
  }
  
  public int method10(int[] args)
  {
    return this$0.GetFilterIndex(args[0]);
  }
  
  public int method11(int[] args)
  {
    return this$0.SetFilterIndex(args[0]);
  }
  
  public int method12(int[] args)
  {
    return this$0.GetDisplayDirectory(args[0]);
  }
  
  public int method13(int[] args)
  {
    return this$0.SetDisplayDirectory(args[0]);
  }
  
  public int method14(int[] args)
  {
    return this$0.GetFile(args[0]);
  }
  
  public int method15(int[] args)
  {
    return this$0.GetFileURL(args[0]);
  }
  
  public int method16(int[] args)
  {
    return this$0.GetFiles(args[0]);
  }
  
  public int method17(int[] args)
  {
    return this$0.Show(args[0]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.FilePicker.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import org.eclipse.swt.internal.C;
import org.eclipse.swt.internal.mozilla.XPCOM;
import org.eclipse.swt.internal.mozilla.XPCOMObject;
import org.eclipse.swt.internal.mozilla.nsEmbedString;
import org.eclipse.swt.internal.mozilla.nsID;
import org.eclipse.swt.internal.mozilla.nsIDOMWindow;
import org.eclipse.swt.internal.mozilla.nsIFilePicker;
import org.eclipse.swt.internal.mozilla.nsIFilePicker_1_8;
import org.eclipse.swt.internal.mozilla.nsILocalFile;
import org.eclipse.swt.internal.mozilla.nsISupports;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;

class FilePicker
{
  XPCOMObject supports;
  XPCOMObject filePicker;
  int refCount = 0;
  short mode;
  int parentHandle;
  String[] files;
  String[] masks;
  String defaultFilename;
  String directory;
  String title;
  static final String SEPARATOR = System.getProperty("file.separator");
  
  FilePicker()
  {
    createCOMInterfaces();
  }
  
  int AddRef()
  {
    refCount += 1;
    return refCount;
  }
  
  void createCOMInterfaces()
  {
    supports = new XPCOMObject(new int[] { 2 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(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 })
    {
      public int method0(int[] args)
      {
        return QueryInterface(args[0], args[1]);
      }
      
      public int method1(int[] args)
      {
        return AddRef();
      }
      
      public int method2(int[] args)
      {
        return Release();
      }
      
      public int method3(int[] args)
      {
        return Init(args[0], args[1], (short)args[2]);
      }
      
      public int method4(int[] args)
      {
        return AppendFilters(args[0]);
      }
      
      public int method5(int[] args)
      {
        return AppendFilter(args[0], args[1]);
      }
      
      public int method6(int[] args)
      {
        return GetDefaultString(args[0]);
      }
      
      public int method7(int[] args)
      {
        return SetDefaultString(args[0]);
      }
      
      public int method8(int[] args)
      {
        return GetDefaultExtension(args[0]);
      }
      
      public int method9(int[] args)
      {
        return SetDefaultExtension(args[0]);
      }
      
      public int method10(int[] args)
      {
        return GetFilterIndex(args[0]);
      }
      
      public int method11(int[] args)
      {
        return SetFilterIndex(args[0]);
      }
      
      public int method12(int[] args)
      {
        return GetDisplayDirectory(args[0]);
      }
      
      public int method13(int[] args)
      {
        return SetDisplayDirectory(args[0]);
      }
      
      public int method14(int[] args)
      {
        return GetFile(args[0]);
      }
      
      public int method15(int[] args)
      {
        return GetFileURL(args[0]);
      }
      
      public int method16(int[] args)
      {
        return GetFiles(args[0]);
      }
      
      public int method17(int[] args)
      {
        return Show(args[0]);
      }
    };
  }
  
  void disposeCOMInterfaces()
  {
    if (supports != null)
    {
      supports.dispose();
      supports = null;
    }
    if (filePicker != null)
    {
      filePicker.dispose();
      filePicker = null;
    }
  }
  
  int getAddress()
  {
    return filePicker.getAddress();
  }
  
  int QueryInterface(int riid, int ppvObject)
  {
    if ((riid == 0) || (ppvObject == 0)) {
      return -2147467262;
    }
    nsID guid = new nsID();
    XPCOM.memmove(guid, riid, 16);
    if (guid.Equals(nsISupports.NS_ISUPPORTS_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { supports.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(nsIFilePicker.NS_IFILEPICKER_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { filePicker.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    if (guid.Equals(nsIFilePicker_1_8.NS_IFILEPICKER_IID))
    {
      XPCOM.memmove(ppvObject, new int[] { filePicker.getAddress() }, C.PTR_SIZEOF);
      AddRef();
      return 0;
    }
    XPCOM.memmove(ppvObject, new int[1], C.PTR_SIZEOF);
    return -2147467262;
  }
  
  int Release()
  {
    refCount -= 1;
    if (refCount == 0) {
      disposeCOMInterfaces();
    }
    return refCount;
  }
  
  Browser getBrowser(int aDOMWindow)
  {
    if (aDOMWindow == 0) {
      return null;
    }
    nsIDOMWindow window = new nsIDOMWindow(aDOMWindow);
    return Mozilla.findBrowser(window);
  }
  
  String parseAString(int string)
  {
    return null;
  }
  
  int Init(int parent, int title, short mode)
  {
    parentHandle = parent;
    this.mode = mode;
    this.title = parseAString(title);
    return 0;
  }
  
  int Show(int _retval)
  {
    if (mode == 2)
    {
      int result = showDirectoryPicker();
      XPCOM.memmove(_retval, new short[] { (short)result }, 2);
      return 0;
    }
    int style = mode == 1 ? 8192 : 4096;
    if (mode == 3) {
      style |= 0x2;
    }
    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 ? 1 : 0;
    XPCOM.memmove(_retval, new short[] { (short)result }, 2);
    return 0;
  }
  
  int showDirectoryPicker()
  {
    Browser browser = getBrowser(parentHandle);
    Shell parent = null;
    if (browser != null) {
      parent = browser.getShell();
    } else {
      parent = new Shell();
    }
    DirectoryDialog dialog = new DirectoryDialog(parent, 0);
    if (title != null) {
      dialog.setText(title);
    }
    if (directory != null) {
      dialog.setFilterPath(directory);
    }
    directory = dialog.open();
    title = (defaultFilename = null);
    files = (masks = null);
    return directory == null ? 1 : 0;
  }
  
  int GetFiles(int aFiles)
  {
    return -2147467263;
  }
  
  int GetFileURL(int aFileURL)
  {
    return -2147467263;
  }
  
  int GetFile(int aFile)
  {
    String filename = "";
    if (directory != null) {
      filename = filename + directory + SEPARATOR;
    }
    if ((files != null) && (files.length > 0)) {
      filename = filename + files[0];
    }
    nsEmbedString path = new nsEmbedString(filename);
    int[] file = new int[1];
    int rc = XPCOM.NS_NewLocalFile(path.getAddress(), 1, file);
    path.dispose();
    if (rc != 0) {
      Mozilla.error(rc);
    }
    if (file[0] == 0) {
      Mozilla.error(-2147467261);
    }
    XPCOM.memmove(aFile, file, C.PTR_SIZEOF);
    return 0;
  }
  
  int SetDisplayDirectory(int aDisplayDirectory)
  {
    if (aDisplayDirectory == 0) {
      return 0;
    }
    nsILocalFile file = new nsILocalFile(aDisplayDirectory);
    int pathname = XPCOM.nsEmbedCString_new();
    file.GetNativePath(pathname);
    int length = XPCOM.nsEmbedCString_Length(pathname);
    int buffer = XPCOM.nsEmbedCString_get(pathname);
    byte[] bytes = new byte[length];
    XPCOM.memmove(bytes, buffer, length);
    XPCOM.nsEmbedCString_delete(pathname);
    char[] chars = MozillaDelegate.mbcsToWcs(null, bytes);
    directory = new String(chars);
    return 0;
  }
  
  int GetDisplayDirectory(int aDispla
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd