]>
Commit | Line | Data |
---|---|---|
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 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
16 | #pragma interface "app.h" | |
17 | #endif | |
18 | ||
19 | // ---------------------------------------------------------------------------- | |
20 | // headers | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
23 | #include "wx/gdicmn.h" | |
24 | #include "wx/event.h" | |
25 | ||
26 | // ---------------------------------------------------------------------------- | |
27 | // forward declarations | |
28 | // ---------------------------------------------------------------------------- | |
29 | ||
30 | class WXDLLEXPORT wxFrame; | |
31 | class WXDLLEXPORT wxWindow; | |
32 | class WXDLLEXPORT wxApp; | |
33 | class WXDLLEXPORT wxKeyEvent; | |
34 | class WXDLLEXPORT wxLog; | |
35 | class WXDLLEXPORT wxXVisualInfo; | |
36 | ||
37 | // ---------------------------------------------------------------------------- | |
38 | // the wxApp class for wxX11 - see wxAppBase for more details | |
39 | // ---------------------------------------------------------------------------- | |
40 | ||
41 | class WXDLLEXPORT wxApp : public wxAppBase | |
42 | { | |
43 | DECLARE_DYNAMIC_CLASS(wxApp) | |
44 | ||
45 | public: | |
46 | wxApp(); | |
47 | ~wxApp(); | |
48 | ||
49 | // override base class (pure) virtuals | |
50 | // ----------------------------------- | |
51 | ||
52 | virtual bool Initialized(); | |
53 | ||
54 | virtual void Exit(); | |
55 | ||
56 | virtual bool Yield(bool onlyIfNeeded = FALSE); | |
57 | virtual void WakeUpIdle(); | |
58 | ||
59 | virtual bool OnInitGui(); | |
60 | ||
61 | // implementation from now on | |
62 | // -------------------------- | |
63 | ||
64 | // Processes an X event. | |
65 | virtual bool ProcessXEvent(WXEvent* event); | |
66 | ||
67 | #ifdef __WXDEBUG__ | |
68 | virtual void OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg); | |
69 | #endif // __WXDEBUG__ | |
70 | ||
71 | protected: | |
72 | bool m_showOnInit; | |
73 | ||
74 | public: | |
75 | // Implementation | |
76 | virtual bool Initialize(int& argc, wxChar **argv); | |
77 | virtual void CleanUp(); | |
78 | ||
79 | WXWindow GetTopLevelWidget() const { return m_topLevelWidget; } | |
80 | WXColormap GetMainColormap(WXDisplay* display); | |
81 | long GetMaxRequestSize() const { return m_maxRequestSize; } | |
82 | ||
83 | // This handler is called when a property change event occurs | |
84 | virtual bool HandlePropertyChange(WXEvent *event); | |
85 | ||
86 | // Values that can be passed on the command line. | |
87 | // Returns -1, -1 if none specified. | |
88 | const wxSize& GetInitialSize() const { return m_initialSize; } | |
89 | bool GetShowIconic() const { return m_showIconic; } | |
90 | ||
91 | #if wxUSE_UNICODE | |
92 | // Global context for Pango layout. Either use X11 | |
93 | // or use Xft rendering according to GDK_USE_XFT | |
94 | // environment variable | |
95 | PangoContext* GetPangoContext(); | |
96 | #endif | |
97 | ||
98 | wxXVisualInfo* GetVisualInfo(WXDisplay* display) | |
99 | { | |
100 | // this should be implemented correctly for wxBitmap to work | |
101 | // with multiple display | |
102 | return m_visualInfo; | |
103 | } | |
104 | ||
105 | // We need this before creating the app | |
106 | static WXDisplay* GetDisplay() { return ms_display; } | |
107 | static WXDisplay* ms_display; | |
108 | ||
109 | public: | |
110 | static long sm_lastMessageTime; | |
111 | bool m_showIconic; | |
112 | wxSize m_initialSize; | |
113 | ||
114 | #if !wxUSE_NANOX | |
115 | wxXVisualInfo* m_visualInfo; | |
116 | #endif | |
117 | ||
118 | protected: | |
119 | bool m_keepGoing; | |
120 | ||
121 | WXWindow m_topLevelWidget; | |
122 | WXColormap m_mainColormap; | |
123 | long m_maxRequestSize; | |
124 | ||
125 | DECLARE_EVENT_TABLE() | |
126 | }; | |
127 | ||
128 | #endif // _WX_APP_H_ | |
129 |