]> git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/app.h
wxLaunchDefaultBrowser() now supports wxBROWSER_NEW_WINDOW flag (and it actually...
[wxWidgets.git] / include / wx / x11 / app.h
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 // ----------------------------------------------------------------------------
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 DECLARE_DYNAMIC_CLASS(wxApp)
40
41 public:
42 wxApp();
43 ~wxApp();
44
45 // override base class (pure) virtuals
46 // -----------------------------------
47
48 virtual void Exit();
49
50 virtual bool Yield(bool onlyIfNeeded = FALSE);
51 virtual void WakeUpIdle();
52
53 virtual bool OnInitGui();
54
55 // implementation from now on
56 // --------------------------
57
58 // Processes an X event.
59 virtual bool ProcessXEvent(WXEvent* event);
60
61 #ifdef __WXDEBUG__
62 virtual void OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg);
63 #endif // __WXDEBUG__
64
65 protected:
66 bool m_showOnInit;
67
68 public:
69 // Implementation
70 virtual bool Initialize(int& argc, wxChar **argv);
71 virtual void CleanUp();
72
73 WXWindow GetTopLevelWidget() const { return m_topLevelWidget; }
74 WXColormap GetMainColormap(WXDisplay* display);
75 long GetMaxRequestSize() const { return m_maxRequestSize; }
76
77 // This handler is called when a property change event occurs
78 virtual bool HandlePropertyChange(WXEvent *event);
79
80 // Values that can be passed on the command line.
81 // Returns -1, -1 if none specified.
82 const wxSize& GetInitialSize() const { return m_initialSize; }
83 bool GetShowIconic() const { return m_showIconic; }
84
85 #if wxUSE_UNICODE
86 // Global context for Pango layout. Either use X11
87 // or use Xft rendering according to GDK_USE_XFT
88 // environment variable
89 PangoContext* GetPangoContext();
90 #endif
91
92 wxXVisualInfo* GetVisualInfo(WXDisplay* display)
93 {
94 // this should be implemented correctly for wxBitmap to work
95 // with multiple display
96 return m_visualInfo;
97 }
98
99 // We need this before creating the app
100 static WXDisplay* GetDisplay() { return ms_display; }
101 static WXDisplay* ms_display;
102
103 public:
104 static long sm_lastMessageTime;
105 bool m_showIconic;
106 wxSize m_initialSize;
107
108 #if !wxUSE_NANOX
109 wxXVisualInfo* m_visualInfo;
110 #endif
111
112 protected:
113 bool m_keepGoing;
114
115 WXWindow m_topLevelWidget;
116 WXColormap m_mainColormap;
117 long m_maxRequestSize;
118
119 DECLARE_EVENT_TABLE()
120 };
121
122 #endif // _WX_APP_H_
123