/////////////////////////////////////////////////////////////////////////////
-// Name: app.cpp
+// Name: src/gtk/app.cpp
// Purpose:
// Author: Robert Roebling
// Id: $Id$
#include "wx/wxprec.h"
#include "wx/app.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/utils.h"
+ #include "wx/dialog.h"
+ #include "wx/settings.h"
+ #include "wx/msgdlg.h"
+#endif
+
#include "wx/gdicmn.h"
-#include "wx/utils.h"
-#include "wx/intl.h"
-#include "wx/log.h"
#include "wx/memory.h"
#include "wx/font.h"
-#include "wx/settings.h"
-#include "wx/dialog.h"
-#include "wx/msgdlg.h"
#include "wx/file.h"
#include "wx/filename.h"
#include "wx/module.h"
#include "wx/thread.h"
#ifdef __WXGPE__
-#include <gpe/init.h>
+ #include <gpe/init.h>
#endif
#ifdef __WXUNIVERSAL__
#include "wx/univ/renderer.h"
#endif
-#if wxUSE_THREADS
- #include "wx/thread.h"
-#endif
-
#include <unistd.h>
#ifdef HAVE_POLL
#include "wx/gtk/win_gtk.h"
#include "wx/gtk/private.h"
-#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+
+//-----------------------------------------------------------------------------
+// link GnomeVFS
+//-----------------------------------------------------------------------------
+
+#if wxUSE_LIBGNOMEVFS
+#include "wx/html/forcelnk.h"
+FORCE_LINK(gnome_vfs)
+#endif
//-----------------------------------------------------------------------------
// global data
//-----------------------------------------------------------------------------
-bool g_mainThreadLocked = FALSE;
+bool g_mainThreadLocked = false;
gint g_pendingTag = 0;
static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
// not static because used by textctrl.cpp
//
// MT-FIXME
-bool wxIsInsideYield = FALSE;
+bool wxIsInsideYield = false;
bool wxApp::Yield(bool onlyIfNeeded)
{
wxFAIL_MSG( wxT("wxYield called recursively" ) );
}
- return FALSE;
+ return false;
}
#if wxUSE_THREADS
if ( !wxThread::IsMain() )
{
// can't call gtk_main_iteration() from other threads like this
- return TRUE;
+ return true;
}
#endif // wxUSE_THREADS
- wxIsInsideYield = TRUE;
+ wxIsInsideYield = true;
// We need to remove idle callbacks or the loop will
// never finish.
wxLog::Resume();
#endif
- wxIsInsideYield = FALSE;
+ wxIsInsideYield = false;
- return TRUE;
+ return true;
}
//-----------------------------------------------------------------------------
#if wxUSE_THREADS
wxMutexLocker lock(gs_idleTagsMutex);
#endif
- g_isIdle = TRUE;
+ g_isIdle = true;
wxTheApp->m_idleTag = 0;
}
gdk_threads_enter();
wxMutexGuiLeave();
- g_mainThreadLocked = TRUE;
+ g_mainThreadLocked = true;
// we rely on the fact that glib GPollFD struct is really just pollfd but
// I wonder how wise is this in the long term (VZ)
gint res = wxPoll( (wxPollFd *) ufds, nfds, timeout );
wxMutexGuiEnter();
- g_mainThreadLocked = FALSE;
+ g_mainThreadLocked = false;
gdk_threads_leave();
wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
- g_isIdle = FALSE;
+ g_isIdle = false;
if (g_pendingTag == 0)
g_pendingTag = g_idle_add_full( 900, wxapp_pending_callback, NULL, NULL );
wxApp::wxApp()
{
#ifdef __WXDEBUG__
- m_isInAssert = FALSE;
+ m_isInAssert = false;
#endif // __WXDEBUG__
m_idleTag = 0;
- g_isIdle = TRUE;
+ g_isIdle = true;
wxapp_install_idle_handler();
#if wxUSE_THREADS
bool wxApp::OnInitGui()
{
if ( !wxAppBase::OnInitGui() )
- return FALSE;
+ return false;
GdkVisual *visual = gdk_visual_get_system();
}
// Nothing to do for 15, 16, 24, 32 bit displays
- if (visual->depth > 8) return TRUE;
+ if (visual->depth > 8) return true;
// initialize color cube for 8-bit color reduction dithering
}
}
- return TRUE;
+ return true;
}
GdkVisual *wxApp::GetGdkVisual()
if (m_glVisualInfo)
visual = gdkx_visual_get( ((XVisualInfo *) m_glVisualInfo)->visualid );
else
- visual = gdk_window_get_visual( wxGetRootWindow()->window );
+ visual = gdk_drawable_get_visual( wxGetRootWindow()->window );
wxASSERT( visual );
bool init_result;
#if wxUSE_THREADS
- // GTK 1.2 up to version 1.2.3 has broken threads
- if ((gtk_major_version == 1) &&
- (gtk_minor_version == 2) &&
- (gtk_micro_version < 4))
- {
- printf( "wxWidgets warning: GUI threading disabled due to outdated GTK version\n" );
- }
- else
- {
- if (!g_thread_supported())
- g_thread_init(NULL);
- }
+ if (!g_thread_supported())
+ g_thread_init(NULL);
#endif // wxUSE_THREADS
gtk_set_locale();
return false;
}
- wxSetDetectableAutoRepeat( TRUE );
+ wxSetDetectableAutoRepeat( true );
#if wxUSE_INTL
wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg)
{
- m_isInAssert = TRUE;
+ m_isInAssert = true;
wxAppBase::OnAssert(file, line, cond, msg);
- m_isInAssert = FALSE;
+ m_isInAssert = false;
}
#endif // __WXDEBUG__
{
g_source_remove( wxTheApp->m_idleTag );
wxTheApp->m_idleTag = 0;
- g_isIdle = TRUE;
+ g_isIdle = true;
}
}