#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)
#if wxUSE_POSTSCRIPT
+#include "wx/window.h"
#include "wx/dcmemory.h"
#include "wx/utils.h"
#include "wx/intl.h"
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)
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 )
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
# define PS_VIEWER_PROG "ghostview"
#else
// Windows ghostscript/ghostview
-# define PS_VIEWER_PROG NULL
+# define PS_VIEWER_PROG "gsview"
#endif
wxPrintSetupData *wxThePrintSetupData = (wxPrintSetupData *) NULL;
// wxUSE_POSTSCRIPT
#endif
- // wxUSE_PRINTING_ARCHITECTURE
\ No newline at end of file
+ // wxUSE_PRINTING_ARCHITECTURE
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
// ===========================================================================