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();
|
|
|
|
|
1999-01-19 11:33:16 -05:00
|
|
|
/* open the clipboard before SetData() and GetData() */
|
1998-12-14 11:13:49 -05:00
|
|
|
virtual bool Open();
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1999-01-19 11:33:16 -05:00
|
|
|
/* close the clipboard after SetData() and GetData() */
|
1998-12-14 11:13:49 -05:00
|
|
|
virtual void Close();
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1999-01-19 11:33:16 -05:00
|
|
|
/* set the clipboard data. the clipboard will delete the broker later */
|
|
|
|
virtual bool SetData( wxDataBroker *data );
|
1998-12-14 11:13:49 -05:00
|
|
|
|
1999-01-19 11:33:16 -05:00
|
|
|
/* fill data with data on the clipboard (if available) */
|
1998-12-14 11:13:49 -05:00
|
|
|
virtual bool GetData( wxDataObject *data );
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1999-01-19 11:33:16 -05:00
|
|
|
/* clears wxTheClipboard and the system's clipboard if possible */
|
1998-12-08 03:40:00 -05:00
|
|
|
virtual void Clear();
|
1998-11-02 09:12:29 -05:00
|
|
|
|
1999-01-19 11:33:16 -05:00
|
|
|
/* implementation */
|
1998-12-14 11:13:49 -05:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
1999-01-19 11:33:16 -05:00
|
|
|
wxDataBroker *m_dataBroker;
|
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__
|