From 7fc0bd1c0541a819d51354a4a86f126dbb8ad08f Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 4 Jan 2002 17:36:18 +0000 Subject: [PATCH] Fixes for GNUPro 00r1 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dirdlg.h | 2 +- include/wx/wxchar.h | 1 + src/common/dynload.cpp | 2 +- src/jpeg/jmorecfg.h | 2 ++ src/msw/clipbrd.cpp | 22 +++++++++++++++++----- src/msw/dirdlg.cpp | 4 +++- src/msw/fontenum.cpp | 2 +- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/include/wx/dirdlg.h b/include/wx/dirdlg.h index 7d8682927a..2598d22ee5 100644 --- a/include/wx/dirdlg.h +++ b/include/wx/dirdlg.h @@ -12,7 +12,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr; WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; #if defined(__WXMSW__) - #if defined(__WIN16__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) || defined(__SALFORDC__) + #if defined(__WIN16__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) || defined(__SALFORDC__) || !wxUSE_OLE #include "wx/generic/dirdlgg.h" #else #include "wx/msw/dirdlg.h" diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index 1174ddb287..7537bd055d 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -69,6 +69,7 @@ #include #include #elif defined(__CYGWIN__) + #define HAVE_WCSLEN #include #include #endif diff --git a/src/common/dynload.cpp b/src/common/dynload.cpp index 2255145493..490ca392d7 100644 --- a/src/common/dynload.cpp +++ b/src/common/dynload.cpp @@ -242,7 +242,7 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const symbol = NSAddressOfSymbol( NSLookupAndBindSymbol( name.c_str() ) ); #elif defined(__WINDOWS__) - symbol = ::GetProcAddress( m_handle, name.mb_str() ); + symbol = (void*) ::GetProcAddress( m_handle, name.mb_str() ); #else #error "runtime shared lib support not implemented" diff --git a/src/jpeg/jmorecfg.h b/src/jpeg/jmorecfg.h index e5ecc58441..51b8ca1bc4 100644 --- a/src/jpeg/jmorecfg.h +++ b/src/jpeg/jmorecfg.h @@ -169,6 +169,8 @@ typedef short INT16; #ifdef XMD_H /* X11/xmd.h correctly defines INT32 */ #define INT32_DEFINED +/* Note: GnuPRO 00r1 should be tested because it does NOT define INT32 in windows.h */ +/* For this compiler, set the following test to 0. */ #elif (_MSC_VER >= 1200) || (__BORLANDC__ >= 0x550) \ || wxCHECK_W32API_VERSION( 0, 5 ) \ || ((defined(__MINGW32__) || defined(__CYGWIN__)) \ diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index d01c281dae..013448c3ac 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -565,7 +565,7 @@ bool wxClipboard::AddData( wxDataObject *data ) #elif wxUSE_DATAOBJ wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); - wxDataFormat format = data->GetFormat(); + wxDataFormat format = data->GetPreferredFormat(); switch ( format ) { @@ -582,23 +582,35 @@ bool wxClipboard::AddData( wxDataObject *data ) { wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject*) data; wxBitmap bitmap(bitmapDataObject->GetBitmap()); - return wxSetClipboardData(data->GetFormat(), &bitmap); + return wxSetClipboardData(data->GetPreferredFormat(), &bitmap); } #if wxUSE_METAFILE case wxDF_METAFILE: { +#if 1 + // TODO + wxLogError("Not implemented because wxMetafileDataObject does not contain width and height values."); + return FALSE; +#else wxMetafileDataObject* metaFileDataObject = (wxMetafileDataObject*) data; wxMetafile metaFile = metaFileDataObject->GetMetafile(); return wxSetClipboardData(wxDF_METAFILE, &metaFile, metaFileDataObject->GetWidth(), metaFileDataObject->GetHeight()); +#endif } #endif // wxUSE_METAFILE default: - return wxSetClipboardData(data); + { +// This didn't compile, of course +// return wxSetClipboardData(data); + // TODO + wxLogError("Not implemented."); + return FALSE; + } } #else // !wxUSE_DATAOBJ return FALSE; @@ -776,7 +788,7 @@ bool wxClipboard::GetData( wxDataObject& data ) #elif wxUSE_DATAOBJ wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); - wxDataFormat format = data.GetFormat(); + wxDataFormat format = data.GetPreferredFormat(); switch ( format ) { case wxDF_TEXT: @@ -797,7 +809,7 @@ bool wxClipboard::GetData( wxDataObject& data ) case wxDF_DIB: { wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data; - wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetFormat()); + wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data.GetPreferredFormat()); if ( !bitmap ) return FALSE; diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index 3f539ad57f..30d39f5902 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -28,9 +28,11 @@ #pragma hdrstop #endif +#include "wx/setup.h" + #if wxUSE_DIRDLG -#if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) +#if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) && wxUSE_OLE #ifndef WX_PRECOMP #include "wx/utils.h" diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index dec87f4fc1..80880ebae1 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -146,7 +146,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) return TRUE; } -#if defined(__GNUWIN32__) && !defined(__CYGWIN10__) +#if 0 // defined(__GNUWIN32__) && !defined(__CYGWIN10__) #if wxUSE_NORLANDER_HEADERS #define wxFONTENUMPROC int(*)(const LOGFONT *, const TEXTMETRIC *, long unsigned int, LPARAM) #else