X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19193a2c85987b595932957e73013e7ea100f0e8..f60b1d829dd8a6d5e47a2adcd3690acb3bd10150:/src/os2/clipbrd.cpp diff --git a/src/os2/clipbrd.cpp b/src/os2/clipbrd.cpp index 2618dc6885..3474d380ab 100644 --- a/src/os2/clipbrd.cpp +++ b/src/os2/clipbrd.cpp @@ -44,7 +44,7 @@ #if wxUSE_DRAG_AND_DROP #include "wx/dataobj.h" - static bool wxSetClipboardData(wxDataObject *data); +// static bool wxSetClipboardData(wxDataObject *data); #endif // =========================================================================== @@ -59,7 +59,7 @@ static bool gs_wxClipboardIsOpen = FALSE; bool wxOpenClipboard() { - wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, wxT("clipboard already opened.") ); + wxCHECK_MSG( !gs_wxClipboardIsOpen, true, wxT("clipboard already opened.") ); // TODO: /* wxWindow *win = wxTheApp->GetTopWindow(); @@ -96,7 +96,7 @@ bool wxCloseClipboard() return FALSE; } */ - return TRUE; + return true; } bool wxEmptyClipboard() @@ -110,7 +110,7 @@ bool wxEmptyClipboard() return FALSE; } */ - return TRUE; + return true; } bool wxIsClipboardOpened() @@ -118,12 +118,13 @@ bool wxIsClipboardOpened() return gs_wxClipboardIsOpen; } -bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) +bool wxIsClipboardFormatAvailable(wxDataFormat WXUNUSED(dataFormat)) { // TODO: return ::IsClipboardFormatAvailable(dataFormat) != 0; - return FALSE; + return false; } +#if 0 #if wxUSE_DRAG_AND_DROP static bool wxSetClipboardData(wxDataObject *data) { @@ -154,9 +155,10 @@ static bool wxSetClipboardData(wxDataObject *data) return FALSE; } */ - return TRUE; + return true; } #endif // wxUSE_DRAG_AND_DROP +#endif bool wxSetClipboardData(wxDataFormat dataFormat, const void *data, @@ -276,12 +278,12 @@ bool wxSetClipboardData(wxDataFormat dataFormat, return FALSE; } */ - return TRUE; + return true; } void *wxGetClipboardData(wxDataFormat dataFormat, long *len) { - void *retval = NULL; +// void *retval = NULL; // TODO: /* switch ( dataFormat ) @@ -327,7 +329,7 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len) wxBM->SetWidth(bm.bmWidth); wxBM->SetHeight(bm.bmHeight); wxBM->SetDepth(bm.bmPlanes); - wxBM->SetOk(TRUE); + wxBM->SetOk(true); retval = wxBM; break; } @@ -469,9 +471,9 @@ bool wxClipboard::SetData( wxDataObject *data ) if ( data ) return AddData(data); else - return TRUE; + return true; */ - return TRUE; + return true; } bool wxClipboard::AddData( wxDataObject *data ) @@ -481,7 +483,7 @@ bool wxClipboard::AddData( wxDataObject *data ) #if wxUSE_DRAG_AND_DROP wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); -// wxDataFormat format = data->GetFormat(); +// wxDataFormat format = data->GetPreferredFormat(); // TODO: /* switch ( format ) @@ -499,7 +501,7 @@ 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 @@ -530,7 +532,7 @@ void wxClipboard::Close() wxCloseClipboard(); } -bool wxClipboard::IsSupported( wxDataFormat format ) +bool wxClipboard::IsSupported( const wxDataFormat& format ) { return wxIsClipboardFormatAvailable(format); } @@ -540,7 +542,7 @@ bool wxClipboard::GetData( wxDataObject& data ) wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); #if wxUSE_DRAG_AND_DROP -// wxDataFormat format = data.GetFormat(); +// wxDataFormat format = data.GetPreferredFormat(); // TODO: /* switch ( format ) @@ -554,7 +556,7 @@ bool wxClipboard::GetData( wxDataObject& data ) { textDataObject.SetText(s); delete[] s; - return TRUE; + return true; } else return FALSE; @@ -564,12 +566,12 @@ 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) { bitmapDataObject.SetBitmap(* bitmap); delete bitmap; - return TRUE; + return true; } else return FALSE; @@ -583,7 +585,7 @@ bool wxClipboard::GetData( wxDataObject& data ) { metaFileDataObject.SetMetafile(*metaFile); delete metaFile; - return TRUE; + return true; } else return FALSE; @@ -599,7 +601,7 @@ bool wxClipboard::GetData( wxDataObject& data ) ((wxPrivateDataObject &)data).SetData(buf, len); free(buf); - return TRUE; + return true; } } @@ -613,7 +615,4 @@ bool wxClipboard::GetData( wxDataObject& data ) #endif } -#else - #error "Please turn wxUSE_CLIPBOARD on to compile this file." #endif // wxUSE_CLIPBOARD -