]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/app.h
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / include / wx / cocoa / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/app.h
3 // Purpose: wxApp class
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2002/11/27
7 // Copyright: (c) 2002 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_COCOA_APP_H_
12 #define _WX_COCOA_APP_H_
13
14 typedef struct __CFRunLoopObserver * CFRunLoopObserverRef;
15 typedef const struct __CFString * CFStringRef;
16
17 #include "wx/osx/core/cfref.h"
18
19 // ========================================================================
20 // wxApp
21 // ========================================================================
22 // Represents the application. Derive OnInit and declare
23 // a new App object to start application
24 class WXDLLIMPEXP_CORE wxApp: public wxAppBase
25 {
26 DECLARE_DYNAMIC_CLASS(wxApp)
27 // ------------------------------------------------------------------------
28 // initialization
29 // ------------------------------------------------------------------------
30 public:
31 wxApp();
32 virtual ~wxApp();
33
34 // ------------------------------------------------------------------------
35 // Cocoa specifics
36 // ------------------------------------------------------------------------
37 public:
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);
45 protected:
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;
51
52 // ------------------------------------------------------------------------
53 // Implementation
54 // ------------------------------------------------------------------------
55 public:
56 // Implement wxAppBase pure virtuals
57 virtual void Exit();
58
59 virtual void WakeUpIdle();
60
61 virtual bool Initialize(int& argc, wxChar **argv);
62 virtual void CleanUp();
63 virtual bool CallOnInit();
64
65
66 virtual bool OnInit();
67 virtual bool OnInitGui();
68
69 // Set true _before_ initializing wx to force embedded mode (no app delegate, etc.)
70 static bool sm_isEmbedded;
71 };
72
73 #endif // _WX_COCOA_APP_H_