remove default wxDC ctor to make it impossible to construct DCs without the associated wxDCImpl (this breaks compilation of classes such as wxMirrorDC instead of crashing at run-time); fixed wxMirrorDC compilation after breaking it; renamed wxDCFactory::GetFactory() to just Get(), no need to be repetitive
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
154
include/wx/dc.h
154
include/wx/dc.h
@@ -114,7 +114,7 @@ class WXDLLIMPEXP_CORE wxDCFactory
|
|||||||
public:
|
public:
|
||||||
wxDCFactory() {}
|
wxDCFactory() {}
|
||||||
virtual ~wxDCFactory() {}
|
virtual ~wxDCFactory() {}
|
||||||
|
|
||||||
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner ) = 0;
|
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner ) = 0;
|
||||||
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner, wxWindow *window ) = 0;
|
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner, wxWindow *window ) = 0;
|
||||||
virtual wxDCImpl* CreateClientDC( wxClientDC *owner ) = 0;
|
virtual wxDCImpl* CreateClientDC( wxClientDC *owner ) = 0;
|
||||||
@@ -128,9 +128,10 @@ public:
|
|||||||
#if wxUSE_PRINTING_ARCHITECTURE
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
virtual wxDCImpl* CreatePrinterDC( wxPrinterDC *owner, const wxPrintData &data ) = 0;
|
virtual wxDCImpl* CreatePrinterDC( wxPrinterDC *owner, const wxPrintData &data ) = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void SetDCFactory( wxDCFactory *factory );
|
static void SetDCFactory( wxDCFactory *factory );
|
||||||
static wxDCFactory *GetFactory();
|
static wxDCFactory *Get();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static wxDCFactory *m_factory;
|
static wxDCFactory *m_factory;
|
||||||
};
|
};
|
||||||
@@ -143,7 +144,7 @@ class WXDLLIMPEXP_CORE wxNativeDCFactory: public wxDCFactory
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxNativeDCFactory() {}
|
wxNativeDCFactory() {}
|
||||||
|
|
||||||
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner );
|
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner );
|
||||||
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner, wxWindow *window );
|
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner, wxWindow *window );
|
||||||
virtual wxDCImpl* CreateClientDC( wxClientDC *owner );
|
virtual wxDCImpl* CreateClientDC( wxClientDC *owner );
|
||||||
@@ -168,11 +169,11 @@ class WXDLLIMPEXP_CORE wxDCImpl: public wxObject
|
|||||||
public:
|
public:
|
||||||
wxDCImpl( wxDC *owner );
|
wxDCImpl( wxDC *owner );
|
||||||
~wxDCImpl();
|
~wxDCImpl();
|
||||||
|
|
||||||
wxDC *GetOwner() const { return m_owner; }
|
wxDC *GetOwner() const { return m_owner; }
|
||||||
|
|
||||||
wxWindow* GetWindow() const { return m_window; }
|
wxWindow* GetWindow() const { return m_window; }
|
||||||
|
|
||||||
virtual bool IsOk() const { return m_ok; }
|
virtual bool IsOk() const { return m_ok; }
|
||||||
|
|
||||||
// query capabilities
|
// query capabilities
|
||||||
@@ -184,17 +185,17 @@ public:
|
|||||||
|
|
||||||
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 int GetDepth() const = 0;
|
virtual int GetDepth() const = 0;
|
||||||
virtual wxSize GetPPI() const = 0;
|
virtual wxSize GetPPI() const = 0;
|
||||||
|
|
||||||
// Right-To-Left (RTL) modes
|
// Right-To-Left (RTL) modes
|
||||||
|
|
||||||
virtual void SetLayoutDirection(wxLayoutDirection WXUNUSED(dir)) { }
|
virtual void SetLayoutDirection(wxLayoutDirection WXUNUSED(dir)) { }
|
||||||
virtual wxLayoutDirection GetLayoutDirection() const { return wxLayout_Default; }
|
virtual wxLayoutDirection GetLayoutDirection() const { return wxLayout_Default; }
|
||||||
|
|
||||||
// page and document
|
// page and document
|
||||||
|
|
||||||
virtual bool StartDoc(const wxString& WXUNUSED(message)) { return true; }
|
virtual bool StartDoc(const wxString& WXUNUSED(message)) { return true; }
|
||||||
virtual void EndDoc() { }
|
virtual void EndDoc() { }
|
||||||
|
|
||||||
@@ -236,28 +237,28 @@ public:
|
|||||||
wxCoord MaxX() const { return m_maxX; }
|
wxCoord MaxX() const { return m_maxX; }
|
||||||
wxCoord MinY() const { return m_minY; }
|
wxCoord MinY() const { return m_minY; }
|
||||||
wxCoord MaxY() const { return m_maxY; }
|
wxCoord MaxY() const { return m_maxY; }
|
||||||
|
|
||||||
// setters and getters
|
// setters and getters
|
||||||
|
|
||||||
virtual void SetFont(const wxFont& font) = 0;
|
virtual void SetFont(const wxFont& font) = 0;
|
||||||
virtual const wxFont& GetFont() const { return m_font; }
|
virtual const wxFont& GetFont() const { return m_font; }
|
||||||
|
|
||||||
virtual void SetPen(const wxPen& pen) = 0;
|
virtual void SetPen(const wxPen& pen) = 0;
|
||||||
virtual const wxPen& GetPen() const { return m_pen; }
|
virtual const wxPen& GetPen() const { return m_pen; }
|
||||||
|
|
||||||
virtual void SetBrush(const wxBrush& brush) = 0;
|
virtual void SetBrush(const wxBrush& brush) = 0;
|
||||||
virtual const wxBrush& GetBrush() const { return m_brush; }
|
virtual const wxBrush& GetBrush() const { return m_brush; }
|
||||||
|
|
||||||
virtual void SetBackground(const wxBrush& brush) = 0;
|
virtual void SetBackground(const wxBrush& brush) = 0;
|
||||||
virtual const wxBrush& GetBackground() const { return m_backgroundBrush; }
|
virtual const wxBrush& GetBackground() const { return m_backgroundBrush; }
|
||||||
|
|
||||||
virtual void SetBackgroundMode(int mode) = 0;
|
virtual void SetBackgroundMode(int mode) = 0;
|
||||||
virtual int GetBackgroundMode() const { return m_backgroundMode; }
|
virtual int GetBackgroundMode() const { return m_backgroundMode; }
|
||||||
|
|
||||||
virtual void SetTextForeground(const wxColour& colour)
|
virtual void SetTextForeground(const wxColour& colour)
|
||||||
{ m_textForegroundColour = colour; }
|
{ m_textForegroundColour = colour; }
|
||||||
virtual const wxColour& GetTextForeground() const { return m_textForegroundColour; }
|
virtual const wxColour& GetTextForeground() const { return m_textForegroundColour; }
|
||||||
|
|
||||||
virtual void SetTextBackground(const wxColour& colour)
|
virtual void SetTextBackground(const wxColour& colour)
|
||||||
{ m_textBackgroundColour = colour; }
|
{ m_textBackgroundColour = colour; }
|
||||||
virtual const wxColour& GetTextBackground() const { return m_textBackgroundColour; }
|
virtual const wxColour& GetTextBackground() const { return m_textBackgroundColour; }
|
||||||
@@ -267,7 +268,7 @@ public:
|
|||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
// logical functions
|
// logical functions
|
||||||
|
|
||||||
virtual void SetLogicalFunction(int function) = 0;
|
virtual void SetLogicalFunction(int function) = 0;
|
||||||
virtual int GetLogicalFunction() const { return m_logicalFunction; }
|
virtual int GetLogicalFunction() const { return m_logicalFunction; }
|
||||||
|
|
||||||
@@ -286,9 +287,9 @@ public:
|
|||||||
wxCoord *heightLine = NULL,
|
wxCoord *heightLine = NULL,
|
||||||
const wxFont *font = NULL) const;
|
const wxFont *font = NULL) const;
|
||||||
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const;
|
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const;
|
||||||
|
|
||||||
// clearing
|
// clearing
|
||||||
|
|
||||||
virtual void Clear() = 0;
|
virtual void Clear() = 0;
|
||||||
|
|
||||||
// clipping
|
// clipping
|
||||||
@@ -354,7 +355,7 @@ public:
|
|||||||
if ( x ) *x = m_deviceOriginX;
|
if ( x ) *x = m_deviceOriginX;
|
||||||
if ( y ) *y = m_deviceOriginY;
|
if ( y ) *y = m_deviceOriginY;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetDeviceLocalOrigin( wxCoord x, wxCoord y );
|
virtual void SetDeviceLocalOrigin( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
virtual void ComputeScaleAndOrigin();
|
virtual void ComputeScaleAndOrigin();
|
||||||
@@ -435,7 +436,7 @@ public:
|
|||||||
wxCoord xoffset, wxCoord yoffset ) = 0;
|
wxCoord xoffset, wxCoord yoffset ) = 0;
|
||||||
virtual void DrawLines(const wxPointList *list,
|
virtual void DrawLines(const wxPointList *list,
|
||||||
wxCoord xoffset, wxCoord yoffset );
|
wxCoord xoffset, wxCoord yoffset );
|
||||||
|
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
int fillStyle = wxODDEVEN_RULE) = 0;
|
int fillStyle = wxODDEVEN_RULE) = 0;
|
||||||
@@ -452,31 +453,31 @@ public:
|
|||||||
virtual void DoDrawSpline(int n, wxPoint points[]);
|
virtual void DoDrawSpline(int n, wxPoint points[]);
|
||||||
virtual void DoDrawSpline(const wxPointList *points);
|
virtual void DoDrawSpline(const wxPointList *points);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// wxMemoryDC Impl API
|
// wxMemoryDC Impl API
|
||||||
|
|
||||||
virtual void DoSelect(const wxBitmap& WXUNUSED(bmp))
|
virtual void DoSelect(const wxBitmap& WXUNUSED(bmp))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
virtual const wxBitmap& GetSelectedBitmap() const
|
virtual const wxBitmap& GetSelectedBitmap() const
|
||||||
{ return wxNullBitmap; }
|
{ return wxNullBitmap; }
|
||||||
virtual wxBitmap& GetSelectedBitmap()
|
virtual wxBitmap& GetSelectedBitmap()
|
||||||
{ return wxNullBitmap; }
|
{ return wxNullBitmap; }
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// wxPrinterDC Impl API
|
// wxPrinterDC Impl API
|
||||||
|
|
||||||
virtual wxRect GetPaperRect()
|
virtual wxRect GetPaperRect()
|
||||||
{ int w = 0; int h = 0; DoGetSize( &w, &h ); return wxRect(0,0,w,h); }
|
{ int w = 0; int h = 0; DoGetSize( &w, &h ); return wxRect(0,0,w,h); }
|
||||||
|
|
||||||
virtual int GetResolution()
|
virtual int GetResolution()
|
||||||
{ return -1; }
|
{ return -1; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxDC *m_owner;
|
wxDC *m_owner;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// unset clipping variables (after clipping region was destroyed)
|
// unset clipping variables (after clipping region was destroyed)
|
||||||
void ResetClipping()
|
void ResetClipping()
|
||||||
{
|
{
|
||||||
@@ -487,7 +488,7 @@ protected:
|
|||||||
|
|
||||||
// window on which the DC draws or NULL
|
// window on which the DC draws or NULL
|
||||||
wxWindow *m_window;
|
wxWindow *m_window;
|
||||||
|
|
||||||
// flags
|
// flags
|
||||||
bool m_colour:1;
|
bool m_colour:1;
|
||||||
bool m_ok:1;
|
bool m_ok:1;
|
||||||
@@ -499,7 +500,7 @@ protected:
|
|||||||
|
|
||||||
wxCoord m_logicalOriginX, m_logicalOriginY;
|
wxCoord m_logicalOriginX, m_logicalOriginY;
|
||||||
wxCoord m_deviceOriginX, m_deviceOriginY; // Usually 0,0, can be change by user
|
wxCoord m_deviceOriginX, m_deviceOriginY; // Usually 0,0, can be change by user
|
||||||
|
|
||||||
wxCoord m_deviceLocalOriginX, m_deviceLocalOriginY; // non-zero if native top-left corner
|
wxCoord m_deviceLocalOriginX, m_deviceLocalOriginY; // non-zero if native top-left corner
|
||||||
// is not at 0,0. This was the case under
|
// is not at 0,0. This was the case under
|
||||||
// Mac's GrafPorts (coordinate system
|
// Mac's GrafPorts (coordinate system
|
||||||
@@ -511,11 +512,11 @@ protected:
|
|||||||
double m_scaleX, m_scaleY; // calculated from logical scale and user scale
|
double m_scaleX, m_scaleY; // calculated from logical scale and user scale
|
||||||
|
|
||||||
int m_signX, m_signY; // Used by SetAxisOrientation() to invert the axes
|
int m_signX, m_signY; // Used by SetAxisOrientation() to invert the axes
|
||||||
|
|
||||||
// what is a mm on a screen you don't know the size of?
|
// what is a mm on a screen you don't know the size of?
|
||||||
double m_mm_to_pix_x,
|
double m_mm_to_pix_x,
|
||||||
m_mm_to_pix_y;
|
m_mm_to_pix_y;
|
||||||
|
|
||||||
// bounding and clipping boxes
|
// bounding and clipping boxes
|
||||||
wxCoord m_minX, m_minY, m_maxX, m_maxY;
|
wxCoord m_minX, m_minY, m_maxX, m_maxY;
|
||||||
wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2;
|
wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2;
|
||||||
@@ -541,11 +542,10 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxDC: public wxObject
|
class WXDLLIMPEXP_CORE wxDC : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDC() { m_pimpl = NULL; }
|
virtual ~wxDC() { delete m_pimpl; }
|
||||||
~wxDC() { if (m_pimpl) delete m_pimpl; }
|
|
||||||
|
|
||||||
wxDCImpl *GetImpl()
|
wxDCImpl *GetImpl()
|
||||||
{ return m_pimpl; }
|
{ return m_pimpl; }
|
||||||
@@ -555,21 +555,21 @@ public:
|
|||||||
wxWindow *GetWindow()
|
wxWindow *GetWindow()
|
||||||
{ return m_pimpl->GetWindow(); }
|
{ return m_pimpl->GetWindow(); }
|
||||||
|
|
||||||
bool IsOk() const
|
bool IsOk() const
|
||||||
{ return m_pimpl && m_pimpl->IsOk(); }
|
{ return m_pimpl && m_pimpl->IsOk(); }
|
||||||
|
|
||||||
// query capabilities
|
// query capabilities
|
||||||
|
|
||||||
bool CanDrawBitmap() const
|
bool CanDrawBitmap() const
|
||||||
{ return m_pimpl->CanDrawBitmap(); }
|
{ return m_pimpl->CanDrawBitmap(); }
|
||||||
bool CanGetTextExtent() const
|
bool CanGetTextExtent() const
|
||||||
{ return m_pimpl->CanGetTextExtent(); }
|
{ return m_pimpl->CanGetTextExtent(); }
|
||||||
|
|
||||||
// query dimension, colour deps, resolution
|
// query dimension, colour deps, resolution
|
||||||
|
|
||||||
void GetSize(int *width, int *height) const
|
void GetSize(int *width, int *height) const
|
||||||
{ m_pimpl->DoGetSize(width, height); }
|
{ m_pimpl->DoGetSize(width, height); }
|
||||||
|
|
||||||
wxSize GetSize() const
|
wxSize GetSize() const
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
@@ -585,7 +585,7 @@ public:
|
|||||||
m_pimpl->DoGetSizeMM(&w, &h);
|
m_pimpl->DoGetSizeMM(&w, &h);
|
||||||
return wxSize(w, h);
|
return wxSize(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetDepth() const
|
int GetDepth() const
|
||||||
{ return m_pimpl->GetDepth(); }
|
{ return m_pimpl->GetDepth(); }
|
||||||
wxSize GetPPI() const
|
wxSize GetPPI() const
|
||||||
@@ -593,16 +593,16 @@ public:
|
|||||||
|
|
||||||
virtual int GetResolution()
|
virtual int GetResolution()
|
||||||
{ return m_pimpl->GetResolution(); }
|
{ return m_pimpl->GetResolution(); }
|
||||||
|
|
||||||
// Right-To-Left (RTL) modes
|
// Right-To-Left (RTL) modes
|
||||||
|
|
||||||
void SetLayoutDirection(wxLayoutDirection dir)
|
void SetLayoutDirection(wxLayoutDirection dir)
|
||||||
{ m_pimpl->SetLayoutDirection( dir ); }
|
{ m_pimpl->SetLayoutDirection( dir ); }
|
||||||
wxLayoutDirection GetLayoutDirection() const
|
wxLayoutDirection GetLayoutDirection() const
|
||||||
{ return m_pimpl->GetLayoutDirection(); }
|
{ return m_pimpl->GetLayoutDirection(); }
|
||||||
|
|
||||||
// page and document
|
// page and document
|
||||||
|
|
||||||
bool StartDoc(const wxString& message)
|
bool StartDoc(const wxString& message)
|
||||||
{ return m_pimpl->StartDoc(message); }
|
{ return m_pimpl->StartDoc(message); }
|
||||||
void EndDoc()
|
void EndDoc()
|
||||||
@@ -614,12 +614,12 @@ public:
|
|||||||
{ m_pimpl->EndPage(); }
|
{ m_pimpl->EndPage(); }
|
||||||
|
|
||||||
// bounding box
|
// bounding box
|
||||||
|
|
||||||
void CalcBoundingBox(wxCoord x, wxCoord y)
|
void CalcBoundingBox(wxCoord x, wxCoord y)
|
||||||
{ m_pimpl->CalcBoundingBox(x,y); }
|
{ m_pimpl->CalcBoundingBox(x,y); }
|
||||||
void ResetBoundingBox()
|
void ResetBoundingBox()
|
||||||
{ m_pimpl->ResetBoundingBox(); }
|
{ m_pimpl->ResetBoundingBox(); }
|
||||||
|
|
||||||
wxCoord MinX() const
|
wxCoord MinX() const
|
||||||
{ return m_pimpl->MinX(); }
|
{ return m_pimpl->MinX(); }
|
||||||
wxCoord MaxX() const
|
wxCoord MaxX() const
|
||||||
@@ -628,29 +628,29 @@ public:
|
|||||||
{ return m_pimpl->MinY(); }
|
{ return m_pimpl->MinY(); }
|
||||||
wxCoord MaxY() const
|
wxCoord MaxY() const
|
||||||
{ return m_pimpl->MaxY(); }
|
{ return m_pimpl->MaxY(); }
|
||||||
|
|
||||||
// setters and getters
|
// setters and getters
|
||||||
|
|
||||||
void SetFont(const wxFont& font)
|
void SetFont(const wxFont& font)
|
||||||
{ m_pimpl->SetFont( font ); }
|
{ m_pimpl->SetFont( font ); }
|
||||||
const wxFont& GetFont() const
|
const wxFont& GetFont() const
|
||||||
{ return m_pimpl->GetFont(); }
|
{ return m_pimpl->GetFont(); }
|
||||||
|
|
||||||
void SetPen(const wxPen& pen)
|
void SetPen(const wxPen& pen)
|
||||||
{ m_pimpl->SetPen( pen ); }
|
{ m_pimpl->SetPen( pen ); }
|
||||||
const wxPen& GetPen() const
|
const wxPen& GetPen() const
|
||||||
{ return m_pimpl->GetPen(); }
|
{ return m_pimpl->GetPen(); }
|
||||||
|
|
||||||
void SetBrush(const wxBrush& brush)
|
void SetBrush(const wxBrush& brush)
|
||||||
{ m_pimpl->SetBrush( brush ); }
|
{ m_pimpl->SetBrush( brush ); }
|
||||||
const wxBrush& GetBrush() const
|
const wxBrush& GetBrush() const
|
||||||
{ return m_pimpl->GetBrush(); }
|
{ return m_pimpl->GetBrush(); }
|
||||||
|
|
||||||
void SetBackground(const wxBrush& brush)
|
void SetBackground(const wxBrush& brush)
|
||||||
{ m_pimpl->SetBackground( brush ); }
|
{ m_pimpl->SetBackground( brush ); }
|
||||||
const wxBrush& GetBackground() const
|
const wxBrush& GetBackground() const
|
||||||
{ return m_pimpl->GetBackground(); }
|
{ return m_pimpl->GetBackground(); }
|
||||||
|
|
||||||
void SetBackgroundMode(int mode)
|
void SetBackgroundMode(int mode)
|
||||||
{ m_pimpl->SetBackgroundMode( mode ); }
|
{ m_pimpl->SetBackgroundMode( mode ); }
|
||||||
int GetBackgroundMode() const
|
int GetBackgroundMode() const
|
||||||
@@ -660,31 +660,31 @@ public:
|
|||||||
{ m_pimpl->SetTextForeground(colour); }
|
{ m_pimpl->SetTextForeground(colour); }
|
||||||
const wxColour& GetTextForeground() const
|
const wxColour& GetTextForeground() const
|
||||||
{ return m_pimpl->GetTextForeground(); }
|
{ return m_pimpl->GetTextForeground(); }
|
||||||
|
|
||||||
void SetTextBackground(const wxColour& colour)
|
void SetTextBackground(const wxColour& colour)
|
||||||
{ m_pimpl->SetTextBackground(colour); }
|
{ m_pimpl->SetTextBackground(colour); }
|
||||||
const wxColour& GetTextBackground() const
|
const wxColour& GetTextBackground() const
|
||||||
{ return m_pimpl->GetTextBackground(); }
|
{ return m_pimpl->GetTextBackground(); }
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
void SetPalette(const wxPalette& palette)
|
void SetPalette(const wxPalette& palette)
|
||||||
{ m_pimpl->SetPalette(palette); }
|
{ m_pimpl->SetPalette(palette); }
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
// logical functions
|
// logical functions
|
||||||
|
|
||||||
void SetLogicalFunction(int function)
|
void SetLogicalFunction(int function)
|
||||||
{ m_pimpl->SetLogicalFunction(function); }
|
{ m_pimpl->SetLogicalFunction(function); }
|
||||||
int GetLogicalFunction() const
|
int GetLogicalFunction() const
|
||||||
{ return m_pimpl->GetLogicalFunction(); }
|
{ return m_pimpl->GetLogicalFunction(); }
|
||||||
|
|
||||||
// text measurement
|
// text measurement
|
||||||
|
|
||||||
wxCoord GetCharHeight() const
|
wxCoord GetCharHeight() const
|
||||||
{ return m_pimpl->GetCharHeight(); }
|
{ return m_pimpl->GetCharHeight(); }
|
||||||
wxCoord GetCharWidth() const
|
wxCoord GetCharWidth() const
|
||||||
{ return m_pimpl->GetCharWidth(); }
|
{ return m_pimpl->GetCharWidth(); }
|
||||||
|
|
||||||
void GetTextExtent(const wxString& string,
|
void GetTextExtent(const wxString& string,
|
||||||
wxCoord *x, wxCoord *y,
|
wxCoord *x, wxCoord *y,
|
||||||
wxCoord *descent = NULL,
|
wxCoord *descent = NULL,
|
||||||
@@ -698,26 +698,26 @@ public:
|
|||||||
m_pimpl->DoGetTextExtent(string, &w, &h);
|
m_pimpl->DoGetTextExtent(string, &w, &h);
|
||||||
return wxSize(w, h);
|
return wxSize(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetMultiLineTextExtent(const wxString& string,
|
void GetMultiLineTextExtent(const wxString& string,
|
||||||
wxCoord *width,
|
wxCoord *width,
|
||||||
wxCoord *height,
|
wxCoord *height,
|
||||||
wxCoord *heightLine = NULL,
|
wxCoord *heightLine = NULL,
|
||||||
const wxFont *font = NULL) const
|
const wxFont *font = NULL) const
|
||||||
{ m_pimpl->GetMultiLineTextExtent( string, width, height, heightLine, font ); }
|
{ m_pimpl->GetMultiLineTextExtent( string, width, height, heightLine, font ); }
|
||||||
|
|
||||||
wxSize GetMultiLineTextExtent(const wxString& string) const
|
wxSize GetMultiLineTextExtent(const wxString& string) const
|
||||||
{
|
{
|
||||||
wxCoord w, h;
|
wxCoord w, h;
|
||||||
m_pimpl->GetMultiLineTextExtent(string, &w, &h);
|
m_pimpl->GetMultiLineTextExtent(string, &w, &h);
|
||||||
return wxSize(w, h);
|
return wxSize(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
|
bool GetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
|
||||||
{ return m_pimpl->DoGetPartialTextExtents(text, widths); }
|
{ return m_pimpl->DoGetPartialTextExtents(text, widths); }
|
||||||
|
|
||||||
// clearing
|
// clearing
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{ m_pimpl->Clear(); }
|
{ m_pimpl->Clear(); }
|
||||||
|
|
||||||
@@ -739,7 +739,7 @@ public:
|
|||||||
{ m_pimpl->DoGetClippingBox(x, y, w, h); }
|
{ m_pimpl->DoGetClippingBox(x, y, w, h); }
|
||||||
void GetClippingBox(wxRect& rect) const
|
void GetClippingBox(wxRect& rect) const
|
||||||
{ m_pimpl->DoGetClippingBox(&rect.x, &rect.y, &rect.width, &rect.height); }
|
{ m_pimpl->DoGetClippingBox(&rect.x, &rect.y, &rect.width, &rect.height); }
|
||||||
|
|
||||||
// coordinates conversions and transforms
|
// coordinates conversions and transforms
|
||||||
|
|
||||||
wxCoord DeviceToLogicalX(wxCoord x) const
|
wxCoord DeviceToLogicalX(wxCoord x) const
|
||||||
@@ -790,8 +790,8 @@ public:
|
|||||||
|
|
||||||
void SetAxisOrientation(bool xLeftRight, bool yBottomUp)
|
void SetAxisOrientation(bool xLeftRight, bool yBottomUp)
|
||||||
{ m_pimpl->SetAxisOrientation(xLeftRight, yBottomUp); }
|
{ m_pimpl->SetAxisOrientation(xLeftRight, yBottomUp); }
|
||||||
|
|
||||||
// mostly internal
|
// mostly internal
|
||||||
void SetDeviceLocalOrigin( wxCoord x, wxCoord y )
|
void SetDeviceLocalOrigin( wxCoord x, wxCoord y )
|
||||||
{ m_pimpl->SetDeviceLocalOrigin( x, y ); }
|
{ m_pimpl->SetDeviceLocalOrigin( x, y ); }
|
||||||
|
|
||||||
@@ -881,7 +881,7 @@ public:
|
|||||||
{ m_pimpl->DoDrawLines(n, points, xoffset, yoffset); }
|
{ m_pimpl->DoDrawLines(n, points, xoffset, yoffset); }
|
||||||
void DrawLines(const wxPointList *list,
|
void DrawLines(const wxPointList *list,
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0)
|
wxCoord xoffset = 0, wxCoord yoffset = 0)
|
||||||
{ m_pimpl->DrawLines( list, xoffset, yoffset ); }
|
{ m_pimpl->DrawLines( list, xoffset, yoffset ); }
|
||||||
#if WXWIN_COMPATIBILITY_2_8
|
#if WXWIN_COMPATIBILITY_2_8
|
||||||
wxDEPRECATED( void DrawLines(const wxList *list,
|
wxDEPRECATED( void DrawLines(const wxList *list,
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0) );
|
wxCoord xoffset = 0, wxCoord yoffset = 0) );
|
||||||
@@ -986,12 +986,12 @@ public:
|
|||||||
source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y);
|
source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StretchBlit(wxCoord dstX, wxCoord dstY,
|
bool StretchBlit(wxCoord dstX, wxCoord dstY,
|
||||||
wxCoord dstWidth, wxCoord dstHeight,
|
wxCoord dstWidth, wxCoord dstHeight,
|
||||||
wxDC *source,
|
wxDC *source,
|
||||||
wxCoord srcX, wxCoord srcY,
|
wxCoord srcX, wxCoord srcY,
|
||||||
wxCoord srcWidth, wxCoord srcHeight,
|
wxCoord srcWidth, wxCoord srcHeight,
|
||||||
int rop = wxCOPY, bool useMask = false,
|
int rop = wxCOPY, bool useMask = false,
|
||||||
wxCoord srcMaskX = wxDefaultCoord, wxCoord srcMaskY = wxDefaultCoord)
|
wxCoord srcMaskX = wxDefaultCoord, wxCoord srcMaskY = wxDefaultCoord)
|
||||||
{
|
{
|
||||||
return m_pimpl->DoStretchBlit(dstX, dstY, dstWidth, dstHeight,
|
return m_pimpl->DoStretchBlit(dstX, dstY, dstWidth, dstHeight,
|
||||||
@@ -1017,7 +1017,7 @@ public:
|
|||||||
{ m_pimpl->DoDrawSpline(x1,y1,x2,y2,x3,y3); }
|
{ m_pimpl->DoDrawSpline(x1,y1,x2,y2,x3,y3); }
|
||||||
void DrawSpline(int n, wxPoint points[])
|
void DrawSpline(int n, wxPoint points[])
|
||||||
{ m_pimpl->DoDrawSpline(n,points); }
|
{ m_pimpl->DoDrawSpline(n,points); }
|
||||||
void DrawSpline(const wxPointList *points)
|
void DrawSpline(const wxPointList *points)
|
||||||
{ m_pimpl->DoDrawSpline(points); }
|
{ m_pimpl->DoDrawSpline(points); }
|
||||||
#endif // wxUSE_SPLINES
|
#endif // wxUSE_SPLINES
|
||||||
|
|
||||||
@@ -1036,10 +1036,14 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxDCImpl *m_pimpl;
|
// ctor takes ownership of the pointer
|
||||||
|
wxDC(wxDCImpl *pimpl) : m_pimpl(pimpl) { }
|
||||||
|
|
||||||
|
wxDCImpl * const m_pimpl;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_ABSTRACT_CLASS(wxDC)
|
DECLARE_ABSTRACT_CLASS(wxDC)
|
||||||
|
DECLARE_NO_COPY_CLASS(wxDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
// Name: wx/dcclient.h
|
// Name: wx/dcclient.h
|
||||||
// Purpose: wxClientDC base header
|
// Purpose: wxClientDC base header
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
|
||||||
// Created:
|
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows Licence
|
// Licence: wxWindows Licence
|
||||||
@@ -21,11 +19,13 @@
|
|||||||
class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
|
class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxWindowDC();
|
wxWindowDC(wxWindow *win);
|
||||||
wxWindowDC( wxWindow *win );
|
|
||||||
|
protected:
|
||||||
|
wxWindowDC(wxDCImpl *impl) : wxDC(impl) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
DECLARE_ABSTRACT_CLASS(wxWindowDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -35,11 +35,13 @@ private:
|
|||||||
class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
|
class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxClientDC();
|
wxClientDC(wxWindow *win);
|
||||||
wxClientDC( wxWindow *win );
|
|
||||||
|
protected:
|
||||||
|
wxClientDC(wxDCImpl *impl) : wxWindowDC(impl) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
DECLARE_ABSTRACT_CLASS(wxClientDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -49,12 +51,13 @@ private:
|
|||||||
class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
|
class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPaintDC();
|
wxPaintDC(wxWindow *win);
|
||||||
wxPaintDC( wxWindow *win );
|
|
||||||
|
protected:
|
||||||
|
wxPaintDC(wxDCImpl *impl) : wxClientDC(impl) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
DECLARE_ABSTRACT_CLASS(wxPaintDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // _WX_DCCLIENT_H_BASE_
|
||||||
// _WX_DCCLIENT_H_BASE_
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
// wxMirrorDC allows to write the same code for horz/vertical layout
|
// wxMirrorDC allows to write the same code for horz/vertical layout
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxMirrorDC : public wxDC
|
class WXDLLEXPORT wxMirrorDCImpl : public wxDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// constructs a mirror DC associated with the given real DC
|
// constructs a mirror DC associated with the given real DC
|
||||||
@@ -26,13 +26,12 @@ public:
|
|||||||
// if mirror parameter is true, all vertical and horizontal coordinates are
|
// if mirror parameter is true, all vertical and horizontal coordinates are
|
||||||
// exchanged, otherwise this class behaves in exactly the same way as a
|
// exchanged, otherwise this class behaves in exactly the same way as a
|
||||||
// plain DC
|
// plain DC
|
||||||
//
|
wxMirrorDCImpl(wxDC *owner, wxDCImpl& dc, bool mirror)
|
||||||
// the cast to wxMirrorDC is a dirty hack done to allow us to call the
|
: wxDCImpl(owner),
|
||||||
// protected methods of wxDCBase directly in our code below, without it it
|
m_dc(dc)
|
||||||
// would be impossible (this is correct from C++ point of view but doesn't
|
{
|
||||||
// make any sense in this particular situation)
|
m_mirror = mirror;
|
||||||
wxMirrorDC(wxDC& dc, bool mirror) : m_dc((wxMirrorDC&)dc)
|
}
|
||||||
{ m_mirror = mirror; }
|
|
||||||
|
|
||||||
// wxDCBase operations
|
// wxDCBase operations
|
||||||
virtual void Clear() { m_dc.Clear(); }
|
virtual void Clear() { m_dc.Clear(); }
|
||||||
@@ -53,8 +52,7 @@ public:
|
|||||||
virtual bool CanGetTextExtent() const { return m_dc.CanGetTextExtent(); }
|
virtual bool CanGetTextExtent() const { return m_dc.CanGetTextExtent(); }
|
||||||
virtual int GetDepth() const { return m_dc.GetDepth(); }
|
virtual int GetDepth() const { return m_dc.GetDepth(); }
|
||||||
virtual wxSize GetPPI() const { return m_dc.GetPPI(); }
|
virtual wxSize GetPPI() const { return m_dc.GetPPI(); }
|
||||||
virtual bool Ok() const { return IsOk(); }
|
virtual bool IsOk() const { return m_dc.IsOk(); }
|
||||||
virtual bool IsOk() const { return m_dc.Ok(); }
|
|
||||||
virtual void SetMapMode(int mode) { m_dc.SetMapMode(mode); }
|
virtual void SetMapMode(int mode) { m_dc.SetMapMode(mode); }
|
||||||
virtual void SetUserScale(double x, double y)
|
virtual void SetUserScale(double x, double y)
|
||||||
{ m_dc.SetUserScale(GetX(x, y), GetY(x, y)); }
|
{ m_dc.SetUserScale(GetX(x, y), GetY(x, y)); }
|
||||||
@@ -68,12 +66,6 @@ public:
|
|||||||
virtual void SetLogicalFunction(int function)
|
virtual void SetLogicalFunction(int function)
|
||||||
{ m_dc.SetLogicalFunction(function); }
|
{ m_dc.SetLogicalFunction(function); }
|
||||||
|
|
||||||
// helper functions which may be useful for the users of this class
|
|
||||||
wxSize Reflect(const wxSize& sizeOrig)
|
|
||||||
{
|
|
||||||
return m_mirror ? wxSize(sizeOrig.y, sizeOrig.x) : sizeOrig;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// returns x and y if not mirroring or y and x if mirroring
|
// returns x and y if not mirroring or y and x if mirroring
|
||||||
wxCoord GetX(wxCoord x, wxCoord y) const { return m_mirror ? y : x; }
|
wxCoord GetX(wxCoord x, wxCoord y) const { return m_mirror ? y : x; }
|
||||||
@@ -276,10 +268,31 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxMirrorDC& m_dc;
|
wxDCImpl& m_dc;
|
||||||
|
|
||||||
bool m_mirror;
|
bool m_mirror;
|
||||||
|
|
||||||
|
DECLARE_NO_COPY_CLASS(wxMirrorDCImpl)
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxMirrorDC : public wxDC
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxMirrorDC(wxDC& dc, bool mirror)
|
||||||
|
: wxDC(new wxMirrorDCImpl(this, *dc.GetImpl(), mirror))
|
||||||
|
{
|
||||||
|
m_mirror = mirror;
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper functions which may be useful for the users of this class
|
||||||
|
wxSize Reflect(const wxSize& sizeOrig)
|
||||||
|
{
|
||||||
|
return m_mirror ? wxSize(sizeOrig.y, sizeOrig.x) : sizeOrig;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_mirror;
|
||||||
|
|
||||||
DECLARE_NO_COPY_CLASS(wxMirrorDC)
|
DECLARE_NO_COPY_CLASS(wxMirrorDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -27,11 +27,13 @@ class WXDLLIMPEXP_CORE wxPrinterDC : public wxDC
|
|||||||
public:
|
public:
|
||||||
wxPrinterDC();
|
wxPrinterDC();
|
||||||
wxPrinterDC(const wxPrintData& data);
|
wxPrinterDC(const wxPrintData& data);
|
||||||
virtual ~wxPrinterDC();
|
|
||||||
|
|
||||||
wxRect GetPaperRect();
|
wxRect GetPaperRect();
|
||||||
int GetResolution();
|
int GetResolution();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxPrinterDC(wxDCImpl *impl) : wxDC(impl) { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxPrinterDC)
|
DECLARE_DYNAMIC_CLASS(wxPrinterDC)
|
||||||
};
|
};
|
||||||
|
@@ -203,10 +203,12 @@ private:
|
|||||||
class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
|
class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxSVGFileDC( const wxString &filename,
|
wxSVGFileDC(const wxString& filename,
|
||||||
int width=320, int height=240, double dpi=72.0 )
|
int width = 320,
|
||||||
|
int height = 240,
|
||||||
|
double dpi = 72.0)
|
||||||
|
: wxDC(new wxSVGFileDCImpl(this, filename, width, height, dpi))
|
||||||
{
|
{
|
||||||
m_pimpl = new wxSVGFileDCImpl( this, filename, width, height, dpi );
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -86,7 +86,7 @@ public:
|
|||||||
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
|
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
|
||||||
virtual void SetDeviceOrigin(wxCoord x, wxCoord 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);
|
||||||
|
|
||||||
// implementation from now on
|
// implementation from now on
|
||||||
@@ -242,8 +242,11 @@ protected:
|
|||||||
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
int fillStyle = wxODDEVEN_RULE);
|
int fillStyle = wxODDEVEN_RULE);
|
||||||
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
|
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
|
||||||
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
|
{
|
||||||
|
return subrect == NULL ? GetSelectedBitmap()
|
||||||
|
: GetSelectedBitmap().GetSubBitmap(*subrect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
@@ -314,7 +317,7 @@ protected:
|
|||||||
// only/mainly)
|
// only/mainly)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLEXPORT wxDCTempImpl: public wxMSWDCImpl
|
class WXDLLEXPORT wxDCTempImpl : public wxMSWDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construct a temporary DC with the specified HDC and size (it should be
|
// construct a temporary DC with the specified HDC and size (it should be
|
||||||
@@ -351,17 +354,14 @@ private:
|
|||||||
DECLARE_NO_COPY_CLASS(wxDCTempImpl)
|
DECLARE_NO_COPY_CLASS(wxDCTempImpl)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxDCTemp: public wxDC
|
class WXDLLEXPORT wxDCTemp : public wxDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDCTemp( WXHDC hdc, const wxSize& size = wxDefaultSize )
|
wxDCTemp(WXHDC hdc, const wxSize& size = wxDefaultSize)
|
||||||
|
: wxDC(new wxDCTempImpl(this, hdc, size))
|
||||||
{
|
{
|
||||||
m_pimpl = new wxDCTempImpl( this, hdc, size );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _WX_MSW_DC_H_
|
#endif // _WX_MSW_DC_H_
|
||||||
|
|
||||||
|
@@ -71,8 +71,8 @@ class WXDLLEXPORT wxPrinterDCFromHDC: public wxPrinterDC
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPrinterDCFromHDC( WXHDC theDC )
|
wxPrinterDCFromHDC( WXHDC theDC )
|
||||||
|
: wxPrinterDC(new wxPrinterDCImpl(this, theDC))
|
||||||
{
|
{
|
||||||
m_pimpl = new wxPrinterDCImpl( this, theDC );
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ void wxDCFactory::SetDCFactory( wxDCFactory *factory )
|
|||||||
wxDCFactory::m_factory = factory;
|
wxDCFactory::m_factory = factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDCFactory *wxDCFactory::GetFactory()
|
wxDCFactory *wxDCFactory::Get()
|
||||||
{
|
{
|
||||||
if (!wxDCFactory::m_factory)
|
if (!wxDCFactory::m_factory)
|
||||||
wxDCFactory::m_factory = new wxNativeDCFactory;
|
wxDCFactory::m_factory = new wxNativeDCFactory;
|
||||||
@@ -86,12 +86,12 @@ wxDCFactory *wxDCFactory::GetFactory()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
wxDCImpl* wxNativeDCFactory::CreateWindowDC( wxWindowDC *owner )
|
wxDCImpl* wxNativeDCFactory::CreateWindowDC( wxWindowDC *owner )
|
||||||
{
|
{
|
||||||
return new wxWindowDCImpl( owner );
|
return new wxWindowDCImpl( owner );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDCImpl* wxNativeDCFactory::CreateWindowDC( wxWindowDC *owner, wxWindow *window )
|
wxDCImpl* wxNativeDCFactory::CreateWindowDC( wxWindowDC *owner, wxWindow *window )
|
||||||
{
|
{
|
||||||
return new wxWindowDCImpl( owner, window );
|
return new wxWindowDCImpl( owner, window );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,34 +147,24 @@ wxDCImpl *wxNativeDCFactory::CreatePrinterDC( wxPrinterDC *owner, const wxPrintD
|
|||||||
// wxWindowDC
|
// wxWindowDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxWindowDC, wxDC)
|
||||||
|
|
||||||
wxWindowDC::wxWindowDC()
|
wxWindowDC::wxWindowDC(wxWindow *win)
|
||||||
|
: wxDC(wxDCFactory::Get()->CreateWindowDC(this, win))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowDC::wxWindowDC( wxWindow *win )
|
|
||||||
{
|
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreateWindowDC( this, win );
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxClientDC
|
// wxClientDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxClientDC, wxWindowDC)
|
||||||
|
|
||||||
wxClientDC::wxClientDC()
|
wxClientDC::wxClientDC(wxWindow *win)
|
||||||
|
: wxWindowDC(wxDCFactory::Get()->CreateClientDC(this, win))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxClientDC::wxClientDC( wxWindow *win )
|
|
||||||
{
|
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreateClientDC( this, win );
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMemoryDC
|
// wxMemoryDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -182,21 +172,18 @@ wxClientDC::wxClientDC( wxWindow *win )
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
|
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
|
||||||
|
|
||||||
wxMemoryDC::wxMemoryDC()
|
wxMemoryDC::wxMemoryDC()
|
||||||
|
: wxDC(wxDCFactory::Get()->CreateMemoryDC(this))
|
||||||
{
|
{
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreateMemoryDC( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDC::wxMemoryDC( wxBitmap& bitmap )
|
wxMemoryDC::wxMemoryDC(wxBitmap& bitmap)
|
||||||
|
: wxDC(wxDCFactory::Get()->CreateMemoryDC(this, bitmap))
|
||||||
{
|
{
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreateMemoryDC( this, bitmap );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDC::wxMemoryDC( wxDC *dc )
|
wxMemoryDC::wxMemoryDC(wxDC *dc)
|
||||||
|
: wxDC(wxDCFactory::Get()->CreateMemoryDC(this, dc))
|
||||||
{
|
{
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreateMemoryDC( this, dc );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMemoryDC::SelectObject(wxBitmap& bmp)
|
void wxMemoryDC::SelectObject(wxBitmap& bmp)
|
||||||
@@ -225,23 +212,18 @@ wxBitmap& wxMemoryDC::GetSelectedBitmap()
|
|||||||
return GetImpl()->GetSelectedBitmap();
|
return GetImpl()->GetSelectedBitmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxPaintDC
|
// wxPaintDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxClientDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxPaintDC, wxClientDC)
|
||||||
|
|
||||||
wxPaintDC::wxPaintDC()
|
wxPaintDC::wxPaintDC(wxWindow *win)
|
||||||
|
: wxClientDC(wxDCFactory::Get()->CreatePaintDC(this, win))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPaintDC::wxPaintDC( wxWindow *win )
|
|
||||||
{
|
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreatePaintDC( this, win );
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxScreenDC
|
// wxScreenDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -249,9 +231,8 @@ wxPaintDC::wxPaintDC( wxWindow *win )
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
||||||
|
|
||||||
wxScreenDC::wxScreenDC()
|
wxScreenDC::wxScreenDC()
|
||||||
|
: wxDC(wxDCFactory::Get()->CreateScreenDC(this))
|
||||||
{
|
{
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreateScreenDC( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -263,19 +244,12 @@ wxScreenDC::wxScreenDC()
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxPrinterDC, wxDC)
|
IMPLEMENT_DYNAMIC_CLASS(wxPrinterDC, wxDC)
|
||||||
|
|
||||||
wxPrinterDC::wxPrinterDC()
|
wxPrinterDC::wxPrinterDC()
|
||||||
|
: wxDC(wxDCFactory::Get()->CreatePrinterDC(this, wxPrintData()))
|
||||||
{
|
{
|
||||||
wxPrintData data; // Does this make sense?
|
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreatePrinterDC( this, data );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPrinterDC::wxPrinterDC( const wxPrintData &data )
|
wxPrinterDC::wxPrinterDC(const wxPrintData& data)
|
||||||
{
|
: wxDC(wxDCFactory::Get()->CreatePrinterDC(this, data))
|
||||||
wxDCFactory *factory = wxDCFactory::GetFactory();
|
|
||||||
m_pimpl = factory->CreatePrinterDC( this, data );
|
|
||||||
}
|
|
||||||
|
|
||||||
wxPrinterDC::~wxPrinterDC()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +263,7 @@ int wxPrinterDC::GetResolution()
|
|||||||
return GetImpl()->GetResolution();
|
return GetImpl()->GetResolution();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxDCImpl
|
// wxDCImpl
|
||||||
@@ -333,7 +307,7 @@ wxDCImpl::wxDCImpl( wxDC *owner )
|
|||||||
(double)wxGetDisplaySizeMM().GetWidth();
|
(double)wxGetDisplaySizeMM().GetWidth();
|
||||||
m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() /
|
m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() /
|
||||||
(double)wxGetDisplaySizeMM().GetHeight();
|
(double)wxGetDisplaySizeMM().GetHeight();
|
||||||
|
|
||||||
ResetBoundingBox();
|
ResetBoundingBox();
|
||||||
ResetClipping();
|
ResetClipping();
|
||||||
}
|
}
|
||||||
@@ -1288,7 +1262,7 @@ void wxDC::GetTextExtent(const wxString& string,
|
|||||||
*externalLeading = externalLeading2;
|
*externalLeading = externalLeading2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::GetLogicalOrigin(long *x, long *y) const
|
void wxDC::GetLogicalOrigin(long *x, long *y) const
|
||||||
{
|
{
|
||||||
wxCoord x2, y2;
|
wxCoord x2, y2;
|
||||||
m_pimpl->DoGetLogicalOrigin(&x2, &y2);
|
m_pimpl->DoGetLogicalOrigin(&x2, &y2);
|
||||||
@@ -1298,7 +1272,7 @@ void wxDC::GetLogicalOrigin(long *x, long *y) const
|
|||||||
*y = y2;
|
*y = y2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::GetDeviceOrigin(long *x, long *y) const
|
void wxDC::GetDeviceOrigin(long *x, long *y) const
|
||||||
{
|
{
|
||||||
wxCoord x2, y2;
|
wxCoord x2, y2;
|
||||||
m_pimpl->DoGetDeviceOrigin(&x2, &y2);
|
m_pimpl->DoGetDeviceOrigin(&x2, &y2);
|
||||||
@@ -1306,9 +1280,9 @@ void wxDC::GetDeviceOrigin(long *x, long *y) const
|
|||||||
*x = x2;
|
*x = x2;
|
||||||
if ( y )
|
if ( y )
|
||||||
*y = y2;
|
*y = y2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDC::GetClippingBox(long *x, long *y, long *w, long *h) const
|
void wxDC::GetClippingBox(long *x, long *y, long *w, long *h) const
|
||||||
{
|
{
|
||||||
wxCoord xx,yy,ww,hh;
|
wxCoord xx,yy,ww,hh;
|
||||||
m_pimpl->DoGetClippingBox(&xx, &yy, &ww, &hh);
|
m_pimpl->DoGetClippingBox(&xx, &yy, &ww, &hh);
|
||||||
@@ -1316,6 +1290,6 @@ void wxDC::GetClippingBox(long *x, long *y, long *w, long *h) const
|
|||||||
if (y) *y = yy;
|
if (y) *y = yy;
|
||||||
if (w) *w = ww;
|
if (w) *w = ww;
|
||||||
if (h) *h = hh;
|
if (h) *h = hh;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // WXWIN_COMPATIBILITY_2_8
|
#endif // WXWIN_COMPATIBILITY_2_8
|
||||||
|
@@ -90,7 +90,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner ) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
|
wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
|
||||||
wxMSWDCImpl( owner )
|
wxMSWDCImpl( owner )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( window, _T("invalid window in wxWindowDCImpl") );
|
wxCHECK_RET( window, _T("invalid window in wxWindowDCImpl") );
|
||||||
@@ -329,27 +329,25 @@ class wxPaintDCExImpl: public wxPaintDCImpl
|
|||||||
public:
|
public:
|
||||||
wxPaintDCExImpl( wxDC *owner, wxWindow *window, WXHDC dc );
|
wxPaintDCExImpl( wxDC *owner, wxWindow *window, WXHDC dc );
|
||||||
~wxPaintDCExImpl();
|
~wxPaintDCExImpl();
|
||||||
|
|
||||||
int m_saveState;
|
int m_saveState;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxPaintDCEx,wxPaintDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxPaintDCEx,wxPaintDC)
|
||||||
|
|
||||||
wxPaintDCEx::wxPaintDCEx( wxWindow *window, WXHDC dc )
|
wxPaintDCEx::wxPaintDCEx(wxWindow *window, WXHDC dc)
|
||||||
|
: wxPaintDC(new wxPaintDCExImpl(this, window, dc))
|
||||||
{
|
{
|
||||||
m_pimpl = new wxPaintDCExImpl( this, window, dc );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxPaintDCExImpl::wxPaintDCExImpl(wxDC *owner, wxWindow *window, WXHDC dc)
|
||||||
|
: wxPaintDCImpl( owner )
|
||||||
wxPaintDCExImpl::wxPaintDCExImpl( wxDC *owner, wxWindow *window, WXHDC dc ) :
|
|
||||||
wxPaintDCImpl( owner )
|
|
||||||
{
|
{
|
||||||
wxCHECK_RET( dc, wxT("wxPaintDCEx requires an existing device context") );
|
wxCHECK_RET( dc, wxT("wxPaintDCEx requires an existing device context") );
|
||||||
|
|
||||||
m_saveState = 0;
|
m_saveState = 0;
|
||||||
|
|
||||||
m_window = window;
|
m_window = window;
|
||||||
|
|
||||||
wxPaintDCInfo *info = FindInCache();
|
wxPaintDCInfo *info = FindInCache();
|
||||||
|
@@ -142,7 +142,7 @@ bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound)
|
|||||||
wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl );
|
wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl );
|
||||||
if (!msw_impl)
|
if (!msw_impl)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( !::PlayEnhMetaFile(GetHdcOf(*msw_impl), GetEMF(), &rect) )
|
if ( !::PlayEnhMetaFile(GetHdcOf(*msw_impl), GetEMF(), &rect) )
|
||||||
{
|
{
|
||||||
wxLogLastError(_T("PlayEnhMetaFile"));
|
wxLogLastError(_T("PlayEnhMetaFile"));
|
||||||
@@ -200,7 +200,7 @@ bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
|
|||||||
class wxEnhMetaFileDCImpl : public wxMSWDCImpl
|
class wxEnhMetaFileDCImpl : public wxMSWDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxEnhMetaFileDCImpl( wxEnhMetaFileDC *owner,
|
wxEnhMetaFileDCImpl( wxEnhMetaFileDC *owner,
|
||||||
const wxString& filename, int width, int height,
|
const wxString& filename, int width, int height,
|
||||||
const wxString& description );
|
const wxString& description );
|
||||||
virtual ~wxEnhMetaFileDCImpl();
|
virtual ~wxEnhMetaFileDCImpl();
|
||||||
@@ -223,8 +223,11 @@ IMPLEMENT_ABSTRACT_CLASS(wxEnhMetaFileDC, wxDC)
|
|||||||
wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename,
|
wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
const wxString& description)
|
const wxString& description)
|
||||||
|
: wxDC(new wxEnhMetaFileDCImpl(this,
|
||||||
|
filename,
|
||||||
|
width, height,
|
||||||
|
description))
|
||||||
{
|
{
|
||||||
m_pimpl = new wxEnhMetaFileDCImpl( this, filename, width, height, description );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user