From de6185e212ebc37ff11ff70278e3c4f68419b097 Mon Sep 17 00:00:00 2001
From: =?utf8?q?W=C5=82odzimierz=20Skiba?= <abx@abx.art.pl>
Date: Tue, 2 May 2006 10:39:23 +0000
Subject: [PATCH] Include wx/utils.h according to precompiled headers of
 wx/wx.h (with other minor cleaning).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/cocoa/fontutil.cpp         |   2 +-
 src/cocoa/settings.mm          |   3 +-
 src/cocoa/utilsexc.mm          |  87 +++++++++++++------------
 src/common/appbase.cpp         |   2 +-
 src/common/appcmn.cpp          |   2 +-
 src/common/bmpbase.cpp         |   2 +-
 src/common/config.cpp          |   2 +-
 src/common/dynlib.cpp          |   2 +-
 src/common/event.cpp           |   2 +-
 src/common/fileconf.cpp        |   2 +-
 src/common/filefn.cpp          |   2 +-
 src/common/filename.cpp        |   2 +-
 src/common/gdicmn.cpp          |   2 +-
 src/common/image.cpp           |   2 +-
 src/common/imagxpm.cpp         |   2 +-
 src/common/log.cpp             |   2 +-
 src/common/sizer.cpp           |   2 +-
 src/common/socket.cpp          |   2 +-
 src/common/stockitem.cpp       |   3 +-
 src/common/strconv.cpp         |   2 +-
 src/common/url.cpp             |   2 +-
 src/common/xpmdecod.cpp        |   2 +-
 src/common/zipstrm.cpp         |   2 +-
 src/common/zstream.cpp         |   6 +-
 src/generic/dcpsg.cpp          |   2 +-
 src/generic/dirctrlg.cpp       |   2 +-
 src/generic/regiong.cpp        |  16 ++++-
 src/generic/scrlwing.cpp       |  11 ++--
 src/gtk/app.cpp                |  14 ++---
 src/gtk/clipbrd.cpp            |  96 ++++++++++++++--------------
 src/gtk/cursor.cpp             |   3 +-
 src/gtk/dnd.cpp                |   2 +-
 src/gtk/font.cpp               |  24 +++----
 src/gtk/fontdlg.cpp            |   2 +-
 src/gtk/listbox.cpp            |   2 +-
 src/gtk/notebook.cpp           |  50 +++++++--------
 src/gtk/scrolbar.cpp           |   7 ++-
 src/gtk/slider.cpp             |  19 +++---
 src/gtk/spinbutt.cpp           |  15 +++--
 src/gtk/spinctrl.cpp           |   8 ++-
 src/gtk/textctrl.cpp           |   2 +-
 src/gtk/threadsgi.cpp          |   4 +-
 src/gtk/window.cpp             |   2 +-
 src/gtk1/app.cpp               |  34 +++++-----
 src/gtk1/clipbrd.cpp           | 112 ++++++++++++++++-----------------
 src/gtk1/cursor.cpp            |   3 +-
 src/gtk1/dnd.cpp               |   2 +-
 src/gtk1/fontdlg.cpp           |   2 +-
 src/gtk1/listbox.cpp           |   2 +-
 src/gtk1/notebook.cpp          |  32 +++++-----
 src/gtk1/scrolbar.cpp          |   7 ++-
 src/gtk1/slider.cpp            |  19 +++---
 src/gtk1/spinbutt.cpp          |  17 ++---
 src/gtk1/spinctrl.cpp          |   8 ++-
 src/gtk1/textctrl.cpp          |   2 +-
 src/gtk1/threadsgi.cpp         |   5 +-
 src/gtk1/window.cpp            |   4 +-
 src/mac/carbon/app.cpp         |   2 +-
 src/mac/carbon/brush.cpp       |   6 +-
 src/mac/carbon/cfsocket.cpp    |   2 +-
 src/mac/carbon/clipbrd.cpp     |   4 +-
 src/mac/carbon/dialog.cpp      |   2 +-
 src/mac/carbon/dirdlg.cpp      |  46 +++++++-------
 src/mac/carbon/filedlg.cpp     |   4 +-
 src/mac/carbon/font.cpp        |   8 +--
 src/mac/carbon/listbox.cpp     |   3 +-
 src/mac/carbon/menu.cpp        |   2 +-
 src/mac/carbon/pen.cpp         |   5 +-
 src/mac/carbon/settings.cpp    |   8 ++-
 src/mac/carbon/stattext.cpp    |   2 +-
 src/mac/carbon/textctrl.cpp    |   2 +-
 src/mac/carbon/window.cpp      |   2 +-
 src/mac/classic/app.cpp        |   2 +-
 src/mac/classic/brush.cpp      |   5 +-
 src/mac/classic/clipbrd.cpp    |   2 +-
 src/mac/classic/dialog.cpp     |   2 +-
 src/mac/classic/dirdlg.cpp     |   8 ++-
 src/mac/classic/filedlg.cpp    |   4 +-
 src/mac/classic/font.cpp       |   2 +-
 src/mac/classic/listbox.cpp    |   3 +-
 src/mac/classic/menu.cpp       |   2 +-
 src/mac/classic/pen.cpp        |   5 +-
 src/mac/classic/settings.cpp   |  49 ++++++++-------
 src/mac/classic/stattext.cpp   |   2 +-
 src/mac/classic/textctrl.cpp   |   2 +-
 src/mac/classic/window.cpp     |   2 +-
 src/mac/corefoundation/hid.cpp |   2 +-
 src/mgl/bitmap.cpp             |   2 +-
 src/mgl/cursor.cpp             |   2 +-
 src/mgl/font.cpp               |  24 +++----
 src/mgl/fontenum.cpp           |   3 +-
 src/motif/accel.cpp            |   2 +-
 src/motif/app.cpp              |   2 +-
 src/motif/checkbox.cpp         |   6 +-
 src/motif/choice.cpp           |   6 +-
 src/motif/clipbrd.cpp          |   2 +-
 src/motif/control.cpp          |   6 +-
 src/motif/cursor.cpp           |   2 +-
 src/motif/dataobj.cpp          |   3 +-
 src/motif/dcmemory.cpp         |   8 ++-
 src/motif/dcscreen.cpp         |  32 +++++-----
 src/motif/dialog.cpp           |   2 +-
 src/motif/dnd.cpp              |   2 +-
 src/motif/filedlg.cpp          |   2 +-
 src/motif/font.cpp             |   2 +-
 src/motif/frame.cpp            |   2 +-
 src/motif/listbox.cpp          |   2 +-
 src/motif/menu.cpp             |   2 +-
 src/motif/menuitem.cpp         |   8 ++-
 src/motif/palette.cpp          |   2 +-
 src/motif/radiobox.cpp         |   6 +-
 src/motif/radiobut.cpp         |   5 +-
 src/motif/slider.cpp           |   5 +-
 src/motif/statbox.cpp          |   5 +-
 src/motif/textctrl.cpp         |  10 ++-
 src/motif/window.cpp           |   2 +-
 src/msw/urlmsw.cpp             |   2 +-
 src/unix/baseunix.cpp          |   5 +-
 src/unix/dialup.cpp            |   2 +-
 src/unix/fontenum.cpp          |   2 +-
 src/unix/fontutil.cpp          |   2 +-
 src/unix/mimetype.cpp          |   2 +-
 src/unix/snglinst.cpp          |  19 +++---
 src/unix/threadpsx.cpp         |   2 +-
 src/x11/app.cpp                |   2 +-
 src/x11/brush.cpp              |   6 +-
 src/x11/clipbrd.cpp            |  56 ++++++++---------
 src/x11/cursor.cpp             |   2 +-
 src/x11/dataobj.cpp            |   2 +-
 src/x11/dcmemory.cpp           |  27 +++++---
 src/x11/dcscreen.cpp           |   2 +-
 src/x11/dnd.cpp                |   2 +-
 src/x11/font.cpp               |   2 +-
 src/x11/glcanvas.cpp           |   3 +-
 src/x11/palette.cpp            |   2 +-
 src/x11/pen.cpp                |   6 +-
 src/x11/textctrl.cpp           |   2 +-
 src/x11/window.cpp             |   2 +-
 138 files changed, 638 insertions(+), 530 deletions(-)

diff --git a/src/cocoa/fontutil.cpp b/src/cocoa/fontutil.cpp
index dbb6d544aa..c50c724772 100644
--- a/src/cocoa/fontutil.cpp
+++ b/src/cocoa/fontutil.cpp
@@ -26,6 +26,7 @@
 
 #ifndef WX_PRECOMP
     #include "wx/hash.h"
+    #include "wx/utils.h"
 #endif // PCH
 
 #include "wx/fontutil.h"
@@ -162,7 +163,6 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding,
         #pragma message enable nosimpint
     #endif
 
-    #include "wx/utils.h"       // for wxGetDisplay()
 #elif defined(__WXGTK__)
     // we have to declare struct tm to avoid problems with first forward
     // declaring it in C code (glib.h included from gdk.h does it) and then
diff --git a/src/cocoa/settings.mm b/src/cocoa/settings.mm
index e6adf7446b..192911f682 100644
--- a/src/cocoa/settings.mm
+++ b/src/cocoa/settings.mm
@@ -10,12 +10,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
+
 #ifndef WX_PRECOMP
+    #include "wx/utils.h"
 #endif
 
 #include "wx/settings.h"
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include "wx/cocoa/autorelease.h"
 
diff --git a/src/cocoa/utilsexc.mm b/src/cocoa/utilsexc.mm
index 5d7fe82113..20d6e25688 100644
--- a/src/cocoa/utilsexc.mm
+++ b/src/cocoa/utilsexc.mm
@@ -6,21 +6,21 @@
 // Created:     2004-10-05
 // RCS-ID:      $Id$
 // Copyright:   (c) Ryan Norton
-// Licence:   	wxWindows licence
+// Licence:     wxWindows licence
 // Notes:       This code may be useful on platforms other than Darwin.
 //              On Darwin we share the CoreFoundation code with wxMac.
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
+
 #ifndef WX_PRECOMP
+    #include "wx/utils.h"
 #endif
+
 #include "wx/unix/execute.h"
-#include "wx/utils.h"
 
 #if 0
 
-#include "wx/utils.h"
-
 #include "wx/process.h"
 #include "wx/stream.h"
 
