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 
GetTopLevelWidget()62     WXWindow       GetTopLevelWidget() const { return m_topLevelWidget; }
63     WXColormap     GetMainColormap(WXDisplay* display);
GetMaxRequestSize()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.
GetInitialSize()71     const wxSize& GetInitialSize() const { return m_initialSize; }
GetShowIconic()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 
GetVisualInfo(WXDisplay * WXUNUSED (display))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     }
GetXVisualInfo()87     virtual void* GetXVisualInfo() { return NULL; }
88 
89 public:
90     static long           sm_lastMessageTime;
91     bool                  m_showIconic;
92     wxSize                m_initialSize;
93 
94 #if !wxUSE_NANOX
95     wxXVisualInfo*        m_visualInfo;
96 #endif
97 
98 protected:
99     WXWindow              m_topLevelWidget;
100     WXColormap            m_mainColormap;
101     long                  m_maxRequestSize;
102 
103     wxDECLARE_DYNAMIC_CLASS(wxApp);
104 };
105 
106 #endif // _WX_X11_APP_H_
107 
108