1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: app.h
|
|
|
|
// Purpose: wxApp class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_APP_H_
|
|
|
|
#define _WX_APP_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
2002-02-05 16:34:33 +00:00
|
|
|
#pragma interface "app.h"
|
1998-09-18 10:19:10 +00:00
|
|
|
#endif
|
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
#include "wx/event.h"
|
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// forward declarations
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
class WXDLLEXPORT wxFrame;
|
|
|
|
class WXDLLEXPORT wxWindow;
|
1999-10-18 15:14:52 +00:00
|
|
|
class WXDLLEXPORT wxApp;
|
1998-09-18 10:19:10 +00:00
|
|
|
class WXDLLEXPORT wxKeyEvent;
|
|
|
|
class WXDLLEXPORT wxLog;
|
2003-02-02 15:48:50 +00:00
|
|
|
class WXDLLEXPORT wxEventLoop;
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// the wxApp class for Motif - see wxAppBase for more details
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
class WXDLLEXPORT wxApp : public wxAppBase
|
1998-09-18 10:19:10 +00:00
|
|
|
{
|
2002-02-05 16:34:33 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
public:
|
|
|
|
wxApp();
|
2003-02-02 15:48:50 +00:00
|
|
|
virtual ~wxApp();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// override base class (pure) virtuals
|
|
|
|
// -----------------------------------
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
virtual int MainLoop();
|
|
|
|
virtual void ExitMainLoop();
|
|
|
|
virtual bool Initialized();
|
1999-10-18 15:14:52 +00:00
|
|
|
virtual bool Pending();
|
|
|
|
virtual void Dispatch();
|
2001-10-19 18:29:32 +00:00
|
|
|
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
2002-08-01 19:54:55 +00:00
|
|
|
virtual bool ProcessIdle();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
virtual bool OnInitGui();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
void OnIdle(wxIdleEvent& event);
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Send idle event to all top-level windows.
|
|
|
|
// Returns TRUE if more idle time is requested.
|
|
|
|
bool SendIdleEvents();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Send idle event to window and all subwindows
|
|
|
|
// Returns TRUE if more idle time is requested.
|
|
|
|
bool SendIdleEvents(wxWindow* win);
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
protected:
|
1999-07-21 16:10:18 +00:00
|
|
|
bool m_showOnInit;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
public:
|
1999-07-21 16:10:18 +00:00
|
|
|
// Implementation
|
|
|
|
static bool Initialize();
|
|
|
|
static void CleanUp();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
void DeletePendingObjects();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Motif-specific
|
|
|
|
WXAppContext GetAppContext() const { return m_appContext; }
|
|
|
|
WXWidget GetTopLevelWidget() const { return m_topLevelWidget; }
|
1999-10-18 15:14:52 +00:00
|
|
|
WXColormap GetMainColormap(WXDisplay* display);
|
1999-07-21 16:10:18 +00:00
|
|
|
WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
|
|
|
|
long GetMaxRequestSize() const { return m_maxRequestSize; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// This handler is called when a property change event occurs
|
|
|
|
virtual void HandlePropertyChange(WXEvent *event);
|
2002-02-05 16:34:33 +00:00
|
|
|
|
2003-02-02 15:48:50 +00:00
|
|
|
private:
|
1999-07-21 16:10:18 +00:00
|
|
|
static long sm_lastMessageTime;
|
|
|
|
int m_nCmdShow;
|
2003-02-02 15:48:50 +00:00
|
|
|
|
|
|
|
wxEventLoop* m_eventLoop;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Motif-specific
|
|
|
|
WXAppContext m_appContext;
|
|
|
|
WXWidget m_topLevelWidget;
|
|
|
|
WXColormap m_mainColormap;
|
|
|
|
WXDisplay* m_initialDisplay;
|
|
|
|
long m_maxRequestSize;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int WXDLLEXPORT wxEntry( int argc, char *argv[] );
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 16:34:33 +00:00
|
|
|
// _WX_APP_H_
|
1998-09-18 10:19:10 +00:00
|
|
|
|