]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/app.cpp
Smooth Aqua buttons in wxTreeCtrl.
[wxWidgets.git] / src / gtk1 / app.cpp
index b27af26cf35b79205115caa4329c18d4d6eef085..0ef365ec055a62bd6ecd44daee068b277a3c089a 100644 (file)
 #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
@@ -78,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() )
     {
@@ -90,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;
     }
 
@@ -116,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
 //-----------------------------------------------------------------------------
@@ -859,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)
     {
@@ -886,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__