X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/213ad8e72cb6e838d15bf54145d661b081dca308..9e15c94f41c8cdf42470d318269e48e90d6ba75e:/include/wx/msw/dc.h diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index 49927b84b3..895aa8c50c 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -30,7 +30,7 @@ class wxDCCacheEntry: public wxObject public: wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth); wxDCCacheEntry(WXHDC hDC, int depth); - ~wxDCCacheEntry(); + virtual ~wxDCCacheEntry(); WXHBITMAP m_bitmap; WXHDC m_dc; @@ -46,7 +46,7 @@ class WXDLLEXPORT wxDC : public wxDCBase { public: wxDC(WXHDC hDC) { Init(); m_hDC = hDC; } - ~wxDC(); + virtual ~wxDC(); // implement base class pure virtuals // ---------------------------------- @@ -133,6 +133,14 @@ public: static void ClearCache(); #endif + // RTL related functions + // --------------------- + + // get or change the layout direction (LTR or RTL) for this dc, + // wxLayout_Default is returned if layout direction is not supported + virtual wxLayoutDirection GetLayoutDirection() const; + virtual void SetLayoutDirection(wxLayoutDirection dir); + protected: void Init() { @@ -297,7 +305,11 @@ protected: class WXDLLEXPORT wxDCTemp : public wxDC { public: - wxDCTemp(WXHDC hdc) : wxDC(hdc) + // construct a temporary DC with the specified HDC and size (it should be + // specified whenever we know it for this HDC) + wxDCTemp(WXHDC hdc, const wxSize& size = wxDefaultSize) + : wxDC(hdc), + m_size(size) { } @@ -310,15 +322,20 @@ public: protected: virtual void DoGetSize(int *w, int *h) const { - wxFAIL_MSG( _T("no way to retrieve the size of generic DC") ); + wxASSERT_MSG( m_size.IsFullySpecified(), + _T("size of this DC hadn't been set and is unknown") ); if ( w ) - *w = 0; + *w = m_size.x; if ( h ) - *h = 0; + *h = m_size.y; } private: + // size of this DC must be explicitly set by SetSize() as we have no way to + // find it ourselves + const wxSize m_size; + DECLARE_NO_COPY_CLASS(wxDCTemp) };