Include wx/dataobj.h from wx/clipbrd.h.
This is necessary in order to define wxVector<wxDataFormat> at least when wxVector is std::vector (as in wxUSE_STL==1 build) because vectors of incomplete types can't be used. Also removed inclusions of this and other unneeded headers from MSW and OS X headers and removed a hopefully out of date comment about Mac code being wx 1.xx-based from the latter. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -19,10 +19,9 @@
|
|||||||
|
|
||||||
#include "wx/event.h"
|
#include "wx/event.h"
|
||||||
#include "wx/chartype.h"
|
#include "wx/chartype.h"
|
||||||
|
#include "wx/dataobj.h" // for wxDataFormat
|
||||||
#include "wx/vector.h"
|
#include "wx/vector.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxDataFormat;
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxDataObject;
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxClipboard;
|
class WXDLLIMPEXP_FWD_CORE wxClipboard;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -105,13 +104,25 @@ public:
|
|||||||
class WXDLLIMPEXP_CORE wxClipboardEvent : public wxEvent
|
class WXDLLIMPEXP_CORE wxClipboardEvent : public wxEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxClipboardEvent(wxEventType evtType = wxEVT_NULL);
|
wxClipboardEvent(wxEventType evtType = wxEVT_NULL)
|
||||||
wxClipboardEvent(const wxClipboardEvent& event);
|
: wxEvent(0, evtType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxClipboardEvent(const wxClipboardEvent& event)
|
||||||
|
: wxEvent(event),
|
||||||
|
m_formats(event.m_formats)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
bool SupportsFormat(const wxDataFormat& format) const;
|
bool SupportsFormat(const wxDataFormat& format) const;
|
||||||
void AddFormat(const wxDataFormat& format);
|
void AddFormat(const wxDataFormat& format);
|
||||||
|
|
||||||
virtual wxEvent *Clone() const;
|
virtual wxEvent *Clone() const
|
||||||
|
{
|
||||||
|
return new wxClipboardEvent(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxVector<wxDataFormat> m_formats;
|
wxVector<wxDataFormat> m_formats;
|
||||||
|
@@ -14,10 +14,6 @@
|
|||||||
|
|
||||||
#if wxUSE_CLIPBOARD
|
#if wxUSE_CLIPBOARD
|
||||||
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/module.h"
|
|
||||||
#include "wx/dataobj.h" // for wxDataFormat
|
|
||||||
|
|
||||||
// These functions superceded by wxClipboard, but retained in order to
|
// These functions superceded by wxClipboard, but retained in order to
|
||||||
// implement wxClipboard, and for compatibility.
|
// implement wxClipboard, and for compatibility.
|
||||||
|
|
||||||
@@ -47,11 +43,8 @@ WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat,
|
|||||||
// wxClipboard
|
// wxClipboard
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxDataObject;
|
|
||||||
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxClipboard();
|
wxClipboard();
|
||||||
virtual ~wxClipboard();
|
virtual ~wxClipboard();
|
||||||
@@ -88,6 +81,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
IDataObject *m_lastDataObject;
|
IDataObject *m_lastDataObject;
|
||||||
bool m_isOpened;
|
bool m_isOpened;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_CLIPBOARD
|
#endif // wxUSE_CLIPBOARD
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: clipbrd.h
|
// Name: clipbrd.h
|
||||||
// Purpose: Clipboard functionality.
|
// Purpose: Clipboard functionality.
|
||||||
// Note: this functionality is under review, and
|
|
||||||
// is derived from wxWidgets 1.xx code. Please contact
|
|
||||||
// the wxWidgets developers for further information.
|
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 1998-01-01
|
// Created: 1998-01-01
|
||||||
@@ -17,21 +14,14 @@
|
|||||||
|
|
||||||
#if wxUSE_CLIPBOARD
|
#if wxUSE_CLIPBOARD
|
||||||
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/module.h"
|
|
||||||
#include "wx/dataobj.h" // for wxDataFormat
|
|
||||||
|
|
||||||
#include "wx/osx/core/cfref.h"
|
#include "wx/osx/core/cfref.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxClipboard
|
// wxClipboard
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxDataObject;
|
|
||||||
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxClipboard();
|
wxClipboard();
|
||||||
virtual ~wxClipboard();
|
virtual ~wxClipboard();
|
||||||
@@ -69,6 +59,8 @@ private:
|
|||||||
wxDataObject *m_data;
|
wxDataObject *m_data;
|
||||||
bool m_open;
|
bool m_open;
|
||||||
wxCFRef<PasteboardRef> m_pasteboard;
|
wxCFRef<PasteboardRef> m_pasteboard;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_CLIPBOARD
|
#endif // wxUSE_CLIPBOARD
|
||||||
|
@@ -41,29 +41,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboardEvent,wxEvent)
|
|||||||
|
|
||||||
wxDEFINE_EVENT( wxEVT_CLIPBOARD_CHANGED, wxClipboardEvent );
|
wxDEFINE_EVENT( wxEVT_CLIPBOARD_CHANGED, wxClipboardEvent );
|
||||||
|
|
||||||
// notice that ctors are defined here and not inline to avoid having to include
|
|
||||||
// wx/dataobj.h from wx/clipbrd.h
|
|
||||||
wxClipboardEvent::wxClipboardEvent(wxEventType evtType)
|
|
||||||
: wxEvent(0, evtType)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
wxClipboardEvent::wxClipboardEvent(const wxClipboardEvent& event)
|
|
||||||
: wxEvent(event),
|
|
||||||
m_formats(event.m_formats)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
wxEvent* wxClipboardEvent::Clone() const
|
|
||||||
{
|
|
||||||
return new wxClipboardEvent(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxClipboardEvent::SupportsFormat( const wxDataFormat &format ) const
|
bool wxClipboardEvent::SupportsFormat( const wxDataFormat &format ) const
|
||||||
{
|
{
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
// GTK has an asynchronous API which reports the supported formats one by
|
|
||||||
// one. We may have to add X11 and Motif later.
|
|
||||||
for (wxVector<wxDataFormat>::size_type n = 0; n < m_formats.size(); n++)
|
for (wxVector<wxDataFormat>::size_type n = 0; n < m_formats.size(); n++)
|
||||||
{
|
{
|
||||||
if (m_formats[n] == format)
|
if (m_formats[n] == format)
|
||||||
|
Reference in New Issue
Block a user