X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83df96d63a52ebb08b9e32549dc255354b4a18d0..a87bf37838e09fb4634a887cc8a6055104b49a01:/src/x11/dc.cpp diff --git a/src/x11/dc.cpp b/src/x11/dc.cpp index cc5c5359a4..4b82e09a70 100644 --- a/src/x11/dc.cpp +++ b/src/x11/dc.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dc.h" #endif @@ -17,7 +17,7 @@ #include "wx/dcmemory.h" #include "wx/defs.h" - IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) +IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) //----------------------------------------------------------------------------- // constants @@ -38,44 +38,28 @@ wxDC::wxDC() { m_ok = FALSE; +#if 1 m_mm_to_pix_x = 1.0; m_mm_to_pix_y = 1.0; +#else + m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() / + (double)wxGetDisplaySizeMM().GetWidth(); + m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() / + (double)wxGetDisplaySizeMM().GetHeight(); +#endif - m_backgroundMode = wxTRANSPARENT; - - m_isInteractive = FALSE; -} - -void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y) -{ - wxCHECK_RET( Ok(), "invalid dc" ); - wxCHECK_RET( icon.Ok(), "invalid icon" ); - - DoDrawBitmap(icon, x, y, TRUE); -} + m_needComputeScaleX = FALSE; /* not used yet */ + m_needComputeScaleY = FALSE; /* not used yet */ -void wxDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask ) -{ - wxCHECK_RET( bitmap.Ok(), "invalid bitmap" ); + m_logicalFunction = wxCOPY; - wxMemoryDC memDC; - memDC.SelectObject(bitmap); + m_pen = *wxBLACK_PEN; + m_font = *wxNORMAL_FONT; + m_brush = *wxWHITE_BRUSH; -#if 0 - // Not sure if we need this. The mask should leave the masked areas as per - // the original background of this DC. - if (useMask) - { - // There might be transparent areas, so make these the same colour as this - // DC - memDC.SetBackground(* GetBackground()); - memDC.Clear(); - } -#endif // 0 - - Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), &memDC, 0, 0, wxCOPY, useMask); + m_backgroundMode = wxTRANSPARENT; - memDC.SelectObject(wxNullBitmap); + m_isInteractive = FALSE; // ??? } void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) @@ -87,19 +71,6 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei m_clipY2 = y + height; } -void wxDC::DestroyClippingRegion() -{ - m_clipping = FALSE; -} - -void wxDC::DoGetSize( int* width, int* height ) const -{ - if ( width ) - *width = m_maxX - m_minX; - if ( height ) - *height = m_maxY - m_minY; -} - void wxDC::DoGetSizeMM( int* width, int* height ) const { int w, h;