From ed39ff57b30a70a2395e07887a70bc01e7a3b7ec Mon Sep 17 00:00:00 2001
From: Mattia Barbon <mbarbon@cpan.org>
Date: Mon, 10 Feb 2003 21:07:36 +0000
Subject: [PATCH]   Remove unnecessary header dependencies. Fix resulting
 compilation problems for wxMSW, wxGTK, wxMotif, wxX11 and wxMac in default
 configuration. Non-default configurations will probably need some more fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 include/wx/fontenum.h     | 2 --
 include/wx/gdicmn.h       | 7 ++-----
 include/wx/image.h        | 5 ++++-
 include/wx/mac/listbox.h  | 2 ++
 include/wx/motif/brush.h  | 1 +
 include/wx/msw/pen.h      | 1 +
 include/wx/msw/private.h  | 1 +
 include/wx/statusbr.h     | 1 +
 include/wx/treebase.h     | 1 +
 include/wx/univ/listbox.h | 1 +
 include/wx/window.h       | 1 -
 src/common/gifdecod.cpp   | 1 +
 src/common/iconbndl.cpp   | 1 +
 src/common/image.cpp      | 1 +
 src/common/imagpcx.cpp    | 1 +
 src/common/lboxcmn.cpp    | 1 +
 src/common/quantize.cpp   | 1 +
 src/common/wincmn.cpp     | 1 +
 src/generic/filedlgg.cpp  | 1 +
 src/generic/tabg.cpp      | 1 +
 src/gtk/brush.cpp         | 1 +
 src/gtk/colour.cpp        | 1 +
 src/gtk/pen.cpp           | 1 +
 src/gtk1/brush.cpp        | 1 +
 src/gtk1/colour.cpp       | 1 +
 src/gtk1/pen.cpp          | 1 +
 src/motif/app.cpp         | 1 +
 src/motif/frame.cpp       | 1 +
 src/motif/mdi.cpp         | 1 +
 src/motif/window.cpp      | 1 +
 src/msw/cursor.cpp        | 1 +
 src/x11/app.cpp           | 1 +
 src/x11/brush.cpp         | 1 +
 src/x11/textctrl.cpp      | 1 +
 src/x11/window.cpp        | 1 +
 35 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/include/wx/fontenum.h b/include/wx/fontenum.h
index 35bde85fc1..105693a202 100644
--- a/include/wx/fontenum.h
+++ b/include/wx/fontenum.h
@@ -17,8 +17,6 @@
     #pragma interface "fontenum.h"
 #endif
 
-#include "wx/font.h"
-
 // ----------------------------------------------------------------------------
 // wxFontEnumerator enumerates all available fonts on the system or only the
 // fonts with given attributes
diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h
index 3cd8a18402..7b6cd783cd 100644
--- a/include/wx/gdicmn.h
+++ b/include/wx/gdicmn.h
@@ -20,13 +20,10 @@
     #pragma interface "gdicmn.h"
 #endif
 
-#include "wx/object.h"
+#include "wx/setup.h"
 #include "wx/list.h"
-#include "wx/hash.h"
 #include "wx/string.h"
-#include "wx/setup.h"
-#include "wx/colour.h"
-#include "wx/font.h"
+#include "wx/fontenc.h"
 
 // ---------------------------------------------------------------------------
 // forward declarations
diff --git a/include/wx/image.h b/include/wx/image.h
index 257fd9773b..a165ad2794 100644
--- a/include/wx/image.h
+++ b/include/wx/image.h
@@ -18,7 +18,9 @@
 #include "wx/object.h"
 #include "wx/string.h"
 #include "wx/gdicmn.h"
-#include "wx/bitmap.h"
+#if WXWIN_COMPATIBILITY_2_2
+#  include "wx/bitmap.h"
+#endif
 #include "wx/hashmap.h"
 
 #if wxUSE_STREAMS
@@ -35,6 +37,7 @@
 
 class WXDLLEXPORT wxImageHandler;
 class WXDLLEXPORT wxImage;
+class WXDLLEXPORT wxPalette;
 
 //-----------------------------------------------------------------------------
 // wxImageHandler
diff --git a/include/wx/mac/listbox.h b/include/wx/mac/listbox.h
index 8158bf6731..fc9809c153 100644
--- a/include/wx/mac/listbox.h
+++ b/include/wx/mac/listbox.h
@@ -20,6 +20,8 @@
 // ----------------------------------------------------------------------------
 // simple types
 // ----------------------------------------------------------------------------
