]>
Commit | Line | Data |
---|---|---|
83df96d6 JS |
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 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
83df96d6 JS |
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; | |
9ce8d6a2 | 35 | class WXDLLEXPORT wxXVisualInfo; |
83df96d6 JS |
36 | |
37 | // ---------------------------------------------------------------------------- | |
256d631a | 38 | // the wxApp class for wxX11 - see wxAppBase for more details |
83df96d6 JS |
39 | // ---------------------------------------------------------------------------- |
40 | ||
41 | class WXDLLEXPORT wxApp : public wxAppBase | |
42 | { | |
43 | DECLARE_DYNAMIC_CLASS(wxApp) | |
1bf77ee5 | 44 | |
83df96d6 JS |
45 | public: |
46 | wxApp(); | |
dc4025af | 47 | ~wxApp(); |
1bf77ee5 | 48 | |
83df96d6 JS |
49 | // override base class (pure) virtuals |
50 | // ----------------------------------- | |
1bf77ee5 | 51 | |
83df96d6 JS |
52 | virtual int MainLoop(); |
53 | virtual void ExitMainLoop(); | |
54 | virtual bool Initialized(); | |
55 | virtual bool Pending(); | |
e6b9830a | 56 | virtual bool Dispatch(); |
e2478fde VZ |
57 | |
58 | virtual void Exit(); | |
59 | ||
83df96d6 | 60 | virtual bool Yield(bool onlyIfNeeded = FALSE); |
e2478fde | 61 | virtual void WakeUpIdle(); |
1bf77ee5 | 62 | |
83df96d6 | 63 | virtual bool OnInitGui(); |
1bf77ee5 | 64 | |
83df96d6 JS |
65 | // implementation from now on |
66 | // -------------------------- | |
1bf77ee5 | 67 | |
83df96d6 | 68 | // Processes an X event. |
086fd560 | 69 | virtual bool ProcessXEvent(WXEvent* event); |
1bf77ee5 | 70 | |
d715d419 | 71 | #ifdef __WXDEBUG__ |
5968a0dc | 72 | virtual void OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg); |
d715d419 | 73 | #endif // __WXDEBUG__ |
1bf77ee5 | 74 | |
83df96d6 JS |
75 | protected: |
76 | bool m_showOnInit; | |
1bf77ee5 | 77 | |
83df96d6 JS |
78 | public: |
79 | // Implementation | |
05e2b077 | 80 | virtual bool Initialize(int& argc, wxChar **argv); |
94826170 | 81 | virtual void CleanUp(); |
1bf77ee5 | 82 | |
7eaac9f5 | 83 | WXWindow GetTopLevelWidget() const { return m_topLevelWidget; } |
83df96d6 | 84 | WXColormap GetMainColormap(WXDisplay* display); |
83df96d6 | 85 | long GetMaxRequestSize() const { return m_maxRequestSize; } |
1bf77ee5 | 86 | |
83df96d6 | 87 | // This handler is called when a property change event occurs |
086fd560 | 88 | virtual bool HandlePropertyChange(WXEvent *event); |
1bf77ee5 | 89 | |
256d631a JS |
90 | // Values that can be passed on the command line. |
91 | // Returns -1, -1 if none specified. | |
92 | const wxSize& GetInitialSize() const { return m_initialSize; } | |
93 | bool GetShowIconic() const { return m_showIconic; } | |
1bf77ee5 | 94 | |
2b5f62a0 VZ |
95 | #if wxUSE_UNICODE |
96 | // Global context for Pango layout. Either use X11 | |
97 | // or use Xft rendering according to GDK_USE_XFT | |
98 | // environment variable | |
99 | PangoContext* GetPangoContext(); | |
1bf77ee5 | 100 | #endif |
9ce8d6a2 MB |
101 | |
102 | wxXVisualInfo* GetVisualInfo(WXDisplay* display) | |
103 | { | |
104 | // this should be implemented correctly for wxBitmap to work | |
105 | // with multiple display | |
106 | return m_visualInfo; | |
107 | } | |
108 | ||
dc4025af RR |
109 | // We need this before creating the app |
110 | static WXDisplay* GetDisplay() { return ms_display; } | |
111 | static WXDisplay* ms_display; | |
112 | ||
83df96d6 | 113 | public: |
256d631a | 114 | static long sm_lastMessageTime; |
1bf77ee5 | 115 | bool m_showIconic; |
256d631a | 116 | wxSize m_initialSize; |
8601b2e1 | 117 | |
9ce8d6a2 MB |
118 | #if !wxUSE_NANOX |
119 | wxXVisualInfo* m_visualInfo; | |
8601b2e1 | 120 | #endif |
1bf77ee5 | 121 | |
83df96d6 JS |
122 | protected: |
123 | bool m_keepGoing; | |
1bf77ee5 | 124 | |
7eaac9f5 | 125 | WXWindow m_topLevelWidget; |
83df96d6 | 126 | WXColormap m_mainColormap; |
83df96d6 | 127 | long m_maxRequestSize; |
1bf77ee5 | 128 | |
83df96d6 JS |
129 | DECLARE_EVENT_TABLE() |
130 | }; | |
131 | ||
6abf9dac | 132 | #endif // _WX_APP_H_ |
83df96d6 | 133 |