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"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/dnd.h" // for wxDataObject
|
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();
|
|
|
|
|
|
|
|
virtual void SetData( wxDataObject *data );
|
1998-12-08 03:40:00 -05:00
|
|
|
|
|
|
|
virtual bool IsSupportedFormat( wxDataFormat format );
|
|
|
|
virtual bool ObtainData( wxDataFormat format );
|
|
|
|
|
|
|
|
// call these after ObtainData()
|
|
|
|
virtual size_t GetDataSize() const;
|
|
|
|
virtual void GetDataHere( void *data ) const;
|
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
1998-11-02 09:12:29 -05:00
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
1998-12-08 03:40:00 -05:00
|
|
|
wxDataObject *m_data;
|
|
|
|
char *m_sentString,
|
|
|
|
*m_receivedString;
|
|
|
|
void *m_receivedTargets;
|
|
|
|
GtkWidget *m_clipboardWidget;
|
|
|
|
|
|
|
|
bool m_formatSupported;
|
|
|
|
GdkAtom m_targetRequested;
|
|
|
|
|
|
|
|
size_t m_receivedSize;
|
|
|
|
char *m_receivedData;
|
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboardModule
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxClipboardModule: public wxModule
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxClipboardModule() {}
|
|
|
|
bool OnInit();
|
|
|
|
void OnExit();
|
1998-11-02 09:12:29 -05:00
|
|
|
};
|
|
|
|
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1998-11-02 09:12:29 -05:00
|
|
|
#endif
|
|
|
|
// __GTKCLIPBOARDH__
|