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/win32 | |
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/win32')
-rw-r--r-- | core/src/fxge/win32/dwrite_int.h | 6 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_device.cpp | 198 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_dib.cpp | 12 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_dwrite.cpp | 18 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_gdipext.cpp | 90 | ||||
-rw-r--r-- | core/src/fxge/win32/fx_win32_print.cpp | 86 | ||||
-rw-r--r-- | core/src/fxge/win32/win32_int.h | 94 |
7 files changed, 252 insertions, 252 deletions
diff --git a/core/src/fxge/win32/dwrite_int.h b/core/src/fxge/win32/dwrite_int.h index dc2a338935..4896161547 100644 --- a/core/src/fxge/win32/dwrite_int.h +++ b/core/src/fxge/win32/dwrite_int.h @@ -35,15 +35,15 @@ public: void Load(); void Unload(); - FX_BOOL IsAvailable() + bool IsAvailable() { return m_pDWriteFactory != NULL; } void* DwCreateFontFaceFromStream(uint8_t* pData, FX_DWORD size, int simulation_style); - FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget); + bool DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget); void DwDeleteRenderingTarget(void* renderTarget); - FX_BOOL DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix, + bool DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix, void *font, FX_FLOAT font_size, FX_ARGB text_color, int glyph_count, unsigned short* glyph_indices, FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY, diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index 18bcc595a4..e6667b17ec 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp @@ -24,18 +24,18 @@ public: CWin32FontInfo(); ~CWin32FontInfo(); virtual void Release(); - virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper); - virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact); + virtual bool EnumFontList(CFX_FontMapper* pMapper); + virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, bool& bExact); virtual void* GetFont(const FX_CHAR* face) { return NULL; } virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size); virtual void DeleteFont(void* hFont); - virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name); - virtual FX_BOOL GetFontCharset(void* hFont, int& charset); - FX_BOOL IsOpenTypeFromDiv(const LOGFONTA *plf); - FX_BOOL IsSupportFontFormDiv(const LOGFONTA* plf); + virtual bool GetFaceName(void* hFont, CFX_ByteString& name); + virtual bool GetFontCharset(void* hFont, int& charset); + bool IsOpenTypeFromDiv(const LOGFONTA *plf); + bool IsSupportFontFormDiv(const LOGFONTA* plf); void AddInstalledFont(const LOGFONTA *plf, FX_DWORD FontType); void GetGBPreference(CFX_ByteString& face, int weight, int picth_family); void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family); @@ -59,10 +59,10 @@ void CWin32FontInfo::Release() delete this; } #define TT_MAKE_TAG(x1, x2, x3, x4) (((FX_DWORD)x1<<24)|((FX_DWORD)x2<<16)|((FX_DWORD)x3<<8)|(FX_DWORD)x4) -FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf) +bool CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf) { HFONT hFont = CreateFontIndirectA(plf); - FX_BOOL ret = FALSE; + bool ret = false; FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0); if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) { FX_DWORD lVersion = 0; @@ -74,16 +74,16 @@ FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf) lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') || lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') || lVersion == 0x00020000) { - ret = TRUE; + ret = true; } } DeleteFont(hFont); return ret; } -FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) +bool CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) { HFONT hFont = CreateFontIndirectA(plf); - FX_BOOL ret = FALSE; + bool ret = false; FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0); if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) { FX_DWORD lVersion = 0; @@ -95,10 +95,10 @@ FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') || lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') || lVersion == 0x00020000) { - ret = TRUE; + ret = true; } else if ((lVersion & 0xFFFF0000) == TT_MAKE_TAG(0x80, 0x01, 0x00, 0x00) || (lVersion & 0xFFFF0000) == TT_MAKE_TAG('%', '!', 0, 0)) { - ret = TRUE; + ret = true; } } DeleteFont(hFont); @@ -139,7 +139,7 @@ static int CALLBACK FontEnumProc( pFontInfo->AddInstalledFont(plf, FontType); return 1; } -FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper) +bool CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper) { m_pMapper = pMapper; LOGFONTA lf; @@ -151,7 +151,7 @@ FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper) if (pMapper->GetFontEnumerator()) { pMapper->GetFontEnumerator()->Finish(); } - return TRUE; + return true; } static const struct { const FX_CHAR* m_pFaceName; @@ -163,22 +163,22 @@ VariantNames[] = { static const struct { const FX_CHAR* m_pName; const FX_CHAR* m_pWinName; - FX_BOOL m_bBold; - FX_BOOL m_bItalic; + bool m_bBold; + bool m_bItalic; } Base14Substs[] = { - {"Courier", "Courier New", FALSE, FALSE}, - {"Courier-Bold", "Courier New", TRUE, FALSE}, - {"Courier-BoldOblique", "Courier New", TRUE, TRUE}, - {"Courier-Oblique", "Courier New", FALSE, TRUE}, - {"Helvetica", "Arial", FALSE, FALSE}, - {"Helvetica-Bold", "Arial", TRUE, FALSE}, - {"Helvetica-BoldOblique", "Arial", TRUE, TRUE}, - {"Helvetica-Oblique", "Arial", FALSE, TRUE}, - {"Times-Roman", "Times New Roman", FALSE, FALSE}, - {"Times-Bold", "Times New Roman", TRUE, FALSE}, - {"Times-BoldItalic", "Times New Roman", TRUE, TRUE}, - {"Times-Italic", "Times New Roman", FALSE, TRUE}, + {"Courier", "Courier New", false, false}, + {"Courier-Bold", "Courier New", true, false}, + {"Courier-BoldOblique", "Courier New", true, true}, + {"Courier-Oblique", "Courier New", false, true}, + {"Helvetica", "Arial", false, false}, + {"Helvetica-Bold", "Arial", true, false}, + {"Helvetica-BoldOblique", "Arial", true, true}, + {"Helvetica-Oblique", "Arial", false, true}, + {"Times-Roman", "Times New Roman", false, false}, + {"Times-Bold", "Times New Roman", true, false}, + {"Times-BoldItalic", "Times New Roman", true, true}, + {"Times-Italic", "Times New Roman", false, true}, }; CFX_ByteString CWin32FontInfo::FindFont(const CFX_ByteString& name) { @@ -212,17 +212,17 @@ extern "C" { return FXSYS_stricmp((const FX_CHAR*)key, ((_FontNameMap*)element)->m_pSrcFontName); } } -FX_BOOL _GetSubFontName(CFX_ByteString& name) +bool _GetSubFontName(CFX_ByteString& name) { int size = sizeof g_JpFontNameMap; void* pFontnameMap = (void*)g_JpFontNameMap; _FontNameMap* found = (_FontNameMap*)FXSYS_bsearch(name.c_str(), pFontnameMap, size / sizeof (_FontNameMap), sizeof (_FontNameMap), compareString); if (found == NULL) { - return FALSE; + return false; } name = found->m_pSubFontName; - return TRUE; + return true; } void CWin32FontInfo::GetGBPreference(CFX_ByteString& face, int weight, int picth_family) { @@ -285,7 +285,7 @@ void CWin32FontInfo::GetJapanesePreference(CFX_ByteString& face, int weight, int face = "MS PMincho"; } } -void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact) +void* CWin32FontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, bool& bExact) { CFX_ByteString face = cstr_face; int iBaseFont; @@ -294,7 +294,7 @@ void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitc face = Base14Substs[iBaseFont].m_pWinName; weight = Base14Substs[iBaseFont].m_bBold ? FW_BOLD : FW_NORMAL; bItalic = Base14Substs[iBaseFont].m_bItalic; - bExact = TRUE; + bExact = true; break; } if (charset == ANSI_CHARSET || charset == SYMBOL_CHARSET) { @@ -373,26 +373,26 @@ FX_DWORD CWin32FontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* buffe } return size; } -FX_BOOL CWin32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name) +bool CWin32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { char facebuf[100]; HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); int ret = ::GetTextFaceA(m_hDC, 100, facebuf); ::SelectObject(m_hDC, hOldFont); if (ret == 0) { - return FALSE; + return false; } name = facebuf; - return TRUE; + return true; } -FX_BOOL CWin32FontInfo::GetFontCharset(void* hFont, int& charset) +bool CWin32FontInfo::GetFontCharset(void* hFont, int& charset) { TEXTMETRIC tm; HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); ::GetTextMetrics(m_hDC, &tm); ::SelectObject(m_hDC, hOldFont); charset = tm.tmCharSet; - return TRUE; + return true; } IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault() { @@ -466,16 +466,16 @@ void* CGdiDeviceDriver::GetClipRgn() } return (void*)hClipRgn; } -FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform) +bool CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform) { if (m_DeviceClass == FXDC_PRINTER) { - CFX_DIBitmap* pBitmap = pBitmap1->FlipImage(FALSE, TRUE); + CFX_DIBitmap* pBitmap = pBitmap1->FlipImage(false, true); if (pBitmap == NULL) { - return FALSE; + return false; } if ((pBitmap->IsCmykImage() || pIccTransform) && !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) { - return FALSE; + return false; } int width = pSrcRect->Width(), height = pSrcRect->Height(); int pitch = pBitmap->GetPitch(); @@ -493,7 +493,7 @@ FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_R CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1; if ((pBitmap->IsCmykImage() || pIccTransform) && (pBitmap = pBitmap->CloneConvert(FXDIB_Rgb, NULL, pIccTransform)) == NULL) { - return FALSE; + return false; } int width = pSrcRect->Width(), height = pSrcRect->Height(); int pitch = pBitmap->GetPitch(); @@ -505,18 +505,18 @@ FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_R delete pBitmap; } } - return TRUE; + return true; } -FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top, +bool CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform) { CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1; if (pBitmap == NULL || dest_width == 0 || dest_height == 0) { - return FALSE; + return false; } if ((pBitmap->IsCmykImage() || pIccTransform) && !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) { - return FALSE; + return false; } CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap); if ((int64_t)abs(dest_width) * abs(dest_height) < (int64_t)pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 || @@ -538,15 +538,15 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int de if (del) { delete pToStrechBitmap; } - return TRUE; + return true; } -FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top, +bool CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags, int alpha_flag, void* pIccTransform) { CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1; if (pBitmap == NULL || dest_width == 0 || dest_height == 0) { - return FALSE; + return false; } _Color2Argb(bitmap_color, bitmap_color, alpha_flag | (1 << 24), pIccTransform); int width = pBitmap->GetWidth(), height = pBitmap->GetHeight(); @@ -592,16 +592,16 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int d SelectObject(m_hDC, hOld); DeleteObject(hPattern); - return TRUE; + return true; } BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect) { return ::GetClipBox(m_hDC, (RECT*)pRect); } -FX_BOOL CGdiDeviceDriver::SetClipRgn(void* hRgn) +bool CGdiDeviceDriver::SetClipRgn(void* hRgn) { ::SelectClipRgn(m_hDC, (HRGN)hRgn); - return TRUE; + return true; } static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, FX_DWORD argb) { @@ -749,11 +749,11 @@ void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT MoveToEx(m_hDC, FXSYS_round(x1), FXSYS_round(y1), NULL); LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2)); } -static FX_BOOL _MatrixNoScaled(const CFX_AffineMatrix* pMatrix) +static bool _MatrixNoScaled(const CFX_AffineMatrix* pMatrix) { return pMatrix->GetA() == 1.0f && pMatrix->GetB() == 0 && pMatrix->GetC() == 0 && pMatrix->GetD() == 1.0f; } -FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, +bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -765,7 +765,7 @@ FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, ) { if (blend_type != FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform); _Color2Argb(stroke_color, stroke_color, alpha_flag, pIccTransform); @@ -786,9 +786,9 @@ FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, } int fill_alpha = FXARGB_A(fill_color); int stroke_alpha = FXARGB_A(stroke_color); - FX_BOOL bDrawAlpha = (fill_alpha > 0 && fill_alpha < 255) || (stroke_alpha > 0 && stroke_alpha < 255 && pGraphState); + bool bDrawAlpha = (fill_alpha > 0 && fill_alpha < 255) || (stroke_alpha > 0 && stroke_alpha < 255 && pGraphState); if (!pPlatform->m_GdiplusExt.IsAvailable() && bDrawAlpha) { - return FALSE; + return false; } if (pPlatform->m_GdiplusExt.IsAvailable()) { if (bDrawAlpha || ((m_DeviceClass != FXDC_PRINTER && !(fill_mode & FXFILL_FULLCOVER)) || (pGraphState && pGraphState->m_DashCount))) { @@ -797,7 +797,7 @@ FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && pPathData->IsRect()) ) { if (pPlatform->m_GdiplusExt.DrawPath(m_hDC, pPathData, pMatrix, pGraphState, fill_color, stroke_color, fill_mode)) { - return TRUE; + return true; } } } @@ -852,29 +852,29 @@ FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, hBrush = (HBRUSH)SelectObject(m_hDC, hBrush); DeleteObject(hBrush); } - return TRUE; + return true; } -FX_BOOL CGdiDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type) +bool CGdiDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform); int alpha; FX_COLORREF rgb; ArgbDecode(fill_color, alpha, rgb); if (alpha == 0) { - return TRUE; + return true; } if (alpha < 255) { - return FALSE; + return false; } HBRUSH hBrush = CreateSolidBrush(rgb); ::FillRect(m_hDC, (RECT*)pRect, hBrush); DeleteObject(hBrush); - return TRUE; + return true; } -FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, +bool CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix, int fill_mode ) @@ -884,15 +884,15 @@ FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, if (pPathData->IsRect(pMatrix, &rectf)) { FX_RECT rect = rectf.GetOutterRect(); IntersectClipRect(m_hDC, rect.left, rect.top, rect.right, rect.bottom); - return TRUE; + return true; } } _SetPathToDC(m_hDC, pPathData, pMatrix); SetPolyFillMode(m_hDC, fill_mode & 3); SelectClipPath(m_hDC, RGN_AND); - return TRUE; + return true; } -FX_BOOL CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, +bool CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix, const CFX_GraphStateData* pGraphState ) @@ -902,23 +902,23 @@ FX_BOOL CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, _SetPathToDC(m_hDC, pPathData, pMatrix); WidenPath(m_hDC); SetPolyFillMode(m_hDC, WINDING); - FX_BOOL ret = SelectClipPath(m_hDC, RGN_AND); + bool ret = SelectClipPath(m_hDC, RGN_AND); hPen = (HPEN)SelectObject(m_hDC, hPen); DeleteObject(hPen); return ret; } -FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, +bool CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, int alpha_flag, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } _Color2Argb(color, color, alpha_flag | (1 << 24), pIccTransform); int a; FX_COLORREF rgb; ArgbDecode(color, a, rgb); if (a == 0) { - return TRUE; + return true; } HPEN hPen = CreatePen(PS_SOLID, 1, rgb); hPen = (HPEN)SelectObject(m_hDC, hPen); @@ -926,12 +926,12 @@ FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2 LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2)); hPen = (HPEN)SelectObject(m_hDC, hPen); DeleteObject(hPen); - return TRUE; + return true; } -FX_BOOL CGdiDeviceDriver::DeleteDeviceRgn(void* pRgn) +bool CGdiDeviceDriver::DeleteDeviceRgn(void* pRgn) { DeleteObject((HGDIOBJ)pRgn); - return TRUE; + return true; } CGdiDisplayDriver::CGdiDisplayDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_DISPLAY) { @@ -940,9 +940,9 @@ CGdiDisplayDriver::CGdiDisplayDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_DISPL m_RenderCaps |= FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE; } } -FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge) +bool CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge) { - FX_BOOL ret = FALSE; + bool ret = false; int width = pBitmap->GetWidth(); int height = pBitmap->GetHeight(); HBITMAP hbmp = CreateCompatibleBitmap(m_hDC, width, height); @@ -969,7 +969,7 @@ FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, v ::GetDIBits(hDCMemory, hbmp, 0, height, bitmap.GetBuffer(), &bmi, DIB_RGB_COLORS); ret = pBitmap->TransferBitmap(0, 0, width, height, &bitmap, 0, 0, pIccTransform); } else { - ret = FALSE; + ret = false; } } if (pBitmap->HasAlpha() && ret) { @@ -979,22 +979,22 @@ FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, v DeleteObject(hDCMemory); return ret; } -FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +bool CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, int alpha_flag, void* pIccTransform) { ASSERT(blend_type == FXDIB_BLEND_NORMAL); if (pSource->IsAlphaMask()) { int width = pSource->GetWidth(), height = pSource->GetHeight(); int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); - FX_BOOL bGDI = pSource->GetBPP() == 1 && alpha == 255; + bool bGDI = pSource->GetBPP() == 1 && alpha == 255; if (!bGDI) { CFX_DIBitmap background; if (!background.Create(width, height, FXDIB_Rgb32) || !GetDIBits(&background, left, top, NULL) || !background.CompositeMask(0, 0, width, height, pSource, color, - 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, + 0, 0, FXDIB_BLEND_NORMAL, NULL, false, alpha_flag, pIccTransform)) { - return FALSE; + return false; } FX_RECT src_rect(0, 0, width, height); return SetDIBits(&background, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL); @@ -1008,8 +1008,8 @@ FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD colo CFX_DIBitmap bitmap; if (!bitmap.Create(width, height, FXDIB_Rgb) || !GetDIBits(&bitmap, left, top, NULL) || - !bitmap.CompositeBitmap(0, 0, width, height, pSource, pSrcRect->left, pSrcRect->top, FXDIB_BLEND_NORMAL, NULL, FALSE, pIccTransform)) { - return FALSE; + !bitmap.CompositeBitmap(0, 0, width, height, pSource, pSrcRect->left, pSrcRect->top, FXDIB_BLEND_NORMAL, NULL, false, pIccTransform)) { + return false; } FX_RECT src_rect(0, 0, width, height); return SetDIBits(&bitmap, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL); @@ -1019,9 +1019,9 @@ FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD colo if (pBitmap) { return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform); } - return FALSE; + return false; } -FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, +bool CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags, int alpha_flag, void* pIccTransform, int blend_type) { @@ -1035,14 +1035,14 @@ FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, F bitmap_clip.Offset(-dest_left, -dest_top); CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, render_flags, &bitmap_clip); if (pStretched == NULL) { - return TRUE; + return true; } FX_RECT src_rect(0, 0, pStretched->GetWidth(), pStretched->GetHeight()); - FX_BOOL ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform); + bool ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform); delete pStretched; return ret; } -FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, +bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, 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, void* pIccTransform, int blend_type) { @@ -1063,17 +1063,17 @@ FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD int clip_width = clip_rect.Width(), clip_height = clip_rect.Height(); CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, flags, &clip_rect); if (pStretched == NULL) { - return TRUE; + return true; } CFX_DIBitmap background; if (!background.Create(clip_width, clip_height, FXDIB_Rgb32) || !GetDIBits(&background, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, NULL) || - !background.CompositeMask(0, 0, clip_width, clip_height, pStretched, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) { + !background.CompositeMask(0, 0, clip_width, clip_height, pStretched, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, false, alpha_flag, pIccTransform)) { delete pStretched; - return FALSE; + return false; } FX_RECT src_rect(0, 0, clip_width, clip_height); - FX_BOOL ret = SetDIBits(&background, 0, &src_rect, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL, 0, NULL); + bool ret = SetDIBits(&background, 0, &src_rect, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL, 0, NULL); delete pStretched; return ret; } @@ -1083,7 +1083,7 @@ FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD CFX_DIBExtractor temp(pSource); CFX_DIBitmap* pBitmap = temp; if (pBitmap == NULL) { - return FALSE; + return false; } return pPlatform->m_GdiplusExt.StretchDIBits(m_hDC, pBitmap, dest_left, dest_top, dest_width, dest_height, pClipRect, flags); } @@ -1095,7 +1095,7 @@ FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD if (pBitmap) { return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform); } - return FALSE; + return false; } #define GET_PS_FEATURESETTING 4121 #define FEATURESETTING_PSLEVEL 2 @@ -1134,7 +1134,7 @@ int GetPSLevel(HDC hDC) return 2; } int CFX_WindowsDevice::m_psLevel = 2; -CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput, FX_BOOL bForcePSOutput, int psLevel) +CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, bool bCmykOutput, bool bForcePSOutput, int psLevel) { m_bForcePSOutput = bForcePSOutput; m_psLevel = psLevel; @@ -1154,7 +1154,7 @@ HDC CFX_WindowsDevice::GetDC() const } return (HDC)pRDD->GetPlatformSurface(); } -IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, FX_BOOL bCmykOutput) +IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, bool bCmykOutput) { int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY); int obj_type = ::GetObjectType(hDC); diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp index 3dcfce4802..610c69e4b1 100644 --- a/core/src/fxge/win32/fx_win32_dib.cpp +++ b/core/src/fxge/win32/fx_win32_dib.cpp @@ -49,19 +49,19 @@ CFX_ByteString CFX_WindowsDIB::GetBitmapInfo(const CFX_DIBitmap* pBitmap) result.ReleaseBuffer(len); return result; } -CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha) +CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, bool bAlpha) { int width = pbmi->bmiHeader.biWidth; int height = pbmi->bmiHeader.biHeight; - BOOL bBottomUp = TRUE; + BOOL bBottomUp = true; if (height < 0) { height = -height; - bBottomUp = FALSE; + bBottomUp = false; } int pitch = (width * pbmi->bmiHeader.biBitCount + 31) / 32 * 4; CFX_DIBitmap* pBitmap = new CFX_DIBitmap; FXDIB_Format format = bAlpha ? (FXDIB_Format)(pbmi->bmiHeader.biBitCount + 0x200) : (FXDIB_Format)pbmi->bmiHeader.biBitCount; - FX_BOOL ret = pBitmap->Create(width, height, format); + bool ret = pBitmap->Create(width, height, format); if (!ret) { delete pBitmap; return NULL; @@ -93,7 +93,7 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL } CFX_DIBitmap* CFX_WindowsDIB::LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData) { - return _FX_WindowsDIB_LoadFromBuf(pbmi, pData, FALSE); + return _FX_WindowsDIB_LoadFromBuf(pbmi, pData, false); } HBITMAP CFX_WindowsDIB::GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC) { @@ -174,7 +174,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) } CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pPalette, FX_DWORD palsize) { - FX_BOOL bCreatedDC = hDC == NULL; + bool bCreatedDC = hDC == NULL; if (hDC == NULL) { hDC = CreateCompatibleDC(NULL); } diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp index 65a35d86a1..8533343926 100644 --- a/core/src/fxge/win32/fx_win32_dwrite.cpp +++ b/core/src/fxge/win32/fx_win32_dwrite.cpp @@ -133,7 +133,7 @@ LPVOID CDWriteExt::DwCreateFontFaceFromStream(uint8_t* pData, FX_DWORD size, int IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory; IDWriteFontFile* pDwFontFile = NULL; IDWriteFontFace* pDwFontFace = NULL; - BOOL isSupportedFontType = FALSE; + BOOL isSupportedFontType = false; DWRITE_FONT_FILE_TYPE fontFileType; DWRITE_FONT_FACE_TYPE fontFaceType; UINT32 numberOfFaces; @@ -174,10 +174,10 @@ failed: SafeRelease(&pDwFontFile); return NULL; } -FX_BOOL CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTarget) +bool CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTarget) { if (pBitmap->GetFormat() > FXDIB_Argb) { - return FALSE; + return false; } IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory; IDWriteGdiInterop* pGdiInterop = NULL; @@ -212,14 +212,14 @@ FX_BOOL CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** render SafeRelease(&pGdiInterop); SafeRelease(&pBitmapRenderTarget); SafeRelease(&pRenderingParams); - return TRUE; + return true; failed: SafeRelease(&pGdiInterop); SafeRelease(&pBitmapRenderTarget); SafeRelease(&pRenderingParams); - return FALSE; + return false; } -FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix, +bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix, void *font, FX_FLOAT font_size, FX_ARGB text_color, int glyph_count, unsigned short* glyph_indices, FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY, @@ -227,7 +227,7 @@ FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, F FX_FLOAT* glyph_advances) { if (renderTarget == NULL) { - return TRUE; + return true; } CDwGdiTextRenderer* pTextRenderer = (CDwGdiTextRenderer*)renderTarget; DWRITE_MATRIX transform; @@ -247,7 +247,7 @@ FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, F glyphRun.glyphIndices = glyph_indices; glyphRun.glyphAdvances = glyph_advances; glyphRun.glyphOffsets = (DWRITE_GLYPH_OFFSET*)glyph_offsets; - glyphRun.isSideways = FALSE; + glyphRun.isSideways = false; glyphRun.bidiLevel = 0; hr = pTextRenderer->DrawGlyphRun( stringRect, @@ -258,7 +258,7 @@ FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, F &glyphRun, RGB(FXARGB_R(text_color), FXARGB_G(text_color), FXARGB_B(text_color)) ); - return SUCCEEDED(hr) ? TRUE : FALSE; + return SUCCEEDED(hr) ? true : false; } void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget) { diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp index d76d52e50b..94fac69157 100644 --- a/core/src/fxge/win32/fx_win32_gdipext.cpp +++ b/core/src/fxge/win32/fx_win32_gdipext.cpp @@ -274,12 +274,12 @@ void* CGdiplusExt::GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void* } return NULL; } -FX_BOOL CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle) +bool CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle) { if (m_pGdiRemoveFontMemResourseEx) { return ((FuncType_GdiRemoveFontMemResourceEx)m_pGdiRemoveFontMemResourseEx)((HANDLE)handle); } - return FALSE; + return false; } static GpBrush* _GdipCreateBrush(DWORD argb) { @@ -291,11 +291,11 @@ static GpBrush* _GdipCreateBrush(DWORD argb) static CFX_DIBitmap* _StretchMonoToGray(int dest_width, int dest_height, const CFX_DIBitmap* pSource, FX_RECT* pClipRect) { - FX_BOOL bFlipX = dest_width < 0; + bool bFlipX = dest_width < 0; if (bFlipX) { dest_width = -dest_width; } - FX_BOOL bFlipY = dest_height < 0; + bool bFlipY = dest_height < 0; if (bFlipY) { dest_height = -dest_height; } @@ -382,7 +382,7 @@ static void OutputImageMask(GpGraphics* pGraphics, BOOL bMonoDevice, const CFX_D if (src_width * src_height > 10000) { pStretched = _StretchMonoToGray(dest_width, dest_height, pBitmap, &image_clip); } else { - pStretched = pBitmap->StretchTo(dest_width, dest_height, FALSE, &image_clip); + pStretched = pBitmap->StretchTo(dest_width, dest_height, false, &image_clip); } GpBitmap* bitmap; CallFunc(GdipCreateBitmapFromScan0)(image_clip.Width(), image_clip.Height(), @@ -536,7 +536,7 @@ void CGdiplusExt::DeleteMemFont(LPVOID pCollection) CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; CallFunc(GdipDeletePrivateFontCollection)((GpFontCollection**)&pCollection); } -FX_BOOL CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap) +bool CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; PixelFormat format; @@ -551,41 +551,41 @@ FX_BOOL CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap) format = PixelFormat32bppARGB; break; default: - return FALSE; + return false; } GpStatus status = CallFunc(GdipCreateBitmapFromScan0)(pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap->GetPitch(), format, pBitmap->GetBuffer(), (GpBitmap**)bitmap); if (status == Ok) { - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics) +bool CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; GpStatus status = CallFunc(GdipGetImageGraphicsContext)((GpBitmap*)bitmap, (GpGraphics**)graphics); if (status == Ok) { - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CGdiplusExt::GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily) +bool CGdiplusExt::GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; GpStatus status = CallFunc(GdipCreateFontFamilyFromName)((GDIPCONST WCHAR *)name, (GpFontCollection*)pFontCollection, (GpFontFamily**)pFamily); if (status == Ok) { - return TRUE; + return true; } - return FALSE; + return false; } -FX_BOOL CGdiplusExt::GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont) +bool CGdiplusExt::GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; GpStatus status = CallFunc(GdipCreateFont)((GpFontFamily*)pFamily, font_size, fontstyle, Unit(flag), (GpFont**)pFont); if (status == Ok) { - return TRUE; + return true; } - return FALSE; + return false; } void CGdiplusExt::GdipGetFontSize(void *pFont, FX_FLOAT *size) { @@ -608,16 +608,16 @@ void CGdiplusExt::GdipSetPageUnit(void* graphics, FX_DWORD unit) CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; CallFunc(GdipSetPageUnit)((GpGraphics*)graphics, (GpUnit)unit); } -FX_BOOL CGdiplusExt::GdipDrawDriverString(void *graphics, unsigned short *text, int length, +bool CGdiplusExt::GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; GpStatus status = CallFunc(GdipDrawDriverString)((GpGraphics*)graphics, (GDIPCONST UINT16 *)text, (INT)length, (GDIPCONST GpFont *)font, (GDIPCONST GpBrush*)brush, (GDIPCONST PointF *)positions, (INT)flags, (GDIPCONST GpMatrix *)matrix); if (status == Ok) { - return TRUE; + return true; } - return FALSE; + return false; } void CGdiplusExt::GdipCreateBrush(FX_DWORD fill_argb, void** pBrush) { @@ -684,7 +684,7 @@ void CGdiplusExt::GdipDeleteGraphics(void* graphics) CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; CallFunc(GdipDeleteGraphics)((GpGraphics*)graphics); } -FX_BOOL CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, +bool CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags) { ASSERT(pBitmap->GetBPP() == 1); @@ -699,9 +699,9 @@ FX_BOOL CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitma } OutputImageMask(pGraphics, bMonoDevice, pBitmap, dest_left, dest_top, dest_width, dest_height, argb, pClipRect); CallFunc(GdipDeleteGraphics)(pGraphics); - return TRUE; + return true; } -FX_BOOL CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, +bool CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, int flags) { GpGraphics* pGraphics; @@ -719,9 +719,9 @@ FX_BOOL CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int des OutputImage(pGraphics, pBitmap, &src_rect, dest_left, dest_top, dest_width, dest_height); CallFunc(GdipDeleteGraphics)(pGraphics); CallFunc(GdipDeleteGraphics)(pGraphics); - return TRUE; + return true; } -static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, DWORD argb, FX_BOOL bTextMode = FALSE) +static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, DWORD argb, bool bTextMode = false) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f; @@ -735,7 +735,7 @@ static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_Af CallFunc(GdipCreatePen1)((ARGB)argb, width, UnitWorld, &pPen); LineCap lineCap; DashCap dashCap = DashCapFlat; - FX_BOOL bDashExtend = FALSE; + bool bDashExtend = false; switch(pGraphState->m_LineCap) { case CFX_GraphStateData::LineCapButt: lineCap = LineCapFlat; @@ -743,11 +743,11 @@ static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_Af case CFX_GraphStateData::LineCapRound: lineCap = LineCapRound; dashCap = DashCapRound; - bDashExtend = TRUE; + bDashExtend = true; break; case CFX_GraphStateData::LineCapSquare: lineCap = LineCapSquare; - bDashExtend = TRUE; + bDashExtend = true; break; } CallFunc(GdipSetPenLineCap197819)(pPen, lineCap, lineCap, dashCap); @@ -839,10 +839,10 @@ static BOOL IsSmallTriangle(PointF* points, const CFX_AffineMatrix* pMatrix, int if (distance_square < (1.0f * 2 + 1.0f / 4)) { v1 = i; v2 = pair1; - return TRUE; + return true; } } - return FALSE; + return false; } BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, @@ -854,7 +854,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, { int nPoints = pPathData->GetPointCount(); if (nPoints == 0) { - return TRUE; + return true; } FX_PATHPOINT* pPoints = pPathData->GetPoints(); GpGraphics* pGraphics = NULL; @@ -870,9 +870,9 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, PointF *points = FX_Alloc(PointF, nPoints); BYTE * types = FX_Alloc(BYTE, nPoints); int nSubPathes = 0; - FX_BOOL bSubClose = FALSE; + bool bSubClose = false; int pos_subclose = 0; - FX_BOOL bSmooth = FALSE; + bool bSmooth = false; int startpoint = 0; for(int i = 0; i < nPoints; i++) { points[i].X = pPoints[i].m_PointX; @@ -900,7 +900,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, if(point_type == FXPT_MOVETO) { types[i] = PathPointTypeStart; nSubPathes ++; - bSubClose = FALSE; + bSubClose = false; startpoint = i; } else if (point_type == FXPT_LINETO) { types[i] = PathPointTypeLine; @@ -910,31 +910,31 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, continue; } if (!bSmooth && points[i].X != points[i - 1].X && points[i].Y != points[i - 1].Y) { - bSmooth = TRUE; + bSmooth = true; } } else if (point_type == FXPT_BEZIERTO) { types[i] = PathPointTypeBezier; - bSmooth = TRUE; + bSmooth = true; } if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE) { if (bSubClose) { types[pos_subclose] &= ~PathPointTypeCloseSubpath; } else { - bSubClose = TRUE; + bSubClose = true; } pos_subclose = i; types[i] |= PathPointTypeCloseSubpath; if (!bSmooth && points[i].X != points[startpoint].X && points[i].Y != points[startpoint].Y) { - bSmooth = TRUE; + bSmooth = true; } } } if (fill_mode & FXFILL_NOPATHSMOOTH) { - bSmooth = FALSE; + bSmooth = false; CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeNone); } else if (!(fill_mode & FXFILL_FULLCOVER)) { if (!bSmooth && (fill_mode & 3)) { - bSmooth = TRUE; + bSmooth = true; } if (bSmooth || (pGraphState && pGraphState->m_LineWidth > 2)) { CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeAntiAlias); @@ -949,7 +949,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, CallFunc(GdipDrawLineI)(pGraphics, pPen, FXSYS_round(points[v1].X), FXSYS_round(points[v1].Y), FXSYS_round(points[v2].X), FXSYS_round(points[v2].Y)); CallFunc(GdipDeletePen)(pPen); - return TRUE; + return true; } } GpPath* pGpPath = NULL; @@ -961,7 +961,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, FX_Free(points); FX_Free(types); CallFunc(GdipDeleteGraphics)(pGraphics); - return FALSE; + return false; } if (new_fill_mode) { GpBrush* pBrush = _GdipCreateBrush(fill_argb); @@ -994,7 +994,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData, FX_Free(types); CallFunc(GdipDeletePath)(pGpPath); CallFunc(GdipDeleteGraphics)(pGraphics); - return TRUE; + return true; } class GpStream final : public IStream { @@ -1229,7 +1229,7 @@ static void FreeDIBitmap(PREVIEW3_DIBITMAP* pInfo) } FX_Free(pInfo); } -CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha); +CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, bool bAlpha); CFX_DIBitmap* CGdiplusExt::LoadDIBitmap(WINDIB_Open_Args_ args) { PREVIEW3_DIBITMAP* pInfo = ::LoadDIBitmap(args); diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 86dbf9bb0a..63c3849237 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -18,7 +18,7 @@ CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_PRINT { m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE); m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE); - m_bSupportROP = TRUE; + m_bSupportROP = true; } int CGdiPrinterDriver::GetDeviceCaps(int caps_id) { @@ -30,7 +30,7 @@ int CGdiPrinterDriver::GetDeviceCaps(int caps_id) } return CGdiDeviceDriver::GetDeviceCaps(caps_id); } -FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +bool CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, int alpha_flag, void* pIccTransform) { if (pSource->IsAlphaMask()) { @@ -41,28 +41,28 @@ FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD colo ASSERT(pSource != NULL && !pSource->IsAlphaMask() && pSrcRect != NULL); ASSERT(blend_type == FXDIB_BLEND_NORMAL); if (pSource->HasAlpha()) { - return FALSE; + return false; } CFX_DIBExtractor temp(pSource); CFX_DIBitmap* pBitmap = temp; if (pBitmap == NULL) { - return FALSE; + return false; } return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform); } -FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, +bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, 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, void* pIccTransform, int blend_type) { if (pSource->IsAlphaMask()) { int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); if (pSource->GetBPP() != 1 || alpha != 255 || !m_bSupportROP) { - return FALSE; + return false; } if (dest_width < 0 || dest_height < 0) { CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0); if (pFlipped == NULL) { - return FALSE; + return false; } if (dest_width < 0) { dest_left += dest_width; @@ -70,24 +70,24 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD if (dest_height < 0) { dest_top += dest_height; } - FX_BOOL ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform); + bool ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform); delete pFlipped; return ret; } CFX_DIBExtractor temp(pSource); CFX_DIBitmap* pBitmap = temp; if (pBitmap == NULL) { - return FALSE; + return false; } return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest_height, color, flags, alpha_flag, pIccTransform); } if (pSource->HasAlpha()) { - return FALSE; + return false; } if (dest_width < 0 || dest_height < 0) { CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0); if (pFlipped == NULL) { - return FALSE; + return false; } if (dest_width < 0) { dest_left += dest_width; @@ -95,14 +95,14 @@ FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD if (dest_height < 0) { dest_top += dest_height; } - FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform); + bool ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform); delete pFlipped; return ret; } CFX_DIBExtractor temp(pSource); CFX_DIBitmap* pBitmap = temp; if (pBitmap == NULL) { - return FALSE; + return false; } return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform); } @@ -189,18 +189,18 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af } return pTempBitmap; } -FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color, +bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_type) { if (bitmap_alpha < 255 || pSource->HasAlpha() || (pSource->IsAlphaMask() && (pSource->GetBPP() != 1 || !m_bSupportROP))) { - return FALSE; + return false; } CFX_FloatRect unit_rect = pMatrix->GetUnitRect(); FX_RECT full_rect = unit_rect.GetOutterRect(); if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) { - FX_BOOL bFlipX = pMatrix->a < 0; - FX_BOOL bFlipY = pMatrix->d > 0; + bool bFlipX = pMatrix->a < 0; + bool bFlipY = pMatrix->d > 0; return StretchDIBits(pSource, color, bFlipX ? full_rect.right : full_rect.left, bFlipY ? full_rect.bottom : full_rect.top, bFlipX ? -full_rect.Width() : full_rect.Width(), bFlipY ? -full_rect.Height() : full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); @@ -208,9 +208,9 @@ FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_ if (FXSYS_fabs(pMatrix->a) < 0.5f && FXSYS_fabs(pMatrix->d) < 0.5f) { CFX_DIBitmap* pTransformed = pSource->SwapXY(pMatrix->c > 0, pMatrix->b < 0); if (pTransformed == NULL) { - return FALSE; + return false; } - FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, + bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); delete pTransformed; return ret; @@ -218,20 +218,20 @@ FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_ if (pSource->GetBPP() == 1) { CFX_DIBitmap* pTransformed = Transform1bppBitmap(pSource, pMatrix); if (pIccTransform == NULL) { - return FALSE; + return false; } SaveState(); CFX_PathData path; path.AppendRect(0, 0, 1.0f, 1.0f); SetClip_PathFill(&path, pMatrix, WINDING); - FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, + bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, alpha_flag, pIccTransform, blend_type); RestoreState(); delete pTransformed; handle = NULL; return ret; } - return FALSE; + return false; } CPSOutput::CPSOutput(HDC hDC) { @@ -266,14 +266,14 @@ void CPSOutput::OutputPS(const FX_CHAR* string, int len) CPSPrinterDriver::CPSPrinterDriver() { m_pPSOutput = NULL; - m_bCmykOutput = FALSE; + m_bCmykOutput = false; } CPSPrinterDriver::~CPSPrinterDriver() { EndRendering(); delete m_pPSOutput; } -FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) +bool CPSPrinterDriver::Init(HDC hDC, int pslevel, bool bCmykOutput) { m_hDC = hDC; m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE); @@ -305,7 +305,7 @@ FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) } } ::DeleteObject(hRgn); - return TRUE; + return true; } int CPSPrinterDriver::GetDeviceCaps(int caps_id) { @@ -327,7 +327,7 @@ int CPSPrinterDriver::GetDeviceCaps(int caps_id) } return 0; } -FX_BOOL CPSPrinterDriver::StartRendering() +bool CPSPrinterDriver::StartRendering() { return m_PSRenderer.StartRendering(); } @@ -339,69 +339,69 @@ void CPSPrinterDriver::SaveState() { m_PSRenderer.SaveState(); } -void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved) +void CPSPrinterDriver::RestoreState(bool bKeepSaved) { m_PSRenderer.RestoreState(bKeepSaved); } -FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, +bool CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode) { m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode); - return TRUE; + return true; } -FX_BOOL CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData, +bool CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState) { m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState); - return TRUE; + return true; } -FX_BOOL CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData, +bool CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_ARGB fill_color, FX_ARGB stroke_color, int fill_mode, int alpha_flag, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } return m_PSRenderer.DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode & 3, alpha_flag, pIccTransform); } -FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect) +bool CPSPrinterDriver::GetClipBox(FX_RECT* pRect) { *pRect = m_PSRenderer.GetClipBox(); - return TRUE; + return true; } -FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +bool CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, int alpha_flag, void* pIccTransform) { if (blend_type != FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } return m_PSRenderer.SetDIBits(pBitmap, color, left, top, alpha_flag, pIccTransform); } -FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, +bool CPSPrinterDriver::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, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } return m_PSRenderer.StretchDIBits(pBitmap, color, dest_left, dest_top, dest_width, dest_height, flags, alpha_flag, pIccTransform); } -FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, +bool CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) { - return FALSE; + return false; } if (bitmap_alpha < 255) { - return FALSE; + return false; } handle = NULL; return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_flag, pIccTransform); } -FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, +bool CPSPrinterDriver::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, void* pIccTransform) { diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h index 569c4f6baa..f9b6a639b9 100644 --- a/core/src/fxge/win32/win32_int.h +++ b/core/src/fxge/win32/win32_int.h @@ -13,15 +13,15 @@ public: CGdiplusExt(); ~CGdiplusExt(); void Load(); - FX_BOOL IsAvailable() + bool IsAvailable() { return m_hModule != NULL; } - FX_BOOL StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + bool StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags); - FX_BOOL StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + bool StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, int flags); - FX_BOOL DrawPath(HDC hDC, const CFX_PathData* pPathData, + bool DrawPath(HDC hDC, const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState, FX_DWORD fill_argb, @@ -31,26 +31,26 @@ public: void* LoadMemFont(uint8_t* pData, FX_DWORD size); void DeleteMemFont(void* pFontCollection); - FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics); + bool GdipCreateFromImage(void* bitmap, void** graphics); void GdipDeleteGraphics(void* graphics); void GdipSetTextRenderingHint(void* graphics, int mode); void GdipSetPageUnit(void* graphics, FX_DWORD unit); void GdipSetWorldTransform(void* graphics, void* pMatrix); - FX_BOOL GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix); + bool GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix); void GdipCreateBrush(FX_DWORD fill_argb, void** pBrush); void GdipDeleteBrush(void* pBrush); void GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, void** matrix); void GdipDeleteMatrix(void* matrix); - FX_BOOL GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily); + bool GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily); void GdipDeleteFontFamily(void* pFamily); - FX_BOOL GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont); + bool GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont); void* GdipCreateFontFromCollection(void* pFontCollection, FX_FLOAT font_size, int fontstyle); void GdipDeleteFont(void* pFont); - FX_BOOL GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap); + bool GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap); void GdipDisposeImage(void* bitmap); void GdipGetFontSize(void *pFont, FX_FLOAT *size); void* GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void* pdv, FX_DWORD* num_face); - FX_BOOL GdiRemoveFontMemResourceEx(void* handle); + bool GdiRemoveFontMemResourceEx(void* handle); void* m_Functions[100]; void* m_pGdiAddFontMemResourceEx; void* m_pGdiRemoveFontMemResourseEx; @@ -63,7 +63,7 @@ protected: class CWin32Platform { public: - FX_BOOL m_bHalfTone; + bool m_bHalfTone; CGdiplusExt m_GdiplusExt; CDWriteExt m_DWriteExt; }; @@ -75,22 +75,22 @@ protected: { SaveDC(m_hDC); } - virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) + virtual void RestoreState(bool bKeepSaved = false) { RestoreDC(m_hDC, -1); if (bKeepSaved) { SaveDC(m_hDC); } } - virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + 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, @@ -100,26 +100,26 @@ protected: void* pIccTransform, int blend_type ); - virtual FX_BOOL FillRect(const FX_RECT* pRect, + virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type); - 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, void* pIccTransform, int blend_type); virtual void* GetClipRgn() ; - virtual FX_BOOL SetClipRgn(void* pRgn) ; - virtual FX_BOOL GetClipBox(FX_RECT* pRect); - virtual FX_BOOL DeleteDeviceRgn(void* pRgn); + virtual bool SetClipRgn(void* pRgn) ; + virtual bool GetClipBox(FX_RECT* pRect); + virtual bool DeleteDeviceRgn(void* pRgn); virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2); virtual void* GetPlatformSurface() { return (void*)m_hDC; } - FX_BOOL GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top, + bool GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform); - FX_BOOL GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + bool GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform); - FX_BOOL GDI_StretchBitMask(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + bool GDI_StretchBitMask(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags, int alpha_flag, void* pIccTransform); HDC m_hDC; @@ -133,19 +133,19 @@ class CGdiDisplayDriver : public CGdiDeviceDriver public: CGdiDisplayDriver(HDC hDC); protected: - 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, int left, int top, int blend_type, + 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 left, int top, int blend_type, int alpha_flag, void* pIccTransform); - 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, void* pIccTransform, int blend_type); - 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 render_flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_type) { - return FALSE; + return false; } - FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, + bool UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); }; @@ -155,16 +155,16 @@ public: CGdiPrinterDriver(HDC hDC); protected: virtual int GetDeviceCaps(int caps_id); - virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, + virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, int alpha_flag, void* pIccTransform); - 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, void* pIccTransform, int blend_type); - 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 render_flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_type); int m_HorzSize, m_VertSize; - FX_BOOL m_bSupportROP; + bool m_bSupportROP; }; class CPSOutput : public IFX_PSOutput { @@ -184,27 +184,27 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { public: CPSPrinterDriver(); - FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput); + bool Init(HDC hDC, int ps_level, bool bCmykOutput); ~CPSPrinterDriver(); protected: - virtual FX_BOOL IsPSPrintDriver() + virtual bool IsPSPrintDriver() { - return TRUE; + return true; } virtual int GetDeviceCaps(int caps_id); - virtual FX_BOOL StartRendering(); + virtual bool StartRendering(); virtual void EndRendering(); virtual void SaveState(); - virtual void RestoreState(FX_BOOL bKeepSaved = FALSE); - virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, + virtual void RestoreState(bool bKeepSaved = false); + 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, @@ -214,16 +214,16 @@ protected: void* pIccTransform, int blend_type ); - virtual FX_BOOL GetClipBox(FX_RECT* pRect); - virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, + virtual bool GetClipBox(FX_RECT* pRect); + virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, int alpha_flag, void* pIccTransform); - 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, void* pIccTransform, int blend_type); - 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 render_flags, void*& handle, int alpha_flag, void* pIccTransform, int blend_type); - 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, void* pIccTransform); virtual void* GetPlatformSurface() @@ -231,7 +231,7 @@ protected: return (void*)m_hDC; } HDC m_hDC; - FX_BOOL m_bCmykOutput; + bool m_bCmykOutput; int m_Width, m_Height, m_nBitsPerPixel; int m_HorzSize, m_VertSize; CPSOutput* m_pPSOutput; |