]> git.saurik.com Git - wxWidgets.git/blame - include/wx/palmos/app.h
in debug mode when clicking with the middle mouse button draw borders around all...
[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
b5dbe15d
VS
18class WXDLLIMPEXP_FWD_CORE wxFrame;
19class WXDLLIMPEXP_FWD_CORE wxWindow;
20class WXDLLIMPEXP_FWD_CORE wxApp;
21class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
22class WXDLLIMPEXP_FWD_BASE wxLog;
ffecfa5a
JS
23
24// Represents the application. Derive OnInit and declare
25// a new App object to start application
53a2db12 26class WXDLLIMPEXP_CORE wxApp : public wxAppBase
ffecfa5a
JS
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
ffecfa5a
JS
45 void OnEndSession(wxCloseEvent& event);
46 void OnQueryEndSession(wxCloseEvent& event);
47
48#if wxUSE_EXCEPTIONS
49 virtual bool OnExceptionInMainLoop();
50#endif // wxUSE_EXCEPTIONS
51
ffecfa5a
JS
52protected:
53 int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
54
55public:
56 // Implementation
57 static bool RegisterWindowClasses();
58 static bool UnregisterWindowClasses();
59
60#if wxUSE_RICHEDIT
61 // initialize the richedit DLL of (at least) given version, return true if
62 // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
63 static bool InitRichEdit(int version = 2);
64#endif // wxUSE_RICHEDIT
65
66 // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
67 // wasn't found at all
68 static int GetComCtl32Version();
69
70 // the SW_XXX value to be used for the frames opened by the application
71 // (currently seems unused which is a bug -- TODO)
72 static int m_nCmdShow;
73
74protected:
75 DECLARE_EVENT_TABLE()
76 DECLARE_NO_COPY_CLASS(wxApp)
77};
78
79// ----------------------------------------------------------------------------
80// Palm OS specific wxEntry() overload and IMPLEMENT_WXWIN_MAIN definition
81// ----------------------------------------------------------------------------
82
83#ifndef SW_SHOWNORMAL
84 #define SW_SHOWNORMAL 1
85#endif
86
53a2db12 87extern WXDLLIMPEXP_CORE int wxEntry();
ffecfa5a 88
ffecfa5a 89#define IMPLEMENT_WXWIN_MAIN \
20bc5ad8
WS
90 \
91 extern "C" { \
92 \
ffecfa5a
JS
93 uint32_t PilotMain(uint16_t cmd, MemPtr cmdPBP, uint16_t launchFlags) \
94 { \
95 switch (cmd) { \
20bc5ad8 96 case 0 /* sysAppLaunchCmdNormalLaunch */ : \
ffecfa5a
JS
97 wxEntry(); \
98 break; \
99 default: \
100 break; \
101 } \
20bc5ad8
WS
102 return 0 /* errNone */ ; \
103 } \
104 \
ffecfa5a 105 }
4055ed82 106
ffecfa5a
JS
107#endif // _WX_APP_H_
108