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__
|
1999-07-21 16:10:18 +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/gdicmn.h"
|
|
|
|
#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;
|
|
|
|
class WXDLLEXPORT wxApp ;
|
|
|
|
class WXDLLEXPORT wxKeyEvent;
|
|
|
|
class WXDLLEXPORT wxLog;
|
|
|
|
|
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
|
|
|
{
|
1999-07-21 16:10:18 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
public:
|
|
|
|
wxApp();
|
|
|
|
~wxApp() {}
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// override base class (pure) virtuals
|
|
|
|
// -----------------------------------
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
virtual int MainLoop();
|
|
|
|
virtual void ExitMainLoop();
|
|
|
|
virtual bool Initialized();
|
|
|
|
virtual bool Pending() ;
|
|
|
|
virtual void Dispatch() ;
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
virtual bool OnInitGui();
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
virtual wxIcon GetStdIcon(int which) const;
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
void OnIdle(wxIdleEvent& event);
|
1998-09-18 10:19:10 +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();
|
1998-09-18 10:19:10 +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);
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Motif implementation.
|
1998-11-12 22:47:51 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Processes an X event.
|
|
|
|
virtual void ProcessXEvent(WXEvent* event);
|
1998-11-12 22:47:51 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Returns TRUE if an accelerator has been processed
|
|
|
|
virtual bool CheckForAccelerator(WXEvent* event);
|
1998-11-12 22:47:51 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Returns TRUE if a key down event has been processed
|
|
|
|
virtual bool CheckForKeyDown(WXEvent* event);
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-30 03:55:59 +00:00
|
|
|
// Returns TRUE if a key up event has been processed
|
|
|
|
virtual bool CheckForKeyUp(WXEvent* event);
|
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
protected:
|
1999-07-21 16:10:18 +00:00
|
|
|
bool m_showOnInit;
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
public:
|
1999-07-21 16:10:18 +00:00
|
|
|
// Implementation
|
|
|
|
static bool Initialize();
|
|
|
|
static void CleanUp();
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
void DeletePendingObjects();
|
|
|
|
bool ProcessIdle();
|
1999-03-27 18:50:54 +00:00
|
|
|
#if wxUSE_THREADS
|
1999-07-21 16:10:18 +00:00
|
|
|
void ProcessPendingEvents();
|
1999-03-27 18:50:54 +00:00
|
|
|
#endif
|
1998-09-18 10:19:10 +00:00
|
|
|
|
1999-07-21 16:10:18 +00:00
|
|
|
// Motif-specific
|
|
|
|
WXAppContext GetAppContext() const { return m_appContext; }
|
|
|
|
WXWidget GetTopLevelWidget() const { return m_topLevelWidget; }
|
|
|
|
WXColormap GetMainColormap(WXDisplay* display) ;
|
|
|
|
WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
|
|
|
|
long GetMaxRequestSize() const { return m_maxRequestSize; }
|
1998-09-18 10:19:10 +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);
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
public:
|
1999-07-21 16:10:18 +00:00
|
|
|
static long sm_lastMessageTime;
|
|
|
|
int m_nCmdShow;
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
protected:
|
1999-07-21 16:10:18 +00:00
|
|
|
bool m_keepGoing ;
|
1998-09-18 10:19:10 +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;
|
1998-09-18 10:19:10 +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
|
|
|
|
// _WX_APP_H_
|
|
|
|
|