]> git.saurik.com Git - wxWidgets.git/blame - include/wx/palmos/app.h
*** empty log message ***
[wxWidgets.git] / include / wx / palmos / app.h
CommitLineData
ffecfa5a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: app.h
3// Purpose: wxApp class
4// Author: William Osborne
5// Modified by:
6// Created: 10/17/04
7// RCS-ID: $Id:
8// Copyright: (c) William Osborne
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_APP_H_
13#define _WX_APP_H_
14
15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16#pragma interface "app.h"
17#endif
18
19#include "wx/event.h"
20#include "wx/icon.h"
21
22class WXDLLIMPEXP_CORE wxFrame;
23class WXDLLIMPEXP_CORE wxWindow;
24class WXDLLIMPEXP_CORE wxApp;
25class WXDLLIMPEXP_CORE wxKeyEvent;
26class WXDLLIMPEXP_BASE wxLog;
27
28// Represents the application. Derive OnInit and declare
29// a new App object to start application
30class WXDLLEXPORT wxApp : public wxAppBase
31{
32 DECLARE_DYNAMIC_CLASS(wxApp)
33
34public:
35 wxApp();
36 virtual ~wxApp();
37
38 // override base class (pure) virtuals
39 virtual bool Initialize(int& argc, wxChar **argv);
40 virtual void CleanUp();
41
42 virtual bool Yield(bool onlyIfNeeded = false);
43 virtual void WakeUpIdle();
44
45 virtual void SetPrintMode(int mode) { m_printMode = mode; }
46 virtual int GetPrintMode() const { return m_printMode; }
47
48 // implementation only
49 void OnIdle(wxIdleEvent& event);
50 void OnEndSession(wxCloseEvent& event);
51 void OnQueryEndSession(wxCloseEvent& event);
52
53#if wxUSE_EXCEPTIONS
54 virtual bool OnExceptionInMainLoop();
55#endif // wxUSE_EXCEPTIONS
56
57 // deprecated functions, use wxEventLoop directly instead
58#if WXWIN_COMPATIBILITY_2_4
59 wxDEPRECATED( void DoMessage(WXMSG *pMsg) );
60 wxDEPRECATED( bool DoMessage() );
61 wxDEPRECATED( bool ProcessMessage(WXMSG* pMsg) );
62#endif // WXWIN_COMPATIBILITY_2_4
63
64protected:
65 int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
66
67public:
68 // Implementation
69 static bool RegisterWindowClasses();
70 static bool UnregisterWindowClasses();
71
72#if wxUSE_RICHEDIT
73 // initialize the richedit DLL of (at least) given version, return true if
74 // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
75 static bool InitRichEdit(int version = 2);
76#endif // wxUSE_RICHEDIT
77
78 // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
79 // wasn't found at all
80 static int GetComCtl32Version();
81
82 // the SW_XXX value to be used for the frames opened by the application
83 // (currently seems unused which is a bug -- TODO)
84 static int m_nCmdShow;
85
86protected:
87 DECLARE_EVENT_TABLE()
88 DECLARE_NO_COPY_CLASS(wxApp)
89};
90
91// ----------------------------------------------------------------------------
92// Palm OS specific wxEntry() overload and IMPLEMENT_WXWIN_MAIN definition
93// ----------------------------------------------------------------------------
94
95#ifndef SW_SHOWNORMAL
96 #define SW_SHOWNORMAL 1
97#endif
98
99extern int WXDLLEXPORT
100wxEntry();
101
102#include <PalmOS.h>
103#define IMPLEMENT_WXWIN_MAIN \
104 uint32_t PilotMain(uint16_t cmd, MemPtr cmdPBP, uint16_t launchFlags) \
105 { \
106 switch (cmd) { \
107 case sysAppLaunchCmdNormalLaunch: \
108 wxEntry(); \
109 break; \
110 default: \
111 break; \
112 } \
113 return errNone; \
114 }
115
116#endif // _WX_APP_H_
117