]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/dcscreen.cpp
Upport scrolling changes and mouse wheel changes.
[wxWidgets.git] / src / x11 / dcscreen.cpp
index 0efabc519cd3b1994659533bc135228460594fd8..8bcb5f410b7437c2321efabdce6be362c582e42c 100644 (file)
@@ -1,22 +1,27 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        dcscreen.cpp
+// Name:        src/x11/dcscreen.cpp
 // Purpose:     wxScreenDC class
 // Author:      Julian Smart, Robert Roebling
 // Modified by:
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart, Robert Roebling
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#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"
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/utils.h"
+    #include "wx/window.h"
+    #include "wx/frame.h"
+#endif
+
+#include "wx/fontutil.h"
 
 #include "wx/x11/private.h"
 
@@ -36,16 +41,21 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
 
 wxScreenDC::wxScreenDC()
 {
-    m_ok = FALSE;
-    
+    m_ok = false;
+
     m_display = (WXDisplay *) wxGlobalDisplay();
-    
+
     int screen = DefaultScreen( (Display*) m_display );
     m_cmap = (WXColormap) DefaultColormap( (Display*) m_display, screen );
-    
+
     m_window = (WXWindow) RootWindow( (Display*) m_display, screen );
 
-    m_isScreenDC = TRUE;
+    m_isScreenDC = true;
+
+#if wxUSE_UNICODE
+    m_context = wxTheApp->GetPangoContext();
+    m_fontdesc = wxNORMAL_FONT->GetNativeFontInfo()->description;
+#endif
 
     SetUpDC();
 
@@ -86,31 +96,30 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
     return StartDrawingOnTop( &rect );
 }
 
-bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
+bool wxScreenDC::StartDrawingOnTop( wxRect *rectIn )
 {
-    int x = 0;
-    int y = 0;
+    // VZ: should we do the same thing that wxMotif wxScreenDC does here?
 #if 0
-    int width = gdk_screen_width();
-    int height = gdk_screen_height();
-#else
-    int width = 1024;
-    int height = 768;
-#endif
-    if (rect)
+    wxRect rect;
+    if ( rectIn )
+    {
+        rect = *rectIn;
+    }
+    else
     {
-        x = rect->x;
-        y = rect->y;
-        width = rect->width;
-        height = rect->height;
+        rect.x =
+        rect.y = 0;
+
+        DoGetSize(&rect.width, &rect.height);
     }
+#endif // 0
 
-    return TRUE;
+    return true;
 }
 
 bool wxScreenDC::EndDrawingOnTop()
 {
-    return TRUE;
+    return true;
 }
 
 void wxScreenDC::DoGetSize(int *width, int *height) const