]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dcscreen.cpp
use unsgined int instead of int for 1 bit bitfields (SGI CC warning fix)
[wxWidgets.git] / src / motif / dcscreen.cpp
index 04c409033ff0b803b2ca07b9c1d73bf01ec30787..44fc92f682f370c0b4c3fc9f0aa11ff86cf9ff86 100644 (file)
@@ -9,20 +9,29 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
 #pragma implementation "dcscreen.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/window.h"
+#include "wx/frame.h"
 #include "wx/dcscreen.h"
 #include "wx/utils.h"
 
 #include "wx/dcscreen.h"
 #include "wx/utils.h"
 
+#ifdef __VMS__
+#pragma message disable nosimpint
+#endif
 #include <Xm/Xm.h>
 #include <Xm/Xm.h>
+#ifdef __VMS__
+#pragma message enable nosimpint
+#endif
 
 
-#include <wx/motif/private.h>
+#include "wx/motif/private.h"
 
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
-#endif
 
 WXWindow wxScreenDC::sm_overlayWindow = 0;
 int wxScreenDC::sm_overlayWindowX = 0;
 
 WXWindow wxScreenDC::sm_overlayWindow = 0;
 int wxScreenDC::sm_overlayWindowX = 0;
@@ -54,11 +63,12 @@ wxScreenDC::wxScreenDC()
         &gcvalues);
     
     m_backgroundPixel = (int) gcvalues.background;
         &gcvalues);
     
     m_backgroundPixel = (int) gcvalues.background;
-    m_ok = TRUE;
+    m_ok = true;
 }
 
 wxScreenDC::~wxScreenDC()
 {
 }
 
 wxScreenDC::~wxScreenDC()
 {
+    EndDrawingOnTop();
 }
 
 bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
 }
 
 bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
@@ -66,7 +76,7 @@ bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
     wxRect rect;
     int x, y, width, height;
     window->GetPosition(& x, & y);
     wxRect rect;
     int x, y, width, height;
     window->GetPosition(& x, & y);
-    if (window->GetParent())
+    if (window->GetParent() && !window->IsKindOf(CLASSINFO(wxFrame)))
         window->GetParent()->ClientToScreen(& x, & y);
     window->GetSize(& width, & height);
     rect.x = x; rect.y = y;
         window->GetParent()->ClientToScreen(& x, & y);
     window->GetSize(& width, & height);
     rect.x = x; rect.y = y;
@@ -78,7 +88,7 @@ bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
 bool wxScreenDC::StartDrawingOnTop(wxRect* rect)
 {
     if (sm_overlayWindow)
 bool wxScreenDC::StartDrawingOnTop(wxRect* rect)
 {
     if (sm_overlayWindow)
-        return FALSE;
+        return false;
     
     Display *dpy = (Display*) wxGetDisplay();
     Pixmap screenPixmap = RootWindow(dpy, DefaultScreen(dpy));
     
     Display *dpy = (Display*) wxGetDisplay();
     Pixmap screenPixmap = RootWindow(dpy, DefaultScreen(dpy));
@@ -108,10 +118,10 @@ bool wxScreenDC::StartDrawingOnTop(wxRect* rect)
     if (sm_overlayWindow)
     {
         XMapWindow(dpy, (Window) sm_overlayWindow);
     if (sm_overlayWindow)
     {
         XMapWindow(dpy, (Window) sm_overlayWindow);
-        return TRUE;
+        return true;
     }
     else
     }
     else
-        return FALSE;
+        return false;
 }
 
 bool wxScreenDC::EndDrawingOnTop()
 }
 
 bool wxScreenDC::EndDrawingOnTop()
@@ -120,8 +130,8 @@ bool wxScreenDC::EndDrawingOnTop()
     {
         XDestroyWindow((Display*) wxGetDisplay(), (Window) sm_overlayWindow);
         sm_overlayWindow = 0;
     {
         XDestroyWindow((Display*) wxGetDisplay(), (Window) sm_overlayWindow);
         sm_overlayWindow = 0;
-        return TRUE;
+        return true;
     }
     else
     }
     else
-        return FALSE;
+        return false;
 }
 }