X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c661ecca60bd71a6d4561425da832cb9e0b30d67..214b7e74f0d6e46fc278d0060b2e864a23f1714e:/include/wx/app.h diff --git a/include/wx/app.h b/include/wx/app.h index 738743fa3a..46bde888f1 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -21,7 +21,7 @@ // typedefs // ---------------------------------------------------------------------------- -#ifdef __WXMSW__ +#if defined(__WXMSW__) || defined (__WXPM__) class WXDLLEXPORT wxApp; typedef wxApp* (*wxAppInitializerFunction)(); #else @@ -61,7 +61,9 @@ class WXDLLEXPORT wxAppBase : public wxEvtHandler public: // the virtual functions which may/must be overridden in the derived class // ----------------------------------------------------------------------- - +#ifdef __WXMAC_X__ + virtual ~wxAppBase() {} // Added min for Mac X +#endif // called during the program initialization, returning FALSE from here // prevents the program from continuing - it's a good place to create // the top level program window and return TRUE. @@ -169,7 +171,7 @@ public: // return the "main" top level window (if it hadn't been set previously // with SetTopWindow(), will return just some top level window and, if // there are none, will return NULL) - wxWindow *GetTopWindow() const + virtual wxWindow *GetTopWindow() const { if (m_topWindow) return m_topWindow; @@ -218,7 +220,7 @@ public: // set use of best visual flag (see below) void SetUseBestVisual( bool flag ) { m_useBestVisual = flag; } bool GetUseBestVisual() const { return m_useBestVisual; } - + // set/get printing mode: see wxPRINT_XXX constants. // // default behaviour is the normal one for Unix: always use PostScript @@ -258,7 +260,7 @@ protected: // TRUE if the application wants to get debug output bool m_wantDebugOutput; - + // TRUE if the apps whats to use the best visual on systems where // more than one are available (Sun, SGI, XFree86 4.0 ?) bool m_useBestVisual; @@ -374,21 +376,29 @@ public: #define IMPLEMENT_WXWIN_MAIN \ extern int wxEntry( int argc, char *argv[] ); \ int main(int argc, char *argv[]) { return wxEntry(argc, argv); } +#elif defined(__WXMAC__) && defined(__UNIX__) + // wxMac seems to have a specific wxEntry prototype + #define IMPLEMENT_WXWIN_MAIN \ + extern int wxEntry( int argc, char *argv[], bool enterLoop = 1 ); \ + int main(int argc, char *argv[]) { return wxEntry(argc, argv); } #elif defined(__WXMSW__) && defined(WXUSINGDLL) // NT defines APIENTRY, 3.x not #if !defined(WXAPIENTRY) #define WXAPIENTRY WXFAR wxSTDCALL #endif + #include + #include "wx/msw/winundef.h" + #define IMPLEMENT_WXWIN_MAIN \ - int WXAPIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,\ - LPSTR m_lpCmdLine, int nCmdShow )\ + extern "C" int WXAPIENTRY WinMain(HINSTANCE hInstance,\ + HINSTANCE hPrevInstance,\ + LPSTR m_lpCmdLine, int nCmdShow)\ {\ - return wxEntry((WXHINSTANCE) hInstance, \ + return wxEntry((WXHINSTANCE) hInstance,\ (WXHINSTANCE) hPrevInstance,\ m_lpCmdLine, nCmdShow);\ } - #else #define IMPLEMENT_WXWIN_MAIN #endif