]> git.saurik.com Git - wxWidgets.git/blame - include/wx/x11/app.h
[start of] cleanup uxtheme support code
[wxWidgets.git] / include / wx / x11 / app.h
CommitLineData
83df96d6
JS
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
edf6a063 15#if defined(__GNUG__) && !defined(__APPLE__)
83df96d6
JS
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
30class WXDLLEXPORT wxFrame;
31class WXDLLEXPORT wxWindow;
32class WXDLLEXPORT wxApp;
33class WXDLLEXPORT wxKeyEvent;
34class WXDLLEXPORT wxLog;
1b0fb34b 35class WXDLLEXPORT wxEventLoop;
9ce8d6a2 36class WXDLLEXPORT wxXVisualInfo;
83df96d6
JS
37
38// ----------------------------------------------------------------------------
256d631a 39// the wxApp class for wxX11 - see wxAppBase for more details
83df96d6
JS
40// ----------------------------------------------------------------------------
41
42class WXDLLEXPORT wxApp : public wxAppBase
43{
44 DECLARE_DYNAMIC_CLASS(wxApp)
45
46public:
47 wxApp();
dc4025af 48 ~wxApp();
83df96d6
JS
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();
e2478fde
VZ
58
59 virtual void Exit();
60
83df96d6 61 virtual bool Yield(bool onlyIfNeeded = FALSE);
e2478fde 62 virtual void WakeUpIdle();
83df96d6
JS
63
64 virtual bool OnInitGui();
65
83df96d6
JS
66 // implementation from now on
67 // --------------------------
68
83df96d6 69 // Processes an X event.
086fd560 70 virtual bool ProcessXEvent(WXEvent* event);
83df96d6 71
d715d419 72#ifdef __WXDEBUG__
5968a0dc 73 virtual void OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg);
d715d419 74#endif // __WXDEBUG__
7edcafa4 75
83df96d6
JS
76protected:
77 bool m_showOnInit;
78
79public:
80 // Implementation
05e2b077 81 virtual bool Initialize(int& argc, wxChar **argv);
94826170 82 virtual void CleanUp();
83df96d6 83
7eaac9f5 84 WXWindow GetTopLevelWidget() const { return m_topLevelWidget; }
83df96d6 85 WXColormap GetMainColormap(WXDisplay* display);
83df96d6
JS
86 long GetMaxRequestSize() const { return m_maxRequestSize; }
87
88 // This handler is called when a property change event occurs
086fd560 89 virtual bool HandlePropertyChange(WXEvent *event);
83df96d6 90
256d631a
JS
91 // Values that can be passed on the command line.
92 // Returns -1, -1 if none specified.
93 const wxSize& GetInitialSize() const { return m_initialSize; }
94 bool GetShowIconic() const { return m_showIconic; }
a11672a4 95
2b5f62a0
VZ
96#if wxUSE_UNICODE
97 // Global context for Pango layout. Either use X11
98 // or use Xft rendering according to GDK_USE_XFT
99 // environment variable
100 PangoContext* GetPangoContext();
101#endif
9ce8d6a2
MB
102
103 wxXVisualInfo* GetVisualInfo(WXDisplay* display)
104 {
105 // this should be implemented correctly for wxBitmap to work
106 // with multiple display
107 return m_visualInfo;
108 }
109
dc4025af
RR
110 // We need this before creating the app
111 static WXDisplay* GetDisplay() { return ms_display; }
112 static WXDisplay* ms_display;
113
83df96d6 114public:
256d631a
JS
115 static long sm_lastMessageTime;
116 bool m_showIconic;
117 wxSize m_initialSize;
8601b2e1 118
9ce8d6a2
MB
119#if !wxUSE_NANOX
120 wxXVisualInfo* m_visualInfo;
8601b2e1 121#endif
dc4025af 122
83df96d6
JS
123protected:
124 bool m_keepGoing;
125
7eaac9f5 126 WXWindow m_topLevelWidget;
83df96d6 127 WXColormap m_mainColormap;
83df96d6 128 long m_maxRequestSize;
1b0fb34b 129 wxEventLoop* m_mainLoop;
83df96d6
JS
130
131 DECLARE_EVENT_TABLE()
132};
133
6abf9dac 134#endif // _WX_APP_H_
83df96d6 135