]> git.saurik.com Git - wxWidgets.git/blame - include/wx/x11/app.h
new wxASSERT implementation using wxAssert() helper function
[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
15#ifdef __GNUG__
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;
83df96d6
JS
36
37// ----------------------------------------------------------------------------
256d631a 38// the wxApp class for wxX11 - see wxAppBase for more details
83df96d6
JS
39// ----------------------------------------------------------------------------
40
41class WXDLLEXPORT wxApp : public wxAppBase
42{
43 DECLARE_DYNAMIC_CLASS(wxApp)
44
45public:
46 wxApp();
dc4025af 47 ~wxApp();
83df96d6
JS
48
49 // override base class (pure) virtuals
50 // -----------------------------------
51
52 virtual int MainLoop();
53 virtual void ExitMainLoop();
54 virtual bool Initialized();
55 virtual bool Pending();
56 virtual void Dispatch();
57 virtual bool Yield(bool onlyIfNeeded = FALSE);
58
59 virtual bool OnInitGui();
60
83df96d6
JS
61 // implementation from now on
62 // --------------------------
63
64 void OnIdle(wxIdleEvent& event);
65
66 // Send idle event to all top-level windows.
67 // Returns TRUE if more idle time is requested.
68 bool SendIdleEvents();
69
70 // Send idle event to window and all subwindows
71 // Returns TRUE if more idle time is requested.
72 bool SendIdleEvents(wxWindow* win);
73
83df96d6 74 // Processes an X event.
086fd560 75 virtual bool ProcessXEvent(WXEvent* event);
83df96d6 76
d715d419 77#ifdef __WXDEBUG__
7edcafa4 78 virtual void OnAssert(const wxChar *file, int line, const wxChar *msg);
d715d419 79#endif // __WXDEBUG__
7edcafa4 80
83df96d6
JS
81protected:
82 bool m_showOnInit;
83
84public:
85 // Implementation
86 static bool Initialize();
87 static void CleanUp();
88
89 void DeletePendingObjects();
90 bool ProcessIdle();
91
7eaac9f5 92 WXWindow GetTopLevelWidget() const { return m_topLevelWidget; }
83df96d6 93 WXColormap GetMainColormap(WXDisplay* display);
83df96d6
JS
94 long GetMaxRequestSize() const { return m_maxRequestSize; }
95
96 // This handler is called when a property change event occurs
086fd560 97 virtual bool HandlePropertyChange(WXEvent *event);
83df96d6 98
256d631a
JS
99 // Values that can be passed on the command line.
100 // Returns -1, -1 if none specified.
101 const wxSize& GetInitialSize() const { return m_initialSize; }
102 bool GetShowIconic() const { return m_showIconic; }
a11672a4 103
dc4025af
RR
104 // We need this before creating the app
105 static WXDisplay* GetDisplay() { return ms_display; }
106 static WXDisplay* ms_display;
107
83df96d6 108public:
256d631a
JS
109 static long sm_lastMessageTime;
110 bool m_showIconic;
111 wxSize m_initialSize;
8601b2e1
JS
112
113#if !wxUSE_NANOX
dc4025af
RR
114 // Someone find a better place for these
115 int m_visualType; // TrueColor, DirectColor etc.
116 int m_visualDepth;
117 int m_visualColormapSize;
118 void *m_visualColormap;
119 int m_visualScreen;
120 unsigned long m_visualRedMask;
121 unsigned long m_visualGreenMask;
122 unsigned long m_visualBlueMask;
123 int m_visualRedShift;
124 int m_visualGreenShift;
125 int m_visualBlueShift;
126 int m_visualRedPrec;
127 int m_visualGreenPrec;
128 int m_visualBluePrec;
129
130 unsigned char *m_colorCube;
8601b2e1 131#endif
dc4025af 132
83df96d6
JS
133protected:
134 bool m_keepGoing;
135
7eaac9f5 136 WXWindow m_topLevelWidget;
83df96d6 137 WXColormap m_mainColormap;
83df96d6 138 long m_maxRequestSize;
1b0fb34b 139 wxEventLoop* m_mainLoop;
83df96d6
JS
140
141 DECLARE_EVENT_TABLE()
142};
143
144int WXDLLEXPORT wxEntry( int argc, char *argv[] );
145
146#endif
147// _WX_APP_H_
148