diff --git a/configure b/configure index f3b8ed7c9d..de07b10fc5 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 62501 2009-10-25 17:48:32Z PC . +# From configure.in Id. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for wxWidgets 2.9.1. # @@ -957,6 +957,7 @@ COND_TOOLKIT_WINCE_WXUNIV_0 COND_TOOLKIT_X11 COND_TOOLKIT_X11_USE_GUI_1 COND_UNICODE_1 +COND_USE_CAIRO_1 COND_USE_EXCEPTIONS_0 COND_USE_EXCEPTIONS_1 COND_USE_GUI_0 @@ -1784,10 +1785,10 @@ Optional Features: --enable-gstreamer8 force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix --enable-webkit use wxWebKitCtrl (Mac) --enable-richtext use wxRichTextCtrl - --enable-graphics_ctx use graphics context 2D drawing API --enable-postscript use wxPostscriptDC device context (default for gtk+) --enable-printarch use printing architecture --enable-svg use wxSVGFileDC device context + --enable-graphics_ctx use graphics context 2D drawing API --enable-clipboard use wxClipboard class --enable-dnd use Drag'n'Drop classes --enable-metafile use win32 metafiles @@ -2934,7 +2935,6 @@ DEFAULT_wxUSE_LIBMSPACK=no DEFAULT_wxUSE_LIBSDL=no DEFAULT_wxUSE_ACCESSIBILITY=no -DEFAULT_wxUSE_GRAPHICS_CONTEXT=no DEFAULT_wxUSE_IPV6=no DEFAULT_wxUSE_GSTREAMER8=no @@ -9243,50 +9243,6 @@ fi echo "${ECHO_T}$result" >&6; } - enablestring= - defaultval=$wxUSE_ALL_FEATURES - 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}-graphics_ctx" >&5 -echo $ECHO_N "checking for --${enablestring:-enable}-graphics_ctx... $ECHO_C" >&6; } - # Check whether --enable-graphics_ctx was given. -if test "${enable_graphics_ctx+set}" = set; then - enableval=$enable_graphics_ctx; - if test "$enableval" = yes; then - wx_cv_use_graphics_ctx='wxUSE_GRAPHICS_CONTEXT=yes' - else - wx_cv_use_graphics_ctx='wxUSE_GRAPHICS_CONTEXT=no' - fi - -else - - wx_cv_use_graphics_ctx='wxUSE_GRAPHICS_CONTEXT=${'DEFAULT_wxUSE_GRAPHICS_CONTEXT":-$defaultval}" - -fi - - - eval "$wx_cv_use_graphics_ctx" - - if test x"$enablestring" = xdisable; then - if test $wxUSE_GRAPHICS_CONTEXT = no; then - result=yes - else - result=no - fi - else - result=$wxUSE_GRAPHICS_CONTEXT - fi - - { echo "$as_me:$LINENO: result: $result" >&5 -echo "${ECHO_T}$result" >&6; } - - enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -9419,6 +9375,53 @@ fi echo "${ECHO_T}$result" >&6; } +if test "$wxUSE_MAC" != 1; then + + enablestring= + defaultval=$wxUSE_ALL_FEATURES + 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}-graphics_ctx" >&5 +echo $ECHO_N "checking for --${enablestring:-enable}-graphics_ctx... $ECHO_C" >&6; } + # Check whether --enable-graphics_ctx was given. +if test "${enable_graphics_ctx+set}" = set; then + enableval=$enable_graphics_ctx; + if test "$enableval" = yes; then + wx_cv_use_graphics_ctx='wxUSE_GRAPHICS_CONTEXT=yes' + else + wx_cv_use_graphics_ctx='wxUSE_GRAPHICS_CONTEXT=no' + fi + +else + + wx_cv_use_graphics_ctx='wxUSE_GRAPHICS_CONTEXT=${'DEFAULT_wxUSE_GRAPHICS_CONTEXT":-$defaultval}" + +fi + + + eval "$wx_cv_use_graphics_ctx" + + if test x"$enablestring" = xdisable; then + if test $wxUSE_GRAPHICS_CONTEXT = no; then + result=yes + else + result=no + fi + else + result=$wxUSE_GRAPHICS_CONTEXT + fi + + { echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6; } + +fi + enablestring= @@ -29961,6 +29964,8 @@ done TOOLKIT_INCLUDE="$wx_cv_cflags_gtk" GUI_TK_LIBRARY="$wx_cv_libs_gtk $GUI_TK_LIBRARY" + TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -DG_DISABLE_CAST_CHECKS" + AFMINSTALL=afminstall TOOLKIT=GTK GUIDIST=GTK_DIST @@ -36823,98 +36828,19 @@ _ACEOF fi if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then - ac_ext=cpp + { echo "$as_me:$LINENO: checking for backtrace() in " >&5 +echo $ECHO_N "checking for backtrace() in ... $ECHO_C" >&6; } +if test "${wx_cv_func_backtrace+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - { echo "$as_me:$LINENO: checking for library containing backtrace" >&5 -echo $ECHO_N "checking for library containing backtrace... $ECHO_C" >&6; } -if test "${ac_cv_search_backtrace+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$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 backtrace (); -int -main () -{ -return backtrace (); - ; - return 0; -} -_ACEOF -for ac_lib in '' execinfo; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - 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); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_backtrace=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_backtrace+set}" = set; then - break -fi -done -if test "${ac_cv_search_backtrace+set}" = set; then - : -else - ac_cv_search_backtrace=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_backtrace" >&5 -echo "${ECHO_T}$ac_cv_search_backtrace" >&6; } -ac_res=$ac_cv_search_backtrace -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - { echo "$as_me:$LINENO: checking for backtrace() in " >&5 -echo $ECHO_N "checking for backtrace() in ... $ECHO_C" >&6; } -if test "${wx_cv_func_backtrace+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -36927,6 +36853,7 @@ main () void *trace[1]; char **messages; + backtrace(trace, 1); messages = backtrace_symbols(trace, 1); @@ -36934,14 +36861,14 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -36950,8 +36877,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest.$ac_objext; then wx_cv_func_backtrace=yes else echo "$as_me: failed program was:" >&5 @@ -36961,15 +36887,18 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi { echo "$as_me:$LINENO: result: $wx_cv_func_backtrace" >&5 echo "${ECHO_T}$wx_cv_func_backtrace" >&6; } -else - wx_cv_func_backtrace=no -fi if test "$wx_cv_func_backtrace" = "no"; then @@ -36983,6 +36912,12 @@ if test "${wx_cv_func_cxa_demangle+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -37030,6 +36965,12 @@ fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + fi @@ -37043,12 +36984,6 @@ _ACEOF fi fi - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - fi if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != 1 -a "$USE_UNIX" != 1; then @@ -47216,21 +47151,83 @@ fi if test "$wxUSE_MAC" = 1; then - wxUSE_GRAPHICS_CONTEXT="yes" + wxUSE_GRAPHICS_CONTEXT="yes" fi if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then - if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then - cat >>confdefs.h <<\_ACEOF -#define wxUSE_GRAPHICS_CONTEXT 1 -_ACEOF + wx_has_graphics=0 + if test "$wxUSE_MSW" = 1; then + { echo "$as_me:$LINENO: checking if GDI+ is available" >&5 +echo $ECHO_N "checking if GDI+ is available... $ECHO_C" >&6; } +if test "${wx_cv_lib_gdiplus+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else - elif test "$wxUSE_GTK" != 1; then - cat >>confdefs.h <<\_ACEOF -#define wxUSE_GRAPHICS_CONTEXT 1 -_ACEOF + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + + using namespace Gdiplus; + + ; + 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); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + wx_cv_lib_gdiplus=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + wx_cv_lib_gdiplus=no + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +fi +{ echo "$as_me:$LINENO: result: $wx_cv_lib_gdiplus" >&5 +echo "${ECHO_T}$wx_cv_lib_gdiplus" >&6; } + if test "$wx_cv_lib_gdiplus" = "yes"; then + wx_has_graphics=1 + fi + elif test "$wxUSE_GTK" = 1; then pkg_failed=no { echo "$as_me:$LINENO: checking for CAIRO" >&5 @@ -47290,24 +47287,33 @@ fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_PKG_ERRORS" >&5 - { echo "$as_me:$LINENO: WARNING: Cairo library not found, unable to set wxUSE_GRAPHICS_CONTEXT" >&5 -echo "$as_me: WARNING: Cairo library not found, unable to set wxUSE_GRAPHICS_CONTEXT" >&2;} + { echo "$as_me:$LINENO: WARNING: Cairo library not found" >&5 +echo "$as_me: WARNING: Cairo library not found" >&2;} elif test $pkg_failed = untried; then - { echo "$as_me:$LINENO: WARNING: Cairo library not found, unable to set wxUSE_GRAPHICS_CONTEXT" >&5 -echo "$as_me: WARNING: Cairo library not found, unable to set wxUSE_GRAPHICS_CONTEXT" >&2;} + { echo "$as_me:$LINENO: WARNING: Cairo library not found" >&5 +echo "$as_me: WARNING: Cairo library not found" >&2;} else CAIRO_CFLAGS=$pkg_cv_CAIRO_CFLAGS CAIRO_LIBS=$pkg_cv_CAIRO_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } - cat >>confdefs.h <<\_ACEOF + wx_has_graphics=1 +fi + else + wx_has_graphics=1 + fi + + if test "$wx_has_graphics" = 1; then + cat >>confdefs.h <<\_ACEOF #define wxUSE_GRAPHICS_CONTEXT 1 _ACEOF -fi - fi + else + { echo "$as_me:$LINENO: WARNING: wxGraphicsContext won't be available" >&5 +echo "$as_me: WARNING: wxGraphicsContext won't be available" >&2;} + fi fi @@ -50948,6 +50954,11 @@ EOF COND_UNICODE_1="" fi + COND_USE_CAIRO_1="#" + if test "x$USE_CAIRO" = "x1" ; then + COND_USE_CAIRO_1="" + fi + COND_USE_EXCEPTIONS_0="#" if test "x$USE_EXCEPTIONS" = "x0" ; then COND_USE_EXCEPTIONS_0="" @@ -52760,6 +52771,7 @@ COND_TOOLKIT_WINCE_WXUNIV_0!$COND_TOOLKIT_WINCE_WXUNIV_0$ac_delim COND_TOOLKIT_X11!$COND_TOOLKIT_X11$ac_delim COND_TOOLKIT_X11_USE_GUI_1!$COND_TOOLKIT_X11_USE_GUI_1$ac_delim COND_UNICODE_1!$COND_UNICODE_1$ac_delim +COND_USE_CAIRO_1!$COND_USE_CAIRO_1$ac_delim COND_USE_EXCEPTIONS_0!$COND_USE_EXCEPTIONS_0$ac_delim COND_USE_EXCEPTIONS_1!$COND_USE_EXCEPTIONS_1$ac_delim COND_USE_GUI_0!$COND_USE_GUI_0$ac_delim @@ -52806,7 +52818,6 @@ COND_wxUSE_REGEX_builtin!$COND_wxUSE_REGEX_builtin$ac_delim COND_wxUSE_ZLIB_builtin!$COND_wxUSE_ZLIB_builtin$ac_delim DEREZ!$DEREZ$ac_delim SHARED!$SHARED$ac_delim -WX_LIBRARY_BASENAME_NOGUI!$WX_LIBRARY_BASENAME_NOGUI$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -52848,6 +52859,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +WX_LIBRARY_BASENAME_NOGUI!$WX_LIBRARY_BASENAME_NOGUI$ac_delim WX_LIBRARY_BASENAME_GUI!$WX_LIBRARY_BASENAME_GUI$ac_delim USE_GUI!$USE_GUI$ac_delim AFMINSTALL!$AFMINSTALL$ac_delim @@ -52892,7 +52904,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` = 42; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 43; 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 bd4ea494d0..c0f7210500 100644 --- a/configure.in +++ b/configure.in @@ -369,7 +369,6 @@ DEFAULT_wxUSE_LIBSDL=no dnl features disabled by default DEFAULT_wxUSE_ACCESSIBILITY=no -DEFAULT_wxUSE_GRAPHICS_CONTEXT=no DEFAULT_wxUSE_IPV6=no DEFAULT_wxUSE_GSTREAMER8=no @@ -807,11 +806,16 @@ WX_ARG_FEATURE(mediactrl, [ --enable-mediactrl use wxMediaCtrl class], w WX_ARG_FEATURE(gstreamer8, [ --enable-gstreamer8 force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8) WX_ARG_FEATURE(webkit, [ --enable-webkit use wxWebKitCtrl (Mac)], wxUSE_WEBKIT) WX_ARG_FEATURE(richtext, [ --enable-richtext use wxRichTextCtrl], wxUSE_RICHTEXT) -WX_ARG_FEATURE(graphics_ctx,[ --enable-graphics_ctx use graphics context 2D drawing API], wxUSE_GRAPHICS_CONTEXT) WX_ARG_FEATURE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT) WX_ARG_FEATURE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE) WX_ARG_FEATURE(svg, [ --enable-svg use wxSVGFileDC device context], wxUSE_SVG) +dnl wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter +dnl can't be disabled, don't even provide an option to do it +if test "$wxUSE_MAC" != 1; then +WX_ARG_FEATURE(graphics_ctx,[ --enable-graphics_ctx use graphics context 2D drawing API], wxUSE_GRAPHICS_CONTEXT) +fi + dnl --------------------------------------------------------------------------- dnl IPC &c dnl --------------------------------------------------------------------------- @@ -7305,23 +7309,50 @@ dnl --------------------------------------------------------------------------- dnl wxGraphicsContext dnl --------------------------------------------------------------------------- +dnl Under Mac we don't even provide --enable-graphics_ctx switch as we always +dnl need it -- but because we don't have the option, wxUSE_GRAPHICS_CONTEXT is +dnl not defined automatically and we need to do it ourselves if test "$wxUSE_MAC" = 1; then - wxUSE_GRAPHICS_CONTEXT="yes" + wxUSE_GRAPHICS_CONTEXT="yes" fi if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then - if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then - AC_DEFINE(wxUSE_GRAPHICS_CONTEXT) - elif test "$wxUSE_GTK" != 1; then - dnl for other builds we'll just wing it for now... - AC_DEFINE(wxUSE_GRAPHICS_CONTEXT) - else - dnl ...but let's check for cairo availability for wxGTK builds - PKG_CHECK_MODULES(CAIRO, cairo, - [AC_DEFINE(wxUSE_GRAPHICS_CONTEXT)], - [AC_MSG_WARN([Cairo library not found, unable to set wxUSE_GRAPHICS_CONTEXT])] - ) - fi + wx_has_graphics=0 + if test "$wxUSE_MSW" = 1; then + AC_CACHE_CHECK([if GDI+ is available], wx_cv_lib_gdiplus, + [ + dnl we need just the header, not the library, as we load the + dnl GDI+ DLL dynamically anyhow during run-time + AC_LANG_PUSH(C++) + AC_TRY_COMPILE( + [#include ], + [ + using namespace Gdiplus; + ], + wx_cv_lib_gdiplus=yes, + wx_cv_lib_gdiplus=no + ) + AC_LANG_POP() + ] + ) + if test "$wx_cv_lib_gdiplus" = "yes"; then + wx_has_graphics=1 + fi + elif test "$wxUSE_GTK" = 1; then + PKG_CHECK_MODULES(CAIRO, cairo, + [wx_has_graphics=1], + [AC_MSG_WARN([Cairo library not found])] + ) + else + dnl assume it's ok, add more checks here if needed + wx_has_graphics=1 + fi + + if test "$wx_has_graphics" = 1; then + AC_DEFINE(wxUSE_GRAPHICS_CONTEXT) + else + AC_MSG_WARN([wxGraphicsContext won't be available]) + fi fi dnl --------------------------------------------------------------------------- diff --git a/docs/changes.txt b/docs/changes.txt index 6ba84595a4..2c586993cb 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -480,6 +480,7 @@ All (GUI): where possible. - wxRTC: corrected centring and right-justification spacing. - Added wxBORDER_THEME to XRC. +- wxGraphicsContext is now enabled by default if supported by the platform. GTK: diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 7477eb865d..04353f0718 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -655,16 +655,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index b62f30c5c1..6487865fb1 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -239,6 +239,15 @@ Compiler-specific checks. */ +// Only MSVC 7+ has gdiplus.h, add exceptions for other compilers here if they +// can support it too (but notice that Borland currently dies in +// src/msw/gdiplus.cpp with "macro expansion too long" error even if the header +// is available) +#if !wxCHECK_VISUALC_VERSION(7) + #undef wxUSE_GRAPHICS_CONTEXT + #define wxUSE_GRAPHICS_CONTEXT 0 +#endif + // Borland #ifdef __BORLANDC__ @@ -254,10 +263,6 @@ # define wxUSE_DEBUG_NEW_ALWAYS 0 #endif -/* compiling src/msw/gdiplus.cpp results in "macro expansion too long" error */ -#undef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 - #endif /* __BORLANDC__ */ /* DMC++ doesn't have definitions for date picker control, so use generic control diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index a85d303489..97783379d8 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -655,28 +655,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// Enable the new wxCairoContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that you will need to link with Cairo for this to work. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_CAIRO -#define wxUSE_CAIRO 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index 13f4acc825..79c6855a1c 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -655,16 +655,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 549887c7d3..77c87b7770 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -655,16 +655,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index 425053ff3b..87a34d35f9 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -656,16 +656,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/include/wx/palmos/setup0.h b/include/wx/palmos/setup0.h index f5adf2d061..3d2bcaccb2 100644 --- a/include/wx/palmos/setup0.h +++ b/include/wx/palmos/setup0.h @@ -655,16 +655,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index ba5db68ad6..0cac75e3be 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -651,16 +651,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 7e154da1b1..2e7d33f3fa 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -654,16 +654,17 @@ // Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced // 2D drawing API. (Still somewhat experimental) // -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. +// Please note that on Windows gdiplus.dll is loaded dynamically which means +// that nothing special needs to be done as long as you don't use +// wxGraphicsContext at all or only use it on XP and later systems but you +// still do need to distribute it yourself for an application using +// wxGraphicsContext to be runnable on pre-XP systems. // -// Default is 0 +// Default is 1 if the compiler has gdiplus.h (currently only MSVC 7+ under +// Windows is known to). // // Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif +#define wxUSE_GRAPHICS_CONTEXT 1 // ---------------------------------------------------------------------------- // Individual GUI controls diff --git a/setup.h.in b/setup.h.in index f3bfe479ae..40a2cb30e2 100644 --- a/setup.h.in +++ b/setup.h.in @@ -322,9 +322,7 @@ #define wxUSE_STC 0 -#ifndef wxUSE_GRAPHICS_CONTEXT #define wxUSE_GRAPHICS_CONTEXT 0 -#endif #define wxUSE_CONTROLS 0