1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
18 #include "wx/window.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 extern wxApp
*wxTheApp
;
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 #define wxPRINT_WINDOWS 1
46 #define wxPRINT_POSTSCRIPT 2
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 class wxApp
: public wxEvtHandler
54 DECLARE_DYNAMIC_CLASS(wxApp
)
61 static void SetInitializerFunction(wxAppInitializerFunction fn
) { m_appInitFn
= fn
; }
62 static wxAppInitializerFunction
GetInitializerFunction(void) { return m_appInitFn
; }
63 virtual bool OnInit(void);
64 virtual bool OnInitGui(void);
65 virtual int OnRun(void);
66 virtual bool OnIdle(void);
67 virtual int OnExit(void);
69 wxWindow
*GetTopWindow(void);
70 void SetTopWindow( wxWindow
*win
);
71 virtual int MainLoop(void);
72 void ExitMainLoop(void);
73 bool Initialized(void);
74 virtual bool Pending(void);
75 virtual void Dispatch(void);
76 void DeletePendingObjects(void);
78 inline wxString
GetAppName(void) const {
81 else return m_className
;
83 inline void SetAppName(const wxString
& name
) { m_appName
= name
; };
84 inline wxString
GetClassName(void) const { return m_className
; }
85 inline void SetClassName(const wxString
& name
) { m_className
= name
; }
87 inline void SetExitOnFrameDelete(bool flag
) { m_exitOnFrameDelete
= flag
; }
88 inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete
; }
90 void SetPrintMode(int WXUNUSED(mode
) ) {};
91 int GetPrintMode(void) const { return wxPRINT_POSTSCRIPT
; };
93 static void CommonInit(void);
94 static void CommonCleanUp(void);
96 // override this function to create default log target of arbitrary
97 // user-defined classv (default implementation creates a wxLogGui object)
98 virtual wxLog
*CreateLogTarget();
101 bool m_exitOnFrameDelete
;
103 wxWindow
*m_topWindow
;
105 wxString m_className
;
110 static wxAppInitializerFunction m_appInitFn
;
113 #endif // __GTKAPPH__