#
-# This file was automatically generated by tmake at 04:13, 1999/10/21
+# This file was automatically generated by tmake at 11:02, 1999/10/21
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
#
parser.o \
appcmn.o \
choiccmn.o \
+ clipcmn.o \
cmndata.o \
config.o \
ctrlcmn.o \
parser.d \
appcmn.d \
choiccmn.d \
+ clipcmn.d \
cmndata.d \
config.d \
ctrlcmn.d \
parser.o \
appcmn.o \
choiccmn.o \
+ clipcmn.o \
cmndata.o \
config.o \
ctrlcmn.o \
parser.d \
appcmn.d \
choiccmn.d \
+ clipcmn.d \
cmndata.d \
config.d \
ctrlcmn.d \
parser.o \
appcmn.o \
choiccmn.o \
+ clipcmn.o \
cmndata.o \
config.o \
ctrlcmn.o \
parser.d \
appcmn.d \
choiccmn.d \
+ clipcmn.d \
cmndata.d \
config.d \
ctrlcmn.d \
appcmn.cpp C B
choiccmn.cpp C
cmndata.cpp C
+clipcmn.cpp C
config.cpp C B
ctrlcmn.cpp C
date.cpp C B
#ifndef _WX_CLIPBRD_H_BASE_
#define _WX_CLIPBRD_H_BASE_
+#ifdef __GNUG__
+ #pragma interface "clipboardbase.h"
+#endif
+
#include "wx/defs.h"
#if wxUSE_CLIPBOARD
+
#include "wx/object.h"
#include "wx/wxchar.h"
class WXDLLEXPORT wxClipboardBase : public wxObject
{
public:
+ wxClipboardBase();
+
// open the clipboard before Add/SetData() and GetData()
- virtual bool Open();
+ virtual bool Open() = 0;
// close the clipboard after Add/SetData() and GetData()
- virtual void Close();
+ virtual void Close() = 0;
// add to the clipboard data
//
// NB: the clipboard owns the pointer and will delete it, so data must be
// allocated on the heap
- virtual bool AddData( wxDataObject *data );
+ virtual bool AddData( wxDataObject *data ) = 0;
// set the clipboard data, this is the same as Clear() followed by
// AddData()
- virtual bool SetData( wxDataObject *data );
+ virtual bool SetData( wxDataObject *data ) = 0;
// ask if data in correct format is available
- virtual bool IsSupported( const wxDataFormat& format );
+ virtual bool IsSupported( const wxDataFormat& format ) = 0;
// fill data with data on the clipboard (if available)
- virtual bool GetData( wxDataObject& data );
-
+ virtual bool GetData( wxDataObject& data ) = 0;
+
// clears wxTheClipboard and the system's clipboard if possible
- virtual void Clear();
+ virtual void Clear() = 0;
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// The global clipboard object
WXDLLEXPORT_DATA(extern wxClipboard *) wxTheClipboard;
-// ----------------------------------------------------------------------------
-// wxClipboardModule: module responsible for initializing the global clipboard
-// object
-//
-// NB: IMPLEMENT_DYNAMIC_CLASS() for it is in common/appcmn.cpp
-// ----------------------------------------------------------------------------
-
-class wxClipboardModule : public wxModule
-{
-public:
- bool OnInit()
- { wxTheClipboard = new wxClipboard; return TRUE; }
- void OnExit()
- { delete wxTheClipboard; wxTheClipboard = (wxClipboard *)NULL; }
-
-private:
- DECLARE_DYNAMIC_CLASS(wxClipboardModule)
-};
-
#endif // wxUSE_CLIPBOARD
#endif // _WX_CLIPBRD_H_BASE_
virtual wxBitmap GetBitmap() const { return m_bitmap; }
virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
-private:
+protected:
wxBitmap m_bitmap;
};
wxFileDataObjectBase() : wxDataObjectSimple(wxDF_FILENAME) { }
// get a reference to our array
- const wxArrayString& GetFilenames() { return m_filenames; }
+ const wxArrayString& GetFilenames() const { return m_filenames; }
// the Get() functions do nothing for us
virtual size_t GetDataSize() const { return 0; }
virtual ~wxDropSourceBase() { }
// set the data which is transfered by drag and drop
- void SetData(wxDataObject& data) { delete m_data; m_data = &data; }
+ void SetData(wxDataObject& data)
+ { if (m_data) delete m_data;
+ m_data = &data; }
// start drag action, see enum wxDragResult for return value description
//
// ctor takes a pointer to heap-allocated wxDataObject which will be owned
// by wxDropTarget and deleted by it automatically. If you don't give it
// here, you can use SetDataObject() later.
- wxDropTargetBase(wxDataObject *dataObject = NULL)
+ wxDropTargetBase(wxDataObject *dataObject = (wxDataObject*)NULL)
{ m_dataObject = dataObject; }
// dtor deletes our data object
virtual ~wxDropTargetBase()
wxDataObject *GetDataObject() const
{ return m_dataObject; }
void SetDataObject(wxDataObject *dataObject)
- { delete m_dataObject; m_dataObject = dataObject; }
+ { if (m_dataObject) delete m_dataObject;
+ m_dataObject = dataObject; }
// called when mouse enters/leaves the window: might be used to give
// some visual feedback to the user
- virtual void OnEnter() { }
virtual void OnLeave() { }
-
+
+ // this function is called when data enters over position (x, y) - if it
+ // returns TRUE, the dragging icon can indicate that the window would
+ // accept a drop here
+ virtual bool OnEnter(wxCoord x, wxCoord y) = 0;
+
+ // this function is called when data is move over position (x, y) - if it
+ // returns TRUE, the dragging icon can indicate that the window would
+ // accept a drop here
+ virtual bool OnMove(wxCoord x, wxCoord y) = 0;
+
// this function is called when data is dropped at position (x, y) - if it
// returns TRUE, OnData() will be called immediately afterwards which will
// allow to retrieve the data dropped.
class wxDataObject : public wxDataObjectBase
{
+public:
+ wxDataObject();
+
+ virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
};
#endif // _WX_GTK_DATAOBJ_H_
void Clear() { free(m_pngData); }
void ClearAll() { Clear(); Init(); }
-private:
size_t m_pngSize;
void *m_pngData;
// implement base class pure virtuals
// ----------------------------------
+ void AddFile( const wxString &filename );
+
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
// wxDropTarget
//-------------------------------------------------------------------------
-class wxDropTarget: public wxObject
+class wxDropTarget: public wxDropTargetBase
{
public:
-
- wxDropTarget();
- ~wxDropTarget();
-
- /* may be overridden to react to events */
- virtual void OnEnter();
- virtual void OnLeave();
-
- /* may be overridden to reject certain formats or drops
- on certain areas. always returns TRUE by default
- indicating that you'd accept the data from the drag. */
- virtual bool OnMove( long x, long y );
-
- /* has to be overridden to accept a drop event. call
- IsSupported() to ask which formats are available
- and then call RequestData() to indicate the format
- you request. */
- virtual bool OnDrop( long x, long y );
-
- /* this gets called once the data has actually arrived. get
- it with GetData(). this has to be overridden. */
- virtual bool OnData( long x, long y );
-
- /* called from within OnDrop() to request a certain format
- from the drop event. */
- bool RequestData( wxDataFormat format );
-
- /* called to query what formats are available */
- bool IsSupported( wxDataFormat format );
-
- /* fill data with data from the dragging source */
- bool GetData( wxDataObject *data );
-
- virtual size_t GetFormatCount() const = 0;
- virtual wxDataFormat GetFormat(size_t n) const = 0;
-
-// implementation
-
- void RegisterWidget( GtkWidget *widget );
- void UnregisterWidget( GtkWidget *widget );
-
- GdkDragContext *m_dragContext;
- GtkWidget *m_dragWidget;
- GtkSelectionData *m_dragData;
- guint m_dragTime;
- bool m_firstMotion; /* gdk has no "gdk_drag_enter" event */
-
- void SetDragContext( GdkDragContext *dc ) { m_dragContext = dc; }
- void SetDragWidget( GtkWidget *w ) { m_dragWidget = w; }
- void SetDragData( GtkSelectionData *sd ) { m_dragData = sd; }
- void SetDragTime( guint time ) { m_dragTime = time; }
-};
-
-//-------------------------------------------------------------------------
-// wxTextDropTarget
-//-------------------------------------------------------------------------
-
-class wxTextDropTarget: public wxDropTarget
-{
-public:
-
- wxTextDropTarget() {}
-
- virtual bool OnData( long x, long y );
-
- /* you have to override OnDropData to get at the text */
- virtual bool OnDropText( long x, long y, const wxChar *text ) = 0;
-
- virtual size_t GetFormatCount() const
- { return 1; }
- virtual wxDataFormat GetFormat(size_t n) const
- { return wxDF_TEXT; }
-};
-
-//-------------------------------------------------------------------------
-// wxPrivateDropTarget
-//-------------------------------------------------------------------------
-
-/*
-class wxPrivateDropTarget: public wxDropTarget
-{
-public:
-
- wxPrivateDropTarget();
- wxPrivateDropTarget( const wxString &id );
-
- virtual bool OnMove( long x, long y );
- virtual bool OnDrop( long x, long y );
- virtual bool OnData( long x, long y );
-
- virtual bool OnDropData( long x, long y, void *data, size_t size ) = 0;
-
- void SetId( const wxString& id ) { m_id = id; }
- wxString GetId() { return m_id; }
-
-private:
-
- wxString m_id;
-};
-*/
-
-//----------------------------------------------------------------------------
-// A drop target which accepts files (dragged from File Manager or Explorer)
-//----------------------------------------------------------------------------
-
-class wxFileDropTarget: public wxDropTarget
-{
-public:
-
- wxFileDropTarget() {}
-
- virtual bool OnData( long x, long y );
-
- virtual bool OnDropFiles( long x, long y, size_t nFiles, const wxChar * const aszFiles[] ) = 0;
-
- virtual size_t GetFormatCount() const
- { return 1; }
- virtual wxDataFormat GetFormat(size_t n) const
- { return wxDF_FILENAME; }
+ wxDropTarget(wxDataObject *dataObject = (wxDataObject*) NULL );
+
+ virtual bool OnEnter(wxCoord x, wxCoord y) ;
+ virtual bool OnMove(wxCoord x, wxCoord y);
+ virtual bool OnDrop(wxCoord x, wxCoord y);
+ virtual bool OnData(wxCoord x, wxCoord y);
+ virtual bool GetData();
+
+ // implementation
+
+ GdkAtom GetMatchingPair();
+ void RegisterWidget( GtkWidget *widget );
+ void UnregisterWidget( GtkWidget *widget );
+
+ GdkDragContext *m_dragContext;
+ GtkWidget *m_dragWidget;
+ GtkSelectionData *m_dragData;
+ guint m_dragTime;
+ bool m_firstMotion; /* gdk has no "gdk_drag_enter" event */
+
+ void SetDragContext( GdkDragContext *dc ) { m_dragContext = dc; }
+ void SetDragWidget( GtkWidget *w ) { m_dragWidget = w; }
+ void SetDragData( GtkSelectionData *sd ) { m_dragData = sd; }
+ void SetDragTime( guint time ) { m_dragTime = time; }
};
//-------------------------------------------------------------------------
// wxDropSource
//-------------------------------------------------------------------------
-class wxDropSource: public wxObject
+class wxDropSource: public wxDropSourceBase
{
public:
/* constructor. set data later with SetData() */
class wxDataObject : public wxDataObjectBase
{
+public:
+ wxDataObject();
+
+ virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
};
#endif // _WX_GTK_DATAOBJ_H_
void Clear() { free(m_pngData); }
void ClearAll() { Clear(); Init(); }
-private:
size_t m_pngSize;
void *m_pngData;
// implement base class pure virtuals
// ----------------------------------
+ void AddFile( const wxString &filename );
+
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
// wxDropTarget
//-------------------------------------------------------------------------
-class wxDropTarget: public wxObject
+class wxDropTarget: public wxDropTargetBase
{
public:
-
- wxDropTarget();
- ~wxDropTarget();
-
- /* may be overridden to react to events */
- virtual void OnEnter();
- virtual void OnLeave();
-
- /* may be overridden to reject certain formats or drops
- on certain areas. always returns TRUE by default
- indicating that you'd accept the data from the drag. */
- virtual bool OnMove( long x, long y );
-
- /* has to be overridden to accept a drop event. call
- IsSupported() to ask which formats are available
- and then call RequestData() to indicate the format
- you request. */
- virtual bool OnDrop( long x, long y );
-
- /* this gets called once the data has actually arrived. get
- it with GetData(). this has to be overridden. */
- virtual bool OnData( long x, long y );
-
- /* called from within OnDrop() to request a certain format
- from the drop event. */
- bool RequestData( wxDataFormat format );
-
- /* called to query what formats are available */
- bool IsSupported( wxDataFormat format );
-
- /* fill data with data from the dragging source */
- bool GetData( wxDataObject *data );
-
- virtual size_t GetFormatCount() const = 0;
- virtual wxDataFormat GetFormat(size_t n) const = 0;
-
-// implementation
-
- void RegisterWidget( GtkWidget *widget );
- void UnregisterWidget( GtkWidget *widget );
-
- GdkDragContext *m_dragContext;
- GtkWidget *m_dragWidget;
- GtkSelectionData *m_dragData;
- guint m_dragTime;
- bool m_firstMotion; /* gdk has no "gdk_drag_enter" event */
-
- void SetDragContext( GdkDragContext *dc ) { m_dragContext = dc; }
- void SetDragWidget( GtkWidget *w ) { m_dragWidget = w; }
- void SetDragData( GtkSelectionData *sd ) { m_dragData = sd; }
- void SetDragTime( guint time ) { m_dragTime = time; }
-};
-
-//-------------------------------------------------------------------------
-// wxTextDropTarget
-//-------------------------------------------------------------------------
-
-class wxTextDropTarget: public wxDropTarget
-{
-public:
-
- wxTextDropTarget() {}
-
- virtual bool OnData( long x, long y );
-
- /* you have to override OnDropData to get at the text */
- virtual bool OnDropText( long x, long y, const wxChar *text ) = 0;
-
- virtual size_t GetFormatCount() const
- { return 1; }
- virtual wxDataFormat GetFormat(size_t n) const
- { return wxDF_TEXT; }
-};
-
-//-------------------------------------------------------------------------
-// wxPrivateDropTarget
-//-------------------------------------------------------------------------
-
-/*
-class wxPrivateDropTarget: public wxDropTarget
-{
-public:
-
- wxPrivateDropTarget();
- wxPrivateDropTarget( const wxString &id );
-
- virtual bool OnMove( long x, long y );
- virtual bool OnDrop( long x, long y );
- virtual bool OnData( long x, long y );
-
- virtual bool OnDropData( long x, long y, void *data, size_t size ) = 0;
-
- void SetId( const wxString& id ) { m_id = id; }
- wxString GetId() { return m_id; }
-
-private:
-
- wxString m_id;
-};
-*/
-
-//----------------------------------------------------------------------------
-// A drop target which accepts files (dragged from File Manager or Explorer)
-//----------------------------------------------------------------------------
-
-class wxFileDropTarget: public wxDropTarget
-{
-public:
-
- wxFileDropTarget() {}
-
- virtual bool OnData( long x, long y );
-
- virtual bool OnDropFiles( long x, long y, size_t nFiles, const wxChar * const aszFiles[] ) = 0;
-
- virtual size_t GetFormatCount() const
- { return 1; }
- virtual wxDataFormat GetFormat(size_t n) const
- { return wxDF_FILENAME; }
+ wxDropTarget(wxDataObject *dataObject = (wxDataObject*) NULL );
+
+ virtual bool OnEnter(wxCoord x, wxCoord y) ;
+ virtual bool OnMove(wxCoord x, wxCoord y);
+ virtual bool OnDrop(wxCoord x, wxCoord y);
+ virtual bool OnData(wxCoord x, wxCoord y);
+ virtual bool GetData();
+
+ // implementation
+
+ GdkAtom GetMatchingPair();
+ void RegisterWidget( GtkWidget *widget );
+ void UnregisterWidget( GtkWidget *widget );
+
+ GdkDragContext *m_dragContext;
+ GtkWidget *m_dragWidget;
+ GtkSelectionData *m_dragData;
+ guint m_dragTime;
+ bool m_firstMotion; /* gdk has no "gdk_drag_enter" event */
+
+ void SetDragContext( GdkDragContext *dc ) { m_dragContext = dc; }
+ void SetDragWidget( GtkWidget *w ) { m_dragWidget = w; }
+ void SetDragData( GtkSelectionData *sd ) { m_dragData = sd; }
+ void SetDragTime( guint time ) { m_dragTime = time; }
};
//-------------------------------------------------------------------------
// wxDropSource
//-------------------------------------------------------------------------
-class wxDropSource: public wxObject
+class wxDropSource: public wxDropSourceBase
{
public:
/* constructor. set data later with SetData() */
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: common/clipcmn.cpp
+// Purpose: common (to all ports) wxClipboard functions
+// Author: Robert Roebling
+// Modified by:
+// Created: 28.06.99
+// RCS-ID: $Id$
+// Copyright: (c) Robert Roebling
+// Licence: wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#ifdef __GNUG__
+ #pragma implementation "clipboardbase.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#include "wx/clipbrd.h"
+
+//--------------------------------------------------------------------------
+// wxClipboardBase
+//--------------------------------------------------------------------------
+
+wxClipboardBase::wxClipboardBase()
+{
+}
+
+// ----------------------------------------------------------------------------
+// wxClipboardModule: module responsible for initializing the global clipboard
+// object
+//
+// NB: IMPLEMENT_DYNAMIC_CLASS() for it is in common/appcmn.cpp
+// ----------------------------------------------------------------------------
+
+class wxClipboardModule : public wxModule
+{
+public:
+ bool OnInit()
+ { wxTheClipboard = new wxClipboard; return TRUE; }
+ void OnExit()
+ { delete wxTheClipboard; wxTheClipboard = (wxClipboard *)NULL; }
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxClipboardModule)
+};
+
#include "wx/dataobj.h"
#include "wx/utils.h"
+#include "wx/log.h"
#include "glib.h"
#include "gdk/gdk.h"
clipboard->m_waiting = FALSE;
return;
}
+
+ wxDataFormat format( selection_data->target );
/* make sure we got the data in the correct format */
- if (data_object->GetFormat() != selection_data->target)
+ if (!data_object->IsSupportedFormat( format ) )
{
clipboard->m_waiting = FALSE;
return;
/* make sure we got the data in the correct form (selection type).
if so, copy data to target object */
- switch (data_object->GetFormat().GetType())
+ switch (format.GetType())
{
case wxDF_TEXT:
{
wxBitmapDataObject *bitmap_object = (wxBitmapDataObject *) data_object;
- bitmap_object->SetPngData( (const void*) selection_data->data, (size_t) selection_data->length );
+ bitmap_object->SetData( (size_t) selection_data->length, (const void*) selection_data->data );
break;
}
return;
}
- wxPrivateDataObject *private_object = (wxPrivateDataObject *) data_object;
-
- private_object->SetData( (const char*) selection_data->data, (size_t) selection_data->length );
+ data_object->SetData( format, (size_t) selection_data->length, (const char*) selection_data->data );
break;
}
wxDataObject *data = wxTheClipboard->m_data;
- if (!data->IsSupportedFormat( selection_data->target )) return;
+ wxDataFormat format( selection_data->target );
+
+ if (!data->IsSupportedFormat( format )) return;
- if (data->GetFormat().GetType() == wxDF_TEXT)
+ if (format.GetType() == wxDF_TEXT)
{
wxTextDataObject *text_object = (wxTextDataObject*) data;
wxString text( text_object->GetText() );
return;
}
- if (data->GetFormat().GetType() == wxDF_BITMAP)
+ if (format.GetType() == wxDF_BITMAP)
{
wxBitmapDataObject *bitmap_object = (wxBitmapDataObject*) data;
- if (bitmap_object->GetDataSize(wxDF_BITMAP) == 0) return;
+ if (bitmap_object->GetDataSize() == 0) return;
gtk_selection_data_set(
selection_data,
GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar),
- (unsigned char*) bitmap_object->GetData(),
- (int) bitmap_object->GetDataSize(wxDF_BITMAP) );
+ (unsigned char*) bitmap_object->GetPngData(),
+ (int) bitmap_object->GetDataSize() );
return;
}
- int size = data->GetDataSize( selection_data->target );
+ int size = data->GetDataSize( format );
if (size == 0) return;
wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
- // we can only store one wxDataObject
+ /* we can only store one wxDataObject */
Clear();
m_data = data;
- /* get native format id of new data object */
- GdkAtom format = data->GetFormat();
-
- wxCHECK_MSG( format, FALSE, wxT("data has invalid format") );
-
/* This should happen automatically, but to be on the safe side */
m_ownsClipboard = FALSE;
m_ownsPrimarySelection = FALSE;
- /* Add handlers if someone requests data */
-
-#if (GTK_MINOR_VERSION > 0)
-
- gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
+ /* get formats from wxDataObjects */
+ wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ];
+ m_data->GetAllFormats( array );
+
+ for (size_t i = 0; i < m_data->GetFormatCount(); i++)
+ {
+ GdkAtom atom = array[i];
+ wxLogDebug( wxT("Clipboard Supported atom %s"), gdk_atom_name( atom ) );
+
+ /* Add handlers if someone requests data. We currently always
+ offer data to the clipboard and the primary selection. Maybe
+ we should make that depend on the usePrimary flag */
+
+ gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
GDK_SELECTION_PRIMARY,
- format,
+ atom,
0 ); /* what is info ? */
- gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
+ gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
g_clipboardAtom,
- format,
+ atom,
0 ); /* what is info ? */
+ }
+
+ delete[] array;
gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
"selection_get",
GTK_SIGNAL_FUNC(selection_handler),
(gpointer) NULL );
-#else
-
- gtk_selection_add_handler( m_clipboardWidget,
- g_clipboardAtom,
- format,
- selection_handler,
- (gpointer) NULL );
-
- gtk_selection_add_handler( m_clipboardWidget,
- GDK_SELECTION_PRIMARY,
- format,
- selection_handler,
- (gpointer) NULL );
-#endif
-
#if wxUSE_THREADS
/* disable GUI threads */
wxapp_uninstall_thread_wakeup();
{
wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
- /* is data supported by clipboard ? */
-
- if (!IsSupported( data->GetFormat() )) return FALSE;
+ /* get formats from wxDataObjects */
+ wxDataFormat *array = new wxDataFormat[ data.GetFormatCount() ];
+ data.GetAllFormats( array );
- /* store pointer to data object to be filled up by callbacks */
+ for (size_t i = 0; i < data.GetFormatCount(); i++)
+ {
+ /* is data supported by clipboard ? */
+ if (!IsSupported( array[i] ))
+ continue;
- m_receivedData = data;
+ /* store pointer to data object to be filled up by callbacks */
+ m_receivedData = &data;
- /* store requested format to be asked for by callbacks */
-
- m_targetRequested = data->GetFormat();
+ /* store requested format to be asked for by callbacks */
+ m_targetRequested = array[i];
- wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+ wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
- /* start query */
-
- m_formatSupported = FALSE;
+ /* start query */
+ m_formatSupported = FALSE;
- /* ask for clipboard contents. this will set
- m_formatSupported to TRUE if m_targetRequested
- is supported.
- also, we have to wait for the "answer" from the
- clipboard owner which is an asynchronous process.
- therefore we set m_waiting = TRUE here and wait
- until the callback "targets_selection_received"
- sets it to FALSE */
-
- m_waiting = TRUE;
-
- gtk_selection_convert( m_clipboardWidget,
+ /* ask for clipboard contents. this will set
+ m_formatSupported to TRUE if m_targetRequested
+ is supported.
+ also, we have to wait for the "answer" from the
+ clipboard owner which is an asynchronous process.
+ therefore we set m_waiting = TRUE here and wait
+ until the callback "targets_selection_received"
+ sets it to FALSE */
+
+ m_waiting = TRUE;
+
+ gtk_selection_convert( m_clipboardWidget,
m_usePrimary ? GDK_SELECTION_PRIMARY : g_clipboardAtom,
m_targetRequested,
GDK_CURRENT_TIME );
- while (m_waiting) gtk_main_iteration();
+ while (m_waiting) gtk_main_iteration();
- /* this is a true error as we checked for the presence of such data before */
-
- wxCHECK_MSG( m_formatSupported, FALSE, wxT("error retrieving data from clipboard") );
+ /* this is a true error as we checked for the presence of such data before */
+ wxCHECK_MSG( m_formatSupported, FALSE, wxT("error retrieving data from clipboard") );
+
+ /* return success */
+ delete[] array;
+ return TRUE;
+ }
- return TRUE;
+ /* return failure */
+ delete[] array;
+ return FALSE;
}
#endif
// wxDataObject
//-------------------------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS( wxDataObject, wxObject )
-
wxDataObject::wxDataObject()
{
}
-wxDataObject::~wxDataObject()
+bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const
{
-}
-
-bool wxDataObject::IsSupportedFormat(const wxDataFormat& format) const
-{
- size_t nFormatCount = GetFormatCount();
+ size_t nFormatCount = GetFormatCount(dir);
if ( nFormatCount == 1 ) {
return format == GetPreferredFormat();
}
else {
wxDataFormat *formats = new wxDataFormat[nFormatCount];
- GetAllFormats(formats);
+ GetAllFormats(formats,dir);
size_t n;
for ( n = 0; n < nFormatCount; n++ ) {
bool wxFileDataObject::GetDataHere(void *buf) const
{
- const wxString& filenames = GetFilenames();
+ wxString filenames;
+
+ for (size_t i = 0; i < m_filenames.GetCount(); i++)
+ {
+ filenames += m_filenames[i];
+ filenames += (wxChar) 0;
+ }
+
memcpy( buf, filenames.mbc_str(), filenames.Len() + 1 );
return TRUE;
size_t wxFileDataObject::GetDataSize() const
{
- return GetFilenames().Len() + 1;
+ size_t res = 0;
+
+ for (size_t i = 0; i < m_filenames.GetCount(); i++)
+ {
+ res += m_filenames[i].Len();
+ res += 1;
+ }
+
+ return res + 1;
}
-bool wxFileDataObject::SetData(const void *buf)
+bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf)
{
- SetFilenames((const wxChar *)buf);
+ /* TODO */
+
+ wxString file( (const char *)buf ); /* char, not wxChar */
+
+ AddFile( file );
return TRUE;
}
+void wxFileDataObject::AddFile( const wxString &filename )
+{
+ m_filenames.Add( filename );
+}
+
// ----------------------------------------------------------------------------
// wxBitmapDataObject
// ----------------------------------------------------------------------------
}
m_bitmap = image.ConvertToBitmap();
+
+ return m_bitmap.Ok();
}
void wxBitmapDataObject::DoConvertToPng()
handler.SaveFile( &image, mstream );
}
-// ----------------------------------------------------------------------------
-// wxPrivateDataObject
-// ----------------------------------------------------------------------------
-
-IMPLEMENT_CLASS( wxPrivateDataObject, wxDataObject )
-
-void wxPrivateDataObject::Free()
-{
- if ( m_data )
- free(m_data);
-}
-
-wxPrivateDataObject::wxPrivateDataObject()
-{
- wxString id = wxT("application/");
- id += wxTheApp->GetAppName();
-
- m_format.SetId( id );
-
- m_size = 0;
- m_data = (void *)NULL;
-}
-
-void wxPrivateDataObject::SetData( const void *data, size_t size )
-{
- Free();
-
- m_size = size;
- m_data = malloc(size);
-
- memcpy( m_data, data, size );
-}
-
-void wxPrivateDataObject::WriteData( void *dest ) const
-{
- WriteData( m_data, dest );
-}
-
-size_t wxPrivateDataObject::GetSize() const
-{
- return m_size;
-}
-
-void wxPrivateDataObject::WriteData( const void *data, void *dest ) const
-{
- memcpy( dest, data, GetSize() );
-}
// wxDropTarget
//----------------------------------------------------------------------------
-wxDropTarget::wxDropTarget( wxDataObject *data )
+wxDropTarget::wxDropTarget( wxDataObject *data )
+ : wxDropTargetBase( data )
{
m_firstMotion = TRUE;
m_dragContext = (GdkDragContext*) NULL;
m_dragWidget = (GtkWidget*) NULL;
m_dragData = (GtkSelectionData*) NULL;
m_dragTime = 0;
- m_data = data;
-}
-
-wxDropTarget::~wxDropTarget()
-{
}
bool wxDropTarget::OnEnter( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
return (GetMatchingPair() != (GdkAtom) 0);
}
-void wxDropTarget::OnLeave()
-{
-}
-
bool wxDropTarget::OnMove( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
return (GetMatchingPair() != (GdkAtom) 0);
bool wxDropTarget::OnDrop( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
return (GetMatchingPair() != (GdkAtom) 0);
bool wxDropTarget::OnData( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
if (GetMatchingPair() == (GdkAtom) 0)
GdkAtom wxDropTarget::GetMatchingPair()
{
- if (!m_data)
+ if (!m_dataObject)
return (GdkAtom) 0;
if (!m_dragContext)
char *name = gdk_atom_name( formatAtom );
if (name) wxLogDebug( "Drop target: drag has format: %s", name );
#endif
- if (m_data->IsSupportedFormat( format ))
+ if (m_dataObject->IsSupportedFormat( format ))
return formatAtom;
child = child->next;
if (!m_dragData)
return FALSE;
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
wxDataFormat dragFormat( m_dragData->target );
- if (!m_data->IsSupportedFormat( dragFormat ))
+ if (!m_dataObject->IsSupportedFormat( dragFormat ))
return FALSE;
if (dragFormat.GetType() == wxDF_TEXT)
{
- wxTextDataObject *text_object = (wxTextDataObject*)m_data;
+ wxTextDataObject *text_object = (wxTextDataObject*)m_dataObject;
text_object->SetText( (const char*)m_dragData->data );
return TRUE;
}
if (dragFormat.GetType() == wxDF_FILENAME)
{
- wxFileDataObject *file_object = (wxFileDataObject*)m_data;
- file_object->SetFiles( (const char*)m_dragData->data );
+ wxFileDataObject *file_object = (wxFileDataObject*)m_dataObject;
+ file_object->SetData( 0, (const char*)m_dragData->data );
return TRUE;
}
m_widget = win->m_widget;
if (win->m_wxwindow) m_widget = win->m_wxwindow;
- m_data = (wxDataObject*) NULL;
m_retValue = wxDragCancel;
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
const wxIcon &go, const wxIcon &stop )
{
m_waiting = TRUE;
+
+ SetData( data );
m_window = win;
m_widget = win->m_widget;
if (win->m_wxwindow) m_widget = win->m_wxwindow;
m_retValue = wxDragCancel;
- m_data = &data;
-
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
if (wxNullIcon == stop) m_stopIcon = wxIcon( gv_xpm );
}
-void wxDropSource::SetData( wxDataObject& data )
-{
- if (m_data)
- delete m_data;
-
- m_data = &data;
-}
-
wxDropSource::~wxDropSource()
{
- if (m_data)
-// delete m_data;
-
g_blockEventsOnDrag = FALSE;
}
GtkTargetList *target_list = gtk_target_list_new( (GtkTargetEntry*) NULL, 0 );
wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ];
- m_data->GetAllFormats( array, TRUE );
+ m_data->GetAllFormats( array );
for (size_t i = 0; i < m_data->GetFormatCount(); i++)
{
GdkAtom atom = array[i];
#include "wx/dataobj.h"
#include "wx/utils.h"
+#include "wx/log.h"
#include "glib.h"
#include "gdk/gdk.h"
clipboard->m_waiting = FALSE;
return;
}
+
+ wxDataFormat format( selection_data->target );
/* make sure we got the data in the correct format */
- if (data_object->GetFormat() != selection_data->target)
+ if (!data_object->IsSupportedFormat( format ) )
{
clipboard->m_waiting = FALSE;
return;
/* make sure we got the data in the correct form (selection type).
if so, copy data to target object */
- switch (data_object->GetFormat().GetType())
+ switch (format.GetType())
{
case wxDF_TEXT:
{
wxBitmapDataObject *bitmap_object = (wxBitmapDataObject *) data_object;
- bitmap_object->SetPngData( (const void*) selection_data->data, (size_t) selection_data->length );
+ bitmap_object->SetData( (size_t) selection_data->length, (const void*) selection_data->data );
break;
}
return;
}
- wxPrivateDataObject *private_object = (wxPrivateDataObject *) data_object;
-
- private_object->SetData( (const char*) selection_data->data, (size_t) selection_data->length );
+ data_object->SetData( format, (size_t) selection_data->length, (const char*) selection_data->data );
break;
}
wxDataObject *data = wxTheClipboard->m_data;
- if (!data->IsSupportedFormat( selection_data->target )) return;
+ wxDataFormat format( selection_data->target );
+
+ if (!data->IsSupportedFormat( format )) return;
- if (data->GetFormat().GetType() == wxDF_TEXT)
+ if (format.GetType() == wxDF_TEXT)
{
wxTextDataObject *text_object = (wxTextDataObject*) data;
wxString text( text_object->GetText() );
return;
}
- if (data->GetFormat().GetType() == wxDF_BITMAP)
+ if (format.GetType() == wxDF_BITMAP)
{
wxBitmapDataObject *bitmap_object = (wxBitmapDataObject*) data;
- if (bitmap_object->GetDataSize(wxDF_BITMAP) == 0) return;
+ if (bitmap_object->GetDataSize() == 0) return;
gtk_selection_data_set(
selection_data,
GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar),
- (unsigned char*) bitmap_object->GetData(),
- (int) bitmap_object->GetDataSize(wxDF_BITMAP) );
+ (unsigned char*) bitmap_object->GetPngData(),
+ (int) bitmap_object->GetDataSize() );
return;
}
- int size = data->GetDataSize( selection_data->target );
+ int size = data->GetDataSize( format );
if (size == 0) return;
wxCHECK_MSG( data, FALSE, wxT("data is invalid") );
- // we can only store one wxDataObject
+ /* we can only store one wxDataObject */
Clear();
m_data = data;
- /* get native format id of new data object */
- GdkAtom format = data->GetFormat();
-
- wxCHECK_MSG( format, FALSE, wxT("data has invalid format") );
-
/* This should happen automatically, but to be on the safe side */
m_ownsClipboard = FALSE;
m_ownsPrimarySelection = FALSE;
- /* Add handlers if someone requests data */
-
-#if (GTK_MINOR_VERSION > 0)
-
- gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
+ /* get formats from wxDataObjects */
+ wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ];
+ m_data->GetAllFormats( array );
+
+ for (size_t i = 0; i < m_data->GetFormatCount(); i++)
+ {
+ GdkAtom atom = array[i];
+ wxLogDebug( wxT("Clipboard Supported atom %s"), gdk_atom_name( atom ) );
+
+ /* Add handlers if someone requests data. We currently always
+ offer data to the clipboard and the primary selection. Maybe
+ we should make that depend on the usePrimary flag */
+
+ gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
GDK_SELECTION_PRIMARY,
- format,
+ atom,
0 ); /* what is info ? */
- gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
+ gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
g_clipboardAtom,
- format,
+ atom,
0 ); /* what is info ? */
+ }
+
+ delete[] array;
gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
"selection_get",
GTK_SIGNAL_FUNC(selection_handler),
(gpointer) NULL );
-#else
-
- gtk_selection_add_handler( m_clipboardWidget,
- g_clipboardAtom,
- format,
- selection_handler,
- (gpointer) NULL );
-
- gtk_selection_add_handler( m_clipboardWidget,
- GDK_SELECTION_PRIMARY,
- format,
- selection_handler,
- (gpointer) NULL );
-#endif
-
#if wxUSE_THREADS
/* disable GUI threads */
wxapp_uninstall_thread_wakeup();
{
wxCHECK_MSG( m_open, FALSE, wxT("clipboard not open") );
- /* is data supported by clipboard ? */
-
- if (!IsSupported( data->GetFormat() )) return FALSE;
+ /* get formats from wxDataObjects */
+ wxDataFormat *array = new wxDataFormat[ data.GetFormatCount() ];
+ data.GetAllFormats( array );
- /* store pointer to data object to be filled up by callbacks */
+ for (size_t i = 0; i < data.GetFormatCount(); i++)
+ {
+ /* is data supported by clipboard ? */
+ if (!IsSupported( array[i] ))
+ continue;
- m_receivedData = data;
+ /* store pointer to data object to be filled up by callbacks */
+ m_receivedData = &data;
- /* store requested format to be asked for by callbacks */
-
- m_targetRequested = data->GetFormat();
+ /* store requested format to be asked for by callbacks */
+ m_targetRequested = array[i];
- wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
+ wxCHECK_MSG( m_targetRequested, FALSE, wxT("invalid clipboard format") );
- /* start query */
-
- m_formatSupported = FALSE;
+ /* start query */
+ m_formatSupported = FALSE;
- /* ask for clipboard contents. this will set
- m_formatSupported to TRUE if m_targetRequested
- is supported.
- also, we have to wait for the "answer" from the
- clipboard owner which is an asynchronous process.
- therefore we set m_waiting = TRUE here and wait
- until the callback "targets_selection_received"
- sets it to FALSE */
-
- m_waiting = TRUE;
-
- gtk_selection_convert( m_clipboardWidget,
+ /* ask for clipboard contents. this will set
+ m_formatSupported to TRUE if m_targetRequested
+ is supported.
+ also, we have to wait for the "answer" from the
+ clipboard owner which is an asynchronous process.
+ therefore we set m_waiting = TRUE here and wait
+ until the callback "targets_selection_received"
+ sets it to FALSE */
+
+ m_waiting = TRUE;
+
+ gtk_selection_convert( m_clipboardWidget,
m_usePrimary ? GDK_SELECTION_PRIMARY : g_clipboardAtom,
m_targetRequested,
GDK_CURRENT_TIME );
- while (m_waiting) gtk_main_iteration();
+ while (m_waiting) gtk_main_iteration();
- /* this is a true error as we checked for the presence of such data before */
-
- wxCHECK_MSG( m_formatSupported, FALSE, wxT("error retrieving data from clipboard") );
+ /* this is a true error as we checked for the presence of such data before */
+ wxCHECK_MSG( m_formatSupported, FALSE, wxT("error retrieving data from clipboard") );
+
+ /* return success */
+ delete[] array;
+ return TRUE;
+ }
- return TRUE;
+ /* return failure */
+ delete[] array;
+ return FALSE;
}
#endif
// wxDataObject
//-------------------------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS( wxDataObject, wxObject )
-
wxDataObject::wxDataObject()
{
}
-wxDataObject::~wxDataObject()
+bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const
{
-}
-
-bool wxDataObject::IsSupportedFormat(const wxDataFormat& format) const
-{
- size_t nFormatCount = GetFormatCount();
+ size_t nFormatCount = GetFormatCount(dir);
if ( nFormatCount == 1 ) {
return format == GetPreferredFormat();
}
else {
wxDataFormat *formats = new wxDataFormat[nFormatCount];
- GetAllFormats(formats);
+ GetAllFormats(formats,dir);
size_t n;
for ( n = 0; n < nFormatCount; n++ ) {
bool wxFileDataObject::GetDataHere(void *buf) const
{
- const wxString& filenames = GetFilenames();
+ wxString filenames;
+
+ for (size_t i = 0; i < m_filenames.GetCount(); i++)
+ {
+ filenames += m_filenames[i];
+ filenames += (wxChar) 0;
+ }
+
memcpy( buf, filenames.mbc_str(), filenames.Len() + 1 );
return TRUE;
size_t wxFileDataObject::GetDataSize() const
{
- return GetFilenames().Len() + 1;
+ size_t res = 0;
+
+ for (size_t i = 0; i < m_filenames.GetCount(); i++)
+ {
+ res += m_filenames[i].Len();
+ res += 1;
+ }
+
+ return res + 1;
}
-bool wxFileDataObject::SetData(const void *buf)
+bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf)
{
- SetFilenames((const wxChar *)buf);
+ /* TODO */
+
+ wxString file( (const char *)buf ); /* char, not wxChar */
+
+ AddFile( file );
return TRUE;
}
+void wxFileDataObject::AddFile( const wxString &filename )
+{
+ m_filenames.Add( filename );
+}
+
// ----------------------------------------------------------------------------
// wxBitmapDataObject
// ----------------------------------------------------------------------------
}
m_bitmap = image.ConvertToBitmap();
+
+ return m_bitmap.Ok();
}
void wxBitmapDataObject::DoConvertToPng()
handler.SaveFile( &image, mstream );
}
-// ----------------------------------------------------------------------------
-// wxPrivateDataObject
-// ----------------------------------------------------------------------------
-
-IMPLEMENT_CLASS( wxPrivateDataObject, wxDataObject )
-
-void wxPrivateDataObject::Free()
-{
- if ( m_data )
- free(m_data);
-}
-
-wxPrivateDataObject::wxPrivateDataObject()
-{
- wxString id = wxT("application/");
- id += wxTheApp->GetAppName();
-
- m_format.SetId( id );
-
- m_size = 0;
- m_data = (void *)NULL;
-}
-
-void wxPrivateDataObject::SetData( const void *data, size_t size )
-{
- Free();
-
- m_size = size;
- m_data = malloc(size);
-
- memcpy( m_data, data, size );
-}
-
-void wxPrivateDataObject::WriteData( void *dest ) const
-{
- WriteData( m_data, dest );
-}
-
-size_t wxPrivateDataObject::GetSize() const
-{
- return m_size;
-}
-
-void wxPrivateDataObject::WriteData( const void *data, void *dest ) const
-{
- memcpy( dest, data, GetSize() );
-}
// wxDropTarget
//----------------------------------------------------------------------------
-wxDropTarget::wxDropTarget( wxDataObject *data )
+wxDropTarget::wxDropTarget( wxDataObject *data )
+ : wxDropTargetBase( data )
{
m_firstMotion = TRUE;
m_dragContext = (GdkDragContext*) NULL;
m_dragWidget = (GtkWidget*) NULL;
m_dragData = (GtkSelectionData*) NULL;
m_dragTime = 0;
- m_data = data;
-}
-
-wxDropTarget::~wxDropTarget()
-{
}
bool wxDropTarget::OnEnter( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
return (GetMatchingPair() != (GdkAtom) 0);
}
-void wxDropTarget::OnLeave()
-{
-}
-
bool wxDropTarget::OnMove( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
return (GetMatchingPair() != (GdkAtom) 0);
bool wxDropTarget::OnDrop( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
return (GetMatchingPair() != (GdkAtom) 0);
bool wxDropTarget::OnData( int WXUNUSED(x), int WXUNUSED(y) )
{
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
if (GetMatchingPair() == (GdkAtom) 0)
GdkAtom wxDropTarget::GetMatchingPair()
{
- if (!m_data)
+ if (!m_dataObject)
return (GdkAtom) 0;
if (!m_dragContext)
char *name = gdk_atom_name( formatAtom );
if (name) wxLogDebug( "Drop target: drag has format: %s", name );
#endif
- if (m_data->IsSupportedFormat( format ))
+ if (m_dataObject->IsSupportedFormat( format ))
return formatAtom;
child = child->next;
if (!m_dragData)
return FALSE;
- if (!m_data)
+ if (!m_dataObject)
return FALSE;
wxDataFormat dragFormat( m_dragData->target );
- if (!m_data->IsSupportedFormat( dragFormat ))
+ if (!m_dataObject->IsSupportedFormat( dragFormat ))
return FALSE;
if (dragFormat.GetType() == wxDF_TEXT)
{
- wxTextDataObject *text_object = (wxTextDataObject*)m_data;
+ wxTextDataObject *text_object = (wxTextDataObject*)m_dataObject;
text_object->SetText( (const char*)m_dragData->data );
return TRUE;
}
if (dragFormat.GetType() == wxDF_FILENAME)
{
- wxFileDataObject *file_object = (wxFileDataObject*)m_data;
- file_object->SetFiles( (const char*)m_dragData->data );
+ wxFileDataObject *file_object = (wxFileDataObject*)m_dataObject;
+ file_object->SetData( 0, (const char*)m_dragData->data );
return TRUE;
}
m_widget = win->m_widget;
if (win->m_wxwindow) m_widget = win->m_wxwindow;
- m_data = (wxDataObject*) NULL;
m_retValue = wxDragCancel;
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
const wxIcon &go, const wxIcon &stop )
{
m_waiting = TRUE;
+
+ SetData( data );
m_window = win;
m_widget = win->m_widget;
if (win->m_wxwindow) m_widget = win->m_wxwindow;
m_retValue = wxDragCancel;
- m_data = &data;
-
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
if (wxNullIcon == stop) m_stopIcon = wxIcon( gv_xpm );
}
-void wxDropSource::SetData( wxDataObject& data )
-{
- if (m_data)
- delete m_data;
-
- m_data = &data;
-}
-
wxDropSource::~wxDropSource()
{
- if (m_data)
-// delete m_data;
-
g_blockEventsOnDrag = FALSE;
}
GtkTargetList *target_list = gtk_target_list_new( (GtkTargetEntry*) NULL, 0 );
wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ];
- m_data->GetAllFormats( array, TRUE );
+ m_data->GetAllFormats( array );
for (size_t i = 0; i < m_data->GetFormatCount(); i++)
{
GdkAtom atom = array[i];