From cf63f3d3ae66075641094ab03328403c7d6e74df Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 6 Apr 2007 21:08:30 +0000 Subject: [PATCH] More patches from FM to clean up after moving contribs. Also removes use of wxUSE_RESOURCES git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- .../bakefiles/wxpresets/presets/wx_win32.bkl | 8 +- configure | 342 +---------------- configure.in | 59 +-- demos/poem/wxpoem.cpp | 4 + docs/latex/wx/function.tex | 67 ---- docs/latex/wx/wizpage.tex | 3 +- include/wx/chkconf.h | 9 - include/wx/setup_inc.h | 2 - include/wx/utils.h | 17 - include/wx/wizard.h | 16 +- setup.h.in | 11 - src/cocoa/utils.cpp | 74 ---- src/generic/wizard.cpp | 20 +- src/mac/carbon/utils.cpp | 78 ---- src/motif/utils.cpp | 363 ------------------ src/msw/utilsgui.cpp | 107 ------ src/os2/utilsgui.cpp | 184 --------- src/palmos/utilsgui.cpp | 47 --- wx-config.in | 3 +- 19 files changed, 35 insertions(+), 1379 deletions(-) diff --git a/build/bakefiles/wxpresets/presets/wx_win32.bkl b/build/bakefiles/wxpresets/presets/wx_win32.bkl index d050a6bb08..624046d8bf 100644 --- a/build/bakefiles/wxpresets/presets/wx_win32.bkl +++ b/build/bakefiles/wxpresets/presets/wx_win32.bkl @@ -192,9 +192,15 @@ $(WXLIB_DBGRID_NAME) $(WXLIB_QA_NAME) $(WXLIB_AUI_NAME) - $(WXLIB_STC_NAME) $(WXLIB_RICHTEXT_NAME) + + + $(WXLIB_STC_NAME) + wxscintilla$(WX3RDPARTYLIBPOSTFIX) + + Unknown wxWidgets library given in the wx-lib tag diff --git a/configure b/configure index 6b00dd7388..a3cfa88688 100755 --- a/configure +++ b/configure @@ -696,7 +696,6 @@ REZ DEREZ SETFILE LIBICONV -EXTRALIBS_ESD SDL_CONFIG SDL_CFLAGS SDL_LIBS @@ -1713,8 +1712,6 @@ Optional Features: --enable-richtext use wxRichTextCtrl --enable-graphics_ctx use graphics context 2D drawing API --enable-postscript use wxPostscriptDC device context (default for gtk+) - --enable-prologio not available; see contrib - --enable-resources not available; see contrib --enable-clipboard use wxClipboard class --enable-dnd use Drag'n'Drop classes --enable-metafile use win32 metafiles @@ -2980,7 +2977,6 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no - DEFAULT_wxUSE_RESOURCES=no DEFAULT_wxUSE_CONSTRAINTS=no DEFAULT_wxUSE_IPC=no DEFAULT_wxUSE_HELP=no @@ -3205,7 +3201,6 @@ else DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes - DEFAULT_wxUSE_RESOURCES=no DEFAULT_wxUSE_CONSTRAINTS=yes DEFAULT_wxUSE_IPC=yes DEFAULT_wxUSE_HELP=yes @@ -8458,90 +8453,6 @@ echo "${ECHO_T}no" >&6; } - enablestring= - { echo "$as_me:$LINENO: checking for --${enablestring:-enable}-prologio" >&5 -echo $ECHO_N "checking for --${enablestring:-enable}-prologio... $ECHO_C" >&6; } - no_cache=0 - # Check whether --enable-prologio was given. -if test "${enable_prologio+set}" = set; then - enableval=$enable_prologio; - if test "$enableval" = yes; then - ac_cv_use_prologio='wxUSE_PROLOGIO=yes' - else - ac_cv_use_prologio='wxUSE_PROLOGIO=no' - fi - -else - - LINE=`grep "wxUSE_PROLOGIO" ${wx_arg_cache_file}` - if test "x$LINE" != x ; then - eval "DEFAULT_$LINE" - else - no_cache=1 - fi - - ac_cv_use_prologio='wxUSE_PROLOGIO='$DEFAULT_wxUSE_PROLOGIO - -fi - - - eval "$ac_cv_use_prologio" - if test "$no_cache" != 1; then - echo $ac_cv_use_prologio >> ${wx_arg_cache_file}.tmp - fi - - if test "$wxUSE_PROLOGIO" = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - fi - - - enablestring= - { echo "$as_me:$LINENO: checking for --${enablestring:-enable}-resources" >&5 -echo $ECHO_N "checking for --${enablestring:-enable}-resources... $ECHO_C" >&6; } - no_cache=0 - # Check whether --enable-resources was given. -if test "${enable_resources+set}" = set; then - enableval=$enable_resources; - if test "$enableval" = yes; then - ac_cv_use_resources='wxUSE_RESOURCES=yes' - else - ac_cv_use_resources='wxUSE_RESOURCES=no' - fi - -else - - LINE=`grep "wxUSE_RESOURCES" ${wx_arg_cache_file}` - if test "x$LINE" != x ; then - eval "DEFAULT_$LINE" - else - no_cache=1 - fi - - ac_cv_use_resources='wxUSE_RESOURCES='$DEFAULT_wxUSE_RESOURCES - -fi - - - eval "$ac_cv_use_resources" - if test "$no_cache" != 1; then - echo $ac_cv_use_resources >> ${wx_arg_cache_file}.tmp - fi - - if test "$wxUSE_RESOURCES" = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - fi - - - - enablestring= { echo "$as_me:$LINENO: checking for --${enablestring:-enable}-clipboard" >&5 echo $ECHO_N "checking for --${enablestring:-enable}-clipboard... $ECHO_C" >&6; } @@ -41970,234 +41881,6 @@ fi - -EXTRALIBS_ESD= -{ echo "$as_me:$LINENO: checking for esd_close in -lesd" >&5 -echo $ECHO_N "checking for esd_close in -lesd... $ECHO_C" >&6; } -if test "${ac_cv_lib_esd_esd_close+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lesd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char esd_close (); -int -main () -{ -return esd_close (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_esd_esd_close=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_esd_esd_close=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_esd_esd_close" >&5 -echo "${ECHO_T}$ac_cv_lib_esd_esd_close" >&6; } -if test $ac_cv_lib_esd_esd_close = yes; then - - { echo "$as_me:$LINENO: checking for esd.h" >&5 -echo $ECHO_N "checking for esd.h... $ECHO_C" >&6; } -if test "${ac_cv_header_esd_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_esd_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_esd_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_esd_h" >&5 -echo "${ECHO_T}$ac_cv_header_esd_h" >&6; } -if test $ac_cv_header_esd_h = yes; then - - EXTRALIBS_ESD="-lesd" - -fi - - - -fi - - - -{ echo "$as_me:$LINENO: checking for known CD-ROM interface" >&5 -echo $ECHO_N "checking for known CD-ROM interface... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __linux__ - #include - #else - /* For Solaris */ - #include - #endif - -int -main () -{ -struct cdrom_tocentry entry, old_entry; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - cat >>confdefs.h <<\_ACEOF -#define HAVE_KNOWN_CDROM_INTERFACE 1 -_ACEOF - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -46182,8 +45865,6 @@ echo "${ECHO_T}$ac_cv_header_sys_soundcard" >&6; } #define HAVE_SYS_SOUNDCARD_H 1 _ACEOF - else - DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia" fi fi @@ -49278,11 +48959,6 @@ _ACEOF SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing" fi -if test "$wxUSE_PROLOGIO" = "yes" -o "$wxUSE_RESOURCES" = "yes"; then - { { echo "$as_me:$LINENO: error: wxExpr and old-style resources are now available in contrib only" >&5 -echo "$as_me: error: wxExpr and old-style resources are now available in contrib only" >&2;} - { (exit 1); exit 1; }; } -fi if test "$wxUSE_METAFILE" = "yes"; then @@ -50999,6 +50675,7 @@ EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS" EXTRALIBS_XML="$EXPAT_LINK" EXTRALIBS_HTML="$MSPACK_LINK" EXTRALIBS_ODBC="$ODBC_LINK" +EXTRALIBS_STC="-lwxscintilla${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}" if test "$wxUSE_GUI" = "yes"; then EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $WEBKIT_LINK $EXTRALIBS_HILDON $EXTRALIBS_GNOMEVFS $EXTRALIBS_GNOMEPRINT` fi @@ -54565,7 +54242,7 @@ ac_config_commands="$ac_config_commands wx-config" if test "$wxWITH_SUBDIRS" != "no"; then if test "$wxUSE_GUI" = "yes"; then - SUBDIRS="samples demos utils contrib" + SUBDIRS="samples demos utils" else SUBDIRS="samples utils" fi @@ -54699,10 +54376,6 @@ echo "${ECHO_T}no" >&6; } -if test "$USE_UNIX" != "1" -a "$USE_WIN32" != "1"; then - DISABLED_CONTRIB="$DISABLED_CONTRIB net" -fi - for subdir in `echo $SUBDIRS`; do if test -d ${srcdir}/${subdir} ; then if test "$wxUSE_GUI" = "yes"; then @@ -55466,8 +55139,8 @@ REZ!$REZ$ac_delim DEREZ!$DEREZ$ac_delim SETFILE!$SETFILE$ac_delim LIBICONV!$LIBICONV$ac_delim -EXTRALIBS_ESD!$EXTRALIBS_ESD$ac_delim SDL_CONFIG!$SDL_CONFIG$ac_delim +SDL_CFLAGS!$SDL_CFLAGS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -55509,7 +55182,6 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -SDL_CFLAGS!$SDL_CFLAGS$ac_delim SDL_LIBS!$SDL_LIBS$ac_delim LIBGNOMEPRINTUI_CFLAGS!$LIBGNOMEPRINTUI_CFLAGS$ac_delim LIBGNOMEPRINTUI_LIBS!$LIBGNOMEPRINTUI_LIBS$ac_delim @@ -55606,6 +55278,7 @@ COND_BUILD_DEBUG_DEBUG_INFO_DEFAULT!$COND_BUILD_DEBUG_DEBUG_INFO_DEFAULT$ac_deli COND_BUILD_DEBUG_UNICODE_0!$COND_BUILD_DEBUG_UNICODE_0$ac_delim COND_BUILD_DEBUG_UNICODE_1!$COND_BUILD_DEBUG_UNICODE_1$ac_delim COND_BUILD_RELEASE!$COND_BUILD_RELEASE$ac_delim +COND_BUILD_RELEASE_DEBUG_INFO_DEFAULT!$COND_BUILD_RELEASE_DEBUG_INFO_DEFAULT$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -55647,7 +55320,6 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -COND_BUILD_RELEASE_DEBUG_INFO_DEFAULT!$COND_BUILD_RELEASE_DEBUG_INFO_DEFAULT$ac_delim COND_BUILD_RELEASE_UNICODE_0!$COND_BUILD_RELEASE_UNICODE_0$ac_delim COND_BUILD_RELEASE_UNICODE_1!$COND_BUILD_RELEASE_UNICODE_1$ac_delim COND_DEBUG_FLAG_1!$COND_DEBUG_FLAG_1$ac_delim @@ -55744,6 +55416,7 @@ COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0!$COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0$ac_ COND_TOOLKIT_DFB!$COND_TOOLKIT_DFB$ac_delim COND_TOOLKIT_DFB_USE_GUI_1!$COND_TOOLKIT_DFB_USE_GUI_1$ac_delim COND_TOOLKIT_GTK!$COND_TOOLKIT_GTK$ac_delim +COND_TOOLKIT_GTK_TOOLKIT_VERSION_!$COND_TOOLKIT_GTK_TOOLKIT_VERSION_$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -55785,7 +55458,6 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -COND_TOOLKIT_GTK_TOOLKIT_VERSION_!$COND_TOOLKIT_GTK_TOOLKIT_VERSION_$ac_delim COND_TOOLKIT_GTK_TOOLKIT_VERSION_2!$COND_TOOLKIT_GTK_TOOLKIT_VERSION_2$ac_delim COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1!$COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1$ac_delim COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0!$COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0$ac_delim @@ -55882,6 +55554,7 @@ DMALLOC_LIBS!$DMALLOC_LIBS$ac_delim WX_VERSION_TAG!$WX_VERSION_TAG$ac_delim RESCOMP!$RESCOMP$ac_delim RESFLAGS!$RESFLAGS$ac_delim +RESPROGRAMOBJ!$RESPROGRAMOBJ$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -55923,7 +55596,6 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -RESPROGRAMOBJ!$RESPROGRAMOBJ$ac_delim WX_RESOURCES_MACOSX_ASCII!$WX_RESOURCES_MACOSX_ASCII$ac_delim WX_RESOURCES_MACOSX_DATA!$WX_RESOURCES_MACOSX_DATA$ac_delim LIBWXMACRES!$LIBWXMACRES$ac_delim @@ -55935,7 +55607,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 10; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index 58eec2af64..8e16c76493 100644 --- a/configure.in +++ b/configure.in @@ -466,7 +466,6 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no - DEFAULT_wxUSE_RESOURCES=no DEFAULT_wxUSE_CONSTRAINTS=no DEFAULT_wxUSE_IPC=no DEFAULT_wxUSE_HELP=no @@ -691,7 +690,6 @@ else DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes - DEFAULT_wxUSE_RESOURCES=no DEFAULT_wxUSE_CONSTRAINTS=yes DEFAULT_wxUSE_IPC=yes DEFAULT_wxUSE_HELP=yes @@ -1052,13 +1050,6 @@ dnl VZ: these options seem to be always on, if someone wants to change it please dnl WX_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], dnl wxUSE_NORMALIZED_PS_FONTS) dnl WX_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], dnl wxUSE_AFM_FOR_POSTSCRIPT) -dnl --------------------------------------------------------------------------- -dnl resources -dnl --------------------------------------------------------------------------- - -WX_ARG_ENABLE(prologio, [ --enable-prologio not available; see contrib], wxUSE_PROLOGIO) -WX_ARG_ENABLE(resources, [ --enable-resources not available; see contrib], wxUSE_RESOURCES) - dnl --------------------------------------------------------------------------- dnl IPC &c dnl --------------------------------------------------------------------------- @@ -5017,37 +5008,6 @@ WX_CHECK_FUNCS(fdopen) fi -dnl if !MSW - - -dnl ------------------------------------------ -dnl Checks specific to contrib libs (MMedia) -dnl ------------------------------------------ - -dnl Check for ESD: -EXTRALIBS_ESD= -AC_CHECK_LIB(esd, esd_close, [ - AC_CHECK_HEADER([esd.h], [ - EXTRALIBS_ESD="-lesd" - ], - [], - [ ]) -]) -AC_SUBST(EXTRALIBS_ESD) - -dnl check for known CD-ROM interface -AC_MSG_CHECKING([for known CD-ROM interface]) -AC_TRY_COMPILE([#ifdef __linux__ - #include - #else - /* For Solaris */ - #include - #endif - ], - [struct cdrom_tocentry entry, old_entry;], - [AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_KNOWN_CDROM_INTERFACE)], - [AC_MSG_RESULT([no])]) dnl =========================================================================== dnl Now we have all the info we need - use it! @@ -5791,8 +5751,6 @@ if test "$USE_UNIX" = "1" ; then if test "$ac_cv_header_sys_soundcard" = "yes"; then AC_DEFINE(HAVE_SYS_SOUNDCARD_H) - else - DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia" fi fi @@ -6589,9 +6547,6 @@ if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing" fi -if test "$wxUSE_PROLOGIO" = "yes" -o "$wxUSE_RESOURCES" = "yes"; then - AC_MSG_ERROR([wxExpr and old-style resources are now available in contrib only]) -fi dnl --------------------------------------------------------------------------- dnl wxMetafile availability @@ -7651,6 +7606,7 @@ EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS" EXTRALIBS_XML="$EXPAT_LINK" EXTRALIBS_HTML="$MSPACK_LINK" EXTRALIBS_ODBC="$ODBC_LINK" +EXTRALIBS_STC="-lwxscintilla${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}" if test "$wxUSE_GUI" = "yes"; then EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $WEBKIT_LINK $EXTRALIBS_HILDON $EXTRALIBS_GNOMEVFS $EXTRALIBS_GNOMEPRINT` fi @@ -8100,23 +8056,18 @@ dnl resembles an installed wx in prefix=$builddir. It is troublesome dnl though in this form because AC_CONFIG_LINKS will fail for directories dnl on platforms that do not have symlinks. dnl AC_CONFIG_LINKS([ include/wx-$WX_RELEASE$WX_FLAVOUR:include ]) -dnl AC_CONFIG_LINKS([ contrib/include ]) if test "$wxWITH_SUBDIRS" != "no"; then -dnl Configure samples, contrib etc. directories, but only if they are present: +dnl Configure samples, demos etc. directories, but only if they are present: if test "$wxUSE_GUI" = "yes"; then - SUBDIRS="samples demos utils contrib" + SUBDIRS="samples demos utils" else dnl we build wxBase only - dnl there are no wxBase programs in contrib nor demos + dnl there are no wxBase programs in demos SUBDIRS="samples utils" fi dnl Add tests to the list of subdirs if cppunit 1.8.0+ is detected AM_PATH_CPPUNIT(1.8.0, [SUBDIRS="$SUBDIRS tests"]) -if test "$USE_UNIX" != "1" -a "$USE_WIN32" != "1"; then - DISABLED_CONTRIB="$DISABLED_CONTRIB net" -fi - for subdir in `echo $SUBDIRS`; do if test -d ${srcdir}/${subdir} ; then if test "$wxUSE_GUI" = "yes"; then @@ -8132,7 +8083,7 @@ for subdir in `echo $SUBDIRS`; do else dnl assume that everything compiles for utils &c dnl any that shouldn't be built can be added to - dnl DISABLED_UTILS, DISABLED_CONTRIB or DISABLED_DEMOS + dnl DISABLED_UTILS, DISABLED_DEMOS disabled_var=DISABLED_`echo $subdir | tr [[a-z]] [[A-Z]]`; eval "disabled=\$$disabled_var" disabled=/`echo X $disabled | sed 's@ @/|/@g'`/ diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index f183c527cc..7464f76cd1 100644 --- a/demos/poem/wxpoem.cpp +++ b/demos/poem/wxpoem.cpp @@ -751,11 +751,13 @@ int GetIndex() // Read preferences void MainWindow::ReadPreferences() { +/* TODO: convert this code to use wxConfig #if wxUSE_RESOURCES wxGetResource(_T("wxPoem"), _T("FontSize"), &pointSize); wxGetResource(_T("wxPoem"), _T("X"), &XPos); wxGetResource(_T("wxPoem"), _T("Y"), &YPos); #endif +*/ } // Write preferences to disk @@ -763,11 +765,13 @@ void MainWindow::WritePreferences() { #ifdef __WXMSW__ TheMainWindow->GetPosition(&XPos, &YPos); +/* TODO: convert this code to use wxConfig #if wxUSE_RESOURCES wxWriteResource(_T("wxPoem"), _T("FontSize"), pointSize); wxWriteResource(_T("wxPoem"), _T("X"), XPos); wxWriteResource(_T("wxPoem"), _T("Y"), YPos); #endif +*/ #endif } diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 8fd8b09c79..30bb2dd121 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -148,7 +148,6 @@ the corresponding topic. \helpref{wxGetPrinterScaling}{wxgetprinterscaling}\\ \helpref{wxGetPrinterTranslation}{wxgetprintertranslation}\\ \helpref{wxGetProcessId}{wxgetprocessid}\\ -\helpref{wxGetResource}{wxgetresource}\\ \helpref{wxGetSingleChoiceData}{wxgetsinglechoicedata}\\ \helpref{wxGetSingleChoiceIndex}{wxgetsinglechoiceindex}\\ \helpref{wxGetSingleChoice}{wxgetsinglechoice}\\ @@ -271,7 +270,6 @@ the corresponding topic. \helpref{wxVaCopy}{wxvacopy}\\ \helpref{wxVsnprintf}{wxvsnprintf}\\ \helpref{wxWakeUpIdle}{wxwakeupidle}\\ -\helpref{wxWriteResource}{wxwriteresource}\\ \helpref{wxYield}{wxyield}\\ \helpref{wx\_const\_cast}{wxconstcastraw}\\ \helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}\\ @@ -3216,40 +3214,6 @@ public: \end{verbatim} -\membersection{::wxGetResource}\label{wxgetresource} - -\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{const wxString\& *}{value}, \param{const wxString\& }{file = NULL}} - -\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{float *}{value}, \param{const wxString\& }{file = NULL}} - -\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{long *}{value}, \param{const wxString\& }{file = NULL}} - -\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{int *}{value}, \param{const wxString\& }{file = NULL}} - -Gets a resource value from the resource database (for example, WIN.INI, or -.Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used, -otherwise the specified file is used. - -Under X, if an application class (wxApp::GetClassName) has been defined, -it is appended to the string /usr/lib/X11/app-defaults/ to try to find -an applications default file when merging all resource databases. - -The reason for passing the result in an argument is that it -can be convenient to define a default value, which gets overridden -if the value exists in the resource file. It saves a separate -test for that resource's existence, and it also allows -the overloading of the function for different types. - -See also \helpref{wxWriteResource}{wxwriteresource}, \helpref{wxConfigBase}{wxconfigbase}. - -\wxheading{Include files} - - - \membersection{::wxGetStockLabel}\label{wxgetstocklabel} @@ -3485,37 +3449,6 @@ As with \texttt{va\_start}, each call to \texttt{wxVaCopy} must have a matching \texttt{va\_end}. -\membersection{::wxWriteResource}\label{wxwriteresource} - -\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{const wxString\& }{value}, \param{const wxString\& }{file = NULL}} - -\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{float }{value}, \param{const wxString\& }{file = NULL}} - -\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{long }{value}, \param{const wxString\& }{file = NULL}} - -\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, - \param{int }{value}, \param{const wxString\& }{file = NULL}} - -Writes a resource value into the resource database (for example, WIN.INI, or -.Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used, -otherwise the specified file is used. - -Under X, the resource databases are cached until the internal function -\rtfsp{\bf wxFlushResources} is called automatically on exit, when -all updated resource databases are written to their files. - -Note that it is considered bad manners to write to the .Xdefaults -file under Unix, although the WIN.INI file is fair game under Windows. - -See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfigbase}. - -\wxheading{Include files} - - - \membersection{\_\_WXFUNCTION\_\_}\label{wxfunction} diff --git a/docs/latex/wx/wizpage.tex b/docs/latex/wx/wizpage.tex index 1b6812c26b..3e4ddf1b0d 100644 --- a/docs/latex/wx/wizpage.tex +++ b/docs/latex/wx/wizpage.tex @@ -50,7 +50,7 @@ should be very rarely needed. \membersection{wxWizardPage::wxWizardPage}\label{wxwizardpagewxwizardpage} -\func{}{wxWizardPage}{\param{wxWizard* }{parent}, \param{const wxBitmap\& }{bitmap = wxNullBitmap}, \param{const wxChar }{*resource = NULL}} +\func{}{wxWizardPage}{\param{wxWizard* }{parent}, \param{const wxBitmap\& }{bitmap = wxNullBitmap}} Constructor accepts an optional bitmap which will be used for this page instead of the default one for this wizard (note that all bitmaps used should @@ -63,7 +63,6 @@ wizard will resize and reposition the page anyhow. \docparam{bitmap}{The page-specific bitmap if different from the global one} -\docparam{resource}{Load the page from the specified resource if non-NULL} \membersection{wxWizardPage::GetPrev}\label{wxwizardpagegetprev} diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 98ec5fbdcb..f7969c189f 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -1804,15 +1804,6 @@ # endif #endif /* wxUSE_CLIPBOARD */ -#if wxUSE_WX_RESOURCES && !wxUSE_PROLOGIO -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxr resources require PrologIO" -# else -# undef wxUSE_PROLOGIO -# define wxUSE_PROLOGIO 1 -# endif -#endif /* wxUSE_WX_RESOURCES */ - #if wxUSE_XRC && !wxUSE_XML # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_XRC requires wxUSE_XML" diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index a11724f248..827dbf7422 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -1068,8 +1068,6 @@ // Use wxHTML-based help controller? #define wxUSE_WXHTML_HELP 1 -#define wxUSE_RESOURCES 0 - // 0 for no wxGetResource/wxWriteResource #define wxUSE_CONSTRAINTS 1 // 0 for no window layout constraint system diff --git a/include/wx/utils.h b/include/wx/utils.h index ac8d98e01d..aec1d1ee50 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -639,23 +639,6 @@ public: static const wxCursor GetBusyCursor(); }; - -// ---------------------------------------------------------------------------- -// Reading and writing resources (eg WIN.INI, .Xdefaults) -// ---------------------------------------------------------------------------- - -#if wxUSE_RESOURCES -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = wxEmptyString); - -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = wxEmptyString); -#endif // wxUSE_RESOURCES - void WXDLLEXPORT wxGetMousePosition( int* x, int* y ); // MSW only: get user-defined resource from the .res file. diff --git a/include/wx/wizard.h b/include/wx/wizard.h index 3674896fa4..c57b2a469c 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -54,12 +54,10 @@ public: // that no other parameters are needed because the wizard will resize and // reposition the page anyhow wxWizardPage(wxWizard *parent, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL); + const wxBitmap& bitmap = wxNullBitmap); bool Create(wxWizard *parent, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL); + const wxBitmap& bitmap = wxNullBitmap); // these functions are used by the wizard to show another page when the // user chooses "Back" or "Next" button @@ -121,21 +119,19 @@ public: wxWizardPageSimple(wxWizard *parent, wxWizardPage *prev = (wxWizardPage *)NULL, wxWizardPage *next = (wxWizardPage *)NULL, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL) + const wxBitmap& bitmap = wxNullBitmap) { - Create(parent, prev, next, bitmap, resource); + Create(parent, prev, next, bitmap); } bool Create(wxWizard *parent = NULL, // let it be default ctor too wxWizardPage *prev = (wxWizardPage *)NULL, wxWizardPage *next = (wxWizardPage *)NULL, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL) + const wxBitmap& bitmap = wxNullBitmap) { m_prev = prev; m_next = next; - return wxWizardPage::Create(parent, bitmap, resource); + return wxWizardPage::Create(parent, bitmap); } // the pointers may be also set later - but before starting the wizard diff --git a/setup.h.in b/setup.h.in index 65759d96c3..d9b83ee4bb 100644 --- a/setup.h.in +++ b/setup.h.in @@ -474,8 +474,6 @@ #define wxUSE_WXHTML_HELP 0 -#define wxUSE_RESOURCES 0 - #define wxUSE_CONSTRAINTS 0 @@ -732,9 +730,6 @@ #define wxUSE_OLE_AUTOMATION 0 #define wxUSE_ACTIVEX 0 -/* for compatibility */ -#define wxUSE_WX_RESOURCES wxUSE_RESOURCES - /* * Use MS HTML Help via libmspack (Unix) */ @@ -1080,15 +1075,9 @@ /* Define if you have the header file (mingw,cygwin). */ #undef HAVE_W32API_H -/* Define if you have the header file. */ -#undef HAVE_ESD_H - /* Define if you have the header file. */ #undef HAVE_SYS_SOUNDCARD_H -/* Define if you have a CD-ROM interface known to mmedia. */ -#undef HAVE_KNOWN_CDROM_INTERFACE - /* Define if you have wcsrtombs() function */ #undef HAVE_WCSRTOMBS diff --git a/src/cocoa/utils.cpp b/src/cocoa/utils.cpp index c2112fc552..081d9e567f 100644 --- a/src/cocoa/utils.cpp +++ b/src/cocoa/utils.cpp @@ -111,77 +111,3 @@ bool wxCheckForInterrupt(wxWindow *wnd) #endif -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - // TODO - return false; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%.4f", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%ld", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%d", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file) -{ - // TODO - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (float)strtod(s, NULL); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = strtol(s, NULL, 10); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (int)strtol(s, NULL, 10); - delete[] s; - return true; - } - else return false; -} -#endif // wxUSE_RESOURCES diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 7973669650..20c5e12750 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -125,31 +125,17 @@ void wxWizardPage::Init() } wxWizardPage::wxWizardPage(wxWizard *parent, - const wxBitmap& bitmap, - const wxChar *resource) + const wxBitmap& bitmap) { - Create(parent, bitmap, resource); + Create(parent, bitmap); } bool wxWizardPage::Create(wxWizard *parent, - const wxBitmap& bitmap, - const wxChar *resource) + const wxBitmap& bitmap) { if ( !wxPanel::Create(parent, wxID_ANY) ) return false; - if ( resource != NULL ) - { -#if wxUSE_WX_RESOURCES -#if 0 - if ( !LoadFromResource(this, resource) ) - { - wxFAIL_MSG(wxT("wxWizardPage LoadFromResource failed!!!!")); - } -#endif -#endif // wxUSE_RESOURCES - } - m_bitmap = bitmap; // initially the page is hidden, it's shown only when it becomes current diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index d491c42b04..f8f817d58c 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -378,84 +378,6 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const return wxPORT_MAC; } -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - // TODO - return false; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%.4f"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%ld"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%d"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file) -{ - // TODO - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (float)strtod(s, NULL); - delete[] s; - } - - return succ; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = strtol(s, NULL, 10); - delete[] s; - } - - return succ; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (int)strtol(s, NULL, 10); - delete[] s; - } - - return succ; -} -#endif // wxUSE_RESOURCES - int gs_wxBusyCursorCount = 0; extern wxCursor gMacCurrentCursor; wxCursor gMacStoredActiveCursor; diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index ed12f87e22..1f5d60838a 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -52,31 +52,12 @@ #include "wx/motif/private.h" -#if wxUSE_RESOURCES -#include "X11/Xresource.h" -#endif - #include "X11/Xutil.h" #ifdef __VMS__ #pragma message enable nosimpint #endif -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// Yuck this is really BOTH site and platform dependent -// so we should use some other strategy! -#ifdef sun - #define DEFAULT_XRESOURCE_DIR "/usr/openwin/lib/app-defaults" -#else - #define DEFAULT_XRESOURCE_DIR "/usr/lib/X11/app-defaults" -#endif - -#if wxUSE_RESOURCES -static char *GetIniFile (char *dest, const char *filename); -#endif // ============================================================================ // implementation @@ -154,350 +135,6 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const return wxPORT_MOTIF; } - -// ---------------------------------------------------------------------------- -// Reading and writing resources (eg WIN.INI, .Xdefaults) -// ---------------------------------------------------------------------------- - -#if wxUSE_RESOURCES - -// Read $HOME for what it says is home, if not -// read $USER or $LOGNAME for user name else determine -// the Real User, then determine the Real home dir. -static char * GetIniFile (char *dest, const char *filename) -{ - char *home = NULL; - if (filename && wxIsAbsolutePath(filename)) - { - strcpy(dest, filename); - } - else if ((home = wxGetUserHome()) != NULL) - { - strcpy(dest, home); - if (dest[strlen(dest) - 1] != '/') - strcat (dest, "/"); - if (filename == NULL) - { - if ((filename = getenv ("XENVIRONMENT")) == NULL) - filename = ".Xdefaults"; - } - else if (*filename != '.') - strcat (dest, "."); - strcat (dest, filename); - } else - { - dest[0] = '\0'; - } - return dest; -} - -static char *GetResourcePath(char *buf, const char *name, bool create = false) -{ - if (create && wxFileExists (name) ) { - strcpy(buf, name); - return buf; // Exists so ... - } - - if (*name == '/') - strcpy(buf, name); - else { - // Put in standard place for resource files if not absolute - strcpy (buf, DEFAULT_XRESOURCE_DIR); - strcat (buf, "/"); - strcat (buf, wxFileNameFromPath (name).c_str()); - } - - if (create) { - // Touch the file to create it - FILE *fd = fopen (buf, "w"); - if (fd) fclose (fd); - } - return buf; -} - -/* -* We have a cache for writing different resource files, -* which will only get flushed when we call wxFlushResources(). -* Build up a list of resource databases waiting to be written. -* -*/ - -wxList wxResourceCache (wxKEY_STRING); - -void -wxFlushResources (void) -{ - char nameBuffer[512]; - - wxNode *node = wxResourceCache.First (); - while (node) - { - const char *file = node->GetKeyString(); - // If file doesn't exist, create it first. - (void)GetResourcePath(nameBuffer, file, true); - - XrmDatabase database = (XrmDatabase) node->Data (); - XrmPutFileDatabase (database, nameBuffer); - XrmDestroyDatabase (database); - wxNode *next = node->Next (); - delete node; - node = next; - } -} - -static XrmDatabase wxResourceDatabase = 0; - -void wxXMergeDatabases (wxApp * theApp, Display * display); - -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - char buffer[500]; - - (void) GetIniFile (buffer, file); - - XrmDatabase database; - wxNode *node = wxResourceCache.Find (buffer); - if (node) - database = (XrmDatabase) node->Data (); - else - { - database = XrmGetFileDatabase (buffer); - wxResourceCache.Append (buffer, (wxObject *) database); - } - - char resName[300]; - strcpy (resName, section.c_str()); - strcat (resName, "."); - strcat (resName, entry.c_str()); - - XrmPutStringResource (&database, resName, value); - return true; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%.4f", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%ld", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%d", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file) -{ - if (!wxResourceDatabase) - { - Display *display = wxGlobalDisplay(); - wxXMergeDatabases (wxTheApp, display); - } - - XrmDatabase database; - - if (!file.empty()) - { - char buffer[500]; - - // Is this right? Trying to get it to look in the user's - // home directory instead of current directory -- JACS - (void) GetIniFile (buffer, file); - - wxNode *node = wxResourceCache.Find (buffer); - if (node) - database = (XrmDatabase) node->Data (); - else - { - database = XrmGetFileDatabase (buffer); - wxResourceCache.Append (buffer, (wxObject *) database); - } - } - else - database = wxResourceDatabase; - - XrmValue xvalue; - char *str_type[20]; - char buf[150]; - strcpy (buf, section); - strcat (buf, "."); - strcat (buf, entry); - - Bool success = XrmGetResource (database, buf, "*", str_type, - &xvalue); - // Try different combinations of upper/lower case, just in case... - if (!success) - { - buf[0] = (isupper (buf[0]) ? tolower (buf[0]) : toupper (buf[0])); - success = XrmGetResource (database, buf, "*", str_type, - &xvalue); - } - if (success) - { - if (*value) - delete[] *value; - - *value = new char[xvalue.size + 1]; - strncpy (*value, xvalue.addr, (int) xvalue.size); - return true; - } - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (float)strtod(s, NULL); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = strtol(s, NULL, 10); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - // Handle True, False here - // True, Yes, Enables, Set or Activated - if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') - *value = true; - // False, No, Disabled, Reset, Cleared, Deactivated - else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C') - *value = false; - // Handle as Integer - else - *value = (int) strtol (s, NULL, 10); - delete[] s; - return true; - } - else - return false; -} - -void wxXMergeDatabases (wxApp * theApp, Display * display) -{ - XrmDatabase homeDB, serverDB, applicationDB; - char filenamebuf[1024]; - - char *filename = &filenamebuf[0]; - char *environment; - wxString classname = theApp->GetClassName(); - char name[256]; - (void) strcpy (name, "/usr/lib/X11/app-defaults/"); - (void) strcat (name, classname.c_str()); - - /* Get application defaults file, if any */ - applicationDB = XrmGetFileDatabase (name); - (void) XrmMergeDatabases (applicationDB, &wxResourceDatabase); - - /* Merge server defaults, created by xrdb, loaded as a property of the root - * window when the server initializes and loaded into the display - * structure on XOpenDisplay; - * if not defined, use .Xdefaults - */ - - if (XResourceManagerString (display) != NULL) - { - serverDB = XrmGetStringDatabase (XResourceManagerString (display)); - } - else - { - (void) GetIniFile (filename, NULL); - serverDB = XrmGetFileDatabase (filename); - } - XrmMergeDatabases (serverDB, &wxResourceDatabase); - - /* Open XENVIRONMENT file, or if not defined, the .Xdefaults, - * and merge into existing database - */ - - if ((environment = getenv ("XENVIRONMENT")) == NULL) - { - size_t len; - environment = GetIniFile (filename, NULL); - len = strlen (environment); - wxString hostname = wxGetHostName(); - if ( !hostname.empty() ) - strncat(environment, hostname, 1024 - len); - } - homeDB = XrmGetFileDatabase (environment); - XrmMergeDatabases (homeDB, &wxResourceDatabase); -} - -#if 0 - -/* -* Not yet used but may be useful. -* -*/ -void -wxSetDefaultResources (const Widget w, const char **resourceSpec, const char *name) -{ - int i; - Display *dpy = XtDisplay (w); // Retrieve the display pointer - - XrmDatabase rdb = NULL; // A resource data base - - // Create an empty resource database - rdb = XrmGetStringDatabase (""); - - // Add the Component resources, prepending the name of the component - - i = 0; - while (resourceSpec[i] != NULL) - { - char buf[1000]; - - sprintf (buf, "*%s%s", name, resourceSpec[i++]); - XrmPutLineResource (&rdb, buf); - } - - // Merge them into the Xt database, with lowest precendence - - if (rdb) - { -#if (XlibSpecificationRelease>=5) - XrmDatabase db = XtDatabase (dpy); - XrmCombineDatabase (rdb, &db, False); -#else - XrmMergeDatabases (dpy->db, &rdb); - dpy->db = rdb; -#endif - } -} -#endif -// 0 - -#endif // wxUSE_RESOURCES - // ---------------------------------------------------------------------------- // display info // ---------------------------------------------------------------------------- diff --git a/src/msw/utilsgui.cpp b/src/msw/utilsgui.cpp index d1acea6ad5..5b091fd03b 100644 --- a/src/msw/utilsgui.cpp +++ b/src/msw/utilsgui.cpp @@ -38,113 +38,6 @@ // implementation // ============================================================================ -// ---------------------------------------------------------------------------- -// functions to work with .INI files -// ---------------------------------------------------------------------------- - -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - if (file != wxEmptyString) -// Don't know what the correct cast should be, but it doesn't -// compile in BC++/16-bit without this cast. -#if !defined(__WIN32__) - return (WritePrivateProfileString((const char*) section, (const char*) entry, (const char*) value, (const char*) file) != 0); -#else - return (WritePrivateProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)value, (LPCTSTR)WXSTRINGCAST file) != 0); -#endif - else - return (WriteProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)WXSTRINGCAST value) != 0); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%.4f"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%ld"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - wxString buf; - buf.Printf(wxT("%d"), value); - - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file) -{ - static const wxChar defunkt[] = wxT("$$default"); - - wxChar buf[1024]; - if (file != wxEmptyString) - { - int n = GetPrivateProfileString(section, entry, defunkt, - buf, WXSIZEOF(buf), file); - if (n == 0 || wxStrcmp(buf, defunkt) == 0) - return false; - } - else - { - int n = GetProfileString(section, entry, defunkt, buf, WXSIZEOF(buf)); - if (n == 0 || wxStrcmp(buf, defunkt) == 0) - return false; - } - if (*value) delete[] (*value); - *value = wxStrcpy(new wxChar[wxStrlen(buf) + 1], buf); - return true; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - wxChar *s = NULL; - bool succ = wxGetResource(section, entry, (wxChar **)&s, file); - if (succ) - { - *value = (float)wxStrtod(s, NULL); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - wxChar *s = NULL; - bool succ = wxGetResource(section, entry, (wxChar **)&s, file); - if (succ) - { - *value = wxStrtol(s, NULL, 10); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - wxChar *s = NULL; - bool succ = wxGetResource(section, entry, (wxChar **)&s, file); - if (succ) - { - *value = (int)wxStrtol(s, NULL, 10); - delete[] s; - return true; - } - else return false; -} -#endif // wxUSE_RESOURCES - // --------------------------------------------------------------------------- // helper functions for showing a "busy" cursor // --------------------------------------------------------------------------- diff --git a/src/os2/utilsgui.cpp b/src/os2/utilsgui.cpp index dc2651beef..03436d722b 100644 --- a/src/os2/utilsgui.cpp +++ b/src/os2/utilsgui.cpp @@ -57,190 +57,6 @@ public: } }; -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource( const wxString& rSection, - const wxString& rEntry, - const wxString& rValue, - const wxString& rFile ) -{ - HAB hab = 0; - HINI hIni = 0; - - if (!rFile.empty()) - { - hIni = ::PrfOpenProfile(hab, (PSZ)WXSTRINGCAST rFile); - if (hIni != 0L) - { - return (::PrfWriteProfileString( hIni - ,(PSZ)WXSTRINGCAST rSection - ,(PSZ)WXSTRINGCAST rEntry - ,(PSZ)WXSTRINGCAST rValue - )); - } - } - else - return (::PrfWriteProfileString( HINI_PROFILE - ,(PSZ)WXSTRINGCAST rSection - ,(PSZ)WXSTRINGCAST rEntry - ,(PSZ)WXSTRINGCAST rValue - )); - return false; -} - -bool wxWriteResource( - const wxString& rSection -, const wxString& rEntry -, float fValue -, const wxString& rFile -) -{ - wxChar zBuf[50]; - - wxSprintf(zBuf, "%.4f", fValue); - return wxWriteResource( rSection - ,rEntry - ,zBuf - ,rFile - ); -} - -bool wxWriteResource( - const wxString& rSection -, const wxString& rEntry -, long lValue -, const wxString& rFile -) -{ - wxChar zBuf[50]; - - wxSprintf(zBuf, "%ld", lValue); - return wxWriteResource( rSection - ,rEntry - ,zBuf - ,rFile - ); -} - -bool wxWriteResource( const wxString& rSection, - const wxString& rEntry, - int lValue, - const wxString& rFile ) -{ - wxChar zBuf[50]; - - wxSprintf(zBuf, "%d", lValue); - return wxWriteResource( rSection, rEntry, zBuf, rFile ); -} - -bool wxGetResource( const wxString& rSection, - const wxString& rEntry, - wxChar** ppValue, - const wxString& rFile ) -{ - HAB hab = 0; - HINI hIni = 0; - wxChar zDefunkt[] = _T("$$default"); - char zBuf[1000]; - - if (!rFile.empty()) - { - hIni = ::PrfOpenProfile(hab, (PSZ)WXSTRINGCAST rFile); - if (hIni != 0L) - { - ULONG n = ::PrfQueryProfileString( hIni - ,(PSZ)WXSTRINGCAST rSection - ,(PSZ)WXSTRINGCAST rEntry - ,(PSZ)zDefunkt - ,(PVOID)zBuf - ,1000 - ); - if (zBuf == NULL) - return false; - if (n == 0L || wxStrcmp(zBuf, zDefunkt) == 0) - return false; - zBuf[n-1] = '\0'; - } - else - return false; - } - else - { - ULONG n = ::PrfQueryProfileString( HINI_PROFILE - ,(PSZ)WXSTRINGCAST rSection - ,(PSZ)WXSTRINGCAST rEntry - ,(PSZ)zDefunkt - ,(PVOID)zBuf - ,1000 - ); - if (zBuf == NULL) - return false; - if (n == 0L || wxStrcmp(zBuf, zDefunkt) == 0) - return false; - zBuf[n-1] = '\0'; - } - strcpy((char*)*ppValue, zBuf); - return true; -} - -bool wxGetResource( const wxString& rSection, - const wxString& rEntry, - float* pValue, - const wxString& rFile ) -{ - wxChar* zStr = NULL; - - zStr = new wxChar[1000]; - bool bSucc = wxGetResource( rSection, rEntry, (wxChar **)&zStr, rFile ); - - if (bSucc) - { - *pValue = (float)wxStrtod(zStr, NULL); - } - - delete[] zStr; - return bSucc; -} - -bool wxGetResource( const wxString& rSection, - const wxString& rEntry, - long* pValue, - const wxString& rFile ) -{ - wxChar* zStr = NULL; - - zStr = new wxChar[1000]; - bool bSucc = wxGetResource( rSection, rEntry, (wxChar **)&zStr, rFile ); - - if (bSucc) - { - *pValue = wxStrtol(zStr, NULL, 10); - } - - delete[] zStr; - return bSucc; -} - -bool wxGetResource( const wxString& rSection, - const wxString& rEntry, - int* pValue, - const wxString& rFile ) -{ - wxChar* zStr = NULL; - - zStr = new wxChar[1000]; - bool bSucc = wxGetResource( rSection, rEntry, (wxChar **)&zStr, rFile ); - - if (bSucc) - { - *pValue = (int)wxStrtol(zStr, NULL, 10); - } - - delete[] zStr; - return bSucc; -} -#endif // wxUSE_RESOURCES - // --------------------------------------------------------------------------- // helper functions for showing a "busy" cursor // --------------------------------------------------------------------------- diff --git a/src/palmos/utilsgui.cpp b/src/palmos/utilsgui.cpp index 29aba3dd83..5c3e637fbb 100644 --- a/src/palmos/utilsgui.cpp +++ b/src/palmos/utilsgui.cpp @@ -34,53 +34,6 @@ // implementation // ============================================================================ -// ---------------------------------------------------------------------------- -// functions to work with .INI files -// ---------------------------------------------------------------------------- - -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - return false; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - return false; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - return false; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file) -{ - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - return false; -} -#endif // wxUSE_RESOURCES - // --------------------------------------------------------------------------- // helper functions for showing a "busy" cursor // --------------------------------------------------------------------------- diff --git a/wx-config.in b/wx-config.in index 1743d670ea..f160232656 100755 --- a/wx-config.in +++ b/wx-config.in @@ -181,7 +181,7 @@ remove_field() } # validate_arg _domain _set _name _value -# Boilerplate to validate an argument and initialise a psuedo-hash. +# Boilerplate to validate an argument and initialise a pseudo-hash. # This one is almost reduction into absurdity, and perhaps makes the # precise action of the argument parser below just a little more # obscure, but oh so neat and compact to use for multiple option @@ -948,6 +948,7 @@ ldlibs_html="@EXTRALIBS_HTML@" ldlibs_xml="@EXTRALIBS_XML@" ldlibs_odbc="@EXTRALIBS_ODBC@" ldlibs_adv="@EXTRALIBS_SDL@" +ldlibs_stc="@EXTRALIBS_STC@" # lib_flags_for _liblist -- 2.45.2