Add wxUSE_ARTPROVIDER_STD build option.

Make it possible to exclude wxDefaultArtProvider from build. Now that a
Tango-based provider exists, it may make sense to disable the standard bitmaps
if the program doesn't need the few of them not provided by Tango anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-12-31 17:39:37 +00:00
parent c1d2466a79
commit 2e9b5717cd
16 changed files with 195 additions and 8 deletions

52
configure vendored
View File

@@ -1806,6 +1806,7 @@ Optional Features:
--disable-controls disable compilation of all standard controls --disable-controls disable compilation of all standard controls
--enable-accel use accelerators --enable-accel use accelerators
--enable-animatectrl use wxAnimationCtrl class --enable-animatectrl use wxAnimationCtrl class
--enable-artstd use standard XPM icons in wxArtProvider
--enable-arttango use Tango icons in wxArtProvider --enable-arttango use Tango icons in wxArtProvider
--enable-bmpbutton use wxBitmapButton class --enable-bmpbutton use wxBitmapButton class
--enable-bmpcombobox use wxBitmapComboBox class --enable-bmpcombobox use wxBitmapComboBox class
@@ -9899,6 +9900,50 @@ fi
echo "${ECHO_T}$result" >&6; } 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}-artstd" >&5
echo $ECHO_N "checking for --${enablestring:-enable}-artstd... $ECHO_C" >&6; }
# Check whether --enable-artstd was given.
if test "${enable_artstd+set}" = set; then
enableval=$enable_artstd;
if test "$enableval" = yes; then
wx_cv_use_artstd='wxUSE_ARTPROVIDER_STD=yes'
else
wx_cv_use_artstd='wxUSE_ARTPROVIDER_STD=no'
fi
else
wx_cv_use_artstd='wxUSE_ARTPROVIDER_STD=${'DEFAULT_wxUSE_ARTPROVIDER_STD":-$defaultval}"
fi
eval "$wx_cv_use_artstd"
if test x"$enablestring" = xdisable; then
if test $wxUSE_ARTPROVIDER_STD = no; then
result=yes
else
result=no
fi
else
result=$wxUSE_ARTPROVIDER_STD
fi
{ echo "$as_me:$LINENO: result: $result" >&5
echo "${ECHO_T}$result" >&6; }
enablestring= enablestring=
defaultval=$wxUSE_ALL_FEATURES defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then if test -z "$defaultval"; then
@@ -47575,6 +47620,13 @@ _ACEOF
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access" SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access"
fi fi
if test "$wxUSE_ARTPROVIDER_STD" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define wxUSE_ARTPROVIDER_STD 1
_ACEOF
fi
if test "$wxUSE_ARTPROVIDER_TANGO" = "auto"; then if test "$wxUSE_ARTPROVIDER_TANGO" = "auto"; then
if test "$wxUSE_GTK" != 1; then if test "$wxUSE_GTK" != 1; then
if test "$wxUSE_LIBPNG" != no -a \ if test "$wxUSE_LIBPNG" != no -a \

View File

