1 /* dstep -I/path/to/ndk-r9d/platforms/android-9/arch-x86/usr/include -I/path/to/ndk-r9d/toolchains/llvm-3.4/prebuilt/linux-x86/lib/clang/3.4/include /path/to/ndk-r9d/platforms/android-9/arch-x86/usr/include/android/native_activity.h -o native_activity.d*/ 2 3 module android.native_activity; 4 5 import jni; 6 import android.rect; 7 import android.asset_manager, android.input, android.native_window; 8 9 version (Android): 10 extern (C): 11 @system: 12 nothrow: 13 @nogc: 14 15 enum 16 { 17 ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT = 1, 18 ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED = 2 19 } 20 21 enum 22 { 23 ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY = 1, 24 ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS = 2 25 } 26 27 struct ANativeActivity 28 { 29 ANativeActivityCallbacks* callbacks; 30 JavaVM* vm; 31 JNIEnv* env; 32 jobject clazz; 33 const(char)* internalDataPath; 34 const(char)* externalDataPath; 35 int sdkVersion; 36 void* instance; 37 AAssetManager* assetManager; 38 } 39 40 struct ANativeActivityCallbacks 41 { 42 void function(ANativeActivity*) onStart; 43 void function(ANativeActivity*) onResume; 44 void* function(ANativeActivity*, size_t*) onSaveInstanceState; 45 void function(ANativeActivity*) onPause; 46 void function(ANativeActivity*) onStop; 47 void function(ANativeActivity*) onDestroy; 48 void function(ANativeActivity*, int) onWindowFocusChanged; 49 void function(ANativeActivity*, ANativeWindow*) onNativeWindowCreated; 50 void function(ANativeActivity*, ANativeWindow*) onNativeWindowResized; 51 void function(ANativeActivity*, ANativeWindow*) onNativeWindowRedrawNeeded; 52 void function(ANativeActivity*, ANativeWindow*) onNativeWindowDestroyed; 53 void function(ANativeActivity*, AInputQueue*) onInputQueueCreated; 54 void function(ANativeActivity*, AInputQueue*) onInputQueueDestroyed; 55 void function(ANativeActivity*, const(ARect)*) onContentRectChanged; 56 void function(ANativeActivity*) onConfigurationChanged; 57 void function(ANativeActivity*) onLowMemory; 58 } 59 60 void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_t savedStateSize); 61 void ANativeActivity_finish(ANativeActivity* activity); 62 void ANativeActivity_setWindowFormat(ANativeActivity* activity, int format); 63 void ANativeActivity_setWindowFlags(ANativeActivity* activity, uint addFlags, uint removeFlags); 64 void ANativeActivity_showSoftInput(ANativeActivity* activity, uint flags); 65 void ANativeActivity_hideSoftInput(ANativeActivity* activity, uint flags);