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