From 6619edf0ea94b6623f1c7e7875d5ca8abac23382 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 19 Jul 2007 15:47:11 +0000 Subject: [PATCH] do platform-specific checks after ensuring that the symbols we use are defined; extract wxGTK-specific checks to wx/gtk/chkconf.h git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 1 + build/bakefiles/files.bkl | 1 + include/wx/chkconf.h | 118 ++++++++++++++------------------- include/wx/gtk/chkconf.h | 31 +++++++++ include/wx/msw/wince/chkconf.h | 4 +- 5 files changed, 87 insertions(+), 68 deletions(-) create mode 100644 include/wx/gtk/chkconf.h diff --git a/Makefile.in b/Makefile.in index 69c5596644..7ab15bc78d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2304,6 +2304,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_GUI_HDR = \ wx/gtk/button.h \ wx/gtk/checkbox.h \ wx/gtk/checklst.h \ + wx/gtk/chkconf.h \ wx/gtk/collpane.h \ wx/gtk/colordlg.h \ wx/gtk/choice.h \ diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 0e5ecaa0a8..c2d4f7884a 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -1084,6 +1084,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/gtk/button.h wx/gtk/checkbox.h wx/gtk/checklst.h + wx/gtk/chkconf.h wx/gtk/collpane.h wx/gtk/colordlg.h wx/gtk/choice.h diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index d03d33d53a..609d019950 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -14,37 +14,16 @@ #define _WX_CHKCONF_H_ /* - Platform-specific checking. + This file has the following sections: + 1. checks that all wxUSE_XXX symbols we use are defined + a) first the non-GUI ones + b) then the GUI-only ones + 2. platform-specific checks done in the platform headers + 3. generic consistency checks + a) first the non-GUI ones + b) then the GUI-only ones */ -#if defined(__WXPALMOS__) -# include "wx/palmos/chkconf.h" -#elif defined(__WXWINCE__) -# include "wx/msw/wince/chkconf.h" -#elif defined(__WXMSW__) -# include "wx/msw/chkconf.h" -#elif defined(__WXMAC__) -# include "wx/mac/chkconf.h" -#elif defined(__OS2__) -# include "wx/os2/chkconf.h" -#elif defined(__WXMGL__) -# include "wx/mgl/chkconf.h" -#elif defined(__WXDFB__) -# include "wx/dfb/chkconf.h" -#elif defined(__WXMOTIF__) -# include "wx/motif/chkconf.h" -#elif defined(__WXX11__) -# include "wx/x11/chkconf.h" -#endif - -#ifdef __UNIX__ -# include "wx/unix/chkconf.h" -#endif - -#ifdef __WXUNIVERSAL__ -# include "wx/univ/chkconf.h" -#endif - /* this global setting determines what should we do if the setting FOO requires BAR and BAR is not set: we can either silently unset FOO as well @@ -84,7 +63,7 @@ /* - tests for non GUI features + Section 1a: tests for non GUI features. please keep the options in alphabetical order! */ @@ -323,7 +302,7 @@ #endif /* wxUSE_VARIANT */ /* - all these tests are for GUI only + Section 1b: all these tests are for GUI only. please keep the options in alphabetical order! */ @@ -991,7 +970,44 @@ #endif /* wxUSE_GUI */ /* - check consistency of the settings + Section 2: platform-specific checks. + + This must be done after checking that everything is defined as the platform + checks use wxUSE_XXX symbols in #if tests. + */ + +#if defined(__WXPALMOS__) +# include "wx/palmos/chkconf.h" +#elif defined(__WXWINCE__) +# include "wx/msw/wince/chkconf.h" +#elif defined(__WXMSW__) +# include "wx/msw/chkconf.h" +#elif defined(__WXGTK__) +# include "wx/gtk/chkconf.h" +#elif defined(__WXMAC__) +# include "wx/mac/chkconf.h" +#elif defined(__OS2__) +# include "wx/os2/chkconf.h" +#elif defined(__WXMGL__) +# include "wx/mgl/chkconf.h" +#elif defined(__WXDFB__) +# include "wx/dfb/chkconf.h" +#elif defined(__WXMOTIF__) +# include "wx/motif/chkconf.h" +#elif defined(__WXX11__) +# include "wx/x11/chkconf.h" +#endif + +#ifdef __UNIX__ +# include "wx/unix/chkconf.h" +#endif + +#ifdef __WXUNIVERSAL__ +# include "wx/univ/chkconf.h" +#endif + +/* + Section 3a: check consistency of the non-GUI settings. */ #if WXWIN_COMPATIBILITY_2_6 @@ -1230,7 +1246,9 @@ # endif #endif /* wxUSE_TARSTREAM */ -/* the rest of the tests is for the GUI settings only */ +/* + Section 3b: the tests for the GUI settings only. + */ #if wxUSE_GUI #if wxUSE_BUTTON || \ @@ -1374,40 +1392,6 @@ #endif /* wxUSE_GRAPHICS_CONTEXT */ -/* wxGTK-specific dependencies */ -#ifdef __WXGTK__ -# ifndef __WXUNIVERSAL__ -# if wxUSE_MDI_ARCHITECTURE && !wxUSE_MENUS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "MDI requires wxUSE_MENUS in wxGTK" -# else -# undef wxUSE_MENUS -# define wxUSE_MENUS 1 -# endif -# endif -# endif /* !__WXUNIVERSAL__ */ - -# if wxUSE_JOYSTICK -# if !wxUSE_THREADS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxJoystick requires threads in wxGTK" -# else -# undef wxUSE_JOYSTICK -# define wxUSE_JOYSTICK 0 -# endif -# endif -# endif -#endif /* wxGTK && !wxUniv */ - -/* Hopefully we can emulate these dialogs in due course */ -#if defined(__SMARTPHONE__) && defined(__WXWINCE__) -# ifdef wxUSE_COLOURDLG -# undef wxUSE_COLOURDLG -# define wxUSE_COLOURDLG 0 -# endif -#endif /* __SMARTPHONE__ && __WXWINCE__ */ - - /* generic controls dependencies */ #if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) # if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG diff --git a/include/wx/gtk/chkconf.h b/include/wx/gtk/chkconf.h new file mode 100644 index 0000000000..1f83d484ed --- /dev/null +++ b/include/wx/gtk/chkconf.h @@ -0,0 +1,31 @@ +/* + * Name: wx/gtk/chkconf.h + * Purpose: wxGTK-specific settings consistency checks + * Author: Vadim Zeitlin + * Created: 2007-07-19 (extracted from wx/chkconf.h) + * RCS-ID: $Id$ + * Copyright: (c) 2000-2007 Vadim Zeitlin + * Licence: wxWindows licence + */ + +#ifndef __WXUNIVERSAL__ +# if wxUSE_MDI_ARCHITECTURE && !wxUSE_MENUS +# ifdef wxABORT_ON_CONFIG_ERROR +# error "MDI requires wxUSE_MENUS in wxGTK" +# else +# undef wxUSE_MENUS +# define wxUSE_MENUS 1 +# endif +# endif +#endif /* !__WXUNIVERSAL__ */ + +#if wxUSE_JOYSTICK +# if !wxUSE_THREADS +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxJoystick requires threads in wxGTK" +# else +# undef wxUSE_JOYSTICK +# define wxUSE_JOYSTICK 0 +# endif +# endif +#endif /* wxUSE_JOYSTICK */ diff --git a/include/wx/msw/wince/chkconf.h b/include/wx/msw/wince/chkconf.h index 2c2b658087..d2a0319566 100644 --- a/include/wx/msw/wince/chkconf.h +++ b/include/wx/msw/wince/chkconf.h @@ -69,7 +69,6 @@ #undef wxUSE_UNICODE_MSLU #define wxUSE_UNICODE_MSLU 0 - // Disable features which don't make sense for MS Smartphones // (due to pointer device usage, limited controls or dialogs, file system) #if defined(__SMARTPHONE__) @@ -84,6 +83,9 @@ #undef wxUSE_COLOURPICKERCTRL #define wxUSE_COLOURPICKERCTRL 0 + + #undef wxUSE_COLOURDLG + #define wxUSE_COLOURDLG 0 #endif // __SMARTPHONE__ #endif // _WX_MSW_WINCE_CHKCONF_H_ -- 2.45.2