// 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
-wxDECLARE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray );
-wxDEFINE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray );
+wxDECLARE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray )
+wxDEFINE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray )
Display* xdisplay = wxGlobalDisplay();
Widget xwidget = (Widget)wxTheApp->GetTopLevelRealizedWidget();
Window xwindow = XtWindow( xwidget );
Display* xdisplay = wxGlobalDisplay();
Widget xwidget = (Widget)wxTheApp->GetTopLevelRealizedWidget();
Window xwindow = XtWindow( xwidget );
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" );
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,