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