1998-11-02 14:12:29 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: clipboard.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKCLIPBOARDH__
|
|
|
|
#define __GTKCLIPBOARDH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-01-04 13:52:06 +00:00
|
|
|
|
|
|
|
#ifdef wxUSE_CLIPBOARD
|
|
|
|
|
1998-11-02 14:12:29 +00:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
1998-12-14 16:13:49 +00:00
|
|
|
#include "wx/dataobj.h"
|
1998-11-02 14:12:29 +00:00
|
|
|
#include "wx/control.h"
|
1998-12-08 08:40:00 +00:00
|
|
|
#include "wx/module.h"
|
1998-11-02 14:12:29 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxClipboard;
|
1998-12-08 08:40:00 +00:00
|
|
|
class wxClipboardModule;
|
1998-11-02 14:12:29 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern wxClipboard* wxTheClipboard;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboard
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-12-08 08:40:00 +00:00
|
|
|
class wxClipboard: public wxObject
|
1998-11-02 14:12:29 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxClipboard();
|
|
|
|
~wxClipboard();
|
|
|
|
|
1998-12-14 16:13:49 +00:00
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
1998-12-08 08:40:00 +00:00
|
|
|
|
1998-12-14 16:13:49 +00:00
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
1998-12-08 08:40:00 +00:00
|
|
|
|
1998-12-14 16:13:49 +00:00
|
|
|
// can be called several times
|
|
|
|
virtual bool SetData( wxDataObject *data );
|
|
|
|
|
|
|
|
// format available on the clipboard ?
|
|
|
|
// supply ID if private format, the same as wxPrivateDataObject::SetId()
|
|
|
|
virtual bool IsSupportedFormat( wxDataFormat format, const wxString &id = "" );
|
|
|
|
|
|
|
|
// fill data with data on the clipboard (if available)
|
|
|
|
virtual bool GetData( wxDataObject *data );
|
1998-12-08 08:40:00 +00:00
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
1998-11-02 14:12:29 +00:00
|
|
|
|
|
|
|
// implementation
|
1998-12-14 16:13:49 +00:00
|
|
|
|
|
|
|
GdkAtom GetTargetAtom( wxDataFormat format, const wxString &id = "" );
|
|
|
|
|
|
|
|
bool m_open;
|
1998-11-02 14:12:29 +00:00
|
|
|
|
1998-12-18 15:49:10 +00:00
|
|
|
bool m_ownsClipboard;
|
|
|
|
bool m_ownsPrimarySelection;
|
|
|
|
|
1998-12-14 16:13:49 +00:00
|
|
|
wxList m_dataObjects;
|
1998-12-08 08:40:00 +00:00
|
|
|
GtkWidget *m_clipboardWidget;
|
|
|
|
|
|
|
|
bool m_formatSupported;
|
|
|
|
GdkAtom m_targetRequested;
|
|
|
|
|
1998-12-14 16:13:49 +00:00
|
|
|
wxDataObject *m_receivedData;
|
1998-12-08 08:40:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboardModule
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxClipboardModule: public wxModule
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxClipboardModule() {}
|
|
|
|
bool OnInit();
|
|
|
|
void OnExit();
|
1998-11-02 14:12:29 +00:00
|
|
|
};
|
|
|
|
|
1999-01-04 13:52:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// wxUSE_CLIPBOARD
|
1998-12-08 08:40:00 +00:00
|
|
|
|
1998-11-02 14:12:29 +00:00
|
|
|
#endif
|
|
|
|
// __GTKCLIPBOARDH__
|