Changes to make common and generic compilable under VisualAge C++ V3.0 ofr OS/2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
485
src/os2/dc.cpp
485
src/os2/dc.cpp
@@ -30,6 +30,50 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||
#define mm2pt 2.83464566929
|
||||
#define pt2mm 0.352777777778
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDCBase
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
long wxDCBase::DeviceToLogicalX(long x) const
|
||||
{
|
||||
return XDEV2LOG(x);
|
||||
};
|
||||
|
||||
long wxDCBase::DeviceToLogicalY(long y) const
|
||||
{
|
||||
return YDEV2LOG(y);
|
||||
};
|
||||
|
||||
long wxDCBase::DeviceToLogicalXRel(long x) const
|
||||
{
|
||||
return XDEV2LOGREL(x);
|
||||
};
|
||||
|
||||
long wxDCBase::DeviceToLogicalYRel(long y) const
|
||||
{
|
||||
return YDEV2LOGREL(y);
|
||||
};
|
||||
|
||||
long wxDCBase::LogicalToDeviceX(long x) const
|
||||
{
|
||||
return XLOG2DEV(x);
|
||||
};
|
||||
|
||||
long wxDCBase::LogicalToDeviceY(long y) const
|
||||
{
|
||||
return YLOG2DEV(y);
|
||||
};
|
||||
|
||||
long wxDCBase::LogicalToDeviceXRel(long x) const
|
||||
{
|
||||
return XLOG2DEVREL(x);
|
||||
};
|
||||
|
||||
long wxDCBase::LogicalToDeviceYRel(long y) const
|
||||
{
|
||||
return YLOG2DEVREL(y);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -41,10 +85,10 @@ wxDC::wxDC(void)
|
||||
m_autoSetting = FALSE;
|
||||
m_colour = TRUE;
|
||||
m_clipping = FALSE;
|
||||
|
||||
|
||||
m_mm_to_pix_x = 1.0;
|
||||
m_mm_to_pix_y = 1.0;
|
||||
|
||||
|
||||
m_logicalOriginX = 0;
|
||||
m_logicalOriginY = 0;
|
||||
m_deviceOriginX = 0;
|
||||
@@ -53,18 +97,18 @@ wxDC::wxDC(void)
|
||||
m_internalDeviceOriginY = 0;
|
||||
m_externalDeviceOriginX = 0;
|
||||
m_externalDeviceOriginY = 0;
|
||||
|
||||
|
||||
m_logicalScaleX = 1.0;
|
||||
m_logicalScaleY = 1.0;
|
||||
m_userScaleX = 1.0;
|
||||
m_userScaleY = 1.0;
|
||||
m_scaleX = 1.0;
|
||||
m_scaleY = 1.0;
|
||||
|
||||
|
||||
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
|
||||
|
||||
@@ -74,14 +118,14 @@ wxDC::wxDC(void)
|
||||
m_logicalFunction = wxCOPY;
|
||||
// m_textAlignment = wxALIGN_TOP_LEFT;
|
||||
m_backgroundMode = wxTRANSPARENT;
|
||||
|
||||
|
||||
m_textForegroundColour = *wxBLACK;
|
||||
m_textBackgroundColour = *wxWHITE;
|
||||
m_pen = *wxBLACK_PEN;
|
||||
m_font = *wxNORMAL_FONT;
|
||||
m_brush = *wxTRANSPARENT_BRUSH;
|
||||
m_backgroundBrush = *wxWHITE_BRUSH;
|
||||
|
||||
|
||||
// m_palette = wxAPP_COLOURMAP;
|
||||
};
|
||||
|
||||
@@ -89,97 +133,11 @@ wxDC::~wxDC(void)
|
||||
{
|
||||
};
|
||||
|
||||
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
|
||||
{
|
||||
};
|
||||
|
||||
void wxDC::DrawPoint( wxPoint& point )
|
||||
{
|
||||
DrawPoint( point.x, point.y );
|
||||
};
|
||||
|
||||
void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle )
|
||||
{
|
||||
int n = list->Number();
|
||||
wxPoint *points = new wxPoint[n];
|
||||
|
||||
int i = 0;
|
||||
for( wxNode *node = list->First(); node; node = node->Next() )
|
||||
{
|
||||
wxPoint *point = (wxPoint *)node->Data();
|
||||
points[i].x = point->x;
|
||||
points[i++].y = point->y;
|
||||
};
|
||||
DrawPolygon( n, points, xoffset, yoffset, fillStyle );
|
||||
delete[] points;
|
||||
};
|
||||
|
||||
void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
|
||||
{
|
||||
int n = list->Number();
|
||||
wxPoint *points = new wxPoint[n];
|
||||
|
||||
int i = 0;
|
||||
for( wxNode *node = list->First(); node; node = node->Next() )
|
||||
{
|
||||
wxPoint *point = (wxPoint *)node->Data();
|
||||
points[i].x = point->x;
|
||||
points[i++].y = point->y;
|
||||
};
|
||||
DrawLines( n, points, xoffset, yoffset );
|
||||
delete []points;
|
||||
};
|
||||
|
||||
void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
|
||||
{
|
||||
wxList list;
|
||||
list.Append( (wxObject*)new wxPoint(x1, y1) );
|
||||
list.Append( (wxObject*)new wxPoint(x2, y2) );
|
||||
list.Append( (wxObject*)new wxPoint(x3, y3) );
|
||||
DrawSpline(&list);
|
||||
wxNode *node = list.First();
|
||||
while (node)
|
||||
{
|
||||
wxPoint *p = (wxPoint*)node->Data();
|
||||
delete p;
|
||||
node = node->Next();
|
||||
};
|
||||
};
|
||||
|
||||
void wxDC::DrawSpline( int n, wxPoint points[] )
|
||||
{
|
||||
wxList list;
|
||||
for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] );
|
||||
DrawSpline( &list );
|
||||
};
|
||||
|
||||
void wxDC::SetClippingRegion( long x, long y, long width, long height )
|
||||
{
|
||||
m_clipping = TRUE;
|
||||
m_clipX1 = x;
|
||||
m_clipY1 = y;
|
||||
m_clipX2 = x + width;
|
||||
m_clipY2 = y + height;
|
||||
};
|
||||
|
||||
void wxDC::DestroyClippingRegion(void)
|
||||
{
|
||||
m_clipping = FALSE;
|
||||
};
|
||||
|
||||
void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
|
||||
{
|
||||
if (m_clipping)
|
||||
{
|
||||
if (x) *x = m_clipX1;
|
||||
if (y) *y = m_clipY1;
|
||||
if (width) *width = (m_clipX2 - m_clipX1);
|
||||
if (height) *height = (m_clipY2 - m_clipY1);
|
||||
}
|
||||
else
|
||||
*x = *y = *width = *height = 0;
|
||||
};
|
||||
|
||||
void wxDC::GetSize( int* width, int* height ) const
|
||||
{
|
||||
*width = m_maxX-m_minX;
|
||||
@@ -195,21 +153,9 @@ void wxDC::GetSizeMM( long* width, long* height ) const
|
||||
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
|
||||
};
|
||||
|
||||
void wxDC::SetTextForeground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
m_textForegroundColour = col;
|
||||
};
|
||||
|
||||
void wxDC::SetTextBackground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
m_textBackgroundColour = col;
|
||||
};
|
||||
|
||||
void wxDC::SetMapMode( int mode )
|
||||
{
|
||||
switch (mode)
|
||||
switch (mode)
|
||||
{
|
||||
case wxMM_TWIPS:
|
||||
SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y );
|
||||
@@ -257,12 +203,6 @@ void wxDC::SetLogicalScale( double x, double y )
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetLogicalScale( double *x, double *y )
|
||||
{
|
||||
if (x) *x = m_logicalScaleX;
|
||||
if (y) *y = m_logicalScaleY;
|
||||
};
|
||||
|
||||
void wxDC::SetLogicalOrigin( long x, long y )
|
||||
{
|
||||
m_logicalOriginX = x * m_signX; // is this still correct ?
|
||||
@@ -270,12 +210,6 @@ void wxDC::SetLogicalOrigin( long x, long y )
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetLogicalOrigin( long *x, long *y )
|
||||
{
|
||||
if (x) *x = m_logicalOriginX;
|
||||
if (y) *y = m_logicalOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_externalDeviceOriginX = x;
|
||||
@@ -283,14 +217,6 @@ void wxDC::SetDeviceOrigin( long x, long y )
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetDeviceOrigin( long *x, long *y )
|
||||
{
|
||||
// if (x) *x = m_externalDeviceOriginX;
|
||||
// if (y) *y = m_externalDeviceOriginY;
|
||||
if (x) *x = m_deviceOriginX;
|
||||
if (y) *y = m_deviceOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetInternalDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_internalDeviceOriginX = x;
|
||||
@@ -311,53 +237,294 @@ void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
long wxDC::DeviceToLogicalX(long x) const
|
||||
{
|
||||
return XDEV2LOG(x);
|
||||
};
|
||||
|
||||
long wxDC::DeviceToLogicalY(long y) const
|
||||
int wxDC::GetDepth() const
|
||||
{
|
||||
return YDEV2LOG(y);
|
||||
};
|
||||
// TODO:
|
||||
return (1);
|
||||
}
|
||||
|
||||
long wxDC::DeviceToLogicalXRel(long x) const
|
||||
wxSize wxDC::GetPPI() const
|
||||
{
|
||||
return XDEV2LOGREL(x);
|
||||
};
|
||||
// TODO:
|
||||
return (1);
|
||||
}
|
||||
void wxDC::GetTextExtent( const wxString& string
|
||||
,long* x
|
||||
,long* y
|
||||
,long* decent
|
||||
,long* externalLeading
|
||||
,wxFont* theFont
|
||||
) const
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
long wxDC::DeviceToLogicalYRel(long y) const
|
||||
void wxDC::GetCharWidth() const
|
||||
{
|
||||
return YDEV2LOGREL(y);
|
||||
};
|
||||
// TODO
|
||||
return(1);
|
||||
}
|
||||
|
||||
long wxDC::LogicalToDeviceX(long x) const
|
||||
void wxDC::GetCharHeight() const
|
||||
{
|
||||
return XLOG2DEV(x);
|
||||
};
|
||||
// TODO
|
||||
return(1);
|
||||
}
|
||||
|
||||
long wxDC::LogicalToDeviceY(long y) const
|
||||
void wxDC::Clear()
|
||||
{
|
||||
return YLOG2DEV(y);
|
||||
};
|
||||
// TODO
|
||||
}
|
||||
|
||||
long wxDC::LogicalToDeviceXRel(long x) const
|
||||
void wxDC::SetFont(const wxFont& font)
|
||||
{
|
||||
return XLOG2DEVREL(x);
|
||||
};
|
||||
// TODO
|
||||
}
|
||||
|
||||
long wxDC::LogicalToDeviceYRel(long y) const
|
||||
void wxDC::SetPen(const wxPen& pen)
|
||||
{
|
||||
return YLOG2DEVREL(y);
|
||||
};
|
||||
|
||||
void wxDC::CalcBoundingBox( long x, long y )
|
||||
// TODO
|
||||
}
|
||||
void wxDC::SetBrush(const wxBrush& brush)
|
||||
{
|
||||
if (x < m_minX) m_minX = x;
|
||||
if (y < m_minY) m_minY = y;
|
||||
if (x > m_maxX) m_maxX = x;
|
||||
if (y > m_maxY) m_maxY = y;
|
||||
};
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::SetBackground(const wxBrush& brush)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalFunction(int function)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::SetBackgroundMode(int mode)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::SetPalette(const wxPalette& palette)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoFloodFill( long x
|
||||
,long y
|
||||
,const wxColour& col
|
||||
,int style = wxFLOOD_SURFACE
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
bool wxDC::DoGetPixel(long x, long y, wxColour *col) const
|
||||
{
|
||||
// TODO
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPoint(long x, long y)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLine(long x1, long y1, long x2, long y2)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawArc( long x1, long y1
|
||||
,long x2, long y2
|
||||
,long xc, long yc
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipticArc( long x
|
||||
,long y
|
||||
,long w
|
||||
,long h
|
||||
,double sa
|
||||
,double ea
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRectangle(long x, long y, long width, long height)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRoundedRectangle( long x, long y
|
||||
,long width, long height
|
||||
,double radius
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipse(long x, long y, long width, long height)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoCrossHair(long x, long y)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawIcon(const wxIcon& icon, long x, long y)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawBitmap( const wxBitmap &bmp
|
||||
,long x, long y
|
||||
,bool useMask = FALSE
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawText(const wxString& text, long x, long y)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
bool wxDC::DoBlit( long xdest
|
||||
,long ydest
|
||||
,long width
|
||||
,long height
|
||||
,wxDC *source
|
||||
,long xsrc
|
||||
,long ysrc
|
||||
,int rop = wxCOPY
|
||||
,bool useMask = FALSE
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
void wxDC::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoGetSizeMM(int* width, int* height) const
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLines( int n, wxPoint points[]
|
||||
,long xoffset, long yoffset
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPolygon(int n, wxPoint points[]
|
||||
,long xoffset, long yoffset
|
||||
,int fillStyle = wxODDEVEN_RULE
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegion( long x, long y
|
||||
,long width, long height
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
#if wxUSE_SPLINES
|
||||
void wxDC::DoDrawSpline(wxList *points)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Private functions
|
||||
//
|
||||
long wxDC::XDEV2LOG(long x) const
|
||||
{
|
||||
long new_x = x - m_deviceOriginX;
|
||||
if (new_x > 0)
|
||||
return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
|
||||
else
|
||||
return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
|
||||
}
|
||||
|
||||
long wxDC::XDEV2LOGREL(long x) const
|
||||
{
|
||||
if (x > 0)
|
||||
return (long)((double)(x) / m_scaleX + 0.5);
|
||||
else
|
||||
return (long)((double)(x) / m_scaleX - 0.5);
|
||||
}
|
||||
|
||||
long wxDC::YDEV2LOG(long y) const
|
||||
{
|
||||
long new_y = y - m_deviceOriginY;
|
||||
if (new_y > 0)
|
||||
return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
|
||||
else
|
||||
return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
|
||||
}
|
||||
|
||||
long wxDC::YDEV2LOGREL(long y) const
|
||||
{
|
||||
if (y > 0)
|
||||
return (long)((double)(y) / m_scaleY + 0.5);
|
||||
else
|
||||
return (long)((double)(y) / m_scaleY - 0.5);
|
||||
}
|
||||
|
||||
long wxDC::XLOG2DEV(long x) const
|
||||
{
|
||||
long new_x = x - m_logicalOriginX;
|
||||
if (new_x > 0)
|
||||
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
|
||||
else
|
||||
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
|
||||
}
|
||||
|
||||
long wxDC::XLOG2DEVREL(long x) const
|
||||
{
|
||||
if (x > 0)
|
||||
return (long)((double)(x) * m_scaleX + 0.5);
|
||||
else
|
||||
return (long)((double)(x) * m_scaleX - 0.5);
|
||||
}
|
||||
|
||||
long wxDC::YLOG2DEV(long y) const
|
||||
{
|
||||
long new_y = y - m_logicalOriginY;
|
||||
if (new_y > 0)
|
||||
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
|
||||
else
|
||||
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
|
||||
}
|
||||
|
||||
long wxDC::YLOG2DEVREL(long y) const
|
||||
{
|
||||
if (y > 0)
|
||||
return (long)((double)(y) * m_scaleY + 0.5);
|
||||
else
|
||||
return (long)((double)(y) * m_scaleY - 0.5);
|
||||
}
|
||||
|
||||
void wxDC::ComputeScaleAndOrigin(void)
|
||||
{
|
||||
@@ -371,7 +538,7 @@ void wxDC::ComputeScaleAndOrigin(void)
|
||||
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
|
||||
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
|
||||
|
||||
// CMB: if scale has changed call SetPen to recalulate the line width
|
||||
// CMB: if scale has changed call SetPen to recalulate the line width
|
||||
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
||||
{
|
||||
// this is a bit artificial, but we need to force wxDC to think
|
||||
|
@@ -50,7 +50,7 @@ wxWindowDC::~wxWindowDC(void)
|
||||
{
|
||||
};
|
||||
|
||||
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
|
||||
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
|
||||
const wxColour& WXUNUSED(col), int WXUNUSED(style) )
|
||||
{
|
||||
};
|
||||
@@ -63,42 +63,42 @@ bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNU
|
||||
void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::CrossHair( long x, long y )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
long xx1 = XLOG2DEV(x1);
|
||||
|
||||
long xx1 = XLOG2DEV(x1);
|
||||
long yy1 = YLOG2DEV(y1);
|
||||
long xx2 = XLOG2DEV(x2);
|
||||
long xx2 = XLOG2DEV(x2);
|
||||
long yy2 = YLOG2DEV(y2);
|
||||
long xxc = XLOG2DEV((long)xc);
|
||||
long xxc = XLOG2DEV((long)xc);
|
||||
long yyc = YLOG2DEV((long)yc);
|
||||
double dx = xx1 - xxc;
|
||||
double dx = xx1 - xxc;
|
||||
double dy = yy1 - yyc;
|
||||
double radius = sqrt(dx*dx+dy*dy);
|
||||
long r = (long)radius;
|
||||
double radius1, radius2;
|
||||
|
||||
if (xx1 == xx2 && yy1 == yy2)
|
||||
if (xx1 == xx2 && yy1 == yy2)
|
||||
{
|
||||
radius1 = 0.0;
|
||||
radius2 = 360.0;
|
||||
}
|
||||
else
|
||||
if (radius == 0.0)
|
||||
}
|
||||
else
|
||||
if (radius == 0.0)
|
||||
{
|
||||
radius1 = radius2 = 0.0;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
radius1 = (xx1 - xxc == 0) ?
|
||||
(yy1 - yyc < 0) ? 90.0 : -90.0 :
|
||||
@@ -113,44 +113,44 @@ void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc )
|
||||
while (alpha1 > 360*64) alpha1 -= 360*64;
|
||||
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
|
||||
|
||||
// CMB: handle -ve width and/or height
|
||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||
if (hh < 0) { hh = -hh; yy = yy - hh; }
|
||||
|
||||
|
||||
long start = long(sa * 64.0);
|
||||
long end = long(ea * 64.0);
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawPoint( long x, long y )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (m_pen.GetStyle() == wxTRANSPARENT) return;
|
||||
|
||||
|
||||
for (int i = 0; i < n-1; i++)
|
||||
{
|
||||
long x1 = XLOG2DEV(points[i].x + xoffset);
|
||||
@@ -163,9 +163,9 @@ void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset
|
||||
void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (m_pen.GetStyle() == wxTRANSPARENT) return;
|
||||
|
||||
|
||||
wxNode *node = points->First();
|
||||
while (node->Next())
|
||||
{
|
||||
@@ -179,13 +179,13 @@ void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset )
|
||||
};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawPolygon( int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
||||
void wxWindowDC::DrawPolygon( int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
||||
long WXUNUSED(xoffset), long WXUNUSED(yoffset), int WXUNUSED(fillStyle) )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawPolygon( wxList *WXUNUSED(lines), long WXUNUSED(xoffset),
|
||||
void wxWindowDC::DrawPolygon( wxList *WXUNUSED(lines), long WXUNUSED(xoffset),
|
||||
long WXUNUSED(yoffset), int WXUNUSED(fillStyle) )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
@@ -199,7 +199,7 @@ void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
|
||||
|
||||
// CMB: draw nothing if transformed w or h is 0
|
||||
if (ww == 0 || hh == 0) return;
|
||||
|
||||
@@ -208,19 +208,19 @@ void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
|
||||
if (hh < 0) { hh = -hh; yy = yy - hh; }
|
||||
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
long rr = XLOG2DEVREL((long)radius);
|
||||
|
||||
@@ -257,7 +257,7 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height,
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||
{
|
||||
};
|
||||
@@ -266,18 +266,18 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height,
|
||||
void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
|
||||
long xx = XLOG2DEV(x);
|
||||
long yy = YLOG2DEV(y);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long ww = m_signX * XLOG2DEVREL(width);
|
||||
long hh = m_signY * YLOG2DEVREL(height);
|
||||
|
||||
// CMB: handle -ve width and/or height
|
||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||
if (hh < 0) { hh = -hh; yy = yy - hh; }
|
||||
|
||||
|
||||
if (m_brush.GetStyle() != wxTRANSPARENT) {};
|
||||
|
||||
|
||||
if (m_pen.GetStyle() != wxTRANSPARENT) {};
|
||||
};
|
||||
|
||||
@@ -289,19 +289,19 @@ bool wxWindowDC::CanDrawBitmap(void) const
|
||||
void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (!icon.Ok()) return;
|
||||
|
||||
|
||||
int xx = XLOG2DEV(x);
|
||||
int yy = YLOG2DEV(y);
|
||||
|
||||
|
||||
};
|
||||
|
||||
bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
|
||||
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool WXUNUSED(useMask) )
|
||||
{
|
||||
if (!Ok()) return FALSE;
|
||||
|
||||
|
||||
// CMB 20/5/98: add blitting of bitmaps
|
||||
if (source->IsKindOf(CLASSINFO(wxMemoryDC)))
|
||||
{
|
||||
@@ -342,19 +342,19 @@ bool wxWindowDC::CanGetTextExtent(void) const
|
||||
|
||||
void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
|
||||
long *WXUNUSED(descent), long *WXUNUSED(externalLeading),
|
||||
wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) )
|
||||
wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) ) const
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
};
|
||||
|
||||
long wxWindowDC::GetCharWidth(void)
|
||||
long wxWindowDC::GetCharWidth(void) const
|
||||
{
|
||||
if (!Ok()) return 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
long wxWindowDC::GetCharHeight(void)
|
||||
long wxWindowDC::GetCharHeight(void) const
|
||||
{
|
||||
if (!Ok()) return 0;
|
||||
return 0;
|
||||
@@ -363,13 +363,13 @@ long wxWindowDC::GetCharHeight(void)
|
||||
void wxWindowDC::Clear(void)
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetFont( const wxFont &font )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
m_font = font;
|
||||
};
|
||||
|
||||
@@ -378,34 +378,34 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
||||
if (!Ok()) return;
|
||||
|
||||
if (m_pen == pen) return;
|
||||
|
||||
|
||||
m_pen = pen;
|
||||
|
||||
|
||||
if (!m_pen.Ok()) return;
|
||||
};
|
||||
|
||||
void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (m_brush == brush) return;
|
||||
|
||||
|
||||
m_brush = brush;
|
||||
|
||||
|
||||
if (!m_brush.Ok()) return;
|
||||
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetBackground( const wxBrush &brush )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (m_backgroundBrush == brush) return;
|
||||
|
||||
|
||||
m_backgroundBrush = brush;
|
||||
|
||||
|
||||
if (!m_backgroundBrush.Ok()) return;
|
||||
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetLogicalFunction( int function )
|
||||
@@ -416,9 +416,9 @@ void wxWindowDC::SetLogicalFunction( int function )
|
||||
void wxWindowDC::SetTextForeground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (m_textForegroundColour == col) return;
|
||||
|
||||
|
||||
m_textForegroundColour = col;
|
||||
if (!m_textForegroundColour.Ok()) return;
|
||||
};
|
||||
@@ -426,9 +426,9 @@ void wxWindowDC::SetTextForeground( const wxColour &col )
|
||||
void wxWindowDC::SetTextBackground( const wxColour &col )
|
||||
{
|
||||
if (!Ok()) return;
|
||||
|
||||
|
||||
if (m_textBackgroundColour == col) return;
|
||||
|
||||
|
||||
m_textBackgroundColour = col;
|
||||
if (!m_textBackgroundColour.Ok()) return;
|
||||
};
|
||||
@@ -451,7 +451,7 @@ void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
|
||||
wxDC::SetClippingRegion( x, y, width, height );
|
||||
|
||||
// TODO
|
||||
|
||||
|
||||
};
|
||||
|
||||
void wxWindowDC::SetClippingRegion( const wxRegion& region )
|
||||
@@ -466,7 +466,7 @@ void wxWindowDC::SetClippingRegion( const wxRegion& region )
|
||||
void wxWindowDC::DestroyClippingRegion(void)
|
||||
{
|
||||
wxDC::DestroyClippingRegion();
|
||||
|
||||
|
||||
};
|
||||
|
||||
// ----------------------------------- spline code ----------------------------------------
|
||||
|
@@ -92,7 +92,7 @@ GENERICOBJS= \
|
||||
# ..\generic\$D\listctrl.obj \
|
||||
# ..\generic\$D\notebook.obj \
|
||||
|
||||
# These are generic things that don't need to be compiled on MSW,
|
||||
# These are generic things that don't need to be compiled on PM,
|
||||
# but sometimes it's useful to do so for testing purposes.
|
||||
NONESSENTIALOBJS= \
|
||||
..\generic\$D\printps.obj \
|
||||
|
Reference in New Issue
Block a user