From: Vadim Zeitlin Date: Thu, 9 Mar 2006 13:36:53 +0000 (+0000) Subject: moved wxapp_install_idle_handler and g_isIdle from many cpp files into gtk/private... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/848332140be2d53aea32d0702f4c0e06c149d24b moved wxapp_install_idle_handler and g_isIdle from many cpp files into gtk/private.h (patch 1435529) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index b754ea5178..4c6be9b94e 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -53,6 +53,17 @@ void gtk_window_set_policy (GtkWindow *window, G_END_DECLS +//----------------------------------------------------------------------------- +// idle system +//----------------------------------------------------------------------------- + +extern void wxapp_install_idle_handler(); +extern bool g_isIdle; + +//----------------------------------------------------------------------------- +// GTK+ scroll types -> wxEventType +//----------------------------------------------------------------------------- + // translate a GTK+ scroll type to a wxEventType inline wxEventType GtkScrollTypeToWx(guint scrollType) { @@ -89,6 +100,11 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType) wxEVT_SCROLLWIN_TOP - wxEVT_SCROLL_TOP; } + +//----------------------------------------------------------------------------- +// Misc. functions +//----------------------------------------------------------------------------- + // Needed for implementing e.g. combobox on wxGTK within a modal dialog. void wxAddGrab(wxWindow* window); void wxRemoveGrab(wxWindow* window); diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 9f3abf88b9..1614d6c5f5 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -74,6 +74,7 @@ #include "wx/unix/private.h" #include "wx/gtk/win_gtk.h" +#include "wx/gtk/private.h" #include @@ -90,8 +91,6 @@ static GtkWidget *gs_RootWindow = (GtkWidget*) NULL; // idle system //----------------------------------------------------------------------------- -extern bool g_isIdle; - void wxapp_install_idle_handler(); #if wxUSE_THREADS diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index 4930087382..eab91a19de 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -24,13 +24,6 @@ class wxBitmapButton; -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 89271ac2b4..e7d67d6e92 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -26,13 +26,6 @@ class wxButton; -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index 09a67f104b..4dd5333334 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -18,13 +18,6 @@ #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 7d0df1ca0d..78ea983c3c 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -24,13 +24,6 @@ #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index b5f70f7a9e..467a6ce586 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -28,13 +28,6 @@ #endif #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index cac9e5aaba..d9c765244e 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -14,16 +14,11 @@ #include "wx/utils.h" #include "wx/app.h" +#include "wx/gtk/private.h" //for idle stuff + #include #include -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // wxCursor //----------------------------------------------------------------------------- diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 49f1ea2c97..5239bad72f 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -37,13 +37,6 @@ class wxDataViewCtrl; -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 537dbd8b8c..884ad11f27 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -29,13 +29,6 @@ #include #include -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //---------------------------------------------------------------------------- // global data //---------------------------------------------------------------------------- diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index 6480cbe651..407c6798c6 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -25,13 +25,6 @@ #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // "delete_event" //----------------------------------------------------------------------------- diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index d0ade77e6d..e35a025f7a 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -48,13 +48,6 @@ const int wxSTATUS_HEIGHT = 25; const int wxPLACE_HOLDER = 0; -// ---------------------------------------------------------------------------- -// idle system -// ---------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - // ---------------------------------------------------------------------------- // event tables // ---------------------------------------------------------------------------- diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index 7e2e6e7463..cc6f93546f 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -45,12 +45,6 @@ int wxGLCanvas::m_glxVersion = 0; //--------------------------------------------------------------------------- XVisualInfo *g_vi = (XVisualInfo*) NULL; -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; //--------------------------------------------------------------------------- // wxGLContext diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 754e6dad26..9846b5d02f 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -43,12 +43,6 @@ extern bool g_blockEventsOnScroll; extern wxCursor g_globalCursor; -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; //----------------------------------------------------------------------------- // Macro to tell which row the strings are in (1 if native checklist, 0 if not) diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 92604075e1..f793871ed4 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -31,13 +31,6 @@ const int wxMENU_HEIGHT = 27; -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // globals //----------------------------------------------------------------------------- diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 28fa85d2fc..470e3b87ba 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -48,9 +48,6 @@ static const int wxGTK_TITLE_ID = -3; // idle system //----------------------------------------------------------------------------- -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - #if wxUSE_ACCEL static wxString GetGtkHotKey( const wxMenuItem& item ); #endif diff --git a/src/gtk/minifram.cpp b/src/gtk/minifram.cpp index 48acb9a499..f209407663 100644 --- a/src/gtk/minifram.cpp +++ b/src/gtk/minifram.cpp @@ -24,13 +24,6 @@ #include #include -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 55d9558f67..25785835a2 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -42,13 +42,6 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index 91ed9b009b..f721ea4405 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -21,15 +21,9 @@ #include #include +#include "wx/gtk/private.h" //for idle stuff #include "wx/gtk/win_gtk.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // "button_press" //----------------------------------------------------------------------------- diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index ae6caf1937..686e8979ae 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -23,13 +23,6 @@ #include "wx/gtk/win_gtk.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp index 028a84cc8e..cf56a75187 100644 --- a/src/gtk/radiobut.cpp +++ b/src/gtk/radiobut.cpp @@ -16,13 +16,6 @@ #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index 3a44d755f0..4319b39407 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -18,13 +18,6 @@ #include "wx/math.h" #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index 0f590126f3..bcaacf7a73 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -18,13 +18,6 @@ #include "wx/math.h" #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp index 578c98ee77..52efbc9d4f 100644 --- a/src/gtk/spinbutt.cpp +++ b/src/gtk/spinbutt.cpp @@ -19,13 +19,6 @@ #include "wx/math.h" #include "wx/gtk/private.h" -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index fc1227c39a..229f6fdf49 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -25,9 +25,6 @@ // idle system //----------------------------------------------------------------------------- -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - static const float sensitivity = 0.02; //----------------------------------------------------------------------------- diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index 70de9fd33d..ee9725a088 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -38,10 +38,6 @@ // globals // ---------------------------------------------------------------------------- -// idle system -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - // data extern bool g_blockEventsOnDrag; extern wxCursor g_globalCursor; diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index d36c312925..d4e61f72ef 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -28,13 +28,6 @@ #include "wx/gtk/private.h" #include -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 722d7f9659..9b9d064259 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -26,8 +26,6 @@ #include "wx/gtk/private.h" -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; extern bool g_blockEventsOnDrag; extern wxCursor g_globalCursor; diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 0a7d9739ad..42eb2ca350 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -48,13 +48,6 @@ // XA_CARDINAL #include -// ---------------------------------------------------------------------------- -// idle system -// ---------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - // ---------------------------------------------------------------------------- // data // ---------------------------------------------------------------------------- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index ae474682b5..b54d7239f1 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -282,13 +282,6 @@ gdk_window_warp_pointer (GdkWindow *window, } } -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // local code (see below) //-----------------------------------------------------------------------------