]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/clipbrd.cpp
Bit fiddling.
[wxWidgets.git] / src / gtk1 / clipbrd.cpp
CommitLineData
dc86cb34
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: clipbrd.cpp
3// Purpose:
4// Author: Robert Roebling
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10#ifdef __GNUG__
11#pragma implementation "clipbrd.h"
12#endif
13
14#include "wx/clipbrd.h"
15
16//-----------------------------------------------------------------------------
17// data
18//-----------------------------------------------------------------------------
19
20wxClipboard *wxTheClipboard = (wxClipboard*) NULL;
21
22//-----------------------------------------------------------------------------
23// functions
24//-----------------------------------------------------------------------------
25
26void wxInitClipboard()
27{
28 if (wxTheClipboard) delete wxTheClipboard;
29 wxTheClipboard = new wxClipboard();
30}
31
32void wxDoneClipboard()
33{
34 if (wxTheClipboard) delete wxTheClipboard;
35 wxTheClipboard = (wxClipboard*) NULL;
36}
37
38//-----------------------------------------------------------------------------
39// "selection_received"
40//-----------------------------------------------------------------------------
41
42/*
43static void selection_received( GtkWidget *widget, GtkSelectionData *selection_data, gpointer data )
44{
45}
46*/
47
48//-----------------------------------------------------------------------------
49// wxClipboard
50//-----------------------------------------------------------------------------
51
52IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
53
54wxClipboard::wxClipboard()
55{
56 m_data = (wxDataObject*)NULL;
57 m_clipboardWidget = gtk_window_new( GTK_WINDOW_POPUP );
58 gtk_widget_realize( m_clipboardWidget );
59}
60
61wxClipboard::~wxClipboard()
62{
63 if (m_data) delete m_data;
64 if (m_clipboardWidget) gtk_widget_destroy( m_clipboardWidget );
65}
66
67void wxClipboard::SetData( wxDataObject *data )
68{
69 if (m_data) delete m_data;
70 m_data = data;
71}
72
73void *wxClipboard::GetData( wxDataFormat format, size_t *length )
74{
75 if (!IsAvailable(format))
76 {
77 if (length) *length = 0;
78 return NULL;
79 }
80 return NULL;
81}
82
83bool wxClipboard::IsAvailable( wxDataFormat WXUNUSED(format) )
84{
85 return FALSE;
86}