@@ -39,14 +39,14 @@
 class wxPipeInputStream : public wxInputStream
 {
 public:
-    wxPipeInputStream(NSPipe* thePipe) : 
+    wxPipeInputStream(NSPipe* thePipe) :
             m_thePipe(thePipe),
             m_theHandle([m_thePipe fileHandleForReading])
     {
     }
 
     ~wxPipeInputStream()
-    {	
+    {
         [m_thePipe release];
     }
 
@@ -57,23 +57,23 @@ protected:
         memcpy(buffer, [theData bytes], [theData length]);
         return [theData length];
     }
-    
-    
-    NSPipe* 		m_thePipe;
-    NSFileHandle*	m_theHandle;
+
+
+    NSPipe* m_thePipe;
+    NSFileHandle* m_theHandle;
 };
 
 class wxPipeOutputStream : public wxOutputStream
 {
 public:
-    wxPipeOutputStream(NSPipe* thePipe) : 
+    wxPipeOutputStream(NSPipe* thePipe) :
             m_thePipe(thePipe),
             m_theHandle([m_thePipe fileHandleForWriting])
     {
     }
 
     ~wxPipeOutputStream()
-    {	
+    {
         [m_thePipe release];
     }
 
@@ -81,14 +81,14 @@ protected:
 
     virtual size_t OnSysWrite(const void *buffer, size_t bufsize)
     {
-        NSData* theData = [NSData dataWithBytesNoCopy:(void*)buffer 
+        NSData* theData = [NSData dataWithBytesNoCopy:(void*)buffer
                                   length:bufsize];
         [m_theHandle writeData:theData];
         return bufsize;
     }
-        
-    NSPipe* 		m_thePipe;
-    NSFileHandle*	m_theHandle;
+
+    NSPipe* m_thePipe;
+    NSFileHandle* m_theHandle;
 };
 
 @interface wxTaskHandler : NSObject
@@ -102,89 +102,88 @@ protected:
 
 @implementation wxTaskHandler : NSObject
 
--(id)init:(void*)handle processIdentifier:(long)pid 
+-(id)init:(void*)handle processIdentifier:(long)pid
 {
     self = [super init];
-    
+
     m_handle = handle;
     m_pid = pid;
 
-    [[NSNotificationCenter defaultCenter] addObserver:self 
-            selector:@selector(termHandler:) 
-            name:NSTaskDidTerminateNotification 
+    [[NSNotificationCenter defaultCenter] addObserver:self
+            selector:@selector(termHandler:)
+            name:NSTaskDidTerminateNotification
             object:nil];
     return self;
 }
 
-- (void)termHandler:(NSNotification *)aNotification 
+- (void)termHandler:(NSNotification *)aNotification
 {
     NSTask* theTask = [aNotification object];
-    
+
     if ([theTask processIdentifier] == m_pid)
     {
-        ((wxProcess*)m_handle)->OnTerminate([theTask processIdentifier], 
+        ((wxProcess*)m_handle)->OnTerminate([theTask processIdentifier],
                           [theTask terminationStatus]);
-        
+
         [self release];
     }
 }
 
 @end
 
-long wxExecute(const wxString& command, 
-                int sync, 
-                wxProcess *handle)
+long wxExecute(const wxString& command,
+               int sync,
+               wxProcess *handle)
 {
     NSTask* theTask = [[NSTask alloc] init];
-    
+
     if (handle && handle->IsRedirected())
     {
         NSPipe* theStdinPipe = [[NSPipe alloc] init];
         NSPipe* theStderrPipe = [[NSPipe alloc] init];
         NSPipe* theStdoutPipe = [[NSPipe alloc] init];
-    
+
         [theTask setStandardInput:theStdinPipe];
         [theTask setStandardError:theStderrPipe];
         [theTask setStandardOutput:theStdoutPipe];
-        
+
         handle->SetPipeStreams(new wxPipeInputStream(theStdoutPipe),
                                new wxPipeOutputStream(theStdinPipe),
                                new wxPipeInputStream(theStderrPipe) );
     }
-    
-    NSArray* theQuoteArguments = 
+
+    NSArray* theQuoteArguments =
         [wxNSStringWithWxString(command) componentsSeparatedByString:@"\""];
-        
-    NSMutableArray* theSeparatedArguments = 
+
+    NSMutableArray* theSeparatedArguments =
         [NSMutableArray arrayWithCapacity:10];
-        
+
     for (unsigned i = 0; i < [theQuoteArguments count]; ++i)
     {
         [theSeparatedArguments addObjectsFromArray:
             [[theQuoteArguments objectAtIndex:i] componentsSeparatedByString:@" "]
         ];
-        
+
         if(++i < [theQuoteArguments count])
             [theSeparatedArguments addObject:[theQuoteArguments objectAtIndex:i]];
     }
-    
+
     [theTask setLaunchPath:[theSeparatedArguments objectAtIndex:0]];
     [theTask setArguments:theSeparatedArguments];
     [theTask launch];
-    
+
     if(sync & wxEXEC_ASYNC)
     {
-        [[wxTaskHandler alloc]init:handle 
+        [[wxTaskHandler alloc]init:handle
                               processIdentifier:[theTask processIdentifier]];
-                                
+
         return 0;
     }
     else
     {
         [theTask waitUntilExit];
-        
+
         return [theTask terminationStatus];
-    }                      
+    }
 }
 #endif //0
-
diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp
index efc2c45cbd..b16ea3d837 100644
--- a/src/common/appbase.cpp
+++ b/src/common/appbase.cpp
@@ -29,9 +29,9 @@
     #include "wx/app.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif //WX_PRECOMP
 
-#include "wx/utils.h"
 #include "wx/apptrait.h"
 #include "wx/cmdline.h"
 #include "wx/confbase.h"
diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp
index fe6e903810..3316cced79 100644
--- a/src/common/appcmn.cpp
+++ b/src/common/appcmn.cpp
@@ -33,6 +33,7 @@
     #include "wx/msgdlg.h"
     #include "wx/bitmap.h"
     #include "wx/confbase.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/apptrait.h"
@@ -40,7 +41,6 @@
 #include "wx/evtloop.h"
 #include "wx/msgout.h"
 #include "wx/thread.h"
-#include "wx/utils.h"
 #include "wx/ptr_scpd.h"
 
 #if defined(__WXMSW__)
diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp
index af1e4c3450..065d1851ad 100644
--- a/src/common/bmpbase.cpp
+++ b/src/common/bmpbase.cpp
@@ -25,9 +25,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
-#include "wx/utils.h"
 #include "wx/palette.h"
 #include "wx/icon.h"
 #include "wx/image.h"
diff --git a/src/common/config.cpp b/src/common/config.cpp
index b5d811d836..2e1430356e 100644
--- a/src/common/config.cpp
+++ b/src/common/config.cpp
@@ -30,6 +30,7 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif //WX_PRECOMP
 
 #include "wx/arrstr.h"
@@ -37,7 +38,6 @@
 #if wxUSE_CONFIG && ((wxUSE_FILE && wxUSE_TEXTFILE) || wxUSE_CONFIG_NATIVE)
 
 #include "wx/file.h"
-#include "wx/utils.h"
 #include "wx/math.h"
 
 #include <stdlib.h>
diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp
index 65270ac612..f400389c4a 100644
--- a/src/common/dynlib.cpp
+++ b/src/common/dynlib.cpp
@@ -35,10 +35,10 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif //WX_PRECOMP
 
 #include "wx/filefn.h"
-#include "wx/utils.h"
 #include "wx/filename.h"        // for SplitPath()
 #include "wx/apptrait.h"
 
diff --git a/src/common/event.cpp b/src/common/event.cpp
index ae1a10d709..9debc5b90a 100644
--- a/src/common/event.cpp
+++ b/src/common/event.cpp
@@ -29,10 +29,10 @@
 #ifndef WX_PRECOMP
     #include "wx/list.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 
     #if wxUSE_GUI
         #include "wx/control.h"
-        #include "wx/utils.h"
         #include "wx/dc.h"
         #include "wx/textctrl.h"
     #endif // wxUSE_GUI
diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp
index 41d46f5fc0..fc33eb7272 100644
--- a/src/common/fileconf.cpp
+++ b/src/common/fileconf.cpp
@@ -29,6 +29,7 @@
     #include  "wx/intl.h"
     #include  "wx/log.h"
     #include  "wx/app.h"
+    #include  "wx/utils.h"    // for wxGetHomeDir
 #endif  //WX_PRECOMP
 
 #include  "wx/file.h"
@@ -42,7 +43,6 @@
     #include  "wx/stream.h"
 #endif // wxUSE_STREAMS
 
-#include  "wx/utils.h"    // for wxGetHomeDir
 
 #if defined(__WXMAC__)
     #include  "wx/mac/private.h"  // includes mac headers
diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp
index 4403c83db9..3bd9d7c1bb 100644
--- a/src/common/filefn.cpp
+++ b/src/common/filefn.cpp
@@ -27,9 +27,9 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/file.h" // This does include filefn.h
 #include "wx/filename.h"
 #include "wx/dir.h"
diff --git a/src/common/filename.cpp b/src/common/filename.cpp
index c776d48846..300a176ee5 100644
--- a/src/common/filename.cpp
+++ b/src/common/filename.cpp
@@ -72,12 +72,12 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/file.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/filename.h"
 #include "wx/tokenzr.h"
 #include "wx/config.h"          // for wxExpandEnvVars
-#include "wx/utils.h"
 #include "wx/file.h"
 #include "wx/dynlib.h"
 
diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp
index bd59e23601..202f10f904 100644
--- a/src/common/gdicmn.cpp
+++ b/src/common/gdicmn.cpp
@@ -26,6 +26,7 @@
     #include "wx/log.h"
     #include "wx/event.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/brush.h"
@@ -36,7 +37,6 @@
 #include "wx/font.h"
 #include "wx/palette.h"
 #include "wx/dc.h"
-#include "wx/utils.h"
 #include "wx/settings.h"
 #include "wx/hashmap.h"
 
diff --git a/src/common/image.cpp b/src/common/image.cpp
index cc9834d4d6..64f367c521 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -20,6 +20,7 @@
     #include "wx/log.h"
     #include "wx/app.h"
     #include "wx/hash.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/image.h"
@@ -29,7 +30,6 @@
 #include "wx/wfstream.h"
 #include "wx/intl.h"
 #include "wx/module.h"
-#include "wx/utils.h"
 #include "wx/math.h"
 
 #if wxUSE_XPM
diff --git a/src/common/imagxpm.cpp b/src/common/imagxpm.cpp
index 843eddf654..3db566fcb7 100644
--- a/src/common/imagxpm.cpp
+++ b/src/common/imagxpm.cpp
@@ -74,11 +74,11 @@ license is as follows:
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/intl.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/imagxpm.h"
 #include "wx/wfstream.h"
-#include "wx/utils.h"
 #include "wx/xpmdecod.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxXPMHandler,wxImageHandler)
diff --git a/src/common/log.cpp b/src/common/log.cpp
index d7a7e7e895..a669a88cb9 100644
--- a/src/common/log.cpp
+++ b/src/common/log.cpp
@@ -33,6 +33,7 @@
     #include "wx/arrstr.h"
     #include "wx/intl.h"
     #include "wx/string.h"
+    #include "wx/utils.h"
 #endif //WX_PRECOMP
 
 #include "wx/apptrait.h"
@@ -40,7 +41,6 @@
 #include "wx/msgout.h"
 #include "wx/textfile.h"
 #include "wx/thread.h"
-#include "wx/utils.h"
 #include "wx/wxchar.h"
 
 // other standard headers
diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp
index b594635146..894a190d7b 100644
--- a/src/common/sizer.cpp
+++ b/src/common/sizer.cpp
@@ -21,10 +21,10 @@
     #include "wx/string.h"
     #include "wx/intl.h"
     #include "wx/math.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
 #include "wx/sizer.h"
-#include "wx/utils.h"
 #include "wx/statbox.h"
 #include "wx/settings.h"
 #include "wx/listimpl.cpp"
diff --git a/src/common/socket.cpp b/src/common/socket.cpp
index 3f7554ef2e..048fe30407 100644
--- a/src/common/socket.cpp
+++ b/src/common/socket.cpp
@@ -31,11 +31,11 @@
     #include "wx/log.h"
     #include "wx/event.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/apptrait.h"
 #include "wx/timer.h"
-#include "wx/utils.h"
 #include "wx/module.h"
 
 #include "wx/sckaddr.h"
diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp
index a43f3a435a..9b2d4e2b1e 100644
--- a/src/common/stockitem.cpp
+++ b/src/common/stockitem.cpp
@@ -28,10 +28,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
+    #include "wx/utils.h" // for wxStripMenuCodes()
 #endif
 
-#include "wx/utils.h" // for wxStripMenuCodes()
-
 bool wxIsStockID(wxWindowID id)
 {
     switch (id)
diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp
index 92b18ad615..eafce97c8b 100644
--- a/src/common/strconv.cpp
+++ b/src/common/strconv.cpp
@@ -18,6 +18,7 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/strconv.h"
@@ -52,7 +53,6 @@
 
 #include "wx/encconv.h"
 #include "wx/fontmap.h"
-#include "wx/utils.h"
 
 #ifdef __WXMAC__
 #ifndef __DARWIN__
diff --git a/src/common/url.cpp b/src/common/url.cpp
index 084a93ca85..3ece422a34 100644
--- a/src/common/url.cpp
+++ b/src/common/url.cpp
@@ -23,9 +23,9 @@
 #ifndef WX_PRECOMP
     #include "wx/list.h"
     #include "wx/string.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/module.h"
 
 #include <string.h>
diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp
index 6fd4fb11aa..6a4f651fc0 100644
--- a/src/common/xpmdecod.cpp
+++ b/src/common/xpmdecod.cpp
@@ -102,11 +102,11 @@ license is as follows:
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/stream.h"
 #include "wx/image.h"
-#include "wx/utils.h"
 #include "wx/hashmap.h"
 #include <string.h>
 
diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp
index 78a4471910..1358b48275 100644
--- a/src/common/zipstrm.cpp
+++ b/src/common/zipstrm.cpp
@@ -19,13 +19,13 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/zipstrm.h"
 #include "wx/datstrm.h"
 #include "wx/zstream.h"
 #include "wx/mstream.h"
-#include "wx/utils.h"
 #include "wx/buffer.h"
 #include "wx/ptr_scpd.h"
 #include "wx/wfstream.h"
diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp
index 3dc3214091..55589614a5 100644
--- a/src/common/zstream.cpp
+++ b/src/common/zstream.cpp
@@ -23,18 +23,18 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 
 // normally, the compiler options should contain -I../zlib, but it is
 // apparently not the case for all MSW makefiles and so, unless we use
 // configure (which defines __WX_SETUP_H__) or it is explicitly overridden by
 // the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
 #if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
-   #include "../zlib/zlib.h"
+    #include "../zlib/zlib.h"
 #else
-   #include "zlib.h"
+    #include "zlib.h"
 #endif
 
 enum {
diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp
index 0a28ec92b6..266b12c3a8 100644
--- a/src/generic/dcpsg.cpp
+++ b/src/generic/dcpsg.cpp
@@ -23,10 +23,10 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
 #include "wx/dcmemory.h"
-#include "wx/utils.h"
 #include "wx/image.h"
 #include "wx/prntbase.h"
 #include "wx/generic/prntdlgg.h"
diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp
index a29d5809e4..9652d6eea8 100644
--- a/src/generic/dirctrlg.cpp
+++ b/src/generic/dirctrlg.cpp
@@ -24,10 +24,10 @@
     #include "wx/hash.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/module.h"
-#include "wx/utils.h"
 #include "wx/button.h"
 #include "wx/layout.h"
 #include "wx/msgdlg.h"
diff --git a/src/generic/regiong.cpp b/src/generic/regiong.cpp
index 0867643f0c..c81364b059 100644
--- a/src/generic/regiong.cpp
+++ b/src/generic/regiong.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        generic/region.cpp
+// Name:        src/generic/region.cpp
 // Purpose:     generic wxRegion class
 // Author:      David Elliott
 // Modified by:
@@ -9,8 +9,19 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
 #include "wx/generic/region.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
 // ========================================================================
 // Classes to interface with X.org code
@@ -1953,4 +1964,3 @@ XRectInRegion(
     return(partIn ? ((ry < prect->y2) ? wxPartRegion : wxInRegion) :
                 wxOutRegion);
 }
-
diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp
index d6ace0914c..69c534470d 100644
--- a/src/generic/scrlwing.cpp
+++ b/src/generic/scrlwing.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        generic/scrolwin.cpp
+// Name:        src/generic/scrolwin.cpp
 // Purpose:     wxScrolledWindow implementation
 // Author:      Julian Smart
 // Modified by: Vadim Zeitlin on 31.08.00: wxScrollHelper allows to implement.
@@ -29,10 +29,14 @@
     #pragma hdrstop
 #endif
 
-#include "wx/utils.h"
+#include "wx/scrolwin.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/dcclient.h"
 
-#include "wx/scrolwin.h"
 #include "wx/panel.h"
 #if wxUSE_TIMER
 #include "wx/timer.h"
@@ -1339,4 +1343,3 @@ WXLRESULT wxScrolledWindow::MSWWindowProc(WXUINT nMsg,
 }
 
 #endif // __WXMSW__
-
diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp
index d7eb518add..2d830719c9 100644
--- a/src/gtk/app.cpp
+++ b/src/gtk/app.cpp
@@ -21,10 +21,10 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 #include "wx/memory.h"
 #include "wx/font.h"
 #include "wx/settings.h"
@@ -95,7 +95,7 @@ FORCE_LINK(gnome_vfs)
 // global data
 //-----------------------------------------------------------------------------
 
-bool   g_mainThreadLocked = FALSE;
+bool   g_mainThreadLocked = false;
 gint   g_pendingTag = 0;
 
 static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
@@ -355,7 +355,7 @@ static gint wxapp_poll_func( GPollFD *ufds, guint nfds, gint timeout )
     gint res = wxPoll( (wxPollFd *) ufds, nfds, timeout );
 
     wxMutexGuiEnter();
-    g_mainThreadLocked = FALSE;
+    g_mainThreadLocked = false;
 
     gdk_threads_leave();
 
@@ -384,7 +384,7 @@ void wxapp_install_idle_handler()
 
     wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
 
-    g_isIdle = FALSE;
+    g_isIdle = false;
 
     if (g_pendingTag == 0)
         g_pendingTag = g_idle_add_full( 900, wxapp_pending_callback, NULL, NULL );
@@ -424,7 +424,7 @@ END_EVENT_TABLE()
 wxApp::wxApp()
 {
 #ifdef __WXDEBUG__
-    m_isInAssert = FALSE;
+    m_isInAssert = false;
 #endif // __WXDEBUG__
 
     m_idleTag = 0;
@@ -454,7 +454,7 @@ wxApp::~wxApp()
 bool wxApp::OnInitGui()
 {
     if ( !wxAppBase::OnInitGui() )
-        return FALSE;
+        return false;
 
     GdkVisual *visual = gdk_visual_get_system();
 
@@ -688,7 +688,7 @@ void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxC
 
     wxAppBase::OnAssert(file, line, cond, msg);
 
-    m_isInAssert = FALSE;
+    m_isInAssert = false;
 }
 
 #endif // __WXDEBUG__
diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp
index 228ecfcf59..92cc30b090 100644
--- a/src/gtk/clipbrd.cpp
+++ b/src/gtk/clipbrd.cpp
@@ -16,10 +16,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/dataobj.h"
-#include "wx/utils.h"
 
 #include "wx/gtk/private.h"
 
@@ -87,7 +87,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
                 wxLogTrace( TRACE_CLIPBOARD,
                             _T("got unsupported clipboard target") );
 
-                clipboard->m_waiting = FALSE;
+                clipboard->m_waiting = false;
                 return;
             }
         }
@@ -123,7 +123,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
         }
     }
 
-    clipboard->m_waiting = FALSE;
+    clipboard->m_waiting = false;
 }
 }
 
@@ -140,7 +140,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
 {
     if (!wxTheClipboard)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -148,13 +148,13 @@ selection_received( GtkWidget *WXUNUSED(widget),
 
     if (!data_object)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
     if (selection_data->length <= 0)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -163,7 +163,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
     // make sure we got the data in the correct format
     if (!data_object->IsSupportedFormat( format ) )
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -173,7 +173,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
     // if so, copy data to target object
     if (selection_data->type != GDK_SELECTION_TYPE_STRING)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 #endif
@@ -181,7 +181,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
     data_object->SetData( format, (size_t) selection_data->length, (const char*) selection_data->data );
 
     wxTheClipboard->m_formatSupported = true;
-    clipboard->m_waiting = FALSE;
+    clipboard->m_waiting = false;
 }
 }
 
@@ -320,11 +320,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
 
 wxClipboard::wxClipboard()
 {
-    m_open = FALSE;
-    m_waiting = FALSE;
+    m_open = false;
+    m_waiting = false;
 
-    m_ownsClipboard = FALSE;
-    m_ownsPrimarySelection = FALSE;
+    m_ownsClipboard = false;
+    m_ownsPrimarySelection = false;
 
     m_data = (wxDataObject*) NULL;
     m_receivedData = (wxDataObject*) NULL;
@@ -352,10 +352,10 @@ wxClipboard::wxClipboard()
     if (!g_targetsAtom) g_targetsAtom = gdk_atom_intern ("TARGETS", FALSE);
     if (!g_timestampAtom) g_timestampAtom = gdk_atom_intern ("TIMESTAMP", FALSE);
 
-    m_formatSupported = FALSE;
+    m_formatSupported = false;
     m_targetRequested = 0;
 
-    m_usePrimary = FALSE;
+    m_usePrimary = false;
 }
 
 wxClipboard::~wxClipboard()
@@ -388,7 +388,7 @@ void wxClipboard::Clear()
 
         if (gdk_selection_owner_get( GDK_SELECTION_PRIMARY ) == m_clipboardWidget->window)
         {
-            m_waiting = TRUE;
+            m_waiting = true;
 
             gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY,
                                      (guint32) GDK_CURRENT_TIME );
@@ -408,23 +408,23 @@ void wxClipboard::Clear()
     }
 
     m_targetRequested = 0;
