]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/motif/app.h
Prepare headers for C->C++ migration
[wxWidgets.git] / include / wx / motif / app.h
... / ...
CommitLineData
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(NO_GCC_PRAGMA)
16#pragma interface "app.h"
17#endif
18
19// ----------------------------------------------------------------------------
20// headers
21// ----------------------------------------------------------------------------
22
23#include "wx/event.h"
24#include "wx/hashmap.h"
25
26// ----------------------------------------------------------------------------
27// forward declarations
28// ----------------------------------------------------------------------------
29
30class WXDLLEXPORT wxFrame;
31class WXDLLEXPORT wxWindow;
32class WXDLLEXPORT wxApp;
33class WXDLLEXPORT wxKeyEvent;
34class WXDLLEXPORT wxLog;
35class WXDLLEXPORT wxEventLoop;
36class WXDLLEXPORT wxXVisualInfo;
37class WXDLLEXPORT wxPerDisplayData;
38
39// ----------------------------------------------------------------------------
40// the wxApp class for Motif - see wxAppBase for more details
41// ----------------------------------------------------------------------------
42
43WX_DECLARE_VOIDPTR_HASH_MAP( wxPerDisplayData*, wxPerDisplayDataMap );
44
45class WXDLLEXPORT wxApp : public wxAppBase
46{
47 DECLARE_DYNAMIC_CLASS(wxApp)
48
49public:
50 wxApp();
51 virtual ~wxApp();
52
53 // override base class (pure) virtuals
54 // -----------------------------------
55
56 virtual int MainLoop();
57
58 virtual void Exit();
59
60 virtual bool Yield(bool onlyIfNeeded = FALSE);
61 virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp
62
63 virtual bool OnInitGui();
64
65 // implementation from now on
66 // --------------------------
67
68protected:
69 bool m_showOnInit;
70
71public:
72 // Implementation
73 virtual bool Initialize(int& argc, wxChar **argv);
74 virtual void CleanUp();
75
76 // Motif-specific
77 WXAppContext GetAppContext() const { return m_appContext; }
78 WXWidget GetTopLevelWidget();
79 WXWidget GetTopLevelRealizedWidget();
80 WXColormap GetMainColormap(WXDisplay* display);
81 WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
82
83 void SetTopLevelWidget(WXDisplay* display, WXWidget widget);
84 void SetTopLevelRealizedWidget(WXDisplay* display,
85 WXWidget widget);
86
87 // This handler is called when a property change event occurs
88 virtual void HandlePropertyChange(WXEvent *event);
89
90 wxXVisualInfo* GetVisualInfo(WXDisplay* display);
91
92private:
93 // Motif-specific
94 WXAppContext m_appContext;
95 WXColormap m_mainColormap;
96 WXDisplay* m_initialDisplay;
97 wxPerDisplayDataMap* m_perDisplayData;
98
99 DECLARE_EVENT_TABLE()
100};
101
102#endif
103// _WX_APP_H_
104