Compile with wxUSE_DYNLIB_CLASS and wxUSE_WXDIB set to 0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -238,4 +238,23 @@
|
||||
# endif
|
||||
#endif /* wxUSE_DYNAMIC_LOADER */
|
||||
|
||||
#if !wxUSE_DYNLIB_CLASS
|
||||
# if wxUSE_UXTHEME
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_UXTHEME requires wxUSE_DYNLIB_CLASS"
|
||||
# else
|
||||
# undef wxUSE_UXTHEME
|
||||
# define wxUSE_UXTHEME 0
|
||||
# endif
|
||||
# endif
|
||||
# if wxUSE_MEDIACTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_MEDIACTRL requires wxUSE_DYNLIB_CLASS"
|
||||
# else
|
||||
# undef wxUSE_MEDIACTRL
|
||||
# define wxUSE_MEDIACTRL 0
|
||||
# endif
|
||||
# endif
|
||||
#endif /* wxUSE_DYNLIB_CLASS */
|
||||
|
||||
#endif /* _WX_MSW_CHKCONF_H_ */
|
||||
|
@@ -165,7 +165,7 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL;
|
||||
bmp = node->GetData()->CreateBitmap(id, client, size);
|
||||
if ( bmp.Ok() )
|
||||
{
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
if ( size != wxDefaultSize &&
|
||||
(bmp.GetWidth() != size.x || bmp.GetHeight() != size.y) )
|
||||
{
|
||||
|
@@ -223,7 +223,7 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
|
||||
{
|
||||
wxBitmap bmp = wxDefaultArtProvider_CreateBitmap(id);
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
if (bmp.Ok())
|
||||
{
|
||||
// fit into transparent image with desired size hint from the client
|
||||
|
@@ -227,8 +227,10 @@ wxMemoryFSHandler::AddFile(const wxString& filename,
|
||||
const wxBitmap& bitmap,
|
||||
long type)
|
||||
{
|
||||
#if !defined(__WXMSW__) || wxUSE_WXDIB
|
||||
wxImage img = bitmap.ConvertToImage();
|
||||
AddFile(filename, img, type);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // wxUSE_IMAGE
|
||||
|
@@ -56,7 +56,7 @@ void wxIconBundle::AddIcon( const wxString& file, long type )
|
||||
void wxIconBundle::AddIcon( const wxString& WXUNUSED(file), long WXUNUSED(type) )
|
||||
#endif
|
||||
{
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
size_t count = wxImage::GetImageCount( file, type );
|
||||
size_t i;
|
||||
wxImage image;
|
||||
|
@@ -100,6 +100,7 @@ static bool DoRegionUnion(wxRegion& region,
|
||||
|
||||
bool wxRegion::Union(const wxBitmap& bmp)
|
||||
{
|
||||
#if (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
if (bmp.GetMask())
|
||||
{
|
||||
wxImage image = bmp.ConvertToImage();
|
||||
@@ -111,6 +112,7 @@ bool wxRegion::Union(const wxBitmap& bmp)
|
||||
0);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return Union(0, 0, bmp.GetWidth(), bmp.GetHeight());
|
||||
}
|
||||
@@ -120,12 +122,16 @@ bool wxRegion::Union(const wxBitmap& bmp,
|
||||
const wxColour& transColour,
|
||||
int tolerance)
|
||||
{
|
||||
#if (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
wxImage image = bmp.ConvertToImage();
|
||||
return DoRegionUnion(*this, image,
|
||||
transColour.Red(),
|
||||
transColour.Green(),
|
||||
transColour.Blue(),
|
||||
tolerance);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
@@ -1483,7 +1483,7 @@ wxImageList *wxFileIconsTable::GetSmallImageList()
|
||||
return m_smallImageList;
|
||||
}
|
||||
|
||||
#if wxUSE_MIMETYPE && wxUSE_IMAGE
|
||||
#if wxUSE_MIMETYPE && wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
// VS: we don't need this function w/o wxMimeTypesManager because we'll only have
|
||||
// one icon and we won't resize it
|
||||
|
||||
@@ -1643,7 +1643,7 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime)
|
||||
{
|
||||
m_smallImageList->Add(bmp);
|
||||
}
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
else
|
||||
{
|
||||
wxImage img = bmp.ConvertToImage();
|
||||
|
@@ -154,7 +154,7 @@ bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor)
|
||||
|
||||
dc2.SelectObject(wxNullBitmap);
|
||||
|
||||
#if wxUSE_IMAGE_IN_DRAGIMAGE
|
||||
#if wxUSE_IMAGE_IN_DRAGIMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
// Make the bitmap masked
|
||||
wxImage image = bitmap.ConvertToImage();
|
||||
image.SetMaskColour(255, 255, 255);
|
||||
|
@@ -446,6 +446,7 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
|
||||
|
||||
void wxHtmlImageCell::SetImage(const wxImage& img)
|
||||
{
|
||||
#if !defined(__WXMSW__) || wxUSE_WXDIB
|
||||
if ( img.Ok() )
|
||||
{
|
||||
delete m_bitmap;
|
||||
@@ -471,6 +472,7 @@ void wxHtmlImageCell::SetImage(const wxImage& img)
|
||||
*/
|
||||
m_bitmap = new wxBitmap(img);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if wxUSE_GIF && wxUSE_TIMER
|
||||
@@ -497,6 +499,7 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer)
|
||||
if ( m_window->GetClientRect().Intersects(rect) &&
|
||||
m_gifDecoder->ConvertToImage(&img) )
|
||||
{
|
||||
#if !defined(__WXMSW__) || wxUSE_WXDIB
|
||||
if ( (int)m_gifDecoder->GetWidth() != m_Width ||
|
||||
(int)m_gifDecoder->GetHeight() != m_Height ||
|
||||
m_gifDecoder->GetLeft() != 0 || m_gifDecoder->GetTop() != 0 )
|
||||
@@ -508,6 +511,7 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer)
|
||||
true /* use mask */);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
SetImage(img);
|
||||
m_window->Refresh(img.HasMask(), &rect);
|
||||
}
|
||||
|
@@ -341,9 +341,11 @@ TAG_HANDLER_BEGIN(BODY, "BODY")
|
||||
wxInputStream *is = fileBgImage->GetStream();
|
||||
if ( is )
|
||||
{
|
||||
#if !defined(__WXMSW__) || wxUSE_WXDIB
|
||||
wxImage image(*is);
|
||||
if ( image.Ok() )
|
||||
m_WParser->GetWindow()->SetBackgroundImage(image);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -589,6 +589,7 @@ int wxApp::GetComCtl32Version()
|
||||
// we're prepared to handle the errors
|
||||
wxLogNull noLog;
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
// do we have it?
|
||||
wxDynamicLibrary dllComCtl32(_T("comctl32.dll"), wxDL_VERBATIM);
|
||||
|
||||
@@ -646,6 +647,7 @@ int wxApp::GetComCtl32Version()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return s_verComCtl32;
|
||||
|
@@ -483,7 +483,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
|
||||
// Create from XPM data
|
||||
bool wxBitmap::CreateFromXpm(const char **data)
|
||||
{
|
||||
#if wxUSE_IMAGE && wxUSE_XPM
|
||||
#if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB
|
||||
Init();
|
||||
|
||||
wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") )
|
||||
@@ -1011,7 +1011,7 @@ bool wxBitmap::LoadFile(const wxString& filename, long type)
|
||||
|
||||
return handler->LoadFile(this, filename, type, -1, -1);
|
||||
}
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE && wxUSE_WXDIB
|
||||
else // no bitmap handler found
|
||||
{
|
||||
wxImage image;
|
||||
@@ -1055,7 +1055,7 @@ bool wxBitmap::SaveFile(const wxString& filename,
|
||||
{
|
||||
return handler->SaveFile(this, filename, type, palette);
|
||||
}
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE && wxUSE_WXDIB
|
||||
else // no bitmap handler found
|
||||
{
|
||||
// FIXME what about palette? shouldn't we use it?
|
||||
|
@@ -209,11 +209,15 @@ wxCursor::wxCursor(const wxImage& image)
|
||||
HCURSOR hcursor = wxBitmapToHCURSOR( wxBitmap(imageSized),
|
||||
hotSpotX, hotSpotY );
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
if ( !hcursor )
|
||||
{
|
||||
wxLogWarning(_("Failed to create cursor."));
|
||||
return;
|
||||
}
|
||||
#else
|
||||
HCURSOR hcursor = 0;
|
||||
#endif
|
||||
|
||||
m_refData = new wxCursorRefData(hcursor, true /* delete it later */);
|
||||
}
|
||||
|
@@ -111,6 +111,7 @@ wxDatePickerCtrl::Create(wxWindow *parent,
|
||||
return false;
|
||||
}
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
INITCOMMONCONTROLSEX icex;
|
||||
icex.dwSize = sizeof(icex);
|
||||
icex.dwICC = ICC_DATE_CLASSES;
|
||||
@@ -126,6 +127,7 @@ wxDatePickerCtrl::Create(wxWindow *parent,
|
||||
}
|
||||
|
||||
s_initDone = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "wx/msw/debughlp.h"
|
||||
|
||||
#if wxUSE_DBGHELP
|
||||
#if wxUSE_DBGHELP && wxUSE_DYNLIB_CLASS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
|
@@ -236,10 +236,14 @@ bool wxDragImage::Create(const wxString& str, const wxCursor& cursor)
|
||||
|
||||
dc2.SelectObject(wxNullBitmap);
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
// Make the bitmap masked
|
||||
wxImage image = bitmap.ConvertToImage();
|
||||
image.SetMaskColour(255, 255, 255);
|
||||
return Create(wxBitmap(image), cursor);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
|
@@ -290,6 +290,7 @@ bool wxImageList::Draw(int index,
|
||||
// Get the bitmap
|
||||
wxBitmap wxImageList::GetBitmap(int index) const
|
||||
{
|
||||
#if wxUSE_WXDIB
|
||||
int bmp_width = 0, bmp_height = 0;
|
||||
GetSize(index, bmp_width, bmp_height);
|
||||
|
||||
@@ -320,8 +321,10 @@ wxBitmap wxImageList::GetBitmap(int index) const
|
||||
image = bitmap.ConvertToImage();
|
||||
image.SetMaskColour(r, g, b);
|
||||
bitmap = wxBitmap(image);
|
||||
|
||||
#else
|
||||
wxBitmap bitmap;
|
||||
return bitmap;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Get the icon
|
||||
|
@@ -844,7 +844,11 @@ void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
memdc.SelectObject(bmp);
|
||||
|
||||
// if there is no special brush just use the solid background colour
|
||||
#if wxUSE_UXTHEME
|
||||
HBRUSH hbr = (HBRUSH)m_hbrBackground;
|
||||
#else
|
||||
HBRUSH hbr = 0;
|
||||
#endif
|
||||
wxBrush brush;
|
||||
if ( !hbr )
|
||||
{
|
||||
|
@@ -106,6 +106,8 @@ static ShellFunctions gs_shellFuncs;
|
||||
|
||||
static void ResolveShellFunctions()
|
||||
{
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
|
||||
// start with the newest functions, fall back to the oldest ones
|
||||
#ifdef __WXWINCE__
|
||||
wxString shellDllName(_T("coredll"));
|
||||
@@ -153,6 +155,7 @@ static void ResolveShellFunctions()
|
||||
// because we also link to it statically, so it's ok
|
||||
|
||||
gs_shellFuncs.initialized = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@@ -656,7 +656,7 @@ bool wxToolBar::Realize()
|
||||
if ( m_disabledImgList )
|
||||
{
|
||||
wxBitmap bmpDisabled = tool->GetDisabledBitmap();
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE && wxUSE_WXDIB
|
||||
if ( !bmpDisabled.Ok() )
|
||||
{
|
||||
// no disabled bitmap specified but we still need to
|
||||
|
@@ -49,7 +49,9 @@
|
||||
// Dynamic library function defs.
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
static wxDynamicLibrary s_mprLib;
|
||||
#endif
|
||||
|
||||
typedef DWORD (WINAPI* WNetOpenEnumPtr)(DWORD, DWORD, DWORD, LPNETRESOURCE, LPHANDLE);
|
||||
typedef DWORD (WINAPI* WNetEnumResourcePtr)(HANDLE, LPDWORD, LPVOID, LPDWORD);
|
||||
@@ -378,6 +380,7 @@ wxArrayString wxFSVolumeBase::GetVolumes(int flagsSet, int flagsUnset)
|
||||
{
|
||||
::InterlockedExchange(&s_cancelSearch, FALSE); // reset
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
if (!s_mprLib.IsLoaded() && s_mprLib.Load(_T("mpr.dll")))
|
||||
{
|
||||
#ifdef UNICODE
|
||||
@@ -389,6 +392,7 @@ wxArrayString wxFSVolumeBase::GetVolumes(int flagsSet, int flagsUnset)
|
||||
#endif
|
||||
s_pWNetCloseEnum = (WNetCloseEnumPtr)s_mprLib.GetSymbol(_T("WNetCloseEnum"));
|
||||
}
|
||||
#endif
|
||||
|
||||
wxArrayString list;
|
||||
|
||||
|
@@ -1091,8 +1091,11 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param,
|
||||
return wxNullBitmap;
|
||||
}
|
||||
if (!(size == wxDefaultSize)) img.Rescale(size.x, size.y);
|
||||
#if !defined(__WXMSW__) || wxUSE_WXDIB
|
||||
return wxBitmap(img);
|
||||
|
||||
#else
|
||||
return wxBitmap();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user