From 64c288fa47480385ad656ae3249b5b131340c1d6 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 21 Jan 2006 16:47:30 +0000 Subject: [PATCH] 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 --- include/wx/msw/chkconf.h | 19 +++++++++++++++++++ src/common/artprov.cpp | 2 +- src/common/artstd.cpp | 2 +- src/common/fs_mem.cpp | 2 ++ src/common/iconbndl.cpp | 2 +- src/common/rgncmn.cpp | 6 ++++++ src/generic/dirctrlg.cpp | 4 ++-- src/generic/dragimgg.cpp | 2 +- src/html/m_image.cpp | 4 ++++ src/html/m_layout.cpp | 2 ++ src/msw/app.cpp | 4 +++- src/msw/bitmap.cpp | 6 +++--- src/msw/cursor.cpp | 4 ++++ src/msw/datectrl.cpp | 2 ++ src/msw/debughlp.cpp | 2 +- src/msw/dragimag.cpp | 4 ++++ src/msw/imaglist.cpp | 5 ++++- src/msw/notebook.cpp | 4 ++++ src/msw/stdpaths.cpp | 3 +++ src/msw/tbar95.cpp | 2 +- src/msw/volume.cpp | 4 ++++ src/xrc/xmlres.cpp | 5 ++++- 22 files changed, 76 insertions(+), 14 deletions(-) diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index 3019e028ee..a9dc1a6d00 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -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_ */ diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index d7497a45ff..2e8a1df31c 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -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) ) { diff --git a/src/common/artstd.cpp b/src/common/artstd.cpp index 0eda93afd3..35f10467b9 100644 --- a/src/common/artstd.cpp +++ b/src/common/artstd.cpp @@ -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 diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index 5c983a1def..7475dfd1e9 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -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 diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index aeeb09fef8..40ff56d9ed 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -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; diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp index 13bcd6e184..b06227cc24 100644 --- a/src/common/rgncmn.cpp +++ b/src/common/rgncmn.cpp @@ -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 diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 11e112db2a..241acd6eb3 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -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(); diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index c931955788..00433a6df6 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -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); diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 595ba007b6..9574b94d41 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -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); } diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index 91b88f6190..d9d76f6f6f 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -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 } } } diff --git a/src/msw/app.cpp b/src/msw/app.cpp index c56de63bc9..f41554eb46 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -588,7 +588,8 @@ 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; diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index e4cbfdc9bc..4477a07b19 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -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? diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 395909699d..3a6a3e9e80 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -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 */); } diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index c0d3396ddc..ec84f53d88 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -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 } diff --git a/src/msw/debughlp.cpp b/src/msw/debughlp.cpp index 0f72ce897c..726900c638 100644 --- a/src/msw/debughlp.cpp +++ b/src/msw/debughlp.cpp @@ -25,7 +25,7 @@ #include "wx/msw/debughlp.h" -#if wxUSE_DBGHELP +#if wxUSE_DBGHELP && wxUSE_DYNLIB_CLASS // ---------------------------------------------------------------------------- // constants diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index 24e30dcc89..761c33e6a0 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -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 diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index 7fab0d3724..e8188e82ba 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -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 diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 53046b87da..8405625fcc 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -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 ) { diff --git a/src/msw/stdpaths.cpp b/src/msw/stdpaths.cpp index f41673b352..3b815eac7b 100644 --- a/src/msw/stdpaths.cpp +++ b/src/msw/stdpaths.cpp @@ -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 } // ============================================================================ diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 1b69f1db05..04141cf01f 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -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 diff --git a/src/msw/volume.cpp b/src/msw/volume.cpp index c9e25c22d6..5da2655208 100644 --- a/src/msw/volume.cpp +++ b/src/msw/volume.cpp @@ -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; diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 5c632e1138..ac70cff460 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -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 } -- 2.45.2