X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6f5aa49cf93fc19c776bcce0a7872bdc9707afb..88594d02eb59a55ac85d3210a49d02918124617b:/src/gtk/app.cpp diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 38d4d1e75f..f5afdd777c 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -28,18 +28,20 @@ #include "wx/module.h" #include "wx/image.h" +#ifdef __WXUNIVERSAL__ + #include "wx/univ/theme.h" + #include "wx/univ/renderer.h" +#endif + #if wxUSE_THREADS #include "wx/thread.h" #endif #include +#include "wx/gtk/win_gtk.h" -#include -#include #include -#include -#include "wx/gtk/win_gtk.h" //----------------------------------------------------------------------------- // global data @@ -81,10 +83,21 @@ void wxExit() // wxYield //----------------------------------------------------------------------------- -static bool gs_inYield = FALSE; - -bool wxYield() +bool wxApp::Yield(bool onlyIfNeeded) { + // MT-FIXME + static bool s_inYield = FALSE; + + if ( s_inYield ) + { + if ( !onlyIfNeeded ) + { + wxFAIL_MSG( wxT("wxYield called recursively" ) ); + } + + return FALSE; + } + #if wxUSE_THREADS if ( !wxThread::IsMain() ) { @@ -93,19 +106,14 @@ bool wxYield() } #endif // wxUSE_THREADS -#ifdef __WXDEBUG__ - if (gs_inYield) - wxFAIL_MSG( wxT("wxYield called recursively" ) ); -#endif - - gs_inYield = TRUE; + s_inYield = TRUE; if (!g_isIdle) { // We need to remove idle callbacks or the loop will // never finish. - gtk_idle_remove( wxTheApp->m_idleTag ); - wxTheApp->m_idleTag = 0; + gtk_idle_remove( m_idleTag ); + m_idleTag = 0; g_isIdle = TRUE; } @@ -119,29 +127,18 @@ bool wxYield() /* it's necessary to call ProcessIdle() to update the frames sizes which might have been changed (it also will update other things set from OnUpdateUI() which is a nice (and desired) side effect) */ - while (wxTheApp->ProcessIdle()) { } + while ( ProcessIdle() ) + { + } // let the logs be flashed again wxLog::Resume(); - gs_inYield = FALSE; + s_inYield = FALSE; return TRUE; } -//----------------------------------------------------------------------------- -// wxYieldIfNeeded -// Like wxYield, but fails silently if the yield is recursive. -//----------------------------------------------------------------------------- - -bool wxYieldIfNeeded() -{ - if (gs_inYield) - return FALSE; - - return wxYield(); -} - //----------------------------------------------------------------------------- // wxWakeUpIdle //----------------------------------------------------------------------------- @@ -682,8 +679,8 @@ GtkWidget* wxGetRootWindow() // wxEntry //----------------------------------------------------------------------------- - -int wxEntryStart( int argc, char *argv[] ) +// NB: argc and argv may be changed here, pass by reference! +int wxEntryStart( int& argc, char *argv[] ) { #if wxUSE_THREADS /* GTK 1.2 up to version 1.2.3 has broken threads */ @@ -862,13 +859,14 @@ int wxEntry( int argc, char *argv[] ) return retValue; } +#ifndef __WXUNIVERSAL__ + #include "wx/gtk/info.xpm" #include "wx/gtk/error.xpm" #include "wx/gtk/question.xpm" #include "wx/gtk/warning.xpm" -wxIcon -wxApp::GetStdIcon(int which) const +wxIcon wxApp::GetStdIcon(int which) const { switch(which) { @@ -889,6 +887,13 @@ wxApp::GetStdIcon(int which) const return wxIcon(error_xpm); } } +#else +wxIcon wxApp::GetStdIcon(int which) const +{ + return wxTheme::Get()->GetRenderer()->GetStdIcon(which); +} +#endif // !__WXUNIVERSAL__ + #ifdef __WXDEBUG__