]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/clipbrd.cpp
use unsgined int instead of int for 1 bit bitfields (SGI CC warning fix)
[wxWidgets.git] / src / motif / clipbrd.cpp
index 1d067954ff9a3316a2333185781e11f22ee3208a..7b13ed0d2bfac3076ea3ecad3c7f3bc92673214b 100644 (file)
@@ -9,11 +9,14 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
 #pragma implementation "clipbrd.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #include "wx/vms_x_fix.h"
 #define XtWindow XTWINDOW
@@ -173,13 +176,16 @@ struct wxDataIdToDataObject
 WX_DEFINE_LIST(wxDataObjectList);
 WX_DEFINE_LIST(wxDataIdToDataObjectList);
 
+extern "C"
+{
 #if wxCHECK_LESSTIF()
 static void wxClipboardCallback( Widget widget, int* data_id,
                                  int* priv, int* reason );
-#else
+#else // Motif
 static void wxClipboardCallback( Widget widget, long* data_id,
                                  long* priv, int* reason );
-#endif
+#endif // Less/Motif
+}
 
 IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
 
@@ -205,7 +211,9 @@ void wxClipboard::Clear()
 
     for( wxDataIdToDataObjectList::compatibility_iterator node2 = m_idToObject.GetFirst();
          node2; node2 = node2->GetNext() )
-        delete node->GetData();
+    {
+        delete node2->GetData();
+    }
     m_idToObject.Clear();
 }
 
@@ -280,7 +288,7 @@ bool wxClipboard::AddData( wxDataObject *data )
     m_data.Append( data );
 
     Display* xdisplay = wxGlobalDisplay();
-    Widget xwidget = (Widget)wxTheApp->GetTopLevelWidget();
+    Widget xwidget = (Widget)wxTheApp->GetTopLevelRealizedWidget();
     Window xwindow = XtWindow( xwidget );
     wxXmString label( wxTheApp->GetAppName() );
     Time timestamp = XtLastTimestampProcessed( xdisplay );
@@ -330,7 +338,7 @@ void wxClipboard::Close()
 bool wxClipboard::IsSupported(const wxDataFormat& format)
 {
     Display* xdisplay = wxGlobalDisplay();
-    Window xwindow = XtWindow( (Widget)wxTheApp->GetTopLevelWidget() );
+    Window xwindow = XtWindow( (Widget)wxTheApp->GetTopLevelRealizedWidget() );
     bool isSupported = false;
     int retval, count;
     unsigned long  max_name_length;
@@ -390,7 +398,7 @@ bool wxClipboard::GetData( wxDataObject& data )
     wxCHECK_MSG( m_open, false, "clipboard not open" );
 
     Display* xdisplay = wxGlobalDisplay();
-    Window xwindow = XtWindow( (Widget)wxTheApp->GetTopLevelWidget() );
+    Window xwindow = XtWindow( (Widget)wxTheApp->GetTopLevelRealizedWidget() );
     Time timestamp = XtLastTimestampProcessed( xdisplay );
 
     wxDataFormat chosenFormat;