From 32d4c30a13f65b7c8cb66f813a0b8c606ad8480b Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 21 Apr 2006 10:33:01 +0000 Subject: [PATCH] Include wx/hash.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/fontutil.cpp | 24 +++++++++--------- src/common/hash.cpp | 3 +-- src/common/image.cpp | 4 +-- src/common/imagpcx.cpp | 3 +-- src/common/mediactrlcmn.cpp | 32 +++++++++++------------- src/common/module.cpp | 10 +++++--- src/generic/dirctrlg.cpp | 19 ++++++++------ src/mgl/fontutil.cpp | 5 +++- src/motif/app.cpp | 5 +++- src/motif/window.cpp | 8 ++++-- src/unix/fontutil.cpp | 2 +- src/x11/app.cpp | 5 +++- src/x11/evtloop.cpp | 50 +++++++++++++++++++++---------------- src/x11/window.cpp | 7 ++++-- 14 files changed, 99 insertions(+), 78 deletions(-) diff --git a/src/cocoa/fontutil.cpp b/src/cocoa/fontutil.cpp index 3c184f4aef..dbb6d544aa 100644 --- a/src/cocoa/fontutil.cpp +++ b/src/cocoa/fontutil.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: unix/fontutil.cpp +// Name: src/cocoa/fontutil.cpp // Purpose: Font helper functions for X11 (GDK/X) // Author: Vadim Zeitlin // Modified by: @@ -25,12 +25,12 @@ #endif #ifndef WX_PRECOMP + #include "wx/hash.h" #endif // PCH #include "wx/fontutil.h" #include "wx/fontmap.h" #include "wx/tokenzr.h" -#include "wx/hash.h" #include "wx/module.h" #include "wx/encinfo.h" @@ -68,7 +68,7 @@ wxFontStyle wxNativeFontInfo::GetStyle() const m_style = wxFONTSTYLE_SLANT; break; } - + return m_style; } @@ -97,19 +97,19 @@ wxFontWeight wxNativeFontInfo::GetWeight() const m_weight = wxFONTWEIGHT_BOLD; break; } - + return m_weight; } bool wxNativeFontInfo::GetUnderlined() const { - return FALSE; + return false; } wxString wxNativeFontInfo::GetFaceName() const { wxString tmp = wxGTK_CONV_BACK( pango_font_description_get_family( description ) ); - + return tmp; } @@ -129,7 +129,7 @@ wxFontEncoding wxNativeFontInfo::GetEncoding() const bool wxNativeEncodingInfo::FromString(const wxString& s) { - return FALSE; + return false; } wxString wxNativeEncodingInfo::ToString() const @@ -139,16 +139,16 @@ wxString wxNativeEncodingInfo::ToString() const bool wxTestFontEncoding(const wxNativeEncodingInfo& info) { - return TRUE; + return true; } bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - return FALSE; + return false; } -#else +#else // __WXGTK20__ #ifdef __X__ @@ -211,7 +211,7 @@ return wxEmptyString; bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - return FALSE; + return false; } bool wxTestFontEncoding(const wxNativeEncodingInfo& info) @@ -243,7 +243,7 @@ bool wxFontModule::OnInit() { g_fontHash = new wxHashTable( wxKEY_STRING ); - return TRUE; + return true; } void wxFontModule::OnExit() diff --git a/src/common/hash.cpp b/src/common/hash.cpp index 7c9ea3da69..9a538b0fd9 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp @@ -26,10 +26,9 @@ #ifndef WX_PRECOMP #include "wx/list.h" + #include "wx/hash.h" #endif -#include "wx/hash.h" - #if wxUSE_OLD_HASH_TABLE #include diff --git a/src/common/image.cpp b/src/common/image.cpp index af8111c5c7..9ce814f683 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -19,6 +19,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/app.h" + #include "wx/hash.h" #endif #include "wx/image.h" @@ -28,12 +29,11 @@ #include "wx/wfstream.h" #include "wx/intl.h" #include "wx/module.h" -#include "wx/hash.h" #include "wx/utils.h" #include "wx/math.h" #if wxUSE_XPM -#include "wx/xpmdecod.h" + #include "wx/xpmdecod.h" #endif // For memcpy diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index 0581f926fc..91167781f9 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -23,14 +23,13 @@ #include "wx/log.h" #include "wx/intl.h" #include "wx/palette.h" + #include "wx/hash.h" #endif #include "wx/imagpcx.h" #include "wx/wfstream.h" #include "wx/module.h" -#include "wx/hash.h" - //----------------------------------------------------------------------------- // wxPCXHandler //----------------------------------------------------------------------------- diff --git a/src/common/mediactrlcmn.cpp b/src/common/mediactrlcmn.cpp index f6f33c8b05..2563d85a8f 100644 --- a/src/common/mediactrlcmn.cpp +++ b/src/common/mediactrlcmn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/mediactrl.cpp +// Name: src/common/mediactrl.cpp // Purpose: wxMediaCtrl common code // Author: Ryan Norton // Modified by: @@ -22,19 +22,19 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop +#endif + +#if wxUSE_MEDIACTRL + +#ifndef WX_PRECOMP + #include "wx/hash.h" #endif //--------------------------------------------------------------------------- // Includes //--------------------------------------------------------------------------- #include "wx/mediactrl.h" -#include "wx/hash.h" - -//--------------------------------------------------------------------------- -// Compilation guard -//--------------------------------------------------------------------------- -#if wxUSE_MEDIACTRL //=========================================================================== // @@ -417,21 +417,21 @@ wxSize wxMediaCtrl::DoGetBestSize() const return wxSize(0,0); } -double wxMediaCtrl::GetVolume() +double wxMediaCtrl::GetVolume() { if(m_imp && m_bLoaded) return m_imp->GetVolume(); return 0.0; } -bool wxMediaCtrl::SetVolume(double dVolume) +bool wxMediaCtrl::SetVolume(double dVolume) { if(m_imp && m_bLoaded) return m_imp->SetVolume(dVolume); return false; } -bool wxMediaCtrl::ShowPlayerControls(wxMediaCtrlPlayerControls flags) +bool wxMediaCtrl::ShowPlayerControls(wxMediaCtrlPlayerControls flags) { if(m_imp) return m_imp->ShowPlayerControls(flags); @@ -475,9 +475,9 @@ void wxMediaCtrl::DoMoveWindow(int x, int y, int w, int h) void wxMediaCtrl::MacVisibilityChanged() { wxControl::MacVisibilityChanged(); - + if(m_imp) - m_imp->MacVisibilityChanged(); + m_imp->MacVisibilityChanged(); } #endif @@ -555,9 +555,5 @@ FORCE_LINK(wxmediabackend_wmp10) #else FORCE_LINK(basewxmediabackends) #endif -//--------------------------------------------------------------------------- -// End of compilation guard and of file -//--------------------------------------------------------------------------- -#endif //wxUSE_MEDIACTRL - +#endif //wxUSE_MEDIACTRL diff --git a/src/common/module.cpp b/src/common/module.cpp index 2d5df44954..e4eb228f23 100644 --- a/src/common/module.cpp +++ b/src/common/module.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: module.cpp +// Name: src/common/module.cpp // Purpose: Modules initialization/destruction // Author: Wolfram Gloger/adapted by Guilhem Lavaux // Modified by: @@ -13,11 +13,14 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/hash.h" #endif #include "wx/module.h" -#include "wx/hash.h" #include "wx/intl.h" #include "wx/log.h" #include "wx/listimpl.cpp" @@ -104,4 +107,3 @@ void wxModule::CleanUpModules() WX_CLEAR_LIST(wxModuleList, m_modules); } - diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index b631aa69cd..159b5eadfc 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -13,11 +13,15 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_DIRDLG || wxUSE_FILEDLG +#ifndef WX_PRECOMP + #include "wx/hash.h" +#endif + #include "wx/generic/dirctrlg.h" #include "wx/module.h" #include "wx/utils.h" @@ -38,7 +42,6 @@ #include "wx/dir.h" #include "wx/settings.h" #include "wx/artprov.h" -#include "wx/hash.h" #include "wx/mimetype.h" #include "wx/image.h" #include "wx/choice.h" @@ -48,7 +51,7 @@ #endif #if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers + #include "wx/mac/private.h" // includes mac headers #endif #ifdef __WXMSW__ @@ -60,10 +63,10 @@ // accordingly. #if !defined(__GNUWIN32__) || (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1) #if !defined(__WXWINCE__) - #include + #include #endif - #include - #include + #include + #include #endif #endif @@ -82,11 +85,11 @@ #endif // __OS2__ #if defined(__WXMAC__) -# include "MoreFilesX.h" + #include "MoreFilesX.h" #endif #ifdef __BORLANDC__ -#include "dos.h" + #include "dos.h" #endif // If compiled under Windows, this macro can cause problems diff --git a/src/mgl/fontutil.cpp b/src/mgl/fontutil.cpp index eeb232e87a..f096ee1547 100644 --- a/src/mgl/fontutil.cpp +++ b/src/mgl/fontutil.cpp @@ -15,12 +15,15 @@ #pragma hdrstop #endif +#ifndef WX_PRECOMP + #include "wx/hash.h" +#endif + #include "wx/log.h" #include "wx/fontutil.h" #include "wx/encinfo.h" #include "wx/fontmap.h" #include "wx/tokenzr.h" -#include "wx/hash.h" #include "wx/listimpl.cpp" #include "wx/sysopt.h" diff --git a/src/motif/app.cpp b/src/motif/app.cpp index d6c6206c93..593f0743bf 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -17,6 +17,10 @@ #define XtDisplay XTDISPLAY #endif +#ifndef WX_PRECOMP + #include "wx/hash.h" +#endif + #include "wx/app.h" #include "wx/utils.h" #include "wx/module.h" @@ -24,7 +28,6 @@ #include "wx/log.h" #include "wx/intl.h" #include "wx/evtloop.h" -#include "wx/hash.h" #if wxUSE_THREADS #include "wx/thread.h" diff --git a/src/motif/window.cpp b/src/motif/window.cpp index e553ef1ef2..5d312ff4ac 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -26,6 +26,10 @@ #define XtScreen XTSCREEN #endif +#ifndef WX_PRECOMP + #include "wx/hash.h" +#endif + #include "wx/menu.h" #include "wx/dc.h" #include "wx/dcclient.h" @@ -40,7 +44,6 @@ #include "wx/menuitem.h" #include "wx/log.h" #include "wx/evtloop.h" -#include "wx/hash.h" #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" @@ -1246,7 +1249,8 @@ void wxWindow::DoSetSizeIntr(int x, int y, int width, int height, int sizeFlags, bool fromCtor) { // A bit of optimization to help sort out the flickers. - int oldX = -1, oldY = -1, oldW = -1, oldH = -1; + int oldX = oldY = oldW = oldH = -1; + if( !fromCtor ) { GetSize(& oldW, & oldH); diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 80d01451cb..5230c5a09e 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -27,12 +27,12 @@ #ifndef WX_PRECOMP #include "wx/font.h" // wxFont enums #include "wx/encinfo.h" + #include "wx/hash.h" #endif // PCH #include "wx/fontutil.h" #include "wx/fontmap.h" #include "wx/tokenzr.h" -#include "wx/hash.h" #include "wx/module.h" #if wxUSE_PANGO diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 86d6447c63..7f7cbe93c0 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -12,6 +12,10 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#ifndef WX_PRECOMP + #include "wx/hash.h" +#endif + #include "wx/frame.h" #include "wx/app.h" #include "wx/utils.h" @@ -26,7 +30,6 @@ #include "wx/evtloop.h" #include "wx/timer.h" #include "wx/filename.h" -#include "wx/hash.h" #include "wx/univ/theme.h" #include "wx/univ/renderer.h" diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index 408d6fee34..85b83d8880 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: x11/evtloop.cpp +// Name: src/x11/evtloop.cpp // Purpose: implements wxEventLoop for X11 // Author: Julian Smart // Modified by: @@ -17,20 +17,27 @@ // headers // ---------------------------------------------------------------------------- +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/hash.h" +#endif + #include "wx/window.h" #include "wx/app.h" #include "wx/evtloop.h" #include "wx/tooltip.h" -#if wxUSE_THREADS -#include "wx/thread.h" -#endif #include "wx/timer.h" -#include "wx/hash.h" #include "wx/module.h" #include "wx/unix/private.h" #include "wx/x11/private.h" #include "X11/Xlib.h" +#if wxUSE_THREADS + #include "wx/thread.h" +#endif + #include #include @@ -159,10 +166,10 @@ bool wxSocketTable::CallCallback(int fd, wxSocketTableType socketType) (entry->m_callbackOutput) (entry->m_fdOutput, entry->m_dataOutput); } } - return TRUE; + return true; } else - return FALSE; + return false; } void wxSocketTable::FillSets(fd_set* readset, fd_set* writeset, int* highest) @@ -220,7 +227,7 @@ class wxSocketTableModule: public wxModule DECLARE_DYNAMIC_CLASS(wxSocketTableModule) public: wxSocketTableModule() {} - bool OnInit() { wxTheSocketTable = new wxSocketTable; return TRUE; }; + bool OnInit() { wxTheSocketTable = new wxSocketTable; return true; }; void OnExit() { delete wxTheSocketTable; wxTheSocketTable = NULL; }; }; @@ -254,12 +261,12 @@ class WXDLLEXPORT wxEventLoopImpl { public: // ctor - wxEventLoopImpl() { SetExitCode(0); m_keepGoing = FALSE; } + wxEventLoopImpl() { SetExitCode(0); m_keepGoing = false; } - // process an XEvent, return TRUE if it was processed + // process an XEvent, return true if it was processed bool ProcessEvent(XEvent* event); - // generate an idle message, return TRUE if more idle time requested + // generate an idle message, return true if more idle time requested bool SendIdleEvent(); // set/get the exit code @@ -267,7 +274,7 @@ public: int GetExitCode() const { return m_exitcode; } public: - // preprocess an event, return TRUE if processed (i.e. no further + // preprocess an event, return true if processed (i.e. no further // dispatching required) bool PreProcessEvent(XEvent* event); @@ -289,13 +296,13 @@ bool wxEventLoopImpl::ProcessEvent(XEvent *event) { // give us the chance to preprocess the message first if ( PreProcessEvent(event) ) - return TRUE; + return true; // if it wasn't done, dispatch it to the corresponding window if (wxTheApp) return wxTheApp->ProcessXEvent((WXEvent*) event); - return FALSE; + return false; } bool wxEventLoopImpl::PreProcessEvent(XEvent *event) @@ -312,18 +319,18 @@ bool wxEventLoopImpl::PreProcessEvent(XEvent *event) for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) { if ( wnd->MSWTranslateMessage((WXMSG *)msg) ) - return TRUE; + return true; } // Anyone for a non-translation message? Try youngest descendants first. for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) { if ( wnd->MSWProcessMessage((WXMSG *)msg) ) - return TRUE; + return true; } #endif - return FALSE; + return false; } // ---------------------------------------------------------------------------- @@ -357,7 +364,7 @@ int wxEventLoop::Run() wxEventLoopActivator activate(this); - m_impl->m_keepGoing = TRUE; + m_impl->m_keepGoing = true; while ( m_impl->m_keepGoing ) { #if 0 // wxUSE_THREADS @@ -405,7 +412,7 @@ void wxEventLoop::Exit(int rc) wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); m_impl->SetExitCode(rc); - m_impl->m_keepGoing = FALSE; + m_impl->m_keepGoing = false; } // ---------------------------------------------------------------------------- @@ -464,7 +471,7 @@ bool wxEventLoop::Dispatch() if (select( highest+1, &readset, &writeset, NULL, &tv ) == 0) { // Timed out, so no event to process - return TRUE; + return true; } else { @@ -488,6 +495,5 @@ bool wxEventLoop::Dispatch() (void) m_impl->ProcessEvent( &event ); - return TRUE; + return true; } - diff --git a/src/x11/window.cpp b/src/x11/window.cpp index c2021f0162..6409d158f5 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -13,7 +13,11 @@ #include "wx/wxprec.h" #if defined(__BORLANDC__) -#pragma hdrstop + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/hash.h" #endif // ============================================================================ @@ -44,7 +48,6 @@ #include "wx/log.h" #include "wx/fontutil.h" #include "wx/univ/renderer.h" -#include "wx/hash.h" #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" -- 2.47.2