/////////////////////////////////////////////////////////////////////////////
-// Name: clipbrd.cpp
+// Name: src/os2/clipbrd.cpp
// Purpose: Clipboard functionality
// Author: David Webster
// Modified by:
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#ifndef WX_PRECOMP
- #include "wx/setup.h"
-#endif
-
#if wxUSE_CLIPBOARD
+#include "wx/clipbrd.h"
+
#ifndef WX_PRECOMP
#include "wx/object.h"
#include "wx/event.h"
#include "wx/bitmap.h"
#include "wx/utils.h"
#include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/dataobj.h"
#endif
#if wxUSE_METAFILE
#include "wx/metafile.h"
#endif
-#include "wx/log.h"
-#include "wx/clipbrd.h"
-
#include <string.h>
#include "wx/os2/private.h"
// wxDataObject is tied to OLE/drag and drop implementation,
// therefore so is wxClipboard :-(
-#if wxUSE_DRAG_AND_DROP
- #include "wx/dataobj.h"
-
-// static bool wxSetClipboardData(wxDataObject *data);
-#endif
// ===========================================================================
// implementation
// old-style clipboard functions using Windows API
// ---------------------------------------------------------------------------
-static bool gs_wxClipboardIsOpen = FALSE;
+static bool gs_wxClipboardIsOpen = false;
bool wxOpenClipboard()
{
gs_wxClipboardIsOpen = ::OpenClipboard((HWND)win->GetHWND()) != 0;
if ( !gs_wxClipboardIsOpen )
+ {
wxLogSysError(_("Failed to open the clipboard."));
+ }
return gs_wxClipboardIsOpen;
}
else
{
- wxLogDebug(wxT("Can not open clipboard without a main window."));
+ wxLogDebug(wxT("Cannot open clipboard without a main window."));
- return FALSE;
+ return false;
}
*/
- return FALSE;
+ return false;
}
bool wxCloseClipboard()
{
- wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, wxT("clipboard is not opened") );
+ wxCHECK_MSG( gs_wxClipboardIsOpen, false, wxT("clipboard is not opened") );
// TODO:
/*
- gs_wxClipboardIsOpen = FALSE;
+ gs_wxClipboardIsOpen = false;
if ( ::CloseClipboard() == 0 )
{
wxLogSysError(_("Failed to close the clipboard."));
- return FALSE;
+ return false;
}
*/
return true;
{
wxLogSysError(_("Failed to empty the clipboard."));
- return FALSE;
+ return false;
}
*/
return true;
wxLogSysError(_("Failed to allocate %dKb of memory for clipboard "
"transfer."), size / 1024);
- return FALSE;
+ return false;
}
LPVOID lpGlobalMemory = ::GlobalLock(hGlobal);
wxLogSysError(_("Failed to set clipboard data in format %s"),
wxDataObject::GetFormatName(format));
- return FALSE;
+ return false;
}
*/
return true;
#endif // wxUSE_DRAG_AND_DROP
#endif
-bool wxSetClipboardData(wxDataFormat dataFormat,
- const void *data,
- int width, int height)
+bool wxSetClipboardData(wxDataFormat WXUNUSED(dataFormat),
+ const void *WXUNUSED(data),
+ int WXUNUSED(width), int WXUNUSED(height))
{
// TODO:
/*
SelectObject(hdcSrc, old);
DeleteDC(hdcMem);
DeleteDC(hdcSrc);
- return FALSE;
+ return false;
}
HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap);
default:
{
wxLogError(_("Unsupported clipboard format."));
- return FALSE;
+ return false;
}
case wxDF_OEMTEXT:
{
wxLogSysError(_("Failed to set clipboard data."));
- return FALSE;
+ return false;
}
*/
return true;
}
-void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
+void *wxGetClipboardData(wxDataFormat WXUNUSED(dataFormat), long *WXUNUSED(len))
{
// void *retval = NULL;
// TODO:
case wxDF_DIB:
{
wxLogError(_("Unsupported clipboard format."));
- return FALSE;
+ return NULL;
}
case wxDF_OEMTEXT:
return dataFormat;
}
-int wxRegisterClipboardFormat(wxChar *formatName)
+int wxRegisterClipboardFormat(wxChar *WXUNUSED(formatName))
{
// TODO: return ::RegisterClipboardFormat(formatName);
return 0;
}
-bool wxGetClipboardFormatName(wxDataFormat dataFormat,
- wxChar *formatName,
- int maxCount)
+bool wxGetClipboardFormatName(wxDataFormat WXUNUSED(dataFormat),
+ wxChar *WXUNUSED(formatName),
+ int WXUNUSED(maxCount))
{
// TODO: return ::GetClipboardFormatName((int)dataFormat, formatName, maxCount) > 0;
return 0;
bool wxClipboard::Flush()
{
// TODO:
- return FALSE;
+ return false;
}
bool wxClipboard::Open()
return wxIsClipboardOpened();
}
-bool wxClipboard::SetData( wxDataObject *data )
+bool wxClipboard::SetData( wxDataObject *WXUNUSED(data) )
{
(void)wxEmptyClipboard();
// TODO:
bool wxClipboard::AddData( wxDataObject *data )
{
- wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
+ wxCHECK_MSG( data, false, wxT("data is invalid") );
#if wxUSE_DRAG_AND_DROP
- wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
+ wxCHECK_MSG( wxIsClipboardOpened(), false, wxT("clipboard not open") );
// wxDataFormat format = data->GetPreferredFormat();
// TODO:
}
#else // !wxUSE_DRAG_AND_DROP
*/
- return FALSE;
+ return false;
#else
- return FALSE;
+ return false;
#endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP
}
return wxIsClipboardFormatAvailable(format);
}
-bool wxClipboard::GetData( wxDataObject& data )
+bool wxClipboard::GetData( wxDataObject& WXUNUSED(data) )
{
- wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
+ wxCHECK_MSG( wxIsClipboardOpened(), false, wxT("clipboard not open") );
#if wxUSE_DRAG_AND_DROP
// wxDataFormat format = data.GetPreferredFormat();
return true;
}
else
- return FALSE;
+ return false;
}
case wxDF_BITMAP:
return true;
}
else
- return FALSE;
+ return false;
}
#if wxUSE_METAFILE
case wxDF_METAFILE:
return true;
}
else
- return FALSE;
+ return false;
}
#endif
default:
void *buf = wxGetClipboardData(format, &len);
if ( buf )
{
- // FIXME this is for testing only!!
+ // FIXME this is for testing only!
((wxPrivateDataObject &)data).SetData(buf, len);
free(buf);
}
}
- return FALSE;
+ return false;
}
#else
*/
- return FALSE;
+ return false;
#else
- return FALSE;
+ return false;
#endif
}