1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: David Elliott
8 // Copyright: (c) 2002 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_APP_H_
13 #define _WX_COCOA_APP_H_
15 // ========================================================================
17 // ========================================================================
18 // Represents the application. Derive OnInit and declare
19 // a new App object to start application
20 class WXDLLEXPORT wxApp
: public wxAppBase
22 DECLARE_DYNAMIC_CLASS(wxApp
)
24 // ------------------------------------------------------------------------
26 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
35 inline WX_NSApplication
GetNSApplication() { return m_cocoaApp
; }
36 virtual void CocoaDelegate_applicationWillBecomeActive();
37 virtual void CocoaDelegate_applicationDidBecomeActive();
38 virtual void CocoaDelegate_applicationWillResignActive();
39 virtual void CocoaDelegate_applicationDidResignActive();
41 WX_NSApplication m_cocoaApp
;
42 struct objc_object
*m_cocoaAppDelegate
;
43 WX_NSThread m_cocoaMainThread
;
45 // ------------------------------------------------------------------------
47 // ------------------------------------------------------------------------
49 // Implement wxAppBase pure virtuals
52 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
53 virtual void WakeUpIdle();
55 virtual bool Initialize(int& argc
, wxChar
**argv
);
56 virtual void CleanUp();
57 virtual bool CallOnInit();
60 virtual bool OnInit();
61 virtual bool OnInitGui();
64 virtual void OnAssert(const wxChar
*file
, int line
, const wxChar
*cond
, const wxChar
*msg
);
65 bool IsInAssert() const { return m_isInAssert
; }
74 #endif // _WX_COCOA_APP_H_