| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 1 #ifndef VM_GLUE_H | 5 #ifndef VM_GLUE_H |
| 2 #define VM_GLUE_H | 6 #define VM_GLUE_H |
| 3 | 7 |
| 4 #include <android_native_app_glue.h> | 8 #include <android_native_app_glue.h> |
| 5 #include "bin/dartutils.h" | 9 |
| 6 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
| 7 #include "jni/graphics.h" | 11 #include "jni/graphics.h" |
| 8 | 12 |
| 9 class VMGlue { | 13 class VMGlue { |
| 10 public: | 14 public: |
| 11 explicit VMGlue(Graphics* graphics); | 15 explicit VMGlue(Graphics* graphics); |
| 12 | 16 |
| 13 int InitializeVM(); | 17 int InitializeVM(); |
| 14 int StartMainIsolate(); | 18 int StartMainIsolate(); |
| 15 int CallSetup(); | 19 int CallSetup(); |
| 16 int CallUpdate(); | 20 int CallUpdate(); |
| 17 int OnMotionEvent(const char* function, int64_t when, | 21 int OnMotionEvent(const char* function, int64_t when, |
| 18 float move_x, float move_y); | 22 float move_x, float move_y); |
| 19 int OnKeyEvent(const char* function, int64_t when, int32_t flags, | 23 int OnKeyEvent(const char* function, int64_t when, int32_t flags, |
| 20 int32_t key_code, int32_t meta_state, int32_t repeat); | 24 int32_t key_code, int32_t meta_state, int32_t repeat); |
| 21 void FinishMainIsolate(); | 25 void FinishMainIsolate(); |
| 22 | 26 |
| 23 private: | 27 private: |
| 24 int Invoke(const char *function, int argc, Dart_Handle* args); | 28 int Invoke(const char *function, int argc, Dart_Handle* args); |
| 25 | 29 |
| 26 static int ErrorExit(const char* format, ...); | 30 static int ErrorExit(const char* format, ...); |
| 27 static Dart_Handle SetupRuntimeOptions(CommandLineOptions* options, | 31 static Dart_Handle CheckError(Dart_Handle); |
| 28 const char* executable_name, | 32 |
| 29 const char* script_name); | |
| 30 static bool CreateIsolateAndSetupHelper(const char* script_uri, | 33 static bool CreateIsolateAndSetupHelper(const char* script_uri, |
| 31 const char* main, | 34 const char* main, |
| 32 void* data, | 35 void* data, |
| 33 char** error); | 36 char** error); |
| 34 static bool CreateIsolateAndSetup(const char* script_uri, | 37 static bool CreateIsolateAndSetup(const char* script_uri, |
| 35 const char* main, | 38 const char* main, |
| 36 void* data, char** error); | 39 void* data, char** error); |
| 40 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, |
| 41 Dart_Handle library, |
| 42 Dart_Handle urlHandle); |
| 43 static Dart_Handle LoadSourceFromFile(const char* url); |
| 37 static void ShutdownIsolate(void* callback_data); | 44 static void ShutdownIsolate(void* callback_data); |
| 38 | 45 |
| 39 Graphics* graphics_; | 46 Graphics* graphics_; |
| 40 Dart_Isolate isolate_; | 47 Dart_Isolate isolate_; |
| 41 bool initialized_vm_; | 48 bool initialized_vm_; |
| 42 bool initialized_script_; | 49 bool initialized_script_; |
| 43 }; | 50 }; |
| 44 | 51 |
| 45 #endif | 52 #endif |
| 46 | 53 |
| OLD | NEW |