1 // TestApp.h 2 3 #ifndef _sk_test_app_h_ 4 #define _sk_test_app_h_ 5 6 #include <Application.h> 7 #include <MessageQueue.h> 8 9 // TestHandler 10 11 class TestHandler : public BHandler { 12 public: 13 virtual void MessageReceived(BMessage *message); 14 BMessageQueue &Queue(); 15 16 private: 17 BMessageQueue fQueue; 18 }; 19 20 21 // TestApp 22 23 class TestApp : public BApplication { 24 public: 25 TestApp(const char *signature); 26 27 status_t Init(); 28 void Terminate(); 29 30 virtual void ReadyToRun(); 31 32 TestHandler &Handler(); 33 34 private: 35 static int32 _AppThreadStart(void *data); 36 37 private: 38 thread_id fAppThread; 39 TestHandler fHandler; 40 }; 41 42 #endif // _sk_test_app_h_ 43