From b0fc907f70d0059216c8f447d6bb9f51a5de1571 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 11 Jul 2007 20:52:41 +0000 Subject: [PATCH] added wxUSE_SVG git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 99 +++++++++++++++++++++++++++++------- configure.in | 26 +++++----- include/wx/chkconf.h | 9 ++++ include/wx/dcsvg.h | 4 ++ include/wx/mac/setup0.h | 6 ++- include/wx/motif/setup0.h | 6 ++- include/wx/msw/setup0.h | 6 ++- include/wx/msw/wince/setup.h | 6 ++- include/wx/os2/setup0.h | 6 ++- include/wx/palmos/setup0.h | 6 ++- include/wx/setup_inc.h | 6 ++- setup.h.in | 2 + src/common/dcsvg.cpp | 4 ++ 13 files changed, 147 insertions(+), 39 deletions(-) diff --git a/configure b/configure index de7e55e4b3..f76cd18461 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 47339 2007-07-11 20:03:11Z VZ . +# From configure.in Id: configure.in 47340 2007-07-11 20:11:37Z VZ . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wxWidgets 2.9.0. # @@ -1050,6 +1050,7 @@ 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-svg use wxSVGFileDC device context --enable-clipboard use wxClipboard class --enable-dnd use Drag'n'Drop classes --enable-metafile use win32 metafiles @@ -9148,6 +9149,61 @@ 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}-svg" >&5 +echo $ECHO_N "checking for --${enablestring:-enable}-svg... $ECHO_C" >&6 + no_cache=0 + # Check whether --enable-svg or --disable-svg was given. +if test "${enable_svg+set}" = set; then + enableval="$enable_svg" + + if test "$enableval" = yes; then + ac_cv_use_svg='wxUSE_SVG=yes' + else + ac_cv_use_svg='wxUSE_SVG=no' + fi + +else + + LINE=`grep "^wxUSE_SVG=" ${wx_arg_cache_file}` + if test "x$LINE" != x ; then + eval "DEFAULT_$LINE" + else + no_cache=1 + fi + + ac_cv_use_svg='wxUSE_SVG=${'DEFAULT_wxUSE_SVG":-$defaultval}" + +fi; + + eval "$ac_cv_use_svg" + if test "$no_cache" != 1; then + echo $ac_cv_use_svg >> ${wx_arg_cache_file}.tmp + fi + + if test x"$enablestring" = xdisable; then + if test $wxUSE_SVG = yes; then + result=no + else + result=yes + fi + else + result=$wxUSE_SVG + fi + + echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6 + + enablestring= @@ -46514,24 +46570,6 @@ _ACEOF fi -if test "$wxUSE_POSTSCRIPT" = "yes" ; then - cat >>confdefs.h <<\_ACEOF -#define wxUSE_POSTSCRIPT 1 -_ACEOF - -fi - -cat >>confdefs.h <<\_ACEOF -#define wxUSE_AFM_FOR_POSTSCRIPT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define wxUSE_NORMALIZED_PS_FONTS 1 -_ACEOF - - - if test "$wxUSE_CONSTRAINTS" = "yes"; then cat >>confdefs.h <<\_ACEOF #define wxUSE_CONSTRAINTS 1 @@ -46609,6 +46647,29 @@ _ACEOF SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing" fi +if test "$wxUSE_POSTSCRIPT" = "yes" ; then + cat >>confdefs.h <<\_ACEOF +#define wxUSE_POSTSCRIPT 1 +_ACEOF + +fi + +cat >>confdefs.h <<\_ACEOF +#define wxUSE_AFM_FOR_POSTSCRIPT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define wxUSE_NORMALIZED_PS_FONTS 1 +_ACEOF + + +if test "$wxUSE_SVG" = "yes"; then + cat >>confdefs.h <<\_ACEOF +#define wxUSE_SVG 1 +_ACEOF + +fi if test "$wxUSE_METAFILE" = "yes"; then diff --git a/configure.in b/configure.in index 8324825f9f..72e62b0e7d 100644 --- a/configure.in +++ b/configure.in @@ -632,8 +632,9 @@ WX_ARG_FEATURE(logwin, [ --enable-logwin use wxLogWindow], wxUSE_L WX_ARG_FEATURE(logdialog, [ --enable-logdialog use wxLogDialog], wxUSE_LOGDIALOG) 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(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(svg, [ --enable-svg use wxSVGFileDC device context], wxUSE_SVG) dnl --------------------------------------------------------------------------- dnl IPC &c @@ -6169,18 +6170,6 @@ if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF) fi -dnl ---------------------------------------------------------------- -dnl Register PostScript options for makefiles and setup.h -dnl ---------------------------------------------------------------- - -if test "$wxUSE_POSTSCRIPT" = "yes" ; then - AC_DEFINE(wxUSE_POSTSCRIPT) -fi - -AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT) - -AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS) - dnl --------------------------------------------------------------------------- dnl big GUI components: MDI, doc/view, printing, help, ... dnl --------------------------------------------------------------------------- @@ -6236,6 +6225,17 @@ if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing" fi +if test "$wxUSE_POSTSCRIPT" = "yes" ; then + AC_DEFINE(wxUSE_POSTSCRIPT) +fi + +AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT) + +AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS) + +if test "$wxUSE_SVG" = "yes"; then + AC_DEFINE(wxUSE_SVG) +fi dnl --------------------------------------------------------------------------- dnl wxMetafile availability diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 5f6604c5b2..f05ad703d2 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -1812,6 +1812,15 @@ # endif #endif /* wxUSE_SOCKETS */ +#if wxUSE_SVG && !wxUSE_STREAMS +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_SVG requires wxUSE_STREAMS" +# else +# undef wxUSE_SVG +# define wxUSE_SVG 0 +# endif +#endif /* wxUSE_SVG */ + #if !wxUSE_VARIANT # if wxUSE_DATAVIEWCTRL # ifdef wxABORT_ON_CONFIG_ERROR diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 92acc4cdd6..9c0a34e604 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -15,6 +15,8 @@ #include "wx/string.h" #include "wx/dc.h" +#if wxUSE_SVG + #define wxSVGVersion wxT("v0100") #ifdef __BORLANDC__ @@ -191,4 +193,6 @@ private: DECLARE_ABSTRACT_CLASS(wxSVGFileDC) }; +#endif // wxUSE_SVG + #endif // _WX_DCSVG_H_ diff --git a/include/wx/mac/setup0.h b/include/wx/mac/setup0.h index fa3a177a4e..3da7d93d0e 100644 --- a/include/wx/mac/setup0.h +++ b/include/wx/mac/setup0.h @@ -1099,7 +1099,7 @@ // Include mouse wheel support // ---------------------------------------------------------------------------- -// postscript support settings +// wxDC classes for various output formats // ---------------------------------------------------------------------------- // Set to 1 for PostScript device context. @@ -1108,6 +1108,10 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 1 +// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows +// to create fiels in SVG (Scalable Vector Graphics) format. +#define wxUSE_SVG 1 + // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 2707f26315..20494c37cf 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -1098,7 +1098,7 @@ // Include mouse wheel support // ---------------------------------------------------------------------------- -// postscript support settings +// wxDC classes for various output formats // ---------------------------------------------------------------------------- // Set to 1 for PostScript device context. @@ -1107,6 +1107,10 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 1 +// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows +// to create fiels in SVG (Scalable Vector Graphics) format. +#define wxUSE_SVG 1 + // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 58c1bec4a2..60ddea641c 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -1098,7 +1098,7 @@ // Include mouse wheel support // ---------------------------------------------------------------------------- -// postscript support settings +// wxDC classes for various output formats // ---------------------------------------------------------------------------- // Set to 1 for PostScript device context. @@ -1107,6 +1107,10 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 1 +// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows +// to create fiels in SVG (Scalable Vector Graphics) format. +#define wxUSE_SVG 1 + // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index 8fa216d987..f6ae98ad95 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -1098,7 +1098,7 @@ // Include mouse wheel support // ---------------------------------------------------------------------------- -// postscript support settings +// wxDC classes for various output formats // ---------------------------------------------------------------------------- // Set to 1 for PostScript device context. @@ -1107,6 +1107,10 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 1 +// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows +// to create fiels in SVG (Scalable Vector Graphics) format. +#define wxUSE_SVG 1 + // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 5a699fdb6d..99492845f3 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -1098,7 +1098,7 @@ // Include mouse wheel support // ---------------------------------------------------------------------------- -// postscript support settings +// wxDC classes for various output formats // ---------------------------------------------------------------------------- // Set to 1 for PostScript device context. @@ -1107,6 +1107,10 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 1 +// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows +// to create fiels in SVG (Scalable Vector Graphics) format. +#define wxUSE_SVG 1 + // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- diff --git a/include/wx/palmos/setup0.h b/include/wx/palmos/setup0.h index 060ac79131..743f52daf1 100644 --- a/include/wx/palmos/setup0.h +++ b/include/wx/palmos/setup0.h @@ -1098,7 +1098,7 @@ // Include mouse wheel support // ---------------------------------------------------------------------------- -// postscript support settings +// wxDC classes for various output formats // ---------------------------------------------------------------------------- // Set to 1 for PostScript device context. @@ -1107,6 +1107,10 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 1 +// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows +// to create fiels in SVG (Scalable Vector Graphics) format. +#define wxUSE_SVG 1 + // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index e469c8dd27..2caa6b0108 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -1094,7 +1094,7 @@ // Include mouse wheel support // ---------------------------------------------------------------------------- -// postscript support settings +// wxDC classes for various output formats // ---------------------------------------------------------------------------- // Set to 1 for PostScript device context. @@ -1103,6 +1103,10 @@ // Set to 1 to use font metric files in GetTextExtent #define wxUSE_AFM_FOR_POSTSCRIPT 1 +// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows +// to create fiels in SVG (Scalable Vector Graphics) format. +#define wxUSE_SVG 1 + // ---------------------------------------------------------------------------- // database classes // ---------------------------------------------------------------------------- diff --git a/setup.h.in b/setup.h.in index dc1e752296..7cee7c7915 100644 --- a/setup.h.in +++ b/setup.h.in @@ -493,6 +493,8 @@ #define wxUSE_AFM_FOR_POSTSCRIPT 0 +#define wxUSE_SVG 0 + #define wxUSE_ODBC 0 diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index ab2302cf7f..ad0f6426cc 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -15,6 +15,8 @@ #pragma hdrstop #endif +#if wxUSE_SVG + #ifndef WX_PRECOMP #include "wx/image.h" #endif @@ -712,3 +714,5 @@ void wxSVGFileDC::SetDeviceOrigin(wxCoord x, wxCoord y) #pragma warn .ccc #endif +#endif // wxUSE_SVG + -- 2.47.2