summaryrefslogtreecommitdiff
path: root/core/src/fxge
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
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')
-rw-r--r--core/src/fxge/agg/include/fx_agg_driver.h38
-rw-r--r--core/src/fxge/agg/src/fx_agg_driver.cpp164
-rw-r--r--core/src/fxge/android/fpf_skiafont.cpp30
-rw-r--r--core/src/fxge/android/fpf_skiafont.h6
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.cpp28
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.h4
-rw-r--r--core/src/fxge/android/fx_android_font.cpp24
-rw-r--r--core/src/fxge/android/fx_android_font.h10
-rw-r--r--core/src/fxge/apple/apple_int.h50
-rw-r--r--core/src/fxge/apple/fx_apple_platform.cpp26
-rw-r--r--core/src/fxge/apple/fx_mac_imp.cpp6
-rw-r--r--core/src/fxge/apple/fx_quartz_device.cpp146
-rw-r--r--core/src/fxge/dib/dib_int.h6
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp142
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp116
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp72
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp246
-rw-r--r--core/src/fxge/dib/fx_dib_transform.cpp32
-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
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.cpp18
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.h8
-rw-r--r--core/src/fxge/skia/fx_skia_device.cpp102
-rw-r--r--core/src/fxge/skia/fx_skia_device.h38
-rw-r--r--core/src/fxge/win32/dwrite_int.h6
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp198
-rw-r--r--core/src/fxge/win32/fx_win32_dib.cpp12
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp18
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp90
-rw-r--r--core/src/fxge/win32/fx_win32_print.cpp86
-rw-r--r--core/src/fxge/win32/win32_int.h94
37 files changed, 1180 insertions, 1180 deletions
diff --git a/core/src/fxge/agg/include/fx_agg_driver.h b/core/src/fxge/agg/include/fx_agg_driver.h
index c8d620122e..29b56c77e4 100644
--- a/core/src/fxge/agg/include/fx_agg_driver.h
+++ b/core/src/fxge/agg/include/fx_agg_driver.h
@@ -22,7 +22,7 @@ public:
class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver
{
public:
- CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout);
+ CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout);
virtual ~CFX_AggDeviceDriver();
void InitPlatform();
void DestroyPlatform();
@@ -32,22 +32,22 @@ public:
virtual void SaveState();
- virtual void RestoreState(bool bKeepSaved);
+ virtual void RestoreState(FX_BOOL bKeepSaved);
- 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,
@@ -58,44 +58,44 @@ public:
int blend_type
);
- virtual bool SetPixel(int x, int y, FX_DWORD color,
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag, void* pIccTransform);
- 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)
{
- return false;
+ return FALSE;
}
- virtual bool GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
virtual CFX_DIBitmap* GetBackDrop()
{
return m_pOriDevice;
}
- 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 flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause);
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
virtual void CancelDIBits(void* handle);
- 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 bool RenderRasterizer(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa)& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+ virtual FX_BOOL RenderRasterizer(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa)& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform);
void SetClipMask(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa)& rasterizer);
@@ -117,9 +117,9 @@ public:
void* m_pDwRenderTartget;
int m_FillFlags;
int m_DitherBits;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bRgbByteOrder;
CFX_DIBitmap* m_pOriDevice;
- bool m_bGroupKnockout;
+ FX_BOOL m_bGroupKnockout;
};
#endif // FX_AGG_DRIVER_H_
diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp
index 2f96ef7379..118db7bf1f 100644
--- a/core/src/fxge/agg/src/fx_agg_driver.cpp
+++ b/core/src/fxge/agg/src/fx_agg_driver.cpp
@@ -119,7 +119,7 @@ private:
static void RasterizeStroke(agg::rasterizer_scanline_aa& rasterizer, agg::path_storage& path_data,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState, FX_FLOAT scale = 1.0f,
- bool bStrokeAdjust = false, bool bTextMode = false)
+ FX_BOOL bStrokeAdjust = FALSE, FX_BOOL bTextMode = FALSE)
{
agg::line_cap_e cap;
switch (pGraphState->m_LineCap) {
@@ -185,11 +185,11 @@ static void RasterizeStroke(agg::rasterizer_scanline_aa& rasterizer, agg::path_s
rasterizer.add_path_transformed(stroke, pObject2Device);
}
}
-IFX_RenderDeviceDriver* IFX_RenderDeviceDriver::CreateFxgeDriver(CFX_DIBitmap* pBitmap, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+IFX_RenderDeviceDriver* IFX_RenderDeviceDriver::CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
return new CFX_AggDeviceDriver(pBitmap, 0, bRgbByteOrder, pOriDevice, bGroupKnockout);
}
-CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
m_pBitmap = pBitmap;
m_DitherBits = dither_bits;
@@ -217,11 +217,11 @@ void CFX_AggDeviceDriver::InitPlatform()
void CFX_AggDeviceDriver::DestroyPlatform()
{
}
-bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+FX_BOOL CFX_AggDeviceDriver::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)
{
- return false;
+ return FALSE;
}
#endif
int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id)
@@ -267,7 +267,7 @@ void CFX_AggDeviceDriver::SaveState()
}
m_StateStack.Add(pClip);
}
-void CFX_AggDeviceDriver::RestoreState(bool bKeepSaved)
+void CFX_AggDeviceDriver::RestoreState(FX_BOOL bKeepSaved)
{
if (m_StateStack.GetSize() == 0) {
delete m_pClipRgn;
@@ -307,7 +307,7 @@ void CFX_AggDeviceDriver::SetClipMask(agg::rasterizer_scanline_aa& rasterizer)
agg::render_scanlines(rasterizer, scanline, final_render, (m_FillFlags & FXFILL_NOPATHSMOOTH) != 0);
m_pClipRgn->IntersectMaskF(path_rect.left, path_rect.top, mask);
}
-bool CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
+FX_BOOL CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
)
@@ -322,7 +322,7 @@ bool CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
rectf.Intersect(CFX_FloatRect(0, 0, (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
FX_RECT rect = rectf.GetOutterRect();
m_pClipRgn->IntersectRect(rect);
- return true;
+ return TRUE;
}
}
CAgg_PathData path_data;
@@ -333,9 +333,9 @@ bool CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
rasterizer.add_path(path_data.m_PathData);
rasterizer.filling_rule((fill_mode & 3) == FXFILL_WINDING ? agg::fill_non_zero : agg::fill_even_odd);
SetClipMask(rasterizer);
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
+FX_BOOL CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
)
@@ -350,7 +350,7 @@ bool CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
RasterizeStroke(rasterizer, path_data.m_PathData, pObject2Device, pGraphState);
rasterizer.filling_rule(agg::fill_non_zero);
SetClipMask(rasterizer);
- return true;
+ return TRUE;
}
class CFX_Renderer
{
@@ -361,8 +361,8 @@ private:
m_Blue,
m_Gray;
FX_DWORD m_Color;
- bool m_bFullCover;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bFullCover;
+ FX_BOOL m_bRgbByteOrder;
CFX_DIBitmap* m_pOriDevice;
FX_RECT m_ClipBox;
const CFX_DIBitmap* m_pClipMask;
@@ -371,7 +371,7 @@ private:
void (CFX_Renderer::*composite_span)(uint8_t*, int, int, int, uint8_t*, int, int, uint8_t*, uint8_t*);
public:
void prepare(unsigned) {}
- void CompositeSpan(uint8_t* dest_scan, uint8_t* ori_scan, int Bpp, bool bDestAlpha,
+ void CompositeSpan(uint8_t* dest_scan, uint8_t* ori_scan, int Bpp, FX_BOOL bDestAlpha,
int span_left, int span_len, uint8_t* cover_scan,
int clip_left, int clip_right, uint8_t* clip_scan)
{
@@ -955,7 +955,7 @@ public:
ori_scan = m_pOriDevice->GetBuffer() + m_pOriDevice->GetPitch() * y;
}
int Bpp = m_pDevice->GetBPP() / 8;
- bool bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
+ FX_BOOL bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
unsigned num_spans = sl.num_spans();
typename Scanline::const_iterator span = sl.begin();
while (1) {
@@ -988,7 +988,7 @@ public:
}
}
- bool Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
+ FX_BOOL Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
int alpha_flag = 0, void* pIccTransform = NULL)
{
m_pDevice = pDevice;
@@ -1008,8 +1008,8 @@ public:
m_pClipMask = m_pClipRgn->GetMask();
}
m_bFullCover = bFullCover;
- bool bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
- bool bDeviceCMYK = pDevice->IsCmykImage();
+ FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bDeviceCMYK = pDevice->IsCmykImage();
m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
ICodec_IccModule* pIccModule = NULL;
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
@@ -1039,7 +1039,7 @@ public:
}
}
}
- return true;
+ return TRUE;
}
if (bDeviceCMYK) {
ASSERT(!m_bRgbByteOrder);
@@ -1051,7 +1051,7 @@ public:
}
} else {
if (!pIccTransform) {
- return false;
+ return FALSE;
}
color = FXARGB_TODIB(color);
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&color, 1);
@@ -1100,22 +1100,22 @@ public:
if (m_pDevice->GetBPP() == 1) {
composite_span = &CFX_Renderer::CompositeSpan1bpp;
}
- return true;
+ return TRUE;
}
};
-bool CFX_AggDeviceDriver::RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+FX_BOOL CFX_AggDeviceDriver::RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform)
{
CFX_DIBitmap* pt = bGroupKnockout ? m_pOriDevice : NULL;
CFX_Renderer render;
if (!render.Init(m_pBitmap, pt, m_pClipRgn, color, bFullCover, m_bRgbByteOrder, alpha_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
agg::scanline_u8 scanline;
agg::render_scanlines(rasterizer, scanline, render, (m_FillFlags & FXFILL_NOPATHSMOOTH) != 0);
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -1127,10 +1127,10 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
if (GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
m_FillFlags = fill_mode;
if ((fill_mode & 3) && fill_color) {
@@ -1140,8 +1140,8 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
rasterizer.add_path(path_data.m_PathData);
rasterizer.filling_rule((fill_mode & 3) == FXFILL_WINDING ? agg::fill_non_zero : agg::fill_even_odd);
- if (!RenderRasterizer(rasterizer, fill_color, fill_mode & FXFILL_FULLCOVER, false, alpha_flag, pIccTransform)) {
- return false;
+ if (!RenderRasterizer(rasterizer, fill_color, fill_mode & FXFILL_FULLCOVER, FALSE, alpha_flag, pIccTransform)) {
+ return FALSE;
}
}
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
@@ -1151,12 +1151,12 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
path_data.BuildPath(pPathData, pObject2Device);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
- RasterizeStroke(rasterizer, path_data.m_PathData, NULL, pGraphState, 1, false, fill_mode & FX_STROKE_TEXT_MODE);
+ RasterizeStroke(rasterizer, path_data.m_PathData, NULL, pGraphState, 1, FALSE, fill_mode & FX_STROKE_TEXT_MODE);
int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag) << 8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
if (!RenderRasterizer(rasterizer, stroke_color, fill_mode & FXFILL_FULLCOVER, m_bGroupKnockout, fill_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
CFX_AffineMatrix matrix1, matrix2;
if (pObject2Device) {
@@ -1174,13 +1174,13 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
path_data.BuildPath(pPathData, &matrix1);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
- RasterizeStroke(rasterizer, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, false, fill_mode & FX_STROKE_TEXT_MODE);
+ RasterizeStroke(rasterizer, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, FALSE, fill_mode & FX_STROKE_TEXT_MODE);
int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag) << 8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
if (!RenderRasterizer(rasterizer, stroke_color, fill_mode & FXFILL_FULLCOVER, m_bGroupKnockout, fill_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb)
{
@@ -1208,7 +1208,7 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid
width = rect.Width();
int src_r = FXARGB_R(argb), src_g = FXARGB_G(argb), src_b = FXARGB_B(argb);
int Bpp = pBitmap->GetBPP() / 8;
- bool bAlpha = pBitmap->HasAlpha();
+ FX_BOOL bAlpha = pBitmap->HasAlpha();
int dib_argb = FXARGB_TOBGRORDERDIB(argb);
uint8_t* pBuffer = pBitmap->GetBuffer();
if (src_alpha == 255) {
@@ -1317,7 +1317,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
}
}
} else {
- ASSERT(false);
+ ASSERT(FALSE);
}
} else if (dest_format == FXDIB_Argb || dest_format == FXDIB_Rgb32) {
if (src_format == FXDIB_Rgb) {
@@ -1351,7 +1351,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
}
}
} else {
- ASSERT(false);
+ ASSERT(FALSE);
}
}
FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha)
@@ -1361,9 +1361,9 @@ FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha)
r, g, b);
return ArgbEncode(alpha, r, g, b);
}
-bool _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
- bool bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
int alpha = bObjCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
@@ -1376,7 +1376,7 @@ bool _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha
} else {
if (pDevice->IsCmykImage()) {
if (!bObjCMYK) {
- return false;
+ return FALSE;
}
} else {
if (bObjCMYK) {
@@ -1388,12 +1388,12 @@ bool _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha
if (pDevice->m_pAlphaMask) {
pDevice->m_pAlphaMask->SetPixel(x, y, alpha << 24);
}
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
pIccTransform = NULL;
@@ -1413,12 +1413,12 @@ bool CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag,
}
} else if (m_pClipRgn->GetType() == CFX_ClipRgn::MaskF) {
const CFX_DIBitmap* pMask = m_pClipRgn->GetMask();
- bool bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
int new_alpha = bCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
new_alpha = new_alpha * pMask->GetScanline(y)[x] / 255;
if (m_bRgbByteOrder) {
RgbByteOrderSetPixel(m_pBitmap, x, y, (color & 0xffffff) | (new_alpha << 24));
- return true;
+ return TRUE;
}
if (bCMYK) {
FXSETFLAG_ALPHA_FILL(alpha_flag, new_alpha);
@@ -1428,15 +1428,15 @@ bool CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag,
return _DibSetPixel(m_pBitmap, x, y, color, alpha_flag, pIccTransform);
}
}
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+FX_BOOL CFX_AggDeviceDriver::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;
}
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
FX_RECT clip_rect;
GetClipBox(&clip_rect);
@@ -1445,7 +1445,7 @@ bool CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, in
draw_rect.Intersect(*pRect);
}
if (draw_rect.IsEmpty()) {
- return true;
+ return TRUE;
}
if (m_pClipRgn == NULL || m_pClipRgn->GetType() == CFX_ClipRgn::RectI) {
if (m_bRgbByteOrder) {
@@ -1453,27 +1453,27 @@ bool CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, in
} else {
m_pBitmap->CompositeRect(draw_rect.left, draw_rect.top, draw_rect.Width(), draw_rect.Height(), fill_color, alpha_flag, pIccTransform);
}
- return true;
+ return TRUE;
}
m_pBitmap->CompositeMask(draw_rect.left, draw_rect.top, draw_rect.Width(), draw_rect.Height(), (const CFX_DIBitmap*)m_pClipRgn->GetMask(),
fill_color, draw_rect.left - clip_rect.left, draw_rect.top - clip_rect.top, FXDIB_BLEND_NORMAL, NULL, m_bRgbByteOrder, alpha_flag, pIccTransform);
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::GetClipBox(FX_RECT* pRect)
+FX_BOOL CFX_AggDeviceDriver::GetClipBox(FX_RECT* pRect)
{
if (m_pClipRgn == NULL) {
pRect->left = pRect->top = 0;
pRect->right = GetDeviceCaps(FXDC_PIXEL_WIDTH);
pRect->bottom = GetDeviceCaps(FXDC_PIXEL_HEIGHT);
- return true;
+ return TRUE;
}
*pRect = m_pClipRgn->GetBox();
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge)
+FX_BOOL CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (bDEdge) {
if (m_bRgbByteOrder) {
@@ -1481,23 +1481,23 @@ bool CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, vo
} else {
return pBitmap->TransferBitmap(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight(), m_pBitmap, left, top, pIccTransform);
}
- return true;
+ return TRUE;
}
FX_RECT rect(left, top, left + pBitmap->GetWidth(), top + pBitmap->GetHeight());
CFX_DIBitmap *pBack = NULL;
if (m_pOriDevice) {
pBack = m_pOriDevice->Clone(&rect);
if (!pBack) {
- return true;
+ return TRUE;
}
pBack->CompositeBitmap(0, 0, pBack->GetWidth(), pBack->GetHeight(), m_pBitmap, 0, 0);
} else {
pBack = m_pBitmap->Clone(&rect);
}
if (!pBack) {
- return true;
+ return TRUE;
}
- bool bRet = true;
+ FX_BOOL bRet = TRUE;
left = left >= 0 ? 0 : left;
top = top >= 0 ? 0 : top;
if (m_bRgbByteOrder) {
@@ -1508,11 +1508,11 @@ bool CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, vo
delete pBack;
return bRet;
}
-bool CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+FX_BOOL CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (pBitmap->IsAlphaMask())
return m_pBitmap->CompositeMask(left, top, pSrcRect->Width(), pSrcRect->Height(), pBitmap, argb,
@@ -1520,12 +1520,12 @@ bool CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb,
return m_pBitmap->CompositeBitmap(left, top, pSrcRect->Width(), pSrcRect->Height(), pBitmap,
pSrcRect->left, pSrcRect->top, blend_type, m_pClipRgn, m_bRgbByteOrder, pIccTransform);
}
-bool CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
+FX_BOOL CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, 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 (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (dest_width == pSource->GetWidth() && dest_height == pSource->GetHeight()) {
FX_RECT rect(0, 0, dest_width, dest_height);
@@ -1536,30 +1536,30 @@ bool CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD a
FX_RECT dest_clip = dest_rect;
dest_clip.Intersect(*pClipRect);
CFX_BitmapComposer composer;
- composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, false, false, false, m_bRgbByteOrder, alpha_flag, pIccTransform, blend_type);
+ composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, blend_type);
dest_clip.Offset(-dest_rect.left, -dest_rect.top);
CFX_ImageStretcher stretcher;
if (stretcher.Start(&composer, pSource, dest_width, dest_height, dest_clip, flags)) {
stretcher.Continue(NULL);
}
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
+FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
CFX_ImageRenderer* pRenderer = new CFX_ImageRenderer;
pRenderer->Start(m_pBitmap, m_pClipRgn, pSource, bitmap_alpha, argb, pMatrix, render_flags, m_bRgbByteOrder, alpha_flag, pIccTransform);
handle = pRenderer;
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
+FX_BOOL CFX_AggDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
return ((CFX_ImageRenderer*)pHandle)->Continue(pPause);
}
@@ -1572,30 +1572,30 @@ void CFX_AggDeviceDriver::CancelDIBits(void* pHandle)
}
CFX_FxgeDevice::CFX_FxgeDevice()
{
- m_bOwnedBitmap = false;
+ m_bOwnedBitmap = FALSE;
}
-bool CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
SetBitmap(pBitmap);
IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
+FX_BOOL CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
{
- m_bOwnedBitmap = true;
+ m_bOwnedBitmap = TRUE;
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
- return false;
+ return FALSE;
}
SetBitmap(pBitmap);
- IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, false, pOriDevice, false);
+ IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
CFX_FxgeDevice::~CFX_FxgeDevice()
{
diff --git a/core/src/fxge/android/fpf_skiafont.cpp b/core/src/fxge/android/fpf_skiafont.cpp
index f5ac6c0ce6..2dad01057a 100644
--- a/core/src/fxge/android/fpf_skiafont.cpp
+++ b/core/src/fxge/android/fpf_skiafont.cpp
@@ -87,23 +87,23 @@ int32_t CFPF_SkiaFont::GetDescent() const
}
return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
}
-bool CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox)
+FX_BOOL CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox)
{
if (!m_Face) {
- return false;
+ return FALSE;
}
if (FXFT_Is_Face_Tricky(m_Face)) {
if (FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72)) {
- return false;
+ return FALSE;
}
if (FXFT_Load_Glyph(m_Face, iGlyphIndex, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return false;
+ return FALSE;
}
FXFT_Glyph glyph;
if (FXFT_Get_Glyph(m_Face->glyph, &glyph)) {
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return false;
+ return FALSE;
}
FXFT_BBox cbox;
FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
@@ -119,24 +119,24 @@ bool CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox)
return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0;
}
if (FXFT_Load_Glyph(m_Face, iGlyphIndex, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
- return false;
+ return FALSE;
}
rtBBox.left = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingX(m_Face));
rtBBox.bottom = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingY(m_Face));
rtBBox.right = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingX(m_Face) + FXFT_Get_Glyph_Width(m_Face));
rtBBox.top = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingY(m_Face) - FXFT_Get_Glyph_Height(m_Face));
- return true;
+ return TRUE;
}
-bool CFPF_SkiaFont::GetBBox(FX_RECT &rtBBox)
+FX_BOOL CFPF_SkiaFont::GetBBox(FX_RECT &rtBBox)
{
if (!m_Face) {
- return false;
+ return FALSE;
}
rtBBox.left = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_xMin(m_Face));
rtBBox.top = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_yMin(m_Face));
rtBBox.right = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_xMax(m_Face));
rtBBox.bottom = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_yMax(m_Face));
- return true;
+ return TRUE;
}
int32_t CFPF_SkiaFont::GetHeight() const
{
@@ -167,10 +167,10 @@ FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable, uint8_t* pBuffer, FX_DWORD
}
return pdfium::base::checked_cast<FX_DWORD>(ulSize);
}
-bool CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset)
+FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset)
{
if (!pFontMgr || !pFontDes) {
- return false;
+ return FALSE;
}
switch (pFontDes->GetType()) {
case FPF_SKIAFONTTYPE_Path: {
@@ -189,16 +189,16 @@ bool CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor
}
break;
default:
- return false;
+ return FALSE;
}
if (!m_Face) {
- return false;
+ return FALSE;
}
m_dwStyle = dwStyle;
m_uCharset = uCharset;
m_pFontMgr = pFontMgr;
m_pFontDes = pFontDes;
m_dwRefCount = 1;
- return true;
+ return TRUE;
}
#endif
diff --git a/core/src/fxge/android/fpf_skiafont.h b/core/src/fxge/android/fpf_skiafont.h
index 90cf5cb29c..49819d4c11 100644
--- a/core/src/fxge/android/fpf_skiafont.h
+++ b/core/src/fxge/android/fpf_skiafont.h
@@ -39,13 +39,13 @@ public:
virtual int32_t GetAscent() const;
virtual int32_t GetDescent() const;
- virtual bool GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox);
- virtual bool GetBBox(FX_RECT &rtBBox);
+ virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox);
+ virtual FX_BOOL GetBBox(FX_RECT &rtBBox);
virtual int32_t GetHeight() const;
virtual int32_t GetItalicAngle() const;
virtual FX_DWORD GetFontData(FX_DWORD dwTable, uint8_t* pBuffer, FX_DWORD dwSize);
- bool InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset);
+ FX_BOOL InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset);
protected:
CFPF_SkiaFontMgr *m_pFontMgr;
CFPF_SkiaFontDescriptor *m_pFontDes;
diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp
index 8c835392fc..86bb052435 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/src/fxge/android/fpf_skiafontmgr.cpp
@@ -103,7 +103,7 @@ FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash)
}
return 0;
}
-static uint32_t FPF_GetHashCode_StringA(const FX_CHAR* pStr, int32_t iLength, bool bIgnoreCase = false)
+static uint32_t FPF_GetHashCode_StringA(const FX_CHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE)
{
if (!pStr) {
return 0;
@@ -208,27 +208,27 @@ static FX_DWORD FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily, FX_DWORD
bsFont += "Serif";
}
bsFont += uCharset;
- return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), true);
+ return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), TRUE);
}
-static bool FPF_SkiaIsCJK(uint8_t uCharset)
+static FX_BOOL FPF_SkiaIsCJK(uint8_t uCharset)
{
return (uCharset == FXFONT_GB2312_CHARSET) || (uCharset == FXFONT_CHINESEBIG5_CHARSET)
|| (uCharset == FXFONT_HANGEUL_CHARSET) || (uCharset == FXFONT_SHIFTJIS_CHARSET);
}
-static bool FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename)
+static FX_BOOL FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename)
{
CFX_ByteString bsName = bsFacename;
bsName.MakeLower();
return bsName.Find("symbol") > -1;
}
-static bool FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename)
+static FX_BOOL FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename)
{
CFX_ByteString bsName = bsFacename;
bsName.MakeLower();
return bsName.Find("arabic") > -1;
}
CFPF_SkiaFontMgr::CFPF_SkiaFontMgr()
- : m_bLoaded(false), m_FTLibrary(NULL)
+ : m_bLoaded(FALSE), m_FTLibrary(NULL)
{
}
CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr()
@@ -252,7 +252,7 @@ CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr()
FXFT_Done_FreeType(m_FTLibrary);
}
}
-bool CFPF_SkiaFontMgr::InitFTLibrary()
+FX_BOOL CFPF_SkiaFontMgr::InitFTLibrary()
{
if (m_FTLibrary == NULL) {
FXFT_Init_FreeType(&m_FTLibrary);
@@ -266,7 +266,7 @@ void CFPF_SkiaFontMgr::LoadSystemFonts()
}
ScanPath(FX_BSTRC("/system/fonts"));
OutputSystemFonts();
- m_bLoaded = true;
+ m_bLoaded = TRUE;
}
void CFPF_SkiaFontMgr::LoadPrivateFont(IFX_FileRead* pFontFile)
{
@@ -289,7 +289,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uin
FX_DWORD dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname);
FX_DWORD dwSubst = FPF_SkiaGetSubstFont(dwFaceName);
FX_DWORD dwSubstSans = FPF_SkiaGetSansFont(dwFaceName);
- bool bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname);
+ FX_BOOL bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname);
if (uCharset != FXFONT_ARABIC_CHARSET && FPF_SkiaMaybeArabic(bsFamilyname)) {
uCharset = FXFONT_ARABIC_CHARSET;
} else if (uCharset == FXFONT_ANSI_CHARSET && (dwMatch & FPF_MATCHFONT_REPLACEANSI)) {
@@ -309,7 +309,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uin
if (dwFaceName == dwSysFontName) {
nFind += FPF_SKIAMATCHWEIGHT_NAME1;
}
- bool bMatchedName = (nFind == FPF_SKIAMATCHWEIGHT_NAME1);
+ FX_BOOL bMatchedName = (nFind == FPF_SKIAMATCHWEIGHT_NAME1);
if ((dwStyle & FXFONT_BOLD) == (pFontDes->m_dwStyle & FXFONT_BOLD)) {
nFind += FPF_SKIAMATCHWEIGHT_1;
}
@@ -327,7 +327,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uin
}
if (dwSubst == dwSysFontName || dwSubstSans == dwSysFontName) {
nFind += FPF_SKIAMATCHWEIGHT_NAME2;
- bMatchedName = true;
+ bMatchedName = TRUE;
}
if (uCharset == FXFONT_DEFAULT_CHARSET || bMaybeSymbol) {
if (nFind > nMax && bMatchedName) {
@@ -399,7 +399,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const CFX_ByteStringC& bsFile, int32_t i
args.pathname = (FT_String*)bsFile.GetCStr();
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
- return false;
+ return FALSE;
}
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
@@ -418,7 +418,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const uint8_t* pBuffer, size_t szBuffer,
args.memory_size = szBuffer;
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
- return false;
+ return FALSE;
}
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
@@ -430,7 +430,7 @@ void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteStringC& path)
return;
}
CFX_ByteString filename;
- bool bFolder = false;
+ FX_BOOL bFolder = FALSE;
while (FX_GetNextFile(handle, filename, bFolder)) {
if (bFolder) {
if (filename == FX_BSTRC(".") || filename == FX_BSTRC("..")) {
diff --git a/core/src/fxge/android/fpf_skiafontmgr.h b/core/src/fxge/android/fpf_skiafontmgr.h
index b4ebe9454a..8c721ff68a 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.h
+++ b/core/src/fxge/android/fpf_skiafontmgr.h
@@ -94,7 +94,7 @@ class CFPF_SkiaFontMgr : public IFPF_FontMgr
public:
CFPF_SkiaFontMgr();
virtual ~CFPF_SkiaFontMgr();
- bool InitFTLibrary();
+ FX_BOOL InitFTLibrary();
virtual void LoadSystemFonts();
virtual void LoadPrivateFont(IFX_FileRead* pFontFile);
virtual void LoadPrivateFont(const CFX_ByteStringC& bsFileName);
@@ -109,7 +109,7 @@ protected:
void ScanFile(const CFX_ByteStringC& file);
void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor *pFontDesc);
void OutputSystemFonts();
- bool m_bLoaded;
+ FX_BOOL m_bLoaded;
CFX_PtrArray m_FontFaces;
FXFT_Library m_FTLibrary;
CFX_MapPtrToPtr m_FamilyFonts;
diff --git a/core/src/fxge/android/fx_android_font.cpp b/core/src/fxge/android/fx_android_font.cpp
index 4f2bc15b2a..3e2fc45854 100644
--- a/core/src/fxge/android/fx_android_font.cpp
+++ b/core/src/fxge/android/fx_android_font.cpp
@@ -10,20 +10,20 @@ CFX_AndroidFontInfo::CFX_AndroidFontInfo()
: m_pFontMgr(NULL)
{
}
-bool CFX_AndroidFontInfo::Init(IFPF_FontMgr *pFontMgr)
+FX_BOOL CFX_AndroidFontInfo::Init(IFPF_FontMgr *pFontMgr)
{
if (!pFontMgr) {
- return false;
+ return FALSE;
}
pFontMgr->LoadSystemFonts();
m_pFontMgr = pFontMgr;
- return true;
+ return TRUE;
}
-bool CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper)
+FX_BOOL CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper)
{
- return false;
+ return FALSE;
}
-void* CFX_AndroidFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, bool& bExact)
+void* CFX_AndroidFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact)
{
if (!m_pFontMgr) {
return NULL;
@@ -57,21 +57,21 @@ FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t*
}
return ((IFPF_Font*)hFont)->GetFontData(table, buffer, size);
}
-bool CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+FX_BOOL CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
{
if (!hFont) {
- return false;
+ return FALSE;
}
name = ((IFPF_Font*)hFont)->GetFamilyName();
- return true;
+ return TRUE;
}
-bool CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset)
+FX_BOOL CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset)
{
if (!hFont) {
- return false;
+ return FALSE;
}
charset = ((IFPF_Font*)hFont)->GetCharset();
- return false;
+ return FALSE;
}
void CFX_AndroidFontInfo::DeleteFont(void* hFont)
{
diff --git a/core/src/fxge/android/fx_android_font.h b/core/src/fxge/android/fx_android_font.h
index 075b79e7f2..83c04a03a4 100644
--- a/core/src/fxge/android/fx_android_font.h
+++ b/core/src/fxge/android/fx_android_font.h
@@ -18,18 +18,18 @@ public:
delete this;
}
- virtual bool EnumFontList(CFX_FontMapper* pMapper);
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
- virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, bool& bExact);
+ virtual void* 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);
virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size);
- virtual bool GetFaceName(void* hFont, CFX_ByteString& name);
- virtual bool GetFontCharset(void* hFont, int& charset);
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
virtual void DeleteFont(void* hFont);
virtual void* RetainFont(void* hFont);
- bool Init(IFPF_FontMgr *pFontMgr);
+ FX_BOOL Init(IFPF_FontMgr *pFontMgr);
protected:
IFPF_FontMgr *m_pFontMgr;
};
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h
index 0e6c9d683f..715e48d6c2 100644
--- a/core/src/fxge/apple/apple_int.h
+++ b/core/src/fxge/apple/apple_int.h
@@ -51,7 +51,7 @@ public:
void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize);
void DestroyFont(void* pFont);
void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix);
- bool drawGraphicsString(void* graphics,
+ FX_BOOL drawGraphicsString(void* graphics,
void* font,
FX_FLOAT fontSize,
FX_WORD* glyphIndices,
@@ -92,26 +92,26 @@ public:
{
return NULL;
}
- virtual bool IsPSPrintDriver()
+ virtual FX_BOOL IsPSPrintDriver()
{
- return false;
+ return FALSE;
}
- virtual bool StartRendering()
+ virtual FX_BOOL StartRendering()
{
- return true;
+ return TRUE;
}
virtual void EndRendering() {}
virtual void SaveState();
- virtual void RestoreState(bool bKeepSaved);
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData,
+ virtual void RestoreState(FX_BOOL bKeepSaved);
+ 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,
@@ -121,36 +121,36 @@ public:
void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL
);
- virtual bool SetPixel(int x, int y, FX_DWORD color,
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL)
{
- return false;
+ return FALSE;
}
- virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- 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 = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual bool GetClipBox(FX_RECT* pRect);
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
int dest_left, int dest_top, int blend_type,
int alpha_flag = 0, void* pIccTransform = NULL);
- 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 = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- 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 flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL)
{
- return false;
+ return FALSE;
}
- virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause)
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause)
{
- return false;
+ return FALSE;
}
virtual void CancelDIBits(void* handle) {}
- 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 = 0, void* pIccTransform = NULL);
virtual void ClearDriver();
@@ -159,7 +159,7 @@ protected:
void setFillInfo(FX_ARGB argb);
void setPathToContext(const CFX_PathData * pathData);
FX_FLOAT getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm);
- bool CG_DrawGlypRun(int nChars,
+ FX_BOOL CG_DrawGlypRun(int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
CFX_FontCache* pCache,
@@ -195,9 +195,9 @@ public:
{
return (FX_FILESIZE)_totalSize;
}
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
- virtual bool IsEOF() override
+ virtual FX_BOOL IsEOF() override
{
return _offSet == _totalSize;
}
diff --git a/core/src/fxge/apple/fx_apple_platform.cpp b/core/src/fxge/apple/fx_apple_platform.cpp
index 9f4712bf7e..9db807c3af 100644
--- a/core/src/fxge/apple/fx_apple_platform.cpp
+++ b/core/src/fxge/apple/fx_apple_platform.cpp
@@ -39,7 +39,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font * pFont,
{
return NULL;
}
-static bool _CGDrawGlyphRun(CGContextRef pContext,
+static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext,
int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
@@ -51,10 +51,10 @@ static bool _CGDrawGlyphRun(CGContextRef pContext,
void* pIccTransform)
{
if (nChars == 0) {
- return true;
+ return TRUE;
}
CFX_AffineMatrix new_matrix;
- bool bNegSize = font_size < 0;
+ FX_BOOL bNegSize = font_size < 0;
if (bNegSize) {
font_size = -font_size;
}
@@ -66,11 +66,11 @@ static bool _CGDrawGlyphRun(CGContextRef pContext,
CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
if (!pFont->m_pPlatformFont) {
if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- return false;
+ return FALSE;
}
pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
if (NULL == pFont->m_pPlatformFont) {
- return false;
+ return FALSE;
}
}
CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
@@ -101,7 +101,7 @@ static bool _CGDrawGlyphRun(CGContextRef pContext,
NULL);
}
static void _DoNothing(void *info, const void *data, size_t size) {}
-bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
+FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars,
const FXTEXT_CHARPOS * pCharPos,
CFX_Font * pFont,
CFX_FontCache * pCache,
@@ -111,22 +111,22 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
int alpha_flag, void* pIccTransform)
{
if (!pFont) {
- return false;
+ return FALSE;
}
- bool bBold = pFont->IsBold();
+ FX_BOOL bBold = pFont->IsBold();
if (!bBold && pFont->GetSubstFont() &&
pFont->GetSubstFont()->m_Weight >= 500 &&
pFont->GetSubstFont()->m_Weight <= 600) {
- return false;
+ return FALSE;
}
for (int i = 0; i < nChars; i ++) {
if (pCharPos[i].m_bGlyphAdjust) {
- return false;
+ return FALSE;
}
}
CGContextRef ctx = CGContextRef(m_pPlatformGraphics);
if (NULL == ctx) {
- return false;
+ return FALSE;
}
CGContextSaveGState(ctx);
CGContextSetTextDrawingMode(ctx, kCGTextFillClip);
@@ -143,7 +143,7 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
CGFloat decode_f[2] = {255.f, 0.f};
pImageCG = CGImageMaskCreate(pClipMask->GetWidth(), pClipMask->GetHeight(),
8, 8, pClipMask->GetPitch(), pClipMaskDataProvider,
- decode_f, false);
+ decode_f, FALSE);
CGDataProviderRelease(pClipMaskDataProvider);
}
} else {
@@ -155,7 +155,7 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
} else {
CGContextClipToRect(ctx, rect_cg);
}
- bool ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform);
+ FX_BOOL ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform);
if (pImageCG) {
CGImageRelease(pImageCG);
}
diff --git a/core/src/fxge/apple/fx_mac_imp.cpp b/core/src/fxge/apple/fx_mac_imp.cpp
index 5e5908b8ff..04b04b8ba8 100644
--- a/core/src/fxge/apple/fx_mac_imp.cpp
+++ b/core/src/fxge/apple/fx_mac_imp.cpp
@@ -28,7 +28,7 @@ Base14Substs[] = {
class CFX_MacFontInfo : public CFX_FolderFontInfo
{
public:
- virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool& bExact);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact);
};
#define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6"
#define JAPAN_MINCHO "Hiragino Mincho Pro W6"
@@ -44,14 +44,14 @@ static void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_fa
face = JAPAN_MINCHO;
}
}
-void* CFX_MacFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, bool& bExact)
+void* CFX_MacFontInfo::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;
for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
face = Base14Substs[iBaseFont].m_pSubstName;
- bExact = true;
+ bExact = TRUE;
break;
}
if (iBaseFont < 12) {
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index 8aa689fa91..d1e4f544ba 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -76,7 +76,7 @@ void CQuartz2D::setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix)
matrix->e,
ty));
}
-bool CQuartz2D::drawGraphicsString(void* graphics,
+FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
void* font,
FX_FLOAT fontSize,
FX_WORD* glyphIndices,
@@ -86,7 +86,7 @@ bool CQuartz2D::drawGraphicsString(void* graphics,
CFX_AffineMatrix* matrix )
{
if (!graphics) {
- return false;
+ return FALSE;
}
CGContextRef context = (CGContextRef) graphics;
CGContextSetFont(context, (CGFontRef)font);
@@ -113,7 +113,7 @@ bool CQuartz2D::drawGraphicsString(void* graphics,
#if CGFLOAT_IS_DOUBLE
CGPoint* glyphPositionsCG = new CGPoint[charsCount];
if (!glyphPositionsCG) {
- return false;
+ return FALSE;
}
for (int index = 0; index < charsCount; ++index) {
glyphPositionsCG[index].x = glyphPositions[index].x;
@@ -130,7 +130,7 @@ bool CQuartz2D::drawGraphicsString(void* graphics,
delete[] glyphPositionsCG;
#endif
CGContextRestoreGState(context);
- return true;
+ return TRUE;
}
void CQuartz2D::saveGraphicsState(void * graphics)
{
@@ -251,7 +251,7 @@ void CFX_QuartzDeviceDriver::SaveState()
CGContextSaveGState(_context);
m_saveCount++;
}
-void CFX_QuartzDeviceDriver::RestoreState(bool isKeepSaved )
+void CFX_QuartzDeviceDriver::RestoreState(FX_BOOL isKeepSaved )
{
CGContextRestoreGState(_context);
if (isKeepSaved) {
@@ -260,7 +260,7 @@ void CFX_QuartzDeviceDriver::RestoreState(bool isKeepSaved )
m_saveCount--;
}
}
-bool CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
+FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
const CFX_AffineMatrix* matrix,
int fillMode )
{
@@ -272,13 +272,13 @@ bool CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
m = CGAffineTransformConcat(m, _foxitDevice2User);
CGContextConcatCTM(_context, m);
setPathToContext(pathData);
- RestoreState(false);
+ RestoreState(FALSE);
if ((fillMode & 3) == FXFILL_WINDING) {
CGContextClip(_context);
} else {
CGContextEOClip(_context);
}
- return true;
+ return TRUE;
}
FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm)
{
@@ -294,7 +294,7 @@ FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphSt
}
return lineWidth;
}
-bool CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData,
+FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData,
const CFX_AffineMatrix* matrix,
const CFX_GraphStateData* graphState )
{
@@ -309,9 +309,9 @@ bool CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathDat
setStrokeInfo(graphState, 0xFF000000, lineWidth);
setPathToContext(pathData);
CGContextReplacePathWithStrokedPath(_context);
- RestoreState(false);
+ RestoreState(FALSE);
CGContextClip(_context);
- return true;
+ return TRUE;
}
static CGBlendMode GetCGBlendMode(int blend_type)
{
@@ -371,7 +371,7 @@ static CGBlendMode GetCGBlendMode(int blend_type)
}
return mode;
}
-bool CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
+FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
const CFX_AffineMatrix* matrix,
const CFX_GraphStateData* graphState,
FX_DWORD fillArgb,
@@ -423,10 +423,10 @@ bool CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
} else if (pathMode == 6) {
CGContextDrawPath(_context, kCGPathEOFillStroke);
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
+FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
FX_ARGB fillArgb,
int alphaFlag ,
void* iccTransform ,
@@ -449,9 +449,9 @@ bool CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
if (mode != kCGBlendModeNormal) {
CGContextSetBlendMode(_context, kCGBlendModeNormal);
}
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
+FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
FX_FLOAT y1,
FX_FLOAT x2,
FX_FLOAT y2,
@@ -483,9 +483,9 @@ bool CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
if (mode != kCGBlendModeNormal) {
CGContextSetBlendMode(_context, kCGBlendModeNormal);
}
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
+FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
{
CGRect r = CGContextGetClipBoundingBox(_context);
r = CGRectApplyAffineTransform(r, _user2FoxitDevice);
@@ -493,22 +493,22 @@ bool CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
rect->top = FXSYS_floor(r.origin.y);
rect->right = FXSYS_ceil(r.origin.x + r.size.width);
rect->bottom = FXSYS_ceil(r.origin.y + r.size.height);
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
+FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
int32_t left,
int32_t top,
void* pIccTransform,
- bool bDEdge)
+ FX_BOOL bDEdge)
{
if (FXDC_PRINTER == _deviceClass) {
- return false;
+ return FALSE;
}
if (bitmap->GetBPP() < 32) {
- return false;
+ return FALSE;
}
if (!(_renderCaps | FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
CGPoint pt = CGPointMake(left, top);
pt = CGPointApplyAffineTransform(pt, _foxitDevice2User);
@@ -517,7 +517,7 @@ bool CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
pt.y *= FXSYS_fabs(ctm.d);
CGImageRef image = CGBitmapContextCreateImage(_context);
if (NULL == image) {
- return false;
+ return FALSE;
}
CGFloat width = (CGFloat) bitmap->GetWidth();
CGFloat height = (CGFloat) bitmap->GetHeight();
@@ -552,9 +552,9 @@ bool CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
}
}
}
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
+FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
FX_ARGB argb,
const FX_RECT* srcRect,
int dest_left,
@@ -598,8 +598,8 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
pBitmap1 = pBitmap->Clone();
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
pBitmap1->GetBuffer(),
@@ -629,8 +629,8 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
if (pBitmap->GetBPP() < 32) {
pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
@@ -642,15 +642,15 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
}
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
if (pBitmap1->HasAlpha()) {
if (pBitmap1 == pBitmap) {
pBitmap1 = pBitmap->Clone();
if (!pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
}
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
@@ -682,10 +682,10 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
+FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
FX_ARGB argb,
int dest_left,
int dest_top,
@@ -723,8 +723,8 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
pBitmap1 = pBitmap->Clone();
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
pBitmap1->GetBuffer(),
@@ -754,8 +754,8 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
if (pBitmap->GetBPP() < 32) {
pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
@@ -767,15 +767,15 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
}
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
if (pBitmap1->HasAlpha()) {
if (pBitmap1 == pBitmap) {
pBitmap1 = pBitmap->Clone();
if (!pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
}
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
@@ -796,10 +796,10 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
+FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
CFX_FontCache* pCache,
@@ -811,16 +811,16 @@ bool CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
void* pIccTransform)
{
if (nChars == 0) {
- return true;
+ return TRUE;
}
CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
if (!pFont->m_pPlatformFont) {
if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- return false;
+ return FALSE;
}
pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
if (NULL == pFont->m_pPlatformFont) {
- return false;
+ return FALSE;
}
}
CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
@@ -872,10 +872,10 @@ bool CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
(CGGlyph*)glyph_indices,
glyph_positions,
nChars);
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
+FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
CFX_FontCache* pCache,
@@ -886,24 +886,24 @@ bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
void* pIccTransform)
{
if (NULL == pFont || NULL == _context) {
- return false;
+ return FALSE;
}
- bool bBold = pFont->IsBold();
+ FX_BOOL bBold = pFont->IsBold();
if (!bBold && pFont->GetSubstFont() &&
pFont->GetSubstFont()->m_Weight >= 500 &&
pFont->GetSubstFont()->m_Weight <= 600) {
- return false;
+ return FALSE;
}
SaveState();
CGContextSetTextDrawingMode(_context, kCGTextFillClip);
- bool ret = false;
+ FX_BOOL ret = FALSE;
int32_t i = 0;
while (i < nChars) {
if (pCharPos[i].m_bGlyphAdjust || font_size < 0) {
if (i > 0) {
ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
if (!ret) {
- RestoreState(false);
+ RestoreState(FALSE);
return ret;
}
}
@@ -920,7 +920,7 @@ bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
}
ret = CG_DrawGlypRun(1, char_pos, pFont, pCache, &glphy_matrix, pObject2Device, font_size, color, alpha_flag, pIccTransform);
if (!ret) {
- RestoreState(false);
+ RestoreState(FALSE);
return ret;
}
i ++;
@@ -934,7 +934,7 @@ bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
if (i > 0) {
ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
}
- RestoreState(false);
+ RestoreState(FALSE);
return ret;
}
void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState, FX_ARGB argb, FX_FLOAT lineWidth)
@@ -1074,7 +1074,7 @@ void CFX_QuartzDeviceDriver::ClearDriver()
}
CFX_QuartzDevice::CFX_QuartzDevice()
{
- m_bOwnedBitmap = false;
+ m_bOwnedBitmap = FALSE;
m_pContext = NULL;
}
CFX_QuartzDevice::~CFX_QuartzDevice()
@@ -1090,7 +1090,7 @@ CGContextRef CFX_QuartzDevice::GetContext()
{
return m_pContext;
}
-bool CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
+FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
{
if (m_pContext) {
CGContextRelease(m_pContext);
@@ -1099,30 +1099,30 @@ bool CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
CGContextRetain(m_pContext);
IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, nDeviceClass);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
+FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
{
SetBitmap(pBitmap);
m_pContext = createContextWithBitmap(pBitmap);
if (NULL == m_pContext) {
- return false;
+ return FALSE;
}
IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format)
+FX_BOOL CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format)
{
if ((uint8_t)format < 32) {
- return false;
+ return FALSE;
}
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
- return false;
+ return FALSE;
}
- m_bOwnedBitmap = true;
+ m_bOwnedBitmap = TRUE;
return Attach(pBitmap);
}
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
diff --git a/core/src/fxge/dib/dib_int.h b/core/src/fxge/dib/dib_int.h
index a6834fd641..825cabe1d1 100644
--- a/core/src/fxge/dib/dib_int.h
+++ b/core/src/fxge/dib/dib_int.h
@@ -63,7 +63,7 @@ public:
int dest_width, int dest_height, const FX_RECT& clip_rect,
const CFX_DIBSource* pSrcBitmap, int flags);
~CStretchEngine();
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Continue(IFX_Pause* pPause);
public:
FXDIB_Format m_DestFormat;
int m_DestBpp, m_SrcBpp, m_bHasAlpha;
@@ -84,8 +84,8 @@ public:
int m_Flags;
CWeightTable m_WeightTable;
int m_CurRow;
- bool StartStretchHorz();
- bool ContinueStretchHorz(IFX_Pause* pPause);
+ FX_BOOL StartStretchHorz();
+ FX_BOOL ContinueStretchHorz(IFX_Pause* pPause);
void StretchVert();
int m_State;
};
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp
index 9f454cc31d..cb99a37ff4 100644
--- a/core/src/fxge/dib/fx_dib_composite.cpp
+++ b/core/src/fxge/dib/fx_dib_composite.cpp
@@ -272,7 +272,7 @@ void _CompositeRow_Argb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int p
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
@@ -467,7 +467,7 @@ inline void _CompositeRow_Argb2Gray(uint8_t* dest_scan, const uint8_t* src_scan,
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
@@ -558,7 +558,7 @@ inline void _CompositeRow_Rgb2Gray(uint8_t* dest_scan, const uint8_t* src_scan,
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
if (pIccTransform) {
@@ -605,7 +605,7 @@ void _CompositeRow_Rgb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int sr
}
if (blend_type) {
int blended_color;
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
int back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
@@ -689,7 +689,7 @@ void _CompositeRow_Argb2Argb(uint8_t* dest_scan, const uint8_t* src_scan, int pi
uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
if (dest_alpha_scan == NULL) {
if (src_alpha_scan == NULL) {
uint8_t back_alpha = 0;
@@ -896,7 +896,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_
uint8_t* dest_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
@@ -957,7 +957,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(uint8_t* dest_scan, const uint8_t*
uint8_t* dest_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
@@ -1121,7 +1121,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(uint8_t* dest_scan, const uint8_t* src_
const uint8_t* src_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
if (src_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
@@ -1243,7 +1243,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* sr
inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
@@ -1266,7 +1266,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(uint8_t* dest_scan, const uint8_t
inline void _CompositeRow_Rgb2Rgb_Blend_Clip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
@@ -1357,7 +1357,7 @@ void _CompositeRow_Argb2Argb_Transform(uint8_t* dest_scan, const uint8_t* src_sc
}
} else {
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
uint8_t back_alpha = *dest_alpha_scan;
@@ -1487,7 +1487,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform(uint8_t* dest_scan, const uin
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
@@ -1630,7 +1630,7 @@ inline void _CompositeRow_8bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc
{
if (src_alpha_scan) {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1668,7 +1668,7 @@ inline void _CompositeRow_8bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc
}
} else {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1704,7 +1704,7 @@ inline void _CompositeRow_8bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s
{
if (src_alpha_scan) {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1778,7 +1778,7 @@ inline void _CompositeRow_8bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s
}
} else {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1836,7 +1836,7 @@ inline void _CompositeRow_1bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc
int reset_gray = pPalette[0];
int set_gray = pPalette[1];
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
@@ -1870,7 +1870,7 @@ inline void _CompositeRow_1bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s
int reset_gray = pPalette[0];
int set_gray = pPalette[1];
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
@@ -2787,7 +2787,7 @@ void _CompositeRow_BitMask2Graya(uint8_t* dest_scan, const uint8_t* src_scan, in
void _CompositeRow_Argb2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
@@ -2844,7 +2844,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src
void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
uint8_t back_alpha = dest_scan[3];
@@ -2881,7 +2881,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const
inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < width; col ++) {
uint8_t src_alpha;
if (clip_scan) {
@@ -2928,7 +2928,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_sca
inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
if (bNonseparableBlend) {
@@ -2995,7 +2995,7 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan
inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
@@ -3039,7 +3039,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, c
inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
uint8_t src_alpha = *clip_scan ++;
@@ -3495,7 +3495,7 @@ void _CompositeRow_BitMask2Rgb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* s
dest_scan += Bpp;
}
}
-inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha,
+inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha,
int& mask_red, int& mask_green, int& mask_blue, int& mask_black,
void* icc_module, void* pIccTransform)
{
@@ -3513,7 +3513,7 @@ inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alp
mask_blue = FXARGB_B(mask_color);
}
if (dest_format == FXDIB_8bppMask) {
- return true;
+ return TRUE;
}
if ((dest_format & 0xff) == 8) {
if (pIccTransform) {
@@ -3550,15 +3550,15 @@ inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alp
mask_blue = mask_color_p[0];
}
}
- return true;
+ return TRUE;
}
inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB_Format dest_format,
FX_DWORD*& pDestPalette, FX_DWORD* pSrcPalette,
void* icc_module, void* pIccTransform)
{
ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module;
- bool isSrcCmyk = src_format & 0x0400 ? true : false;
- bool isDstCmyk = dest_format & 0x0400 ? true : false;
+ FX_BOOL isSrcCmyk = src_format & 0x0400 ? TRUE : FALSE;
+ FX_BOOL isDstCmyk = dest_format & 0x0400 ? TRUE : FALSE;
pDestPalette = NULL;
if (pIccTransform) {
if (pSrcPalette) {
@@ -3679,7 +3679,7 @@ CFX_ScanlineCompositor::CFX_ScanlineCompositor()
m_pSrcPalette = NULL;
m_pCacheScanline = NULL;
m_CacheSize = 0;
- m_bRgbByteOrder = false;
+ m_bRgbByteOrder = FALSE;
m_BlendType = FXDIB_BLEND_NORMAL;
}
CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
@@ -3691,8 +3691,8 @@ CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
FX_Free(m_pCacheScanline);
}
}
-bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette,
- FX_DWORD mask_color, int blend_type, bool bClip, bool bRgbByteOrder, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette,
+ FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
{
m_SrcFormat = src_format;
m_DestFormat = dest_format;
@@ -3707,7 +3707,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
}
m_pIccTransform = pIccTransform;
if ((dest_format & 0xff) == 1) {
- return false;
+ return FALSE;
}
if (m_SrcFormat == FXDIB_1bppMask || m_SrcFormat == FXDIB_8bppMask) {
return _ScanlineCompositor_InitSourceMask(dest_format, alpha_flag, mask_color,
@@ -3715,11 +3715,11 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
pIccModule, pIccTransform);
}
if (pIccTransform == NULL && (~src_format & 0x0400) && (dest_format & 0x0400)) {
- return false;
+ return FALSE;
}
if ((m_SrcFormat & 0xff) <= 8) {
if (dest_format == FXDIB_8bppMask) {
- return true;
+ return TRUE;
}
_ScanlineCompositor_InitSourcePalette(src_format, dest_format, m_pSrcPalette, pSrcPalette,
pIccModule, pIccTransform);
@@ -3727,7 +3727,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
+ (dest_format & 0x0200 ? 2 : 0)
+ (dest_format & 0x0400 ? 4 : 0)
+ ((src_format & 0xff) == 1 ? 8 : 0);
- return true;
+ return TRUE;
}
m_Transparency = (src_format & 0x0200 ? 0 : 1)
+ (dest_format & 0x0200 ? 0 : 2)
@@ -3736,7 +3736,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
+ (src_format & 0x0400 ? 16 : 0)
+ (dest_format & 0x0400 ? 32 : 0)
+ (pIccTransform ? 64 : 0);
- return true;
+ return TRUE;
}
void CFX_ScanlineCompositor::CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan,
const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha)
@@ -4059,22 +4059,22 @@ void CFX_ScanlineCompositor::CompositeBitMaskLine(uint8_t* dest_scan, const uint
_CompositeRow_BitMask2Rgb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
src_left, width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
}
-bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top,
- int blend_type, const CFX_ClipRgn* pClipRgn, bool bRgbByteOrder, void* pIccTransform)
+ int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(!pSrcBitmap->IsAlphaMask());
ASSERT(m_bpp >= 8);
if (pSrcBitmap->IsAlphaMask() || m_bpp < 8) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(),
src_left, src_top, pClipRgn);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
const CFX_DIBitmap* pClipMask = NULL;
FX_RECT clip_box;
@@ -4086,11 +4086,11 @@ bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int h
CFX_ScanlineCompositor compositor;
if (!compositor.Init(GetFormat(), pSrcBitmap->GetFormat(), width, pSrcBitmap->GetPalette(), 0, blend_type,
pClipMask != NULL, bRgbByteOrder, 0, pIccTransform)) {
- return false;
+ return FALSE;
}
int dest_Bpp = m_bpp / 8;
int src_Bpp = pSrcBitmap->GetBPP() / 8;
- bool bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage();
+ FX_BOOL bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage();
CFX_DIBitmap* pSrcAlphaMask = pSrcBitmap->m_pAlphaMask;
for (int row = 0; row < height; row ++) {
uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * dest_Bpp;
@@ -4107,27 +4107,27 @@ bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int h
compositor.CompositePalBitmapLine(dest_scan, src_scan, src_left, width, clip_scan, src_scan_extra_alpha, dst_scan_extra_alpha);
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top,
- int blend_type, const CFX_ClipRgn* pClipRgn, bool bRgbByteOrder, int alpha_flag, void* pIccTransform)
+ int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(pMask->IsAlphaMask());
ASSERT(m_bpp >= 8);
if (!pMask->IsAlphaMask() || m_bpp < 8) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, pClipRgn);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
int src_alpha = (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
if (src_alpha == 0) {
- return true;
+ return TRUE;
}
const CFX_DIBitmap* pClipMask = NULL;
FX_RECT clip_box;
@@ -4140,7 +4140,7 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int hei
int Bpp = GetBPP() / 8;
CFX_ScanlineCompositor compositor;
if (!compositor.Init(GetFormat(), pMask->GetFormat(), width, NULL, color, blend_type, pClipMask != NULL, bRgbByteOrder, alpha_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
for (int row = 0; row < height; row ++) {
uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
@@ -4156,21 +4156,21 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int hei
compositor.CompositeByteMaskLine(dest_scan, src_scan + src_left, width, clip_scan, dst_scan_extra_alpha);
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
int src_alpha = (alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
if (src_alpha == 0) {
- return true;
+ return TRUE;
}
FX_RECT rect(left, top, left + width, top + height);
rect.Intersect(0, 0, m_Width, m_Height);
if (rect.IsEmpty()) {
- return true;
+ return TRUE;
}
width = rect.Width();
FX_DWORD dst_color;
@@ -4210,7 +4210,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
dest_scan ++;
}
}
- return true;
+ return TRUE;
}
if (m_bpp == 1) {
ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0);
@@ -4248,11 +4248,11 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
}
}
}
- return true;
+ return TRUE;
}
ASSERT(m_bpp >= 24);
if (m_bpp < 24) {
- return false;
+ return FALSE;
}
if (pIccTransform && CFX_GEModule::Get()->GetCodecModule()) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
@@ -4262,15 +4262,15 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
color_p[2], color_p[1], color_p[0]);
else if (!(alpha_flag >> 8) && IsCmykImage()) {
- return false;
+ return FALSE;
}
}
if(!IsCmykImage()) {
color_p[3] = (uint8_t)src_alpha;
}
int Bpp = m_bpp / 8;
- bool bAlpha = HasAlpha();
- bool bArgb = GetFormat() == FXDIB_Argb ? true : false;
+ FX_BOOL bAlpha = HasAlpha();
+ FX_BOOL bArgb = GetFormat() == FXDIB_Argb ? TRUE : FALSE;
if (src_alpha == 255) {
for (int row = rect.top; row < rect.bottom; row ++) {
uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
@@ -4291,7 +4291,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
}
}
}
- return true;
+ return TRUE;
}
for (int row = rect.top; row < rect.bottom; row ++) {
uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
@@ -4346,7 +4346,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
}
}
}
- return true;
+ return TRUE;
}
CFX_BitmapComposer::CFX_BitmapComposer()
{
@@ -4354,7 +4354,7 @@ CFX_BitmapComposer::CFX_BitmapComposer()
m_pScanlineAlphaV = NULL;
m_pClipScanV = NULL;
m_pAddClipScan = NULL;
- m_bRgbByteOrder = false;
+ m_bRgbByteOrder = FALSE;
m_BlendType = FXDIB_BLEND_NORMAL;
}
CFX_BitmapComposer::~CFX_BitmapComposer()
@@ -4373,8 +4373,8 @@ CFX_BitmapComposer::~CFX_BitmapComposer()
}
}
void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha,
- FX_DWORD mask_color, FX_RECT& dest_rect, bool bVertical,
- bool bFlipX, bool bFlipY, bool bRgbByteOrder,
+ FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical,
+ FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder,
int alpha_flag, void* pIccTransform, int blend_type)
{
m_pBitmap = pDest;
@@ -4397,12 +4397,12 @@ void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRg
m_bRgbByteOrder = bRgbByteOrder;
m_BlendType = blend_type;
}
-bool CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
+FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
{
m_SrcFormat = src_format;
if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, width, pSrcPalette, m_MaskColor, FXDIB_BLEND_NORMAL,
m_pClipMask != NULL || (m_BitmapAlpha < 255), m_bRgbByteOrder, m_AlphaFlag, m_pIccTransform)) {
- return false;
+ return FALSE;
}
if (m_bVertical) {
m_pScanlineV = FX_Alloc(uint8_t, m_pBitmap->GetBPP() / 8 * width + 4);
@@ -4414,7 +4414,7 @@ bool CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format,
if (m_BitmapAlpha < 255) {
m_pAddClipScan = FX_Alloc(uint8_t, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
}
- return true;
+ return TRUE;
}
void CFX_BitmapComposer::DoCompose(uint8_t* dest_scan, const uint8_t* src_scan, int dest_width, const uint8_t* clip_scan,
const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha)
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index 7e5a0341a2..d7860aee19 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -103,7 +103,7 @@ public:
CFX_Palette();
~CFX_Palette();
public:
- bool BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType);
+ FX_BOOL BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType);
FX_DWORD* GetPalette() const
{
return m_pPalette;
@@ -227,10 +227,10 @@ CFX_Palette::~CFX_Palette()
}
m_lut = 0;
}
-bool CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
+FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
{
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
if (m_pPalette != NULL) {
FX_Free(m_pPalette);
@@ -277,9 +277,9 @@ bool CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
win_mac_pal = (FX_DWORD*)g_dwMacPalette;
}
_Obtain_Pal(m_aLut, m_cLut, m_pPalette, pal_type, win_mac_pal, m_lut);
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
uint8_t set_gray, reset_gray;
@@ -296,9 +296,9 @@ bool _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width,
dest_scan ++;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
for (int row = 0; row < height; row ++) {
@@ -306,9 +306,9 @@ bool _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width,
const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
FXSYS_memcpy(dest_scan, src_scan, width);
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
@@ -359,9 +359,9 @@ bool _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, i
dest_scan ++;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
@@ -402,9 +402,9 @@ bool _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, i
*dest_scan++ = gray[*src_scan++];
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int Bpp = pSrcBitmap->GetBPP() / 8;
@@ -451,7 +451,7 @@ bool _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width,
}
}
}
- return true;
+ return TRUE;
}
inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
@@ -476,7 +476,7 @@ inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int widt
}
}
}
-bool _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
{
_ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
@@ -515,9 +515,9 @@ bool _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, in
FXSYS_memcpy(dst_plt, src_plt, plt_size * 4);
}
}
- return true;
+ return TRUE;
}
-inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_pitch, int width, int height,
+inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt)
{
int bpp = pSrcBitmap->GetBPP() / 8;
@@ -527,7 +527,7 @@ inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_p
FX_DWORD* cLut = palette.GetColorLut();
FX_DWORD* aLut = palette.GetAmountLut();
if (cLut == NULL || aLut == NULL) {
- return false;
+ return FALSE;
}
int lut = palette.Getlut();
FX_DWORD* pPalette = palette.GetPalette();
@@ -571,12 +571,12 @@ inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_p
}
}
FXSYS_memcpy(dst_plt, pPalette, sizeof(FX_DWORD) * 256);
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
{
- bool ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt);
+ FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt);
if (ret && pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
for (int i = 0; i < 256; i++) {
@@ -588,7 +588,7 @@ bool _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, in
}
return ret;
}
-bool _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
@@ -611,9 +611,9 @@ bool _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
@@ -629,9 +629,9 @@ bool _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps - 2;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = (dst_format & 0xff) / 8;
@@ -676,9 +676,9 @@ bool _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps - 2;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = (dst_format & 0xff) / 8;
@@ -722,9 +722,9 @@ bool _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps - 2;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (pIccTransform) {
@@ -741,9 +741,9 @@ bool _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width,
FXSYS_memcpy(dest_scan, src_scan, width * 3);
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
for (int row = 0; row < height; row ++) {
@@ -763,9 +763,9 @@ bool _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width,
pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width);
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = pSrcBitmap->GetBPP() / 8;
@@ -793,9 +793,9 @@ bool _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int
}
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (pIccTransform) {
@@ -821,9 +821,9 @@ bool _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width
}
}
}
- return true;
+ return TRUE;
}
-bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& d_pal, void* pIccTransform)
{
FXDIB_Format src_format = pSrcBitmap->GetFormat();
@@ -835,8 +835,8 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
case FXDIB_1bppCmyk:
case FXDIB_1bppMask:
case FXDIB_1bppRgb:
- ASSERT(false);
- return false;
+ ASSERT(FALSE);
+ return FALSE;
case FXDIB_8bppMask: {
if ((src_format & 0xff) == 1) {
if (pSrcBitmap->GetPalette()) {
@@ -853,7 +853,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
if ((src_format & 0xff) >= 24) {
return _ConvertBuffer_RgbOrCmyk2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
}
- return false;
+ return FALSE;
}
case FXDIB_8bppRgb:
case FXDIB_8bppRgba: {
@@ -867,7 +867,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
if ((src_format & 0xff) >= 24) {
return _ConvertBuffer_Rgb2PltRgb8(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
}
- return false;
+ return FALSE;
}
case FXDIB_Rgb:
case FXDIB_Rgba: {
@@ -889,7 +889,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
if ((src_format & 0xff) == 32) {
return _ConvertBuffer_32bppRgb2Rgb24(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
}
- return false;
+ return FALSE;
}
case FXDIB_Argb:
case FXDIB_Rgb32: {
@@ -911,12 +911,12 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
}
return _ConvertBuffer_Rgb2Rgb32(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
}
- return false;
+ return FALSE;
}
default:
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_RECT* pClip, void* pIccTransform) const
{
@@ -939,7 +939,7 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_REC
delete pClone;
return NULL;
}
- bool ret = true;
+ FX_BOOL ret = TRUE;
CFX_DIBitmap* pSrcAlpha = NULL;
if (m_AlphaFlag & 2) {
pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask;
@@ -981,15 +981,15 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_REC
}
return pClone;
}
-bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
+FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
{
FXDIB_Format src_format = GetFormat();
if (dest_format == src_format && pIccTransform == NULL) {
- return true;
+ return TRUE;
}
if (dest_format == FXDIB_8bppMask && src_format == FXDIB_8bppRgb && m_pPalette == NULL) {
m_AlphaFlag = 1;
- return true;
+ return TRUE;
}
if (dest_format == FXDIB_Argb && src_format == FXDIB_Rgb32 && pIccTransform == NULL) {
m_AlphaFlag = 2;
@@ -1000,13 +1000,13 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
scanline += 4;
}
}
- return true;
+ return TRUE;
}
int dest_bpp = dest_format & 0xff;
int dest_pitch = (dest_bpp * m_Width + 31) / 32 * 4;
uint8_t* dest_buf = FX_TryAlloc(uint8_t, dest_pitch * m_Height + 4);
if (dest_buf == NULL) {
- return false;
+ return FALSE;
}
CFX_DIBitmap* pAlphaMask = NULL;
if (dest_format == FXDIB_Argb) {
@@ -1026,13 +1026,13 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
pAlphaMask = GetAlphaMask();
if (pAlphaMask == NULL) {
FX_Free(dest_buf);
- return false;
+ return FALSE;
}
} else {
if (m_pAlphaMask == NULL) {
if (!BuildAlphaMask()) {
FX_Free(dest_buf);
- return false;
+ return FALSE;
}
pAlphaMask = m_pAlphaMask;
m_pAlphaMask = NULL;
@@ -1041,7 +1041,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
}
}
}
- bool ret = false;
+ FX_BOOL ret = FALSE;
FX_DWORD* pal_8bpp = NULL;
ret = ConvertBuffer(dest_format, dest_buf, dest_pitch, m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform);
if (!ret) {
@@ -1054,7 +1054,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
if (dest_buf) {
FX_Free(dest_buf);
}
- return false;
+ return FALSE;
}
if (m_pAlphaMask && pAlphaMask != m_pAlphaMask) {
delete m_pAlphaMask;
@@ -1067,10 +1067,10 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
if (!m_bExtBuf) {
FX_Free(m_pBuffer);
}
- m_bExtBuf = false;
+ m_bExtBuf = FALSE;
m_pBuffer = dest_buf;
m_bpp = (uint8_t)dest_format;
m_AlphaFlag = (uint8_t)(dest_format >> 8);
m_Pitch = dest_pitch;
- return true;
+ return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index f143ac3ae2..7390c431d9 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -217,7 +217,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d
m_SrcHeight = pSrcBitmap->GetHeight();
m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4;
if ((flags & FXDIB_NOSMOOTH) == 0) {
- bool bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
+ FX_BOOL bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
if (!bInterpol && FXSYS_abs(dest_width) != 0 && FXSYS_abs(dest_height) < m_SrcWidth * m_SrcHeight * 8 / FXSYS_abs(dest_width)) {
flags = FXDIB_INTERPOL;
}
@@ -280,16 +280,16 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d
}
}
}
-bool CStretchEngine::Continue(IFX_Pause* pPause)
+FX_BOOL CStretchEngine::Continue(IFX_Pause* pPause)
{
while (m_State == 1) {
if (ContinueStretchHorz(pPause)) {
- return true;
+ return TRUE;
}
m_State = 2;
StretchVert();
}
- return false;
+ return FALSE;
}
CStretchEngine::~CStretchEngine()
{
@@ -306,46 +306,46 @@ CStretchEngine::~CStretchEngine()
FX_Free(m_pDestMaskScanline);
}
}
-bool CStretchEngine::StartStretchHorz()
+FX_BOOL CStretchEngine::StartStretchHorz()
{
if (m_DestWidth == 0 || m_pDestScanline == NULL || m_SrcClip.Height() > (int)((1U << 29) / m_InterPitch) || m_SrcClip.Height() == 0) {
- return false;
+ return FALSE;
}
m_pInterBuf = FX_TryAlloc(unsigned char, m_SrcClip.Height() * m_InterPitch);
if (m_pInterBuf == NULL) {
- return false;
+ return FALSE;
}
if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) {
m_pExtraAlphaBuf = FX_Alloc2D(unsigned char, m_SrcClip.Height(), m_ExtraMaskPitch);
FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4;
m_pDestMaskScanline = FX_TryAlloc(unsigned char, size);
if (!m_pDestMaskScanline) {
- return false;
+ return FALSE;
}
}
m_WeightTable.Calc(m_DestWidth, m_DestClip.left, m_DestClip.right, m_SrcWidth, m_SrcClip.left, m_SrcClip.right, m_Flags);
if (m_WeightTable.m_pWeightTables == NULL) {
- return false;
+ return FALSE;
}
m_CurRow = m_SrcClip.top;
m_State = 1;
- return true;
+ return TRUE;
}
#define FX_STRECH_PAUSE_ROWS 10
-bool CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
+FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
{
if (!m_DestWidth) {
return 0;
}
if (m_pSource->SkipToScanline(m_CurRow, pPause)) {
- return true;
+ return TRUE;
}
int Bpp = m_DestBpp / 8;
int rows_to_go = FX_STRECH_PAUSE_ROWS;
for (; m_CurRow < m_SrcClip.bottom; m_CurRow ++) {
if (rows_to_go == 0) {
if (pPause && pPause->NeedToPauseNow()) {
- return true;
+ return TRUE;
}
rows_to_go = FX_STRECH_PAUSE_ROWS;
}
@@ -532,7 +532,7 @@ bool CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
}
rows_to_go --;
}
- return false;
+ return FALSE;
}
void CStretchEngine::StretchVert()
{
@@ -697,7 +697,7 @@ FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc)
}
return format;
}
-bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
+FX_BOOL CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
const CFX_DIBSource* pSource, int dest_width, int dest_height,
const FX_RECT& rect, FX_DWORD flags)
{
@@ -722,7 +722,7 @@ bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
pal[i] = ArgbEncode(a, r, g, b);
}
if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
- return false;
+ return FALSE;
}
} else if (pSource->GetFormat() == FXDIB_1bppCmyk && pSource->GetPalette()) {
FX_CMYK pal[256];
@@ -737,17 +737,17 @@ bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
pal[i] = CmykEncode(c, m, y, k);
}
if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
- return false;
+ return FALSE;
}
} else if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, NULL)) {
- return false;
+ return FALSE;
}
if (flags & FXDIB_DOWNSAMPLE) {
return StartQuickStretch();
}
return StartStretch();
}
-bool CFX_ImageStretcher::Continue(IFX_Pause* pPause)
+FX_BOOL CFX_ImageStretcher::Continue(IFX_Pause* pPause)
{
if (m_Flags & FXDIB_DOWNSAMPLE) {
return ContinueQuickStretch(pPause);
@@ -755,39 +755,39 @@ bool CFX_ImageStretcher::Continue(IFX_Pause* pPause)
return ContinueStretch(pPause);
}
#define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000
-bool CFX_ImageStretcher::StartStretch()
+FX_BOOL CFX_ImageStretcher::StartStretch()
{
m_pStretchEngine = new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect, m_pSource, m_Flags);
m_pStretchEngine->StartStretchHorz();
if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
m_pStretchEngine->Continue(NULL);
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause)
+FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause)
{
if (m_pStretchEngine == NULL) {
- return false;
+ return FALSE;
}
return m_pStretchEngine->Continue(pPause);
}
-bool CFX_ImageStretcher::StartQuickStretch()
+FX_BOOL CFX_ImageStretcher::StartQuickStretch()
{
- m_bFlipX = false;
- m_bFlipY = false;
+ m_bFlipX = FALSE;
+ m_bFlipY = FALSE;
if (m_DestWidth < 0) {
- m_bFlipX = true;
+ m_bFlipX = TRUE;
m_DestWidth = -m_DestWidth;
}
if (m_DestHeight < 0) {
- m_bFlipY = true;
+ m_bFlipY = TRUE;
m_DestHeight = -m_DestHeight;
}
m_LineIndex = 0;
FX_DWORD size = m_ClipRect.Width();
if (size && m_DestBPP > (int)(INT_MAX / size)) {
- return false;
+ return FALSE;
}
size *= m_DestBPP;
m_pScanline = FX_Alloc(uint8_t, (size / 8 + 3) / 4 * 4);
@@ -796,14 +796,14 @@ bool CFX_ImageStretcher::StartQuickStretch()
}
if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
ContinueQuickStretch(NULL);
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
+FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
{
if (m_pScanline == NULL) {
- return false;
+ return FALSE;
}
int result_width = m_ClipRect.Width(), result_height = m_ClipRect.Height();
int src_height = m_pSource->GetHeight();
@@ -823,7 +823,7 @@ bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
src_y = 0;
}
if (m_pSource->SkipToScanline(src_y, pPause)) {
- return true;
+ return TRUE;
}
m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
if (m_pMaskScanline) {
@@ -831,5 +831,5 @@ bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
}
m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline);
}
- return false;
+ return FALSE;
}
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index efd886e2b7..8a864f10a1 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -9,7 +9,7 @@
#include "../../../include/fxcodec/fx_codec.h"
#include "dib_int.h"
#include <limits.h>
-bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& pal, void* pIccTransform);
void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k)
{
@@ -52,39 +52,39 @@ CFX_DIBSource::~CFX_DIBSource()
}
CFX_DIBitmap::CFX_DIBitmap()
{
- m_bExtBuf = false;
+ m_bExtBuf = FALSE;
m_pBuffer = NULL;
m_pPalette = NULL;
}
#define _MAX_OOM_LIMIT_ 12000000
-bool CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer, int pitch)
+FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer, int pitch)
{
m_pBuffer = NULL;
m_bpp = (uint8_t)format;
m_AlphaFlag = (uint8_t)(format >> 8);
m_Width = m_Height = m_Pitch = 0;
if (width <= 0 || height <= 0 || pitch < 0) {
- return false;
+ return FALSE;
}
if ((INT_MAX - 31) / width < (format & 0xff)) {
- return false;
+ return FALSE;
}
if (!pitch) {
pitch = (width * (format & 0xff) + 31) / 32 * 4;
}
if ((1 << 30) / pitch < height) {
- return false;
+ return FALSE;
}
if (pBuffer) {
m_pBuffer = pBuffer;
- m_bExtBuf = true;
+ m_bExtBuf = TRUE;
} else {
int size = pitch * height + 4;
int oomlimit = _MAX_OOM_LIMIT_;
if (oomlimit >= 0 && size >= oomlimit) {
m_pBuffer = FX_TryAlloc(uint8_t, size);
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
} else {
m_pBuffer = FX_Alloc(uint8_t, size);
@@ -94,33 +94,33 @@ bool CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* p
m_Height = height;
m_Pitch = pitch;
if (HasAlpha() && format != FXDIB_Argb) {
- bool ret = true;
+ FX_BOOL ret = TRUE;
ret = BuildAlphaMask();
if (!ret) {
if (!m_bExtBuf && m_pBuffer) {
FX_Free(m_pBuffer);
m_pBuffer = NULL;
m_Width = m_Height = m_Pitch = 0;
- return false;
+ return FALSE;
}
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc)
+FX_BOOL CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc)
{
if (m_pBuffer) {
- return false;
+ return FALSE;
}
if (!Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat())) {
- return false;
+ return FALSE;
}
CopyPalette(pSrc->GetPalette());
CopyAlphaMask(pSrc->m_pAlphaMask);
for (int row = 0; row < pSrc->GetHeight(); row ++) {
FXSYS_memcpy(m_pBuffer + row * m_Pitch, pSrc->GetScanline(row), m_Pitch);
}
- return true;
+ return TRUE;
}
CFX_DIBitmap::~CFX_DIBitmap()
{
@@ -218,19 +218,19 @@ void CFX_DIBSource::BuildPalette()
}
}
}
-bool CFX_DIBSource::BuildAlphaMask()
+FX_BOOL CFX_DIBSource::BuildAlphaMask()
{
if (m_pAlphaMask) {
- return true;
+ return TRUE;
}
m_pAlphaMask = new CFX_DIBitmap;
if (!m_pAlphaMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete m_pAlphaMask;
m_pAlphaMask = NULL;
- return false;
+ return FALSE;
}
FXSYS_memset(m_pAlphaMask->GetBuffer(), 0xff, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
- return true;
+ return TRUE;
}
FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const
{
@@ -367,15 +367,15 @@ void CFX_DIBSource::GetOverlapRect(int& dest_left, int& dest_top, int& width, in
width = dest_rect.right - dest_rect.left;
height = dest_rect.bottom - dest_rect.top;
}
-bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(), src_left, src_top, NULL);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
FXDIB_Format dest_format = GetFormat();
FXDIB_Format src_format = pSrcBitmap->GetFormat();
@@ -402,7 +402,7 @@ bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int he
}
} else {
if (m_pPalette) {
- return false;
+ return FALSE;
}
if (m_bpp == 8) {
dest_format = FXDIB_8bppMask;
@@ -410,25 +410,25 @@ bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int he
uint8_t* dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8;
FX_DWORD* d_plt = NULL;
if(!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height, pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(HasAlpha() && (m_bpp >= 24));
ASSERT(pMask->IsAlphaMask());
if (!HasAlpha() || !pMask->IsAlphaMask() || m_bpp < 24) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, NULL);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
int src_bpp = pMask->GetBPP();
int alpha;
@@ -449,7 +449,7 @@ bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int heig
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
color_p[2], color_p[1], color_p[0]);
else if (!(alpha_flag >> 8) && IsCmykImage()) {
- return false;
+ return FALSE;
}
}
if(!IsCmykImage()) {
@@ -507,7 +507,7 @@ bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int heig
}
}
}
- return true;
+ return TRUE;
}
void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size)
{
@@ -570,21 +570,21 @@ CFX_DIBitmap* CFX_DIBSource::GetAlphaMask(const FX_RECT* pClip) const
}
return pMask;
}
-bool CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip)
+FX_BOOL CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip)
{
if (!HasAlpha() || GetFormat() == FXDIB_Argb) {
- return false;
+ return FALSE;
}
if (pAlphaMask) {
FX_RECT rect(0, 0, pAlphaMask->m_Width, pAlphaMask->m_Height);
if (pClip) {
rect.Intersect(*pClip);
if (rect.IsEmpty() || rect.Width() != m_Width || rect.Height() != m_Height) {
- return false;
+ return FALSE;
}
} else {
if (pAlphaMask->m_Width != m_Width || pAlphaMask->m_Height != m_Height) {
- return false;
+ return FALSE;
}
}
for (int row = 0; row < m_Height; row ++)
@@ -593,25 +593,25 @@ bool CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT
} else {
m_pAlphaMask->Clear(0xff000000);
}
- return true;
+ return TRUE;
}
const int g_ChannelOffset[] = {0, 2, 1, 0, 0, 1, 2, 3, 3};
-bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel)
+FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
CFX_DIBSource* pSrcClone = (CFX_DIBSource*)pSrcBitmap;
CFX_DIBitmap* pDst = this;
int destOffset, srcOffset;
if (srcChannel == FXDIB_Alpha) {
if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (pSrcBitmap->GetBPP() == 1) {
pSrcClone = pSrcBitmap->CloneConvert(FXDIB_8bppMask);
if (pSrcClone == NULL) {
- return false;
+ return FALSE;
}
}
if(pSrcBitmap->GetFormat() == FXDIB_Argb) {
@@ -621,7 +621,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
}
} else {
if (pSrcBitmap->IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (pSrcBitmap->GetBPP() < 24) {
if (pSrcBitmap->IsCmykImage()) {
@@ -630,7 +630,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
pSrcClone = pSrcBitmap->CloneConvert((FXDIB_Format)((pSrcBitmap->GetFormat() & 0xff00) | 0x18));
}
if (pSrcClone == NULL) {
- return false;
+ return FALSE;
}
}
srcOffset = g_ChannelOffset[srcChannel];
@@ -641,7 +641,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
destOffset = 0;
} else {
@@ -650,7 +650,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
if (GetFormat() == FXDIB_Argb) {
destOffset = 3;
@@ -661,7 +661,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
if (GetBPP() < 24) {
if (HasAlpha()) {
@@ -669,7 +669,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
} else
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -680,7 +680,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
}
destOffset = g_ChannelOffset[destChannel];
@@ -694,7 +694,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
}
}
@@ -710,7 +710,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
delete pSrcClone;
}
if (pSrcMatched == NULL) {
- return false;
+ return FALSE;
}
pSrcClone = pSrcMatched;
}
@@ -732,24 +732,24 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap && pSrcClone != pSrcBitmap->m_pAlphaMask) {
delete pSrcClone;
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
+FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
int destOffset;
if (destChannel == FXDIB_Alpha) {
if (IsAlphaMask()) {
if(!ConvertFormat(FXDIB_8bppMask)) {
- return false;
+ return FALSE;
}
destOffset = 0;
} else {
destOffset = 0;
if(!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- return false;
+ return FALSE;
}
if (GetFormat() == FXDIB_Argb) {
destOffset = 3;
@@ -757,21 +757,21 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
}
} else {
if (IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (GetBPP() < 24) {
if (HasAlpha()) {
if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- return false;
+ return FALSE;
}
} else
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) {
- return false;
+ return FALSE;
}
#else
if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) {
- return false;
+ return FALSE;
}
#endif
}
@@ -780,11 +780,11 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
int Bpp = GetBPP() / 8;
if (Bpp == 1) {
FXSYS_memset(m_pBuffer, value, m_Height * m_Pitch);
- return true;
+ return TRUE;
}
if (destChannel == FXDIB_Alpha && m_pAlphaMask) {
FXSYS_memset(m_pAlphaMask->GetBuffer(), value, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
- return true;
+ return TRUE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* scan_line = m_pBuffer + row * m_Pitch + destOffset;
@@ -793,16 +793,16 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
scan_line += Bpp;
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
+FX_BOOL CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(pSrcBitmap->IsAlphaMask());
if (!pSrcBitmap->IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (!IsAlphaMask() && !HasAlpha()) {
return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha);
@@ -812,7 +812,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height);
ASSERT(pSrcClone != NULL);
if (pSrcClone == NULL) {
- return false;
+ return FALSE;
}
}
if (IsAlphaMask()) {
@@ -820,7 +820,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* dest_scan = m_pBuffer + m_Pitch * row;
@@ -844,7 +844,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* dest_scan = m_pBuffer + m_Pitch * row + 3;
@@ -861,17 +861,17 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
+FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
switch (GetFormat()) {
case FXDIB_1bppRgb: {
if (m_pPalette == NULL) {
- return false;
+ return FALSE;
}
uint8_t gray[2];
for (int i = 0; i < 2; i ++) {
@@ -883,7 +883,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
FXSYS_memset(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height);
for (int row = 0; row < m_Height; row ++) {
@@ -902,7 +902,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
}
case FXDIB_8bppRgb: {
if (m_pPalette == NULL) {
- return false;
+ return FALSE;
}
uint8_t gray[256];
for (int i = 0; i < 256; i ++) {
@@ -914,7 +914,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
@@ -931,7 +931,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* src_pos = m_pBuffer + row * m_Pitch;
@@ -949,7 +949,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* src_pos = m_pBuffer + row * m_Pitch;
@@ -964,19 +964,19 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
break;
}
default:
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::MultiplyAlpha(int alpha)
+FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
switch (GetFormat()) {
case FXDIB_1bppMask:
if (!ConvertFormat(FXDIB_8bppMask)) {
- return false;
+ return FALSE;
}
MultiplyAlpha(alpha);
break;
@@ -1004,18 +1004,18 @@ bool CFX_DIBitmap::MultiplyAlpha(int alpha)
m_pAlphaMask->MultiplyAlpha(alpha);
} else if (IsCmykImage()) {
if (!ConvertFormat((FXDIB_Format)(GetFormat() | 0x0200))) {
- return false;
+ return FALSE;
}
m_pAlphaMask->MultiplyAlpha(alpha);
} else {
if (!ConvertFormat(FXDIB_Argb)) {
- return false;
+ return FALSE;
}
MultiplyAlpha(alpha);
}
break;
}
- return true;
+ return TRUE;
}
FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const
{
@@ -1122,7 +1122,7 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
}
}
void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
{
if (m_pBuffer == NULL) {
return;
@@ -1179,15 +1179,15 @@ void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp
}
}
}
-bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
+FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
{
ASSERT(!IsAlphaMask());
if (m_pBuffer == NULL || IsAlphaMask()) {
- return false;
+ return FALSE;
}
int fc, fm, fy, fk, bc, bm, by, bk;
int fr, fg, fb, br, bg, bb;
- bool isCmykImage = IsCmykImage();
+ FX_BOOL isCmykImage = IsCmykImage();
if (isCmykImage) {
fc = FXSYS_GetCValue(forecolor);
fm = FXSYS_GetMValue(forecolor);
@@ -1208,10 +1208,10 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
if (m_bpp <= 8) {
if (isCmykImage) {
if (forecolor == 0xff && backcolor == 0 && m_pPalette == NULL) {
- return true;
+ return TRUE;
}
} else if (forecolor == 0 && backcolor == 0xffffff && m_pPalette == NULL) {
- return true;
+ return TRUE;
}
if (m_pPalette == NULL) {
BuildPalette();
@@ -1232,7 +1232,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
m_pPalette[i] = FXARGB_MAKE(0xff, br + (fr - br) * gray / 255, bg + (fg - bg) * gray / 255,
bb + (fb - bb) * gray / 255);
}
- return true;
+ return TRUE;
}
if (isCmykImage) {
if (forecolor == 0xff && backcolor == 0x00) {
@@ -1248,7 +1248,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
*scanline ++ = 255 - FXRGB2GRAY(r, g, b);
}
}
- return true;
+ return TRUE;
}
} else if (forecolor == 0 && backcolor == 0xffffff) {
for (int row = 0; row < m_Height; row ++) {
@@ -1262,7 +1262,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
scanline += gap;
}
}
- return true;
+ return TRUE;
}
if (isCmykImage) {
for (int row = 0; row < m_Height; row ++) {
@@ -1291,18 +1291,18 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
}
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect)
+FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) {
- return false;
+ return FALSE;
}
if (m_Width < 4 && m_Height < 4) {
- return false;
+ return FALSE;
}
FX_RECT rect(0, 0, m_Width, m_Height);
if (pRect) {
@@ -1374,9 +1374,9 @@ bool CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_REC
}
}
}
- return true;
+ return TRUE;
}
-CFX_DIBitmap* CFX_DIBSource::FlipImage(bool bXFlip, bool bYFlip) const
+CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const
{
CFX_DIBitmap* pFlipped = new CFX_DIBitmap;
if (!pFlipped->Create(m_Width, m_Height, GetFormat())) {
@@ -1480,7 +1480,7 @@ CFX_FilteredDIB::~CFX_FilteredDIB()
FX_Free(m_pScanline);
}
}
-void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, bool bAutoDropSrc)
+void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
{
m_pSrc = pSrc;
m_bAutoDropSrc = bAutoDropSrc;
@@ -1499,7 +1499,7 @@ const uint8_t* CFX_FilteredDIB::GetScanline(int line) const
return m_pScanline;
}
void CFX_FilteredDIB::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
{
m_pSrc->DownSampleScanline(line, dest_scan, dest_bpp, dest_width, bFlipX, clip_left, clip_width);
TranslateDownSamples(dest_scan, dest_scan, clip_width, dest_bpp);
@@ -1508,18 +1508,18 @@ CFX_ImageRenderer::CFX_ImageRenderer()
{
m_Status = 0;
m_pTransformer = NULL;
- m_bRgbByteOrder = false;
+ m_bRgbByteOrder = FALSE;
m_BlendType = FXDIB_BLEND_NORMAL;
}
CFX_ImageRenderer::~CFX_ImageRenderer()
{
delete m_pTransformer;
}
-extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, bool bFlipX, bool bFlipY);
-bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
+extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY);
+FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
const CFX_DIBSource* pSource, int bitmap_alpha,
FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix,
- FX_DWORD dib_flags, bool bRgbByteOrder,
+ FX_DWORD dib_flags, FX_BOOL bRgbByteOrder,
int alpha_flag, void* pIccTransform, int blend_type)
{
m_Matrix = *pMatrix;
@@ -1528,7 +1528,7 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
m_ClipBox = pClipRgn ? pClipRgn->GetBox() : FX_RECT(0, 0, pDevice->GetWidth(), pDevice->GetHeight());
m_ClipBox.Intersect(image_rect);
if (m_ClipBox.IsEmpty()) {
- return false;
+ return FALSE;
}
m_pDevice = pDevice;
m_pClipRgn = pClipRgn;
@@ -1540,7 +1540,7 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
m_pIccTransform = pIccTransform;
m_bRgbByteOrder = bRgbByteOrder;
m_BlendType = blend_type;
- bool ret = true;
+ FX_BOOL ret = TRUE;
if ((FXSYS_fabs(m_Matrix.b) >= 0.5f || m_Matrix.a == 0) ||
(FXSYS_fabs(m_Matrix.c) >= 0.5f || m_Matrix.d == 0) ) {
if (FXSYS_fabs(m_Matrix.a) < FXSYS_fabs(m_Matrix.b) / 20 && FXSYS_fabs(m_Matrix.d) < FXSYS_fabs(m_Matrix.c) / 20 &&
@@ -1550,18 +1550,18 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
FX_RECT bitmap_clip = m_ClipBox;
bitmap_clip.Offset(-image_rect.left, -image_rect.top);
bitmap_clip = _FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height, m_Matrix.c > 0, m_Matrix.b < 0);
- m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, true,
+ m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, TRUE,
m_Matrix.c > 0, m_Matrix.b < 0, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
if (!m_Stretcher.Start(&m_Composer, pSource, dest_height, dest_width, bitmap_clip, dib_flags)) {
- return false;
+ return FALSE;
}
m_Status = 1;
- return true;
+ return TRUE;
}
m_Status = 2;
m_pTransformer = new CFX_ImageTransformer;
m_pTransformer->Start(pSource, &m_Matrix, dib_flags, &m_ClipBox);
- return true;
+ return TRUE;
}
int dest_width = image_rect.Width();
if (m_Matrix.a < 0) {
@@ -1572,32 +1572,32 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
dest_height = -dest_height;
}
if (dest_width == 0 || dest_height == 0) {
- return false;
+ return FALSE;
}
FX_RECT bitmap_clip = m_ClipBox;
bitmap_clip.Offset(-image_rect.left, -image_rect.top);
m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color,
- m_ClipBox, false, false, false, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
+ m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
m_Status = 1;
ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitmap_clip, dib_flags);
return ret;
}
-bool CFX_ImageRenderer::Continue(IFX_Pause* pPause)
+FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause)
{
if (m_Status == 1) {
return m_Stretcher.Continue(pPause);
}
if (m_Status == 2) {
if (m_pTransformer->Continue(pPause)) {
- return true;
+ return TRUE;
}
CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
if (pBitmap->GetBuffer() == NULL) {
delete pBitmap;
- return false;
+ return FALSE;
}
if (pBitmap->IsAlphaMask()) {
if (m_BitmapAlpha != 255) {
@@ -1618,9 +1618,9 @@ bool CFX_ImageRenderer::Continue(IFX_Pause* pPause)
pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, 0, 0, m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_pIccTransform);
}
delete pBitmap;
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
CFX_BitmapStorer::CFX_BitmapStorer()
{
@@ -1653,16 +1653,16 @@ void CFX_BitmapStorer::ComposeScanline(int line, const uint8_t* scanline, const
FXSYS_memcpy(dest_alpha_buf, scan_extra_alpha, m_pBitmap->m_pAlphaMask->GetPitch());
}
}
-bool CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
+FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
{
m_pBitmap = new CFX_DIBitmap;
if (!m_pBitmap->Create(width, height, src_format)) {
delete m_pBitmap;
m_pBitmap = NULL;
- return false;
+ return FALSE;
}
if (pSrcPalette) {
m_pBitmap->CopyPalette(pSrcPalette);
}
- return true;
+ return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index 01bc167ede..e34e715bf2 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -54,7 +54,7 @@ public:
y1 /= base;
}
};
-CFX_DIBitmap* CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pDestClip) const
+CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pDestClip) const
{
FX_RECT dest_clip(0, 0, m_Height, m_Width);
if (pDestClip) {
@@ -148,7 +148,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pDe
return pTransBitmap;
}
#define FIX16_005 0.05f
-FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, bool bFlipX, bool bFlipY)
+FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY)
{
FX_RECT rect;
if (bFlipY) {
@@ -206,7 +206,7 @@ CFX_ImageTransformer::CFX_ImageTransformer()
CFX_ImageTransformer::~CFX_ImageTransformer()
{
}
-bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip)
+FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip)
{
m_pMatrix = (CFX_AffineMatrix*)pDestMatrix;
CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
@@ -216,7 +216,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
result_clip.Intersect(*pDestClip);
}
if (result_clip.IsEmpty()) {
- return false;
+ return FALSE;
}
m_ResultLeft = result_clip.left;
m_ResultTop = result_clip.top;
@@ -232,7 +232,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
result_clip = _FXDIB_SwapClipBox(result_clip, dest_width, dest_height, pDestMatrix->c > 0, pDestMatrix->b < 0);
m_Stretcher.Start(&m_Storer, pSrc, dest_height, dest_width, result_clip, flags);
m_Status = 1;
- return true;
+ return TRUE;
}
if (FXSYS_fabs(pDestMatrix->b) < FIX16_005 && FXSYS_fabs(pDestMatrix->c) < FIX16_005) {
int dest_width = pDestMatrix->a > 0 ? (int)FXSYS_ceil(pDestMatrix->a) : (int)FXSYS_floor(pDestMatrix->a);
@@ -240,7 +240,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
result_clip.Offset(-result_rect.left, -result_rect.top);
m_Stretcher.Start(&m_Storer, pSrc, dest_width, dest_height, result_clip, flags);
m_Status = 2;
- return true;
+ return TRUE;
}
int stretch_width = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->a, pDestMatrix->b));
int stretch_height = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->c, pDestMatrix->d));
@@ -254,7 +254,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
m_StretchClip.Intersect(0, 0, stretch_width, stretch_height);
m_Stretcher.Start(&m_Storer, pSrc, stretch_width, stretch_height, m_StretchClip, flags);
m_Status = 3;
- return true;
+ return TRUE;
}
uint8_t _bilinear_interpol(const uint8_t* buf, int row_offset_l, int row_offset_r,
int src_col_l, int src_col_r, int res_x, int res_y,
@@ -335,30 +335,30 @@ FXDIB_Format _GetTransformedFormat(const CFX_DIBSource* pDrc)
}
return format;
}
-bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
+FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
{
if (m_Status == 1) {
if (m_Stretcher.Continue(pPause)) {
- return true;
+ return TRUE;
}
if (m_Storer.GetBitmap()) {
m_Storer.Replace(m_Storer.GetBitmap()->SwapXY(m_pMatrix->c > 0, m_pMatrix->b < 0));
}
- return false;
+ return FALSE;
}
if (m_Status == 2) {
return m_Stretcher.Continue(pPause);
}
if (m_Status != 3) {
- return false;
+ return FALSE;
}
if (m_Stretcher.Continue(pPause)) {
- return true;
+ return TRUE;
}
int stretch_width = m_StretchClip.Width();
int stretch_height = m_StretchClip.Height();
if (m_Storer.GetBitmap() == NULL) {
- return false;
+ return FALSE;
}
const uint8_t* stretch_buf = m_Storer.GetBitmap()->GetBuffer();
const uint8_t* stretch_buf_mask = NULL;
@@ -370,7 +370,7 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
FXDIB_Format transformF = _GetTransformedFormat(m_Stretcher.m_pSource);
if (!pTransformed->Create(m_ResultWidth, m_ResultHeight, transformF)) {
delete pTransformed;
- return false;
+ return FALSE;
}
pTransformed->Clear(0);
if (pTransformed->m_pAlphaMask) {
@@ -641,7 +641,7 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
}
} else {
- bool bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
+ FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
int destBpp = pTransformed->GetBPP() / 8;
if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
@@ -786,5 +786,5 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
}
m_Storer.Replace(pTransformed);
- return false;
+ return FALSE;
}
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;
};
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.cpp b/core/src/fxge/skia/fx_skia_blitter_new.cpp
index 13bb753e45..3437eb497d 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.cpp
+++ b/core/src/fxge/skia/fx_skia_blitter_new.cpp
@@ -1298,7 +1298,7 @@
//--------------------------------------------------------------------
- bool CFX_SkiaRenderer::Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
+ FX_BOOL CFX_SkiaRenderer::Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
int alpha_flag, void* pIccTransform) //The alpha flag must be fill_flag if exist.
{
m_pDevice = pDevice;
@@ -1331,8 +1331,8 @@
m_bFullCover = bFullCover;
- bool bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
- bool bDeviceCMYK = pDevice->IsCmykImage();
+ FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bDeviceCMYK = pDevice->IsCmykImage();
m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
@@ -1377,7 +1377,7 @@
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&m_Color, 1);
} else { // Object RGB
if (!pIccTransform)
- return false;
+ return FALSE;
color = FXARGB_TODIB(color);
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&color, 1);
}
@@ -1385,7 +1385,7 @@
m_Green = ((uint8_t*)&m_Color)[1];
m_Blue = ((uint8_t*)&m_Color)[2];
m_Gray = ((uint8_t*)&m_Color)[3];
- return true;
+ return TRUE;
}
if (pIccTransform) {
color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
@@ -1496,8 +1496,8 @@
break;
}
if (composite_span == NULL)
- return false;
- return true;
+ return FALSE;
+ return TRUE;
}
/*----------------------------------------------------------------------------------------------------*/
@@ -1595,7 +1595,7 @@
blitV(x, y, height, rightAlpha);
}
- bool CFX_SkiaA8Renderer::Init(CFX_DIBitmap* pDevice, int Left, int Top)
+ FX_BOOL CFX_SkiaA8Renderer::Init(CFX_DIBitmap* pDevice, int Left, int Top)
{
m_pDevice = pDevice;
m_Left = Left;
@@ -1604,6 +1604,6 @@
m_dstWidth = m_Left + pDevice->GetWidth();
m_dstHeight = m_Top + pDevice->GetHeight();
}
- return true;
+ return TRUE;
}
#endif
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.h b/core/src/fxge/skia/fx_skia_blitter_new.h
index cd411da9f5..e60c6398d2 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.h
+++ b/core/src/fxge/skia/fx_skia_blitter_new.h
@@ -15,9 +15,9 @@ protected:
m_Blue, // Yellow
m_Gray; // Black
FX_DWORD m_Color; // FX_ARGB or FX_CMYK
- bool m_bFullCover;
+ FX_BOOL m_bFullCover;
int m_ProcessFilter;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bRgbByteOrder;
FX_RECT m_ClipBox;
CFX_DIBitmap* m_pDevice;
@@ -205,7 +205,7 @@ public:
//--------------------------------------------------------------------
- bool Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
+ FX_BOOL Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
int alpha_flag = 0, void* pIccTransform = NULL); //The alpha flag must be fill_flag if exist.
};
class CFX_SkiaA8Renderer : public SkBlitter
@@ -218,7 +218,7 @@ public:
virtual void blitRect(int x, int y, int width, int height);
virtual void blitAntiRect(int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha);
//--------------------------------------------------------------------
- bool Init(CFX_DIBitmap* pDevice, int Left, int Top);
+ FX_BOOL Init(CFX_DIBitmap* pDevice, int Left, int Top);
CFX_DIBitmap* m_pDevice;
int m_Left;
int m_Top;
diff --git a/core/src/fxge/skia/fx_skia_device.cpp b/core/src/fxge/skia/fx_skia_device.cpp
index 72478b1097..41ce077976 100644
--- a/core/src/fxge/skia/fx_skia_device.cpp
+++ b/core/src/fxge/skia/fx_skia_device.cpp
@@ -46,24 +46,24 @@ class SuperBlitter_skia
public:
static void DrawPath(const SkPath& srcPath, SkBlitter* blitter, const SkRasterClip& rect, const SkPaint& origPaint);
};
-bool FxSkDrawTreatAsHairline(const SkPaint& paint, SkScalar* coverage) {
+FX_BOOL FxSkDrawTreatAsHairline(const SkPaint& paint, SkScalar* coverage) {
if (SkPaint::kStroke_Style != paint.getStyle())
- return false;
+ return FALSE;
FXSYS_assert(coverage);
SkScalar strokeWidth = paint.getStrokeWidth();
if (0 == strokeWidth) {
*coverage = SK_Scalar1;
- return true;
+ return TRUE;
}
// if we get here, we need to try to fake a thick-stroke with a modulated
// hairline
if (!paint.isAntiAlias())
- return false;
+ return FALSE;
if (strokeWidth <= SK_Scalar1) {
*coverage = strokeWidth;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void SuperBlitter_skia::DrawPath(const SkPath& srcPath, SkBlitter* blitter, const SkRasterClip& rect, const SkPaint& origPaint)
@@ -167,7 +167,7 @@ void CSkia_PathData::BuildPath(const CFX_PathData* pPathData, const CFX_AffineMa
static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path_data,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState, FX_FIXFLOAT scale = FIX8_ONE,
- bool bStrokeAdjust = false, bool bTextMode = false)
+ FX_BOOL bStrokeAdjust = FALSE, FX_BOOL bTextMode = FALSE)
{
SkPaint::Cap cap;
switch (pGraphState->m_LineCap) {
@@ -203,7 +203,7 @@ static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path
stroker.setJoin(join);
stroker.setMiterLimit(pGraphState->m_MiterLimit);
stroker.setWidth(width);
- stroker.setDoFill(false);
+ stroker.setDoFill(FALSE);
stroker.strokePath(path_data, dstPathData);
SkMatrix smatrix;
smatrix.setAll(pObject2Device->a, pObject2Device->c, pObject2Device->e, pObject2Device->b, pObject2Device->d, pObject2Device->f, 0, 0, 1);
@@ -235,7 +235,7 @@ static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path
}
}
-CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
m_pAggDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
}
@@ -243,7 +243,7 @@ CFX_SkiaDeviceDriver::~CFX_SkiaDeviceDriver()
{
delete m_pAggDriver;
}
-bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FIXFLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
@@ -259,7 +259,7 @@ void CFX_SkiaDeviceDriver::SaveState()
m_pAggDriver->SaveState();
}
-void CFX_SkiaDeviceDriver::RestoreState(bool bKeepSaved)
+void CFX_SkiaDeviceDriver::RestoreState(FX_BOOL bKeepSaved)
{
m_pAggDriver->RestoreState(bKeepSaved);
}
@@ -294,7 +294,7 @@ void CFX_SkiaDeviceDriver::SetClipMask(SkPath& skPath, SkPaint* spaint)
m_pAggDriver->m_pClipRgn->IntersectMaskF(clip_box.fLeft, clip_box.fTop, mask);
}
-bool CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // path info
+FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
int fill_mode // fill mode, WINDING or ALTERNATE
)
@@ -308,7 +308,7 @@ bool CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // pa
rectf.Intersect(CFX_FloatRect(0, 0, (FX_FIXFLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), (FX_FIXFLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
FX_RECT rect = rectf.GetOutterRect();
m_pAggDriver->m_pClipRgn->IntersectRect(rect);
- return true;
+ return TRUE;
}
}
CSkia_PathData path_data;
@@ -318,15 +318,15 @@ bool CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // pa
SkPaint spaint;
spaint.setColor(0xffffffff);
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
spaint.setStyle(SkPaint::kFill_Style);
SetClipMask(path_data.m_PathData, &spaint);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, // path info
+FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState // graphic state, for pen attributes
)
@@ -342,36 +342,36 @@ bool CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, //
SkPaint spaint;
spaint.setColor(0xffffffff);
spaint.setStyle(SkPaint::kStroke_Style);
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
SkPath dst_path;
- SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, pObject2Device, pGraphState, 1, false, 0);
+ SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, pObject2Device, pGraphState, 1, FALSE, 0);
spaint.setStyle(SkPaint::kFill_Style);
SetClipMask(dst_path, &spaint);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+FX_BOOL CFX_SkiaDeviceDriver::RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->RenderRasterizer(rasterizer, color, bFullCover, bGroupKnockout,alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
- int alpha_flag, void* pIccTransform, bool bFill)
+FX_BOOL CFX_SkiaDeviceDriver::RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
+ int alpha_flag, void* pIccTransform, FX_BOOL bFill)
{
CFX_DIBitmap* pt = bGroupKnockout?m_pAggDriver->GetBackDrop():NULL;
CFX_SkiaRenderer render;
if (!render.Init(m_pAggDriver->m_pBitmap, pt, m_pAggDriver->m_pClipRgn, color, bFullCover, m_pAggDriver->m_bRgbByteOrder, alpha_flag, pIccTransform))
- return false;
+ return FALSE;
SkRasterClip rasterClip(rect);
SuperBlitter_skia::DrawPath(skPath, (SkBlitter*)&render, rasterClip, origPaint);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
+FX_BOOL CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState, // graphic state, for pen attributes
FX_DWORD fill_color, // fill color
@@ -381,7 +381,7 @@ bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
void* pIccTransform
)
{
- if (GetBuffer() == NULL) return true;
+ if (GetBuffer() == NULL) return TRUE;
FOXIT_DEBUG1("CFX_SkiaDeviceDriver::DrawPath: entering");
SkIRect rect;
rect.set(0, 0, GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
@@ -396,11 +396,11 @@ bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
path_data.m_PathData.setFillType((fill_mode&3) == FXFILL_WINDING? SkPath::kWinding_FillType:SkPath::kEvenOdd_FillType);
SkPaint spaint;
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
spaint.setStyle(SkPaint::kFill_Style);
spaint.setColor(fill_color);
- if (!RenderRasterizerSkia(path_data.m_PathData, spaint, rect, fill_color, fill_mode & FXFILL_FULLCOVER, false, alpha_flag, pIccTransform))
- return false;
+ if (!RenderRasterizerSkia(path_data.m_PathData, spaint, rect, fill_color, fill_mode & FXFILL_FULLCOVER, FALSE, alpha_flag, pIccTransform))
+ return FALSE;
}
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
@@ -427,48 +427,48 @@ bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
SkPaint spaint;
spaint.setColor(stroke_color);
spaint.setStyle(SkPaint::kStroke_Style);
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
SkPath dst_path;
- SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, false, 0);
+ SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, FALSE, 0);
spaint.setStyle(SkPaint::kFill_Style);
int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag)<<8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
- if (!RenderRasterizerSkia(dst_path, spaint, rect, stroke_color, fill_mode & FXFILL_FULLCOVER, false, fill_flag, pIccTransform, false))
- return false;
+ if (!RenderRasterizerSkia(dst_path, spaint, rect, stroke_color, fill_mode & FXFILL_FULLCOVER, FALSE, fill_flag, pIccTransform, FALSE))
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::SetPixel(int x, int y, FX_DWORD color,
+FX_BOOL CFX_SkiaDeviceDriver::SetPixel(int x, int y, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->SetPixel(x, y, color, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect)
+FX_BOOL CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect)
{
return m_pAggDriver->GetClipBox(pRect);
}
-bool CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge)
+FX_BOOL CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
{
return m_pAggDriver->GetDIBits(pBitmap, left, top, pIccTransform, bDEdge);
}
-bool CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->SetDIBits(pBitmap, argb, pSrcRect, left, top, blend_type, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
+FX_BOOL CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -477,7 +477,7 @@ bool CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD
alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
+FX_BOOL CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform)
{
@@ -485,7 +485,7 @@ bool CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_
pMatrix, render_flags, handle, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
+FX_BOOL CFX_SkiaDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
{
return m_pAggDriver->ContinueDIBits(pHandle, pPause);
}
@@ -497,31 +497,31 @@ void CFX_SkiaDeviceDriver::CancelDIBits(void* pHandle)
CFX_SkiaDevice::CFX_SkiaDevice()
{
- m_bOwnedBitmap = false;
+ m_bOwnedBitmap = FALSE;
}
-bool CFX_SkiaDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+FX_BOOL CFX_SkiaDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
if (pBitmap == NULL)
- return false;
+ return FALSE;
SetBitmap(pBitmap);
CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
+FX_BOOL CFX_SkiaDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
{
- m_bOwnedBitmap = true;
+ m_bOwnedBitmap = TRUE;
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
- return false;
+ return FALSE;
}
SetBitmap(pBitmap);
- CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, false, pOriDevice, false);
+ CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
CFX_SkiaDevice::~CFX_SkiaDevice()
{
diff --git a/core/src/fxge/skia/fx_skia_device.h b/core/src/fxge/skia/fx_skia_device.h
index 7278671dc7..ab51e51a33 100644
--- a/core/src/fxge/skia/fx_skia_device.h
+++ b/core/src/fxge/skia/fx_skia_device.h
@@ -9,7 +9,7 @@
class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver
{
public:
- CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout);
+ CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout);
virtual ~CFX_SkiaDeviceDriver();
/** Options */
@@ -17,22 +17,22 @@ public:
/** Save and restore all graphic states */
virtual void SaveState();
- virtual void RestoreState(bool bKeepSaved);
+ virtual void RestoreState(FX_BOOL bKeepSaved);
/** Set clipping path using filled region */
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData, // path info
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
int fill_mode // fill mode, WINDING or ALTERNATE
);
/** Set clipping path using stroked region */
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, // path info
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState // graphic state, for pen attributes
);
/** Draw a path */
- 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,
@@ -42,44 +42,44 @@ public:
void* pIccTransform = NULL
);
- virtual bool SetPixel(int x, int y, FX_DWORD color,
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
int alpha_flag = 0, void* pIccTransform = NULL);
/** Draw a single pixel (device dependant) line */
- virtual bool DrawCosmeticLine(FX_FIXFLOAT x1, FX_FIXFLOAT y1, FX_FIXFLOAT x2, FX_FIXFLOAT y2, FX_DWORD color,
- int alpha_flag, void* pIccTransform, int blend_type) { return false; }
+ virtual FX_BOOL DrawCosmeticLine(FX_FIXFLOAT x1, FX_FIXFLOAT y1, FX_FIXFLOAT x2, FX_FIXFLOAT y2, FX_DWORD color,
+ int alpha_flag, void* pIccTransform, int blend_type) { return FALSE; }
- virtual bool GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
/** Load device buffer into a DIB */
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
virtual CFX_DIBitmap* GetBackDrop() { return m_pAggDriver->GetBackDrop(); }
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
int dest_left, int dest_top, int blend_type,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual 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 = 0, void* pIccTransform = NULL);
- 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 flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause);
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
virtual void CancelDIBits(void* handle);
- 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_FIXFLOAT font_size, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+ virtual FX_BOOL RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform);
- virtual bool RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
- int alpha_flag, void* pIccTransform, bool bFill = true);
+ virtual FX_BOOL RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
+ int alpha_flag, void* pIccTransform, FX_BOOL bFill = TRUE);
void SetClipMask(rasterizer_scanline_aa& rasterizer);
void SetClipMask(SkPath& skPath, SkPaint* spaint);
virtual uint8_t* GetBuffer() const {return m_pAggDriver->GetBuffer();}
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;