wxBase/GUI separation: 1st step, wxMSW should build, all the rest is broken
[wxWidgets.git] / include / wx / gtk / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/app.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef __GTKAPPH__
11 #define __GTKAPPH__
12
13 #if defined(__GNUG__) && !defined(__APPLE__)
14 #pragma interface
15 #endif
16
17 #include "wx/frame.h"
18 #include "wx/icon.h"
19
20 //-----------------------------------------------------------------------------
21 // classes
22 //-----------------------------------------------------------------------------
23
24 class wxApp;
25 class wxLog;
26
27 //-----------------------------------------------------------------------------
28 // wxApp
29 //-----------------------------------------------------------------------------
30
31 class wxApp: public wxAppBase
32 {
33 public:
34 wxApp();
35 virtual ~wxApp();
36
37 /* override for altering the way wxGTK intializes the GUI
38 * (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
39 * default. when overriding this method, the code in it is likely to be
40 * platform dependent, otherwise use OnInit(). */
41 virtual bool OnInitGui();
42
43 // override base class (pure) virtuals
44 virtual int MainLoop();
45 virtual void ExitMainLoop();
46 virtual bool Initialized();
47 virtual bool Pending();
48 virtual void Dispatch();
49
50 virtual void Exit();
51
52 virtual bool Yield(bool onlyIfNeeded = FALSE);
53 virtual bool ProcessIdle();
54 virtual void WakeUpIdle();
55
56 // implementation only from now on
57 void OnIdle( wxIdleEvent &event );
58 bool SendIdleEvents();
59 bool SendIdleEvents( wxWindow* win );
60
61 static bool Initialize();
62 static bool InitialzeVisual();
63 static void CleanUp();
64
65 void DeletePendingObjects();
66
67 #ifdef __WXDEBUG__
68 virtual void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg);
69
70 bool IsInAssert() const { return m_isInAssert; }
71 #endif // __WXDEBUG__
72
73 bool m_initialized;
74
75 gint m_idleTag;
76 #if wxUSE_THREADS
77 gint m_wakeUpTimerTag;
78 #endif
79 unsigned char *m_colorCube;
80
81 // Used by the the wxGLApp and wxGLCanvas class for GL-based X visual
82 // selection; this is actually an XVisualInfo*
83 void *m_glVisualInfo;
84 // This returns the current visual: either that used by wxRootWindow
85 // or the XVisualInfo* for SGI.
86 GdkVisual *GetGdkVisual();
87
88 private:
89 // true if we're inside an assert modal dialog
90 #ifdef __WXDEBUG__
91 bool m_isInAssert;
92 #endif // __WXDEBUG__
93
94 bool CallInternalIdle( wxWindow* win );
95
96 DECLARE_DYNAMIC_CLASS(wxApp)
97 DECLARE_EVENT_TABLE()
98 };
99
100 int WXDLLEXPORT wxEntry( int argc, char *argv[] );
101
102 #endif // __GTKAPPH__