/////////////////////////////////////////////////////////////////////////////
-// Name: clipbrd.cpp
+// Name: src/motif/clipbrd.cpp
// Purpose: Clipboard functionality
// Author: Julian Smart
// Modified by: Mattia Barbon (added support for generic wxDataObjects)
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#define XtDisplay XTDISPLAY
#endif
-#include "wx/defs.h"
-
#if wxUSE_CLIPBOARD
-#include "wx/app.h"
-#include "wx/bitmap.h"
-#include "wx/utils.h"
#include "wx/clipbrd.h"
-#include "wx/dataobj.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/app.h"
+ #include "wx/utils.h"
+ #include "wx/bitmap.h"
+ #include "wx/dataobj.h"
+#endif
+
#include "wx/ptr_scpd.h"
#ifdef __VMS__
#include "wx/listimpl.cpp"
-WX_DEFINE_LIST(wxDataObjectList);
-WX_DEFINE_LIST(wxDataIdToDataObjectList);
+WX_DEFINE_LIST(wxDataObjectList)
+WX_DEFINE_LIST(wxDataIdToDataObjectList)
extern "C"
{
wxClipboard::~wxClipboard()
{
- Clear();
+ Clear();
}
void wxClipboard::Clear()
bool wxClipboard::Open()
{
wxCHECK_MSG( !m_open, false, "clipboard already open" );
-
+
m_open = true;
return true;
return AddData( data );
}
-wxDECLARE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray );
-wxDEFINE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray );
+wxDECLARE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray )
+wxDEFINE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray )
#if wxCHECK_LESSTIF()
void wxClipboardCallback( Widget xwidget, int* data_id,
- int* priv, int* reason )
+ int* priv, int* WXUNUSED(reason) )
#else
void wxClipboardCallback( Widget xwidget, long* data_id,
- long* priv, int* reason )
+ long* priv, int* WXUNUSED(reason) )
#endif
{
Display* xdisplay = XtDisplay( xwidget );
wxString id = dfarr[i].GetId();
while( ( retval = XmClipboardCopy( xdisplay, xwindow, itemId,
- wxConstCast(id.c_str(), char),
+ id.char_str(),
NULL, size, i, &data_id ) )
== XmClipboardLocked );
void wxClipboard::Close()
{
wxCHECK_RET( m_open, "clipboard not open" );
-
+
m_open = false;
}
size_t dfcount = data.GetFormatCount( wxDataObject::Set );
wxDataFormatScopedArray dfarr( new wxDataFormat[dfcount] );
data.GetAllFormats( dfarr.get(), wxDataObject::Set );
-
+
if( XmClipboardInquireCount( xdisplay, xwindow, &count, &max_name_length )
== XmClipboardSuccess )
{
wxString id = chosenFormat.GetId();
while( ( retval = XmClipboardInquireLength( xdisplay, xwindow,
- wxConstCast(id.c_str(), char),
+ id.char_str(),
&length ) )
== XmClipboardLocked );
if( retval != XmClipboardSuccess )
wxCharBuffer buf(length);
while( ( retval = XmClipboardRetrieve( xdisplay, xwindow,
- wxConstCast(id.c_str(), char),
+ id.char_str(),
(XtPointer)buf.data(),
length, &dummy1, &dummy2 ) )
== XmClipboardLocked );