summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-23 13:36:00 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-23 13:36:00 -0700
commitf1e7c461dfabbff6b65a072f24f6711b34159361 (patch)
tree3b0bb772a59669f06b86824a444fd06642592d4b /core/src/fxge/ge
parent320b2313d19869333ed453af546e61a9fc2b81c9 (diff)
downloadpdfium-f1e7c461dfabbff6b65a072f24f6711b34159361.tar.xz
Revert "FX_BOOL considered harmful, part 2."
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9. Reason for revert: build failure. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255693002 .
Diffstat (limited to 'core/src/fxge/ge')
-rw-r--r--core/src/fxge/ge/fx_ge_device.cpp94
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp72
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp120
-rw-r--r--core/src/fxge/ge/fx_ge_linux.cpp20
-rw-r--r--core/src/fxge/ge/fx_ge_path.cpp68
-rw-r--r--core/src/fxge/ge/fx_ge_ps.cpp64
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp94
-rw-r--r--core/src/fxge/ge/text_int.h12
8 files changed, 272 insertions, 272 deletions
diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp
index ecdd1b0183..0baa99cdc7 100644
--- a/core/src/fxge/ge/fx_ge_device.cpp
+++ b/core/src/fxge/ge/fx_ge_device.cpp
@@ -35,7 +35,7 @@ void CFX_RenderDevice::InitDeviceInfo()
m_ClipBox.bottom = m_Height;
}
}
-bool CFX_RenderDevice::StartRendering()
+FX_BOOL CFX_RenderDevice::StartRendering()
{
return m_pDeviceDriver->StartRendering();
}
@@ -47,7 +47,7 @@ void CFX_RenderDevice::SaveState()
{
m_pDeviceDriver->SaveState();
}
-void CFX_RenderDevice::RestoreState(bool bKeepSaved)
+void CFX_RenderDevice::RestoreState(FX_BOOL bKeepSaved)
{
m_pDeviceDriver->RestoreState(bKeepSaved);
UpdateClipBox();
@@ -60,7 +60,7 @@ CFX_Matrix CFX_RenderDevice::GetCTM() const
{
return m_pDeviceDriver->GetCTM();
}
-bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
+FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
{
if (m_RenderCaps & FXRC_CMYK_OUTPUT) {
return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Cmyka : FXDIB_Cmyk);
@@ -74,37 +74,37 @@ bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int
return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb);
#endif
}
-bool CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
+FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
)
{
if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device, fill_mode)) {
- return false;
+ return FALSE;
}
UpdateClipBox();
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
+FX_BOOL CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
)
{
if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, pGraphState)) {
- return false;
+ return FALSE;
}
UpdateClipBox();
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
+FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
{
CFX_PathData path;
path.AppendRect((FX_FLOAT)(pRect->left), (FX_FLOAT)(pRect->bottom), (FX_FLOAT)(pRect->right), (FX_FLOAT)(pRect->top));
if (!SetClip_PathFill(&path, NULL, FXFILL_WINDING)) {
- return false;
+ return FALSE;
}
UpdateClipBox();
- return true;
+ return TRUE;
}
void CFX_RenderDevice::UpdateClipBox()
{
@@ -116,7 +116,7 @@ void CFX_RenderDevice::UpdateClipBox()
m_ClipBox.right = m_Width;
m_ClipBox.bottom = m_Height;
}
-bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode,
@@ -149,7 +149,7 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
y2 = pPoints[1].m_PointY;
}
DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, alpha_flag, pIccTransform, blend_type);
- return true;
+ return TRUE;
}
if ((pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && stroke_alpha == 0) {
CFX_FloatRect rect_f;
@@ -184,13 +184,13 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
}
}
if (FillRect(&rect_i, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return true;
+ return TRUE;
}
}
}
if((fill_mode & 3) && stroke_alpha == 0 && !(fill_mode & FX_FILL_STROKE) && !(fill_mode & FX_FILL_TEXT_MODE)) {
CFX_PathData newPath;
- bool bThin = false;
+ FX_BOOL bThin = FALSE;
if (pPathData->GetZeroAreaPath(newPath, (CFX_Matrix*)pObject2Device, bThin, m_pDeviceDriver->GetDriverType())) {
CFX_GraphStateData graphState;
graphState.m_LineWidth = 0.0f;
@@ -215,7 +215,7 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
}
if ((fill_mode & 3) && fill_alpha && stroke_alpha < 0xff && (fill_mode & FX_FILL_STROKE)) {
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
CFX_FloatRect bbox;
if (pGraphState) {
@@ -232,19 +232,19 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
FX_RECT rect = bbox.GetOutterRect();
CFX_DIBitmap bitmap, Backdrop;
if (!CreateCompatibleBitmap(&bitmap, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY))) {
- return false;
+ return FALSE;
}
if (bitmap.HasAlpha()) {
bitmap.Clear(0);
Backdrop.Copy(&bitmap);
} else {
if (!m_pDeviceDriver->GetDIBits(&bitmap, rect.left, rect.top, NULL)) {
- return false;
+ return FALSE;
}
Backdrop.Copy(&bitmap);
}
CFX_FxgeDevice bitmap_device;
- bitmap_device.Attach(&bitmap, 0, false, &Backdrop, true);
+ bitmap_device.Attach(&bitmap, 0, FALSE, &Backdrop, TRUE);
CFX_AffineMatrix matrix;
if (pObject2Device) {
matrix = *pObject2Device;
@@ -252,51 +252,51 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
matrix.TranslateI(-rect.left, -rect.top);
matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
if (!bitmap_device.GetDeviceDriver()->DrawPath(pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return false;
+ return FALSE;
}
FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY));
return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, FXDIB_BLEND_NORMAL);
}
return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type);
}
-bool CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) {
- return true;
+ return TRUE;
}
FX_RECT rect(x, y, x + 1, y + 1);
return FillRect(&rect, color, alpha_flag, pIccTransform);
}
-bool CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
{
if (m_pDeviceDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return true;
+ return TRUE;
}
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
CFX_DIBitmap bitmap;
if (!CreateCompatibleBitmap(&bitmap, pRect->Width(), pRect->Height())) {
- return false;
+ return FALSE;
}
if (!m_pDeviceDriver->GetDIBits(&bitmap, pRect->left, pRect->top)) {
- return false;
+ return FALSE;
}
if (!bitmap.CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color, alpha_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height());
m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, pRect->left, pRect->top, FXDIB_BLEND_NORMAL);
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
{
if (((m_RenderCaps & FXRC_ALPHA_PATH) &&
(FXGETFLAG_COLORTYPE(alpha_flag) && FXGETFLAG_ALPHA_FILL(alpha_flag) == 0xff)) ||
color >= 0xff000000)
if (m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, alpha_flag, pIccTransform, blend_type)) {
- return true;
+ return TRUE;
}
CFX_GraphStateData graph_state;
CFX_PathData path;
@@ -305,10 +305,10 @@ bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, F
path.SetPoint(1, x2, y2, FXPT_LINETO);
return m_pDeviceDriver->DrawPath(&path, NULL, &graph_state, 0, color, fill_mode, alpha_flag, pIccTransform, blend_type);
}
-bool CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
+FX_BOOL CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
{
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
return m_pDeviceDriver->GetDIBits(pBitmap, left, top, pIccTransform);
}
@@ -316,7 +316,7 @@ CFX_DIBitmap* CFX_RenderDevice::GetBackDrop()
{
return m_pDeviceDriver->GetBackDrop();
}
-bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
+FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
void* pIccTransform)
{
ASSERT(!pBitmap->IsAlphaMask());
@@ -326,7 +326,7 @@ bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top
FX_RECT dest_rect(left, top, FXSYS_round(left + pBitmap->GetWidth() / fScaleX), FXSYS_round(top + pBitmap->GetHeight() / fScaleY));
dest_rect.Intersect(m_ClipBox);
if (dest_rect.IsEmpty()) {
- return true;
+ return TRUE;
}
FX_RECT src_rect(dest_rect.left - left, dest_rect.top - top,
dest_rect.left - left + dest_rect.Width(), dest_rect.top - top + dest_rect.Height());
@@ -337,29 +337,29 @@ bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top
if ((blend_mode != FXDIB_BLEND_NORMAL && !(m_RenderCaps & FXRC_BLEND_MODE)) ||
(pBitmap->HasAlpha() && !(m_RenderCaps & FXRC_ALPHA_IMAGE))) {
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
int bg_pixel_width = FXSYS_round(dest_rect.Width() * fScaleX);
int bg_pixel_height = FXSYS_round(dest_rect.Height() * fScaleY);
CFX_DIBitmap background;
if (!background.Create(bg_pixel_width, bg_pixel_height,
(m_RenderCaps & FXRC_CMYK_OUTPUT) ? FXDIB_Cmyk : FXDIB_Rgb32)) {
- return false;
+ return FALSE;
}
if (!m_pDeviceDriver->GetDIBits(&background, dest_rect.left, dest_rect.top)) {
- return false;
+ return FALSE;
}
if (!background.CompositeBitmap(0, 0, bg_pixel_width, bg_pixel_height,
pBitmap, src_rect.left, src_rect.top,
- blend_mode, NULL, false, pIccTransform)) {
- return false;
+ blend_mode, NULL, FALSE, pIccTransform)) {
+ return FALSE;
}
FX_RECT src_rect(0, 0, bg_pixel_width, bg_pixel_height);
return m_pDeviceDriver->SetDIBits(&background, 0, &src_rect, dest_rect.left, dest_rect.top, FXDIB_BLEND_NORMAL);
}
return m_pDeviceDriver->SetDIBits(pBitmap, 0, &src_rect, dest_rect.left, dest_rect.top, blend_mode, 0, pIccTransform);
}
-bool CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
+FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
int dest_width, int dest_height, FX_DWORD flags,
void* pIccTransform, int blend_mode)
{
@@ -367,17 +367,17 @@ bool CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int
FX_RECT clip_box = m_ClipBox;
clip_box.Intersect(dest_rect);
if (clip_box.IsEmpty()) {
- return true;
+ return TRUE;
}
return m_pDeviceDriver->StretchDIBits(pBitmap, 0, left, top, dest_width, dest_height, &clip_box, flags, 0, pIccTransform, blend_mode);
}
-bool CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
+FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
int alpha_flag, void* pIccTransform)
{
FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
return m_pDeviceDriver->SetDIBits(pBitmap, argb, &src_rect, left, top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
}
-bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
+FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
int dest_width, int dest_height, FX_DWORD argb, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -386,13 +386,13 @@ bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, in
clip_box.Intersect(dest_rect);
return m_pDeviceDriver->StretchDIBits(pBitmap, argb, left, top, dest_width, dest_height, &clip_box, flags, alpha_flag, pIccTransform);
}
-bool CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
+FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_mode)
{
return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, alpha_flag, pIccTransform, blend_mode);
}
-bool CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause)
+FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause)
{
return m_pDeviceDriver->ContinueDIBits(handle, pPause);
}
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index 7a5e0ccabd..6a950bf20b 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -13,8 +13,8 @@ CFX_Font::CFX_Font()
{
m_pSubstFont = NULL;
m_Face = NULL;
- m_bEmbedded = false;
- m_bVertical = false;
+ m_bEmbedded = FALSE;
+ m_bVertical = FALSE;
m_pFontData = NULL;
m_pFontDataAllocation = NULL;
m_dwSize = 0;
@@ -24,7 +24,7 @@ CFX_Font::CFX_Font()
m_pPlatformFontCollection = NULL;
m_pDwFont = NULL;
m_hHandle = NULL;
- m_bDwLoaded = false;
+ m_bDwLoaded = FALSE;
}
CFX_Font::~CFX_Font()
{
@@ -61,10 +61,10 @@ void CFX_Font::DeleteFace()
FXFT_Done_Face(m_Face);
m_Face = NULL;
}
-bool CFX_Font::LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, bool bVertical)
+FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical)
{
- m_bEmbedded = false;
+ m_bEmbedded = FALSE;
m_bVertical = bVertical;
m_pSubstFont = new CFX_SubstFont;
m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
@@ -79,7 +79,7 @@ bool CFX_Font::LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWO
m_pFontData = FXFT_Get_Face_Stream_Base(m_Face);
m_dwSize = FXFT_Get_Face_Stream_Size(m_Face);
}
- return true;
+ return TRUE;
}
extern "C" {
unsigned long _FTStreamRead(FXFT_Stream stream, unsigned long offset,
@@ -99,7 +99,7 @@ extern "C" {
{
}
};
-bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
+FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
{
FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(uint8_t, sizeof (FXFT_StreamRec));
stream1->base = NULL;
@@ -113,16 +113,16 @@ bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_
args.stream = stream1;
if (FXFT_Open_Face(library, &args, 0, Face)) {
FX_Free(stream1);
- return false;
+ return FALSE;
}
if (stream) {
*stream = stream1;
}
- return true;
+ return TRUE;
}
-bool CFX_Font::LoadFile(IFX_FileRead* pFile)
+FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile)
{
- m_bEmbedded = false;
+ m_bEmbedded = FALSE;
FXFT_Library library;
if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
FXFT_Init_FreeType(&CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary);
@@ -130,11 +130,11 @@ bool CFX_Font::LoadFile(IFX_FileRead* pFile)
library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
FXFT_Stream stream = NULL;
if (!_LoadFile(library, &m_Face, pFile, &stream)) {
- return false;
+ return FALSE;
}
m_pOwnedStream = stream;
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return true;
+ return TRUE;
}
int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index)
{
@@ -169,20 +169,20 @@ static FXFT_Face FT_LoadFont(uint8_t* pData, int size)
}
return face;
}
-bool CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size)
+FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size)
{
m_pFontDataAllocation = FX_Alloc(uint8_t, size);
FXSYS_memcpy(m_pFontDataAllocation, data, size);
m_Face = FT_LoadFont((uint8_t*)m_pFontDataAllocation, size);
m_pFontData = (uint8_t*)m_pFontDataAllocation;
- m_bEmbedded = true;
+ m_bEmbedded = TRUE;
m_dwSize = size;
return m_Face != NULL;
}
-bool CFX_Font::IsTTFont()
+FX_BOOL CFX_Font::IsTTFont()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
return FXFT_Is_Face_TT_OT(m_Face) == FXFT_FACE_FLAG_SFNT;
}
@@ -202,25 +202,25 @@ int CFX_Font::GetDescent() const
int descent = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
return descent;
}
-bool CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
+FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
if (FXFT_Is_Face_Tricky(m_Face)) {
int error = FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72);
if (error) {
- return false;
+ return FALSE;
}
error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
if (error) {
- return false;
+ return FALSE;
}
FXFT_BBox cbox;
FT_Glyph glyph;
error = FXFT_Get_Glyph(((FXFT_Face)m_Face)->glyph, &glyph);
if (error) {
- return false;
+ return FALSE;
}
FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
int pixel_size_x = ((FXFT_Face)m_Face)->size->metrics.x_ppem,
@@ -246,7 +246,7 @@ bool CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0;
}
if (FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
- return false;
+ return FALSE;
}
int em = FXFT_Get_Face_UnitsPerEM(m_Face);
if (em == 0) {
@@ -260,34 +260,34 @@ bool CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
bbox.right = (FXFT_Get_Glyph_HoriBearingX(m_Face) + FXFT_Get_Glyph_Width(m_Face)) * 1000 / em;
bbox.bottom = (FXFT_Get_Glyph_HoriBearingY(m_Face)) * 1000 / em;
}
- return true;
+ return TRUE;
}
-bool CFX_Font::IsItalic()
+FX_BOOL CFX_Font::IsItalic()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
- bool ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
+ FX_BOOL ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
if (!ret) {
CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
str.MakeLower();
if (str.Find("italic") != -1) {
- ret = true;
+ ret = TRUE;
}
}
return ret;
}
-bool CFX_Font::IsBold()
+FX_BOOL CFX_Font::IsBold()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
return FXFT_Is_Face_Bold(m_Face) == FXFT_STYLE_FLAG_BOLD;
}
-bool CFX_Font::IsFixedWidth()
+FX_BOOL CFX_Font::IsFixedWidth()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
return FXFT_Is_Face_fixedwidth(m_Face);
}
@@ -331,10 +331,10 @@ CFX_ByteString CFX_Font::GetFaceName() const
}
return m_pSubstFont->m_Family;
}
-bool CFX_Font::GetBBox(FX_RECT &bbox)
+FX_BOOL CFX_Font::GetBBox(FX_RECT &bbox)
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
int em = FXFT_Get_Face_UnitsPerEM(m_Face);
if (em == 0) {
@@ -348,7 +348,7 @@ bool CFX_Font::GetBBox(FX_RECT &bbox)
bbox.right = FXFT_Get_Face_xMax(m_Face) * 1000 / em;
bbox.bottom = FXFT_Get_Face_yMax(m_Face) * 1000 / em;
}
- return true;
+ return TRUE;
}
int CFX_Font::GetHeight()
{
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 15f022e86b..14427a5e40 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -18,9 +18,9 @@ CFX_SubstFont::CFX_SubstFont()
m_SubstFlags = 0;
m_Weight = 0;
m_ItalicAngle = 0;
- m_bSubstOfCJK = false;
+ m_bSubstOfCJK = FALSE;
m_WeightCJK = 0;
- m_bItlicCJK = false;
+ m_bItlicCJK = FALSE;
}
CTTFontDesc::~CTTFontDesc()
{
@@ -38,11 +38,11 @@ CTTFontDesc::~CTTFontDesc()
FX_Free(m_pFontData);
}
}
-bool CTTFontDesc::ReleaseFace(FXFT_Face face)
+FX_BOOL CTTFontDesc::ReleaseFace(FXFT_Face face)
{
if (m_Type == 1) {
if (m_SingleFace.m_pFace != face) {
- return false;
+ return FALSE;
}
} else if (m_Type == 2) {
int i;
@@ -51,15 +51,15 @@ bool CTTFontDesc::ReleaseFace(FXFT_Face face)
break;
}
if (i == 16) {
- return false;
+ return FALSE;
}
}
m_RefCount --;
if (m_RefCount) {
- return false;
+ return FALSE;
}
delete this;
- return true;
+ return TRUE;
}
CFX_FontMgr::CFX_FontMgr()
{
@@ -98,7 +98,7 @@ void CFX_FontMgr::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
{
m_pBuiltinMapper->SetSystemFontInfo(pFontInfo);
}
-FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, bool bTrueType,
+FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType,
FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont)
{
if (m_FTLibrary == NULL) {
@@ -115,7 +115,7 @@ FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, bool bTrue
CharsetCP, pSubstFont);
}
FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
- int weight, bool bItalic, uint8_t*& pFontData)
+ int weight, FX_BOOL bItalic, uint8_t*& pFontData)
{
CFX_ByteString key(face_name);
key += ',';
@@ -131,7 +131,7 @@ FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
return NULL;
}
FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name,
- int weight, bool bItalic, uint8_t* pData, FX_DWORD size, int face_index)
+ int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index)
{
CTTFontDesc* pFontDesc = new CTTFontDesc;
pFontDesc->m_Type = 1;
@@ -433,10 +433,10 @@ void _FPDFAPI_GetInternalFontData(int id, const uint8_t*& data, FX_DWORD& size)
{
CFX_GEModule::Get()->GetFontMgr()->GetStandardFont(data, size, id);
}
-bool CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index)
+FX_BOOL CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index)
{
if (index > 15 || index < 0) {
- return false;
+ return FALSE;
}
{
if (index >= 14) {
@@ -452,14 +452,14 @@ bool CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int
size = g_FoxitFonts[index].m_dwSize;
}
}
- return true;
+ return TRUE;
}
CFX_FontMapper::CFX_FontMapper()
{
FXSYS_memset(m_FoxitFaces, 0, sizeof m_FoxitFaces);
m_MMFaces[0] = m_MMFaces[1] = NULL;
m_pFontInfo = NULL;
- m_bListLoaded = false;
+ m_bListLoaded = FALSE;
m_pFontEnumerator = NULL;
}
CFX_FontMapper::~CFX_FontMapper()
@@ -583,10 +583,10 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset)
return;
}
const uint8_t* ptr = name;
- bool bLocalized = false;
+ FX_BOOL bLocalized = FALSE;
for (int i = 0; i < name.GetLength(); i ++)
if (ptr[i] > 0x80) {
- bLocalized = true;
+ bLocalized = TRUE;
break;
}
if (bLocalized) {
@@ -620,7 +620,7 @@ void CFX_FontMapper::LoadInstalledFonts()
return;
}
m_pFontInfo->EnumFontList(this);
- m_bListLoaded = true;
+ m_bListLoaded = TRUE;
}
CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_name)
{
@@ -847,7 +847,7 @@ CFX_ByteString ParseStyle(const FX_CHAR* pStyle, int iLen, int iIndex)
}
return buf.GetByteString();
}
-int32_t GetStyleType(const CFX_ByteString &bsStyle, bool bRevert)
+int32_t GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
{
int32_t iLen = bsStyle.GetLength();
if (!iLen) {
@@ -872,15 +872,15 @@ int32_t GetStyleType(const CFX_ByteString &bsStyle, bool bRevert)
}
return -1;
}
-bool CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
+FX_BOOL CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
{
if (name == FX_BSTRC("MyriadPro")) {
PitchFamily &= ~FXFONT_FF_ROMAN;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueType, FX_DWORD flags,
+FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTrueType, FX_DWORD flags,
int weight, int italic_angle, int WindowCP, CFX_SubstFont* pSubstFont)
{
if (!(flags & FXFONT_USEEXTERNATTR)) {
@@ -923,14 +923,14 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
int iBaseFont = 0;
CFX_ByteString family, style;
- bool bHasComma = false;
- bool bHasHypen = false;
+ FX_BOOL bHasComma = FALSE;
+ FX_BOOL bHasHypen = FALSE;
int find = SubstName.Find(FX_BSTRC(","), 0);
if (find >= 0) {
family = SubstName.Left(find);
_PDF_GetStandardFontName(family);
style = SubstName.Mid(find + 1);
- bHasComma = true;
+ bHasComma = TRUE;
} else {
family = SubstName;
}
@@ -939,9 +939,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
break;
}
int PitchFamily = 0;
- bool bItalic = false;
+ FX_BOOL bItalic = FALSE;
FX_DWORD nStyle = 0;
- bool bStyleAvail = false;
+ FX_BOOL bStyleAvail = FALSE;
if (iBaseFont < 12) {
family = g_Base14FontNames[iBaseFont];
if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2) {
@@ -962,12 +962,12 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
if (find >= 0) {
style = family.Mid(find + 1);
family = family.Left(find);
- bHasHypen = true;
+ bHasHypen = TRUE;
}
}
if (!bHasHypen) {
int nLen = family.GetLength();
- int32_t nRet = GetStyleType(family, true);
+ int32_t nRet = GetStyleType(family, TRUE);
if (nRet > -1) {
family = family.Left(nLen - g_FontStyles[nRet].len);
if (nRet == 0) {
@@ -995,17 +995,17 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
int nLen = style.GetLength();
const FX_CHAR* pStyle = style;
int i = 0;
- bool bFirstItem = true;
+ FX_BOOL bFirstItem = TRUE;
CFX_ByteString buf;
while (i < nLen) {
buf = ParseStyle(pStyle, nLen, i);
- int32_t nRet = GetStyleType(buf, false);
+ int32_t nRet = GetStyleType(buf, FALSE);
if ((i && !bStyleAvail) || (!i && nRet < 0)) {
family = SubstName;
iBaseFont = 12;
break;
} else if (nRet >= 0) {
- bStyleAvail = true;
+ bStyleAvail = TRUE;
}
if (nRet == 0) {
if (nStyle & FX_FONT_STYLE_Bold) {
@@ -1013,7 +1013,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
} else {
nStyle |= FX_FONT_STYLE_Bold;
}
- bFirstItem = false;
+ bFirstItem = FALSE;
}
if (nRet == 1) {
if (bFirstItem) {
@@ -1031,7 +1031,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
} else {
nStyle |= FX_FONT_STYLE_Bold;
}
- bFirstItem = false;
+ bFirstItem = FALSE;
}
i += buf.GetLength() + 1;
}
@@ -1042,9 +1042,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
weight = nStyle & FX_FONT_STYLE_BoldBold ? 900 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL);
}
if (nStyle & FX_FONT_STYLE_Italic) {
- bItalic = true;
+ bItalic = TRUE;
}
- bool bCJK = false;
+ FX_BOOL bCJK = FALSE;
int iExact = 0;
int Charset = FXFONT_ANSI_CHARSET;
if (WindowCP) {
@@ -1054,7 +1054,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
if (Charset == FXFONT_SHIFTJIS_CHARSET || Charset == FXFONT_GB2312_CHARSET ||
Charset == FXFONT_HANGEUL_CHARSET || Charset == FXFONT_CHINESEBIG5_CHARSET) {
- bCJK = true;
+ bCJK = TRUE;
}
if (m_pFontInfo == NULL) {
pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
@@ -1069,21 +1069,21 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
if (!bCJK) {
if (!CheckSupportThirdPartFont(family, PitchFamily)) {
if (italic_angle != 0) {
- bItalic = true;
+ bItalic = TRUE;
} else {
- bItalic = false;
+ bItalic = FALSE;
}
weight = old_weight;
}
} else {
- pSubstFont->m_bSubstOfCJK = true;
+ pSubstFont->m_bSubstOfCJK = TRUE;
if (nStyle) {
pSubstFont->m_WeightCJK = weight;
} else {
pSubstFont->m_WeightCJK = FXFONT_FW_NORMAL;
}
if (nStyle & FX_FONT_STYLE_Italic) {
- pSubstFont->m_bItlicCJK = true;
+ pSubstFont->m_bItlicCJK = TRUE;
}
}
} else {
@@ -1123,7 +1123,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
} else {
if (flags & FXFONT_ITALIC) {
- bItalic = true;
+ bItalic = TRUE;
}
}
iExact = !match.IsEmpty();
@@ -1134,9 +1134,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
if (hFont == NULL) {
if (bCJK) {
if (italic_angle != 0) {
- bItalic = true;
+ bItalic = TRUE;
} else {
- bItalic = false;
+ bItalic = FALSE;
}
weight = old_weight;
}
@@ -1221,18 +1221,18 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
pSubstFont->m_Family = SubstName;
pSubstFont->m_Charset = Charset;
- bool bNeedUpdateWeight = false;
+ FX_BOOL bNeedUpdateWeight = FALSE;
if (FXFT_Is_Face_Bold(face)) {
if (weight == FXFONT_FW_BOLD) {
- bNeedUpdateWeight = false;
+ bNeedUpdateWeight = FALSE;
} else {
- bNeedUpdateWeight = true;
+ bNeedUpdateWeight = TRUE;
}
} else {
if (weight == FXFONT_FW_NORMAL) {
- bNeedUpdateWeight = false;
+ bNeedUpdateWeight = FALSE;
} else {
- bNeedUpdateWeight = true;
+ bNeedUpdateWeight = TRUE;
}
}
if (bNeedUpdateWeight) {
@@ -1262,7 +1262,7 @@ CFontFileFaceInfo::CFontFileFaceInfo()
m_FileSize = 0;
m_FontOffset = 0;
m_Weight = 0;
- m_bItalic = false;
+ m_bItalic = FALSE;
m_PitchFamily = 0;
}
CFontFileFaceInfo::~CFontFileFaceInfo()
@@ -1272,7 +1272,7 @@ CFontFileFaceInfo::~CFontFileFaceInfo()
}
m_Face = NULL;
}
-extern bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
+extern FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
#if _FX_OS_ == _FX_ANDROID_
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
{
@@ -1300,13 +1300,13 @@ void CFX_FolderFontInfo::Release()
{
delete this;
}
-bool CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
+FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
{
m_pMapper = pMapper;
for (int i = 0; i < m_PathList.GetSize(); i ++) {
ScanPath(m_PathList[i]);
}
- return true;
+ return TRUE;
}
void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
{
@@ -1315,7 +1315,7 @@ void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
return;
}
CFX_ByteString filename;
- bool bFolder;
+ FX_BOOL bFolder;
while (FX_GetNextFile(handle, filename, bFolder)) {
if (bFolder) {
if (filename == "." || filename == "..") {
@@ -1451,7 +1451,7 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
}
m_FontList.SetAt(facename, pInfo);
}
-void* CFX_FolderFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact)
+void* CFX_FolderFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact)
{
return NULL;
}
@@ -1506,16 +1506,16 @@ FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* b
void CFX_FolderFontInfo::DeleteFont(void* hFont)
{
}
-bool CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+FX_BOOL CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
{
if (hFont == NULL) {
- return false;
+ return FALSE;
}
CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
name = pFont->m_FaceName;
- return true;
+ return TRUE;
}
-bool CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
+FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
{
- return false;
+ return FALSE;
}
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index 9f493a6cfc..861afd259c 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -30,9 +30,9 @@ Base14Substs[] = {
class CFX_LinuxFontInfo : public CFX_FolderFontInfo
{
public:
- void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override;
- bool ParseFontCfg();
- void* FindFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool bMatchName);
+ void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override;
+ FX_BOOL ParseFontCfg();
+ void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName);
};
#define LINUX_GPNAMESIZE 6
static const struct {
@@ -77,7 +77,7 @@ static int32_t GetJapanesePreference(const FX_CHAR* facearr, int weight, int pic
}
return 2;
}
-void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, int& iExact)
+void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, int& iExact)
{
CFX_ByteString face = cstr_face;
int iBaseFont;
@@ -91,7 +91,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitc
return GetFont(face);
}
void* p = NULL;
- bool bCJK = true;
+ FX_BOOL bCJK = TRUE;
switch (charset) {
case FXFONT_SHIFTJIS_CHARSET: {
int32_t index = GetJapanesePreference(cstr_face, weight, pitch_family);
@@ -129,7 +129,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitc
}
break;
default:
- bCJK = false;
+ bCJK = FALSE;
break;
}
if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
@@ -157,7 +157,7 @@ static FX_DWORD _LinuxGetCharset(int charset)
}
return 0;
}
-static int32_t _LinuxGetSimilarValue(int weight, bool bItalic, int pitch_family, FX_DWORD style)
+static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style)
{
int32_t iSimilarValue = 0;
if ((style & FXFONT_BOLD) == (weight > 400)) {
@@ -177,7 +177,7 @@ static int32_t _LinuxGetSimilarValue(int weight, bool bItalic, int pitch_family,
}
return iSimilarValue;
}
-void* CFX_LinuxFontInfo::FindFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool bMatchName)
+void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName)
{
CFontFaceInfo* pFind = NULL;
FX_DWORD charset_flag = _LinuxGetCharset(charset);
@@ -217,9 +217,9 @@ IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
}
return pInfo;
}
-bool CFX_LinuxFontInfo::ParseFontCfg()
+FX_BOOL CFX_LinuxFontInfo::ParseFontCfg()
{
- return false;
+ return FALSE;
}
void CFX_GEModule::InitPlatform()
{
diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp
index 4bc9a88128..b1410b3911 100644
--- a/core/src/fxge/ge/fx_ge_path.cpp
+++ b/core/src/fxge/ge/fx_ge_path.cpp
@@ -110,7 +110,7 @@ void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask)
m_Mask = new_mask;
return;
}
- ASSERT(false);
+ ASSERT(FALSE);
}
CFX_PathData::CFX_PathData()
{
@@ -257,8 +257,8 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, FX_FLOAT start_x, FX_FLOA
FX_FLOAT half_width, FX_FLOAT miter_limit)
{
FX_FLOAT start_k = 0, start_c = 0, end_k = 0, end_c = 0, start_len = 0, start_dc = 0, end_len = 0, end_dc = 0;
- bool bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
- bool bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
+ FX_BOOL bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
+ FX_BOOL bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
if (bStartVert && bEndVert) {
int start_dir = middle_y > start_y ? 1 : -1;
FX_FLOAT point_y = middle_y + half_width * start_dir;
@@ -342,12 +342,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_l
int iPoint = 0;
FX_FLOAT half_width = line_width;
int iStartPoint, iEndPoint, iMiddlePoint;
- bool bJoin;
+ FX_BOOL bJoin;
while (iPoint < m_PointCount) {
if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) {
iStartPoint = iPoint + 1;
iEndPoint = iPoint;
- bJoin = false;
+ bJoin = FALSE;
} else {
if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) {
rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY);
@@ -357,12 +357,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_l
if (iPoint == m_PointCount - 1 || m_pPoints[iPoint + 1].m_Flag == FXPT_MOVETO) {
iStartPoint = iPoint - 1;
iEndPoint = iPoint;
- bJoin = false;
+ bJoin = FALSE;
} else {
iStartPoint = iPoint - 1;
iMiddlePoint = iPoint;
iEndPoint = iPoint + 1;
- bJoin = true;
+ bJoin = TRUE;
}
}
FX_FLOAT start_x = m_pPoints[iStartPoint].m_PointX;
@@ -389,10 +389,10 @@ void CFX_PathData::Transform(const CFX_AffineMatrix* pMatrix)
pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY);
}
}
-bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, bool&bThin, bool bAdjust) const
+FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const
{
if (m_PointCount < 3) {
- return false;
+ return FALSE;
}
if (m_PointCount == 3 && (m_pPoints[0].m_Flag & FXPT_TYPE) == FXPT_MOVETO &&
(m_pPoints[1].m_Flag & FXPT_TYPE) == FXPT_LINETO && (m_pPoints[2].m_Flag & FXPT_TYPE) == FXPT_LINETO
@@ -422,19 +422,19 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
NewPath.SetPoint(1, m_pPoints[1].m_PointX, m_pPoints[1].m_PointY, FXPT_LINETO);
}
if (m_pPoints[0].m_PointX != m_pPoints[1].m_PointX && m_pPoints[0].m_PointY != m_pPoints[1].m_PointY) {
- bThin = true;
+ bThin = TRUE;
}
- return true;
+ return TRUE;
}
if (((m_PointCount > 3) && (m_PointCount % 2))) {
int mid = m_PointCount / 2;
- bool bZeroArea = false;
+ FX_BOOL bZeroArea = FALSE;
CFX_PathData t_path;
for (int i = 0; i < mid; i++) {
if (!(m_pPoints[mid - i - 1].m_PointX == m_pPoints[mid + i + 1].m_PointX
&& m_pPoints[mid - i - 1].m_PointY == m_pPoints[mid + i + 1].m_PointY &&
((m_pPoints[mid - i - 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[mid + i + 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO))) {
- bZeroArea = true;
+ bZeroArea = TRUE;
break;
}
int new_count = t_path.GetPointCount();
@@ -444,8 +444,8 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
}
if (!bZeroArea) {
NewPath.Append(&t_path, NULL);
- bThin = true;
- return true;
+ bThin = TRUE;
+ return TRUE;
}
}
int stratPoint = 0;
@@ -488,7 +488,7 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
NewPath.AddPointCount(2);
NewPath.SetPoint(new_count, m_pPoints[i - 1].m_PointX, m_pPoints[i - 1].m_PointY, FXPT_MOVETO);
NewPath.SetPoint(new_count + 1, m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, FXPT_LINETO);
- bThin = true;
+ bThin = TRUE;
}
}
} else if (point_type == FXPT_BEZIERTO) {
@@ -497,42 +497,42 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
}
}
if (m_PointCount > 3 && NewPath.GetPointCount()) {
- bThin = true;
+ bThin = TRUE;
}
if (NewPath.GetPointCount() == 0) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_PathData::IsRect() const
+FX_BOOL CFX_PathData::IsRect() const
{
if (m_PointCount != 5 && m_PointCount != 4) {
- return false;
+ return FALSE;
}
if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX ||
m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
(m_pPoints[0].m_PointX == m_pPoints[2].m_PointX && m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) ||
(m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return false;
+ return FALSE;
}
if (m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return false;
+ return FALSE;
}
for (int i = 1; i < 4; i ++) {
if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return false;
+ return FALSE;
}
if (m_pPoints[i].m_PointX != m_pPoints[i - 1].m_PointX && m_pPoints[i].m_PointY != m_pPoints[i - 1].m_PointY) {
- return false;
+ return FALSE;
}
}
return m_PointCount == 5 || (m_pPoints[3].m_Flag & FXPT_CLOSEFIGURE);
}
-bool CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
+FX_BOOL CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
{
if (pMatrix == NULL) {
if (!IsRect()) {
- return false;
+ return FALSE;
}
if (pRect) {
pRect->left = m_pPoints[0].m_PointX;
@@ -541,27 +541,27 @@ bool CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect)
pRect->top = m_pPoints[2].m_PointY;
pRect->Normalize();
}
- return true;
+ return TRUE;
}
if (m_PointCount != 5 && m_PointCount != 4) {
- return false;
+ return FALSE;
}
if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
(m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return false;
+ return FALSE;
}
if (m_PointCount == 4 && m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return false;
+ return FALSE;
}
FX_FLOAT x[5], y[5];
for (int i = 0; i < m_PointCount; i ++) {
pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, x[i], y[i]);
if (i) {
if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return false;
+ return FALSE;
}
if (x[i] != x[i - 1] && y[i] != y[i - 1]) {
- return false;
+ return FALSE;
}
}
}
@@ -572,7 +572,7 @@ bool CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect)
pRect->top = y[2];
pRect->Normalize();
}
- return true;
+ return TRUE;
}
void CFX_PathData::Copy(const CFX_PathData &src)
{
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index e375288247..ba5c5fbabb 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -10,7 +10,7 @@
struct PSGlyph {
CFX_Font* m_pFont;
FX_DWORD m_GlyphIndex;
- bool m_bGlyphAdjust;
+ FX_BOOL m_bGlyphAdjust;
FX_FLOAT m_AdjustMatrix[4];
};
class CPSFont
@@ -22,8 +22,8 @@ public:
CFX_PSRenderer::CFX_PSRenderer()
{
m_pOutput = NULL;
- m_bColorSet = m_bGraphStateSet = false;
- m_bInited = false;
+ m_bColorSet = m_bGraphStateSet = FALSE;
+ m_bInited = FALSE;
}
CFX_PSRenderer::~CFX_PSRenderer()
{
@@ -33,7 +33,7 @@ CFX_PSRenderer::~CFX_PSRenderer()
}
}
#define OUTPUT_PS(str) m_pOutput->OutputPS(str, sizeof str-1)
-void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, bool bCmykOutput)
+void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, FX_BOOL bCmykOutput)
{
m_PSLevel = pslevel;
m_pOutput = pOutput;
@@ -42,10 +42,10 @@ void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int hei
m_ClipBox.bottom = height;
m_bCmykOutput = bCmykOutput;
}
-bool CFX_PSRenderer::StartRendering()
+FX_BOOL CFX_PSRenderer::StartRendering()
{
if (m_bInited) {
- return true;
+ return TRUE;
}
static const char init_str[] = "\nsave\n/im/initmatrix load def\n"
"/n/newpath load def/m/moveto load def/l/lineto load def/c/curveto load def/h/closepath load def\n"
@@ -57,15 +57,15 @@ bool CFX_PSRenderer::StartRendering()
"/cm/concat load def/Cm/currentmatrix load def/mx/matrix load def/sm/setmatrix load def\n"
;
OUTPUT_PS(init_str);
- m_bInited = true;
- return true;
+ m_bInited = TRUE;
+ return TRUE;
}
void CFX_PSRenderer::EndRendering()
{
if (m_bInited) {
OUTPUT_PS("\nrestore\n");
}
- m_bInited = false;
+ m_bInited = FALSE;
}
void CFX_PSRenderer::SaveState()
{
@@ -73,7 +73,7 @@ void CFX_PSRenderer::SaveState()
OUTPUT_PS("q\n");
m_ClipBoxStack.Add(m_ClipBox);
}
-void CFX_PSRenderer::RestoreState(bool bKeepSaved)
+void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved)
{
StartRendering();
if (bKeepSaved) {
@@ -81,7 +81,7 @@ void CFX_PSRenderer::RestoreState(bool bKeepSaved)
} else {
OUTPUT_PS("Q\n");
}
- m_bColorSet = m_bGraphStateSet = false;
+ m_bColorSet = m_bGraphStateSet = FALSE;
m_ClipBox = m_ClipBoxStack.GetAt(m_ClipBoxStack.GetSize() - 1);
if (!bKeepSaved) {
m_ClipBoxStack.RemoveAt(m_ClipBoxStack.GetSize() - 1);
@@ -175,7 +175,7 @@ void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData,
OUTPUT_PS("strokepath W n\n");
}
}
-bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -189,13 +189,13 @@ bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
int fill_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
if (fill_alpha && fill_alpha < 255) {
- return false;
+ return FALSE;
}
if (stroke_alpha && stroke_alpha < 255) {
- return false;
+ return FALSE;
}
if (fill_alpha == 0 && stroke_alpha == 0) {
- return false;
+ return FALSE;
}
if (stroke_alpha) {
SetGraphState(pGraphState);
@@ -233,7 +233,7 @@ bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
}
}
OUTPUT_PS("\n");
- return true;
+ return TRUE;
}
void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
{
@@ -259,7 +259,7 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
buf << pGraphState->m_MiterLimit << FX_BSTRC(" M\n");
}
m_CurGraphState.Copy(*pGraphState);
- m_bGraphStateSet = true;
+ m_bGraphStateSet = TRUE;
if (buf.GetSize()) {
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
@@ -305,7 +305,7 @@ static void PSCompressData(int PSLevel, uint8_t* src_buf, FX_DWORD src_size,
}
}
}
-bool CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
+FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
int alpha_flag, void* pIccTransform)
{
StartRendering();
@@ -313,7 +313,7 @@ bool CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int
(FX_FLOAT)(left), (FX_FLOAT)(top + pSource->GetHeight()));
return DrawDIBits(pSource, color, &matrix, 0, alpha_flag, pIccTransform);
}
-bool CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -322,20 +322,20 @@ bool CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
(FX_FLOAT)(dest_left), (FX_FLOAT)(dest_top + dest_height));
return DrawDIBits(pSource, color, &matrix, flags, alpha_flag, pIccTransform);
}
-bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
+FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
StartRendering();
if ((pMatrix->a == 0 && pMatrix->b == 0) || (pMatrix->c == 0 && pMatrix->d == 0)) {
- return true;
+ return TRUE;
}
if (pSource->HasAlpha()) {
- return false;
+ return FALSE;
}
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(color) : FXARGB_A(color);
if (pSource->IsAlphaMask() && (alpha < 255 || pSource->GetBPP() != 1)) {
- return false;
+ return FALSE;
}
OUTPUT_PS("q\n");
CFX_ByteTextBuf buf;
@@ -358,7 +358,7 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
FaxCompressData(src_buf, width, height, output_buf, output_size);
if (pSource->IsAlphaMask()) {
SetColor(color, alpha_flag, pIccTransform);
- m_bColorSet = false;
+ m_bColorSet = FALSE;
buf << FX_BSTRC(" true[");
} else {
buf << FX_BSTRC(" 1[");
@@ -406,7 +406,7 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
}
if (pConverted == NULL) {
OUTPUT_PS("\nQ\n");
- return false;
+ return FALSE;
}
int Bpp = pConverted->GetBPP() / 8;
uint8_t* output_buf = NULL;
@@ -462,14 +462,14 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
FX_Free(output_buf);
}
OUTPUT_PS("\nQ\n");
- return true;
+ return TRUE;
}
void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
pIccTransform = NULL;
}
- bool bCMYK = false;
+ FX_BOOL bCMYK = FALSE;
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
@@ -490,7 +490,7 @@ void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransfor
<< FXARGB_B(color) / 255.0 << FX_BSTRC(" rg\n");
}
if (bCMYK == m_bCmykOutput) {
- m_bColorSet = true;
+ m_bColorSet = TRUE;
m_LastColor = color;
}
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
@@ -588,7 +588,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont,
<< FX_BSTRC("/") << ps_glyphindex << FX_BSTRC(" put\n");
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
-bool CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+FX_BOOL CFX_PSRenderer::DrawText(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)
@@ -596,10 +596,10 @@ bool CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Fo
StartRendering();
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
if (alpha < 255) {
- return false;
+ return FALSE;
}
if ((pObject2Device->a == 0 && pObject2Device->b == 0) || (pObject2Device->c == 0 && pObject2Device->d == 0)) {
- return true;
+ return TRUE;
}
SetColor(color, alpha_flag, pIccTransform);
CFX_ByteTextBuf buf;
@@ -628,7 +628,7 @@ bool CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Fo
}
buf << FX_BSTRC("Q\n");
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
- return true;
+ return TRUE;
}
void CFX_PSRenderer::WritePSBinary(const uint8_t* data, int len)
{
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index c5da66a4ce..59a4cfb37d 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -46,7 +46,7 @@ private:
FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
{
FX_RECT rect(0, 0, 0, 0);
- bool bStarted = false;
+ FX_BOOL bStarted = FALSE;
for (int iChar = 0; iChar < nChars; iChar ++) {
FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph;
@@ -66,7 +66,7 @@ FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a
rect.right = char_right;
rect.top = char_top;
rect.bottom = char_bottom;
- bStarted = true;
+ bStarted = TRUE;
} else {
if (rect.left > char_left) {
rect.left = char_left;
@@ -87,9 +87,9 @@ FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a
static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars)
{
ASSERT(nChars > 1);
- bool bVertical = false;
+ FX_BOOL bVertical = FALSE;
if (pGlyphAndPos[nChars - 1].m_OriginX == pGlyphAndPos[0].m_OriginX) {
- bVertical = true;
+ bVertical = TRUE;
} else if (pGlyphAndPos[nChars - 1].m_OriginY != pGlyphAndPos[0].m_OriginY) {
return;
}
@@ -155,7 +155,7 @@ void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransf
bgra[3] = (alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag);
argb = FXARGB_MAKE(bgra[3], bgra[2], bgra[1], bgra[0]);
}
-bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
+FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
FX_DWORD fill_color, FX_DWORD text_flags,
@@ -171,12 +171,12 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
#endif
#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return true;
+ return TRUE;
}
}
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
if (alpha < 255) {
- return false;
+ return FALSE;
}
} else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -186,7 +186,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
#endif
#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return true;
+ return TRUE;
}
}
CFX_AffineMatrix char2device, deviceCtm, text2Device;
@@ -204,24 +204,24 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
}
}
int anti_alias = FXFT_RENDER_MODE_MONO;
- bool bNormal = false;
+ FX_BOOL bNormal = FALSE;
if ((text_flags & FXTEXT_NOSMOOTH) == 0) {
if (m_DeviceClass == FXDC_DISPLAY && m_bpp > 1) {
- bool bClearType;
+ FX_BOOL bClearType;
if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_CLEARTYPE)) {
- bClearType = false;
+ bClearType = FALSE;
} else {
bClearType = text_flags & FXTEXT_CLEARTYPE;
}
if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = true;
+ bNormal = TRUE;
} else if (m_bpp < 16) {
anti_alias = FXFT_RENDER_MODE_NORMAL;
} else {
- if (bClearType == false) {
+ if (bClearType == FALSE) {
anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = true;
+ bNormal = TRUE;
} else {
anti_alias = FXFT_RENDER_MODE_LCD;
}
@@ -278,7 +278,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
bmp_rect.Intersect(m_ClipBox);
if (bmp_rect.IsEmpty()) {
FX_Free(pGlyphAndPos);
- return true;
+ return TRUE;
}
int pixel_width = FXSYS_round(bmp_rect.Width() * scale_x);
int pixel_height = FXSYS_round(bmp_rect.Height() * scale_y);
@@ -288,7 +288,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
CFX_DIBitmap bitmap;
if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
bitmap.Clear(0);
for (iChar = 0; iChar < nChars; iChar ++) {
@@ -308,19 +308,19 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
if (m_bpp == 8) {
if (!bitmap.Create(pixel_width, pixel_height, FXDIB_8bppMask)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
} else {
if (!CreateCompatibleBitmap(&bitmap, pixel_width, pixel_height)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
}
if (!bitmap.HasAlpha() && !bitmap.IsAlphaMask()) {
bitmap.Clear(0xFFFFFFFF);
if (!GetDIBits(&bitmap, bmp_rect.left, bmp_rect.top)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
} else {
bitmap.Clear(0);
@@ -352,13 +352,13 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
int nrows = pGlyph->GetHeight();
if (anti_alias == FXFT_RENDER_MODE_NORMAL) {
if (!bitmap.CompositeMask(left, top, ncols, nrows, pGlyph, fill_color,
- 0, 0, FXDIB_BLEND_NORMAL, NULL, false, alpha_flag, pIccTransform)) {
+ 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
continue;
}
- bool bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
+ FX_BOOL bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
ncols /= 3;
int x_subpixel = (int)(glyph.m_fOriginX * 3) % 3;
uint8_t* src_buf = pGlyph->GetBuffer();
@@ -945,9 +945,9 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
SetDIBits(&bitmap, bmp_rect.left, bmp_rect.top);
}
FX_Free(pGlyphAndPos);
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
+FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
@@ -973,7 +973,7 @@ bool CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
matrix.Concat(*pText2User);
CFX_PathData TransformedPath(*pPath);
TransformedPath.Transform(&matrix);
- bool bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
+ FX_BOOL bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
(FXGETFLAG_ALPHA_FILL(alpha_flag) || FXGETFLAG_ALPHA_STROKE(alpha_flag)) :
(fill_color || stroke_color);
if (bHasAlpha) {
@@ -989,24 +989,24 @@ bool CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
}
fill_mode |= FX_FILL_TEXT_MODE;
if (!DrawPath(&TransformedPath, pUser2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return false;
+ return FALSE;
}
}
if (pClippingPath) {
pClippingPath->Append(&TransformedPath, pUser2Device);
}
}
- return true;
+ return TRUE;
}
CFX_FontCache::~CFX_FontCache()
{
- FreeCache(true);
+ FreeCache(TRUE);
}
CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
{
FXFT_Face internal_face = pFont->GetFace();
- const bool bExternal = internal_face == nullptr;
+ const FX_BOOL bExternal = internal_face == nullptr;
FXFT_Face face = bExternal ?
(FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
@@ -1028,7 +1028,7 @@ CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
{
FXFT_Face internal_face = pFont->GetFace();
- const bool bExternal = internal_face == nullptr;
+ const FX_BOOL bExternal = internal_face == nullptr;
FXFT_Face face = bExternal ?
(FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
@@ -1043,7 +1043,7 @@ void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
}
}
-void CFX_FontCache::FreeCache(bool bRelease)
+void CFX_FontCache::FreeCache(FX_BOOL bRelease)
{
for (auto it = m_FTFaceMap.begin(); it != m_FTFaceMap.end();) {
auto curr_it = it++;
@@ -1095,7 +1095,7 @@ void CFX_FaceCache::InitPlatform()
}
#endif
CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix,
- CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, bool bFontStyle,
+ CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, FX_BOOL bFontStyle,
int dest_width, int anti_alias)
{
CFX_SizeGlyphCache* pSizeCache = NULL;
@@ -1114,7 +1114,7 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_Aff
pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
-const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix,
+const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
int dest_width, int anti_alias, int& text_flags)
{
if (glyph_index == (FX_DWORD) - 1) {
@@ -1311,7 +1311,7 @@ static void _ContrastAdjust(uint8_t* pDataIn, uint8_t* pDataOut, int nWid, int n
}
}
}
-CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle,
+CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias)
{
if (m_Face == NULL) {
@@ -1322,7 +1322,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
ft_matrix.xy = (signed long)(pMatrix->GetC() / 64 * 65536);
ft_matrix.yx = (signed long)(pMatrix->GetB() / 64 * 65536);
ft_matrix.yy = (signed long)(pMatrix->GetD() / 64 * 65536);
- bool bUseCJKSubFont = false;
+ FX_BOOL bUseCJKSubFont = FALSE;
const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
if (pSubstFont) {
bUseCJKSubFont = pSubstFont->m_bSubstOfCJK && bFontStyle;
@@ -1422,18 +1422,18 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
}
return pGlyphBitmap;
}
-bool _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
+FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
int glyph_index, FX_ARGB argb)
{
CFX_DIBitmap* pDib = (CFX_DIBitmap*)dib;
FXFT_Face face = pFont->GetFace();
int error = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_BITMAP);
if (error) {
- return false;
+ return FALSE;
}
error = FXFT_Render_Glyph(face, FXFT_RENDER_MODE_NORMAL);
if (error) {
- return false;
+ return FALSE;
}
int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(face));
int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(face));
@@ -1451,13 +1451,13 @@ bool _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
FXSYS_memcpy(dest_scan, src_scan, dest_pitch);
}
pDib->CompositeMask(x + left, y - top, bmwidth, bmheight, &mask, argb, 0, 0);
- return true;
+ return TRUE;
}
-bool OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb)
{
if (!pFont) {
- return false;
+ return FALSE;
}
FXFT_Face face = pFont->GetFace();
FXFT_Select_Charmap(pFont->m_Face, FXFT_ENCODING_UNICODE);
@@ -1490,9 +1490,9 @@ bool OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
}
if (pText_matrix)
ResetTransform(face);
- return true;
+ return TRUE;
}
-bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb)
{
FXFT_Matrix ft_matrix;
@@ -1507,7 +1507,7 @@ bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
ft_matrix.yy = (signed long)(font_size / 64 * 65536);
}
ScopedFontTransform scoped_transform(pFont->m_Face, &ft_matrix);
- bool ret = _OutputGlyph(dib, x, y, pFont,
+ FX_BOOL ret = _OutputGlyph(dib, x, y, pFont,
glyph_index, argb);
return ret;
}
@@ -1533,7 +1533,7 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph
return pGlyphPath;
}
typedef struct {
- bool m_bCount;
+ FX_BOOL m_bCount;
int m_PointCount;
FX_PATHPOINT* m_pPoints;
int m_CurX;
@@ -1684,7 +1684,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
funcs.shift = 0;
funcs.delta = 0;
OUTLINE_PARAMS params;
- params.m_bCount = true;
+ params.m_bCount = TRUE;
params.m_PointCount = 0;
FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
if (params.m_PointCount == 0) {
@@ -1692,7 +1692,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
}
CFX_PathData* pPath = new CFX_PathData;
pPath->SetPointCount(params.m_PointCount);
- params.m_bCount = false;
+ params.m_bCount = FALSE;
params.m_PointCount = 0;
params.m_pPoints = pPath->GetPoints();
params.m_CurX = params.m_CurY = 0;
diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h
index 2e861baf1b..12fac6a60a 100644
--- a/core/src/fxge/ge/text_int.h
+++ b/core/src/fxge/ge/text_int.h
@@ -32,12 +32,12 @@ public:
m_RefCount = 0;
}
~CTTFontDesc();
- bool ReleaseFace(FXFT_Face face);
+ FX_BOOL ReleaseFace(FXFT_Face face);
int m_Type;
union {
struct {
- bool m_bItalic;
- bool m_bBold;
+ FX_BOOL m_bItalic;
+ FX_BOOL m_bBold;
FXFT_Face m_pFace;
} m_SingleFace;
struct {
@@ -63,9 +63,9 @@ private:
{
return Unicode;
}
- virtual bool IsUnicodeCompatible() const
+ virtual FX_BOOL IsUnicodeCompatible() const
{
- return true;
+ return TRUE;
}
};
#define CHARSET_FLAG_ANSI 1
@@ -97,7 +97,7 @@ public:
FX_DWORD m_FileSize;
FX_DWORD m_FontOffset;
int m_Weight;
- bool m_bItalic;
+ FX_BOOL m_bItalic;
int m_PitchFamily;
CFX_ByteString m_FontTables;
};