1998-11-02 09:12:29 -05: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 08:52:06 -05:00
|
|
|
|
1999-01-06 16:09:17 -05:00
|
|
|
#if wxUSE_CLIPBOARD
|
1999-01-04 08:52:06 -05:00
|
|
|
|
1998-11-02 09:12:29 -05:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
1998-12-14 11:13:49 -05:00
|
|
|
#include "wx/dataobj.h"
|
1998-11-02 09:12:29 -05:00
|
|
|
#include "wx/control.h"
|
1998-12-08 03:40:00 -05:00
|
|
|
#include "wx/module.h"
|
1998-11-02 09:12:29 -05:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxClipboard;
|
1998-12-08 03:40:00 -05:00
|
|
|
class wxClipboardModule;
|
1998-11-02 09:12:29 -05:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern wxClipboard* wxTheClipboard;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboard
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-12-08 03:40:00 -05:00
|
|
|
class wxClipboard: public wxObject
|
1998-11-02 09:12:29 -05:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxClipboard();
|
|
|
|
~wxClipboard();
|
|
|
|
|
1998-12-14 11:13:49 -05:00
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1998-12-14 11:13:49 -05:00
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1998-12-14 11:13:49 -05: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 03:40:00 -05:00
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
1998-11-02 09:12:29 -05:00
|
|
|
|
|
|
|
// implementation
|
1998-12-14 11:13:49 -05:00
|
|
|
|
|
|
|
GdkAtom GetTargetAtom( wxDataFormat format, const wxString &id = "" );
|
|
|
|
|
|
|
|
bool m_open;
|
1998-11-02 09:12:29 -05:00
|
|
|
|
1998-12-18 10:49:10 -05:00
|
|
|
bool m_ownsClipboard;
|
|
|
|
bool m_ownsPrimarySelection;
|
|
|
|
|
1998-12-14 11:13:49 -05:00
|
|
|
wxList m_dataObjects;
|
1998-12-08 03:40:00 -05:00
|
|
|
GtkWidget *m_clipboardWidget;
|
|
|
|
|
|
|
|
bool m_formatSupported;
|
|
|
|
GdkAtom m_targetRequested;
|
|
|
|
|
1998-12-14 11:13:49 -05:00
|
|
|
wxDataObject *m_receivedData;
|
1998-12-08 03:40:00 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboardModule
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxClipboardModule: public wxModule
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxClipboardModule() {}
|
|
|
|
bool OnInit();
|
|
|
|
void OnExit();
|
1998-11-02 09:12:29 -05:00
|
|
|
};
|
|
|
|
|
1999-01-04 08:52:06 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// wxUSE_CLIPBOARD
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1998-11-02 09:12:29 -05:00
|
|
|
#endif
|
|
|
|
// __GTKCLIPBOARDH__
|