X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/53a2db124c633f80bdb16336084262037d879a2c..86ac84b8ce086e6bbda58f422d41f84268606e35:/include/wx/apptrait.h?ds=inline diff --git a/include/wx/apptrait.h b/include/wx/apptrait.h index c31d9d0670..52c815bf13 100644 --- a/include/wx/apptrait.h +++ b/include/wx/apptrait.h @@ -25,12 +25,12 @@ class WXDLLIMPEXP_FWD_BASE wxLog; class WXDLLIMPEXP_FWD_BASE wxMessageOutput; class WXDLLIMPEXP_FWD_BASE wxObject; class WXDLLIMPEXP_FWD_CORE wxRendererNative; -class WXDLLIMPEXP_FWD_BASE wxStandardPathsBase; +class WXDLLIMPEXP_FWD_BASE wxStandardPaths; class WXDLLIMPEXP_FWD_BASE wxString; class WXDLLIMPEXP_FWD_BASE wxTimer; class WXDLLIMPEXP_FWD_BASE wxTimerImpl; -class GSocketManager; +class wxSocketManager; // ---------------------------------------------------------------------------- @@ -75,7 +75,7 @@ public: // wxStandardPaths object is normally the same for wxBase and wxGUI // except in the case of wxMac and wxCocoa - virtual wxStandardPathsBase& GetStandardPaths(); + virtual wxStandardPaths& GetStandardPaths(); #if wxUSE_INTL // called during wxApp initialization to set the locale to correspond to @@ -87,7 +87,6 @@ public: // functions abstracting differences between GUI and console modes // ------------------------------------------------------------------------ -#ifdef __WXDEBUG__ // show the assert dialog with the specified message in GUI or just print // the string to stderr in console mode // @@ -96,7 +95,6 @@ public: // // return true to suppress subsequent asserts, false to continue as before virtual bool ShowAssertDialog(const wxString& msg) = 0; -#endif // __WXDEBUG__ // return true if fprintf(stderr) goes somewhere, false otherwise virtual bool HasStderr() = 0; @@ -116,9 +114,21 @@ public: virtual void RemoveFromPendingDelete(wxObject *object) = 0; #if wxUSE_SOCKETS + // this function is used by wxNet library to set the default socket manager + // to use: doing it like this allows us to keep all socket-related code in + // wxNet instead of having to pull it in wxBase itself as we'd have to do + // if we really implemented wxSocketManager here + // + // we don't take ownership of this pointer, it should have a lifetime + // greater than that of any socket (e.g. be a pointer to a static object) + static void SetDefaultSocketManager(wxSocketManager *manager) + { + ms_manager = manager; + } + // return socket manager: this is usually different for console and GUI // applications (although some ports use the same implementation for both) - virtual GSocketManager *GetSocketManager() = 0; + virtual wxSocketManager *GetSocketManager() { return ms_manager; } #endif // create a new, port specific, instance of the event loop used by wxApp @@ -165,10 +175,13 @@ public: protected: -#if wxUSE_STACKWALKER && defined( __WXDEBUG__ ) +#if wxUSE_STACKWALKER // utility function: returns the stack frame as a plain wxString virtual wxString GetAssertStackTrace(); #endif + +private: + static wxSocketManager *ms_manager; }; // ---------------------------------------------------------------------------- @@ -217,9 +230,7 @@ public: #endif // wxUSE_FONTMAP virtual wxRendererNative *CreateRenderer(); -#ifdef __WXDEBUG__ virtual bool ShowAssertDialog(const wxString& msg); -#endif // __WXDEBUG__ virtual bool HasStderr(); virtual void ScheduleForDestroy(wxObject *object); @@ -258,9 +269,7 @@ public: #endif // wxUSE_FONTMAP virtual wxRendererNative *CreateRenderer(); -#ifdef __WXDEBUG__ virtual bool ShowAssertDialog(const wxString& msg); -#endif // __WXDEBUG__ virtual bool HasStderr(); virtual void ScheduleForDestroy(wxObject *object);