Moved bunch of #defines (LOG2DEV etc) from msw/dc.cpp to msw/dc.h
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
This commit is contained in:
parent
112c5086e8
commit
e6f1ad222c
@ -16,6 +16,58 @@
|
||||
#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)
|
||||
|
@ -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
|
||||
// wxUSE_PRINTING_ARCHITECTURE
|
||||
|
@ -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
|
||||
// ===========================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user