-    m_formatSupported = FALSE;
+    m_formatSupported = false;
 }
 
 bool wxClipboard::Open()
 {
-    wxCHECK_MSG( !m_open, FALSE, wxT("clipboard already open") );
+    wxCHECK_MSG( !m_open, false, wxT("clipboard already open") );
 
-    m_open = TRUE;
+    m_open = true;
 
-    return TRUE;
+    return true;
 }
 
 bool wxClipboard::SetData( wxDataObject *data )
 {
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
-    wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
+    wxCHECK_MSG( data, false, wxT("data is invalid") );
 
     Clear();
 
@@ -433,9 +433,9 @@ bool wxClipboard::SetData( wxDataObject *data )
 
 bool wxClipboard::AddData( wxDataObject *data )
 {
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
-    wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
+    wxCHECK_MSG( data, false, wxT("data is invalid") );
 
     // we can only store one wxDataObject
     Clear();
@@ -502,7 +502,7 @@ void wxClipboard::Close()
 {
     wxCHECK_RET( m_open, wxT("clipboard not open") );
 
-    m_open = FALSE;
+    m_open = false;
 }
 
 bool wxClipboard::IsOpened() const
@@ -513,7 +513,7 @@ bool wxClipboard::IsOpened() const
 bool wxClipboard::IsSupported( const wxDataFormat& format )
 {
     /* reentrance problems */
-    if (m_waiting) return FALSE;
+    if (m_waiting) return false;
 
     /* store requested format to be asked for by callbacks */
     m_targetRequested = format;
@@ -522,19 +522,19 @@ bool wxClipboard::IsSupported( const wxDataFormat& format )
                 wxT("wxClipboard:IsSupported: requested format: %s"),
                 format.GetId().c_str() );
 
-    wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+    wxCHECK_MSG( m_targetRequested, false, wxT("invalid clipboard format") );
 
-    m_formatSupported = FALSE;
+    m_formatSupported = false;
 
     /* perform query. this will set m_formatSupported to
-       TRUE if m_targetRequested is supported.
+       true if m_targetRequested is supported.
        also, we have to wait for the "answer" from the
        clipboard owner which is an asynchronous process.
-       therefore we set m_waiting = TRUE here and wait
+       therefore we set m_waiting = true here and wait
        until the callback "targets_selection_received"
-       sets it to FALSE */
+       sets it to false */
 
-    m_waiting = TRUE;
+    m_waiting = true;
 
     gtk_selection_convert( m_targetsWidget,
                            m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY
@@ -558,7 +558,7 @@ bool wxClipboard::IsSupported( const wxDataFormat& format )
 
 bool wxClipboard::GetData( wxDataObject& data )
 {
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
     /* get formats from wxDataObjects */
     wxDataFormat *array = new wxDataFormat[ data.GetFormatCount() ];
@@ -577,19 +577,19 @@ bool wxClipboard::GetData( wxDataObject& data )
         /* store requested format to be asked for by callbacks */
         m_targetRequested = format;
 
-        wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+        wxCHECK_MSG( m_targetRequested, false, wxT("invalid clipboard format") );
 
-        m_formatSupported = FALSE;
+        m_formatSupported = false;
 
        /* perform query. this will set m_formatSupported to
-          TRUE if m_targetRequested is supported.
+          true if m_targetRequested is supported.
           also, we have to wait for the "answer" from the
           clipboard owner which is an asynchronous process.
-          therefore we set m_waiting = TRUE here and wait
+          therefore we set m_waiting = true here and wait
           until the callback "targets_selection_received"
-          sets it to FALSE */
+          sets it to false */
 
-        m_waiting = TRUE;
+        m_waiting = true;
 
         gtk_selection_convert( m_targetsWidget,
                            m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY
@@ -607,21 +607,21 @@ bool wxClipboard::GetData( wxDataObject& data )
         /* store requested format to be asked for by callbacks */
         m_targetRequested = format;
 
-        wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+        wxCHECK_MSG( m_targetRequested, false, wxT("invalid clipboard format") );
 
         /* start query */
-        m_formatSupported = FALSE;
+        m_formatSupported = false;
 
         /* ask for clipboard contents.  this will set
-           m_formatSupported to TRUE if m_targetRequested
+           m_formatSupported to true if m_targetRequested
            is supported.
            also, we have to wait for the "answer" from the
            clipboard owner which is an asynchronous process.
-           therefore we set m_waiting = TRUE here and wait
+           therefore we set m_waiting = true here and wait
            until the callback "targets_selection_received"
-           sets it to FALSE */
+           sets it to false */
 
-        m_waiting = TRUE;
+        m_waiting = true;
 
         wxLogTrace( TRACE_CLIPBOARD,
                     wxT("wxClipboard::GetData: format found, start convert") );
@@ -635,11 +635,11 @@ bool wxClipboard::GetData( wxDataObject& data )
         while (m_waiting) gtk_main_iteration();
 
         /* this is a true error as we checked for the presence of such data before */
-        wxCHECK_MSG( m_formatSupported, FALSE, wxT("error retrieving data from clipboard") );
+        wxCHECK_MSG( m_formatSupported, false, wxT("error retrieving data from clipboard") );
 
         /* return success */
         delete[] array;
-        return TRUE;
+        return true;
     }
 
     wxLogTrace( TRACE_CLIPBOARD,
@@ -647,7 +647,7 @@ bool wxClipboard::GetData( wxDataObject& data )
 
     /* return failure */
     delete[] array;
-    return FALSE;
+    return false;
 }
 
 #endif
diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp
index 25e4e109ac..c975d3cf0d 100644
--- a/src/gtk/cursor.cpp
+++ b/src/gtk/cursor.cpp
@@ -14,10 +14,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
-#include "wx/utils.h"
-
 #include "wx/gtk/private.h" //for idle stuff
 
 #include <gdk/gdk.h>
diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp
index 946de36ded..b199481b30 100644
--- a/src/gtk/dnd.cpp
+++ b/src/gtk/dnd.cpp
@@ -18,11 +18,11 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include "wx/gtk/private.h"
 
diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp
index 10183aa014..67d9182765 100644
--- a/src/gtk/font.cpp
+++ b/src/gtk/font.cpp
@@ -22,11 +22,11 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/fontutil.h"
 #include "wx/cmndata.h"
-#include "wx/utils.h"
 #include "wx/gdicmn.h"
 #include "wx/tokenzr.h"
 #include "wx/settings.h"
@@ -62,7 +62,7 @@ public:
                   int family = wxFONTFAMILY_DEFAULT,
                   int style = wxFONTSTYLE_NORMAL,
                   int weight = wxFONTWEIGHT_NORMAL,
-                  bool underlined = FALSE,
+                  bool underlined = false,
                   const wxString& faceName = wxEmptyString,
                   wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 
@@ -78,7 +78,7 @@ public:
     bool HasNativeFont() const
     {
         // we always have a Pango font description
-        return TRUE;
+        return true;
     }
 
     // setters: all of them also take care to modify m_nativeFontInfo if we
@@ -91,7 +91,7 @@ public:
     void SetFaceName(const wxString& facename);
     void SetEncoding(wxFontEncoding encoding);
 
-    void SetNoAntiAliasing( bool no = TRUE ) { m_noAA = no; }
+    void SetNoAntiAliasing( bool no = true ) { m_noAA = no; }
     bool GetNoAntiAliasing() const { return m_noAA; }
 
     // and this one also modifies all the other font data fields
@@ -159,7 +159,7 @@ void wxFontRefData::Init(int pointSize,
     m_underlined = underlined;
     m_encoding = encoding;
 
-    m_noAA = FALSE;
+    m_noAA = false;
 
     // Create native font info
     m_nativeFontInfo.description = pango_font_description_new();
@@ -196,7 +196,7 @@ void wxFontRefData::Init(int pointSize,
 
 void wxFontRefData::InitFromNative()
 {
-    m_noAA = FALSE;
+    m_noAA = false;
 
     // Get native info
     PangoFontDescription *desc = m_nativeFontInfo.description;
@@ -231,7 +231,7 @@ void wxFontRefData::InitFromNative()
     }
 
     // Pango description are never underlined (?)
-    m_underlined = FALSE;
+    m_underlined = false;
 
     // always with GTK+ 2
     m_encoding = wxFONTENCODING_UTF8;
@@ -374,7 +374,7 @@ bool wxFont::Create( int pointSize,
     m_refData = new wxFontRefData(pointSize, family, style, weight,
                                   underlined, face, encoding);
 
-    return TRUE;
+    return true;
 }
 
 bool wxFont::Create(const wxString& fontname)
@@ -384,12 +384,12 @@ bool wxFont::Create(const wxString& fontname)
     {
         *this = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
 
-        return TRUE;
+        return true;
     }
 
     m_refData = new wxFontRefData(fontname);
 
-    return TRUE;
+    return true;
 }
 
 void wxFont::Unshare()
@@ -483,7 +483,7 @@ int wxFont::GetWeight() const
 
 bool wxFont::GetUnderlined() const
 {
-    wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), false, wxT("invalid font") );
 
     return M_FONTDATA->m_underlined;
 }
@@ -511,7 +511,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
 
 bool wxFont::IsFixedWidth() const
 {
-    wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), false, wxT("invalid font") );
 
     return wxFontBase::IsFixedWidth();
 }
diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp
index 50e7ad2331..47efa1cfc6 100644
--- a/src/gtk/fontdlg.cpp
+++ b/src/gtk/fontdlg.cpp
@@ -16,10 +16,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/fontutil.h"
-#include "wx/utils.h"
 #include "wx/debug.h"
 #include "wx/msgdlg.h"
 
diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp
index 82f03469c6..21fc6d64bf 100644
--- a/src/gtk/listbox.cpp
+++ b/src/gtk/listbox.cpp
@@ -19,10 +19,10 @@
     #include "wx/dynarray.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/arrstr.h"
-#include "wx/utils.h"
 #include "wx/checklst.h"
 #include "wx/settings.h"
 #include "wx/gtk/private.h"
diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp
index 9d5cf1a053..38938182da 100644
--- a/src/gtk/notebook.cpp
+++ b/src/gtk/notebook.cpp
@@ -17,10 +17,10 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/panel.h"
-#include "wx/utils.h"
 #include "wx/imaglist.h"
 #include "wx/bitmap.h"
 #include "wx/fontutil.h"
@@ -99,7 +99,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
     wxCHECK_RET( !notebook->m_inSwitchPage,
                  _T("gtk_notebook_page_change_callback reentered") );
 
-    notebook->m_inSwitchPage = TRUE;
+    notebook->m_inSwitchPage = true;
     if (g_isIdle)
         wxapp_install_idle_handler();
 
@@ -129,7 +129,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
         notebook->GetEventHandler()->ProcessEvent( eventChanged );
     }
 
-    notebook->m_inSwitchPage = FALSE;
+    notebook->m_inSwitchPage = false;
 }
 }
 
@@ -292,11 +292,11 @@ END_EVENT_TABLE()
 void wxNotebook::Init()
 {
     m_padding = 0;
-    m_inSwitchPage = FALSE;
+    m_inSwitchPage = false;
 
     m_imageList = (wxImageList *) NULL;
     m_selection = -1;
-    m_themeEnabled = TRUE;
+    m_themeEnabled = true;
 }
 
 wxNotebook::wxNotebook()
@@ -321,15 +321,15 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
                         const wxPoint& pos, const wxSize& size,
                         long style, const wxString& name )
 {
-    m_needParent = TRUE;
-    m_acceptsFocus = TRUE;
+    m_needParent = true;
+    m_acceptsFocus = true;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( wxT("wxNoteBook creation failed") );
-        return FALSE;
+        return false;
     }
 
 
@@ -357,7 +357,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     g_signal_connect (m_widget, "realize",
                       G_CALLBACK (gtk_notebook_realized_callback), this);
 
-    return TRUE;
+    return true;
 }
 
 int wxNotebook::GetSelection() const
@@ -436,17 +436,17 @@ int wxNotebook::SetSelection( size_t page )
 
 bool wxNotebook::SetPageText( size_t page, const wxString &text )
 {
-    wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid notebook") );
+    wxCHECK_MSG( m_widget != NULL, false, wxT("invalid notebook") );
 
     wxGtkNotebookPage* nb_page = GetNotebookPage(page);
 
-    wxCHECK_MSG( nb_page, FALSE, wxT("SetPageText: invalid page index") );
+    wxCHECK_MSG( nb_page, false, wxT("SetPageText: invalid page index") );
 
     nb_page->m_text = text;
 
     gtk_label_set_text( nb_page->m_label, wxGTK_CONV( nb_page->m_text ) );
 
-    return TRUE;
+    return true;
 }
 
 bool wxNotebook::SetPageImage( size_t page, int image )
@@ -455,13 +455,13 @@ bool wxNotebook::SetPageImage( size_t page, int image )
 
     wxGtkNotebookPage* nb_page = GetNotebookPage(page);
 
-    if (!nb_page) return FALSE;
+    if (!nb_page) return false;
 
     /* Optimization posibility: return immediately if image unchanged.
      * Not enabled because it may break existing (stupid) code that
      * manipulates the imagelist to cycle images */
 
-    /* if (image == nb_page->m_image) return TRUE; */
+    /* if (image == nb_page->m_image) return true; */
 
     /* For different cases:
        1) no image -> no image
@@ -470,7 +470,7 @@ bool wxNotebook::SetPageImage( size_t page, int image )
        4) image -> image */
 
     if (image == -1 && nb_page->m_image == -1)
-        return TRUE; /* Case 1): Nothing to do. */
+        return true; /* Case 1): Nothing to do. */
 
     GtkWidget *pixmapwid = (GtkWidget*) NULL;
 
@@ -498,7 +498,7 @@ bool wxNotebook::SetPageImage( size_t page, int image )
             gtk_container_remove(GTK_CONTAINER(nb_page->m_box), pixmapwid);
             nb_page->m_image = -1;
 
-            return TRUE; /* Case 2) */
+            return true; /* Case 2) */
         }
     }
 
@@ -531,7 +531,7 @@ bool wxNotebook::SetPageImage( size_t page, int image )
 
     nb_page->m_image = image;
 
-    return TRUE;
+    return true;
 }
 
 void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
@@ -573,7 +573,7 @@ void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz))
 
 bool wxNotebook::DeleteAllPages()
 {
-    wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid notebook") );
+    wxCHECK_MSG( m_widget != NULL, false, wxT("invalid notebook") );
 
     while (m_pagesData.GetCount() > 0)
         DeletePage( m_pagesData.GetCount()-1 );
@@ -625,12 +625,12 @@ bool wxNotebook::InsertPage( size_t position,
                              bool select,
                              int imageId )
 {
-    wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid notebook") );
+    wxCHECK_MSG( m_widget != NULL, false, wxT("invalid notebook") );
 
-    wxCHECK_MSG( win->GetParent() == this, FALSE,
+    wxCHECK_MSG( win->GetParent() == this, false,
                wxT("Can't add a page whose parent is not the notebook!") );
 
-    wxCHECK_MSG( position <= GetPageCount(), FALSE,
+    wxCHECK_MSG( position <= GetPageCount(), false,
                  _T("invalid page index in wxNotebookPage::InsertPage()") );
 
     // Hack Alert! (Part II): See above in wxInsertChildInNotebook callback
@@ -646,7 +646,7 @@ bool wxNotebook::InsertPage( size_t position,
                                           this);
 
     if (m_themeEnabled)
-        win->SetThemeEnabled(TRUE);
+        win->SetThemeEnabled(true);
 
     GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);
 
@@ -718,7 +718,7 @@ bool wxNotebook::InsertPage( size_t position,
                       G_CALLBACK (gtk_notebook_page_change_callback), this);
 
     InvalidateBestSize();
-    return TRUE;
+    return true;
 }
 
 // helper for HitTest(): check if the point lies inside the given widget which
@@ -812,12 +812,12 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
 void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )
 {
     // don't set the sizes of the pages - their correct size is not yet known
-    wxControl::SetConstraintSizes(FALSE);
+    wxControl::SetConstraintSizes(false);
 }
 
 bool wxNotebook::DoPhase( int WXUNUSED(nPhase) )
 {
-    return TRUE;
+    return true;
 }
 
 #endif
diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp
index 4319b39407..8f8034a0c6 100644
--- a/src/gtk/scrolbar.cpp
+++ b/src/gtk/scrolbar.cpp
@@ -14,7 +14,10 @@
 
 #include "wx/scrolbar.h"
 
-#include "wx/utils.h"
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/math.h"
 #include "wx/gtk/private.h"
 
@@ -344,4 +347,4 @@ wxScrollBar::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_vscrollbar_new);
 }
 
-#endif
+#endif // wxUSE_SCROLLBAR
diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp
index bcaacf7a73..6003bdf6fe 100644
--- a/src/gtk/slider.cpp
+++ b/src/gtk/slider.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        gtk/slider.cpp
+// Name:        src/gtk/slider.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -10,11 +10,14 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_SLIDER
+
 #include "wx/slider.h"
 
-#if wxUSE_SLIDER
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
-#include "wx/utils.h"
 #include "wx/math.h"
 #include "wx/gtk/private.h"
 
@@ -153,14 +156,14 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
         const wxPoint& pos, const wxSize& size,
         long style, const wxValidator& validator, const wxString& name )
 {
-    m_acceptsFocus = TRUE;
-    m_needParent = TRUE;
+    m_acceptsFocus = true;
+    m_needParent = true;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
         wxFAIL_MSG( wxT("wxSlider creation failed") );
-        return FALSE;
+        return false;
     }
 
     m_oldPos = 0.0;
@@ -219,7 +222,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 int wxSlider::GetValue() const
@@ -351,4 +354,4 @@ wxSlider::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_vscale_new);
 }
 
-#endif
+#endif // wxUSE_SLIDER
diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp
index 52efbc9d4f..7c0480bb99 100644
--- a/src/gtk/spinbutt.cpp
+++ b/src/gtk/spinbutt.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        spinbutt.cpp
+// Name:        src/gtk/spinbutt.cpp
 // Purpose:     wxSpinButton
 // Author:      Robert
 // Modified by:
@@ -11,11 +11,14 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_SPINBTN
+
 #include "wx/spinbutt.h"
 
-#if wxUSE_SPINBTN
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
-#include "wx/utils.h"
 #include "wx/math.h"
 #include "wx/gtk/private.h"
 
