X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ec4a23f50e12b2e7d780543bc87744d1b4a00b4..a5b31f4e11c860fa5d9949c8694a7499793c3b98:/include/wx/app.h?ds=sidebyside diff --git a/include/wx/app.h b/include/wx/app.h index 02e57755fa..ef7a14120b 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -18,15 +18,9 @@ // ---------------------------------------------------------------------------- #include "wx/event.h" // for the base class - -#if wxUSE_GUI - #include "wx/window.h" // for wxTopLevelWindows - - #include "wx/vidmode.h" -#endif // wxUSE_GUI - #include "wx/build.h" #include "wx/init.h" // we must declare wxEntry() +#include "wx/intl.h" // for wxLayoutDirection class WXDLLIMPEXP_BASE wxAppConsole; class WXDLLIMPEXP_BASE wxAppTraits; @@ -36,6 +30,7 @@ class WXDLLIMPEXP_BASE wxMessageOutput; #if wxUSE_GUI class WXDLLEXPORT wxEventLoop; + struct WXDLLIMPEXP_CORE wxVideoMode; #endif // ---------------------------------------------------------------------------- @@ -113,6 +108,9 @@ public: // Called from wxExit() function, should terminate the application a.s.a.p. virtual void Exit(); + // Return the layout direction for the current locale + virtual wxLayoutDirection GetLayoutDirection() const; + // application info: name, description, vendor // ------------------------------------------- @@ -443,15 +441,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) - virtual wxWindow *GetTopWindow() const - { - if (m_topWindow) - return m_topWindow; - else if (wxTopLevelWindows.GetCount() > 0) - return wxTopLevelWindows.GetFirst()->GetData(); - else - return (wxWindow *)NULL; - } + virtual wxWindow *GetTopWindow() const; // control the exit behaviour: by default, the program will exit the // main loop (and so, usually, terminate) when the last top-level @@ -468,10 +458,10 @@ public: // ------------------------------------------------------------------------ // Get display mode that is used use. This is only used in framebuffer - // wxWin ports (such as wxMGL). - virtual wxVideoMode GetDisplayMode() const { return wxVideoMode(); } + // wxWin ports (such as wxMGL or wxDFB). + virtual wxVideoMode GetDisplayMode() const; // Set display mode to use. This is only used in framebuffer wxWin - // ports (such as wxMGL). This method should be called from + // ports (such as wxMGL or wxDFB). This method should be called from // wxApp::OnInitGui virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; } @@ -503,10 +493,12 @@ public: // deactivated virtual void SetActive(bool isActive, wxWindow *lastFocus); +#if WXWIN_COMPATIBILITY_2_6 // OBSOLETE: don't use, always returns true // // returns true if the program is successfully initialized - bool Initialized() { return true; } + wxDEPRECATED( bool Initialized() ); +#endif // WXWIN_COMPATIBILITY_2_6 // perform standard OnIdle behaviour, ensure that this is always called void OnIdle(wxIdleEvent& event); @@ -549,6 +541,10 @@ protected: DECLARE_NO_COPY_CLASS(wxAppBase) }; +#if WXWIN_COMPATIBILITY_2_6 + inline bool wxAppBase::Initialized() { return true; } +#endif // WXWIN_COMPATIBILITY_2_6 + #endif // wxUSE_GUI // ---------------------------------------------------------------------------- @@ -564,6 +560,8 @@ protected: #include "wx/motif/app.h" #elif defined(__WXMGL__) #include "wx/mgl/app.h" + #elif defined(__WXDFB__) + #include "wx/dfb/app.h" #elif defined(__WXGTK20__) #include "wx/gtk/app.h" #elif defined(__WXGTK__) @@ -595,7 +593,7 @@ protected: // // the cast is safe as in GUI build we only use wxApp, not wxAppConsole, and in // console mode it does nothing at all -#define wxTheApp ((wxApp *)wxApp::GetInstance()) +#define wxTheApp wx_static_cast(wxApp*, wxApp::GetInstance()) // ---------------------------------------------------------------------------- // global functions @@ -662,7 +660,7 @@ public: wxAppInitializer \ wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \ DECLARE_APP(appname) \ - appname& wxGetApp() { return *(appname *)wxTheApp; } + appname& wxGetApp() { return *wx_static_cast(appname*, wxApp::GetInstance()); } // Same as IMPLEMENT_APP() normally but doesn't include themes support in // wxUniversal builds @@ -694,4 +692,3 @@ extern wxAppConsole *wxCreateApp(); extern wxAppInitializer wxTheAppInitializer; #endif // _WX_APP_H_BASE_ -