]> git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/app.h
compilation fix
[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 #if defined(__GNUG__) && !defined(__APPLE__)
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;
35 class WXDLLEXPORT wxEventLoop;
36 class WXDLLEXPORT wxXVisualInfo;
37
38 // ----------------------------------------------------------------------------
39 // the wxApp class for wxX11 - see wxAppBase for more details
40 // ----------------------------------------------------------------------------
41
42 class WXDLLEXPORT wxApp : public wxAppBase
43 {
44 DECLARE_DYNAMIC_CLASS(wxApp)
45
46 public:
47 wxApp();
48 ~wxApp();
49
50 // override base class (pure) virtuals
51 // -----------------------------------
52
53 virtual int MainLoop();
54 virtual void ExitMainLoop();
55 virtual bool Initialized();
56 virtual bool Pending();
57 virtual void Dispatch();
58
59 virtual void Exit();
60
61 virtual bool Yield(bool onlyIfNeeded = FALSE);
62 virtual bool ProcessIdle();
63 virtual void WakeUpIdle();
64
65 virtual bool OnInitGui();
66
67 // implementation from now on
68 // --------------------------
69
70 void OnIdle(wxIdleEvent& event);
71
72 // Send idle event to all top-level windows.
73 // Returns TRUE if more idle time is requested.
74 bool SendIdleEvents();
75
76 // Send idle event to window and all subwindows
77 // Returns TRUE if more idle time is requested.
78 bool SendIdleEvents(wxWindow* win);
79
80 // Processes an X event.
81 virtual bool ProcessXEvent(WXEvent* event);
82
83 #ifdef __WXDEBUG__
84 virtual void OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg);
85 #endif // __WXDEBUG__
86
87 protected:
88 bool m_showOnInit;
89
90 public:
91 // Implementation
92 virtual bool Initialize(int& argc, wxChar **argv);
93 virtual void CleanUp();
94
95 WXWindow GetTopLevelWidget() const { return m_topLevelWidget; }
96 WXColormap GetMainColormap(WXDisplay* display);
97 long GetMaxRequestSize() const { return m_maxRequestSize; }
98
99 // This handler is called when a property change event occurs
100 virtual bool HandlePropertyChange(WXEvent *event);
101
102 // Values that can be passed on the command line.
103 // Returns -1, -1 if none specified.
104 const wxSize& GetInitialSize() const { return m_initialSize; }
105 bool GetShowIconic() const { return m_showIconic; }
106
107 #if wxUSE_UNICODE
108 // Global context for Pango layout. Either use X11
109 // or use Xft rendering according to GDK_USE_XFT
110 // environment variable
111 PangoContext* GetPangoContext();
112 #endif
113
114 wxXVisualInfo* GetVisualInfo(WXDisplay* display)
115 {
116 // this should be implemented correctly for wxBitmap to work
117 // with multiple display
118 return m_visualInfo;
119 }
120
121 // We need this before creating the app
122 static WXDisplay* GetDisplay() { return ms_display; }
123 static WXDisplay* ms_display;
124
125 public:
126 static long sm_lastMessageTime;
127 bool m_showIconic;
128 wxSize m_initialSize;
129
130 #if !wxUSE_NANOX
131 wxXVisualInfo* m_visualInfo;
132 #endif
133
134 protected:
135 bool m_keepGoing;
136
137 WXWindow m_topLevelWidget;
138 WXColormap m_mainColormap;
139 long m_maxRequestSize;
140 wxEventLoop* m_mainLoop;
141
142 DECLARE_EVENT_TABLE()
143 };
144
145 #endif // _WX_APP_H_
146