wxBase/GUI separation: 1st step, wxMSW should build, all the rest is broken
[wxWidgets.git] / include / wx / motif / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: app.h
3 // Purpose: wxApp class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_APP_H_
13 #define _WX_APP_H_
14
15 #ifdef __GNUG__
16 #pragma interface "app.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // headers
21 // ----------------------------------------------------------------------------
22
23 #include "wx/event.h"
24
25 // ----------------------------------------------------------------------------
26 // forward declarations
27 // ----------------------------------------------------------------------------
28
29 class WXDLLEXPORT wxFrame;
30 class WXDLLEXPORT wxWindow;
31 class WXDLLEXPORT wxApp;
32 class WXDLLEXPORT wxKeyEvent;
33 class WXDLLEXPORT wxLog;
34 class WXDLLEXPORT wxEventLoop;
35 class WXDLLEXPORT wxXVisualInfo;
36 class wxPerDisplayDataMap;
37
38 // ----------------------------------------------------------------------------
39 // the wxApp class for Motif - see wxAppBase for more details
40 // ----------------------------------------------------------------------------
41
42 class WXDLLEXPORT wxApp : public wxAppBase
43 {
44 DECLARE_DYNAMIC_CLASS(wxApp)
45
46 public:
47 wxApp();
48 virtual ~wxApp();
49
50 // override base class (pure) virtuals
51 // -----------------------------------
52
53 virtual int MainLoop();
54 virtual void ExitMainLoop();
55 virtual bool Initialized();
56 virtual bool Pending();
57 virtual void Dispatch();
58
59 virtual void Exit();
60
61 virtual bool Yield(bool onlyIfNeeded = FALSE);
62 virtual bool ProcessIdle();
63 virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp
64
65 virtual bool OnInitGui();
66
67 // implementation from now on
68 // --------------------------
69
70 void OnIdle(wxIdleEvent& event);
71
72 // Send idle event to all top-level windows.
73 // Returns TRUE if more idle time is requested.
74 bool SendIdleEvents();
75
76 // Send idle event to window and all subwindows
77 // Returns TRUE if more idle time is requested.
78 bool SendIdleEvents(wxWindow* win);
79
80 protected:
81 bool m_showOnInit;
82
83 public:
84 // Implementation
85 static bool Initialize();
86 static void CleanUp();
87
88 void DeletePendingObjects();
89
90 // Motif-specific
91 WXAppContext GetAppContext() const { return m_appContext; }
92 WXWidget GetTopLevelWidget();
93 WXColormap GetMainColormap(WXDisplay* display);
94 WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
95
96 void SetTopLevelWidget(WXDisplay* display, WXWidget widget);
97
98 // This handler is called when a property change event occurs
99 virtual void HandlePropertyChange(WXEvent *event);
100
101 wxXVisualInfo* GetVisualInfo(WXDisplay* display);
102
103 private:
104 wxEventLoop* m_eventLoop;
105
106 // Motif-specific
107 WXAppContext m_appContext;
108 WXColormap m_mainColormap;
109 WXDisplay* m_initialDisplay;
110 wxPerDisplayDataMap* m_perDisplayData;
111
112 DECLARE_EVENT_TABLE()
113 };
114
115 int WXDLLEXPORT wxEntry( int argc, char *argv[] );
116
117 #endif
118 // _WX_APP_H_
119