1 #ifndef MSP_CORE_ANDROID_MAINTHREAD_H_
2 #define MSP_CORE_ANDROID_MAINTHREAD_H_
4 #include <android/native_activity.h>
5 #include <sigc++/signal.h>
12 class MainThread: public Thread
15 sigc::signal<void, ANativeWindow *> signal_native_window_created;
16 sigc::signal<void, ANativeWindow *> signal_native_window_resized;
17 sigc::signal<void, ANativeWindow *> signal_native_window_destroyed;
18 sigc::signal<void, AInputQueue *> signal_input_queue_created;
19 sigc::signal<void, AInputQueue *> signal_input_queue_destroyed;
22 ANativeActivity *activity;
23 AAssetManager *asset_manager;
28 MainThread(ANativeActivity *);
30 void attach_to_activity(ANativeActivity *);
31 bool is_starting_up() const { return starting_up; }
32 void wait_for_app_created();
33 void resume_startup();
35 AAssetManager *get_asset_manager() const { return asset_manager; }
40 static void app_created(void *);
41 static void activity_destroyed(ANativeActivity *);
42 static void native_window_created(ANativeActivity *, ANativeWindow *);
43 static void native_window_resized(ANativeActivity *, ANativeWindow *);
44 static void native_window_destroyed(ANativeActivity *, ANativeWindow *);
45 static void input_queue_created(ANativeActivity *, AInputQueue *);
46 static void input_queue_destroyed(ANativeActivity *, AInputQueue *);
49 } // namespace Android