]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/clipbrd.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "clipbrd.h"
14 #include "wx/clipbrd.h"
16 //-----------------------------------------------------------------------------
18 //-----------------------------------------------------------------------------
20 wxClipboard
*wxTheClipboard
= (wxClipboard
*) NULL
;
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
26 void wxInitClipboard()
28 if (wxTheClipboard
) delete wxTheClipboard
;
29 wxTheClipboard
= new wxClipboard();
32 void wxDoneClipboard()
34 if (wxTheClipboard
) delete wxTheClipboard
;
35 wxTheClipboard
= (wxClipboard
*) NULL
;
38 //-----------------------------------------------------------------------------
39 // "selection_received"
40 //-----------------------------------------------------------------------------
43 static void selection_received( GtkWidget *widget, GtkSelectionData *selection_data, gpointer data )
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 IMPLEMENT_DYNAMIC_CLASS(wxClipboard
,wxObject
)
54 wxClipboard::wxClipboard()
56 m_data
= (wxDataObject
*)NULL
;
57 m_clipboardWidget
= gtk_window_new( GTK_WINDOW_POPUP
);
58 gtk_widget_realize( m_clipboardWidget
);
61 wxClipboard::~wxClipboard()
63 if (m_data
) delete m_data
;
64 if (m_clipboardWidget
) gtk_widget_destroy( m_clipboardWidget
);
67 void wxClipboard::SetData( wxDataObject
*data
)
69 if (m_data
) delete m_data
;
73 void *wxClipboard::GetData( wxDataFormat format
, size_t *length
)
75 if (!IsAvailable(format
))
77 if (length
) *length
= 0;
83 bool wxClipboard::IsAvailable( wxDataFormat
WXUNUSED(format
) )