1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/app.h
3 // Purpose: wxApp class
4 // Author: David Elliott
7 // Copyright: (c) 2002 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_COCOA_APP_H_
12 #define _WX_COCOA_APP_H_
14 typedef struct __CFRunLoopObserver
* CFRunLoopObserverRef
;
15 typedef const struct __CFString
* CFStringRef
;
17 #include "wx/osx/core/cfref.h"
19 // ========================================================================
21 // ========================================================================
22 // Represents the application. Derive OnInit and declare
23 // a new App object to start application
24 class WXDLLIMPEXP_CORE wxApp
: public wxAppBase
26 DECLARE_DYNAMIC_CLASS(wxApp
)
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
38 inline WX_NSApplication
GetNSApplication() { return m_cocoaApp
; }
39 virtual void CocoaDelegate_applicationWillBecomeActive();
40 virtual void CocoaDelegate_applicationDidBecomeActive();
41 virtual void CocoaDelegate_applicationWillResignActive();
42 virtual void CocoaDelegate_applicationDidResignActive();
43 virtual void CocoaDelegate_applicationWillUpdate();
44 virtual void CF_ObserveMainRunLoopBeforeWaiting(CFRunLoopObserverRef observer
, int activity
);
46 WX_NSApplication m_cocoaApp
;
47 struct objc_object
*m_cocoaAppDelegate
;
48 WX_NSThread m_cocoaMainThread
;
49 wxCFRef
<CFRunLoopObserverRef
> m_cfRunLoopIdleObserver
;
50 wxCFRef
<CFStringRef
> m_cfObservedRunLoopMode
;
52 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
56 // Implement wxAppBase pure virtuals
59 virtual void WakeUpIdle();
61 virtual bool Initialize(int& argc
, wxChar
**argv
);
62 virtual void CleanUp();
63 virtual bool CallOnInit();
66 virtual bool OnInit();
67 virtual bool OnInitGui();
69 // Set true _before_ initializing wx to force embedded mode (no app delegate, etc.)
70 static bool sm_isEmbedded
;
73 #endif // _WX_COCOA_APP_H_