]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/app.h
Added wxFrameBase::OnMenuOpen, and wxUSE_IDLEMENUUPDATES in platform.h
[wxWidgets.git] / include / wx / cocoa / app.h
CommitLineData
fb896a32
DE
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 license
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COCOA_APP_H_
13#define _WX_COCOA_APP_H_
14
fb896a32
DE
15// Represents the application. Derive OnInit and declare
16// a new App object to start application
17class WXDLLEXPORT wxApp: public wxAppBase
18{
19 DECLARE_DYNAMIC_CLASS(wxApp)
20 DECLARE_EVENT_TABLE()
21// ------------------------------------------------------------------------
22// initialization
23// ------------------------------------------------------------------------
24public:
25 wxApp();
26 virtual ~wxApp() {}
27
28// ------------------------------------------------------------------------
29// Cocoa specifics
30// ------------------------------------------------------------------------
31public:
32 inline WX_NSApplication GetNSApplication() { return m_cocoaApp; }
33 void CocoaInstallRequestedIdleHandler() { if(m_isIdle) CocoaInstallIdleHandler(); }
34 inline void CocoaRequestIdle() { m_isIdle = true; }
35protected:
36 WX_NSApplication m_cocoaApp;
37 void CocoaInstallIdleHandler();
38 bool m_isIdle;
39
40// ------------------------------------------------------------------------
41// Implementation
42// ------------------------------------------------------------------------
43public:
44 // Implement wxAppBase pure virtuals
45 virtual int MainLoop();
46 virtual void ExitMainLoop();
47 virtual bool Initialized();
48 virtual bool Pending();
49 virtual void Dispatch();
e2478fde
VZ
50
51 virtual void Exit();
52
fb896a32
DE
53 virtual bool Yield(bool onlyIfNeeded = FALSE);
54 virtual bool ProcessIdle();
bf252640 55 virtual void WakeUpIdle() { CocoaRequestIdle(); }
fb896a32
DE
56
57 /* Idle Processing */
58 void OnIdle(wxIdleEvent& event);
59 // Send idle event to all top-level windows.
60 // Returns TRUE if more idle time is requested.
61 bool SendIdleEvents();
62 // Send idle event to window and all subwindows
63 // Returns TRUE if more idle time is requested.
64 bool SendIdleEvents(wxWindowCocoa* win);
65
05e2b077 66 virtual bool Initialize(int& argc, wxChar **argv);
94826170 67 virtual void CleanUp();
47f1ad6a
DE
68 virtual bool CallOnInit();
69
fb896a32
DE
70
71 virtual bool OnInit();
72 virtual bool OnInitGui();
fb896a32
DE
73};
74
75#endif // _WX_COCOA_APP_H_