// 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
// 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
#if wxCHECK_LESSTIF()
static void wxClipboardCallback( Widget widget, int* data_id,
int* priv, int* reason );
#if wxCHECK_LESSTIF()
static void wxClipboardCallback( Widget widget, int* data_id,
int* priv, int* reason );
static void wxClipboardCallback( Widget widget, long* data_id,
long* priv, int* reason );
static void wxClipboardCallback( Widget widget, long* data_id,
long* priv, int* reason );
-wxDECLARE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray );
-wxDEFINE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray );
+wxDECLARE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray )
+wxDEFINE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray )
wxString id = dfarr[i].GetId();
while( ( retval = XmClipboardCopy( xdisplay, xwindow, itemId,
wxString id = dfarr[i].GetId();
while( ( retval = XmClipboardCopy( xdisplay, xwindow, itemId,
NULL, size, i, &data_id ) )
== XmClipboardLocked );
NULL, size, i, &data_id ) )
== XmClipboardLocked );
void wxClipboard::Close()
{
wxCHECK_RET( m_open, "clipboard not open" );
void wxClipboard::Close()
{
wxCHECK_RET( m_open, "clipboard not open" );
wxCHECK_MSG( m_open, false, "clipboard not open" );
Display* xdisplay = wxGlobalDisplay();
wxCHECK_MSG( m_open, false, "clipboard not open" );
Display* xdisplay = wxGlobalDisplay();
size_t dfcount = data.GetFormatCount( wxDataObject::Set );
wxDataFormatScopedArray dfarr( new wxDataFormat[dfcount] );
data.GetAllFormats( dfarr.get(), wxDataObject::Set );
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 )
{
if( XmClipboardInquireCount( xdisplay, xwindow, &count, &max_name_length )
== XmClipboardSuccess )
{
wxString id = chosenFormat.GetId();
while( ( retval = XmClipboardInquireLength( xdisplay, xwindow,
wxString id = chosenFormat.GetId();
while( ( retval = XmClipboardInquireLength( xdisplay, xwindow,
wxCharBuffer buf(length);
while( ( retval = XmClipboardRetrieve( xdisplay, xwindow,
wxCharBuffer buf(length);
while( ( retval = XmClipboardRetrieve( xdisplay, xwindow,