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