1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
18 class WXDLLIMPEXP_FWD_CORE wxFrame
;
19 class WXDLLIMPEXP_FWD_CORE wxWindow
;
20 class WXDLLIMPEXP_FWD_CORE wxApp
;
21 class WXDLLIMPEXP_FWD_CORE wxKeyEvent
;
22 class WXDLLIMPEXP_FWD_BASE wxLog
;
24 // Represents the application. Derive OnInit and declare
25 // a new App object to start application
26 class WXDLLIMPEXP_CORE wxApp
: public wxAppBase
32 // override base class (pure) virtuals
33 virtual bool Initialize(int& argc
, wxChar
**argv
);
34 virtual void CleanUp();
36 virtual void WakeUpIdle();
38 virtual void SetPrintMode(int mode
) { m_printMode
= mode
; }
39 virtual int GetPrintMode() const { return m_printMode
; }
41 // implementation only
42 void OnIdle(wxIdleEvent
& event
);
43 void OnEndSession(wxCloseEvent
& event
);
44 void OnQueryEndSession(wxCloseEvent
& event
);
47 virtual bool OnExceptionInMainLoop();
48 #endif // wxUSE_EXCEPTIONS
50 // MSW-specific from now on
51 // ------------------------
53 // this suffix should be appended to all our Win32 class names to obtain a
54 // variant registered without CS_[HV]REDRAW styles
55 static const wxChar
*GetNoRedrawClassSuffix() { return wxT("NR"); }
57 // get the name of the registered Win32 class with the given (unique) base
58 // name: this function constructs the unique class name using this name as
59 // prefix, checks if the class is already registered and registers it if it
60 // isn't and returns the name it was registered under (or NULL if it failed)
62 // the registered class will always have CS_[HV]REDRAW and CS_DBLCLKS
63 // styles as well as any additional styles specified as arguments here; and
64 // there will be also a companion registered class identical to this one
65 // but without CS_[HV]REDRAW whose name will be the same one but with
66 // GetNoRedrawClassSuffix()
68 // the background brush argument must be either a COLOR_XXX standard value
69 // or (default) -1 meaning that the class paints its background itself
70 static const wxChar
*GetRegisteredClassName(const wxChar
*name
,
74 // return true if this name corresponds to one of the classes we registered
75 // in the previous GetRegisteredClassName() calls
76 static bool IsRegisteredClassName(const wxString
& name
);
79 int m_printMode
; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
82 // unregister any window classes registered by GetRegisteredClassName()
83 static void UnregisterWindowClasses();
86 // initialize the richedit DLL of (at least) given version, return true if
87 // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3)
88 static bool InitRichEdit(int version
= 2);
89 #endif // wxUSE_RICHEDIT
91 // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it
92 // wasn't found at all
93 static int GetComCtl32Version();
95 // the same for shell32.dll: returns 400, 471, 500, 600, ... (4.70 not
96 // currently detected)
97 static int GetShell32Version();
99 // the SW_XXX value to be used for the frames opened by the application
100 // (currently seems unused which is a bug -- TODO)
101 static int m_nCmdShow
;
104 DECLARE_EVENT_TABLE()
105 wxDECLARE_NO_COPY_CLASS(wxApp
);
106 DECLARE_DYNAMIC_CLASS(wxApp
)
111 // under CE provide a dummy implementation of GetComCtl32Version() returning
112 // the value passing all ">= 470" tests (which are the only ones used in our
113 // code currently) as commctrl.dll under CE 2.0 and later support comctl32.dll
115 inline int wxApp::GetComCtl32Version()
120 // this is not currently used at all under CE so it's not really clear what do
121 // we need to return from here
122 inline int wxApp::GetShell32Version()
127 #endif // __WXWINCE__