1. wxApp::ProcessPendingEvents() is now common, added appcmn.cpp and
regenerated the makefiles. wxPostEvent() should work for wxGTK too (untested) 2. long -> wxCoord change for wxGTK and wxMSW, use wxUSE_COMPATIBLE_COORD_TYPES to get the old behaviour 3. wxHTML compilation fixes (for !wxUSE_HTML case) 4. a couple of handy macros in thread.h added git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -232,6 +232,9 @@ public:
|
|||||||
static wxAppInitializerFunction GetInitializerFunction()
|
static wxAppInitializerFunction GetInitializerFunction()
|
||||||
{ return m_appInitFn; }
|
{ return m_appInitFn; }
|
||||||
|
|
||||||
|
// process all events in the wxPendingEvents list
|
||||||
|
virtual void ProcessPendingEvents();
|
||||||
|
|
||||||
// access to the command line arguments
|
// access to the command line arguments
|
||||||
int argc;
|
int argc;
|
||||||
wxChar **argv;
|
wxChar **argv;
|
||||||
|
243
include/wx/dc.h
243
include/wx/dc.h
@@ -31,14 +31,6 @@
|
|||||||
|
|
||||||
#include "wx/list.h" // we use wxList in inline functions
|
#include "wx/list.h" // we use wxList in inline functions
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// types
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// type which should be used (whenever possible, i.e. as long as it doesn't
|
|
||||||
// break compatibility) for screen coordinates
|
|
||||||
typedef int wxCoord;
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// global variables
|
// global variables
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -92,65 +84,69 @@ public:
|
|||||||
// graphic primitives
|
// graphic primitives
|
||||||
// ------------------
|
// ------------------
|
||||||
|
|
||||||
void FloodFill(long x, long y, const wxColour& col,
|
void FloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||||
int style = wxFLOOD_SURFACE)
|
int style = wxFLOOD_SURFACE)
|
||||||
{ DoFloodFill(x, y, col, style); }
|
{ DoFloodFill(x, y, col, style); }
|
||||||
void FloodFill(const wxPoint& pt, const wxColour& col,
|
void FloodFill(const wxPoint& pt, const wxColour& col,
|
||||||
int style = wxFLOOD_SURFACE)
|
int style = wxFLOOD_SURFACE)
|
||||||
{ DoFloodFill(pt.x, pt.y, col, style); }
|
{ DoFloodFill(pt.x, pt.y, col, style); }
|
||||||
|
|
||||||
bool GetPixel(long x, long y, wxColour *col) const
|
bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const
|
||||||
{ return DoGetPixel(x, y, col); }
|
{ return DoGetPixel(x, y, col); }
|
||||||
bool GetPixel(const wxPoint& pt, wxColour *col) const
|
bool GetPixel(const wxPoint& pt, wxColour *col) const
|
||||||
{ return DoGetPixel(pt.x, pt.y, col); }
|
{ return DoGetPixel(pt.x, pt.y, col); }
|
||||||
|
|
||||||
void DrawLine(long x1, long y1, long x2, long y2)
|
void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
||||||
{ DoDrawLine(x1, y1, x2, y2); }
|
{ DoDrawLine(x1, y1, x2, y2); }
|
||||||
void DrawLine(const wxPoint& pt1, const wxPoint& pt2)
|
void DrawLine(const wxPoint& pt1, const wxPoint& pt2)
|
||||||
{ DoDrawLine(pt1.x, pt1.y, pt2.x, pt2.y); }
|
{ DoDrawLine(pt1.x, pt1.y, pt2.x, pt2.y); }
|
||||||
|
|
||||||
void CrossHair(long x, long y)
|
void CrossHair(wxCoord x, wxCoord y)
|
||||||
{ DoCrossHair(x, y); }
|
{ DoCrossHair(x, y); }
|
||||||
void CrossHair(const wxPoint& pt)
|
void CrossHair(const wxPoint& pt)
|
||||||
{ DoCrossHair(pt.x, pt.y); }
|
{ DoCrossHair(pt.x, pt.y); }
|
||||||
|
|
||||||
void DrawArc(long x1, long y1, long x2, long y2, long xc, long yc)
|
void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
||||||
|
wxCoord xc, wxCoord yc)
|
||||||
{ DoDrawArc(x1, y1, x2, y2, xc, yc); }
|
{ DoDrawArc(x1, y1, x2, y2, xc, yc); }
|
||||||
void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre)
|
void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre)
|
||||||
{ DoDrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); }
|
{ DoDrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); }
|
||||||
|
|
||||||
void DrawEllipticArc(long x, long y, long w, long h, double sa, double ea)
|
void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||||
|
double sa, double ea)
|
||||||
{ DoDrawEllipticArc(x, y, w, h, sa, ea); }
|
{ DoDrawEllipticArc(x, y, w, h, sa, ea); }
|
||||||
void DrawEllipticArc(const wxPoint& pt, const wxSize& sz,
|
void DrawEllipticArc(const wxPoint& pt, const wxSize& sz,
|
||||||
double sa, double ea)
|
double sa, double ea)
|
||||||
{ DoDrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); }
|
{ DoDrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); }
|
||||||
|
|
||||||
void DrawPoint(long x, long y)
|
void DrawPoint(wxCoord x, wxCoord y)
|
||||||
{ DoDrawPoint(x, y); }
|
{ DoDrawPoint(x, y); }
|
||||||
void DrawPoint(const wxPoint& pt)
|
void DrawPoint(const wxPoint& pt)
|
||||||
{ DoDrawPoint(pt.x, pt.y); }
|
{ DoDrawPoint(pt.x, pt.y); }
|
||||||
|
|
||||||
void DrawLines(int n, wxPoint points[], long xoffset = 0, long yoffset = 0)
|
void DrawLines(int n, wxPoint points[],
|
||||||
|
wxCoord xoffset = 0, wxCoord yoffset = 0)
|
||||||
{ DoDrawLines(n, points, xoffset, yoffset); }
|
{ DoDrawLines(n, points, xoffset, yoffset); }
|
||||||
void DrawLines(const wxList *list, long xoffset = 0, long yoffset = 0);
|
void DrawLines(const wxList *list,
|
||||||
|
wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||||
|
|
||||||
void DrawPolygon(int n, wxPoint points[],
|
void DrawPolygon(int n, wxPoint points[],
|
||||||
long xoffset = 0, long yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
int fillStyle = wxODDEVEN_RULE)
|
int fillStyle = wxODDEVEN_RULE)
|
||||||
{ DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); }
|
{ DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); }
|
||||||
|
|
||||||
void DrawPolygon(const wxList *list,
|
void DrawPolygon(const wxList *list,
|
||||||
long xoffset = 0, long yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
int fillStyle = wxODDEVEN_RULE);
|
int fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
void DrawRectangle(long x, long y, long width, long height)
|
void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||||
{ DoDrawRectangle(x, y, width, height); }
|
{ DoDrawRectangle(x, y, width, height); }
|
||||||
void DrawRectangle(const wxPoint& pt, const wxSize& sz)
|
void DrawRectangle(const wxPoint& pt, const wxSize& sz)
|
||||||
{ DoDrawRectangle(pt.x, pt.y, sz.x, sz.y); }
|
{ DoDrawRectangle(pt.x, pt.y, sz.x, sz.y); }
|
||||||
void DrawRectangle(const wxRect& rect)
|
void DrawRectangle(const wxRect& rect)
|
||||||
{ DoDrawRectangle(rect.x, rect.y, rect.width, rect.height); }
|
{ DoDrawRectangle(rect.x, rect.y, rect.width, rect.height); }
|
||||||
|
|
||||||
void DrawRoundedRectangle(long x, long y, long width, long height,
|
void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height,
|
||||||
double radius)
|
double radius)
|
||||||
{ DoDrawRoundedRectangle(x, y, width, height, radius); }
|
{ DoDrawRoundedRectangle(x, y, width, height, radius); }
|
||||||
void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz,
|
void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz,
|
||||||
@@ -159,33 +155,34 @@ public:
|
|||||||
void DrawRoundedRectangle(const wxRect& r, double radius)
|
void DrawRoundedRectangle(const wxRect& r, double radius)
|
||||||
{ DoDrawRoundedRectangle(r.x, r.y, r.width, r.height, radius); }
|
{ DoDrawRoundedRectangle(r.x, r.y, r.width, r.height, radius); }
|
||||||
|
|
||||||
void DrawCircle(long x, long y, long radius)
|
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius)
|
||||||
{ DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); }
|
{ DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); }
|
||||||
void DrawEllipse(long x, long y, long width, long height)
|
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||||
{ DoDrawEllipse(x, y, width, height); }
|
{ DoDrawEllipse(x, y, width, height); }
|
||||||
void DrawEllipse(const wxPoint& pt, const wxSize& sz)
|
void DrawEllipse(const wxPoint& pt, const wxSize& sz)
|
||||||
{ DoDrawEllipse(pt.x, pt.y, sz.x, sz.y); }
|
{ DoDrawEllipse(pt.x, pt.y, sz.x, sz.y); }
|
||||||
void DrawEllipse(const wxRect& rect)
|
void DrawEllipse(const wxRect& rect)
|
||||||
{ DoDrawEllipse(rect.x, rect.y, rect.width, rect.height); }
|
{ DoDrawEllipse(rect.x, rect.y, rect.width, rect.height); }
|
||||||
|
|
||||||
void DrawIcon(const wxIcon& icon, long x, long y)
|
void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
|
||||||
{ DoDrawIcon(icon, x, y); }
|
{ DoDrawIcon(icon, x, y); }
|
||||||
void DrawIcon(const wxIcon& icon, const wxPoint& pt)
|
void DrawIcon(const wxIcon& icon, const wxPoint& pt)
|
||||||
{ DoDrawIcon(icon, pt.x, pt.y); }
|
{ DoDrawIcon(icon, pt.x, pt.y); }
|
||||||
|
|
||||||
void DrawBitmap(const wxBitmap &bmp, long x, long y, bool useMask = FALSE)
|
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||||
|
bool useMask = FALSE)
|
||||||
{ DoDrawBitmap(bmp, x, y, useMask); }
|
{ DoDrawBitmap(bmp, x, y, useMask); }
|
||||||
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt,
|
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt,
|
||||||
bool useMask = FALSE)
|
bool useMask = FALSE)
|
||||||
{ DoDrawBitmap(bmp, pt.x, pt.y, useMask); }
|
{ DoDrawBitmap(bmp, pt.x, pt.y, useMask); }
|
||||||
|
|
||||||
void DrawText(const wxString& text, long x, long y)
|
void DrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||||
{ DoDrawText(text, x, y); }
|
{ DoDrawText(text, x, y); }
|
||||||
void DrawText(const wxString& text, const wxPoint& pt)
|
void DrawText(const wxString& text, const wxPoint& pt)
|
||||||
{ DoDrawText(text, pt.x, pt.y); }
|
{ DoDrawText(text, pt.x, pt.y); }
|
||||||
|
|
||||||
bool Blit(long xdest, long ydest, long width, long height,
|
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop = wxCOPY, bool useMask = FALSE)
|
int rop = wxCOPY, bool useMask = FALSE)
|
||||||
{
|
{
|
||||||
return DoBlit(xdest, ydest, width, height,
|
return DoBlit(xdest, ydest, width, height,
|
||||||
@@ -200,8 +197,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_SPLINES
|
#if wxUSE_SPLINES
|
||||||
// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?)
|
// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?)
|
||||||
void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3);
|
void DrawSpline(wxCoord x1, wxCoord y1,
|
||||||
|
wxCoord x2, wxCoord y2,
|
||||||
|
wxCoord x3, wxCoord y3);
|
||||||
void DrawSpline(int n, wxPoint points[]);
|
void DrawSpline(int n, wxPoint points[]);
|
||||||
|
|
||||||
void DrawSpline(wxList *points) { DoDrawSpline(points); }
|
void DrawSpline(wxList *points) { DoDrawSpline(points); }
|
||||||
@@ -231,7 +230,7 @@ public:
|
|||||||
// clipping region
|
// clipping region
|
||||||
// ---------------
|
// ---------------
|
||||||
|
|
||||||
void SetClippingRegion(long x, long y, long width, long height)
|
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||||
{ DoSetClippingRegion(x, y, width, height); }
|
{ DoSetClippingRegion(x, y, width, height); }
|
||||||
void SetClippingRegion(const wxPoint& pt, const wxSize& sz)
|
void SetClippingRegion(const wxPoint& pt, const wxSize& sz)
|
||||||
{ DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); }
|
{ DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); }
|
||||||
@@ -242,7 +241,7 @@ public:
|
|||||||
|
|
||||||
virtual void DestroyClippingRegion() = 0;
|
virtual void DestroyClippingRegion() = 0;
|
||||||
|
|
||||||
void GetClippingBox(long *x, long *y, long *w, long *h) const
|
void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
|
||||||
{ DoGetClippingBox(x, y, w, h); }
|
{ DoGetClippingBox(x, y, w, h); }
|
||||||
void GetClippingBox(wxRect& rect) const
|
void GetClippingBox(wxRect& rect) const
|
||||||
{ DoGetClippingBox(&rect.x, &rect.y, &rect.width, &rect.height); }
|
{ DoGetClippingBox(&rect.x, &rect.y, &rect.width, &rect.height); }
|
||||||
@@ -250,13 +249,14 @@ public:
|
|||||||
// text extent
|
// text extent
|
||||||
// -----------
|
// -----------
|
||||||
|
|
||||||
virtual long GetCharHeight() const = 0;
|
virtual wxCoord GetCharHeight() const = 0;
|
||||||
virtual long GetCharWidth() const = 0;
|
virtual wxCoord GetCharWidth() const = 0;
|
||||||
virtual void GetTextExtent(const wxString& string,
|
void GetTextExtent(const wxString& string,
|
||||||
long *x, long *y,
|
wxCoord *x, wxCoord *y,
|
||||||
long *descent = NULL,
|
wxCoord *descent = NULL,
|
||||||
long *externalLeading = NULL,
|
wxCoord *externalLeading = NULL,
|
||||||
wxFont *theFont = NULL) const = 0;
|
wxFont *theFont = NULL) const
|
||||||
|
{ DoGetTextExtent(string, x, y, descent, externalLeading, theFont); }
|
||||||
|
|
||||||
// size and resolution
|
// size and resolution
|
||||||
// -------------------
|
// -------------------
|
||||||
@@ -288,14 +288,14 @@ public:
|
|||||||
|
|
||||||
// This group of functions does actual conversion of the input, as you'd
|
// This group of functions does actual conversion of the input, as you'd
|
||||||
// expect.
|
// expect.
|
||||||
long DeviceToLogicalX(long x) const;
|
wxCoord DeviceToLogicalX(wxCoord x) const;
|
||||||
long DeviceToLogicalY(long y) const;
|
wxCoord DeviceToLogicalY(wxCoord y) const;
|
||||||
long DeviceToLogicalXRel(long x) const;
|
wxCoord DeviceToLogicalXRel(wxCoord x) const;
|
||||||
long DeviceToLogicalYRel(long y) const;
|
wxCoord DeviceToLogicalYRel(wxCoord y) const;
|
||||||
long LogicalToDeviceX(long x) const;
|
wxCoord LogicalToDeviceX(wxCoord x) const;
|
||||||
long LogicalToDeviceY(long y) const;
|
wxCoord LogicalToDeviceY(wxCoord y) const;
|
||||||
long LogicalToDeviceXRel(long x) const;
|
wxCoord LogicalToDeviceXRel(wxCoord x) const;
|
||||||
long LogicalToDeviceYRel(long y) const;
|
wxCoord LogicalToDeviceYRel(wxCoord y) const;
|
||||||
|
|
||||||
// query DC capabilities
|
// query DC capabilities
|
||||||
// ---------------------
|
// ---------------------
|
||||||
@@ -356,17 +356,17 @@ public:
|
|||||||
m_logicalScaleY = y;
|
m_logicalScaleY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetLogicalOrigin(long *x, long *y) const
|
void GetLogicalOrigin(wxCoord *x, wxCoord *y) const
|
||||||
{ DoGetLogicalOrigin(x, y); }
|
{ DoGetLogicalOrigin(x, y); }
|
||||||
wxPoint GetLogicalOrigin() const
|
wxPoint GetLogicalOrigin() const
|
||||||
{ long x, y; DoGetLogicalOrigin(&x, &y); return wxPoint(x, y); }
|
{ wxCoord x, y; DoGetLogicalOrigin(&x, &y); return wxPoint(x, y); }
|
||||||
virtual void SetLogicalOrigin(long x, long y) = 0;
|
virtual void SetLogicalOrigin(wxCoord x, wxCoord y) = 0;
|
||||||
|
|
||||||
void GetDeviceOrigin(long *x, long *y) const
|
void GetDeviceOrigin(wxCoord *x, wxCoord *y) const
|
||||||
{ DoGetDeviceOrigin(x, y); }
|
{ DoGetDeviceOrigin(x, y); }
|
||||||
wxPoint GetDeviceOrigin() const
|
wxPoint GetDeviceOrigin() const
|
||||||
{ long x, y; DoGetDeviceOrigin(&x, &y); return wxPoint(x, y); }
|
{ wxCoord x, y; DoGetDeviceOrigin(&x, &y); return wxPoint(x, y); }
|
||||||
virtual void SetDeviceOrigin(long x, long y) = 0;
|
virtual void SetDeviceOrigin(wxCoord x, wxCoord y) = 0;
|
||||||
|
|
||||||
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) = 0;
|
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) = 0;
|
||||||
|
|
||||||
@@ -383,23 +383,66 @@ public:
|
|||||||
// bounding box
|
// bounding box
|
||||||
// ------------
|
// ------------
|
||||||
|
|
||||||
virtual void CalcBoundingBox(long x, long y)
|
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
if (x < m_minX) m_minX = x;
|
if ( x < m_minX ) m_minX = x;
|
||||||
if (y < m_minY) m_minY = y;
|
if ( y < m_minY ) m_minY = y;
|
||||||
if (x > m_maxX) m_maxX = x;
|
if ( x > m_maxX ) m_maxX = x;
|
||||||
if (y > m_maxY) m_maxY = y;
|
if ( y > m_maxY ) m_maxY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the final bounding box of the PostScript or Metafile picture.
|
// Get the final bounding box of the PostScript or Metafile picture.
|
||||||
long MinX() const { return m_minX; }
|
wxCoord MinX() const { return m_minX; }
|
||||||
long MaxX() const { return m_maxX; }
|
wxCoord MaxX() const { return m_maxX; }
|
||||||
long MinY() const { return m_minY; }
|
wxCoord MinY() const { return m_minY; }
|
||||||
long MaxY() const { return m_maxY; }
|
wxCoord MaxY() const { return m_maxY; }
|
||||||
|
|
||||||
// misc old functions
|
// misc old functions
|
||||||
// ------------------
|
// ------------------
|
||||||
|
|
||||||
|
// for compatibility with the old code when wxCoord was long everywhere
|
||||||
|
#ifndef __WIN16__
|
||||||
|
void GetTextExtent(const wxString& string,
|
||||||
|
long *x, long *y,
|
||||||
|
long *descent = NULL,
|
||||||
|
long *externalLeading = NULL,
|
||||||
|
wxFont *theFont = NULL) const
|
||||||
|
{
|
||||||
|
wxCoord x2, y2, descent2, externalLeading2;
|
||||||
|
DoGetTextExtent(string, &x2, &y2,
|
||||||
|
&descent2, &externalLeading2,
|
||||||
|
theFont);
|
||||||
|
if ( x )
|
||||||
|
*x = x2;
|
||||||
|
if ( y )
|
||||||
|
*y = y2;
|
||||||
|
if ( descent )
|
||||||
|
*descent = descent2;
|
||||||
|
if ( externalLeading )
|
||||||
|
*externalLeading = externalLeading2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetLogicalOrigin(long *x, long *y) const
|
||||||
|
{
|
||||||
|
wxCoord x2, y2;
|
||||||
|
DoGetLogicalOrigin(&x2, &y2);
|
||||||
|
if ( x )
|
||||||
|
*x = x2;
|
||||||
|
if ( y )
|
||||||
|
*y = y2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetDeviceOrigin(long *x, long *y) const
|
||||||
|
{
|
||||||
|
wxCoord x2, y2;
|
||||||
|
DoGetDeviceOrigin(&x2, &y2);
|
||||||
|
if ( x )
|
||||||
|
*x = x2;
|
||||||
|
if ( y )
|
||||||
|
*y = y2;
|
||||||
|
}
|
||||||
|
#endif // !Win16
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY
|
#if WXWIN_COMPATIBILITY
|
||||||
virtual void SetColourMap(const wxPalette& palette) { SetPalette(palette); }
|
virtual void SetColourMap(const wxPalette& palette) { SetPalette(palette); }
|
||||||
void GetTextExtent(const wxString& string, float *x, float *y,
|
void GetTextExtent(const wxString& string, float *x, float *y,
|
||||||
@@ -411,57 +454,59 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// the pure virtual functions which should be implemented by wxDC
|
// the pure virtual functions which should be implemented by wxDC
|
||||||
virtual void DoFloodFill(long x, long y, const wxColour& col,
|
virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||||
int style = wxFLOOD_SURFACE) = 0;
|
int style = wxFLOOD_SURFACE) = 0;
|
||||||
|
|
||||||
virtual bool DoGetPixel(long x, long y, wxColour *col) const = 0;
|
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const = 0;
|
||||||
|
|
||||||
virtual void DoDrawPoint(long x, long y) = 0;
|
virtual void DoDrawPoint(wxCoord x, wxCoord y) = 0;
|
||||||
virtual void DoDrawLine(long x1, long y1, long x2, long y2) = 0;
|
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) = 0;
|
||||||
|
|
||||||
virtual void DoDrawArc(long x1, long y1,
|
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
|
||||||
long x2, long y2,
|
wxCoord x2, wxCoord y2,
|
||||||
long xc, long yc) = 0;
|
wxCoord xc, wxCoord yc) = 0;
|
||||||
virtual void DoDrawEllipticArc(long x, long y, long w, long h,
|
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||||
double sa, double ea) = 0;
|
double sa, double ea) = 0;
|
||||||
|
|
||||||
virtual void DoDrawRectangle(long x, long y, long width, long height) = 0;
|
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) = 0;
|
||||||
virtual void DoDrawRoundedRectangle(long x, long y,
|
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||||
long width, long height,
|
wxCoord width, wxCoord height,
|
||||||
double radius) = 0;
|
double radius) = 0;
|
||||||
virtual void DoDrawEllipse(long x, long y, long width, long height) = 0;
|
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
|
||||||
|
wxCoord width, wxCoord height) = 0;
|
||||||
|
|
||||||
virtual void DoCrossHair(long x, long y) = 0;
|
virtual void DoCrossHair(wxCoord x, wxCoord y) = 0;
|
||||||
|
|
||||||
virtual void DoDrawIcon(const wxIcon& icon, long x, long y) = 0;
|
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0;
|
||||||
virtual void DoDrawBitmap(const wxBitmap &bmp, long x, long y,
|
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||||
bool useMask = FALSE) = 0;
|
bool useMask = FALSE) = 0;
|
||||||
|
|
||||||
virtual void DoDrawText(const wxString& text, long x, long y) = 0;
|
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0;
|
||||||
|
|
||||||
virtual bool DoBlit(long xdest, long ydest, long width, long height,
|
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
||||||
wxDC *source, long xsrc, long ysrc,
|
wxCoord width, wxCoord height,
|
||||||
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop = wxCOPY, bool useMask = FALSE) = 0;
|
int rop = wxCOPY, bool useMask = FALSE) = 0;
|
||||||
|
|
||||||
virtual void DoGetSize(int *width, int *height) const = 0;
|
virtual void DoGetSize(int *width, int *height) const = 0;
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const = 0;
|
virtual void DoGetSizeMM(int* width, int* height) const = 0;
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset) = 0;
|
wxCoord xoffset, wxCoord yoffset) = 0;
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
int fillStyle = wxODDEVEN_RULE) = 0;
|
int fillStyle = wxODDEVEN_RULE) = 0;
|
||||||
|
|
||||||
virtual void DoSetClippingRegionAsRegion(const wxRegion& region) = 0;
|
virtual void DoSetClippingRegionAsRegion(const wxRegion& region) = 0;
|
||||||
virtual void DoSetClippingRegion(long x, long y,
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
|
||||||
long width, long height) = 0;
|
wxCoord width, wxCoord height) = 0;
|
||||||
|
|
||||||
// FIXME are these functions really different?
|
// FIXME are these functions really different?
|
||||||
virtual void DoGetClippingRegion(long *x, long *y,
|
virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
|
||||||
long *w, long *h)
|
wxCoord *w, wxCoord *h)
|
||||||
{ DoGetClippingBox(x, y, w, h); }
|
{ DoGetClippingBox(x, y, w, h); }
|
||||||
virtual void DoGetClippingBox(long *x, long *y,
|
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
|
||||||
long *w, long *h) const
|
wxCoord *w, wxCoord *h) const
|
||||||
{
|
{
|
||||||
if ( m_clipping )
|
if ( m_clipping )
|
||||||
{
|
{
|
||||||
@@ -476,18 +521,24 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DoGetLogicalOrigin(long *x, long *y) const
|
virtual void DoGetLogicalOrigin(wxCoord *x, wxCoord *y) const
|
||||||
{
|
{
|
||||||
if ( x ) *x = m_logicalOriginX;
|
if ( x ) *x = m_logicalOriginX;
|
||||||
if ( y ) *y = m_logicalOriginY;
|
if ( y ) *y = m_logicalOriginY;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DoGetDeviceOrigin(long *x, long *y) const
|
virtual void DoGetDeviceOrigin(wxCoord *x, wxCoord *y) const
|
||||||
{
|
{
|
||||||
if ( x ) *x = m_deviceOriginX;
|
if ( x ) *x = m_deviceOriginX;
|
||||||
if ( y ) *y = m_deviceOriginY;
|
if ( y ) *y = m_deviceOriginY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void DoGetTextExtent(const wxString& string,
|
||||||
|
wxCoord *x, wxCoord *y,
|
||||||
|
wxCoord *descent = NULL,
|
||||||
|
wxCoord *externalLeading = NULL,
|
||||||
|
wxFont *theFont = NULL) const = 0;
|
||||||
|
|
||||||
#if wxUSE_SPLINES
|
#if wxUSE_SPLINES
|
||||||
virtual void DoDrawSpline(wxList *points) = 0;
|
virtual void DoDrawSpline(wxList *points) = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -503,8 +554,8 @@ protected:
|
|||||||
|
|
||||||
// TODO short descriptions of what exactly they are would be nice...
|
// TODO short descriptions of what exactly they are would be nice...
|
||||||
|
|
||||||
long m_logicalOriginX, m_logicalOriginY;
|
wxCoord m_logicalOriginX, m_logicalOriginY;
|
||||||
long m_deviceOriginX, m_deviceOriginY;
|
wxCoord m_deviceOriginX, m_deviceOriginY;
|
||||||
|
|
||||||
double m_logicalScaleX, m_logicalScaleY;
|
double m_logicalScaleX, m_logicalScaleY;
|
||||||
double m_userScaleX, m_userScaleY;
|
double m_userScaleX, m_userScaleY;
|
||||||
@@ -514,8 +565,8 @@ protected:
|
|||||||
int m_signX, m_signY;
|
int m_signX, m_signY;
|
||||||
|
|
||||||
// bounding and clipping boxes
|
// bounding and clipping boxes
|
||||||
long m_minX, m_minY, m_maxX, m_maxY;
|
wxCoord m_minX, m_minY, m_maxX, m_maxY;
|
||||||
long m_clipX1, m_clipY1, m_clipX2, m_clipY2;
|
wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2;
|
||||||
|
|
||||||
int m_logicalFunction;
|
int m_logicalFunction;
|
||||||
int m_backgroundMode;
|
int m_backgroundMode;
|
||||||
|
@@ -506,9 +506,25 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// machine specific settings
|
// standard wxWindows types
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// the type for screen and DC coordinates
|
||||||
|
|
||||||
|
#if wxUSE_COMPATIBLE_COORD_TYPES
|
||||||
|
// to ensure compatibility with 2.0, we must use long
|
||||||
|
#define wxCoord long
|
||||||
|
#else // !wxUSE_COMPATIBLE_COORD_TYPES
|
||||||
|
#ifdef __WIN16__
|
||||||
|
// under Win16, int is too small, so use long to allow for bigger
|
||||||
|
// virtual canvases
|
||||||
|
typedef long wxCoord;
|
||||||
|
#else // !Win16
|
||||||
|
// other platforms we support have at least 32bit int - quite enough
|
||||||
|
typedef int wxCoord;
|
||||||
|
#endif // Win16/!Win16
|
||||||
|
#endif // wxUSE_COMPATIBLE_COORD_TYPES/!wxUSE_COMPATIBLE_COORD_TYPES
|
||||||
|
|
||||||
// fixed length types
|
// fixed length types
|
||||||
|
|
||||||
#define wxInt8 char signed
|
#define wxInt8 char signed
|
||||||
@@ -560,6 +576,10 @@ enum
|
|||||||
#define wxByte wxUint8
|
#define wxByte wxUint8
|
||||||
#define wxWord wxUint16
|
#define wxWord wxUint16
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// byte ordering related definition and macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// byte sex
|
// byte sex
|
||||||
|
|
||||||
#define wxBIG_ENDIAN 4321
|
#define wxBIG_ENDIAN 4321
|
||||||
|
@@ -23,9 +23,7 @@
|
|||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#include "wx/thread.h"
|
||||||
#include "wx/thread.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// forward declarations
|
// forward declarations
|
||||||
|
@@ -172,12 +172,11 @@ public:
|
|||||||
// members are public for compatibility (don't use them directly,
|
// members are public for compatibility (don't use them directly,
|
||||||
// especially that there names were chosen very unfortunately - they should
|
// especially that there names were chosen very unfortunately - they should
|
||||||
// have been called width and height)
|
// have been called width and height)
|
||||||
long x;
|
int x, y;
|
||||||
long y;
|
|
||||||
|
|
||||||
// constructors
|
// constructors
|
||||||
wxSize() { x = y = 0; }
|
wxSize() { x = y = 0; }
|
||||||
wxSize(long xx, long yy) { Set(xx, yy); }
|
wxSize(int xx, int yy) { Set(xx, yy); }
|
||||||
|
|
||||||
// no copy ctor or assignment operator - the defaults are ok
|
// no copy ctor or assignment operator - the defaults are ok
|
||||||
bool operator==(const wxSize& sz) const { return x == sz.x && y == sz.y; }
|
bool operator==(const wxSize& sz) const { return x == sz.x && y == sz.y; }
|
||||||
@@ -187,16 +186,16 @@ public:
|
|||||||
wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); }
|
wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); }
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
void Set(long xx, long yy) { x = xx; y = yy; }
|
void Set(int xx, int yy) { x = xx; y = yy; }
|
||||||
void SetWidth(long w) { x = w; }
|
void SetWidth(int w) { x = w; }
|
||||||
void SetHeight(long h) { y = h; }
|
void SetHeight(int h) { y = h; }
|
||||||
|
|
||||||
long GetWidth() const { return x; }
|
int GetWidth() const { return x; }
|
||||||
long GetHeight() const { return y; }
|
int GetHeight() const { return y; }
|
||||||
|
|
||||||
// compatibility
|
// compatibility
|
||||||
long GetX() const { return x; }
|
int GetX() const { return x; }
|
||||||
long GetY() const { return y; }
|
int GetY() const { return y; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -221,16 +220,10 @@ public:
|
|||||||
class WXDLLEXPORT wxPoint
|
class WXDLLEXPORT wxPoint
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#if defined(__WXMSW__) && !defined(__WIN32__)
|
int x, y;
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
#else
|
|
||||||
long x;
|
|
||||||
long y;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxPoint() { x = y = 0; };
|
wxPoint() { x = y = 0; };
|
||||||
wxPoint(long xx, long yy) { x = xx; y = yy; };
|
wxPoint(int xx, int yy) { x = xx; y = yy; };
|
||||||
|
|
||||||
// no copy ctor or assignment operator - the defaults are ok
|
// no copy ctor or assignment operator - the defaults are ok
|
||||||
|
|
||||||
@@ -259,39 +252,39 @@ class WXDLLEXPORT wxRect
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxRect() { x = y = width = height = 0; }
|
wxRect() { x = y = width = height = 0; }
|
||||||
wxRect(long xx, long yy, long ww, long hh)
|
wxRect(int xx, int yy, int ww, int hh)
|
||||||
{ x = xx; y = yy; width = ww; height = hh; }
|
{ x = xx; y = yy; width = ww; height = hh; }
|
||||||
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
|
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||||
wxRect(const wxPoint& pos, const wxSize& size);
|
wxRect(const wxPoint& pos, const wxSize& size);
|
||||||
|
|
||||||
// default copy ctor and assignment operators ok
|
// default copy ctor and assignment operators ok
|
||||||
|
|
||||||
long GetX() const { return x; }
|
int GetX() const { return x; }
|
||||||
void SetX(long xx) { x = xx; }
|
void SetX(int xx) { x = xx; }
|
||||||
|
|
||||||
long GetY() const { return y; }
|
int GetY() const { return y; }
|
||||||
void SetY(long yy) { y = yy; }
|
void SetY(int yy) { y = yy; }
|
||||||
|
|
||||||
long GetWidth() const { return width; }
|
int GetWidth() const { return width; }
|
||||||
void SetWidth(long w) { width = w; }
|
void SetWidth(int w) { width = w; }
|
||||||
|
|
||||||
long GetHeight() const { return height; }
|
int GetHeight() const { return height; }
|
||||||
void SetHeight(long h) { height = h; }
|
void SetHeight(int h) { height = h; }
|
||||||
|
|
||||||
wxPoint GetPosition() const { return wxPoint(x, y); }
|
wxPoint GetPosition() const { return wxPoint(x, y); }
|
||||||
wxSize GetSize() const { return wxSize(width, height); }
|
wxSize GetSize() const { return wxSize(width, height); }
|
||||||
|
|
||||||
// MFC-like functions
|
// MFC-like functions
|
||||||
|
|
||||||
long GetLeft() const { return x; }
|
int GetLeft() const { return x; }
|
||||||
long GetTop() const { return y; }
|
int GetTop() const { return y; }
|
||||||
long GetBottom() const { return y + height - 1; }
|
int GetBottom() const { return y + height - 1; }
|
||||||
long GetRight() const { return x + width - 1; }
|
int GetRight() const { return x + width - 1; }
|
||||||
|
|
||||||
void SetLeft(long left) { x = left; }
|
void SetLeft(int left) { x = left; }
|
||||||
void SetRight(long right) { width = right - x + 1; }
|
void SetRight(int right) { width = right - x + 1; }
|
||||||
void SetTop(long top) { y = top; }
|
void SetTop(int top) { y = top; }
|
||||||
void SetBottom(long bottom) { height = bottom - y + 1; }
|
void SetBottom(int bottom) { height = bottom - y + 1; }
|
||||||
|
|
||||||
bool operator==(const wxRect& rect) const;
|
bool operator==(const wxRect& rect) const;
|
||||||
bool operator!=(const wxRect& rect) const { return !(*this == rect); }
|
bool operator!=(const wxRect& rect) const { return !(*this == rect); }
|
||||||
@@ -299,9 +292,9 @@ public:
|
|||||||
bool Inside(int cx, int cy) const;
|
bool Inside(int cx, int cy) const;
|
||||||
wxRect operator + (const wxRect& rect) const;
|
wxRect operator + (const wxRect& rect) const;
|
||||||
const wxRect& operator += (const wxRect& rect);
|
const wxRect& operator += (const wxRect& rect);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
long x, y, width, height;
|
int x, y, width, height;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -62,30 +62,30 @@ public:
|
|||||||
virtual void BeginDrawing() {}
|
virtual void BeginDrawing() {}
|
||||||
virtual void EndDrawing() {}
|
virtual void EndDrawing() {}
|
||||||
|
|
||||||
void DoFloodFill(long x1, long y1, const wxColour &col, int style=wxFLOOD_SURFACE );
|
void DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE );
|
||||||
bool DoGetPixel(long x1, long y1, wxColour *col) const;
|
bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const;
|
||||||
|
|
||||||
void DoDrawLine(long x1, long y1, long x2, long y2);
|
void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
||||||
void DoCrossHair(long x, long y) ;
|
void DoCrossHair(wxCoord x, wxCoord y) ;
|
||||||
void DoDrawArc(long x1,long y1,long x2,long y2,long xc,long yc);
|
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
||||||
void DoDrawEllipticArc(long x,long y,long w,long h,double sa,double ea);
|
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
||||||
void DoDrawPoint(long x, long y);
|
void DoDrawPoint(wxCoord x, wxCoord y);
|
||||||
void DoDrawLines(int n, wxPoint points[], long xoffset = 0, long yoffset = 0);
|
void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||||
void DoDrawPolygon(int n, wxPoint points[], long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
||||||
void DoDrawRectangle(long x, long y, long width, long height);
|
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
void DoDrawRoundedRectangle(long x, long y, long width, long height, double radius = 20);
|
void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20);
|
||||||
void DoDrawEllipse(long x, long y, long width, long height);
|
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
|
||||||
void DoDrawSpline(wxList *points);
|
void DoDrawSpline(wxList *points);
|
||||||
|
|
||||||
bool DoBlit(long xdest, long ydest, long width, long height,
|
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc, int rop = wxCOPY, bool useMask = FALSE);
|
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = FALSE);
|
||||||
inline bool CanDrawBitmap(void) const { return TRUE; }
|
bool CanDrawBitmap() const { return TRUE; }
|
||||||
|
|
||||||
void DoDrawIcon( const wxIcon& icon, long x, long y );
|
void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y );
|
||||||
void DoDrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask=FALSE );
|
void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask=FALSE );
|
||||||
|
|
||||||
void DoDrawText(const wxString& text, long x, long y );
|
void DoDrawText(const wxString& text, wxCoord x, wxCoord y );
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
void SetFont( const wxFont& font );
|
void SetFont( const wxFont& font );
|
||||||
@@ -94,35 +94,35 @@ public:
|
|||||||
void SetLogicalFunction( int function );
|
void SetLogicalFunction( int function );
|
||||||
void SetBackground( const wxBrush& brush );
|
void SetBackground( const wxBrush& brush );
|
||||||
|
|
||||||
void DoSetClippingRegion(long x, long y, long width, long height);
|
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
void DestroyClippingRegion();
|
void DestroyClippingRegion();
|
||||||
|
|
||||||
void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) {}
|
void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { }
|
||||||
|
|
||||||
bool StartDoc(const wxString& message);
|
bool StartDoc(const wxString& message);
|
||||||
void EndDoc();
|
void EndDoc();
|
||||||
void StartPage();
|
void StartPage();
|
||||||
void EndPage();
|
void EndPage();
|
||||||
|
|
||||||
long GetCharHeight() const;
|
wxCoord GetCharHeight() const;
|
||||||
long GetCharWidth() const;
|
wxCoord GetCharWidth() const;
|
||||||
inline bool CanGetTextExtent(void) const { return FALSE; }
|
bool CanGetTextExtent() const { return FALSE; }
|
||||||
void GetTextExtent(const wxString& string, long *x, long *y,
|
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
||||||
long *descent = (long *) NULL,
|
wxCoord *descent = (wxCoord *) NULL,
|
||||||
long *externalLeading = (long *) NULL,
|
wxCoord *externalLeading = (wxCoord *) NULL,
|
||||||
wxFont *theFont = (wxFont *) NULL ) const;
|
wxFont *theFont = (wxFont *) NULL ) const;
|
||||||
|
|
||||||
void DoGetSize(int* width, int* height) const;
|
void DoGetSize(int* width, int* height) const;
|
||||||
void DoGetSizeMM(int *width, int *height) const;
|
void DoGetSizeMM(int *width, int *height) const;
|
||||||
|
|
||||||
// Resolution in pixels per logical inch
|
// Resolution in pixels per logical inch
|
||||||
wxSize GetPPI(void) const;
|
wxSize GetPPI() const;
|
||||||
|
|
||||||
void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
||||||
void SetDeviceOrigin( long x, long y );
|
void SetDeviceOrigin( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
inline void SetBackgroundMode(int WXUNUSED(mode)) {}
|
void SetBackgroundMode(int WXUNUSED(mode)) { }
|
||||||
inline void SetPalette(const wxPalette& WXUNUSED(palette)) {}
|
void SetPalette(const wxPalette& WXUNUSED(palette)) { }
|
||||||
|
|
||||||
wxPrintData& GetPrintData() { return m_printData; }
|
wxPrintData& GetPrintData() { return m_printData; }
|
||||||
void SetPrintData(const wxPrintData& data) { m_printData = data; }
|
void SetPrintData(const wxPrintData& data) { m_printData = data; }
|
||||||
@@ -145,14 +145,17 @@ protected:
|
|||||||
|
|
||||||
// Deprecated: should use wxGenericPrintDialog instead.
|
// Deprecated: should use wxGenericPrintDialog instead.
|
||||||
#if 1
|
#if 1
|
||||||
#define wxID_PRINTER_COMMAND 1
|
enum
|
||||||
#define wxID_PRINTER_OPTIONS 2
|
{
|
||||||
#define wxID_PRINTER_ORIENTATION 3
|
wxID_PRINTER_COMMAND = 1,
|
||||||
#define wxID_PRINTER_MODES 4
|
wxID_PRINTER_OPTIONS,
|
||||||
#define wxID_PRINTER_X_SCALE 5
|
wxID_PRINTER_ORIENTATION,
|
||||||
#define wxID_PRINTER_Y_SCALE 6
|
wxID_PRINTER_MODES,
|
||||||
#define wxID_PRINTER_X_TRANS 7
|
wxID_PRINTER_X_SCALE,
|
||||||
#define wxID_PRINTER_Y_TRANS 8
|
wxID_PRINTER_Y_SCALE,
|
||||||
|
wxID_PRINTER_X_TRANS,
|
||||||
|
wxID_PRINTER_Y_TRANS
|
||||||
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxPostScriptPrintDialog: public wxDialog
|
class WXDLLEXPORT wxPostScriptPrintDialog: public wxDialog
|
||||||
{
|
{
|
||||||
@@ -160,11 +163,11 @@ DECLARE_CLASS(wxPostScriptPrintDialog)
|
|||||||
public:
|
public:
|
||||||
wxPostScriptPrintDialog (wxWindow *parent, const wxString& title,
|
wxPostScriptPrintDialog (wxWindow *parent, const wxString& title,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
long style = wxDEFAULT_DIALOG_STYLE);
|
wxCoord style = wxDEFAULT_DIALOG_STYLE);
|
||||||
|
|
||||||
virtual int ShowModal(void) ;
|
virtual int ShowModal();
|
||||||
};
|
};
|
||||||
#endif
|
#endif // 1
|
||||||
|
|
||||||
// Print Orientation (Should also add Left, Right)
|
// Print Orientation (Should also add Left, Right)
|
||||||
enum
|
enum
|
||||||
@@ -188,7 +191,7 @@ WXDLLEXPORT void wxSetPrintPreviewCommand(const wxString& cmd);
|
|||||||
WXDLLEXPORT void wxSetPrinterOptions(const wxString& flags);
|
WXDLLEXPORT void wxSetPrinterOptions(const wxString& flags);
|
||||||
WXDLLEXPORT void wxSetPrinterOrientation(int orientation);
|
WXDLLEXPORT void wxSetPrinterOrientation(int orientation);
|
||||||
WXDLLEXPORT void wxSetPrinterScaling(double x, double y);
|
WXDLLEXPORT void wxSetPrinterScaling(double x, double y);
|
||||||
WXDLLEXPORT void wxSetPrinterTranslation(long x, long y);
|
WXDLLEXPORT void wxSetPrinterTranslation(wxCoord x, wxCoord y);
|
||||||
WXDLLEXPORT void wxSetPrinterMode(int mode);
|
WXDLLEXPORT void wxSetPrinterMode(int mode);
|
||||||
WXDLLEXPORT void wxSetPrinterFile(const wxString& f);
|
WXDLLEXPORT void wxSetPrinterFile(const wxString& f);
|
||||||
WXDLLEXPORT void wxSetAFMPath(const wxString& f);
|
WXDLLEXPORT void wxSetAFMPath(const wxString& f);
|
||||||
@@ -199,7 +202,7 @@ WXDLLEXPORT wxString wxGetPrintPreviewCommand();
|
|||||||
WXDLLEXPORT wxString wxGetPrinterOptions();
|
WXDLLEXPORT wxString wxGetPrinterOptions();
|
||||||
WXDLLEXPORT int wxGetPrinterOrientation();
|
WXDLLEXPORT int wxGetPrinterOrientation();
|
||||||
WXDLLEXPORT void wxGetPrinterScaling(double* x, double* y);
|
WXDLLEXPORT void wxGetPrinterScaling(double* x, double* y);
|
||||||
WXDLLEXPORT void wxGetPrinterTranslation(long *x, long *y);
|
WXDLLEXPORT void wxGetPrinterTranslation(wxCoord *x, wxCoord *y);
|
||||||
WXDLLEXPORT int wxGetPrinterMode();
|
WXDLLEXPORT int wxGetPrinterMode();
|
||||||
WXDLLEXPORT wxString wxGetPrinterFile();
|
WXDLLEXPORT wxString wxGetPrinterFile();
|
||||||
WXDLLEXPORT wxString wxGetAFMPath();
|
WXDLLEXPORT wxString wxGetAFMPath();
|
||||||
@@ -222,7 +225,7 @@ public:
|
|||||||
void SetPrinterFile(const wxString& f) { m_printerFile = f; };
|
void SetPrinterFile(const wxString& f) { m_printerFile = f; };
|
||||||
void SetPrinterOrientation(int orient) { m_printerOrient = orient; };
|
void SetPrinterOrientation(int orient) { m_printerOrient = orient; };
|
||||||
void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; };
|
void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; };
|
||||||
void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; };
|
void SetPrinterTranslation(wxCoord x, wxCoord y) { m_printerTranslateX = x; m_printerTranslateY = y; };
|
||||||
// 1 = Preview, 2 = print to file, 3 = send to printer
|
// 1 = Preview, 2 = print to file, 3 = send to printer
|
||||||
void SetPrinterMode(int mode) { m_printerMode = mode; };
|
void SetPrinterMode(int mode) { m_printerMode = mode; };
|
||||||
void SetAFMPath(const wxString& f) { m_afmPath = f; };
|
void SetAFMPath(const wxString& f) { m_afmPath = f; };
|
||||||
@@ -236,7 +239,7 @@ public:
|
|||||||
wxString GetPaperName() const { return m_paperName; }
|
wxString GetPaperName() const { return m_paperName; }
|
||||||
int GetPrinterOrientation() const { return m_printerOrient; };
|
int GetPrinterOrientation() const { return m_printerOrient; };
|
||||||
void GetPrinterScaling(double* x, double* y) const { *x = m_printerScaleX; *y = m_printerScaleY; };
|
void GetPrinterScaling(double* x, double* y) const { *x = m_printerScaleX; *y = m_printerScaleY; };
|
||||||
void GetPrinterTranslation(long *x, long *y) const { *x = m_printerTranslateX; *y = m_printerTranslateY; };
|
void GetPrinterTranslation(wxCoord *x, wxCoord *y) const { *x = m_printerTranslateX; *y = m_printerTranslateY; };
|
||||||
int GetPrinterMode() const { return m_printerMode; };
|
int GetPrinterMode() const { return m_printerMode; };
|
||||||
wxString GetAFMPath() const { return m_afmPath; };
|
wxString GetAFMPath() const { return m_afmPath; };
|
||||||
bool GetColour() const { return m_printColour; };
|
bool GetColour() const { return m_printColour; };
|
||||||
@@ -247,6 +250,11 @@ public:
|
|||||||
// There is also an operator for initializing a wxPrintData from a wxPrintSetupData.
|
// There is also an operator for initializing a wxPrintData from a wxPrintSetupData.
|
||||||
void operator=(const wxPrintData& data);
|
void operator=(const wxPrintData& data);
|
||||||
|
|
||||||
|
#ifndef __WIN16__
|
||||||
|
void GetPrinterTranslation(long *x, long *y) const
|
||||||
|
{ *x = m_printerTranslateX; *y = m_printerTranslateY; }
|
||||||
|
#endif // !Win16
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxString m_printerCommand;
|
wxString m_printerCommand;
|
||||||
wxString m_previewCommand;
|
wxString m_previewCommand;
|
||||||
@@ -255,8 +263,8 @@ public:
|
|||||||
int m_printerOrient;
|
int m_printerOrient;
|
||||||
double m_printerScaleX;
|
double m_printerScaleX;
|
||||||
double m_printerScaleY;
|
double m_printerScaleY;
|
||||||
long m_printerTranslateX;
|
wxCoord m_printerTranslateX;
|
||||||
long m_printerTranslateY;
|
wxCoord m_printerTranslateY;
|
||||||
// 1 = Preview, 2 = print to file, 3 = send to printer
|
// 1 = Preview, 2 = print to file, 3 = send to printer
|
||||||
int m_printerMode;
|
int m_printerMode;
|
||||||
wxString m_afmPath;
|
wxString m_afmPath;
|
||||||
@@ -264,7 +272,7 @@ public:
|
|||||||
wxString m_paperName;
|
wxString m_paperName;
|
||||||
bool m_printColour;
|
bool m_printColour;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPrintSetupData)
|
DECLARE_DYNAMIC_CLASS(wxPrintSetupData)
|
||||||
};
|
};
|
||||||
|
|
||||||
WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData;
|
WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData;
|
||||||
@@ -272,7 +280,7 @@ WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE);
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_POSTSCRIPT
|
// wxUSE_POSTSCRIPT
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_PRINTING_ARCHITECTURE
|
// wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
@@ -59,7 +59,6 @@ public:
|
|||||||
static void CleanUp();
|
static void CleanUp();
|
||||||
|
|
||||||
bool ProcessIdle();
|
bool ProcessIdle();
|
||||||
void ProcessPendingEvents();
|
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
|
|
||||||
// This can be used to suppress the generation of Idle events.
|
// This can be used to suppress the generation of Idle events.
|
||||||
|
@@ -62,8 +62,8 @@ public:
|
|||||||
virtual void SetMapMode( int mode );
|
virtual void SetMapMode( int mode );
|
||||||
virtual void SetUserScale( double x, double y );
|
virtual void SetUserScale( double x, double y );
|
||||||
virtual void SetLogicalScale( double x, double y );
|
virtual void SetLogicalScale( double x, double y );
|
||||||
virtual void SetLogicalOrigin( long x, long y );
|
virtual void SetLogicalOrigin( wxCoord x, wxCoord y );
|
||||||
virtual void SetDeviceOrigin( long x, long y );
|
virtual void SetDeviceOrigin( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
||||||
|
|
||||||
@@ -72,70 +72,70 @@ public:
|
|||||||
|
|
||||||
virtual void ComputeScaleAndOrigin();
|
virtual void ComputeScaleAndOrigin();
|
||||||
|
|
||||||
long XDEV2LOG(long x) const
|
wxCoord XDEV2LOG(wxCoord x) const
|
||||||
{
|
{
|
||||||
long new_x = x - m_deviceOriginX;
|
wxCoord new_x = x - m_deviceOriginX;
|
||||||
if (new_x > 0)
|
if (new_x > 0)
|
||||||
return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
|
return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
|
return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
|
||||||
}
|
}
|
||||||
long XDEV2LOGREL(long x) const
|
wxCoord XDEV2LOGREL(wxCoord x) const
|
||||||
{
|
{
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
return (long)((double)(x) / m_scaleX + 0.5);
|
return (wxCoord)((double)(x) / m_scaleX + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(x) / m_scaleX - 0.5);
|
return (wxCoord)((double)(x) / m_scaleX - 0.5);
|
||||||
}
|
}
|
||||||
long YDEV2LOG(long y) const
|
wxCoord YDEV2LOG(wxCoord y) const
|
||||||
{
|
{
|
||||||
long new_y = y - m_deviceOriginY;
|
wxCoord new_y = y - m_deviceOriginY;
|
||||||
if (new_y > 0)
|
if (new_y > 0)
|
||||||
return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
|
return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
|
return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
|
||||||
}
|
}
|
||||||
long YDEV2LOGREL(long y) const
|
wxCoord YDEV2LOGREL(wxCoord y) const
|
||||||
{
|
{
|
||||||
if (y > 0)
|
if (y > 0)
|
||||||
return (long)((double)(y) / m_scaleY + 0.5);
|
return (wxCoord)((double)(y) / m_scaleY + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(y) / m_scaleY - 0.5);
|
return (wxCoord)((double)(y) / m_scaleY - 0.5);
|
||||||
}
|
}
|
||||||
long XLOG2DEV(long x) const
|
wxCoord XLOG2DEV(wxCoord x) const
|
||||||
{
|
{
|
||||||
long new_x = x - m_logicalOriginX;
|
wxCoord new_x = x - m_logicalOriginX;
|
||||||
if (new_x > 0)
|
if (new_x > 0)
|
||||||
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
|
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
|
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
|
||||||
}
|
}
|
||||||
long XLOG2DEVREL(long x) const
|
wxCoord XLOG2DEVREL(wxCoord x) const
|
||||||
{
|
{
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
return (long)((double)(x) * m_scaleX + 0.5);
|
return (wxCoord)((double)(x) * m_scaleX + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(x) * m_scaleX - 0.5);
|
return (wxCoord)((double)(x) * m_scaleX - 0.5);
|
||||||
}
|
}
|
||||||
long YLOG2DEV(long y) const
|
wxCoord YLOG2DEV(wxCoord y) const
|
||||||
{
|
{
|
||||||
long new_y = y - m_logicalOriginY;
|
wxCoord new_y = y - m_logicalOriginY;
|
||||||
if (new_y > 0)
|
if (new_y > 0)
|
||||||
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
|
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
|
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
|
||||||
}
|
}
|
||||||
long YLOG2DEVREL(long y) const
|
wxCoord YLOG2DEVREL(wxCoord y) const
|
||||||
{
|
{
|
||||||
if (y > 0)
|
if (y > 0)
|
||||||
return (long)((double)(y) * m_scaleY + 0.5);
|
return (wxCoord)((double)(y) * m_scaleY + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(y) * m_scaleY - 0.5);
|
return (wxCoord)((double)(y) * m_scaleY - 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// base class pure virtuals implemented here
|
// base class pure virtuals implemented here
|
||||||
virtual void DoSetClippingRegion(long x, long y, long width, long height);
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
|
@@ -42,43 +42,43 @@ public:
|
|||||||
virtual bool CanDrawBitmap() const { return TRUE; }
|
virtual bool CanDrawBitmap() const { return TRUE; }
|
||||||
virtual bool CanGetTextExtent() const { return TRUE; }
|
virtual bool CanGetTextExtent() const { return TRUE; }
|
||||||
|
|
||||||
virtual void DoFloodFill( long x, long y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
||||||
virtual bool DoGetPixel( long x1, long y1, wxColour *col ) const;
|
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
|
||||||
|
|
||||||
virtual void DoDrawLine( long x1, long y1, long x2, long y2 );
|
virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 );
|
||||||
virtual void DoCrossHair( long x, long y );
|
virtual void DoCrossHair( wxCoord x, wxCoord y );
|
||||||
virtual void DoDrawArc( long x1, long y1, long x2, long y2,
|
virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
||||||
long xc, long yc );
|
wxCoord xc, wxCoord yc );
|
||||||
virtual void DoDrawEllipticArc( long x, long y, long width, long height,
|
virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height,
|
||||||
double sa, double ea );
|
double sa, double ea );
|
||||||
virtual void DoDrawPoint( long x, long y );
|
virtual void DoDrawPoint( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
int fillStyle = wxODDEVEN_RULE);
|
int fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
virtual void DoDrawRectangle( long x, long y, long width, long height );
|
virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||||
virtual void DoDrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 );
|
virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 );
|
||||||
virtual void DoDrawEllipse( long x, long y, long width, long height );
|
virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||||
|
|
||||||
virtual void DoDrawIcon( const wxIcon &icon, long x, long y );
|
virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y );
|
||||||
virtual void DoDrawBitmap( const wxBitmap &bitmap, long x, long y,
|
virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y,
|
||||||
bool useMask = FALSE );
|
bool useMask = FALSE );
|
||||||
|
|
||||||
virtual bool DoBlit( long xdest, long ydest, long width, long height,
|
virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int logical_func = wxCOPY, bool useMask = FALSE );
|
int logical_func = wxCOPY, bool useMask = FALSE );
|
||||||
|
|
||||||
virtual void DoDrawText( const wxString &text, long x, long y );
|
virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y );
|
||||||
virtual void GetTextExtent( const wxString &string,
|
virtual void DoGetTextExtent( const wxString &string,
|
||||||
long *width, long *height,
|
wxCoord *width, wxCoord *height,
|
||||||
long *descent = (long *) NULL,
|
wxCoord *descent = (wxCoord *) NULL,
|
||||||
long *externalLeading = (long *) NULL,
|
wxCoord *externalLeading = (wxCoord *) NULL,
|
||||||
wxFont *theFont = (wxFont *) NULL) const;
|
wxFont *theFont = (wxFont *) NULL) const;
|
||||||
virtual long GetCharWidth() const;
|
virtual wxCoord GetCharWidth() const;
|
||||||
virtual long GetCharHeight() const;
|
virtual wxCoord GetCharHeight() const;
|
||||||
|
|
||||||
virtual void Clear();
|
virtual void Clear();
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ public:
|
|||||||
virtual void SetBackgroundMode( int mode );
|
virtual void SetBackgroundMode( int mode );
|
||||||
virtual void SetPalette( const wxPalette& palette );
|
virtual void SetPalette( const wxPalette& palette );
|
||||||
|
|
||||||
virtual void DoSetClippingRegion( long x, long y, long width, long height );
|
virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||||
virtual void DestroyClippingRegion();
|
virtual void DestroyClippingRegion();
|
||||||
virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion );
|
virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion );
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@ class wxMemoryDC;
|
|||||||
// wxMemoryDC
|
// wxMemoryDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxMemoryDC: public wxWindowDC
|
class wxMemoryDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __GTKDCSCREENH__
|
#ifndef __GTKDCSCREENH__
|
||||||
@@ -27,15 +27,15 @@ class wxScreenDC: public wxPaintDC
|
|||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxScreenDC(void);
|
wxScreenDC();
|
||||||
~wxScreenDC(void);
|
~wxScreenDC();
|
||||||
|
|
||||||
static bool StartDrawingOnTop( wxWindow *window );
|
static bool StartDrawingOnTop( wxWindow *window );
|
||||||
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
||||||
static bool EndDrawingOnTop(void);
|
static bool EndDrawingOnTop();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
static GdkWindow *sm_overlayWindow;
|
static GdkWindow *sm_overlayWindow;
|
||||||
static int sm_overlayWindowX;
|
static int sm_overlayWindowX;
|
||||||
static int sm_overlayWindowY;
|
static int sm_overlayWindowY;
|
||||||
|
@@ -59,7 +59,6 @@ public:
|
|||||||
static void CleanUp();
|
static void CleanUp();
|
||||||
|
|
||||||
bool ProcessIdle();
|
bool ProcessIdle();
|
||||||
void ProcessPendingEvents();
|
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
|
|
||||||
// This can be used to suppress the generation of Idle events.
|
// This can be used to suppress the generation of Idle events.
|
||||||
|
@@ -62,8 +62,8 @@ public:
|
|||||||
virtual void SetMapMode( int mode );
|
virtual void SetMapMode( int mode );
|
||||||
virtual void SetUserScale( double x, double y );
|
virtual void SetUserScale( double x, double y );
|
||||||
virtual void SetLogicalScale( double x, double y );
|
virtual void SetLogicalScale( double x, double y );
|
||||||
virtual void SetLogicalOrigin( long x, long y );
|
virtual void SetLogicalOrigin( wxCoord x, wxCoord y );
|
||||||
virtual void SetDeviceOrigin( long x, long y );
|
virtual void SetDeviceOrigin( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
||||||
|
|
||||||
@@ -72,70 +72,70 @@ public:
|
|||||||
|
|
||||||
virtual void ComputeScaleAndOrigin();
|
virtual void ComputeScaleAndOrigin();
|
||||||
|
|
||||||
long XDEV2LOG(long x) const
|
wxCoord XDEV2LOG(wxCoord x) const
|
||||||
{
|
{
|
||||||
long new_x = x - m_deviceOriginX;
|
wxCoord new_x = x - m_deviceOriginX;
|
||||||
if (new_x > 0)
|
if (new_x > 0)
|
||||||
return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
|
return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
|
return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
|
||||||
}
|
}
|
||||||
long XDEV2LOGREL(long x) const
|
wxCoord XDEV2LOGREL(wxCoord x) const
|
||||||
{
|
{
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
return (long)((double)(x) / m_scaleX + 0.5);
|
return (wxCoord)((double)(x) / m_scaleX + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(x) / m_scaleX - 0.5);
|
return (wxCoord)((double)(x) / m_scaleX - 0.5);
|
||||||
}
|
}
|
||||||
long YDEV2LOG(long y) const
|
wxCoord YDEV2LOG(wxCoord y) const
|
||||||
{
|
{
|
||||||
long new_y = y - m_deviceOriginY;
|
wxCoord new_y = y - m_deviceOriginY;
|
||||||
if (new_y > 0)
|
if (new_y > 0)
|
||||||
return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
|
return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
|
return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
|
||||||
}
|
}
|
||||||
long YDEV2LOGREL(long y) const
|
wxCoord YDEV2LOGREL(wxCoord y) const
|
||||||
{
|
{
|
||||||
if (y > 0)
|
if (y > 0)
|
||||||
return (long)((double)(y) / m_scaleY + 0.5);
|
return (wxCoord)((double)(y) / m_scaleY + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(y) / m_scaleY - 0.5);
|
return (wxCoord)((double)(y) / m_scaleY - 0.5);
|
||||||
}
|
}
|
||||||
long XLOG2DEV(long x) const
|
wxCoord XLOG2DEV(wxCoord x) const
|
||||||
{
|
{
|
||||||
long new_x = x - m_logicalOriginX;
|
wxCoord new_x = x - m_logicalOriginX;
|
||||||
if (new_x > 0)
|
if (new_x > 0)
|
||||||
return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
|
return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
|
return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
|
||||||
}
|
}
|
||||||
long XLOG2DEVREL(long x) const
|
wxCoord XLOG2DEVREL(wxCoord x) const
|
||||||
{
|
{
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
return (long)((double)(x) * m_scaleX + 0.5);
|
return (wxCoord)((double)(x) * m_scaleX + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(x) * m_scaleX - 0.5);
|
return (wxCoord)((double)(x) * m_scaleX - 0.5);
|
||||||
}
|
}
|
||||||
long YLOG2DEV(long y) const
|
wxCoord YLOG2DEV(wxCoord y) const
|
||||||
{
|
{
|
||||||
long new_y = y - m_logicalOriginY;
|
wxCoord new_y = y - m_logicalOriginY;
|
||||||
if (new_y > 0)
|
if (new_y > 0)
|
||||||
return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
|
return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
|
||||||
else
|
else
|
||||||
return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
|
return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
|
||||||
}
|
}
|
||||||
long YLOG2DEVREL(long y) const
|
wxCoord YLOG2DEVREL(wxCoord y) const
|
||||||
{
|
{
|
||||||
if (y > 0)
|
if (y > 0)
|
||||||
return (long)((double)(y) * m_scaleY + 0.5);
|
return (wxCoord)((double)(y) * m_scaleY + 0.5);
|
||||||
else
|
else
|
||||||
return (long)((double)(y) * m_scaleY - 0.5);
|
return (wxCoord)((double)(y) * m_scaleY - 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// base class pure virtuals implemented here
|
// base class pure virtuals implemented here
|
||||||
virtual void DoSetClippingRegion(long x, long y, long width, long height);
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
|
@@ -42,43 +42,43 @@ public:
|
|||||||
virtual bool CanDrawBitmap() const { return TRUE; }
|
virtual bool CanDrawBitmap() const { return TRUE; }
|
||||||
virtual bool CanGetTextExtent() const { return TRUE; }
|
virtual bool CanGetTextExtent() const { return TRUE; }
|
||||||
|
|
||||||
virtual void DoFloodFill( long x, long y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
||||||
virtual bool DoGetPixel( long x1, long y1, wxColour *col ) const;
|
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
|
||||||
|
|
||||||
virtual void DoDrawLine( long x1, long y1, long x2, long y2 );
|
virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 );
|
||||||
virtual void DoCrossHair( long x, long y );
|
virtual void DoCrossHair( wxCoord x, wxCoord y );
|
||||||
virtual void DoDrawArc( long x1, long y1, long x2, long y2,
|
virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
||||||
long xc, long yc );
|
wxCoord xc, wxCoord yc );
|
||||||
virtual void DoDrawEllipticArc( long x, long y, long width, long height,
|
virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height,
|
||||||
double sa, double ea );
|
double sa, double ea );
|
||||||
virtual void DoDrawPoint( long x, long y );
|
virtual void DoDrawPoint( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
int fillStyle = wxODDEVEN_RULE);
|
int fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
virtual void DoDrawRectangle( long x, long y, long width, long height );
|
virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||||
virtual void DoDrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 );
|
virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 );
|
||||||
virtual void DoDrawEllipse( long x, long y, long width, long height );
|
virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||||
|
|
||||||
virtual void DoDrawIcon( const wxIcon &icon, long x, long y );
|
virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y );
|
||||||
virtual void DoDrawBitmap( const wxBitmap &bitmap, long x, long y,
|
virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y,
|
||||||
bool useMask = FALSE );
|
bool useMask = FALSE );
|
||||||
|
|
||||||
virtual bool DoBlit( long xdest, long ydest, long width, long height,
|
virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int logical_func = wxCOPY, bool useMask = FALSE );
|
int logical_func = wxCOPY, bool useMask = FALSE );
|
||||||
|
|
||||||
virtual void DoDrawText( const wxString &text, long x, long y );
|
virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y );
|
||||||
virtual void GetTextExtent( const wxString &string,
|
virtual void DoGetTextExtent( const wxString &string,
|
||||||
long *width, long *height,
|
wxCoord *width, wxCoord *height,
|
||||||
long *descent = (long *) NULL,
|
wxCoord *descent = (wxCoord *) NULL,
|
||||||
long *externalLeading = (long *) NULL,
|
wxCoord *externalLeading = (wxCoord *) NULL,
|
||||||
wxFont *theFont = (wxFont *) NULL) const;
|
wxFont *theFont = (wxFont *) NULL) const;
|
||||||
virtual long GetCharWidth() const;
|
virtual wxCoord GetCharWidth() const;
|
||||||
virtual long GetCharHeight() const;
|
virtual wxCoord GetCharHeight() const;
|
||||||
|
|
||||||
virtual void Clear();
|
virtual void Clear();
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ public:
|
|||||||
virtual void SetBackgroundMode( int mode );
|
virtual void SetBackgroundMode( int mode );
|
||||||
virtual void SetPalette( const wxPalette& palette );
|
virtual void SetPalette( const wxPalette& palette );
|
||||||
|
|
||||||
virtual void DoSetClippingRegion( long x, long y, long width, long height );
|
virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height );
|
||||||
virtual void DestroyClippingRegion();
|
virtual void DestroyClippingRegion();
|
||||||
virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion );
|
virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion );
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@ class wxMemoryDC;
|
|||||||
// wxMemoryDC
|
// wxMemoryDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxMemoryDC: public wxWindowDC
|
class wxMemoryDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __GTKDCSCREENH__
|
#ifndef __GTKDCSCREENH__
|
||||||
@@ -27,15 +27,15 @@ class wxScreenDC: public wxPaintDC
|
|||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxScreenDC(void);
|
wxScreenDC();
|
||||||
~wxScreenDC(void);
|
~wxScreenDC();
|
||||||
|
|
||||||
static bool StartDrawingOnTop( wxWindow *window );
|
static bool StartDrawingOnTop( wxWindow *window );
|
||||||
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
||||||
static bool EndDrawingOnTop(void);
|
static bool EndDrawingOnTop();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
static GdkWindow *sm_overlayWindow;
|
static GdkWindow *sm_overlayWindow;
|
||||||
static int sm_overlayWindowX;
|
static int sm_overlayWindowX;
|
||||||
static int sm_overlayWindowY;
|
static int sm_overlayWindowY;
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
|
|
||||||
#if wxUSE_PRINTING_ARCHITECTURE
|
#if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
#include "wx/html/htmlcell.h"
|
#include "wx/html/htmlcell.h"
|
||||||
#include "wx/html/winpars.h"
|
#include "wx/html/winpars.h"
|
||||||
@@ -25,15 +25,13 @@
|
|||||||
#include "wx/print.h"
|
#include "wx/print.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
// wxHtmlDCRenderer
|
// wxHtmlDCRenderer
|
||||||
// This class is capable of rendering HTML into specified
|
// This class is capable of rendering HTML into specified
|
||||||
// portion of DC
|
// portion of DC
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxHtmlDCRenderer : public wxObject
|
||||||
class wxHtmlDCRenderer : public wxObject
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxHtmlDCRenderer();
|
wxHtmlDCRenderer();
|
||||||
@@ -103,7 +101,7 @@ enum {
|
|||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class wxHtmlPrintout : public wxPrintout
|
class WXDLLEXPORT wxHtmlPrintout : public wxPrintout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxHtmlPrintout(const wxString& title = "Printout");
|
wxHtmlPrintout(const wxString& title = "Printout");
|
||||||
@@ -181,7 +179,7 @@ class wxHtmlPrintout : public wxPrintout
|
|||||||
// stores page&printer settings in it.
|
// stores page&printer settings in it.
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxHtmlEasyPrinting : public wxObject
|
class WXDLLEXPORT wxHtmlEasyPrinting : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -233,7 +231,7 @@ class wxHtmlEasyPrinting : public wxObject
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
#endif // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
#endif // _WX_HTMPRINT_H_
|
#endif // _WX_HTMPRINT_H_
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 17/09/98
|
// Created: 17/09/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_ACCEL_H_
|
#ifndef _WX_ACCEL_H_
|
||||||
@@ -46,12 +46,12 @@ public:
|
|||||||
m_flags = flags; m_keyCode = keyCode; m_command = cmd;
|
m_flags = flags; m_keyCode = keyCode; m_command = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Set(int flags, int keyCode, int cmd)
|
void Set(int flags, int keyCode, int cmd)
|
||||||
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
|
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
|
||||||
|
|
||||||
inline int GetFlags() const { return m_flags; }
|
int GetFlags() const { return m_flags; }
|
||||||
inline int GetKeyCode() const { return m_keyCode; }
|
int GetKeyCode() const { return m_keyCode; }
|
||||||
inline int GetCommand() const { return m_command; }
|
int GetCommand() const { return m_command; }
|
||||||
|
|
||||||
void operator = (const wxAcceleratorEntry& entry)
|
void operator = (const wxAcceleratorEntry& entry)
|
||||||
{
|
{
|
||||||
@@ -62,9 +62,9 @@ public:
|
|||||||
bool MatchesEvent(const wxKeyEvent& event) const;
|
bool MatchesEvent(const wxKeyEvent& event) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int m_flags;
|
int m_flags;
|
||||||
int m_keyCode; // ASCII or virtual keycode
|
int m_keyCode; // ASCII or virtual keycode
|
||||||
int m_command; // Command id to generate
|
int m_command; // Command id to generate
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxAcceleratorTable: public wxObject
|
class WXDLLEXPORT wxAcceleratorTable: public wxObject
|
||||||
@@ -76,14 +76,14 @@ public:
|
|||||||
wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array
|
wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array
|
||||||
|
|
||||||
// Copy constructors
|
// Copy constructors
|
||||||
inline wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
|
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
|
||||||
inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
|
wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
|
||||||
|
|
||||||
~wxAcceleratorTable();
|
~wxAcceleratorTable();
|
||||||
|
|
||||||
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
|
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
|
||||||
inline bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; }
|
bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; }
|
||||||
inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; }
|
bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; }
|
||||||
|
|
||||||
bool Ok() const;
|
bool Ok() const;
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
class WXDLLEXPORT wxFrame;
|
class WXDLLEXPORT wxFrame;
|
||||||
class WXDLLEXPORT wxWindow;
|
class WXDLLEXPORT wxWindow;
|
||||||
class WXDLLEXPORT wxApp ;
|
class WXDLLEXPORT wxApp;
|
||||||
class WXDLLEXPORT wxKeyEvent;
|
class WXDLLEXPORT wxKeyEvent;
|
||||||
class WXDLLEXPORT wxLog;
|
class WXDLLEXPORT wxLog;
|
||||||
|
|
||||||
@@ -51,8 +51,8 @@ public:
|
|||||||
virtual int MainLoop();
|
virtual int MainLoop();
|
||||||
virtual void ExitMainLoop();
|
virtual void ExitMainLoop();
|
||||||
virtual bool Initialized();
|
virtual bool Initialized();
|
||||||
virtual bool Pending() ;
|
virtual bool Pending();
|
||||||
virtual void Dispatch() ;
|
virtual void Dispatch();
|
||||||
|
|
||||||
virtual bool OnInitGui();
|
virtual bool OnInitGui();
|
||||||
|
|
||||||
@@ -95,14 +95,11 @@ public:
|
|||||||
|
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
bool ProcessIdle();
|
bool ProcessIdle();
|
||||||
#if wxUSE_THREADS
|
|
||||||
void ProcessPendingEvents();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Motif-specific
|
// Motif-specific
|
||||||
WXAppContext GetAppContext() const { return m_appContext; }
|
WXAppContext GetAppContext() const { return m_appContext; }
|
||||||
WXWidget GetTopLevelWidget() const { return m_topLevelWidget; }
|
WXWidget GetTopLevelWidget() const { return m_topLevelWidget; }
|
||||||
WXColormap GetMainColormap(WXDisplay* display) ;
|
WXColormap GetMainColormap(WXDisplay* display);
|
||||||
WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
|
WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
|
||||||
long GetMaxRequestSize() const { return m_maxRequestSize; }
|
long GetMaxRequestSize() const { return m_maxRequestSize; }
|
||||||
|
|
||||||
@@ -114,7 +111,7 @@ public:
|
|||||||
int m_nCmdShow;
|
int m_nCmdShow;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_keepGoing ;
|
bool m_keepGoing;
|
||||||
|
|
||||||
// Motif-specific
|
// Motif-specific
|
||||||
WXAppContext m_appContext;
|
WXAppContext m_appContext;
|
||||||
|
@@ -54,8 +54,8 @@ public:
|
|||||||
bool Create(const wxBitmap& bitmap, int paletteIndex);
|
bool Create(const wxBitmap& bitmap, int paletteIndex);
|
||||||
bool Create(const wxBitmap& bitmap);
|
bool Create(const wxBitmap& bitmap);
|
||||||
|
|
||||||
inline WXPixmap GetPixmap() const { return m_pixmap; }
|
WXPixmap GetPixmap() const { return m_pixmap; }
|
||||||
inline void SetPixmap(WXPixmap pixmap) { m_pixmap = pixmap; }
|
void SetPixmap(WXPixmap pixmap) { m_pixmap = pixmap; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WXPixmap m_pixmap;
|
WXPixmap m_pixmap;
|
||||||
@@ -110,12 +110,12 @@ public:
|
|||||||
int desiredWidth, int desiredHeight);
|
int desiredWidth, int desiredHeight);
|
||||||
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||||
|
|
||||||
inline void SetName(const wxString& name) { m_name = name; }
|
void SetName(const wxString& name) { m_name = name; }
|
||||||
inline void SetExtension(const wxString& ext) { m_extension = ext; }
|
void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||||
inline void SetType(long type) { m_type = type; }
|
void SetType(long type) { m_type = type; }
|
||||||
inline wxString GetName() const { return m_name; }
|
wxString GetName() const { return m_name; }
|
||||||
inline wxString GetExtension() const { return m_extension; }
|
wxString GetExtension() const { return m_extension; }
|
||||||
inline long GetType() const { return m_type; }
|
long GetType() const { return m_type; }
|
||||||
protected:
|
protected:
|
||||||
wxString m_name;
|
wxString m_name;
|
||||||
wxString m_extension;
|
wxString m_extension;
|
||||||
@@ -134,7 +134,7 @@ public:
|
|||||||
wxBitmap(); // Platform-specific
|
wxBitmap(); // Platform-specific
|
||||||
|
|
||||||
// Copy constructors
|
// Copy constructors
|
||||||
inline wxBitmap(const wxBitmap& bitmap)
|
wxBitmap(const wxBitmap& bitmap)
|
||||||
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
|
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
|
||||||
|
|
||||||
// Initialize with raw XBM data
|
// Initialize with raw XBM data
|
||||||
@@ -158,29 +158,29 @@ public:
|
|||||||
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
|
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
|
||||||
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
||||||
|
|
||||||
inline bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
|
bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
|
||||||
inline int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
|
int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
|
||||||
inline int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
|
int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
|
||||||
inline int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
|
int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
|
||||||
inline int GetQuality() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_quality : 0); }
|
int GetQuality() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_quality : 0); }
|
||||||
void SetWidth(int w);
|
void SetWidth(int w);
|
||||||
void SetHeight(int h);
|
void SetHeight(int h);
|
||||||
void SetDepth(int d);
|
void SetDepth(int d);
|
||||||
void SetQuality(int q);
|
void SetQuality(int q);
|
||||||
void SetOk(bool isOk);
|
void SetOk(bool isOk);
|
||||||
|
|
||||||
inline wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
|
wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
|
||||||
void SetPalette(const wxPalette& palette);
|
void SetPalette(const wxPalette& palette);
|
||||||
|
|
||||||
inline wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
|
wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
|
||||||
void SetMask(wxMask *mask) ;
|
void SetMask(wxMask *mask) ;
|
||||||
|
|
||||||
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
|
wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
|
||||||
inline bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; }
|
bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; }
|
||||||
inline bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; }
|
bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; }
|
||||||
|
|
||||||
// Format handling
|
// Format handling
|
||||||
static inline wxList& GetHandlers() { return sm_handlers; }
|
static wxList& GetHandlers() { return sm_handlers; }
|
||||||
static void AddHandler(wxBitmapHandler *handler);
|
static void AddHandler(wxBitmapHandler *handler);
|
||||||
static void InsertHandler(wxBitmapHandler *handler);
|
static void InsertHandler(wxBitmapHandler *handler);
|
||||||
static bool RemoveHandler(const wxString& name);
|
static bool RemoveHandler(const wxString& name);
|
||||||
@@ -193,8 +193,8 @@ public:
|
|||||||
|
|
||||||
// Motif implementation
|
// Motif implementation
|
||||||
public:
|
public:
|
||||||
inline WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; }
|
WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; }
|
||||||
inline WXDisplay* GetPixmap() const { return M_BITMAPDATA->m_pixmap; }
|
WXDisplay* GetPixmap() const { return M_BITMAPDATA->m_pixmap; }
|
||||||
virtual WXPixmap GetLabelPixmap(WXWidget w) ;
|
virtual WXPixmap GetLabelPixmap(WXWidget w) ;
|
||||||
virtual WXPixmap GetArmPixmap(WXWidget w) ;
|
virtual WXPixmap GetArmPixmap(WXWidget w) ;
|
||||||
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
|
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
|
||||||
|
@@ -54,7 +54,7 @@ public:
|
|||||||
wxCursor();
|
wxCursor();
|
||||||
|
|
||||||
// Copy constructors
|
// Copy constructors
|
||||||
inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
||||||
|
|
||||||
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
|
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
|
||||||
const char maskBits[] = NULL);
|
const char maskBits[] = NULL);
|
||||||
@@ -67,9 +67,9 @@ public:
|
|||||||
|
|
||||||
virtual bool Ok() const { return ((m_refData != NULL) && M_CURSORDATA->m_ok); }
|
virtual bool Ok() const { return ((m_refData != NULL) && M_CURSORDATA->m_ok); }
|
||||||
|
|
||||||
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
|
wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
|
||||||
inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
|
bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
|
||||||
inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }
|
bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }
|
||||||
|
|
||||||
// Motif-specific.
|
// Motif-specific.
|
||||||
// Create/get a cursor for the current display
|
// Create/get a cursor for the current display
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 17/09/98
|
// Created: 17/09/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_PALETTE_H_
|
#ifndef _WX_PALETTE_H_
|
||||||
@@ -55,7 +55,7 @@ class WXDLLEXPORT wxPalette: public wxGDIObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
wxPalette();
|
wxPalette();
|
||||||
inline wxPalette(const wxPalette& palette) { Ref(palette); }
|
wxPalette(const wxPalette& palette) { Ref(palette); }
|
||||||
|
|
||||||
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
~wxPalette();
|
~wxPalette();
|
||||||
@@ -65,9 +65,9 @@ public:
|
|||||||
|
|
||||||
virtual bool Ok() const { return (m_refData != NULL) ; }
|
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||||
|
|
||||||
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
|
wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
|
||||||
inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; }
|
bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; }
|
||||||
inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; }
|
bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; }
|
||||||
|
|
||||||
// Motif-specific
|
// Motif-specific
|
||||||
WXColormap GetXColormap(WXDisplay* display = NULL) const;
|
WXColormap GetXColormap(WXDisplay* display = NULL) const;
|
||||||
|
@@ -83,7 +83,6 @@ public:
|
|||||||
virtual bool ProcessMessage(WXMSG* pMsg);
|
virtual bool ProcessMessage(WXMSG* pMsg);
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
bool ProcessIdle();
|
bool ProcessIdle();
|
||||||
void ProcessPendingEvents();
|
|
||||||
int GetComCtl32Version() const;
|
int GetComCtl32Version() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -99,13 +99,13 @@ public:
|
|||||||
|
|
||||||
virtual void DestroyClippingRegion();
|
virtual void DestroyClippingRegion();
|
||||||
|
|
||||||
virtual long GetCharHeight() const;
|
virtual wxCoord GetCharHeight() const;
|
||||||
virtual long GetCharWidth() const;
|
virtual wxCoord GetCharWidth() const;
|
||||||
virtual void GetTextExtent(const wxString& string,
|
virtual void DoGetTextExtent(const wxString& string,
|
||||||
long *x, long *y,
|
wxCoord *x, wxCoord *y,
|
||||||
long *descent = NULL,
|
wxCoord *descent = NULL,
|
||||||
long *externalLeading = NULL,
|
wxCoord *externalLeading = NULL,
|
||||||
wxFont *theFont = NULL) const;
|
wxFont *theFont = NULL) const;
|
||||||
|
|
||||||
virtual bool CanDrawBitmap() const;
|
virtual bool CanDrawBitmap() const;
|
||||||
virtual bool CanGetTextExtent() const;
|
virtual bool CanGetTextExtent() const;
|
||||||
@@ -116,8 +116,8 @@ public:
|
|||||||
virtual void SetUserScale(double x, double y);
|
virtual void SetUserScale(double x, double y);
|
||||||
virtual void SetSystemScale(double x, double y);
|
virtual void SetSystemScale(double x, double y);
|
||||||
virtual void SetLogicalScale(double x, double y);
|
virtual void SetLogicalScale(double x, double y);
|
||||||
virtual void SetLogicalOrigin(long x, long y);
|
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
|
||||||
virtual void SetDeviceOrigin(long x, long y);
|
virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
|
||||||
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
|
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
|
||||||
virtual void SetLogicalFunction(int function);
|
virtual void SetLogicalFunction(int function);
|
||||||
|
|
||||||
@@ -139,45 +139,45 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoFloodFill(long x, long y, const wxColour& col,
|
virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||||
int style = wxFLOOD_SURFACE);
|
int style = wxFLOOD_SURFACE);
|
||||||
|
|
||||||
virtual bool DoGetPixel(long x, long y, wxColour *col) const;
|
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
|
||||||
|
|
||||||
virtual void DoDrawPoint(long x, long y);
|
virtual void DoDrawPoint(wxCoord x, wxCoord y);
|
||||||
virtual void DoDrawLine(long x1, long y1, long x2, long y2);
|
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
||||||
|
|
||||||
virtual void DoDrawArc(long x1, long y1,
|
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
|
||||||
long x2, long y2,
|
wxCoord x2, wxCoord y2,
|
||||||
long xc, long yc);
|
wxCoord xc, wxCoord yc);
|
||||||
virtual void DoDrawEllipticArc(long x, long y, long w, long h,
|
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||||
double sa, double ea);
|
double sa, double ea);
|
||||||
|
|
||||||
virtual void DoDrawRectangle(long x, long y, long width, long height);
|
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
virtual void DoDrawRoundedRectangle(long x, long y,
|
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||||
long width, long height,
|
wxCoord width, wxCoord height,
|
||||||
double radius);
|
double radius);
|
||||||
virtual void DoDrawEllipse(long x, long y, long width, long height);
|
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
|
||||||
virtual void DoCrossHair(long x, long y);
|
virtual void DoCrossHair(wxCoord x, wxCoord y);
|
||||||
|
|
||||||
virtual void DoDrawIcon(const wxIcon& icon, long x, long y);
|
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
|
||||||
virtual void DoDrawBitmap(const wxBitmap &bmp, long x, long y,
|
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||||
bool useMask = FALSE);
|
bool useMask = FALSE);
|
||||||
|
|
||||||
virtual void DoDrawText(const wxString& text, long x, long y);
|
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
|
||||||
|
|
||||||
virtual bool DoBlit(long xdest, long ydest, long width, long height,
|
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int rop = wxCOPY, bool useMask = FALSE);
|
int rop = wxCOPY, bool useMask = FALSE);
|
||||||
|
|
||||||
// this is gnarly - we can't even call this function DoSetClippingRegion()
|
// this is gnarly - we can't even call this function DoSetClippingRegion()
|
||||||
// because of virtual function hiding
|
// because of virtual function hiding
|
||||||
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
|
virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
|
||||||
virtual void DoSetClippingRegion(long x, long y,
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
|
||||||
long width, long height);
|
wxCoord width, wxCoord height);
|
||||||
virtual void DoGetClippingRegion(long *x, long *y,
|
virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
|
||||||
long *width, long *height)
|
wxCoord *width, wxCoord *height)
|
||||||
{
|
{
|
||||||
GetClippingBox(x, y, width, height);
|
GetClippingBox(x, y, width, height);
|
||||||
}
|
}
|
||||||
@@ -186,9 +186,9 @@ protected:
|
|||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||||
long xoffset, long yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
int fillStyle = wxODDEVEN_RULE);
|
int fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
#if wxUSE_SPLINES
|
#if wxUSE_SPLINES
|
||||||
|
@@ -18,17 +18,20 @@
|
|||||||
|
|
||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
|
|
||||||
class WXDLLEXPORT wxMemoryDC: public wxDC
|
class WXDLLEXPORT wxMemoryDC : public wxDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
public:
|
||||||
|
wxMemoryDC();
|
||||||
|
wxMemoryDC(wxDC *dc); // Create compatible DC
|
||||||
|
|
||||||
public:
|
~wxMemoryDC();
|
||||||
wxMemoryDC(void);
|
|
||||||
wxMemoryDC(wxDC *dc); // Create compatible DC
|
|
||||||
|
|
||||||
~wxMemoryDC(void);
|
virtual void SelectObject(const wxBitmap& bitmap);
|
||||||
virtual void SelectObject(const wxBitmap& bitmap);
|
|
||||||
virtual void DoGetSize(int* width, int* height) const;
|
virtual void DoGetSize(int* width, int* height) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* The main configuration file for wxWindows.
|
||||||
|
*
|
||||||
|
* NB: this file can be included in .c files, so it must be compileable by a C
|
||||||
|
* compiler - use #ifdef __cplusplus for C++ specific features and avoid
|
||||||
|
* using C++ style comments
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _WX_SETUP_H_BASE_
|
#ifndef _WX_SETUP_H_BASE_
|
||||||
#define _WX_SETUP_H_BASE_
|
#define _WX_SETUP_H_BASE_
|
||||||
@@ -5,7 +12,7 @@
|
|||||||
/* compatibility code, to be removed asap: */
|
/* compatibility code, to be removed asap: */
|
||||||
|
|
||||||
#if !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__) && !defined(__WXSTUBS__) && !defined(__WXMAC__) && !defined(__WXPM__)
|
#if !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__) && !defined(__WXSTUBS__) && !defined(__WXMAC__) && !defined(__WXPM__)
|
||||||
# error No __WXxxx__ define set! Please define one of __WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXPM__,__WXSTUBS__
|
#error No __WXxxx__ define set! Please define one of __WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXPM__,__WXSTUBS__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
@@ -24,5 +31,45 @@
|
|||||||
#include "wx/gtk/setup.h"
|
#include "wx/gtk/setup.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compatibility defines: note that, in general, there is a a reason for not
|
||||||
|
* compatible changes, so you should try to avoid defining WXWIN_COMPATIBILITY
|
||||||
|
* and do so only if your program really can't be compiled otherwise.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compatibility with 1.66 API.
|
||||||
|
* Level 0: no backward compatibility, all new features
|
||||||
|
* Level 1: wxDC, OnSize (etc.) compatibility, but
|
||||||
|
* some new features such as event tables
|
||||||
|
*/
|
||||||
|
#define WXWIN_COMPATIBILITY 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxWindows 2.0 API compatibility. Possible values are:
|
||||||
|
* 0: no backwards compatibility
|
||||||
|
* 1: some backwards compatibility, but if it conflicts with the new
|
||||||
|
* features, use the new code, not the old one
|
||||||
|
* 2: maximum backwards compatiblity: even if compatibility can only be
|
||||||
|
* achieved by disabling new features, do it.
|
||||||
|
*/
|
||||||
|
#define WXWIN_COMPATIBILITY_2 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxWindows 2.0 uses long for wxPoint/wxRect/wxSize member fields and wxDC
|
||||||
|
* method arguments, wxWindows 2.1 and later uses wxCoord typedef which is
|
||||||
|
* usually int. Using long leads to (justified) warnings about long to int
|
||||||
|
* conversions from some compilers and is, generally speaking, unneeded.
|
||||||
|
*/
|
||||||
|
#define wxUSE_COMPATIBLE_COORD_TYPES 0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Maximum compatibility with 2.0 API
|
||||||
|
*/
|
||||||
|
#if WXWIN_COMPATIBILITY_2 == 2
|
||||||
|
#undef wxUSE_COMPATIBLE_COORD_TYPES
|
||||||
|
#define wxUSE_COMPATIBLE_COORD_TYPES 1
|
||||||
|
#endif /* WXWIN_COMPATIBILITY_2_MAX */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* _WX_SETUP_H_BASE_ */
|
/* _WX_SETUP_H_BASE_ */
|
||||||
|
@@ -350,6 +350,12 @@ private:
|
|||||||
void WXDLLEXPORT wxMutexGuiEnter();
|
void WXDLLEXPORT wxMutexGuiEnter();
|
||||||
void WXDLLEXPORT wxMutexGuiLeave();
|
void WXDLLEXPORT wxMutexGuiLeave();
|
||||||
|
|
||||||
|
// macros for entering/leaving critical sections which may be used without
|
||||||
|
// having to take them inside "#if wxUSE_THREADS"
|
||||||
|
#define wxENTER_CRIT_SECT(cs) (cs)->Enter()
|
||||||
|
#define wxLEAVE_CRIT_SECT(cs) (cs)->Leave()
|
||||||
|
#define wxCRIT_SECT_LOCKER(name, cs) wxCriticalSectionLocker name(*cs)
|
||||||
|
|
||||||
#else // !wxUSE_THREADS
|
#else // !wxUSE_THREADS
|
||||||
|
|
||||||
#include "wx/defs.h" // for WXDLLEXPORT
|
#include "wx/defs.h" // for WXDLLEXPORT
|
||||||
@@ -358,6 +364,12 @@ void WXDLLEXPORT wxMutexGuiLeave();
|
|||||||
inline void WXDLLEXPORT wxMutexGuiEnter() { }
|
inline void WXDLLEXPORT wxMutexGuiEnter() { }
|
||||||
inline void WXDLLEXPORT wxMutexGuiLeave() { }
|
inline void WXDLLEXPORT wxMutexGuiLeave() { }
|
||||||
|
|
||||||
|
// macros for entering/leaving critical sections which may be used without
|
||||||
|
// having to take them inside "#if wxUSE_THREADS"
|
||||||
|
#define wxENTER_CRIT_SECT(cs)
|
||||||
|
#define wxLEAVE_CRIT_SECT(cs)
|
||||||
|
#define wxCRIT_SECT_LOCKER(name, cs)
|
||||||
|
|
||||||
#endif // wxUSE_THREADS
|
#endif // wxUSE_THREADS
|
||||||
|
|
||||||
// automatically unlock GUI mutex in dtor
|
// automatically unlock GUI mutex in dtor
|
||||||
|
65
src/common/appcmn.cpp
Normal file
65
src/common/appcmn.cpp
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: common/appcmn.cpp
|
||||||
|
// Purpose: wxAppBase methods common to all platforms
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 18.10.99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Vadim Zeitlin
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "appbase.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#if defined(__BORLANDC__)
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/app.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/thread.h"
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
// implementation
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// wxAppBase
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxAppBase::ProcessPendingEvents()
|
||||||
|
{
|
||||||
|
// ensure that we're the only thread to modify the pending events list
|
||||||
|
wxCRIT_SECT_LOCKER(locker, wxPendingEventsLocker);
|
||||||
|
|
||||||
|
if ( !wxPendingEvents )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// iterate until the list becomes empty
|
||||||
|
wxNode *node = wxPendingEvents->First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
|
||||||
|
|
||||||
|
handler->ProcessPendingEvents();
|
||||||
|
|
||||||
|
delete node;
|
||||||
|
node = wxPendingEvents->First();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
|
|
||||||
void wxDCBase::DrawLines(const wxList *list, long xoffset, long yoffset)
|
void wxDCBase::DrawLines(const wxList *list, wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
int n = list->Number();
|
int n = list->Number();
|
||||||
wxPoint *points = new wxPoint[n];
|
wxPoint *points = new wxPoint[n];
|
||||||
@@ -50,7 +50,7 @@ void wxDCBase::DrawLines(const wxList *list, long xoffset, long yoffset)
|
|||||||
|
|
||||||
|
|
||||||
void wxDCBase::DrawPolygon(const wxList *list,
|
void wxDCBase::DrawPolygon(const wxList *list,
|
||||||
long xoffset, long yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
int fillStyle)
|
int fillStyle)
|
||||||
{
|
{
|
||||||
int n = list->Number();
|
int n = list->Number();
|
||||||
@@ -73,7 +73,7 @@ void wxDCBase::DrawPolygon(const wxList *list,
|
|||||||
#if wxUSE_SPLINES
|
#if wxUSE_SPLINES
|
||||||
|
|
||||||
// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?)
|
// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?)
|
||||||
void wxDCBase::DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3)
|
void wxDCBase::DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord x3, wxCoord y3)
|
||||||
{
|
{
|
||||||
wxList point_list;
|
wxList point_list;
|
||||||
|
|
||||||
|
@@ -321,7 +321,7 @@ bool wxMouseEvent::Button(int but) const
|
|||||||
{
|
{
|
||||||
switch (but) {
|
switch (but) {
|
||||||
case -1:
|
case -1:
|
||||||
return (ButtonUp(-1) || ButtonDown(-1) || ButtonDClick(-1)) ;
|
return (ButtonUp(-1) || ButtonDown(-1) || ButtonDClick(-1));
|
||||||
case 1:
|
case 1:
|
||||||
return (LeftDown() || LeftUp() || LeftDClick());
|
return (LeftDown() || LeftUp() || LeftDClick());
|
||||||
case 2:
|
case 2:
|
||||||
@@ -601,11 +601,13 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
|
|||||||
|
|
||||||
m_pendingEvents->Append(event2);
|
m_pendingEvents->Append(event2);
|
||||||
|
|
||||||
wxPendingEventsLocker->Enter();
|
wxENTER_CRIT_SECT(wxPendingEventsLocker);
|
||||||
|
|
||||||
if ( !wxPendingEvents )
|
if ( !wxPendingEvents )
|
||||||
wxPendingEvents = new wxList;
|
wxPendingEvents = new wxList;
|
||||||
wxPendingEvents->Append(this);
|
wxPendingEvents->Append(this);
|
||||||
wxPendingEventsLocker->Leave();
|
|
||||||
|
wxLEAVE_CRIT_SECT(wxPendingEventsLocker);
|
||||||
|
|
||||||
// TODO: Wake up idle handler for the other platforms.
|
// TODO: Wake up idle handler for the other platforms.
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
@@ -623,9 +625,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
|
|||||||
|
|
||||||
void wxEvtHandler::ProcessPendingEvents()
|
void wxEvtHandler::ProcessPendingEvents()
|
||||||
{
|
{
|
||||||
#if wxUSE_THREADS
|
wxCRIT_SECT_LOCKER(locker, m_eventsLocker);
|
||||||
wxCriticalSectionLocker locker(*m_eventsLocker);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxNode *node = m_pendingEvents->First();
|
wxNode *node = m_pendingEvents->First();
|
||||||
wxEvent *event;
|
wxEvent *event;
|
||||||
|
@@ -94,7 +94,11 @@ wxObject *wxObject::Clone() const
|
|||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
void wxObject::CopyObject(wxObject& object_dest) const
|
void wxObject::CopyObject(wxObject& object_dest) const
|
||||||
|
#else // !Debug
|
||||||
|
void wxObject::CopyObject(wxObject& WXUNUSED(object_dest)) const
|
||||||
|
#endif // Debug/!Debug
|
||||||
{
|
{
|
||||||
wxASSERT(object_dest.GetClassInfo()->IsKindOf(GetClassInfo()));
|
wxASSERT(object_dest.GetClassInfo()->IsKindOf(GetClassInfo()));
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "appbase.h"
|
|
||||||
#pragma implementation "app.h"
|
#pragma implementation "app.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -515,28 +514,6 @@ void wxApp::Dispatch()
|
|||||||
gtk_main_iteration();
|
gtk_main_iteration();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxApp::ProcessPendingEvents()
|
|
||||||
{
|
|
||||||
#if wxUSE_THREADS
|
|
||||||
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
|
|
||||||
#endif // wxUSE_THREADS
|
|
||||||
|
|
||||||
if ( !wxPendingEvents )
|
|
||||||
return;
|
|
||||||
|
|
||||||
wxNode *node = wxPendingEvents->First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
|
|
||||||
|
|
||||||
handler->ProcessPendingEvents();
|
|
||||||
|
|
||||||
delete node;
|
|
||||||
|
|
||||||
node = wxPendingEvents->First();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxApp::DeletePendingObjects()
|
void wxApp::DeletePendingObjects()
|
||||||
{
|
{
|
||||||
wxNode *node = wxPendingDelete.First();
|
wxNode *node = wxPendingDelete.First();
|
||||||
|
@@ -51,7 +51,7 @@ wxDC::wxDC()
|
|||||||
m_brush = *wxWHITE_BRUSH;
|
m_brush = *wxWHITE_BRUSH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoSetClippingRegion( long x, long y, long width, long height )
|
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
m_clipping = TRUE;
|
m_clipping = TRUE;
|
||||||
m_clipX1 = x;
|
m_clipX1 = x;
|
||||||
@@ -149,14 +149,14 @@ void wxDC::SetLogicalScale( double x, double y )
|
|||||||
ComputeScaleAndOrigin();
|
ComputeScaleAndOrigin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetLogicalOrigin( long x, long y )
|
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
m_logicalOriginX = x * m_signX; // is this still correct ?
|
m_logicalOriginX = x * m_signX; // is this still correct ?
|
||||||
m_logicalOriginY = y * m_signY;
|
m_logicalOriginY = y * m_signY;
|
||||||
ComputeScaleAndOrigin();
|
ComputeScaleAndOrigin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetDeviceOrigin( long x, long y )
|
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
// only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
|
// only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
|
||||||
m_deviceOriginX = x;
|
m_deviceOriginX = x;
|
||||||
@@ -176,42 +176,42 @@ void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
|||||||
// coordinates transformations
|
// coordinates transformations
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalX(long x) const
|
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XDEV2LOG(x);
|
return ((wxDC *)this)->XDEV2LOG(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalY(long y) const
|
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YDEV2LOG(y);
|
return ((wxDC *)this)->YDEV2LOG(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalXRel(long x) const
|
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XDEV2LOGREL(x);
|
return ((wxDC *)this)->XDEV2LOGREL(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalYRel(long y) const
|
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YDEV2LOGREL(y);
|
return ((wxDC *)this)->YDEV2LOGREL(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceX(long x) const
|
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XLOG2DEV(x);
|
return ((wxDC *)this)->XLOG2DEV(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceY(long y) const
|
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YLOG2DEV(y);
|
return ((wxDC *)this)->YLOG2DEV(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceXRel(long x) const
|
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XLOG2DEVREL(x);
|
return ((wxDC *)this)->XLOG2DEVREL(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceYRel(long y) const
|
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YLOG2DEVREL(y);
|
return ((wxDC *)this)->YLOG2DEVREL(y);
|
||||||
}
|
}
|
||||||
|
@@ -153,19 +153,19 @@ wxWindowDC::~wxWindowDC()
|
|||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y),
|
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||||
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
|
wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
|
bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
|
wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
|
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoCrossHair( long x, long y )
|
void wxWindowDC::DoCrossHair( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -188,8 +188,8 @@ void wxWindowDC::DoCrossHair( long x, long y )
|
|||||||
int w = 0;
|
int w = 0;
|
||||||
int h = 0;
|
int h = 0;
|
||||||
GetSize( &w, &h );
|
GetSize( &w, &h );
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
if (m_window)
|
if (m_window)
|
||||||
{
|
{
|
||||||
gdk_draw_line( m_window, m_penGC, 0, yy, XLOG2DEVREL(w), yy );
|
gdk_draw_line( m_window, m_penGC, 0, yy, XLOG2DEVREL(w), yy );
|
||||||
@@ -198,21 +198,21 @@ void wxWindowDC::DoCrossHair( long x, long y )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
|
void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
||||||
long xc, long yc )
|
wxCoord xc, wxCoord yc )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx1 = XLOG2DEV(x1);
|
wxCoord xx1 = XLOG2DEV(x1);
|
||||||
long yy1 = YLOG2DEV(y1);
|
wxCoord yy1 = YLOG2DEV(y1);
|
||||||
long xx2 = XLOG2DEV(x2);
|
wxCoord xx2 = XLOG2DEV(x2);
|
||||||
long yy2 = YLOG2DEV(y2);
|
wxCoord yy2 = YLOG2DEV(y2);
|
||||||
long xxc = XLOG2DEV(xc);
|
wxCoord xxc = XLOG2DEV(xc);
|
||||||
long yyc = YLOG2DEV(yc);
|
wxCoord yyc = YLOG2DEV(yc);
|
||||||
double dx = xx1 - xxc;
|
double dx = xx1 - xxc;
|
||||||
double dy = yy1 - yyc;
|
double dy = yy1 - yyc;
|
||||||
double radius = sqrt((double)(dx*dx+dy*dy));
|
double radius = sqrt((double)(dx*dx+dy*dy));
|
||||||
long r = (long)radius;
|
wxCoord r = (wxCoord)radius;
|
||||||
double radius1, radius2;
|
double radius1, radius2;
|
||||||
|
|
||||||
if (xx1 == xx2 && yy1 == yy2)
|
if (xx1 == xx2 && yy1 == yy2)
|
||||||
@@ -234,8 +234,8 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
|
|||||||
(yy2 - yyc < 0) ? 90.0 : -90.0 :
|
(yy2 - yyc < 0) ? 90.0 : -90.0 :
|
||||||
-atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG;
|
-atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG;
|
||||||
}
|
}
|
||||||
long alpha1 = long(radius1 * 64.0);
|
wxCoord alpha1 = wxCoord(radius1 * 64.0);
|
||||||
long alpha2 = long((radius2 - radius1) * 64.0);
|
wxCoord alpha2 = wxCoord((radius2 - radius1) * 64.0);
|
||||||
while (alpha2 <= 0) alpha2 += 360*64;
|
while (alpha2 <= 0) alpha2 += 360*64;
|
||||||
while (alpha1 > 360*64) alpha1 -= 360*64;
|
while (alpha1 > 360*64) alpha1 -= 360*64;
|
||||||
|
|
||||||
@@ -252,14 +252,14 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
|
|||||||
CalcBoundingBox (x2, y2);
|
CalcBoundingBox (x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
|
void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double sa, double ea )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
|
|
||||||
// CMB: handle -ve width and/or height
|
// CMB: handle -ve width and/or height
|
||||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||||
@@ -267,8 +267,8 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
|
|||||||
|
|
||||||
if (m_window)
|
if (m_window)
|
||||||
{
|
{
|
||||||
long start = long(sa * 64.0);
|
wxCoord start = wxCoord(sa * 64.0);
|
||||||
long end = long(ea * 64.0);
|
wxCoord end = wxCoord(ea * 64.0);
|
||||||
|
|
||||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
|
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
|
||||||
@@ -281,7 +281,7 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
|
|||||||
CalcBoundingBox (x + width, y + height);
|
CalcBoundingBox (x + width, y + height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawPoint( long x, long y )
|
void wxWindowDC::DoDrawPoint( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ void wxWindowDC::DoDrawPoint( long x, long y )
|
|||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset )
|
void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -302,10 +302,10 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
|
|||||||
|
|
||||||
for (int i = 0; i < n-1; i++)
|
for (int i = 0; i < n-1; i++)
|
||||||
{
|
{
|
||||||
long x1 = XLOG2DEV(points[i].x + xoffset);
|
wxCoord x1 = XLOG2DEV(points[i].x + xoffset);
|
||||||
long x2 = XLOG2DEV(points[i+1].x + xoffset);
|
wxCoord x2 = XLOG2DEV(points[i+1].x + xoffset);
|
||||||
long y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
|
wxCoord y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
|
||||||
long y2 = YLOG2DEV(points[i+1].y + yoffset);
|
wxCoord y2 = YLOG2DEV(points[i+1].y + yoffset);
|
||||||
|
|
||||||
if (m_window)
|
if (m_window)
|
||||||
gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
|
gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
|
||||||
@@ -314,7 +314,7 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
|
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -350,14 +350,14 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoff
|
|||||||
delete[] gdkpoints;
|
delete[] gdkpoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
|
void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
|
|
||||||
// CMB: draw nothing if transformed w or h is 0
|
// CMB: draw nothing if transformed w or h is 0
|
||||||
if (ww == 0 || hh == 0) return;
|
if (ww == 0 || hh == 0) return;
|
||||||
@@ -379,17 +379,17 @@ void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
|
|||||||
CalcBoundingBox( x + width, y + height );
|
CalcBoundingBox( x + width, y + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius )
|
void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
|
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
long rr = XLOG2DEVREL((long)radius);
|
wxCoord rr = XLOG2DEVREL((wxCoord)radius);
|
||||||
|
|
||||||
// CMB: handle -ve width and/or height
|
// CMB: handle -ve width and/or height
|
||||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||||
@@ -418,7 +418,7 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
|
|||||||
{
|
{
|
||||||
// CMB: ensure dd is not larger than rectangle otherwise we
|
// CMB: ensure dd is not larger than rectangle otherwise we
|
||||||
// get an hour glass shape
|
// get an hour glass shape
|
||||||
long dd = 2 * rr;
|
wxCoord dd = 2 * rr;
|
||||||
if (dd > ww) dd = ww;
|
if (dd > ww) dd = ww;
|
||||||
if (dd > hh) dd = hh;
|
if (dd > hh) dd = hh;
|
||||||
rr = dd / 2;
|
rr = dd / 2;
|
||||||
@@ -451,14 +451,14 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
|
|||||||
CalcBoundingBox( x + width, y + height );
|
CalcBoundingBox( x + width, y + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
|
void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
|
|
||||||
// CMB: handle -ve width and/or height
|
// CMB: handle -ve width and/or height
|
||||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||||
@@ -477,14 +477,14 @@ void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
|
|||||||
CalcBoundingBox( x + width, y + height );
|
CalcBoundingBox( x + width, y + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawIcon( const wxIcon &icon, long x, long y )
|
void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
||||||
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
|
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
||||||
long x, long y,
|
wxCoord x, wxCoord y,
|
||||||
bool useMask )
|
bool useMask )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
@@ -559,8 +559,8 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int logical_func, bool useMask )
|
int logical_func, bool useMask )
|
||||||
{
|
{
|
||||||
/* this is the nth try to get this utterly useless function to
|
/* this is the nth try to get this utterly useless function to
|
||||||
@@ -629,11 +629,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
{
|
{
|
||||||
/* scale/translate bitmap size */
|
/* scale/translate bitmap size */
|
||||||
|
|
||||||
long bm_width = memDC->m_selected.GetWidth();
|
wxCoord bm_width = memDC->m_selected.GetWidth();
|
||||||
long bm_height = memDC->m_selected.GetHeight();
|
wxCoord bm_height = memDC->m_selected.GetHeight();
|
||||||
|
|
||||||
long bm_ww = XLOG2DEVREL( bm_width );
|
wxCoord bm_ww = XLOG2DEVREL( bm_width );
|
||||||
long bm_hh = YLOG2DEVREL( bm_height );
|
wxCoord bm_hh = YLOG2DEVREL( bm_height );
|
||||||
|
|
||||||
/* scale bitmap if required */
|
/* scale bitmap if required */
|
||||||
|
|
||||||
@@ -653,11 +653,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
|
|
||||||
/* scale/translate size and position */
|
/* scale/translate size and position */
|
||||||
|
|
||||||
long xx = XLOG2DEV(xdest);
|
wxCoord xx = XLOG2DEV(xdest);
|
||||||
long yy = YLOG2DEV(ydest);
|
wxCoord yy = YLOG2DEV(ydest);
|
||||||
|
|
||||||
long ww = XLOG2DEVREL(width);
|
wxCoord ww = XLOG2DEVREL(width);
|
||||||
long hh = YLOG2DEVREL(height);
|
wxCoord hh = YLOG2DEVREL(height);
|
||||||
|
|
||||||
/* apply mask if any */
|
/* apply mask if any */
|
||||||
|
|
||||||
@@ -700,11 +700,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
{
|
{
|
||||||
/* scale/translate size and position */
|
/* scale/translate size and position */
|
||||||
|
|
||||||
long xx = XLOG2DEV(xdest);
|
wxCoord xx = XLOG2DEV(xdest);
|
||||||
long yy = YLOG2DEV(ydest);
|
wxCoord yy = YLOG2DEV(ydest);
|
||||||
|
|
||||||
long ww = XLOG2DEVREL(width);
|
wxCoord ww = XLOG2DEVREL(width);
|
||||||
long hh = YLOG2DEVREL(height);
|
wxCoord hh = YLOG2DEVREL(height);
|
||||||
|
|
||||||
if ((width != ww) || (height != hh))
|
if ((width != ww) || (height != hh))
|
||||||
{
|
{
|
||||||
@@ -754,7 +754,7 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
|
void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -770,8 +770,8 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
|
|||||||
/* CMB 21/5/98: draw text background if mode is wxSOLID */
|
/* CMB 21/5/98: draw text background if mode is wxSOLID */
|
||||||
if (m_backgroundMode == wxSOLID)
|
if (m_backgroundMode == wxSOLID)
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long height = font->ascent + font->descent;
|
wxCoord height = font->ascent + font->descent;
|
||||||
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
|
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
|
||||||
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
|
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
|
||||||
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
|
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
|
||||||
@@ -783,42 +783,43 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
|
|||||||
properties (see wxXt implementation) */
|
properties (see wxXt implementation) */
|
||||||
if (m_font.GetUnderlined())
|
if (m_font.GetUnderlined())
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long ul_y = y + font->ascent;
|
wxCoord ul_y = y + font->ascent;
|
||||||
if (font->descent > 0) ul_y++;
|
if (font->descent > 0) ul_y++;
|
||||||
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
GetTextExtent (text, &w, &h);
|
GetTextExtent (text, &w, &h);
|
||||||
CalcBoundingBox (x + w, y + h);
|
CalcBoundingBox (x + w, y + h);
|
||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
|
void wxWindowDC::DoGetTextExtent(const wxString &string,
|
||||||
long *descent, long *externalLeading,
|
wxCoord *width, wxCoord *height,
|
||||||
wxFont *theFont ) const
|
wxCoord *descent, wxCoord *externalLeading,
|
||||||
|
wxFont *theFont) const
|
||||||
{
|
{
|
||||||
wxFont fontToUse = m_font;
|
wxFont fontToUse = m_font;
|
||||||
if (theFont) fontToUse = *theFont;
|
if (theFont) fontToUse = *theFont;
|
||||||
|
|
||||||
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
|
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
|
||||||
if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
|
if (width) (*width) = wxCoord(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
|
||||||
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
|
if (height) (*height) = wxCoord((font->ascent + font->descent) / m_scaleY);
|
||||||
if (descent) (*descent) = long(font->descent / m_scaleY);
|
if (descent) (*descent) = wxCoord(font->descent / m_scaleY);
|
||||||
if (externalLeading) (*externalLeading) = 0; // ??
|
if (externalLeading) (*externalLeading) = 0; // ??
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxWindowDC::GetCharWidth() const
|
wxCoord wxWindowDC::GetCharWidth() const
|
||||||
{
|
{
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return long(gdk_string_width( font, "H" ) / m_scaleX);
|
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxWindowDC::GetCharHeight() const
|
wxCoord wxWindowDC::GetCharHeight() const
|
||||||
{
|
{
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return long((font->ascent + font->descent) / m_scaleY);
|
return wxCoord((font->ascent + font->descent) / m_scaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::Clear()
|
void wxWindowDC::Clear()
|
||||||
@@ -886,7 +887,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
|||||||
|
|
||||||
static const char dotted[] = {1, 1};
|
static const char dotted[] = {1, 1};
|
||||||
static const char short_dashed[] = {2, 2};
|
static const char short_dashed[] = {2, 2};
|
||||||
static const char long_dashed[] = {2, 4};
|
static const char wxCoord_dashed[] = {2, 4};
|
||||||
static const char dotted_dashed[] = {3, 3, 1, 3};
|
static const char dotted_dashed[] = {3, 3, 1, 3};
|
||||||
|
|
||||||
// We express dash pattern in pen width unit, so we are
|
// We express dash pattern in pen width unit, so we are
|
||||||
@@ -915,7 +916,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
|||||||
{
|
{
|
||||||
lineStyle = GDK_LINE_ON_OFF_DASH;
|
lineStyle = GDK_LINE_ON_OFF_DASH;
|
||||||
req_nb_dash = 2;
|
req_nb_dash = 2;
|
||||||
req_dash = long_dashed;
|
req_dash = wxCoord_dashed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxSHORT_DASH:
|
case wxSHORT_DASH:
|
||||||
@@ -1168,7 +1169,7 @@ void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
|
|||||||
wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
|
wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
|
void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -25,15 +25,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
|
|||||||
wxMemoryDC::wxMemoryDC() : wxWindowDC()
|
wxMemoryDC::wxMemoryDC() : wxWindowDC()
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
|
|
||||||
m_cmap = gtk_widget_get_default_colormap();
|
m_cmap = gtk_widget_get_default_colormap();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
||||||
: wxWindowDC()
|
: wxWindowDC()
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
|
|
||||||
m_cmap = gtk_widget_get_default_colormap();
|
m_cmap = gtk_widget_get_default_colormap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,13 +54,13 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
|
|||||||
{
|
{
|
||||||
m_window = m_selected.GetBitmap();
|
m_window = m_selected.GetBitmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetUpDC();
|
SetUpDC();
|
||||||
|
|
||||||
m_isMemDC = TRUE;
|
m_isMemDC = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
m_window = (GdkWindow *) NULL;
|
m_window = (GdkWindow *) NULL;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -22,10 +22,9 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
|
GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
|
||||||
int wxScreenDC::sm_overlayWindowX = 0;
|
int wxScreenDC::sm_overlayWindowX = 0;
|
||||||
int wxScreenDC::sm_overlayWindowY = 0;
|
int wxScreenDC::sm_overlayWindowY = 0;
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// create X window
|
// create X window
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -57,14 +56,14 @@ int my_event_masks_table[19] =
|
|||||||
StructureNotifyMask,
|
StructureNotifyMask,
|
||||||
PropertyChangeMask,
|
PropertyChangeMask,
|
||||||
VisibilityChangeMask,
|
VisibilityChangeMask,
|
||||||
0, /* PROXIMITY_IN */
|
0, /* PROXIMITY_IN */
|
||||||
0 /* PROXIMTY_OUT */
|
0 /* PROXIMTY_OUT */
|
||||||
};
|
};
|
||||||
|
|
||||||
GdkWindow*
|
GdkWindow*
|
||||||
gdk_window_transparent_new ( GdkWindow *parent,
|
gdk_window_transparent_new ( GdkWindow *parent,
|
||||||
GdkWindowAttr *attributes,
|
GdkWindowAttr *attributes,
|
||||||
gint attributes_mask)
|
gint attributes_mask)
|
||||||
{
|
{
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
GdkWindowPrivate *gprivate;
|
GdkWindowPrivate *gprivate;
|
||||||
@@ -125,7 +124,7 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
|
gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
|
||||||
gprivate->window_type = attributes->window_type;
|
gprivate->window_type = attributes->window_type;
|
||||||
gprivate->extension_events = FALSE;
|
gprivate->extension_events = FALSE;
|
||||||
|
|
||||||
#if (GTK_MINOR_VERSION == 0)
|
#if (GTK_MINOR_VERSION == 0)
|
||||||
gprivate->dnd_drag_data_type = None;
|
gprivate->dnd_drag_data_type = None;
|
||||||
gprivate->dnd_drag_data_typesavail =
|
gprivate->dnd_drag_data_typesavail =
|
||||||
@@ -152,16 +151,16 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
for (i = 0; i < my_nevent_masks; i++)
|
for (i = 0; i < my_nevent_masks; i++)
|
||||||
{
|
{
|
||||||
if (attributes->event_mask & (1 << (i + 1)))
|
if (attributes->event_mask & (1 << (i + 1)))
|
||||||
xattributes.event_mask |= my_event_masks_table[i];
|
xattributes.event_mask |= my_event_masks_table[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xattributes.event_mask)
|
if (xattributes.event_mask)
|
||||||
xattributes_mask |= CWEventMask;
|
xattributes_mask |= CWEventMask;
|
||||||
|
|
||||||
if(attributes_mask & GDK_WA_NOREDIR) {
|
if(attributes_mask & GDK_WA_NOREDIR) {
|
||||||
xattributes.override_redirect =
|
xattributes.override_redirect =
|
||||||
(attributes->override_redirect == FALSE)?False:True;
|
(attributes->override_redirect == FALSE)?False:True;
|
||||||
xattributes_mask |= CWOverrideRedirect;
|
xattributes_mask |= CWOverrideRedirect;
|
||||||
} else
|
} else
|
||||||
xattributes.override_redirect = False;
|
xattributes.override_redirect = False;
|
||||||
|
|
||||||
@@ -169,24 +168,24 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
depth = visual->depth;
|
depth = visual->depth;
|
||||||
|
|
||||||
if (attributes_mask & GDK_WA_COLORMAP)
|
if (attributes_mask & GDK_WA_COLORMAP)
|
||||||
gprivate->colormap = attributes->colormap;
|
gprivate->colormap = attributes->colormap;
|
||||||
else
|
else
|
||||||
gprivate->colormap = gdk_colormap_get_system ();
|
gprivate->colormap = gdk_colormap_get_system ();
|
||||||
|
|
||||||
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
|
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
|
||||||
xattributes_mask |= CWColormap;
|
xattributes_mask |= CWColormap;
|
||||||
|
|
||||||
xparent = gdk_root_window;
|
xparent = gdk_root_window;
|
||||||
|
|
||||||
xattributes.save_under = True;
|
xattributes.save_under = True;
|
||||||
xattributes.override_redirect = True;
|
xattributes.override_redirect = True;
|
||||||
xattributes.cursor = None;
|
xattributes.cursor = None;
|
||||||
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
|
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
|
||||||
|
|
||||||
gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
|
gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
|
||||||
x, y, gprivate->width, gprivate->height,
|
x, y, gprivate->width, gprivate->height,
|
||||||
0, depth, gclass, xvisual,
|
0, depth, gclass, xvisual,
|
||||||
xattributes_mask, &xattributes);
|
xattributes_mask, &xattributes);
|
||||||
gdk_window_ref (window);
|
gdk_window_ref (window);
|
||||||
gdk_xid_table_insert (&gprivate->xwindow, window);
|
gdk_xid_table_insert (&gprivate->xwindow, window);
|
||||||
|
|
||||||
@@ -246,12 +245,12 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
|
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
|
||||||
|
|
||||||
wxScreenDC::wxScreenDC(void)
|
wxScreenDC::wxScreenDC()
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
m_window = (GdkWindow *) NULL;
|
m_window = (GdkWindow *) NULL;
|
||||||
m_cmap = gdk_colormap_get_system();
|
m_cmap = gdk_colormap_get_system();
|
||||||
|
|
||||||
if (sm_overlayWindow)
|
if (sm_overlayWindow)
|
||||||
{
|
{
|
||||||
m_window = sm_overlayWindow;
|
m_window = sm_overlayWindow;
|
||||||
@@ -262,16 +261,16 @@ wxScreenDC::wxScreenDC(void)
|
|||||||
{
|
{
|
||||||
m_window = GDK_ROOT_PARENT();
|
m_window = GDK_ROOT_PARENT();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetUpDC();
|
SetUpDC();
|
||||||
|
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
||||||
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
|
||||||
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
|
||||||
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxScreenDC::~wxScreenDC(void)
|
wxScreenDC::~wxScreenDC()
|
||||||
{
|
{
|
||||||
EndDrawingOnTop();
|
EndDrawingOnTop();
|
||||||
}
|
}
|
||||||
@@ -279,7 +278,7 @@ wxScreenDC::~wxScreenDC(void)
|
|||||||
bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
|
bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
|
||||||
{
|
{
|
||||||
if (!window) return StartDrawingOnTop();
|
if (!window) return StartDrawingOnTop();
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
window->GetPosition( &x, &y );
|
window->GetPosition( &x, &y );
|
||||||
@@ -287,13 +286,13 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
|
|||||||
int h = 0;
|
int h = 0;
|
||||||
window->GetSize( &w, &h );
|
window->GetSize( &w, &h );
|
||||||
window->ClientToScreen( &x, &y );
|
window->ClientToScreen( &x, &y );
|
||||||
|
|
||||||
wxRect rect;
|
wxRect rect;
|
||||||
rect.x = x;
|
rect.x = x;
|
||||||
rect.y = y;
|
rect.y = y;
|
||||||
rect.width = 0;
|
rect.width = 0;
|
||||||
rect.height = 0;
|
rect.height = 0;
|
||||||
|
|
||||||
return StartDrawingOnTop( &rect );
|
return StartDrawingOnTop( &rect );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,7 +309,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
|
|||||||
width = rect->width;
|
width = rect->width;
|
||||||
height = rect->height;
|
height = rect->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
sm_overlayWindowX = x;
|
sm_overlayWindowX = x;
|
||||||
sm_overlayWindowY = y;
|
sm_overlayWindowY = y;
|
||||||
|
|
||||||
@@ -323,23 +322,23 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
|
|||||||
attr.wclass = GDK_INPUT_OUTPUT;
|
attr.wclass = GDK_INPUT_OUTPUT;
|
||||||
attr.event_mask = 0;
|
attr.event_mask = 0;
|
||||||
attr.window_type = GDK_WINDOW_TEMP;
|
attr.window_type = GDK_WINDOW_TEMP;
|
||||||
|
|
||||||
// GTK cannot set transparent backgrounds. :-(
|
// GTK cannot set transparent backgrounds. :-(
|
||||||
sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
|
sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
|
||||||
|
|
||||||
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
|
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
|
||||||
|
|
||||||
return (sm_overlayWindow != NULL);
|
return (sm_overlayWindow != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxScreenDC::EndDrawingOnTop(void)
|
bool wxScreenDC::EndDrawingOnTop()
|
||||||
{
|
{
|
||||||
if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
|
if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
|
||||||
|
|
||||||
sm_overlayWindow = NULL;
|
sm_overlayWindow = NULL;
|
||||||
sm_overlayWindowX = 0;
|
sm_overlayWindowX = 0;
|
||||||
sm_overlayWindowY = 0;
|
sm_overlayWindowY = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "appbase.h"
|
|
||||||
#pragma implementation "app.h"
|
#pragma implementation "app.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -515,28 +514,6 @@ void wxApp::Dispatch()
|
|||||||
gtk_main_iteration();
|
gtk_main_iteration();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxApp::ProcessPendingEvents()
|
|
||||||
{
|
|
||||||
#if wxUSE_THREADS
|
|
||||||
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
|
|
||||||
#endif // wxUSE_THREADS
|
|
||||||
|
|
||||||
if ( !wxPendingEvents )
|
|
||||||
return;
|
|
||||||
|
|
||||||
wxNode *node = wxPendingEvents->First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
|
|
||||||
|
|
||||||
handler->ProcessPendingEvents();
|
|
||||||
|
|
||||||
delete node;
|
|
||||||
|
|
||||||
node = wxPendingEvents->First();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxApp::DeletePendingObjects()
|
void wxApp::DeletePendingObjects()
|
||||||
{
|
{
|
||||||
wxNode *node = wxPendingDelete.First();
|
wxNode *node = wxPendingDelete.First();
|
||||||
|
@@ -51,7 +51,7 @@ wxDC::wxDC()
|
|||||||
m_brush = *wxWHITE_BRUSH;
|
m_brush = *wxWHITE_BRUSH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoSetClippingRegion( long x, long y, long width, long height )
|
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
m_clipping = TRUE;
|
m_clipping = TRUE;
|
||||||
m_clipX1 = x;
|
m_clipX1 = x;
|
||||||
@@ -149,14 +149,14 @@ void wxDC::SetLogicalScale( double x, double y )
|
|||||||
ComputeScaleAndOrigin();
|
ComputeScaleAndOrigin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetLogicalOrigin( long x, long y )
|
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
m_logicalOriginX = x * m_signX; // is this still correct ?
|
m_logicalOriginX = x * m_signX; // is this still correct ?
|
||||||
m_logicalOriginY = y * m_signY;
|
m_logicalOriginY = y * m_signY;
|
||||||
ComputeScaleAndOrigin();
|
ComputeScaleAndOrigin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetDeviceOrigin( long x, long y )
|
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
// only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
|
// only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
|
||||||
m_deviceOriginX = x;
|
m_deviceOriginX = x;
|
||||||
@@ -176,42 +176,42 @@ void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
|||||||
// coordinates transformations
|
// coordinates transformations
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalX(long x) const
|
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XDEV2LOG(x);
|
return ((wxDC *)this)->XDEV2LOG(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalY(long y) const
|
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YDEV2LOG(y);
|
return ((wxDC *)this)->YDEV2LOG(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalXRel(long x) const
|
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XDEV2LOGREL(x);
|
return ((wxDC *)this)->XDEV2LOGREL(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalYRel(long y) const
|
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YDEV2LOGREL(y);
|
return ((wxDC *)this)->YDEV2LOGREL(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceX(long x) const
|
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XLOG2DEV(x);
|
return ((wxDC *)this)->XLOG2DEV(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceY(long y) const
|
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YLOG2DEV(y);
|
return ((wxDC *)this)->YLOG2DEV(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceXRel(long x) const
|
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->XLOG2DEVREL(x);
|
return ((wxDC *)this)->XLOG2DEVREL(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceYRel(long y) const
|
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
return ((wxDC *)this)->YLOG2DEVREL(y);
|
return ((wxDC *)this)->YLOG2DEVREL(y);
|
||||||
}
|
}
|
||||||
|
@@ -153,19 +153,19 @@ wxWindowDC::~wxWindowDC()
|
|||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y),
|
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||||
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
|
wxFAIL_MSG( wxT("wxWindowDC::DoFloodFill not implemented") );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
|
bool wxWindowDC::DoGetPixel( wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
|
wxFAIL_MSG( wxT("wxWindowDC::DoGetPixel not implemented") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
|
void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoCrossHair( long x, long y )
|
void wxWindowDC::DoCrossHair( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -188,8 +188,8 @@ void wxWindowDC::DoCrossHair( long x, long y )
|
|||||||
int w = 0;
|
int w = 0;
|
||||||
int h = 0;
|
int h = 0;
|
||||||
GetSize( &w, &h );
|
GetSize( &w, &h );
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
if (m_window)
|
if (m_window)
|
||||||
{
|
{
|
||||||
gdk_draw_line( m_window, m_penGC, 0, yy, XLOG2DEVREL(w), yy );
|
gdk_draw_line( m_window, m_penGC, 0, yy, XLOG2DEVREL(w), yy );
|
||||||
@@ -198,21 +198,21 @@ void wxWindowDC::DoCrossHair( long x, long y )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
|
void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
||||||
long xc, long yc )
|
wxCoord xc, wxCoord yc )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx1 = XLOG2DEV(x1);
|
wxCoord xx1 = XLOG2DEV(x1);
|
||||||
long yy1 = YLOG2DEV(y1);
|
wxCoord yy1 = YLOG2DEV(y1);
|
||||||
long xx2 = XLOG2DEV(x2);
|
wxCoord xx2 = XLOG2DEV(x2);
|
||||||
long yy2 = YLOG2DEV(y2);
|
wxCoord yy2 = YLOG2DEV(y2);
|
||||||
long xxc = XLOG2DEV(xc);
|
wxCoord xxc = XLOG2DEV(xc);
|
||||||
long yyc = YLOG2DEV(yc);
|
wxCoord yyc = YLOG2DEV(yc);
|
||||||
double dx = xx1 - xxc;
|
double dx = xx1 - xxc;
|
||||||
double dy = yy1 - yyc;
|
double dy = yy1 - yyc;
|
||||||
double radius = sqrt((double)(dx*dx+dy*dy));
|
double radius = sqrt((double)(dx*dx+dy*dy));
|
||||||
long r = (long)radius;
|
wxCoord r = (wxCoord)radius;
|
||||||
double radius1, radius2;
|
double radius1, radius2;
|
||||||
|
|
||||||
if (xx1 == xx2 && yy1 == yy2)
|
if (xx1 == xx2 && yy1 == yy2)
|
||||||
@@ -234,8 +234,8 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
|
|||||||
(yy2 - yyc < 0) ? 90.0 : -90.0 :
|
(yy2 - yyc < 0) ? 90.0 : -90.0 :
|
||||||
-atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG;
|
-atan2(double(yy2-yyc), double(xx2-xxc)) * RAD2DEG;
|
||||||
}
|
}
|
||||||
long alpha1 = long(radius1 * 64.0);
|
wxCoord alpha1 = wxCoord(radius1 * 64.0);
|
||||||
long alpha2 = long((radius2 - radius1) * 64.0);
|
wxCoord alpha2 = wxCoord((radius2 - radius1) * 64.0);
|
||||||
while (alpha2 <= 0) alpha2 += 360*64;
|
while (alpha2 <= 0) alpha2 += 360*64;
|
||||||
while (alpha1 > 360*64) alpha1 -= 360*64;
|
while (alpha1 > 360*64) alpha1 -= 360*64;
|
||||||
|
|
||||||
@@ -252,14 +252,14 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
|
|||||||
CalcBoundingBox (x2, y2);
|
CalcBoundingBox (x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
|
void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double sa, double ea )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
|
|
||||||
// CMB: handle -ve width and/or height
|
// CMB: handle -ve width and/or height
|
||||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||||
@@ -267,8 +267,8 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
|
|||||||
|
|
||||||
if (m_window)
|
if (m_window)
|
||||||
{
|
{
|
||||||
long start = long(sa * 64.0);
|
wxCoord start = wxCoord(sa * 64.0);
|
||||||
long end = long(ea * 64.0);
|
wxCoord end = wxCoord(ea * 64.0);
|
||||||
|
|
||||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
|
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
|
||||||
@@ -281,7 +281,7 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou
|
|||||||
CalcBoundingBox (x + width, y + height);
|
CalcBoundingBox (x + width, y + height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawPoint( long x, long y )
|
void wxWindowDC::DoDrawPoint( wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ void wxWindowDC::DoDrawPoint( long x, long y )
|
|||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset )
|
void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -302,10 +302,10 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
|
|||||||
|
|
||||||
for (int i = 0; i < n-1; i++)
|
for (int i = 0; i < n-1; i++)
|
||||||
{
|
{
|
||||||
long x1 = XLOG2DEV(points[i].x + xoffset);
|
wxCoord x1 = XLOG2DEV(points[i].x + xoffset);
|
||||||
long x2 = XLOG2DEV(points[i+1].x + xoffset);
|
wxCoord x2 = XLOG2DEV(points[i+1].x + xoffset);
|
||||||
long y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
|
wxCoord y1 = YLOG2DEV(points[i].y + yoffset); // oh, what a waste
|
||||||
long y2 = YLOG2DEV(points[i+1].y + yoffset);
|
wxCoord y2 = YLOG2DEV(points[i+1].y + yoffset);
|
||||||
|
|
||||||
if (m_window)
|
if (m_window)
|
||||||
gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
|
gdk_draw_line( m_window, m_penGC, x1, y1, x2, y2 );
|
||||||
@@ -314,7 +314,7 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
|
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -350,14 +350,14 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoff
|
|||||||
delete[] gdkpoints;
|
delete[] gdkpoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
|
void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
|
|
||||||
// CMB: draw nothing if transformed w or h is 0
|
// CMB: draw nothing if transformed w or h is 0
|
||||||
if (ww == 0 || hh == 0) return;
|
if (ww == 0 || hh == 0) return;
|
||||||
@@ -379,17 +379,17 @@ void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
|
|||||||
CalcBoundingBox( x + width, y + height );
|
CalcBoundingBox( x + width, y + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius )
|
void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
|
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
long rr = XLOG2DEVREL((long)radius);
|
wxCoord rr = XLOG2DEVREL((wxCoord)radius);
|
||||||
|
|
||||||
// CMB: handle -ve width and/or height
|
// CMB: handle -ve width and/or height
|
||||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||||
@@ -418,7 +418,7 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
|
|||||||
{
|
{
|
||||||
// CMB: ensure dd is not larger than rectangle otherwise we
|
// CMB: ensure dd is not larger than rectangle otherwise we
|
||||||
// get an hour glass shape
|
// get an hour glass shape
|
||||||
long dd = 2 * rr;
|
wxCoord dd = 2 * rr;
|
||||||
if (dd > ww) dd = ww;
|
if (dd > ww) dd = ww;
|
||||||
if (dd > hh) dd = hh;
|
if (dd > hh) dd = hh;
|
||||||
rr = dd / 2;
|
rr = dd / 2;
|
||||||
@@ -451,14 +451,14 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height
|
|||||||
CalcBoundingBox( x + width, y + height );
|
CalcBoundingBox( x + width, y + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
|
void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
long xx = XLOG2DEV(x);
|
wxCoord xx = XLOG2DEV(x);
|
||||||
long yy = YLOG2DEV(y);
|
wxCoord yy = YLOG2DEV(y);
|
||||||
long ww = m_signX * XLOG2DEVREL(width);
|
wxCoord ww = m_signX * XLOG2DEVREL(width);
|
||||||
long hh = m_signY * YLOG2DEVREL(height);
|
wxCoord hh = m_signY * YLOG2DEVREL(height);
|
||||||
|
|
||||||
// CMB: handle -ve width and/or height
|
// CMB: handle -ve width and/or height
|
||||||
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
if (ww < 0) { ww = -ww; xx = xx - ww; }
|
||||||
@@ -477,14 +477,14 @@ void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
|
|||||||
CalcBoundingBox( x + width, y + height );
|
CalcBoundingBox( x + width, y + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawIcon( const wxIcon &icon, long x, long y )
|
void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
|
||||||
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
|
DoDrawBitmap( (const wxBitmap&)icon, x, y, (bool)TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
||||||
long x, long y,
|
wxCoord x, wxCoord y,
|
||||||
bool useMask )
|
bool useMask )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
@@ -559,8 +559,8 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc,
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||||
int logical_func, bool useMask )
|
int logical_func, bool useMask )
|
||||||
{
|
{
|
||||||
/* this is the nth try to get this utterly useless function to
|
/* this is the nth try to get this utterly useless function to
|
||||||
@@ -629,11 +629,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
{
|
{
|
||||||
/* scale/translate bitmap size */
|
/* scale/translate bitmap size */
|
||||||
|
|
||||||
long bm_width = memDC->m_selected.GetWidth();
|
wxCoord bm_width = memDC->m_selected.GetWidth();
|
||||||
long bm_height = memDC->m_selected.GetHeight();
|
wxCoord bm_height = memDC->m_selected.GetHeight();
|
||||||
|
|
||||||
long bm_ww = XLOG2DEVREL( bm_width );
|
wxCoord bm_ww = XLOG2DEVREL( bm_width );
|
||||||
long bm_hh = YLOG2DEVREL( bm_height );
|
wxCoord bm_hh = YLOG2DEVREL( bm_height );
|
||||||
|
|
||||||
/* scale bitmap if required */
|
/* scale bitmap if required */
|
||||||
|
|
||||||
@@ -653,11 +653,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
|
|
||||||
/* scale/translate size and position */
|
/* scale/translate size and position */
|
||||||
|
|
||||||
long xx = XLOG2DEV(xdest);
|
wxCoord xx = XLOG2DEV(xdest);
|
||||||
long yy = YLOG2DEV(ydest);
|
wxCoord yy = YLOG2DEV(ydest);
|
||||||
|
|
||||||
long ww = XLOG2DEVREL(width);
|
wxCoord ww = XLOG2DEVREL(width);
|
||||||
long hh = YLOG2DEVREL(height);
|
wxCoord hh = YLOG2DEVREL(height);
|
||||||
|
|
||||||
/* apply mask if any */
|
/* apply mask if any */
|
||||||
|
|
||||||
@@ -700,11 +700,11 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
{
|
{
|
||||||
/* scale/translate size and position */
|
/* scale/translate size and position */
|
||||||
|
|
||||||
long xx = XLOG2DEV(xdest);
|
wxCoord xx = XLOG2DEV(xdest);
|
||||||
long yy = YLOG2DEV(ydest);
|
wxCoord yy = YLOG2DEV(ydest);
|
||||||
|
|
||||||
long ww = XLOG2DEVREL(width);
|
wxCoord ww = XLOG2DEVREL(width);
|
||||||
long hh = YLOG2DEVREL(height);
|
wxCoord hh = YLOG2DEVREL(height);
|
||||||
|
|
||||||
if ((width != ww) || (height != hh))
|
if ((width != ww) || (height != hh))
|
||||||
{
|
{
|
||||||
@@ -754,7 +754,7 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
|
void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -770,8 +770,8 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
|
|||||||
/* CMB 21/5/98: draw text background if mode is wxSOLID */
|
/* CMB 21/5/98: draw text background if mode is wxSOLID */
|
||||||
if (m_backgroundMode == wxSOLID)
|
if (m_backgroundMode == wxSOLID)
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long height = font->ascent + font->descent;
|
wxCoord height = font->ascent + font->descent;
|
||||||
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
|
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
|
||||||
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
|
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
|
||||||
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
|
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
|
||||||
@@ -783,42 +783,43 @@ void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
|
|||||||
properties (see wxXt implementation) */
|
properties (see wxXt implementation) */
|
||||||
if (m_font.GetUnderlined())
|
if (m_font.GetUnderlined())
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long ul_y = y + font->ascent;
|
wxCoord ul_y = y + font->ascent;
|
||||||
if (font->descent > 0) ul_y++;
|
if (font->descent > 0) ul_y++;
|
||||||
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
GetTextExtent (text, &w, &h);
|
GetTextExtent (text, &w, &h);
|
||||||
CalcBoundingBox (x + w, y + h);
|
CalcBoundingBox (x + w, y + h);
|
||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
|
void wxWindowDC::DoGetTextExtent(const wxString &string,
|
||||||
long *descent, long *externalLeading,
|
wxCoord *width, wxCoord *height,
|
||||||
wxFont *theFont ) const
|
wxCoord *descent, wxCoord *externalLeading,
|
||||||
|
wxFont *theFont) const
|
||||||
{
|
{
|
||||||
wxFont fontToUse = m_font;
|
wxFont fontToUse = m_font;
|
||||||
if (theFont) fontToUse = *theFont;
|
if (theFont) fontToUse = *theFont;
|
||||||
|
|
||||||
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
|
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
|
||||||
if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
|
if (width) (*width) = wxCoord(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
|
||||||
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
|
if (height) (*height) = wxCoord((font->ascent + font->descent) / m_scaleY);
|
||||||
if (descent) (*descent) = long(font->descent / m_scaleY);
|
if (descent) (*descent) = wxCoord(font->descent / m_scaleY);
|
||||||
if (externalLeading) (*externalLeading) = 0; // ??
|
if (externalLeading) (*externalLeading) = 0; // ??
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxWindowDC::GetCharWidth() const
|
wxCoord wxWindowDC::GetCharWidth() const
|
||||||
{
|
{
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return long(gdk_string_width( font, "H" ) / m_scaleX);
|
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxWindowDC::GetCharHeight() const
|
wxCoord wxWindowDC::GetCharHeight() const
|
||||||
{
|
{
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
return long((font->ascent + font->descent) / m_scaleY);
|
return wxCoord((font->ascent + font->descent) / m_scaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::Clear()
|
void wxWindowDC::Clear()
|
||||||
@@ -886,7 +887,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
|||||||
|
|
||||||
static const char dotted[] = {1, 1};
|
static const char dotted[] = {1, 1};
|
||||||
static const char short_dashed[] = {2, 2};
|
static const char short_dashed[] = {2, 2};
|
||||||
static const char long_dashed[] = {2, 4};
|
static const char wxCoord_dashed[] = {2, 4};
|
||||||
static const char dotted_dashed[] = {3, 3, 1, 3};
|
static const char dotted_dashed[] = {3, 3, 1, 3};
|
||||||
|
|
||||||
// We express dash pattern in pen width unit, so we are
|
// We express dash pattern in pen width unit, so we are
|
||||||
@@ -915,7 +916,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
|||||||
{
|
{
|
||||||
lineStyle = GDK_LINE_ON_OFF_DASH;
|
lineStyle = GDK_LINE_ON_OFF_DASH;
|
||||||
req_nb_dash = 2;
|
req_nb_dash = 2;
|
||||||
req_dash = long_dashed;
|
req_dash = wxCoord_dashed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxSHORT_DASH:
|
case wxSHORT_DASH:
|
||||||
@@ -1168,7 +1169,7 @@ void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
|
|||||||
wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
|
wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
|
void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -25,15 +25,15 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
|
|||||||
wxMemoryDC::wxMemoryDC() : wxWindowDC()
|
wxMemoryDC::wxMemoryDC() : wxWindowDC()
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
|
|
||||||
m_cmap = gtk_widget_get_default_colormap();
|
m_cmap = gtk_widget_get_default_colormap();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
||||||
: wxWindowDC()
|
: wxWindowDC()
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
|
|
||||||
m_cmap = gtk_widget_get_default_colormap();
|
m_cmap = gtk_widget_get_default_colormap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,13 +54,13 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
|
|||||||
{
|
{
|
||||||
m_window = m_selected.GetBitmap();
|
m_window = m_selected.GetBitmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetUpDC();
|
SetUpDC();
|
||||||
|
|
||||||
m_isMemDC = TRUE;
|
m_isMemDC = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
m_window = (GdkWindow *) NULL;
|
m_window = (GdkWindow *) NULL;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -22,10 +22,9 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
|
GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
|
||||||
int wxScreenDC::sm_overlayWindowX = 0;
|
int wxScreenDC::sm_overlayWindowX = 0;
|
||||||
int wxScreenDC::sm_overlayWindowY = 0;
|
int wxScreenDC::sm_overlayWindowY = 0;
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// create X window
|
// create X window
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -57,14 +56,14 @@ int my_event_masks_table[19] =
|
|||||||
StructureNotifyMask,
|
StructureNotifyMask,
|
||||||
PropertyChangeMask,
|
PropertyChangeMask,
|
||||||
VisibilityChangeMask,
|
VisibilityChangeMask,
|
||||||
0, /* PROXIMITY_IN */
|
0, /* PROXIMITY_IN */
|
||||||
0 /* PROXIMTY_OUT */
|
0 /* PROXIMTY_OUT */
|
||||||
};
|
};
|
||||||
|
|
||||||
GdkWindow*
|
GdkWindow*
|
||||||
gdk_window_transparent_new ( GdkWindow *parent,
|
gdk_window_transparent_new ( GdkWindow *parent,
|
||||||
GdkWindowAttr *attributes,
|
GdkWindowAttr *attributes,
|
||||||
gint attributes_mask)
|
gint attributes_mask)
|
||||||
{
|
{
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
GdkWindowPrivate *gprivate;
|
GdkWindowPrivate *gprivate;
|
||||||
@@ -125,7 +124,7 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
|
gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
|
||||||
gprivate->window_type = attributes->window_type;
|
gprivate->window_type = attributes->window_type;
|
||||||
gprivate->extension_events = FALSE;
|
gprivate->extension_events = FALSE;
|
||||||
|
|
||||||
#if (GTK_MINOR_VERSION == 0)
|
#if (GTK_MINOR_VERSION == 0)
|
||||||
gprivate->dnd_drag_data_type = None;
|
gprivate->dnd_drag_data_type = None;
|
||||||
gprivate->dnd_drag_data_typesavail =
|
gprivate->dnd_drag_data_typesavail =
|
||||||
@@ -152,16 +151,16 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
for (i = 0; i < my_nevent_masks; i++)
|
for (i = 0; i < my_nevent_masks; i++)
|
||||||
{
|
{
|
||||||
if (attributes->event_mask & (1 << (i + 1)))
|
if (attributes->event_mask & (1 << (i + 1)))
|
||||||
xattributes.event_mask |= my_event_masks_table[i];
|
xattributes.event_mask |= my_event_masks_table[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xattributes.event_mask)
|
if (xattributes.event_mask)
|
||||||
xattributes_mask |= CWEventMask;
|
xattributes_mask |= CWEventMask;
|
||||||
|
|
||||||
if(attributes_mask & GDK_WA_NOREDIR) {
|
if(attributes_mask & GDK_WA_NOREDIR) {
|
||||||
xattributes.override_redirect =
|
xattributes.override_redirect =
|
||||||
(attributes->override_redirect == FALSE)?False:True;
|
(attributes->override_redirect == FALSE)?False:True;
|
||||||
xattributes_mask |= CWOverrideRedirect;
|
xattributes_mask |= CWOverrideRedirect;
|
||||||
} else
|
} else
|
||||||
xattributes.override_redirect = False;
|
xattributes.override_redirect = False;
|
||||||
|
|
||||||
@@ -169,24 +168,24 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
depth = visual->depth;
|
depth = visual->depth;
|
||||||
|
|
||||||
if (attributes_mask & GDK_WA_COLORMAP)
|
if (attributes_mask & GDK_WA_COLORMAP)
|
||||||
gprivate->colormap = attributes->colormap;
|
gprivate->colormap = attributes->colormap;
|
||||||
else
|
else
|
||||||
gprivate->colormap = gdk_colormap_get_system ();
|
gprivate->colormap = gdk_colormap_get_system ();
|
||||||
|
|
||||||
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
|
xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
|
||||||
xattributes_mask |= CWColormap;
|
xattributes_mask |= CWColormap;
|
||||||
|
|
||||||
xparent = gdk_root_window;
|
xparent = gdk_root_window;
|
||||||
|
|
||||||
xattributes.save_under = True;
|
xattributes.save_under = True;
|
||||||
xattributes.override_redirect = True;
|
xattributes.override_redirect = True;
|
||||||
xattributes.cursor = None;
|
xattributes.cursor = None;
|
||||||
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
|
xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
|
||||||
|
|
||||||
gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
|
gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
|
||||||
x, y, gprivate->width, gprivate->height,
|
x, y, gprivate->width, gprivate->height,
|
||||||
0, depth, gclass, xvisual,
|
0, depth, gclass, xvisual,
|
||||||
xattributes_mask, &xattributes);
|
xattributes_mask, &xattributes);
|
||||||
gdk_window_ref (window);
|
gdk_window_ref (window);
|
||||||
gdk_xid_table_insert (&gprivate->xwindow, window);
|
gdk_xid_table_insert (&gprivate->xwindow, window);
|
||||||
|
|
||||||
@@ -246,12 +245,12 @@ gdk_window_transparent_new ( GdkWindow *parent,
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
|
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
|
||||||
|
|
||||||
wxScreenDC::wxScreenDC(void)
|
wxScreenDC::wxScreenDC()
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
m_ok = FALSE;
|
||||||
m_window = (GdkWindow *) NULL;
|
m_window = (GdkWindow *) NULL;
|
||||||
m_cmap = gdk_colormap_get_system();
|
m_cmap = gdk_colormap_get_system();
|
||||||
|
|
||||||
if (sm_overlayWindow)
|
if (sm_overlayWindow)
|
||||||
{
|
{
|
||||||
m_window = sm_overlayWindow;
|
m_window = sm_overlayWindow;
|
||||||
@@ -262,16 +261,16 @@ wxScreenDC::wxScreenDC(void)
|
|||||||
{
|
{
|
||||||
m_window = GDK_ROOT_PARENT();
|
m_window = GDK_ROOT_PARENT();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetUpDC();
|
SetUpDC();
|
||||||
|
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
||||||
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
|
||||||
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
|
||||||
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxScreenDC::~wxScreenDC(void)
|
wxScreenDC::~wxScreenDC()
|
||||||
{
|
{
|
||||||
EndDrawingOnTop();
|
EndDrawingOnTop();
|
||||||
}
|
}
|
||||||
@@ -279,7 +278,7 @@ wxScreenDC::~wxScreenDC(void)
|
|||||||
bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
|
bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
|
||||||
{
|
{
|
||||||
if (!window) return StartDrawingOnTop();
|
if (!window) return StartDrawingOnTop();
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
window->GetPosition( &x, &y );
|
window->GetPosition( &x, &y );
|
||||||
@@ -287,13 +286,13 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
|
|||||||
int h = 0;
|
int h = 0;
|
||||||
window->GetSize( &w, &h );
|
window->GetSize( &w, &h );
|
||||||
window->ClientToScreen( &x, &y );
|
window->ClientToScreen( &x, &y );
|
||||||
|
|
||||||
wxRect rect;
|
wxRect rect;
|
||||||
rect.x = x;
|
rect.x = x;
|
||||||
rect.y = y;
|
rect.y = y;
|
||||||
rect.width = 0;
|
rect.width = 0;
|
||||||
rect.height = 0;
|
rect.height = 0;
|
||||||
|
|
||||||
return StartDrawingOnTop( &rect );
|
return StartDrawingOnTop( &rect );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,7 +309,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
|
|||||||
width = rect->width;
|
width = rect->width;
|
||||||
height = rect->height;
|
height = rect->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
sm_overlayWindowX = x;
|
sm_overlayWindowX = x;
|
||||||
sm_overlayWindowY = y;
|
sm_overlayWindowY = y;
|
||||||
|
|
||||||
@@ -323,23 +322,23 @@ bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
|
|||||||
attr.wclass = GDK_INPUT_OUTPUT;
|
attr.wclass = GDK_INPUT_OUTPUT;
|
||||||
attr.event_mask = 0;
|
attr.event_mask = 0;
|
||||||
attr.window_type = GDK_WINDOW_TEMP;
|
attr.window_type = GDK_WINDOW_TEMP;
|
||||||
|
|
||||||
// GTK cannot set transparent backgrounds. :-(
|
// GTK cannot set transparent backgrounds. :-(
|
||||||
sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
|
sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
|
||||||
|
|
||||||
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
|
if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
|
||||||
|
|
||||||
return (sm_overlayWindow != NULL);
|
return (sm_overlayWindow != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxScreenDC::EndDrawingOnTop(void)
|
bool wxScreenDC::EndDrawingOnTop()
|
||||||
{
|
{
|
||||||
if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
|
if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
|
||||||
|
|
||||||
sm_overlayWindow = NULL;
|
sm_overlayWindow = NULL;
|
||||||
sm_overlayWindowX = 0;
|
sm_overlayWindowX = 0;
|
||||||
sm_overlayWindowY = 0;
|
sm_overlayWindowY = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_PRINTING_ARCHITECTURE
|
#if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
#include "wx/print.h"
|
#include "wx/print.h"
|
||||||
#include "wx/printdlg.h"
|
#include "wx/printdlg.h"
|
||||||
@@ -565,4 +565,4 @@ wxHtmlPrintout *wxHtmlEasyPrinting::CreatePrintout()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
#endif // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
@@ -53,11 +53,6 @@
|
|||||||
extern char *wxBuffer;
|
extern char *wxBuffer;
|
||||||
extern wxList wxPendingDelete;
|
extern wxList wxPendingDelete;
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
|
||||||
extern wxList *wxPendingEvents;
|
|
||||||
extern wxCriticalSection *wxPendingEventsLocker;
|
|
||||||
#endif // wxUSE_THREADS
|
|
||||||
|
|
||||||
wxApp *wxTheApp = NULL;
|
wxApp *wxTheApp = NULL;
|
||||||
|
|
||||||
wxHashTable *wxWidgetHashTable = NULL;
|
wxHashTable *wxWidgetHashTable = NULL;
|
||||||
@@ -81,7 +76,6 @@ bool wxApp::Initialize()
|
|||||||
// GL: I'm annoyed ... I don't know where to put this and I don't want to
|
// GL: I'm annoyed ... I don't know where to put this and I don't want to
|
||||||
// create a module for that as it's part of the core.
|
// create a module for that as it's part of the core.
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
wxPendingEvents = new wxList();
|
|
||||||
wxPendingEventsLocker = new wxCriticalSection();
|
wxPendingEventsLocker = new wxCriticalSection();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -549,24 +543,6 @@ void wxApp::DeletePendingObjects()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
|
||||||
void wxApp::ProcessPendingEvents()
|
|
||||||
{
|
|
||||||
wxNode *node = wxPendingEvents->First();
|
|
||||||
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
|
|
||||||
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
|
|
||||||
|
|
||||||
handler->ProcessPendingEvents();
|
|
||||||
|
|
||||||
delete node;
|
|
||||||
node = wxPendingEvents->First();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // wxUSE_THREADS
|
|
||||||
|
|
||||||
// Create an application context
|
// Create an application context
|
||||||
bool wxApp::OnInitGui()
|
bool wxApp::OnInitGui()
|
||||||
{
|
{
|
||||||
|
@@ -27,12 +27,6 @@ wxWindowList wxTopLevelWindows;
|
|||||||
// List of windows pending deletion
|
// List of windows pending deletion
|
||||||
wxList wxPendingDelete;
|
wxList wxPendingDelete;
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
|
||||||
// List of events pending propagation
|
|
||||||
wxList *wxPendingEvents = NULL;
|
|
||||||
wxCriticalSection *wxPendingEventsLocker = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int wxPageNumber;
|
int wxPageNumber;
|
||||||
|
|
||||||
// GDI Object Lists
|
// GDI Object Lists
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "app.h"
|
#pragma implementation "app.h"
|
||||||
#pragma implementation "appbase.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
@@ -44,8 +43,8 @@
|
|||||||
#include "wx/msgdlg.h"
|
#include "wx/msgdlg.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
#include "wx/dynarray.h"
|
#include "wx/dynarray.h"
|
||||||
# include "wx/wxchar.h"
|
#include "wx/wxchar.h"
|
||||||
# include "wx/icon.h"
|
#include "wx/icon.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
@@ -924,28 +923,6 @@ bool wxApp::ProcessIdle()
|
|||||||
return event.MoreRequested();
|
return event.MoreRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxApp::ProcessPendingEvents()
|
|
||||||
{
|
|
||||||
#if wxUSE_THREADS
|
|
||||||
// ensure that we're the only thread to modify the pending events list
|
|
||||||
wxCriticalSectionLocker locker(*wxPendingEventsLocker);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( !wxPendingEvents )
|
|
||||||
return;
|
|
||||||
|
|
||||||
wxNode *node = wxPendingEvents->First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
|
|
||||||
|
|
||||||
handler->ProcessPendingEvents();
|
|
||||||
|
|
||||||
delete node;
|
|
||||||
node = wxPendingEvents->First();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxApp::ExitMainLoop()
|
void wxApp::ExitMainLoop()
|
||||||
{
|
{
|
||||||
m_keepGoing = FALSE;
|
m_keepGoing = FALSE;
|
||||||
|
146
src/msw/dc.cpp
146
src/msw/dc.cpp
@@ -164,7 +164,7 @@ void wxDC::SelectOldObjects(WXHDC dc)
|
|||||||
// clipping
|
// clipping
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::DoSetClippingRegion(long cx, long cy, long cw, long ch)
|
void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
|
||||||
{
|
{
|
||||||
m_clipping = TRUE;
|
m_clipping = TRUE;
|
||||||
m_clipX1 = (int)cx;
|
m_clipX1 = (int)cx;
|
||||||
@@ -273,7 +273,7 @@ void wxDC::Clear()
|
|||||||
::SetWindowOrgEx(GetHdc(), (int)m_logicalOriginX, (int)m_logicalOriginY, NULL);
|
::SetWindowOrgEx(GetHdc(), (int)m_logicalOriginX, (int)m_logicalOriginY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoFloodFill(long x, long y, const wxColour& col, int style)
|
void wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
|
||||||
{
|
{
|
||||||
(void)ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
|
(void)ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
|
||||||
col.GetPixel(),
|
col.GetPixel(),
|
||||||
@@ -283,7 +283,7 @@ void wxDC::DoFloodFill(long x, long y, const wxColour& col, int style)
|
|||||||
CalcBoundingBox(x, y);
|
CalcBoundingBox(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDC::DoGetPixel(long x, long y, wxColour *col) const
|
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
|
||||||
{
|
{
|
||||||
// added by steve 29.12.94 (copied from DrawPoint)
|
// added by steve 29.12.94 (copied from DrawPoint)
|
||||||
// returns TRUE for pixels in the color of the current pen
|
// returns TRUE for pixels in the color of the current pen
|
||||||
@@ -308,12 +308,12 @@ bool wxDC::DoGetPixel(long x, long y, wxColour *col) const
|
|||||||
return(pixelcolor==pencolor);
|
return(pixelcolor==pencolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoCrossHair(long x, long y)
|
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
long x1 = x-VIEWPORT_EXTENT;
|
wxCoord x1 = x-VIEWPORT_EXTENT;
|
||||||
long y1 = y-VIEWPORT_EXTENT;
|
wxCoord y1 = y-VIEWPORT_EXTENT;
|
||||||
long x2 = x+VIEWPORT_EXTENT;
|
wxCoord x2 = x+VIEWPORT_EXTENT;
|
||||||
long y2 = y+VIEWPORT_EXTENT;
|
wxCoord y2 = y+VIEWPORT_EXTENT;
|
||||||
|
|
||||||
(void)MoveToEx(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y), NULL);
|
(void)MoveToEx(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y), NULL);
|
||||||
(void)LineTo(GetHdc(), XLOG2DEV(x2), YLOG2DEV(y));
|
(void)LineTo(GetHdc(), XLOG2DEV(x2), YLOG2DEV(y));
|
||||||
@@ -325,7 +325,7 @@ void wxDC::DoCrossHair(long x, long y)
|
|||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawLine(long x1, long y1, long x2, long y2)
|
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
||||||
{
|
{
|
||||||
(void)MoveToEx(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y1), NULL);
|
(void)MoveToEx(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y1), NULL);
|
||||||
(void)LineTo(GetHdc(), XLOG2DEV(x2), YLOG2DEV(y2));
|
(void)LineTo(GetHdc(), XLOG2DEV(x2), YLOG2DEV(y2));
|
||||||
@@ -339,30 +339,30 @@ void wxDC::DoDrawLine(long x1, long y1, long x2, long y2)
|
|||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawArc(long x1,long y1,long x2,long y2, long xc, long yc)
|
void wxDC::DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2, wxCoord xc, wxCoord yc)
|
||||||
{
|
{
|
||||||
double dx = xc-x1;
|
double dx = xc-x1;
|
||||||
double dy = yc-y1;
|
double dy = yc-y1;
|
||||||
double radius = (double)sqrt(dx*dx+dy*dy) ;;
|
double radius = (double)sqrt(dx*dx+dy*dy) ;;
|
||||||
if (x1==x2 && x2==y2)
|
if (x1==x2 && x2==y2)
|
||||||
{
|
{
|
||||||
DrawEllipse(xc,yc,(long)(radius*2.0),(long)(radius*2.0));
|
DrawEllipse(xc,yc,(wxCoord)(radius*2.0),(wxCoord)(radius*2.0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long xx1 = XLOG2DEV(x1);
|
wxCoord xx1 = XLOG2DEV(x1);
|
||||||
long yy1 = YLOG2DEV(y1);
|
wxCoord yy1 = YLOG2DEV(y1);
|
||||||
long xx2 = XLOG2DEV(x2);
|
wxCoord xx2 = XLOG2DEV(x2);
|
||||||
long yy2 = YLOG2DEV(y2);
|
wxCoord yy2 = YLOG2DEV(y2);
|
||||||
long xxc = XLOG2DEV(xc);
|
wxCoord xxc = XLOG2DEV(xc);
|
||||||
long yyc = YLOG2DEV(yc);
|
wxCoord yyc = YLOG2DEV(yc);
|
||||||
long ray = (long) sqrt(double((xxc-xx1)*(xxc-xx1)+(yyc-yy1)*(yyc-yy1)));
|
wxCoord ray = (wxCoord) sqrt(double((xxc-xx1)*(xxc-xx1)+(yyc-yy1)*(yyc-yy1)));
|
||||||
|
|
||||||
(void)MoveToEx(GetHdc(), (int) xx1, (int) yy1, NULL);
|
(void)MoveToEx(GetHdc(), (int) xx1, (int) yy1, NULL);
|
||||||
long xxx1 = (long) (xxc-ray);
|
wxCoord xxx1 = (wxCoord) (xxc-ray);
|
||||||
long yyy1 = (long) (yyc-ray);
|
wxCoord yyy1 = (wxCoord) (yyc-ray);
|
||||||
long xxx2 = (long) (xxc+ray);
|
wxCoord xxx2 = (wxCoord) (xxc+ray);
|
||||||
long yyy2 = (long) (yyc+ray);
|
wxCoord yyy2 = (wxCoord) (yyc+ray);
|
||||||
if (m_brush.Ok() && m_brush.GetStyle() !=wxTRANSPARENT)
|
if (m_brush.Ok() && m_brush.GetStyle() !=wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
// Have to add 1 to bottom-right corner of rectangle
|
// Have to add 1 to bottom-right corner of rectangle
|
||||||
@@ -377,11 +377,11 @@ void wxDC::DoDrawArc(long x1,long y1,long x2,long y2, long xc, long yc)
|
|||||||
Arc(GetHdc(),xxx1,yyy1,xxx2,yyy2,
|
Arc(GetHdc(),xxx1,yyy1,xxx2,yyy2,
|
||||||
xx1,yy1,xx2,yy2);
|
xx1,yy1,xx2,yy2);
|
||||||
|
|
||||||
CalcBoundingBox((long)(xc-radius), (long)(yc-radius));
|
CalcBoundingBox((wxCoord)(xc-radius), (wxCoord)(yc-radius));
|
||||||
CalcBoundingBox((long)(xc+radius), (long)(yc+radius));
|
CalcBoundingBox((wxCoord)(xc+radius), (wxCoord)(yc+radius));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawPoint(long x, long y)
|
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
COLORREF color = 0x00ffffff;
|
COLORREF color = 0x00ffffff;
|
||||||
if (m_pen.Ok())
|
if (m_pen.Ok())
|
||||||
@@ -394,7 +394,7 @@ void wxDC::DoDrawPoint(long x, long y)
|
|||||||
CalcBoundingBox(x, y);
|
CalcBoundingBox(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawPolygon(int n, wxPoint points[], long xoffset, long yoffset,int fillStyle)
|
void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle)
|
||||||
{
|
{
|
||||||
// Do things less efficiently if we have offsets
|
// Do things less efficiently if we have offsets
|
||||||
if (xoffset != 0 || yoffset != 0)
|
if (xoffset != 0 || yoffset != 0)
|
||||||
@@ -425,7 +425,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], long xoffset, long yoffset,int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawLines(int n, wxPoint points[], long xoffset, long yoffset)
|
void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
// Do things less efficiently if we have offsets
|
// Do things less efficiently if we have offsets
|
||||||
if (xoffset != 0 || yoffset != 0)
|
if (xoffset != 0 || yoffset != 0)
|
||||||
@@ -452,10 +452,10 @@ void wxDC::DoDrawLines(int n, wxPoint points[], long xoffset, long yoffset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawRectangle(long x, long y, long width, long height)
|
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||||
{
|
{
|
||||||
long x2 = x + width;
|
wxCoord x2 = x + width;
|
||||||
long y2 = y + height;
|
wxCoord y2 = y + height;
|
||||||
|
|
||||||
/* MATTHEW: [6] new normalization */
|
/* MATTHEW: [6] new normalization */
|
||||||
#if WX_STANDARD_GRAPHICS
|
#if WX_STANDARD_GRAPHICS
|
||||||
@@ -496,7 +496,7 @@ void wxDC::DoDrawRectangle(long x, long y, long width, long height)
|
|||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawRoundedRectangle(long x, long y, long width, long height, double radius)
|
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
|
||||||
{
|
{
|
||||||
// Now, a negative radius value is interpreted to mean
|
// Now, a negative radius value is interpreted to mean
|
||||||
// 'the proportion of the smallest X or Y dimension'
|
// 'the proportion of the smallest X or Y dimension'
|
||||||
@@ -511,8 +511,8 @@ void wxDC::DoDrawRoundedRectangle(long x, long y, long width, long height, doubl
|
|||||||
radius = (- radius * smallest);
|
radius = (- radius * smallest);
|
||||||
}
|
}
|
||||||
|
|
||||||
long x2 = (x+width);
|
wxCoord x2 = (x+width);
|
||||||
long y2 = (y+height);
|
wxCoord y2 = (y+height);
|
||||||
|
|
||||||
(void)RoundRect(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2),
|
(void)RoundRect(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2),
|
||||||
YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius)));
|
YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius)));
|
||||||
@@ -521,10 +521,10 @@ void wxDC::DoDrawRoundedRectangle(long x, long y, long width, long height, doubl
|
|||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawEllipse(long x, long y, long width, long height)
|
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||||
{
|
{
|
||||||
long x2 = (x+width);
|
wxCoord x2 = (x+width);
|
||||||
long y2 = (y+height);
|
wxCoord y2 = (y+height);
|
||||||
|
|
||||||
(void)Ellipse(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
|
(void)Ellipse(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
|
||||||
|
|
||||||
@@ -533,10 +533,10 @@ void wxDC::DoDrawEllipse(long x, long y, long width, long height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Chris Breeze 20/5/98: first implementation of DrawEllipticArc on Windows
|
// Chris Breeze 20/5/98: first implementation of DrawEllipticArc on Windows
|
||||||
void wxDC::DoDrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
|
void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
|
||||||
{
|
{
|
||||||
long x2 = (x+w);
|
wxCoord x2 = (x+w);
|
||||||
long y2 = (y+h);
|
wxCoord y2 = (y+h);
|
||||||
|
|
||||||
const double deg2rad = 3.14159265359 / 180.0;
|
const double deg2rad = 3.14159265359 / 180.0;
|
||||||
int rx1 = XLOG2DEV(x+w/2);
|
int rx1 = XLOG2DEV(x+w/2);
|
||||||
@@ -569,7 +569,7 @@ void wxDC::DoDrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
|
|||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawIcon(const wxIcon& icon, long x, long y)
|
void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
#if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__)
|
#if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__)
|
||||||
::DrawIconEx(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), (HICON) icon.GetHICON(),
|
::DrawIconEx(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), (HICON) icon.GetHICON(),
|
||||||
@@ -582,7 +582,7 @@ void wxDC::DoDrawIcon(const wxIcon& icon, long x, long y)
|
|||||||
CalcBoundingBox(x+icon.GetWidth(), y+icon.GetHeight());
|
CalcBoundingBox(x+icon.GetWidth(), y+icon.GetHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask )
|
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
|
||||||
{
|
{
|
||||||
if (!bmp.Ok())
|
if (!bmp.Ok())
|
||||||
return;
|
return;
|
||||||
@@ -623,7 +623,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::DoDrawText(const wxString& text, long x, long y)
|
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
if (m_textForegroundColour.Ok())
|
if (m_textForegroundColour.Ok())
|
||||||
SetTextColor(GetHdc(), m_textForegroundColour.GetPixel() );
|
SetTextColor(GetHdc(), m_textForegroundColour.GetPixel() );
|
||||||
@@ -650,7 +650,7 @@ void wxDC::DoDrawText(const wxString& text, long x, long y)
|
|||||||
|
|
||||||
CalcBoundingBox(x, y);
|
CalcBoundingBox(x, y);
|
||||||
|
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
GetTextExtent(text, &w, &h);
|
GetTextExtent(text, &w, &h);
|
||||||
CalcBoundingBox((x + w), (y + h));
|
CalcBoundingBox((x + w), (y + h));
|
||||||
}
|
}
|
||||||
@@ -901,7 +901,7 @@ void wxDC::EndPage()
|
|||||||
// text metrics
|
// text metrics
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
long wxDC::GetCharHeight() const
|
wxCoord wxDC::GetCharHeight() const
|
||||||
{
|
{
|
||||||
TEXTMETRIC lpTextMetric;
|
TEXTMETRIC lpTextMetric;
|
||||||
|
|
||||||
@@ -910,7 +910,7 @@ long wxDC::GetCharHeight() const
|
|||||||
return YDEV2LOGREL(lpTextMetric.tmHeight);
|
return YDEV2LOGREL(lpTextMetric.tmHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::GetCharWidth() const
|
wxCoord wxDC::GetCharWidth() const
|
||||||
{
|
{
|
||||||
TEXTMETRIC lpTextMetric;
|
TEXTMETRIC lpTextMetric;
|
||||||
|
|
||||||
@@ -919,9 +919,9 @@ long wxDC::GetCharWidth() const
|
|||||||
return XDEV2LOGREL(lpTextMetric.tmAveCharWidth);
|
return XDEV2LOGREL(lpTextMetric.tmAveCharWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::GetTextExtent(const wxString& string, long *x, long *y,
|
void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
||||||
long *descent, long *externalLeading,
|
wxCoord *descent, wxCoord *externalLeading,
|
||||||
wxFont *theFont) const
|
wxFont *theFont) const
|
||||||
{
|
{
|
||||||
wxFont *fontToUse = (wxFont*) theFont;
|
wxFont *fontToUse = (wxFont*) theFont;
|
||||||
if (!fontToUse)
|
if (!fontToUse)
|
||||||
@@ -1031,7 +1031,7 @@ void wxDC::SetSystemScale(double x, double y)
|
|||||||
SetMapMode(m_mappingMode);
|
SetMapMode(m_mappingMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetLogicalOrigin(long x, long y)
|
void wxDC::SetLogicalOrigin(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
m_logicalOriginX = x;
|
m_logicalOriginX = x;
|
||||||
m_logicalOriginY = y;
|
m_logicalOriginY = y;
|
||||||
@@ -1039,7 +1039,7 @@ void wxDC::SetLogicalOrigin(long x, long y)
|
|||||||
::SetWindowOrgEx(GetHdc(), (int)m_logicalOriginX, (int)m_logicalOriginY, NULL);
|
::SetWindowOrgEx(GetHdc(), (int)m_logicalOriginX, (int)m_logicalOriginY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::SetDeviceOrigin(long x, long y)
|
void wxDC::SetDeviceOrigin(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
m_deviceOriginX = x;
|
m_deviceOriginX = x;
|
||||||
m_deviceOriginY = y;
|
m_deviceOriginY = y;
|
||||||
@@ -1051,56 +1051,56 @@ void wxDC::SetDeviceOrigin(long x, long y)
|
|||||||
// coordinates transformations
|
// coordinates transformations
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalX(long x) const
|
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||||
{
|
{
|
||||||
return (long) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX) - m_logicalOriginX);
|
return (wxCoord) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX) - m_logicalOriginX);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalXRel(long x) const
|
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
return (long) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX));
|
return (wxCoord) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX));
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalY(long y) const
|
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||||
{
|
{
|
||||||
return (long) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY) - m_logicalOriginY);
|
return (wxCoord) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY) - m_logicalOriginY);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::DeviceToLogicalYRel(long y) const
|
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
return (long) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY));
|
return (wxCoord) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY));
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceX(long x) const
|
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||||
{
|
{
|
||||||
return (long) ((x - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX + m_deviceOriginX);
|
return (wxCoord) ((x - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX + m_deviceOriginX);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceXRel(long x) const
|
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||||
{
|
{
|
||||||
return (long) (x*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX);
|
return (wxCoord) (x*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceY(long y) const
|
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||||
{
|
{
|
||||||
return (long) ((y - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY + m_deviceOriginY);
|
return (wxCoord) ((y - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY + m_deviceOriginY);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDCBase::LogicalToDeviceYRel(long y) const
|
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||||
{
|
{
|
||||||
return (long) (y*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY);
|
return (wxCoord) (y*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// bit blit
|
// bit blit
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
bool wxDC::DoBlit(long xdest, long ydest, long width, long height,
|
bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||||
wxDC *source, long xsrc, long ysrc, int rop, bool useMask)
|
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop, bool useMask)
|
||||||
{
|
{
|
||||||
long xdest1 = xdest;
|
wxCoord xdest1 = xdest;
|
||||||
long ydest1 = ydest;
|
wxCoord ydest1 = ydest;
|
||||||
long xsrc1 = xsrc;
|
wxCoord xsrc1 = xsrc;
|
||||||
long ysrc1 = ysrc;
|
wxCoord ysrc1 = ysrc;
|
||||||
|
|
||||||
// Chris Breeze 18/5/98: use text foreground/background colours
|
// Chris Breeze 18/5/98: use text foreground/background colours
|
||||||
// when blitting from 1-bit bitmaps
|
// when blitting from 1-bit bitmaps
|
||||||
@@ -1295,7 +1295,7 @@ void wxDC::DoGetTextExtent(const wxString& string, float *x, float *y,
|
|||||||
float *descent, float *externalLeading,
|
float *descent, float *externalLeading,
|
||||||
wxFont *theFont, bool use16bit) const
|
wxFont *theFont, bool use16bit) const
|
||||||
{
|
{
|
||||||
long x1, y1, descent1, externalLeading1;
|
wxCoord x1, y1, descent1, externalLeading1;
|
||||||
GetTextExtent(string, & x1, & y1, & descent1, & externalLeading1, theFont, use16bit);
|
GetTextExtent(string, & x1, & y1, & descent1, & externalLeading1, theFont, use16bit);
|
||||||
*x = x1; *y = y1;
|
*x = x1; *y = y1;
|
||||||
if (descent)
|
if (descent)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 22:30, 1999/10/16
|
# This file was automatically generated by tmake at 15:50, 1999/10/18
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -109,6 +109,7 @@ GENERICOBJS= $(MSWDIR)\busyinfo.obj \
|
|||||||
|
|
||||||
COMMONOBJS = \
|
COMMONOBJS = \
|
||||||
$(MSWDIR)\y_tab.obj \
|
$(MSWDIR)\y_tab.obj \
|
||||||
|
$(MSWDIR)\appcmn.obj \
|
||||||
$(MSWDIR)\choiccmn.obj \
|
$(MSWDIR)\choiccmn.obj \
|
||||||
$(MSWDIR)\cmndata.obj \
|
$(MSWDIR)\cmndata.obj \
|
||||||
$(MSWDIR)\config.obj \
|
$(MSWDIR)\config.obj \
|
||||||
@@ -525,6 +526,8 @@ $(MSWDIR)\xpmhand.obj: $(MSWDIR)\xpmhand.$(SRCSUFF)
|
|||||||
########################################################
|
########################################################
|
||||||
# Common objects (always compiled)
|
# Common objects (always compiled)
|
||||||
|
|
||||||
|
$(MSWDIR)\appcmn.obj: $(COMMDIR)\appcmn.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\choiccmn.obj: $(COMMDIR)\choiccmn.$(SRCSUFF)
|
$(MSWDIR)\choiccmn.obj: $(COMMDIR)\choiccmn.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\cmndata.obj: $(COMMDIR)\cmndata.$(SRCSUFF)
|
$(MSWDIR)\cmndata.obj: $(COMMDIR)\cmndata.$(SRCSUFF)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 22:30, 1999/10/16
|
# This file was automatically generated by tmake at 15:50, 1999/10/18
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -100,6 +100,7 @@ GENERICOBJS= $(MSWDIR)\busyinfo.obj \
|
|||||||
|
|
||||||
COMMONOBJS = \
|
COMMONOBJS = \
|
||||||
$(MSWDIR)\y_tab.obj \
|
$(MSWDIR)\y_tab.obj \
|
||||||
|
$(MSWDIR)\appcmn.obj \
|
||||||
$(MSWDIR)\choiccmn.obj \
|
$(MSWDIR)\choiccmn.obj \
|
||||||
$(MSWDIR)\cmndata.obj \
|
$(MSWDIR)\cmndata.obj \
|
||||||
$(MSWDIR)\config.obj \
|
$(MSWDIR)\config.obj \
|
||||||
@@ -433,6 +434,8 @@ $(MSWDIR)\xpmhand.obj: $(MSWDIR)\xpmhand.$(SRCSUFF)
|
|||||||
########################################################
|
########################################################
|
||||||
# Common objects (always compiled)
|
# Common objects (always compiled)
|
||||||
|
|
||||||
|
$(MSWDIR)\appcmn.obj: $(COMMDIR)\appcmn.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\choiccmn.obj: $(COMMDIR)\choiccmn.$(SRCSUFF)
|
$(MSWDIR)\choiccmn.obj: $(COMMDIR)\choiccmn.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\cmndata.obj: $(COMMDIR)\cmndata.$(SRCSUFF)
|
$(MSWDIR)\cmndata.obj: $(COMMDIR)\cmndata.$(SRCSUFF)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 22:30, 1999/10/16
|
# This file was automatically generated by tmake at 15:50, 1999/10/18
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -87,6 +87,7 @@ GENERICOBJS= $(GENDIR)\busyinfo.obj \
|
|||||||
|
|
||||||
COMMONOBJS = \
|
COMMONOBJS = \
|
||||||
$(COMMDIR)\y_tab.obj \
|
$(COMMDIR)\y_tab.obj \
|
||||||
|
$(COMMDIR)\appcmn.obj \
|
||||||
$(COMMDIR)\choiccmn.obj \
|
$(COMMDIR)\choiccmn.obj \
|
||||||
$(COMMDIR)\cmndata.obj \
|
$(COMMDIR)\cmndata.obj \
|
||||||
$(COMMDIR)\config.obj \
|
$(COMMDIR)\config.obj \
|
||||||
@@ -677,6 +678,11 @@ $(MSWDIR)/xpmhand.obj: $*.$(SRCSUFF)
|
|||||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
<<
|
<<
|
||||||
|
|
||||||
|
$(COMMDIR)/appcmn.obj: $*.$(SRCSUFF)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
$(COMMDIR)/choiccmn.obj: $*.$(SRCSUFF)
|
$(COMMDIR)/choiccmn.obj: $*.$(SRCSUFF)
|
||||||
cl @<<
|
cl @<<
|
||||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
# This file was automatically generated by tmake at 22:30, 1999/10/16
|
# This file was automatically generated by tmake at 15:50, 1999/10/18
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -60,6 +60,7 @@ GENERICOBJS = \
|
|||||||
|
|
||||||
COMMONOBJS = \
|
COMMONOBJS = \
|
||||||
$(COMMDIR)/y_tab.$(OBJSUFF) \
|
$(COMMDIR)/y_tab.$(OBJSUFF) \
|
||||||
|
$(COMMDIR)/appcmn.$(OBJSUFF) \
|
||||||
$(COMMDIR)/choiccmn.$(OBJSUFF) \
|
$(COMMDIR)/choiccmn.$(OBJSUFF) \
|
||||||
$(COMMDIR)/cmndata.$(OBJSUFF) \
|
$(COMMDIR)/cmndata.$(OBJSUFF) \
|
||||||
$(COMMDIR)/config.$(OBJSUFF) \
|
$(COMMDIR)/config.$(OBJSUFF) \
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 22:30, 1999/10/16
|
# This file was automatically generated by tmake at 15:50, 1999/10/18
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T!
|
||||||
|
|
||||||
# Symantec C++ makefile for the msw objects
|
# Symantec C++ makefile for the msw objects
|
||||||
@@ -48,6 +48,7 @@ GENERICOBJS= $(GENDIR)\busyinfo.obj \
|
|||||||
|
|
||||||
COMMONOBJS = \
|
COMMONOBJS = \
|
||||||
$(COMMDIR)\y_tab.obj \
|
$(COMMDIR)\y_tab.obj \
|
||||||
|
$(COMMDIR)\appcmn.obj \
|
||||||
$(COMMDIR)\choiccmn.obj \
|
$(COMMDIR)\choiccmn.obj \
|
||||||
$(COMMDIR)\cmndata.obj \
|
$(COMMDIR)\cmndata.obj \
|
||||||
$(COMMDIR)\config.obj \
|
$(COMMDIR)\config.obj \
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# This file was automatically generated by tmake at 22:30, 1999/10/16
|
# This file was automatically generated by tmake at 15:50, 1999/10/18
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T!
|
||||||
|
|
||||||
# File: makefile.vc
|
# File: makefile.vc
|
||||||
@@ -125,6 +125,7 @@ NONESSENTIALOBJS= ..\generic\$D\caret.obj \
|
|||||||
|
|
||||||
COMMONOBJS = \
|
COMMONOBJS = \
|
||||||
..\common\$D\y_tab.obj \
|
..\common\$D\y_tab.obj \
|
||||||
|
..\common\$D\appcmn.obj \
|
||||||
..\common\$D\choiccmn.obj \
|
..\common\$D\choiccmn.obj \
|
||||||
..\common\$D\cmndata.obj \
|
..\common\$D\cmndata.obj \
|
||||||
..\common\$D\config.obj \
|
..\common\$D\config.obj \
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 22:30, 1999/10/16
|
# This file was automatically generated by tmake at 15:50, 1999/10/18
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
|
||||||
|
|
||||||
#!/binb/wmake.exe
|
#!/binb/wmake.exe
|
||||||
@@ -74,6 +74,7 @@ NONESSENTIALOBJS= caret.obj &
|
|||||||
|
|
||||||
COMMONOBJS = &
|
COMMONOBJS = &
|
||||||
y_tab.obj &
|
y_tab.obj &
|
||||||
|
appcmn.obj &
|
||||||
choiccmn.obj &
|
choiccmn.obj &
|
||||||
cmndata.obj &
|
cmndata.obj &
|
||||||
config.obj &
|
config.obj &
|
||||||
@@ -556,6 +557,9 @@ xpmhand.obj: $(MSWDIR)\xpmhand.cpp
|
|||||||
########################################################
|
########################################################
|
||||||
# Common objects (always compiled)
|
# Common objects (always compiled)
|
||||||
|
|
||||||
|
appcmn.obj: $(COMMDIR)\appcmn.cpp
|
||||||
|
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||||
|
|
||||||
choiccmn.obj: $(COMMDIR)\choiccmn.cpp
|
choiccmn.obj: $(COMMDIR)\choiccmn.cpp
|
||||||
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user