@@ -105,7 +108,7 @@ bool wxSpinButton::Create(wxWindow *parent,
                           long style,
                           const wxString& name)
 {
-    m_needParent = TRUE;
+    m_needParent = true;
 
     wxSize new_size = size,
            sizeBest = DoGetBestSize();
@@ -117,7 +120,7 @@ bool wxSpinButton::Create(wxWindow *parent,
         !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( wxT("wxXX creation failed") );
-        return FALSE;
+        return false;
     }
 
     m_oldPos = 0.0;
@@ -136,7 +139,7 @@ bool wxSpinButton::Create(wxWindow *parent,
 
     PostCreation(new_size);
 
-    return TRUE;
+    return true;
 }
 
 int wxSpinButton::GetMin() const
diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp
index f9cc4a9518..4c85508b2d 100644
--- a/src/gtk/spinctrl.cpp
+++ b/src/gtk/spinctrl.cpp
@@ -11,11 +11,13 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#include "wx/spinctrl.h"
-
 #if wxUSE_SPINCTRL
 
-#include "wx/utils.h"
+#include "wx/spinctrl.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
 #include "wx/textctrl.h"    // for wxEVT_COMMAND_TEXT_UPDATED
 #include "wx/math.h"
diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp
index 3b3cd28c2d..73b66c7677 100644
--- a/src/gtk/textctrl.cpp
+++ b/src/gtk/textctrl.cpp
@@ -15,9 +15,9 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/math.h"
 #include "wx/settings.h"
 #include "wx/panel.h"
diff --git a/src/gtk/threadsgi.cpp b/src/gtk/threadsgi.cpp
index bfbdec4d7a..fdf7740181 100644
--- a/src/gtk/threadsgi.cpp
+++ b/src/gtk/threadsgi.cpp
@@ -16,6 +16,7 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include <stdio.h>
@@ -25,7 +26,6 @@
 #include <sys/wait.h>
 #include <sys/prctl.h>
 #include "wx/module.h"
-#include "wx/utils.h"
 
 #include "gdk/gdk.h"
 #include "gtk/gtk.h"
@@ -261,7 +261,7 @@ bool wxThreadModule::OnInit()
     wxThreadGuiInit();
     p_mainid = (int)getpid();
     wxMainMutex->Lock();
-    return TRUE;
+    return true;
 }
 
 void wxThreadModule::OnExit()
diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp
index 1ab4c6e774..eef601151d 100644
--- a/src/gtk/window.cpp
+++ b/src/gtk/window.cpp
@@ -20,12 +20,12 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/dcclient.h"
 #include "wx/frame.h"
 #include "wx/layout.h"
-#include "wx/utils.h"
 #include "wx/dialog.h"
 #include "wx/msgdlg.h"
 #include "wx/module.h"
diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp
index 9c6a6f9937..f45088ac37 100644
--- a/src/gtk1/app.cpp
+++ b/src/gtk1/app.cpp
@@ -21,10 +21,10 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 #include "wx/memory.h"
 #include "wx/font.h"
 #include "wx/settings.h"
@@ -85,7 +85,7 @@
 // global data
 //-----------------------------------------------------------------------------
 
-bool   g_mainThreadLocked = FALSE;
+bool   g_mainThreadLocked = false;
 gint   g_pendingTag = 0;
 
 static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
@@ -109,7 +109,7 @@ static wxMutex gs_idleTagsMutex;
 // not static because used by textctrl.cpp
 //
 // MT-FIXME
-bool wxIsInsideYield = FALSE;
+bool wxIsInsideYield = false;
 
 bool wxApp::Yield(bool onlyIfNeeded)
 {
@@ -120,18 +120,18 @@ bool wxApp::Yield(bool onlyIfNeeded)
             wxFAIL_MSG( wxT("wxYield called recursively" ) );
         }
 
-        return FALSE;
+        return false;
     }
 
 #if wxUSE_THREADS
     if ( !wxThread::IsMain() )
     {
         // can't call gtk_main_iteration() from other threads like this
-        return TRUE;
+        return true;
     }
 #endif // wxUSE_THREADS
 
-    wxIsInsideYield = TRUE;
+    wxIsInsideYield = true;
 
     // We need to remove idle callbacks or the loop will
     // never finish.
@@ -159,9 +159,9 @@ bool wxApp::Yield(bool onlyIfNeeded)
     wxLog::Resume();
 #endif
 
-    wxIsInsideYield = FALSE;
+    wxIsInsideYield = false;
 
-    return TRUE;
+    return true;
 }
 
 //-----------------------------------------------------------------------------
@@ -353,14 +353,14 @@ static gint wxapp_poll_func( GPollFD *ufds, guint nfds, gint timeout )
     gdk_threads_enter();
 
     wxMutexGuiLeave();
-    g_mainThreadLocked = TRUE;
+    g_mainThreadLocked = true;
 
     // we rely on the fact that glib GPollFD struct is really just pollfd but
     // I wonder how wise is this in the long term (VZ)
     gint res = wxPoll( (wxPollFd *) ufds, nfds, timeout );
 
     wxMutexGuiEnter();
-    g_mainThreadLocked = FALSE;
+    g_mainThreadLocked = false;
 
     gdk_threads_leave();
 
@@ -389,7 +389,7 @@ void wxapp_install_idle_handler()
 
     wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
 
-    g_isIdle = FALSE;
+    g_isIdle = false;
 
     if (g_pendingTag == 0)
         g_pendingTag = gtk_idle_add_priority( 900, wxapp_pending_callback, (gpointer) NULL );
@@ -429,7 +429,7 @@ END_EVENT_TABLE()
 wxApp::wxApp()
 {
 #ifdef __WXDEBUG__
-    m_isInAssert = FALSE;
+    m_isInAssert = false;
 #endif // __WXDEBUG__
 
     m_idleTag = 0;
@@ -457,7 +457,7 @@ wxApp::~wxApp()
 bool wxApp::OnInitGui()
 {
     if ( !wxAppBase::OnInitGui() )
-        return FALSE;
+        return false;
 
     GdkVisual *visual = gdk_visual_get_system();
 
@@ -541,7 +541,7 @@ bool wxApp::OnInitGui()
         }
     }
 
-    return TRUE;
+    return true;
 }
 
 GdkVisual *wxApp::GetGdkVisual()
@@ -671,11 +671,11 @@ void wxApp::CleanUp()
 
 void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg)
 {
-    m_isInAssert = TRUE;
+    m_isInAssert = true;
 
     wxAppBase::OnAssert(file, line, cond, msg);
 
-    m_isInAssert = FALSE;
+    m_isInAssert = false;
 }
 
 #endif // __WXDEBUG__
@@ -689,6 +689,6 @@ void wxApp::RemoveIdleTag()
     {
         gtk_idle_remove( wxTheApp->m_idleTag );
         wxTheApp->m_idleTag = 0;
-        g_isIdle = TRUE;
+        g_isIdle = true;
     }
 }
diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp
index 02f3374010..4a09a5006f 100644
--- a/src/gtk1/clipbrd.cpp
+++ b/src/gtk1/clipbrd.cpp
@@ -16,10 +16,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/dataobj.h"
-#include "wx/utils.h"
 
 #include <glib.h>
 #include <gdk/gdk.h>
@@ -86,7 +86,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
                 wxLogTrace( TRACE_CLIPBOARD,
                             _T("got unsupported clipboard target") );
 
-                clipboard->m_waiting = FALSE;
+                clipboard->m_waiting = false;
                 g_free(atom_name);
                 return;
             }
@@ -117,14 +117,14 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
 
             if (format == clipboard->m_targetRequested)
             {
-                clipboard->m_waiting = FALSE;
-                clipboard->m_formatSupported = TRUE;
+                clipboard->m_waiting = false;
+                clipboard->m_formatSupported = true;
                 return;
             }
         }
     }
 
-    clipboard->m_waiting = FALSE;
+    clipboard->m_waiting = false;
 }
 }
 
@@ -141,7 +141,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
 {
     if (!wxTheClipboard)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -149,13 +149,13 @@ selection_received( GtkWidget *WXUNUSED(widget),
 
     if (!data_object)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
     if (selection_data->length <= 0)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -164,7 +164,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
     // make sure we got the data in the correct format
     if (!data_object->IsSupportedFormat( format ) )
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -174,15 +174,15 @@ selection_received( GtkWidget *WXUNUSED(widget),
     // if so, copy data to target object
     if (selection_data->type != GDK_SELECTION_TYPE_STRING)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 #endif
 
     data_object->SetData( format, (size_t) selection_data->length, (const char*) selection_data->data );
 
-    wxTheClipboard->m_formatSupported = TRUE;
-    clipboard->m_waiting = FALSE;
+    wxTheClipboard->m_formatSupported = true;
+    clipboard->m_waiting = false;
 }
 }
 
@@ -198,16 +198,16 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
 
     if (event->selection == GDK_SELECTION_PRIMARY)
     {
-        wxTheClipboard->m_ownsPrimarySelection = FALSE;
+        wxTheClipboard->m_ownsPrimarySelection = false;
     }
     else
     if (event->selection == g_clipboardAtom)
     {
-        wxTheClipboard->m_ownsClipboard = FALSE;
+        wxTheClipboard->m_ownsClipboard = false;
     }
     else
     {
-        wxTheClipboard->m_waiting = FALSE;
+        wxTheClipboard->m_waiting = false;
         return FALSE;
     }
 
@@ -224,7 +224,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
         }
     }
 
-    wxTheClipboard->m_waiting = FALSE;
+    wxTheClipboard->m_waiting = false;
     return TRUE;
 }
 }
@@ -308,11 +308,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
 
 wxClipboard::wxClipboard()
 {
-    m_open = FALSE;
-    m_waiting = FALSE;
+    m_open = false;
+    m_waiting = false;
 
-    m_ownsClipboard = FALSE;
-    m_ownsPrimarySelection = FALSE;
+    m_ownsClipboard = false;
+    m_ownsPrimarySelection = false;
 
     m_data = (wxDataObject*) NULL;
     m_receivedData = (wxDataObject*) NULL;
@@ -346,10 +346,10 @@ wxClipboard::wxClipboard()
     if (!g_targetsAtom) g_targetsAtom = gdk_atom_intern ("TARGETS", FALSE);
     if (!g_timestampAtom) g_timestampAtom = gdk_atom_intern ("TIMESTAMP", FALSE);
 
-    m_formatSupported = FALSE;
+    m_formatSupported = false;
     m_targetRequested = 0;
 
-    m_usePrimary = FALSE;
+    m_usePrimary = false;
 }
 
 wxClipboard::~wxClipboard()
@@ -372,7 +372,7 @@ void wxClipboard::Clear()
         //  it, clear_selection is called which will set m_data to zero
         if (gdk_selection_owner_get( g_clipboardAtom ) == m_clipboardWidget->window)
         {
-            m_waiting = TRUE;
+            m_waiting = true;
 
             gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom,
                                      (guint32) GDK_CURRENT_TIME );
@@ -382,7 +382,7 @@ void wxClipboard::Clear()
 
         if (gdk_selection_owner_get( GDK_SELECTION_PRIMARY ) == m_clipboardWidget->window)
         {
-            m_waiting = TRUE;
+            m_waiting = true;
 
             gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY,
                                      (guint32) GDK_CURRENT_TIME );
@@ -402,23 +402,23 @@ void wxClipboard::Clear()
     }
 
     m_targetRequested = 0;
-    m_formatSupported = FALSE;
+    m_formatSupported = false;
 }
 
 bool wxClipboard::Open()
 {
-    wxCHECK_MSG( !m_open, FALSE, wxT("clipboard already open") );
+    wxCHECK_MSG( !m_open, false, wxT("clipboard already open") );
 
-    m_open = TRUE;
+    m_open = true;
 
-    return TRUE;
+    return true;
 }
 
 bool wxClipboard::SetData( wxDataObject *data )
 {
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
-    wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
+    wxCHECK_MSG( data, false, wxT("data is invalid") );
 
     Clear();
 
@@ -427,9 +427,9 @@ bool wxClipboard::SetData( wxDataObject *data )
 
 bool wxClipboard::AddData( wxDataObject *data )
 {
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
-    wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
+    wxCHECK_MSG( data, false, wxT("data is invalid") );
 
     // we can only store one wxDataObject
     Clear();
@@ -497,7 +497,7 @@ void wxClipboard::Close()
 {
     wxCHECK_RET( m_open, wxT("clipboard not open") );
 
-    m_open = FALSE;
+    m_open = false;
 }
 
 bool wxClipboard::IsOpened() const
@@ -508,7 +508,7 @@ bool wxClipboard::IsOpened() const
 bool wxClipboard::IsSupported( const wxDataFormat& format )
 {
     /* reentrance problems */
-    if (m_waiting) return FALSE;
+    if (m_waiting) return false;
 
     /* store requested format to be asked for by callbacks */
     m_targetRequested = format;
@@ -517,19 +517,19 @@ bool wxClipboard::IsSupported( const wxDataFormat& format )
                 wxT("wxClipboard:IsSupported: requested format: %s"),
                 format.GetId().c_str() );
 
-    wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+    wxCHECK_MSG( m_targetRequested, false, wxT("invalid clipboard format") );
 
-    m_formatSupported = FALSE;
+    m_formatSupported = false;
 
     /* perform query. this will set m_formatSupported to
-       TRUE if m_targetRequested is supported.
+       true if m_targetRequested is supported.
        also, we have to wait for the "answer" from the
        clipboard owner which is an asynchronous process.
-       therefore we set m_waiting = TRUE here and wait
+       therefore we set m_waiting = true here and wait
        until the callback "targets_selection_received"
-       sets it to FALSE */
+       sets it to false */
 
-    m_waiting = TRUE;
+    m_waiting = true;
 
     gtk_selection_convert( m_targetsWidget,
                            m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY
@@ -544,7 +544,7 @@ bool wxClipboard::IsSupported( const wxDataFormat& format )
 
 bool wxClipboard::GetData( wxDataObject& data )
 {
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
     /* get formats from wxDataObjects */
     wxDataFormat *array = new wxDataFormat[ data.GetFormatCount() ];
@@ -563,19 +563,19 @@ bool wxClipboard::GetData( wxDataObject& data )
         /* store requested format to be asked for by callbacks */
         m_targetRequested = format;
 
-        wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+        wxCHECK_MSG( m_targetRequested, false, wxT("invalid clipboard format") );
 
-        m_formatSupported = FALSE;
+        m_formatSupported = false;
 
        /* perform query. this will set m_formatSupported to
-          TRUE if m_targetRequested is supported.
+          true if m_targetRequested is supported.
           also, we have to wait for the "answer" from the
           clipboard owner which is an asynchronous process.
-          therefore we set m_waiting = TRUE here and wait
+          therefore we set m_waiting = true here and wait
           until the callback "targets_selection_received"
-          sets it to FALSE */
+          sets it to false */
 
-        m_waiting = TRUE;
+        m_waiting = true;
 
         gtk_selection_convert( m_targetsWidget,
                            m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY
@@ -593,21 +593,21 @@ bool wxClipboard::GetData( wxDataObject& data )
         /* store requested format to be asked for by callbacks */
         m_targetRequested = format;
 
-        wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+        wxCHECK_MSG( m_targetRequested, false, wxT("invalid clipboard format") );
 
         /* start query */
-        m_formatSupported = FALSE;
+        m_formatSupported = false;
 
         /* ask for clipboard contents.  this will set
-           m_formatSupported to TRUE if m_targetRequested
+           m_formatSupported to true if m_targetRequested
            is supported.
            also, we have to wait for the "answer" from the
            clipboard owner which is an asynchronous process.
-           therefore we set m_waiting = TRUE here and wait
+           therefore we set m_waiting = true here and wait
            until the callback "targets_selection_received"
-           sets it to FALSE */
+           sets it to false */
 
-        m_waiting = TRUE;
+        m_waiting = true;
 
         wxLogTrace( TRACE_CLIPBOARD,
                     wxT("wxClipboard::GetData: format found, start convert") );
@@ -621,11 +621,11 @@ bool wxClipboard::GetData( wxDataObject& data )
         while (m_waiting) gtk_main_iteration();
 
         /* this is a true error as we checked for the presence of such data before */
-        wxCHECK_MSG( m_formatSupported, FALSE, wxT("error retrieving data from clipboard") );
+        wxCHECK_MSG( m_formatSupported, false, wxT("error retrieving data from clipboard") );
 
         /* return success */
         delete[] array;
-        return TRUE;
+        return true;
     }
 
     wxLogTrace( TRACE_CLIPBOARD,
@@ -633,7 +633,7 @@ bool wxClipboard::GetData( wxDataObject& data )
 
     /* return failure */
     delete[] array;
-    return FALSE;
+    return false;
 }
 
 #endif
diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp
index 6e9d9f33a8..2a9b130532 100644
--- a/src/gtk1/cursor.cpp
+++ b/src/gtk1/cursor.cpp
@@ -14,10 +14,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
-#include "wx/utils.h"
-
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp
index 4da84ef7b0..1d128192e1 100644
--- a/src/gtk1/dnd.cpp
+++ b/src/gtk1/dnd.cpp
@@ -18,11 +18,11 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include "wx/gtk1/private.h"
 
diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp
index d912375443..741824b351 100644
--- a/src/gtk1/fontdlg.cpp
+++ b/src/gtk1/fontdlg.cpp
@@ -16,10 +16,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/fontutil.h"
-#include "wx/utils.h"
 #include "wx/debug.h"
 #include "wx/msgdlg.h"
 
diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp
index e7988ebf58..ab51f39ea5 100644
--- a/src/gtk1/listbox.cpp
+++ b/src/gtk1/listbox.cpp
@@ -17,10 +17,10 @@
 #ifndef WX_PRECOMP
     #include "wx/dynarray.h"
     #include "wx/intl.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/arrstr.h"
-#include "wx/utils.h"
 #include "wx/checklst.h"
 #include "wx/settings.h"
 #include "wx/gtk1/private.h"
diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp
index d5b0887776..2d8998bbe1 100644
--- a/src/gtk1/notebook.cpp
+++ b/src/gtk1/notebook.cpp
@@ -17,10 +17,10 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/panel.h"
-#include "wx/utils.h"
 #include "wx/imaglist.h"
 #include "wx/bitmap.h"
 #include "wx/fontutil.h"
@@ -100,7 +100,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
     wxCHECK_RET( !notebook->m_inSwitchPage,
                  _T("gtk_notebook_page_change_callback reentered") );
 
-    notebook->m_inSwitchPage = TRUE;
+    notebook->m_inSwitchPage = true;
     if (g_isIdle)
         wxapp_install_idle_handler();
 
@@ -292,11 +292,11 @@ END_EVENT_TABLE()
 void wxNotebook::Init()
 {
     m_padding = 0;
-    m_inSwitchPage = FALSE;
+    m_inSwitchPage = false;
 
     m_imageList = (wxImageList *) NULL;
     m_selection = -1;
-    m_themeEnabled = TRUE;
+    m_themeEnabled = true;
 }
 
 wxNotebook::wxNotebook()
@@ -321,15 +321,15 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
                         const wxPoint& pos, const wxSize& size,
                         long style, const wxString& name )
 {
-    m_needParent = TRUE;
-    m_acceptsFocus = TRUE;
+    m_needParent = true;
+    m_acceptsFocus = true;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( wxT("wxNoteBook creation failed") );
-        return FALSE;
+        return false;
     }
 
 
@@ -357,7 +357,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
                             GTK_SIGNAL_FUNC(gtk_notebook_realized_callback), (gpointer) this );
 
-    return TRUE;
+    return true;
 }
 
 int wxNotebook::GetSelection() const
@@ -446,7 +446,7 @@ bool wxNotebook::SetPageText( size_t page, const wxString &text )
 
     gtk_label_set( nb_page->m_label, wxGTK_CONV( nb_page->m_text ) );
 
-    return TRUE;
+    return true;
 }
 
 bool wxNotebook::SetPageImage( size_t page, int image )