+#include  "wx/dynarray.h"
+
 
 #if wxUSE_OWNER_DRAWN
   class WXDLLEXPORT wxOwnerDrawn;
diff --git a/include/wx/motif/brush.h b/include/wx/motif/brush.h
index 513d7fc9c3..a0a5e51b7c 100644
--- a/include/wx/motif/brush.h
+++ b/include/wx/motif/brush.h
@@ -19,6 +19,7 @@
 #include "wx/gdicmn.h"
 #include "wx/gdiobj.h"
 #include "wx/bitmap.h"
+#include "wx/colour.h"
 
 class WXDLLEXPORT wxBrush;
 
diff --git a/include/wx/msw/pen.h b/include/wx/msw/pen.h
index 61ce98dfe9..2a96b98338 100644
--- a/include/wx/msw/pen.h
+++ b/include/wx/msw/pen.h
@@ -18,6 +18,7 @@
 
 #include "wx/gdiobj.h"
 #include "wx/bitmap.h"
+#include "wx/colour.h"
 
 typedef WXDWORD wxMSWDash;
 
diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h
index 390a7007b9..a1308f5b47 100644
--- a/include/wx/msw/private.h
+++ b/include/wx/msw/private.h
@@ -213,6 +213,7 @@ extern LONG APIENTRY _EXPORT
 #if wxUSE_GUI
 
 #include <wx/gdicmn.h>
+#include <wx/colour.h>
 
 // make conversion from wxColour and COLORREF a bit less painful
 inline COLORREF wxColourToRGB(const wxColour& c)
diff --git a/include/wx/statusbr.h b/include/wx/statusbr.h
index 0ae464c94e..4e53a2509a 100644
--- a/include/wx/statusbr.h
+++ b/include/wx/statusbr.h
@@ -21,6 +21,7 @@
 #if wxUSE_STATUSBAR
 
 #include "wx/list.h"
+#include "wx/dynarray.h"
 
 WX_DECLARE_LIST(wxString, wxListString);
 
diff --git a/include/wx/treebase.h b/include/wx/treebase.h
index 4f1af7fb65..9f46b920cb 100644
--- a/include/wx/treebase.h
+++ b/include/wx/treebase.h
@@ -24,6 +24,7 @@
 
 #include "wx/window.h"  // for wxClientData
 #include "wx/event.h"
+#include "wx/dynarray.h"
 
 // ----------------------------------------------------------------------------
 // wxTreeItemId identifies an element of the tree. In this implementation, it's
diff --git a/include/wx/univ/listbox.h b/include/wx/univ/listbox.h
index 363f523ac8..01ad0a276c 100644
--- a/include/wx/univ/listbox.h
+++ b/include/wx/univ/listbox.h
@@ -17,6 +17,7 @@
 #endif
 
 #include "wx/scrolwin.h"    // for wxScrollHelper
+#include "wx/dynarray.h"
 
 // ----------------------------------------------------------------------------
 // the actions supported by this control
diff --git a/include/wx/window.h b/include/wx/window.h
index 1b12bc2884..590aaec381 100644
--- a/include/wx/window.h
+++ b/include/wx/window.h
@@ -33,7 +33,6 @@
 #include "wx/validate.h"        // for wxDefaultValidator (always include it)
 
 #if wxUSE_PALETTE
-    #include "wx/dcclient.h"
     #include "wx/palette.h"
 #endif // wxUSE_PALETTE
 
diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp
index 784d7bdfab..229050812f 100644
--- a/src/common/gifdecod.cpp
+++ b/src/common/gifdecod.cpp
@@ -21,6 +21,7 @@
 
 #ifndef WX_PRECOMP
 #  include "wx/defs.h"
+#  include "wx/palette.h"
 #endif
 
 #if wxUSE_STREAMS && wxUSE_GIF
diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp
index 54a0b03dc7..cd9bf9886a 100644
--- a/src/common/iconbndl.cpp
+++ b/src/common/iconbndl.cpp
@@ -24,6 +24,7 @@
     #include "wx/icon.h"
     #include "wx/log.h"
     #include "wx/intl.h"
+    #include "wx/bitmap.h"
 #endif
 
 #ifndef _WX_IMAGE_H_
