1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
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() { return m_appInitFn
; }
64 /* this may have to be overwritten when special, non-default visuals have
65 to be set. it is also platform dependent as only X knows about displays
67 virtual bool InitVisual();
69 virtual bool OnInit();
70 virtual bool OnInitGui();
74 wxWindow
*GetTopWindow();
75 void SetTopWindow( wxWindow
*win
);
76 virtual int MainLoop();
79 virtual bool Pending();
80 virtual void Dispatch();
82 inline void SetWantDebugOutput(bool flag
) { m_wantDebugOutput
= flag
; }
83 inline bool GetWantDebugOutput() { return m_wantDebugOutput
; }
85 void OnIdle( wxIdleEvent
&event
);
86 bool SendIdleEvents();
87 bool SendIdleEvents( wxWindow
* win
);
89 inline wxString
GetAppName() const
93 else return m_className
;
96 inline void SetAppName(const wxString
& name
) { m_appName
= name
; };
97 inline wxString
GetClassName() const { return m_className
; }
98 inline void SetClassName(const wxString
& name
) { m_className
= name
; }
99 const wxString
& GetVendorName() const { return m_vendorName
; }
100 void SetVendorName(const wxString
& name
) { m_vendorName
= name
; }
102 inline void SetExitOnFrameDelete(bool flag
) { m_exitOnFrameDelete
= flag
; }
103 inline bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete
; }
105 void SetPrintMode(int WXUNUSED(mode
) ) {};
106 int GetPrintMode() const { return wxPRINT_POSTSCRIPT
; };
108 // override this function to create default log target of arbitrary
109 // user-defined classv (default implementation creates a wxLogGui object)
110 virtual wxLog
*CreateLogTarget();
112 // GTK implementation
114 static void CommonInit();
115 static void CommonCleanUp();
118 void DeletePendingObjects();
121 bool m_exitOnFrameDelete
;
122 bool m_wantDebugOutput
;
123 wxWindow
*m_topWindow
;
130 static wxAppInitializerFunction m_appInitFn
;
133 wxString m_vendorName
,
137 DECLARE_EVENT_TABLE()
140 #endif // __GTKAPPH__