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>
6 #include <msp/fs/path.h>
13 class MainThread: public Thread
16 sigc::signal<void, ANativeWindow *> signal_native_window_created;
17 sigc::signal<void, ANativeWindow *> signal_native_window_resized;
18 sigc::signal<void, ANativeWindow *> signal_native_window_destroyed;
19 sigc::signal<void, AInputQueue *> signal_input_queue_created;
20 sigc::signal<void, AInputQueue *> signal_input_queue_destroyed;
23 ANativeActivity *activity;
24 AAssetManager *asset_manager;
25 FS::Path int_data_path;
30 MainThread(ANativeActivity *);
32 void attach_to_activity(ANativeActivity *);
33 bool is_starting_up() const { return starting_up; }
34 void wait_for_app_created();
35 void resume_startup();
37 AAssetManager *get_asset_manager() const { return asset_manager; }
38 const FS::Path &get_internal_data_path() const { return int_data_path; }
40 void set_window_flags(unsigned, unsigned);
45 static void app_created(void *);
46 static void activity_destroyed(ANativeActivity *);
47 static void native_window_created(ANativeActivity *, ANativeWindow *);
48 static void native_window_resized(ANativeActivity *, ANativeWindow *);
49 static void native_window_destroyed(ANativeActivity *, ANativeWindow *);
50 static void input_queue_created(ANativeActivity *, AInputQueue *);
51 static void input_queue_destroyed(ANativeActivity *, AInputQueue *);
52 static void end_process(ANativeActivity *);
55 } // namespace Android