X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e711d5c093dcc758e3f1670caf845612ea9fa92..b1d66b5415f7befb45e050d7097571642b8bfa56:/include/wx/app.h diff --git a/include/wx/app.h b/include/wx/app.h index 36e9e19790..4e562c5968 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -54,6 +54,32 @@ class WXDLLEXPORT wxCmdLineParser; static const int wxPRINT_WINDOWS = 1; static const int wxPRINT_POSTSCRIPT = 2; +// ---------------------------------------------------------------------------- +// support for framebuffer ports +// ---------------------------------------------------------------------------- + +#if wxUSE_GUI +// VS: Fullscreen/framebuffer application needs to choose display mode prior +// to wxWindows initialization. This class holds information about display +// mode. It is used by wxApp::Set/GetDisplayMode. +class WXDLLEXPORT wxDisplayModeInfo +{ +public: + wxDisplayModeInfo() : m_ok(FALSE) {} + wxDisplayModeInfo(unsigned width, unsigned height, unsigned depth) + : m_width(width), m_height(height), m_depth(depth), m_ok(TRUE) {} + + unsigned GetWidth() const { return m_width; } + unsigned GetHeight() const { return m_height; } + unsigned GetDepth() const { return m_depth; } + bool IsOk() const { return m_ok; } + +private: + unsigned m_width, m_height, m_depth; + bool m_ok; +}; +#endif + // ---------------------------------------------------------------------------- // the common part of wxApp implementations for all platforms // ---------------------------------------------------------------------------- @@ -65,9 +91,6 @@ public: // the virtual functions which may/must be overridden in the derived class // ----------------------------------------------------------------------- -#ifdef __DARWIN__ - virtual ~wxAppBase() { } -#endif // called during the program initialization, returning FALSE from here // prevents the program from continuing - it's a good place to create @@ -135,6 +158,17 @@ public: // process the first event in the event queue (blocks until an event // apperas if there are none currently) virtual void Dispatch() = 0; + + // process all currently pending events right now + // + // it is an error to call Yield() recursively unless the value of + // onlyIfNeeded is TRUE + // + // WARNING: this function is dangerous as it can lead to unexpected + // reentrancies (i.e. when called from an event handler it + // may result in calling the same event handler again), use + // with _extreme_ care or, better, don't use at all! + virtual bool Yield(bool onlyIfNeeded = FALSE) = 0; #endif // wxUSE_GUI // application info: name, description, vendor @@ -245,6 +279,13 @@ public: // wxICON_XXX values virtual wxIcon GetStdIcon(int which) const = 0; + // Get display mode that is used use. This is only used in framebuffer wxWin ports + // (such as wxMGL). + virtual wxDisplayModeInfo GetDisplayMode() const { return wxDisplayModeInfo(); } + // Set display mode to use. This is only used in framebuffer wxWin ports + // (such as wxMGL). This method should be called from wxApp:OnInitGui + virtual bool SetDisplayMode(const wxDisplayModeInfo& WXUNUSED(info)) { return TRUE; } + // VZ: what does this do exactly? void SetWantDebugOutput( bool flag ) { m_wantDebugOutput = flag; } bool GetWantDebugOutput() const { return m_wantDebugOutput; } @@ -285,6 +326,11 @@ public: static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; } + // needed to avoid link errors +#ifdef __DARWIN__ + virtual ~wxAppBase() { } +#endif + // process all events in the wxPendingEvents list virtual void ProcessPendingEvents();