diff --git a/src/common/image.cpp b/src/common/image.cpp
index e43c7da643..9d3502abf2 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -31,6 +31,7 @@
 #include "wx/wfstream.h"
 #include "wx/intl.h"
 #include "wx/module.h"
+#include "wx/hash.h"
 
 // For memcpy
 #include <string.h>
diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp
index 975252e0e1..f4d6852e66 100644
--- a/src/common/imagpcx.cpp
+++ b/src/common/imagpcx.cpp
@@ -21,6 +21,7 @@
 
 #ifndef WX_PRECOMP
 #  include "wx/defs.h"
+#  include "wx/palette.h"
 #endif
 
 #if wxUSE_IMAGE && wxUSE_PCX
diff --git a/src/common/lboxcmn.cpp b/src/common/lboxcmn.cpp
index 55ab6ade5e..429aa9e5ff 100644
--- a/src/common/lboxcmn.cpp
+++ b/src/common/lboxcmn.cpp
@@ -32,6 +32,7 @@
 
 #ifndef WX_PRECOMP
     #include "wx/listbox.h"
+    #include "wx/dynarray.h"
 #endif
 
 // ============================================================================
diff --git a/src/common/quantize.cpp b/src/common/quantize.cpp
index 1d1e1500fb..d3d894f41a 100644
--- a/src/common/quantize.cpp
+++ b/src/common/quantize.cpp
@@ -42,6 +42,7 @@
 #endif
 
 #ifndef WX_PRECOMP
+    #include "wx/palette.h"
 #endif
 
 #include "wx/image.h"
diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp
index 2962b83ab4..d54ce77bdf 100644
--- a/src/common/wincmn.cpp
+++ b/src/common/wincmn.cpp
@@ -44,6 +44,7 @@
     #include "wx/dialog.h"
     #include "wx/msgdlg.h"
     #include "wx/statusbr.h"
+    #include "wx/dcclient.h"
 #endif //WX_PRECOMP
 
 #if wxUSE_CONSTRAINTS
diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp
index 10a1c4f423..a1b704fcd5 100644
--- a/src/generic/filedlgg.cpp
+++ b/src/generic/filedlgg.cpp
@@ -55,6 +55,7 @@
 #include "wx/imaglist.h"
 #include "wx/dir.h"
 #include "wx/artprov.h"
+#include "wx/hash.h"
 
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
diff --git a/src/generic/tabg.cpp b/src/generic/tabg.cpp
index bb3fc77c3d..d1b044d937 100644
--- a/src/generic/tabg.cpp
+++ b/src/generic/tabg.cpp
@@ -25,6 +25,7 @@
 #ifndef WX_PRECOMP
     #include "wx/settings.h"
     #include "wx/intl.h"
+    #include "wx/dcclient.h"
 #endif
 
 #include <stdio.h>
diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp
index f20993f3cb..dd6720c868 100644
--- a/src/gtk/brush.cpp
+++ b/src/gtk/brush.cpp
@@ -12,6 +12,7 @@
 #endif
 
 #include "wx/brush.h"
+#include "wx/colour.h"
 
 #include <gdk/gdk.h>
 
diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp
index 4d3b511afa..c57698a100 100644
--- a/src/gtk/colour.cpp
+++ b/src/gtk/colour.cpp
@@ -13,6 +13,7 @@
 #endif
 
 #include "wx/gdicmn.h"
+#include "wx/colour.h"
 #include "wx/gtk/private.h"
 
 #include <gdk/gdk.h>
diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp
index 11f787bd32..66470bcc89 100644
--- a/src/gtk/pen.cpp
+++ b/src/gtk/pen.cpp
@@ -13,6 +13,7 @@
 #endif
 
 #include "wx/pen.h"
+#include "wx/colour.h"
 
 #include <gdk/gdk.h>
 
diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp
index f20993f3cb..dd6720c868 100644
--- a/src/gtk1/brush.cpp
+++ b/src/gtk1/brush.cpp
@@ -12,6 +12,7 @@
 #endif
 
 #include "wx/brush.h"
+#include "wx/colour.h"
 
 #include <gdk/gdk.h>
 
diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp
index 4d3b511afa..c57698a100 100644
--- a/src/gtk1/colour.cpp
+++ b/src/gtk1/colour.cpp
@@ -13,6 +13,7 @@
 #endif
 
 #include "wx/gdicmn.h"
