+void wxGTKMemoryImplDC::SetBackground( const wxBrush& brushOrig )
+{
+ wxBrush brush(brushOrig);
+
+ if ( m_selected.Ok() &&
+ m_selected.GetDepth() == 1 &&
+ (brush != *wxTRANSPARENT_BRUSH) )
+ {
+ brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
+ }
+
+ wxGTKWindowImplDC::SetBackground( brush );
+}
+
+void wxGTKMemoryImplDC::SetTextForeground( const wxColour& col )
+{
+ if ( m_selected.Ok() && m_selected.GetDepth() == 1 )
+ {
+ wxGTKWindowImplDC::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
+ }
+ else
+ {
+ wxGTKWindowImplDC::SetTextForeground( col );
+ }
+}
+
+void wxGTKMemoryImplDC::SetTextBackground( const wxColour &col )
+{
+ if (m_selected.Ok() && m_selected.GetDepth() == 1)
+ {
+ wxGTKWindowImplDC::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
+ }
+ else
+ {
+ wxGTKWindowImplDC::SetTextBackground( col );
+ }
+}
+
+void wxGTKMemoryImplDC::DoGetSize( int *width, int *height ) const
+{
+ if (m_selected.Ok())
+ {
+ if (width) (*width) = m_selected.GetWidth();
+ if (height) (*height) = m_selected.GetHeight();
+ }
+ else
+ {
+ if (width) (*width) = 0;
+ if (height) (*height) = 0;
+ }
+}
+
+wxBitmap wxGTKMemoryImplDC::DoGetAsBitmap(const wxRect *subrect) const
+{
+ wxBitmap bmp = GetSelectedBitmap();
+ return subrect ? bmp.GetSubBitmap(*subrect) : bmp;
+}
+
+const wxBitmap& wxGTKMemoryImplDC::GetSelectedBitmap() const
+{
+ return m_selected;
+}
+
+wxBitmap& wxGTKMemoryImplDC::GetSelectedBitmap()
+{
+ return m_selected;
+}