@@ -461,7 +461,7 @@ bool wxNotebook::SetPageImage( size_t page, int image )
      * Not enabled because it may break existing (stupid) code that
      * manipulates the imagelist to cycle images */
 
-    /* if (image == nb_page->m_image) return TRUE; */
+    /* if (image == nb_page->m_image) return true; */
 
     /* For different cases:
        1) no image -> no image
@@ -470,7 +470,7 @@ bool wxNotebook::SetPageImage( size_t page, int image )
        4) image -> image */
 
     if (image == -1 && nb_page->m_image == -1)
-        return TRUE; /* Case 1): Nothing to do. */
+        return true; /* Case 1): Nothing to do. */
 
     GtkWidget *pixmapwid = (GtkWidget*) NULL;
 
@@ -498,7 +498,7 @@ bool wxNotebook::SetPageImage( size_t page, int image )
             gtk_container_remove(GTK_CONTAINER(nb_page->m_box), pixmapwid);
             nb_page->m_image = -1;
 
-            return TRUE; /* Case 2) */
+            return true; /* Case 2) */
         }
     }
 
@@ -531,7 +531,7 @@ bool wxNotebook::SetPageImage( size_t page, int image )
 
     nb_page->m_image = image;
 
-    return TRUE;
+    return true;
 }
 
 void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
@@ -644,7 +644,7 @@ bool wxNotebook::InsertPage( size_t position,
       GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
 
     if (m_themeEnabled)
-        win->SetThemeEnabled(TRUE);
+        win->SetThemeEnabled(true);
 
     GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);
 
@@ -716,7 +716,7 @@ bool wxNotebook::InsertPage( size_t position,
       GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer)this );
 
     InvalidateBestSize();
-    return TRUE;
+    return true;
 }
 
 // helper for HitTest(): check if the point lies inside the given widget which
@@ -819,7 +819,7 @@ void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )
 
 bool wxNotebook::DoPhase( int WXUNUSED(nPhase) )
 {
-    return TRUE;
+    return true;
 }
 
 #endif
diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp
index bc2977ba69..4fcc4eb928 100644
--- a/src/gtk1/scrolbar.cpp
+++ b/src/gtk1/scrolbar.cpp
@@ -14,7 +14,10 @@
 
 #include "wx/scrolbar.h"
 
-#include "wx/utils.h"
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/math.h"
 #include "wx/gtk1/private.h"
 
@@ -362,4 +365,4 @@ wxScrollBar::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_vscrollbar_new);
 }
 
-#endif
+#endif // wxUSE_SCROLLBAR
diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp
index 594d0ae265..6f37e77222 100644
--- a/src/gtk1/slider.cpp
+++ b/src/gtk1/slider.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        gtk/slider.cpp
+// Name:        src/gtk1/slider.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -10,11 +10,14 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_SLIDER
+
 #include "wx/slider.h"
 
-#if wxUSE_SLIDER
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
-#include "wx/utils.h"
 #include "wx/math.h"
 #include "wx/gtk1/private.h"
 
@@ -136,14 +139,14 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
         const wxPoint& pos, const wxSize& size,
         long style, const wxValidator& validator, const wxString& name )
 {
-    m_acceptsFocus = TRUE;
-    m_needParent = TRUE;
+    m_acceptsFocus = true;
+    m_needParent = true;
 
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
         wxFAIL_MSG( wxT("wxSlider creation failed") );
-        return FALSE;
+        return false;
     }
 
     m_oldPos = 0.0;
@@ -201,7 +204,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation(size);
 
-    return TRUE;
+    return true;
 }
 
 int wxSlider::GetValue() const
@@ -339,4 +342,4 @@ wxSlider::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_vscale_new);
 }
 
-#endif
+#endif // wxUSE_SLIDER
diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp
index 0af1e68f5d..607e7bc682 100644
--- a/src/gtk1/spinbutt.cpp
+++ b/src/gtk1/spinbutt.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        spinbutt.cpp
+// Name:        src/gtk1/spinbutt.cpp
 // Purpose:     wxSpinButton
 // Author:      Robert
 // Modified by:
@@ -11,11 +11,14 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_SPINBTN
+
 #include "wx/spinbutt.h"
 
-#if wxUSE_SPINBTN
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
-#include "wx/utils.h"
 #include "wx/math.h"
 #include "wx/gtk1/private.h"
 
@@ -114,7 +117,7 @@ bool wxSpinButton::Create(wxWindow *parent,
                           long style,
                           const wxString& name)
 {
-    m_needParent = TRUE;
+    m_needParent = true;
 
     wxSize new_size = size,
            sizeBest = DoGetBestSize();
@@ -126,7 +129,7 @@ bool wxSpinButton::Create(wxWindow *parent,
         !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( wxT("wxXX creation failed") );
-        return FALSE;
+        return false;
     }
 
     m_oldPos = 0.0;
@@ -147,7 +150,7 @@ bool wxSpinButton::Create(wxWindow *parent,
 
     PostCreation(new_size);
 
-    return TRUE;
+    return true;
 }
 
 int wxSpinButton::GetMin() const
@@ -236,4 +239,4 @@ wxSpinButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_button_new);
 }
 
-#endif
+#endif // wxUSE_SPINBTN
diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp
index e0c8046cfa..12718d6159 100644
--- a/src/gtk1/spinctrl.cpp
+++ b/src/gtk1/spinctrl.cpp
@@ -11,11 +11,13 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#include "wx/spinctrl.h"
-
 #if wxUSE_SPINCTRL
 
-#include "wx/utils.h"
+#include "wx/spinctrl.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
 #include "wx/textctrl.h"    // for wxEVT_COMMAND_TEXT_UPDATED
 #include "wx/math.h"
diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp
index 36ac27ffd4..59dc8c0690 100644
--- a/src/gtk1/textctrl.cpp
+++ b/src/gtk1/textctrl.cpp
@@ -15,9 +15,9 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/math.h"
 #include "wx/settings.h"
 #include "wx/panel.h"
diff --git a/src/gtk1/threadsgi.cpp b/src/gtk1/threadsgi.cpp
index 914ad1ef37..b4e1b4ab82 100644
--- a/src/gtk1/threadsgi.cpp
+++ b/src/gtk1/threadsgi.cpp
@@ -16,6 +16,7 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include <stdio.h>
@@ -25,7 +26,6 @@
 #include <sys/wait.h>
 #include <sys/prctl.h>
 #include "wx/module.h"
-#include "wx/utils.h"
 
 #include "gdk/gdk.h"
 #include "gtk/gtk.h"
@@ -261,7 +261,7 @@ bool wxThreadModule::OnInit()
     wxThreadGuiInit();
     p_mainid = (int)getpid();
     wxMainMutex->Lock();
-    return TRUE;
+    return true;
 }
 
 void wxThreadModule::OnExit()
@@ -270,4 +270,3 @@ void wxThreadModule::OnExit()
     wxThreadGuiExit();
     delete wxMainMutex;
 }
-
diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp
index 738fdc8086..23578f743b 100644
--- a/src/gtk1/window.cpp
+++ b/src/gtk1/window.cpp
@@ -20,12 +20,12 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/dcclient.h"
 #include "wx/frame.h"
 #include "wx/layout.h"
-#include "wx/utils.h"
 #include "wx/dialog.h"
 #include "wx/msgdlg.h"
 #include "wx/module.h"