+#include "wx/colour.h"
 #include "wx/gtk/private.h"
 
 #include <gdk/gdk.h>
diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp
index 11f787bd32..66470bcc89 100644
--- a/src/gtk1/pen.cpp
+++ b/src/gtk1/pen.cpp
@@ -13,6 +13,7 @@
 #endif
 
 #include "wx/pen.h"
+#include "wx/colour.h"
 
 #include <gdk/gdk.h>
 
diff --git a/src/motif/app.cpp b/src/motif/app.cpp
index 330ba91007..b40531cea5 100644
--- a/src/motif/app.cpp
+++ b/src/motif/app.cpp
@@ -36,6 +36,7 @@
 #include "wx/log.h"
 #include "wx/intl.h"
 #include "wx/evtloop.h"
+#include "wx/hash.h"
 
 #if wxUSE_THREADS
     #include "wx/thread.h"
diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp
index 2b8dc03fff..18dc34e554 100644
--- a/src/motif/frame.cpp
+++ b/src/motif/frame.cpp
@@ -36,6 +36,7 @@
 #include "wx/utils.h"
 #include "wx/log.h"
 #include "wx/app.h"
+#include "wx/icon.h"
 
 #ifdef __VMS__
     #pragma message disable nosimpint
diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp
index ef6cb3a192..95be276fbc 100644
--- a/src/motif/mdi.cpp
+++ b/src/motif/mdi.cpp
@@ -22,6 +22,7 @@
 #include "wx/mdi.h"
 #include "wx/menu.h"
 #include "wx/settings.h"
+#include "wx/icon.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
diff --git a/src/motif/window.cpp b/src/motif/window.cpp
index 4ee8f71d5b..88dff30462 100644
--- a/src/motif/window.cpp
+++ b/src/motif/window.cpp
@@ -46,6 +46,7 @@
 #include "wx/menuitem.h"
 #include "wx/log.h"
 #include "wx/evtloop.h"
+#include "wx/hash.h"
 
 #if  wxUSE_DRAG_AND_DROP
     #include "wx/dnd.h"
diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp
index 4ccdedbe1e..268a0931cb 100644
--- a/src/msw/cursor.cpp
+++ b/src/msw/cursor.cpp
@@ -35,6 +35,7 @@
     #include "wx/bitmap.h"
     #include "wx/icon.h"
     #include "wx/cursor.h"
+    #include "wx/settings.h"
 #endif
 
 #include "wx/ptr_scpd.h"
diff --git a/src/x11/app.cpp b/src/x11/app.cpp
index fbbbdd1d50..5c2371a2bb 100644
--- a/src/x11/app.cpp
+++ b/src/x11/app.cpp
@@ -27,6 +27,7 @@
 #include "wx/evtloop.h"
 #include "wx/timer.h"
 #include "wx/filename.h"
+#include "wx/hash.h"
 
 #include "wx/univ/theme.h"
 #include "wx/univ/renderer.h"
diff --git a/src/x11/brush.cpp b/src/x11/brush.cpp
index 7f524c4155..85614366cb 100644
--- a/src/x11/brush.cpp
+++ b/src/x11/brush.cpp
@@ -16,6 +16,7 @@
 #include "wx/setup.h"
 #include "wx/utils.h"
 #include "wx/brush.h"
+#include "wx/colour.h"
 
 //-----------------------------------------------------------------------------
 // wxBrush
diff --git a/src/x11/textctrl.cpp b/src/x11/textctrl.cpp
index c3b1b6411f..29847609ae 100644
--- a/src/x11/textctrl.cpp
+++ b/src/x11/textctrl.cpp
@@ -19,6 +19,7 @@
 #include "wx/panel.h"
 #include "wx/clipbrd.h"
 #include "wx/tokenzr.h"
+#include "wx/dcclient.h"
 
 #include "wx/univ/inphand.h"
 #include "wx/univ/renderer.h"
diff --git a/src/x11/window.cpp b/src/x11/window.cpp
index 8ee15a5f5d..cf10d5730f 100644
--- a/src/x11/window.cpp
+++ b/src/x11/window.cpp
@@ -42,6 +42,7 @@
 #include "wx/log.h"
 #include "wx/fontutil.h"
 #include "wx/univ/renderer.h"
+#include "wx/hash.h"
 
 #if  wxUSE_DRAG_AND_DROP
     #include "wx/dnd.h"
-- 
2.47.2