From 18680f86512504f043ad5d0b222afc7be87aa3e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 15 Jun 2006 17:58:49 +0000 Subject: [PATCH] Include wx/math.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wx.h | 1 + src/cocoa/dc.mm | 2 +- src/common/config.cpp | 2 +- src/common/datstrm.cpp | 5 +- src/common/dcbase.cpp | 7 +- src/common/image.cpp | 2 +- src/common/longlong.cpp | 18 ++- src/common/matrix.cpp | 6 +- src/common/variant.cpp | 2 +- src/generic/dcpsg.cpp | 2 +- src/generic/listctrl.cpp | 2 +- src/generic/sashwin.cpp | 3 +- src/generic/tabg.cpp | 6 +- src/gtk/bitmap.cpp | 3 +- src/gtk/dcclient.cpp | 3 +- src/gtk/gnome/gprint.cpp | 2 +- src/gtk/textctrl.cpp | 3 +- src/gtk/window.cpp | 2 +- src/gtk1/bitmap.cpp | 3 +- src/gtk1/dcclient.cpp | 3 +- src/gtk1/scrolbar.cpp | 2 +- src/gtk1/slider.cpp | 2 +- src/gtk1/spinbutt.cpp | 2 +- src/gtk1/spinctrl.cpp | 2 +- src/gtk1/textctrl.cpp | 9 +- src/gtk1/window.cpp | 2 +- src/html/m_image.cpp | 2 +- src/mac/carbon/dcclient.cpp | 2 +- src/mac/carbon/dcprint.cpp | 2 +- src/mac/carbon/mpthread.cpp | 305 +++++++++++++++++------------------ src/mac/carbon/printmac.cpp | 2 +- src/mac/carbon/thread.cpp | 21 ++- src/mac/classic/dcclient.cpp | 2 +- src/mac/classic/dcprint.cpp | 2 +- src/motif/bmpmotif.cpp | 6 +- src/motif/dcclient.cpp | 2 +- src/msw/colordlg.cpp | 2 +- src/msw/dcprint.cpp | 2 +- src/msw/filedlg.cpp | 2 +- src/msw/fontdlg.cpp | 3 +- src/msw/mediactrl.cpp | 2 +- src/msw/mediactrl_am.cpp | 2 +- src/msw/ole/activex.cpp | 3 +- src/msw/ole/automtn.cpp | 2 +- src/x11/bitmap.cpp | 2 +- src/x11/dcclient.cpp | 7 +- 46 files changed, 235 insertions(+), 234 deletions(-) diff --git a/include/wx/wx.h b/include/wx/wx.h index a3bb3bfe06..e204e289af 100644 --- a/include/wx/wx.h +++ b/include/wx/wx.h @@ -26,6 +26,7 @@ #include "wx/utils.h" #include "wx/stream.h" #include "wx/memory.h" +#include "wx/math.h" #if wxUSE_GUI diff --git a/src/cocoa/dc.mm b/src/cocoa/dc.mm index 4c1ad172aa..7541eaf8c3 100644 --- a/src/cocoa/dc.mm +++ b/src/cocoa/dc.mm @@ -15,6 +15,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/math.h" //math constants #endif //WX_PRECOMP #include "wx/cocoa/autorelease.h" @@ -30,7 +31,6 @@ #import #import -#include "wx/math.h" //math constants #include "wx/listimpl.cpp" WX_DEFINE_LIST(wxCocoaDCStack); diff --git a/src/common/config.cpp b/src/common/config.cpp index 19885d4a39..9f49fa0783 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -32,12 +32,12 @@ #include "wx/app.h" #include "wx/utils.h" #include "wx/arrstr.h" + #include "wx/math.h" #endif //WX_PRECOMP #if wxUSE_CONFIG && ((wxUSE_FILE && wxUSE_TEXTFILE) || wxUSE_CONFIG_NATIVE) #include "wx/file.h" -#include "wx/math.h" #include #include diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp index b4a4816f45..50e4eb4b2e 100644 --- a/src/common/datstrm.cpp +++ b/src/common/datstrm.cpp @@ -19,7 +19,10 @@ #if wxUSE_STREAMS #include "wx/datstrm.h" -#include "wx/math.h" + +#ifndef WX_PRECOMP + #include "wx/math.h" +#endif //WX_PRECOMP // --------------------------------------------------------------------------- // wxDataInputStream diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index f637c952d3..ef8918bbb5 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -25,7 +25,10 @@ #endif #include "wx/dc.h" -#include "wx/math.h" + +#ifndef WX_PRECOMP + #include "wx/math.h" +#endif // bool wxDCBase::sm_cacheing = false; @@ -414,7 +417,7 @@ bool wxDCBase::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) { int totalWidth = 0; - const size_t len = text.Length(); + const size_t len = text.length(); widths.Empty(); widths.Add(0, len); diff --git a/src/common/image.cpp b/src/common/image.cpp index 8711e3d1cd..0a67c8d50b 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -24,13 +24,13 @@ #include "wx/hash.h" #include "wx/utils.h" #include "wx/bitmap.h" + #include "wx/math.h" #endif #include "wx/filefn.h" #include "wx/wfstream.h" #include "wx/intl.h" #include "wx/module.h" -#include "wx/math.h" #if wxUSE_XPM #include "wx/xpmdecod.h" diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp index b8364d8579..360d087b3e 100644 --- a/src/common/longlong.cpp +++ b/src/common/longlong.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/longlong.cpp +// Name: src/common/longlong.cpp // Purpose: implementation of wxLongLongNative // Author: Jeffrey C. Ollie , Vadim Zeitlin // Remarks: this class is not public in wxWidgets 2.0! It is intentionally @@ -22,17 +22,21 @@ #endif #if wxUSE_LONGLONG + #include "wx/longlong.h" -#include "wx/math.h" // for fabs() + +#ifndef WX_PRECOMP + #include "wx/math.h" // for fabs() +#endif #if wxUSE_STREAMS -#include "wx/txtstrm.h" + #include "wx/txtstrm.h" #endif #if defined(__MWERKS__) && defined(__WXMSW__) -#include // for memset() + #include // for memset() #else -#include // for memset() + #include // for memset() #endif #include "wx/ioswrap.h" @@ -1257,7 +1261,7 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxString s = o.ReadWord(); ll = wxULongLong(0l, 0l); - size_t length = s.Length(); + size_t length = s.length(); size_t idx = 0; wxChar ch = READ_STRING_CHAR(s, idx, length); @@ -1282,7 +1286,7 @@ WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxString s = o.ReadWord(); ll = wxLongLong(0l, 0l); - size_t length = s.Length(); + size_t length = s.length(); size_t idx = 0; wxChar ch = READ_STRING_CHAR(s, idx, length); diff --git a/src/common/matrix.cpp b/src/common/matrix.cpp index 769dd965e1..f1f8c319f9 100644 --- a/src/common/matrix.cpp +++ b/src/common/matrix.cpp @@ -16,15 +16,15 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#include "wx/matrix.h" + #ifndef WX_PRECOMP #include "wx/math.h" #endif -#include "wx/matrix.h" - static const double pi = M_PI; wxTransformMatrix::wxTransformMatrix(void) diff --git a/src/common/variant.cpp b/src/common/variant.cpp index a45b3d7489..a1e7f8a8c3 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -20,6 +20,7 @@ #ifndef WX_PRECOMP #include "wx/string.h" + #include "wx/math.h" #if wxUSE_STREAMS #include "wx/stream.h" #endif @@ -44,7 +45,6 @@ using namespace std ; #include "wx/string.h" #include "wx/tokenzr.h" -#include "wx/math.h" IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject) diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index f57daec342..33bd3d37dd 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -25,6 +25,7 @@ #include "wx/app.h" #include "wx/utils.h" #include "wx/dcmemory.h" + #include "wx/math.h" #endif // WX_PRECOMP #include "wx/image.h" @@ -32,7 +33,6 @@ #include "wx/generic/prntdlgg.h" #include "wx/paper.h" #include "wx/filefn.h" -#include "wx/math.h" #include "wx/stdpaths.h" WXDLLIMPEXP_DATA_CORE(int) wxPageNumber; diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 161c1dedf2..93b28ecb70 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -50,11 +50,11 @@ #include "wx/dcscreen.h" #include "wx/textctrl.h" #include "wx/listbox.h" + #include "wx/math.h" #endif #include "wx/selstore.h" #include "wx/renderer.h" -#include "wx/math.h" #ifdef __WXMAC__ #include "wx/mac/private.h" diff --git a/src/generic/sashwin.cpp b/src/generic/sashwin.cpp index 3a4e2b6d97..fc30aba821 100644 --- a/src/generic/sashwin.cpp +++ b/src/generic/sashwin.cpp @@ -28,10 +28,9 @@ #include "wx/settings.h" #include "wx/dcclient.h" #include "wx/dcscreen.h" + #include "wx/math.h" #endif -#include "wx/math.h" - #include #include "wx/laywin.h" diff --git a/src/generic/tabg.cpp b/src/generic/tabg.cpp index 249395811a..cec7c1d37a 100644 --- a/src/generic/tabg.cpp +++ b/src/generic/tabg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: tabg.cpp +// Name: src/generic/tabg.cpp // Purpose: Generic tabbed dialogs // Author: Julian Smart // Modified by: @@ -13,7 +13,7 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_TAB_DIALOG @@ -22,13 +22,13 @@ #include "wx/settings.h" #include "wx/intl.h" #include "wx/dcclient.h" + #include "wx/math.h" #endif #include #include #include -#include "wx/math.h" #include "wx/tab.h" #include "wx/listimpl.cpp" diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index b04bbe3905..46dd9e5229 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -17,6 +17,7 @@ #include "wx/dcmemory.h" #include "wx/palette.h" #include "wx/icon.h" + #include "wx/math.h" #endif #include "wx/filefn.h" @@ -32,8 +33,6 @@ #include -#include "wx/math.h" - extern void gdk_wx_draw_bitmap (GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 8dd54a51ab..bf1c437b76 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -19,6 +19,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/dcmemory.h" + #include "wx/math.h" // for floating-point functions #endif #include "wx/image.h" @@ -28,8 +29,6 @@ #include "wx/gtk/win_gtk.h" #include "wx/gtk/private.h" -#include "wx/math.h" // for floating-point functions - #include #include #include diff --git a/src/gtk/gnome/gprint.cpp b/src/gtk/gnome/gprint.cpp index e262a9303e..a623c309d3 100644 --- a/src/gtk/gnome/gprint.cpp +++ b/src/gtk/gnome/gprint.cpp @@ -23,9 +23,9 @@ #include "wx/log.h" #include "wx/dcmemory.h" #include "wx/icon.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/fontutil.h" #include "wx/gtk/private.h" #include "wx/module.h" diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 4417e2c99c..173ae70dde 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -18,16 +18,15 @@ #include "wx/utils.h" #include "wx/panel.h" #include "wx/settings.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/strconv.h" #include "wx/fontutil.h" // for wxNativeFontInfo (GetNativeFontInfo()) #include #include #include -#include "wx/math.h" #include "wx/gtk/private.h" #include diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index de6677ff19..cefe1bbd95 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -32,6 +32,7 @@ #include "wx/combobox.h" #include "wx/layout.h" #include "wx/statusbr.h" + #include "wx/math.h" #endif #include "wx/module.h" @@ -54,7 +55,6 @@ #include "wx/thread.h" #endif -#include "wx/math.h" #include // FIXME: Due to a hack we use GtkCombo in here, which is deprecated since gtk2.3.0 diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 7c2c675a79..bd4abefa09 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -17,6 +17,7 @@ #include "wx/dcmemory.h" #include "wx/palette.h" #include "wx/icon.h" + #include "wx/math.h" #endif // WX_PRECOMP #include "wx/filefn.h" @@ -28,8 +29,6 @@ #include -#include "wx/math.h" - extern void gdk_wx_draw_bitmap (GdkDrawable *drawable, GdkGC *gc, diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 9d579b0bb6..a5b9b4a5d0 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -19,6 +19,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/dcmemory.h" + #include "wx/math.h" // for floating-point functions #endif #include "wx/image.h" @@ -27,8 +28,6 @@ #include "wx/gtk1/win_gtk.h" -#include "wx/math.h" // for floating-point functions - #include #include #include diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index 4fcc4eb928..b2ef2c4cf1 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/scrolbar.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/utils.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/gtk1/private.h" //----------------------------------------------------------------------------- diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index 6f37e77222..ddeb7570c7 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/utils.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/gtk1/private.h" //----------------------------------------------------------------------------- diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp index 607e7bc682..84e55b4d93 100644 --- a/src/gtk1/spinbutt.cpp +++ b/src/gtk1/spinbutt.cpp @@ -17,9 +17,9 @@ #ifndef WX_PRECOMP #include "wx/utils.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/gtk1/private.h" //----------------------------------------------------------------------------- diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index 51c4c477cd..e2a7824071 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -18,9 +18,9 @@ #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/gtk1/private.h" //----------------------------------------------------------------------------- diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index eda1665baf..d09ad26829 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -18,16 +18,15 @@ #include "wx/utils.h" #include "wx/panel.h" #include "wx/settings.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/strconv.h" #include "wx/fontutil.h" // for wxNativeFontInfo (GetNativeFontInfo()) #include #include #include -#include "wx/math.h" #include "wx/gtk1/private.h" #include @@ -458,7 +457,7 @@ void wxTextCtrl::WriteText( const wxString &text ) // resetting the style and appending some more text wouldn't work: if // we don't specify the style explicitly, the old style would be used gtk_editable_delete_selection( GTK_EDITABLE(m_text) ); - wxGtkTextInsert(m_text, m_defaultStyle, text.c_str(), text.Len()); + wxGtkTextInsert(m_text, m_defaultStyle, text.c_str(), text.length()); // we called wxGtkTextInsert with correct font, no need to do anything // in UpdateFontIfNeeded() any longer @@ -478,7 +477,7 @@ void wxTextCtrl::WriteText( const wxString &text ) // This moves the cursor pos to behind the inserted text. gint len = GET_EDITABLE_POS(m_text); - gtk_editable_insert_text( GTK_EDITABLE(m_text), text.c_str(), text.Len(), &len ); + gtk_editable_insert_text( GTK_EDITABLE(m_text), text.c_str(), text.length(), &len ); // Bring entry's cursor uptodate. gtk_entry_set_position( GTK_ENTRY(m_text), len ); @@ -542,7 +541,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const wxString text = GetValue(); // cast to prevent warning. But pos really should've been unsigned. - if( (unsigned long)pos > text.Len() ) + if( (unsigned long)pos > text.length() ) return false; *x=0; // First Col diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 70742e6193..cda6b3fae3 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -31,6 +31,7 @@ #include "wx/combobox.h" #include "wx/layout.h" #include "wx/statusbr.h" + #include "wx/math.h" #endif #include "wx/module.h" @@ -53,7 +54,6 @@ #include "wx/thread.h" #endif -#include "wx/math.h" #include #include "wx/gtk1/private.h" diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 624356dcb3..c7586333b0 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -22,6 +22,7 @@ #include "wx/timer.h" #include "wx/dcmemory.h" #include "wx/log.h" + #include "wx/math.h" #endif #include "wx/html/forcelnk.h" @@ -31,7 +32,6 @@ #include "wx/image.h" #include "wx/gifdecod.h" #include "wx/artprov.h" -#include "wx/math.h" #include diff --git a/src/mac/carbon/dcclient.cpp b/src/mac/carbon/dcclient.cpp index 23d159b764..c05e976854 100644 --- a/src/mac/carbon/dcclient.cpp +++ b/src/mac/carbon/dcclient.cpp @@ -19,10 +19,10 @@ #include "wx/dcmemory.h" #include "wx/settings.h" #include "wx/toplevel.h" + #include "wx/math.h" #endif #include "wx/region.h" -#include "wx/math.h" #include "wx/mac/private.h" //----------------------------------------------------------------------------- diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp index 490b083065..2acdaf2199 100644 --- a/src/mac/carbon/dcprint.cpp +++ b/src/mac/carbon/dcprint.cpp @@ -22,9 +22,9 @@ #ifndef WX_PRECOMP #include "wx/msgdlg.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/mac/uma.h" #include "wx/mac/private/print.h" diff --git a/src/mac/carbon/mpthread.cpp b/src/mac/carbon/mpthread.cpp index 9da62d0185..edf27aaf3c 100755 --- a/src/mac/carbon/mpthread.cpp +++ b/src/mac/carbon/mpthread.cpp @@ -1,13 +1,13 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: thread.cpp -// Purpose: wxThread Implementation -// Author: Original from Wolfram Gloger/Guilhem Lavaux/Vadim Zeitlin -// Modified by: Aj Lavin, Stefan Csomor -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998), -// Vadim Zeitlin (1999) , Stefan Csomor (2000) -// Licence: wxWindows licence +// Name: src/mac/carbon/mpthread.cpp +// Purpose: wxThread Implementation +// Author: Original from Wolfram Gloger/Guilhem Lavaux/Vadim Zeitlin +// Modified by: Aj Lavin, Stefan Csomor +// Created: 04/22/98 +// RCS-ID: $Id$ +// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998), +// Vadim Zeitlin (1999) , Stefan Csomor (2000) +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ---------------------------------------------------------------------------- @@ -18,15 +18,15 @@ #include "wx/wxprec.h" #if defined(__BORLANDC__) -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_THREADS + #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" #endif -#if wxUSE_THREADS - #include "wx/module.h" #include "wx/thread.h" @@ -36,7 +36,6 @@ #else #include #include -#include "wx/math.h" #endif #include "wx/mac/uma.h" #endif @@ -49,11 +48,11 @@ // this state) enum wxThreadState { - STATE_NEW, // didn't start execution yet (=> RUNNING) - STATE_RUNNING, // thread is running (=> PAUSED, CANCELED) - STATE_PAUSED, // thread is temporarily suspended (=> RUNNING) - STATE_CANCELED, // thread should terminate a.s.a.p. (=> EXITED) - STATE_EXITED // thread is terminating + STATE_NEW, // didn't start execution yet (=> RUNNING) + STATE_RUNNING, // thread is running (=> PAUSED, CANCELED) + STATE_PAUSED, // thread is temporarily suspended (=> RUNNING) + STATE_CANCELED, // thread should terminate a.s.a.p. (=> EXITED) + STATE_EXITED // thread is terminating }; // ---------------------------------------------------------------------------- @@ -81,7 +80,7 @@ static wxCriticalSection *gs_critsectWaitingForGui = NULL; // number of threads waiting for GUI in wxMutexGuiEnter() static size_t gs_nWaitingForGui = 0; -// overall number of threads, needed for determining the sleep value of the main +// overall number of threads, needed for determining the sleep value of the main // event loop size_t g_numberOfThreads = 0; @@ -99,23 +98,23 @@ MPCriticalRegionID gs_guiCritical = kInvalidID; /* Notes : - + The implementation is very close to the phtreads implementation, the reason for using MPServices is the fact that these are also available under OS 9. Thus allowing for one common API for all current builds. - + As soon as wxThreads are on a 64 bit address space, the TLS must be extended to use two indices one for each 32 bit part as the MP implementation is limited to longs. - + I have two implementations for mutexes : - version A based on a binary semaphore, problem - not reentrant, version B based + version A based on a binary semaphore, problem - not reentrant, version B based on a critical region, allows for reentrancy, performance implications not yet tested The same for condition internal, one implementation by Aj Lavin and the other one copied from the thrimpl.cpp which I assume has been more broadly tested, I've just - replaced the interlock increment with the appropriate PPC calls + replaced the interlock increment with the appropriate PPC calls */ // ---------------------------------------------------------------------------- @@ -124,31 +123,31 @@ MPCriticalRegionID gs_guiCritical = kInvalidID; static bool wxMacMPThreadsInitVerify() { - static bool hasThreadManager = false ; - if ( !hasThreadManager ) - hasThreadManager = MPLibraryIsLoaded(); - - if ( !hasThreadManager ) + static bool hasThreadManager = false ; + if ( !hasThreadManager ) + hasThreadManager = MPLibraryIsLoaded(); + + if ( !hasThreadManager ) { - wxMessageBox( wxT("Error") , wxT("MP Thread Support is not available on this System" ), wxOK ) ; - return FALSE ; + wxMessageBox( wxT("Error") , wxT("MP Thread Support is not available on this System" ), wxOK ) ; + return false ; } - return TRUE ; -} + return true ; +} -#if 0 +#if 0 class wxMutexInternal { public: - wxMutexInternal(wxMutexType mutexType) ; - ~wxMutexInternal() ; - bool IsOk() const { return m_isOk; } - - wxMutexError Lock() ; - wxMutexError TryLock() ; - wxMutexError Unlock(); -private: + wxMutexInternal(wxMutexType mutexType) ; + ~wxMutexInternal() ; + bool IsOk() const { return m_isOk; } + + wxMutexError Lock() ; + wxMutexError TryLock() ; + wxMutexError Unlock(); +private: MPSemaphoreID m_semaphore; bool m_isOk ; }; @@ -156,16 +155,16 @@ private: wxMutexInternal::wxMutexInternal(wxMutexType mutexType ) { wxMacMPThreadsInitVerify() ; - + m_isOk = false ; m_semaphore = kInvalidID ; - + OSStatus err = noErr ; switch( mutexType ) { case wxMUTEX_DEFAULT : { - verify_noerr( MPCreateBinarySemaphore( & m_semaphore) ); + verify_noerr( MPCreateBinarySemaphore( & m_semaphore) ); m_isOk = ( m_semaphore != kInvalidID ) ; } break ; @@ -181,37 +180,37 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType ) wxMutexInternal::~wxMutexInternal() { if ( m_semaphore != kInvalidID ) - MPDeleteSemaphore( m_semaphore); + MPDeleteSemaphore( m_semaphore); } wxMutexError wxMutexInternal::Lock() { wxCHECK_MSG( m_isOk , wxMUTEX_MISC_ERROR , wxT("Invalid Mutex") ) ; - OSStatus err = MPWaitOnSemaphore( m_semaphore, kDurationForever); - if ( err) + OSStatus err = MPWaitOnSemaphore( m_semaphore, kDurationForever); + if ( err) { - wxLogSysError(wxT("Could not lock mutex")); - return wxMUTEX_MISC_ERROR; + wxLogSysError(wxT("Could not lock mutex")); + return wxMUTEX_MISC_ERROR; } - - return wxMUTEX_NO_ERROR; + + return wxMUTEX_NO_ERROR; } wxMutexError wxMutexInternal::TryLock() { wxCHECK_MSG( m_isOk , wxMUTEX_MISC_ERROR , wxT("Invalid Mutex") ) ; - OSStatus err = MPWaitOnSemaphore( m_semaphore, kDurationImmediate); - if ( err) + OSStatus err = MPWaitOnSemaphore( m_semaphore, kDurationImmediate); + if ( err) { - if ( err == kMPTimeoutErr) - { - return wxMUTEX_BUSY; - } - wxLogSysError(wxT("Could not try lock mutex")); - return wxMUTEX_MISC_ERROR; + if ( err == kMPTimeoutErr) + { + return wxMUTEX_BUSY; + } + wxLogSysError(wxT("Could not try lock mutex")); + return wxMUTEX_MISC_ERROR; } - - return wxMUTEX_NO_ERROR; + + return wxMUTEX_NO_ERROR; } wxMutexError wxMutexInternal::Unlock() @@ -221,10 +220,10 @@ wxMutexError wxMutexInternal::Unlock() if ( err) { wxLogSysError(_("Could not unlock mutex")); - return wxMUTEX_MISC_ERROR; + return wxMUTEX_MISC_ERROR; } - - return wxMUTEX_NO_ERROR; + + return wxMUTEX_NO_ERROR; } #else @@ -235,11 +234,11 @@ public: wxMutexInternal(wxMutexType mutexType) ; ~wxMutexInternal() ; bool IsOk() const { return m_isOk; } - + wxMutexError Lock() ; wxMutexError TryLock() ; wxMutexError Unlock(); -private: +private: MPCriticalRegionID m_critRegion ; bool m_isOk ; }; @@ -249,10 +248,10 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType ) wxMacMPThreadsInitVerify() ; m_isOk = false ; m_critRegion = kInvalidID ; - + verify_noerr( MPCreateCriticalRegion( & m_critRegion) ); m_isOk = ( m_critRegion != kInvalidID ) ; - + if ( !IsOk() ) wxFAIL_MSG(wxT("Error when creating mutex") ) ; } @@ -272,8 +271,8 @@ wxMutexError wxMutexInternal::Lock() wxLogSysError(wxT("Could not lock mutex")); return wxMUTEX_MISC_ERROR; } - - return wxMUTEX_NO_ERROR; + + return wxMUTEX_NO_ERROR; } wxMutexError wxMutexInternal::TryLock() @@ -287,10 +286,10 @@ wxMutexError wxMutexInternal::TryLock() return wxMUTEX_BUSY; } wxLogSysError(wxT("Could not try lock mutex")); - return wxMUTEX_MISC_ERROR; + return wxMUTEX_MISC_ERROR; } - - return wxMUTEX_NO_ERROR; + + return wxMUTEX_NO_ERROR; } wxMutexError wxMutexInternal::Unlock() @@ -300,10 +299,10 @@ wxMutexError wxMutexInternal::Unlock() if ( err) { wxLogSysError(_("Could not unlock mutex")); - return wxMUTEX_MISC_ERROR; + return wxMUTEX_MISC_ERROR; } - - return wxMUTEX_NO_ERROR; + + return wxMUTEX_NO_ERROR; } #endif @@ -317,22 +316,22 @@ class wxSemaphoreInternal public: wxSemaphoreInternal(int initialcount, int maxcount); ~wxSemaphoreInternal(); - + bool IsOk() const { return m_isOk; } - + wxSemaError WaitTimeout(unsigned long milliseconds); - + wxSemaError Wait() { return WaitTimeout( kDurationForever); } - - wxSemaError TryWait() - { - wxSemaError err = WaitTimeout(kDurationImmediate); + + wxSemaError TryWait() + { + wxSemaError err = WaitTimeout(kDurationImmediate); if ( err == wxSEMA_TIMEOUT ) err = wxSEMA_BUSY ; return err ; } wxSemaError Post(); - + private: MPSemaphoreID m_semaphore; bool m_isOk ; @@ -350,7 +349,7 @@ wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) } verify_noerr( MPCreateSemaphore( maxcount, initialcount, & m_semaphore) ); m_isOk = ( m_semaphore != kInvalidID ) ; - + if ( !IsOk() ) wxFAIL_MSG(wxT("Error when creating semaphore") ) ; } @@ -394,8 +393,8 @@ wxSemaError wxSemaphoreInternal::Post() class wxConditionInternal { public: - - wxConditionInternal(wxMutex& mutex) + + wxConditionInternal(wxMutex& mutex) : m_mutex( mutex), m_semaphore( 0, 1), m_gate( 1, 1) @@ -404,34 +403,34 @@ public: m_signals = 0; m_canceled = 0; } - + ~wxConditionInternal() { } - + bool IsOk() const { return m_mutex.IsOk() ; } - + wxCondError Wait() { return WaitTimeout( kDurationForever); } - + wxCondError WaitTimeout(unsigned long msectimeout); - + wxCondError Signal() { return DoSignal( false); } - + wxCondError Broadcast() { return DoSignal( true); } - + private: - + wxCondError DoSignal( bool signalAll); - + wxMutex& m_mutex; wxSemaphoreInternal m_semaphore; // Signals the waiting threads. wxSemaphoreInternal m_gate; @@ -443,7 +442,7 @@ private: wxCondError wxConditionInternal::WaitTimeout(unsigned long msectimeout) -{ +{ m_gate.Wait(); if ( ++ m_waiters == INT_MAX) { @@ -454,24 +453,24 @@ wxCondError wxConditionInternal::WaitTimeout(unsigned long msectimeout) m_varSection.Leave(); } m_gate.Post(); - + m_mutex.Unlock(); - + wxSemaError err = m_semaphore.WaitTimeout( msectimeout); wxASSERT( err == wxSEMA_NO_ERROR || err == wxSEMA_TIMEOUT); - + m_varSection.Enter(); if ( err != wxSEMA_NO_ERROR) { if ( m_signals > m_canceled) { // A signal is being sent after we timed out. - + if ( m_waiters == m_signals) { // There are no excess waiters to catch the signal, so // we must throw it away. - + wxSemaError err2 = m_semaphore.Wait(); if ( err2 != wxSEMA_NO_ERROR) { @@ -514,15 +513,15 @@ wxCondError wxConditionInternal::WaitTimeout(unsigned long msectimeout) } } m_varSection.Leave(); - + m_mutex.Lock(); - - if ( err) + + if ( err) { return err == wxSEMA_TIMEOUT ? wxCOND_TIMEOUT : wxCOND_MISC_ERROR; } - - return wxCOND_NO_ERROR; + + return wxCOND_NO_ERROR; } @@ -530,36 +529,36 @@ wxCondError wxConditionInternal::DoSignal( bool signalAll) { m_gate.Wait(); m_varSection.Enter(); - + wxASSERT( m_signals == m_canceled); - + if ( m_waiters == m_canceled) { m_varSection.Leave(); m_gate.Post(); return wxCOND_NO_ERROR; } - + if ( m_canceled > 0) { m_waiters -= m_canceled; m_signals = 0; m_canceled = 0; } - + m_signals = signalAll ? m_waiters : 1; size_t n = m_signals; - + m_varSection.Leave(); - + // Let the waiters inherit the gate lock. - + do { wxSemaError err = m_semaphore.Post(); wxASSERT( err == wxSEMA_NO_ERROR); } while ( -- n); - + return wxCOND_NO_ERROR; } @@ -718,14 +717,14 @@ public: m_prio = WXTHREAD_DEFAULT_PRIORITY; m_notifyQueueId = kInvalidID; m_exitcode = 0; - m_cancelled = FALSE ; + m_cancelled = false ; - // 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() { @@ -765,7 +764,7 @@ public: // Get the ID of this thread's underlying MP Services task. MPTaskID GetId() const { return m_tid; } - 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; } @@ -780,8 +779,8 @@ public: { wxCriticalSectionLocker lock(m_csJoinFlag); - m_shouldBeJoined = FALSE; - m_isDetached = TRUE; + m_shouldBeJoined = false; + m_isDetached = true; } private: @@ -852,7 +851,7 @@ OSStatus wxThreadInternal::MacThreadStart(void *parameter) pthread->SetState(STATE_EXITED); } } - + if ( dontRunAtAll ) { if ( pthread->m_isDetached ) @@ -880,7 +879,7 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) OSStatus err = noErr ; m_thread = thread; - + if ( m_notifyQueueId == kInvalidID ) { OSStatus err = MPCreateQueue( & m_notifyQueueId); @@ -890,9 +889,9 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) return false; } } - + m_state = STATE_NEW; - + err = MPCreateTask( MacThreadStart, (void*) m_thread, stackSize, @@ -901,25 +900,25 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) 0, 0, &m_tid); - + if ( err) { - wxLogSysError(_("Can't create thread")); + wxLogSysError(_("Can't create thread")); return false; } - + if ( m_prio != WXTHREAD_DEFAULT_PRIORITY ) { SetPriority(m_prio); } - + return true; } void wxThreadInternal::SetPriority( int priority) { m_prio = priority; - + if ( m_tid) { // Mac priorities range from 1 to 10,000, with a default of 100. @@ -927,7 +926,7 @@ void wxThreadInternal::SetPriority( int priority) // We can map wxWidgets to Mac priorities easily by assuming // the former uses a logarithmic scale. const unsigned int macPriority = ( int)( exp( priority / 25.0 * log( 10.0)) + 0.5); - + MPSetTaskWeight( m_tid, macPriority); } } @@ -963,10 +962,10 @@ void wxThreadInternal::Wait() void * param2; void * rc; - OSStatus err = MPWaitOnQueue ( m_notifyQueueId, - & param1, - & param2, - & rc, + OSStatus err = MPWaitOnQueue ( m_notifyQueueId, + & param1, + & param2, + & rc, kDurationForever); if ( err) { @@ -978,7 +977,7 @@ void wxThreadInternal::Wait() // but we don't need this here m_exitcode = rc; - m_shouldBeJoined = FALSE; + m_shouldBeJoined = false; } } @@ -1073,7 +1072,7 @@ wxThread::wxThread(wxThreadKind kind) { g_numberOfThreads++; m_internal = new wxThreadInternal(); - + m_isDetached = (kind == wxTHREAD_DETACHED); } @@ -1102,7 +1101,7 @@ wxThread::~wxThread() wxThreadError wxThread::Create(unsigned int stackSize) { wxCriticalSectionLocker lock(m_critsect); - + if ( m_isDetached ) { m_internal->Detach() ; @@ -1112,7 +1111,7 @@ wxThreadError wxThread::Create(unsigned int stackSize) m_internal->SetState(STATE_EXITED); return wxTHREAD_NO_RESOURCE; } - + return wxTHREAD_NO_ERROR; } @@ -1297,7 +1296,7 @@ void wxThread::Exit(ExitCode status) OnExit(); MPTerminateTask( m_internal->GetId() , (long) status) ; - + if ( IsDetached() ) { delete this; @@ -1398,10 +1397,10 @@ bool wxThread::IsAlive() const { case STATE_RUNNING: case STATE_PAUSED: - return TRUE; + return true; default: - return FALSE; + return false; } } @@ -1421,7 +1420,7 @@ class wxThreadModule : public wxModule public: virtual bool OnInit(); virtual void OnExit(); - + private: DECLARE_DYNAMIC_CLASS(wxThreadModule) }; @@ -1429,24 +1428,24 @@ private: IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) bool wxThreadModule::OnInit() -{ +{ if ( !wxMacMPThreadsInitVerify() ) { - return FALSE ; + return false ; } - + verify_noerr( MPAllocateTaskStorageIndex( &gs_tlsForWXThread ) ) ; // main thread's This() is NULL verify_noerr( MPSetTaskStorageValue( gs_tlsForWXThread , NULL ) ) ; gs_idMainThread = wxThread::GetCurrentId() ; - + gs_critsectWaitingForGui = new wxCriticalSection(); gs_critsectGui = new wxCriticalSection(); gs_critsectGui->Enter(); - - return TRUE; + + return true; } void wxThreadModule::OnExit() diff --git a/src/mac/carbon/printmac.cpp b/src/mac/carbon/printmac.cpp index 9ce3354d46..dee2ce7c80 100644 --- a/src/mac/carbon/printmac.cpp +++ b/src/mac/carbon/printmac.cpp @@ -24,9 +24,9 @@ #include "wx/app.h" #include "wx/msgdlg.h" #include "wx/dcprint.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/mac/uma.h" #include "wx/mac/printmac.h" diff --git a/src/mac/carbon/thread.cpp b/src/mac/carbon/thread.cpp index 88e9abb5e0..2a2f9a7440 100644 --- a/src/mac/carbon/thread.cpp +++ b/src/mac/carbon/thread.cpp @@ -1,23 +1,23 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/thread.cpp -// Purpose: wxThread Implementation -// Author: Original from Wolfram Gloger/Guilhem Lavaux/Vadim Zeitlin +// Name: src/mac/carbon/thread.cpp +// Purpose: wxThread Implementation +// Author: Original from Wolfram Gloger/Guilhem Lavaux/Vadim Zeitlin // Modified by: Aj Lavin, Stefan Csomor -// Created: 04/22/98 -// RCS-ID: $Id$ -// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998), -// Vadim Zeitlin (1999), Stefan Csomor (2000) -// Licence: wxWindows licence +// Created: 04/22/98 +// RCS-ID: $Id$ +// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998), +// Vadim Zeitlin (1999), Stefan Csomor (2000) +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" #if defined(__BORLANDC__) -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" #endif #if wxUSE_THREADS @@ -31,7 +31,6 @@ #else #include #include - #include "wx/math.h" #endif #include "wx/mac/uma.h" diff --git a/src/mac/classic/dcclient.cpp b/src/mac/classic/dcclient.cpp index d5aeff7bbb..a76be690b6 100644 --- a/src/mac/classic/dcclient.cpp +++ b/src/mac/classic/dcclient.cpp @@ -17,10 +17,10 @@ #include "wx/window.h" #include "wx/dcmemory.h" #include "wx/toplevel.h" + #include "wx/math.h" #endif #include "wx/region.h" -#include "wx/math.h" #include "wx/mac/private.h" //----------------------------------------------------------------------------- diff --git a/src/mac/classic/dcprint.cpp b/src/mac/classic/dcprint.cpp index fb7d386862..b26db3e8c6 100644 --- a/src/mac/classic/dcprint.cpp +++ b/src/mac/classic/dcprint.cpp @@ -20,9 +20,9 @@ #ifndef WX_PRECOMP #include "wx/msgdlg.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/mac/uma.h" #include "wx/mac/private/print.h" diff --git a/src/motif/bmpmotif.cpp b/src/motif/bmpmotif.cpp index bec6dd5146..f79d04c32b 100644 --- a/src/motif/bmpmotif.cpp +++ b/src/motif/bmpmotif.cpp @@ -19,6 +19,10 @@ #include "wx/motif/bmpmotif.h" +#ifndef WX_PRECOMP + #include "wx/math.h" +#endif + #ifdef __VMS__ #pragma message disable nosimpint #endif @@ -33,8 +37,6 @@ #include #endif -#include "wx/math.h" - Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap ); static inline wxCharBuffer GetCacheImageName(WXImage image) diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index cd858688c3..94bd4419e5 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -46,10 +46,10 @@ #include "wx/app.h" #include "wx/window.h" #include "wx/dcmemory.h" + #include "wx/math.h" #endif #include "wx/image.h" -#include "wx/math.h" #ifdef __VMS__ #pragma message disable nosimpint diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp index 4282b46c2b..21d50103f3 100644 --- a/src/msw/colordlg.cpp +++ b/src/msw/colordlg.cpp @@ -35,10 +35,10 @@ #include "wx/utils.h" #include "wx/dialog.h" #include "wx/cmndata.h" + #include "wx/math.h" #endif #include "wx/msw/private.h" -#include "wx/math.h" #include "wx/msw/wrapcdlg.h" #include diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 1850d5e873..81687b72fe 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -33,6 +33,7 @@ #include "wx/log.h" #include "wx/window.h" #include "wx/dcmemory.h" + #include "wx/math.h" #endif #include "wx/msw/private.h" @@ -43,7 +44,6 @@ #include "wx/printdlg.h" #include "wx/msw/printdlg.h" -#include "wx/math.h" #include "wx/msw/wrapcdlg.h" #ifndef __WIN32__ diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 87c21c141d..76c8f73ecc 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -35,6 +35,7 @@ #include "wx/intl.h" #include "wx/log.h" #include "wx/app.h" + #include "wx/math.h" #endif #include "wx/msw/wrapcdlg.h" @@ -44,7 +45,6 @@ #include "wx/filename.h" #include "wx/tokenzr.h" -#include "wx/math.h" #include "wx/msw/missing.h" diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp index 2c5a32114d..72802a232f 100644 --- a/src/msw/fontdlg.cpp +++ b/src/msw/fontdlg.cpp @@ -33,12 +33,11 @@ #include "wx/dialog.h" #include "wx/log.h" #include "wx/cmndata.h" + #include "wx/math.h" #endif #include "wx/msw/wrapcdlg.h" -#include "wx/math.h" - #include #include diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index afa432cd22..885ab1ed14 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -38,9 +38,9 @@ #include "wx/log.h" #include "wx/dcclient.h" #include "wx/timer.h" + #include "wx/math.h" // log10 & pow #endif -#include "wx/math.h" // log10 & pow #include "wx/msw/private.h" // user info and wndproc setting/getting #include "wx/dynlib.h" diff --git a/src/msw/mediactrl_am.cpp b/src/msw/mediactrl_am.cpp index de07e983b1..cee182bf06 100644 --- a/src/msw/mediactrl_am.cpp +++ b/src/msw/mediactrl_am.cpp @@ -64,9 +64,9 @@ #include "wx/log.h" #include "wx/dcclient.h" #include "wx/timer.h" + #include "wx/math.h" // log10 & pow #endif -#include "wx/math.h" // log10 & pow #include "wx/msw/private.h" // user info and wndproc setting/getting #include "wx/dynlib.h" #include "wx/stopwatch.h" diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index 108bd936b9..2341500182 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -25,10 +25,9 @@ #ifndef WX_PRECOMP #include "wx/dcclient.h" + #include "wx/math.h" #endif -#include "wx/math.h" - // I don't know why members of tagVARIANT aren't found when compiling // with Wine #ifndef __WINE__ diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 28464845af..b1bb3076fb 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -22,13 +22,13 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/math.h" #endif #define _FORCENAMELESSUNION #include "wx/msw/private.h" #include "wx/msw/ole/oleutils.h" #include "wx/msw/ole/automtn.h" -#include "wx/math.h" #ifdef __WXWINCE__ #include "wx/msw/wince/time.h" diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 6139786ca5..91951610bb 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -19,6 +19,7 @@ #include "wx/app.h" #include "wx/dcmemory.h" #include "wx/icon.h" + #include "wx/math.h" #endif #include "wx/image.h" @@ -42,7 +43,6 @@ bool wxGetImageFromDrawable(GR_DRAW_ID drawable, int srcX, int srcY, int width, #include "wx/wfstream.h" #endif #endif -#include "wx/math.h" //----------------------------------------------------------------------------- // wxMask diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 5e3b5728cb..37787a903d 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -18,6 +18,7 @@ #include "wx/app.h" #include "wx/window.h" #include "wx/dcmemory.h" + #include "wx/math.h" #endif #include "wx/image.h" @@ -26,8 +27,6 @@ #include "wx/x11/private.h" -#include "wx/math.h" - #if wxUSE_UNICODE #include "glib.h" #include "pango/pangox.h" @@ -1594,7 +1593,7 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) #endif { XDrawString( (Display*) m_display, (Window) m_window, - (GC) m_textGC, x, y + XFontStructGetAscent(xfont), text.c_str(), text.Len() ); + (GC) m_textGC, x, y + XFontStructGetAscent(xfont), text.c_str(), text.length() ); } #if 0 @@ -1670,7 +1669,7 @@ void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoor int direction, ascent, descent2; XCharStruct overall; - XTextExtents( xfont, (char*) string.c_str(), string.Len(), &direction, + XTextExtents( xfont, (char*) string.c_str(), string.length(), &direction, &ascent, &descent2, &overall); if (width) -- 2.45.2