#include <hildon-widgets/hildon-program.h>
#endif // wxUSE_LIBHILDON
+#if wxUSE_LIBHILDON2
+ #include <hildon/hildon.h>
+#endif // wxUSE_LIBHILDON2
+
#include <gdk/gdkx.h>
//-----------------------------------------------------------------------------
id_save = m_idleSourceId;
m_idleSourceId = 0;
wx_add_idle_hooks();
-#ifdef __WXDEBUG__
+
+#if wxDEBUG_LEVEL
// don't generate the idle events while the assert modal dialog is shown,
// this matches the behavior of wxMSW
if (m_isInAssert)
gdk_threads_enter();
bool needMore;
do {
+ ProcessPendingEvents();
+
needMore = ProcessIdle();
} while (needMore && gtk_events_pending() == 0);
gdk_threads_leave();
wxApp::wxApp()
{
-#ifdef __WXDEBUG__
m_isInAssert = false;
-#endif // __WXDEBUG__
+
#if wxUSE_THREADS
m_idleMutex = NULL;
#endif
}
}
-#if wxUSE_LIBHILDON
- m_hildonProgram = hildon_program_get_instance();
- if ( !m_hildonProgram )
+#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
+ if ( !GetHildonProgram() )
{
wxLogError(_("Unable to initialize Hildon program"));
return false;
}
-#endif // wxUSE_LIBHILDON
+#endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2
return true;
}
// (1) this variable exists for the sole purpose of specifying the encoding
// of the filenames for GTK+ programs, so use it if it is set
- wxString encName(wxGetenv(_T("G_FILENAME_ENCODING")));
- encName = encName.BeforeFirst(_T(','));
- if (encName.CmpNoCase(_T("@locale")) == 0)
+ wxString encName(wxGetenv(wxT("G_FILENAME_ENCODING")));
+ encName = encName.BeforeFirst(wxT(','));
+ if (encName.CmpNoCase(wxT("@locale")) == 0)
encName.clear();
encName.MakeUpper();
#if wxUSE_INTL
// filenames in this locale too
encName = wxLocale::GetSystemEncodingName().Upper();
// (3) finally use UTF-8 by default
- if (encName.empty() || encName == _T("US-ASCII"))
- encName = _T("UTF-8");
- wxSetEnv(_T("G_FILENAME_ENCODING"), encName);
+ if (encName.empty() || encName == wxT("US-ASCII"))
+ encName = wxT("UTF-8");
+ wxSetEnv(wxT("G_FILENAME_ENCODING"), encName);
}
#else
if (encName.empty())
- encName = _T("UTF-8");
+ encName = wxT("UTF-8");
// if wxUSE_INTL==0 it probably indicates that only "C" locale is supported
// by the program anyhow so prevent GTK+ from calling setlocale(LC_ALL, "")
// we can not enter threads before gtk_init is done
gdk_threads_enter();
- wxSetDetectableAutoRepeat( true );
-
#if wxUSE_INTL
wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
#endif
return gtk_events_pending() != 0;
}
-#ifdef __WXDEBUG__
-
void wxApp::OnAssertFailure(const wxChar *file,
int line,
const wxChar* func,
const wxChar* cond,
const wxChar *msg)
{
-
+ // there is no need to do anything if asserts are disabled in this build
+ // anyhow
+#if wxDEBUG_LEVEL
// block wx idle events while assert dialog is showing
m_isInAssert = true;
wxAppBase::OnAssertFailure(file, line, func, cond, msg);
m_isInAssert = false;
+#else // !wxDEBUG_LEVEL
+ wxUnusedVar(file);
+ wxUnusedVar(line);
+ wxUnusedVar(func);
+ wxUnusedVar(cond);
+ wxUnusedVar(msg);
+#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
}
-#endif // __WXDEBUG__
-
#if wxUSE_THREADS
void wxGUIAppTraits::MutexGuiEnter()
{
gdk_threads_leave();
}
#endif // wxUSE_THREADS
+
+#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
+// Maemo-specific method: get the main program object
+HildonProgram *wxApp::GetHildonProgram()
+{
+ return hildon_program_get_instance();
+}
+
+#endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2