Lugdunum  0.1.0
MainAndroid.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <android/configuration.h>
4 #include <android/native_activity.h>
5 
6 extern int main(int argc, const char* argv[]);
7 
8 namespace lug {
9 namespace Main {
10 
11 class AndroidApp {
12 public:
13  AndroidApp(ANativeActivity* activity, void* savedState, size_t savedStateSize);
14 
15  // Callback functions as defined in android/native_activity.h, must be public
16  static void onStart(ANativeActivity* activity);
17  static void onResume(ANativeActivity* activity);
18  static void* onSaveInstanceState(ANativeActivity* activity, size_t* outSize);
19  static void onPause(ANativeActivity* activity);
20  static void onStop(ANativeActivity* activity);
21  static void onDestroy(ANativeActivity* activity);
22  static void onWindowFocusChanged(ANativeActivity* activity, int hasFocus);
23  static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window);
24  static void onNativeWindowResized(ANativeActivity* activity, ANativeWindow* window);
25  static void onNativeWindowRedrawNeeded(ANativeActivity* activity, ANativeWindow* window);
26  static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window);
27  static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue);
28  static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue);
29  static void onContentRectChanged(ANativeActivity* activity, const ARect* rect);
30  static void onConfigurationChanged(ANativeActivity* activity);
31  static void onLowMemory(ANativeActivity* activity);
32 
33 private:
34  void shutdowApplication();
35  void startApplication();
36 
37  void* _savedState;
39 };
40 
41 } // Main
42 } // lug
static void * onSaveInstanceState(ANativeActivity *activity, size_t *outSize)
Definition: MainAndroid.cpp:59
int main(int argc, const char *argv[])
static void onNativeWindowCreated(ANativeActivity *activity, ANativeWindow *window)
Definition: MainAndroid.cpp:76
static void onInputQueueDestroyed(ANativeActivity *activity, AInputQueue *queue)
Definition: MainAndroid.cpp:96
static void onStart(ANativeActivity *activity)
Definition: MainAndroid.cpp:55
static void onNativeWindowDestroyed(ANativeActivity *activity, ANativeWindow *window)
Definition: MainAndroid.cpp:86
static void onDestroy(ANativeActivity *activity)
Definition: MainAndroid.cpp:67
static void onInputQueueCreated(ANativeActivity *activity, AInputQueue *queue)
Definition: MainAndroid.cpp:91
static void onConfigurationChanged(ANativeActivity *activity)
static void onNativeWindowRedrawNeeded(ANativeActivity *activity, ANativeWindow *window)
Definition: MainAndroid.cpp:84
static void onWindowFocusChanged(ANativeActivity *activity, int hasFocus)
Definition: MainAndroid.cpp:74
static void onNativeWindowResized(ANativeActivity *activity, ANativeWindow *window)
Definition: MainAndroid.cpp:82
static void onPause(ANativeActivity *activity)
Definition: MainAndroid.cpp:63
static void onResume(ANativeActivity *activity)
Definition: MainAndroid.cpp:57
static void onLowMemory(ANativeActivity *activity)
static void onContentRectChanged(ANativeActivity *activity, const ARect *rect)
AndroidApp(ANativeActivity *activity, void *savedState, size_t savedStateSize)
Definition: MainAndroid.cpp:9
static void onStop(ANativeActivity *activity)
Definition: MainAndroid.cpp:65