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