@@ -1352,7 +1352,7 @@ template<typename T> void InitMouseEvent(wxWindowGTK *win,
 static void AdjustEventButtonState(wxMouseEvent& event)
 {
     // GDK reports the old state of the button for a button press event, but
-    // for compatibility with MSW and common sense we want m_leftDown be TRUE
+    // for compatibility with MSW and common sense we want m_leftDown be true
     // for a LEFT_DOWN event, not FALSE, so we will invert
     // left/right/middleDown for the corresponding click events
 
diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp
index 8338c41618..4a80a2817d 100644
--- a/src/mac/carbon/app.cpp
+++ b/src/mac/carbon/app.cpp
@@ -16,12 +16,12 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
 #include "wx/frame.h"
 #include "wx/button.h"
-#include "wx/utils.h"
 #include "wx/gdicmn.h"
 #include "wx/pen.h"
 #include "wx/brush.h"
diff --git a/src/mac/carbon/brush.cpp b/src/mac/carbon/brush.cpp
index ae77b03b20..4f56a3a614 100644
--- a/src/mac/carbon/brush.cpp
+++ b/src/mac/carbon/brush.cpp
@@ -11,9 +11,12 @@
 
 #include "wx/wxprec.h"
 
-#include "wx/utils.h"
 #include "wx/brush.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/mac/private.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
@@ -230,4 +233,3 @@ wxMacBrushKind wxBrush::MacGetBrushKind() const
 {
     return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
 }
-
diff --git a/src/mac/carbon/cfsocket.cpp b/src/mac/carbon/cfsocket.cpp
index 45c8b20ecd..cfeb84963a 100644
--- a/src/mac/carbon/cfsocket.cpp
+++ b/src/mac/carbon/cfsocket.cpp
@@ -26,11 +26,11 @@
     #include "wx/log.h"
     #include "wx/event.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/apptrait.h"
 #include "wx/timer.h"
-#include "wx/utils.h"
 #include "wx/module.h"
 
 #include "wx/sckaddr.h"
diff --git a/src/mac/carbon/clipbrd.cpp b/src/mac/carbon/clipbrd.cpp
index 1e49197c03..18e8d90a59 100644
--- a/src/mac/carbon/clipbrd.cpp
+++ b/src/mac/carbon/clipbrd.cpp
@@ -2,7 +2,7 @@
 // Name:        src/mac/carbon/clipbrd.cpp
 // Purpose:     Clipboard functionality
 // Author:      Stefan Csomor;
-//                   Generalized clipboard implementation by Matthew Flatt
+//              Generalized clipboard implementation by Matthew Flatt
 // Modified by:
 // Created:     1998-01-01
 // RCS-ID:      $Id$
@@ -20,11 +20,11 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/frame.h"
 #include "wx/bitmap.h"
-#include "wx/utils.h"
 #include "wx/metafile.h"
 
 #ifndef __DARWIN__
diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp
index 5eeadbf263..69f568b9a5 100644
--- a/src/mac/carbon/dialog.cpp
+++ b/src/mac/carbon/dialog.cpp
@@ -15,9 +15,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
-#include "wx/utils.h"
 #include "wx/frame.h"
 #include "wx/settings.h"
 
diff --git a/src/mac/carbon/dirdlg.cpp b/src/mac/carbon/dirdlg.cpp
index a17768a61b..60ace1175c 100644
--- a/src/mac/carbon/dirdlg.cpp
+++ b/src/mac/carbon/dirdlg.cpp
@@ -1,31 +1,35 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        dirdlg.cpp
+// Name:        src/mac/carbon/dirdlg.cpp
 // Purpose:     wxDirDialog
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
-// Licence:       wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
 
 #if wxUSE_DIRDLG
 
-#include "wx/utils.h"
-#include "wx/dialog.h"
 #include "wx/dirdlg.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif // WX_PRECOMP
+
+#include "wx/dialog.h"
+
 #include "wx/cmndata.h"
 #include "wx/filename.h"
 
 #include "wx/mac/private.h"
 
 #ifdef __DARWIN__
-  #include <Carbon/Carbon.h>
+    #include <Carbon/Carbon.h>
 #else
-  #include <Navigation.h>
+    #include <Navigation.h>
 #endif
 
 IMPLEMENT_CLASS(wxDirDialog, wxDialog)
@@ -45,7 +49,7 @@ static pascal void NavEventProc(
     wxDirDialog * data = ( wxDirDialog *) ioUserData ;
     if ( inSelector == kNavCBStart )
     {
-        if (data && !data->GetPath().IsEmpty() )
+        if (data && !data->GetPath().empty() )
         {
             // Set default location for the modern Navigation APIs
             // Apple Technical Q&A 1151
@@ -80,15 +84,15 @@ int wxDirDialog::ShowModal()
     NavReplyRecord reply ;
     bool disposeReply = false ;
     OSStatus err = noErr;
-    
+
     err = NavGetDefaultDialogCreationOptions(&options);
-    if (err == noErr) 
+    if (err == noErr)
     {
         wxMacCFStringHolder message(m_message, m_font.GetEncoding());
         options.message = message;
         err = NavCreateChooseFolderDialog(&options, sStandardNavEventFilter , NULL,  this , &dialog);
-        if (err == noErr) 
-        {        
+        if (err == noErr)
+        {
             err = NavDialogRun(dialog);
             if ( err == noErr )
             {
@@ -97,16 +101,16 @@ int wxDirDialog::ShowModal()
             }
         }
     }
-    
-    if ( err == noErr ) 
-    { 
+
+    if ( err == noErr )
+    {
         if ( reply.validRecord )
         {
             FSRef folderInfo;
             AEDesc specDesc ;
-            
+
             OSErr err = ::AECoerceDesc( &reply.selection , typeFSRef, &specDesc);
-            if ( err != noErr ) 
+            if ( err != noErr )
             {
                 m_path = wxEmptyString ;
             }
@@ -114,10 +118,10 @@ int wxDirDialog::ShowModal()
             {
                 folderInfo = **(FSRef**) specDesc.dataHandle;
                 m_path = wxMacFSRefToPath( &folderInfo ) ;
-                if (specDesc.dataHandle != nil) 
+                if (specDesc.dataHandle != nil)
                 {
                     ::AEDisposeDesc(&specDesc);
-                }            
+                }
             }
         }
         else
@@ -125,14 +129,14 @@ int wxDirDialog::ShowModal()
             err = paramErr ; // could be any error, only used for giving back wxID_CANCEL
         }
     }
-    
+
     if ( disposeReply )
         ::NavDisposeReply(&reply);
-    
+
     // apparently cancelling shouldn't change m_path
     if ( err != noErr && err != userCanceledErr )
         m_path = wxEmptyString ;
-    
+
     return (err == noErr) ? wxID_OK : wxID_CANCEL ;
 }
 
diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp
index 5b668fec72..dcc70f4bdb 100644
--- a/src/mac/carbon/filedlg.cpp
+++ b/src/mac/carbon/filedlg.cpp
@@ -16,9 +16,9 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/dialog.h"
 #include "wx/tokenzr.h"
 #include "wx/filename.h"
@@ -74,7 +74,7 @@ static pascal void NavEventProc(
     }
     else if ( inSelector == kNavCBStart )
     {
-        if (data && !(data->defaultLocation).IsEmpty())
+        if (data && !(data->defaultLocation).empty())
         {
             // Set default location for the modern Navigation APIs
             // Apple Technical Q&A 1151
diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp
index 1d4d28e4d6..666b85b5f7 100644
--- a/src/mac/carbon/font.cpp
+++ b/src/mac/carbon/font.cpp
@@ -15,11 +15,11 @@
 
 #ifndef WX_PRECOMP
     #include "wx/string.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/fontutil.h"
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 #include "wx/fontutil.h"
 
 #include "wx/mac/private.h"
@@ -202,7 +202,7 @@ wxFontRefData::~wxFontRefData()
 void wxFontRefData::MacFindFont()
 {
     OSStatus status ;
-    
+
     Str255 qdFontName ;
     if ( m_macThemeFontID != kThemeCurrentPortFont )
     {
@@ -219,7 +219,7 @@ void wxFontRefData::MacFindFont()
         if ( m_macFontStyle & underline )
             m_underlined = true ;
         m_pointSize = m_macFontSize ;
-        
+
         m_macFontFamily = FMGetFontFamilyFromName( qdFontName );
     }
     else
@@ -291,7 +291,7 @@ void wxFontRefData::MacFindFont()
     wxASSERT_MSG( status == noErr , wxT("couldn't get an ATSUFont from font family") );
 
     m_macATSUAdditionalQDStyles = m_macFontStyle & (~intrinsicStyle );
-    
+
     if ( m_macATSUStyle )
     {
         ::ATSUDisposeStyle((ATSUStyle)m_macATSUStyle);
diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp
index 91a2c995a6..50112e6d37 100644
--- a/src/mac/carbon/listbox.cpp
+++ b/src/mac/carbon/listbox.cpp
@@ -19,14 +19,13 @@
     #include "wx/dynarray.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/button.h"
 #include "wx/settings.h"
 #include "wx/toplevel.h"
 
-#include "wx/utils.h"
-
 IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
 
 BEGIN_EVENT_TABLE(wxListBox, wxControl)
diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp
index c4e9815e8a..94f29966bc 100644
--- a/src/mac/carbon/menu.cpp
+++ b/src/mac/carbon/menu.cpp
@@ -23,12 +23,12 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/menuitem.h"
 #include "wx/window.h"
 #include "wx/log.h"
-#include "wx/utils.h"
 #include "wx/frame.h"
 
 #include "wx/mac/uma.h"
diff --git a/src/mac/carbon/pen.cpp b/src/mac/carbon/pen.cpp
index 2fb238858a..7f0acfebe5 100644
--- a/src/mac/carbon/pen.cpp
+++ b/src/mac/carbon/pen.cpp
@@ -11,9 +11,12 @@
 
 #include "wx/wxprec.h"
 
-#include "wx/utils.h"
 #include "wx/pen.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
 
 wxPenRefData::wxPenRefData()
diff --git a/src/mac/carbon/settings.cpp b/src/mac/carbon/settings.cpp
index 6f19bfb7dc..450b800996 100644
--- a/src/mac/carbon/settings.cpp
+++ b/src/mac/carbon/settings.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        settings.cpp
+// Name:        src/mac/carbon/settings.cpp
 // Purpose:     wxSettings
 // Author:      Stefan Csomor
 // Modified by:
@@ -12,8 +12,12 @@
 #include "wx/wxprec.h"
 
 #include "wx/settings.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include "wx/mac/uma.h"
 
diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp
index b6bb94d019..78c2ebeaac 100644
--- a/src/mac/carbon/stattext.cpp
+++ b/src/mac/carbon/stattext.cpp
@@ -17,13 +17,13 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
 #include "wx/notebook.h"
 #include "wx/tabctrl.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
-#include "wx/utils.h"
 #include "wx/settings.h"
 
 #include "wx/mac/uma.h"
diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp
index 0a622adfb4..6645f1e881 100644
--- a/src/mac/carbon/textctrl.cpp
+++ b/src/mac/carbon/textctrl.cpp
@@ -18,6 +18,7 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #ifdef __DARWIN__
@@ -42,7 +43,6 @@
 #include "wx/toplevel.h"
 #include "wx/settings.h"
 #include "wx/filefn.h"
-#include "wx/utils.h"
 #include "wx/sysopt.h"
 #include "wx/menu.h"
 
diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp
index 674afb8bd4..6093f5494e 100644
--- a/src/mac/carbon/window.cpp
+++ b/src/mac/carbon/window.cpp
@@ -16,12 +16,12 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/menu.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
-#include "wx/utils.h"
 #include "wx/panel.h"
 #include "wx/layout.h"
 #include "wx/dialog.h"
diff --git a/src/mac/classic/app.cpp b/src/mac/classic/app.cpp
index bbce9ec769..5f4fb9e612 100644
--- a/src/mac/classic/app.cpp
+++ b/src/mac/classic/app.cpp
@@ -20,12 +20,12 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
 #include "wx/frame.h"
 #include "wx/button.h"
-#include "wx/utils.h"
 #include "wx/gdicmn.h"
 #include "wx/pen.h"
 #include "wx/brush.h"
diff --git a/src/mac/classic/brush.cpp b/src/mac/classic/brush.cpp
index bf5c4c368f..a2e9e6d798 100644
--- a/src/mac/classic/brush.cpp
+++ b/src/mac/classic/brush.cpp
@@ -11,9 +11,12 @@
 
 #include "wx/wxprec.h"
 
-#include "wx/utils.h"
 #include "wx/brush.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/mac/private.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
diff --git a/src/mac/classic/clipbrd.cpp b/src/mac/classic/clipbrd.cpp
index eee39f0f07..294e8d2631 100644
--- a/src/mac/classic/clipbrd.cpp
+++ b/src/mac/classic/clipbrd.cpp
@@ -17,11 +17,11 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/frame.h"
 #include "wx/bitmap.h"
-#include "wx/utils.h"
 #include "wx/metafile.h"
 
 #ifndef __DARWIN__
diff --git a/src/mac/classic/dialog.cpp b/src/mac/classic/dialog.cpp
index 7e5599e8ce..75a92a14f0 100644
--- a/src/mac/classic/dialog.cpp
+++ b/src/mac/classic/dialog.cpp
@@ -15,9 +15,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif // WX_PRECOMP
 
-#include "wx/utils.h"
 #include "wx/frame.h"
 #include "wx/settings.h"
 
diff --git a/src/mac/classic/dirdlg.cpp b/src/mac/classic/dirdlg.cpp
index d58aa0d5f4..b9ee11f0b3 100644
--- a/src/mac/classic/dirdlg.cpp
+++ b/src/mac/classic/dirdlg.cpp
@@ -15,10 +15,14 @@
     #pragma hdrstop
 #endif
 
-#include "wx/utils.h"
-#include "wx/dialog.h"
 #include "wx/dirdlg.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif // WX_PRECOMP
+
+#include "wx/dialog.h"
+
 #include "wx/cmndata.h"
 
 #include "wx/mac/private.h"
diff --git a/src/mac/classic/filedlg.cpp b/src/mac/classic/filedlg.cpp
index 52ecefe806..f80b88378e 100644
--- a/src/mac/classic/filedlg.cpp
+++ b/src/mac/classic/filedlg.cpp
@@ -20,9 +20,9 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/dialog.h"
 #include "wx/tokenzr.h"
 #include "wx/filename.h"
@@ -98,7 +98,7 @@ NavEventProc(
     else if ( inSelector == kNavCBStart )
     {
 #if TARGET_CARBON
-        if (data && !(data->defaultLocation).IsEmpty())
+        if (data && !(data->defaultLocation).empty())
         {
             // Set default location for the modern Navigation APIs
             // Apple Technical Q&A 1151
diff --git a/src/mac/classic/font.cpp b/src/mac/classic/font.cpp
index 42445ce21a..09feb155c6 100644
--- a/src/mac/classic/font.cpp
+++ b/src/mac/classic/font.cpp
@@ -19,11 +19,11 @@
 
 #ifndef WX_PRECOMP
     #include "wx/string.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/fontutil.h"
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include "wx/fontutil.h"
 
diff --git a/src/mac/classic/listbox.cpp b/src/mac/classic/listbox.cpp
index a34258969c..303848e70c 100644
--- a/src/mac/classic/listbox.cpp
+++ b/src/mac/classic/listbox.cpp
@@ -19,14 +19,13 @@
     #include "wx/dynarray.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/button.h"
 #include "wx/settings.h"
 #include "wx/toplevel.h"
 
-#include "wx/utils.h"
-
 IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
 
 BEGIN_EVENT_TABLE(wxListBox, wxControl)
diff --git a/src/mac/classic/menu.cpp b/src/mac/classic/menu.cpp
index 01345794d2..66a7365a55 100644
--- a/src/mac/classic/menu.cpp
+++ b/src/mac/classic/menu.cpp
@@ -23,11 +23,11 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/menuitem.h"
 #include "wx/window.h"
-#include "wx/utils.h"
 #include "wx/frame.h"
 
 #include "wx/mac/uma.h"
diff --git a/src/mac/classic/pen.cpp b/src/mac/classic/pen.cpp
index 0a980d0c4d..cd3184992c 100644
--- a/src/mac/classic/pen.cpp
+++ b/src/mac/classic/pen.cpp
@@ -11,9 +11,12 @@
 
 #include "wx/wxprec.h"
 
-#include "wx/utils.h"
 #include "wx/pen.h"
 
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
 
 wxPenRefData::wxPenRefData()
diff --git a/src/mac/classic/settings.cpp b/src/mac/classic/settings.cpp
index f9c75a0d04..fda51b4928 100644
--- a/src/mac/classic/settings.cpp
+++ b/src/mac/classic/settings.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        settings.cpp
+// Name:        src/mac/classic/settings.cpp
 // Purpose:     wxSettings
 // Author:      Stefan Csomor
 // Modified by:
@@ -9,9 +9,15 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+#include "wx/wxprec.h"
+
 #include "wx/settings.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include "wx/mac/uma.h"
 
@@ -27,7 +33,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
 {
     int major,minor;
     wxGetOsVersion( &major, &minor );
-    
+
     switch( index )
     {
         case wxSYS_COLOUR_SCROLLBAR :
@@ -78,7 +84,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_GRAYTEXT:
             return wxColor( 0xCC , 0xCC , 0xCC ) ;
             break ;
-    
+
         case wxSYS_COLOUR_3DDKSHADOW:
             return wxColor( 0x44 , 0x44 , 0x44 ) ;
             break ;
@@ -96,7 +102,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
             }
             break ;
         case wxSYS_COLOUR_INFOBK :
-        case wxSYS_COLOUR_APPWORKSPACE: 
+        case wxSYS_COLOUR_APPWORKSPACE:
             return *wxWHITE ;
             break ;
 
@@ -106,7 +112,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         case wxSYS_COLOUR_MENUHILIGHT:
             // TODO
             return *wxBLACK;
-         
+
         case wxSYS_COLOUR_MAX:
             wxFAIL_MSG( _T("unknown system colour index") );
             break ;
@@ -138,7 +144,6 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
                 return *wxNORMAL_FONT ;
                     } ;
             break ;
-                
     }
     return *wxNORMAL_FONT;
 }
@@ -157,7 +162,7 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w
         case wxSYS_MOUSE_BUTTONS:
             // we emulate a two button mouse (ctrl + click = right button )
             return 2;
-            
+
         // TODO case wxSYS_BORDER_X:
         // TODO case wxSYS_BORDER_Y:
         // TODO case wxSYS_CURSOR_X:
@@ -168,33 +173,33 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w
         // TODO case wxSYS_DRAG_Y:
         // TODO case wxSYS_EDGE_X:
         // TODO case wxSYS_EDGE_Y:
-            
+
         case wxSYS_HSCROLL_ARROW_X:
             return 16;
         case wxSYS_HSCROLL_ARROW_Y:
             return 16;
         case wxSYS_HTHUMB_X:
             return 16;
-            
+
         // TODO case wxSYS_ICON_X:
         // TODO case wxSYS_ICON_Y:
         // TODO case wxSYS_ICONSPACING_X:
         // TODO case wxSYS_ICONSPACING_Y:
         // TODO case wxSYS_WINDOWMIN_X:
         // TODO case wxSYS_WINDOWMIN_Y:
-            
+
         case wxSYS_SCREEN_X:
             wxDisplaySize(&value, NULL);
             return value;
         case wxSYS_SCREEN_Y:
             wxDisplaySize(NULL, &value);
             return value;
-            
+
         // TODO case wxSYS_FRAMESIZE_X:
         // TODO case wxSYS_FRAMESIZE_Y:
         // TODO case wxSYS_SMALLICON_X:
         // TODO case wxSYS_SMALLICON_Y:
-            
+
         case wxSYS_HSCROLL_Y:
             return 16;
         case wxSYS_VSCROLL_X:
@@ -205,19 +210,19 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w
             return 16;
         case wxSYS_VTHUMB_Y:
             return 16;
-            
+
         // TODO case wxSYS_CAPTION_Y:
         // TODO case wxSYS_MENU_Y:
         // TODO case wxSYS_NETWORK_PRESENT:
-            
+
         case wxSYS_PENWINDOWS_PRESENT:
             return 0;
-            
+
         // TODO case wxSYS_SHOW_SOUNDS:
-            
+
         case wxSYS_SWAP_BUTTONS:
             return 0;
-            
+
         default:
             return -1;  // unsupported metric
     }
@@ -228,11 +233,11 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
 {
     switch (index)
     {
-        case wxSYS_CAN_ICONIZE_FRAME: 
+        case wxSYS_CAN_ICONIZE_FRAME:
         case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
-            return TRUE;
-            
+            return true;
+
         default:
-            return FALSE;
+            return false;
     }
 }
diff --git a/src/mac/classic/stattext.cpp b/src/mac/classic/stattext.cpp
index dfcfab0a42..d748041bec 100644
--- a/src/mac/classic/stattext.cpp
+++ b/src/mac/classic/stattext.cpp
@@ -15,13 +15,13 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/notebook.h"
 #include "wx/tabctrl.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
-#include "wx/utils.h"
 #include "wx/settings.h"
 
 #include <stdio.h>
diff --git a/src/mac/classic/textctrl.cpp b/src/mac/classic/textctrl.cpp
index c482de0f2c..bd8363888b 100644
--- a/src/mac/classic/textctrl.cpp
+++ b/src/mac/classic/textctrl.cpp
@@ -21,6 +21,7 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #ifdef __DARWIN__
@@ -47,7 +48,6 @@
 #include "wx/tabctrl.h"
 #include "wx/settings.h"
 #include "wx/filefn.h"
-#include "wx/utils.h"
 
 #if defined(__BORLANDC__) && !defined(__WIN32__)
     #include <alloc.h>
diff --git a/src/mac/classic/window.cpp b/src/mac/classic/window.cpp
index 73e83de943..c18d278e5b 100644
--- a/src/mac/classic/window.cpp
+++ b/src/mac/classic/window.cpp
@@ -16,12 +16,12 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/menu.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
-#include "wx/utils.h"
 #include "wx/panel.h"
 #include "wx/layout.h"
 #include "wx/dialog.h"
diff --git a/src/mac/corefoundation/hid.cpp b/src/mac/corefoundation/hid.cpp
index e052ab5063..f072b71b46 100644
--- a/src/mac/corefoundation/hid.cpp
+++ b/src/mac/corefoundation/hid.cpp
@@ -33,11 +33,11 @@
     #include "wx/dynarray.h"
     #include "wx/string.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/mac/corefoundation/cfstring.h"
 
-#include "wx/utils.h"
 #include "wx/module.h"
 
 // ============================================================================
diff --git a/src/mgl/bitmap.cpp b/src/mgl/bitmap.cpp
index e65eabae6d..7f5df13f1f 100644
--- a/src/mgl/bitmap.cpp
+++ b/src/mgl/bitmap.cpp
@@ -18,13 +18,13 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/icon.h"
 #include "wx/filefn.h"
 #include "wx/image.h"
 #include "wx/dcmemory.h"
-#include "wx/utils.h"
 #include "wx/image.h"
 #include "wx/xpmdecod.h"
 
diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp
index d678b261ee..275c62c34b 100644
--- a/src/mgl/cursor.cpp
+++ b/src/mgl/cursor.cpp
@@ -19,10 +19,10 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/module.h"
-#include "wx/utils.h"
 #include "wx/hashmap.h"
 
 #include "wx/mgl/private.h"
diff --git a/src/mgl/font.cpp b/src/mgl/font.cpp
index d619798ed0..7c4f8903ab 100644
--- a/src/mgl/font.cpp
+++ b/src/mgl/font.cpp
@@ -25,11 +25,11 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/fontutil.h"
 #include "wx/cmndata.h"
-#include "wx/utils.h"
 #include "wx/gdicmn.h"
 #include "wx/tokenzr.h"
 #include "wx/settings.h"
@@ -46,7 +46,7 @@ public:
                   int family = wxDEFAULT,
                   int style = wxDEFAULT,
                   int weight = wxDEFAULT,
-                  bool underlined = FALSE,
+                  bool underlined = false,
                   const wxString& faceName = wxEmptyString,
                   wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
     wxFontRefData(const wxFontRefData& data);
@@ -121,7 +121,7 @@ void wxFontRefData::Init(int pointSize,
     m_encoding = encoding;
 
     m_library = NULL;
-    m_valid = FALSE;
+    m_valid = false;
 }
 
 wxFontRefData::wxFontRefData(const wxFontRefData& data)
@@ -174,7 +174,7 @@ bool wxFont::Create(int pointSize,
 {
     m_refData = new wxFontRefData(pointSize, family, style, weight,
                                   underlined, face, encoding);
-    return TRUE;
+    return true;
 }
 
 struct font_t *wxFont::GetMGLfont_t(float scale, bool antialiased)
@@ -246,7 +246,7 @@ int wxFont::GetWeight() const
 
 bool wxFont::GetUnderlined() const
 {
-    wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), false, wxT("invalid font") );
 
     return M_FONTDATA->m_underlined;
 }
@@ -261,7 +261,7 @@ wxFontEncoding wxFont::GetEncoding() const
 
 bool wxFont::IsFixedWidth() const
 {
-    wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), false, wxT("invalid font") );
 
     return (bool)(M_FONTDATA->m_library->GetFamily()->GetInfo()->isFixed);
 }
@@ -284,7 +284,7 @@ void wxFont::SetPointSize(int pointSize)
     AllocExclusive();
 
     M_FONTDATA->m_pointSize = pointSize;
-    M_FONTDATA->m_valid = FALSE;
+    M_FONTDATA->m_valid = false;
 }
 
 void wxFont::SetFamily(int family)
@@ -292,7 +292,7 @@ void wxFont::SetFamily(int family)
     AllocExclusive();
 
     M_FONTDATA->m_family = family;
-    M_FONTDATA->m_valid = FALSE;
+    M_FONTDATA->m_valid = false;
 }
 
 void wxFont::SetStyle(int style)
@@ -300,7 +300,7 @@ void wxFont::SetStyle(int style)
     AllocExclusive();
 
     M_FONTDATA->m_style = style;
-    M_FONTDATA->m_valid = FALSE;
+    M_FONTDATA->m_valid = false;
 }
 
 void wxFont::SetWeight(int weight)
@@ -308,7 +308,7 @@ void wxFont::SetWeight(int weight)
     AllocExclusive();
 
     M_FONTDATA->m_weight = weight;
-    M_FONTDATA->m_valid = FALSE;
+    M_FONTDATA->m_valid = false;
 }
 
 void wxFont::SetFaceName(const wxString& faceName)
@@ -316,7 +316,7 @@ void wxFont::SetFaceName(const wxString& faceName)
     AllocExclusive();
 
     M_FONTDATA->m_faceName = faceName;
-    M_FONTDATA->m_valid = FALSE;
+    M_FONTDATA->m_valid = false;
 }
 
 void wxFont::SetUnderlined(bool underlined)
