]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/app.h
Implemented copy-on-demand for wxClipboard.
[wxWidgets.git] / include / wx / motif / app.h
CommitLineData
9b6dbb09
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__
83df96d6 16#pragma interface "app.h"
9b6dbb09
JS
17#endif
18
ee31c392
VZ
19// ----------------------------------------------------------------------------
20// headers
21// ----------------------------------------------------------------------------
22
9b6dbb09
JS
23#include "wx/event.h"
24
ee31c392
VZ
25// ----------------------------------------------------------------------------
26// forward declarations
27// ----------------------------------------------------------------------------
28
9b6dbb09
JS
29class WXDLLEXPORT wxFrame;
30class WXDLLEXPORT wxWindow;
72cdf4c9 31class WXDLLEXPORT wxApp;
9b6dbb09
JS
32class WXDLLEXPORT wxKeyEvent;
33class WXDLLEXPORT wxLog;
7e1bcfa8 34class WXDLLEXPORT wxEventLoop;
9ce8d6a2 35class WXDLLEXPORT wxXVisualInfo;
eb6fa4b4 36class wxPerDisplayDataMap;
9b6dbb09 37
ee31c392
VZ
38// ----------------------------------------------------------------------------
39// the wxApp class for Motif - see wxAppBase for more details
40// ----------------------------------------------------------------------------
9b6dbb09 41
ee31c392 42class WXDLLEXPORT wxApp : public wxAppBase
9b6dbb09 43{
83df96d6
JS
44 DECLARE_DYNAMIC_CLASS(wxApp)
45
ee31c392
VZ
46public:
47 wxApp();
7e1bcfa8 48 virtual ~wxApp();
83df96d6 49
ee31c392
VZ
50 // override base class (pure) virtuals
51 // -----------------------------------
83df96d6 52
ee31c392
VZ
53 virtual int MainLoop();
54 virtual void ExitMainLoop();
55 virtual bool Initialized();
72cdf4c9
VZ
56 virtual bool Pending();
57 virtual void Dispatch();
8461e4c2 58 virtual bool Yield(bool onlyIfNeeded = FALSE);
90a1a975 59 virtual bool ProcessIdle();
83df96d6 60
ee31c392 61 virtual bool OnInitGui();
83df96d6 62
ee31c392
VZ
63 // implementation from now on
64 // --------------------------
83df96d6 65
ee31c392 66 void OnIdle(wxIdleEvent& event);
83df96d6 67
ee31c392
VZ
68 // Send idle event to all top-level windows.
69 // Returns TRUE if more idle time is requested.
70 bool SendIdleEvents();
83df96d6 71
ee31c392
VZ
72 // Send idle event to window and all subwindows
73 // Returns TRUE if more idle time is requested.
74 bool SendIdleEvents(wxWindow* win);
83df96d6 75
9b6dbb09 76protected:
ee31c392 77 bool m_showOnInit;
83df96d6 78
9b6dbb09 79public:
ee31c392
VZ
80 // Implementation
81 static bool Initialize();
82 static void CleanUp();
83df96d6 83
ee31c392 84 void DeletePendingObjects();
83df96d6 85
ee31c392
VZ
86 // Motif-specific
87 WXAppContext GetAppContext() const { return m_appContext; }
eb6fa4b4 88 WXWidget GetTopLevelWidget();
72cdf4c9 89 WXColormap GetMainColormap(WXDisplay* display);
ee31c392 90 WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
eb6fa4b4
MB
91
92 void SetTopLevelWidget(WXDisplay* display, WXWidget widget);
93
ee31c392
VZ
94 // This handler is called when a property change event occurs
95 virtual void HandlePropertyChange(WXEvent *event);
9ce8d6a2
MB
96
97 wxXVisualInfo* GetVisualInfo(WXDisplay* display);
98
7e1bcfa8 99private:
7e1bcfa8 100 wxEventLoop* m_eventLoop;
83df96d6 101
ee31c392
VZ
102 // Motif-specific
103 WXAppContext m_appContext;
ee31c392
VZ
104 WXColormap m_mainColormap;
105 WXDisplay* m_initialDisplay;
eb6fa4b4 106 wxPerDisplayDataMap* m_perDisplayData;
9ce8d6a2 107
ee31c392 108 DECLARE_EVENT_TABLE()
9b6dbb09
JS
109};
110
111int WXDLLEXPORT wxEntry( int argc, char *argv[] );
112
113#endif
83df96d6 114// _WX_APP_H_
9b6dbb09 115