1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-10-19 14:29:32 -04:00
|
|
|
// Name: wx/gtk/app.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-26 05:56:58 -05:00
|
|
|
// Id: $Id$
|
1998-10-24 13:12:05 -04:00
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-26 14:36:19 -04:00
|
|
|
#ifndef _WX_GTK_APP_H_
|
|
|
|
#define _WX_GTK_APP_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-04-19 12:58:07 -04:00
|
|
|
#if wxUSE_THREADS
|
|
|
|
class WXDLLIMPEXP_BASE wxMutex;
|
|
|
|
#endif
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxApp
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxApp: public wxAppBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-07-05 20:44:26 -04:00
|
|
|
public:
|
1999-01-08 15:33:18 -05:00
|
|
|
wxApp();
|
2001-09-28 09:53:55 -04:00
|
|
|
virtual ~wxApp();
|
1998-08-07 11:09:04 -04:00
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
/* override for altering the way wxGTK intializes the GUI
|
|
|
|
* (palette/visual/colorcube). under wxMSW, OnInitGui() does nothing by
|
|
|
|
* default. when overriding this method, the code in it is likely to be
|
|
|
|
* platform dependent, otherwise use OnInit(). */
|
1999-01-08 15:33:18 -05:00
|
|
|
virtual bool OnInitGui();
|
1999-07-05 20:44:26 -04:00
|
|
|
|
|
|
|
// override base class (pure) virtuals
|
2001-10-19 14:29:32 -04:00
|
|
|
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
2003-06-23 20:56:19 -04:00
|
|
|
virtual void WakeUpIdle();
|
1998-06-03 15:06:13 -04:00
|
|
|
|
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();
|
1998-08-07 11:09:04 -04:00
|
|
|
|
2001-07-11 11:19:32 -04:00
|
|
|
#ifdef __WXDEBUG__
|
2006-08-25 18:48:07 -04:00
|
|
|
virtual void OnAssertFailure(const wxChar *file,
|
|
|
|
int line,
|
|
|
|
const wxChar *func,
|
|
|
|
const wxChar *cond,
|
|
|
|
const wxChar *msg);
|
2001-07-11 11:19:32 -04:00
|
|
|
#endif // __WXDEBUG__
|
1999-07-05 20:44:26 -04:00
|
|
|
|
2007-04-15 19:06:45 -04:00
|
|
|
// GTK-specific methods
|
|
|
|
// -------------------
|
|
|
|
|
|
|
|
// this can be overridden to return a specific visual to be used for GTK+
|
|
|
|
// instead of the default one (it's used by wxGLApp)
|
|
|
|
//
|
|
|
|
// must return XVisualInfo pointer (it is not freed by caller)
|
|
|
|
virtual void *GetXVisualInfo() { return NULL; }
|
|
|
|
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
2002-01-12 07:21:57 -05:00
|
|
|
// This returns the current visual: either that used by wxRootWindow
|
|
|
|
// or the XVisualInfo* for SGI.
|
|
|
|
GdkVisual *GetGdkVisual();
|
2007-04-15 19:06:45 -04:00
|
|
|
|
2007-04-19 12:58:07 -04:00
|
|
|
// check for pending events, without interference from our idle source
|
|
|
|
bool EventsPending();
|
|
|
|
bool DoIdle();
|
|
|
|
|
1999-07-05 20:44:26 -04:00
|
|
|
private:
|
2001-07-11 11:19:32 -04:00
|
|
|
// true if we're inside an assert modal dialog
|
|
|
|
#ifdef __WXDEBUG__
|
|
|
|
bool m_isInAssert;
|
|
|
|
#endif // __WXDEBUG__
|
2007-04-19 12:58:07 -04:00
|
|
|
#if wxUSE_THREADS
|
|
|
|
wxMutex* m_idleMutex;
|
|
|
|
#endif
|
|
|
|
guint m_idleSourceId;
|
1999-07-05 20:44:26 -04:00
|
|
|
|
1999-08-24 16:26:06 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2006-08-26 14:36:19 -04:00
|
|
|
#endif // _WX_GTK_APP_H_
|