@@ -331,5 +331,5 @@ void wxFont::SetEncoding(wxFontEncoding encoding)
     AllocExclusive();
 
     M_FONTDATA->m_encoding = encoding;
-    M_FONTDATA->m_valid = FALSE;
+    M_FONTDATA->m_valid = false;
 }
diff --git a/src/mgl/fontenum.cpp b/src/mgl/fontenum.cpp
index 044e471851..c3a523e17b 100644
--- a/src/mgl/fontenum.cpp
+++ b/src/mgl/fontenum.cpp
@@ -27,10 +27,9 @@
 #ifndef WX_PRECOMP
     #include "wx/dynarray.h"
     #include "wx/string.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
-
 #include "wx/encinfo.h"
 #include "wx/fontutil.h"
 
diff --git a/src/motif/accel.cpp b/src/motif/accel.cpp
index c1e6426f22..e3d7e23be3 100644
--- a/src/motif/accel.cpp
+++ b/src/motif/accel.cpp
@@ -16,9 +16,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/string.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include <ctype.h>
 
 IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject)
diff --git a/src/motif/app.cpp b/src/motif/app.cpp
index 5ed71e7572..278ceb911d 100644
--- a/src/motif/app.cpp
+++ b/src/motif/app.cpp
@@ -23,9 +23,9 @@
     #include "wx/hash.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/module.h"
 #include "wx/memory.h"
 #include "wx/evtloop.h"
diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp
index 948b2c673a..6d03da153a 100644
--- a/src/motif/checkbox.cpp
+++ b/src/motif/checkbox.cpp
@@ -17,8 +17,12 @@
 #endif
 
 #include "wx/checkbox.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/tglbtn.h"
-#include "wx/utils.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp
index 04531704ee..ba418a03e9 100644
--- a/src/motif/choice.cpp
+++ b/src/motif/choice.cpp
@@ -20,7 +20,11 @@
 #endif
 
 #include "wx/choice.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/arrstr.h"
 
 #ifdef __VMS__
diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp
index 08c3f81d81..5684992b09 100644
--- a/src/motif/clipbrd.cpp
+++ b/src/motif/clipbrd.cpp
@@ -27,10 +27,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/bitmap.h"
-#include "wx/utils.h"
 #include "wx/dataobj.h"
 #include "wx/ptr_scpd.h"
 
diff --git a/src/motif/control.cpp b/src/motif/control.cpp
index 18f8bbeb68..2c00c7cdf3 100644
--- a/src/motif/control.cpp
+++ b/src/motif/control.cpp
@@ -13,8 +13,12 @@
 #include "wx/wxprec.h"
 
 #include "wx/control.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/panel.h"
-#include "wx/utils.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/cursor.cpp b/src/motif/cursor.cpp
index a29a6d608f..fdcb917d39 100644
--- a/src/motif/cursor.cpp
+++ b/src/motif/cursor.cpp
@@ -20,9 +20,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/window.h"
 
 #if wxUSE_IMAGE
diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp
index bdecb6f26b..7b4f82f041 100644
--- a/src/motif/dataobj.cpp
+++ b/src/motif/dataobj.cpp
@@ -16,10 +16,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
-
 #ifdef __VMS__
 #pragma message disable nosimpint
 #endif
diff --git a/src/motif/dcmemory.cpp b/src/motif/dcmemory.cpp
index 2bf8dcbd71..41eeaccfff 100644
--- a/src/motif/dcmemory.cpp
+++ b/src/motif/dcmemory.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        dcmemory.cpp
+// Name:        src/motif/dcmemory.cpp
 // Purpose:     wxMemoryDC class
 // Author:      Julian Smart
 // Modified by:
@@ -13,8 +13,12 @@
 #include "wx/wxprec.h"
 
 #include "wx/dcmemory.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/settings.h"
-#include "wx/utils.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/dcscreen.cpp b/src/motif/dcscreen.cpp
index 762a740101..d385243254 100644
--- a/src/motif/dcscreen.cpp
+++ b/src/motif/dcscreen.cpp
@@ -1,21 +1,25 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        dcscreen.cpp
+// Name:        src/motif/dcscreen.cpp
 // Purpose:     wxScreenDC class
 // Author:      Julian Smart
 // Modified by:
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:   	wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#include "wx/dcscreen.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/window.h"
 #include "wx/frame.h"
-#include "wx/dcscreen.h"
-#include "wx/utils.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -38,7 +42,7 @@ wxScreenDC::wxScreenDC()
 {
     m_display = wxGetDisplay();
     Display* display = (Display*) m_display;
-    
+
     if (sm_overlayWindow)
     {
         m_pixmap = sm_overlayWindow;
@@ -47,7 +51,7 @@ wxScreenDC::wxScreenDC()
     }
     else
         m_pixmap = (WXPixmap) RootWindow(display, DefaultScreen(display));
-    
+
     XGCValues gcvalues;
     gcvalues.foreground = BlackPixel (display, DefaultScreen (display));
     gcvalues.background = WhitePixel (display, DefaultScreen (display));
@@ -57,7 +61,7 @@ wxScreenDC::wxScreenDC()
     m_gc = XCreateGC (display, RootWindow (display, DefaultScreen (display)),
         GCForeground | GCBackground | GCGraphicsExposures | GCLineWidth | GCSubwindowMode,
         &gcvalues);
-    
+
     m_backgroundPixel = (int) gcvalues.background;
     m_ok = true;
 }
@@ -77,7 +81,7 @@ bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
     window->GetSize(& width, & height);
     rect.x = x; rect.y = y;
     rect.width = width; rect.height = height;
-    
+
     return StartDrawingOnTop(& rect);
 }
 
@@ -85,15 +89,15 @@ bool wxScreenDC::StartDrawingOnTop(wxRect* rect)
 {
     if (sm_overlayWindow)
         return false;
-    
+
     Display *dpy = (Display*) wxGetDisplay();
     Pixmap screenPixmap = RootWindow(dpy, DefaultScreen(dpy));
-    
+
     int x = 0;
     int y = 0;
     int width, height;
     wxDisplaySize(&width, &height);
-    
+
     if (rect)
     {
         x = rect->x; y = rect->y;
@@ -101,16 +105,16 @@ bool wxScreenDC::StartDrawingOnTop(wxRect* rect)
     }
     sm_overlayWindowX = x;
     sm_overlayWindowY = y;
-    
+
     XSetWindowAttributes attributes;
     attributes.override_redirect = True;
     unsigned long valueMask = CWOverrideRedirect;
-    
+
     sm_overlayWindow = (WXWindow) XCreateWindow(dpy, screenPixmap, x, y, width, height, 0,
         wxDisplayDepth(), InputOutput,
         DefaultVisual(dpy, 0), valueMask,
         & attributes);
-    
+
     if (sm_overlayWindow)
     {
         XMapWindow(dpy, (Window) sm_overlayWindow);
diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp
index 11d7ac387c..22dc5a65f8 100644
--- a/src/motif/dialog.cpp
+++ b/src/motif/dialog.cpp
@@ -23,9 +23,9 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/settings.h"
 #include "wx/evtloop.h"
 
diff --git a/src/motif/dnd.cpp b/src/motif/dnd.cpp
index 3e7014c852..aac3b27102 100644
--- a/src/motif/dnd.cpp
+++ b/src/motif/dnd.cpp
@@ -18,11 +18,11 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include <X11/Xlib.h>
 
diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp
index 42bc27a41c..bc9f15ccfa 100644
--- a/src/motif/filedlg.cpp
+++ b/src/motif/filedlg.cpp
@@ -23,9 +23,9 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/settings.h"
 #include "wx/tokenzr.h"
 #include "wx/stockitem.h"
diff --git a/src/motif/font.cpp b/src/motif/font.cpp
index f4653d60ad..2d0c35bc64 100644
--- a/src/motif/font.cpp
+++ b/src/motif/font.cpp
@@ -33,10 +33,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/string.h"
+    #include "wx/utils.h"       // for wxGetDisplay()
 #endif
 
 #include "wx/gdicmn.h"
-#include "wx/utils.h"       // for wxGetDisplay()
 #include "wx/fontutil.h"    // for wxNativeFontInfo
 #include "wx/tokenzr.h"
 #include "wx/settings.h"
diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp
index 24b8baf9cc..24c4eb0f9d 100644
--- a/src/motif/frame.cpp
+++ b/src/motif/frame.cpp
@@ -31,13 +31,13 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/statusbr.h"
 #include "wx/toolbar.h"
 #include "wx/menu.h"
 #include "wx/settings.h"
-#include "wx/utils.h"
 #include "wx/icon.h"
 
 #ifdef __VMS__
diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp
index 1158c22fe0..8b956b96ef 100644
--- a/src/motif/listbox.cpp
+++ b/src/motif/listbox.cpp
@@ -19,6 +19,7 @@
 #ifndef WX_PRECOMP
     #include "wx/dynarray.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #ifdef __VMS
@@ -27,7 +28,6 @@
 #endif
 
 #include "wx/settings.h"
-#include "wx/utils.h"
 #include "wx/arrstr.h"
 
 #ifdef __VMS__
diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp
index b036cac890..7ea74148a6 100644
--- a/src/motif/menu.cpp
+++ b/src/motif/menu.cpp
@@ -25,10 +25,10 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/menuitem.h"
-#include "wx/utils.h"
 #include "wx/frame.h"
 #include "wx/settings.h"
 
diff --git a/src/motif/menuitem.cpp b/src/motif/menuitem.cpp
index cbed0910f4..a8a899d140 100644
--- a/src/motif/menuitem.cpp
+++ b/src/motif/menuitem.cpp
@@ -20,9 +20,13 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#include "wx/menu.h"
 #include "wx/menuitem.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
+#include "wx/menu.h"
 #include "wx/frame.h"
 
 #ifdef __VMS__
diff --git a/src/motif/palette.cpp b/src/motif/palette.cpp
index 672cb58071..12cf5a31dd 100644
--- a/src/motif/palette.cpp
+++ b/src/motif/palette.cpp
@@ -41,10 +41,10 @@ not the functionality that wxPalette::Create() aims to provide.
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
-#include "wx/utils.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/radiobox.cpp b/src/motif/radiobox.cpp
index 2761725f12..09b06715d1 100644
--- a/src/motif/radiobox.cpp
+++ b/src/motif/radiobox.cpp
@@ -19,7 +19,11 @@
 #endif
 
 #include "wx/radiobox.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/arrstr.h"
 
 #ifdef __VMS__
diff --git a/src/motif/radiobut.cpp b/src/motif/radiobut.cpp
index 956e8d65aa..c0886ce554 100644
--- a/src/motif/radiobut.cpp
+++ b/src/motif/radiobut.cpp
@@ -17,7 +17,10 @@
 #endif
 
 #include "wx/radiobut.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp
index 31ca0ae3e0..8e52931335 100644
--- a/src/motif/slider.cpp
+++ b/src/motif/slider.cpp
@@ -15,7 +15,10 @@
 #if wxUSE_SLIDER
 
 #include "wx/slider.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/statbox.cpp b/src/motif/statbox.cpp
index 744db44731..f6d4fa2b5e 100644
--- a/src/motif/statbox.cpp
+++ b/src/motif/statbox.cpp
@@ -17,7 +17,10 @@
 #endif
 
 #include "wx/statbox.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp
index 81ac9740ea..8ab3add39f 100644
--- a/src/motif/textctrl.cpp
+++ b/src/motif/textctrl.cpp
@@ -29,9 +29,13 @@
 #include <ctype.h>
 
 #include "wx/textctrl.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/settings.h"
 #include "wx/filefn.h"
-#include "wx/utils.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -163,8 +167,8 @@ bool wxTextCtrl::Create(wxWindow *parent,
 #if 0
         // TODO: Is this relevant? What does it do?
         int noCols = 2;
-        if (!value.IsNull() && (value.Length() > (unsigned int) noCols))
-            noCols = value.Length();
+        if (!value.IsNull() && (value.length() > (unsigned int) noCols))
+            noCols = value.length();
         XtVaSetValues((Widget) m_mainWidget,
                       XmNcolumns, noCols,
                       NULL);
diff --git a/src/motif/window.cpp b/src/motif/window.cpp
index 865e4272fb..e97cc2732b 100644
--- a/src/motif/window.cpp
+++ b/src/motif/window.cpp
@@ -30,12 +30,12 @@
     #include "wx/hash.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/menu.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
-#include "wx/utils.h"
 #include "wx/layout.h"
 #include "wx/button.h"
 #include "wx/settings.h"
diff --git a/src/msw/urlmsw.cpp b/src/msw/urlmsw.cpp
index d99a478404..951244b6e4 100644
--- a/src/msw/urlmsw.cpp
+++ b/src/msw/urlmsw.cpp
@@ -21,6 +21,7 @@
 #ifndef WX_PRECOMP
     #include "wx/list.h"
     #include "wx/string.h"
+    #include "wx/utils.h"
 #endif
 
 #if !wxUSE_PROTOCOL_HTTP
@@ -64,7 +65,6 @@ USE_PROTOCOL(wxHTTPDummyProto)
     #pragma comment(lib, "wininet.lib")
 #endif
 
-#include "wx/utils.h"
 #include "wx/module.h"
 #include "wx/url.h"
 
diff --git a/src/unix/baseunix.cpp b/src/unix/baseunix.cpp
index d7e34da3c5..de2ee2f156 100644
--- a/src/unix/baseunix.cpp
+++ b/src/unix/baseunix.cpp
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        unix/baseunix.cpp
+// Name:        src/unix/baseunix.cpp
 // Purpose:     misc stuff only used in console applications under Unix
 // Author:      Vadim Zeitlin
 // Modified by:
@@ -27,10 +27,10 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/intl.h"
+    #include "wx/utils.h"
 #endif //WX_PRECOMP
 
 #include "wx/apptrait.h"
-#include "wx/utils.h"
 #include "wx/unix/execute.h"
 
 // for waitpid()
@@ -123,4 +123,3 @@ wxToolkitInfo& wxConsoleAppTraits::GetToolkitInfo()
 }
 
 #endif // __WXMAC__
-
diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp
index e90fc222ec..b71a5cc8a4 100644
--- a/src/unix/dialup.cpp
+++ b/src/unix/dialup.cpp
@@ -22,11 +22,11 @@
     #include "wx/log.h"
     #include "wx/event.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif // !PCH
 
 #include "wx/timer.h"
 #include "wx/filefn.h"
-#include "wx/utils.h"
 #include "wx/ffile.h"
 #include "wx/process.h"
 #include "wx/wxchar.h"
diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp
index 71ba6d7849..3e0766599a 100644
--- a/src/unix/fontenum.cpp
+++ b/src/unix/fontenum.cpp
@@ -26,10 +26,10 @@
     #include "wx/dynarray.h"
     #include "wx/string.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/regex.h"
-#include "wx/utils.h"
 #include "wx/fontmap.h"
 #include "wx/fontutil.h"
 #include "wx/encinfo.h"
diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp
index 5230c5a09e..2d04279540 100644
--- a/src/unix/fontutil.cpp
+++ b/src/unix/fontutil.cpp
@@ -28,6 +28,7 @@
     #include "wx/font.h" // wxFont enums
     #include "wx/encinfo.h"
     #include "wx/hash.h"
+    #include "wx/utils.h"       // for wxGetDisplay()
 #endif // PCH
 
 #include "wx/fontutil.h"
@@ -343,7 +344,6 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding,
         #pragma message enable nosimpint
     #endif
 
-    #include "wx/utils.h"       // for wxGetDisplay()
 #elif defined(__WXGTK__)
     // we have to declare struct tm to avoid problems with first forward
     // declaring it in C code (glib.h included from gdk.h does it) and then
diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp
index 5b108a6733..af9e6ea701 100644
--- a/src/unix/mimetype.cpp
+++ b/src/unix/mimetype.cpp
@@ -45,6 +45,7 @@
     #include "wx/string.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/file.h"
@@ -53,7 +54,6 @@
 #include "wx/ffile.h"
 #include "wx/textfile.h"
 #include "wx/dir.h"
-#include "wx/utils.h"
 #include "wx/tokenzr.h"
 #include "wx/iconloc.h"
 #include "wx/filename.h"
diff --git a/src/unix/snglinst.cpp b/src/unix/snglinst.cpp
index bdd773a19e..26bab35d8b 100644
--- a/src/unix/snglinst.cpp
+++ b/src/unix/snglinst.cpp
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        unix/snglinst.cpp
+// Name:        src/unix/snglinst.cpp
 // Purpose:     implements wxSingleInstanceChecker class for Unix using
 //              lock files with fcntl(2) or flock(2)
 // Author:      Vadim Zeitlin
@@ -31,10 +31,10 @@
     #include "wx/string.h"
     #include "wx/log.h"
     #include "wx/intl.h"
+    #include "wx/utils.h"           // wxGetHomeDir()
 #endif //WX_PRECOMP
 
 #include "wx/file.h"
-#include "wx/utils.h"           // wxGetHomeDir()
 
 #include "wx/snglinst.h"
 
@@ -183,7 +183,7 @@ LockResult wxSingleInstanceCheckerImpl::CreateLockFile()
                               m_nameLock.c_str());
 
                 Unlock();
