]> git.saurik.com Git - wxWidgets.git/commitdiff
Moved bunch of #defines (LOG2DEV etc) from msw/dc.cpp to msw/dc.h
authorHarco de Hilster <harcoh@caos.kun.nl>
Mon, 19 Jul 1999 16:23:12 +0000 (16:23 +0000)
committerHarco de Hilster <harcoh@caos.kun.nl>
Mon, 19 Jul 1999 16:23:12 +0000 (16:23 +0000)
Small changes to dcpsg.cpp to make it compile for wxMSW

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/dc.h
src/generic/dcpsg.cpp
src/msw/dc.cpp

index 88516932353bef2b18203157cfad2f75084c41c5..067cda1bbb24d79ef5cfd91d35668509acba9b1a 100644 (file)
     #pragma interface "dc.h"
 #endif
 
+// ---------------------------------------------------------------------------
+// macros
+// ---------------------------------------------------------------------------
+
+// Logical to device
+// Absolute
+#define XLOG2DEV(x) (x)
+#define YLOG2DEV(y) (y)
+
+// Relative
+#define XLOG2DEVREL(x) (x)
+#define YLOG2DEVREL(y) (y)
+
+// Device to logical
+// Absolute
+#define XDEV2LOG(x) (x)
+
+#define YDEV2LOG(y) (y)
+
+// Relative
+#define XDEV2LOGREL(x) (x)
+#define YDEV2LOGREL(y) (y)
+
+/*
+ * Have the same macros as for XView but not for every operation:
+ * just for calculating window/viewport extent (a better way of scaling).
+ */
+
+// Logical to device
+// Absolute
+#define MS_XLOG2DEV(x) LogicalToDevice(x)
+
+#define MS_YLOG2DEV(y) LogicalToDevice(y)
+
+// Relative
+#define MS_XLOG2DEVREL(x) LogicalToDeviceXRel(x)
+#define MS_YLOG2DEVREL(y) LogicalToDeviceYRel(y)
+
+// Device to logical
+// Absolute
+#define MS_XDEV2LOG(x) DeviceToLogicalX(x)
+
+#define MS_YDEV2LOG(y) DeviceToLogicalY(y)
+
+// Relative
+#define MS_XDEV2LOGREL(x) DeviceToLogicalXRel(x)
+#define MS_YDEV2LOGREL(y) DeviceToLogicalYRel(y)
+
+#define YSCALE(y) (yorigin - (y))
+
+#define     wx_round(a)    (int)((a)+.5)
+
 class WXDLLEXPORT wxDC : public wxDCBase
 {
     DECLARE_DYNAMIC_CLASS(wxDC)
index 769fe924972d46b1abfa16039bb8b521390560af..3a0608b9e9c3ecd5738b857ae9484a2f4423f44e 100644 (file)
@@ -29,6 +29,7 @@
 
 #if wxUSE_POSTSCRIPT
 
+#include "wx/window.h"
 #include "wx/dcmemory.h"
 #include "wx/utils.h"
 #include "wx/intl.h"
@@ -250,7 +251,10 @@ wxPostScriptDC::wxPostScriptDC ()
     m_signY = -1;  // default y-axis bottom up -> top down
 
     // Compatibility only
+    // HH: Doesn't seem to work for wxMSW...
+    #ifndef __WXMSW__
     m_printData = * wxThePrintSetupData;
+    #endif
 }
 
 wxPostScriptDC::wxPostScriptDC (const wxString& file, bool interactive, wxWindow *parent)
@@ -1003,7 +1007,11 @@ void wxPostScriptDC::SetFont( const wxFont& font )
     fprintf( m_pstream, " reencodeISO def\n" );
     fprintf( m_pstream, buffer );
     fprintf( m_pstream, " findfont\n" );
+    #ifdef __WXMSW__
+    fprintf( m_pstream, "%d scalefont setfont\n", YLOG2DEVREL(m_font.GetPointSize()) );
+    #else
     fprintf( m_pstream, "%ld scalefont setfont\n", YLOG2DEVREL(m_font.GetPointSize()) );
+    #endif
 }
 
 void wxPostScriptDC::SetPen( const wxPen& pen )
@@ -1016,8 +1024,11 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
 
     m_pen = pen;
 
+    #ifdef __WXMSW__
+    fprintf( m_pstream, "%d setlinewidth\n", XLOG2DEVREL(m_pen.GetWidth()) );
+    #else
     fprintf( m_pstream, "%ld setlinewidth\n", XLOG2DEVREL(m_pen.GetWidth()) );
-
+    #endif
 /*
      Line style - WRONG: 2nd arg is OFFSET
 
@@ -1997,7 +2008,7 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y,
 # define PS_VIEWER_PROG "ghostview"
 #else
 // Windows ghostscript/ghostview
-# define PS_VIEWER_PROG NULL
+# define PS_VIEWER_PROG "gsview"
 #endif
 
 wxPrintSetupData *wxThePrintSetupData = (wxPrintSetupData *) NULL;
@@ -2369,4 +2380,4 @@ void wxPostScriptModule::OnExit()
   // wxUSE_POSTSCRIPT
 
 #endif 
-  // wxUSE_PRINTING_ARCHITECTURE
\ No newline at end of file
+  // wxUSE_PRINTING_ARCHITECTURE
index c5c2a08b642df42bb23d5dd13d3abd3767efbf62..fa53cd8b6e9bf32f81145061c00a390c56c4e5ad 100644 (file)
@@ -68,58 +68,6 @@ static const int VIEWPORT_EXTENT = 1000;
 static const int MM_POINTS = 9;
 static const int MM_METRIC = 10;
 
-// ---------------------------------------------------------------------------
-// macros
-// ---------------------------------------------------------------------------
-
-// Logical to device
-// Absolute
-#define XLOG2DEV(x) (x)
-#define YLOG2DEV(y) (y)
-
-// Relative
-#define XLOG2DEVREL(x) (x)
-#define YLOG2DEVREL(y) (y)
-
-// Device to logical
-// Absolute
-#define XDEV2LOG(x) (x)
-
-#define YDEV2LOG(y) (y)
-
-// Relative
-#define XDEV2LOGREL(x) (x)
-#define YDEV2LOGREL(y) (y)
-
-/*
- * Have the same macros as for XView but not for every operation:
- * just for calculating window/viewport extent (a better way of scaling).
- */
-
-// Logical to device
-// Absolute
-#define MS_XLOG2DEV(x) LogicalToDevice(x)
-
-#define MS_YLOG2DEV(y) LogicalToDevice(y)
-
-// Relative
-#define MS_XLOG2DEVREL(x) LogicalToDeviceXRel(x)
-#define MS_YLOG2DEVREL(y) LogicalToDeviceYRel(y)
-
-// Device to logical
-// Absolute
-#define MS_XDEV2LOG(x) DeviceToLogicalX(x)
-
-#define MS_YDEV2LOG(y) DeviceToLogicalY(y)
-
-// Relative
-#define MS_XDEV2LOGREL(x) DeviceToLogicalXRel(x)
-#define MS_YDEV2LOGREL(y) DeviceToLogicalYRel(y)
-
-#define YSCALE(y) (yorigin - (y))
-
-#define     wx_round(a)    (int)((a)+.5)
-
 // ===========================================================================
 // implementation
 // ===========================================================================