X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e320a79f187558effb04d92020b470372bbe456..b782f2e0f6abc7baa9a8bfc158847a89d5d12145:/src/os2/brush.cpp diff --git a/src/os2/brush.cpp b/src/os2/brush.cpp index 4f28e92f53..bf2712be01 100644 --- a/src/os2/brush.cpp +++ b/src/os2/brush.cpp @@ -81,20 +81,6 @@ wxBrush::wxBrush(const wxBitmap& stipple) wxTheBrushList->AddBrush(this); } -void wxBrush::Unshare() -{ - // Don't change shared data - if (!m_refData) - { - m_refData = new wxBrushRefData(); - } - else - { - wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData); - UnRef(); - m_refData = ref; - } -} void wxBrush::SetColour(const wxColour& col) { @@ -138,3 +124,39 @@ bool wxBrush::RealizeResource() return FALSE; } +WXHANDLE wxBrush::GetResourceHandle(void) +{ + return (WXHANDLE) M_BRUSHDATA->m_hBrush; +} + +bool wxBrush::FreeResource(bool WXUNUSED(force)) +{ + if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0)) + { +// TODO DeleteObject((HBRUSH) M_BRUSHDATA->m_hBrush); + M_BRUSHDATA->m_hBrush = 0; + return TRUE; + } + else return FALSE; +} + +bool wxBrush::IsFree() const +{ + return (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0)); +} + +void wxBrush::Unshare() +{ + // Don't change shared data + if (!m_refData) + { + m_refData = new wxBrushRefData(); + } + else + { + wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData); + UnRef(); + m_refData = ref; + } +} +