# See the License for the specific language governing permissions and
# limitations under the License.
-import ::android::platform
+import ::android
import ::android::vibration
import asteronits
module android
import platform
-import native_app_glue
import dalvik
private import log
-private import assets
-
-redef class App
- redef fun init_window
- do
- super
- on_create
- on_restore_state
- on_start
- end
-
- redef fun term_window
- do
- super
- on_stop
- end
-
- # Is the application currently paused?
- var paused = true
-
- redef fun pause
- do
- paused = true
- on_pause
- super
- end
-
- redef fun resume
- do
- paused = false
- on_resume
- super
- end
-
- redef fun save_state do on_save_state
-
- redef fun lost_focus
- do
- paused = true
- super
- end
-
- redef fun gained_focus
- do
- paused = false
- super
- end
-
- redef fun destroy do on_destroy
-end
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Android services and implementation of app.nit for gamnit and mnit
+module game
+
+import platform
+import native_app_glue
+import dalvik
+private import log
+private import assets
+
+redef class App
+ redef fun init_window
+ do
+ super
+ on_create
+ on_restore_state
+ on_start
+ end
+
+ redef fun term_window
+ do
+ super
+ on_stop
+ end
+
+ # Is the application currently paused?
+ var paused = true
+
+ redef fun pause
+ do
+ paused = true
+ on_pause
+ super
+ end
+
+ redef fun resume
+ do
+ paused = false
+ on_resume
+ super
+ end
+
+ redef fun save_state do on_save_state
+
+ redef fun lost_focus
+ do
+ paused = true
+ super
+ end
+
+ redef fun gained_focus
+ do
+ paused = false
+ super
+ end
+
+ redef fun destroy do on_destroy
+end
module input_events
import mnit::input
-import android
+import android::game
in "C header" `{
#include <android/log.h>
import core::error
# Platform variations
-# TODO: move on the platform once qualified names are understand in the condition
import linux::audio is conditional(linux)
import android::audio is conditional(android)
import serialization
# Platform variations
-# TODO: move on the platform once qualified names are understand in the condition
import linux::data_store is conditional(linux)
import android::data_store is conditional(android)
import ios::data_store is conditional(ios)
import app_base
# Platform variations
-# TODO: move on the platform once qualified names are understand in the condition
import linux::ui is conditional(linux)
-import android::ui is conditional(android) # FIXME it should be conditional to `android::platform`
+import android::ui is conditional(android)
import ios::ui is conditional(ios)
redef class App
android_manifest """<uses-feature android:glEsVersion="0x00020000"/>"""
end
-import ::android
+import ::android::game
intrude import android::load_image
private import gamnit::egl
import mnit
import mnit::opengles1
-import ::android
+import ::android::game
intrude import ::android::input_events
in "C" `{