// Purpose:
// Author: Robert Roebling
// RCS-ID: $Id$
-// Copyright: (c) 1998 Robert Roebling, Markus Holzem
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "dc.h"
#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#include "wx/dc.h"
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
// constants
{
m_ok = FALSE;
- m_mm_to_pix_x = 1.0;
- m_mm_to_pix_y = 1.0;
+ m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() /
+ (double)wxGetDisplaySizeMM().GetWidth();
+ m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() /
+ (double)wxGetDisplaySizeMM().GetHeight();
m_needComputeScaleX = FALSE; /* not used yet */
m_needComputeScaleY = FALSE; /* not used yet */
m_clipY2 = y + height;
}
-void wxDC::DestroyClippingRegion()
-{
- m_clipping = FALSE;
-}
-
// ---------------------------------------------------------------------------
// get DC capabilities
// ---------------------------------------------------------------------------
-void wxDC::DoGetSize( int* width, int* height ) const
-{
- if (width) *width = m_maxX-m_minX;
- if (height) *height = m_maxY-m_minY;
-}
-
void wxDC::DoGetSizeMM( int* width, int* height ) const
{
int w = 0;
int h = 0;
GetSize( &w, &h );
- if (width) *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) );
- if (height) *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) );
+ if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) );
+ if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) );
}
// Resolution in pixels per logical inch