Package org.eclipse.swt.ole.win32

Examples of org.eclipse.swt.ole.win32.OleFrame


    // a new top-level function.
    //
    String newScript = createNativeMethodInjector(jsniSignature, paramNames, js);
    try {
      // TODO: somehow insert file/line info into the script
      Variant result = execute(newScript);
      if (result != null) {
        result.dispose();
      }
    } catch (RuntimeException e) {
      throw new RuntimeException(file + "(" + line
          + "): Failed to create JSNI method with signature '" + jsniSignature
          + "'", e);
View Full Code Here


      for (int i = 0; i < len; ++i) {
        vArgs[i + 1] = SwtOleGlue.convertObjectToVariant(
            getIsolatedClassLoader(), types[i], args[i]);
      }

      Variant result = doInvokeOnWindow(window, name, vArgs);
      try {
        return new JsValueIE6(result);
      } finally {
        if (result != null) {
          result.dispose();
        }
      }
    } finally {
      // We allocated variants for all arguments, so we must dispose them all.
      //
View Full Code Here

    }
  }

  private static Variant maybeCopyVariant(Variant variant) {
    if (variant == null) {
      return new Variant();
    }
    switch (variant.getType()) {
      case COM.VT_DISPATCH: {
        IDispatch dispatch = variant.getDispatch();
        dispatch.AddRef();
        return new Variant(dispatch);
      }
      case COM.VT_UNKNOWN: {
        IUnknown unknown = variant.getUnknown();
        unknown.AddRef();
        return new Variant(unknown);
      }
    }
    return variant;
  }
View Full Code Here

    // see if the variant is a wrapper object
    if (variant.getType() != COM.VT_DISPATCH) {
      return false;
    }
    OleAutomation auto = null;
    Variant result = null;
    try {
      auto = new OleAutomation(variant.getDispatch());
      // see if it has a valueOf method
      int[] ids = auto.getIDsOfNames(new String[] {"valueOf"});
      if (ids == null) {
        return false;
      }
      result = auto.invoke(ids[0]);
      /*
       * If the return type of the valueOf method is string, we assume it is a
       * String wrapper object.
       */
      return result.getType() == COM.VT_BSTR;
    } finally {
      if (auto != null) {
        auto.dispose();
      }
      if (result != null) {
        result.dispose();
      }
    }
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.google.gwt.dev.shell.JsValue#setBoolean(boolean)
   */
  public void setBoolean(boolean val) {
    setVariant(new Variant(val));
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.google.gwt.dev.shell.JsValue#setByte(byte)
   */
  public void setByte(byte val) {
    setVariant(new Variant(val));
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.google.gwt.dev.shell.JsValue#setChar(char)
   */
  public void setChar(char val) {
    setVariant(new Variant(val));
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.google.gwt.dev.shell.JsValue#setDouble(double)
   */
  public void setDouble(double val) {
    setVariant(new Variant(val));
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.google.gwt.dev.shell.JsValue#setInt(int)
   */
  public void setInt(int val) {
    setVariant(new Variant(val));
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see com.google.gwt.dev.shell.JsValue#setNull()
   */
  public void setNull() {
    setVariant(new Variant(0, COM.VT_NULL));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.ole.win32.OleFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.