From ad9835c97c10c0d7de345e3a7a7c0fc2776eb2cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 19 Apr 2006 14:18:39 +0000 Subject: [PATCH] Include wx/dynarray.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/cmdline.cpp | 12 ++--- src/common/dynarray.cpp | 10 ++-- src/common/fileconf.cpp | 9 ++-- src/common/filename.cpp | 8 +-- src/common/intl.cpp | 22 ++++----- src/common/lboxcmn.cpp | 2 +- src/common/mimecmn.cpp | 10 ++-- src/common/valgen.cpp | 8 +-- src/generic/listctrl.cpp | 2 +- src/gtk/listbox.cpp | 7 ++- src/gtk1/listbox.cpp | 5 +- src/html/helpfrm.cpp | 2 +- src/html/helpwnd.cpp | 2 +- src/html/htmlcell.cpp | 2 +- src/html/htmlpars.cpp | 2 +- src/html/m_image.cpp | 2 +- src/mac/carbon/display.cpp | 4 +- src/mac/carbon/listbox.cpp | 69 +++++++++++++------------- src/mac/carbon/mimetmac.cpp | 12 ++--- src/mac/carbon/timer.cpp | 12 +++-- src/mac/classic/display.cpp | 4 +- src/mac/classic/listbox.cpp | 5 +- src/mac/classic/mimetmac.cpp | 15 +++--- src/mac/classic/timer.cpp | 41 ++++++++-------- src/mac/corefoundation/hid.cpp | 85 ++++++++++++++++---------------- src/mgl/fontenum.cpp | 5 +- src/motif/listbox.cpp | 7 ++- src/msdos/mimetype.cpp | 4 +- src/msw/app.cpp | 8 +-- src/msw/display.cpp | 8 +-- src/msw/iniconf.cpp | 90 +++++++++++++++++----------------- src/msw/listbox.cpp | 14 +++--- src/msw/mimetype.cpp | 4 +- src/msw/tbar95.cpp | 9 ++-- src/msw/treectrl.cpp | 5 +- src/msw/wince/tbarwce.cpp | 10 ++-- src/os2/app.cpp | 85 +++++++++++++++----------------- src/os2/iniconf.cpp | 15 +++--- src/os2/listbox.cpp | 24 ++++----- src/os2/mimetype.cpp | 22 ++++----- src/os2/treectrl.cpp | 7 ++- src/palmos/app.cpp | 2 +- src/palmos/listbox.cpp | 14 +++--- src/palmos/toolbar.cpp | 7 ++- src/palmos/treectrl.cpp | 6 ++- src/unix/displayx11.cpp | 20 ++++---- src/unix/fontenum.cpp | 5 +- src/unix/mimetype.cpp | 2 +- src/unix/threadpsx.cpp | 40 ++++++++------- 49 files changed, 398 insertions(+), 367 deletions(-) diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 12012e6807..dd154cbaee 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: common/cmdline.cpp +// Name: src/common/cmdline.cpp // Purpose: wxCmdLineParser implementation // Author: Vadim Zeitlin // Modified by: @@ -24,18 +24,18 @@ #pragma hdrstop #endif -#include "wx/cmdline.h" - -#if wxUSE_CMDLINE_PARSER - #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/string.h" #include "wx/log.h" #include "wx/intl.h" #include "wx/app.h" - #include "wx/dynarray.h" #endif //WX_PRECOMP +#include "wx/cmdline.h" + +#if wxUSE_CMDLINE_PARSER + #include #include "wx/datetime.h" diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index 4fc0f8ce40..ead8099c32 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dynarray.cpp +// Name: src/common/dynarray.cpp // Purpose: implementation of wxBaseArray class // Author: Vadim Zeitlin // Modified by: @@ -13,13 +13,17 @@ // headers // ============================================================================ +// For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif -#include "wx/dynarray.h" +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif //WX_PRECOMP + #include "wx/intl.h" #include diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 385b76df94..2e4468252f 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -14,21 +14,22 @@ // headers // ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif //__BORLANDC__ #if wxUSE_CONFIG && wxUSE_FILECONFIG #ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" + #include "wx/dynarray.h" + #include "wx/string.h" + #include "wx/intl.h" #endif //WX_PRECOMP #include "wx/app.h" -#include "wx/dynarray.h" #include "wx/file.h" #include "wx/log.h" #include "wx/textfile.h" diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 959224c908..c776d48846 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -68,9 +68,10 @@ #endif #ifndef WX_PRECOMP -#include "wx/intl.h" -#include "wx/log.h" -#include "wx/file.h" + #include "wx/dynarray.h" + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/file.h" #endif #include "wx/filename.h" @@ -2047,7 +2048,6 @@ public : OSType m_creator ; } ; -#include "wx/dynarray.h" WX_DECLARE_OBJARRAY(MacDefaultExtensionRecord, MacDefaultExtensionArray) ; bool gMacDefaultExtensionsInited = false ; diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 443c1b0c67..7556b41fb2 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -39,28 +39,26 @@ #if wxUSE_INTL -// standard headers +#ifndef WX_PRECOMP + #include "wx/dynarray.h" + #include "wx/string.h" + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/debug.h" + #include "wx/utils.h" +#endif // WX_PRECOMP #ifndef __WXWINCE__ -#include + #include #endif +// standard headers #include #include #ifdef HAVE_LANGINFO_H #include #endif -// wxWidgets -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/debug.h" - #include "wx/utils.h" - #include "wx/dynarray.h" -#endif // WX_PRECOMP - #ifdef __WIN32__ #include "wx/msw/private.h" #elif defined(__UNIX_LIKE__) diff --git a/src/common/lboxcmn.cpp b/src/common/lboxcmn.cpp index 02d5c94b81..6350c107f2 100644 --- a/src/common/lboxcmn.cpp +++ b/src/common/lboxcmn.cpp @@ -27,8 +27,8 @@ #if wxUSE_LISTBOX #ifndef WX_PRECOMP - #include "wx/listbox.h" #include "wx/dynarray.h" + #include "wx/listbox.h" #include "wx/arrstr.h" #endif diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index 104285eac5..326eefa0af 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/mimecmn.cpp +// Name: src/common/mimecmn.cpp // Purpose: classes and functions to manage MIME types // Author: Vadim Zeitlin // Modified by: @@ -28,7 +28,8 @@ #if wxUSE_MIMETYPE #ifndef WX_PRECOMP - #include "wx/string.h" + #include "wx/dynarray.h" + #include "wx/string.h" #endif //WX_PRECOMP #include "wx/module.h" @@ -36,7 +37,6 @@ #include "wx/file.h" #include "wx/iconloc.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" #include "wx/mimetype.h" @@ -459,7 +459,7 @@ bool wxFileType::SetDefaultIcon(const wxString& cmd, int index) wxMimeTypesManagerFactory *wxMimeTypesManagerFactory::m_factory = NULL; -/* static */ +/* static */ void wxMimeTypesManagerFactory::SetFactory( wxMimeTypesManagerFactory *factory ) { if (wxMimeTypesManagerFactory::m_factory) @@ -468,7 +468,7 @@ void wxMimeTypesManagerFactory::SetFactory( wxMimeTypesManagerFactory *factory ) wxMimeTypesManagerFactory::m_factory = factory; } -/* static */ +/* static */ wxMimeTypesManagerFactory *wxMimeTypesManagerFactory::GetFactory() { if (!wxMimeTypesManagerFactory::m_factory) diff --git a/src/common/valgen.cpp b/src/common/valgen.cpp index 46c0a4cbb7..3d77628f4a 100644 --- a/src/common/valgen.cpp +++ b/src/common/valgen.cpp @@ -19,9 +19,9 @@ #if wxUSE_VALIDATORS #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/utils.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/choice.h" #include "wx/combobox.h" #include "wx/radiobox.h" @@ -39,13 +39,13 @@ #include "wx/spinctrl.h" #if wxUSE_SPINBTN - #include "wx/spinbutt.h" + #include "wx/spinbutt.h" #endif #if wxUSE_CHECKLISTBOX - #include "wx/checklst.h" + #include "wx/checklst.h" #endif #if wxUSE_TOGGLEBTN - #include "wx/tglbtn.h" + #include "wx/tglbtn.h" #endif #include "wx/valgen.h" diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 924faa7615..99b530c7d7 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -24,8 +24,8 @@ #if wxUSE_LISTCTRL #ifndef WX_PRECOMP - #include "wx/app.h" #include "wx/dynarray.h" + #include "wx/app.h" #include "wx/dcscreen.h" #include "wx/textctrl.h" #endif diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index a0d65e5401..cc241866a7 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -13,8 +13,11 @@ #if wxUSE_LISTBOX +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/listbox.h" -#include "wx/dynarray.h" #include "wx/arrstr.h" #include "wx/utils.h" #include "wx/intl.h" @@ -25,7 +28,7 @@ #include "wx/gtk/treeentry_gtk.h" #if wxUSE_TOOLTIPS -#include "wx/tooltip.h" + #include "wx/tooltip.h" #endif #include diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index ebfe1b76cb..4648ad6b98 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -12,8 +12,11 @@ #if wxUSE_LISTBOX +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/listbox.h" -#include "wx/dynarray.h" #include "wx/arrstr.h" #include "wx/utils.h" #include "wx/intl.h" diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index 250f7f2e8c..8c016573cd 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -21,6 +21,7 @@ #ifndef WXPRECOMP #include "wx/object.h" + #include "wx/dynarray.h" #include "wx/intl.h" #include "wx/log.h" @@ -53,7 +54,6 @@ #include "wx/filedlg.h" #include "wx/artprov.h" #include "wx/spinctrl.h" -#include "wx/dynarray.h" #include "wx/choicdlg.h" #include "wx/settings.h" diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 317df03cc4..bb2aaafd71 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -21,6 +21,7 @@ #ifndef WXPRECOMP #include "wx/object.h" + #include "wx/dynarray.h" #include "wx/intl.h" #include "wx/log.h" @@ -54,7 +55,6 @@ #include "wx/filedlg.h" #include "wx/artprov.h" #include "wx/spinctrl.h" -#include "wx/dynarray.h" #include "wx/choicdlg.h" #include "wx/settings.h" diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 8f4f0f50c0..ace347c57a 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -16,6 +16,7 @@ #if wxUSE_HTML && wxUSE_STREAMS #ifndef WXPRECOMP + #include "wx/dynarray.h" #include "wx/brush.h" #include "wx/colour.h" #include "wx/dc.h" @@ -25,7 +26,6 @@ #include "wx/html/htmlwin.h" #include "wx/settings.h" #include "wx/module.h" -#include "wx/dynarray.h" #include diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index b5feaccbf1..0abe5400dd 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -16,6 +16,7 @@ #if wxUSE_HTML && wxUSE_STREAMS #ifndef WXPRECOMP + #include "wx/dynarray.h" #include "wx/log.h" #include "wx/intl.h" #endif @@ -26,7 +27,6 @@ #include "wx/fontmap.h" #include "wx/html/htmldefs.h" #include "wx/html/htmlpars.h" -#include "wx/dynarray.h" #include "wx/arrimpl.cpp" #ifdef __WXWINCE__ diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 59881ad023..a81f2c1023 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -16,6 +16,7 @@ #if wxUSE_HTML && wxUSE_STREAMS #ifndef WXPRECOMP + #include "wx/dynarray.h" #include "wx/dc.h" #include "wx/scrolwin.h" #include "wx/timer.h" @@ -28,7 +29,6 @@ #include "wx/image.h" #include "wx/gifdecod.h" -#include "wx/dynarray.h" #include "wx/log.h" #include "wx/artprov.h" #include "wx/math.h" diff --git a/src/mac/carbon/display.cpp b/src/mac/carbon/display.cpp index d6bad4945e..d5af1de13a 100644 --- a/src/mac/carbon/display.cpp +++ b/src/mac/carbon/display.cpp @@ -26,8 +26,8 @@ #if wxUSE_DISPLAY #ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/log.h" + #include "wx/dynarray.h" + #include "wx/log.h" #endif #ifdef __DARWIN__ diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 5b7ef94b22..3d6eac95da 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -13,12 +13,15 @@ #if wxUSE_LISTBOX +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/app.h" #include "wx/listbox.h" #include "wx/button.h" #include "wx/settings.h" #include "wx/toplevel.h" -#include "wx/dynarray.h" #include "wx/log.h" #include "wx/utils.h" @@ -29,8 +32,8 @@ BEGIN_EVENT_TABLE(wxListBox, wxControl) END_EVENT_TABLE() #include "wx/mac/uma.h" -#include "wx/dynarray.h" -#include "wx/arrstr.h" +#include "wx/dynarray.h" +#include "wx/arrstr.h" // ============================================================================ // list box control implementation @@ -57,9 +60,9 @@ bool wxListBox::Create( style, validator, name ); } -wxMacListControl* wxListBox::GetPeer() const -{ - return dynamic_cast(m_peer); +wxMacListControl* wxListBox::GetPeer() const +{ + return dynamic_cast(m_peer); } bool wxListBox::Create( @@ -80,7 +83,7 @@ bool wxListBox::Create( if ( !wxListBoxBase::Create( parent, id, pos, size, style & ~(wxHSCROLL | wxVSCROLL), validator, name ) ) return false; - + wxMacDataBrowserListControl* control = new wxMacDataBrowserListControl( this, pos, size, style ); control->SetClientDataType( m_clientDataItemsType ); m_peer = control; @@ -133,7 +136,7 @@ int wxListBox::DoAppend(const wxString& item) void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData) { Clear(); - + unsigned int n = choices.GetCount(); for ( size_t i = 0; i < n; ++i ) @@ -450,22 +453,22 @@ wxMacListBoxItem::~wxMacListBoxItem() { } -void wxMacListBoxItem::SetOrder( SInt32 order ) +void wxMacListBoxItem::SetOrder( SInt32 order ) { m_order = order; } -SInt32 wxMacListBoxItem::GetOrder() const +SInt32 wxMacListBoxItem::GetOrder() const { return m_order; } -void wxMacListBoxItem::SetData( void* data) +void wxMacListBoxItem::SetData( void* data) { m_data = data; } -void* wxMacListBoxItem::GetData() const +void* wxMacListBoxItem::GetData() const { return m_data; } @@ -481,8 +484,8 @@ const wxString& wxMacListBoxItem::GetLabel() const return m_label; } -bool wxMacListBoxItem::IsLessThan(wxMacDataItemBrowserControl *owner , - const wxMacDataItem* rhs, +bool wxMacListBoxItem::IsLessThan(wxMacDataItemBrowserControl *owner , + const wxMacDataItem* rhs, DataBrowserPropertyID sortProperty) const { const wxMacListBoxItem* otherItem = dynamic_cast(rhs); @@ -507,7 +510,7 @@ bool wxMacListBoxItem::IsLessThan(wxMacDataItemBrowserControl *owner , OSStatus wxMacListBoxItem::GetSetData( wxMacDataItemBrowserControl *owner , DataBrowserPropertyID property, DataBrowserItemDataRef itemData, - bool changeValue ) + bool changeValue ) { OSStatus err = errDataBrowserPropertyNotSupported; wxListBox *list = wxDynamicCast( owner->GetPeer() , wxListBox ); @@ -545,14 +548,14 @@ OSStatus wxMacListBoxItem::GetSetData( wxMacDataItemBrowserControl *owner , return err; } -void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner , +void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner , DataBrowserItemNotification message, DataBrowserItemDataRef itemData ) const { wxMacDataBrowserListControl *lb = dynamic_cast(owner); // we want to depend on as little as possible to make sure tear-down of controls is safe - + if ( message == kDataBrowserItemRemoved) { if ( lb != NULL && lb->GetClientDataType() == wxClientData_Object ) @@ -563,7 +566,7 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner , delete this; return; } - + wxListBox *list = wxDynamicCast( owner->GetPeer() , wxListBox ); wxCHECK_RET( list != NULL , wxT("Listbox expected")); @@ -612,7 +615,7 @@ wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxListBox *peer, const OSStatus err = noErr; m_clientDataItemsType = wxClientData_None; m_stringSorted = style & wxLB_SORT; - + DataBrowserSelectionFlags options = kDataBrowserDragSelect; if ( style & wxLB_MULTIPLE ) { @@ -628,7 +631,7 @@ wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxListBox *peer, const } err = SetSelectionFlags( options ); verify_noerr( err ); - + DataBrowserListViewColumnDesc columnDesc; columnDesc.headerBtnDesc.titleOffset = 0; columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc; @@ -693,26 +696,26 @@ wxMacDataBrowserListControl::~wxMacDataBrowserListControl() } -wxMacListBoxItem* wxMacDataBrowserListControl::CreateItem() +wxMacListBoxItem* wxMacDataBrowserListControl::CreateItem() { return new wxMacListBoxItem(); } wxListBox * wxMacDataBrowserListControl::GetPeer() const -{ - return wxDynamicCast( wxMacControl::GetPeer() , wxListBox ); +{ + return wxDynamicCast( wxMacControl::GetPeer() , wxListBox ); } -wxClientDataType wxMacDataBrowserListControl::GetClientDataType() const +wxClientDataType wxMacDataBrowserListControl::GetClientDataType() const { return m_clientDataItemsType; } -void wxMacDataBrowserListControl::SetClientDataType(wxClientDataType clientDataItemsType) +void wxMacDataBrowserListControl::SetClientDataType(wxClientDataType clientDataItemsType) { m_clientDataItemsType = clientDataItemsType; } -unsigned int wxMacDataBrowserListControl::MacGetCount() const +unsigned int wxMacDataBrowserListControl::MacGetCount() const { return GetItemCount(wxMacDataBrowserRootContainer,false,kDataBrowserItemNoState); } @@ -737,7 +740,7 @@ void wxMacDataBrowserListControl::MacInsert( unsigned int n, const wxString& tex wxMacListBoxItem* iter = (wxMacListBoxItem*) GetItemFromLine(i); iter->SetOrder( iter->GetOrder() + 1 ); } - + SInt32 frontLineOrder = 0; if ( n > 0 ) { @@ -746,7 +749,7 @@ void wxMacDataBrowserListControl::MacInsert( unsigned int n, const wxString& tex } newItem->SetOrder( frontLineOrder + 1 ); } - + AddItem( wxMacDataBrowserRootContainer, newItem ); } @@ -755,9 +758,9 @@ void wxMacDataBrowserListControl::MacInsert( unsigned int n, const wxArrayString size_t itemsCount = items.GetCount(); if ( itemsCount == 0 ) return; - + SInt32 frontLineOrder = 0; - + if ( !m_stringSorted ) { // increase the order of the lines to be shifted @@ -887,17 +890,17 @@ wxString wxMacDataBrowserListControl::MacGetString( unsigned int n ) const return item->GetLabel(); } -void wxMacDataBrowserListControl::MacSetClientData( unsigned int n, void * data) +void wxMacDataBrowserListControl::MacSetClientData( unsigned int n, void * data) { wxMacListBoxItem* item = (wxMacListBoxItem*) GetItemFromLine( n); item->SetData( data ); // not displayed, therefore no Update infos to DataBrowser } -void * wxMacDataBrowserListControl::MacGetClientData( unsigned int n) const +void * wxMacDataBrowserListControl::MacGetClientData( unsigned int n) const { wxMacListBoxItem * item = (wxMacListBoxItem*) GetItemFromLine( n ); - return item->GetData(); + return item->GetData(); } void wxMacDataBrowserListControl::MacScrollTo( unsigned int n ) diff --git a/src/mac/carbon/mimetmac.cpp b/src/mac/carbon/mimetmac.cpp index e53d77111f..f0bc491790 100644 --- a/src/mac/carbon/mimetmac.cpp +++ b/src/mac/carbon/mimetmac.cpp @@ -27,23 +27,23 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif #if wxUSE_MIMETYPE #ifndef WX_PRECOMP - #include "wx/string.h" + #include "wx/dynarray.h" + #include "wx/string.h" - #if wxUSE_GUI - #include "wx/icon.h" - #endif + #if wxUSE_GUI + #include "wx/icon.h" + #endif #endif #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" #include "wx/mac/mimetype.h" diff --git a/src/mac/carbon/timer.cpp b/src/mac/carbon/timer.cpp index 1fa8fb492c..c17eb429fc 100644 --- a/src/mac/carbon/timer.cpp +++ b/src/mac/carbon/timer.cpp @@ -6,21 +6,23 @@ // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/timer.h" #ifdef __WXMAC__ -#include "wx/mac/private.h" + #include "wx/mac/private.h" #endif -#include "wx/dynarray.h" - #ifndef __DARWIN__ -#include + #include #endif IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler) diff --git a/src/mac/classic/display.cpp b/src/mac/classic/display.cpp index 069570e5d1..9798492bc9 100644 --- a/src/mac/classic/display.cpp +++ b/src/mac/classic/display.cpp @@ -27,8 +27,8 @@ #if wxUSE_DISPLAY #ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/log.h" + #include "wx/dynarray.h" + #include "wx/log.h" #endif #ifdef __DARWIN__ diff --git a/src/mac/classic/listbox.cpp b/src/mac/classic/listbox.cpp index 02f93f5c8d..0289796b70 100644 --- a/src/mac/classic/listbox.cpp +++ b/src/mac/classic/listbox.cpp @@ -13,12 +13,15 @@ #if wxUSE_LISTBOX +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/app.h" #include "wx/listbox.h" #include "wx/button.h" #include "wx/settings.h" #include "wx/toplevel.h" -#include "wx/dynarray.h" #include "wx/log.h" #include "wx/utils.h" diff --git a/src/mac/classic/mimetmac.cpp b/src/mac/classic/mimetmac.cpp index 7a99856444..40dd00318d 100644 --- a/src/mac/classic/mimetmac.cpp +++ b/src/mac/classic/mimetmac.cpp @@ -13,21 +13,21 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP - #include "wx/string.h" - #if wxUSE_GUI - #include "wx/icon.h" - #endif + #include "wx/dynarray.h" + #include "wx/string.h" + #if wxUSE_GUI + #include "wx/icon.h" + #endif #endif //WX_PRECOMP #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" #include "wx/mac/mimetype.h" @@ -61,7 +61,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const { - if ( m_strFileType.Length() > 0 ) + if ( !m_strFileType.empty() ) { *mimeType = m_strFileType ; return true ; @@ -217,4 +217,3 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *ft) { return false; } - diff --git a/src/mac/classic/timer.cpp b/src/mac/classic/timer.cpp index 0e55f1cf0e..34e288bcdb 100644 --- a/src/mac/classic/timer.cpp +++ b/src/mac/classic/timer.cpp @@ -1,14 +1,21 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: timer.cpp +// Name: src/mac/classic/timer.cpp // Purpose: wxTimer implementation // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/timer.h" IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler) @@ -20,8 +27,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler) #include #endif -#include "wx/dynarray.h" - typedef struct MacTimerInfo { TMTask m_task; @@ -38,7 +43,7 @@ static pascal void MacTimerProc( TMTask * t ) } // we need this array to track timers that are being deleted within the Notify procedure -// adding the timer before the Notify call and checking after whether it still is in there +// adding the timer before the Notify call and checking after whether it still is in there // as the destructor would have removed it from the array wxArrayPtrVoid gTimersInProcess ; @@ -47,27 +52,26 @@ static void wxProcessTimer( unsigned long event , void *data ) { if ( !data ) return ; - + wxTimer* timer = (wxTimer*) data ; - + if ( timer->IsOneShot() ) timer->Stop() ; - + gTimersInProcess.Add( timer ) ; - + timer->Notify(); int index = gTimersInProcess.Index( timer ) ; - + if ( index != wxNOT_FOUND ) { gTimersInProcess.RemoveAt( index ) ; - + if ( !timer->IsOneShot() && timer->m_info->m_task.tmAddr ) { PrimeTime( (QElemPtr) &timer->m_info->m_task , timer->GetInterval() ) ; } - } } @@ -82,7 +86,7 @@ void wxTimer::Init() m_info->m_timer = this ; } -bool wxTimer::IsRunning() const +bool wxTimer::IsRunning() const { // as the qType may already indicate it is elapsed, but it // was not handled internally yet @@ -98,15 +102,15 @@ wxTimer::~wxTimer() } int index = gTimersInProcess.Index( this ) ; if ( index != wxNOT_FOUND ) - gTimersInProcess.RemoveAt( index ) ; + gTimersInProcess.RemoveAt( index ) ; } bool wxTimer::Start(int milliseconds,bool mode) { (void)wxTimerBase::Start(milliseconds, mode); - wxCHECK_MSG( m_milli > 0, FALSE, wxT("invalid value for timer timeout") ); - wxCHECK_MSG( m_info->m_task.tmAddr == NULL , FALSE, wxT("attempting to restart a timer") ); + wxCHECK_MSG( m_milli > 0, false, wxT("invalid value for timer timeout") ); + wxCHECK_MSG( m_info->m_task.tmAddr == NULL , false, wxT("attempting to restart a timer") ); #if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) m_info->m_task.tmAddr = NewTimerUPP( MacTimerProc ) ; @@ -119,7 +123,7 @@ bool wxTimer::Start(int milliseconds,bool mode) m_info->m_timer = this ; InsXTime((QElemPtr) &m_info->m_task ) ; PrimeTime( (QElemPtr) &m_info->m_task , m_milli ) ; - return TRUE; + return true; } void wxTimer::Stop() @@ -132,6 +136,3 @@ void wxTimer::Stop() } wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable() , this ) ; } - - - diff --git a/src/mac/corefoundation/hid.cpp b/src/mac/corefoundation/hid.cpp index 3717bcaefe..276571c883 100644 --- a/src/mac/corefoundation/hid.cpp +++ b/src/mac/corefoundation/hid.cpp @@ -27,6 +27,10 @@ //DARWIN _ONLY_ #ifdef __DARWIN__ +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/mac/corefoundation/hid.h" #include "wx/string.h" #include "wx/log.h" @@ -34,7 +38,6 @@ #include "wx/utils.h" #include "wx/module.h" -#include "wx/dynarray.h" // ============================================================================ // implementation @@ -49,12 +52,12 @@ // ---------------------------------------------------------------------------- // wxHIDDevice::Create // -// nClass is the HID Page such as +// nClass is the HID Page such as // kHIDPage_GenericDesktop // nType is the HID Usage such as // kHIDUsage_GD_Joystick,kHIDUsage_GD_Mouse,kHIDUsage_GD_Keyboard // nDev is the device number to use -// +// // ---------------------------------------------------------------------------- bool wxHIDDevice::Create (int nClass, int nType, int nDev) { @@ -97,13 +100,13 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) //Now get the maching services io_iterator_t pIterator; - if( IOServiceGetMatchingServices(m_pPort, + if( IOServiceGetMatchingServices(m_pPort, pDictionary, &pIterator) != kIOReturnSuccess ) { wxLogSysError(_T("No Matching HID Services")); return false; } - + //Were there any devices matched? if(pIterator == 0) return false; // No devices found @@ -134,15 +137,15 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) // //Get [product] name - CFStringRef cfsProduct = (CFStringRef) + CFStringRef cfsProduct = (CFStringRef) CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductKey)); - m_szProductName = - wxMacCFStringHolder( cfsProduct, - false + m_szProductName = + wxMacCFStringHolder( cfsProduct, + false ).AsString(); //Get the Product ID Key - CFNumberRef cfnProductId = (CFNumberRef) + CFNumberRef cfnProductId = (CFNumberRef) CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDProductIDKey)); if (cfnProductId) { @@ -150,7 +153,7 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) } //Get the Vendor ID Key - CFNumberRef cfnVendorId = (CFNumberRef) + CFNumberRef cfnVendorId = (CFNumberRef) CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDVendorIDKey)); if (cfnVendorId) { @@ -164,9 +167,9 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) //Create the interface (good grief - long function names!) SInt32 nScore; IOCFPlugInInterface** ppPlugin; - if(IOCreatePlugInInterfaceForService(pObject, + if(IOCreatePlugInInterfaceForService(pObject, kIOHIDDeviceUserClientTypeID, - kIOCFPlugInInterfaceID, &ppPlugin, + kIOCFPlugInInterfaceID, &ppPlugin, &nScore) != kIOReturnSuccess) { wxLogSysError(wxT("Could not create HID Interface for product")); @@ -179,7 +182,7 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) //Get the HID interface from the plugin to the mach port if((*ppPlugin)->QueryInterface(ppPlugin, - CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), + CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID), (void**) &m_ppDevice) != S_OK) { wxLogSysError(wxT("Could not get device interface from HID interface")); @@ -194,12 +197,12 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) wxLogDebug(_T("HID device: open failed")); // - //Now the hard part - in order to scan things we need "cookies" + //Now the hard part - in order to scan things we need "cookies" // - CFArrayRef cfaCookies = (CFArrayRef)CFDictionaryGetValue(pDictionary, + CFArrayRef cfaCookies = (CFArrayRef)CFDictionaryGetValue(pDictionary, CFSTR(kIOHIDElementKey)); BuildCookies(cfaCookies); - + //cleanup CFRelease(pDictionary); IOObjectRelease(pObject); @@ -209,7 +212,7 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) return true; } - + //iterator cleanup IOObjectRelease(pIterator); @@ -231,7 +234,7 @@ size_t wxHIDDevice::GetCount (int nClass, int nType) wxLogSysError(wxT("Could not create mach port")); return false; } - + //Dictionary that will hold first //the matching dictionary for determining which kind of devices we want, //then later some registry properties from an iterator (see below) @@ -260,14 +263,14 @@ size_t wxHIDDevice::GetCount (int nClass, int nType) //Now get the maching services io_iterator_t pIterator; - if( IOServiceGetMatchingServices(pPort, + if( IOServiceGetMatchingServices(pPort, pDictionary, &pIterator) != kIOReturnSuccess ) { wxLogSysError(_T("No Matching HID Services")); return false; } - - //If the iterator doesn't exist there are no devices :) + + //If the iterator doesn't exist there are no devices :) if ( !pIterator ) return 0; @@ -279,11 +282,11 @@ size_t wxHIDDevice::GetCount (int nClass, int nType) ++nCount; IOObjectRelease(pObject); } - + //cleanup IOObjectRelease(pIterator); mach_port_deallocate(mach_task_self(), pPort); - + return nCount; }//end Create() @@ -341,7 +344,7 @@ void wxHIDDevice::InitCookies(size_t dwSize, bool bQueue) wxLogDebug(_T("HID device: create failed")); } } - + //make sure that cookie array is clear memset(m_pCookies, 0, sizeof(*m_pCookies) * dwSize); } @@ -361,7 +364,7 @@ bool wxHIDDevice::IsActive(int nIndex) //check here return false; } - + IOHIDEventStruct Event; (*m_ppDevice)->getElementValue(m_ppDevice, m_pCookies[nIndex], &Event); return !!Event.value; @@ -426,7 +429,7 @@ enum // ---------------------------------------------------------------------------- int wxHIDKeyboard::GetCount() { - return wxHIDDevice::GetCount(kHIDPage_GenericDesktop, + return wxHIDDevice::GetCount(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard); } @@ -437,7 +440,7 @@ int wxHIDKeyboard::GetCount() // ---------------------------------------------------------------------------- bool wxHIDKeyboard::Create(int nDev /* = 1*/) { - return wxHIDDevice::Create(kHIDPage_GenericDesktop, + return wxHIDDevice::Create(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard, nDev); } @@ -445,7 +448,7 @@ bool wxHIDKeyboard::Create(int nDev /* = 1*/) // ---------------------------------------------------------------------------- // wxHIDKeyboard::AddCookie // -// Overloaded version of wxHIDDevice::AddCookie that simply does not +// Overloaded version of wxHIDDevice::AddCookie that simply does not // add a cookie if a duplicate is found // ---------------------------------------------------------------------------- void wxHIDKeyboard::AddCookie(CFTypeRef Data, int i) @@ -462,9 +465,9 @@ void wxHIDKeyboard::AddCookie(CFTypeRef Data, int i) // ---------------------------------------------------------------------------- void wxHIDKeyboard::BuildCookies(CFArrayRef Array) { - //Create internal cookie array + //Create internal cookie array InitCookies(500); - + //Begin recursing in array DoBuildCookies(Array); } @@ -478,7 +481,7 @@ void wxHIDKeyboard::DoBuildCookies(CFArrayRef Array) for (i = 0; i < CFArrayGetCount(Array); ++i) { const void* ref = CFDictionaryGetValue( - (CFDictionaryRef)CFArrayGetValueAtIndex(Array, i), + (CFDictionaryRef)CFArrayGetValueAtIndex(Array, i), CFSTR(kIOHIDElementKey) ); @@ -493,17 +496,17 @@ void wxHIDKeyboard::DoBuildCookies(CFArrayRef Array) // Get the usage # // CFNumberGetValue( - (CFNumberRef) - CFDictionaryGetValue((CFDictionaryRef) - CFArrayGetValueAtIndex(Array, i), + (CFNumberRef) + CFDictionaryGetValue((CFDictionaryRef) + CFArrayGetValueAtIndex(Array, i), CFSTR(kIOHIDElementUsageKey) ), - kCFNumberLongType, + kCFNumberLongType, &nUsage); // // Now translate the usage # into a wx keycode - // + // // // OK, this is strange - basically this kind of strange - @@ -524,7 +527,7 @@ void wxHIDKeyboard::DoBuildCookies(CFArrayRef Array) // bEOTriggered = true; //} //Instead of that though we now just don't add duplicate keys - + if (nUsage >= kHIDUsage_KeyboardA && nUsage <= kHIDUsage_KeyboardZ) AddCookie(CFArrayGetValueAtIndex(Array, i), 'A' + (nUsage - kHIDUsage_KeyboardA) ); else if (nUsage >= kHIDUsage_Keyboard1 && nUsage <= kHIDUsage_Keyboard9) @@ -670,7 +673,7 @@ bool wxGetKeyState (wxKeyCode key) if (wxHIDModule::sm_keyboards.GetCount() == 0) { int nKeyboards = wxHIDKeyboard::GetCount(); - + for(int i = 1; i <= nKeyboards; ++i) { wxHIDKeyboard* keyboard = new wxHIDKeyboard(); @@ -693,7 +696,7 @@ bool wxGetKeyState (wxKeyCode key) { wxHIDKeyboard* keyboard = (wxHIDKeyboard*) wxHIDModule::sm_keyboards[i]; - + switch(key) { case WXK_SHIFT: @@ -732,7 +735,7 @@ bool wxGetKeyState (wxKeyCode key) break; } } - + return false; //not down/error } diff --git a/src/mgl/fontenum.cpp b/src/mgl/fontenum.cpp index 58866a8120..2bc8300d33 100644 --- a/src/mgl/fontenum.cpp +++ b/src/mgl/fontenum.cpp @@ -22,7 +22,10 @@ // headers // ---------------------------------------------------------------------------- -#include "wx/dynarray.h" +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/string.h" #include "wx/utils.h" diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index cc73babadf..23bd098612 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -14,14 +14,17 @@ #if wxUSE_LISTBOX +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #ifdef __VMS #define XtParent XTPARENT #define XtDisplay XTDISPLAY #endif -# include "wx/listbox.h" +#include "wx/listbox.h" #include "wx/settings.h" -#include "wx/dynarray.h" #include "wx/log.h" #include "wx/utils.h" #include "wx/arrstr.h" diff --git a/src/msdos/mimetype.cpp b/src/msdos/mimetype.cpp index 2966f22f65..d3aaab0001 100644 --- a/src/msdos/mimetype.cpp +++ b/src/msdos/mimetype.cpp @@ -19,6 +19,7 @@ #if wxUSE_MIMETYPE #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/string.h" #if wxUSE_GUI #include "wx/icon.h" @@ -28,7 +29,6 @@ #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" #include "wx/msdos/mimetype.h" @@ -65,7 +65,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& WXUNUSED(extensions)) bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const { - if ( m_strFileType.Length() > 0 ) + if ( !m_strFileType.empty() ) { *mimeType = m_strFileType ; return true ; diff --git a/src/msw/app.cpp b/src/msw/app.cpp index e7733b748c..6ba5c68d00 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -25,6 +25,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/app.h" #include "wx/utils.h" @@ -38,7 +39,6 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/wxchar.h" #include "wx/icon.h" #include "wx/log.h" @@ -313,7 +313,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // fails to find a device. SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); #endif - + wxOleInitialize(); RegisterWindowClasses(); @@ -591,7 +591,7 @@ int wxApp::GetComCtl32Version() // we're prepared to handle the errors wxLogNull noLog; - + #if wxUSE_DYNLIB_CLASS // do we have it? wxDynamicLibrary dllComCtl32(_T("comctl32.dll"), wxDL_VERBATIM); @@ -650,7 +650,7 @@ int wxApp::GetComCtl32Version() } } } -#endif +#endif } return s_verComCtl32; diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 2dd19b26f2..9266bf1b73 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -28,9 +28,9 @@ #if wxUSE_DISPLAY #ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/dynarray.h" - #include "wx/frame.h" + #include "wx/dynarray.h" + #include "wx/app.h" + #include "wx/frame.h" #endif #include "wx/dynload.h" @@ -69,7 +69,7 @@ #define MONITOR_DEFAULTTONULL 0x00000000 #define MONITOR_DEFAULTTOPRIMARY 0x00000001 #define MONITOR_DEFAULTTONEAREST 0x00000002 - #define MONITORINFOF_PRIMARY 0x00000001 + #define MONITORINFOF_PRIMARY 0x00000001 #define HMONITOR_DECLARED #endif #endif // !__WXWINCE__ diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index a84b90756a..5761d72e19 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -13,22 +13,22 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/event.h" - #include "wx/app.h" - #include "wx/utils.h" -#endif //WX_PRECOMP - // Doesn't yet compile in Unicode mode #if wxUSE_CONFIG && !wxUSE_UNICODE -#include "wx/dynarray.h" +#ifndef WX_PRECOMP + #include "wx/dynarray.h" + #include "wx/string.h" + #include "wx/intl.h" + #include "wx/event.h" + #include "wx/app.h" + #include "wx/utils.h" +#endif //WX_PRECOMP + #include "wx/log.h" #include "wx/config.h" #include "wx/file.h" @@ -64,21 +64,21 @@ wxIniConfig::wxIniConfig(const wxString& strAppName, : wxConfigBase(strAppName, strVendor, localFilename, globalFilename, style) #if 0 // This is too complex for some compilers, e.g. BC++ 5.01 - : wxConfigBase((strAppName.IsEmpty() && wxTheApp) ? wxTheApp->GetAppName() + : wxConfigBase((strAppName.empty() && wxTheApp) ? wxTheApp->GetAppName() : strAppName, - strVendor.IsEmpty() ? (wxTheApp ? wxTheApp->GetVendorName() + strVendor.empty() ? (wxTheApp ? wxTheApp->GetVendorName() : strAppName) : strVendor, localFilename, globalFilename, style) #endif { - if (strAppName.IsEmpty() && wxTheApp) + if (strAppName.empty() && wxTheApp) SetAppName(wxTheApp->GetAppName()); - if (strVendor.IsEmpty() && wxTheApp) + if (strVendor.empty() && wxTheApp) SetVendorName(wxTheApp->GetVendorName()); m_strLocalFilename = localFilename; - if (m_strLocalFilename.IsEmpty()) + if (m_strLocalFilename.empty()) { m_strLocalFilename = GetAppName() + wxT(".ini"); } @@ -107,7 +107,7 @@ void wxIniConfig::SetPath(const wxString& strPath) { wxArrayString aParts; - if ( strPath.IsEmpty() ) { + if ( strPath.empty() ) { // nothing } else if ( strPath[0u] == wxCONFIG_PATH_SEPARATOR ) { @@ -139,7 +139,7 @@ void wxIniConfig::SetPath(const wxString& strPath) // other functions assume that all this is true, i.e. there are no trailing // underscores at the end except if the group is the root one - wxASSERT( (m_strPath.IsEmpty() || m_strPath.Last() != PATH_SEP_REPLACE) && + wxASSERT( (m_strPath.empty() || m_strPath.Last() != PATH_SEP_REPLACE) && (m_strGroup == wxString(PATH_SEP_REPLACE) || m_strGroup.Last() != PATH_SEP_REPLACE) ); } @@ -156,7 +156,7 @@ const wxString& wxIniConfig::GetPath() const } else { s_str << m_strGroup; - if ( !m_strPath.IsEmpty() ) + if ( !m_strPath.empty() ) s_str << wxCONFIG_PATH_SEPARATOR; for ( const char *p = m_strPath; *p != '\0'; p++ ) { s_str << (*p == PATH_SEP_REPLACE ? wxCONFIG_PATH_SEPARATOR : *p); @@ -170,7 +170,7 @@ wxString wxIniConfig::GetPrivateKeyName(const wxString& szKey) const { wxString strKey; - if ( !m_strPath.IsEmpty() ) + if ( !m_strPath.empty() ) strKey << m_strPath << PATH_SEP_REPLACE; strKey << szKey; @@ -184,7 +184,7 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const if ( m_strGroup != wxString(PATH_SEP_REPLACE) ) strKey << m_strGroup << PATH_SEP_REPLACE; - if ( !m_strPath.IsEmpty() ) + if ( !m_strPath.empty() ) strKey << m_strPath << PATH_SEP_REPLACE; strKey << szKey; @@ -199,30 +199,30 @@ wxString wxIniConfig::GetKeyName(const wxString& szKey) const // not implemented bool wxIniConfig::GetFirstGroup(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return false; + return false; } bool wxIniConfig::GetNextGroup (wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return false; + return false; } bool wxIniConfig::GetFirstEntry(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return false; + return false; } bool wxIniConfig::GetNextEntry (wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return false; + return false; } // ---------------------------------------------------------------------------- @@ -232,47 +232,47 @@ bool wxIniConfig::GetNextEntry (wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) // not implemented size_t wxIniConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return (size_t)-1; + return (size_t)-1; } size_t wxIniConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return (size_t)-1; + return (size_t)-1; } bool wxIniConfig::HasGroup(const wxString& WXUNUSED(strName)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return false; + return false; } bool wxIniConfig::HasEntry(const wxString& WXUNUSED(strName)) const { - wxFAIL_MSG("not implemented"); + wxFAIL_MSG("not implemented"); - return false; + return false; } // is current group empty? bool wxIniConfig::IsEmpty() const { - char szBuf[1024]; + char szBuf[1024]; - GetPrivateProfileString(m_strGroup, NULL, "", - szBuf, WXSIZEOF(szBuf), m_strLocalFilename); - if ( !::IsEmpty(szBuf) ) - return false; + GetPrivateProfileString(m_strGroup, NULL, "", + szBuf, WXSIZEOF(szBuf), m_strLocalFilename); + if ( !::IsEmpty(szBuf) ) + return false; - GetProfileString(m_strGroup, NULL, "", szBuf, WXSIZEOF(szBuf)); - if ( !::IsEmpty(szBuf) ) - return false; + GetProfileString(m_strGroup, NULL, "", szBuf, WXSIZEOF(szBuf)); + if ( !::IsEmpty(szBuf) ) + return false; - return true; + return true; } // ---------------------------------------------------------------------------- diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 578f993b1a..f5c67dba29 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -19,12 +19,13 @@ #if wxUSE_LISTBOX #ifndef WX_PRECOMP -#include "wx/listbox.h" -#include "wx/settings.h" -#include "wx/brush.h" -#include "wx/font.h" -#include "wx/dc.h" -#include "wx/utils.h" + #include "wx/dynarray.h" + #include "wx/listbox.h" + #include "wx/settings.h" + #include "wx/brush.h" + #include "wx/font.h" + #include "wx/dc.h" + #include "wx/utils.h" #endif #include "wx/window.h" @@ -32,7 +33,6 @@ #include -#include "wx/dynarray.h" #include "wx/log.h" #if wxUSE_OWNER_DRAWN diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 0525d92b49..9dedef77d5 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -13,12 +13,13 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif #if wxUSE_MIMETYPE #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/string.h" #if wxUSE_GUI #include "wx/icon.h" @@ -30,7 +31,6 @@ #include "wx/file.h" #include "wx/iconloc.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" #ifdef __WXMSW__ diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 21a7755a45..b1fe59c5ea 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/tbar95.cpp +// Name: src/msw/tbar95.cpp // Purpose: wxToolBar // Author: Julian Smart // Modified by: @@ -24,19 +24,19 @@ #pragma hdrstop #endif +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && !defined(__SMARTPHONE__) + #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/log.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/settings.h" #include "wx/bitmap.h" #include "wx/dcmemory.h" #include "wx/control.h" #endif -#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && !defined(__SMARTPHONE__) - #include "wx/toolbar.h" #include "wx/sysopt.h" #include "wx/image.h" @@ -1659,4 +1659,3 @@ WXHBITMAP wxToolBar::MapBitmap(WXHBITMAP bitmap, int width, int height) #endif // wxREMAP_BUTTON_COLOURS #endif // wxUSE_TOOLBAR - diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 52c7d9f768..b6d787a4a3 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -26,6 +26,10 @@ #if wxUSE_TREECTRL +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/msw/private.h" // include "properly" @@ -39,7 +43,6 @@ #include "wx/app.h" #include "wx/log.h" -#include "wx/dynarray.h" #include "wx/imaglist.h" #include "wx/settings.h" #include "wx/treectrl.h" diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 9d9cf88f7e..5919c6a704 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -24,21 +24,21 @@ #pragma hdrstop #endif +// Use the WinCE-specific toolbar only if we're either compiling +// with a WinCE earlier than 4, or we wish to emulate a PocketPC-style UI +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) + #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/log.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/settings.h" #include "wx/bitmap.h" #include "wx/dcmemory.h" #include "wx/control.h" #endif -// Use the WinCE-specific toolbar only if we're either compiling -// with a WinCE earlier than 4, or we wish to emulate a PocketPC-style UI -#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || defined(__POCKETPC__) || defined(__SMARTPHONE__)) - #include "wx/toolbar.h" #if !defined(__GNUWIN32__) && !defined(__SALFORDC__) diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 55c540bcd5..050117d47f 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: app.cpp +// Name: src/os2/app.cpp // Purpose: wxApp // Author: David Webster // Modified by: @@ -13,6 +13,7 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/app.h" #include "wx/utils.h" @@ -26,7 +27,6 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/wxchar.h" #include "wx/icon.h" #include "wx/stdpaths.h" @@ -122,7 +122,7 @@ struct GsocketCallbackInfo{ void wxApp::HandleSockets() { - bool pendingEvent = FALSE; + bool pendingEvent = false; // Check whether it's time for Gsocket operation if (m_maxSocketHandles > 0 && m_maxSocketNr > 0) @@ -151,7 +151,7 @@ void wxApp::HandleSockets() if (r < m_maxSocketHandles) { CallbackInfo[r].proc(CallbackInfo[r].gsock); - pendingEvent = TRUE; + pendingEvent = true; } } if (FD_ISSET(i, &writefds)) @@ -164,7 +164,7 @@ void wxApp::HandleSockets() if (r < m_maxSocketHandles) { CallbackInfo[r].proc(CallbackInfo[r].gsock); - pendingEvent = TRUE; + pendingEvent = true; } } } @@ -228,7 +228,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // TODO: at least give some error message here... wxAppBase::CleanUp(); - return FALSE; + return false; } wxBuffer = new wxChar[1500]; // FIXME; why? @@ -252,7 +252,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) RegisterWindowClasses(vHabmain); - return TRUE; + return true; } // end of wxApp::Initialize const char* CANTREGISTERCLASS = " Can't register Class "; @@ -260,12 +260,10 @@ const char* CANTREGISTERCLASS = " Can't register Class " // RegisterWindowClasses // --------------------------------------------------------------------------- -bool wxApp::RegisterWindowClasses( - HAB vHab -) +bool wxApp::RegisterWindowClasses( HAB vHab ) { - ERRORID vError = 0L; - wxString sError; + ERRORID vError = 0L; + wxString sError; if (!::WinRegisterClass( vHab ,(PSZ)wxFrameClassName @@ -277,7 +275,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -290,7 +288,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -303,7 +301,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -316,7 +314,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -329,7 +327,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -342,7 +340,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -355,7 +353,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -368,7 +366,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab ,(PSZ)wxCanvasClassNameNR @@ -380,9 +378,9 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } - return TRUE; + return true; } // end of wxApp::RegisterWindowClasses // @@ -397,7 +395,7 @@ void wxApp::CleanUp() // PM-SPECIFIC CLEANUP // - // wxSetKeyboardHook(FALSE); + // wxSetKeyboardHook(false); if (wxSTD_FRAME_ICON) ::WinFreeFileIcon(wxSTD_FRAME_ICON); @@ -430,11 +428,11 @@ void wxApp::CleanUp() bool wxApp::OnInitGui() { - ERRORID vError; - wxString sError; + ERRORID vError; + wxString sError; if (!wxAppBase::OnInitGui()) - return FALSE; + return false; m_hMq = ::WinCreateMsgQueue(vHabmain, 0); if (!m_hMq) @@ -442,10 +440,10 @@ bool wxApp::OnInitGui() vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); wxLogDebug(sError); - return FALSE; + return false; } - return TRUE; + return true; } // end of wxApp::OnInitGui wxApp::wxApp() @@ -475,13 +473,10 @@ wxApp::~wxApp() #endif } // end of wxApp::~wxApp -bool gbInOnIdle = FALSE; +bool gbInOnIdle = false; -void wxApp::OnIdle( - wxIdleEvent& rEvent -) +void wxApp::OnIdle( wxIdleEvent& rEvent ) { - // // Avoid recursion (via ProcessEvent default case) // @@ -502,28 +497,26 @@ void wxApp::OnIdle( wxDC::ClearCache(); #endif // wxUSE_DC_CACHEING - gbInOnIdle = FALSE; + gbInOnIdle = false; } // end of wxApp::OnIdle void wxApp::OnEndSession( wxCloseEvent& WXUNUSED(rEvent)) { if (GetTopWindow()) - GetTopWindow()->Close(TRUE); + GetTopWindow()->Close(true); } // end of wxApp::OnEndSession // // Default behaviour: close the application with prompts. The // user can veto the close, and therefore the end session. // -void wxApp::OnQueryEndSession( - wxCloseEvent& rEvent -) +void wxApp::OnQueryEndSession( wxCloseEvent& rEvent ) { if (GetTopWindow()) { if (!GetTopWindow()->Close(!rEvent.CanVeto())) - rEvent.Veto(TRUE); + rEvent.Veto(true); } } // end of wxApp::OnQueryEndSession @@ -532,7 +525,7 @@ void wxApp::OnQueryEndSession( // bool wxApp::Yield(bool onlyIfNeeded) { - static bool s_inYield = FALSE; + static bool s_inYield = false; if ( s_inYield ) { @@ -541,11 +534,11 @@ bool wxApp::Yield(bool onlyIfNeeded) wxFAIL_MSG( _T("wxYield() called recursively") ); } - return FALSE; + return false; } - HAB vHab = 0; - QMSG vMsg; + HAB vHab = 0; + QMSG vMsg; // // Disable log flushing from here because a call to wxYield() shouldn't @@ -553,7 +546,7 @@ bool wxApp::Yield(bool onlyIfNeeded) // wxLog::Suspend(); - s_inYield = TRUE; + s_inYield = true; // // We want to go back to the main message loop @@ -578,8 +571,8 @@ bool wxApp::Yield(bool onlyIfNeeded) // Let the logs be flashed again // wxLog::Resume(); - s_inYield = FALSE; - return TRUE; + s_inYield = false; + return true; } // end of wxYield int wxApp::AddSocketHandler(int handle, int mask, diff --git a/src/os2/iniconf.cpp b/src/os2/iniconf.cpp index d5730815d0..db81983a3a 100644 --- a/src/os2/iniconf.cpp +++ b/src/os2/iniconf.cpp @@ -12,19 +12,20 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_CONFIG + #ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/event.h" - #include "wx/app.h" - #include "wx/utils.h" + #include "wx/dynarray.h" + #include "wx/string.h" + #include "wx/intl.h" + #include "wx/event.h" + #include "wx/app.h" + #include "wx/utils.h" #endif //WX_PRECOMP -#include "wx/dynarray.h" #include "wx/log.h" #include "wx/config.h" -#if wxUSE_CONFIG #include "wx/os2/iniconf.h" diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 410fe754da..eea8872b6b 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -14,24 +14,24 @@ #if wxUSE_LISTBOX -#include "wx/window.h" -#include "wx/os2/private.h" - #ifndef WX_PRECOMP -#include "wx/listbox.h" -#include "wx/settings.h" -#include "wx/brush.h" -#include "wx/font.h" -#include "wx/dc.h" -#include "wx/dcscreen.h" -#include "wx/utils.h" -#include "wx/scrolwin.h" + #include "wx/dynarray.h" + #include "wx/listbox.h" + #include "wx/settings.h" + #include "wx/brush.h" + #include "wx/font.h" + #include "wx/dc.h" + #include "wx/dcscreen.h" + #include "wx/utils.h" + #include "wx/scrolwin.h" #endif +#include "wx/window.h" +#include "wx/os2/private.h" + #define INCL_M #include -#include "wx/dynarray.h" #include "wx/log.h" #if wxUSE_OWNER_DRAWN diff --git a/src/os2/mimetype.cpp b/src/os2/mimetype.cpp index 43d09ca099..7dbd51fc74 100644 --- a/src/os2/mimetype.cpp +++ b/src/os2/mimetype.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/mimetype.cpp +// Name: src/os2/mimetype.cpp // Purpose: classes and functions to manage MIME types // Author: David Webster // Modified by: @@ -12,27 +12,27 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_MIMETYPE + +#ifndef WX_PRECOMP + #include "wx/dynarray.h" + #include "wx/string.h" + #if wxUSE_GUI + #include "wx/icon.h" + #endif +#endif //WX_PRECOMP + #define INCL_DOS #define INCL_GPI #define INCL_WIN #include -#ifndef WX_PRECOMP - #include "wx/string.h" - #if wxUSE_GUI - #include "wx/icon.h" - #endif -#endif //WX_PRECOMP - #include "wx/log.h" #include "wx/file.h" #include "wx/iconloc.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" -#if wxUSE_MIMETYPE - #include "wx/os2/mimetype.h" // other standard headers diff --git a/src/os2/treectrl.cpp b/src/os2/treectrl.cpp index 2a3742d8a3..da60f7a692 100644 --- a/src/os2/treectrl.cpp +++ b/src/os2/treectrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/treectrl.cpp +// Name: src/os2/treectrl.cpp // Purpose: wxTreeCtrl // Author: Julian Smart // Modified by: Vadim Zeitlin to be less MSW-specific on 10.10.98 @@ -26,11 +26,14 @@ #if wxUSE_TREECTRL +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/os2/private.h" #include "wx/app.h" #include "wx/log.h" -#include "wx/dynarray.h" #include "wx/imaglist.h" #include "wx/settings.h" #include "wx/os2/treectrl.h" diff --git a/src/palmos/app.cpp b/src/palmos/app.cpp index fb37d4eb44..508e073e87 100644 --- a/src/palmos/app.cpp +++ b/src/palmos/app.cpp @@ -25,6 +25,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/app.h" #include "wx/utils.h" @@ -38,7 +39,6 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/wxchar.h" #include "wx/icon.h" #include "wx/log.h" diff --git a/src/palmos/listbox.cpp b/src/palmos/listbox.cpp index 24f38de7a9..a1655ba2ec 100644 --- a/src/palmos/listbox.cpp +++ b/src/palmos/listbox.cpp @@ -19,18 +19,18 @@ #if wxUSE_LISTBOX #ifndef WX_PRECOMP -#include "wx/listbox.h" -#include "wx/settings.h" -#include "wx/brush.h" -#include "wx/font.h" -#include "wx/dc.h" -#include "wx/utils.h" + #include "wx/dynarray.h" + #include "wx/listbox.h" + #include "wx/settings.h" + #include "wx/brush.h" + #include "wx/font.h" + #include "wx/dc.h" + #include "wx/utils.h" #endif #include "wx/window.h" #include "wx/palmos/private.h" -#include "wx/dynarray.h" #include "wx/log.h" #if wxUSE_OWNER_DRAWN diff --git a/src/palmos/toolbar.cpp b/src/palmos/toolbar.cpp index df42ca9892..4eece9ff42 100644 --- a/src/palmos/toolbar.cpp +++ b/src/palmos/toolbar.cpp @@ -24,19 +24,19 @@ #pragma hdrstop #endif +#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE + #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/log.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/settings.h" #include "wx/bitmap.h" #include "wx/dcmemory.h" #include "wx/control.h" #endif -#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE - #include "wx/toolbar.h" #include "wx/sysopt.h" @@ -268,4 +268,3 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event) } #endif // wxUSE_TOOLBAR - diff --git a/src/palmos/treectrl.cpp b/src/palmos/treectrl.cpp index 41a4abbea1..f8aa33d8a9 100644 --- a/src/palmos/treectrl.cpp +++ b/src/palmos/treectrl.cpp @@ -26,11 +26,14 @@ #if wxUSE_TREECTRL +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/palmos/private.h" #include "wx/app.h" #include "wx/log.h" -#include "wx/dynarray.h" #include "wx/imaglist.h" #include "wx/settings.h" @@ -722,4 +725,3 @@ int wxTreeCtrl::GetState(const wxTreeItemId& node) } #endif // wxUSE_TREECTRL - diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index 598fbad77f..b42d4462a0 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -21,22 +21,22 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif -#include "wx/display.h" -#include "wx/display_impl.h" -#include "wx/intl.h" -#include "wx/log.h" +#if wxUSE_DISPLAY #ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/gdicmn.h" - #include "wx/string.h" - #include "wx/utils.h" + #include "wx/dynarray.h" + #include "wx/gdicmn.h" + #include "wx/string.h" + #include "wx/utils.h" #endif /* WX_PRECOMP */ -#if wxUSE_DISPLAY +#include "wx/display.h" +#include "wx/display_impl.h" +#include "wx/intl.h" +#include "wx/log.h" /* These must be included after the wx files. Otherwise the Data macro in * Xlibint.h conflicts with a function declaration in wx/list.h. */ diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index 0496afeeef..3f4f7ae079 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -20,7 +20,10 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/dynarray.h" +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/string.h" #include "wx/regex.h" #include "wx/utils.h" diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 8a91d72f82..aa2d4f3d63 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -39,13 +39,13 @@ #if wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/string.h" #endif #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" #include "wx/ffile.h" diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index d1a8b82f60..d7237bb471 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: threadpsx.cpp +// Name: src/unix/threadpsx.cpp // Purpose: wxThread (Posix) Implementation // Author: Original from Wolfram Gloger/Guilhem Lavaux // Modified by: K. S. Sreeram (2002): POSIXified wxCondition, added wxSemaphore @@ -26,12 +26,15 @@ #if wxUSE_THREADS +#ifndef WX_PRECOMP + #include "wx/dynarray.h" +#endif + #include "wx/thread.h" #include "wx/module.h" #include "wx/utils.h" #include "wx/log.h" #include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/timer.h" #include "wx/stopwatch.h" @@ -481,7 +484,7 @@ wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) { wxFAIL_MSG( _T("wxSemaphore: invalid initial or maximal count") ); - m_isOk = FALSE; + m_isOk = false; } else { @@ -649,7 +652,7 @@ public: pthread_t GetId() const { return m_threadId; } pthread_t *GetIdPtr() { return &m_threadId; } // "cancelled" flag - void SetCancelFlag() { m_cancelled = TRUE; } + void SetCancelFlag() { m_cancelled = true; } bool WasCancelled() const { return m_cancelled; } // exit code void SetExitCode(wxThread::ExitCode exitcode) { m_exitcode = exitcode; } @@ -664,8 +667,8 @@ public: { wxCriticalSectionLocker lock(m_csJoinFlag); - m_shouldBeJoined = FALSE; - m_isDetached = TRUE; + m_shouldBeJoined = false; + m_isDetached = true; } #ifdef wxHAVE_PTHREAD_CLEANUP @@ -841,17 +844,17 @@ void wxThreadInternal::Cleanup(wxThread *thread) wxThreadInternal::wxThreadInternal() { m_state = STATE_NEW; - m_cancelled = FALSE; + m_cancelled = false; m_prio = WXTHREAD_DEFAULT_PRIORITY; m_threadId = 0; m_exitcode = 0; - // set to TRUE only when the thread starts waiting on m_semSuspend - m_isPaused = FALSE; + // set to true only when the thread starts waiting on m_semSuspend + m_isPaused = false; // defaults for joinable threads - m_shouldBeJoined = TRUE; - m_isDetached = FALSE; + m_shouldBeJoined = true; + m_isDetached = false; } wxThreadInternal::~wxThreadInternal() @@ -904,7 +907,7 @@ void wxThreadInternal::Wait() wxLogError(_("Failed to join a thread, potential memory leak detected - please restart the program")); } - m_shouldBeJoined = FALSE; + m_shouldBeJoined = false; } } @@ -943,7 +946,7 @@ void wxThreadInternal::Resume() m_semSuspend.Post(); // reset the flag - SetReallyPaused(FALSE); + SetReallyPaused(false); } else { @@ -1507,7 +1510,7 @@ bool wxThread::TestDestroy() if ( m_internal->GetState() == STATE_PAUSED ) { - m_internal->SetReallyPaused(TRUE); + m_internal->SetReallyPaused(true); // leave the crit section or the other threads will stop too if they // try to call any of (seemingly harmless) IsXXX() functions while we @@ -1566,10 +1569,10 @@ bool wxThread::IsAlive() const { case STATE_RUNNING: case STATE_PAUSED: - return TRUE; + return true; default: - return FALSE; + return false; } } @@ -1603,7 +1606,7 @@ bool wxThreadModule::OnInit() { wxLogSysError(rc, _("Thread module initialization failed: failed to create thread key")); - return FALSE; + return false; } gs_tidMain = pthread_self(); @@ -1614,7 +1617,7 @@ bool wxThreadModule::OnInit() gs_mutexDeleteThread = new wxMutex(); gs_condAllDeleted = new wxCondition( *gs_mutexDeleteThread ); - return TRUE; + return true; } void wxThreadModule::OnExit() @@ -1720,4 +1723,3 @@ void wxMutexGuiLeave() #include "wx/thrimpl.cpp" #endif // wxUSE_THREADS - -- 2.45.2