-                
+
                 return LOCK_ERROR;
             }
 
@@ -226,11 +226,11 @@ bool wxSingleInstanceCheckerImpl::Create(const wxString& name)
 
         case LOCK_CREATED:
             // nothing more to do
-            return TRUE;
+            return true;
 
         case LOCK_ERROR:
             // oops...
-            return FALSE;
+            return false;
     }
 
     // Check if the file is owned by current user and has 0600 permissions.
@@ -269,7 +269,7 @@ bool wxSingleInstanceCheckerImpl::Create(const wxString& name)
         // rarely in practice that we don't care
         wxLogError(_("Failed to access lock file."));
 
-        return FALSE;
+        return false;
     }
 
     char buf[256];
@@ -289,7 +289,7 @@ bool wxSingleInstanceCheckerImpl::Create(const wxString& name)
                     wxLogError(_("Failed to remove stale lock file '%s'."),
                                name.c_str());
 
-                    // return TRUE in this case for now...
+                    // return true in this case for now...
                 }
                 else
                 {
@@ -308,7 +308,7 @@ bool wxSingleInstanceCheckerImpl::Create(const wxString& name)
         }
     }
 
-    // return TRUE if we could get the PID of the process owning the lock file
+    // return true if we could get the PID of the process owning the lock file
     // (whether it is still running or not), FALSE otherwise as it is
     // unexpected
     return m_pidLocker != 0;
@@ -373,7 +373,7 @@ bool wxSingleInstanceChecker::Create(const wxString& name,
 
 bool wxSingleInstanceChecker::IsAnotherRunning() const
 {
-    wxCHECK_MSG( m_impl, FALSE, _T("must call Create() first") );
+    wxCHECK_MSG( m_impl, false, _T("must call Create() first") );
 
     // if another instance is running, it must own the lock file - otherwise
     // we have it and the locker PID is ours one
@@ -386,4 +386,3 @@ wxSingleInstanceChecker::~wxSingleInstanceChecker()
 }
 
 #endif // wxUSE_SNGLINST_CHECKER
-
diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp
index 6d2db0b956..f6f055e6d6 100644
--- a/src/unix/threadpsx.cpp
+++ b/src/unix/threadpsx.cpp
@@ -32,10 +32,10 @@
     #include "wx/dynarray.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/module.h"
-#include "wx/utils.h"
 #include "wx/timer.h"
 #include "wx/stopwatch.h"
 
diff --git a/src/x11/app.cpp b/src/x11/app.cpp
index 8215157322..e6ac52fd44 100644
--- a/src/x11/app.cpp
+++ b/src/x11/app.cpp
@@ -18,10 +18,10 @@
     #include "wx/hash.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/frame.h"
-#include "wx/utils.h"
 #include "wx/gdicmn.h"
 #include "wx/icon.h"
 #include "wx/dialog.h"
diff --git a/src/x11/brush.cpp b/src/x11/brush.cpp
index 736dcc6cfd..ce9e17d9dc 100644
--- a/src/x11/brush.cpp
+++ b/src/x11/brush.cpp
@@ -12,8 +12,12 @@
 // for compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#include "wx/utils.h"
 #include "wx/brush.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/bitmap.h"
 #include "wx/colour.h"
 
diff --git a/src/x11/clipbrd.cpp b/src/x11/clipbrd.cpp
index 479e96dff7..731d49e668 100644
--- a/src/x11/clipbrd.cpp
+++ b/src/x11/clipbrd.cpp
@@ -17,10 +17,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/dataobj.h"
-#include "wx/utils.h"
 
 #include "wx/x11/private.h"
 
@@ -88,7 +88,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
                 wxLogTrace( TRACE_CLIPBOARD,
                             _T("got unsupported clipboard target") );
 
-                clipboard->m_waiting = FALSE;
+                clipboard->m_waiting = false;
                 return;
             }
         }
@@ -113,14 +113,14 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
 
             if (format == clipboard->m_targetRequested)
             {
-                clipboard->m_waiting = FALSE;
+                clipboard->m_waiting = false;
                 clipboard->m_formatSupported = true;
                 return;
             }
         }
     }
 
-    clipboard->m_waiting = FALSE;
+    clipboard->m_waiting = false;
 }
 
 //-----------------------------------------------------------------------------
@@ -137,7 +137,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
 {
     if (!wxTheClipboard)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -145,13 +145,13 @@ selection_received( GtkWidget *WXUNUSED(widget),
 
     if (!data_object)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
     if (selection_data->length <= 0)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -160,7 +160,7 @@ selection_received( GtkWidget *WXUNUSED(widget),
     /* make sure we got the data in the correct format */
     if (!data_object->IsSupportedFormat( format ) )
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
@@ -168,14 +168,14 @@ selection_received( GtkWidget *WXUNUSED(widget),
        if so, copy data to target object */
     if (selection_data->type != GDK_SELECTION_TYPE_STRING)
     {
-        clipboard->m_waiting = FALSE;
+        clipboard->m_waiting = false;
         return;
     }
 
     data_object->SetData( format, (size_t) selection_data->length, (const char*) selection_data->data );
 
     wxTheClipboard->m_formatSupported = true;
-    clipboard->m_waiting = FALSE;
+    clipboard->m_waiting = false;
 }
 
 //-----------------------------------------------------------------------------
@@ -189,16 +189,16 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
 
     if (event->selection == GDK_SELECTION_PRIMARY)
     {
-        wxTheClipboard->m_ownsPrimarySelection = FALSE;
+        wxTheClipboard->m_ownsPrimarySelection = false;
     }
     else
     if (event->selection == g_clipboardAtom)
     {
-        wxTheClipboard->m_ownsClipboard = FALSE;
+        wxTheClipboard->m_ownsClipboard = false;
     }
     else
     {
-        wxTheClipboard->m_waiting = FALSE;
+        wxTheClipboard->m_waiting = false;
         return FALSE;
     }
 
@@ -215,7 +215,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
         }
     }
 
-    wxTheClipboard->m_waiting = FALSE;
+    wxTheClipboard->m_waiting = false;
     return TRUE;
 }
 
@@ -283,10 +283,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
 
 wxClipboard::wxClipboard()
 {
-    m_open = FALSE;
+    m_open = false;
 
-    m_ownsClipboard = FALSE;
-    m_ownsPrimarySelection = FALSE;
+    m_ownsClipboard = false;
+    m_ownsPrimarySelection = false;
 
     m_data = (wxDataObject*) NULL;
     m_receivedData = (wxDataObject*) NULL;
@@ -299,10 +299,10 @@ wxClipboard::wxClipboard()
     if (!g_targetsAtom) g_targetsAtom = XInternAtom( (Display*) wxGetDisplay(), "TARGETS", False );
 #endif
 
-    m_formatSupported = FALSE;
+    m_formatSupported = false;
     m_targetRequested = 0;
 
-    m_usePrimary = FALSE;
+    m_usePrimary = false;
 }
 
 wxClipboard::~wxClipboard()
@@ -371,9 +371,9 @@ bool wxClipboard::Open()
 
 bool wxClipboard::SetData( wxDataObject *data )
 {
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
-    wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
+    wxCHECK_MSG( data, false, wxT("data is invalid") );
 
     Clear();
 
@@ -383,11 +383,11 @@ bool wxClipboard::SetData( wxDataObject *data )
 bool wxClipboard::AddData( wxDataObject *data )
 {
 #if wxUSE_NANOX
-    return FALSE;
+    return false;
 #else
-    wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
+    wxCHECK_MSG( m_open, false, wxT("clipboard not open") );
 
-    wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
+    wxCHECK_MSG( data, false, wxT("data is invalid") );
 
     /* we can only store one wxDataObject */
     Clear();
@@ -432,7 +432,7 @@ bool wxClipboard::AddData( wxDataObject *data )
     /* disable GUI threads */
 #endif
 
-    bool res = FALSE;
+    bool res = false;
 #if 0
     /* Tell the world we offer clipboard data */
     res = (gtk_selection_owner_set( m_clipboardWidget,
@@ -457,7 +457,7 @@ void wxClipboard::Close()
 {
     wxCHECK_RET( m_open, wxT("clipboard not open") );
 
-    m_open = FALSE;
+    m_open = false;
 }
 
 bool wxClipboard::IsOpened() const
@@ -539,7 +539,7 @@ bool wxClipboard::GetData( wxDataObject& data )
           clipboard owner which is an asynchronous process.
           therefore we set m_waiting = true here and wait
           until the callback "targets_selection_received"
-          sets it to FALSE */
+          sets it to false */
 
         m_waiting = true;
 
@@ -591,7 +591,7 @@ bool wxClipboard::GetData( wxDataObject& data )
 #endif
 
         /* this is a true error as we checked for the presence of such data before */
-        wxCHECK_MSG( m_formatSupported, FALSE, wxT("error retrieving data from clipboard") );
+        wxCHECK_MSG( m_formatSupported, false, wxT("error retrieving data from clipboard") );
 
         /* return success */
         delete[] array;
diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp
index b94f974e5a..7fbd54c028 100644
--- a/src/x11/cursor.cpp
+++ b/src/x11/cursor.cpp
@@ -16,11 +16,11 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/gdicmn.h"
 #include "wx/icon.h"
-#include "wx/utils.h"
 
 #include "wx/x11/private.h"
 
diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp
index c32748372e..d1562f99bf 100644
--- a/src/x11/dataobj.cpp
+++ b/src/x11/dataobj.cpp
@@ -17,12 +17,12 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/mstream.h"
 #include "wx/image.h"
 
-#include "wx/utils.h"
 #include "wx/x11/private.h"
 
 //-------------------------------------------------------------------------
diff --git a/src/x11/dcmemory.cpp b/src/x11/dcmemory.cpp
index 157f62a48b..810e55f83e 100644
--- a/src/x11/dcmemory.cpp
+++ b/src/x11/dcmemory.cpp
@@ -1,17 +1,24 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        dcmemory.cpp
+// Name:        src/x11/dcmemory.cpp
 // Purpose:     wxMemoryDC class
 // Author:      Julian Smart
 // Modified by:
 // Created:     01/02/97
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:   	wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/dcmemory.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/settings.h"
-#include "wx/utils.h"
 
 #include "wx/x11/private.h"
 
@@ -19,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
 
 wxMemoryDC::wxMemoryDC() : wxWindowDC()
 {
-    m_ok = FALSE;
-    
+    m_ok = false;
+
     m_display = (WXDisplay *) wxGlobalDisplay();
 
     int screen = DefaultScreen( wxGlobalDisplay() );
@@ -30,10 +37,10 @@ wxMemoryDC::wxMemoryDC() : wxWindowDC()
 wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
   : wxWindowDC()
 {
-    m_ok = FALSE;
+    m_ok = false;
 
     m_display = (WXDisplay *) wxGlobalDisplay();
-    
+
     int screen = DefaultScreen( wxGlobalDisplay() );
     m_cmap = (WXColormap) DefaultColormap( wxGlobalDisplay(), screen );
 }
@@ -45,7 +52,7 @@ wxMemoryDC::~wxMemoryDC()
 void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
 {
     Destroy();
-    
+
     m_selected = bitmap;
     if (m_selected.Ok())
     {
@@ -58,13 +65,13 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
             m_window = m_selected.GetBitmap();
         }
 
-        m_isMemDC = TRUE;
+        m_isMemDC = true;
 
         SetUpDC();
     }
     else
     {
-        m_ok = FALSE;
+        m_ok = false;
         m_window = NULL;
     }
 }
diff --git a/src/x11/dcscreen.cpp b/src/x11/dcscreen.cpp
index 989ddd259f..8b922df00c 100644
--- a/src/x11/dcscreen.cpp
+++ b/src/x11/dcscreen.cpp
@@ -16,11 +16,11 @@
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
 #include "wx/frame.h"
-#include "wx/utils.h"
 #include "wx/fontutil.h"
 
 #include "wx/x11/private.h"
diff --git a/src/x11/dnd.cpp b/src/x11/dnd.cpp
index ea53b0384c..1697027afd 100644
--- a/src/x11/dnd.cpp
+++ b/src/x11/dnd.cpp
@@ -22,11 +22,11 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
 #include "wx/gdicmn.h"
-#include "wx/utils.h"
 
 #include <X11/Xlib.h>
 
diff --git a/src/x11/font.cpp b/src/x11/font.cpp
index c1e7646796..1dc91a3ba1 100644
--- a/src/x11/font.cpp
+++ b/src/x11/font.cpp
@@ -33,10 +33,10 @@
 
 #ifndef WX_PRECOMP
     #include "wx/string.h"
+    #include "wx/utils.h"       // for wxGetDisplay()
 #endif
 
 #include "wx/gdicmn.h"
-#include "wx/utils.h"       // for wxGetDisplay()
 #include "wx/fontutil.h"    // for wxNativeFontInfo
 #include "wx/tokenzr.h"
 #include "wx/settings.h"
diff --git a/src/x11/glcanvas.cpp b/src/x11/glcanvas.cpp
index a4e41c925d..c6aa213acc 100644
--- a/src/x11/glcanvas.cpp
+++ b/src/x11/glcanvas.cpp
@@ -24,10 +24,9 @@
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
-
 #ifdef __VMS
 # pragma message disable nosimpint
 #endif
diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp
index aa81fd4ae0..e2d9504f4b 100644
--- a/src/x11/palette.cpp
+++ b/src/x11/palette.cpp
@@ -41,10 +41,10 @@ not the functionality that wxPalette::Create() aims to provide.
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/window.h"
-#include "wx/utils.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/x11/pen.cpp b/src/x11/pen.cpp
index 5dd99899cb..c89e957e6b 100644
--- a/src/x11/pen.cpp
+++ b/src/x11/pen.cpp
@@ -12,8 +12,12 @@
 // for compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#include "wx/utils.h"
 #include "wx/pen.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/utils.h"
+#endif
+
 #include "wx/colour.h"
 #include "wx/bitmap.h"
 
diff --git a/src/x11/textctrl.cpp b/src/x11/textctrl.cpp
index 96d2ea1e5e..75a799c5b1 100644
--- a/src/x11/textctrl.cpp
+++ b/src/x11/textctrl.cpp
@@ -15,9 +15,9 @@
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/utils.h"
 #include "wx/settings.h"
 #include "wx/panel.h"
 #include "wx/clipbrd.h"
diff --git a/src/x11/window.cpp b/src/x11/window.cpp
index 41032fb7fc..e5080dae51 100644
--- a/src/x11/window.cpp
+++ b/src/x11/window.cpp
@@ -30,12 +30,12 @@
     #include "wx/hash.h"
     #include "wx/log.h"
     #include "wx/app.h"
+    #include "wx/utils.h"
 #endif
 
 #include "wx/menu.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
-#include "wx/utils.h"
 #include "wx/panel.h"
 #include "wx/layout.h"
 #include "wx/dialog.h"
-- 
2.47.2