X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e933b5bc365e0907a4f0fd15b4c49e4c96c2b59f..7169360153f35fe579c7e72fd95a1dbbb2eff043:/src/motif/clipbrd.cpp diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp index 1353a842a9..4664139db9 100644 --- a/src/motif/clipbrd.cpp +++ b/src/motif/clipbrd.cpp @@ -4,7 +4,6 @@ // 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 ///////////////////////////////////////////////////////////////////////////// @@ -21,16 +20,20 @@ #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" -#include "wx/ptr_scpd.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/utils.h" + #include "wx/bitmap.h" + #include "wx/dataobj.h" +#endif + +#include "wx/scopedarray.h" + +typedef wxScopedArray wxDataFormatScopedArray; #ifdef __VMS__ #pragma message disable nosimpint @@ -147,7 +150,7 @@ wxDataFormat wxRegisterClipboardFormat(char *WXUNUSED(formatName)) bool wxGetClipboardFormatName(const wxDataFormat& dataFormat, char *formatName, int maxCount) { - wxStrncpy( formatName, dataFormat.GetId().c_str(), maxCount ); + wxStrlcpy( formatName, dataFormat.GetId().c_str(), maxCount ); return true; } @@ -231,9 +234,6 @@ bool wxClipboard::SetData( wxDataObject *data ) return AddData( data ); } -wxDECLARE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray ) -wxDEFINE_SCOPED_ARRAY( wxDataFormat, wxDataFormatScopedArray ) - #if wxCHECK_LESSTIF() void wxClipboardCallback( Widget xwidget, int* data_id, int* priv, int* WXUNUSED(reason) ) @@ -285,7 +285,7 @@ bool wxClipboard::AddData( wxDataObject *data ) Display* xdisplay = wxGlobalDisplay(); Widget xwidget = (Widget)wxTheApp->GetTopLevelRealizedWidget(); Window xwindow = XtWindow( xwidget ); - wxXmString label( wxTheApp->GetAppName() ); + wxXmString label( wxTheApp->GetAppDisplayName() ); Time timestamp = XtLastTimestampProcessed( xdisplay ); long itemId; @@ -310,7 +310,7 @@ bool wxClipboard::AddData( wxDataObject *data ) 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 ); @@ -459,7 +459,7 @@ bool wxClipboard::GetData( wxDataObject& data ) wxString id = chosenFormat.GetId(); while( ( retval = XmClipboardInquireLength( xdisplay, xwindow, - wxConstCast(id.c_str(), char), + id.char_str(), &length ) ) == XmClipboardLocked ); if( retval != XmClipboardSuccess ) @@ -468,7 +468,7 @@ bool wxClipboard::GetData( wxDataObject& data ) wxCharBuffer buf(length); while( ( retval = XmClipboardRetrieve( xdisplay, xwindow, - wxConstCast(id.c_str(), char), + id.char_str(), (XtPointer)buf.data(), length, &dummy1, &dummy2 ) ) == XmClipboardLocked );