]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dc.cpp
GetValue() converts using wxConv_current...
[wxWidgets.git] / src / motif / dc.cpp
index bd526de2914abe52a842f1d6faddc44fdf865580..3e822c4836bfbbf552842b994887f75b62fae947 100644 (file)
@@ -61,15 +61,15 @@ wxDC::wxDC(void)
     m_scaleX = 1.0;
     m_scaleY = 1.0;
     
-    m_mappingMode = MM_TEXT;
+    m_mappingMode = wxMM_TEXT;
     m_needComputeScaleX = FALSE;
     m_needComputeScaleY = FALSE;
     
     m_signX = 1;  // default x-axis left to right
     m_signY = 1;  // default y-axis top down
     
-    m_maxX = m_maxY = -100000;
-    m_minY = m_minY =  100000;
+    m_maxX = m_maxY = 0;
+    m_minX = m_minY = 0;
     
     m_logicalFunction = wxCOPY;
     //  m_textAlignment = wxALIGN_TOP_LEFT;
@@ -213,15 +213,22 @@ void wxDC::GetSize( int* width, int* height ) const
     *height = m_maxY-m_minY;
 };
 
-void wxDC::GetSizeMM( long* width, long* height ) const
+void wxDC::GetSizeMM( int* width, int* height ) const
 {
     int w = 0;
     int h = 0;
     GetSize( &w, &h );
-    *width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
-    *height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
+    *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) );
+    *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) );
 };
 
+// Resolution in pixels per logical inch
+wxSize wxDC::GetPPI(void) const
+{
+    // TODO (should probably be pure virtual)
+    return wxSize(0, 0);
+}
+
 void wxDC::SetTextForeground( const wxColour &col )
 {
     if (!Ok()) return;
@@ -238,24 +245,24 @@ void wxDC::SetMapMode( int mode )
 {
     switch (mode) 
     {
-    case MM_TWIPS:
+    case wxMM_TWIPS:
         SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y );
         break;
-    case MM_POINTS:
+    case wxMM_POINTS:
         SetLogicalScale( pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y );
         break;
-    case MM_METRIC:
+    case wxMM_METRIC:
         SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y );
         break;
-    case MM_LOMETRIC:
+    case wxMM_LOMETRIC:
         SetLogicalScale( m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0 );
         break;
     default:
-    case MM_TEXT:
+    case wxMM_TEXT:
         SetLogicalScale( 1.0, 1.0 );
         break;
     };
-    if (mode != MM_TEXT)
+    if (mode != wxMM_TEXT)
     {
         m_needComputeScaleX = TRUE;
         m_needComputeScaleY = TRUE;