1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-07-25 10:31:55 -04:00
|
|
|
// Name: wx/motif/app.h
|
1998-09-18 06:19:10 -04:00
|
|
|
// Purpose: wxApp class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_APP_H_
|
|
|
|
#define _WX_APP_H_
|
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
#include "wx/event.h"
|
2004-05-08 16:20:24 -04:00
|
|
|
#include "wx/hashmap.h"
|
1998-09-18 06:19:10 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
class WXDLLEXPORT wxFrame;
|
|
|
|
class WXDLLEXPORT wxWindow;
|
1999-10-18 11:14:52 -04:00
|
|
|
class WXDLLEXPORT wxApp;
|
1998-09-18 06:19:10 -04:00
|
|
|
class WXDLLEXPORT wxKeyEvent;
|
|
|
|
class WXDLLEXPORT wxLog;
|
2003-02-02 10:48:50 -05:00
|
|
|
class WXDLLEXPORT wxEventLoop;
|
2003-04-07 13:15:11 -04:00
|
|
|
class WXDLLEXPORT wxXVisualInfo;
|
2004-05-08 16:20:24 -04:00
|
|
|
class WXDLLEXPORT wxPerDisplayData;
|
1998-09-18 06:19:10 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// the wxApp class for Motif - see wxAppBase for more details
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-09-18 06:19:10 -04:00
|
|
|
|
2004-05-08 16:20:24 -04:00
|
|
|
WX_DECLARE_VOIDPTR_HASH_MAP( wxPerDisplayData*, wxPerDisplayDataMap );
|
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
class WXDLLEXPORT wxApp : public wxAppBase
|
1998-09-18 06:19:10 -04:00
|
|
|
{
|
2002-02-05 11:34:33 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
public:
|
|
|
|
wxApp();
|
2003-02-02 10:48:50 -05:00
|
|
|
virtual ~wxApp();
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
// override base class (pure) virtuals
|
|
|
|
// -----------------------------------
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
virtual int MainLoop();
|
2003-06-23 20:56:19 -04:00
|
|
|
|
|
|
|
virtual void Exit();
|
|
|
|
|
2005-02-06 12:38:33 -05:00
|
|
|
virtual bool Yield(bool onlyIfNeeded = false);
|
2003-06-23 20:56:19 -04:00
|
|
|
virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
virtual bool OnInitGui();
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
protected:
|
1999-07-21 12:10:18 -04:00
|
|
|
bool m_showOnInit;
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
public:
|
1999-07-21 12:10:18 -04:00
|
|
|
// Implementation
|
2003-06-30 16:02:05 -04:00
|
|
|
virtual bool Initialize(int& argc, wxChar **argv);
|
2003-06-30 14:43:09 -04:00
|
|
|
virtual void CleanUp();
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
// Motif-specific
|
|
|
|
WXAppContext GetAppContext() const { return m_appContext; }
|
2003-05-04 13:40:46 -04:00
|
|
|
WXWidget GetTopLevelWidget();
|
2004-05-22 14:01:33 -04:00
|
|
|
WXWidget GetTopLevelRealizedWidget();
|
1999-10-18 11:14:52 -04:00
|
|
|
WXColormap GetMainColormap(WXDisplay* display);
|
1999-07-21 12:10:18 -04:00
|
|
|
WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
|
2003-05-04 13:40:46 -04:00
|
|
|
|
|
|
|
void SetTopLevelWidget(WXDisplay* display, WXWidget widget);
|
2004-05-22 14:01:33 -04:00
|
|
|
void SetTopLevelRealizedWidget(WXDisplay* display,
|
|
|
|
WXWidget widget);
|
2003-05-04 13:40:46 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
// This handler is called when a property change event occurs
|
|
|
|
virtual void HandlePropertyChange(WXEvent *event);
|
2003-04-07 13:15:11 -04:00
|
|
|
|
|
|
|
wxXVisualInfo* GetVisualInfo(WXDisplay* display);
|
|
|
|
|
2003-02-02 10:48:50 -05:00
|
|
|
private:
|
1999-07-21 12:10:18 -04:00
|
|
|
// Motif-specific
|
|
|
|
WXAppContext m_appContext;
|
|
|
|
WXColormap m_mainColormap;
|
|
|
|
WXDisplay* m_initialDisplay;
|
2003-05-04 13:40:46 -04:00
|
|
|
wxPerDisplayDataMap* m_perDisplayData;
|
2003-04-07 13:15:11 -04:00
|
|
|
|
1999-07-21 12:10:18 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-09-18 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 11:34:33 -05:00
|
|
|
// _WX_APP_H_
|