diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
commit | 320b2313d19869333ed453af546e61a9fc2b81c9 (patch) | |
tree | 25f2eb8a0991ac485ca6354f0d3caf7fd775e732 /core/src/fxge/apple | |
parent | 065e9321b84fc0490f3da9099e8840c65e06868d (diff) | |
download | pdfium-320b2313d19869333ed453af546e61a9fc2b81c9.tar.xz |
FX_BOOL considered harmful, part 2.
Fully automatic change, execpt for cleanup in fx_system.h
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1254703002 .
Diffstat (limited to 'core/src/fxge/apple')
-rw-r--r-- | core/src/fxge/apple/apple_int.h | 50 | ||||
-rw-r--r-- | core/src/fxge/apple/fx_apple_platform.cpp | 26 | ||||
-rw-r--r-- | core/src/fxge/apple/fx_mac_imp.cpp | 6 | ||||
-rw-r--r-- | core/src/fxge/apple/fx_quartz_device.cpp | 146 |
4 files changed, 114 insertions, 114 deletions
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h index 715e48d6c2..0e6c9d683f 100644 --- a/core/src/fxge/apple/apple_int.h +++ b/core/src/fxge/apple/apple_int.h @@ -51,7 +51,7 @@ public: void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize); void DestroyFont(void* pFont); void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix); - FX_BOOL drawGraphicsString(void* graphics, + bool drawGraphicsString(void* graphics, void* font, FX_FLOAT fontSize, FX_WORD* glyphIndices, @@ -92,26 +92,26 @@ public: { return NULL; } - virtual FX_BOOL IsPSPrintDriver() + virtual bool IsPSPrintDriver() { - return FALSE; + return false; } - virtual FX_BOOL StartRendering() + virtual bool StartRendering() { - return TRUE; + return true; } virtual void EndRendering() {} virtual void SaveState(); - virtual void RestoreState(FX_BOOL bKeepSaved); - virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + virtual void RestoreState(bool bKeepSaved); + virtual bool SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ); - virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, + virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ); - virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, + virtual bool DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -121,36 +121,36 @@ public: void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL ); - virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color, + virtual bool SetPixel(int x, int y, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL) { - return FALSE; + return false; } - virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color, + virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, + virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - virtual FX_BOOL GetClipBox(FX_RECT* pRect); - virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE); - virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, + virtual bool GetClipBox(FX_RECT* pRect); + virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false); + virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int dest_left, int dest_top, int blend_type, int alpha_flag = 0, void* pIccTransform = NULL); - virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); - virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, + virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } - virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) + virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause) { - return FALSE; + return false; } virtual void CancelDIBits(void* handle) {} - virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, + virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL); virtual void ClearDriver(); @@ -159,7 +159,7 @@ protected: void setFillInfo(FX_ARGB argb); void setPathToContext(const CFX_PathData * pathData); FX_FLOAT getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm); - FX_BOOL CG_DrawGlypRun(int nChars, + bool CG_DrawGlypRun(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, @@ -195,9 +195,9 @@ public: { return (FX_FILESIZE)_totalSize; } - virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; + virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; - virtual FX_BOOL IsEOF() override + virtual bool IsEOF() override { return _offSet == _totalSize; } diff --git a/core/src/fxge/apple/fx_apple_platform.cpp b/core/src/fxge/apple/fx_apple_platform.cpp index 9db807c3af..9f4712bf7e 100644 --- a/core/src/fxge/apple/fx_apple_platform.cpp +++ b/core/src/fxge/apple/fx_apple_platform.cpp @@ -39,7 +39,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font * pFont, { return NULL; } -static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, +static bool _CGDrawGlyphRun(CGContextRef pContext, int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, @@ -51,10 +51,10 @@ static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, void* pIccTransform) { if (nChars == 0) { - return TRUE; + return true; } CFX_AffineMatrix new_matrix; - FX_BOOL bNegSize = font_size < 0; + bool bNegSize = font_size < 0; if (bNegSize) { font_size = -font_size; } @@ -66,11 +66,11 @@ static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d; if (!pFont->m_pPlatformFont) { if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) { - return FALSE; + return false; } pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize); if (NULL == pFont->m_pPlatformFont) { - return FALSE; + return false; } } CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars); @@ -101,7 +101,7 @@ static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext, NULL); } static void _DoNothing(void *info, const void *data, size_t size) {} -FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, +bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS * pCharPos, CFX_Font * pFont, CFX_FontCache * pCache, @@ -111,22 +111,22 @@ FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, int alpha_flag, void* pIccTransform) { if (!pFont) { - return FALSE; + return false; } - FX_BOOL bBold = pFont->IsBold(); + bool bBold = pFont->IsBold(); if (!bBold && pFont->GetSubstFont() && pFont->GetSubstFont()->m_Weight >= 500 && pFont->GetSubstFont()->m_Weight <= 600) { - return FALSE; + return false; } for (int i = 0; i < nChars; i ++) { if (pCharPos[i].m_bGlyphAdjust) { - return FALSE; + return false; } } CGContextRef ctx = CGContextRef(m_pPlatformGraphics); if (NULL == ctx) { - return FALSE; + return false; } CGContextSaveGState(ctx); CGContextSetTextDrawingMode(ctx, kCGTextFillClip); @@ -143,7 +143,7 @@ FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, CGFloat decode_f[2] = {255.f, 0.f}; pImageCG = CGImageMaskCreate(pClipMask->GetWidth(), pClipMask->GetHeight(), 8, 8, pClipMask->GetPitch(), pClipMaskDataProvider, - decode_f, FALSE); + decode_f, false); CGDataProviderRelease(pClipMaskDataProvider); } } else { @@ -155,7 +155,7 @@ FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, } else { CGContextClipToRect(ctx, rect_cg); } - FX_BOOL ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform); + bool ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform); if (pImageCG) { CGImageRelease(pImageCG); } diff --git a/core/src/fxge/apple/fx_mac_imp.cpp b/core/src/fxge/apple/fx_mac_imp.cpp index 04b04b8ba8..5e5908b8ff 100644 --- a/core/src/fxge/apple/fx_mac_imp.cpp +++ b/core/src/fxge/apple/fx_mac_imp.cpp @@ -28,7 +28,7 @@ Base14Substs[] = { class CFX_MacFontInfo : public CFX_FolderFontInfo { public: - virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact); + virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool& bExact); }; #define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6" #define JAPAN_MINCHO "Hiragino Mincho Pro W6" @@ -44,14 +44,14 @@ static void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_fa face = JAPAN_MINCHO; } } -void* CFX_MacFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact) +void* CFX_MacFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, bool& bExact) { CFX_ByteString face = cstr_face; int iBaseFont; for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++) if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) { face = Base14Substs[iBaseFont].m_pSubstName; - bExact = TRUE; + bExact = true; break; } if (iBaseFont < 12) { diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp index d1e4f544ba..8aa689fa91 100644 --- a/core/src/fxge/apple/fx_quartz_device.cpp +++ b/core/src/fxge/apple/fx_quartz_device.cpp @@ -76,7 +76,7 @@ void CQuartz2D::setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix) matrix->e, ty)); } -FX_BOOL CQuartz2D::drawGraphicsString(void* graphics, +bool CQuartz2D::drawGraphicsString(void* graphics, void* font, FX_FLOAT fontSize, FX_WORD* glyphIndices, @@ -86,7 +86,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics, CFX_AffineMatrix* matrix ) { if (!graphics) { - return FALSE; + return false; } CGContextRef context = (CGContextRef) graphics; CGContextSetFont(context, (CGFontRef)font); @@ -113,7 +113,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics, #if CGFLOAT_IS_DOUBLE CGPoint* glyphPositionsCG = new CGPoint[charsCount]; if (!glyphPositionsCG) { - return FALSE; + return false; } for (int index = 0; index < charsCount; ++index) { glyphPositionsCG[index].x = glyphPositions[index].x; @@ -130,7 +130,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics, delete[] glyphPositionsCG; #endif CGContextRestoreGState(context); - return TRUE; + return true; } void CQuartz2D::saveGraphicsState(void * graphics) { @@ -251,7 +251,7 @@ void CFX_QuartzDeviceDriver::SaveState() CGContextSaveGState(_context); m_saveCount++; } -void CFX_QuartzDeviceDriver::RestoreState(FX_BOOL isKeepSaved ) +void CFX_QuartzDeviceDriver::RestoreState(bool isKeepSaved ) { CGContextRestoreGState(_context); if (isKeepSaved) { @@ -260,7 +260,7 @@ void CFX_QuartzDeviceDriver::RestoreState(FX_BOOL isKeepSaved ) m_saveCount--; } } -FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData, +bool CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData, const CFX_AffineMatrix* matrix, int fillMode ) { @@ -272,13 +272,13 @@ FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData m = CGAffineTransformConcat(m, _foxitDevice2User); CGContextConcatCTM(_context, m); setPathToContext(pathData); - RestoreState(FALSE); + RestoreState(false); if ((fillMode & 3) == FXFILL_WINDING) { CGContextClip(_context); } else { CGContextEOClip(_context); } - return TRUE; + return true; } FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm) { @@ -294,7 +294,7 @@ FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphSt } return lineWidth; } -FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData, +bool CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData, const CFX_AffineMatrix* matrix, const CFX_GraphStateData* graphState ) { @@ -309,9 +309,9 @@ FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* path setStrokeInfo(graphState, 0xFF000000, lineWidth); setPathToContext(pathData); CGContextReplacePathWithStrokedPath(_context); - RestoreState(FALSE); + RestoreState(false); CGContextClip(_context); - return TRUE; + return true; } static CGBlendMode GetCGBlendMode(int blend_type) { @@ -371,7 +371,7 @@ static CGBlendMode GetCGBlendMode(int blend_type) } return mode; } -FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData, +bool CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData, const CFX_AffineMatrix* matrix, const CFX_GraphStateData* graphState, FX_DWORD fillArgb, @@ -423,10 +423,10 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData, } else if (pathMode == 6) { CGContextDrawPath(_context, kCGPathEOFillStroke); } - RestoreState(FALSE); - return TRUE; + RestoreState(false); + return true; } -FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect, +bool CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect, FX_ARGB fillArgb, int alphaFlag , void* iccTransform , @@ -449,9 +449,9 @@ FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect, if (mode != kCGBlendModeNormal) { CGContextSetBlendMode(_context, kCGBlendModeNormal); } - return TRUE; + return true; } -FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, +bool CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, @@ -483,9 +483,9 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, if (mode != kCGBlendModeNormal) { CGContextSetBlendMode(_context, kCGBlendModeNormal); } - return TRUE; + return true; } -FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect) +bool CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect) { CGRect r = CGContextGetClipBoundingBox(_context); r = CGRectApplyAffineTransform(r, _user2FoxitDevice); @@ -493,22 +493,22 @@ FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect) rect->top = FXSYS_floor(r.origin.y); rect->right = FXSYS_ceil(r.origin.x + r.size.width); rect->bottom = FXSYS_ceil(r.origin.y + r.size.height); - return TRUE; + return true; } -FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap, +bool CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap, int32_t left, int32_t top, void* pIccTransform, - FX_BOOL bDEdge) + bool bDEdge) { if (FXDC_PRINTER == _deviceClass) { - return FALSE; + return false; } if (bitmap->GetBPP() < 32) { - return FALSE; + return false; } if (!(_renderCaps | FXRC_GET_BITS)) { - return FALSE; + return false; } CGPoint pt = CGPointMake(left, top); pt = CGPointApplyAffineTransform(pt, _foxitDevice2User); @@ -517,7 +517,7 @@ FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap, pt.y *= FXSYS_fabs(ctm.d); CGImageRef image = CGBitmapContextCreateImage(_context); if (NULL == image) { - return FALSE; + return false; } CGFloat width = (CGFloat) bitmap->GetWidth(); CGFloat height = (CGFloat) bitmap->GetHeight(); @@ -552,9 +552,9 @@ FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap, } } } - return TRUE; + return true; } -FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, +bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_ARGB argb, const FX_RECT* srcRect, int dest_left, @@ -598,8 +598,8 @@ FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, pBitmap1 = pBitmap->Clone(); } if (NULL == pBitmap1) { - RestoreState(FALSE); - return FALSE; + RestoreState(false); + return false; } CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL, pBitmap1->GetBuffer(), @@ -629,8 +629,8 @@ FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, if (pBitmap1 != pBitmap) { delete pBitmap1; } - RestoreState(FALSE); - return TRUE; + RestoreState(false); + return true; } if (pBitmap->GetBPP() < 32) { pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32); @@ -642,15 +642,15 @@ FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, } } if (NULL == pBitmap1) { - RestoreState(FALSE); - return FALSE; + RestoreState(false); + return false; } if (pBitmap1->HasAlpha()) { if (pBitmap1 == pBitmap) { pBitmap1 = pBitmap->Clone(); if (!pBitmap1) { - RestoreState(FALSE); - return FALSE; + RestoreState(false); + return false; } } for (int row = 0; row < pBitmap1->GetHeight(); row ++) { @@ -682,10 +682,10 @@ FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, if (pBitmap1 != pBitmap) { delete pBitmap1; } - RestoreState(FALSE); - return TRUE; + RestoreState(false); + return true; } -FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, +bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_ARGB argb, int dest_left, int dest_top, @@ -723,8 +723,8 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, pBitmap1 = pBitmap->Clone(); } if (NULL == pBitmap1) { - RestoreState(FALSE); - return FALSE; + RestoreState(false); + return false; } CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL, pBitmap1->GetBuffer(), @@ -754,8 +754,8 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, if (pBitmap1 != pBitmap) { delete pBitmap1; } - RestoreState(FALSE); - return TRUE; + RestoreState(false); + return true; } if (pBitmap->GetBPP() < 32) { pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32); @@ -767,15 +767,15 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, } } if (NULL == pBitmap1) { - RestoreState(FALSE); - return FALSE; + RestoreState(false); + return false; } if (pBitmap1->HasAlpha()) { if (pBitmap1 == pBitmap) { pBitmap1 = pBitmap->Clone(); if (!pBitmap1) { - RestoreState(FALSE); - return FALSE; + RestoreState(false); + return false; } } for (int row = 0; row < pBitmap1->GetHeight(); row ++) { @@ -796,10 +796,10 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap, if (pBitmap1 != pBitmap) { delete pBitmap1; } - RestoreState(FALSE); - return TRUE; + RestoreState(false); + return true; } -FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars, +bool CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, @@ -811,16 +811,16 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars void* pIccTransform) { if (nChars == 0) { - return TRUE; + return true; } CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d; if (!pFont->m_pPlatformFont) { if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) { - return FALSE; + return false; } pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize); if (NULL == pFont->m_pPlatformFont) { - return FALSE; + return false; } } CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars); @@ -872,10 +872,10 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars (CGGlyph*)glyph_indices, glyph_positions, nChars); - RestoreState(FALSE); - return TRUE; + RestoreState(false); + return true; } -FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, +bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache, @@ -886,24 +886,24 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, void* pIccTransform) { if (NULL == pFont || NULL == _context) { - return FALSE; + return false; } - FX_BOOL bBold = pFont->IsBold(); + bool bBold = pFont->IsBold(); if (!bBold && pFont->GetSubstFont() && pFont->GetSubstFont()->m_Weight >= 500 && pFont->GetSubstFont()->m_Weight <= 600) { - return FALSE; + return false; } SaveState(); CGContextSetTextDrawingMode(_context, kCGTextFillClip); - FX_BOOL ret = FALSE; + bool ret = false; int32_t i = 0; while (i < nChars) { if (pCharPos[i].m_bGlyphAdjust || font_size < 0) { if (i > 0) { ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform); if (!ret) { - RestoreState(FALSE); + RestoreState(false); return ret; } } @@ -920,7 +920,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, } ret = CG_DrawGlypRun(1, char_pos, pFont, pCache, &glphy_matrix, pObject2Device, font_size, color, alpha_flag, pIccTransform); if (!ret) { - RestoreState(FALSE); + RestoreState(false); return ret; } i ++; @@ -934,7 +934,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars, if (i > 0) { ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform); } - RestoreState(FALSE); + RestoreState(false); return ret; } void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState, FX_ARGB argb, FX_FLOAT lineWidth) @@ -1074,7 +1074,7 @@ void CFX_QuartzDeviceDriver::ClearDriver() } CFX_QuartzDevice::CFX_QuartzDevice() { - m_bOwnedBitmap = FALSE; + m_bOwnedBitmap = false; m_pContext = NULL; } CFX_QuartzDevice::~CFX_QuartzDevice() @@ -1090,7 +1090,7 @@ CGContextRef CFX_QuartzDevice::GetContext() { return m_pContext; } -FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass) +bool CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass) { if (m_pContext) { CGContextRelease(m_pContext); @@ -1099,30 +1099,30 @@ FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass) CGContextRetain(m_pContext); IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, nDeviceClass); SetDeviceDriver(pDriver); - return TRUE; + return true; } -FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap) +bool CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap) { SetBitmap(pBitmap); m_pContext = createContextWithBitmap(pBitmap); if (NULL == m_pContext) { - return FALSE; + return false; } IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY); SetDeviceDriver(pDriver); - return TRUE; + return true; } -FX_BOOL CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format) +bool CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format) { if ((uint8_t)format < 32) { - return FALSE; + return false; } CFX_DIBitmap* pBitmap = new CFX_DIBitmap; if (!pBitmap->Create(width, height, format)) { delete pBitmap; - return FALSE; + return false; } - m_bOwnedBitmap = TRUE; + m_bOwnedBitmap = true; return Attach(pBitmap); } #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |