예제 #1
0
/* LIbrary Initialise function */
DART_EXPORT Dart_Handle amqp_extension_Init(Dart_Handle parent_library) {
  
  if (Dart_IsError(parent_library)) { return parent_library; }

  Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName);
  if (Dart_IsError(result_code)) return result_code;

  return Dart_Null();
  
}
예제 #2
0
void platformServicePort(Dart_NativeArguments arguments) {
    Dart_EnterScope();
    Dart_SetReturnValue(arguments, Dart_Null());
    Dart_Port service_port =
            Dart_NewNativePort("PlatformService", wrappedPlatformService, true);
    if (service_port != ILLEGAL_PORT) {
        Dart_Handle send_port = HandleError(Dart_NewSendPort(service_port));
        Dart_SetReturnValue(arguments, send_port);
    }
    Dart_ExitScope();
}
예제 #3
0
파일: TextBox.cpp 프로젝트: algor/engine
Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
  if (val.is_null)
    return Dart_Null();
  DartClassLibrary& class_library = DartState::Current()->class_library();
  Dart_Handle type = Dart_HandleFromPersistent(
      class_library.GetClass("ui", "TextBox"));
  DCHECK(!LogIfError(type));
  const int argc = 5;
  Dart_Handle argv[argc] = {
    blink::ToDart(val.sk_rect.fLeft),
    blink::ToDart(val.sk_rect.fTop),
    blink::ToDart(val.sk_rect.fRight),
    blink::ToDart(val.sk_rect.fBottom),
    blink::ToDart(static_cast<int>(val.direction)),
  };
  return Dart_New(type, blink::ToDart("_"), argc, argv);
}
예제 #4
0
    Dart_Handle Isolate::New(const char* typeName, int argc, Dart_Handle* args)
    {
        // entering and leaving the scope here causes us to invalidate the instance handle!
//        Dart_EnterScope();
        
        // Get type
        Dart_Handle type = Dart_GetType(library_, NewString(typeName), 0, NULL);
        if(Dart_IsError(type)) {
            LOG_E(Dart_GetError(type));
        }
        
        // Invoke the unnamed constructor.
        Dart_Handle instance = Dart_New(type, Dart_Null(), argc, args);
        
        if (Dart_IsError(instance)) {
            //            Dart_NewApiError
            LOG_E(Dart_GetError(instance) << " while instantiating '"<< type <<"'")
        }

//        Dart_ExitScope();
        return instance;
    }