@@ -928,6 +928,7 @@ fi
dnl please keep the settings below in alphabetical order dnl please keep the settings below in alphabetical order
WX_ARG_FEATURE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL) WX_ARG_FEATURE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL)
WX_ARG_FEATURE(animatectrl, [ --enable-animatectrl use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL) WX_ARG_FEATURE(animatectrl, [ --enable-animatectrl use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL)
WX_ARG_FEATURE(artstd, [ --enable-artstd use standard XPM icons in wxArtProvider], wxUSE_ARTPROVIDER_STD)
WX_ARG_FEATURE(arttango, [ --enable-arttango use Tango icons in wxArtProvider], wxUSE_ARTPROVIDER_TANGO) WX_ARG_FEATURE(arttango, [ --enable-arttango use Tango icons in wxArtProvider], wxUSE_ARTPROVIDER_TANGO)
WX_ARG_FEATURE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON) WX_ARG_FEATURE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON)
WX_ARG_FEATURE(bmpcombobox, [ --enable-bmpcombobox use wxBitmapComboBox class], wxUSE_BITMAPCOMBOBOX) WX_ARG_FEATURE(bmpcombobox, [ --enable-bmpcombobox use wxBitmapComboBox class], wxUSE_BITMAPCOMBOBOX)
@@ -7147,6 +7148,10 @@ if test "$wxUSE_ACCESSIBILITY" = "yes"; then
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access" SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access"
fi fi
if test "$wxUSE_ARTPROVIDER_STD" = "yes"; then
AC_DEFINE(wxUSE_ARTPROVIDER_STD)
fi
if test "$wxUSE_ARTPROVIDER_TANGO" = "auto"; then if test "$wxUSE_ARTPROVIDER_TANGO" = "auto"; then
dnl Tango-based art provider is not needed in GTK-based ports as the dnl Tango-based art provider is not needed in GTK-based ports as the
dnl native art provider completely replaces it. dnl native art provider completely replaces it.

View File

@@ -67,6 +67,7 @@ library:
@itemdef{wxUSE_ACCEL, Use wxAcceleratorTable/Entry classes and support for them in wxMenu, wxMenuBar.} @itemdef{wxUSE_ACCEL, Use wxAcceleratorTable/Entry classes and support for them in wxMenu, wxMenuBar.}
@itemdef{wxUSE_AFM_FOR_POSTSCRIPT, In wxPostScriptDC class use AFM (adobe font metrics) file for character widths.} @itemdef{wxUSE_AFM_FOR_POSTSCRIPT, In wxPostScriptDC class use AFM (adobe font metrics) file for character widths.}
@itemdef{wxUSE_ANIMATIONCTRL, Use wxAnimationCtrl class.} @itemdef{wxUSE_ANIMATIONCTRL, Use wxAnimationCtrl class.}
@itemdef{wxUSE_ARTPROVIDER_STD, Use standard low quality icons in wxArtProvider.}
@itemdef{wxUSE_ARTPROVIDER_TANGO, Use Tango icons in wxArtProvider.} @itemdef{wxUSE_ARTPROVIDER_TANGO, Use Tango icons in wxArtProvider.}
@itemdef{wxUSE_ANY, Use wxAny class.} @itemdef{wxUSE_ANY, Use wxAny class.}
@itemdef{wxUSE_APPLE_IEEE, IEEE Extended to/from double routines; see src/common/extended.c file.} @itemdef{wxUSE_APPLE_IEEE, IEEE Extended to/from double routines; see src/common/extended.c file.}

View File

@@ -201,8 +201,10 @@ public:
protected: protected:
friend class wxArtProviderModule; friend class wxArtProviderModule;
#if wxUSE_ARTPROVIDER_STD
// Initializes default provider // Initializes default provider
static void InitStdProvider(); static void InitStdProvider();
#endif // wxUSE_ARTPROVIDER_STD
// Initializes Tango-based icon provider // Initializes Tango-based icon provider
#if wxUSE_ARTPROVIDER_TANGO #if wxUSE_ARTPROVIDER_TANGO
static void InitTangoProvider(); static void InitTangoProvider();

View File

@@ -407,6 +407,14 @@
# endif # endif
#endif /* !defined(wxUSE_ANIMATIONCTRL) */ #endif /* !defined(wxUSE_ANIMATIONCTRL) */
#ifndef wxUSE_ARTPROVIDER_STD
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_ARTPROVIDER_STD must be defined, please read comment near the top of this file."
# else
# define wxUSE_ARTPROVIDER_STD 0
# endif
#endif /* !defined(wxUSE_ARTPROVIDER_STD) */
#ifndef wxUSE_ARTPROVIDER_TANGO #ifndef wxUSE_ARTPROVIDER_TANGO
# ifdef wxABORT_ON_CONFIG_ERROR # ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_ARTPROVIDER_TANGO must be defined, please read comment near the top of this file." # error "wxUSE_ARTPROVIDER_TANGO must be defined, please read comment near the top of this file."

