]>
Commit | Line | Data |
---|---|---|
fb896a32 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cocoa/app.h | |
3 | // Purpose: wxApp class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2002/11/27 | |
cdd0a08f | 7 | // RCS-ID: $Id$ |
fb896a32 | 8 | // Copyright: (c) 2002 David Elliott |
cdd0a08f | 9 | // Licence: wxWindows licence |
fb896a32 DE |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_COCOA_APP_H_ | |
13 | #define _WX_COCOA_APP_H_ | |
14 | ||
cdd0a08f DE |
15 | // ======================================================================== |
16 | // wxApp | |
17 | // ======================================================================== | |
fb896a32 DE |
18 | // Represents the application. Derive OnInit and declare |
19 | // a new App object to start application | |
20 | class WXDLLEXPORT wxApp: public wxAppBase | |
21 | { | |
22 | DECLARE_DYNAMIC_CLASS(wxApp) | |
23 | DECLARE_EVENT_TABLE() | |
24 | // ------------------------------------------------------------------------ | |
25 | // initialization | |
26 | // ------------------------------------------------------------------------ | |
27 | public: | |
28 | wxApp(); | |
29 | virtual ~wxApp() {} | |
30 | ||
31 | // ------------------------------------------------------------------------ | |
32 | // Cocoa specifics | |
33 | // ------------------------------------------------------------------------ | |
34 | public: | |
35 | inline WX_NSApplication GetNSApplication() { return m_cocoaApp; } | |
36 | void CocoaInstallRequestedIdleHandler() { if(m_isIdle) CocoaInstallIdleHandler(); } | |
37 | inline void CocoaRequestIdle() { m_isIdle = true; } | |
38 | protected: | |
39 | WX_NSApplication m_cocoaApp; | |
14fc7eb4 | 40 | WX_NSThread m_cocoaMainThread; |
fb896a32 DE |
41 | void CocoaInstallIdleHandler(); |
42 | bool m_isIdle; | |
43 | ||
44 | // ------------------------------------------------------------------------ | |
45 | // Implementation | |
46 | // ------------------------------------------------------------------------ | |
47 | public: | |
48 | // Implement wxAppBase pure virtuals | |
49 | virtual int MainLoop(); | |
50 | virtual void ExitMainLoop(); | |
51 | virtual bool Initialized(); | |
52 | virtual bool Pending(); | |
53 | virtual void Dispatch(); | |
e2478fde VZ |
54 | |
55 | virtual void Exit(); | |
56 | ||
fb896a32 | 57 | virtual bool Yield(bool onlyIfNeeded = FALSE); |
bf252640 | 58 | virtual void WakeUpIdle() { CocoaRequestIdle(); } |
fb896a32 | 59 | |
05e2b077 | 60 | virtual bool Initialize(int& argc, wxChar **argv); |
94826170 | 61 | virtual void CleanUp(); |
47f1ad6a DE |
62 | virtual bool CallOnInit(); |
63 | ||
fb896a32 DE |
64 | |
65 | virtual bool OnInit(); | |
66 | virtual bool OnInitGui(); | |
b93d8cc4 DE |
67 | |
68 | #ifdef __WXDEBUG__ | |
69 | virtual void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg); | |
70 | bool IsInAssert() const { return m_isInAssert; } | |
71 | #endif // __WXDEBUG__ | |
72 | ||
73 | private: | |
74 | #ifdef __WXDEBUG__ | |
75 | bool m_isInAssert; | |
76 | #endif // __WXDEBUG__ | |
fb896a32 DE |
77 | }; |
78 | ||
79 | #endif // _WX_COCOA_APP_H_ |