From 3c029873c66cfdc0dcbf52958970273435ba02fc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 11 Jul 2007 00:00:33 +0000 Subject: [PATCH] check for wxUSE_TIMER in headers, not the files including them git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/private/timer.h | 5 ++++- include/wx/gtk/private/timer.h | 4 ++++ include/wx/unix/private/timer.h | 4 ++++ src/gtk/utilsgtk.cpp | 6 +++++- src/unix/baseunix.cpp | 4 +--- src/unix/evtloopunix.cpp | 4 +--- src/unix/utilsx11.cpp | 8 +++++--- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/include/wx/generic/private/timer.h b/include/wx/generic/private/timer.h index 9db8f41489..fcf598d1da 100644 --- a/include/wx/generic/private/timer.h +++ b/include/wx/generic/private/timer.h @@ -7,10 +7,11 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - #ifndef _WX_GENERIC_PRIVATE_TIMER_H_ #define _WX_GENERIC_PRIVATE_TIMER_H_ +#if wxUSE_TIMER + #include "wx/private/timer.h" //----------------------------------------------------------------------------- @@ -40,4 +41,6 @@ private: wxTimerDesc *m_desc; }; +#endif // wxUSE_TIMER + #endif // _WX_GENERIC_PRIVATE_TIMER_H_ diff --git a/include/wx/gtk/private/timer.h b/include/wx/gtk/private/timer.h index 2753541ef6..53d51fc9d5 100644 --- a/include/wx/gtk/private/timer.h +++ b/include/wx/gtk/private/timer.h @@ -10,6 +10,8 @@ #ifndef _WX_GTK_PRIVATE_TIMER_H_ #define _WX_GTK_PRIVATE_TIMER_H_ +#if wxUSE_TIMER + #include "wx/private/timer.h" //----------------------------------------------------------------------------- @@ -29,4 +31,6 @@ protected: int m_sourceId; }; +#endif // wxUSE_TIMER + #endif // _WX_GTK_PRIVATE_TIMER_H_ diff --git a/include/wx/unix/private/timer.h b/include/wx/unix/private/timer.h index 17776738c9..535ba7db95 100644 --- a/include/wx/unix/private/timer.h +++ b/include/wx/unix/private/timer.h @@ -11,6 +11,8 @@ #ifndef _WX_UNIX_PRIVATE_TIMER_H_ #define _WX_UNIX_PRIVATE_TIMER_H_ +#if wxUSE_TIMER + #include "wx/private/timer.h" // the type used for milliseconds is large enough for microseconds too but @@ -135,4 +137,6 @@ private: // returns the number of microseconds since the Epoch extern wxUsecClock_t wxGetLocalTimeUsec(); +#endif // wxUSE_TIMER + #endif // _WX_UNIX_PRIVATE_TIMER_H_ diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index 445a5f3bb7..6b3e1751a2 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -312,11 +312,15 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const return wxPORT_GTK; } +#if wxUSE_TIMER + wxTimerImpl *wxGUIAppTraits::CreateTimerImpl(wxTimer *timer) { return new wxGTKTimerImpl(timer); } +#endif // wxUSE_TIMER + #if wxUSE_DETECT_SM static wxString GetSM() { @@ -483,9 +487,9 @@ bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg) wxString wxGUIAppTraits::GetDesktopEnvironment() const { wxString de = wxSystemOptions::GetOption(_T("gtk.desktop")); +#if wxUSE_DETECT_SM if ( de.empty() ) { -#if wxUSE_DETECT_SM static const wxString s_SM = GetSM(); if (s_SM == wxT("GnomeSM")) diff --git a/src/unix/baseunix.cpp b/src/unix/baseunix.cpp index fb2bdf58ba..9773a110a5 100644 --- a/src/unix/baseunix.cpp +++ b/src/unix/baseunix.cpp @@ -34,9 +34,7 @@ #include "wx/unix/execute.h" #include "wx/evtloop.h" -#if wxUSE_TIMER - #include "wx/unix/private/timer.h" -#endif // wxUSE_TIMER +#include "wx/unix/private/timer.h" // for waitpid() #include diff --git a/src/unix/evtloopunix.cpp b/src/unix/evtloopunix.cpp index ff12e32638..34dd79ab9b 100644 --- a/src/unix/evtloopunix.cpp +++ b/src/unix/evtloopunix.cpp @@ -32,9 +32,7 @@ #include "wx/unix/private/epolldispatcher.h" #include "wx/private/selectdispatcher.h" -#if wxUSE_TIMER - #include "wx/generic/private/timer.h" -#endif +#include "wx/generic/private/timer.h" #define TRACE_EVENTS _T("events") diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index 67e641c3cb..51736ee332 100644 --- a/src/unix/utilsx11.cpp +++ b/src/unix/utilsx11.cpp @@ -41,7 +41,6 @@ #endif // Various X11 Atoms used in this file: -static Atom _NET_WM_ICON = 0; static Atom _NET_WM_STATE = 0; static Atom _NET_WM_STATE_FULLSCREEN = 0; static Atom _NET_WM_STATE_STAYS_ON_TOP = 0; @@ -106,10 +105,13 @@ private: // Setting icons for window manager: // ---------------------------------------------------------------------------- +#if wxUSE_IMAGE && !wxUSE_NANOX + +static Atom _NET_WM_ICON = 0; + void wxSetIconsX11(WXDisplay* display, WXWindow window, const wxIconBundle& ib) { -#if !wxUSE_NANOX size_t size = 0; const size_t numIcons = ib.GetIconCount(); @@ -184,9 +186,9 @@ wxSetIconsX11(WXDisplay* display, WXWindow window, const wxIconBundle& ib) WindowCast(window), _NET_WM_ICON ); } -#endif // !wxUSE_NANOX } +#endif // wxUSE_IMAGE && !wxUSE_NANOX // ---------------------------------------------------------------------------- // Fullscreen mode: -- 2.45.2