From df91131cb0f90ee8bfb194926a13b1a108ca3c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 24 Apr 2006 08:46:59 +0000 Subject: [PATCH] Include wx/string.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/display.mm | 8 ++++---- src/common/socket.cpp | 5 +++-- src/common/sysopt.cpp | 8 ++++---- src/common/url.cpp | 5 +++-- src/common/variant.cpp | 8 ++++++-- src/generic/notebook.cpp | 12 ++++++------ src/gtk/utilsgtk.cpp | 12 +++++++----- src/gtk/utilsres.cpp | 5 +++-- src/gtk1/utilsgtk.cpp | 12 +++++++----- src/gtk1/utilsres.cpp | 5 +++-- src/mac/carbon/accel.cpp | 9 +++++---- src/mac/carbon/cfsocket.cpp | 5 +++-- src/mac/carbon/display.cpp | 5 +++-- src/mac/carbon/font.cpp | 13 ++++++++----- src/mac/carbon/notebmac.cpp | 17 +++++++++++------ src/mac/carbon/sound.cpp | 5 +++-- src/mac/classic/accel.cpp | 7 +++++-- src/mac/classic/display.cpp | 5 +++-- src/mac/classic/font.cpp | 8 ++++++-- src/mac/classic/notebmac.cpp | 11 +++++++++-- src/mac/classic/sound.cpp | 6 +++--- src/mac/corefoundation/hid.cpp | 5 +++-- src/mgl/fontenum.cpp | 5 +++-- src/mgl/utils.cpp | 7 +++++-- src/motif/accel.cpp | 6 +++++- src/motif/font.cpp | 6 +++++- src/msdos/utilsdos.cpp | 15 +++++++++------ src/msw/dcclient.cpp | 12 +++++++----- src/msw/joystick.cpp | 8 ++++++-- src/msw/registry.cpp | 11 ++++++----- src/msw/urlmsw.cpp | 2 +- src/os2/dcclient.cpp | 16 +++++++++------- src/os2/dcprint.cpp | 13 +++++++------ src/os2/joystick.cpp | 11 +++++++---- src/palmos/dcclient.cpp | 10 ++++++---- src/palmos/joystick.cpp | 13 ++++++++----- src/unix/fontenum.cpp | 5 +++-- src/x11/font.cpp | 6 +++++- src/xrc/xh_statbar.cpp | 15 +++++++++------ 39 files changed, 209 insertions(+), 128 deletions(-) diff --git a/src/cocoa/display.mm b/src/cocoa/display.mm index f1d7739174..0694473028 100644 --- a/src/cocoa/display.mm +++ b/src/cocoa/display.mm @@ -18,14 +18,15 @@ #if wxUSE_DISPLAY +#include "wx/display.h" + #ifndef WX_PRECOMP - #include "wx/dynarray.h" + #include "wx/dynarray.h" + #include "wx/string.h" #endif -#include "wx/display.h" #include "wx/display_impl.h" #include "wx/gdicmn.h" -#include "wx/string.h" #import @@ -226,4 +227,3 @@ bool wxDisplayImplMacOSX::ChangeMode(const wxVideoMode& mode) } #endif // wxUSE_DISPLAY - diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 1448cbf02c..da94159c17 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -22,13 +22,15 @@ #if wxUSE_SOCKETS +#include "wx/socket.h" + #ifndef WX_PRECOMP #include "wx/object.h" + #include "wx/string.h" #endif #include "wx/app.h" #include "wx/apptrait.h" -#include "wx/string.h" #include "wx/timer.h" #include "wx/utils.h" #include "wx/module.h" @@ -37,7 +39,6 @@ #include "wx/event.h" #include "wx/sckaddr.h" -#include "wx/socket.h" #include "wx/datetime.h" // DLL options compatibility check: diff --git a/src/common/sysopt.cpp b/src/common/sysopt.cpp index 83183c926a..a5967226a8 100644 --- a/src/common/sysopt.cpp +++ b/src/common/sysopt.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/sysopt.cpp +// Name: src/common/sysopt.cpp // Purpose: wxSystemOptions // Author: Julian Smart // Modified by: @@ -26,12 +26,13 @@ #if wxUSE_SYSTEM_OPTIONS +#include "wx/sysopt.h" + #ifndef WX_PRECOMP #include "wx/list.h" + #include "wx/string.h" #endif -#include "wx/string.h" -#include "wx/sysopt.h" #include "wx/arrstr.h" // ---------------------------------------------------------------------------- @@ -86,4 +87,3 @@ bool wxSystemOptions::HasOption(const wxString& name) } #endif // wxUSE_SYSTEM_OPTIONS - diff --git a/src/common/url.cpp b/src/common/url.cpp index 65f2fe7265..084a93ca85 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -18,14 +18,15 @@ #if wxUSE_URL +#include "wx/url.h" + #ifndef WX_PRECOMP #include "wx/list.h" + #include "wx/string.h" #endif -#include "wx/string.h" #include "wx/utils.h" #include "wx/module.h" -#include "wx/url.h" #include #include diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 5df645bb83..e76fbcb725 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -16,6 +16,12 @@ #pragma hdrstop #endif +#include "wx/variant.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #if wxUSE_STD_IOSTREAM #if wxUSE_IOSTREAMH #include @@ -38,8 +44,6 @@ using namespace std ; #include "wx/tokenzr.h" #include "wx/math.h" -#include "wx/variant.h" - IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject) wxVariant WXDLLIMPEXP_BASE wxNullVariant; diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp index fe376a1202..b7891ecc37 100644 --- a/src/generic/notebook.cpp +++ b/src/generic/notebook.cpp @@ -21,16 +21,18 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#ifndef __WXPALMOS__ +#include "wx/notebook.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif -#include "wx/string.h" #include "wx/log.h" #include "wx/settings.h" #include "wx/generic/imaglist.h" -#include "wx/notebook.h" #include "wx/dcclient.h" #include "wx/generic/tabg.h" @@ -711,5 +713,3 @@ bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId) } return retval; } - -#endif // __WXPALMOS__ diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index cb2455bbcd..ae61014f02 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -11,7 +11,10 @@ #include "wx/wxprec.h" #include "wx/utils.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif #include "wx/apptrait.h" #include "wx/intl.h" @@ -69,12 +72,12 @@ bool wxSetDetectableAutoRepeat( bool flag ) { Bool result; XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag, &result ); - return result; /* TRUE if keyboard hardware supports this mode */ + return result; /* true if keyboard hardware supports this mode */ } #else bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) { - return FALSE; + return false; } #endif @@ -152,7 +155,7 @@ void wxGetMousePosition( int* x, int* y ) bool wxColourDisplay() { - return TRUE; + return true; } int wxDisplayDepth() @@ -256,4 +259,3 @@ int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) return tag; } - diff --git a/src/gtk/utilsres.cpp b/src/gtk/utilsres.cpp index 3efcd634f9..1b97063219 100644 --- a/src/gtk/utilsres.cpp +++ b/src/gtk/utilsres.cpp @@ -10,12 +10,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/utils.h" + #ifndef WX_PRECOMP #include "wx/list.h" + #include "wx/string.h" #endif -#include "wx/utils.h" -#include "wx/string.h" #include "wx/log.h" #include "wx/config.h" #include "wx/app.h" diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp index e05a766246..2f969d7be8 100644 --- a/src/gtk1/utilsgtk.cpp +++ b/src/gtk1/utilsgtk.cpp @@ -11,7 +11,10 @@ #include "wx/wxprec.h" #include "wx/utils.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif #include "wx/apptrait.h" #include "wx/intl.h" @@ -70,12 +73,12 @@ bool wxSetDetectableAutoRepeat( bool flag ) { Bool result; XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag, &result ); - return result; /* TRUE if keyboard hardware supports this mode */ + return result; /* true if keyboard hardware supports this mode */ } #else bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) { - return FALSE; + return false; } #endif @@ -118,7 +121,7 @@ void wxGetMousePosition( int* x, int* y ) bool wxColourDisplay() { - return TRUE; + return true; } int wxDisplayDepth() @@ -194,4 +197,3 @@ int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) return tag; } - diff --git a/src/gtk1/utilsres.cpp b/src/gtk1/utilsres.cpp index 76deb2b6be..1bd989f80b 100644 --- a/src/gtk1/utilsres.cpp +++ b/src/gtk1/utilsres.cpp @@ -10,12 +10,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/utils.h" + #ifndef WX_PRECOMP #include "wx/list.h" + #include "wx/string.h" #endif -#include "wx/utils.h" -#include "wx/string.h" #include "wx/log.h" #include "wx/config.h" #include "wx/app.h" diff --git a/src/mac/carbon/accel.cpp b/src/mac/carbon/accel.cpp index 1ca16d6c29..36ea097688 100644 --- a/src/mac/carbon/accel.cpp +++ b/src/mac/carbon/accel.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: accel.cpp +// Name: src/mac/carbon/accel.cpp // Purpose: wxAcceleratorTable // Author: Stefan Csomor // Modified by: @@ -12,7 +12,10 @@ #include "wx/wxprec.h" #include "wx/accel.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) @@ -99,5 +102,3 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event ) return -1; } - - diff --git a/src/mac/carbon/cfsocket.cpp b/src/mac/carbon/cfsocket.cpp index 0916087f97..205bc86ad1 100644 --- a/src/mac/carbon/cfsocket.cpp +++ b/src/mac/carbon/cfsocket.cpp @@ -17,13 +17,15 @@ #if wxUSE_SOCKETS +#include "wx/socket.h" + #ifndef WX_PRECOMP #include "wx/object.h" + #include "wx/string.h" #endif #include "wx/app.h" #include "wx/apptrait.h" -#include "wx/string.h" #include "wx/timer.h" #include "wx/utils.h" #include "wx/module.h" @@ -32,7 +34,6 @@ #include "wx/event.h" #include "wx/sckaddr.h" -#include "wx/socket.h" #include "wx/mac/carbon/private.h" #include diff --git a/src/mac/carbon/display.cpp b/src/mac/carbon/display.cpp index d5af1de13a..aa3e320d34 100644 --- a/src/mac/carbon/display.cpp +++ b/src/mac/carbon/display.cpp @@ -25,9 +25,12 @@ #if wxUSE_DISPLAY +#include "wx/display.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/string.h" #endif #ifdef __DARWIN__ @@ -41,10 +44,8 @@ #include #endif -#include "wx/display.h" #include "wx/display_impl.h" #include "wx/gdicmn.h" -#include "wx/string.h" // ---------------------------------------------------------------------------- // display classes implementation diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index 47ceb2e5b1..5ea3432877 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: font.cpp +// Name: src/mac/carbon/font.cpp // Purpose: wxFont class // Author: Stefan Csomor // Modified by: @@ -11,8 +11,12 @@ #include "wx/wxprec.h" -#include "wx/string.h" #include "wx/font.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/fontutil.h" #include "wx/gdicmn.h" #include "wx/utils.h" @@ -39,7 +43,7 @@ public: , m_family(wxDEFAULT) , m_style(wxNORMAL) , m_weight(wxNORMAL) - , m_underlined(FALSE) + , m_underlined(false) , m_faceName(wxT("applicationfont")) , m_encoding(wxFONTENCODING_DEFAULT) , m_macFontNum(0) @@ -216,7 +220,7 @@ void wxFontRefData::MacFindFont() } else { - if ( m_faceName.Length() == 0 ) + if ( m_faceName.empty() ) { switch ( m_family ) { @@ -637,4 +641,3 @@ const wxNativeFontInfo * wxFont::GetNativeFontInfo() const return &(M_FONTDATA->m_info); } - diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index df02de6a4b..26decfafb2 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -13,12 +13,17 @@ #if wxUSE_NOTEBOOK +#include "wx/notebook.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/app.h" #include "wx/string.h" #include "wx/log.h" #include "wx/imaglist.h" #include "wx/image.h" -#include "wx/notebook.h" #include "wx/mac/uma.h" @@ -96,18 +101,18 @@ bool wxNotebook::Create( wxWindow *parent, ControlTabSize tabsize; switch (GetWindowVariant()) { - case wxWINDOW_VARIANT_MINI: + case wxWINDOW_VARIANT_MINI: if ( UMAGetSystemVersion() >= 0x1030 ) tabsize = 3 ; else tabsize = kControlSizeSmall; break; - case wxWINDOW_VARIANT_SMALL: + case wxWINDOW_VARIANT_SMALL: tabsize = kControlTabSizeSmall; break; - default: + default: tabsize = kControlTabSizeLarge; break; } @@ -323,11 +328,11 @@ int wxNotebook::HitTest(const wxPoint& pt, long * flags) const const int countPages = GetPageCount(); // we have to convert from Client to Window relative coordinates - wxPoint adjustedPt = pt + GetClientAreaOrigin(); + wxPoint adjustedPt = pt + GetClientAreaOrigin(); // and now to HIView native ones adjustedPt.x -= MacGetLeftBorderSize() ; adjustedPt.y -= MacGetTopBorderSize() ; - + HIPoint hipoint= { adjustedPt.x , adjustedPt.y } ; HIViewPartCode outPart = 0 ; OSStatus err = HIViewGetPartHit( m_peer->GetControlRef(), &hipoint, &outPart ); diff --git a/src/mac/carbon/sound.cpp b/src/mac/carbon/sound.cpp index 78a0b6fba9..32147daa8a 100644 --- a/src/mac/carbon/sound.cpp +++ b/src/mac/carbon/sound.cpp @@ -14,14 +14,15 @@ #if wxUSE_SOUND +#include "wx/sound.h" + #ifndef WX_PRECOMP #include "wx/object.h" + #include "wx/string.h" #endif -#include "wx/string.h" #include "wx/log.h" #include "wx/file.h" -#include "wx/sound.h" #include "wx/timer.h" #include "wx/intl.h" diff --git a/src/mac/classic/accel.cpp b/src/mac/classic/accel.cpp index ce99c542e6..89ac19e521 100644 --- a/src/mac/classic/accel.cpp +++ b/src/mac/classic/accel.cpp @@ -12,7 +12,10 @@ #include "wx/wxprec.h" #include "wx/accel.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) @@ -47,7 +50,7 @@ wxAcceleratorRefData::wxAcceleratorRefData() wxAcceleratorRefData::~wxAcceleratorRefData() { - m_accels.DeleteContents( TRUE ); + m_accels.DeleteContents( true ); } wxAcceleratorTable::wxAcceleratorTable() diff --git a/src/mac/classic/display.cpp b/src/mac/classic/display.cpp index 9798492bc9..f216f1fd65 100644 --- a/src/mac/classic/display.cpp +++ b/src/mac/classic/display.cpp @@ -26,9 +26,12 @@ #if wxUSE_DISPLAY +#include "wx/display.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" #include "wx/log.h" + #include "wx/string.h" #endif #ifdef __DARWIN__ @@ -41,10 +44,8 @@ #include #endif -#include "wx/display.h" #include "wx/display_impl.h" #include "wx/gdicmn.h" -#include "wx/string.h" // ---------------------------------------------------------------------------- // display implementation classes diff --git a/src/mac/classic/font.cpp b/src/mac/classic/font.cpp index 7f4f120eb8..42445ce21a 100644 --- a/src/mac/classic/font.cpp +++ b/src/mac/classic/font.cpp @@ -15,8 +15,12 @@ #pragma hdrstop #endif -#include "wx/string.h" #include "wx/font.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/fontutil.h" #include "wx/gdicmn.h" #include "wx/utils.h" @@ -166,7 +170,7 @@ wxFontRefData::~wxFontRefData() void wxFontRefData::MacFindFont() { - if( m_faceName.Length() == 0 ) + if( m_faceName.empty() ) { switch( m_family ) { diff --git a/src/mac/classic/notebmac.cpp b/src/mac/classic/notebmac.cpp index 7edae0f4e6..02c1dd5501 100644 --- a/src/mac/classic/notebmac.cpp +++ b/src/mac/classic/notebmac.cpp @@ -9,6 +9,8 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + // ============================================================================ // declarations // ============================================================================ @@ -16,12 +18,17 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- + +#include "wx/notebook.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/app.h" -#include "wx/string.h" #include "wx/log.h" #include "wx/imaglist.h" #include "wx/image.h" -#include "wx/notebook.h" #include "wx/mac/uma.h" // ---------------------------------------------------------------------------- // macros diff --git a/src/mac/classic/sound.cpp b/src/mac/classic/sound.cpp index 5698858cfd..8f3eed837e 100644 --- a/src/mac/classic/sound.cpp +++ b/src/mac/classic/sound.cpp @@ -14,13 +14,13 @@ #if wxUSE_SOUND +#include "wx/sound.h" + #ifndef WX_PRECOMP #include "wx/object.h" + #include "wx/string.h" #endif -#include "wx/string.h" -#include "wx/sound.h" - #ifdef __WXMAC__ #include "wx/mac/private.h" #ifndef __DARWIN__ diff --git a/src/mac/corefoundation/hid.cpp b/src/mac/corefoundation/hid.cpp index 276571c883..e4577b1c98 100644 --- a/src/mac/corefoundation/hid.cpp +++ b/src/mac/corefoundation/hid.cpp @@ -27,12 +27,13 @@ //DARWIN _ONLY_ #ifdef __DARWIN__ +#include "wx/mac/corefoundation/hid.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" + #include "wx/string.h" #endif -#include "wx/mac/corefoundation/hid.h" -#include "wx/string.h" #include "wx/log.h" #include "wx/mac/corefoundation/cfstring.h" diff --git a/src/mgl/fontenum.cpp b/src/mgl/fontenum.cpp index 2bc8300d33..044e471851 100644 --- a/src/mgl/fontenum.cpp +++ b/src/mgl/fontenum.cpp @@ -22,14 +22,15 @@ // headers // ---------------------------------------------------------------------------- +#include "wx/fontenum.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" + #include "wx/string.h" #endif -#include "wx/string.h" #include "wx/utils.h" -#include "wx/fontenum.h" #include "wx/encinfo.h" #include "wx/fontutil.h" diff --git a/src/mgl/utils.cpp b/src/mgl/utils.cpp index fd2e5c63c7..d722788098 100644 --- a/src/mgl/utils.cpp +++ b/src/mgl/utils.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp +// Name: src/mgl/utils.cpp // Purpose: // Author: Vaclav Slavik // Id: $Id$ @@ -15,7 +15,10 @@ #endif #include "wx/utils.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif #include "wx/intl.h" #include "wx/apptrait.h" diff --git a/src/motif/accel.cpp b/src/motif/accel.cpp index e6769cd37c..c1e6426f22 100644 --- a/src/motif/accel.cpp +++ b/src/motif/accel.cpp @@ -13,7 +13,11 @@ #include "wx/wxprec.h" #include "wx/accel.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/utils.h" #include diff --git a/src/motif/font.cpp b/src/motif/font.cpp index a0a1c809b9..f4653d60ad 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -29,8 +29,12 @@ #pragma message enable nosimpint #endif -#include "wx/string.h" #include "wx/font.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/gdicmn.h" #include "wx/utils.h" // for wxGetDisplay() #include "wx/fontutil.h" // for wxNativeFontInfo diff --git a/src/msdos/utilsdos.cpp b/src/msdos/utilsdos.cpp index c8b1151512..0c818dbc80 100644 --- a/src/msdos/utilsdos.cpp +++ b/src/msdos/utilsdos.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp +// Name: src/msdos/utils.cpp // Purpose: DOS implementations of utility functions // Author: Vaclav Slavik, M.J.Wetherell // Id: $Id$ @@ -16,7 +16,10 @@ #endif #include "wx/utils.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif #include "wx/intl.h" #include "wx/apptrait.h" @@ -85,12 +88,12 @@ bool wxGetEnv(const wxString& var, wxString *value) // wxGetenv is defined as getenv() wxChar *p = wxGetenv(var); if ( !p ) - return FALSE; + return false; if ( value ) *value = p; - return TRUE; + return true; } bool wxSetEnv(const wxString& variable, const wxChar *value) @@ -233,7 +236,7 @@ bool wxGetUserName(wxChar *buf, int n) bool wxGetHostName(wxChar *buf, int n) { const wxChar *host = wxGetenv(_T("ComputerName")); - + if (!host) host = wxGetenv(_T("HOSTNAME")); @@ -318,7 +321,7 @@ long wxExecute(const wxString& command, int flags, wxProcess *process) #if wxUSE_STREAMS // A wxFFileInputStream that deletes the file in it's destructor -// +// class wxTempFileInStream : public wxFFileInputStream { public: diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index d318904387..080af680d2 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.cpp +// Name: src/msw/dcclient.cpp // Purpose: wxClientDC class // Author: Julian Smart // Modified by: @@ -24,14 +24,17 @@ #pragma hdrstop #endif -#include "wx/string.h" +#include "wx/dcclient.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/log.h" #include "wx/window.h" #include "wx/msw/private.h" -#include "wx/dcclient.h" - // ---------------------------------------------------------------------------- // array/list types // ---------------------------------------------------------------------------- @@ -353,4 +356,3 @@ wxPaintDCEx::~wxPaintDCEx() // prevent the base class dtor from ReleaseDC()ing it again m_hDC = 0; } - diff --git a/src/msw/joystick.cpp b/src/msw/joystick.cpp index 294447cb0a..51e6178094 100644 --- a/src/msw/joystick.cpp +++ b/src/msw/joystick.cpp @@ -13,13 +13,17 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_JOYSTICK #include "wx/joystick.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/window.h" #include "wx/msw/private.h" diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 010ff1d301..c2aab338a6 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/registry.cpp +// Name: src/msw/registry.cpp // Purpose: implementation of registry classes and functions // Author: Vadim Zeitlin // Modified by: @@ -16,11 +16,13 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/string.h" #endif -// other wxWidgets headers -#include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" #include "wx/file.h" @@ -1413,4 +1415,3 @@ void RemoveTrailingSeparator(wxString& str) if ( !str.empty() && str.Last() == REG_SEPARATOR ) str.Truncate(str.Len() - 1); } - diff --git a/src/msw/urlmsw.cpp b/src/msw/urlmsw.cpp index 891cdb6bc0..d99a478404 100644 --- a/src/msw/urlmsw.cpp +++ b/src/msw/urlmsw.cpp @@ -20,6 +20,7 @@ #ifndef WX_PRECOMP #include "wx/list.h" + #include "wx/string.h" #endif #if !wxUSE_PROTOCOL_HTTP @@ -63,7 +64,6 @@ USE_PROTOCOL(wxHTTPDummyProto) #pragma comment(lib, "wininet.lib") #endif -#include "wx/string.h" #include "wx/utils.h" #include "wx/module.h" #include "wx/url.h" diff --git a/src/os2/dcclient.cpp b/src/os2/dcclient.cpp index 81007873df..24de249cc2 100644 --- a/src/os2/dcclient.cpp +++ b/src/os2/dcclient.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.cpp +// Name: src/os2/dcclient.cpp // Purpose: wxClientDC class // Author: David Webster // Modified by: @@ -20,15 +20,18 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/string.h" +#include "wx/dcclient.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/log.h" #include "wx/window.h" #include "wx/app.h" #include "wx/os2/private.h" -#include "wx/dcclient.h" - // ---------------------------------------------------------------------------- // array/list types // ---------------------------------------------------------------------------- @@ -362,7 +365,7 @@ wxPaintDC::wxPaintDC( ); } - m_bIsPaintTime = TRUE; + m_bIsPaintTime = true; ms_cache.Add(new wxPaintDCInfo(m_pCanvas, this)); } InitDC(); @@ -383,7 +386,7 @@ wxPaintDC::~wxPaintDC() { ::WinEndPaint(m_hPS); m_hPS = m_hOldPS; - m_bIsPaintTime = FALSE; + m_bIsPaintTime = false; ms_cache.RemoveAt(nIndex); } //else: cached DC entry is still in use @@ -431,4 +434,3 @@ WXHDC wxPaintDC::FindDCInCache( } return 0; } // end of wxPaintDC::FindInCache - diff --git a/src/os2/dcprint.cpp b/src/os2/dcprint.cpp index 87c745f2e8..655622d16f 100644 --- a/src/os2/dcprint.cpp +++ b/src/os2/dcprint.cpp @@ -12,23 +12,24 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_PRINTING_ARCHITECTURE + #define INCL_DEV #define INCL_GPI #define INCL_PM #include +#include "wx/dcprint.h" + #ifndef WX_PRECOMP -#include "wx/app.h" -#include "wx/math.h" + #include "wx/app.h" + #include "wx/math.h" + #include "wx/string.h" #endif -#include "wx/string.h" #include "wx/log.h" #include "wx/window.h" #include "wx/os2/private.h" -#include "wx/dcprint.h" - -#if wxUSE_PRINTING_ARCHITECTURE IMPLEMENT_CLASS(wxPrinterDC, wxDC) diff --git a/src/os2/joystick.cpp b/src/os2/joystick.cpp index 6fef9a0116..c86cb881a6 100644 --- a/src/os2/joystick.cpp +++ b/src/os2/joystick.cpp @@ -9,14 +9,17 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -// // For compilers that support precompilation, includes "wx.h". -// #include "wx/wxprec.h" #if wxUSE_JOYSTICK -#include "wx/string.h" +#include "wx/joystick.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #define INCL_PM #define INCL_DOS #include "wx/os2/private.h" @@ -24,7 +27,6 @@ #define NO_JOYGETPOSEX #include "wx/window.h" -#include "wx/joystick.h" IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) @@ -287,4 +289,5 @@ bool wxJoystick::ReleaseCapture() // TODO return false; } + #endif // wxUSE_JOYSTICK diff --git a/src/palmos/dcclient.cpp b/src/palmos/dcclient.cpp index e7a6817db9..8a07a7b2ce 100644 --- a/src/palmos/dcclient.cpp +++ b/src/palmos/dcclient.cpp @@ -24,12 +24,15 @@ #pragma hdrstop #endif -#include "wx/string.h" +#include "wx/dcclient.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/log.h" #include "wx/window.h" -#include "wx/dcclient.h" - // ---------------------------------------------------------------------------- // array/list types // ---------------------------------------------------------------------------- @@ -156,4 +159,3 @@ wxPaintDCEx::wxPaintDCEx(wxWindow *canvas, WXHDC dc) : saveState(0) wxPaintDCEx::~wxPaintDCEx() { } - diff --git a/src/palmos/joystick.cpp b/src/palmos/joystick.cpp index cfceba1191..f189adc7cd 100644 --- a/src/palmos/joystick.cpp +++ b/src/palmos/joystick.cpp @@ -12,13 +12,15 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifdef __BORLANDC__ -#pragma hdrstop +#if wxUSE_JOYSTICK + +#include "wx/joystick.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" #endif -#include "wx/string.h" #include "wx/window.h" -#include "wx/palmos/joystick.h" IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) @@ -27,7 +29,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) wxJoystick::wxJoystick(int joystick) { -}; +} wxPoint wxJoystick::GetPosition() const { @@ -245,3 +247,4 @@ bool wxJoystick::ReleaseCapture() return false; } +#endif // wxUSE_JOYSTICK diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index a72dfdf81e..98215d2945 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -20,16 +20,17 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/fontenum.h" + #ifndef WX_PRECOMP #include "wx/dynarray.h" + #include "wx/string.h" #endif -#include "wx/string.h" #include "wx/regex.h" #include "wx/utils.h" #include "wx/app.h" #include "wx/fontmap.h" -#include "wx/fontenum.h" #include "wx/fontutil.h" #include "wx/encinfo.h" diff --git a/src/x11/font.cpp b/src/x11/font.cpp index f982eb15fe..c1e7646796 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -29,8 +29,12 @@ #pragma message enable nosimpint #endif -#include "wx/string.h" #include "wx/font.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/gdicmn.h" #include "wx/utils.h" // for wxGetDisplay() #include "wx/fontutil.h" // for wxNativeFontInfo diff --git a/src/xrc/xh_statbar.cpp b/src/xrc/xh_statbar.cpp index d5b4fbfa4d..c49c0c33a4 100644 --- a/src/xrc/xh_statbar.cpp +++ b/src/xrc/xh_statbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: xh_statbar.cpp +// Name: src/xrc/xh_statbar.cpp // Purpose: XRC resource for wxStatusBar // Author: Brian Ravnsgaard Riis // Created: 2004/01/21 @@ -17,11 +17,15 @@ #if wxUSE_XRC && wxUSE_STATUSBAR +#include "wx/xrc/xh_statbar.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif + #include "wx/frame.h" -#include "wx/string.h" #include "wx/log.h" -#include "wx/xrc/xh_statbar.h" #include "wx/statusbr.h" IMPLEMENT_DYNAMIC_CLASS(wxStatusBarXmlHandler, wxXmlResourceHandler) @@ -62,7 +66,7 @@ wxObject *wxStatusBarXmlHandler::DoCreateResource() else statbar->SetFieldsCount(fields); - if (!styles.IsEmpty()) + if (!styles.empty()) { int *style = new int[fields]; for (int i = 0; i < fields; ++i) @@ -77,7 +81,7 @@ wxObject *wxStatusBarXmlHandler::DoCreateResource() else if (first == wxT("wxSB_RAISED")) style[i] = wxSB_RAISED; - if (!first.IsEmpty()) + if (!first.empty()) wxLogError(wxT("Error in resource, unknown statusbar field style: ") + first); if(styles.Find(wxT(','))) styles.Remove(0, styles.Find(wxT(',')) + 1); @@ -102,4 +106,3 @@ bool wxStatusBarXmlHandler::CanHandle(wxXmlNode *node) } #endif // wxUSE_XRC && wxUSE_STATUSBAR -