From 61873536a0cdc8011fb43142e6656647c8c99c71 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 27 Jul 2007 14:57:31 +0000 Subject: [PATCH] added wxUSE_INICONF (disabled by default) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 64 +++++++++++++++++++++++++++++++++++++- configure.in | 5 +++ include/wx/msw/chkconf.h | 8 +++++ include/wx/msw/iniconf.h | 10 ++++-- include/wx/msw/setup0.h | 7 +++++ include/wx/msw/setup_inc.h | 7 +++++ setup.h.in | 2 ++ src/msw/iniconf.cpp | 4 +-- 8 files changed, 101 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 9403903cb3..150196ad35 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 47734 2007-07-26 16:27:29Z VZ . +# From configure.in Id: configure.in 47742 2007-07-27 03:38:33Z DE . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0. # @@ -1847,6 +1847,7 @@ Optional Features: --enable-xpm use xpm images (XPM file format) --enable-icocur use Windows ICO and CUR formats --enable-dccache cache temporary wxDC objects (Win32 only) + --enable-ps-in-msw use PS printing in wxMSW (Win32 only) --enable-ownerdrawn use owner drawn controls (Win32 only) --enable-regkey use wxRegKey class (Win32 only) @@ -15581,6 +15582,60 @@ fi echo "${ECHO_T}$result" >&6; } + enablestring= + defaultval= + if test -z "$defaultval"; then + if test x"$enablestring" = xdisable; then + defaultval=yes + else + defaultval=no + fi + fi + + { echo "$as_me:$LINENO: checking for --${enablestring:-enable}-" >&5 +echo $ECHO_N "checking for --${enablestring:-enable}-... $ECHO_C" >&6; } + # Check whether --enable- was given. +if test "${enable_+set}" = set; then + enableval=$enable_; + if test "$enableval" = yes; then + wx_cv_use_='=yes' + else + wx_cv_use_='=no' + fi + cache=yes + +else + + cache=no + LINE=`grep "^=" ${wx_arg_cache_file}` + if test "x$LINE" != x ; then + eval "DEFAULT_$LINE" + fi + + wx_cv_use_='=${'DEFAULT_":-$defaultval}" + +fi + + + eval "$wx_cv_use_" + if test "x$cache" = xyes; then + echo "=$" >> ${wx_arg_cache_file}.tmp + fi + + if test x"$enablestring" = xdisable; then + if test $ = yes; then + result=no + else + result=yes + fi + else + result=$ + fi + + { echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6; } + (iniconf, --enable-iniconf use wxIniConfig (Win32 only), wxUSE_INICONF) + enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -49342,6 +49397,13 @@ _ACEOF fi +if test "$wxUSE_INICONF" = "yes"; then + cat >>confdefs.h <<\_ACEOF +#define wxUSE_INICONF 1 +_ACEOF + +fi + if test "$wxUSE_DIB" = "yes"; then cat >>confdefs.h <<\_ACEOF #define wxUSE_WXDIB 1 diff --git a/configure.in b/configure.in index cb74a99908..36a6f3da8a 100644 --- a/configure.in +++ b/configure.in @@ -934,6 +934,7 @@ dnl wxMSW-only options dnl --------------------------------------------------------------------------- WX_ARG_FEATURE(dccache, [ --enable-dccache cache temporary wxDC objects (Win32 only)], wxUSE_DC_CACHEING) +WX_ARG_ENABLE (iniconf, [ --enable-iniconf use wxIniConfig (Win32 only)], wxUSE_INICONF) WX_ARG_FEATURE(ps-in-msw, [ --enable-ps-in-msw use PS printing in wxMSW (Win32 only)], wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) WX_ARG_FEATURE(ownerdrawn, [ --enable-ownerdrawn use owner drawn controls (Win32 only)], wxUSE_OWNER_DRAWN) WX_ARG_FEATURE(regkey, [ --enable-regkey use wxRegKey class (Win32 only)], wxUSE_REGKEY) @@ -7224,6 +7225,10 @@ if test "$wxUSE_DC_CACHEING" = "yes"; then AC_DEFINE(wxUSE_DC_CACHEING) fi +if test "$wxUSE_INICONF" = "yes"; then + AC_DEFINE(wxUSE_INICONF) +fi + if test "$wxUSE_DIB" = "yes"; then AC_DEFINE(wxUSE_WXDIB) fi diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index 2c088a7bf4..59d5dbc433 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -55,6 +55,14 @@ # endif #endif /* !defined(wxUSE_MS_HTML_HELP) */ +#ifndef wxUSE_INICONF +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_INICONF must be defined." +# else +# define wxUSE_INICONF 0 +# endif +#endif /* !defined(wxUSE_INICONF) */ + #ifndef wxUSE_OLE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_OLE must be defined." diff --git a/include/wx/msw/iniconf.h b/include/wx/msw/iniconf.h index e0ee004ca9..5eca7ba7af 100644 --- a/include/wx/msw/iniconf.h +++ b/include/wx/msw/iniconf.h @@ -9,8 +9,10 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifndef _INICONF_H -#define _INICONF_H +#ifndef _WX_MSW_INICONF_H_ +#define _WX_MSW_INICONF_H_ + +#if wxUSE_INICONF // ---------------------------------------------------------------------------- // wxIniConfig is a wxConfig implementation which uses MS Windows INI files to @@ -97,4 +99,6 @@ private: DECLARE_ABSTRACT_CLASS(wxIniConfig) }; -#endif //_INICONF_H +#endif // wxUSE_INICONF + +#endif //_WX_MSW_INICONF_H_ diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 5636e5f35c..6e2a8de398 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -1352,6 +1352,13 @@ // Set to 1 to use InkEdit control (Tablet PC), if available #define wxUSE_INKEDIT 0 +// Set to 1 to enable .INI files based wxConfig implementation (wxIniConfig) +// +// Default is 0. +// +// Recommended setting: 0, nobody uses .INI files any more +#define wxUSE_INICONF 0 + // ---------------------------------------------------------------------------- // Generic versions of native controls // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/setup_inc.h b/include/wx/msw/setup_inc.h index 322a9da473..c4bc19fe15 100644 --- a/include/wx/msw/setup_inc.h +++ b/include/wx/msw/setup_inc.h @@ -116,6 +116,13 @@ // Set to 1 to use InkEdit control (Tablet PC), if available #define wxUSE_INKEDIT 0 +// Set to 1 to enable .INI files based wxConfig implementation (wxIniConfig) +// +// Default is 0. +// +// Recommended setting: 0, nobody uses .INI files any more +#define wxUSE_INICONF 0 + // ---------------------------------------------------------------------------- // Generic versions of native controls // ---------------------------------------------------------------------------- diff --git a/setup.h.in b/setup.h.in index 264fc58d6f..c074f66f5b 100644 --- a/setup.h.in +++ b/setup.h.in @@ -591,6 +591,8 @@ #define wxUSE_INKEDIT 0 +#define wxUSE_INICONF 0 + #define wxUSE_DATEPICKCTRL_GENERIC 0 diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index 8a97072e4b..b56e88db4a 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -16,7 +16,7 @@ #pragma hdrstop #endif -#if wxUSE_CONFIG +#if wxUSE_INICONF #ifndef WX_PRECOMP #include "wx/msw/wrapwin.h" @@ -471,4 +471,4 @@ bool wxIniConfig::RenameGroup(const wxString& WXUNUSED(oldName), return false; } -#endif // wxUSE_CONFIG +#endif // wxUSE_INICONF -- 2.47.2