git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25682
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
: OPAQUE);
// flag which telsl us to undo changes in the dtor
: OPAQUE);
// flag which telsl us to undo changes in the dtor
}
else
{
// nothing done, nothing to undo
}
else
{
// nothing done, nothing to undo
m_oldPalette = 0;
#endif // wxUSE_PALETTE
m_oldPalette = 0;
#endif // wxUSE_PALETTE
}
// ---------------------------------------------------------------------------
}
// ---------------------------------------------------------------------------
bool wxDC::CanDrawBitmap() const
{
bool wxDC::CanDrawBitmap() const
{
}
bool wxDC::CanGetTextExtent() const
{
#ifdef __WXMICROWIN__
// TODO Extend MicroWindows' GetDeviceCaps function
}
bool wxDC::CanGetTextExtent() const
{
#ifdef __WXMICROWIN__
// TODO Extend MicroWindows' GetDeviceCaps function
#else
// What sort of display is it?
int technology = ::GetDeviceCaps(GetHdc(), TECHNOLOGY);
#else
// What sort of display is it?
int technology = ::GetDeviceCaps(GetHdc(), TECHNOLOGY);
bool wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
{
#ifdef __WXWINCE__
bool wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
{
#ifdef __WXWINCE__
- WXMICROWIN_CHECK_HDC_RET(FALSE)
+ WXMICROWIN_CHECK_HDC_RET(false)
bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
col.GetPixel(),
bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
col.GetPixel(),
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
{
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
{
- WXMICROWIN_CHECK_HDC_RET(FALSE)
+ WXMICROWIN_CHECK_HDC_RET(false)
- wxCHECK_MSG( col, FALSE, _T("NULL colour parameter in wxDC::GetPixel") );
+ wxCHECK_MSG( col, false, _T("NULL colour parameter in wxDC::GetPixel") );
// get the color of the pixel
COLORREF pixelcolor = ::GetPixel(GetHdc(), XLOG2DEV(x), YLOG2DEV(y));
wxRGBToColour(*col, pixelcolor);
// get the color of the pixel
COLORREF pixelcolor = ::GetPixel(GetHdc(), XLOG2DEV(x), YLOG2DEV(y));
wxRGBToColour(*col, pixelcolor);
}
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
}
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
{
// don't give assert here because this would break existing
// programs - just silently ignore useMask parameter
{
// don't give assert here because this would break existing
// programs - just silently ignore useMask parameter
// On some systems, MaskBlt succeeds yet is much much slower
// than the wxWindows fall-back implementation. So we need
// to be able to switch this on and off at runtime.
// On some systems, MaskBlt succeeds yet is much much slower
// than the wxWindows fall-back implementation. So we need
// to be able to switch this on and off at runtime.
#if wxUSE_SYSTEM_OPTIONS
if (wxSystemOptions::GetOptionInt(wxT("no-maskblt")) == 0)
#endif
#if wxUSE_SYSTEM_OPTIONS
if (wxSystemOptions::GetOptionInt(wxT("no-maskblt")) == 0)
#endif
{
HPALETTE oldPal = ::SelectPalette(GetHdc(),
GetHpaletteOf(m_palette),
{
HPALETTE oldPal = ::SelectPalette(GetHdc(),
GetHpaletteOf(m_palette),
if (!m_oldPalette)
m_oldPalette = (WXHPALETTE) oldPal;
if (!m_oldPalette)
m_oldPalette = (WXHPALETTE) oldPal;
if ( palette.Ok() )
{
m_palette = palette;
if ( palette.Ok() )
{
m_palette = palette;
wxLogLastError(_T("SelectObject(old font)"));
}
wxLogLastError(_T("SelectObject(old font)"));
}
wxLogLastError(_T("SelectObject(old pen)"));
}
wxLogLastError(_T("SelectObject(old pen)"));
}
wxLogLastError(_T("SelectObject(old brush)"));
}
wxLogLastError(_T("SelectObject(old brush)"));
}
bool wxDC::StartDoc(const wxString& WXUNUSED(message))
{
bool wxDC::StartDoc(const wxString& WXUNUSED(message))
{
- // We might be previewing, so return TRUE to let it continue.
- return TRUE;
+ // We might be previewing, so return true to let it continue.
+ return true;
int rop, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask)
{
int rop, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask)
{
- wxCHECK_MSG( source, FALSE, _T("wxDC::Blit(): NULL wxDC pointer") );
+ wxCHECK_MSG( source, false, _T("wxDC::Blit(): NULL wxDC pointer") );
- WXMICROWIN_CHECK_HDC_RET(FALSE)
+ WXMICROWIN_CHECK_HDC_RET(false)
const wxBitmap& bmpSrc = source->m_selectedBitmap;
if ( bmpSrc.Ok() && bmpSrc.HasAlpha() )
{
if ( AlphaBlt(GetHdc(), xdest, ydest, width, height,
GetHdcOf(*source), bmpSrc) )
const wxBitmap& bmpSrc = source->m_selectedBitmap;
if ( bmpSrc.Ok() && bmpSrc.HasAlpha() )
{
if ( AlphaBlt(GetHdc(), xdest, ydest, width, height,
GetHdcOf(*source), bmpSrc) )
{
// don't give assert here because this would break existing
// programs - just silently ignore useMask parameter
{
// don't give assert here because this would break existing
// programs - just silently ignore useMask parameter
case wxNOR: dwRop = NOTSRCCOPY; break;
default:
wxFAIL_MSG( wxT("unsupported logical function") );
case wxNOR: dwRop = NOTSRCCOPY; break;
default:
wxFAIL_MSG( wxT("unsupported logical function") );
class wxDCModule : public wxModule
{
public:
class wxDCModule : public wxModule
{
public:
- virtual bool OnInit() { return TRUE; }
+ virtual bool OnInit() { return true; }
virtual void OnExit() { wxDC::ClearCache(); }
private:
virtual void OnExit() { wxDC::ClearCache(); }
private:
// bitmaps can be drawn only from GUI thread so there is no need to
// protect this static variable from multiple threads
// bitmaps can be drawn only from GUI thread so there is no need to
// protect this static variable from multiple threads
- static bool s_triedToLoad = FALSE;
+ static bool s_triedToLoad = false;
static AlphaBlend_t pfnAlphaBlend = NULL;
if ( !s_triedToLoad )
{
static AlphaBlend_t pfnAlphaBlend = NULL;
if ( !s_triedToLoad )
{
// don't give errors about the DLL being unavailable, we're
// prepared to handle this
// don't give errors about the DLL being unavailable, we're
// prepared to handle this
bf) )
{
// skip wxAlphaBlend() call below
bf) )
{
// skip wxAlphaBlend() call below
}
wxLogLastError(_T("AlphaBlend"));
}
wxLogLastError(_T("AlphaBlend"));
#ifdef wxHAVE_RAW_BITMAP
wxAlphaBlend(hdcDst, x, y, width, height, bmp);
#ifdef wxHAVE_RAW_BITMAP
wxAlphaBlend(hdcDst, x, y, width, height, bmp);
#else // !wxHAVE_RAW_BITMAP
// no wxAlphaBlend() neither, fall back to using simple BitBlt() (we lose
// alpha but at least something will be shown like this)
#else // !wxHAVE_RAW_BITMAP
// no wxAlphaBlend() neither, fall back to using simple BitBlt() (we lose
// alpha but at least something will be shown like this)
#endif // wxHAVE_RAW_BITMAP
}
#endif // wxHAVE_RAW_BITMAP
}