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_
16 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );
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 void CocoaInstallRequestedIdleHandler() { if(m_isIdle
) CocoaInstallIdleHandler(); }
37 inline void CocoaRequestIdle() { m_isIdle
= true; }
39 WX_NSApplication m_cocoaApp
;
40 void CocoaInstallIdleHandler();
43 // ------------------------------------------------------------------------
45 // ------------------------------------------------------------------------
47 // Implement wxAppBase pure virtuals
48 virtual int MainLoop();
49 virtual void ExitMainLoop();
50 virtual bool Initialized();
51 virtual bool Pending();
52 virtual void Dispatch();
53 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
54 virtual bool ProcessIdle();
57 void OnIdle(wxIdleEvent
& event
);
58 // Send idle event to all top-level windows.
59 // Returns TRUE if more idle time is requested.
60 bool SendIdleEvents();
61 // Send idle event to window and all subwindows
62 // Returns TRUE if more idle time is requested.
63 bool SendIdleEvents(wxWindowCocoa
* win
);
65 static bool Initialize();
66 static void CleanUp();
68 virtual bool OnInit();
69 virtual bool OnInitGui();
70 void DeletePendingObjects();
73 #endif // _WX_COCOA_APP_H_