]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/clipbrd.cpp
removed settingsdlg from makefile.g95 - not part of the library
[wxWidgets.git] / src / gtk1 / clipbrd.cpp
index 99ce0ac8b8945feade294b666ce3a88c2af93e56..1e061e32011c4caf71e0845152cc1613de76fb9d 100644 (file)
@@ -75,6 +75,9 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
 
     for (unsigned int i=0; i<selection_data->length/sizeof(GdkAtom); i++)
     {
+      char *name = gdk_atom_name (atoms[i]);
+      if (name) printf( "Format available: %s.\n", name );
+      
         if (atoms[i] == clipboard->m_targetRequested)
         {
             clipboard->m_formatSupported = TRUE;
@@ -382,6 +385,26 @@ bool wxClipboard::AddData( wxDataObject *data )
     
     /* Add handlers if someone requests data */
   
+
+#if (GTK_MINOR_VERSION > 0)
+
+    gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget), 
+                              GDK_SELECTION_PRIMARY,
+                             format, 
+                             0 );  /* what is info ? */
+                            
+    gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget), 
+                              g_clipboardAtom,
+                             format, 
+                             0 );  /* what is info ? */
+                            
+    gtk_signal_connect( GTK_OBJECT(m_clipboardWidget), 
+                        "selection_get",
+                       GTK_SIGNAL_FUNC(selection_handler), 
+                       (gpointer) NULL );
+
+#else
+
     gtk_selection_add_handler( m_clipboardWidget, 
                                g_clipboardAtom,
                               format,
@@ -393,6 +416,7 @@ bool wxClipboard::AddData( wxDataObject *data )
                               format,
                               selection_handler,
                               (gpointer) NULL );
+#endif
                               
     /* Tell the world we offer clipboard data */
   
@@ -422,13 +446,13 @@ void wxClipboard::Close()
     m_open = FALSE;
 }
 
-bool wxClipboard::IsSupported( wxDataObject &data )
+bool wxClipboard::IsSupported( wxDataFormat format )
 {
     wxCHECK_MSG( m_open, FALSE, "clipboard not open" );
     
     /* store requested format to be asked for by callbacks */
     
-    m_targetRequested = data.GetFormat().GetAtom();
+    m_targetRequested = format.GetAtom();
   
     wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );
     
@@ -458,21 +482,21 @@ bool wxClipboard::IsSupported( wxDataObject &data )
     return TRUE;
 }    
     
-bool wxClipboard::GetData( wxDataObject &data )
+bool wxClipboard::GetData( wxDataObject *data )
 {
     wxCHECK_MSG( m_open, FALSE, "clipboard not open" );
     
     /* is data supported by clipboard ? */
     
-    if (!IsSupported( data )) return FALSE;
+    if (!IsSupported( data->GetFormat() )) return FALSE;
     
     /* store pointer to data object to be filled up by callbacks */
     
-    m_receivedData = &data;
+    m_receivedData = data;
     
     /* store requested format to be asked for by callbacks */
     
-    m_targetRequested = data.GetFormat().GetAtom();
+    m_targetRequested = data->GetFormat().GetAtom();
   
     wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );