11// This file is part of SmallBASIC
22//
3- // Copyright(C) 2001-2016 Chris Warren-Smith.
3+ // Copyright(C) 2001-2022 Chris Warren-Smith.
44//
55// This program is distributed under the terms of the GPL v2.0 or later
66// Download the GNU Public License (GPL) from www.gnu.org
@@ -132,6 +132,7 @@ int get_sensor_events(int fd, int events, void *data) {
132132 return 1 ;
133133}
134134
135+ // callbacks from MainActivity.java
135136extern " C" JNIEXPORT void JNICALL Java_net_sourceforge_smallbasic_MainActivity_onActivityPaused
136137 (JNIEnv *env, jclass jclazz, jboolean paused) {
137138 if (runtime != nullptr && !runtime->isClosing () && runtime->isActive () && os_graphics) {
@@ -140,7 +141,6 @@ extern "C" JNIEXPORT void JNICALL Java_net_sourceforge_smallbasic_MainActivity_o
140141 }
141142}
142143
143- // callback from MainActivity.java
144144extern " C" JNIEXPORT jboolean JNICALL Java_net_sourceforge_smallbasic_MainActivity_optionSelected
145145 (JNIEnv *env, jclass jclazz, jint index) {
146146 auto *maEvent = new MAEvent ();
@@ -180,6 +180,15 @@ extern "C" JNIEXPORT void JNICALL Java_net_sourceforge_smallbasic_MainActivity_o
180180 }
181181}
182182
183+ extern " C" JNIEXPORT jboolean JNICALL Java_net_sourceforge_smallbasic_MainActivity_libraryMode
184+ (JNIEnv *env, jclass jclazz) {
185+ #if defined(_ANDROID_LIBRARY)
186+ return true ;
187+ #else
188+ return false ;
189+ #endif
190+ }
191+
183192void onContentRectChanged (ANativeActivity *activity, const ARect *rect) {
184193 logEntered ();
185194 runtime->onResize (rect->right , rect->bottom );
0 commit comments