1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: David Elliott
8 // Copyright: (c) 2002 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_APP_H_
13 #define _WX_COCOA_APP_H_
15 // Represents the application. Derive OnInit and declare
16 // a new App object to start application
17 class WXDLLEXPORT wxApp
: public wxAppBase
19 DECLARE_DYNAMIC_CLASS(wxApp
)
21 // ------------------------------------------------------------------------
23 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
32 inline WX_NSApplication
GetNSApplication() { return m_cocoaApp
; }
33 void CocoaInstallRequestedIdleHandler() { if(m_isIdle
) CocoaInstallIdleHandler(); }
34 inline void CocoaRequestIdle() { m_isIdle
= true; }
36 WX_NSApplication m_cocoaApp
;
37 WX_NSThread m_cocoaMainThread
;
38 void CocoaInstallIdleHandler();
41 // ------------------------------------------------------------------------
43 // ------------------------------------------------------------------------
45 // Implement wxAppBase pure virtuals
46 virtual int MainLoop();
47 virtual void ExitMainLoop();
48 virtual bool Initialized();
49 virtual bool Pending();
50 virtual void Dispatch();
54 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
55 virtual void WakeUpIdle() { CocoaRequestIdle(); }
57 virtual bool Initialize(int& argc
, wxChar
**argv
);
58 virtual void CleanUp();
59 virtual bool CallOnInit();
62 virtual bool OnInit();
63 virtual bool OnInitGui();
66 virtual void OnAssert(const wxChar
*file
, int line
, const wxChar
*cond
, const wxChar
*msg
);
67 bool IsInAssert() const { return m_isInAssert
; }
76 #endif // _WX_COCOA_APP_H_