From 8d2aae7ee320da3a8ffe01c57e38b3f98443257d Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Jul 2015 12:08:12 -0700 Subject: Revert "FX Bool considered harmful, part 3" This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255293002 . --- core/src/fxge/win32/dwrite_int.h | 6 +- core/src/fxge/win32/fx_win32_device.cpp | 198 +++++++++++++++---------------- core/src/fxge/win32/fx_win32_dib.cpp | 12 +- core/src/fxge/win32/fx_win32_dwrite.cpp | 18 +-- core/src/fxge/win32/fx_win32_gdipext.cpp | 90 +++++++------- core/src/fxge/win32/fx_win32_print.cpp | 86 +++++++------- core/src/fxge/win32/win32_int.h | 94 +++++++-------- 7 files changed, 252 insertions(+), 252 deletions(-) (limited to 'core/src/fxge/win32') diff --git a/core/src/fxge/win32/dwrite_int.h b/core/src/fxge/win32/dwrite_int.h index 4896161547..dc2a338935 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(); - bool IsAvailable() + FX_BOOL IsAvailable() { return m_pDWriteFactory != NULL; } void* DwCreateFontFaceFromStream(uint8_t* pData, FX_DWORD size, int simulation_style); - bool DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget); + FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget); void DwDeleteRenderingTarget(void* renderTarget); - bool DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix, + FX_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 e6667b17ec..18bcc595a4 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 bool EnumFontList(CFX_FontMapper* pMapper); - virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, bool& bExact); + 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 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 bool GetFaceName(void* hFont, CFX_ByteString& name); - virtual bool GetFontCharset(void* hFont, int& charset); - bool IsOpenTypeFromDiv(const LOGFONTA *plf); - bool IsSupportFontFormDiv(const LOGFONTA* plf); + 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); 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) -bool CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf) +FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf) { HFONT hFont = CreateFontIndirectA(plf); - bool ret = false; + FX_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 @@ 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; } -bool CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) +FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) { HFONT hFont = CreateFontIndirectA(plf); - bool ret = false; + FX_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 @@ 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; } -bool CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper) +FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper) { m_pMapper = pMapper; LOGFONTA lf; @@ -151,7 +151,7 @@ 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; - bool m_bBold; - bool m_bItalic; + FX_BOOL m_bBold; + FX_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); } } -bool _GetSubFontName(CFX_ByteString& name) +FX_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, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, bool& bExact) +void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact) { CFX_ByteString face = cstr_face; int iBaseFont; @@ -294,7 +294,7 @@ void* CWin32FontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_f 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; } -bool CWin32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name) +FX_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; } -bool CWin32FontInfo::GetFontCharset(void* hFont, int& charset) +FX_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; } -bool CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform) +FX_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 @@ bool CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT 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 @@ bool CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT delete pBitmap; } } - return true; + return TRUE; } -bool CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top, +FX_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 @@ bool CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_ if (del) { delete pToStrechBitmap; } - return true; + return TRUE; } -bool CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top, +FX_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 @@ bool CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest SelectObject(m_hDC, hOld); DeleteObject(hPattern); - return true; + return TRUE; } BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect) { return ::GetClipBox(m_hDC, (RECT*)pRect); } -bool CGdiDeviceDriver::SetClipRgn(void* hRgn) +FX_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 bool _MatrixNoScaled(const CFX_AffineMatrix* pMatrix) +static FX_BOOL _MatrixNoScaled(const CFX_AffineMatrix* pMatrix) { return pMatrix->GetA() == 1.0f && pMatrix->GetB() == 0 && pMatrix->GetC() == 0 && pMatrix->GetD() == 1.0f; } -bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, +FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix, const CFX_GraphStateData* pGraphState, FX_DWORD fill_color, @@ -765,7 +765,7 @@ 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 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, } int fill_alpha = FXARGB_A(fill_color); int stroke_alpha = FXARGB_A(stroke_color); - bool bDrawAlpha = (fill_alpha > 0 && fill_alpha < 255) || (stroke_alpha > 0 && stroke_alpha < 255 && pGraphState); + FX_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 @@ 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 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, hBrush = (HBRUSH)SelectObject(m_hDC, hBrush); DeleteObject(hBrush); } - return true; + return TRUE; } -bool CGdiDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type) +FX_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; } -bool CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, +FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix, int fill_mode ) @@ -884,15 +884,15 @@ 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; } -bool CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, +FX_BOOL CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix, const CFX_GraphStateData* pGraphState ) @@ -902,23 +902,23 @@ bool CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, _SetPathToDC(m_hDC, pPathData, pMatrix); WidenPath(m_hDC); SetPolyFillMode(m_hDC, WINDING); - bool ret = SelectClipPath(m_hDC, RGN_AND); + FX_BOOL ret = SelectClipPath(m_hDC, RGN_AND); hPen = (HPEN)SelectObject(m_hDC, hPen); DeleteObject(hPen); return ret; } -bool CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, +FX_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 @@ bool CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, F LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2)); hPen = (HPEN)SelectObject(m_hDC, hPen); DeleteObject(hPen); - return true; + return TRUE; } -bool CGdiDeviceDriver::DeleteDeviceRgn(void* pRgn) +FX_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; } } -bool CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge) +FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge) { - bool ret = false; + FX_BOOL ret = FALSE; int width = pBitmap->GetWidth(); int height = pBitmap->GetHeight(); HBITMAP hbmp = CreateCompatibleBitmap(m_hDC, width, height); @@ -969,7 +969,7 @@ bool CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void ::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 @@ bool CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void DeleteObject(hDCMemory); return ret; } -bool CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +FX_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); - bool bGDI = pSource->GetBPP() == 1 && alpha == 255; + FX_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 @@ bool CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, 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 @@ bool CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, if (pBitmap) { return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform); } - return false; + return FALSE; } -bool CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, +FX_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 @@ bool CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_D 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()); - bool ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform); + FX_BOOL ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform); delete pStretched; return ret; } -bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, +FX_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 @@ bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col 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); - bool ret = SetDIBits(&background, 0, &src_rect, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL, 0, NULL); + 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); delete pStretched; return ret; } @@ -1083,7 +1083,7 @@ bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col 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 @@ bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col 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, bool bCmykOutput, bool bForcePSOutput, int psLevel) +CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput, FX_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, bool bCmykOutput) +IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, FX_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 610c69e4b1..3dcfce4802 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, bool bAlpha) +CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_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; - bool ret = pBitmap->Create(width, height, format); + FX_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, bool bA } 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) { - bool bCreatedDC = hDC == NULL; + FX_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 8533343926..65a35d86a1 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; } -bool CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTarget) +FX_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 @@ bool CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTar SafeRelease(&pGdiInterop); SafeRelease(&pBitmapRenderTarget); SafeRelease(&pRenderingParams); - return true; + return TRUE; failed: SafeRelease(&pGdiInterop); SafeRelease(&pBitmapRenderTarget); SafeRelease(&pRenderingParams); - return false; + return FALSE; } -bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix, +FX_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 @@ bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_R FX_FLOAT* glyph_advances) { if (renderTarget == NULL) { - return true; + return TRUE; } CDwGdiTextRenderer* pTextRenderer = (CDwGdiTextRenderer*)renderTarget; DWRITE_MATRIX transform; @@ -247,7 +247,7 @@ bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_R 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 @@ bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_R &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 94fac69157..d76d52e50b 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; } -bool CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle) +FX_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) { - bool bFlipX = dest_width < 0; + FX_BOOL bFlipX = dest_width < 0; if (bFlipX) { dest_width = -dest_width; } - bool bFlipY = dest_height < 0; + FX_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); } -bool CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap) +FX_BOOL CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap) { CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; PixelFormat format; @@ -551,41 +551,41 @@ 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; } -bool CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics) +FX_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; } -bool CGdiplusExt::GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily) +FX_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; } -bool CGdiplusExt::GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont) +FX_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); } -bool CGdiplusExt::GdipDrawDriverString(void *graphics, unsigned short *text, int length, +FX_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); } -bool CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, +FX_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 @@ bool CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* } OutputImageMask(pGraphics, bMonoDevice, pBitmap, dest_left, dest_top, dest_width, dest_height, argb, pClipRect); CallFunc(GdipDeleteGraphics)(pGraphics); - return true; + return TRUE; } -bool CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, +FX_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 @@ bool CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_l 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, bool bTextMode = false) +static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, DWORD argb, FX_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; - bool bDashExtend = false; + FX_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; - bool bSubClose = false; + FX_BOOL bSubClose = FALSE; int pos_subclose = 0; - bool bSmooth = false; + FX_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, bool bAlpha); +CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_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 63c3849237..86dbf9bb0a 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); } -bool CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +FX_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 @@ bool CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, 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); } -bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, +FX_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 @@ bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col if (dest_height < 0) { dest_top += dest_height; } - bool ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform); + FX_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 @@ bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col if (dest_height < 0) { dest_top += dest_height; } - bool ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform); + FX_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; } -bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color, +FX_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) { - bool bFlipX = pMatrix->a < 0; - bool bFlipY = pMatrix->d > 0; + FX_BOOL bFlipX = pMatrix->a < 0; + FX_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 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alp 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; } - bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, + FX_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 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alp 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); - bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0, + FX_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; } -bool CPSPrinterDriver::Init(HDC hDC, int pslevel, bool bCmykOutput) +FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput) { m_hDC = hDC; m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE); @@ -305,7 +305,7 @@ bool CPSPrinterDriver::Init(HDC hDC, int pslevel, 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; } -bool CPSPrinterDriver::StartRendering() +FX_BOOL CPSPrinterDriver::StartRendering() { return m_PSRenderer.StartRendering(); } @@ -339,69 +339,69 @@ void CPSPrinterDriver::SaveState() { m_PSRenderer.SaveState(); } -void CPSPrinterDriver::RestoreState(bool bKeepSaved) +void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved) { m_PSRenderer.RestoreState(bKeepSaved); } -bool CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, +FX_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; } -bool CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData, +FX_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; } -bool CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData, +FX_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); } -bool CPSPrinterDriver::GetClipBox(FX_RECT* pRect) +FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect) { *pRect = m_PSRenderer.GetClipBox(); - return true; + return TRUE; } -bool CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, +FX_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); } -bool CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, +FX_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); } -bool CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, +FX_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); } -bool CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, +FX_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 f9b6a639b9..569c4f6baa 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(); - bool IsAvailable() + FX_BOOL IsAvailable() { return m_hModule != NULL; } - bool StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + FX_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); - bool StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + FX_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); - bool DrawPath(HDC hDC, const CFX_PathData* pPathData, + FX_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); - bool GdipCreateFromImage(void* bitmap, void** graphics); + FX_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); - bool GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix); + FX_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); - bool GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily); + FX_BOOL GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily); void GdipDeleteFontFamily(void* pFamily); - bool GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont); + FX_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); - bool GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap); + FX_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); - bool GdiRemoveFontMemResourceEx(void* handle); + FX_BOOL GdiRemoveFontMemResourceEx(void* handle); void* m_Functions[100]; void* m_pGdiAddFontMemResourceEx; void* m_pGdiRemoveFontMemResourseEx; @@ -63,7 +63,7 @@ protected: class CWin32Platform { public: - bool m_bHalfTone; + FX_BOOL m_bHalfTone; CGdiplusExt m_GdiplusExt; CDWriteExt m_DWriteExt; }; @@ -75,22 +75,22 @@ protected: { SaveDC(m_hDC); } - virtual void RestoreState(bool bKeepSaved = false) + virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) { RestoreDC(m_hDC, -1); if (bKeepSaved) { SaveDC(m_hDC); } } - virtual bool SetClip_PathFill(const CFX_PathData* pPathData, + virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ); - virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, + virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ); - virtual bool DrawPath(const CFX_PathData* pPathData, + virtual FX_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 bool FillRect(const FX_RECT* pRect, + virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type); - virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color, + virtual FX_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 bool SetClipRgn(void* pRgn) ; - virtual bool GetClipBox(FX_RECT* pRect); - virtual bool DeleteDeviceRgn(void* pRgn); + virtual FX_BOOL SetClipRgn(void* pRgn) ; + virtual FX_BOOL GetClipBox(FX_RECT* pRect); + virtual FX_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; } - bool GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top, + FX_BOOL GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform); - bool GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + FX_BOOL GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform); - bool GDI_StretchBitMask(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top, + FX_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 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, + 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, int alpha_flag, void* pIccTransform); - virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + virtual FX_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 bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, + virtual FX_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; } - bool UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top, + FX_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 bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type, + virtual FX_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 bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + virtual FX_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 bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, + virtual FX_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; - bool m_bSupportROP; + FX_BOOL m_bSupportROP; }; class CPSOutput : public IFX_PSOutput { @@ -184,27 +184,27 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { public: CPSPrinterDriver(); - bool Init(HDC hDC, int ps_level, bool bCmykOutput); + FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput); ~CPSPrinterDriver(); protected: - virtual bool IsPSPrintDriver() + virtual FX_BOOL IsPSPrintDriver() { - return true; + return TRUE; } virtual int GetDeviceCaps(int caps_id); - virtual bool StartRendering(); + virtual FX_BOOL StartRendering(); virtual void EndRendering(); virtual void SaveState(); - virtual void RestoreState(bool bKeepSaved = false); - virtual bool SetClip_PathFill(const CFX_PathData* pPathData, + virtual void RestoreState(FX_BOOL bKeepSaved = FALSE); + virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, int fill_mode ); - virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, + virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device, const CFX_GraphStateData* pGraphState ); - virtual bool DrawPath(const CFX_PathData* pPathData, + virtual FX_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 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, + 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, int alpha_flag, void* pIccTransform); - virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top, + virtual FX_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 bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color, + virtual FX_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 bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, + virtual FX_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; - bool m_bCmykOutput; + FX_BOOL m_bCmykOutput; int m_Width, m_Height, m_nBitsPerPixel; int m_HorzSize, m_VertSize; CPSOutput* m_pPSOutput; -- cgit v1.2.3