X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6dddc146fbea484558c02c18ea8250549329c70e..83498ef2b0a77944b3f7f3539b7bef6387c384a0:/src/os2/clipbrd.cpp diff --git a/src/os2/clipbrd.cpp b/src/os2/clipbrd.cpp index b0a54e5f24..3474d380ab 100644 --- a/src/os2/clipbrd.cpp +++ b/src/os2/clipbrd.cpp @@ -37,10 +37,6 @@ #include -#define INCL_DOS -#define INCL_PM -#include - #include "wx/os2/private.h" // wxDataObject is tied to OLE/drag and drop implementation, @@ -48,7 +44,7 @@ #if wxUSE_DRAG_AND_DROP #include "wx/dataobj.h" - static bool wxSetClipboardData(wxDataObject *data); +// static bool wxSetClipboardData(wxDataObject *data); #endif // =========================================================================== @@ -63,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(); @@ -100,7 +96,7 @@ bool wxCloseClipboard() return FALSE; } */ - return TRUE; + return true; } bool wxEmptyClipboard() @@ -114,7 +110,7 @@ bool wxEmptyClipboard() return FALSE; } */ - return TRUE; + return true; } bool wxIsClipboardOpened() @@ -122,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) { @@ -158,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, @@ -280,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 ) @@ -331,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; } @@ -436,8 +434,6 @@ bool wxGetClipboardFormatName(wxDataFormat dataFormat, IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) -wxClipboard* wxTheClipboard = (wxClipboard *)NULL; - wxClipboard::wxClipboard() { } @@ -475,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 ) @@ -487,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 ) @@ -505,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 @@ -526,6 +522,8 @@ bool wxClipboard::AddData( wxDataObject *data ) #else // !wxUSE_DRAG_AND_DROP */ return FALSE; +#else + return FALSE; #endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP } @@ -534,17 +532,17 @@ void wxClipboard::Close() wxCloseClipboard(); } -bool wxClipboard::IsSupported( wxDataFormat format ) +bool wxClipboard::IsSupported( const wxDataFormat& format ) { return wxIsClipboardFormatAvailable(format); } -bool wxClipboard::GetData( wxDataObject *data ) +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 ) @@ -552,13 +550,13 @@ bool wxClipboard::GetData( wxDataObject *data ) case wxDF_TEXT: case wxDF_OEMTEXT: { - wxTextDataObject* textDataObject = (wxTextDataObject*) data; + wxTextDataObject& textDataObject = (wxTextDataObject&) data; char* s = (char*) wxGetClipboardData(format); if ( s ) { - textDataObject->SetText(s); + textDataObject.SetText(s); delete[] s; - return TRUE; + return true; } else return FALSE; @@ -567,13 +565,13 @@ bool wxClipboard::GetData( wxDataObject *data ) case wxDF_BITMAP: case wxDF_DIB: { - wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject *)data; - wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetFormat()); + wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data; + wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetPreferredFormat()); if (bitmap) { - bitmapDataObject->SetBitmap(* bitmap); + bitmapDataObject.SetBitmap(* bitmap); delete bitmap; - return TRUE; + return true; } else return FALSE; @@ -581,13 +579,13 @@ bool wxClipboard::GetData( wxDataObject *data ) #if wxUSE_METAFILE case wxDF_METAFILE: { - wxMetafileDataObject* metaFileDataObject = (wxMetafileDataObject *)data; + wxMetafileDataObject& metaFileDataObject = (wxMetafileDataObject &)data; wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE); if (metaFile) { - metaFileDataObject->SetMetafile(*metaFile); + metaFileDataObject.SetMetafile(*metaFile); delete metaFile; - return TRUE; + return true; } else return FALSE; @@ -600,10 +598,10 @@ bool wxClipboard::GetData( wxDataObject *data ) if ( buf ) { // FIXME this is for testing only!! - ((wxPrivateDataObject *)data)->SetData(buf, len); + ((wxPrivateDataObject &)data).SetData(buf, len); free(buf); - return TRUE; + return true; } } @@ -612,10 +610,9 @@ bool wxClipboard::GetData( wxDataObject *data ) #else */ return FALSE; +#else + return FALSE; #endif } -#else - #error "Please turn wxUSE_CLIPBOARD on to compile this file." #endif // wxUSE_CLIPBOARD -