View File

@@ -912,11 +912,25 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.
// //
// Default is 1. // Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
// //
// Recommended setting: 1 but can be turned off to reduce the library size. // Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1 #define wxUSE_ARTPROVIDER_TANGO 1

View File

@@ -912,11 +912,25 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.
// //
// Default is 1. // Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
// //
// Recommended setting: 1 but can be turned off to reduce the library size. // Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1 #define wxUSE_ARTPROVIDER_TANGO 1

View File

@@ -912,11 +912,25 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.
// //
// Default is 1. // Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
// //
// Recommended setting: 1 but can be turned off to reduce the library size. // Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1 #define wxUSE_ARTPROVIDER_TANGO 1

View File

@@ -912,11 +912,25 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.
// //
// Default is 1. // Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
// //
// Recommended setting: 1 but can be turned off to reduce the library size. // Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1 #define wxUSE_ARTPROVIDER_TANGO 1

View File

@@ -913,11 +913,25 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.
// //
// Default is 1. // Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
// //
// Recommended setting: 1 but can be turned off to reduce the library size. // Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1 #define wxUSE_ARTPROVIDER_TANGO 1
@@ -1133,7 +1147,7 @@
// //
// Recommended setting: default or 0 for everything for portable programs. // Recommended setting: default or 0 for everything for portable programs.
#define wxUSE_METAFILE 1 #define wxUSE_METAFILE 1
#define wxUSE_ENH_METAFILE 0 #define wxUSE_ENH_METAFILE 1
#define wxUSE_WIN_METAFILES_ALWAYS 0 #define wxUSE_WIN_METAFILES_ALWAYS 0
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -912,11 +912,25 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.
// //
// Default is 1. // Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
// //
// Recommended setting: 1 but can be turned off to reduce the library size. // Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1 #define wxUSE_ARTPROVIDER_TANGO 1

View File

@@ -908,6 +908,19 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.

View File

@@ -911,11 +911,25 @@
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) // wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1 #define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality // Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without // icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size. // transparency but the embedded PNG icons add to the library size.
// //
// Default is 1. // Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
// //
// Recommended setting: 1 but can be turned off to reduce the library size. // Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1 #define wxUSE_ARTPROVIDER_TANGO 1

View File

@@ -426,6 +426,8 @@
#define wxUSE_ACCEL 0 #define wxUSE_ACCEL 0
#define wxUSE_ARTPROVIDER_STD 0
#define wxUSE_ARTPROVIDER_TANGO 0 #define wxUSE_ARTPROVIDER_TANGO 0
#define wxUSE_HOTKEY 0 #define wxUSE_HOTKEY 0

View File

@@ -440,7 +440,9 @@ class wxArtProviderModule: public wxModule
public: public:
bool OnInit() bool OnInit()
{ {
#if wxUSE_ARTPROVIDER_STD
wxArtProvider::InitStdProvider(); wxArtProvider::InitStdProvider();
#endif // wxUSE_ARTPROVIDER_STD
#if wxUSE_ARTPROVIDER_TANGO #if wxUSE_ARTPROVIDER_TANGO
wxArtProvider::InitTangoProvider(); wxArtProvider::InitTangoProvider();
#endif // wxUSE_ARTPROVIDER_TANGO #endif // wxUSE_ARTPROVIDER_TANGO

View File

@@ -20,6 +20,8 @@
#pragma hdrstop #pragma hdrstop
#endif #endif
#if wxUSE_ARTPROVIDER_STD
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/image.h" #include "wx/image.h"
#endif #endif
@@ -246,3 +248,5 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
return bmp; return bmp;
} }
#endif // wxUSE_ARTPROVIDER_STD