1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: app.h
|
|
|
|
// Purpose: wxApp inclusion
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart and Markus Holzem
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_APP_H_BASE_
|
|
|
|
#define _WX_APP_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-08-07 17:32:13 -04:00
|
|
|
#ifdef __WXMSW__
|
1998-05-20 10:01:55 -04:00
|
|
|
class WXDLLEXPORT wxApp;
|
|
|
|
typedef wxApp* (*wxAppInitializerFunction) (void);
|
1998-05-21 11:02:02 -04:00
|
|
|
#endif
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
#include "wx/object.h"
|
|
|
|
|
1998-08-07 17:32:13 -04:00
|
|
|
#ifndef __WXMSW__
|
1998-05-20 10:01:55 -04:00
|
|
|
typedef wxObject* (*wxAppInitializerFunction) (void); // returning wxApp* won't work with gcc
|
1998-05-21 11:02:02 -04:00
|
|
|
#endif
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-07-10 10:15:17 -04:00
|
|
|
#if defined(__WXMSW__)
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/msw/app.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXMOTIF__)
|
1998-08-14 20:23:28 -04:00
|
|
|
#include "wx/motif/app.h"
|
1998-08-07 16:23:17 -04:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/app.h"
|
1998-07-10 10:15:17 -04:00
|
|
|
#elif defined(__WXGTK__)
|
1998-05-20 10:01:55 -04:00
|
|
|
#include "wx/gtk/app.h"
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/app.h"
|
|
|
|
#elif defined(__WXSTUBS__)
|
|
|
|
#include "wx/stubs/app.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Having a global instance of this class allows
|
|
|
|
// wxApp to be aware of the app creator function.
|
|
|
|
// wxApp can then call this function to create a new
|
|
|
|
// app object. Convoluted, but necessary.
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxAppInitializer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxAppInitializer(wxAppInitializerFunction fn)
|
|
|
|
{
|
|
|
|
wxApp::SetInitializerFunction(fn);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
1998-05-21 15:39:05 -04:00
|
|
|
// Here's a macro you can use if your compiler
|
|
|
|
// really, really wants main() to be in your main program
|
|
|
|
// (e.g. hello.cpp).
|
|
|
|
// Now IMPLEMENT_APP should add this code if required.
|
|
|
|
|
1998-07-07 11:59:37 -04:00
|
|
|
#if defined(__AIX__) || defined(__HPUX__)
|
1998-05-28 15:54:07 -04:00
|
|
|
#define IMPLEMENT_WXWIN_MAIN \
|
|
|
|
extern int wxEntry( int argc, char *argv[] ); \
|
|
|
|
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
1998-05-21 15:39:05 -04:00
|
|
|
#else
|
|
|
|
#define IMPLEMENT_WXWIN_MAIN
|
|
|
|
#endif
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#define IMPLEMENT_APP(appname) \
|
|
|
|
wxApp *wxCreateApp(void) { return new appname; } \
|
|
|
|
wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
|
|
|
|
appname& wxGetApp(void) { return *(appname *)wxTheApp; } \
|
1998-05-21 15:39:05 -04:00
|
|
|
IMPLEMENT_WXWIN_MAIN
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
#define DECLARE_APP(appname) \
|
|
|
|
extern appname& wxGetApp(void) ;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_APP_H_BASE_
|