OLD | NEW |
(Empty) | |
| 1 #ifndef VM_GLUE_H |
| 2 #define VM_GLUE_H |
| 3 |
| 4 #include <android_native_app_glue.h> |
| 5 #include "include/dart_api.h" |
| 6 #include "bin/dartutils.h" |
| 7 //#include "timer.h" |
| 8 #include "graphics.h" |
| 9 //#include "context.h" |
| 10 |
| 11 class VMGlue { |
| 12 public: |
| 13 VMGlue(Graphics* pGraphics); |
| 14 |
| 15 int initializeVM(); |
| 16 int startMainIsolate(); |
| 17 int callSetup(); |
| 18 int callUpdate(); |
| 19 int onMotionEvent(const char* function, int64_t when, |
| 20 float lMoveX, float lMoveY); |
| 21 int onKeyEvent(const char* pFunction, int64_t pWhen, int32_t pFlags, |
| 22 int32_t pKeyCode, int32_t pMetaState, int32_t pRepeat); |
| 23 void finishMainIsolate(); |
| 24 |
| 25 private: |
| 26 int invoke(const char *function, int argc, Dart_Handle* args); |
| 27 |
| 28 static int ErrorExit(const char* format, ...); |
| 29 static Dart_Handle SetupRuntimeOptions(CommandLineOptions* options, |
| 30 const char* executable_name, |
| 31 const char* script_name); |
| 32 static bool CreateIsolateAndSetupHelper(const char* script_uri, |
| 33 const char* main, |
| 34 void* data, |
| 35 char** error); |
| 36 static bool CreateIsolateAndSetup(const char* script_uri, |
| 37 const char* main, |
| 38 void* data, char** error); |
| 39 static void ShutdownIsolate(void* callback_data); |
| 40 |
| 41 Graphics *mGraphics; |
| 42 Dart_Isolate mIsolate; |
| 43 bool mInitializedVM; |
| 44 bool mInitializedScript; |
| 45 }; |
| 46 |
| 47 #endif |
OLD | NEW |